@uva-glass/component-library 1.48.0 → 1.49.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.
Files changed (199) hide show
  1. package/dist/MultiSelect-Ckf3uGw5.js.map +1 -1
  2. package/dist/assets/CheckboxButton.css +1 -0
  3. package/dist/assets/CheckboxButtonBar.css +1 -0
  4. package/dist/assets/CheckboxTree.css +1 -1
  5. package/dist/assets/Label.css +1 -1
  6. package/dist/assets/PeriodSelector.css +1 -0
  7. package/dist/components/Accordion/Accordion.d.ts +2 -2
  8. package/dist/components/Accordion/Accordion.js.map +1 -1
  9. package/dist/components/ActionList/ActionList.d.ts +6 -0
  10. package/dist/components/ActionList/ActionList.js +1 -1
  11. package/dist/components/ActionList/ActionList.js.map +1 -1
  12. package/dist/components/ActionList/ActionList.stories.js +4 -3
  13. package/dist/components/ActionList/ActionList.stories.js.map +1 -1
  14. package/dist/components/AppStatusBar/AppStatusBar.d.ts +3 -0
  15. package/dist/components/AppStatusBar/AppStatusBar.js.map +1 -1
  16. package/dist/components/AppStatusBar/AppStatusBar.stories.js +8 -7
  17. package/dist/components/AppStatusBar/AppStatusBar.stories.js.map +1 -1
  18. package/dist/components/Attention/Attention.d.ts +1 -0
  19. package/dist/components/Attention/Attention.js.map +1 -1
  20. package/dist/components/Attention/Attention.stories.js +3 -2
  21. package/dist/components/Attention/Attention.stories.js.map +1 -1
  22. package/dist/components/Backdrop/Backdrop.d.ts +1 -0
  23. package/dist/components/Backdrop/Backdrop.js.map +1 -1
  24. package/dist/components/Backdrop/Backdrop.stories.js +8 -7
  25. package/dist/components/Backdrop/Backdrop.stories.js.map +1 -1
  26. package/dist/components/Button/Button.d.ts +4 -0
  27. package/dist/components/Button/Button.js.map +1 -1
  28. package/dist/components/Button/Button.stories.js +14 -13
  29. package/dist/components/Button/Button.stories.js.map +1 -1
  30. package/dist/components/ButtonGroup/ButtonGroup.d.ts +3 -0
  31. package/dist/components/ButtonGroup/ButtonGroup.js.map +1 -1
  32. package/dist/components/ButtonGroup/ButtonGroup.stories.js +1 -0
  33. package/dist/components/ButtonGroup/ButtonGroup.stories.js.map +1 -1
  34. package/dist/components/Card/Card.d.ts +6 -0
  35. package/dist/components/Card/Card.js.map +1 -1
  36. package/dist/components/Card/Card.stories.js +14 -13
  37. package/dist/components/Card/Card.stories.js.map +1 -1
  38. package/dist/components/Checkbox/Checkbox.d.ts +1 -0
  39. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  40. package/dist/components/Checkbox/Checkbox.stories.js +17 -16
  41. package/dist/components/Checkbox/Checkbox.stories.js.map +1 -1
  42. package/dist/components/CheckboxButton/CheckboxButton.d.ts +16 -0
  43. package/dist/components/CheckboxButton/CheckboxButton.js +51 -0
  44. package/dist/components/CheckboxButton/CheckboxButton.js.map +1 -0
  45. package/dist/components/CheckboxButton/CheckboxButton.stories.d.ts +5 -0
  46. package/dist/components/CheckboxButton/CheckboxButton.stories.js +48 -0
  47. package/dist/components/CheckboxButton/CheckboxButton.stories.js.map +1 -0
  48. package/dist/components/CheckboxButton/index.d.ts +1 -0
  49. package/dist/components/CheckboxButton/index.js +5 -0
  50. package/dist/components/CheckboxButton/index.js.map +1 -0
  51. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.d.ts +22 -0
  52. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js +62 -0
  53. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js.map +1 -0
  54. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.d.ts +5 -0
  55. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +70 -0
  56. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js.map +1 -0
  57. package/dist/components/CheckboxButtonBar/index.d.ts +1 -0
  58. package/dist/components/CheckboxButtonBar/index.js +5 -0
  59. package/dist/components/CheckboxButtonBar/index.js.map +1 -0
  60. package/dist/components/CheckboxTree/CheckboxTree.d.ts +5 -3
  61. package/dist/components/CheckboxTree/CheckboxTree.js +21 -21
  62. package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
  63. package/dist/components/CheckboxTree/CheckboxTree.stories.js +1 -1
  64. package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
  65. package/dist/components/Drawer/Drawer.d.ts +6 -0
  66. package/dist/components/Drawer/Drawer.js.map +1 -1
  67. package/dist/components/Drawer/Drawer.stories.js +16 -15
  68. package/dist/components/Drawer/Drawer.stories.js.map +1 -1
  69. package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.d.ts +3 -0
  70. package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.js.map +1 -1
  71. package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.stories.js +3 -2
  72. package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.stories.js.map +1 -1
  73. package/dist/components/FeedbackBox/FeedbackBox.d.ts +4 -0
  74. package/dist/components/FeedbackBox/FeedbackBox.js.map +1 -1
  75. package/dist/components/FeedbackBox/FeedbackBox.stories.js +10 -9
  76. package/dist/components/FeedbackBox/FeedbackBox.stories.js.map +1 -1
  77. package/dist/components/FieldHint/FieldHint.d.ts +4 -0
  78. package/dist/components/FieldHint/FieldHint.js.map +1 -1
  79. package/dist/components/FieldHint/FieldHint.stories.js +1 -0
  80. package/dist/components/FieldHint/FieldHint.stories.js.map +1 -1
  81. package/dist/components/Fieldset/Fieldset.d.ts +5 -0
  82. package/dist/components/Fieldset/Fieldset.js.map +1 -1
  83. package/dist/components/Fieldset/Fieldset.stories.js +20 -19
  84. package/dist/components/Fieldset/Fieldset.stories.js.map +1 -1
  85. package/dist/components/FormField/FormField.d.ts +3 -0
  86. package/dist/components/FormField/FormField.js.map +1 -1
  87. package/dist/components/FormField/FormField.stories.js +16 -15
  88. package/dist/components/FormField/FormField.stories.js.map +1 -1
  89. package/dist/components/GridRow/GridRow.d.ts +4 -0
  90. package/dist/components/GridRow/GridRow.js +4 -4
  91. package/dist/components/GridRow/GridRow.js.map +1 -1
  92. package/dist/components/GridRow/GridRow.stories.js +1 -0
  93. package/dist/components/GridRow/GridRow.stories.js.map +1 -1
  94. package/dist/components/HorizontalList/HorizontalList.d.ts +3 -0
  95. package/dist/components/HorizontalList/HorizontalList.js.map +1 -1
  96. package/dist/components/HorizontalList/HorizontalList.stories.js +7 -6
  97. package/dist/components/HorizontalList/HorizontalList.stories.js.map +1 -1
  98. package/dist/components/Icon/Icon.d.ts +4 -0
  99. package/dist/components/Icon/Icon.js.map +1 -1
  100. package/dist/components/Icon/Icon.stories.js +1 -0
  101. package/dist/components/Icon/Icon.stories.js.map +1 -1
  102. package/dist/components/IconButton/IconButton.d.ts +5 -0
  103. package/dist/components/IconButton/IconButton.js.map +1 -1
  104. package/dist/components/IconButton/IconButton.stories.js +8 -7
  105. package/dist/components/IconButton/IconButton.stories.js.map +1 -1
  106. package/dist/components/InfoMessage/InfoMessage.d.ts +3 -0
  107. package/dist/components/InfoMessage/InfoMessage.js.map +1 -1
  108. package/dist/components/InfoMessage/InfoMessage.stories.js +4 -3
  109. package/dist/components/InfoMessage/InfoMessage.stories.js.map +1 -1
  110. package/dist/components/Input/Input.d.ts +6 -0
  111. package/dist/components/Input/Input.js.map +1 -1
  112. package/dist/components/Input/Input.stories.js +11 -10
  113. package/dist/components/Input/Input.stories.js.map +1 -1
  114. package/dist/components/InputField/InputField.d.ts +6 -0
  115. package/dist/components/InputField/InputField.js.map +1 -1
  116. package/dist/components/InputField/InputField.stories.js +16 -15
  117. package/dist/components/InputField/InputField.stories.js.map +1 -1
  118. package/dist/components/Label/Label.d.ts +6 -1
  119. package/dist/components/Label/Label.js +12 -10
  120. package/dist/components/Label/Label.js.map +1 -1
  121. package/dist/components/Label/Label.stories.js +1 -0
  122. package/dist/components/Label/Label.stories.js.map +1 -1
  123. package/dist/components/MenuButton/MenuButton.d.ts +4 -0
  124. package/dist/components/MenuButton/MenuButton.js +1 -1
  125. package/dist/components/MenuButton/MenuButton.js.map +1 -1
  126. package/dist/components/MenuButton/MenuButton.stories.js +19 -18
  127. package/dist/components/MenuButton/MenuButton.stories.js.map +1 -1
  128. package/dist/components/MenuLink/MenuLink.d.ts +1 -0
  129. package/dist/components/MenuLink/MenuLink.js.map +1 -1
  130. package/dist/components/MenuLink/MenuLink.stories.js +5 -4
  131. package/dist/components/MenuLink/MenuLink.stories.js.map +1 -1
  132. package/dist/components/MetaDataList/MetaDataList.d.ts +2 -0
  133. package/dist/components/MetaDataList/MetaDataList.js.map +1 -1
  134. package/dist/components/MetaDataList/MetaDataList.stories.js +5 -4
  135. package/dist/components/MetaDataList/MetaDataList.stories.js.map +1 -1
  136. package/dist/components/ModalDialog/ModalDialog.d.ts +20 -1
  137. package/dist/components/ModalDialog/ModalDialog.js.map +1 -1
  138. package/dist/components/ModalDialog/ModalDialog.stories.js +9 -8
  139. package/dist/components/ModalDialog/ModalDialog.stories.js.map +1 -1
  140. package/dist/components/MultiSelect/MultiSelect.d.ts +4 -0
  141. package/dist/components/MultiSelect/MultiSelect.stories.js +23 -22
  142. package/dist/components/MultiSelect/MultiSelect.stories.js.map +1 -1
  143. package/dist/components/OverlayCloseButton/OverlayCloseButton.d.ts +3 -0
  144. package/dist/components/OverlayCloseButton/OverlayCloseButton.js.map +1 -1
  145. package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +11 -10
  146. package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js.map +1 -1
  147. package/dist/components/PeriodSelector/PeriodSelector.d.ts +16 -0
  148. package/dist/components/PeriodSelector/PeriodSelector.js +74 -0
  149. package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -0
  150. package/dist/components/PeriodSelector/PeriodSelector.stories.d.ts +5 -0
  151. package/dist/components/PeriodSelector/PeriodSelector.stories.js +25 -0
  152. package/dist/components/PeriodSelector/PeriodSelector.stories.js.map +1 -0
  153. package/dist/components/PeriodSelector/index.d.ts +1 -0
  154. package/dist/components/PeriodSelector/index.js +5 -0
  155. package/dist/components/PeriodSelector/index.js.map +1 -0
  156. package/dist/components/Periods/Periods.d.ts +4 -0
  157. package/dist/components/Periods/Periods.js.map +1 -1
  158. package/dist/components/Periods/Periods.stories.js +1 -0
  159. package/dist/components/Periods/Periods.stories.js.map +1 -1
  160. package/dist/components/ProgrammeCard/ProgrammeCard.d.ts +4 -0
  161. package/dist/components/ProgrammeCard/ProgrammeCard.js.map +1 -1
  162. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +19 -18
  163. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
  164. package/dist/components/RadioButton/RadioButton.d.ts +5 -0
  165. package/dist/components/RadioButton/RadioButton.js.map +1 -1
  166. package/dist/components/RadioButton/RadioButton.stories.js +9 -8
  167. package/dist/components/RadioButton/RadioButton.stories.js.map +1 -1
  168. package/dist/components/Repeater/Repeater.d.ts +3 -0
  169. package/dist/components/Repeater/Repeater.js.map +1 -1
  170. package/dist/components/Repeater/Repeater.stories.js +6 -5
  171. package/dist/components/Repeater/Repeater.stories.js.map +1 -1
  172. package/dist/components/SectionNotification/SectionNotification.d.ts +2 -0
  173. package/dist/components/SectionNotification/SectionNotification.js.map +1 -1
  174. package/dist/components/SectionNotification/SectionNotification.stories.js +1 -0
  175. package/dist/components/SectionNotification/SectionNotification.stories.js.map +1 -1
  176. package/dist/components/SelectListbox/SelectListBox.stories.d.ts +2 -2
  177. package/dist/components/SelectListbox/SelectListBox.stories.js +1 -0
  178. package/dist/components/SelectListbox/SelectListBox.stories.js.map +1 -1
  179. package/dist/components/SelectListbox/SelectListbox.d.ts +12 -0
  180. package/dist/components/SelectListbox/SelectListbox.js +9 -9
  181. package/dist/components/SelectListbox/SelectListbox.js.map +1 -1
  182. package/dist/components/Spinner/Spinner.d.ts +3 -1
  183. package/dist/components/Spinner/Spinner.js.map +1 -1
  184. package/dist/components/Spinner/Spinner.stories.js +4 -3
  185. package/dist/components/Spinner/Spinner.stories.js.map +1 -1
  186. package/dist/components/StatusPill/StatusPill.d.ts +4 -0
  187. package/dist/components/StatusPill/StatusPill.js.map +1 -1
  188. package/dist/components/StatusPill/StatusPill.stories.js +7 -6
  189. package/dist/components/StatusPill/StatusPill.stories.js.map +1 -1
  190. package/dist/components/Tooltip/Tooltip.d.ts +6 -0
  191. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  192. package/dist/components/Tooltip/Tooltip.stories.js +10 -9
  193. package/dist/components/Tooltip/Tooltip.stories.js.map +1 -1
  194. package/dist/components/index.d.ts +3 -0
  195. package/dist/components/index.js +73 -67
  196. package/dist/components/index.js.map +1 -1
  197. package/dist/index.js +73 -67
  198. package/dist/index.js.map +1 -1
  199. package/package.json +15 -15
@@ -5,41 +5,41 @@ import { Icon as L } from "../Icon/Icon.js";
5
5
  import "@react-aria/button";
6
6
  import { Button as R } from "../Button/Button.js";
7
7
  import { Checkbox as y } from "../Checkbox/Checkbox.js";
8
+ import { Label as S } from "../Label/Label.js";
8
9
  import "@react-aria/dialog";
9
10
  import "@react-aria/focus";
10
11
  import "@react-aria/overlays";
11
12
  import "../OverlayCloseButton/OverlayCloseButton.js";
12
- import { FormField as S } from "../FormField/FormField.js";
13
+ import { FormField as C } from "../FormField/FormField.js";
13
14
  import "../GridRow/GridRow.js";
14
15
  import "../IconButton/IconButton.js";
15
16
  import "../Input/Input.js";
16
17
  import "../InputField/InputField.js";
17
- import { Label as C } from "../Label/Label.js";
18
18
  import "react-router-dom";
19
19
  import "../../MultiSelect-Ckf3uGw5.js";
20
20
  import "../SelectListbox/SelectListbox.js";
21
21
  import "../SelectListbox/SelectProvider.js";
22
22
  import { useResponsive as j } from "../hooks/useResponsive.js";
23
23
  import '../../assets/CheckboxTree.css';const o = {
24
- "checkbox-tree__header": "_checkbox-tree__header_12b1f_1",
25
- "checkbox-tree__branch": "_checkbox-tree__branch_12b1f_8",
26
- "checkbox-tree__branch--icon": "_checkbox-tree__branch--icon_12b1f_17",
27
- "checkbox-tree__branch--icon--expanded": "_checkbox-tree__branch--icon--expanded_12b1f_23",
28
- "checkbox-tree__branch--formfield": "_checkbox-tree__branch--formfield_12b1f_28",
29
- "checkbox-tree__leaves": "_checkbox-tree__leaves_12b1f_35",
30
- "checkbox-tree__leaves--expanded": "_checkbox-tree__leaves--expanded_12b1f_44",
31
- "checkbox-tree__leaf": "_checkbox-tree__leaf_12b1f_48"
32
- }, ce = ({ title: p, checkboxTree: A, defaultValue: i, onChange: u }) => {
24
+ "checkbox-tree__header": "_checkbox-tree__header_xbe4e_1",
25
+ "checkbox-tree__branch": "_checkbox-tree__branch_xbe4e_8",
26
+ "checkbox-tree__branch--icon": "_checkbox-tree__branch--icon_xbe4e_21",
27
+ "checkbox-tree__branch--icon--expanded": "_checkbox-tree__branch--icon--expanded_xbe4e_27",
28
+ "checkbox-tree__branch--formfield": "_checkbox-tree__branch--formfield_xbe4e_32",
29
+ "checkbox-tree__leaves": "_checkbox-tree__leaves_xbe4e_39",
30
+ "checkbox-tree__leaves--expanded": "_checkbox-tree__leaves--expanded_xbe4e_48",
31
+ "checkbox-tree__leaf": "_checkbox-tree__leaf_xbe4e_52"
32
+ }, ce = ({ title: p, checkboxTree: A, defaultValue: i, onChange: x }) => {
33
33
  const s = T([]), { lessThan: n } = j(), _ = (r, e = document) => [].slice.call(e.querySelectorAll(r)), E = () => {
34
34
  const r = s.current.reduce((e, t) => (t.name && t.checked && e.push(t.value), e), []);
35
- u && u(r);
36
- }, f = (r) => {
35
+ x && x(r);
36
+ }, u = (r) => {
37
37
  var e, t, d;
38
38
  for (; r; ) {
39
- const c = (t = (e = r.closest("[data-ul]")) == null ? void 0 : e.parentNode) == null ? void 0 : t.querySelector("input"), x = _(
39
+ const c = (t = (e = r.closest("[data-ul]")) == null ? void 0 : e.parentNode) == null ? void 0 : t.querySelector("input"), f = _(
40
40
  "input",
41
41
  (d = c == null ? void 0 : c.closest("[data-li]")) == null ? void 0 : d.querySelector("[data-ul]")
42
- ).reduce((k, v) => (v.disabled || k.push(v.checked), k), []), b = x.every(Boolean), F = x.some(Boolean);
42
+ ).reduce((k, v) => (v.disabled || k.push(v.checked), k), []), b = f.every(Boolean), F = f.some(Boolean);
43
43
  if (c && (c.checked = b, c.indeterminate = !b && b !== F), !c || r === c)
44
44
  break;
45
45
  r = c;
@@ -61,7 +61,7 @@ import '../../assets/CheckboxTree.css';const o = {
61
61
  return;
62
62
  }
63
63
  if (s.current.indexOf(e) === -1) return;
64
- (e.parentNode.parentNode ? _("input", e.parentNode.parentNode) : []).forEach((h) => h.checked = h.disabled ? !1 : e.checked), f(e), E();
64
+ (e.parentNode.parentNode ? _("input", e.parentNode.parentNode) : []).forEach((h) => h.checked = h.disabled ? !1 : e.checked), u(e), E();
65
65
  }, B = (r) => {
66
66
  const e = r.target, t = e.closest("[data-li]");
67
67
  m(e, t);
@@ -70,7 +70,7 @@ import '../../assets/CheckboxTree.css';const o = {
70
70
  s.current = _("input") || [];
71
71
  }, []), N(() => {
72
72
  i && s.current.forEach((r) => {
73
- i.includes(r.value) && (r.checked = !0, f(r));
73
+ i.includes(r.value) && (r.checked = !0, u(r));
74
74
  });
75
75
  }, [i]), /* @__PURE__ */ l("div", { children: [
76
76
  p && /* @__PURE__ */ a("span", { className: o["checkbox-tree__header"], children: p }),
@@ -81,7 +81,7 @@ import '../../assets/CheckboxTree.css';const o = {
81
81
  "data-li": !0,
82
82
  "aria-expanded": n.md ? "false" : "true",
83
83
  children: [
84
- /* @__PURE__ */ l(S, { inline: !0, className: o["checkbox-tree__branch--formfield"], children: [
84
+ /* @__PURE__ */ l(C, { inline: !0, className: o["checkbox-tree__branch--formfield"], children: [
85
85
  /* @__PURE__ */ a(R, { variant: "blank", onClick: B, children: /* @__PURE__ */ a(
86
86
  L,
87
87
  {
@@ -93,7 +93,7 @@ import '../../assets/CheckboxTree.css';const o = {
93
93
  }
94
94
  ) }),
95
95
  /* @__PURE__ */ a(y, { id: r, disabled: e.every((t) => t.disabled) }),
96
- /* @__PURE__ */ a(C, { htmlFor: r, children: r })
96
+ /* @__PURE__ */ a(S, { htmlFor: r, children: r })
97
97
  ] }),
98
98
  /* @__PURE__ */ a(
99
99
  "div",
@@ -102,9 +102,9 @@ import '../../assets/CheckboxTree.css';const o = {
102
102
  [o["checkbox-tree__leaves--expanded"]]: !n.md
103
103
  }),
104
104
  "data-ul": !0,
105
- children: e.map(({ itemName: t, itemValue: d, disabled: c }) => /* @__PURE__ */ a("div", { className: o["checkbox-tree__leaf"], "data-li": !0, children: /* @__PURE__ */ l(S, { inline: !0, className: o["checkbox-tree__branch--formfield"], children: [
105
+ children: e.map(({ itemName: t, itemValue: d, disabled: c }) => /* @__PURE__ */ a("div", { className: o["checkbox-tree__leaf"], "data-li": !0, children: /* @__PURE__ */ l(C, { inline: !0, className: o["checkbox-tree__branch--formfield"], children: [
106
106
  /* @__PURE__ */ a(y, { id: t, name: t, value: d, disabled: c }),
107
- /* @__PURE__ */ a(C, { htmlFor: t, children: t })
107
+ /* @__PURE__ */ a(S, { htmlFor: t, children: t })
108
108
  ] }) }, t))
109
109
  }
110
110
  )
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxTree.js","sources":["../../../src/components/CheckboxTree/CheckboxTree.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport type { MouseEventHandler } from 'react';\n\nimport styles from './CheckboxTree.module.css';\n\nimport { Checkbox, Label, FormField, Icon, Button } from 'components';\nimport { useResponsive } from 'components/hooks/useResponsive';\n\ntype CheckboxLeaf = {\n itemName: string;\n itemValue: string;\n disabled?: boolean;\n};\n\ntype CheckboxBranch = {\n itemName: string;\n children: CheckboxLeaf[];\n};\n\nexport interface CheckboxTreeProps {\n title?: string;\n /** array of checkbox groups with a label and array of children (itemname, itemvalue and disabled boolean)*/\n checkboxTree: CheckboxBranch[];\n /** array of selected values */\n defaultValue?: string[];\n /** returns array of selected values*/\n onChange?: (value: string[]) => void;\n}\n\nexport const CheckboxTree = ({ title, checkboxTree, defaultValue, onChange }: CheckboxTreeProps) => {\n const checkboxNodes = useRef<HTMLInputElement[]>([]);\n const { lessThan } = useResponsive();\n\n const nodeArray = (selector: string, parent = document) => [].slice.call(parent.querySelectorAll(selector));\n\n const setValue = () => {\n const values = checkboxNodes.current.reduce((values, checkbox) => {\n if (checkbox.name && checkbox.checked) {\n values.push(checkbox.value);\n }\n return values;\n }, [] as string[]);\n\n if (onChange) onChange(values);\n };\n\n const setCheckboxesState = (check: HTMLInputElement) => {\n while (check) {\n const parent = check.closest('[data-ul]')?.parentNode?.querySelector('input');\n const siblings: HTMLInputElement[] = nodeArray(\n 'input',\n parent?.closest('[data-li]')?.querySelector('[data-ul]') as Document | undefined\n );\n\n const checkStatus = siblings.reduce((status, check) => {\n if (!check.disabled) status.push(check.checked);\n return status;\n }, [] as boolean[]);\n\n const every = checkStatus.every(Boolean);\n const some = checkStatus.some(Boolean);\n\n if (parent) {\n parent.checked = every;\n parent.indeterminate = !every && every !== some;\n }\n\n if (!parent || check === parent) {\n break;\n }\n\n check = parent;\n }\n };\n\n const setExpandedAttributes = (trigger: HTMLButtonElement, container: Element | null) => {\n const children = container?.querySelector('[data-ul]');\n\n (trigger.childNodes[0] as Element).classList.toggle(styles['checkbox-tree__branch--icon--expanded']);\n container\n ?.closest('[data-li]')\n ?.setAttribute(\n 'aria-expanded',\n container?.closest('[data-li]')?.getAttribute('aria-expanded') === 'false' ? 'true' : 'false'\n );\n\n if (children) {\n children.classList.toggle(styles['checkbox-tree__leaves--expanded']);\n }\n };\n\n const handleChange: MouseEventHandler<HTMLDivElement> = (event) => {\n const check = event.target as HTMLInputElement;\n\n if (!check || !check.parentNode || !check.parentNode.parentNode) return;\n const parentCheckbox = check.parentNode.parentNode as HTMLElement;\n\n if (\n lessThan.md &&\n check.previousElementSibling?.tagName === 'BUTTON' &&\n parentCheckbox.getAttribute('aria-expanded') === 'false'\n ) {\n event.preventDefault();\n setExpandedAttributes(parentCheckbox.querySelector('button') as HTMLButtonElement, parentCheckbox);\n return;\n }\n\n if (checkboxNodes.current.indexOf(check) === -1) return;\n\n const children: HTMLInputElement[] = (check.parentNode.parentNode as Document)\n ? nodeArray('input', check.parentNode.parentNode as Document)\n : [];\n\n children.forEach((child) => {\n return (child.checked = child.disabled ? false : check.checked);\n });\n\n setCheckboxesState(check);\n setValue();\n };\n\n const handleExpanded: MouseEventHandler<HTMLButtonElement> = (event) => {\n const target = event.target as HTMLButtonElement;\n const parent = target.closest('[data-li]');\n setExpandedAttributes(target, parent);\n };\n\n useEffect(() => {\n checkboxNodes.current = nodeArray('input') || [];\n }, []);\n\n useEffect(() => {\n if (defaultValue) {\n checkboxNodes.current.forEach((checkbox) => {\n if (defaultValue.includes(checkbox.value)) {\n checkbox.checked = true;\n setCheckboxesState(checkbox);\n }\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [defaultValue]);\n\n return (\n <div>\n {title && <span className={styles['checkbox-tree__header']}>{title}</span>}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\n <div onClick={handleChange} data-ul role=\"tree\" tabIndex={0}>\n {checkboxTree.map(({ itemName, children }) => (\n <div\n key={itemName}\n className={styles['checkbox-tree__branch']}\n data-li\n aria-expanded={lessThan.md ? 'false' : 'true'}\n >\n <FormField inline className={styles['checkbox-tree__branch--formfield']}>\n <Button variant=\"blank\" onClick={handleExpanded}>\n <Icon\n name=\"CheveronRight\"\n size={16}\n className={clsx(styles['checkbox-tree__branch--icon'], {\n [styles['checkbox-tree__branch--icon--expanded']]: !lessThan.md,\n })}\n />\n </Button>\n <Checkbox id={itemName} disabled={children.every((checkbox) => checkbox.disabled)} />\n <Label htmlFor={itemName}>{itemName}</Label>\n </FormField>\n <div\n className={clsx(styles['checkbox-tree__leaves'], {\n [styles['checkbox-tree__leaves--expanded']]: !lessThan.md,\n })}\n data-ul\n >\n {children.map(({ itemName, itemValue, disabled }) => (\n <div key={itemName} className={styles['checkbox-tree__leaf']} data-li>\n <FormField inline className={styles['checkbox-tree__branch--formfield']}>\n <Checkbox id={itemName} name={itemName} value={itemValue} disabled={disabled} />\n <Label htmlFor={itemName}>{itemName}</Label>\n </FormField>\n </div>\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n"],"names":["CheckboxTree","title","checkboxTree","defaultValue","onChange","checkboxNodes","useRef","lessThan","useResponsive","nodeArray","selector","parent","setValue","values","checkbox","setCheckboxesState","check","_b","_a","checkStatus","_c","status","every","some","setExpandedAttributes","trigger","container","children","styles","handleChange","event","parentCheckbox","child","handleExpanded","target","useEffect","itemName","jsxs","FormField","jsx","Button","Icon","clsx","Checkbox","Label","itemValue","disabled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BaA,KAAe,CAAC,EAAE,OAAAC,GAAO,cAAAC,GAAc,cAAAC,GAAc,UAAAC,QAAkC;AAC5F,QAAAC,IAAgBC,EAA2B,CAAA,CAAE,GAC7C,EAAE,UAAAC,MAAaC,KAEfC,IAAY,CAACC,GAAkBC,IAAS,aAAa,CAAA,EAAG,MAAM,KAAKA,EAAO,iBAAiBD,CAAQ,CAAC,GAEpGE,IAAW,MAAM;AACrB,UAAMC,IAASR,EAAc,QAAQ,OAAO,CAACQ,GAAQC,OAC/CA,EAAS,QAAQA,EAAS,WAC5BD,EAAO,KAAKC,EAAS,KAAK,GAErBD,IACN,CAAc,CAAA;AAEb,IAAAT,OAAmBS,CAAM;AAAA,EAAA,GAGzBE,IAAqB,CAACC,MAA4B;;AACtD,WAAOA,KAAO;AACZ,YAAML,KAASM,KAAAC,IAAAF,EAAM,QAAQ,WAAW,MAAzB,gBAAAE,EAA4B,eAA5B,gBAAAD,EAAwC,cAAc,UAM/DE,IAL+BV;AAAA,QACnC;AAAA,SACAW,IAAAT,KAAA,gBAAAA,EAAQ,QAAQ,iBAAhB,gBAAAS,EAA8B,cAAc;AAAA,MAAW,EAG5B,OAAO,CAACC,GAAQL,OACtCA,EAAM,YAAiBK,EAAA,KAAKL,EAAM,OAAO,GACvCK,IACN,CAAe,CAAA,GAEZC,IAAQH,EAAY,MAAM,OAAO,GAC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QAAQ,EAAG,CAAA;AAAA,YAClF,gBAAAyB,EAAAK,GAAA,EAAM,SAASR,GAAW,UAASA,GAAA;AAAA,UAAA,GACtC;AAAA,UACA,gBAAAG;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWG,EAAKd,EAAO,uBAAuB,GAAG;AAAA,gBAC/C,CAACA,EAAO,iCAAiC,CAAC,GAAG,CAACrB,EAAS;AAAA,cAAA,CACxD;AAAA,cACD,WAAO;AAAA,cAEN,UAAAoB,EAAS,IAAI,CAAC,EAAE,UAAAS,GAAU,WAAAS,GAAW,UAAAC,EACpC,MAAA,gBAAAP,EAAC,OAAmB,EAAA,WAAWX,EAAO,qBAAqB,GAAG,WAAO,IACnE,UAAC,gBAAAS,EAAAC,GAAA,EAAU,QAAM,IAAC,WAAWV,EAAO,kCAAkC,GACpE,UAAA;AAAA,gBAAA,gBAAAW,EAACI,KAAS,IAAIP,GAAU,MAAMA,GAAU,OAAOS,GAAW,UAAAC,GAAoB;AAAA,gBAC7E,gBAAAP,EAAAK,GAAA,EAAM,SAASR,GAAW,UAAAA,GAAS;AAAA,cAAA,GACtC,EAAA,GAJQA,CAKV,CACD;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MAAA;AAAA,MAhCKA;AAAA,IAkCR,CAAA,GACH;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"CheckboxTree.js","sources":["../../../src/components/CheckboxTree/CheckboxTree.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport type { MouseEventHandler } from 'react';\n\nimport styles from './CheckboxTree.module.css';\n\nimport { Button, Checkbox, FormField, Icon, Label } from 'components';\nimport { useResponsive } from 'components/hooks/useResponsive';\n\n// TODO: Currently the checkbox tree shows odd behavior when a disabled checkbox is checked. When deselecting the parent checkbox, the disabled checkbox is deselected, and will never be checked again. We'll leave this for now, until we run into a real world example where this is necessary.\n\ntype CheckboxLeaf = {\n itemName: string;\n itemValue: string;\n disabled?: boolean;\n};\n\ntype CheckboxBranch = {\n itemName: string;\n children: CheckboxLeaf[];\n};\n\nexport interface CheckboxTreeProps {\n /** The title of the component. */\n title?: string;\n /** Array of checkbox groups with a label and array of children (itemName, itemValue and disabled boolean). */\n checkboxTree: CheckboxBranch[];\n /** Array of selected values. */\n defaultValue?: string[];\n /** Returns array of selected values. */\n onChange?: (value: string[]) => void;\n}\n\n/** Represents a component to render a tree of checkboxes. */\nexport const CheckboxTree = ({ title, checkboxTree, defaultValue, onChange }: CheckboxTreeProps) => {\n const checkboxNodes = useRef<HTMLInputElement[]>([]);\n const { lessThan } = useResponsive();\n\n const nodeArray = (selector: string, parent = document) => [].slice.call(parent.querySelectorAll(selector));\n\n const setValue = () => {\n const values = checkboxNodes.current.reduce((values, checkbox) => {\n if (checkbox.name && checkbox.checked) {\n values.push(checkbox.value);\n }\n return values;\n }, [] as string[]);\n\n if (onChange) onChange(values);\n };\n\n const setCheckboxesState = (check: HTMLInputElement) => {\n while (check) {\n const parent = check.closest('[data-ul]')?.parentNode?.querySelector('input');\n const siblings: HTMLInputElement[] = nodeArray(\n 'input',\n parent?.closest('[data-li]')?.querySelector('[data-ul]') as Document | undefined\n );\n\n const checkStatus = siblings.reduce((status, check) => {\n if (!check.disabled) status.push(check.checked);\n return status;\n }, [] as boolean[]);\n\n const every = checkStatus.every(Boolean);\n const some = checkStatus.some(Boolean);\n\n if (parent) {\n parent.checked = every;\n parent.indeterminate = !every && every !== some;\n }\n\n if (!parent || check === parent) {\n break;\n }\n\n check = parent;\n }\n };\n\n const setExpandedAttributes = (trigger: HTMLButtonElement, container: Element | null) => {\n const children = container?.querySelector('[data-ul]');\n\n (trigger.childNodes[0] as Element).classList.toggle(styles['checkbox-tree__branch--icon--expanded']);\n container\n ?.closest('[data-li]')\n ?.setAttribute(\n 'aria-expanded',\n container?.closest('[data-li]')?.getAttribute('aria-expanded') === 'false' ? 'true' : 'false'\n );\n\n if (children) {\n children.classList.toggle(styles['checkbox-tree__leaves--expanded']);\n }\n };\n\n const handleChange: MouseEventHandler<HTMLDivElement> = (event) => {\n const check = event.target as HTMLInputElement;\n\n if (!check || !check.parentNode || !check.parentNode.parentNode) return;\n const parentCheckbox = check.parentNode.parentNode as HTMLElement;\n\n if (\n lessThan.md &&\n check.previousElementSibling?.tagName === 'BUTTON' &&\n parentCheckbox.getAttribute('aria-expanded') === 'false'\n ) {\n event.preventDefault();\n setExpandedAttributes(parentCheckbox.querySelector('button') as HTMLButtonElement, parentCheckbox);\n return;\n }\n\n if (checkboxNodes.current.indexOf(check) === -1) return;\n\n const children: HTMLInputElement[] = (check.parentNode.parentNode as Document)\n ? nodeArray('input', check.parentNode.parentNode as Document)\n : [];\n\n children.forEach((child) => {\n return (child.checked = child.disabled ? false : check.checked);\n });\n\n setCheckboxesState(check);\n setValue();\n };\n\n const handleExpanded: MouseEventHandler<HTMLButtonElement> = (event) => {\n const target = event.target as HTMLButtonElement;\n const parent = target.closest('[data-li]');\n setExpandedAttributes(target, parent);\n };\n\n useEffect(() => {\n checkboxNodes.current = nodeArray('input') || [];\n }, []);\n\n useEffect(() => {\n if (defaultValue) {\n checkboxNodes.current.forEach((checkbox) => {\n if (defaultValue.includes(checkbox.value)) {\n checkbox.checked = true;\n setCheckboxesState(checkbox);\n }\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [defaultValue]);\n\n return (\n <div>\n {title && <span className={styles['checkbox-tree__header']}>{title}</span>}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\n <div onClick={handleChange} data-ul role=\"tree\" tabIndex={0}>\n {checkboxTree.map(({ itemName, children }) => (\n <div\n key={itemName}\n className={styles['checkbox-tree__branch']}\n data-li\n aria-expanded={lessThan.md ? 'false' : 'true'}\n >\n <FormField inline className={styles['checkbox-tree__branch--formfield']}>\n <Button variant=\"blank\" onClick={handleExpanded}>\n <Icon\n name=\"CheveronRight\"\n size={16}\n className={clsx(styles['checkbox-tree__branch--icon'], {\n [styles['checkbox-tree__branch--icon--expanded']]: !lessThan.md,\n })}\n />\n </Button>\n <Checkbox id={itemName} disabled={children.every((checkbox) => checkbox.disabled)} />\n <Label htmlFor={itemName}>{itemName}</Label>\n </FormField>\n <div\n className={clsx(styles['checkbox-tree__leaves'], {\n [styles['checkbox-tree__leaves--expanded']]: !lessThan.md,\n })}\n data-ul\n >\n {children.map(({ itemName, itemValue, disabled }) => (\n <div key={itemName} className={styles['checkbox-tree__leaf']} data-li>\n <FormField inline className={styles['checkbox-tree__branch--formfield']}>\n <Checkbox id={itemName} name={itemName} value={itemValue} disabled={disabled} />\n <Label htmlFor={itemName}>{itemName}</Label>\n </FormField>\n </div>\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n"],"names":["CheckboxTree","title","checkboxTree","defaultValue","onChange","checkboxNodes","useRef","lessThan","useResponsive","nodeArray","selector","parent","setValue","values","checkbox","setCheckboxesState","check","_b","_a","checkStatus","_c","status","every","some","setExpandedAttributes","trigger","container","children","styles","handleChange","event","parentCheckbox","child","handleExpanded","target","useEffect","itemName","jsxs","FormField","jsx","Button","Icon","clsx","Checkbox","Label","itemValue","disabled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCaA,KAAe,CAAC,EAAE,OAAAC,GAAO,cAAAC,GAAc,cAAAC,GAAc,UAAAC,QAAkC;AAC5F,QAAAC,IAAgBC,EAA2B,CAAA,CAAE,GAC7C,EAAE,UAAAC,MAAaC,KAEfC,IAAY,CAACC,GAAkBC,IAAS,aAAa,CAAA,EAAG,MAAM,KAAKA,EAAO,iBAAiBD,CAAQ,CAAC,GAEpGE,IAAW,MAAM;AACrB,UAAMC,IAASR,EAAc,QAAQ,OAAO,CAACQ,GAAQC,OAC/CA,EAAS,QAAQA,EAAS,WAC5BD,EAAO,KAAKC,EAAS,KAAK,GAErBD,IACN,CAAc,CAAA;AAEb,IAAAT,OAAmBS,CAAM;AAAA,EAAA,GAGzBE,IAAqB,CAACC,MAA4B;;AACt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args = {
64
64
  title: "Periode",
65
65
  checkboxTree: i,
66
66
  // eslint-disable-next-line @typescript-eslint/no-magic-numbers
67
- defaultValue: ["3", "5"],
67
+ defaultValue: ["3", "4"],
68
68
  onChange: m()
69
69
  };
70
70
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxTree.stories.js","sources":["../../../src/components/CheckboxTree/CheckboxTree.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { CheckboxTreeProps } from './CheckboxTree';\n\nimport { CheckboxTree } from './CheckboxTree';\n\nconst MOCK_CHECKBOX_TREE = [\n {\n itemName: 'Semester 1',\n children: [\n {\n itemName: '1.1',\n itemValue: '1',\n disabled: true,\n },\n {\n itemName: '1.2',\n itemValue: '2',\n disabled: false,\n },\n {\n itemName: '1.3',\n itemValue: '3',\n disabled: false,\n },\n ],\n },\n {\n itemName: 'Semester 2',\n children: [\n {\n itemName: '2.1',\n itemValue: '4',\n disabled: false,\n },\n {\n itemName: '2.2',\n itemValue: '5',\n disabled: true,\n },\n {\n itemName: '2.3',\n itemValue: '6',\n disabled: false,\n },\n ],\n },\n {\n itemName: 'Semester 3',\n children: [\n {\n itemName: '3',\n itemValue: '7',\n disabled: false,\n },\n ],\n },\n];\n\nconst codeString = '<CheckboxTree title={} checkboxTree={} defaultValue={} onChange={} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Organisms/CheckboxTree',\n component: CheckboxTree,\n parameters: {\n inspectComponent: CheckboxTree,\n codeString: codeString,\n },\n} as Meta<CheckboxTreeProps>;\n\nconst Template: StoryFn<CheckboxTreeProps> = (args) => <CheckboxTree {...args} />;\n\nexport const CheckboxTreeExample = Template.bind({});\nCheckboxTreeExample.args = {\n title: 'Periode',\n checkboxTree: MOCK_CHECKBOX_TREE,\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n defaultValue: ['3', '5'],\n onChange: fn(),\n};\n"],"names":["MOCK_CHECKBOX_TREE","codeString","CheckboxTree_stories","CheckboxTree","Template","args","jsx","CheckboxTreeExample","fn"],"mappings":";;;AAOA,MAAMA,IAAqB;AAAA,EACzB;AAAA,IACE,UAAU;AAAA,IACV,UAAU;AAAA,MACR;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,UAAU;AAAA,MACR;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,UAAU;AAAA,MACR;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AACF,GAEMC,IAAa,0EAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAuC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAc,GAAGE,EAAM,CAAA,GAElEE,IAAsBH,EAAS,KAAK,EAAE;AACnDG,EAAoB,OAAO;AAAA,EACzB,OAAO;AAAA,EACP,cAAcP;AAAA;AAAA,EAEd,cAAc,CAAC,KAAK,GAAG;AAAA,EACvB,UAAUQ,EAAG;AACf;"}
1
+ {"version":3,"file":"CheckboxTree.stories.js","sources":["../../../src/components/CheckboxTree/CheckboxTree.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { CheckboxTreeProps } from './CheckboxTree';\n\nimport { CheckboxTree } from './CheckboxTree';\n\nconst MOCK_CHECKBOX_TREE = [\n {\n itemName: 'Semester 1',\n children: [\n {\n itemName: '1.1',\n itemValue: '1',\n disabled: true,\n },\n {\n itemName: '1.2',\n itemValue: '2',\n disabled: false,\n },\n {\n itemName: '1.3',\n itemValue: '3',\n disabled: false,\n },\n ],\n },\n {\n itemName: 'Semester 2',\n children: [\n {\n itemName: '2.1',\n itemValue: '4',\n disabled: false,\n },\n {\n itemName: '2.2',\n itemValue: '5',\n disabled: true,\n },\n {\n itemName: '2.3',\n itemValue: '6',\n disabled: false,\n },\n ],\n },\n {\n itemName: 'Semester 3',\n children: [\n {\n itemName: '3',\n itemValue: '7',\n disabled: false,\n },\n ],\n },\n];\n\nconst codeString = '<CheckboxTree title={} checkboxTree={} defaultValue={} onChange={} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Organisms/CheckboxTree',\n component: CheckboxTree,\n parameters: {\n inspectComponent: CheckboxTree,\n codeString: codeString,\n },\n} as Meta<CheckboxTreeProps>;\n\nconst Template: StoryFn<CheckboxTreeProps> = (args) => <CheckboxTree {...args} />;\n\nexport const CheckboxTreeExample = Template.bind({});\nCheckboxTreeExample.args = {\n title: 'Periode',\n checkboxTree: MOCK_CHECKBOX_TREE,\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n defaultValue: ['3', '4'],\n onChange: fn(),\n};\n"],"names":["MOCK_CHECKBOX_TREE","codeString","CheckboxTree_stories","CheckboxTree","Template","args","jsx","CheckboxTreeExample","fn"],"mappings":";;;AAOA,MAAMA,IAAqB;AAAA,EACzB;AAAA,IACE,UAAU;AAAA,IACV,UAAU;AAAA,MACR;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,UAAU;AAAA,MACR;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,UAAU;AAAA,MACR;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,QACX,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AACF,GAEMC,IAAa,0EAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAuC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAc,GAAGE,EAAM,CAAA,GAElEE,IAAsBH,EAAS,KAAK,EAAE;AACnDG,EAAoB,OAAO;AAAA,EACzB,OAAO;AAAA,EACP,cAAcP;AAAA;AAAA,EAEd,cAAc,CAAC,KAAK,GAAG;AAAA,EACvB,UAAUQ,EAAG;AACf;"}
@@ -1,9 +1,15 @@
1
1
  import { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
2
2
  export interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'style' | 'className'> {
3
+ /** The buttons to render in the drawer. */
3
4
  buttons?: ReactNode;
5
+ /** true if the drawer should be open; otherwise, false. The default is false. */
4
6
  isOpen?: boolean;
7
+ /** The callback method that is invoked when the drawer is closed. */
5
8
  onClose: () => void;
9
+ /** The title of the drawer. */
6
10
  title: string;
11
+ /** The aria-label of the close button. */
7
12
  closeButtonAriaValueText?: string;
8
13
  }
14
+ /** Represents a Drawer component. */
9
15
  export declare function Drawer({ buttons, children, isOpen, onClose, title, closeButtonAriaValueText, ...restProps }: PropsWithChildren<DrawerProps>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","sources":["../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import { useDialog } from '@react-aria/dialog';\nimport { FocusScope } from '@react-aria/focus';\nimport { OverlayContainer, useModal, useOverlay, usePreventScroll } from '@react-aria/overlays';\nimport { clsx } from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport type { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';\n\nimport styles from './Drawer.module.css';\n\nimport { Backdrop } from 'components/Backdrop/Backdrop';\nimport { OverlayCloseButton } from 'components/OverlayCloseButton';\n\nexport interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'style' | 'className'> {\n buttons?: ReactNode;\n isOpen?: boolean;\n onClose: () => void;\n title: string;\n closeButtonAriaValueText?: string;\n}\n\nconst closingDelay = 200;\n\nexport function Drawer({\n buttons,\n children,\n isOpen,\n onClose,\n title,\n closeButtonAriaValueText = 'Close',\n ...restProps\n}: PropsWithChildren<DrawerProps>) {\n const [containerClassNames, setContainerClassNames] = useState(styles.drawer);\n // Hide content outside the modal from screen readers.\n const { modalProps } = useModal({ isDisabled: !isOpen });\n const contentRef = useRef<HTMLDivElement>(null);\n\n function onCloseDrawer() {\n setContainerClassNames(styles.drawer);\n\n globalThis.setTimeout(() => {\n onClose();\n }, closingDelay);\n }\n\n // Handle interacting outside the dialog and pressing\n // the Escape key to close the modal.\n const { overlayProps, underlayProps } = useOverlay(\n { isDismissable: true, isKeyboardDismissDisabled: false, isOpen, onClose: onCloseDrawer },\n contentRef\n );\n\n // Get props for the dialog and its title\n const { dialogProps, titleProps } = useDialog({}, contentRef);\n\n usePreventScroll({ isDisabled: !isOpen });\n\n useEffect(() => {\n // setting class name after render so that element can slide in after it is mounted and slide out\n // before it is unmounted\n setContainerClassNames(clsx(styles.drawer, { [styles['drawer--open']]: isOpen }));\n }, [isOpen]);\n\n return (\n <OverlayContainer>\n <Backdrop {...underlayProps}>\n <FocusScope contain restoreFocus>\n <aside\n {...modalProps}\n {...overlayProps}\n {...dialogProps}\n {...restProps}\n className={containerClassNames}\n ref={contentRef}\n >\n <header className={styles.drawer__header}>\n <h1 className={styles.drawer__heading} {...titleProps}>\n {title}\n </h1>\n\n <OverlayCloseButton aria-label={closeButtonAriaValueText} onClick={onCloseDrawer} />\n </header>\n\n <div className={styles.drawer__content}>{children}</div>\n\n {buttons && (\n <footer className={styles.drawer__footer}>\n <div className={styles.drawer__buttons}>{buttons}</div>\n </footer>\n )}\n </aside>\n </FocusScope>\n </Backdrop>\n </OverlayContainer>\n );\n}\n"],"names":["closingDelay","Drawer","buttons","children","isOpen","onClose","title","closeButtonAriaValueText","restProps","containerClassNames","setContainerClassNames","useState","styles","modalProps","useModal","contentRef","useRef","onCloseDrawer","overlayProps","underlayProps","useOverlay","dialogProps","titleProps","useDialog","usePreventScroll","useEffect","clsx","jsx","OverlayContainer","Backdrop","FocusScope","jsxs","OverlayCloseButton"],"mappings":";;;;;;;;;;;;;;;;GAqBMA,IAAe;AAEd,SAASC,EAAO;AAAA,EACrB,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,0BAAAC,IAA2B;AAAA,EAC3B,GAAGC;AACL,GAAmC;AACjC,QAAM,CAACC,GAAqBC,CAAsB,IAAIC,EAASC,EAAO,MAAM,GAEtE,EAAE,YAAAC,MAAeC,EAAS,EAAE,YAAY,CAACV,GAAQ,GACjDW,IAAaC,EAAuB,IAAI;AAE9C,WAASC,IAAgB;AACvB,IAAAP,EAAuBE,EAAO,MAAM,GAEpC,WAAW,WA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A,GACnD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAGN,GACF,EACF,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Drawer.js","sources":["../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import { useDialog } from '@react-aria/dialog';\nimport { FocusScope } from '@react-aria/focus';\nimport { OverlayContainer, useModal, useOverlay, usePreventScroll } from '@react-aria/overlays';\nimport { clsx } from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport type { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';\n\nimport styles from './Drawer.module.css';\n\nimport { Backdrop } from 'components/Backdrop/Backdrop';\nimport { OverlayCloseButton } from 'components/OverlayCloseButton';\n\nexport interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'style' | 'className'> {\n /** The buttons to render in the drawer. */\n buttons?: ReactNode;\n /** true if the drawer should be open; otherwise, false. The default is false. */\n isOpen?: boolean;\n /** The callback method that is invoked when the drawer is closed. */\n onClose: () => void;\n /** The title of the drawer. */\n title: string;\n /** The aria-label of the close button. */\n closeButtonAriaValueText?: string;\n}\n\nconst closingDelay = 200;\n\n/** Represents a Drawer component. */\nexport function Drawer({\n buttons,\n children,\n isOpen,\n onClose,\n title,\n closeButtonAriaValueText = 'Close',\n ...restProps\n}: PropsWithChildren<DrawerProps>) {\n const [containerClassNames, setContainerClassNames] = useState(styles.drawer);\n // Hide content outside the modal from screen readers.\n const { modalProps } = useModal({ isDisabled: !isOpen });\n const contentRef = useRef<HTMLDivElement>(null);\n\n function onCloseDrawer() {\n setContainerClassNames(styles.drawer);\n\n globalThis.setTimeout(() => {\n onClose();\n }, closingDelay);\n }\n\n // Handle interacting outside the dialog and pressing\n // the Escape key to close the modal.\n const { overlayProps, underlayProps } = useOverlay(\n { isDismissable: true, isKeyboardDismissDisabled: false, isOpen, onClose: onCloseDrawer },\n contentRef\n );\n\n // Get props for the dialog and its title\n const { dialogProps, titleProps } = useDialog({}, contentRef);\n\n usePreventScroll({ isDisabled: !isOpen });\n\n useEffect(() => {\n // setting class name after render so that element can slide in after it is mounted and slide out\n // before it is unmounted\n setContainerClassNames(clsx(styles.drawer, { [styles['drawer--open']]: isOpen }));\n }, [isOpen]);\n\n return (\n <OverlayContainer>\n <Backdrop {...underlayProps}>\n <FocusScope contain restoreFocus>\n <aside\n {...modalProps}\n {...overlayProps}\n {...dialogProps}\n {...restProps}\n className={containerClassNames}\n ref={contentRef}\n >\n <header className={styles.drawer__header}>\n <h1 className={styles.drawer__heading} {...titleProps}>\n {title}\n </h1>\n\n <OverlayCloseButton aria-label={closeButtonAriaValueText} onClick={onCloseDrawer} />\n </header>\n\n <div className={styles.drawer__content}>{children}</div>\n\n {buttons && (\n <footer className={styles.drawer__footer}>\n <div className={styles.drawer__buttons}>{buttons}</div>\n </footer>\n )}\n </aside>\n </FocusScope>\n </Backdrop>\n </OverlayContainer>\n );\n}\n"],"names":["closingDelay","Drawer","buttons","children","isOpen","onClose","title","closeButtonAriaValueText","restProps","containerClassNames","setContainerClassNames","useState","styles","modalProps","useModal","contentRef","useRef","onCloseDrawer","overlayProps","underlayProps","useOverlay","dialogProps","titleProps","useDialog","usePreventScroll","useEffect","clsx","jsx","OverlayContainer","Backdrop","FocusScope","jsxs","OverlayCloseButton"],"mappings":";;;;;;;;;;;;;;;;GA0BMA,IAAe;AAGd,SAASC,EAAO;AAAA,EACrB,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,0BAAAC,IAA2B;AAAA,EAC3B,GAAGC;AACL,GAAmC;AACjC,QAAM,CAACC,GAAqBC,CAAsB,IAAIC,EAASC,EAAO,MAAM,GAEtE,EAAE,YAAAC,MAAeC,EAAS,EAAE,YAAY,CAACV,GAAQ,GACjDW,IAAaC,EAAuB,IAAI;AAE9C,WAASC,IAAgB;AACvB,IAAAP,EAAuBE,EAAO,MAAM,GAEpC,WAAW,WAAW,MAAM;AAClB,MAAAP;OACPL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AAA;AAAA,EAAA,GAGN,GACF,EACF,CAAA;AAEJ;"}
@@ -1,15 +1,15 @@
1
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
2
  import { OverlayProvider as p } from "@react-aria/overlays";
3
3
  import { fn as m } from "../../index-MQ0yPLdl.js";
4
- import { useState as u } from "react";
5
- import { Drawer as a } from "./Drawer.js";
6
- import { Button as r } from "../Button/Button.js";
7
- import { ButtonGroup as c } from "../ButtonGroup/ButtonGroup.js";
4
+ import { useState as c } from "react";
5
+ import { Drawer as r } from "./Drawer.js";
6
+ import { Button as n } from "../Button/Button.js";
7
+ import { ButtonGroup as u } from "../ButtonGroup/ButtonGroup.js";
8
8
  const d = `
9
9
  <Drawer isOpen={isOpen} onClose={onCloseFunction} title={title} buttons={buttons}> {children} </Drawer>
10
- `, C = {
10
+ `, O = {
11
11
  title: "Molecules/Drawer",
12
- component: a,
12
+ component: r,
13
13
  argTypes: {
14
14
  isOpen: {
15
15
  table: {
@@ -28,14 +28,15 @@ const d = `
28
28
  }
29
29
  },
30
30
  parameters: {
31
+ inspectComponent: r,
31
32
  codeString: d
32
33
  }
33
34
  }, s = (l) => {
34
- const [e, o] = u(!1);
35
- return /* @__PURE__ */ n(p, { children: [
36
- /* @__PURE__ */ t(r, { onClick: () => o(!e), variant: "primary", children: "Open drawer" }),
35
+ const [e, o] = c(!1);
36
+ return /* @__PURE__ */ a(p, { children: [
37
+ /* @__PURE__ */ t(n, { onClick: () => o(!e), variant: "primary", children: "Open drawer" }),
37
38
  e && /* @__PURE__ */ t(
38
- a,
39
+ r,
39
40
  {
40
41
  ...l,
41
42
  isOpen: e,
@@ -54,14 +55,14 @@ b.args = {
54
55
  const f = s.bind({});
55
56
  f.args = {
56
57
  ...i,
57
- buttons: /* @__PURE__ */ n(c, { children: [
58
- /* @__PURE__ */ t(r, { variant: "primary", children: "Primary Example Button" }),
59
- /* @__PURE__ */ t(r, { variant: "secondary", children: "Secondary Example Button" })
58
+ buttons: /* @__PURE__ */ a(u, { children: [
59
+ /* @__PURE__ */ t(n, { variant: "primary", children: "Primary Example Button" }),
60
+ /* @__PURE__ */ t(n, { variant: "secondary", children: "Secondary Example Button" })
60
61
  ] })
61
62
  };
62
63
  export {
63
64
  b as DrawerExample,
64
65
  f as WithButtons,
65
- C as default
66
+ O as default
66
67
  };
67
68
  //# sourceMappingURL=Drawer.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.stories.js","sources":["../../../src/components/Drawer/Drawer.stories.tsx"],"sourcesContent":["import { OverlayProvider } from '@react-aria/overlays';\nimport { fn } from '@storybook/test';\nimport { useState } from 'react';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { DrawerProps } from './Drawer';\n\nimport { Drawer } from './Drawer';\n\nimport { Button } from 'components/Button';\nimport { ButtonGroup } from 'components/ButtonGroup';\n\nconst codeString = `\n <Drawer isOpen={isOpen} onClose={onCloseFunction} title={title} buttons={buttons}> {children} </Drawer>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Molecules/Drawer',\n component: Drawer,\n argTypes: {\n isOpen: {\n table: {\n disable: true,\n },\n },\n buttons: {\n table: {\n disable: true,\n },\n },\n closeButtonAriaValueText: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<DrawerProps>;\n\nconst Template: StoryFn<DrawerProps> = (args) => {\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <OverlayProvider>\n <Button onClick={() => setIsOpen(!isOpen)} variant=\"primary\">\n Open drawer\n </Button>\n {isOpen && (\n <Drawer\n {...args}\n isOpen={isOpen}\n onClose={() => {\n fn()();\n return setIsOpen(!isOpen);\n }}\n >\n Example Drawer Content\n </Drawer>\n )}\n </OverlayProvider>\n );\n};\n\nconst defaultArgs: Partial<DrawerProps> = {\n title: 'Example Title',\n closeButtonAriaValueText: 'Close',\n};\n\nexport const DrawerExample = Template.bind({});\nDrawerExample.args = {\n ...defaultArgs,\n};\n\nexport const WithButtons = Template.bind({});\nWithButtons.args = {\n ...defaultArgs,\n buttons: (\n <ButtonGroup>\n <Button variant=\"primary\">Primary Example Button</Button>\n <Button variant=\"secondary\">Secondary Example Button</Button>\n </ButtonGroup>\n ),\n};\n"],"names":["codeString","Drawer_stories","Drawer","Template","args","isOpen","setIsOpen","useState","OverlayProvider","jsx","Button","fn","defaultArgs","DrawerExample","WithButtons","ButtonGroup"],"mappings":";;;;;;;AAYA,MAAMA,IAAa;AAAA;AAAA,GAKJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,0BAA0B;AAAA,MACxB,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAiC,CAACC,MAAS;AAC/C,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK;AAE1C,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAO,SAAS,MAAMJ,EAAU,CAACD,CAAM,GAAG,SAAQ,WAAU,UAE7D,cAAA,CAAA;AAAA,IACCA,KACC,gBAAAI;AAAA,MAACP;AAAA,MAAA;AAAA,QACE,GAAGE;AAAA,QACJ,QAAAC;AAAA,QACA,SAAS,OACPM,EAAK,EAAA,GACEL,EAAU,CAACD,CAAM;AAAA,QAE3B,UAAA;AAAA,MAAA;AAAA,IAED;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEMO,IAAoC;AAAA,EACxC,OAAO;AAAA,EACP,0BAA0B;AAC5B,GAEaC,IAAgBV,EAAS,KAAK,EAAE;AAC7CU,EAAc,OAAO;AAAA,EACnB,GAAGD;AACL;AAEO,MAAME,IAAcX,EAAS,KAAK,EAAE;AAC3CW,EAAY,OAAO;AAAA,EACjB,GAAGF;AAAA,EACH,2BACGG,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAN,EAAAC,GAAA,EAAO,SAAQ,WAAU,UAAsB,0BAAA;AAAA,IAC/C,gBAAAD,EAAAC,GAAA,EAAO,SAAQ,aAAY,UAAwB,4BAAA;AAAA,EAAA,GACtD;AAEJ;"}
1
+ {"version":3,"file":"Drawer.stories.js","sources":["../../../src/components/Drawer/Drawer.stories.tsx"],"sourcesContent":["import { OverlayProvider } from '@react-aria/overlays';\nimport { fn } from '@storybook/test';\nimport { useState } from 'react';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { DrawerProps } from './Drawer';\n\nimport { Drawer } from './Drawer';\n\nimport { Button } from 'components/Button';\nimport { ButtonGroup } from 'components/ButtonGroup';\n\nconst codeString = `\n <Drawer isOpen={isOpen} onClose={onCloseFunction} title={title} buttons={buttons}> {children} </Drawer>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Molecules/Drawer',\n component: Drawer,\n argTypes: {\n isOpen: {\n table: {\n disable: true,\n },\n },\n buttons: {\n table: {\n disable: true,\n },\n },\n closeButtonAriaValueText: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: Drawer,\n codeString: codeString,\n },\n} as Meta<DrawerProps>;\n\nconst Template: StoryFn<DrawerProps> = (args) => {\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <OverlayProvider>\n <Button onClick={() => setIsOpen(!isOpen)} variant=\"primary\">\n Open drawer\n </Button>\n {isOpen && (\n <Drawer\n {...args}\n isOpen={isOpen}\n onClose={() => {\n fn()();\n return setIsOpen(!isOpen);\n }}\n >\n Example Drawer Content\n </Drawer>\n )}\n </OverlayProvider>\n );\n};\n\nconst defaultArgs: Partial<DrawerProps> = {\n title: 'Example Title',\n closeButtonAriaValueText: 'Close',\n};\n\nexport const DrawerExample = Template.bind({});\nDrawerExample.args = {\n ...defaultArgs,\n};\n\nexport const WithButtons = Template.bind({});\nWithButtons.args = {\n ...defaultArgs,\n buttons: (\n <ButtonGroup>\n <Button variant=\"primary\">Primary Example Button</Button>\n <Button variant=\"secondary\">Secondary Example Button</Button>\n </ButtonGroup>\n ),\n};\n"],"names":["codeString","Drawer_stories","Drawer","Template","args","isOpen","setIsOpen","useState","OverlayProvider","jsx","Button","fn","defaultArgs","DrawerExample","WithButtons","ButtonGroup"],"mappings":";;;;;;;AAYA,MAAMA,IAAa;AAAA;AAAA,GAKJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,0BAA0B;AAAA,MACxB,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAiC,CAACC,MAAS;AAC/C,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK;AAE1C,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAO,SAAS,MAAMJ,EAAU,CAACD,CAAM,GAAG,SAAQ,WAAU,UAE7D,cAAA,CAAA;AAAA,IACCA,KACC,gBAAAI;AAAA,MAACP;AAAA,MAAA;AAAA,QACE,GAAGE;AAAA,QACJ,QAAAC;AAAA,QACA,SAAS,OACPM,EAAK,EAAA,GACEL,EAAU,CAACD,CAAM;AAAA,QAE3B,UAAA;AAAA,MAAA;AAAA,IAED;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEMO,IAAoC;AAAA,EACxC,OAAO;AAAA,EACP,0BAA0B;AAC5B,GAEaC,IAAgBV,EAAS,KAAK,EAAE;AAC7CU,EAAc,OAAO;AAAA,EACnB,GAAGD;AACL;AAEO,MAAME,IAAcX,EAAS,KAAK,EAAE;AAC3CW,EAAY,OAAO;AAAA,EACjB,GAAGF;AAAA,EACH,2BACGG,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAN,EAAAC,GAAA,EAAO,SAAQ,WAAU,UAAsB,0BAAA;AAAA,IAC/C,gBAAAD,EAAAC,GAAA,EAAO,SAAQ,aAAY,UAAwB,4BAAA;AAAA,EAAA,GACtD;AAEJ;"}
@@ -1,5 +1,8 @@
1
1
  export interface EmptyStateDataDisplayProps {
2
+ /** The main text to display. */
2
3
  label: string;
4
+ /** The sub-text to display. */
3
5
  paragraph: string;
4
6
  }
7
+ /** Represents a component to indicate an empty state. */
5
8
  export declare function EmptyStateDataDisplay({ label, paragraph }: EmptyStateDataDisplayProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyStateDataDisplay.js","sources":["../../../src/components/EmptyStateDataDisplay/EmptyStateDataDisplay.tsx"],"sourcesContent":["import styles from './EmptyStateDataDisplay.module.css';\n\nimport { Icon } from 'components/Icon';\n\nexport interface EmptyStateDataDisplayProps {\n label: string;\n paragraph: string;\n}\n\nexport function EmptyStateDataDisplay({ label, paragraph }: EmptyStateDataDisplayProps) {\n return (\n <div className={styles['empty-state-data-display_wrapper']}>\n <div className={styles['empty-state-data-display_icon-frame']}>\n <Icon name=\"CubeTransparent\" />\n </div>\n <div className={styles['empty-state-data-display_text-content']}>\n <label className={styles['empty-state-data-display_label']}>{label}</label>\n <p className={styles['empty-state-data-display_paragraph']}>{paragraph}</p>\n </div>\n </div>\n );\n}\n"],"names":["EmptyStateDataDisplay","label","paragraph","jsxs","styles","jsx","Icon"],"mappings":";;;;;;;;;AASO,SAASA,EAAsB,EAAE,OAAAC,GAAO,WAAAC,KAAyC;AACtF,SACG,gBAAAC,EAAA,OAAA,EAAI,WAAWC,EAAO,kCAAkC,GACvD,UAAA;AAAA,IAAC,gBAAAC,EAAA,OAAA,EAAI,WAAWD,EAAO,qCAAqC,GAC1D,UAAC,gBAAAC,EAAAC,GAAA,EAAK,MAAK,kBAAA,CAAkB,EAC/B,CAAA;AAAA,IACC,gBAAAH,EAAA,OAAA,EAAI,WAAWC,EAAO,uCAAuC,GAC5D,UAAA;AAAA,MAAA,gBAAAC,EAAC,SAAM,EAAA,WAAWD,EAAO,gCAAgC,GAAI,UAAMH,GAAA;AAAA,wBAClE,KAAE,EAAA,WAAWG,EAAO,oCAAoC,GAAI,UAAUF,GAAA;AAAA,IAAA,GACzE;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"EmptyStateDataDisplay.js","sources":["../../../src/components/EmptyStateDataDisplay/EmptyStateDataDisplay.tsx"],"sourcesContent":["import styles from './EmptyStateDataDisplay.module.css';\n\nimport { Icon } from 'components/Icon';\n\nexport interface EmptyStateDataDisplayProps {\n /** The main text to display. */\n label: string;\n /** The sub-text to display. */\n paragraph: string;\n}\n\n/** Represents a component to indicate an empty state. */\nexport function EmptyStateDataDisplay({ label, paragraph }: EmptyStateDataDisplayProps) {\n return (\n <div className={styles['empty-state-data-display_wrapper']}>\n <div className={styles['empty-state-data-display_icon-frame']}>\n <Icon name=\"CubeTransparent\" />\n </div>\n <div className={styles['empty-state-data-display_text-content']}>\n <label className={styles['empty-state-data-display_label']}>{label}</label>\n <p className={styles['empty-state-data-display_paragraph']}>{paragraph}</p>\n </div>\n </div>\n );\n}\n"],"names":["EmptyStateDataDisplay","label","paragraph","jsxs","styles","jsx","Icon"],"mappings":";;;;;;;;;AAYO,SAASA,EAAsB,EAAE,OAAAC,GAAO,WAAAC,KAAyC;AACtF,SACG,gBAAAC,EAAA,OAAA,EAAI,WAAWC,EAAO,kCAAkC,GACvD,UAAA;AAAA,IAAC,gBAAAC,EAAA,OAAA,EAAI,WAAWD,EAAO,qCAAqC,GAC1D,UAAC,gBAAAC,EAAAC,GAAA,EAAK,MAAK,kBAAA,CAAkB,EAC/B,CAAA;AAAA,IACC,gBAAAH,EAAA,OAAA,EAAI,WAAWC,EAAO,uCAAuC,GAC5D,UAAA;AAAA,MAAA,gBAAAC,EAAC,SAAM,EAAA,WAAWD,EAAO,gCAAgC,GAAI,UAAMH,GAAA;AAAA,wBAClE,KAAE,EAAA,WAAWG,EAAO,oCAAoC,GAAI,UAAUF,GAAA;AAAA,IAAA,GACzE;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -1,9 +1,10 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
2
  import { EmptyStateDataDisplay as a } from "./EmptyStateDataDisplay.js";
3
- const e = "<EmptyStateDataDisplay label={label} paragraph={paragraph} />", m = {
3
+ const e = "<EmptyStateDataDisplay label={label} paragraph={paragraph} />", o = {
4
4
  title: "Molecules/EmptyStateDataDisplay",
5
5
  component: a,
6
6
  parameters: {
7
+ inspectComponent: a,
7
8
  codeString: e
8
9
  }
9
10
  }, s = (t) => /* @__PURE__ */ p(a, { ...t }), l = s.bind({});
@@ -13,6 +14,6 @@ l.args = {
13
14
  };
14
15
  export {
15
16
  l as EmptyStateDataDisplayExample,
16
- m as default
17
+ o as default
17
18
  };
18
19
  //# sourceMappingURL=EmptyStateDataDisplay.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyStateDataDisplay.stories.js","sources":["../../../src/components/EmptyStateDataDisplay/EmptyStateDataDisplay.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { EmptyStateDataDisplayProps } from './EmptyStateDataDisplay';\n\nimport { EmptyStateDataDisplay } from './EmptyStateDataDisplay';\n\nconst codeString = '<EmptyStateDataDisplay label={label} paragraph={paragraph} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Molecules/EmptyStateDataDisplay',\n component: EmptyStateDataDisplay,\n parameters: {\n codeString: codeString,\n },\n} as Meta<EmptyStateDataDisplayProps>;\n\nconst Template: StoryFn<EmptyStateDataDisplayProps> = (args) => <EmptyStateDataDisplay {...args} />;\n\nexport const EmptyStateDataDisplayExample = Template.bind({});\nEmptyStateDataDisplayExample.args = {\n label: 'This is an example info empty state data display label',\n paragraph: 'This is an example info empty state data display paragraph',\n};\n"],"names":["codeString","EmptyStateDataDisplay_stories","EmptyStateDataDisplay","Template","args","jsx","EmptyStateDataDisplayExample"],"mappings":";;AAKA,MAAMA,IAAa,iEAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAgD,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAuB,GAAGE,EAAM,CAAA,GAEpFE,IAA+BH,EAAS,KAAK,EAAE;AAC5DG,EAA6B,OAAO;AAAA,EAClC,OAAO;AAAA,EACP,WAAW;AACb;"}
1
+ {"version":3,"file":"EmptyStateDataDisplay.stories.js","sources":["../../../src/components/EmptyStateDataDisplay/EmptyStateDataDisplay.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { EmptyStateDataDisplayProps } from './EmptyStateDataDisplay';\n\nimport { EmptyStateDataDisplay } from './EmptyStateDataDisplay';\n\nconst codeString = '<EmptyStateDataDisplay label={label} paragraph={paragraph} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Molecules/EmptyStateDataDisplay',\n component: EmptyStateDataDisplay,\n parameters: {\n inspectComponent: EmptyStateDataDisplay,\n codeString: codeString,\n },\n} as Meta<EmptyStateDataDisplayProps>;\n\nconst Template: StoryFn<EmptyStateDataDisplayProps> = (args) => <EmptyStateDataDisplay {...args} />;\n\nexport const EmptyStateDataDisplayExample = Template.bind({});\nEmptyStateDataDisplayExample.args = {\n label: 'This is an example info empty state data display label',\n paragraph: 'This is an example info empty state data display paragraph',\n};\n"],"names":["codeString","EmptyStateDataDisplay_stories","EmptyStateDataDisplay","Template","args","jsx","EmptyStateDataDisplayExample"],"mappings":";;AAKA,MAAMA,IAAa,iEAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAgD,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAuB,GAAGE,EAAM,CAAA,GAEpFE,IAA+BH,EAAS,KAAK,EAAE;AAC5DG,EAA6B,OAAO;AAAA,EAClC,OAAO;AAAA,EACP,WAAW;AACb;"}
@@ -1,8 +1,12 @@
1
1
  type FeedbackLevel = 'success' | 'warning' | 'error';
2
2
  export interface FeedbackBoxProps {
3
+ /** The id of the element. */
3
4
  id?: string;
5
+ /** The feedback level, indicates what icon is used. */
4
6
  level: FeedbackLevel;
7
+ /** The feedback value. */
5
8
  feedback: string;
6
9
  }
10
+ /** Represents a component to show feedback. */
7
11
  export declare const FeedbackBox: ({ id, level, feedback }: FeedbackBoxProps) => import("react/jsx-runtime").JSX.Element;
8
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackBox.js","sources":["../../../src/components/FeedbackBox/FeedbackBox.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { IconProps } from 'components/Icon';\n\nimport styles from './FeedbackBox.module.css';\n\nimport { Icon } from 'components/Icon';\n\ntype FeedbackLevel = 'success' | 'warning' | 'error';\n\nconst LEVEL_ICON_MAP: Record<FeedbackLevel, IconProps['name']> = {\n success: 'CheckCircle',\n warning: 'ExclamationTriangleMini',\n error: 'ExclamationCircle',\n};\n\nexport interface FeedbackBoxProps {\n id?: string;\n level: FeedbackLevel;\n feedback: string;\n}\n\nexport const FeedbackBox = ({ id, level, feedback }: FeedbackBoxProps) => (\n <div\n className={clsx(styles['feedback-box'], {\n [styles['feedback-box__success']]: level === 'success',\n [styles['feedback-box__warning']]: level === 'warning',\n [styles['feedback-box__error']]: level === 'error',\n })}\n id={id}\n >\n <Icon name={LEVEL_ICON_MAP[level]} size={16} />\n {feedback}\n </div>\n);\n"],"names":["LEVEL_ICON_MAP","FeedbackBox","id","level","feedback","jsxs","clsx","styles","jsx","Icon"],"mappings":";;;;;;;;GAUMA,IAA2D;AAAA,EAC/D,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAQaC,IAAc,CAAC,EAAE,IAAAC,GAAI,OAAAC,GAAO,UAAAC,EACvC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAKC,EAAO,cAAc,GAAG;AAAA,MACtC,CAACA,EAAO,uBAAuB,CAAC,GAAGJ,MAAU;AAAA,MAC7C,CAACI,EAAO,uBAAuB,CAAC,GAAGJ,MAAU;AAAA,MAC7C,CAACI,EAAO,qBAAqB,CAAC,GAAGJ,MAAU;AAAA,IAAA,CAC5C;AAAA,IACD,IAAAD;AAAA,IAEA,UAAA;AAAA,MAAA,gBAAAM,EAACC,KAAK,MAAMT,EAAeG,CAAK,GAAG,MAAM,IAAI;AAAA,MAC5CC;AAAA,IAAA;AAAA,EAAA;AACH;"}
1
+ {"version":3,"file":"FeedbackBox.js","sources":["../../../src/components/FeedbackBox/FeedbackBox.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { IconProps } from 'components/Icon';\n\nimport styles from './FeedbackBox.module.css';\n\nimport { Icon } from 'components/Icon';\n\ntype FeedbackLevel = 'success' | 'warning' | 'error';\n\nconst LEVEL_ICON_MAP: Record<FeedbackLevel, IconProps['name']> = {\n success: 'CheckCircle',\n warning: 'ExclamationTriangleMini',\n error: 'ExclamationCircle',\n};\n\nexport interface FeedbackBoxProps {\n /** The id of the element. */\n id?: string;\n /** The feedback level, indicates what icon is used. */\n level: FeedbackLevel;\n /** The feedback value. */\n feedback: string;\n}\n\n/** Represents a component to show feedback. */\nexport const FeedbackBox = ({ id, level, feedback }: FeedbackBoxProps) => (\n <div\n className={clsx(styles['feedback-box'], {\n [styles['feedback-box__success']]: level === 'success',\n [styles['feedback-box__warning']]: level === 'warning',\n [styles['feedback-box__error']]: level === 'error',\n })}\n id={id}\n >\n <Icon name={LEVEL_ICON_MAP[level]} size={16} />\n {feedback}\n </div>\n);\n"],"names":["LEVEL_ICON_MAP","FeedbackBox","id","level","feedback","jsxs","clsx","styles","jsx","Icon"],"mappings":";;;;;;;;GAUMA,IAA2D;AAAA,EAC/D,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAYaC,IAAc,CAAC,EAAE,IAAAC,GAAI,OAAAC,GAAO,UAAAC,EACvC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAKC,EAAO,cAAc,GAAG;AAAA,MACtC,CAACA,EAAO,uBAAuB,CAAC,GAAGJ,MAAU;AAAA,MAC7C,CAACI,EAAO,uBAAuB,CAAC,GAAGJ,MAAU;AAAA,MAC7C,CAACI,EAAO,qBAAqB,CAAC,GAAGJ,MAAU;AAAA,IAAA,CAC5C;AAAA,IACD,IAAAD;AAAA,IAEA,UAAA;AAAA,MAAA,gBAAAM,EAACC,KAAK,MAAMT,EAAeG,CAAK,GAAG,MAAM,IAAI;AAAA,MAC5CC;AAAA,IAAA;AAAA,EAAA;AACH;"}
@@ -1,20 +1,21 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { FeedbackBox as o } from "./FeedbackBox.js";
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { FeedbackBox as e } from "./FeedbackBox.js";
3
3
  import { Container as c } from "../../storyComponents/Container/Container.js";
4
- const t = "<FeedbackBox id={id} level={level} feedback={feedback} />", b = {
4
+ const a = "<FeedbackBox id={id} level={level} feedback={feedback} />", i = {
5
5
  title: "Molecules/FeedbackBox",
6
- component: o,
6
+ component: e,
7
7
  parameters: {
8
- codeString: t
8
+ inspectComponent: e,
9
+ codeString: a
9
10
  }
10
- }, d = (a) => /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(o, { ...a }) }), l = d.bind({});
11
- l.args = {
11
+ }, d = (t) => /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(e, { ...t }) }), s = d.bind({});
12
+ s.args = {
12
13
  id: "gba0d2d4",
13
14
  level: "success",
14
15
  feedback: "Example FeedbackBox text"
15
16
  };
16
17
  export {
17
- l as FeedbackBoxExample,
18
- b as default
18
+ s as FeedbackBoxExample,
19
+ i as default
19
20
  };
20
21
  //# sourceMappingURL=FeedbackBox.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackBox.stories.js","sources":["../../../src/components/FeedbackBox/FeedbackBox.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { FeedbackBoxProps } from './FeedbackBox';\n\nimport { FeedbackBox } from './FeedbackBox';\n\nimport { Container } from 'storyComponents/Container';\n\nconst codeString = '<FeedbackBox id={id} level={level} feedback={feedback} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Molecules/FeedbackBox',\n component: FeedbackBox,\n parameters: {\n codeString,\n },\n} as Meta<FeedbackBoxProps>;\n\nconst Template: StoryFn<FeedbackBoxProps> = (args) => (\n <Container>\n <FeedbackBox {...args} />\n </Container>\n);\n\nexport const FeedbackBoxExample = Template.bind({});\nFeedbackBoxExample.args = {\n id: 'gba0d2d4',\n level: 'success',\n feedback: 'Example FeedbackBox text',\n};\n"],"names":["codeString","FeedbackBox_stories","FeedbackBox","Template","args","jsx","Container","FeedbackBoxExample"],"mappings":";;;AAOA,MAAMA,IAAa,6DAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAsC,CAACC,MAC3C,gBAAAC,EAACC,KACC,UAAC,gBAAAD,EAAAH,GAAA,EAAa,GAAGE,EAAM,CAAA,EACzB,CAAA,GAGWG,IAAqBJ,EAAS,KAAK,EAAE;AAClDI,EAAmB,OAAO;AAAA,EACxB,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,UAAU;AACZ;"}
1
+ {"version":3,"file":"FeedbackBox.stories.js","sources":["../../../src/components/FeedbackBox/FeedbackBox.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { FeedbackBoxProps } from './FeedbackBox';\n\nimport { FeedbackBox } from './FeedbackBox';\n\nimport { Container } from 'storyComponents/Container';\n\nconst codeString = '<FeedbackBox id={id} level={level} feedback={feedback} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Molecules/FeedbackBox',\n component: FeedbackBox,\n parameters: {\n inspectComponent: FeedbackBox,\n codeString,\n },\n} as Meta<FeedbackBoxProps>;\n\nconst Template: StoryFn<FeedbackBoxProps> = (args) => (\n <Container>\n <FeedbackBox {...args} />\n </Container>\n);\n\nexport const FeedbackBoxExample = Template.bind({});\nFeedbackBoxExample.args = {\n id: 'gba0d2d4',\n level: 'success',\n feedback: 'Example FeedbackBox text',\n};\n"],"names":["codeString","FeedbackBox_stories","FeedbackBox","Template","args","jsx","Container","FeedbackBoxExample"],"mappings":";;;AAOA,MAAMA,IAAa,6DAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAsC,CAACC,MAC3C,gBAAAC,EAACC,KACC,UAAC,gBAAAD,EAAAH,GAAA,EAAa,GAAGE,EAAM,CAAA,EACzB,CAAA,GAGWG,IAAqBJ,EAAS,KAAK,EAAE;AAClDI,EAAmB,OAAO;AAAA,EACxB,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,UAAU;AACZ;"}
@@ -1,6 +1,10 @@
1
1
  export interface FieldHintProps {
2
+ /** The value to display. */
2
3
  value?: string;
4
+ /** The aria-valuetext value of the spinner component. */
3
5
  spinnerAriaValueText: string;
6
+ /** true if the field hint is loading; otherwise, false. The default is false. */
4
7
  loading?: boolean;
5
8
  }
9
+ /** Represents a component to show a hint for an input element. */
6
10
  export declare function FieldHint({ value, spinnerAriaValueText, loading }: FieldHintProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"FieldHint.js","sources":["../../../src/components/FieldHint/FieldHint.tsx"],"sourcesContent":["import styles from './FieldHint.module.css';\n\nimport { Spinner } from 'components/Spinner/Spinner';\n\nexport interface FieldHintProps {\n value?: string;\n spinnerAriaValueText: string;\n loading?: boolean;\n}\n\nexport function FieldHint({ value, spinnerAriaValueText, loading }: FieldHintProps) {\n return (\n <span className={styles['field-hint']}>\n {value && <>{value}</>}\n {!value && loading && <Spinner ariaValueText={spinnerAriaValueText} />}\n </span>\n );\n}\n"],"names":["FieldHint","value","spinnerAriaValueText","loading","jsxs","styles","jsx","Spinner"],"mappings":";;;;;AAUO,SAASA,EAAU,EAAE,OAAAC,GAAO,sBAAAC,GAAsB,SAAAC,KAA2B;AAClF,SACG,gBAAAC,EAAA,QAAA,EAAK,WAAWC,EAAO,YAAY,GACjC,UAAA;AAAA,IAAAJ,4BAAY,UAAMA,EAAA,CAAA;AAAA,IAClB,CAACA,KAASE,KAAY,gBAAAG,EAAAC,GAAA,EAAQ,eAAeL,GAAsB;AAAA,EACtE,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"FieldHint.js","sources":["../../../src/components/FieldHint/FieldHint.tsx"],"sourcesContent":["import styles from './FieldHint.module.css';\n\nimport { Spinner } from 'components/Spinner/Spinner';\n\nexport interface FieldHintProps {\n /** The value to display. */\n value?: string;\n /** The aria-valuetext value of the spinner component. */\n spinnerAriaValueText: string;\n /** true if the field hint is loading; otherwise, false. The default is false. */\n loading?: boolean;\n}\n\n/** Represents a component to show a hint for an input element. */\nexport function FieldHint({ value, spinnerAriaValueText, loading }: FieldHintProps) {\n return (\n <span className={styles['field-hint']}>\n {value && <>{value}</>}\n {!value && loading && <Spinner ariaValueText={spinnerAriaValueText} />}\n </span>\n );\n}\n"],"names":["FieldHint","value","spinnerAriaValueText","loading","jsxs","styles","jsx","Spinner"],"mappings":";;;;;AAcO,SAASA,EAAU,EAAE,OAAAC,GAAO,sBAAAC,GAAsB,SAAAC,KAA2B;AAClF,SACG,gBAAAC,EAAA,QAAA,EAAK,WAAWC,EAAO,YAAY,GACjC,UAAA;AAAA,IAAAJ,4BAAY,UAAMA,EAAA,CAAA;AAAA,IAClB,CAACA,KAASE,KAAY,gBAAAG,EAAAC,GAAA,EAAQ,eAAeL,GAAsB;AAAA,EACtE,EAAA,CAAA;AAEJ;"}
@@ -12,6 +12,7 @@ const l = "<FieldHint value={value} loading={loading} spinnerAriaValueText={spin
12
12
  }
13
13
  },
14
14
  parameters: {
15
+ inspectComponent: e,
15
16
  codeString: l
16
17
  }
17
18
  }, i = (n) => /* @__PURE__ */ a(e, { ...n }), t = {
@@ -1 +1 @@
1
- {"version":3,"file":"FieldHint.stories.js","sources":["../../../src/components/FieldHint/FieldHint.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { FieldHintProps } from './FieldHint';\n\nimport { FieldHint } from './FieldHint';\n\nconst codeString = '<FieldHint value={value} loading={loading} spinnerAriaValueText={spinnerAriaValueText} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/FieldHint',\n component: FieldHint,\n argTypes: {\n value: {\n control: 'text',\n },\n spinnerAriaValueText: {\n control: 'text',\n },\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<FieldHintProps>;\n\nconst Template: StoryFn<FieldHintProps> = (args) => <FieldHint {...args} />;\n\nconst defaultArgs: Partial<FieldHintProps> = {\n spinnerAriaValueText: 'FieldHint Loading',\n};\n\nexport const FieldHintExample = Template.bind({});\nFieldHintExample.args = {\n value: 'This is a FieldHint',\n loading: false,\n ...defaultArgs,\n};\n\nexport const LoadingFieldHint = Template.bind({});\nLoadingFieldHint.args = {\n value: '',\n loading: true,\n ...defaultArgs,\n};\n"],"names":["codeString","FieldHint_stories","FieldHint","Template","args","jsx","defaultArgs","FieldHintExample","LoadingFieldHint"],"mappings":";;AAKA,MAAMA,IAAa,6FAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA,IACX;AAAA,IACA,sBAAsB;AAAA,MACpB,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAoC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAW,GAAGE,EAAM,CAAA,GAEnEE,IAAuC;AAAA,EAC3C,sBAAsB;AACxB,GAEaC,IAAmBJ,EAAS,KAAK,EAAE;AAChDI,EAAiB,OAAO;AAAA,EACtB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,GAAGD;AACL;AAEO,MAAME,IAAmBL,EAAS,KAAK,EAAE;AAChDK,EAAiB,OAAO;AAAA,EACtB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,GAAGF;AACL;"}
1
+ {"version":3,"file":"FieldHint.stories.js","sources":["../../../src/components/FieldHint/FieldHint.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { FieldHintProps } from './FieldHint';\n\nimport { FieldHint } from './FieldHint';\n\nconst codeString = '<FieldHint value={value} loading={loading} spinnerAriaValueText={spinnerAriaValueText} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/FieldHint',\n component: FieldHint,\n argTypes: {\n value: {\n control: 'text',\n },\n spinnerAriaValueText: {\n control: 'text',\n },\n },\n parameters: {\n inspectComponent: FieldHint,\n codeString: codeString,\n },\n} as Meta<FieldHintProps>;\n\nconst Template: StoryFn<FieldHintProps> = (args) => <FieldHint {...args} />;\n\nconst defaultArgs: Partial<FieldHintProps> = {\n spinnerAriaValueText: 'FieldHint Loading',\n};\n\nexport const FieldHintExample = Template.bind({});\nFieldHintExample.args = {\n value: 'This is a FieldHint',\n loading: false,\n ...defaultArgs,\n};\n\nexport const LoadingFieldHint = Template.bind({});\nLoadingFieldHint.args = {\n value: '',\n loading: true,\n ...defaultArgs,\n};\n"],"names":["codeString","FieldHint_stories","FieldHint","Template","args","jsx","defaultArgs","FieldHintExample","LoadingFieldHint"],"mappings":";;AAKA,MAAMA,IAAa,6FAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA,IACX;AAAA,IACA,sBAAsB;AAAA,MACpB,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAoC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAW,GAAGE,EAAM,CAAA,GAEnEE,IAAuC;AAAA,EAC3C,sBAAsB;AACxB,GAEaC,IAAmBJ,EAAS,KAAK,EAAE;AAChDI,EAAiB,OAAO;AAAA,EACtB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,GAAGD;AACL;AAEO,MAAME,IAAmBL,EAAS,KAAK,EAAE;AAChDK,EAAiB,OAAO;AAAA,EACtB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,GAAGF;AACL;"}
@@ -1,8 +1,13 @@
1
1
  import { PropsWithChildren, ReactNode } from 'react';
2
2
  export interface FieldsetProps {
3
+ /** The description to render. */
3
4
  description?: ReactNode;
5
+ /** The id of the description element. Used together with the description property. */
4
6
  descriptionId?: string;
7
+ /** true if the form fields should render inline; otherwise, false. The default is false. */
5
8
  inline?: boolean;
9
+ /** The legend to render. */
6
10
  legend: string;
7
11
  }
12
+ /** Represents a component to show a collection of form field elements. */
8
13
  export declare const Fieldset: ({ inline, legend, description, descriptionId, children, }: PropsWithChildren<FieldsetProps>) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Fieldset.js","sources":["../../../src/components/Fieldset/Fieldset.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { PropsWithChildren, ReactNode } from 'react';\n\nimport styles from './Fieldset.module.css';\n\nexport interface FieldsetProps {\n description?: ReactNode;\n descriptionId?: string;\n inline?: boolean;\n legend: string;\n}\n\nexport const Fieldset = ({\n inline,\n legend,\n description,\n descriptionId,\n children,\n}: PropsWithChildren<FieldsetProps>) => (\n <fieldset\n className={clsx(styles['fieldset'], {\n [styles['fieldset--inline']]: inline,\n })}\n >\n <div>\n <legend className={styles['fieldset__legend']}>{legend}</legend>\n {description && (\n <p className={styles['fieldset__description']} id={descriptionId}>\n {description}\n </p>\n )}\n </div>\n {children}\n </fieldset>\n);\n"],"names":["Fieldset","inline","legend","description","descriptionId","children","jsxs","clsx","styles","jsx"],"mappings":";;;;;;;GAaaA,IAAW,CAAC;AAAA,EACvB,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AACF,MACE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAKC,EAAO,UAAa;AAAA,MAClC,CAACA,EAAO,kBAAkB,CAAC,GAAGP;AAAA,IAAA,CAC/B;AAAA,IAED,UAAA;AAAA,MAAA,gBAAAK,EAAC,OACC,EAAA,UAAA;AAAA,QAAA,gBAAAG,EAAC,UAAO,EAAA,WAAWD,EAAO,kBAAsB,UAAON,GAAA;AAAA,QACtDC,uBACE,KAAE,EAAA,WAAWK,EAAO,uBAA0B,IAAIJ,GAChD,UACHD,EAAA,CAAA;AAAA,MAAA,GAEJ;AAAA,MACCE;AAAA,IAAA;AAAA,EAAA;AACH;"}
1
+ {"version":3,"file":"Fieldset.js","sources":["../../../src/components/Fieldset/Fieldset.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { PropsWithChildren, ReactNode } from 'react';\n\nimport styles from './Fieldset.module.css';\n\nexport interface FieldsetProps {\n /** The description to render. */\n description?: ReactNode;\n /** The id of the description element. Used together with the description property. */\n descriptionId?: string;\n /** true if the form fields should render inline; otherwise, false. The default is false. */\n inline?: boolean;\n /** The legend to render. */\n legend: string;\n}\n\n/** Represents a component to show a collection of form field elements. */\nexport const Fieldset = ({\n inline,\n legend,\n description,\n descriptionId,\n children,\n}: PropsWithChildren<FieldsetProps>) => (\n <fieldset\n className={clsx(styles['fieldset'], {\n [styles['fieldset--inline']]: inline,\n })}\n >\n <div>\n <legend className={styles['fieldset__legend']}>{legend}</legend>\n {description && (\n <p className={styles['fieldset__description']} id={descriptionId}>\n {description}\n </p>\n )}\n </div>\n {children}\n </fieldset>\n);\n"],"names":["Fieldset","inline","legend","description","descriptionId","children","jsxs","clsx","styles","jsx"],"mappings":";;;;;;;GAkBaA,IAAW,CAAC;AAAA,EACvB,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AACF,MACE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAKC,EAAO,UAAa;AAAA,MAClC,CAACA,EAAO,kBAAkB,CAAC,GAAGP;AAAA,IAAA,CAC/B;AAAA,IAED,UAAA;AAAA,MAAA,gBAAAK,EAAC,OACC,EAAA,UAAA;AAAA,QAAA,gBAAAG,EAAC,UAAO,EAAA,WAAWD,EAAO,kBAAsB,UAAON,GAAA;AAAA,QACtDC,uBACE,KAAE,EAAA,WAAWK,EAAO,uBAA0B,IAAIJ,GAChD,UACHD,EAAA,CAAA;AAAA,MAAA,GAEJ;AAAA,MACCE;AAAA,IAAA;AAAA,EAAA;AACH;"}
@@ -1,12 +1,12 @@
1
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { Fieldset as s } from "./Fieldset.js";
3
- import { InputField as i } from "../InputField/InputField.js";
4
- import { Label as t } from "../Label/Label.js";
5
- import { Container as n } from "../../storyComponents/Container/Container.js";
6
- import { FormField as r } from "../FormField/FormField.js";
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import { Fieldset as l } from "./Fieldset.js";
3
+ import { InputField as t } from "../InputField/InputField.js";
4
+ import { Label as r } from "../Label/Label.js";
5
+ import { Container as a } from "../../storyComponents/Container/Container.js";
6
+ import { FormField as s } from "../FormField/FormField.js";
7
7
  const m = "<Fieldset legend={legend} description={description}>{children}</Fieldset>", u = {
8
8
  title: "Atoms/Fieldset",
9
- component: s,
9
+ component: l,
10
10
  argTypes: {
11
11
  descriptionId: {
12
12
  table: {
@@ -15,27 +15,28 @@ const m = "<Fieldset legend={legend} description={description}>{children}</Field
15
15
  }
16
16
  },
17
17
  parameters: {
18
+ inspectComponent: l,
18
19
  codeString: m
19
20
  }
20
- }, d = (a) => /* @__PURE__ */ e(n, { size: "large", children: /* @__PURE__ */ l(s, { ...a, children: [
21
- /* @__PURE__ */ l(r, { children: [
22
- /* @__PURE__ */ e(t, { htmlFor: "d6aa53fd", children: "Example label 1" }),
23
- /* @__PURE__ */ e(i, { id: "d6aa53fd" })
21
+ }, o = (n) => /* @__PURE__ */ e(a, { size: "large", children: /* @__PURE__ */ i(l, { ...n, children: [
22
+ /* @__PURE__ */ i(s, { children: [
23
+ /* @__PURE__ */ e(r, { htmlFor: "d6aa53fd", children: "Example label 1" }),
24
+ /* @__PURE__ */ e(t, { id: "d6aa53fd" })
24
25
  ] }),
25
- /* @__PURE__ */ l(r, { children: [
26
- /* @__PURE__ */ e(t, { htmlFor: "4e7a2f22", children: "Example label 2" }),
27
- /* @__PURE__ */ e(i, { id: "4e7a2f22" })
26
+ /* @__PURE__ */ i(s, { children: [
27
+ /* @__PURE__ */ e(r, { htmlFor: "4e7a2f22", children: "Example label 2" }),
28
+ /* @__PURE__ */ e(t, { id: "4e7a2f22" })
28
29
  ] })
29
- ] }) }), o = {
30
+ ] }) }), d = {
30
31
  legend: "Fieldset example",
31
32
  inline: !1
32
- }, p = d.bind({});
33
+ }, p = o.bind({});
33
34
  p.args = {
34
- ...o
35
+ ...d
35
36
  };
36
- const c = d.bind({});
37
+ const c = o.bind({});
37
38
  c.args = {
38
- ...o,
39
+ ...d,
39
40
  description: "A Fieldset groups several controls as well as labels"
40
41
  };
41
42
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Fieldset.stories.js","sources":["../../../src/components/Fieldset/Fieldset.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { PropsWithChildren } from 'react';\nimport type { FieldsetProps } from './Fieldset';\n\nimport { Fieldset } from './Fieldset';\n\nimport { InputField } from 'components/InputField';\nimport { Label } from 'components/Label';\nimport { Container } from 'storyComponents/Container';\nimport { FormField } from 'components/FormField';\n\nconst codeString = '<Fieldset legend={legend} description={description}>{children}</Fieldset>';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Fieldset',\n component: Fieldset,\n argTypes: {\n descriptionId: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<PropsWithChildren<FieldsetProps>>;\n\nconst Template: StoryFn<PropsWithChildren<FieldsetProps>> = (args) => (\n <Container size=\"large\">\n <Fieldset {...args}>\n <FormField>\n <Label htmlFor=\"d6aa53fd\">Example label 1</Label>\n <InputField id=\"d6aa53fd\" />\n </FormField>\n <FormField>\n <Label htmlFor=\"4e7a2f22\">Example label 2</Label>\n <InputField id=\"4e7a2f22\" />\n </FormField>\n </Fieldset>\n </Container>\n);\n\nconst defaultArgs: Partial<PropsWithChildren<FieldsetProps>> = {\n legend: 'Fieldset example',\n inline: false,\n};\n\nexport const FieldsetExample = Template.bind({});\nFieldsetExample.args = {\n ...defaultArgs,\n};\n\nexport const WithDescriptionExample = Template.bind({});\nWithDescriptionExample.args = {\n ...defaultArgs,\n description: 'A Fieldset groups several controls as well as labels',\n};\n"],"names":["codeString","Fieldset_stories","Fieldset","Template","args","jsx","Container","jsxs","FormField","Label","InputField","defaultArgs","FieldsetExample","WithDescriptionExample"],"mappings":";;;;;;AAWA,MAAMA,IAAa,6EAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,eAAe;AAAA,MACb,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAsD,CAACC,MAC1D,gBAAAC,EAAAC,GAAA,EAAU,MAAK,SACd,UAAA,gBAAAC,EAACL,GAAU,EAAA,GAAGE,GACZ,UAAA;AAAA,EAAA,gBAAAG,EAACC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAH,EAAAI,GAAA,EAAM,SAAQ,YAAW,UAAe,mBAAA;AAAA,IACzC,gBAAAJ,EAACK,GAAW,EAAA,IAAG,WAAW,CAAA;AAAA,EAAA,GAC5B;AAAA,oBACCF,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAH,EAAAI,GAAA,EAAM,SAAQ,YAAW,UAAe,mBAAA;AAAA,IACzC,gBAAAJ,EAACK,GAAW,EAAA,IAAG,WAAW,CAAA;AAAA,EAAA,GAC5B;AAAA,EACF,CAAA,EACF,CAAA,GAGIC,IAAyD;AAAA,EAC7D,QAAQ;AAAA,EACR,QAAQ;AACV,GAEaC,IAAkBT,EAAS,KAAK,EAAE;AAC/CS,EAAgB,OAAO;AAAA,EACrB,GAAGD;AACL;AAEO,MAAME,IAAyBV,EAAS,KAAK,EAAE;AACtDU,EAAuB,OAAO;AAAA,EAC5B,GAAGF;AAAA,EACH,aAAa;AACf;"}
1
+ {"version":3,"file":"Fieldset.stories.js","sources":["../../../src/components/Fieldset/Fieldset.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { PropsWithChildren } from 'react';\nimport type { FieldsetProps } from './Fieldset';\n\nimport { Fieldset } from './Fieldset';\n\nimport { InputField } from 'components/InputField';\nimport { Label } from 'components/Label';\nimport { Container } from 'storyComponents/Container';\nimport { FormField } from 'components/FormField';\n\nconst codeString = '<Fieldset legend={legend} description={description}>{children}</Fieldset>';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Fieldset',\n component: Fieldset,\n argTypes: {\n descriptionId: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: Fieldset,\n codeString: codeString,\n },\n} as Meta<PropsWithChildren<FieldsetProps>>;\n\nconst Template: StoryFn<PropsWithChildren<FieldsetProps>> = (args) => (\n <Container size=\"large\">\n <Fieldset {...args}>\n <FormField>\n <Label htmlFor=\"d6aa53fd\">Example label 1</Label>\n <InputField id=\"d6aa53fd\" />\n </FormField>\n <FormField>\n <Label htmlFor=\"4e7a2f22\">Example label 2</Label>\n <InputField id=\"4e7a2f22\" />\n </FormField>\n </Fieldset>\n </Container>\n);\n\nconst defaultArgs: Partial<PropsWithChildren<FieldsetProps>> = {\n legend: 'Fieldset example',\n inline: false,\n};\n\nexport const FieldsetExample = Template.bind({});\nFieldsetExample.args = {\n ...defaultArgs,\n};\n\nexport const WithDescriptionExample = Template.bind({});\nWithDescriptionExample.args = {\n ...defaultArgs,\n description: 'A Fieldset groups several controls as well as labels',\n};\n"],"names":["codeString","Fieldset_stories","Fieldset","Template","args","jsx","Container","jsxs","FormField","Label","InputField","defaultArgs","FieldsetExample","WithDescriptionExample"],"mappings":";;;;;;AAWA,MAAMA,IAAa,6EAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,eAAe;AAAA,MACb,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAsD,CAACC,MAC1D,gBAAAC,EAAAC,GAAA,EAAU,MAAK,SACd,UAAA,gBAAAC,EAACL,GAAU,EAAA,GAAGE,GACZ,UAAA;AAAA,EAAA,gBAAAG,EAACC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAH,EAAAI,GAAA,EAAM,SAAQ,YAAW,UAAe,mBAAA;AAAA,IACzC,gBAAAJ,EAACK,GAAW,EAAA,IAAG,WAAW,CAAA;AAAA,EAAA,GAC5B;AAAA,oBACCF,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAH,EAAAI,GAAA,EAAM,SAAQ,YAAW,UAAe,mBAAA;AAAA,IACzC,gBAAAJ,EAACK,GAAW,EAAA,IAAG,WAAW,CAAA;AAAA,EAAA,GAC5B;AAAA,EACF,CAAA,EACF,CAAA,GAGIC,IAAyD;AAAA,EAC7D,QAAQ;AAAA,EACR,QAAQ;AACV,GAEaC,IAAkBT,EAAS,KAAK,EAAE;AAC/CS,EAAgB,OAAO;AAAA,EACrB,GAAGD;AACL;AAEO,MAAME,IAAyBV,EAAS,KAAK,EAAE;AACtDU,EAAuB,OAAO;AAAA,EAC5B,GAAGF;AAAA,EACH,aAAa;AACf;"}