UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

42 lines 1.8 kB
var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import React, { forwardRef } from "react"; import { useRenameCSS } from "../theme/Theme.js"; import { typoClassNames } from "./util.js"; /** * Part of a set of components for displaying text with consistent typography. * * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/typography) * @see 🏷️ {@link BodyShortProps} * @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support * * @example * ```jsx * <BodyShort> * Du må gjøre en filtrering for å se brukere i listen. * </BodyShort> * ``` */ export const BodyShort = forwardRef((_a, ref) => { var { className, size = "medium", as: Component = "p", spacing, truncate, weight = "regular", align, visuallyHidden, textColor } = _a, rest = __rest(_a, ["className", "size", "as", "spacing", "truncate", "weight", "align", "visuallyHidden", "textColor"]); const { cn } = useRenameCSS(); return (React.createElement(Component, Object.assign({}, rest, { ref: ref, className: cn(className, "navds-body-short", `navds-body-short--${size}`, typoClassNames({ spacing, truncate, weight, align, visuallyHidden, textColor, })) }))); }); export default BodyShort; //# sourceMappingURL=BodyShort.js.map