@uva-glass/component-library 3.19.4 → 3.21.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/CheckboxButtonBar.css +1 -1
- package/dist/assets/ControlsButton.css +1 -0
- package/dist/assets/PeriodSelector.css +1 -1
- package/dist/assets/RadioTabSelector.css +1 -0
- package/dist/components/Buttons/Button.stories.js +1 -1
- package/dist/components/Buttons/LinkButton.stories.js +1 -1
- package/dist/components/Buttons/MenuButton.stories.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.d.ts +5 -2
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js +54 -47
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js.map +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +16 -4
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js.map +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +17 -19
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js.map +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +1 -1
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/ControlsButton/ControlsButton.d.ts +18 -0
- package/dist/components/ControlsButton/ControlsButton.js +46 -0
- package/dist/components/ControlsButton/ControlsButton.js.map +1 -0
- package/dist/components/ControlsButton/ControlsButton.stories.d.ts +5 -0
- package/dist/components/ControlsButton/ControlsButton.stories.js +45 -0
- package/dist/components/ControlsButton/ControlsButton.stories.js.map +1 -0
- package/dist/components/ControlsButton/index.d.ts +1 -0
- package/dist/components/ControlsButton/index.js +5 -0
- package/dist/components/Drawer/Drawer.stories.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/FormInput/FormInput.stories.js +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +31 -30
- package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.d.ts +25 -0
- package/dist/components/RadioTabSelector/RadioTabSelector.js +89 -0
- package/dist/components/RadioTabSelector/RadioTabSelector.js.map +1 -0
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.d.ts +5 -0
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +60 -0
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js.map +1 -0
- package/dist/components/RadioTabSelector/index.d.ts +1 -0
- package/dist/components/RadioTabSelector/index.js +5 -0
- package/dist/components/RadioTabSelector/index.js.map +1 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/Sortable/Sortable.stories.js +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.test.js +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +46 -44
- package/dist/components/index.js.map +1 -1
- package/dist/{index-BCvy9BiK.js → index-Dwqes6RH.js} +5 -2
- package/dist/{index-BCvy9BiK.js.map → index-Dwqes6RH.js.map} +1 -1
- package/dist/index.js +46 -44
- package/dist/index.js.map +1 -1
- package/dist/storybook__react.d.js +1 -1
- package/package.json +22 -22
- package/dist/assets/CheckboxButton.css +0 -1
- package/dist/components/CheckboxButton/CheckboxButton.d.ts +0 -16
- package/dist/components/CheckboxButton/CheckboxButton.js +0 -51
- package/dist/components/CheckboxButton/CheckboxButton.js.map +0 -1
- package/dist/components/CheckboxButton/CheckboxButton.stories.d.ts +0 -5
- package/dist/components/CheckboxButton/CheckboxButton.stories.js +0 -48
- package/dist/components/CheckboxButton/CheckboxButton.stories.js.map +0 -1
- package/dist/components/CheckboxButton/CheckboxButton.test.d.ts +0 -0
- package/dist/components/CheckboxButton/CheckboxButton.test.js +0 -51
- package/dist/components/CheckboxButton/CheckboxButton.test.js.map +0 -1
- package/dist/components/CheckboxButton/index.d.ts +0 -1
- package/dist/components/CheckboxButton/index.js +0 -5
- /package/dist/components/{CheckboxButton → ControlsButton}/index.js.map +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useState as d, useRef as g } from "react";
|
|
3
|
-
import { fn as l } from "../../index-
|
|
3
|
+
import { fn as l } from "../../index-Dwqes6RH.js";
|
|
4
4
|
import { InputField as e } from "./InputField.js";
|
|
5
5
|
import { Container as u } from "../../storyComponents/Container/Container.js";
|
|
6
6
|
import { Icon as h } from "../Icon/Icon.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { ModalProvider as r } from "@react-aria/overlays";
|
|
3
|
-
import { fn as i } from "../../index-
|
|
3
|
+
import { fn as i } from "../../index-Dwqes6RH.js";
|
|
4
4
|
import { ModalDialog as t } from "./ModalDialog.js";
|
|
5
5
|
import { Button as s } from "../Buttons/Button.js";
|
|
6
6
|
import "../Buttons/LinkButton.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as S, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { fn as d } from "../../index-
|
|
2
|
+
import { fn as d } from "../../index-Dwqes6RH.js";
|
|
3
3
|
import { useState as p } from "react";
|
|
4
4
|
import { M as e } from "../../TablePlugin-hxs9O_ox.js";
|
|
5
5
|
import { Container as M } from "../../storyComponents/Container/Container.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { fn as o } from "../../index-
|
|
2
|
+
import { fn as o } from "../../index-Dwqes6RH.js";
|
|
3
3
|
import { MultiSelectBox as e } from "./MultiSelectBox.js";
|
|
4
4
|
const c = "<MultiSelectBox selectData={[{label, value}]} onChange={fn} labelSuffix={string} />", b = {
|
|
5
5
|
title: "Organisms/MultiSelectBox",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { fn as a } from "../../index-
|
|
2
|
+
import { fn as a } from "../../index-Dwqes6RH.js";
|
|
3
3
|
import { OverlayCloseButton as o } from "./OverlayCloseButton.js";
|
|
4
4
|
import { Container as l } from "../../storyComponents/Container/Container.js";
|
|
5
5
|
const n = "<OverlayCloseButton aria-label={aria-label} onClick={onClickFunction} />", c = {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsxs as h, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { useRef as
|
|
2
|
+
import { c as x } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { useRef as v, useState as M, useEffect as $ } from "react";
|
|
4
4
|
import "../Buttons/Button.js";
|
|
5
5
|
import "../Buttons/LinkButton.js";
|
|
6
6
|
import "@react-aria/button";
|
|
7
7
|
import "../Checkbox/Checkbox.js";
|
|
8
|
-
import { CheckboxButtonBar as
|
|
8
|
+
import { CheckboxButtonBar as N } from "../CheckboxButtonBar/CheckboxButtonBar.js";
|
|
9
9
|
import "@react-aria/dialog";
|
|
10
10
|
import "@react-aria/focus";
|
|
11
11
|
import "@react-aria/overlays";
|
|
12
12
|
import "../OverlayCloseButton/OverlayCloseButton.js";
|
|
13
|
-
import { FeedbackBox as
|
|
13
|
+
import { FeedbackBox as w } from "../FeedbackBox/FeedbackBox.js";
|
|
14
14
|
import "../GridRow/GridRow.js";
|
|
15
15
|
import "../IconButton/IconButton.js";
|
|
16
16
|
import "../Input/Input.js";
|
|
17
17
|
import "../InputField/InputField.js";
|
|
18
|
-
import { Label as
|
|
18
|
+
import { Label as B } from "../Label/Label.js";
|
|
19
19
|
import "react-router";
|
|
20
20
|
import "../../TablePlugin-hxs9O_ox.js";
|
|
21
21
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
@@ -27,59 +27,60 @@ import "../SelectListbox/SelectProvider.js";
|
|
|
27
27
|
import "../Sortable/components/SortableItem.js";
|
|
28
28
|
import "../../SortableProvider-B3_u0pKv.js";
|
|
29
29
|
import '../../assets/PeriodSelector.css';const l = {
|
|
30
|
-
"period-selector__container": "_period-
|
|
31
|
-
"period-selector__container--label-left": "_period-selector__container--label-
|
|
32
|
-
"period-selector__container--label-top": "_period-selector__container--label-
|
|
33
|
-
"period-selector__selector-container": "_period-selector__selector-
|
|
34
|
-
"period-selector__selector-row": "_period-selector__selector-
|
|
35
|
-
}, S = 0, f = 1, E = 2,
|
|
30
|
+
"period-selector__container": "_period-selector__container_d1p0j_1",
|
|
31
|
+
"period-selector__container--label-left": "_period-selector__container--label-left_d1p0j_6",
|
|
32
|
+
"period-selector__container--label-top": "_period-selector__container--label-top_d1p0j_12",
|
|
33
|
+
"period-selector__selector-container": "_period-selector__selector-container_d1p0j_18",
|
|
34
|
+
"period-selector__selector-row": "_period-selector__selector-row_d1p0j_24"
|
|
35
|
+
}, S = 0, f = 1, E = 2, _ = 3, D = 7, I = (n) => {
|
|
36
36
|
const c = [];
|
|
37
|
-
for (let t = 0; t < n.length; t +=
|
|
38
|
-
c.push(n.slice(t, t +
|
|
37
|
+
for (let t = 0; t < n.length; t += _)
|
|
38
|
+
c.push(n.slice(t, t + _));
|
|
39
39
|
return c;
|
|
40
40
|
}, lr = ({
|
|
41
|
-
maxPeriods: n =
|
|
41
|
+
maxPeriods: n = D,
|
|
42
42
|
defaultValues: c,
|
|
43
43
|
label: t,
|
|
44
44
|
labelPosition: b = "top",
|
|
45
|
-
required:
|
|
46
|
-
notValidatedText:
|
|
45
|
+
required: m = !1,
|
|
46
|
+
notValidatedText: p = "",
|
|
47
47
|
onChange: g
|
|
48
48
|
}) => {
|
|
49
|
-
const R = Array.from({ length: n }, (r, e) => e + 1), a =
|
|
50
|
-
label: `${e + 1}${r.length === 1 ? "" : `.${(o - 1) %
|
|
49
|
+
const R = Array.from({ length: n }, (r, e) => e + 1), a = I(R), j = a.map((r, e) => r.map((o) => ({
|
|
50
|
+
label: `${e + 1}${r.length === 1 ? "" : `.${(o - 1) % _ + 1}`}`,
|
|
51
51
|
value: o.toString()
|
|
52
|
-
}))), i =
|
|
52
|
+
}))), i = v(
|
|
53
53
|
a.map(
|
|
54
54
|
(r) => r.reduce((e, o) => (c != null && c.includes(o) && e.push(o), e), [])
|
|
55
55
|
)
|
|
56
|
-
), [P,
|
|
57
|
-
i.current[e] = r.map((o) => Number(o)), u(
|
|
56
|
+
), [P, d] = M([]), u = (r) => r[S].length !== 0 || r[f].length !== 0 ? [E] : r[E].length !== 0 ? [S, f] : [], k = (r, e) => {
|
|
57
|
+
i.current[e] = r.map((o) => Number(o)), d(u(i.current)), g([...i.current.flat()].sort());
|
|
58
58
|
};
|
|
59
|
-
return
|
|
60
|
-
u(
|
|
59
|
+
return $(() => {
|
|
60
|
+
d(u(i.current));
|
|
61
61
|
}, []), /* @__PURE__ */ h(
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
|
-
className:
|
|
64
|
+
className: x(
|
|
65
65
|
l["period-selector__container"],
|
|
66
66
|
l[`period-selector__container--label-${b}`]
|
|
67
67
|
),
|
|
68
68
|
children: [
|
|
69
|
-
t && /* @__PURE__ */ s(
|
|
69
|
+
t && /* @__PURE__ */ s(B, { htmlFor: "", required: m, children: t }),
|
|
70
70
|
/* @__PURE__ */ h("div", { className: l["period-selector__selector-container"], children: [
|
|
71
|
-
/* @__PURE__ */ s("div", { className: l["period-selector__selector-row"], children:
|
|
72
|
-
|
|
71
|
+
/* @__PURE__ */ s("div", { className: l["period-selector__selector-row"], children: j.map((r, e) => /* @__PURE__ */ s(
|
|
72
|
+
N,
|
|
73
73
|
{
|
|
74
74
|
checkboxes: r,
|
|
75
75
|
defaultValues: i.current[e].map((o) => o.toString()),
|
|
76
76
|
disableGroup: P.includes(e),
|
|
77
|
-
required:
|
|
78
|
-
onSetValues: (o) => k(o, e)
|
|
77
|
+
required: m,
|
|
78
|
+
onSetValues: (o) => k(o, e),
|
|
79
|
+
notValidated: p !== ""
|
|
79
80
|
},
|
|
80
81
|
`group_${e}`
|
|
81
82
|
)) }),
|
|
82
|
-
|
|
83
|
+
p !== "" && /* @__PURE__ */ s(w, { level: "error", feedback: p })
|
|
83
84
|
] })
|
|
84
85
|
]
|
|
85
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeriodSelector.js","sources":["../../../src/components/PeriodSelector/PeriodSelector.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport styles from './PeriodSelector.module.css';\n\nimport { Label, CheckboxButtonBar, FeedbackBox } from 'components';\n\nexport interface PeriodSelectorProps {\n /** Indicates how many periods are shown. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n maxPeriods: 6 | 7;\n /** array of period values [3, 5 ...] */\n defaultValues?: number[];\n label?: string;\n labelPosition?: 'top' | 'left';\n /** Shows red * */\n required?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange: (values: number[]) => void;\n}\n\nconst SEMESTER_1 = 0;\nconst SEMESTER_2 = 1;\nconst SEMESTER_3 = 2;\n\nconst PERIODS_PER_SEMESTER = 3;\nconst MAX_PERIODS = 7;\n\nconst chunkPeriods = (array: number[]): number[][] => {\n const result: number[][] = [];\n for (let count = 0; count < array.length; count += PERIODS_PER_SEMESTER) {\n result.push(array.slice(count, count + PERIODS_PER_SEMESTER));\n }\n return result;\n};\n\n/** Checkbox group for selecting periods */\nexport const PeriodSelector = ({\n maxPeriods = MAX_PERIODS,\n defaultValues,\n label,\n labelPosition = 'top',\n required = false,\n notValidatedText = '',\n onChange,\n}: PeriodSelectorProps) => {\n const maxPeriodsList = Array.from({ length: maxPeriods }, (_, index) => index + 1);\n const chunkedPeriods = chunkPeriods(maxPeriodsList);\n\n const checkboxItems = chunkedPeriods.map((periods, semester) => {\n return periods.map((period) => ({\n label: `${semester + 1}${periods.length === 1 ? '' : `.${((period - 1) % PERIODS_PER_SEMESTER) + 1}`}`,\n value: period.toString(),\n }));\n });\n\n const returnValues = useRef<number[][]>(\n chunkedPeriods.map((semester) =>\n semester.reduce((periods, period) => {\n if (defaultValues?.includes(period)) periods.push(period);\n return periods;\n }, [] as number[])\n )\n );\n const [disableSemesters, setDisableSemesters] = useState<number[]>([]);\n\n const disableGroups = (selects: number[][]) => {\n if (selects[SEMESTER_1].length !== 0 || selects[SEMESTER_2].length !== 0) return [SEMESTER_3];\n if (selects[SEMESTER_3].length !== 0) return [SEMESTER_1, SEMESTER_2];\n return [];\n };\n\n const handleChange = (values: string[], index: number) => {\n returnValues.current[index] = values.map((num) => Number(num));\n setDisableSemesters(disableGroups(returnValues.current));\n onChange([...returnValues.current.flat()].sort());\n };\n\n useEffect(() => {\n setDisableSemesters(disableGroups(returnValues.current));\n }, []);\n\n return (\n <div\n className={clsx(\n styles['period-selector__container'],\n styles[`period-selector__container--label-${labelPosition}`]\n )}\n >\n {label && (\n <Label htmlFor=\"\" required={required}>\n {label}\n </Label>\n )}\n <div className={styles['period-selector__selector-container']}>\n <div className={styles['period-selector__selector-row']}>\n {checkboxItems.map((checkboxes, semester) => (\n <CheckboxButtonBar\n key={`group_${semester}`}\n checkboxes={checkboxes}\n defaultValues={returnValues.current[semester].map((num) => num.toString())}\n disableGroup={disableSemesters.includes(semester)}\n required={required}\n onSetValues={(event) => handleChange(event, semester)}\n />\n ))}\n </div>\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n </div>\n );\n};\n"],"names":["SEMESTER_1","SEMESTER_2","SEMESTER_3","PERIODS_PER_SEMESTER","MAX_PERIODS","chunkPeriods","array","result","count","PeriodSelector","maxPeriods","defaultValues","label","labelPosition","required","notValidatedText","onChange","maxPeriodsList","_","index","chunkedPeriods","checkboxItems","periods","semester","period","returnValues","useRef","disableSemesters","setDisableSemesters","useState","disableGroups","selects","handleChange","values","num","useEffect","jsxs","clsx","styles","jsx","Label","checkboxes","CheckboxButtonBar","event","FeedbackBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuBMA,IAAa,GACbC,IAAa,GACbC,IAAa,GAEbC,IAAuB,GACvBC,IAAc,GAEdC,IAAe,CAACC,MAAgC;AACpD,QAAMC,IAAqB,CAAC;AAC5B,WAASC,IAAQ,GAAGA,IAAQF,EAAM,QAAQE,KAASL;AACjD,IAAAI,EAAO,KAAKD,EAAM,MAAME,GAAOA,IAAQL,CAAoB,CAAC;AAEvD,SAAAI;AACT,GAGaE,KAAiB,CAAC;AAAA,EAC7B,YAAAC,IAAaN;AAAA,EACb,eAAAO;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,UAAAC,IAAW;AAAA,EACX,kBAAAC,IAAmB;AAAA,EACnB,UAAAC;AACF,MAA2B;AACnB,QAAAC,IAAiB,MAAM,KAAK,EAAE,QAAQP,EAAW,GAAG,CAACQ,GAAGC,MAAUA,IAAQ,CAAC,GAC3EC,IAAiBf,EAAaY,CAAc,GAE5CI,IAAgBD,EAAe,IAAI,CAACE,GAASC,MAC1CD,EAAQ,IAAI,CAACE,OAAY;AAAA,IAC9B,OAAO,GAAGD,IAAW,CAAC,GAAGD,EAAQ,WAAW,IAAI,KAAK,KAAME,IAAS,KAAKrB,IAAwB,CAAC,EAAE;AAAA,IACpG,OAAOqB,EAAO,SAAS;AAAA,EAAA,EACvB,CACH,GAEKC,IAAeC;AAAA,IACnBN,EAAe;AAAA,MAAI,CAACG,MAClBA,EAAS,OAAO,CAACD,GAASE,OACpBb,KAAA,QAAAA,EAAe,SAASa,MAASF,EAAQ,KAAKE,CAAM,GACjDF,IACN,CAAc,CAAA;AAAA,IAAA;AAAA,EAErB,GACM,CAACK,GAAkBC,CAAmB,IAAIC,EAAmB,CAAA,CAAE,GAE/DC,IAAgB,CAACC,MACjBA,EAAQ/B,CAAU,EAAE,WAAW,KAAK+B,EAAQ9B,CAAU,EAAE,WAAW,IAAU,CAACC,CAAU,IACxF6B,EAAQ7B,CAAU,EAAE,WAAW,IAAU,CAACF,GAAYC,CAAU,IAC7D,CAAC,GAGJ+B,IAAe,CAACC,GAAkBd,MAAkB;AAC3C,IAAAM,EAAA,QAAQN,CAAK,IAAIc,EAAO,IAAI,CAACC,MAAQ,OAAOA,CAAG,CAAC,GACzCN,EAAAE,EAAcL,EAAa,OAAO,CAAC,GAC9CT,EAAA,CAAC,GAAGS,EAAa,QAAQ,KAAM,CAAA,EAAE,MAAM;AAAA,EAClD;AAEA,SAAAU,EAAU,MAAM;AACM,IAAAP,EAAAE,EAAcL,EAAa,OAAO,CAAC;AAAA,EACzD,GAAG,EAAE,GAGH,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTC,EAAO,4BAA4B;AAAA,QACnCA,EAAO,qCAAqCzB,CAAa,EAAE;AAAA,MAC7D;AAAA,MAEC,UAAA;AAAA,QAAAD,KACE,gBAAA2B,EAAAC,GAAA,EAAM,SAAQ,IAAG,UAAA1B,GACf,UACHF,GAAA;AAAA,QAED,gBAAAwB,EAAA,OAAA,EAAI,WAAWE,EAAO,qCAAqC,GAC1D,UAAA;AAAA,UAAC,gBAAAC,EAAA,OAAA,EAAI,WAAWD,EAAO,+BAA+B,GACnD,UAAcjB,EAAA,IAAI,CAACoB,GAAYlB,MAC9B,gBAAAgB;AAAA,YAACG;AAAA,YAAA;AAAA,cAEC,YAAAD;AAAA,cACA,eAAehB,EAAa,QAAQF,CAAQ,EAAE,IAAI,CAACW,MAAQA,EAAI,UAAU;AAAA,cACzE,cAAcP,EAAiB,SAASJ,CAAQ;AAAA,cAChD,UAAAT;AAAA,cACA,aAAa,CAAC6B,MAAUX,EAAaW,GAAOpB,CAAQ;AAAA,YAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"PeriodSelector.js","sources":["../../../src/components/PeriodSelector/PeriodSelector.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport styles from './PeriodSelector.module.css';\n\nimport { Label, CheckboxButtonBar, FeedbackBox } from 'components';\n\nexport interface PeriodSelectorProps {\n /** Indicates how many periods are shown. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n maxPeriods: 6 | 7;\n /** array of period values [3, 5 ...] */\n defaultValues?: number[];\n label?: string;\n labelPosition?: 'top' | 'left';\n /** Shows red * */\n required?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange: (values: number[]) => void;\n}\n\nconst SEMESTER_1 = 0;\nconst SEMESTER_2 = 1;\nconst SEMESTER_3 = 2;\n\nconst PERIODS_PER_SEMESTER = 3;\nconst MAX_PERIODS = 7;\n\nconst chunkPeriods = (array: number[]): number[][] => {\n const result: number[][] = [];\n for (let count = 0; count < array.length; count += PERIODS_PER_SEMESTER) {\n result.push(array.slice(count, count + PERIODS_PER_SEMESTER));\n }\n return result;\n};\n\n/** Checkbox group for selecting periods */\nexport const PeriodSelector = ({\n maxPeriods = MAX_PERIODS,\n defaultValues,\n label,\n labelPosition = 'top',\n required = false,\n notValidatedText = '',\n onChange,\n}: PeriodSelectorProps) => {\n const maxPeriodsList = Array.from({ length: maxPeriods }, (_, index) => index + 1);\n const chunkedPeriods = chunkPeriods(maxPeriodsList);\n\n const checkboxItems = chunkedPeriods.map((periods, semester) => {\n return periods.map((period) => ({\n label: `${semester + 1}${periods.length === 1 ? '' : `.${((period - 1) % PERIODS_PER_SEMESTER) + 1}`}`,\n value: period.toString(),\n }));\n });\n\n const returnValues = useRef<number[][]>(\n chunkedPeriods.map((semester) =>\n semester.reduce((periods, period) => {\n if (defaultValues?.includes(period)) periods.push(period);\n return periods;\n }, [] as number[])\n )\n );\n const [disableSemesters, setDisableSemesters] = useState<number[]>([]);\n\n const disableGroups = (selects: number[][]) => {\n if (selects[SEMESTER_1].length !== 0 || selects[SEMESTER_2].length !== 0) return [SEMESTER_3];\n if (selects[SEMESTER_3].length !== 0) return [SEMESTER_1, SEMESTER_2];\n return [];\n };\n\n const handleChange = (values: string[], index: number) => {\n returnValues.current[index] = values.map((num) => Number(num));\n setDisableSemesters(disableGroups(returnValues.current));\n onChange([...returnValues.current.flat()].sort());\n };\n\n useEffect(() => {\n setDisableSemesters(disableGroups(returnValues.current));\n }, []);\n\n return (\n <div\n className={clsx(\n styles['period-selector__container'],\n styles[`period-selector__container--label-${labelPosition}`]\n )}\n >\n {label && (\n <Label htmlFor=\"\" required={required}>\n {label}\n </Label>\n )}\n <div className={styles['period-selector__selector-container']}>\n <div className={styles['period-selector__selector-row']}>\n {checkboxItems.map((checkboxes, semester) => (\n <CheckboxButtonBar\n key={`group_${semester}`}\n checkboxes={checkboxes}\n defaultValues={returnValues.current[semester].map((num) => num.toString())}\n disableGroup={disableSemesters.includes(semester)}\n required={required}\n onSetValues={(event) => handleChange(event, semester)}\n notValidated={notValidatedText !== ''}\n />\n ))}\n </div>\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n </div>\n );\n};\n"],"names":["SEMESTER_1","SEMESTER_2","SEMESTER_3","PERIODS_PER_SEMESTER","MAX_PERIODS","chunkPeriods","array","result","count","PeriodSelector","maxPeriods","defaultValues","label","labelPosition","required","notValidatedText","onChange","maxPeriodsList","_","index","chunkedPeriods","checkboxItems","periods","semester","period","returnValues","useRef","disableSemesters","setDisableSemesters","useState","disableGroups","selects","handleChange","values","num","useEffect","jsxs","clsx","styles","jsx","Label","checkboxes","CheckboxButtonBar","event","FeedbackBox"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { fn as t } from "../../index-
|
|
2
|
+
import { fn as t } from "../../index-Dwqes6RH.js";
|
|
3
3
|
import { PeriodSelector as e } from "./PeriodSelector.js";
|
|
4
4
|
const i = "<PeriodSelector maxPeriods={} defaultValues={} label={} labelPosition={} required={} onChange={} />", m = {
|
|
5
5
|
title: "Organisms/PeriodSelector",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type ButtonProps = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export interface RadioTabSelectorProps {
|
|
7
|
+
/** array with objects with label, value, disablestate */
|
|
8
|
+
buttons: ButtonProps[];
|
|
9
|
+
/** name of the radiogroup */
|
|
10
|
+
radioGroupName: string;
|
|
11
|
+
/** innitial value */
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
/** label takst */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** 'top' | 'left' */
|
|
16
|
+
labelPosition?: 'top' | 'left';
|
|
17
|
+
/** show red star */
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/** error text to display if set */
|
|
20
|
+
notValidatedText?: string;
|
|
21
|
+
/** The callback function that is invoked when the radio tab selector changes value. */
|
|
22
|
+
onSetValue: (value: string | null) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const RadioTabSelector: ({ buttons, radioGroupName, defaultValue, label, labelPosition, required, notValidatedText, onSetValue, }: RadioTabSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as b } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { useState as h } from "react";
|
|
4
|
+
import "../Buttons/Button.js";
|
|
5
|
+
import "../Buttons/LinkButton.js";
|
|
6
|
+
import "@react-aria/button";
|
|
7
|
+
import "../Checkbox/Checkbox.js";
|
|
8
|
+
import { Label as v } from "../Label/Label.js";
|
|
9
|
+
import { FeedbackBox as g } from "../FeedbackBox/FeedbackBox.js";
|
|
10
|
+
import { ControlsButton as k } from "../ControlsButton/ControlsButton.js";
|
|
11
|
+
import "@react-aria/dialog";
|
|
12
|
+
import "@react-aria/focus";
|
|
13
|
+
import "@react-aria/overlays";
|
|
14
|
+
import "../OverlayCloseButton/OverlayCloseButton.js";
|
|
15
|
+
import "../GridRow/GridRow.js";
|
|
16
|
+
import "../IconButton/IconButton.js";
|
|
17
|
+
import "../Input/Input.js";
|
|
18
|
+
import "../InputField/InputField.js";
|
|
19
|
+
import "react-router";
|
|
20
|
+
import "../../TablePlugin-hxs9O_ox.js";
|
|
21
|
+
import "../RteEditor/Providers/LanguageProvider.js";
|
|
22
|
+
import "../RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
23
|
+
import "../RteEditor/hooks/components/Flyout.js";
|
|
24
|
+
import "../../index-DllfJcv4.js";
|
|
25
|
+
import "../SelectListbox/SelectListbox.js";
|
|
26
|
+
import "../SelectListbox/SelectProvider.js";
|
|
27
|
+
import "../Sortable/components/SortableItem.js";
|
|
28
|
+
import "../../SortableProvider-B3_u0pKv.js";
|
|
29
|
+
import '../../assets/RadioTabSelector.css';const t = {
|
|
30
|
+
"radio-tab-selector-button-bar__container": "_radio-tab-selector-button-bar__container_a4wnc_1",
|
|
31
|
+
"radio-tab-selector-button-bar__container--label-left": "_radio-tab-selector-button-bar__container--label-left_a4wnc_6",
|
|
32
|
+
"radio-tab-selector-button-bar__container--label-top": "_radio-tab-selector-button-bar__container--label-top_a4wnc_12",
|
|
33
|
+
"radio-tab-selector-button-bar__row-container": "_radio-tab-selector-button-bar__row-container_a4wnc_18",
|
|
34
|
+
"radio-tab-selector-button-bar__row": "_radio-tab-selector-button-bar__row_a4wnc_18",
|
|
35
|
+
"radio-tab-selector-button-bar__row--not-validated": "_radio-tab-selector-button-bar__row--not-validated_a4wnc_35"
|
|
36
|
+
}, X = ({
|
|
37
|
+
buttons: l,
|
|
38
|
+
radioGroupName: c,
|
|
39
|
+
defaultValue: _,
|
|
40
|
+
label: i,
|
|
41
|
+
labelPosition: m = "top",
|
|
42
|
+
required: s = !1,
|
|
43
|
+
notValidatedText: a = "",
|
|
44
|
+
onSetValue: p
|
|
45
|
+
}) => {
|
|
46
|
+
const [d, u] = h(_ || null), w = (r) => {
|
|
47
|
+
u(r.target.value), p(r.target.value);
|
|
48
|
+
};
|
|
49
|
+
return /* @__PURE__ */ n(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: b(
|
|
53
|
+
t["radio-tab-selector-button-bar__container"],
|
|
54
|
+
t[`radio-tab-selector-button-bar__container--label-${m}`]
|
|
55
|
+
),
|
|
56
|
+
children: [
|
|
57
|
+
i && /* @__PURE__ */ o(v, { htmlFor: "", required: s, children: i }),
|
|
58
|
+
/* @__PURE__ */ n("div", { className: t["radio-tab-selector-button-bar__row-container"], children: [
|
|
59
|
+
/* @__PURE__ */ o(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: b(t["radio-tab-selector-button-bar__row"], {
|
|
63
|
+
[t["radio-tab-selector-button-bar__row--not-validated"]]: a
|
|
64
|
+
}),
|
|
65
|
+
children: l.map(({ label: r, value: e, disabled: f }) => /* @__PURE__ */ o(
|
|
66
|
+
k,
|
|
67
|
+
{
|
|
68
|
+
type: "radio",
|
|
69
|
+
name: c,
|
|
70
|
+
label: r,
|
|
71
|
+
value: e,
|
|
72
|
+
checked: d === e,
|
|
73
|
+
disabled: f,
|
|
74
|
+
onSetValue: w
|
|
75
|
+
},
|
|
76
|
+
`${e}`
|
|
77
|
+
))
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
a !== "" && /* @__PURE__ */ o(g, { level: "error", feedback: a })
|
|
81
|
+
] })
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
export {
|
|
87
|
+
X as RadioTabSelector
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=RadioTabSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioTabSelector.js","sources":["../../../src/components/RadioTabSelector/RadioTabSelector.tsx"],"sourcesContent":["import clsx from 'clsx';\r\nimport { useState } from 'react';\r\n\r\nimport type { ChangeEvent } from 'react';\r\n\r\nimport styles from './RadioTabSelector.module.css';\r\n\r\nimport { ControlsButton, FeedbackBox, Label } from 'components';\r\n\r\ntype ButtonProps = {\r\n label: string;\r\n value: string;\r\n disabled?: boolean;\r\n};\r\n\r\nexport interface RadioTabSelectorProps {\r\n /** array with objects with label, value, disablestate */\r\n buttons: ButtonProps[];\r\n /** name of the radiogroup */\r\n radioGroupName: string;\r\n /** innitial value */\r\n defaultValue?: string;\r\n /** label takst */\r\n label?: string;\r\n /** 'top' | 'left' */\r\n labelPosition?: 'top' | 'left';\r\n /** show red star */\r\n required?: boolean;\r\n /** error text to display if set */\r\n notValidatedText?: string;\r\n /** The callback function that is invoked when the radio tab selector changes value. */\r\n onSetValue: (value: string | null) => void;\r\n}\r\n\r\nexport const RadioTabSelector = ({\r\n buttons,\r\n radioGroupName,\r\n defaultValue,\r\n label,\r\n labelPosition = 'top',\r\n required = false,\r\n notValidatedText = '',\r\n onSetValue,\r\n}: RadioTabSelectorProps) => {\r\n const [currentValue, setCurrentValue] = useState<string | null>(defaultValue || null);\r\n\r\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\r\n setCurrentValue(event.target.value);\r\n onSetValue(event.target.value);\r\n };\r\n\r\n return (\r\n <div\r\n className={clsx(\r\n styles['radio-tab-selector-button-bar__container'],\r\n styles[`radio-tab-selector-button-bar__container--label-${labelPosition}`]\r\n )}\r\n >\r\n {label && (\r\n <Label htmlFor=\"\" required={required}>\r\n {label}\r\n </Label>\r\n )}\r\n <div className={styles['radio-tab-selector-button-bar__row-container']}>\r\n <div\r\n className={clsx(styles['radio-tab-selector-button-bar__row'], {\r\n [styles['radio-tab-selector-button-bar__row--not-validated']]: notValidatedText,\r\n })}\r\n >\r\n {buttons.map(({ label, value, disabled }) => (\r\n <ControlsButton\r\n type=\"radio\"\r\n name={radioGroupName}\r\n key={`${value}`}\r\n label={label}\r\n value={value}\r\n checked={currentValue === value}\r\n disabled={disabled}\r\n onSetValue={handleChange}\r\n />\r\n ))}\r\n </div>\r\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\r\n </div>\r\n </div>\r\n );\r\n};\r\n"],"names":["RadioTabSelector","buttons","radioGroupName","defaultValue","label","labelPosition","required","notValidatedText","onSetValue","currentValue","setCurrentValue","useState","handleChange","event","jsxs","clsx","styles","jsx","Label","value","disabled","ControlsButton","FeedbackBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCaA,IAAmB,CAAC;AAAA,EAC/B,SAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,UAAAC,IAAW;AAAA,EACX,kBAAAC,IAAmB;AAAA,EACnB,YAAAC;AACF,MAA6B;AAC3B,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAwBR,KAAgB,IAAI,GAE9ES,IAAe,CAACC,MAAyC;AAC7C,IAAAH,EAAAG,EAAM,OAAO,KAAK,GACvBL,EAAAK,EAAM,OAAO,KAAK;AAAA,EAC/B;AAGE,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTC,EAAO,0CAA0C;AAAA,QACjDA,EAAO,mDAAmDX,CAAa,EAAE;AAAA,MAC3E;AAAA,MAEC,UAAA;AAAA,QAAAD,KACE,gBAAAa,EAAAC,GAAA,EAAM,SAAQ,IAAG,UAAAZ,GACf,UACHF,GAAA;AAAA,QAED,gBAAAU,EAAA,OAAA,EAAI,WAAWE,EAAO,8CAA8C,GACnE,UAAA;AAAA,UAAA,gBAAAC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWF,EAAKC,EAAO,oCAAoC,GAAG;AAAA,gBAC5D,CAACA,EAAO,mDAAmD,CAAC,GAAGT;AAAA,cAAA,CAChE;AAAA,cAEA,UAAAN,EAAQ,IAAI,CAAC,EAAE,OAAAG,GAAO,OAAAe,GAAO,UAAAC,QAC5B,gBAAAH;AAAA,gBAACI;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,MAAMnB;AAAA,kBAEN,OAAOE;AAAAA,kBACP,OAAAe;AAAA,kBACA,SAASV,MAAiBU;AAAA,kBAC1B,UAAAC;AAAA,kBACA,YAAYR;AAAA,gBAAA;AAAA,gBALP,GAAGO,CAAK;AAAA,cAOhB,CAAA;AAAA,YAAA;AAAA,UACH;AAAA,UACCZ,MAAqB,MAAM,gBAAAU,EAACK,KAAY,OAAM,SAAQ,UAAUf,EAAkB,CAAA;AAAA,QAAA,EACrF,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { RadioTabSelectorProps } from './RadioTabSelector';
|
|
3
|
+
declare const _default: Meta<RadioTabSelectorProps>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const RadioTabSelectorExample: import('@storybook/core/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, RadioTabSelectorProps>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { fn as o } from "../../index-Dwqes6RH.js";
|
|
3
|
+
import { RadioTabSelector as e } from "./RadioTabSelector.js";
|
|
4
|
+
const l = "<RadioTabSelector radioButtons={} defaultValue={} label={} labelPosition={} required={} notValidatedText={} onSetValue={} />", u = {
|
|
5
|
+
title: "Molecules/RadioTabSelector",
|
|
6
|
+
component: e,
|
|
7
|
+
argTypes: {
|
|
8
|
+
radioButtons: {
|
|
9
|
+
table: {
|
|
10
|
+
disable: !0
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultValue: {
|
|
14
|
+
table: {
|
|
15
|
+
disable: !0
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
control: "text"
|
|
20
|
+
},
|
|
21
|
+
labelPosition: {
|
|
22
|
+
control: "radio",
|
|
23
|
+
options: ["top", "left"]
|
|
24
|
+
},
|
|
25
|
+
required: {
|
|
26
|
+
control: "boolean"
|
|
27
|
+
},
|
|
28
|
+
notValidatedText: {
|
|
29
|
+
control: "text"
|
|
30
|
+
},
|
|
31
|
+
onSetValue: {
|
|
32
|
+
table: {
|
|
33
|
+
disable: !0
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
parameters: {
|
|
38
|
+
inspectComponent: e,
|
|
39
|
+
codeString: l
|
|
40
|
+
}
|
|
41
|
+
}, i = (t) => /* @__PURE__ */ a(e, { ...t }), r = i.bind({});
|
|
42
|
+
r.args = {
|
|
43
|
+
buttons: [
|
|
44
|
+
{ label: "Digitaal", value: "digitaal" },
|
|
45
|
+
{ label: "Schriftelijk", value: "schriftelijk" },
|
|
46
|
+
{ label: "Presentatie", value: "presentatie" }
|
|
47
|
+
],
|
|
48
|
+
defaultValue: "digitaal",
|
|
49
|
+
radioGroupName: "radio-group",
|
|
50
|
+
label: "Toetsvorm",
|
|
51
|
+
labelPosition: "top",
|
|
52
|
+
required: !0,
|
|
53
|
+
notValidatedText: "",
|
|
54
|
+
onSetValue: o()
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
r as RadioTabSelectorExample,
|
|
58
|
+
u as default
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=RadioTabSelector.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioTabSelector.stories.js","sources":["../../../src/components/RadioTabSelector/RadioTabSelector.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\r\n\r\nimport type { Meta, StoryFn } from '@storybook/react';\r\nimport type { RadioTabSelectorProps } from './RadioTabSelector'; // Already imported above\r\n\r\nimport { RadioTabSelector } from './RadioTabSelector';\r\n\r\nconst codeString =\r\n '<RadioTabSelector radioButtons={} defaultValue={} label={} labelPosition={} required={} notValidatedText={} onSetValue={} />';\r\n\r\n// eslint-disable-next-line import/no-default-export\r\nexport default {\r\n title: 'Molecules/RadioTabSelector',\r\n component: RadioTabSelector,\r\n argTypes: {\r\n radioButtons: {\r\n table: {\r\n disable: true,\r\n },\r\n },\r\n defaultValue: {\r\n table: {\r\n disable: true,\r\n },\r\n },\r\n label: {\r\n control: 'text',\r\n },\r\n labelPosition: {\r\n control: 'radio',\r\n options: ['top', 'left'],\r\n },\r\n required: {\r\n control: 'boolean',\r\n },\r\n notValidatedText: {\r\n control: 'text',\r\n },\r\n onSetValue: {\r\n table: {\r\n disable: true,\r\n },\r\n },\r\n },\r\n parameters: {\r\n inspectComponent: RadioTabSelector,\r\n codeString: codeString,\r\n },\r\n} as Meta<RadioTabSelectorProps>;\r\n\r\nconst Template: StoryFn<RadioTabSelectorProps> = (args) => <RadioTabSelector {...args} />;\r\n\r\nexport const RadioTabSelectorExample = Template.bind({});\r\nRadioTabSelectorExample.args = {\r\n buttons: [\r\n { label: 'Digitaal', value: 'digitaal' },\r\n { label: 'Schriftelijk', value: 'schriftelijk' },\r\n { label: 'Presentatie', value: 'presentatie' },\r\n ],\r\n defaultValue: 'digitaal',\r\n radioGroupName: 'radio-group',\r\n label: 'Toetsvorm',\r\n labelPosition: 'top',\r\n required: true,\r\n notValidatedText: '',\r\n onSetValue: fn(),\r\n};\r\n"],"names":["codeString","RadioTabSelector_stories","RadioTabSelector","Template","args","jsx","RadioTabSelectorExample","fn"],"mappings":";;;AAOA,MAAMA,IACJ,gIAGaC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IAEb;AAAA,IACA,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IAEb;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,IACX;AAAA,IACA,eAAe;AAAA,MACb,SAAS;AAAA,MACT,SAAS,CAAC,OAAO,MAAM;AAAA,IACzB;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,IACX;AAAA,IACA,kBAAkB;AAAA,MAChB,SAAS;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,EAEJ;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EAAA;AAEJ,GAEMG,IAA2C,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAkB,GAAGE,GAAM,GAE1EE,IAA0BH,EAAS,KAAK,CAAE,CAAA;AACvDG,EAAwB,OAAO;AAAA,EAC7B,SAAS;AAAA,IACP,EAAE,OAAO,YAAY,OAAO,WAAW;AAAA,IACvC,EAAE,OAAO,gBAAgB,OAAO,eAAe;AAAA,IAC/C,EAAE,OAAO,eAAe,OAAO,cAAc;AAAA,EAC/C;AAAA,EACA,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,YAAYC,EAAG;AACjB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RadioTabSelector';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -8,11 +8,11 @@ import "../../../../Buttons/LinkButton.js";
|
|
|
8
8
|
import "@react-aria/button";
|
|
9
9
|
import "../../../../Checkbox/Checkbox.js";
|
|
10
10
|
import "../../../../Label/Label.js";
|
|
11
|
+
import "../../../../FeedbackBox/FeedbackBox.js";
|
|
11
12
|
import "@react-aria/dialog";
|
|
12
13
|
import "@react-aria/focus";
|
|
13
14
|
import "@react-aria/overlays";
|
|
14
15
|
import "../../../../OverlayCloseButton/OverlayCloseButton.js";
|
|
15
|
-
import "../../../../FeedbackBox/FeedbackBox.js";
|
|
16
16
|
import "../../../../FormField/FormField.js";
|
|
17
17
|
import "../../../../GridRow/GridRow.js";
|
|
18
18
|
import "../../../../IconButton/IconButton.js";
|
|
@@ -23,11 +23,11 @@ import "../Buttons/Button.js";
|
|
|
23
23
|
import "../Buttons/LinkButton.js";
|
|
24
24
|
import "@react-aria/button";
|
|
25
25
|
import "../Checkbox/Checkbox.js";
|
|
26
|
+
import { FeedbackBox as fr } from "../FeedbackBox/FeedbackBox.js";
|
|
26
27
|
import "@react-aria/dialog";
|
|
27
28
|
import "@react-aria/focus";
|
|
28
29
|
import "@react-aria/overlays";
|
|
29
30
|
import "../OverlayCloseButton/OverlayCloseButton.js";
|
|
30
|
-
import { FeedbackBox as fr } from "../FeedbackBox/FeedbackBox.js";
|
|
31
31
|
import "../GridRow/GridRow.js";
|
|
32
32
|
import "../IconButton/IconButton.js";
|
|
33
33
|
import "../Input/Input.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as m, Fragment as i } from "react/jsx-runtime";
|
|
2
|
-
import { fn as s } from "../../index-
|
|
2
|
+
import { fn as s } from "../../index-Dwqes6RH.js";
|
|
3
3
|
import { Sortable as o } from "./Sortable.js";
|
|
4
4
|
import { InputField as c } from "../InputField/InputField.js";
|
|
5
5
|
import { Icon as d } from "../Icon/Icon.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { fn as r } from "../../index-
|
|
2
|
+
import { fn as r } from "../../index-Dwqes6RH.js";
|
|
3
3
|
import { TextArea as e } from "./TextArea.js";
|
|
4
4
|
const o = `
|
|
5
5
|
<TextArea label={label} maxCharacters={maxCharacters} /> `, x = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-BqLi4tOb.js";
|
|
3
3
|
import { r as n, s as t, f as r } from "../../react.esm-CsMDid07.js";
|
|
4
|
-
import { userEvent as s } from "../../index-
|
|
4
|
+
import { userEvent as s } from "../../index-Dwqes6RH.js";
|
|
5
5
|
import { TextArea as o } from "./TextArea.js";
|
|
6
6
|
describe("TextArea", () => {
|
|
7
7
|
it("should render correctly with label", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { fn as l } from "../../index-
|
|
2
|
+
import { fn as l } from "../../index-Dwqes6RH.js";
|
|
3
3
|
import { ToggleSwitch as e } from "./ToggleSwitch.js";
|
|
4
4
|
const n = `
|
|
5
5
|
// Has all InputHTMLAttributes props available except "className" and "style"
|
|
@@ -8,10 +8,10 @@ export * from './ButtonGroup';
|
|
|
8
8
|
export * from './Buttons';
|
|
9
9
|
export * from './Card';
|
|
10
10
|
export * from './Checkbox';
|
|
11
|
-
export * from './CheckboxButton';
|
|
12
11
|
export * from './CheckboxButtonBar';
|
|
13
12
|
export * from './CheckboxTree';
|
|
14
13
|
export * from './Chip';
|
|
14
|
+
export * from './ControlsButton';
|
|
15
15
|
export * from './Drawer';
|
|
16
16
|
export * from './EmptyStateDataDisplay';
|
|
17
17
|
export * from './FeedbackBar';
|
|
@@ -41,6 +41,7 @@ export * from './PeriodSelector';
|
|
|
41
41
|
export * from './ProgrammeCard';
|
|
42
42
|
export * from './RadioButton';
|
|
43
43
|
export * from './RadioGroup';
|
|
44
|
+
export * from './RadioTabSelector';
|
|
44
45
|
export * from './Repeater';
|
|
45
46
|
export * from './RteEditor';
|
|
46
47
|
export * from './SectionNotification';
|