@navikt/ds-react
Version:
React components from the Norwegian Labour and Welfare Administration.
30 lines • 1.37 kB
JavaScript
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((props, forwardedRef) => {
return (React.createElement(BaseAlert.Root, Object.assign({ ref: forwardedRef, role: "alert" }, props, { type: "strong", global: true })));
});
GlobalAlert.Header = GlobalAlertHeader;
GlobalAlert.Title = GlobalAlertTitle;
GlobalAlert.Content = GlobalAlertContent;
GlobalAlert.CloseButton = GlobalAlertCloseButton;
export default GlobalAlert;
export { GlobalAlertCloseButton, GlobalAlertContent, GlobalAlertHeader, GlobalAlertTitle, };
//# sourceMappingURL=GlobalAlertRoot.js.map