@uva-glass/component-library 3.20.0 → 3.21.1
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/dist/assets/ControlsButton.css +1 -0
- package/dist/assets/PageOverlay.css +1 -1
- package/dist/assets/RadioTabSelector.css +1 -0
- package/dist/components/Buttons/Button.stories.js +1 -1
- package/dist/components/Buttons/LinkButton.stories.js +1 -1
- package/dist/components/Buttons/MenuButton.stories.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js +34 -31
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js.map +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +1 -1
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/ControlsButton/ControlsButton.d.ts +18 -0
- package/dist/components/ControlsButton/ControlsButton.js +46 -0
- package/dist/components/ControlsButton/ControlsButton.js.map +1 -0
- package/dist/components/ControlsButton/ControlsButton.stories.d.ts +5 -0
- package/dist/components/ControlsButton/ControlsButton.stories.js +45 -0
- package/dist/components/ControlsButton/ControlsButton.stories.js.map +1 -0
- package/dist/components/ControlsButton/index.d.ts +1 -0
- package/dist/components/ControlsButton/index.js +5 -0
- package/dist/components/Drawer/Drawer.stories.js +1 -1
- package/dist/components/FormInput/FormInput.stories.js +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
- package/dist/components/PageOverlay/PageOverlay.d.ts +3 -1
- package/dist/components/PageOverlay/PageOverlay.js +60 -53
- package/dist/components/PageOverlay/PageOverlay.js.map +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.d.ts +25 -0
- package/dist/components/RadioTabSelector/RadioTabSelector.js +89 -0
- package/dist/components/RadioTabSelector/RadioTabSelector.js.map +1 -0
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.d.ts +5 -0
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +60 -0
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js.map +1 -0
- package/dist/components/RadioTabSelector/index.d.ts +1 -0
- package/dist/components/RadioTabSelector/index.js +5 -0
- package/dist/components/RadioTabSelector/index.js.map +1 -0
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/Sortable/Sortable.stories.js +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.test.js +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +46 -44
- package/dist/components/index.js.map +1 -1
- package/dist/{index-BCvy9BiK.js → index-Dwqes6RH.js} +5 -2
- package/dist/{index-BCvy9BiK.js.map → index-Dwqes6RH.js.map} +1 -1
- package/dist/index.js +46 -44
- package/dist/index.js.map +1 -1
- package/dist/storybook__react.d.js +1 -1
- package/package.json +22 -22
- package/dist/assets/CheckboxButton.css +0 -1
- package/dist/components/CheckboxButton/CheckboxButton.d.ts +0 -12
- package/dist/components/CheckboxButton/CheckboxButton.js +0 -28
- package/dist/components/CheckboxButton/CheckboxButton.js.map +0 -1
- package/dist/components/CheckboxButton/CheckboxButton.stories.d.ts +0 -5
- package/dist/components/CheckboxButton/CheckboxButton.stories.js +0 -40
- package/dist/components/CheckboxButton/CheckboxButton.stories.js.map +0 -1
- package/dist/components/CheckboxButton/CheckboxButton.test.d.ts +0 -0
- package/dist/components/CheckboxButton/CheckboxButton.test.js +0 -21
- package/dist/components/CheckboxButton/CheckboxButton.test.js.map +0 -1
- package/dist/components/CheckboxButton/index.d.ts +0 -1
- package/dist/components/CheckboxButton/index.js +0 -5
- /package/dist/components/{CheckboxButton → ControlsButton}/index.js.map +0 -0
package/dist/index.js
CHANGED
|
@@ -7,13 +7,13 @@ import { Backdrop as c } from "./components/Backdrop/Backdrop.js";
|
|
|
7
7
|
import { ButtonGroup as u } from "./components/ButtonGroup/ButtonGroup.js";
|
|
8
8
|
import { Button as s } from "./components/Buttons/Button.js";
|
|
9
9
|
import { LinkButton as b } from "./components/Buttons/LinkButton.js";
|
|
10
|
-
import { MenuButton as
|
|
10
|
+
import { MenuButton as k } from "./components/Buttons/MenuButton.js";
|
|
11
11
|
import { Card as M } from "./components/Card/Card.js";
|
|
12
12
|
import { Checkbox as I } from "./components/Checkbox/Checkbox.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
13
|
+
import { CheckboxButtonBar as R } from "./components/CheckboxButtonBar/CheckboxButtonBar.js";
|
|
14
|
+
import { CheckboxTree as P } from "./components/CheckboxTree/CheckboxTree.js";
|
|
15
|
+
import { Chip as y } from "./components/Chip/Chip.js";
|
|
16
|
+
import { ControlsButton as T } from "./components/ControlsButton/ControlsButton.js";
|
|
17
17
|
import { Drawer as w } from "./components/Drawer/Drawer.js";
|
|
18
18
|
import { EmptyStateDataDisplay as O } from "./components/EmptyStateDataDisplay/EmptyStateDataDisplay.js";
|
|
19
19
|
import { FeedbackBar as H } from "./components/FeedbackBar/FeedbackBar.js";
|
|
@@ -33,29 +33,30 @@ import { Label as no } from "./components/Label/Label.js";
|
|
|
33
33
|
import { MenuLink as co } from "./components/MenuLink/MenuLink.js";
|
|
34
34
|
import { MetaDataList as Bo } from "./components/MetaDataList/MetaDataList.js";
|
|
35
35
|
import { ModalDialog as So } from "./components/ModalDialog/ModalDialog.js";
|
|
36
|
-
import { M as
|
|
36
|
+
import { M as Co } from "./TablePlugin-hxs9O_ox.js";
|
|
37
37
|
import { MultiSelectBox as Fo } from "./components/MultiSelectBox/MultiSelectBox.js";
|
|
38
38
|
import { OverlayCloseButton as go } from "./components/OverlayCloseButton/OverlayCloseButton.js";
|
|
39
39
|
import { OverlayStepBar as Lo } from "./components/OverlayStepBar/OverlayStepBar.js";
|
|
40
40
|
import { PageOverlay as Ao } from "./components/PageOverlay/PageOverlay.js";
|
|
41
|
-
import { Periods as
|
|
41
|
+
import { Periods as ho } from "./components/Periods/Periods.js";
|
|
42
42
|
import { PeriodSelector as Do } from "./components/PeriodSelector/PeriodSelector.js";
|
|
43
|
-
import { ProgrammeCard as
|
|
43
|
+
import { ProgrammeCard as vo } from "./components/ProgrammeCard/ProgrammeCard.js";
|
|
44
44
|
import { RadioButton as Go } from "./components/RadioButton/RadioButton.js";
|
|
45
45
|
import { RadioGroup as Eo } from "./components/RadioGroup/RadioGroup.js";
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
46
|
+
import { RadioTabSelector as zo } from "./components/RadioTabSelector/RadioTabSelector.js";
|
|
47
|
+
import { Repeater as Vo } from "./components/Repeater/Repeater.js";
|
|
48
|
+
import { Rte as qo, RteEditor as Jo } from "./components/RteEditor/RteEditor.js";
|
|
49
|
+
import { SectionNotification as Qo } from "./components/SectionNotification/SectionNotification.js";
|
|
50
|
+
import { SelectListbox as Wo } from "./components/SelectListbox/SelectListbox.js";
|
|
51
|
+
import { SelectProvider as Yo, useSelect as Zo } from "./components/SelectListbox/SelectProvider.js";
|
|
52
|
+
import { Sortable as $o } from "./components/Sortable/Sortable.js";
|
|
53
|
+
import { Spinner as rr } from "./components/Spinner/Spinner.js";
|
|
54
|
+
import { StatusBadge as er } from "./components/StatusBadge/StatusBage.js";
|
|
55
|
+
import { StatusPill as xr } from "./components/StatusPill/StatusPill.js";
|
|
56
|
+
import { TextArea as fr } from "./components/TextArea/TextArea.js";
|
|
57
|
+
import { ToggleSwitch as ir } from "./components/ToggleSwitch/ToggleSwitch.js";
|
|
58
|
+
import { Tooltip as lr } from "./components/Tooltip/Tooltip.js";
|
|
59
|
+
import { VarIndicator as dr } from "./components/VarIndicator/VarIndicator.js";
|
|
59
60
|
export {
|
|
60
61
|
t as Accordion,
|
|
61
62
|
p as AccordionCard,
|
|
@@ -67,10 +68,10 @@ export {
|
|
|
67
68
|
u as ButtonGroup,
|
|
68
69
|
M as Card,
|
|
69
70
|
I as Checkbox,
|
|
70
|
-
|
|
71
|
-
P as
|
|
72
|
-
y as
|
|
73
|
-
|
|
71
|
+
R as CheckboxButtonBar,
|
|
72
|
+
P as CheckboxTree,
|
|
73
|
+
y as Chip,
|
|
74
|
+
T as ControlsButton,
|
|
74
75
|
w as Drawer,
|
|
75
76
|
O as EmptyStateDataDisplay,
|
|
76
77
|
H as FeedbackBar,
|
|
@@ -88,34 +89,35 @@ export {
|
|
|
88
89
|
ao as InputField,
|
|
89
90
|
no as Label,
|
|
90
91
|
b as LinkButton,
|
|
91
|
-
|
|
92
|
+
k as MenuButton,
|
|
92
93
|
co as MenuLink,
|
|
93
94
|
Bo as MetaDataList,
|
|
94
95
|
So as ModalDialog,
|
|
95
|
-
|
|
96
|
+
Co as MultiSelect,
|
|
96
97
|
Fo as MultiSelectBox,
|
|
97
98
|
go as OverlayCloseButton,
|
|
98
99
|
Lo as OverlayStepBar,
|
|
99
100
|
Ao as PageOverlay,
|
|
100
101
|
Do as PeriodSelector,
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
ho as Periods,
|
|
103
|
+
vo as ProgrammeCard,
|
|
103
104
|
Go as RadioButton,
|
|
104
105
|
Eo as RadioGroup,
|
|
105
|
-
zo as
|
|
106
|
-
Vo as
|
|
107
|
-
|
|
108
|
-
Jo as
|
|
109
|
-
Qo as
|
|
110
|
-
Wo as
|
|
111
|
-
|
|
112
|
-
$o as
|
|
113
|
-
rr as
|
|
114
|
-
er as
|
|
115
|
-
xr as
|
|
116
|
-
fr as
|
|
117
|
-
ir as
|
|
118
|
-
lr as
|
|
119
|
-
|
|
106
|
+
zo as RadioTabSelector,
|
|
107
|
+
Vo as Repeater,
|
|
108
|
+
qo as Rte,
|
|
109
|
+
Jo as RteEditor,
|
|
110
|
+
Qo as SectionNotification,
|
|
111
|
+
Wo as SelectListbox,
|
|
112
|
+
Yo as SelectProvider,
|
|
113
|
+
$o as Sortable,
|
|
114
|
+
rr as Spinner,
|
|
115
|
+
er as StatusBadge,
|
|
116
|
+
xr as StatusPill,
|
|
117
|
+
fr as TextArea,
|
|
118
|
+
ir as ToggleSwitch,
|
|
119
|
+
lr as Tooltip,
|
|
120
|
+
dr as VarIndicator,
|
|
121
|
+
Zo as useSelect
|
|
120
122
|
};
|
|
121
123
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -752,7 +752,7 @@ var Hc = Ms((tp, er) => {
|
|
|
752
752
|
return jt.createElement(jt.Suspense, null, e());
|
|
753
753
|
}], Pa = async () => {
|
|
754
754
|
try {
|
|
755
|
-
let { configure: e } = await import("./index-
|
|
755
|
+
let { configure: e } = await import("./index-Dwqes6RH.js"), t = await lu();
|
|
756
756
|
e({ unstable_advanceTimersWrapper: (r) => t(r), asyncWrapper: async (r) => {
|
|
757
757
|
let n = ou();
|
|
758
758
|
St(!1);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@uva-glass/component-library",
|
|
3
3
|
"author": "Team Glass - Frontend vrienden",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.21.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -45,26 +45,26 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@commitlint/cli": "^19.8.1",
|
|
47
47
|
"@commitlint/config-conventional": "^19.8.1",
|
|
48
|
-
"@react-aria/button": "^3.13.
|
|
49
|
-
"@react-aria/dialog": "^3.5.
|
|
50
|
-
"@react-aria/overlays": "^3.27.
|
|
51
|
-
"@react-types/dialog": "^3.5.
|
|
48
|
+
"@react-aria/button": "^3.13.1",
|
|
49
|
+
"@react-aria/dialog": "^3.5.25",
|
|
50
|
+
"@react-aria/overlays": "^3.27.1",
|
|
51
|
+
"@react-types/dialog": "^3.5.18",
|
|
52
52
|
"@semantic-release/git": "^10.0.1",
|
|
53
53
|
"@semantic-release/gitlab": "^13.2.5",
|
|
54
54
|
"@semantic-release/npm": "^12.0.1",
|
|
55
|
-
"@storybook/addon-a11y": "^8.6.
|
|
56
|
-
"@storybook/addon-essentials": "^8.6.
|
|
57
|
-
"@storybook/addon-links": "^8.6.
|
|
58
|
-
"@storybook/blocks": "^8.6.
|
|
59
|
-
"@storybook/manager-api": "^8.6.
|
|
60
|
-
"@storybook/preview-api": "^8.6.
|
|
61
|
-
"@storybook/react": "^8.6.
|
|
62
|
-
"@storybook/react-vite": "^8.6.
|
|
63
|
-
"@storybook/test": "^8.6.
|
|
55
|
+
"@storybook/addon-a11y": "^8.6.14",
|
|
56
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
57
|
+
"@storybook/addon-links": "^8.6.14",
|
|
58
|
+
"@storybook/blocks": "^8.6.14",
|
|
59
|
+
"@storybook/manager-api": "^8.6.14",
|
|
60
|
+
"@storybook/preview-api": "^8.6.14",
|
|
61
|
+
"@storybook/react": "^8.6.14",
|
|
62
|
+
"@storybook/react-vite": "^8.6.14",
|
|
63
|
+
"@storybook/test": "^8.6.14",
|
|
64
64
|
"@testing-library/jest-dom": "^6.6.3",
|
|
65
65
|
"@testing-library/react": "^16.3.0",
|
|
66
66
|
"@types/jest": "^29.5.14",
|
|
67
|
-
"@types/node": "^22.15.
|
|
67
|
+
"@types/node": "^22.15.19",
|
|
68
68
|
"@types/react-dom": "^19.1.5",
|
|
69
69
|
"@types/react": "^19.1.4",
|
|
70
70
|
"@uva-glass/eslint-config": "^1.3.10",
|
|
@@ -81,20 +81,20 @@
|
|
|
81
81
|
"jest-environment-jsdom": "^29.7.0",
|
|
82
82
|
"jest-junit": "^16.0.0",
|
|
83
83
|
"jsdom": "^26.1.0",
|
|
84
|
-
"npm-run-all2": "^8.0.
|
|
84
|
+
"npm-run-all2": "^8.0.2",
|
|
85
85
|
"react": "^19.1.0",
|
|
86
86
|
"react-dom": "^19.1.0",
|
|
87
87
|
"react-router": "^7.6.0",
|
|
88
|
-
"semantic-release": "^24.2.
|
|
89
|
-
"storybook": "^8.6.
|
|
90
|
-
"style-dictionary": "^
|
|
88
|
+
"semantic-release": "^24.2.4",
|
|
89
|
+
"storybook": "^8.6.14",
|
|
90
|
+
"style-dictionary": "^5.0.0",
|
|
91
91
|
"stylelint": "^16.19.1",
|
|
92
92
|
"stylelint-config-recommended": "^16.0.0",
|
|
93
93
|
"stylelint-config-standard": "^38.0.0",
|
|
94
94
|
"stylelint-order": "^7.0.0",
|
|
95
95
|
"ts-node": "^10.9.2",
|
|
96
96
|
"typescript": "^5.8.3",
|
|
97
|
-
"vite-plugin-dts": "^4.5.
|
|
97
|
+
"vite-plugin-dts": "^4.5.4",
|
|
98
98
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
99
99
|
"vite-plugin-static-copy": "^3.0.0",
|
|
100
100
|
"vite-plugin-svgr": "^4.3.0",
|
|
@@ -112,9 +112,9 @@
|
|
|
112
112
|
"lexical": "^0.31.1"
|
|
113
113
|
},
|
|
114
114
|
"optionalDependencies": {
|
|
115
|
-
"@rollup/rollup-linux-x64-gnu": "^4.
|
|
115
|
+
"@rollup/rollup-linux-x64-gnu": "^4.41.0",
|
|
116
116
|
"@rspack/binding-darwin-arm64": "1.3.10",
|
|
117
117
|
"@rspack/binding-linux-x64-gnu": "1.3.10",
|
|
118
|
-
"@ast-grep/napi-linux-x64-gnu": "0.38.
|
|
118
|
+
"@ast-grep/napi-linux-x64-gnu": "0.38.2"
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._checkbox-button__container_1q8j8_1{align-items:center;display:inline-flex;justify-content:center}._checkbox-button__container_1q8j8_1 input[type=checkbox]{cursor:pointer;height:0;opacity:0;position:absolute;width:0}._checkbox-button__container_1q8j8_1 input[type=checkbox]:after{content:" ";position:absolute;right:-1.3125rem;top:-1.3125rem;width:2.625rem;height:2.625rem}._checkbox-button__container_1q8j8_1 input[type=checkbox]:focus-visible+label{outline:.125rem dotted var(--new-color-navy-600);outline-offset:.125rem}._checkbox-button__container_1q8j8_1 input[type=checkbox]:checked+label{background-color:var(--new-color-grey-200);border:1px solid var(--new-color-grey-700);font-weight:var(--semibold)}._checkbox-button__container_1q8j8_1 input[type=checkbox]:disabled+label,._checkbox-button__container_1q8j8_1 input[type=checkbox]:disabled:hover+label{background-color:var(--new-color-grey-400);color:var(--new-color-grey-700);cursor:not-allowed}._checkbox-button__container_1q8j8_1 input[type=checkbox]:hover+label{background-color:var(--new-color-grey-200)}._checkbox-button_1q8j8_1{align-items:center;background-color:var(--new-color-uva-white);border-radius:.25rem;cursor:pointer;display:flex;font-size:var(--font-size-default);height:2.25rem;justify-content:center;padding:.25rem;-webkit-user-select:none;user-select:none;white-space:nowrap;width:2.25rem}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface CheckboxButtonProps {
|
|
2
|
-
label: string;
|
|
3
|
-
value: string;
|
|
4
|
-
/** to set default status */
|
|
5
|
-
isChecked?: boolean;
|
|
6
|
-
/** `true` to disable the button; otherwise, `false`. The default is `false`. */
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
/** The callback function that is invoked when the checkbox button changes value. */
|
|
9
|
-
onSetValue: (value: string | null) => void;
|
|
10
|
-
}
|
|
11
|
-
/** Represents a component that acts as a checkbox, it's either set or unset. */
|
|
12
|
-
export declare const CheckboxButton: ({ label, value, isChecked, disabled, onSetValue }: CheckboxButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsxs as x, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useId as _, useState as i } from "react";
|
|
3
|
-
import '../../assets/CheckboxButton.css';const n = {
|
|
4
|
-
"checkbox-button__container": "_checkbox-button__container_1q8j8_1",
|
|
5
|
-
"checkbox-button": "_checkbox-button_1q8j8_1"
|
|
6
|
-
}, m = ({ label: t, value: s, isChecked: h = !1, disabled: r, onSetValue: a }) => {
|
|
7
|
-
const c = _(), [b, u] = i(h), k = (e) => {
|
|
8
|
-
u(e.target.checked), a(e.target.checked ? e.target.value : null);
|
|
9
|
-
};
|
|
10
|
-
return /* @__PURE__ */ x("span", { className: n["checkbox-button__container"], children: [
|
|
11
|
-
/* @__PURE__ */ o(
|
|
12
|
-
"input",
|
|
13
|
-
{
|
|
14
|
-
type: "checkbox",
|
|
15
|
-
id: `${c}${t}`,
|
|
16
|
-
disabled: r,
|
|
17
|
-
value: s,
|
|
18
|
-
checked: b,
|
|
19
|
-
onChange: k
|
|
20
|
-
}
|
|
21
|
-
),
|
|
22
|
-
/* @__PURE__ */ o("label", { htmlFor: `${c}${t}`, className: n["checkbox-button"], children: t })
|
|
23
|
-
] });
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
m as CheckboxButton
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=CheckboxButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxButton.js","sources":["../../../src/components/CheckboxButton/CheckboxButton.tsx"],"sourcesContent":["import { useId, useState } from 'react';\n\nimport type { ChangeEvent } from 'react';\n\nimport styles from './CheckboxButton.module.css';\n\nexport interface CheckboxButtonProps {\n label: string;\n value: string;\n /** to set default status */\n isChecked?: boolean;\n /** `true` to disable the button; otherwise, `false`. The default is `false`. */\n disabled?: boolean;\n /** The callback function that is invoked when the checkbox button changes value. */\n onSetValue: (value: string | null) => void;\n}\n\n/** Represents a component that acts as a checkbox, it's either set or unset. */\nexport const CheckboxButton = ({ label, value, isChecked = false, disabled, onSetValue }: CheckboxButtonProps) => {\n const idPrefix = useId();\n const [checked, setChecked] = useState(isChecked);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setChecked(event.target.checked);\n onSetValue(event.target.checked ? event.target.value : null);\n };\n\n return (\n <span className={styles['checkbox-button__container']}>\n <input\n type=\"checkbox\"\n id={`${idPrefix}${label}`}\n disabled={disabled}\n value={value}\n checked={checked}\n onChange={handleChange}\n />\n <label htmlFor={`${idPrefix}${label}`} className={styles['checkbox-button']}>\n {label}\n </label>\n </span>\n );\n};\n"],"names":["CheckboxButton","label","value","isChecked","disabled","onSetValue","idPrefix","useId","checked","setChecked","useState","handleChange","event","jsxs","styles","jsx"],"mappings":";;;;;GAkBaA,IAAiB,CAAC,EAAE,OAAAC,GAAO,OAAAC,GAAO,WAAAC,IAAY,IAAO,UAAAC,GAAU,YAAAC,QAAsC;AAChH,QAAMC,IAAWC,EAAM,GACjB,CAACC,GAASC,CAAU,IAAIC,EAASP,CAAS,GAE1CQ,IAAe,CAACC,MAAyC;AAClD,IAAAH,EAAAG,EAAM,OAAO,OAAO,GAC/BP,EAAWO,EAAM,OAAO,UAAUA,EAAM,OAAO,QAAQ,IAAI;AAAA,EAC7D;AAEA,SACG,gBAAAC,EAAA,QAAA,EAAK,WAAWC,EAAO,4BAA4B,GAClD,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,IAAI,GAAGT,CAAQ,GAAGL,CAAK;AAAA,QACvB,UAAAG;AAAA,QACA,OAAAF;AAAA,QACA,SAAAM;AAAA,QACA,UAAUG;AAAA,MAAA;AAAA,IACZ;AAAA,IACC,gBAAAI,EAAA,SAAA,EAAM,SAAS,GAAGT,CAAQ,GAAGL,CAAK,IAAI,WAAWa,EAAO,iBAAiB,GACvE,UACHb,EAAA,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Meta } from '@storybook/react';
|
|
2
|
-
import { CheckboxButtonProps } from './CheckboxButton';
|
|
3
|
-
declare const _default: Meta<CheckboxButtonProps>;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const CheckboxButtonExample: import('@storybook/core/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, CheckboxButtonProps>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { fn as n } from "../../index-BCvy9BiK.js";
|
|
3
|
-
import { CheckboxButton as e } from "./CheckboxButton.js";
|
|
4
|
-
const a = "<CheckboxButton label={} value={} isChecked={} variant={} disabled={} notValid={} onSetValue={} key={} />", b = {
|
|
5
|
-
title: "Atoms/CheckboxButton",
|
|
6
|
-
component: e,
|
|
7
|
-
argTypes: {
|
|
8
|
-
label: {
|
|
9
|
-
control: "text"
|
|
10
|
-
},
|
|
11
|
-
value: {
|
|
12
|
-
control: "string"
|
|
13
|
-
},
|
|
14
|
-
isChecked: {
|
|
15
|
-
control: "boolean"
|
|
16
|
-
},
|
|
17
|
-
disabled: {
|
|
18
|
-
control: "boolean"
|
|
19
|
-
},
|
|
20
|
-
onSetValue: {
|
|
21
|
-
table: {
|
|
22
|
-
disable: !0
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
parameters: {
|
|
27
|
-
inspectComponent: e,
|
|
28
|
-
codeString: a
|
|
29
|
-
}
|
|
30
|
-
}, l = (o) => /* @__PURE__ */ t(e, { ...o }), r = l.bind({});
|
|
31
|
-
r.args = {
|
|
32
|
-
label: "1.2",
|
|
33
|
-
value: "1.2",
|
|
34
|
-
onSetValue: n()
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
r as CheckboxButtonExample,
|
|
38
|
-
b as default
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=CheckboxButton.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxButton.stories.js","sources":["../../../src/components/CheckboxButton/CheckboxButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { CheckboxButtonProps } from './CheckboxButton';\n\nimport { CheckboxButton } from './CheckboxButton';\n\nconst codeString =\n '<CheckboxButton label={} value={} isChecked={} variant={} disabled={} notValid={} onSetValue={} key={} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/CheckboxButton',\n component: CheckboxButton,\n argTypes: {\n label: {\n control: 'text',\n },\n value: {\n control: 'string',\n },\n isChecked: {\n control: 'boolean',\n },\n disabled: {\n control: 'boolean',\n },\n onSetValue: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: CheckboxButton,\n codeString: codeString,\n },\n} as Meta<CheckboxButtonProps>;\n\nconst Template: StoryFn<CheckboxButtonProps> = (args) => <CheckboxButton {...args} />;\n\nexport const CheckboxButtonExample = Template.bind({});\nCheckboxButtonExample.args = {\n label: '1.2',\n value: '1.2',\n onSetValue: fn(),\n};\n"],"names":["codeString","CheckboxButton_stories","CheckboxButton","Template","args","jsx","CheckboxButtonExample","fn"],"mappings":";;;AAOA,MAAMA,IACJ,6GAGaC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA,IACX;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,EAEJ;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EAAA;AAEJ,GAEMG,IAAyC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAgB,GAAGE,GAAM,GAEtEE,IAAwBH,EAAS,KAAK,CAAE,CAAA;AACrDG,EAAsB,OAAO;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAYC,EAAG;AACjB;"}
|
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-BqLi4tOb.js";
|
|
3
|
-
import { r as c, s as l } from "../../react.esm-CsMDid07.js";
|
|
4
|
-
import { CheckboxButton as n } from "./CheckboxButton.js";
|
|
5
|
-
const o = jest.fn();
|
|
6
|
-
describe("CheckboxButton", () => {
|
|
7
|
-
it("should render", () => {
|
|
8
|
-
c(/* @__PURE__ */ t(n, { label: "2.1", value: "4", onSetValue: o }));
|
|
9
|
-
const e = l.getByRole("checkbox");
|
|
10
|
-
expect(e).toBeInTheDocument();
|
|
11
|
-
}), it("should be checked if clicked", () => {
|
|
12
|
-
c(/* @__PURE__ */ t(n, { label: "2.1", value: "4", onSetValue: o }));
|
|
13
|
-
const e = l.getByRole("checkbox");
|
|
14
|
-
expect(e).toBeInTheDocument(), e.click(), expect(e).toBeChecked(), expect(o).toHaveBeenCalledTimes(1);
|
|
15
|
-
}), it("should be disabled", () => {
|
|
16
|
-
c(/* @__PURE__ */ t(n, { label: "2.1", value: "4", onSetValue: o, disabled: !0 }));
|
|
17
|
-
const e = l.getByRole("checkbox");
|
|
18
|
-
expect(e).toBeInTheDocument(), expect(e).toBeDisabled();
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=CheckboxButton.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxButton.test.js","sources":["../../../src/components/CheckboxButton/CheckboxButton.test.tsx"],"sourcesContent":["import '@testing-library/jest-dom';\nimport { render, screen } from '@testing-library/react';\n\nimport { CheckboxButton } from './CheckboxButton';\n\nconst onClickSpy = jest.fn();\n\ndescribe('CheckboxButton', () => {\n it('should render', () => {\n render(<CheckboxButton label=\"2.1\" value=\"4\" onSetValue={onClickSpy} />);\n const checkbox = screen.getByRole('checkbox');\n expect(checkbox).toBeInTheDocument();\n });\n\n it('should be checked if clicked', () => {\n render(<CheckboxButton label=\"2.1\" value=\"4\" onSetValue={onClickSpy} />);\n const checkbox = screen.getByRole('checkbox');\n expect(checkbox).toBeInTheDocument();\n checkbox.click();\n expect(checkbox).toBeChecked();\n expect(onClickSpy).toHaveBeenCalledTimes(1);\n });\n\n it('should be disabled', () => {\n render(<CheckboxButton label=\"2.1\" value=\"4\" onSetValue={onClickSpy} disabled={true} />);\n const checkbox = screen.getByRole('checkbox');\n expect(checkbox).toBeInTheDocument();\n expect(checkbox).toBeDisabled();\n });\n});\n"],"names":["onClickSpy","render","jsx","CheckboxButton","checkbox","screen"],"mappings":";;;;AAKA,MAAMA,IAAa,KAAK,GAAG;AAE3B,SAAS,kBAAkB,MAAM;AAC/B,KAAG,iBAAiB,MAAM;AACjB,IAAAC,EAAA,gBAAAC,EAACC,KAAe,OAAM,OAAM,OAAM,KAAI,YAAYH,GAAY,CAAE;AACjE,UAAAI,IAAWC,EAAO,UAAU,UAAU;AACrC,WAAAD,CAAQ,EAAE,kBAAkB;AAAA,EAAA,CACpC,GAED,GAAG,gCAAgC,MAAM;AAChC,IAAAH,EAAA,gBAAAC,EAACC,KAAe,OAAM,OAAM,OAAM,KAAI,YAAYH,GAAY,CAAE;AACjE,UAAAI,IAAWC,EAAO,UAAU,UAAU;AACrC,WAAAD,CAAQ,EAAE,kBAAkB,GACnCA,EAAS,MAAM,GACR,OAAAA,CAAQ,EAAE,YAAY,GACtB,OAAAJ,CAAU,EAAE,sBAAsB,CAAC;AAAA,EAAA,CAC3C,GAED,GAAG,sBAAsB,MAAM;AACtB,IAAAC,EAAA,gBAAAC,EAACC,GAAe,EAAA,OAAM,OAAM,OAAM,KAAI,YAAYH,GAAY,UAAU,GAAM,CAAA,CAAE;AACjF,UAAAI,IAAWC,EAAO,UAAU,UAAU;AACrC,WAAAD,CAAQ,EAAE,kBAAkB,GAC5B,OAAAA,CAAQ,EAAE,aAAa;AAAA,EAAA,CAC/B;AACH,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './CheckboxButton';
|
|
File without changes
|