@uva-glass/component-library 3.38.3 → 3.39.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 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.d.ts +2 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js +14 -13
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js.map +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.d.ts +1 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +110 -18
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js.map +1 -1
- package/dist/components/ControlsButton/ControlsButton.d.ts +6 -4
- package/dist/components/ControlsButton/ControlsButton.js +45 -41
- package/dist/components/ControlsButton/ControlsButton.js.map +1 -1
- package/dist/components/ControlsButton/ControlsButton.stories.d.ts +1 -0
- package/dist/components/ControlsButton/ControlsButton.stories.js +32 -18
- 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 +16 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
._controls-
|
|
1
|
+
._controls-input_1hbz5_1{aspect-ratio:unset;cursor:pointer;height:0;opacity:0;position:absolute;width:0}._controls-input_1hbz5_1:focus-visible+label{outline:.125rem dotted var(--new-color-navy-600);outline-offset:.125rem}._controls-input_1hbz5_1:checked+label{background-color:var(--new-color-grey-200);border:1px solid var(--new-color-grey-700);font-weight:var(--semibold)}._controls-input_1hbz5_1:disabled+label,._controls-input_1hbz5_1:disabled:hover+label{background-color:var(--new-color-grey-400);color:var(--new-color-grey-700);cursor:not-allowed}._controls-input_1hbz5_1:hover+label{background-color:var(--new-color-grey-300)}._controls-button_1hbz5_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_1hbz5_50{width:2.25rem}._controls-button_1hbz5_32:after{content:"";min-height:2.625rem;min-width:2.625rem;position:absolute;width:100%}._controls-button--with-prefix_1hbz5_62{height:auto;padding:.125rem .5rem;width:auto}._controls-button--with-icon_1hbz5_68{gap:.5rem}._controls-button__wrapper_1hbz5_72{align-items:center;display:flex;flex-direction:column}._controls-button__prefix_1hbz5_78{color:var(--new-color-grey-700);font-size:var(--font-size-text-non-essential)}._controls-button__tooltip_1hbz5_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;left:50%;padding:.5rem 1rem;position:absolute;text-align:center;top:calc(100% + .5rem);transform:translate(-50%);z-index:1}._controls-button__tooltip_1hbz5_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);left:50%;position:absolute;transform:translate(-50%);z-index:-1}._controls-button__tooltip_1hbz5_83:after{border-color:transparent transparent var(--new-color-uva-white) transparent;border-style:solid;border-width:.5rem;bottom:100%;content:"";left:50%;position:absolute;transform:translate(-50%)}._controls-button_1hbz5_32:hover ._controls-button__tooltip_1hbz5_83,._controls-input_1hbz5_1:focus-visible+label ._controls-button__tooltip_1hbz5_83{display:block}
|
|
@@ -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 N } 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 S } from "../Label/Label.js";
|
|
5
|
+
import { FeedbackBox as j } from "../FeedbackBox/FeedbackBox.js";
|
|
6
|
+
import { ControlsButton as y } 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
|
+
}, D = ({
|
|
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] = N(
|
|
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(S, { 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,30 +47,31 @@ 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: _,
|
|
51
|
-
|
|
50
|
+
children: d.map(({ label: e, value: o, prefix: _, tooltip: w, disabled: v }) => /* @__PURE__ */ c(
|
|
51
|
+
y,
|
|
52
52
|
{
|
|
53
53
|
type: "checkbox",
|
|
54
54
|
label: e,
|
|
55
55
|
prefix: _,
|
|
56
|
+
tooltip: w,
|
|
56
57
|
forceSquared: !0,
|
|
57
58
|
value: o,
|
|
58
59
|
checked: h.includes(o),
|
|
59
|
-
disabled:
|
|
60
|
-
onSetValue: (
|
|
60
|
+
disabled: v || p,
|
|
61
|
+
onSetValue: (C) => g(C.target.value)
|
|
61
62
|
},
|
|
62
63
|
`${o}`
|
|
63
64
|
))
|
|
64
65
|
}
|
|
65
66
|
),
|
|
66
67
|
l && /* @__PURE__ */ c("div", { className: t["checkbox-button-bar__footer"], children: l }),
|
|
67
|
-
b !== "" && /* @__PURE__ */ c(
|
|
68
|
+
b !== "" && /* @__PURE__ */ c(j, { level: "error", feedback: b })
|
|
68
69
|
] })
|
|
69
70
|
]
|
|
70
71
|
}
|
|
71
72
|
);
|
|
72
73
|
};
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
D as CheckboxButtonBar
|
|
75
76
|
};
|
|
76
77
|
//# 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 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 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, disabled }) => (\n <ControlsButton\n key={`${value}`}\n type=\"checkbox\"\n label={label}\n prefix={prefix}\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","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 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"],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AAA,cAAA,CACtE;AAAA,cAEA,UAAAN,EAAW,IAAI,CAAC,EAAE,OAAAE,GAAO,OAAAa,GAAO,QAAAQ,GAAQ,SAAAC,GAAS,UAAAC,EAAA,MAChD,gBAAAJ;AAAA,gBAACK;AAAA,gBAAA;AAAA,kBAEC,MAAK;AAAA,kBACL,OAAOxB;AAAAA,kBACP,QAAAqB;AAAA,kBACA,SAAAC;AAAA,kBACA,cAAc;AAAA,kBACd,OAAAT;AAAA,kBACA,SAASJ,EAAc,SAASI,CAAK;AAAA,kBACrC,UAAUU,KAAYhB;AAAA,kBACtB,YAAY,CAACkB,MAAUb,EAAaa,EAAM,OAAO,KAAK;AAAA,gBAAA;AAAA,gBATjD,GAAGZ,CAAK;AAAA,cAAA,CAWhB;AAAA,YAAA;AAAA,UAAA;AAAA,UAEFP,KAAc,gBAAAa,EAAC,OAAA,EAAI,WAAWD,EAAO,6BAA6B,GAAI,UAAAZ,GAAW;AAAA,UACjFF,MAAqB,MAAM,gBAAAe,EAACO,KAAY,OAAM,SAAQ,UAAUtB,EAAA,CAAkB;AAAA,QAAA,EAAA,CACrF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -5,3 +5,4 @@ export default _default;
|
|
|
5
5
|
export declare const CheckboxButtonBarExample: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, CheckboxButtonBarProps>;
|
|
6
6
|
export declare const CheckboxButtonBarAsRadioButtonBar: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, CheckboxButtonBarProps>;
|
|
7
7
|
export declare const CheckboxButtonBarWithPrefix: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, CheckboxButtonBarProps>;
|
|
8
|
+
export declare const CheckboxButtonBarWithTooltip: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, CheckboxButtonBarProps>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { l } from "../../index-BYGu3RV5.js";
|
|
3
|
-
import { CheckboxButtonBar as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as l, Fragment as t } from "react/jsx-runtime";
|
|
2
|
+
import { l as a } from "../../index-BYGu3RV5.js";
|
|
3
|
+
import { CheckboxButtonBar as r } from "./CheckboxButtonBar.js";
|
|
4
|
+
const b = "<CheckboxButtonBar checkboxes={} defaultValues={} label={} labelPosition={} required={} notValidatedText={} disableGroup={} onSetValues={} />", f = {
|
|
5
5
|
title: "Molecules/CheckboxButtonBar",
|
|
6
|
-
component:
|
|
6
|
+
component: r,
|
|
7
7
|
argTypes: {
|
|
8
8
|
checkboxes: {
|
|
9
9
|
table: {
|
|
@@ -41,10 +41,10 @@ const r = "<CheckboxButtonBar checkboxes={} defaultValues={} label={} labelPosit
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
parameters: {
|
|
44
|
-
inspectComponent:
|
|
45
|
-
codeString:
|
|
44
|
+
inspectComponent: r,
|
|
45
|
+
codeString: b
|
|
46
46
|
}
|
|
47
|
-
},
|
|
47
|
+
}, o = (i) => /* @__PURE__ */ e(r, { ...i }), u = o.bind({});
|
|
48
48
|
u.args = {
|
|
49
49
|
label: "Periode",
|
|
50
50
|
required: !0,
|
|
@@ -77,10 +77,10 @@ u.args = {
|
|
|
77
77
|
defaultValues: ["1", "2"],
|
|
78
78
|
labelPosition: "top",
|
|
79
79
|
footerText: "Weken in periode 2",
|
|
80
|
-
onSetValues:
|
|
80
|
+
onSetValues: a()
|
|
81
81
|
};
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const n = o.bind({});
|
|
83
|
+
n.args = {
|
|
84
84
|
label: "Weken",
|
|
85
85
|
required: !0,
|
|
86
86
|
checkboxes: [
|
|
@@ -112,10 +112,10 @@ b.args = {
|
|
|
112
112
|
defaultValues: ["1"],
|
|
113
113
|
labelPosition: "top",
|
|
114
114
|
actAsRadioButtonBar: !0,
|
|
115
|
-
onSetValues:
|
|
115
|
+
onSetValues: a()
|
|
116
116
|
};
|
|
117
|
-
const
|
|
118
|
-
|
|
117
|
+
const s = o.bind({});
|
|
118
|
+
s.args = {
|
|
119
119
|
label: "Weken",
|
|
120
120
|
required: !0,
|
|
121
121
|
checkboxes: [
|
|
@@ -153,12 +153,104 @@ n.args = {
|
|
|
153
153
|
defaultValues: ["1"],
|
|
154
154
|
labelPosition: "top",
|
|
155
155
|
actAsRadioButtonBar: !1,
|
|
156
|
-
onSetValues:
|
|
156
|
+
onSetValues: a()
|
|
157
|
+
};
|
|
158
|
+
const p = o.bind({});
|
|
159
|
+
p.args = {
|
|
160
|
+
label: "Weken",
|
|
161
|
+
required: !0,
|
|
162
|
+
checkboxes: [
|
|
163
|
+
{
|
|
164
|
+
label: "1",
|
|
165
|
+
value: "1",
|
|
166
|
+
prefix: "36",
|
|
167
|
+
tooltip: /* @__PURE__ */ l(t, { children: [
|
|
168
|
+
"1 sept - 5 sept",
|
|
169
|
+
/* @__PURE__ */ e("br", {}),
|
|
170
|
+
"2025"
|
|
171
|
+
] })
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
label: "2",
|
|
175
|
+
value: "2",
|
|
176
|
+
prefix: "37",
|
|
177
|
+
tooltip: /* @__PURE__ */ l(t, { children: [
|
|
178
|
+
"8 sept - 12 sept",
|
|
179
|
+
/* @__PURE__ */ e("br", {}),
|
|
180
|
+
"2025"
|
|
181
|
+
] })
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
label: "3",
|
|
185
|
+
value: "3",
|
|
186
|
+
prefix: "38",
|
|
187
|
+
tooltip: /* @__PURE__ */ l(t, { children: [
|
|
188
|
+
"15 sept - 19 sept",
|
|
189
|
+
/* @__PURE__ */ e("br", {}),
|
|
190
|
+
"2025"
|
|
191
|
+
] })
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
label: "4",
|
|
195
|
+
value: "4",
|
|
196
|
+
prefix: "39",
|
|
197
|
+
tooltip: /* @__PURE__ */ l(t, { children: [
|
|
198
|
+
"22 sept - 26 sept",
|
|
199
|
+
/* @__PURE__ */ e("br", {}),
|
|
200
|
+
"2025"
|
|
201
|
+
] })
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
label: "5",
|
|
205
|
+
value: "5",
|
|
206
|
+
prefix: "40",
|
|
207
|
+
tooltip: /* @__PURE__ */ l(t, { children: [
|
|
208
|
+
"29 sept - 3 okt",
|
|
209
|
+
/* @__PURE__ */ e("br", {}),
|
|
210
|
+
"2025"
|
|
211
|
+
] })
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
label: "6",
|
|
215
|
+
value: "6",
|
|
216
|
+
prefix: "41",
|
|
217
|
+
tooltip: /* @__PURE__ */ l(t, { children: [
|
|
218
|
+
"6 okt - 10 okt",
|
|
219
|
+
/* @__PURE__ */ e("br", {}),
|
|
220
|
+
"2025"
|
|
221
|
+
] })
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
label: "7",
|
|
225
|
+
value: "7",
|
|
226
|
+
prefix: "42",
|
|
227
|
+
tooltip: /* @__PURE__ */ l(t, { children: [
|
|
228
|
+
"13 okt - 17 okt",
|
|
229
|
+
/* @__PURE__ */ e("br", {}),
|
|
230
|
+
"2025"
|
|
231
|
+
] })
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
label: "8",
|
|
235
|
+
value: "8",
|
|
236
|
+
prefix: "43",
|
|
237
|
+
tooltip: /* @__PURE__ */ l(t, { children: [
|
|
238
|
+
"20 okt - 24 okt",
|
|
239
|
+
/* @__PURE__ */ e("br", {}),
|
|
240
|
+
"2025"
|
|
241
|
+
] })
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
defaultValues: ["1"],
|
|
245
|
+
labelPosition: "top",
|
|
246
|
+
actAsRadioButtonBar: !1,
|
|
247
|
+
onSetValues: a()
|
|
157
248
|
};
|
|
158
249
|
export {
|
|
159
|
-
|
|
250
|
+
n as CheckboxButtonBarAsRadioButtonBar,
|
|
160
251
|
u as CheckboxButtonBarExample,
|
|
161
|
-
|
|
162
|
-
|
|
252
|
+
s as CheckboxButtonBarWithPrefix,
|
|
253
|
+
p as CheckboxButtonBarWithTooltip,
|
|
254
|
+
f as default
|
|
163
255
|
};
|
|
164
256
|
//# sourceMappingURL=CheckboxButtonBar.stories.js.map
|
|
@@ -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"],"names":["codeString","CheckboxButtonBar_stories","CheckboxButtonBar","Template","args","jsx","CheckboxButtonBarExample","fn","CheckboxButtonBarAsRadioButtonBar","CheckboxButtonBarWithPrefix"],"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,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,IACV;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,IAAA;AAAA,IAET;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,IAAA;AAAA,IAET;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,IAAA;AAAA,IAET;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,IAAA;AAAA,IAET;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,IAAA;AAAA,IAET;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,IAAA;AAAA,EACT;AAAA,EAEF,eAAe,CAAC,GAAG;AAAA,EACnB,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,aAAaD,EAAA;AACf;AAEO,MAAME,IAA8BN,EAAS,KAAK,CAAA,CAAE;AAC3DM,EAA4B,OAAO;AAAA,EACjC,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,IACV;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,IAEV;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,IAEV;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,IAEV;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,IAEV;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,IAEV;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,EACV;AAAA,EAEF,eAAe,CAAC,GAAG;AAAA,EACnB,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,aAAaF,EAAA;AACf;"}
|
|
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,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;AAAA,MACX,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,EACF;AAAA,EAEF,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EAAA;AAEJ,GAEMG,IAA4C,CAACC,MAAS,gBAAAC,EAACH,GAAA,EAAmB,GAAGE,GAAM,GAE5EE,IAA2BH,EAAS,KAAK,CAAA,CAAE;AACxDG,EAAyB,OAAO;AAAA,EAC9B,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,IACV;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,IAAA;A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;AAAA,QAAA;AAAA,0BAEC,MAAA,EAAG;AAAA,QAAE;AAAA,MAAA,EAAA,CAER;AAAA,IAAA;AAAA,IAGJ;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SACE,gBAAAD,EAAAC,GAAA,EAAE,UAAA;AAAA,QAAA;AAAA,0BAEC,MAAA,EAAG;AAAA,QAAE;AAAA,MAAA,EAAA,CAER;AAAA,IAAA;AAAA,IAGJ;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SACE,gBAAAD,EAAAC,GAAA,EAAE,UAAA;AAAA,QAAA;AAAA,0BAEC,MAAA,EAAG;AAAA,QAAE;AAAA,MAAA,EAAA,CAER;AAAA,IAAA;AAAA,IAGJ;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SACE,gBAAAD,EAAAC,GAAA,EAAE,UAAA;AAAA,QAAA;AAAA,0BAEC,MAAA,EAAG;AAAA,QAAE;AAAA,MAAA,EAAA,CAER;AAAA,IAAA;AAAA,IAGJ;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SACE,gBAAAD,EAAAC,GAAA,EAAE,UAAA;AAAA,QAAA;AAAA,0BAEC,MAAA,EAAG;AAAA,QAAE;AAAA,MAAA,EAAA,CAER;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEF,eAAe,CAAC,GAAG;AAAA,EACnB,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,aAAaL,EAAA;AACf;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeEvent } from 'react';
|
|
1
|
+
import { ChangeEvent, ReactNode } from 'react';
|
|
2
2
|
import { IconProps } from 'components/Icon';
|
|
3
3
|
export interface ControlsButtonProps {
|
|
4
4
|
/** to set type/behaviour of input radio or checkbox */
|
|
@@ -7,10 +7,12 @@ export interface ControlsButtonProps {
|
|
|
7
7
|
label: string;
|
|
8
8
|
/** button value */
|
|
9
9
|
value: string;
|
|
10
|
-
/** set if icon is needed in font of
|
|
10
|
+
/** set if icon is needed in font of label */
|
|
11
11
|
iconName?: IconProps['name'];
|
|
12
|
-
/** set if prefix is needed above of
|
|
12
|
+
/** set if prefix is needed above of label */
|
|
13
13
|
prefix?: string;
|
|
14
|
+
/** set tooltip */
|
|
15
|
+
tooltip?: ReactNode;
|
|
14
16
|
/** set if used as radiogroup */
|
|
15
17
|
name?: string;
|
|
16
18
|
/** `true` to set squared button; otherwise, `false`. The default is `false`. Note: hides icon */
|
|
@@ -22,4 +24,4 @@ export interface ControlsButtonProps {
|
|
|
22
24
|
/** The callback function that is invoked when the radio button changes value. */
|
|
23
25
|
onSetValue: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
24
26
|
}
|
|
25
|
-
export declare const ControlsButton: ({ type, label, value, iconName, prefix, name, forceSquared, checked, disabled, onSetValue, }: ControlsButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const ControlsButton: ({ type, label, value, iconName, prefix, tooltip, name, forceSquared, checked, disabled, onSetValue, }: ControlsButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,63 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { c as
|
|
4
|
-
import { Icon as
|
|
1
|
+
import { jsxs as l, Fragment as x, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useId as z } from "react";
|
|
3
|
+
import { c as w } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { Icon as v } 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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
"controls-input": "_controls-input_1hbz5_1",
|
|
7
|
+
"controls-button": "_controls-button_1hbz5_32",
|
|
8
|
+
"controls-button--squared": "_controls-button--squared_1hbz5_50",
|
|
9
|
+
"controls-button--with-prefix": "_controls-button--with-prefix_1hbz5_62",
|
|
10
|
+
"controls-button--with-icon": "_controls-button--with-icon_1hbz5_68",
|
|
11
|
+
"controls-button__wrapper": "_controls-button__wrapper_1hbz5_72",
|
|
12
|
+
"controls-button__prefix": "_controls-button__prefix_1hbz5_78",
|
|
13
|
+
"controls-button__tooltip": "_controls-button__tooltip_1hbz5_83"
|
|
14
|
+
}, $ = ({
|
|
15
|
+
type: b = "checkbox",
|
|
16
|
+
label: _,
|
|
17
|
+
value: u,
|
|
17
18
|
iconName: n,
|
|
18
19
|
prefix: r,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
tooltip: s,
|
|
21
|
+
name: a,
|
|
22
|
+
forceSquared: p = !1,
|
|
23
|
+
checked: h,
|
|
24
|
+
disabled: d,
|
|
25
|
+
onSetValue: m
|
|
24
26
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
27
|
+
const f = z(), i = _.replace(/\s+/g, "_"), c = `${f}${i}`, e = `${c}-tooltip`;
|
|
28
|
+
return /* @__PURE__ */ l(x, { children: [
|
|
29
|
+
/* @__PURE__ */ o(
|
|
28
30
|
"input",
|
|
29
31
|
{
|
|
30
|
-
type:
|
|
31
|
-
id:
|
|
32
|
-
name:
|
|
33
|
-
disabled:
|
|
34
|
-
value:
|
|
35
|
-
checked:
|
|
36
|
-
onChange:
|
|
37
|
-
className: t["controls-input"]
|
|
32
|
+
type: b,
|
|
33
|
+
id: c,
|
|
34
|
+
name: a ?? i,
|
|
35
|
+
disabled: d,
|
|
36
|
+
value: u,
|
|
37
|
+
checked: h,
|
|
38
|
+
onChange: m,
|
|
39
|
+
className: t["controls-input"],
|
|
40
|
+
"aria-describedby": s ? e : void 0
|
|
38
41
|
}
|
|
39
42
|
),
|
|
40
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ l(
|
|
41
44
|
"label",
|
|
42
45
|
{
|
|
43
|
-
htmlFor:
|
|
44
|
-
className:
|
|
45
|
-
|
|
46
|
+
htmlFor: c,
|
|
47
|
+
className: w(t["controls-button"], [
|
|
48
|
+
p && t["controls-button--squared"],
|
|
46
49
|
r && t["controls-button--with-prefix"],
|
|
47
50
|
n && t["controls-button--with-icon"]
|
|
48
51
|
]),
|
|
49
52
|
children: [
|
|
50
|
-
n && /* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
r && /* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
] })
|
|
53
|
+
n && /* @__PURE__ */ o(v, { name: n, size: 20 }),
|
|
54
|
+
/* @__PURE__ */ l("div", { className: t["controls-button__wrapper"], children: [
|
|
55
|
+
r && /* @__PURE__ */ o("div", { className: t["controls-button__prefix"], children: r }),
|
|
56
|
+
_
|
|
57
|
+
] }),
|
|
58
|
+
s && /* @__PURE__ */ o("div", { id: e, role: "tooltip", className: t["controls-button__tooltip"], children: s })
|
|
55
59
|
]
|
|
56
60
|
}
|
|
57
61
|
)
|
|
58
62
|
] });
|
|
59
63
|
};
|
|
60
64
|
export {
|
|
61
|
-
|
|
65
|
+
$ as ControlsButton
|
|
62
66
|
};
|
|
63
67
|
//# 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 } 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
|
|
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 id={tooltipId} role=\"tooltip\" className={styles['controls-button__tooltip']}>\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","name","forceSquared","checked","disabled","onSetValue","idPrefix","useId","sanitizedLabel","baseId","tooltipId","jsxs","Fragment","jsx","styles","clsx","Icon"],"mappings":";;;;;;;;;;;;;GAmCaA,IAAiB,CAAC;AAAA,EAC7B,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,MAA2B;AACzB,QAAMC,IAAWC,EAAA,GACXC,IAAiBZ,EAAM,QAAQ,QAAQ,GAAG,GAC1Ca,IAAS,GAAGH,CAAQ,GAAGE,CAAc,IACrCE,IAAY,GAAGD,CAAM;AAE3B,SACE,gBAAAE,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAAlB;AAAA,QACA,IAAIc;AAAA,QACJ,MAAMR,KAAQO;AAAA,QACd,UAAAJ;AAAA,QACA,OAAAP;AAAA,QACA,SAAAM;AAAA,QACA,UAAUE;AAAA,QACV,WAAWS,EAAO,gBAAgB;AAAA,QAClC,oBAAkBd,IAAUU,IAAY;AAAA,MAAA;AAAA,IAAA;AAAA,IAE1C,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAASF;AAAA,QACT,WAAWM,EAAKD,EAAO,iBAAiB,GAAG;AAAA,UACzCZ,KAAgBY,EAAO,0BAA0B;AAAA,UACjDf,KAAUe,EAAO,8BAA8B;AAAA,UAC/ChB,KAAYgB,EAAO,4BAA4B;AAAA,QAAA,CAChD;AAAA,QAEA,UAAA;AAAA,UAAAhB,KAAY,gBAAAe,EAACG,GAAA,EAAK,MAAMlB,GAAU,MAAM,IAAI;AAAA,UAC7C,gBAAAa,EAAC,OAAA,EAAI,WAAWG,EAAO,0BAA0B,GAC9C,UAAA;AAAA,YAAAf,uBAAW,OAAA,EAAI,WAAWe,EAAO,yBAAyB,GAAI,UAAAf,GAAO;AAAA,YACrEH;AAAA,UAAA,GACH;AAAA,UACCI,KACC,gBAAAa,EAAC,OAAA,EAAI,IAAIH,GAAW,MAAK,WAAU,WAAWI,EAAO,0BAA0B,GAC5E,UAAAd,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ,GACF;AAEJ;"}
|
|
@@ -5,3 +5,4 @@ export default _default;
|
|
|
5
5
|
export declare const ControlsButtonExample: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ControlsButtonProps>;
|
|
6
6
|
export declare const WithPrefix: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ControlsButtonProps>;
|
|
7
7
|
export declare const WithIcon: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ControlsButtonProps>;
|
|
8
|
+
export declare const WithTooltip: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ControlsButtonProps>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as l, jsxs as a, Fragment as r } from "react/jsx-runtime";
|
|
2
2
|
import { l as e } from "../../index-BYGu3RV5.js";
|
|
3
|
-
import { ControlsButton as
|
|
4
|
-
import { Icons as
|
|
5
|
-
const
|
|
3
|
+
import { ControlsButton as t } from "./ControlsButton.js";
|
|
4
|
+
import { Icons as c } from "../Icon/icons/index.js";
|
|
5
|
+
const s = Object.keys(c), i = "<ControlsButton type={radio or checkbox} label={} value={} prefix={} tooltip={} forceSquared={}isChecked={} variant={} disabled={} notValid={} onSetValue={} key={} />", S = {
|
|
6
6
|
title: "Atoms/ControlsButton",
|
|
7
|
-
component:
|
|
7
|
+
component: t,
|
|
8
8
|
argTypes: {
|
|
9
9
|
label: {
|
|
10
10
|
control: "text"
|
|
@@ -14,7 +14,7 @@ const r = Object.keys(a), c = "<ControlsButton type={radio or checkbox} label={}
|
|
|
14
14
|
},
|
|
15
15
|
iconName: {
|
|
16
16
|
control: { type: "select" },
|
|
17
|
-
options:
|
|
17
|
+
options: s
|
|
18
18
|
},
|
|
19
19
|
forceSquared: {
|
|
20
20
|
control: "boolean"
|
|
@@ -32,37 +32,51 @@ const r = Object.keys(a), c = "<ControlsButton type={radio or checkbox} label={}
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
parameters: {
|
|
35
|
-
inspectComponent:
|
|
36
|
-
codeString:
|
|
35
|
+
inspectComponent: t,
|
|
36
|
+
codeString: i
|
|
37
37
|
}
|
|
38
|
-
},
|
|
39
|
-
|
|
38
|
+
}, o = (n) => /* @__PURE__ */ l(t, { ...n }), p = o.bind({});
|
|
39
|
+
p.args = {
|
|
40
40
|
type: "checkbox",
|
|
41
41
|
label: "1.2",
|
|
42
42
|
value: "1.2",
|
|
43
43
|
forceSquared: !0,
|
|
44
44
|
onSetValue: e()
|
|
45
45
|
};
|
|
46
|
-
const
|
|
47
|
-
|
|
46
|
+
const b = o.bind({});
|
|
47
|
+
b.args = {
|
|
48
48
|
type: "checkbox",
|
|
49
49
|
label: "1.3",
|
|
50
50
|
value: "1.3",
|
|
51
51
|
prefix: "13",
|
|
52
52
|
onSetValue: e()
|
|
53
53
|
};
|
|
54
|
-
const
|
|
55
|
-
|
|
54
|
+
const u = o.bind({});
|
|
55
|
+
u.args = {
|
|
56
56
|
type: "checkbox",
|
|
57
57
|
label: "2.1",
|
|
58
58
|
value: "2.1",
|
|
59
59
|
iconName: "AcademicCap",
|
|
60
60
|
onSetValue: e()
|
|
61
61
|
};
|
|
62
|
+
const d = o.bind({});
|
|
63
|
+
d.args = {
|
|
64
|
+
type: "checkbox",
|
|
65
|
+
label: "5",
|
|
66
|
+
value: "5",
|
|
67
|
+
prefix: "40",
|
|
68
|
+
tooltip: /* @__PURE__ */ a(r, { children: [
|
|
69
|
+
"15 dec - 19 dec",
|
|
70
|
+
/* @__PURE__ */ l("br", {}),
|
|
71
|
+
"2025"
|
|
72
|
+
] }),
|
|
73
|
+
onSetValue: e()
|
|
74
|
+
};
|
|
62
75
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
76
|
+
p as ControlsButtonExample,
|
|
77
|
+
u as WithIcon,
|
|
78
|
+
b as WithPrefix,
|
|
79
|
+
d as WithTooltip,
|
|
80
|
+
S as default
|
|
67
81
|
};
|
|
68
82
|
//# sourceMappingURL=ControlsButton.stories.js.map
|
|
@@ -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={} 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"],"names":["iconNames","Icons","codeString","ControlsButton_stories","ControlsButton","Template","args","jsx","ControlsButtonExample","fn","WithPrefix","WithIcon"],"mappings":";;;;AASA,MAAMA,IAAY,OAAO,KAAKC,CAAK,GAE7BC,IACJ
|
|
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,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,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,EAAM,eAAA;AACN;AAAA,MAAA;AAAA,IACF;AAGF,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,CAACM,MAAWA,EAAO,UAAUV,GAAe,KAAK,CAAC,GACnFE,EAAU,EAAK;AAEjB;AAAA,IAAA;AAAA,EACJ;AAGF,SAAAS,EAAU,MAA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|
|
@@ -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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GAAOD,EAAO,OAAOS,EAAc,OAAOD,CAAc,CAAC,GAG3D,gBAAAa,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC,EAAKC,EAAO,uBAAuB,GAAG;AAAA,UAC/C,CAACA,EAAO,+BAA+B,CAAC,GAAGxB,MAAUM;AAAA,UACrD,CAACkB,EAAO,gCAAgC,CAAC,GAAGxB,IAAQ,MAAMC;AAAA,QAAA,CAC3D;AAAA,QAEA,GAAI,CAACF,EAAO,YAAY;AAAA,UACvB,SAAS,MAAMU,EAAiBV,CAAM;AAAA,UACtC,WAAWgB;AAAA,UACX,UAAU;AAAA,UACV,MAAM;AAAA,UACN,iBAAiBP,EAAc,UAAUT,EAAO;AAAA,QAAA;AAAA,QAElD,KAAKI;AAAA,QAEJ,UAAAD;AAAA,MAAA;AAAA,MAVI,GAAGH,EAAO,KAAK;AAAA,IAAA;AAAA,IAYrBC,IAAQ,MAAMC,KAAgB,gBAAAqB,EAAC,OAAA,EAAI,WAAWE,EAAO,wBAAwB,GAAG,eAAY,OAAA,CAAO;AAAA,EAAA,GACtG;AAEJ;"}
|
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.39.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@commitlint/cli": "^19.8.1",
|
|
47
47
|
"@commitlint/config-conventional": "^19.8.1",
|
|
48
|
-
"@react-aria/button": "^3.14.
|
|
49
|
-
"@react-aria/dialog": "^3.5.
|
|
50
|
-
"@react-aria/overlays": "^3.
|
|
51
|
-
"@react-types/dialog": "^3.5.
|
|
48
|
+
"@react-aria/button": "^3.14.1",
|
|
49
|
+
"@react-aria/dialog": "^3.5.29",
|
|
50
|
+
"@react-aria/overlays": "^3.29.0",
|
|
51
|
+
"@react-types/dialog": "^3.5.21",
|
|
52
52
|
"@semantic-release/git": "^10.0.1",
|
|
53
|
-
"@semantic-release/gitlab": "^13.2.
|
|
53
|
+
"@semantic-release/gitlab": "^13.2.8",
|
|
54
54
|
"@semantic-release/npm": "^12.0.2",
|
|
55
55
|
"@storybook/addon-a11y": "^9.1.3",
|
|
56
56
|
"@storybook/addon-docs": "^9.1.3",
|
|
@@ -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
|
}
|