@uva-glass/component-library 3.38.3 → 3.39.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 +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/package.json +6 -6
|
@@ -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"],"mappings":";;;;;;;;;;;;;;GA0CaA,IAAoB,CAAC;AAAA,EAChC,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,UAAAC,IAAW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,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,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,SA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AO;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;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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;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","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AA,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;"}
|
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.0",
|
|
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",
|