@gnist/design-system 3.12.4 → 4.0.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 +25 -0
- package/dist/components/actions/index.cjs +2 -0
- package/dist/components/actions/index.js +2 -0
- package/dist/components/actions/selectionControls/RadioButton.cjs +4 -3
- package/dist/components/actions/selectionControls/RadioButton.d.ts +5 -2
- package/dist/components/actions/selectionControls/RadioButton.d.ts.map +1 -1
- package/dist/components/actions/selectionControls/RadioButton.js +4 -3
- package/dist/components/actions/selectionControls/RadioButtonGroup.cjs +12 -0
- package/dist/components/actions/selectionControls/RadioButtonGroup.d.ts +31 -0
- package/dist/components/actions/selectionControls/RadioButtonGroup.d.ts.map +1 -0
- package/dist/components/actions/selectionControls/RadioButtonGroup.js +10 -0
- package/dist/components/actions/selectionControls/index.cjs +2 -0
- package/dist/components/actions/selectionControls/index.d.ts +1 -0
- package/dist/components/actions/selectionControls/index.d.ts.map +1 -1
- package/dist/components/actions/selectionControls/index.js +2 -0
- package/dist/components/actions/selectionControls/radiobutton.css.d.ts.map +1 -1
- package/dist/components/actions/selectionControls/radiobuttongroup.css.cjs +21 -0
- package/dist/components/actions/selectionControls/radiobuttongroup.css.d.ts +3 -0
- package/dist/components/actions/selectionControls/radiobuttongroup.css.d.ts.map +1 -0
- package/dist/components/actions/selectionControls/radiobuttongroup.css.js +21 -0
- package/dist/components/index.cjs +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/inputs/dropdowns/SelectBase.cjs +1 -0
- package/dist/components/inputs/dropdowns/SelectBase.js +1 -0
- package/dist/components/inputs/pickers/calendar.cjs +1 -0
- package/dist/components/inputs/pickers/calendar.js +1 -0
- package/dist/components/surfaces/cards/CheckboxCard.d.ts +1 -1
- package/dist/components/surfaces/cards/CheckboxCard.d.ts.map +1 -1
- package/dist/components/surfaces/cards/RadioCard.d.ts +1 -1
- package/dist/components/surfaces/cards/RadioCard.d.ts.map +1 -1
- package/dist/components/surfaces/cards/internal/SelectionCard.d.ts +2 -2
- package/dist/components/surfaces/cards/internal/SelectionCard.d.ts.map +1 -1
- package/dist/components/surfaces/modal/Modal.cjs +1 -0
- package/dist/components/surfaces/modal/Modal.js +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
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
|
+
## [4.0.0](https://github.com/mollerdigital/design-system-design-system/compare/@gnist/design-system@3.12.4...@gnist/design-system@4.0.0) (2025-09-26)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* RadioButton value prop changed from boolean to string. Added RadioButtonGroup component for proper grouping.
|
|
11
|
+
|
|
12
|
+
- RadioButton.value: boolean → string
|
|
13
|
+
- RadioButton now requires name prop for grouping
|
|
14
|
+
- Added RadioButtonGroup component for accessibility
|
|
15
|
+
- SelectionCardProps<TVal> now supports generic types
|
|
16
|
+
- Updated all stories and examples
|
|
17
|
+
|
|
18
|
+
Migration:
|
|
19
|
+
// Before
|
|
20
|
+
<RadioButton value={true} onChange={...} />
|
|
21
|
+
|
|
22
|
+
// After
|
|
23
|
+
<RadioButtonGroup name="group">
|
|
24
|
+
<RadioButton value="option1" checked={selected === "option1"} onChange={...} />
|
|
25
|
+
</RadioButtonGroup>
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* change RadioButton and RadioCard value from boolean to string, add RadioButtonGroup ([03521b4](https://github.com/mollerdigital/design-system-design-system/commit/03521b4c0c0d3b9ea7f7d55994ff34b1f644de35))
|
|
30
|
+
|
|
6
31
|
## [3.12.4](https://github.com/mollerdigital/design-system-design-system/compare/@gnist/design-system@3.12.3...@gnist/design-system@3.12.4) (2025-09-19)
|
|
7
32
|
|
|
8
33
|
### Bug Fixes
|
|
@@ -11,6 +11,7 @@ const IconButton = require("./buttons/IconButton.cjs");
|
|
|
11
11
|
const Checkbox = require("./selectionControls/Checkbox.cjs");
|
|
12
12
|
const RadioButton = require("./selectionControls/RadioButton.cjs");
|
|
13
13
|
const Switch = require("./selectionControls/Switch.cjs");
|
|
14
|
+
const RadioButtonGroup = require("./selectionControls/RadioButtonGroup.cjs");
|
|
14
15
|
const ActionChip = require("./chips/ActionChip.cjs");
|
|
15
16
|
const FilterChip = require("./chips/FilterChip.cjs");
|
|
16
17
|
const TagChip = require("./chips/TagChip.cjs");
|
|
@@ -24,6 +25,7 @@ exports.IconButton = IconButton.IconButton;
|
|
|
24
25
|
exports.Checkbox = Checkbox.Checkbox;
|
|
25
26
|
exports.RadioButton = RadioButton.RadioButton;
|
|
26
27
|
exports.Switch = Switch.Switch;
|
|
28
|
+
exports.RadioButtonGroup = RadioButtonGroup.RadioButtonGroup;
|
|
27
29
|
exports.ActionChip = ActionChip.ActionChip;
|
|
28
30
|
exports.FilterChip = FilterChip.FilterChip;
|
|
29
31
|
exports.TagChip = TagChip.TagChip;
|
|
@@ -9,6 +9,7 @@ import { IconButton } from "./buttons/IconButton.js";
|
|
|
9
9
|
import { Checkbox } from "./selectionControls/Checkbox.js";
|
|
10
10
|
import { RadioButton } from "./selectionControls/RadioButton.js";
|
|
11
11
|
import { Switch } from "./selectionControls/Switch.js";
|
|
12
|
+
import { RadioButtonGroup } from "./selectionControls/RadioButtonGroup.js";
|
|
12
13
|
import { ActionChip } from "./chips/ActionChip.js";
|
|
13
14
|
import { FilterChip } from "./chips/FilterChip.js";
|
|
14
15
|
import { TagChip } from "./chips/TagChip.js";
|
|
@@ -21,6 +22,7 @@ export {
|
|
|
21
22
|
IconButton,
|
|
22
23
|
PrimaryButton,
|
|
23
24
|
RadioButton,
|
|
25
|
+
RadioButtonGroup,
|
|
24
26
|
SecondaryButton,
|
|
25
27
|
SuccessButton,
|
|
26
28
|
Switch,
|
|
@@ -12,12 +12,12 @@ const shared_css = require("./shared.css.cjs");
|
|
|
12
12
|
const shared = require("./shared.cjs");
|
|
13
13
|
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
14
14
|
const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
|
|
15
|
-
const CustomRadioButton = ({
|
|
15
|
+
const CustomRadioButton = ({ isChecked, disabled, validity }) => {
|
|
16
16
|
return jsxRuntime.jsx("span", { className: radiobutton_css.RadioButtonRecipe({
|
|
17
17
|
disabled,
|
|
18
18
|
validity: validity?.type
|
|
19
19
|
}), "aria-hidden": true, children: jsxRuntime.jsx("span", { className: radiobutton_css.CheckedCircleRecipe({
|
|
20
|
-
checked:
|
|
20
|
+
checked: isChecked,
|
|
21
21
|
disabled,
|
|
22
22
|
validity: validity?.type
|
|
23
23
|
}) }) });
|
|
@@ -36,6 +36,7 @@ function RadioButton({
|
|
|
36
36
|
className,
|
|
37
37
|
render = defaultRender,
|
|
38
38
|
ref,
|
|
39
|
+
checked,
|
|
39
40
|
// Input element props
|
|
40
41
|
...rest
|
|
41
42
|
}) {
|
|
@@ -47,7 +48,7 @@ function RadioButton({
|
|
|
47
48
|
validity,
|
|
48
49
|
reserveSpaceForMessage: canShowErrorMessage
|
|
49
50
|
});
|
|
50
|
-
const radioButtonElement = jsxRuntime.jsx("span", { className: classNames__default.default(shared_css.InputWrapper, className), ref, children: jsxRuntime.jsxs("label", { htmlFor: inputId, className: shared_css.LabelRecipe({ disabled }), id: labelId, children: [jsxRuntime.jsx("input", { type: "radio", id: inputId, disabled, onChange, checked:
|
|
51
|
+
const radioButtonElement = jsxRuntime.jsx("span", { className: classNames__default.default(shared_css.InputWrapper, className), ref, children: jsxRuntime.jsxs("label", { htmlFor: inputId, className: shared_css.LabelRecipe({ disabled }), id: labelId, children: [jsxRuntime.jsx("input", { type: "radio", id: inputId, disabled, onChange, value, checked: checked ?? false, className: shared_css.InputStyleRecipe({ disabled }), tabIndex: 0, ...inputAriaProps, ...rest }), jsxRuntime.jsx(CustomRadioButton, { isChecked: checked ?? false, disabled, validity }), hideLabel ? jsxRuntime.jsx(ScreenReaderOnly.ScreenReaderOnly, { children: label }) : jsxRuntime.jsx("span", { className: shared_css.LabelStyle, children: label })] }) });
|
|
51
52
|
const descriptionElement = description ? jsxRuntime.jsx(shared.SelectionDescription, { disabled, children: description }) : void 0;
|
|
52
53
|
return jsxRuntime.jsx(shared.HelperTextWrapper, { ...helperTextProps, children: render && render(radioButtonElement, descriptionElement) });
|
|
53
54
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Ref } from "react";
|
|
2
2
|
import { SelectionControlProps } from "./shared.js";
|
|
3
|
-
export type RadioButtonProps = SelectionControlProps<
|
|
3
|
+
export type RadioButtonProps = SelectionControlProps<string> & {
|
|
4
4
|
ref?: Ref<HTMLSpanElement>;
|
|
5
|
+
checked?: boolean;
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
8
|
* Radio buttons allow users to select one option from a list. Use radio buttons when the user needs to see all available options. If available options can be collapsed, consider using a dropdown menu because it uses less space.
|
|
8
9
|
*
|
|
10
|
+
* Radio buttons should be wrapped in a RadioButtonGroup component to ensure proper accessibility and functionality.
|
|
11
|
+
*
|
|
9
12
|
* Radio buttons should be used instead of checkboxes if only one item can be selected from a list.
|
|
10
13
|
|
|
11
14
|
Documentation: [RadioButton](https://gnist.moller.no/developers/components/latest/?path=/docs/components-actions-selectioncontrols-radiobutton--docs)
|
|
12
15
|
**/
|
|
13
|
-
export declare function RadioButton({ value, onChange, disabled, validity, label, description, id, hideLabel, canShowErrorMessage, className, render, ref, ...rest }: RadioButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function RadioButton({ value, onChange, disabled, validity, label, description, id, hideLabel, canShowErrorMessage, className, render, ref, checked, ...rest }: RadioButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
//# sourceMappingURL=RadioButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/RadioButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAS5B,OAAO,EAEH,qBAAqB,EAExB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,
|
|
1
|
+
{"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/RadioButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAS5B,OAAO,EAEH,qBAAqB,EAExB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,MAAM,CAAC,GAAG;IAC3D,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AA2CF;;;;;;;;GAQG;AAEH,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,WAAW,EACX,EAA6B,EAC7B,SAAiB,EACjB,mBAA2B,EAC3B,SAAS,EACT,MAAsB,EACtB,GAAG,EACH,OAAO,EAEP,GAAG,IAAI,EACV,EAAE,gBAAgB,2CAsDlB"}
|
|
@@ -8,12 +8,12 @@ import classNames from "classnames";
|
|
|
8
8
|
import { RadioButtonRecipe, CheckedCircleRecipe } from "./radiobutton.css.js";
|
|
9
9
|
import { LabelRecipe, InputStyleRecipe, LabelStyle, InputWrapper, indentedDescriptionStyle } from "./shared.css.js";
|
|
10
10
|
import { SelectionDescription, HelperTextWrapper } from "./shared.js";
|
|
11
|
-
const CustomRadioButton = ({
|
|
11
|
+
const CustomRadioButton = ({ isChecked, disabled, validity }) => {
|
|
12
12
|
return jsx("span", { className: RadioButtonRecipe({
|
|
13
13
|
disabled,
|
|
14
14
|
validity: validity?.type
|
|
15
15
|
}), "aria-hidden": true, children: jsx("span", { className: CheckedCircleRecipe({
|
|
16
|
-
checked:
|
|
16
|
+
checked: isChecked,
|
|
17
17
|
disabled,
|
|
18
18
|
validity: validity?.type
|
|
19
19
|
}) }) });
|
|
@@ -32,6 +32,7 @@ function RadioButton({
|
|
|
32
32
|
className,
|
|
33
33
|
render = defaultRender,
|
|
34
34
|
ref,
|
|
35
|
+
checked,
|
|
35
36
|
// Input element props
|
|
36
37
|
...rest
|
|
37
38
|
}) {
|
|
@@ -43,7 +44,7 @@ function RadioButton({
|
|
|
43
44
|
validity,
|
|
44
45
|
reserveSpaceForMessage: canShowErrorMessage
|
|
45
46
|
});
|
|
46
|
-
const radioButtonElement = jsx("span", { className: classNames(InputWrapper, className), ref, children: jsxs("label", { htmlFor: inputId, className: LabelRecipe({ disabled }), id: labelId, children: [jsx("input", { type: "radio", id: inputId, disabled, onChange, checked:
|
|
47
|
+
const radioButtonElement = jsx("span", { className: classNames(InputWrapper, className), ref, children: jsxs("label", { htmlFor: inputId, className: LabelRecipe({ disabled }), id: labelId, children: [jsx("input", { type: "radio", id: inputId, disabled, onChange, value, checked: checked ?? false, className: InputStyleRecipe({ disabled }), tabIndex: 0, ...inputAriaProps, ...rest }), jsx(CustomRadioButton, { isChecked: checked ?? false, disabled, validity }), hideLabel ? jsx(ScreenReaderOnly, { children: label }) : jsx("span", { className: LabelStyle, children: label })] }) });
|
|
47
48
|
const descriptionElement = description ? jsx(SelectionDescription, { disabled, children: description }) : void 0;
|
|
48
49
|
return jsx(HelperTextWrapper, { ...helperTextProps, children: render && render(radioButtonElement, descriptionElement) });
|
|
49
50
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const classNames = require("classnames");
|
|
6
|
+
const radiobuttongroup_css = require("./radiobuttongroup.css.cjs");
|
|
7
|
+
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
8
|
+
const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
|
|
9
|
+
function RadioButtonGroup({ className, label, children, ref, ...props }) {
|
|
10
|
+
return jsxRuntime.jsxs("fieldset", { className: classNames__default.default(radiobuttongroup_css.fieldSetStyle, className), ref, ...props, children: [jsxRuntime.jsx("legend", { className: radiobuttongroup_css.legendStyle, children: label }), children] });
|
|
11
|
+
}
|
|
12
|
+
exports.RadioButtonGroup = RadioButtonGroup;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface Props extends React.HTMLAttributes<HTMLFieldSetElement> {
|
|
2
|
+
label: string;
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
ref?: React.Ref<HTMLFieldSetElement>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Radio group to wrap RadioButton.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```jsx
|
|
12
|
+
* <RadioGroup
|
|
13
|
+
* label="What option?"
|
|
14
|
+
* >
|
|
15
|
+
* <RadioButton label="Option 1" name="option1" />
|
|
16
|
+
* <RadioButton label="Option 2" name="option2" />
|
|
17
|
+
* </RadioGroup>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param children - RadioButtons.
|
|
21
|
+
* @param label - Label of group.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Radio button groups gives a label for a group of radio buttons.
|
|
25
|
+
*
|
|
26
|
+
|
|
27
|
+
Documentation: [RadioButtonGroup](https://gnist.moller.no/developers/components/latest/?path=/docs/components-actions-selectioncontrols-radiobuttongroup--docs)
|
|
28
|
+
**/
|
|
29
|
+
export declare function RadioButtonGroup({ className, label, children, ref, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=RadioButtonGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButtonGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/RadioButtonGroup.tsx"],"names":[],"mappings":"AAGA,UAAU,KAAM,SAAQ,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;CACxC;AAED;;;;;;;;;;;;;;;GAeG;AAEH;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC7B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACX,EAAE,KAAK,2CAWP"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { legendStyle, fieldSetStyle } from "./radiobuttongroup.css.js";
|
|
5
|
+
function RadioButtonGroup({ className, label, children, ref, ...props }) {
|
|
6
|
+
return jsxs("fieldset", { className: classNames(fieldSetStyle, className), ref, ...props, children: [jsx("legend", { className: legendStyle, children: label }), children] });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
RadioButtonGroup
|
|
10
|
+
};
|
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const Checkbox = require("./Checkbox.cjs");
|
|
5
5
|
const RadioButton = require("./RadioButton.cjs");
|
|
6
6
|
const Switch = require("./Switch.cjs");
|
|
7
|
+
const RadioButtonGroup = require("./RadioButtonGroup.cjs");
|
|
7
8
|
exports.Checkbox = Checkbox.Checkbox;
|
|
8
9
|
exports.RadioButton = RadioButton.RadioButton;
|
|
9
10
|
exports.Switch = Switch.Switch;
|
|
11
|
+
exports.RadioButtonGroup = RadioButtonGroup.RadioButtonGroup;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Checkbox, type CheckboxProps } from "./Checkbox.js";
|
|
2
2
|
export { RadioButton, type RadioButtonProps } from "./RadioButton.js";
|
|
3
3
|
export { Switch, type SwitchProps } from "./Switch.js";
|
|
4
|
+
export { RadioButtonGroup } from "./RadioButtonGroup.js";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
import { Checkbox } from "./Checkbox.js";
|
|
3
3
|
import { RadioButton } from "./RadioButton.js";
|
|
4
4
|
import { Switch } from "./Switch.js";
|
|
5
|
+
import { RadioButtonGroup } from "./RadioButtonGroup.js";
|
|
5
6
|
export {
|
|
6
7
|
Checkbox,
|
|
7
8
|
RadioButton,
|
|
9
|
+
RadioButtonGroup,
|
|
8
10
|
Switch
|
|
9
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radiobutton.css.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/radiobutton.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radiobutton.css.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/radiobutton.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;EAwC5B,CAAC;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;EA8D9B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const atoms_css_js = require("@gnist/themes/atoms.css.js");
|
|
5
|
+
const css = require("@vanilla-extract/css");
|
|
6
|
+
const fieldSetStyle = css.style([
|
|
7
|
+
{
|
|
8
|
+
border: "none"
|
|
9
|
+
},
|
|
10
|
+
atoms_css_js.atoms({
|
|
11
|
+
padding: "none",
|
|
12
|
+
display: "flex",
|
|
13
|
+
flexDirection: "column",
|
|
14
|
+
gap: "base"
|
|
15
|
+
})
|
|
16
|
+
]);
|
|
17
|
+
const legendStyle = atoms_css_js.atoms({
|
|
18
|
+
marginBottom: "base"
|
|
19
|
+
});
|
|
20
|
+
exports.fieldSetStyle = fieldSetStyle;
|
|
21
|
+
exports.legendStyle = legendStyle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radiobuttongroup.css.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/radiobuttongroup.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,QAUxB,CAAC;AAEH,eAAO,MAAM,WAAW,QAEtB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { atoms } from "@gnist/themes/atoms.css.js";
|
|
3
|
+
import { style } from "@vanilla-extract/css";
|
|
4
|
+
const fieldSetStyle = style([
|
|
5
|
+
{
|
|
6
|
+
border: "none"
|
|
7
|
+
},
|
|
8
|
+
atoms({
|
|
9
|
+
padding: "none",
|
|
10
|
+
display: "flex",
|
|
11
|
+
flexDirection: "column",
|
|
12
|
+
gap: "base"
|
|
13
|
+
})
|
|
14
|
+
]);
|
|
15
|
+
const legendStyle = atoms({
|
|
16
|
+
marginBottom: "base"
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
fieldSetStyle,
|
|
20
|
+
legendStyle
|
|
21
|
+
};
|
|
@@ -11,6 +11,7 @@ const IconButton = require("./actions/buttons/IconButton.cjs");
|
|
|
11
11
|
const Checkbox = require("./actions/selectionControls/Checkbox.cjs");
|
|
12
12
|
const RadioButton = require("./actions/selectionControls/RadioButton.cjs");
|
|
13
13
|
const Switch = require("./actions/selectionControls/Switch.cjs");
|
|
14
|
+
const RadioButtonGroup = require("./actions/selectionControls/RadioButtonGroup.cjs");
|
|
14
15
|
const ActionChip = require("./actions/chips/ActionChip.cjs");
|
|
15
16
|
const FilterChip = require("./actions/chips/FilterChip.cjs");
|
|
16
17
|
const TagChip = require("./actions/chips/TagChip.cjs");
|
|
@@ -41,6 +42,7 @@ exports.IconButton = IconButton.IconButton;
|
|
|
41
42
|
exports.Checkbox = Checkbox.Checkbox;
|
|
42
43
|
exports.RadioButton = RadioButton.RadioButton;
|
|
43
44
|
exports.Switch = Switch.Switch;
|
|
45
|
+
exports.RadioButtonGroup = RadioButtonGroup.RadioButtonGroup;
|
|
44
46
|
exports.ActionChip = ActionChip.ActionChip;
|
|
45
47
|
exports.FilterChip = FilterChip.FilterChip;
|
|
46
48
|
exports.TagChip = TagChip.TagChip;
|
package/dist/components/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { IconButton } from "./actions/buttons/IconButton.js";
|
|
|
9
9
|
import { Checkbox } from "./actions/selectionControls/Checkbox.js";
|
|
10
10
|
import { RadioButton } from "./actions/selectionControls/RadioButton.js";
|
|
11
11
|
import { Switch } from "./actions/selectionControls/Switch.js";
|
|
12
|
+
import { RadioButtonGroup } from "./actions/selectionControls/RadioButtonGroup.js";
|
|
12
13
|
import { ActionChip } from "./actions/chips/ActionChip.js";
|
|
13
14
|
import { FilterChip } from "./actions/chips/FilterChip.js";
|
|
14
15
|
import { TagChip } from "./actions/chips/TagChip.js";
|
|
@@ -51,6 +52,7 @@ export {
|
|
|
51
52
|
ProgressBar,
|
|
52
53
|
ProgressBarComponent,
|
|
53
54
|
RadioButton,
|
|
55
|
+
RadioButtonGroup,
|
|
54
56
|
RadioCard,
|
|
55
57
|
SecondaryButton,
|
|
56
58
|
SingleSelect,
|
|
@@ -32,6 +32,7 @@ require("../../actions/selectionControls/radiobutton.css.cjs");
|
|
|
32
32
|
require("../../actions/selectionControls/shared.css.cjs");
|
|
33
33
|
require("../../../utilities/layout/Column.cjs");
|
|
34
34
|
require("../../actions/selectionControls/switch.css.cjs");
|
|
35
|
+
require("../../actions/selectionControls/radiobuttongroup.css.cjs");
|
|
35
36
|
require("../../../styles/animations.css.cjs");
|
|
36
37
|
require("../../actions/chips/styles.css.cjs");
|
|
37
38
|
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
@@ -31,6 +31,7 @@ import "../../actions/selectionControls/radiobutton.css.js";
|
|
|
31
31
|
import "../../actions/selectionControls/shared.css.js";
|
|
32
32
|
import "../../../utilities/layout/Column.js";
|
|
33
33
|
import "../../actions/selectionControls/switch.css.js";
|
|
34
|
+
import "../../actions/selectionControls/radiobuttongroup.css.js";
|
|
34
35
|
import "../../../styles/animations.css.js";
|
|
35
36
|
import "../../actions/chips/styles.css.js";
|
|
36
37
|
function SelectBase(props, isMultiple) {
|
|
@@ -33,6 +33,7 @@ require("../../actions/selectionControls/shared.css.cjs");
|
|
|
33
33
|
require("../../../utilities/layout/Column.cjs");
|
|
34
34
|
require("../../actions/selectionControls/radiobutton.css.cjs");
|
|
35
35
|
require("../../actions/selectionControls/switch.css.cjs");
|
|
36
|
+
require("../../actions/selectionControls/radiobuttongroup.css.cjs");
|
|
36
37
|
require("../../../styles/animations.css.cjs");
|
|
37
38
|
require("../../actions/chips/styles.css.cjs");
|
|
38
39
|
const Calendar_css = require("./Calendar.css.cjs");
|
|
@@ -31,6 +31,7 @@ import "../../actions/selectionControls/shared.css.js";
|
|
|
31
31
|
import "../../../utilities/layout/Column.js";
|
|
32
32
|
import "../../actions/selectionControls/radiobutton.css.js";
|
|
33
33
|
import "../../actions/selectionControls/switch.css.js";
|
|
34
|
+
import "../../actions/selectionControls/radiobuttongroup.css.js";
|
|
34
35
|
import "../../../styles/animations.css.js";
|
|
35
36
|
import "../../actions/chips/styles.css.js";
|
|
36
37
|
import { headerCell, containerStyle, selectMonthRow, buttonRow, arrowButton, gridStyle, rowStyle, cellSkeletonStyle, firstDay, cellRecipe } from "./Calendar.css.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CheckboxProps } from "../../actions/selectionControls/Checkbox.js";
|
|
2
2
|
import { HtmlSelectionControlProps, SelectionCardProps } from "./internal/SelectionCard.js";
|
|
3
|
-
interface CheckboxCardProps extends SelectionCardProps {
|
|
3
|
+
interface CheckboxCardProps extends SelectionCardProps<boolean> {
|
|
4
4
|
/**
|
|
5
5
|
* Change handler function
|
|
6
6
|
*/
|
|
@@ -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;AAKrC,UAAU,iBAAkB,SAAQ,kBAAkB;
|
|
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;AAKrC,UAAU,iBAAkB,SAAQ,kBAAkB,CAAC,OAAO,CAAC;IAC3D;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACpC;;OAEG;IACH,aAAa,CAAC,EAAE,yBAAyB,CAAC;CAC7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,EACzB,KAAK,EACL,WAAW,EACX,KAAK,EACL,EAAE,EACF,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,aAAa,EACb,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACX,EAAE,iBAAiB,2CAwCnB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RadioButtonProps } from "../../actions/selectionControls/RadioButton.js";
|
|
2
2
|
import { HtmlSelectionControlProps, SelectionCardProps } from "./internal/SelectionCard.js";
|
|
3
|
-
interface RadioCardProps extends SelectionCardProps {
|
|
3
|
+
interface RadioCardProps extends SelectionCardProps<string> {
|
|
4
4
|
/**
|
|
5
5
|
* Change handler function
|
|
6
6
|
*/
|
|
@@ -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;AAKrC,UAAU,cAAe,SAAQ,kBAAkB;
|
|
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;AAKrC,UAAU,cAAe,SAAQ,kBAAkB,CAAC,MAAM,CAAC;IACvD;;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,wBAAgB,SAAS,CAAC,EACtB,KAAK,EACL,WAAW,EACX,KAAK,EACL,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACX,EAAE,cAAc,2CAqChB"}
|
|
@@ -13,12 +13,12 @@ export interface BaseSelectionCardProps {
|
|
|
13
13
|
*/
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
}
|
|
16
|
-
export interface SelectionCardProps extends BaseSelectionCardProps, CardBaseProps<"div">, CardStyleProps, CommonInputProps<
|
|
16
|
+
export interface SelectionCardProps<TVal> extends BaseSelectionCardProps, CardBaseProps<"div">, CardStyleProps, CommonInputProps<TVal>, Validity<{
|
|
17
17
|
errorMsgRequired: false;
|
|
18
18
|
}> {
|
|
19
19
|
}
|
|
20
20
|
export declare const SelectionCardLoader: ({ type, density, }: {
|
|
21
21
|
type: "checkbox" | "radio";
|
|
22
22
|
} & DensityTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export declare const SelectionCardContent: ({ description, value, density, children, }: Pick<SelectionCardProps
|
|
23
|
+
export declare const SelectionCardContent: <TVal>({ description, value, density, children, }: Pick<SelectionCardProps<TVal>, "description" | "value" | "density" | "children">) => import("react/jsx-runtime").JSX.Element | null;
|
|
24
24
|
//# sourceMappingURL=SelectionCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/surfaces/cards/internal/SelectionCard.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,gBAAgB,EAChB,QAAQ,EACX,6CAAoE;AACrE,OAAO,EAAE,gBAAgB,EAAE,+BAAwC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAOhD,MAAM,WAAW,cAAc;IAC3B,SAAS,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CACvC;AAED,MAAM,MAAM,yBAAyB,GAAG,IAAI,CACxC,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,EACjC,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,IAAI,CAC5D,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACnC,+EAA+E;IAC/E,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"SelectionCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/surfaces/cards/internal/SelectionCard.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,gBAAgB,EAChB,QAAQ,EACX,6CAAoE;AACrE,OAAO,EAAE,gBAAgB,EAAE,+BAAwC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAOhD,MAAM,WAAW,cAAc;IAC3B,SAAS,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CACvC;AAED,MAAM,MAAM,yBAAyB,GAAG,IAAI,CACxC,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,EACjC,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,IAAI,CAC5D,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACnC,+EAA+E;IAC/E,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAkB,CAAC,IAAI,CACpC,SAAQ,sBAAsB,EAC1B,aAAa,CAAC,KAAK,CAAC,EACpB,cAAc,EACd,gBAAgB,CAAC,IAAI,CAAC,EACtB,QAAQ,CAAC;IAAE,gBAAgB,EAAE,KAAK,CAAA;CAAE,CAAC;CAAG;AAEhD,eAAO,MAAM,mBAAmB,uBAG7B;IAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAA;CAAE,GAAG,gBAAgB,4CAcnD,CAAC;AAIF,eAAO,MAAM,oBAAoB,GAAI,IAAI,8CAKtC,IAAI,CACH,kBAAkB,CAAC,IAAI,CAAC,EACxB,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,CACnD,mDAiBA,CAAC"}
|
|
@@ -27,6 +27,7 @@ require("../../../utilities/layout/Column.cjs");
|
|
|
27
27
|
require("../../../utilities/layout/Row.cjs");
|
|
28
28
|
require("../../actions/selectionControls/radiobutton.css.cjs");
|
|
29
29
|
require("../../actions/selectionControls/switch.css.cjs");
|
|
30
|
+
require("../../actions/selectionControls/radiobuttongroup.css.cjs");
|
|
30
31
|
require("../../../styles/animations.css.cjs");
|
|
31
32
|
require("../../actions/chips/styles.css.cjs");
|
|
32
33
|
const index = require("../../../translations/index.cjs");
|
|
@@ -25,6 +25,7 @@ import "../../../utilities/layout/Column.js";
|
|
|
25
25
|
import "../../../utilities/layout/Row.js";
|
|
26
26
|
import "../../actions/selectionControls/radiobutton.css.js";
|
|
27
27
|
import "../../actions/selectionControls/switch.css.js";
|
|
28
|
+
import "../../actions/selectionControls/radiobuttongroup.css.js";
|
|
28
29
|
import "../../../styles/animations.css.js";
|
|
29
30
|
import "../../actions/chips/styles.css.js";
|
|
30
31
|
import { useTranslation } from "../../../translations/index.js";
|
package/dist/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ const IconButton = require("./components/actions/buttons/IconButton.cjs");
|
|
|
12
12
|
const Checkbox = require("./components/actions/selectionControls/Checkbox.cjs");
|
|
13
13
|
const RadioButton = require("./components/actions/selectionControls/RadioButton.cjs");
|
|
14
14
|
const Switch = require("./components/actions/selectionControls/Switch.cjs");
|
|
15
|
+
const RadioButtonGroup = require("./components/actions/selectionControls/RadioButtonGroup.cjs");
|
|
15
16
|
const ActionChip = require("./components/actions/chips/ActionChip.cjs");
|
|
16
17
|
const FilterChip = require("./components/actions/chips/FilterChip.cjs");
|
|
17
18
|
const TagChip = require("./components/actions/chips/TagChip.cjs");
|
|
@@ -62,6 +63,7 @@ exports.IconButton = IconButton.IconButton;
|
|
|
62
63
|
exports.Checkbox = Checkbox.Checkbox;
|
|
63
64
|
exports.RadioButton = RadioButton.RadioButton;
|
|
64
65
|
exports.Switch = Switch.Switch;
|
|
66
|
+
exports.RadioButtonGroup = RadioButtonGroup.RadioButtonGroup;
|
|
65
67
|
exports.ActionChip = ActionChip.ActionChip;
|
|
66
68
|
exports.FilterChip = FilterChip.FilterChip;
|
|
67
69
|
exports.TagChip = TagChip.TagChip;
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { IconButton } from "./components/actions/buttons/IconButton.js";
|
|
|
10
10
|
import { Checkbox } from "./components/actions/selectionControls/Checkbox.js";
|
|
11
11
|
import { RadioButton } from "./components/actions/selectionControls/RadioButton.js";
|
|
12
12
|
import { Switch } from "./components/actions/selectionControls/Switch.js";
|
|
13
|
+
import { RadioButtonGroup } from "./components/actions/selectionControls/RadioButtonGroup.js";
|
|
13
14
|
import { ActionChip } from "./components/actions/chips/ActionChip.js";
|
|
14
15
|
import { FilterChip } from "./components/actions/chips/FilterChip.js";
|
|
15
16
|
import { TagChip } from "./components/actions/chips/TagChip.js";
|
|
@@ -94,6 +95,7 @@ export {
|
|
|
94
95
|
ProgressBar,
|
|
95
96
|
ProgressBarComponent,
|
|
96
97
|
RadioButton,
|
|
98
|
+
RadioButtonGroup,
|
|
97
99
|
RadioCard,
|
|
98
100
|
Row,
|
|
99
101
|
ScreenReaderOnly,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gnist/design-system",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.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": "a96ca4cc9524bb65377c0532fcf6733aabd41e39"
|
|
106
106
|
}
|