@gnist/design-system 3.5.6 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/components/feedback/alerts/AlertBanner.cjs +1 -1
- package/dist/components/feedback/alerts/AlertBanner.d.ts +3 -2
- package/dist/components/feedback/alerts/AlertBanner.d.ts.map +1 -1
- package/dist/components/feedback/alerts/AlertBanner.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.6.0](https://github.com/mollerdigital/design-system-design-system/compare/@gnist/design-system@3.5.6...@gnist/design-system@3.6.0) (2025-07-07)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* AlertBanner message-prop allows React Node ([c911154](https://github.com/mollerdigital/design-system-design-system/commit/c911154f4a3c2b8bea410bf963a9c4b14943a508))
|
|
11
|
+
|
|
6
12
|
## [3.5.6](https://github.com/mollerdigital/design-system-design-system/compare/@gnist/design-system@3.5.5...@gnist/design-system@3.5.6) (2025-07-04)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
@@ -23,6 +23,6 @@ const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
|
|
|
23
23
|
const BannerHeading = componentUtils.component("BannerHeading", AlertBanner_css.bannerHeading, "h2");
|
|
24
24
|
const AlertBanner = ({ type, heading, message, dismiss, action, density = "default", headingLevel = "h2", className }) => {
|
|
25
25
|
const text = index.useTranslation((t) => t.components.feedback.alerts);
|
|
26
|
-
return jsxRuntime.jsxs("div", { className: classNames__default.default(className, AlertBanner_css.banner({ type, density })), children: [jsxRuntime.jsx(Icon.Icon, { type, icon: type, className: AlertBanner_css.icon({ type }) }), jsxRuntime.jsxs("div", { className: AlertBanner_css.mainContentContainer({ density }), children: [heading && jsxRuntime.jsx(BannerHeading, { "$as": headingLevel, children: heading }), dismiss && jsxRuntime.jsx(IconButton.IconButton, { className: AlertBanner_css.closeButton, icon: "close", label: text.dismissLabel, onClick: dismiss }), jsxRuntime.jsx(index$1.TextContainer, { className: AlertBanner_css.messageContainer, children: message }), action && jsxRuntime.jsx(TextButton.TextButton, { density: "compact", className: AlertBanner_css.actionButton, onClick: action.onClick, underline: true, children: action.label })] })] });
|
|
26
|
+
return jsxRuntime.jsxs("div", { className: classNames__default.default(className, AlertBanner_css.banner({ type, density })), children: [jsxRuntime.jsx(Icon.Icon, { type, icon: type, className: AlertBanner_css.icon({ type }) }), jsxRuntime.jsxs("div", { className: AlertBanner_css.mainContentContainer({ density }), children: [heading && jsxRuntime.jsx(BannerHeading, { "$as": headingLevel, children: heading }), dismiss && jsxRuntime.jsx(IconButton.IconButton, { className: AlertBanner_css.closeButton, icon: "close", label: text.dismissLabel, onClick: dismiss }), typeof message === "string" ? jsxRuntime.jsx(index$1.TextContainer, { className: AlertBanner_css.messageContainer, children: message }) : jsxRuntime.jsx("div", { className: AlertBanner_css.messageContainer, children: message }), action && jsxRuntime.jsx(TextButton.TextButton, { density: "compact", className: AlertBanner_css.actionButton, onClick: action.onClick, underline: true, children: action.label })] })] });
|
|
27
27
|
};
|
|
28
28
|
exports.AlertBanner = AlertBanner;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { DensitySizes } from "../../../foundation/typography";
|
|
2
|
+
import { ReactNode } from "react";
|
|
2
3
|
export interface AlertBannerProps {
|
|
3
4
|
type: "info" | "success" | "warning" | "error";
|
|
4
5
|
heading?: string | undefined;
|
|
5
|
-
message:
|
|
6
|
+
message: ReactNode;
|
|
6
7
|
dismiss?: () => void;
|
|
7
8
|
action?: {
|
|
8
9
|
label: string;
|
|
@@ -14,7 +15,7 @@ export interface AlertBannerProps {
|
|
|
14
15
|
}
|
|
15
16
|
/** An alert banner displays an important and high-signal message, and provides actions for users to address (or dismiss the banner). They’re meant to be noticed and often requires a user action to be dismissed.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
Message is required for all alert banners. The message should be concise and, if applicable, describe the next step that a user can take. The message prop can be string or other React Node.
|
|
18
19
|
|
|
19
20
|
Title and button with a contextual action are optional.
|
|
20
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/alerts/AlertBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,YAAY,EAEf,uCAAmD;
|
|
1
|
+
{"version":3,"file":"AlertBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/alerts/AlertBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,YAAY,EAEf,uCAAmD;AAapD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC/C,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACvB,CAAC;IACF,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAID;;;;;;;GAOG;AAEH,eAAO,MAAM,WAAW,mFASrB,gBAAgB,4CAuClB,CAAC"}
|
|
@@ -19,7 +19,7 @@ import { bannerHeading, icon, mainContentContainer, closeButton, messageContaine
|
|
|
19
19
|
const BannerHeading = component("BannerHeading", bannerHeading, "h2");
|
|
20
20
|
const AlertBanner = ({ type, heading, message, dismiss, action, density = "default", headingLevel = "h2", className }) => {
|
|
21
21
|
const text = useTranslation((t) => t.components.feedback.alerts);
|
|
22
|
-
return jsxs("div", { className: classNames(className, banner({ type, density })), children: [jsx(Icon, { type, icon: type, className: icon({ type }) }), jsxs("div", { className: mainContentContainer({ density }), children: [heading && jsx(BannerHeading, { "$as": headingLevel, children: heading }), dismiss && jsx(IconButton, { className: closeButton, icon: "close", label: text.dismissLabel, onClick: dismiss }), jsx(TextContainer, { className: messageContainer, children: message }), action && jsx(TextButton, { density: "compact", className: actionButton, onClick: action.onClick, underline: true, children: action.label })] })] });
|
|
22
|
+
return jsxs("div", { className: classNames(className, banner({ type, density })), children: [jsx(Icon, { type, icon: type, className: icon({ type }) }), jsxs("div", { className: mainContentContainer({ density }), children: [heading && jsx(BannerHeading, { "$as": headingLevel, children: heading }), dismiss && jsx(IconButton, { className: closeButton, icon: "close", label: text.dismissLabel, onClick: dismiss }), typeof message === "string" ? jsx(TextContainer, { className: messageContainer, children: message }) : jsx("div", { className: messageContainer, children: message }), action && jsx(TextButton, { density: "compact", className: actionButton, onClick: action.onClick, underline: true, children: action.label })] })] });
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
25
25
|
AlertBanner
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gnist/design-system",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"optional": true
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "13550fb6429db09a62cbcdeb9dad1cb142bc0f49"
|
|
106
106
|
}
|