UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

57 lines 2.38 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 FormSummaryAnswer from "./FormSummaryAnswer.js"; import FormSummaryAnswers from "./FormSummaryAnswers.js"; import FormSummaryEditLink from "./FormSummaryEditLink.js"; import FormSummaryFooter from "./FormSummaryFooter.js"; import FormSummaryHeader from "./FormSummaryHeader.js"; import FormSummaryHeading from "./FormSummaryHeading.js"; import FormSummaryLabel from "./FormSummaryLabel.js"; import FormSummaryValue from "./FormSummaryValue.js"; /** * A summary of a previously answered form. * * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/formsummary) * * @example * <FormSummary> * <FormSummary.Header> * <FormSummary.Heading level="2">HeadingTekst</FormSummary.Heading> * </FormSummary.Header> * <FormSummary.Answers> * <FormSummary.Answer> * <FormSummary.Label>Navn</FormSummary.Label> * <FormSummary.Value>Ola Nordmann</FormSummary.Value> * </FormSummary.Answer> * </FormSummary.Answers> * <FormSummary.Footer> * <FormSummary.EditLink href="#" /> * </FormSummary.Footer> * </FormSummary> */ export const FormSummary = forwardRef((_a, ref) => { var { children, className } = _a, rest = __rest(_a, ["children", "className"]); const { cn } = useRenameCSS(); return (React.createElement("div", Object.assign({ ref: ref }, rest, { className: cn("navds-form-summary", className) }), children)); }); FormSummary.Header = FormSummaryHeader; FormSummary.Heading = FormSummaryHeading; FormSummary.EditLink = FormSummaryEditLink; FormSummary.Answers = FormSummaryAnswers; FormSummary.Answer = FormSummaryAnswer; FormSummary.Label = FormSummaryLabel; FormSummary.Value = FormSummaryValue; FormSummary.Footer = FormSummaryFooter; export default FormSummary; //# sourceMappingURL=FormSummary.js.map