@navikt/ds-react
Version:
React components from the Norwegian Labour and Welfare Administration.
40 lines • 1.81 kB
JavaScript
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 { InfoCardContent, } from "../content/InfoCardContent.js";
import { InfoCardHeader, } from "../header/InfoCardHeader.js";
import { InfoCardTitle } from "../title/InfoCardTitle.js";
/**
* A component for displaying informational content in a card format.
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/infocard)
* @see 🏷️ {@link InfoCardProps}
* @example
* ```jsx
* <InfoCard data-color="info">
* <InfoCard.Header icon={<InformationSquareIcon aria-hidden />}>
* <InfoCard.Title>Info title</InfoCard.Title>
* </InfoCard.Header>
* <InfoCard.Content>Content</InfoCard.Content>
* </InfoCard>
* ```
*/
export const InfoCard = forwardRef((_a, forwardedRef) => {
var { "data-color": dataColor = "info", as = "div" } = _a, restProps = __rest(_a, ["data-color", "as"]);
return (React.createElement(BaseAlert.Root, Object.assign({ ref: forwardedRef, "data-color": dataColor }, restProps, { type: "moderate", global: false, as: as })));
});
InfoCard.Header = InfoCardHeader;
InfoCard.Title = InfoCardTitle;
InfoCard.Content = InfoCardContent;
export default InfoCard;
export { InfoCardContent, InfoCardHeader, InfoCardTitle };
//# sourceMappingURL=InfoCardRoot.js.map