@gnist/design-system 2.0.12 → 2.0.14
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 +8 -0
- package/dist/components/actions/buttons/IconButton.d.ts +2 -0
- package/dist/components/actions/buttons/IconButton.d.ts.map +1 -1
- package/dist/components/surfaces/cards/ActionCard.cjs +3 -3
- package/dist/components/surfaces/cards/ActionCard.js +3 -3
- package/dist/components/surfaces/cards/CheckboxCard.cjs +5 -2
- package/dist/components/surfaces/cards/CheckboxCard.d.ts.map +1 -1
- package/dist/components/surfaces/cards/CheckboxCard.js +3 -2
- package/dist/components/surfaces/cards/InfoCard.cjs +2 -2
- package/dist/components/surfaces/cards/InfoCard.js +2 -2
- package/dist/components/surfaces/cards/LinkCard.cjs +2 -2
- package/dist/components/surfaces/cards/LinkCard.js +2 -2
- package/dist/components/surfaces/cards/RadioCard.cjs +5 -2
- package/dist/components/surfaces/cards/RadioCard.d.ts.map +1 -1
- package/dist/components/surfaces/cards/RadioCard.js +3 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## <small>2.0.14 (2025-02-20)</small>
|
|
7
|
+
|
|
8
|
+
* fix: pass classname prop for card components ([3fbfa17](https://github.com/mollerdigital/design-system-design-system/commit/3fbfa17))
|
|
9
|
+
|
|
10
|
+
## <small>2.0.13 (2025-02-17)</small>
|
|
11
|
+
|
|
12
|
+
* feat: add docs for loading prop for buttons ([268e827](https://github.com/mollerdigital/design-system-design-system/commit/268e827))
|
|
13
|
+
|
|
6
14
|
## <small>2.0.12 (2025-02-14)</small>
|
|
7
15
|
|
|
8
16
|
* chore: upgrade storybook to 8.5 ([a07105d](https://github.com/mollerdigital/design-system-design-system/commit/a07105d))
|
|
@@ -22,6 +22,8 @@ type IconButtonProps<AsElement extends ElementType> = PolymorphicProps<AsElement
|
|
|
22
22
|
/**
|
|
23
23
|
An icon button is a button which displays only an icon with or without a label. Icon buttons allow users to take actions, and make choices, with a single tap. Because the background is transparent, the icon and label color is inherited from ancestors to acommodate use on different background colors.
|
|
24
24
|
|
|
25
|
+
Note: Unlike most button components, `disabled`, `loading` and `density` props don't exist for IconButton.
|
|
26
|
+
|
|
25
27
|
Documentation: [IconButton](https://gnist.moller.no/developers/components/latest/?path=/docs/components-actions-buttons-iconbutton--docs)
|
|
26
28
|
*/
|
|
27
29
|
export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<IconButtonProps<ElementType>, "ref"> & import("react").RefAttributes<Element>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/buttons/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,wDAAoE;AAG3F,OAAO,EAAE,WAAW,EAA2C,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAQ,MAAM,0CAA0C,CAAC;AAI9E,KAAK,eAAe,CAAC,SAAS,SAAS,WAAW,IAC9C,gBAAgB,CAAC,SAAS,CAAC,GAAG;IAC1B;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACtC,mHAAmH;IACnH,eAAe,CAAC,EAAE,YAAY,CAAC;CAClC,CAAC;AAEN
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/buttons/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,wDAAoE;AAG3F,OAAO,EAAE,WAAW,EAA2C,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAQ,MAAM,0CAA0C,CAAC;AAI9E,KAAK,eAAe,CAAC,SAAS,SAAS,WAAW,IAC9C,gBAAgB,CAAC,SAAS,CAAC,GAAG;IAC1B;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACtC,mHAAmH;IACnH,eAAe,CAAC,EAAE,YAAY,CAAC;CAClC,CAAC;AAEN;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,+HA8CrB,CAAC"}
|
|
@@ -10,13 +10,13 @@ const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in
|
|
|
10
10
|
const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
|
|
11
11
|
const ActionCard = React.forwardRef(function ActionCard2({ $as, as, children, isLoading, density, ...props }, ref) {
|
|
12
12
|
const cardProps = {
|
|
13
|
-
...props,
|
|
14
13
|
ref,
|
|
15
|
-
|
|
14
|
+
...props,
|
|
15
|
+
className: classNames__default.default(cards_css.cardsRecipe({
|
|
16
16
|
type: "action",
|
|
17
17
|
isLoading,
|
|
18
18
|
density
|
|
19
|
-
}))
|
|
19
|
+
}), props.className)
|
|
20
20
|
};
|
|
21
21
|
return React.createElement($as ?? as ?? "button", cardProps, jsxRuntime.jsx(jsxRuntime.Fragment, { children: isLoading ? jsxRuntime.jsx(SharedComponents.LoadingSkeleton, {}) : children }));
|
|
22
22
|
});
|
|
@@ -6,13 +6,13 @@ import { cardsRecipe } from "./cards.css.js";
|
|
|
6
6
|
import { LoadingSkeleton } from "./SharedComponents.js";
|
|
7
7
|
const ActionCard = forwardRef(function ActionCard2({ $as, as, children, isLoading, density, ...props }, ref) {
|
|
8
8
|
const cardProps = {
|
|
9
|
-
...props,
|
|
10
9
|
ref,
|
|
11
|
-
|
|
10
|
+
...props,
|
|
11
|
+
className: classNames(cardsRecipe({
|
|
12
12
|
type: "action",
|
|
13
13
|
isLoading,
|
|
14
14
|
density
|
|
15
|
-
}))
|
|
15
|
+
}), props.className)
|
|
16
16
|
};
|
|
17
17
|
return createElement($as ?? as ?? "button", cardProps, jsx(Fragment, { children: isLoading ? jsx(LoadingSkeleton, {}) : children }));
|
|
18
18
|
});
|
|
@@ -7,10 +7,13 @@ const SelectionCard = require("./internal/SelectionCard.cjs");
|
|
|
7
7
|
const InfoCard = require("./InfoCard.cjs");
|
|
8
8
|
const checkboxCard_css = require("./checkboxCard.css.cjs");
|
|
9
9
|
const React = require("react");
|
|
10
|
+
const classNames = require("classnames");
|
|
11
|
+
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
12
|
+
const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
|
|
10
13
|
const CheckboxCard = React.forwardRef(function CheckboxCard2({ label, description, value, id, onChange, children, isLoading, validity, checkboxProps, cardStyle, ...props }, ref) {
|
|
11
|
-
return jsxRuntime.jsx(InfoCard.InfoCard, { ref, className: checkboxCard_css.StyledCardRecipe({
|
|
14
|
+
return jsxRuntime.jsx(InfoCard.InfoCard, { ref, ...props, className: classNames__default.default(checkboxCard_css.StyledCardRecipe({
|
|
12
15
|
disabled: props.disabled,
|
|
13
16
|
cardStyle: cardStyle ?? "elevation"
|
|
14
|
-
}),
|
|
17
|
+
}), props.className), children: isLoading ? jsxRuntime.jsx(SelectionCard.SelectionCardLoader, { type: "checkbox", density: props.density }) : jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Checkbox.Checkbox, { label, value, onChange, validity, id, disabled: props.disabled, ...checkboxProps }), jsxRuntime.jsx(SelectionCard.SelectionCardContent, { description, value, density: props.density, children })] }) });
|
|
15
18
|
});
|
|
16
19
|
exports.CheckboxCard = CheckboxCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxCard.d.ts","sourceRoot":"","sources":["../../../../src/components/surfaces/cards/CheckboxCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,aAAa,EAChB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACH,yBAAyB,EAGzB,kBAAkB,EACrB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckboxCard.d.ts","sourceRoot":"","sources":["../../../../src/components/surfaces/cards/CheckboxCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,aAAa,EAChB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACH,yBAAyB,EAGzB,kBAAkB,EACrB,MAAM,6BAA6B,CAAC;AAMrC,UAAU,iBAAkB,SAAQ,kBAAkB;IAClD;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACpC;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;CAC1D;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,yBAAyB,CACtD,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAwDtE,CAAC"}
|
|
@@ -5,11 +5,12 @@ import { SelectionCardLoader, SelectionCardContent } from "./internal/SelectionC
|
|
|
5
5
|
import { InfoCard } from "./InfoCard.js";
|
|
6
6
|
import { StyledCardRecipe } from "./checkboxCard.css.js";
|
|
7
7
|
import { forwardRef } from "react";
|
|
8
|
+
import classNames from "classnames";
|
|
8
9
|
const CheckboxCard = forwardRef(function CheckboxCard2({ label, description, value, id, onChange, children, isLoading, validity, checkboxProps, cardStyle, ...props }, ref) {
|
|
9
|
-
return jsx(InfoCard, { ref, className: StyledCardRecipe({
|
|
10
|
+
return jsx(InfoCard, { ref, ...props, className: classNames(StyledCardRecipe({
|
|
10
11
|
disabled: props.disabled,
|
|
11
12
|
cardStyle: cardStyle ?? "elevation"
|
|
12
|
-
}),
|
|
13
|
+
}), props.className), children: isLoading ? jsx(SelectionCardLoader, { type: "checkbox", density: props.density }) : jsxs(Fragment, { children: [jsx(Checkbox, { label, value, onChange, validity, id, disabled: props.disabled, ...checkboxProps }), jsx(SelectionCardContent, { description, value, density: props.density, children })] }) });
|
|
13
14
|
});
|
|
14
15
|
export {
|
|
15
16
|
CheckboxCard
|
|
@@ -9,11 +9,11 @@ const SharedComponents = require("./SharedComponents.cjs");
|
|
|
9
9
|
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
10
10
|
const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
|
|
11
11
|
const InfoCard = React.forwardRef(function InfoCard2({ isLoading, transparent, density, ...props }, ref) {
|
|
12
|
-
return jsxRuntime.jsx("div", { ref, ...props, className: classNames__default.default(
|
|
12
|
+
return jsxRuntime.jsx("div", { ref, ...props, className: classNames__default.default(cards_css.cardsRecipe({
|
|
13
13
|
type: "info",
|
|
14
14
|
isLoading,
|
|
15
15
|
transparent,
|
|
16
16
|
density
|
|
17
|
-
})), children: isLoading ? jsxRuntime.jsx(SharedComponents.LoadingSkeleton, {}) : props.children });
|
|
17
|
+
}), props.className), children: isLoading ? jsxRuntime.jsx(SharedComponents.LoadingSkeleton, {}) : props.children });
|
|
18
18
|
});
|
|
19
19
|
exports.InfoCard = InfoCard;
|
|
@@ -5,12 +5,12 @@ import { forwardRef } from "react";
|
|
|
5
5
|
import { cardsRecipe } from "./cards.css.js";
|
|
6
6
|
import { LoadingSkeleton } from "./SharedComponents.js";
|
|
7
7
|
const InfoCard = forwardRef(function InfoCard2({ isLoading, transparent, density, ...props }, ref) {
|
|
8
|
-
return jsx("div", { ref, ...props, className: classNames(
|
|
8
|
+
return jsx("div", { ref, ...props, className: classNames(cardsRecipe({
|
|
9
9
|
type: "info",
|
|
10
10
|
isLoading,
|
|
11
11
|
transparent,
|
|
12
12
|
density
|
|
13
|
-
})), children: isLoading ? jsx(LoadingSkeleton, {}) : props.children });
|
|
13
|
+
}), props.className), children: isLoading ? jsx(LoadingSkeleton, {}) : props.children });
|
|
14
14
|
});
|
|
15
15
|
export {
|
|
16
16
|
InfoCard
|
|
@@ -12,11 +12,11 @@ const LinkCard = React.forwardRef(function LinkCard2({ $as, as, children, isLoad
|
|
|
12
12
|
const cardProps = {
|
|
13
13
|
...props,
|
|
14
14
|
ref,
|
|
15
|
-
className: classNames__default.default(
|
|
15
|
+
className: classNames__default.default(cards_css.cardsRecipe({
|
|
16
16
|
type: "link",
|
|
17
17
|
isLoading,
|
|
18
18
|
density
|
|
19
|
-
}))
|
|
19
|
+
}), props.className)
|
|
20
20
|
};
|
|
21
21
|
return React.createElement($as ?? as ?? "a", cardProps, jsxRuntime.jsx(jsxRuntime.Fragment, { children: isLoading ? jsxRuntime.jsx(SharedComponents.LoadingSkeleton, {}) : children }));
|
|
22
22
|
});
|
|
@@ -8,11 +8,11 @@ const LinkCard = forwardRef(function LinkCard2({ $as, as, children, isLoading, d
|
|
|
8
8
|
const cardProps = {
|
|
9
9
|
...props,
|
|
10
10
|
ref,
|
|
11
|
-
className: classNames(
|
|
11
|
+
className: classNames(cardsRecipe({
|
|
12
12
|
type: "link",
|
|
13
13
|
isLoading,
|
|
14
14
|
density
|
|
15
|
-
}))
|
|
15
|
+
}), props.className)
|
|
16
16
|
};
|
|
17
17
|
return createElement($as ?? as ?? "a", cardProps, jsx(Fragment, { children: isLoading ? jsx(LoadingSkeleton, {}) : children }));
|
|
18
18
|
});
|
|
@@ -7,10 +7,13 @@ const SelectionCard = require("./internal/SelectionCard.cjs");
|
|
|
7
7
|
const InfoCard = require("./InfoCard.cjs");
|
|
8
8
|
const React = require("react");
|
|
9
9
|
const checkboxCard_css = require("./checkboxCard.css.cjs");
|
|
10
|
+
const classNames = require("classnames");
|
|
11
|
+
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
12
|
+
const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
|
|
10
13
|
const RadioCard = React.forwardRef(function RadioCard2({ label, description, value, id, name, onChange, children, isLoading, validity, cardStyle, ...props }, ref) {
|
|
11
|
-
return jsxRuntime.jsx(InfoCard.InfoCard, { ...props,
|
|
14
|
+
return jsxRuntime.jsx(InfoCard.InfoCard, { ref, ...props, className: classNames__default.default(checkboxCard_css.StyledCardRecipe({
|
|
12
15
|
disabled: props.disabled,
|
|
13
16
|
cardStyle: cardStyle ?? "elevation"
|
|
14
|
-
}), children: isLoading ? jsxRuntime.jsx(SelectionCard.SelectionCardLoader, { type: "radio", density: props.density }) : jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(RadioButton.RadioButton, { label, value, onChange, disabled: props.disabled, validity, id, name }), jsxRuntime.jsx(SelectionCard.SelectionCardContent, { description, value, density: props.density, children })] }) });
|
|
17
|
+
}), props.className), children: isLoading ? jsxRuntime.jsx(SelectionCard.SelectionCardLoader, { type: "radio", density: props.density }) : jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(RadioButton.RadioButton, { label, value, onChange, disabled: props.disabled, validity, id, name }), jsxRuntime.jsx(SelectionCard.SelectionCardContent, { description, value, density: props.density, children })] }) });
|
|
15
18
|
});
|
|
16
19
|
exports.RadioCard = RadioCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCard.d.ts","sourceRoot":"","sources":["../../../../src/components/surfaces/cards/RadioCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,gBAAgB,EACnB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACH,yBAAyB,EAGzB,kBAAkB,EACrB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioCard.d.ts","sourceRoot":"","sources":["../../../../src/components/surfaces/cards/RadioCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,gBAAgB,EACnB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACH,yBAAyB,EAGzB,kBAAkB,EACrB,MAAM,6BAA6B,CAAC;AAMrC,UAAU,cAAe,SAAQ,kBAAkB;IAC/C;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACvC;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC/B;;OAEG;IACH,UAAU,CAAC,EAAE,yBAAyB,CAAC;CAC1C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,yBAAyB,CACnD,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAqDnE,CAAC"}
|
|
@@ -5,11 +5,12 @@ import { SelectionCardLoader, SelectionCardContent } from "./internal/SelectionC
|
|
|
5
5
|
import { InfoCard } from "./InfoCard.js";
|
|
6
6
|
import { forwardRef } from "react";
|
|
7
7
|
import { StyledCardRecipe } from "./checkboxCard.css.js";
|
|
8
|
+
import classNames from "classnames";
|
|
8
9
|
const RadioCard = forwardRef(function RadioCard2({ label, description, value, id, name, onChange, children, isLoading, validity, cardStyle, ...props }, ref) {
|
|
9
|
-
return jsx(InfoCard, { ...props,
|
|
10
|
+
return jsx(InfoCard, { ref, ...props, className: classNames(StyledCardRecipe({
|
|
10
11
|
disabled: props.disabled,
|
|
11
12
|
cardStyle: cardStyle ?? "elevation"
|
|
12
|
-
}), children: isLoading ? jsx(SelectionCardLoader, { type: "radio", density: props.density }) : jsxs(Fragment, { children: [jsx(RadioButton, { label, value, onChange, disabled: props.disabled, validity, id, name }), jsx(SelectionCardContent, { description, value, density: props.density, children })] }) });
|
|
13
|
+
}), props.className), children: isLoading ? jsx(SelectionCardLoader, { type: "radio", density: props.density }) : jsxs(Fragment, { children: [jsx(RadioButton, { label, value, onChange, disabled: props.disabled, validity, id, name }), jsx(SelectionCardContent, { description, value, density: props.density, children })] }) });
|
|
13
14
|
});
|
|
14
15
|
export {
|
|
15
16
|
RadioCard
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gnist/design-system",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"optional": true
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "a64d01c99899cab0ce5db11deab339f79d27872d"
|
|
117
117
|
}
|