UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

42 lines 1.95 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 { BaseAlert } from "../../base-alert/index.js"; import { GlobalAlertCloseButton, } from "../close-button/GlobalAlertCloseButton.js"; import { GlobalAlertContent, } from "../content/GlobalAlertContent.js"; import { GlobalAlertHeader, } from "../header/GlobalAlertHeader.js"; import { GlobalAlertTitle, } from "../title/GlobalAlertTitle.js"; /** * A component for displaying alerts about your app. * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/globalalert) * @see 🏷️ {@link GlobalAlertProps} * @example * ```jsx * <GlobalAlert status="error"> * <GlobalAlert.Header> * <GlobalAlert.Title>Alert title</GlobalAlert.Title> * </GlobalAlert.Header> * <GlobalAlert.Content>Content</GlobalAlert.Content> * </GlobalAlert> * ``` */ export const GlobalAlert = forwardRef((_a, forwardedRef) => { var { centered = true } = _a, rest = __rest(_a, ["centered"]); return (React.createElement(BaseAlert.Root, Object.assign({ ref: forwardedRef, role: "alert" }, rest, { type: "strong", global: true, "data-centered": centered }))); }); GlobalAlert.Header = GlobalAlertHeader; GlobalAlert.Title = GlobalAlertTitle; GlobalAlert.Content = GlobalAlertContent; GlobalAlert.CloseButton = GlobalAlertCloseButton; export default GlobalAlert; export { GlobalAlertCloseButton, GlobalAlertContent, GlobalAlertHeader, GlobalAlertTitle, }; //# sourceMappingURL=GlobalAlertRoot.js.map