@uva-glass/component-library 3.39.0 → 3.40.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/dist/assets/ControlsButton.css +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.d.ts +1 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js +14 -13
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js.map +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +13 -11
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js.map +1 -1
- package/dist/components/ControlsButton/ControlsButton.d.ts +3 -1
- package/dist/components/ControlsButton/ControlsButton.js +52 -40
- package/dist/components/ControlsButton/ControlsButton.js.map +1 -1
- package/dist/components/ControlsButton/ControlsButton.stories.js +15 -14
- package/dist/components/ControlsButton/ControlsButton.stories.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectButton.js +43 -34
- package/dist/components/SelectListbox/components/SelectButton.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectOption.js +40 -31
- package/dist/components/SelectListbox/components/SelectOption.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
._controls-
|
|
1
|
+
._controls-input_lu12f_1{aspect-ratio:unset;cursor:pointer;height:0;opacity:0;position:absolute;width:0}._controls-input_lu12f_1:focus-visible+label{outline:.125rem dotted var(--new-color-navy-600);outline-offset:.125rem}._controls-input_lu12f_1:checked+label{background-color:var(--new-color-grey-200);border:1px solid var(--new-color-grey-700);font-weight:var(--semibold)}._controls-input_lu12f_1:disabled+label,._controls-input_lu12f_1:disabled:hover+label{background-color:var(--new-color-grey-400);color:var(--new-color-grey-700);cursor:not-allowed}._controls-input_lu12f_1:hover+label{background-color:var(--new-color-grey-300)}._controls-button_lu12f_32{align-items:center;background-color:var(--new-color-uva-white);border:1px solid transparent;border-radius:.25rem;box-sizing:border-box;cursor:pointer;display:inline-flex;font-size:var(--font-size-default);height:2.25rem;justify-content:center;min-width:2.25rem;padding:.5rem;position:relative;-webkit-user-select:none;user-select:none;white-space:nowrap}._controls-button--squared_lu12f_50{width:2.25rem}._controls-button_lu12f_32:after{content:"";min-height:2.625rem;min-width:2.625rem;position:absolute;width:100%}._controls-button--with-prefix_lu12f_62{height:auto;padding:.125rem .5rem;width:auto}._controls-button--with-icon_lu12f_68{gap:.5rem}._controls-button__wrapper_lu12f_72{align-items:center;display:flex;flex-direction:column}._controls-button__prefix_lu12f_78{color:var(--new-color-grey-700);font-size:var(--font-size-text-non-essential)}._controls-button__tooltip_lu12f_83{background-color:var(--new-color-uva-white);box-shadow:0 0 .25rem #00000040;color:var(--new-color-grey-700);display:none;font-size:var(--font-size-text-non-essential);font-style:italic;font-weight:400;padding:.5rem 1rem;position:absolute;text-align:center;top:calc(100% + .5rem);z-index:1}._controls-button__tooltip--left_lu12f_98{left:0rem}._controls-button__tooltip--center_lu12f_102{left:50%;transform:translate(-50%)}._controls-button__tooltip--right_lu12f_107{right:0rem}._controls-button__tooltip_lu12f_83:before{border-color:transparent transparent var(--new-color-grey-400) transparent;border-style:solid;border-width:.5rem;bottom:calc(100% + .125rem);content:"";filter:blur(.125rem);position:absolute;z-index:-1}._controls-button__tooltip_lu12f_83:after{border-color:transparent transparent var(--new-color-uva-white) transparent;border-style:solid;border-width:.5rem;bottom:100%;content:"";position:absolute}._controls-button_lu12f_32:hover ._controls-button__tooltip_lu12f_83,._controls-input_lu12f_1:focus-visible+label ._controls-button__tooltip_lu12f_83{display:block}._controls-button__tooltip--left_lu12f_98:before,._controls-button__tooltip--left_lu12f_98:after{left:.5rem}._controls-button__tooltip--center_lu12f_102:before,._controls-button__tooltip--center_lu12f_102:after{left:50%;transform:translate(-50%)}._controls-button__tooltip--right_lu12f_107:before,._controls-button__tooltip--right_lu12f_107:after{right:.5rem}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as k, jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as S } from "react";
|
|
3
3
|
import { c as x } from "../../clsx-OuTLNxxd.js";
|
|
4
|
-
import { Label as
|
|
5
|
-
import { FeedbackBox as
|
|
6
|
-
import { ControlsButton as
|
|
4
|
+
import { Label as j } from "../Label/Label.js";
|
|
5
|
+
import { FeedbackBox as y } from "../FeedbackBox/FeedbackBox.js";
|
|
6
|
+
import { ControlsButton as F } from "../ControlsButton/ControlsButton.js";
|
|
7
7
|
import '../../assets/CheckboxButtonBar.css';const t = {
|
|
8
8
|
"checkbox-button-bar__container": "_checkbox-button-bar__container_5gd9n_1",
|
|
9
9
|
"checkbox-button-bar__container--label-left": "_checkbox-button-bar__container--label-left_5gd9n_5",
|
|
@@ -12,7 +12,7 @@ import '../../assets/CheckboxButtonBar.css';const t = {
|
|
|
12
12
|
"checkbox-button-bar__row": "_checkbox-button-bar__row_5gd9n_15",
|
|
13
13
|
"checkbox-button-bar__row--not-validated": "_checkbox-button-bar__row--not-validated_5gd9n_30",
|
|
14
14
|
"checkbox-button-bar__footer": "_checkbox-button-bar__footer_5gd9n_33"
|
|
15
|
-
},
|
|
15
|
+
}, E = ({
|
|
16
16
|
checkboxes: d,
|
|
17
17
|
defaultValues: r,
|
|
18
18
|
label: a,
|
|
@@ -25,7 +25,7 @@ import '../../assets/CheckboxButtonBar.css';const t = {
|
|
|
25
25
|
disableGroup: p = !1,
|
|
26
26
|
onSetValues: i
|
|
27
27
|
}) => {
|
|
28
|
-
const [h, s] =
|
|
28
|
+
const [h, s] = S(
|
|
29
29
|
r && !n ? r.map(String) : r && n ? r.slice(0, 1) : []
|
|
30
30
|
), g = (e) => {
|
|
31
31
|
let o = h;
|
|
@@ -39,7 +39,7 @@ import '../../assets/CheckboxButtonBar.css';const t = {
|
|
|
39
39
|
t[`checkbox-button-bar__container--label-${u}`]
|
|
40
40
|
),
|
|
41
41
|
children: [
|
|
42
|
-
a && /* @__PURE__ */ c(
|
|
42
|
+
a && /* @__PURE__ */ c(j, { htmlFor: "", required: m, children: a }),
|
|
43
43
|
/* @__PURE__ */ k("div", { className: t["checkbox-button-bar__row-container"], children: [
|
|
44
44
|
/* @__PURE__ */ c(
|
|
45
45
|
"div",
|
|
@@ -47,31 +47,32 @@ import '../../assets/CheckboxButtonBar.css';const t = {
|
|
|
47
47
|
className: x(t["checkbox-button-bar__row"], {
|
|
48
48
|
[t["checkbox-button-bar__row--not-validated"]]: f || b
|
|
49
49
|
}),
|
|
50
|
-
children: d.map(({ label: e, value: o, prefix: _, tooltip: w,
|
|
51
|
-
|
|
50
|
+
children: d.map(({ label: e, value: o, prefix: _, tooltip: w, tooltipPosition: v, disabled: C }) => /* @__PURE__ */ c(
|
|
51
|
+
F,
|
|
52
52
|
{
|
|
53
53
|
type: "checkbox",
|
|
54
54
|
label: e,
|
|
55
55
|
prefix: _,
|
|
56
56
|
tooltip: w,
|
|
57
|
+
tooltipPosition: v,
|
|
57
58
|
forceSquared: !0,
|
|
58
59
|
value: o,
|
|
59
60
|
checked: h.includes(o),
|
|
60
|
-
disabled:
|
|
61
|
-
onSetValue: (
|
|
61
|
+
disabled: C || p,
|
|
62
|
+
onSetValue: (N) => g(N.target.value)
|
|
62
63
|
},
|
|
63
64
|
`${o}`
|
|
64
65
|
))
|
|
65
66
|
}
|
|
66
67
|
),
|
|
67
68
|
l && /* @__PURE__ */ c("div", { className: t["checkbox-button-bar__footer"], children: l }),
|
|
68
|
-
b !== "" && /* @__PURE__ */ c(
|
|
69
|
+
b !== "" && /* @__PURE__ */ c(y, { level: "error", feedback: b })
|
|
69
70
|
] })
|
|
70
71
|
]
|
|
71
72
|
}
|
|
72
73
|
);
|
|
73
74
|
};
|
|
74
75
|
export {
|
|
75
|
-
|
|
76
|
+
E as CheckboxButtonBar
|
|
76
77
|
};
|
|
77
78
|
//# sourceMappingURL=CheckboxButtonBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxButtonBar.js","sources":["../../../src/components/CheckboxButtonBar/CheckboxButtonBar.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { ReactNode } from 'react';\n\nimport styles from './CheckboxButtonBar.module.css';\n\nimport { Label } from 'components/Label';\nimport { FeedbackBox } from 'components/FeedbackBox';\nimport { ControlsButton } from 'components/ControlsButton';\n\ntype CheckboxProps = {\n label: string;\n value: string;\n prefix?: string;\n tooltip?: ReactNode;\n disabled?: boolean;\n};\n\nexport interface CheckboxButtonBarProps {\n /** array with objects with label, value, prefix and disabled*/\n checkboxes: CheckboxProps[];\n //** array with value(s) */\n defaultValues?: string[];\n label?: string;\n /** 'top' | 'left' */\n labelPosition?: 'top' | 'left';\n /** `true` to show an asterisk to indicate an item is required; otherwise, `false`. */\n required?: boolean;\n /** `true` to color border red to show missing in validation; otherwise, `false`. */\n notValidated?: boolean;\n /** error text to display under the bar */\n notValidatedText?: string;\n /** returns an array with only one value */\n actAsRadioButtonBar?: boolean;\n /** optional footer text */\n footerText?: string;\n /** disables all checkboxes in the bar */\n disableGroup?: boolean;\n onSetValues: (value: string[]) => void;\n}\n\nexport const CheckboxButtonBar = ({\n checkboxes,\n defaultValues,\n label,\n labelPosition = 'top',\n required = false,\n notValidated = false,\n notValidatedText = '',\n actAsRadioButtonBar = false,\n footerText = '',\n disableGroup = false,\n onSetValues,\n}: CheckboxButtonBarProps) => {\n const [currentValues, setCurrentValues] = useState<string[]>(\n defaultValues && !actAsRadioButtonBar\n ? defaultValues.map(String)\n : defaultValues && actAsRadioButtonBar\n ? defaultValues.slice(0, 1)\n : []\n );\n\n const handleChange = (value: string) => {\n let values = currentValues;\n\n if (actAsRadioButtonBar) {\n setCurrentValues([value]);\n onSetValues([value]);\n } else {\n if (values.includes(value)) {\n values = values.filter((val) => val !== value);\n } else {\n values = [...values, value];\n }\n setCurrentValues(values);\n onSetValues(values);\n }\n };\n\n return (\n <div\n className={clsx(\n styles['checkbox-button-bar__container'],\n styles[`checkbox-button-bar__container--label-${labelPosition}`]\n )}\n >\n {label && (\n <Label htmlFor=\"\" required={required}>\n {label}\n </Label>\n )}\n <div className={styles['checkbox-button-bar__row-container']}>\n <div\n className={clsx(styles['checkbox-button-bar__row'], {\n [styles['checkbox-button-bar__row--not-validated']]: notValidated || notValidatedText,\n })}\n >\n {checkboxes.map(({ label, value, prefix, tooltip, disabled }) => (\n <ControlsButton\n key={`${value}`}\n type=\"checkbox\"\n label={label}\n prefix={prefix}\n tooltip={tooltip}\n forceSquared={true}\n value={value}\n checked={currentValues.includes(value)}\n disabled={disabled || disableGroup}\n onSetValue={(event) => handleChange(event.target.value)}\n />\n ))}\n </div>\n {footerText && <div className={styles['checkbox-button-bar__footer']}>{footerText}</div>}\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n </div>\n );\n};\n"],"names":["CheckboxButtonBar","checkboxes","defaultValues","label","labelPosition","required","notValidated","notValidatedText","actAsRadioButtonBar","footerText","disableGroup","onSetValues","currentValues","setCurrentValues","useState","handleChange","value","values","val","jsxs","clsx","styles","jsx","Label","prefix","tooltip","disabled","ControlsButton","event","FeedbackBox"],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CheckboxButtonBar.js","sources":["../../../src/components/CheckboxButtonBar/CheckboxButtonBar.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { ReactNode } from 'react';\n\nimport styles from './CheckboxButtonBar.module.css';\n\nimport { Label } from 'components/Label';\nimport { FeedbackBox } from 'components/FeedbackBox';\nimport { ControlsButton } from 'components/ControlsButton';\n\ntype CheckboxProps = {\n label: string;\n value: string;\n prefix?: string;\n tooltip?: ReactNode;\n tooltipPosition?: 'left' | 'center' | 'right';\n disabled?: boolean;\n};\n\nexport interface CheckboxButtonBarProps {\n /** array with objects with label, value, prefix and disabled*/\n checkboxes: CheckboxProps[];\n //** array with value(s) */\n defaultValues?: string[];\n label?: string;\n /** 'top' | 'left' */\n labelPosition?: 'top' | 'left';\n /** `true` to show an asterisk to indicate an item is required; otherwise, `false`. */\n required?: boolean;\n /** `true` to color border red to show missing in validation; otherwise, `false`. */\n notValidated?: boolean;\n /** error text to display under the bar */\n notValidatedText?: string;\n /** returns an array with only one value */\n actAsRadioButtonBar?: boolean;\n /** optional footer text */\n footerText?: string;\n /** disables all checkboxes in the bar */\n disableGroup?: boolean;\n onSetValues: (value: string[]) => void;\n}\n\nexport const CheckboxButtonBar = ({\n checkboxes,\n defaultValues,\n label,\n labelPosition = 'top',\n required = false,\n notValidated = false,\n notValidatedText = '',\n actAsRadioButtonBar = false,\n footerText = '',\n disableGroup = false,\n onSetValues,\n}: CheckboxButtonBarProps) => {\n const [currentValues, setCurrentValues] = useState<string[]>(\n defaultValues && !actAsRadioButtonBar\n ? defaultValues.map(String)\n : defaultValues && actAsRadioButtonBar\n ? defaultValues.slice(0, 1)\n : []\n );\n\n const handleChange = (value: string) => {\n let values = currentValues;\n\n if (actAsRadioButtonBar) {\n setCurrentValues([value]);\n onSetValues([value]);\n } else {\n if (values.includes(value)) {\n values = values.filter((val) => val !== value);\n } else {\n values = [...values, value];\n }\n setCurrentValues(values);\n onSetValues(values);\n }\n };\n\n return (\n <div\n className={clsx(\n styles['checkbox-button-bar__container'],\n styles[`checkbox-button-bar__container--label-${labelPosition}`]\n )}\n >\n {label && (\n <Label htmlFor=\"\" required={required}>\n {label}\n </Label>\n )}\n <div className={styles['checkbox-button-bar__row-container']}>\n <div\n className={clsx(styles['checkbox-button-bar__row'], {\n [styles['checkbox-button-bar__row--not-validated']]: notValidated || notValidatedText,\n })}\n >\n {checkboxes.map(({ label, value, prefix, tooltip, tooltipPosition, disabled }) => (\n <ControlsButton\n key={`${value}`}\n type=\"checkbox\"\n label={label}\n prefix={prefix}\n tooltip={tooltip}\n tooltipPosition={tooltipPosition}\n forceSquared={true}\n value={value}\n checked={currentValues.includes(value)}\n disabled={disabled || disableGroup}\n onSetValue={(event) => handleChange(event.target.value)}\n />\n ))}\n </div>\n {footerText && <div className={styles['checkbox-button-bar__footer']}>{footerText}</div>}\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n </div>\n );\n};\n"],"names":["CheckboxButtonBar","checkboxes","defaultValues","label","labelPosition","required","notValidated","notValidatedText","actAsRadioButtonBar","footerText","disableGroup","onSetValues","currentValues","setCurrentValues","useState","handleChange","value","values","val","jsxs","clsx","styles","jsx","Label","prefix","tooltip","tooltipPosition","disabled","ControlsButton","event","FeedbackBox"],"mappings":";;;;;;;;;;;;;;GA2CaA,IAAoB,CAAC;AAAA,EAChC,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,UAAAC,IAAW;AAAA,EACX,cAAAC,IAAe;AAAA,EACf,kBAAAC,IAAmB;AAAA,EACnB,qBAAAC,IAAsB;AAAA,EACtB,YAAAC,IAAa;AAAA,EACb,cAAAC,IAAe;AAAA,EACf,aAAAC;AACF,MAA8B;AAC5B,QAAM,CAACC,GAAeC,CAAgB,IAAIC;AAAA,IACxCZ,KAAiB,CAACM,IACdN,EAAc,IAAI,MAAM,IACxBA,KAAiBM,IACfN,EAAc,MAAM,GAAG,CAAC,IACxB,CAAA;AAAA,EAAC,GAGHa,IAAe,CAACC,MAAkB;AACtC,QAAIC,IAASL;AAEb,IAAIJ,KACFK,EAAiB,CAACG,CAAK,CAAC,GACxBL,EAAY,CAACK,CAAK,CAAC,MAEfC,EAAO,SAASD,CAAK,IACvBC,IAASA,EAAO,OAAO,CAACC,MAAQA,MAAQF,CAAK,IAE7CC,IAAS,CAAC,GAAGA,GAAQD,CAAK,GAE5BH,EAAiBI,CAAM,GACvBN,EAAYM,CAAM;AAAA,EACpB;AAGF,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTC,EAAO,gCAAgC;AAAA,QACvCA,EAAO,yCAAyCjB,CAAa,EAAE;AAAA,MAAA;AAAA,MAGhE,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|
import { CheckboxButtonBar as r } from "./CheckboxButtonBar.js";
|
|
4
4
|
const b = "<CheckboxButtonBar checkboxes={} defaultValues={} label={} labelPosition={} required={} notValidatedText={} disableGroup={} onSetValues={} />", f = {
|
|
5
5
|
title: "Molecules/CheckboxButtonBar",
|
|
@@ -44,7 +44,7 @@ const b = "<CheckboxButtonBar checkboxes={} defaultValues={} label={} labelPosit
|
|
|
44
44
|
inspectComponent: r,
|
|
45
45
|
codeString: b
|
|
46
46
|
}
|
|
47
|
-
},
|
|
47
|
+
}, a = (i) => /* @__PURE__ */ e(r, { ...i }), u = a.bind({});
|
|
48
48
|
u.args = {
|
|
49
49
|
label: "Periode",
|
|
50
50
|
required: !0,
|
|
@@ -77,9 +77,9 @@ u.args = {
|
|
|
77
77
|
defaultValues: ["1", "2"],
|
|
78
78
|
labelPosition: "top",
|
|
79
79
|
footerText: "Weken in periode 2",
|
|
80
|
-
onSetValues:
|
|
80
|
+
onSetValues: o()
|
|
81
81
|
};
|
|
82
|
-
const n =
|
|
82
|
+
const n = a.bind({});
|
|
83
83
|
n.args = {
|
|
84
84
|
label: "Weken",
|
|
85
85
|
required: !0,
|
|
@@ -112,9 +112,9 @@ n.args = {
|
|
|
112
112
|
defaultValues: ["1"],
|
|
113
113
|
labelPosition: "top",
|
|
114
114
|
actAsRadioButtonBar: !0,
|
|
115
|
-
onSetValues:
|
|
115
|
+
onSetValues: o()
|
|
116
116
|
};
|
|
117
|
-
const s =
|
|
117
|
+
const s = a.bind({});
|
|
118
118
|
s.args = {
|
|
119
119
|
label: "Weken",
|
|
120
120
|
required: !0,
|
|
@@ -153,9 +153,9 @@ s.args = {
|
|
|
153
153
|
defaultValues: ["1"],
|
|
154
154
|
labelPosition: "top",
|
|
155
155
|
actAsRadioButtonBar: !1,
|
|
156
|
-
onSetValues:
|
|
156
|
+
onSetValues: o()
|
|
157
157
|
};
|
|
158
|
-
const p =
|
|
158
|
+
const p = a.bind({});
|
|
159
159
|
p.args = {
|
|
160
160
|
label: "Weken",
|
|
161
161
|
required: !0,
|
|
@@ -168,7 +168,8 @@ p.args = {
|
|
|
168
168
|
"1 sept - 5 sept",
|
|
169
169
|
/* @__PURE__ */ e("br", {}),
|
|
170
170
|
"2025"
|
|
171
|
-
] })
|
|
171
|
+
] }),
|
|
172
|
+
tooltipPosition: "left"
|
|
172
173
|
},
|
|
173
174
|
{
|
|
174
175
|
label: "2",
|
|
@@ -238,13 +239,14 @@ p.args = {
|
|
|
238
239
|
"20 okt - 24 okt",
|
|
239
240
|
/* @__PURE__ */ e("br", {}),
|
|
240
241
|
"2025"
|
|
241
|
-
] })
|
|
242
|
+
] }),
|
|
243
|
+
tooltipPosition: "right"
|
|
242
244
|
}
|
|
243
245
|
],
|
|
244
246
|
defaultValues: ["1"],
|
|
245
247
|
labelPosition: "top",
|
|
246
248
|
actAsRadioButtonBar: !1,
|
|
247
|
-
onSetValues:
|
|
249
|
+
onSetValues: o()
|
|
248
250
|
};
|
|
249
251
|
export {
|
|
250
252
|
n as CheckboxButtonBarAsRadioButtonBar,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxButtonBar.stories.js","sources":["../../../src/components/CheckboxButtonBar/CheckboxButtonBar.stories.tsx"],"sourcesContent":["import { fn } from 'storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { CheckboxButtonBarProps } from './CheckboxButtonBar';\n\nimport { CheckboxButtonBar } from './CheckboxButtonBar';\n\nconst codeString =\n '<CheckboxButtonBar checkboxes={} defaultValues={} label={} labelPosition={} required={} notValidatedText={} disableGroup={} onSetValues={} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Molecules/CheckboxButtonBar',\n component: CheckboxButtonBar,\n argTypes: {\n checkboxes: {\n table: {\n disable: true,\n },\n },\n defaultValues: {\n table: {\n disable: true,\n },\n },\n label: {\n control: 'text',\n },\n labelPosition: {\n control: 'radio',\n options: ['top', 'left'],\n },\n required: {\n control: 'boolean',\n },\n notValidatedText: {\n control: 'text',\n },\n disableGroup: {\n control: 'boolean',\n },\n actAsRadioButtonBar: {\n control: 'boolean',\n },\n onSetValues: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: CheckboxButtonBar,\n codeString: codeString,\n },\n} as Meta<CheckboxButtonBarProps>;\n\nconst Template: StoryFn<CheckboxButtonBarProps> = (args) => <CheckboxButtonBar {...args} />;\n\nexport const CheckboxButtonBarExample = Template.bind({});\nCheckboxButtonBarExample.args = {\n label: 'Periode',\n required: true,\n checkboxes: [\n {\n label: '1.1',\n value: '1',\n },\n {\n label: '1.2',\n value: '2',\n },\n {\n label: '1.3',\n value: '3',\n },\n {\n label: '4',\n value: '4',\n },\n {\n label: '5',\n value: '5',\n },\n {\n label: '6',\n value: '6',\n },\n ],\n defaultValues: ['1', '2'],\n labelPosition: 'top',\n footerText: 'Weken in periode 2',\n onSetValues: fn(),\n};\n\nexport const CheckboxButtonBarAsRadioButtonBar = Template.bind({});\nCheckboxButtonBarAsRadioButtonBar.args = {\n label: 'Weken',\n required: true,\n checkboxes: [\n {\n label: '1',\n value: '1',\n },\n {\n label: '2',\n value: '2',\n },\n {\n label: '3',\n value: '3',\n },\n {\n label: '4',\n value: '4',\n },\n {\n label: '5',\n value: '5',\n },\n {\n label: '6',\n value: '6',\n },\n ],\n defaultValues: ['1'],\n labelPosition: 'top',\n actAsRadioButtonBar: true,\n onSetValues: fn(),\n};\n\nexport const CheckboxButtonBarWithPrefix = Template.bind({});\nCheckboxButtonBarWithPrefix.args = {\n label: 'Weken',\n required: true,\n checkboxes: [\n {\n label: '1',\n value: '1',\n prefix: '13',\n },\n {\n label: '2',\n value: '2',\n prefix: '14',\n },\n {\n label: '3',\n value: '3',\n prefix: '15',\n },\n {\n label: '4',\n value: '4',\n prefix: '16',\n },\n {\n label: '5',\n value: '5',\n prefix: '17',\n },\n {\n label: '6',\n value: '6',\n prefix: '18',\n },\n ],\n defaultValues: ['1'],\n labelPosition: 'top',\n actAsRadioButtonBar: false,\n onSetValues: fn(),\n};\n\nexport const CheckboxButtonBarWithTooltip = Template.bind({});\nCheckboxButtonBarWithTooltip.args = {\n label: 'Weken',\n required: true,\n checkboxes: [\n {\n label: '1',\n value: '1',\n prefix: '36',\n tooltip: (\n <>\n 1 sept - 5 sept\n <br />\n 2025\n </>\n ),\n },\n {\n label: '2',\n value: '2',\n prefix: '37',\n tooltip: (\n <>\n 8 sept - 12 sept\n <br />\n 2025\n </>\n ),\n },\n {\n label: '3',\n value: '3',\n prefix: '38',\n tooltip: (\n <>\n 15 sept - 19 sept\n <br />\n 2025\n </>\n ),\n },\n {\n label: '4',\n value: '4',\n prefix: '39',\n tooltip: (\n <>\n 22 sept - 26 sept\n <br />\n 2025\n </>\n ),\n },\n {\n label: '5',\n value: '5',\n prefix: '40',\n tooltip: (\n <>\n 29 sept - 3 okt\n <br />\n 2025\n </>\n ),\n },\n {\n label: '6',\n value: '6',\n prefix: '41',\n tooltip: (\n <>\n 6 okt - 10 okt\n <br />\n 2025\n </>\n ),\n },\n {\n label: '7',\n value: '7',\n prefix: '42',\n tooltip: (\n <>\n 13 okt - 17 okt\n <br />\n 2025\n </>\n ),\n },\n {\n label: '8',\n value: '8',\n prefix: '43',\n tooltip: (\n <>\n 20 okt - 24 okt\n <br />\n 2025\n </>\n ),\n },\n ],\n defaultValues: ['1'],\n labelPosition: 'top',\n actAsRadioButtonBar: false,\n onSetValues: fn(),\n};\n"],"names":["codeString","CheckboxButtonBar_stories","CheckboxButtonBar","Template","args","jsx","CheckboxButtonBarExample","fn","CheckboxButtonBarAsRadioButtonBar","CheckboxButtonBarWithPrefix","CheckboxButtonBarWithTooltip","jsxs","Fragment"],"mappings":";;;AAOA,MAAMA,IACJ,iJAGFC,IAAe;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,YAAY;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,IAEF,eAAe;AAAA,MAC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5DO,EAA6B,OAAO;AAAA,EAClC,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,IACV;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SACE,gBAAAC,EAAAC,GAAA,EAAE,UAAA;AAAA,QAAA;AAAA,0BAEC,MAAA,EAAG;AAAA,QAAE;AAAA,MAAA,
|
|
1
|
+
{"version":3,"file":"CheckboxButtonBar.stories.js","sources":["../../../src/components/CheckboxButtonBar/CheckboxButtonBar.stories.tsx"],"sourcesContent":["import { fn } from 'storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { CheckboxButtonBarProps } from './CheckboxButtonBar';\n\nimport { CheckboxButtonBar } from './CheckboxButtonBar';\n\nconst codeString =\n '<CheckboxButtonBar checkboxes={} defaultValues={} label={} labelPosition={} required={} notValidatedText={} disableGroup={} onSetValues={} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Molecules/CheckboxButtonBar',\n component: CheckboxButtonBar,\n argTypes: {\n checkboxes: {\n table: {\n disable: true,\n },\n },\n defaultValues: {\n table: {\n disable: true,\n },\n },\n label: {\n control: 'text',\n },\n labelPosition: {\n control: 'radio',\n options: ['top', 'left'],\n },\n required: {\n control: 'boolean',\n },\n notValidatedText: {\n control: 'text',\n },\n disableGroup: {\n control: 'boolean',\n },\n actAsRadioButtonBar: {\n control: 'boolean',\n },\n onSetValues: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: CheckboxButtonBar,\n codeString: codeString,\n },\n} as Meta<CheckboxButtonBarProps>;\n\nconst Template: StoryFn<CheckboxButtonBarProps> = (args) => <CheckboxButtonBar {...args} />;\n\nexport const CheckboxButtonBarExample = Template.bind({});\nCheckboxButtonBarExample.args = {\n label: 'Periode',\n required: true,\n checkboxes: [\n {\n label: '1.1',\n value: '1',\n },\n {\n label: '1.2',\n value: '2',\n },\n {\n label: '1.3',\n value: '3',\n },\n {\n label: '4',\n value: '4',\n },\n {\n label: '5',\n value: '5',\n },\n {\n label: '6',\n value: '6',\n },\n ],\n defaultValues: ['1', '2'],\n labelPosition: 'top',\n footerText: 'Weken in periode 2',\n onSetValues: fn(),\n};\n\nexport const CheckboxButtonBarAsRadioButtonBar = Template.bind({});\nCheckboxButtonBarAsRadioButtonBar.args = {\n label: 'Weken',\n required: true,\n checkboxes: [\n {\n label: '1',\n value: '1',\n },\n {\n label: '2',\n value: '2',\n },\n {\n label: '3',\n value: '3',\n },\n {\n label: '4',\n value: '4',\n },\n {\n label: '5',\n value: '5',\n },\n {\n label: '6',\n value: '6',\n },\n ],\n defaultValues: ['1'],\n labelPosition: 'top',\n actAsRadioButtonBar: true,\n onSetValues: fn(),\n};\n\nexport const CheckboxButtonBarWithPrefix = Template.bind({});\nCheckboxButtonBarWithPrefix.args = {\n label: 'Weken',\n required: true,\n checkboxes: [\n {\n label: '1',\n value: '1',\n prefix: '13',\n },\n {\n label: '2',\n value: '2',\n prefix: '14',\n },\n {\n label: '3',\n value: '3',\n prefix: '15',\n },\n {\n label: '4',\n value: '4',\n prefix: '16',\n },\n {\n label: '5',\n value: '5',\n prefix: '17',\n },\n {\n label: '6',\n value: '6',\n prefix: '18',\n },\n ],\n defaultValues: ['1'],\n labelPosition: 'top',\n actAsRadioButtonBar: false,\n onSetValues: fn(),\n};\n\nexport const CheckboxButtonBarWithTooltip = Template.bind({});\nCheckboxButtonBarWithTooltip.args = {\n label: 'Weken',\n required: true,\n checkboxes: [\n {\n label: '1',\n value: '1',\n prefix: '36',\n tooltip: (\n <>\n 1 sept - 5 sept\n <br />\n 2025\n </>\n ),\n tooltipPosition: 'left',\n },\n {\n label: '2',\n value: '2',\n prefix: '37',\n tooltip: (\n <>\n 8 sept - 12 sept\n <br />\n 2025\n </>\n ),\n },\n {\n label: '3',\n value: '3',\n prefix: '38',\n tooltip: (\n <>\n 15 sept - 19 sept\n <br />\n 2025\n </>\n ),\n },\n {\n label: '4',\n value: '4',\n prefix: '39',\n tooltip: (\n <>\n 22 sept - 26 sept\n <br />\n 2025\n </>\n ),\n },\n {\n label: '5',\n value: '5',\n prefix: '40',\n tooltip: (\n <>\n 29 sept - 3 okt\n <br />\n 2025\n </>\n ),\n },\n {\n label: '6',\n value: '6',\n prefix: '41',\n tooltip: (\n <>\n 6 okt - 10 okt\n <br />\n 2025\n </>\n ),\n },\n {\n label: '7',\n value: '7',\n prefix: '42',\n tooltip: (\n <>\n 13 okt - 17 okt\n <br />\n 2025\n </>\n ),\n },\n {\n label: '8',\n value: '8',\n prefix: '43',\n tooltip: (\n <>\n 20 okt - 24 okt\n <br />\n 2025\n </>\n ),\n tooltipPosition: 'right',\n },\n ],\n defaultValues: ['1'],\n labelPosition: 'top',\n actAsRadioButtonBar: false,\n onSetValues: fn(),\n};\n"],"names":["codeString","CheckboxButtonBar_stories","CheckboxButtonBar","Template","args","jsx","CheckboxButtonBarExample","fn","CheckboxButtonBarAsRadioButtonBar","CheckboxButtonBarWithPrefix","CheckboxButtonBarWithTooltip","jsxs","Fragment"],"mappings":";;;AAOA,MAAMA,IACJ,iJAGFC,IAAe;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,YAAY;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,IAEF,eAAe;AAAA,MACb,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,IAEF,OAAO;AAAA,MACL,SAAS;AAAA,IAAA;AAAA,IAEX,eAAe;AAAA,MACb,SAAS;AAAA,MACT,SAAS,CAAC,OAAO,MAAM;AAAA,IAAA;AAAA,IAEzB,UAAU;AAAA,MACR,SAAS;AAAA,IAAA;AAAA,IAEX,kBAAkB;AAAA,MAChB,SAAS;AAAA,IAAA;AAAA,IAEX,cAAc;AAAA,MACZ,SAAS;AAAA,IAAA;AAAA,IAEX,qBAAqB;AAAA,MACnB,SAAS;AAAA,IAAA;AAAA,IAEX,aAAa;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AAA,QAAE;AAAA,MAAA,GAER;AAAA,MAEF,iBAAiB;AAAA,IAAA;AAAA,EACnB;AAAA,EAEF,eAAe,CAAC,GAAG;AAAA,EACnB,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,aAAaL,EAAA;AACf;"}
|
|
@@ -13,6 +13,8 @@ export interface ControlsButtonProps {
|
|
|
13
13
|
prefix?: string;
|
|
14
14
|
/** set tooltip */
|
|
15
15
|
tooltip?: ReactNode;
|
|
16
|
+
/** set horizontal position of the tooltip */
|
|
17
|
+
tooltipPosition?: 'left' | 'center' | 'right';
|
|
16
18
|
/** set if used as radiogroup */
|
|
17
19
|
name?: string;
|
|
18
20
|
/** `true` to set squared button; otherwise, `false`. The default is `false`. Note: hides icon */
|
|
@@ -24,4 +26,4 @@ export interface ControlsButtonProps {
|
|
|
24
26
|
/** The callback function that is invoked when the radio button changes value. */
|
|
25
27
|
onSetValue: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
26
28
|
}
|
|
27
|
-
export declare const ControlsButton: ({ type, label, value, iconName, prefix, tooltip, name, forceSquared, checked, disabled, onSetValue, }: ControlsButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const ControlsButton: ({ type, label, value, iconName, prefix, tooltip, tooltipPosition, name, forceSquared, checked, disabled, onSetValue, }: ControlsButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,67 +1,79 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { c as
|
|
4
|
-
import { Icon as
|
|
1
|
+
import { jsxs as s, Fragment as g, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useId as v } from "react";
|
|
3
|
+
import { c as e } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { Icon as I } from "../Icon/Icon.js";
|
|
5
5
|
import '../../assets/ControlsButton.css';const t = {
|
|
6
|
-
"controls-input": "_controls-
|
|
7
|
-
"controls-button": "_controls-
|
|
8
|
-
"controls-button--squared": "_controls-button--
|
|
9
|
-
"controls-button--with-prefix": "_controls-button--with-
|
|
10
|
-
"controls-button--with-icon": "_controls-button--with-
|
|
11
|
-
"controls-button__wrapper": "_controls-
|
|
12
|
-
"controls-button__prefix": "_controls-
|
|
13
|
-
"controls-button__tooltip": "_controls-
|
|
14
|
-
|
|
6
|
+
"controls-input": "_controls-input_lu12f_1",
|
|
7
|
+
"controls-button": "_controls-button_lu12f_32",
|
|
8
|
+
"controls-button--squared": "_controls-button--squared_lu12f_50",
|
|
9
|
+
"controls-button--with-prefix": "_controls-button--with-prefix_lu12f_62",
|
|
10
|
+
"controls-button--with-icon": "_controls-button--with-icon_lu12f_68",
|
|
11
|
+
"controls-button__wrapper": "_controls-button__wrapper_lu12f_72",
|
|
12
|
+
"controls-button__prefix": "_controls-button__prefix_lu12f_78",
|
|
13
|
+
"controls-button__tooltip": "_controls-button__tooltip_lu12f_83",
|
|
14
|
+
"controls-button__tooltip--left": "_controls-button__tooltip--left_lu12f_98",
|
|
15
|
+
"controls-button__tooltip--center": "_controls-button__tooltip--center_lu12f_102",
|
|
16
|
+
"controls-button__tooltip--right": "_controls-button__tooltip--right_lu12f_107"
|
|
17
|
+
}, y = ({
|
|
15
18
|
type: b = "checkbox",
|
|
16
|
-
label:
|
|
17
|
-
value:
|
|
19
|
+
label: c,
|
|
20
|
+
value: p,
|
|
18
21
|
iconName: n,
|
|
19
|
-
prefix:
|
|
20
|
-
tooltip:
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
prefix: l,
|
|
23
|
+
tooltip: r,
|
|
24
|
+
tooltipPosition: a = "center",
|
|
25
|
+
name: f,
|
|
26
|
+
forceSquared: d = !1,
|
|
23
27
|
checked: h,
|
|
24
|
-
disabled:
|
|
25
|
-
onSetValue:
|
|
28
|
+
disabled: m,
|
|
29
|
+
onSetValue: x
|
|
26
30
|
}) => {
|
|
27
|
-
const
|
|
28
|
-
return /* @__PURE__ */
|
|
31
|
+
const w = v(), i = c.replace(/\s+/g, "_"), _ = `${w}${i}`, u = `${_}-tooltip`;
|
|
32
|
+
return /* @__PURE__ */ s(g, { children: [
|
|
29
33
|
/* @__PURE__ */ o(
|
|
30
34
|
"input",
|
|
31
35
|
{
|
|
32
36
|
type: b,
|
|
33
|
-
id:
|
|
34
|
-
name:
|
|
35
|
-
disabled:
|
|
36
|
-
value:
|
|
37
|
+
id: _,
|
|
38
|
+
name: f ?? i,
|
|
39
|
+
disabled: m,
|
|
40
|
+
value: p,
|
|
37
41
|
checked: h,
|
|
38
|
-
onChange:
|
|
42
|
+
onChange: x,
|
|
39
43
|
className: t["controls-input"],
|
|
40
|
-
"aria-describedby":
|
|
44
|
+
"aria-describedby": r ? u : void 0
|
|
41
45
|
}
|
|
42
46
|
),
|
|
43
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ s(
|
|
44
48
|
"label",
|
|
45
49
|
{
|
|
46
|
-
htmlFor:
|
|
47
|
-
className:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
htmlFor: _,
|
|
51
|
+
className: e(t["controls-button"], [
|
|
52
|
+
d && t["controls-button--squared"],
|
|
53
|
+
l && t["controls-button--with-prefix"],
|
|
50
54
|
n && t["controls-button--with-icon"]
|
|
51
55
|
]),
|
|
52
56
|
children: [
|
|
53
|
-
n && /* @__PURE__ */ o(
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
n && /* @__PURE__ */ o(I, { name: n, size: 20 }),
|
|
58
|
+
/* @__PURE__ */ s("div", { className: t["controls-button__wrapper"], children: [
|
|
59
|
+
l && /* @__PURE__ */ o("div", { className: t["controls-button__prefix"], children: l }),
|
|
60
|
+
c
|
|
57
61
|
] }),
|
|
58
|
-
|
|
62
|
+
r && /* @__PURE__ */ o(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
id: u,
|
|
66
|
+
role: "tooltip",
|
|
67
|
+
className: e(t["controls-button__tooltip"], t[`controls-button__tooltip--${a}`]),
|
|
68
|
+
children: r
|
|
69
|
+
}
|
|
70
|
+
)
|
|
59
71
|
]
|
|
60
72
|
}
|
|
61
73
|
)
|
|
62
74
|
] });
|
|
63
75
|
};
|
|
64
76
|
export {
|
|
65
|
-
|
|
77
|
+
y as ControlsButton
|
|
66
78
|
};
|
|
67
79
|
//# sourceMappingURL=ControlsButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlsButton.js","sources":["../../../src/components/ControlsButton/ControlsButton.tsx"],"sourcesContent":["import { useId } from 'react';\r\nimport { clsx } from 'clsx';\r\n\r\nimport type { ChangeEvent, ReactNode } from 'react';\r\nimport type { IconProps } from 'components/Icon';\r\n\r\nimport styles from './ControlsButton.module.css';\r\n\r\nimport { Icon } from 'components/Icon';\r\n\r\nexport interface ControlsButtonProps {\r\n /** to set type/behaviour of input radio or checkbox */\r\n type?: 'radio' | 'checkbox';\r\n /** button label */\r\n label: string;\r\n /** button value */\r\n value: string;\r\n /** set if icon is needed in font of label */\r\n iconName?: IconProps['name'];\r\n /** set if prefix is needed above of label */\r\n prefix?: string;\r\n /** set tooltip */\r\n tooltip?: ReactNode;\r\n /** set if used as radiogroup */\r\n name?: string;\r\n /** `true` to set squared button; otherwise, `false`. The default is `false`. Note: hides icon */\r\n forceSquared?: boolean;\r\n /** to set default status */\r\n checked?: boolean;\r\n /** `true` to disable the button; otherwise, `false`. The default is `false`. */\r\n disabled?: boolean;\r\n /** The callback function that is invoked when the radio button changes value. */\r\n onSetValue: (event: ChangeEvent<HTMLInputElement>) => void;\r\n}\r\n\r\nexport const ControlsButton = ({\r\n type = 'checkbox',\r\n label,\r\n value,\r\n iconName,\r\n prefix,\r\n tooltip,\r\n name,\r\n forceSquared = false,\r\n checked,\r\n disabled,\r\n onSetValue,\r\n}: ControlsButtonProps) => {\r\n const idPrefix = useId();\r\n const sanitizedLabel = label.replace(/\\s+/g, '_');\r\n const baseId = `${idPrefix}${sanitizedLabel}`;\r\n const tooltipId = `${baseId}-tooltip`;\r\n\r\n return (\r\n <>\r\n <input\r\n type={type}\r\n id={baseId}\r\n name={name ?? sanitizedLabel}\r\n disabled={disabled}\r\n value={value}\r\n checked={checked}\r\n onChange={onSetValue}\r\n className={styles['controls-input']}\r\n aria-describedby={tooltip ? tooltipId : undefined}\r\n />\r\n <label\r\n htmlFor={baseId}\r\n className={clsx(styles['controls-button'], [\r\n forceSquared && styles['controls-button--squared'],\r\n prefix && styles['controls-button--with-prefix'],\r\n iconName && styles['controls-button--with-icon'],\r\n ])}\r\n >\r\n {iconName && <Icon name={iconName} size={20} />}\r\n <div className={styles['controls-button__wrapper']}>\r\n {prefix && <div className={styles['controls-button__prefix']}>{prefix}</div>}\r\n {label}\r\n </div>\r\n {tooltip && (\r\n <div
|
|
1
|
+
{"version":3,"file":"ControlsButton.js","sources":["../../../src/components/ControlsButton/ControlsButton.tsx"],"sourcesContent":["import { useId } from 'react';\r\nimport { clsx } from 'clsx';\r\n\r\nimport type { ChangeEvent, ReactNode } from 'react';\r\nimport type { IconProps } from 'components/Icon';\r\n\r\nimport styles from './ControlsButton.module.css';\r\n\r\nimport { Icon } from 'components/Icon';\r\n\r\nexport interface ControlsButtonProps {\r\n /** to set type/behaviour of input radio or checkbox */\r\n type?: 'radio' | 'checkbox';\r\n /** button label */\r\n label: string;\r\n /** button value */\r\n value: string;\r\n /** set if icon is needed in font of label */\r\n iconName?: IconProps['name'];\r\n /** set if prefix is needed above of label */\r\n prefix?: string;\r\n /** set tooltip */\r\n tooltip?: ReactNode;\r\n /** set horizontal position of the tooltip */\r\n tooltipPosition?: 'left' | 'center' | 'right';\r\n /** set if used as radiogroup */\r\n name?: string;\r\n /** `true` to set squared button; otherwise, `false`. The default is `false`. Note: hides icon */\r\n forceSquared?: boolean;\r\n /** to set default status */\r\n checked?: boolean;\r\n /** `true` to disable the button; otherwise, `false`. The default is `false`. */\r\n disabled?: boolean;\r\n /** The callback function that is invoked when the radio button changes value. */\r\n onSetValue: (event: ChangeEvent<HTMLInputElement>) => void;\r\n}\r\n\r\nexport const ControlsButton = ({\r\n type = 'checkbox',\r\n label,\r\n value,\r\n iconName,\r\n prefix,\r\n tooltip,\r\n tooltipPosition = 'center',\r\n name,\r\n forceSquared = false,\r\n checked,\r\n disabled,\r\n onSetValue,\r\n}: ControlsButtonProps) => {\r\n const idPrefix = useId();\r\n const sanitizedLabel = label.replace(/\\s+/g, '_');\r\n const baseId = `${idPrefix}${sanitizedLabel}`;\r\n const tooltipId = `${baseId}-tooltip`;\r\n\r\n return (\r\n <>\r\n <input\r\n type={type}\r\n id={baseId}\r\n name={name ?? sanitizedLabel}\r\n disabled={disabled}\r\n value={value}\r\n checked={checked}\r\n onChange={onSetValue}\r\n className={styles['controls-input']}\r\n aria-describedby={tooltip ? tooltipId : undefined}\r\n />\r\n <label\r\n htmlFor={baseId}\r\n className={clsx(styles['controls-button'], [\r\n forceSquared && styles['controls-button--squared'],\r\n prefix && styles['controls-button--with-prefix'],\r\n iconName && styles['controls-button--with-icon'],\r\n ])}\r\n >\r\n {iconName && <Icon name={iconName} size={20} />}\r\n <div className={styles['controls-button__wrapper']}>\r\n {prefix && <div className={styles['controls-button__prefix']}>{prefix}</div>}\r\n {label}\r\n </div>\r\n {tooltip && (\r\n <div\r\n id={tooltipId}\r\n role=\"tooltip\"\r\n className={clsx(styles['controls-button__tooltip'], styles[`controls-button__tooltip--${tooltipPosition}`])}\r\n >\r\n {tooltip}\r\n </div>\r\n )}\r\n </label>\r\n </>\r\n );\r\n};\r\n"],"names":["ControlsButton","type","label","value","iconName","prefix","tooltip","tooltipPosition","name","forceSquared","checked","disabled","onSetValue","idPrefix","useId","sanitizedLabel","baseId","tooltipId","jsxs","Fragment","jsx","styles","clsx","Icon"],"mappings":";;;;;;;;;;;;;;;;GAqCaA,IAAiB,CAAC;AAAA,EAC7B,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAA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,EAAO,6BAA6Bd,CAAe,EAAE,CAAC;AAAA,cAEzG,UAAAD;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ,GACF;AAEJ;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { l as
|
|
1
|
+
import { jsx as n, jsxs as a, Fragment as r } from "react/jsx-runtime";
|
|
2
|
+
import { l as o } from "../../index-BYGu3RV5.js";
|
|
3
3
|
import { ControlsButton as t } from "./ControlsButton.js";
|
|
4
4
|
import { Icons as c } from "../Icon/icons/index.js";
|
|
5
|
-
const
|
|
5
|
+
const i = Object.keys(c), s = "<ControlsButton type={radio or checkbox} label={} value={} prefix={} tooltip={} forceSquared={}isChecked={} variant={} disabled={} notValid={} onSetValue={} key={} />", S = {
|
|
6
6
|
title: "Atoms/ControlsButton",
|
|
7
7
|
component: t,
|
|
8
8
|
argTypes: {
|
|
@@ -14,7 +14,7 @@ const s = Object.keys(c), i = "<ControlsButton type={radio or checkbox} label={}
|
|
|
14
14
|
},
|
|
15
15
|
iconName: {
|
|
16
16
|
control: { type: "select" },
|
|
17
|
-
options:
|
|
17
|
+
options: i
|
|
18
18
|
},
|
|
19
19
|
forceSquared: {
|
|
20
20
|
control: "boolean"
|
|
@@ -33,33 +33,33 @@ const s = Object.keys(c), i = "<ControlsButton type={radio or checkbox} label={}
|
|
|
33
33
|
},
|
|
34
34
|
parameters: {
|
|
35
35
|
inspectComponent: t,
|
|
36
|
-
codeString:
|
|
36
|
+
codeString: s
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, e = (l) => /* @__PURE__ */ n(t, { ...l }), p = e.bind({});
|
|
39
39
|
p.args = {
|
|
40
40
|
type: "checkbox",
|
|
41
41
|
label: "1.2",
|
|
42
42
|
value: "1.2",
|
|
43
43
|
forceSquared: !0,
|
|
44
|
-
onSetValue:
|
|
44
|
+
onSetValue: o()
|
|
45
45
|
};
|
|
46
|
-
const b =
|
|
46
|
+
const b = e.bind({});
|
|
47
47
|
b.args = {
|
|
48
48
|
type: "checkbox",
|
|
49
49
|
label: "1.3",
|
|
50
50
|
value: "1.3",
|
|
51
51
|
prefix: "13",
|
|
52
|
-
onSetValue:
|
|
52
|
+
onSetValue: o()
|
|
53
53
|
};
|
|
54
|
-
const u =
|
|
54
|
+
const u = e.bind({});
|
|
55
55
|
u.args = {
|
|
56
56
|
type: "checkbox",
|
|
57
57
|
label: "2.1",
|
|
58
58
|
value: "2.1",
|
|
59
59
|
iconName: "AcademicCap",
|
|
60
|
-
onSetValue:
|
|
60
|
+
onSetValue: o()
|
|
61
61
|
};
|
|
62
|
-
const d =
|
|
62
|
+
const d = e.bind({});
|
|
63
63
|
d.args = {
|
|
64
64
|
type: "checkbox",
|
|
65
65
|
label: "5",
|
|
@@ -67,10 +67,11 @@ d.args = {
|
|
|
67
67
|
prefix: "40",
|
|
68
68
|
tooltip: /* @__PURE__ */ a(r, { children: [
|
|
69
69
|
"15 dec - 19 dec",
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ n("br", {}),
|
|
71
71
|
"2025"
|
|
72
72
|
] }),
|
|
73
|
-
|
|
73
|
+
tooltipPosition: "center",
|
|
74
|
+
onSetValue: o()
|
|
74
75
|
};
|
|
75
76
|
export {
|
|
76
77
|
p as ControlsButtonExample,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlsButton.stories.js","sources":["../../../src/components/ControlsButton/ControlsButton.stories.tsx"],"sourcesContent":["import { fn } from 'storybook/test';\r\n\r\nimport type { Meta, StoryFn } from '@storybook/react';\r\nimport type { ControlsButtonProps } from './ControlsButton';\r\n\r\nimport { ControlsButton } from './ControlsButton';\r\n\r\nimport { Icons } from 'components/Icon/icons';\r\n\r\nconst iconNames = Object.keys(Icons) as (keyof typeof Icons)[];\r\n\r\nconst codeString =\r\n '<ControlsButton type={radio or checkbox} label={} value={} prefix={} tooltip={} forceSquared={}isChecked={} variant={} disabled={} notValid={} onSetValue={} key={} />';\r\n\r\n// eslint-disable-next-line import/no-default-export\r\nexport default {\r\n title: 'Atoms/ControlsButton',\r\n component: ControlsButton,\r\n argTypes: {\r\n label: {\r\n control: 'text',\r\n },\r\n value: {\r\n control: 'string',\r\n },\r\n iconName: {\r\n control: { type: 'select' },\r\n options: iconNames,\r\n },\r\n forceSquared: {\r\n control: 'boolean',\r\n },\r\n isChecked: {\r\n control: 'boolean',\r\n },\r\n disabled: {\r\n control: 'boolean',\r\n },\r\n onSetValue: {\r\n table: {\r\n disable: true,\r\n },\r\n },\r\n },\r\n parameters: {\r\n inspectComponent: ControlsButton,\r\n codeString: codeString,\r\n },\r\n} as Meta<ControlsButtonProps>;\r\n\r\nconst Template: StoryFn<ControlsButtonProps> = (args) => <ControlsButton {...args} />;\r\n\r\nexport const ControlsButtonExample = Template.bind({});\r\nControlsButtonExample.args = {\r\n type: 'checkbox',\r\n label: '1.2',\r\n value: '1.2',\r\n forceSquared: true,\r\n onSetValue: fn(),\r\n};\r\n\r\nexport const WithPrefix = Template.bind({});\r\nWithPrefix.args = {\r\n type: 'checkbox',\r\n label: '1.3',\r\n value: '1.3',\r\n prefix: '13',\r\n onSetValue: fn(),\r\n};\r\n\r\nexport const WithIcon = Template.bind({});\r\nWithIcon.args = {\r\n type: 'checkbox',\r\n label: '2.1',\r\n value: '2.1',\r\n iconName: 'AcademicCap',\r\n onSetValue: fn(),\r\n};\r\n\r\nexport const WithTooltip = Template.bind({});\r\nWithTooltip.args = {\r\n type: 'checkbox',\r\n label: '5',\r\n value: '5',\r\n prefix: '40',\r\n tooltip: (\r\n <>\r\n 15 dec - 19 dec\r\n <br />\r\n 2025\r\n </>\r\n ),\r\n onSetValue: fn(),\r\n};\r\n"],"names":["iconNames","Icons","codeString","ControlsButton_stories","ControlsButton","Template","args","jsx","ControlsButtonExample","fn","WithPrefix","WithIcon","WithTooltip","jsxs","Fragment"],"mappings":";;;;AASA,MAAMA,IAAY,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AAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SACE,gBAAAC,EAAAC,GAAA,EAAE,UAAA;AAAA,IAAA;AAAA,sBAEC,MAAA,EAAG;AAAA,IAAE;AAAA,EAAA,GAER;AAAA,EAEF,YAAYL,EAAA;AACd;"}
|
|
1
|
+
{"version":3,"file":"ControlsButton.stories.js","sources":["../../../src/components/ControlsButton/ControlsButton.stories.tsx"],"sourcesContent":["import { fn } from 'storybook/test';\r\n\r\nimport type { Meta, StoryFn } from '@storybook/react';\r\nimport type { ControlsButtonProps } from './ControlsButton';\r\n\r\nimport { ControlsButton } from './ControlsButton';\r\n\r\nimport { Icons } from 'components/Icon/icons';\r\n\r\nconst iconNames = Object.keys(Icons) as (keyof typeof Icons)[];\r\n\r\nconst codeString =\r\n '<ControlsButton type={radio or checkbox} label={} value={} prefix={} tooltip={} forceSquared={}isChecked={} variant={} disabled={} notValid={} onSetValue={} key={} />';\r\n\r\n// eslint-disable-next-line import/no-default-export\r\nexport default {\r\n title: 'Atoms/ControlsButton',\r\n component: ControlsButton,\r\n argTypes: {\r\n label: {\r\n control: 'text',\r\n },\r\n value: {\r\n control: 'string',\r\n },\r\n iconName: {\r\n control: { type: 'select' },\r\n options: iconNames,\r\n },\r\n forceSquared: {\r\n control: 'boolean',\r\n },\r\n isChecked: {\r\n control: 'boolean',\r\n },\r\n disabled: {\r\n control: 'boolean',\r\n },\r\n onSetValue: {\r\n table: {\r\n disable: true,\r\n },\r\n },\r\n },\r\n parameters: {\r\n inspectComponent: ControlsButton,\r\n codeString: codeString,\r\n },\r\n} as Meta<ControlsButtonProps>;\r\n\r\nconst Template: StoryFn<ControlsButtonProps> = (args) => <ControlsButton {...args} />;\r\n\r\nexport const ControlsButtonExample = Template.bind({});\r\nControlsButtonExample.args = {\r\n type: 'checkbox',\r\n label: '1.2',\r\n value: '1.2',\r\n forceSquared: true,\r\n onSetValue: fn(),\r\n};\r\n\r\nexport const WithPrefix = Template.bind({});\r\nWithPrefix.args = {\r\n type: 'checkbox',\r\n label: '1.3',\r\n value: '1.3',\r\n prefix: '13',\r\n onSetValue: fn(),\r\n};\r\n\r\nexport const WithIcon = Template.bind({});\r\nWithIcon.args = {\r\n type: 'checkbox',\r\n label: '2.1',\r\n value: '2.1',\r\n iconName: 'AcademicCap',\r\n onSetValue: fn(),\r\n};\r\n\r\nexport const WithTooltip = Template.bind({});\r\nWithTooltip.args = {\r\n type: 'checkbox',\r\n label: '5',\r\n value: '5',\r\n prefix: '40',\r\n tooltip: (\r\n <>\r\n 15 dec - 19 dec\r\n <br />\r\n 2025\r\n </>\r\n ),\r\n tooltipPosition: 'center',\r\n onSetValue: fn(),\r\n};\r\n"],"names":["iconNames","Icons","codeString","ControlsButton_stories","ControlsButton","Template","args","jsx","ControlsButtonExample","fn","WithPrefix","WithIcon","WithTooltip","jsxs","Fragment"],"mappings":";;;;AASA,MAAMA,IAAY,OAAO,KAAKC,CAAK,GAE7BC,IACJ,0KAGFC,IAAe;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA,IAAA;AAAA,IAEX,OAAO;AAAA,MACL,SAAS;AAAA,IAAA;AAAA,IAEX,UAAU;AAAA,MACR,SAAS,EAAE,MAAM,SAAA;AAAA,MACjB,SAASJ;AAAA,IAAA;AAAA,IAEX,cAAc;AAAA,MACZ,SAAS;AAAA,IAAA;AAAA,IAEX,WAAW;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,IAEX,UAAU;AAAA,MACR,SAAS;AAAA,IAAA;AAAA,IAEX,YAAY;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,EACF;AAAA,EAEF,YAAY;AAAA,IACV,kBAAkBI;AAAA,IAClB,YAAAF;AAAA,EAAA;AAEJ,GAEMG,IAAyC,CAACC,MAAS,gBAAAC,EAACH,GAAA,EAAgB,GAAGE,GAAM,GAEtEE,IAAwBH,EAAS,KAAK,CAAA,CAAE;AACrDG,EAAsB,OAAO;AAAA,EAC3B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,cAAc;AAAA,EACd,YAAYC,EAAA;AACd;AAEO,MAAMC,IAAaL,EAAS,KAAK,CAAA,CAAE;AAC1CK,EAAW,OAAO;AAAA,EAChB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,YAAYD,EAAA;AACd;AAEO,MAAME,IAAWN,EAAS,KAAK,CAAA,CAAE;AACxCM,EAAS,OAAO;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAYF,EAAA;AACd;AAEO,MAAMG,IAAcP,EAAS,KAAK,CAAA,CAAE;AAC3CO,EAAY,OAAO;AAAA,EACjB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SACE,gBAAAC,EAAAC,GAAA,EAAE,UAAA;AAAA,IAAA;AAAA,sBAEC,MAAA,EAAG;AAAA,IAAE;AAAA,EAAA,GAER;AAAA,EAEF,iBAAiB;AAAA,EACjB,YAAYL,EAAA;AACd;"}
|
|
@@ -1,52 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { s as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { useSelect as
|
|
7
|
-
const O =
|
|
8
|
-
const { variant:
|
|
9
|
-
|
|
1
|
+
import { jsx as c, jsxs as K } from "react/jsx-runtime";
|
|
2
|
+
import { c as m } from "../../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { forwardRef as N, useRef as h, useEffect as u } from "react";
|
|
4
|
+
import { s as t } from "../../../SelectListbox.module-yzXaWwsm.js";
|
|
5
|
+
import { Icon as R } from "../../Icon/Icon.js";
|
|
6
|
+
import { useSelect as S } from "../SelectProvider.js";
|
|
7
|
+
const O = N((y, b) => {
|
|
8
|
+
const { variant: f, size: k = "default", onChange: o, buttonLabelProp: w = "label", buttonLabelBold: I, disabled: L = !1 } = y, l = h(null), i = h(!0), { listboxId: C, isOpen: e, selectedValue: s, toggleListbox: D, setIsOpen: n, setActiveIndex: p, options: d } = S() || {}, E = (r) => {
|
|
9
|
+
if (r.key.length === 1) {
|
|
10
|
+
const a = r.key.toLocaleLowerCase(), g = d.findIndex(
|
|
11
|
+
(x) => !x.disabled && x.label.toLocaleLowerCase().startsWith(a)
|
|
12
|
+
);
|
|
13
|
+
if (g !== -1) {
|
|
14
|
+
p(g), e || n(!0), r.preventDefault();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
switch (r.key) {
|
|
10
19
|
case "Enter":
|
|
11
|
-
if (
|
|
12
|
-
|
|
20
|
+
if (r.preventDefault(), !e) {
|
|
21
|
+
n(!0);
|
|
13
22
|
return;
|
|
14
23
|
}
|
|
15
24
|
break;
|
|
16
25
|
case "Escape":
|
|
17
|
-
|
|
26
|
+
e && (r.stopPropagation(), p(d.findIndex((a) => a.value === s?.value)), n(!1));
|
|
18
27
|
break;
|
|
19
28
|
}
|
|
20
29
|
};
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
}), []),
|
|
26
|
-
|
|
27
|
-
}, [
|
|
30
|
+
return u(() => {
|
|
31
|
+
e ? (l.current?.children[0]).blur() : !i.current && (l.current?.children[0]).focus();
|
|
32
|
+
}, [e]), u(() => (i.current = !1, () => {
|
|
33
|
+
i.current = !0;
|
|
34
|
+
}), []), u(() => {
|
|
35
|
+
o && o(s);
|
|
36
|
+
}, [o, s]), /* @__PURE__ */ c("span", { ref: l, children: /* @__PURE__ */ K(
|
|
28
37
|
"button",
|
|
29
38
|
{
|
|
30
|
-
className:
|
|
31
|
-
[
|
|
32
|
-
[
|
|
39
|
+
className: m(t["select-listbox-trigger"], t[`select-listbox-trigger--${k}`], {
|
|
40
|
+
[t[`select-listbox-trigger--${f}`]]: f,
|
|
41
|
+
[t["select-listbox-trigger--bold"]]: I
|
|
33
42
|
}),
|
|
34
43
|
type: "button",
|
|
35
|
-
onClick:
|
|
36
|
-
onKeyDown:
|
|
37
|
-
"aria-expanded":
|
|
44
|
+
onClick: D,
|
|
45
|
+
onKeyDown: E,
|
|
46
|
+
"aria-expanded": e,
|
|
38
47
|
"aria-haspopup": "listbox",
|
|
39
|
-
"aria-label": `${
|
|
40
|
-
disabled:
|
|
41
|
-
"aria-controls":
|
|
42
|
-
...
|
|
48
|
+
"aria-label": `${s.label}`,
|
|
49
|
+
disabled: L,
|
|
50
|
+
"aria-controls": C,
|
|
51
|
+
...b && { ref: b },
|
|
43
52
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
53
|
+
/* @__PURE__ */ c("span", { className: t["select-listbox-trigger-label"], children: s[w] }),
|
|
54
|
+
/* @__PURE__ */ c(
|
|
55
|
+
R,
|
|
47
56
|
{
|
|
48
|
-
className:
|
|
49
|
-
[
|
|
57
|
+
className: m(t["select-listbox-trigger-icon"], {
|
|
58
|
+
[t["select-listbox-trigger-icon--open"]]: e
|
|
50
59
|
}),
|
|
51
60
|
name: "CheveronDown",
|
|
52
61
|
size: 16
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectButton.js","sources":["../../../../src/components/SelectListbox/components/SelectButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef, forwardRef } from 'react';\n\nimport type { KeyboardEvent } from 'react';\nimport type { OptionValue, SelectValue } from 'components/SelectListbox/SelectProvider';\n\nimport styles from 'components/SelectListbox/SelectListbox.module.css';\nimport { Icon } from 'components/Icon';\nimport { useSelect } from 'components/SelectListbox/SelectProvider';\n\nexport interface SelectButtonProps {\n variant?: 'noborder' | 'pill' | 'pillLeft' | 'pillRight' | 'darkBorder';\n size?: 'small' | 'medium' | 'default';\n onChange?: (option: OptionValue) => void;\n buttonLabelProp?: string;\n buttonLabelBold?: boolean;\n disabled?: boolean;\n}\n\nexport const SelectButton = forwardRef<HTMLButtonElement, SelectButtonProps>((props, ref) => {\n const { variant, size = 'default', onChange, buttonLabelProp = 'label', buttonLabelBold, disabled = false } = props;\n const buttonWrapper = useRef<HTMLSpanElement>(null);\n const isFirstRender = useRef(true);\n const { listboxId, isOpen, selectedValue, toggleListbox, setIsOpen, setActiveIndex, options } = useSelect() || {};\n\n const onTriggerKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n switch (event.key) {\n case 'Enter':\n event.preventDefault();\n if (!isOpen) {\n setIsOpen(true);\n return;\n }\n break;\n case 'Escape':\n if (isOpen) {\n event.stopPropagation();\n setActiveIndex(options.findIndex((option) => option.value === selectedValue?.value));\n setIsOpen(false);\n }\n break;\n }\n };\n\n useEffect(() => {\n isOpen\n ? (buttonWrapper.current?.children[0] as HTMLButtonElement).blur()\n : !isFirstRender.current && (buttonWrapper.current?.children[0] as HTMLButtonElement).focus();\n }, [isOpen]);\n\n useEffect(() => {\n isFirstRender.current = false;\n\n return () => {\n isFirstRender.current = true;\n };\n }, []);\n\n useEffect(() => {\n if (onChange) onChange(selectedValue);\n }, [onChange, selectedValue]);\n\n return (\n <span ref={buttonWrapper}>\n <button\n className={clsx(styles['select-listbox-trigger'], styles[`select-listbox-trigger--${size}`], {\n [styles[`select-listbox-trigger--${variant}`]]: variant,\n [styles['select-listbox-trigger--bold']]: buttonLabelBold,\n })}\n type=\"button\"\n onClick={toggleListbox}\n onKeyDown={onTriggerKeyDown}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-label={`${selectedValue.label}`}\n disabled={disabled}\n aria-controls={listboxId}\n {...(ref && { ref: ref })}\n >\n <span className={styles['select-listbox-trigger-label']}>\n {selectedValue[buttonLabelProp as keyof SelectValue]}\n </span>\n\n <Icon\n className={clsx(styles['select-listbox-trigger-icon'], {\n [styles['select-listbox-trigger-icon--open']]: isOpen,\n })}\n name=\"CheveronDown\"\n size={16}\n />\n </button>\n </span>\n );\n});\n"],"names":["SelectButton","forwardRef","props","ref","variant","size","onChange","buttonLabelProp","buttonLabelBold","disabled","buttonWrapper","useRef","isFirstRender","listboxId","isOpen","selectedValue","toggleListbox","setIsOpen","setActiveIndex","options","useSelect","onTriggerKeyDown","event","option","useEffect","jsx","jsxs","clsx","styles","Icon"],"mappings":";;;;;;AAmBO,MAAMA,IAAeC,EAAiD,CAACC,GAAOC,MAAQ;AAC3F,QAAM,EAAE,SAAAC,GAAS,MAAAC,IAAO,WAAW,UAAAC,GAAU,iBAAAC,IAAkB,SAAS,iBAAAC,GAAiB,UAAAC,IAAW,GAAA,IAAUP,GACxGQ,IAAgBC,EAAwB,IAAI,GAC5CC,IAAgBD,EAAO,EAAI,GAC3B,EAAE,WAAAE,GAAW,QAAAC,GAAQ,eAAAC,GAAe,eAAAC,GAAe,WAAAC,GAAW,gBAAAC,GAAgB,SAAAC,EAAA,IAAYC,EAAA,KAAe,CAAA,GAEzGC,IAAmB,CAACC,MAA4C;AACpE,YAAQA,EAAM,KAAA;AAAA,MACZ,KAAK;AAEH,YADAA,EAAM,eAAA,GACF,CAACR,GAAQ;AACX,UAAAG,EAAU,EAAI;AACd;AAAA,QAAA;AAEF;AAAA,MACF,KAAK;AACH,QAAIH,MACFQ,EAAM,gBAAA,GACNJ,EAAeC,EAAQ,UAAU,
|
|
1
|
+
{"version":3,"file":"SelectButton.js","sources":["../../../../src/components/SelectListbox/components/SelectButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef, forwardRef } from 'react';\n\nimport type { KeyboardEvent } from 'react';\nimport type { OptionValue, SelectValue } from 'components/SelectListbox/SelectProvider';\n\nimport styles from 'components/SelectListbox/SelectListbox.module.css';\nimport { Icon } from 'components/Icon';\nimport { useSelect } from 'components/SelectListbox/SelectProvider';\n\nexport interface SelectButtonProps {\n variant?: 'noborder' | 'pill' | 'pillLeft' | 'pillRight' | 'darkBorder';\n size?: 'small' | 'medium' | 'default';\n onChange?: (option: OptionValue) => void;\n buttonLabelProp?: string;\n buttonLabelBold?: boolean;\n disabled?: boolean;\n}\n\nexport const SelectButton = forwardRef<HTMLButtonElement, SelectButtonProps>((props, ref) => {\n const { variant, size = 'default', onChange, buttonLabelProp = 'label', buttonLabelBold, disabled = false } = props;\n const buttonWrapper = useRef<HTMLSpanElement>(null);\n const isFirstRender = useRef(true);\n const { listboxId, isOpen, selectedValue, toggleListbox, setIsOpen, setActiveIndex, options } = useSelect() || {};\n\n const onTriggerKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.key.length === 1) {\n const key = event.key.toLocaleLowerCase();\n const optionIndexStartsWithKey = options.findIndex(\n (option) => !option.disabled && option.label.toLocaleLowerCase().startsWith(key)\n );\n if (optionIndexStartsWithKey !== -1) {\n setActiveIndex(optionIndexStartsWithKey);\n if (!isOpen) setIsOpen(true);\n event.preventDefault();\n return;\n }\n }\n\n switch (event.key) {\n case 'Enter':\n event.preventDefault();\n if (!isOpen) {\n setIsOpen(true);\n return;\n }\n break;\n case 'Escape':\n if (isOpen) {\n event.stopPropagation();\n setActiveIndex(options.findIndex((option) => option.value === selectedValue?.value));\n setIsOpen(false);\n }\n break;\n }\n };\n\n useEffect(() => {\n isOpen\n ? (buttonWrapper.current?.children[0] as HTMLButtonElement).blur()\n : !isFirstRender.current && (buttonWrapper.current?.children[0] as HTMLButtonElement).focus();\n }, [isOpen]);\n\n useEffect(() => {\n isFirstRender.current = false;\n\n return () => {\n isFirstRender.current = true;\n };\n }, []);\n\n useEffect(() => {\n if (onChange) onChange(selectedValue);\n }, [onChange, selectedValue]);\n\n return (\n <span ref={buttonWrapper}>\n <button\n className={clsx(styles['select-listbox-trigger'], styles[`select-listbox-trigger--${size}`], {\n [styles[`select-listbox-trigger--${variant}`]]: variant,\n [styles['select-listbox-trigger--bold']]: buttonLabelBold,\n })}\n type=\"button\"\n onClick={toggleListbox}\n onKeyDown={onTriggerKeyDown}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-label={`${selectedValue.label}`}\n disabled={disabled}\n aria-controls={listboxId}\n {...(ref && { ref: ref })}\n >\n <span className={styles['select-listbox-trigger-label']}>\n {selectedValue[buttonLabelProp as keyof SelectValue]}\n </span>\n\n <Icon\n className={clsx(styles['select-listbox-trigger-icon'], {\n [styles['select-listbox-trigger-icon--open']]: isOpen,\n })}\n name=\"CheveronDown\"\n size={16}\n />\n </button>\n </span>\n );\n});\n"],"names":["SelectButton","forwardRef","props","ref","variant","size","onChange","buttonLabelProp","buttonLabelBold","disabled","buttonWrapper","useRef","isFirstRender","listboxId","isOpen","selectedValue","toggleListbox","setIsOpen","setActiveIndex","options","useSelect","onTriggerKeyDown","event","key","optionIndexStartsWithKey","option","useEffect","jsx","jsxs","clsx","styles","Icon"],"mappings":";;;;;;AAmBO,MAAMA,IAAeC,EAAiD,CAACC,GAAOC,MAAQ;AAC3F,QAAM,EAAE,SAAAC,GAAS,MAAAC,IAAO,WAAW,UAAAC,GAAU,iBAAAC,IAAkB,SAAS,iBAAAC,GAAiB,UAAAC,IAAW,GAAA,IAAUP,GACxGQ,IAAgBC,EAAwB,IAAI,GAC5CC,IAAgBD,EAAO,EAAI,GAC3B,EAAE,WAAAE,GAAW,QAAAC,GAAQ,eAAAC,GAAe,eAAAC,GAAe,WAAAC,GAAW,gBAAAC,GAAgB,SAAAC,EAAA,IAAYC,EAAA,KAAe,CAAA,GAEzGC,IAAmB,CAACC,MAA4C;AACpE,QAAIA,EAAM,IAAI,WAAW,GAAG;AAC1B,YAAMC,IAAMD,EAAM,IAAI,kBAAA,GAChBE,IAA2BL,EAAQ;AAAA,QACvC,CAACM,MAAW,CAACA,EAAO,YAAYA,EAAO,MAAM,oBAAoB,WAAWF,CAAG;AAAA,MAAA;AAEjF,UAAIC,MAA6B,IAAI;AACnC,QAAAN,EAAeM,CAAwB,GAClCV,KAAQG,EAAU,EAAI,GAC3BK,E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AA;AAAA,QAAA,gBAAAwB,EAAC,UAAK,WAAWG,EAAO,8BAA8B,GACnD,UAAAf,EAAcR,CAAoC,GACrD;AAAA,QAEA,gBAAAoB;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,WAAWF,EAAKC,EAAO,6BAA6B,GAAG;AAAA,cACrD,CAACA,EAAO,mCAAmC,CAAC,GAAGhB;AAAA,YAAA,CAChD;AAAA,YACD,MAAK;AAAA,YACL,MAAM;AAAA,UAAA;AAAA,QAAA;AAAA,MACR;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,CAAC;"}
|
|
@@ -1,58 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useSelect as
|
|
1
|
+
import { jsxs as v, Fragment as x, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as I } from "../../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { useRef as O, useEffect as k } from "react";
|
|
4
|
+
import { useSelect as g } from "../SelectProvider.js";
|
|
5
5
|
import { s as c } from "../../../SelectListbox.module-yzXaWwsm.js";
|
|
6
|
-
const
|
|
7
|
-
const i =
|
|
8
|
-
p(o[
|
|
9
|
-
},
|
|
10
|
-
|
|
6
|
+
const K = ({ option: a, index: s, dividerAfter: u, children: w }) => {
|
|
7
|
+
const i = O(null), { isOpen: l, activeIndex: t, setActiveIndex: r, selectedValue: n, setSelectedValue: p, setIsOpen: f, options: o } = g(), y = (e) => {
|
|
8
|
+
p(o[e]), f(!1);
|
|
9
|
+
}, h = (e) => {
|
|
10
|
+
if (e.key.length === 1) {
|
|
11
|
+
const D = e.key.toLocaleLowerCase(), d = o.findIndex(
|
|
12
|
+
(b) => !b.disabled && b.label.toLocaleLowerCase().startsWith(D)
|
|
13
|
+
);
|
|
14
|
+
if (d !== -1) {
|
|
15
|
+
r(d), e.preventDefault();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
switch (e.key) {
|
|
11
20
|
case "Tab":
|
|
12
|
-
|
|
21
|
+
e.preventDefault(), l && f(!1);
|
|
13
22
|
break;
|
|
14
23
|
case "ArrowDown":
|
|
15
24
|
case "ArrowUp":
|
|
16
|
-
if (
|
|
25
|
+
if (e.preventDefault(), !l)
|
|
17
26
|
return;
|
|
18
|
-
|
|
27
|
+
e.key === "ArrowDown" && t < o.length - 1 && r(t + 1), e.key === "ArrowUp" && t > 0 && r(t - 1);
|
|
19
28
|
break;
|
|
20
29
|
case "Enter":
|
|
21
|
-
|
|
30
|
+
e.preventDefault(), o?.length && t > -1 && !o[t].disabled && y(t);
|
|
22
31
|
break;
|
|
23
32
|
case "Escape":
|
|
24
|
-
|
|
33
|
+
l && (e.stopPropagation(), f(!1));
|
|
25
34
|
break;
|
|
26
35
|
}
|
|
27
36
|
};
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
n.value ===
|
|
32
|
-
}, [
|
|
33
|
-
/* @__PURE__ */
|
|
37
|
+
return k(() => {
|
|
38
|
+
s === t && (l ? i.current?.focus() : i.current?.blur());
|
|
39
|
+
}, [t, s, l]), k(() => {
|
|
40
|
+
n.value === a.value && r(s);
|
|
41
|
+
}, [s, a.value, n.value, r]), /* @__PURE__ */ v(x, { children: [
|
|
42
|
+
/* @__PURE__ */ m(
|
|
34
43
|
"li",
|
|
35
44
|
{
|
|
36
|
-
className:
|
|
37
|
-
[c["select-listbox-option--active"]]:
|
|
38
|
-
[c["select-listbox-option--divider"]]:
|
|
45
|
+
className: I(c["select-listbox-option"], {
|
|
46
|
+
[c["select-listbox-option--active"]]: s === t,
|
|
47
|
+
[c["select-listbox-option--divider"]]: s + 1 === u
|
|
39
48
|
}),
|
|
40
|
-
...!
|
|
41
|
-
onClick: () => p(
|
|
42
|
-
onKeyDown:
|
|
49
|
+
...!a.disabled && {
|
|
50
|
+
onClick: () => p(a),
|
|
51
|
+
onKeyDown: h,
|
|
43
52
|
tabIndex: 0,
|
|
44
53
|
role: "option",
|
|
45
|
-
"aria-selected": n.value ===
|
|
54
|
+
"aria-selected": n.value === a.value
|
|
46
55
|
},
|
|
47
56
|
ref: i,
|
|
48
|
-
children:
|
|
57
|
+
children: w
|
|
49
58
|
},
|
|
50
|
-
`${
|
|
59
|
+
`${a.value}`
|
|
51
60
|
),
|
|
52
|
-
|
|
61
|
+
s + 1 === u && /* @__PURE__ */ m("div", { className: c["select-listbox-divider"], "aria-hidden": "true" })
|
|
53
62
|
] });
|
|
54
63
|
};
|
|
55
64
|
export {
|
|
56
|
-
|
|
65
|
+
K as SelectOption
|
|
57
66
|
};
|
|
58
67
|
//# sourceMappingURL=SelectOption.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectOption.js","sources":["../../../../src/components/SelectListbox/components/SelectOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef } from 'react';\n\nimport type { KeyboardEvent, ReactNode } from 'react';\nimport type { OptionValue } from 'components/SelectListbox/SelectProvider';\n\nimport { useSelect } from 'components/SelectListbox/SelectProvider';\nimport styles from 'components/SelectListbox/SelectListbox.module.css';\n\nexport interface SelectOptionProps {\n option: OptionValue;\n index: number;\n key: string | number;\n dividerAfter?: number;\n children: ReactNode;\n}\n\nexport const SelectOption = ({ option, index, dividerAfter, children }: SelectOptionProps) => {\n const selectOptionRef = useRef<HTMLLIElement>(null);\n const { isOpen, activeIndex, setActiveIndex, selectedValue, setSelectedValue, setIsOpen, options } = useSelect();\n\n const handleSelectOption = (aIndex: number) => {\n setSelectedValue(options[aIndex]);\n setIsOpen(false);\n };\n\n const onOptionKeyDown = (event: KeyboardEvent<HTMLLIElement>) => {\n switch (event.key) {\n case 'Tab':\n event.preventDefault();\n if (isOpen) {\n setIsOpen(false);\n }\n break;\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n if (!isOpen) {\n return;\n }\n if (event.key === 'ArrowDown' && activeIndex < options.length - 1) {\n setActiveIndex(activeIndex + 1);\n }\n if (event.key === 'ArrowUp' && activeIndex > 0) {\n setActiveIndex(activeIndex - 1);\n }\n break;\n case 'Enter':\n event.preventDefault();\n if (options?.length && activeIndex > -1 && !options[activeIndex].disabled) {\n handleSelectOption(activeIndex);\n }\n break;\n case 'Escape':\n if (isOpen) {\n event.stopPropagation();\n setIsOpen(false);\n }\n break;\n }\n };\n\n useEffect(() => {\n if (index === activeIndex) {\n isOpen ? selectOptionRef.current?.focus() : selectOptionRef.current?.blur();\n }\n }, [activeIndex, index, isOpen]);\n\n useEffect(() => {\n if (selectedValue.value === option.value) {\n setActiveIndex(index);\n }\n }, [index, option.value, selectedValue.value, setActiveIndex]);\n\n return (\n <>\n <li\n className={clsx(styles['select-listbox-option'], {\n [styles['select-listbox-option--active']]: index === activeIndex,\n [styles['select-listbox-option--divider']]: index + 1 === dividerAfter,\n })}\n key={`${option.value}`}\n {...(!option.disabled && {\n onClick: () => setSelectedValue(option),\n onKeyDown: onOptionKeyDown,\n tabIndex: 0,\n role: 'option',\n 'aria-selected': selectedValue.value === option.value,\n })}\n ref={selectOptionRef}\n >\n {children}\n </li>\n {index + 1 === dividerAfter && <div className={styles['select-listbox-divider']} aria-hidden=\"true\" />}\n </>\n );\n};\n"],"names":["SelectOption","option","index","dividerAfter","children","selectOptionRef","useRef","isOpen","activeIndex","setActiveIndex","selectedValue","setSelectedValue","setIsOpen","options","useSelect","handleSelectOption","aIndex","onOptionKeyDown","event","useEffect","jsxs","Fragment","jsx","clsx","styles"],"mappings":";;;;;AAiBO,MAAMA,IAAe,CAAC,EAAE,QAAAC,GAAQ,OAAAC,GAAO,cAAAC,GAAc,UAAAC,QAAkC;AAC5F,QAAMC,IAAkBC,EAAsB,IAAI,GAC5C,EAAE,QAAAC,GAAQ,aAAAC,GAAa,gBAAAC,GAAgB,eAAAC,GAAe,kBAAAC,GAAkB,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAA,GAE/FC,IAAqB,CAACC,MAAmB;AAC7C,IAAAL,EAAiBE,EAAQG,CAAM,CAAC,GAChCJ,EAAU,EAAK;AAAA,EAAA,GAGXK,IAAkB,CAACC,MAAwC;AAC/D,YAAQA,EAAM,KAAA;AAAA,MACZ,KAAK;AACH,QAAAA,EAAM,eAAA,GACFX,KACFK,EAAU,EAAK;AAEjB;AAAA,MACF,KAAK;AAAA,MACL,KAAK;AAEH,YADAM,EAAM,eAAA,GACF,CAACX;AACH;AAEF,QAAIW,EAAM,QAAQ,eAAeV,IAAcK,EAAQ,SAAS,KAC9DJ,EAAeD,IAAc,CAAC,GAE5BU,EAAM,QAAQ,aAAaV,IAAc,KAC3CC,EAAeD,IAAc,CAAC;AAEhC;AAAA,MACF,KAAK;AACH,QAAAU,EAAM,eAAA,GACFL,GAAS,UAAUL,IAAc,MAAM,CAACK,EAAQL,CAAW,EAAE,YAC/DO,EAAmBP,CAAW;AAEhC;AAAA,MACF,KAAK;AACH,QAAID,MACFW,EAAM,gBAAA,GACNN,EAAU,EAAK;AAEjB;AAAA,IAAA;AAAA,EACJ;AAGF,
|
|
1
|
+
{"version":3,"file":"SelectOption.js","sources":["../../../../src/components/SelectListbox/components/SelectOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef } from 'react';\n\nimport type { KeyboardEvent, ReactNode } from 'react';\nimport type { OptionValue } from 'components/SelectListbox/SelectProvider';\n\nimport { useSelect } from 'components/SelectListbox/SelectProvider';\nimport styles from 'components/SelectListbox/SelectListbox.module.css';\n\nexport interface SelectOptionProps {\n option: OptionValue;\n index: number;\n key: string | number;\n dividerAfter?: number;\n children: ReactNode;\n}\n\nexport const SelectOption = ({ option, index, dividerAfter, children }: SelectOptionProps) => {\n const selectOptionRef = useRef<HTMLLIElement>(null);\n const { isOpen, activeIndex, setActiveIndex, selectedValue, setSelectedValue, setIsOpen, options } = useSelect();\n\n const handleSelectOption = (aIndex: number) => {\n setSelectedValue(options[aIndex]);\n setIsOpen(false);\n };\n\n const onOptionKeyDown = (event: KeyboardEvent<HTMLLIElement>) => {\n if (event.key.length === 1) {\n const key = event.key.toLocaleLowerCase();\n const optionIndexStartsWithKey = options.findIndex(\n (option) => !option.disabled && option.label.toLocaleLowerCase().startsWith(key)\n );\n if (optionIndexStartsWithKey !== -1) {\n setActiveIndex(optionIndexStartsWithKey);\n event.preventDefault();\n return;\n }\n }\n\n switch (event.key) {\n case 'Tab':\n event.preventDefault();\n if (isOpen) {\n setIsOpen(false);\n }\n break;\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n if (!isOpen) {\n return;\n }\n if (event.key === 'ArrowDown' && activeIndex < options.length - 1) {\n setActiveIndex(activeIndex + 1);\n }\n if (event.key === 'ArrowUp' && activeIndex > 0) {\n setActiveIndex(activeIndex - 1);\n }\n break;\n case 'Enter':\n event.preventDefault();\n if (options?.length && activeIndex > -1 && !options[activeIndex].disabled) {\n handleSelectOption(activeIndex);\n }\n break;\n case 'Escape':\n if (isOpen) {\n event.stopPropagation();\n setIsOpen(false);\n }\n break;\n }\n };\n\n useEffect(() => {\n if (index === activeIndex) {\n isOpen ? selectOptionRef.current?.focus() : selectOptionRef.current?.blur();\n }\n }, [activeIndex, index, isOpen]);\n\n useEffect(() => {\n if (selectedValue.value === option.value) {\n setActiveIndex(index);\n }\n }, [index, option.value, selectedValue.value, setActiveIndex]);\n\n return (\n <>\n <li\n className={clsx(styles['select-listbox-option'], {\n [styles['select-listbox-option--active']]: index === activeIndex,\n [styles['select-listbox-option--divider']]: index + 1 === dividerAfter,\n })}\n key={`${option.value}`}\n {...(!option.disabled && {\n onClick: () => setSelectedValue(option),\n onKeyDown: onOptionKeyDown,\n tabIndex: 0,\n role: 'option',\n 'aria-selected': selectedValue.value === option.value,\n })}\n ref={selectOptionRef}\n >\n {children}\n </li>\n {index + 1 === dividerAfter && <div className={styles['select-listbox-divider']} aria-hidden=\"true\" />}\n </>\n );\n};\n"],"names":["SelectOption","option","index","dividerAfter","children","selectOptionRef","useRef","isOpen","activeIndex","setActiveIndex","selectedValue","setSelectedValue","setIsOpen","options","useSelect","handleSelectOption","aIndex","onOptionKeyDown","event","key","optionIndexStartsWithKey","useEffect","jsxs","Fragment","jsx","clsx","styles"],"mappings":";;;;;AAiBO,MAAMA,IAAe,CAAC,EAAE,QAAAC,GAAQ,OAAAC,GAAO,cAAAC,GAAc,UAAAC,QAAkC;AAC5F,QAAMC,IAAkBC,EAAsB,IAAI,GAC5C,EAAE,QAAAC,GAAQ,aAAAC,GAAa,gBAAAC,GAAgB,eAAAC,GAAe,kBAAAC,GAAkB,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAA,GAE/FC,IAAqB,CAACC,MAAmB;AAC7C,IAAAL,EAAiBE,EAAQG,CAAM,CAAC,GAChCJ,EAAU,EAAK;AAAA,EAAA,GAGXK,IAAkB,CAACC,MAAwC;AAC/D,QAAIA,EAAM,IAAI,WAAW,GAAG;AAC1B,YAAMC,IAAMD,EAAM,IAAI,kBAAA,GAChBE,IAA2BP,EAAQ;AAAA,QACvC,CAACZ,MAAW,CAACA,EAAO,YAAYA,EAAO,MAAM,oBAAoB,WAAWkB,CAAG;AAAA,MAAA;AAEjF,UAAIC,MAA6B,IAAI;AACnC,QAAAX,EAAeW,CAAwB,GACvCF,EAAM,eAAA;AACN;AAAA,MAAA;AAAA,IACF;AAGF,YAAQA,EAAM,KAAA;AAAA,MACZ,KAAK;AACH,QAAAA,EAAM,eAAA,GACFX,KACFK,EAAU,EAAK;AAEjB;AAAA,MACF,KAAK;AAAA,MACL,KAAK;AAEH,YADAM,EAAM,eAAA,GACF,CAACX;AACH;AAEF,QAAIW,EAAM,QAAQ,eAAeV,IAAcK,EAAQ,SAAS,KAC9DJ,EAAeD,IAAc,CAAC,GAE5BU,EAAM,QAAQ,aAAaV,IAAc,KAC3CC,EAAeD,IAAc,CAAC;AAEhC;AAAA,MACF,KAAK;AACH,QAAAU,EAAM,eAAA,GACFL,GAAS,UAAUL,IAAc,MAAM,CAACK,EAAQL,CAAW,EAAE,YAC/DO,E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
"version": "3.
|
|
5
|
+
"version": "3.40.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -61,20 +61,20 @@
|
|
|
61
61
|
"@testing-library/react": "^16.3.0",
|
|
62
62
|
"@types/jest": "^30.0.0",
|
|
63
63
|
"@types/node": "^22.18.0",
|
|
64
|
-
"@types/react": "^19.1.
|
|
65
|
-
"@types/react-dom": "^19.1.
|
|
64
|
+
"@types/react": "^19.1.12",
|
|
65
|
+
"@types/react-dom": "^19.1.8",
|
|
66
66
|
"@uva-glass/eslint-config": "^1.3.11",
|
|
67
67
|
"@uva-glass/stylelint-config": "^1.2.3",
|
|
68
|
-
"@vitejs/plugin-react": "^5.0.
|
|
69
|
-
"babel-jest": "^30.
|
|
68
|
+
"@vitejs/plugin-react": "^5.0.2",
|
|
69
|
+
"babel-jest": "^30.1.1",
|
|
70
70
|
"babel-plugin-transform-vite-meta-env": "^1.0.3",
|
|
71
71
|
"clsx": "^2.1.1",
|
|
72
72
|
"eslint-plugin-react-hooks": "^6.0.0",
|
|
73
73
|
"glob": "^11.0.3",
|
|
74
74
|
"husky": "^9.1.7",
|
|
75
75
|
"identity-obj-proxy": "^3.0.0",
|
|
76
|
-
"jest": "^30.
|
|
77
|
-
"jest-environment-jsdom": "^30.
|
|
76
|
+
"jest": "^30.1.1",
|
|
77
|
+
"jest-environment-jsdom": "^30.1.1",
|
|
78
78
|
"jest-junit": "^16.0.0",
|
|
79
79
|
"jsdom": "^26.1.0",
|
|
80
80
|
"npm-run-all2": "^8.0.4",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"react-router": "^7.8.2",
|
|
84
84
|
"semantic-release": "^24.2.7",
|
|
85
85
|
"storybook": "^9.1.3",
|
|
86
|
-
"style-dictionary": "^5.0.
|
|
86
|
+
"style-dictionary": "^5.0.3",
|
|
87
87
|
"stylelint": "^16.23.1",
|
|
88
88
|
"stylelint-config-recommended": "^17.0.0",
|
|
89
89
|
"stylelint-config-standard": "^39.0.0",
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
},
|
|
110
110
|
"optionalDependencies": {
|
|
111
111
|
"@ast-grep/napi-linux-x64-gnu": "0.39.4",
|
|
112
|
-
"@rollup/rollup-linux-x64-gnu": "^4.
|
|
113
|
-
"@rspack/binding-darwin-arm64": "1.
|
|
114
|
-
"@rspack/binding-linux-x64-gnu": "1.
|
|
112
|
+
"@rollup/rollup-linux-x64-gnu": "^4.49.0",
|
|
113
|
+
"@rspack/binding-darwin-arm64": "1.5.0",
|
|
114
|
+
"@rspack/binding-linux-x64-gnu": "1.5.0"
|
|
115
115
|
}
|
|
116
116
|
}
|