@uva-glass/component-library 3.52.10 → 3.53.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 (178) hide show
  1. package/dist/{Lexical.prod-sd_e2sqT.js → Lexical.prod-DH2XfwvA.js} +58 -58
  2. package/dist/{Lexical.prod-sd_e2sqT.js.map → Lexical.prod-DH2XfwvA.js.map} +1 -1
  3. package/dist/{LexicalClipboard.prod-Co2PF1UJ.js → LexicalClipboard.prod-DTuNvXAS.js} +22 -22
  4. package/dist/{LexicalClipboard.prod-Co2PF1UJ.js.map → LexicalClipboard.prod-DTuNvXAS.js.map} +1 -1
  5. package/dist/{LexicalLink.prod-BCE6Bg2N.js → LexicalLink.prod-BV5Y2RYj.js} +8 -9
  6. package/dist/{LexicalLink.prod-BCE6Bg2N.js.map → LexicalLink.prod-BV5Y2RYj.js.map} +1 -1
  7. package/dist/{LexicalList.prod-CIB0K0ja.js → LexicalList.prod-DA9du3qx.js} +4 -4
  8. package/dist/{LexicalList.prod-CIB0K0ja.js.map → LexicalList.prod-DA9du3qx.js.map} +1 -1
  9. package/dist/{LexicalSelection.prod-CCmcTP6S.js → LexicalSelection.prod-mQk00-U_.js} +2 -2
  10. package/dist/{LexicalSelection.prod-CCmcTP6S.js.map → LexicalSelection.prod-mQk00-U_.js.map} +1 -1
  11. package/dist/{LexicalTable.prod-Oa2YPHLl.js → LexicalTable.prod-RGq0GKAR.js} +4 -4
  12. package/dist/{LexicalTable.prod-Oa2YPHLl.js.map → LexicalTable.prod-RGq0GKAR.js.map} +1 -1
  13. package/dist/{LexicalUtils.prod-CjKjgnmx.js → LexicalUtils.prod-DU4QwthB.js} +2 -2
  14. package/dist/{LexicalUtils.prod-CjKjgnmx.js.map → LexicalUtils.prod-DU4QwthB.js.map} +1 -1
  15. package/dist/RteEditor.module-DaBh86FK.js +41 -0
  16. package/dist/RteEditor.module-DaBh86FK.js.map +1 -0
  17. package/dist/{TableCellResizerPlugin-DATbSzfg.js → TableCellResizerPlugin-DRwI83s2.js} +4 -4
  18. package/dist/{TableCellResizerPlugin-DATbSzfg.js.map → TableCellResizerPlugin-DRwI83s2.js.map} +1 -1
  19. package/dist/{TablePlugin-CqCjNBW_.js → TablePlugin-DmE96vN7.js} +20 -20
  20. package/dist/{TablePlugin-CqCjNBW_.js.map → TablePlugin-DmE96vN7.js.map} +1 -1
  21. package/dist/assets/AddCatalogueLinkForm.css +1 -0
  22. package/dist/assets/Flyout.css +1 -1
  23. package/dist/assets/RteEditor.css +1 -1
  24. package/dist/assets/variables.css +72 -72
  25. package/dist/chunk-SS2NHR7W-qmI2h7CJ.js +4507 -0
  26. package/dist/chunk-SS2NHR7W-qmI2h7CJ.js.map +1 -0
  27. package/dist/{client-CFLMKOFW.js → client-D4oO7Spw.js} +11 -11
  28. package/dist/{client-CFLMKOFW.js.map → client-D4oO7Spw.js.map} +1 -1
  29. package/dist/components/Accordion/Accordion.test.js +2 -2
  30. package/dist/components/AccordionCard/AccordionCard.test.js +2 -2
  31. package/dist/components/ActionList/ActionList.test.js +2 -2
  32. package/dist/components/AppStatusBar/AppStatusBar.test.js +1 -1
  33. package/dist/components/Attention/Attention.test.js +1 -1
  34. package/dist/components/Backdrop/Backdrop.test.js +1 -1
  35. package/dist/components/Buttons/Button.stories.js +1 -1
  36. package/dist/components/Buttons/Button.test.js +1 -1
  37. package/dist/components/Buttons/LinkButton.stories.js +1 -1
  38. package/dist/components/Buttons/LinkButton.test.js +1 -1
  39. package/dist/components/Buttons/MenuButton.stories.js +1 -1
  40. package/dist/components/Buttons/MenuButton.test.js +1 -1
  41. package/dist/components/Card/Card.test.js +1 -1
  42. package/dist/components/Checkbox/Checkbox.stories.js +1 -1
  43. package/dist/components/Checkbox/Checkbox.test.js +2 -2
  44. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
  45. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +1 -1
  46. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  47. package/dist/components/CheckboxTree/CheckboxTree.stories.js +111 -55
  48. package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
  49. package/dist/components/Chip/Chip.stories.js +1 -1
  50. package/dist/components/ControlsButton/ControlsButton.stories.js +1 -1
  51. package/dist/components/Drawer/Drawer.stories.js +1 -1
  52. package/dist/components/FeedbackBar/FeedbackBar.test.js +1 -1
  53. package/dist/components/FormInput/FormInput.d.ts +3 -1
  54. package/dist/components/FormInput/FormInput.js +26 -24
  55. package/dist/components/FormInput/FormInput.js.map +1 -1
  56. package/dist/components/FormInput/FormInput.stories.js +1 -1
  57. package/dist/components/IconButton/IconButton.stories.js +1 -1
  58. package/dist/components/InputField/InputField.stories.js +2 -2
  59. package/dist/components/Label/Label.test.js +1 -1
  60. package/dist/components/MetaDataBar/MetaDataBar.test.js +1 -1
  61. package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
  62. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  63. package/dist/components/MultiSelect/MultiSelect.stories.js +2 -2
  64. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  65. package/dist/components/MultiSelect/index.js +1 -1
  66. package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
  67. package/dist/components/MultiSelectBox/MultiSelectBox.test.js +1 -1
  68. package/dist/components/Notification/Notification.stories.js +1 -1
  69. package/dist/components/Notification/Notification.test.js +1 -1
  70. package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
  71. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  72. package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
  73. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  74. package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
  75. package/dist/components/RadioGroup/Radiogroup.test.js +1 -1
  76. package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
  77. package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +1 -1
  78. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  79. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
  80. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/AddCatalogueLinkForm.d.ts +22 -0
  81. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/AddCatalogueLinkForm.js +108 -0
  82. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/AddCatalogueLinkForm.js.map +1 -0
  83. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/index.d.ts +1 -0
  84. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/index.js +5 -0
  85. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/index.js.map +1 -0
  86. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.d.ts +8 -0
  87. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +182 -0
  88. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js.map +1 -0
  89. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/index.d.ts +1 -0
  90. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/index.js +5 -0
  91. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/index.js.map +1 -0
  92. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +8 -8
  93. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
  94. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +0 -2
  95. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +112 -132
  96. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  97. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  98. package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +2 -3
  99. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +52 -57
  100. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
  101. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +3 -3
  102. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +4 -4
  103. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
  104. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +2 -2
  105. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +6 -6
  106. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +24 -23
  107. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -1
  108. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  109. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +4 -1
  110. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +65 -52
  111. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  112. package/dist/components/RteEditor/Plugins/index.js +8 -9
  113. package/dist/components/RteEditor/Providers/LanguageProvider.d.ts +2 -2
  114. package/dist/components/RteEditor/Providers/LanguageProvider.js +4 -4
  115. package/dist/components/RteEditor/Providers/LanguageProvider.js.map +1 -1
  116. package/dist/components/RteEditor/RteEditor.d.ts +8 -3
  117. package/dist/components/RteEditor/RteEditor.js +334 -309
  118. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  119. package/dist/components/RteEditor/RteEditor.stories.js +69 -33
  120. package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
  121. package/dist/components/RteEditor/UvaTheme/UvaTheme.d.ts +1 -0
  122. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +3 -2
  123. package/dist/components/RteEditor/UvaTheme/UvaTheme.js.map +1 -1
  124. package/dist/components/RteEditor/helpers.js +26 -23
  125. package/dist/components/RteEditor/helpers.js.map +1 -1
  126. package/dist/components/RteEditor/hooks/components/Flyout.js +6 -16
  127. package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -1
  128. package/dist/components/RteEditor/hooks/useTranslation.d.ts +39 -1
  129. package/dist/components/RteEditor/hooks/useTranslation.js +6 -6
  130. package/dist/components/RteEditor/hooks/useTranslation.js.map +1 -1
  131. package/dist/components/RteEditor/mockCatalogueSearchData.d.ts +18 -0
  132. package/dist/components/RteEditor/mockCatalogueSearchData.js +485 -0
  133. package/dist/components/RteEditor/mockCatalogueSearchData.js.map +1 -0
  134. package/dist/components/RteEditor/mockRteContent.d.ts +1 -1
  135. package/dist/components/RteEditor/mockRteContent.js +8 -6
  136. package/dist/components/RteEditor/mockRteContent.js.map +1 -1
  137. package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.d.ts +29 -0
  138. package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +126 -0
  139. package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js.map +1 -0
  140. package/dist/components/RteEditor/nodes/CourseCatalogueNode/index.d.ts +1 -0
  141. package/dist/components/RteEditor/nodes/CourseCatalogueNode/index.js +11 -0
  142. package/dist/components/RteEditor/nodes/CourseCatalogueNode/index.js.map +1 -0
  143. package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +58 -52
  144. package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js.map +1 -1
  145. package/dist/components/RteEditor/nodes/index.d.ts +1 -0
  146. package/dist/components/RteEditor/nodes/index.js +14 -6
  147. package/dist/components/RteEditor/nodes/index.js.map +1 -1
  148. package/dist/components/RteEditor/translations.d.ts +41 -3
  149. package/dist/components/RteEditor/translations.js +44 -6
  150. package/dist/components/RteEditor/translations.js.map +1 -1
  151. package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
  152. package/dist/components/Sortable/Sortable.stories.js +1 -1
  153. package/dist/components/StatusBadge/StatusBadge.test.js +1 -1
  154. package/dist/components/TextArea/TextArea.stories.js +1 -1
  155. package/dist/components/TextArea/TextArea.test.js +2 -2
  156. package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
  157. package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
  158. package/dist/components/VarIndicator/VarIndicator.test.js +2 -2
  159. package/dist/components/index.js +1 -1
  160. package/dist/{index-DRQMriwT.js → index-B4NxQN5d.js} +8668 -10004
  161. package/dist/index-B4NxQN5d.js.map +1 -0
  162. package/dist/{index-BKK3EWVW.js → index-ZQcmo1D_.js} +2 -2
  163. package/dist/{index-BKK3EWVW.js.map → index-ZQcmo1D_.js.map} +1 -1
  164. package/dist/index.js +1 -1
  165. package/dist/react-18-BczhA0zC.js +41 -0
  166. package/dist/react-18-BczhA0zC.js.map +1 -0
  167. package/dist/{react.esm-BjO203QT.js → react.esm-BDo_tPxu.js} +2 -2
  168. package/dist/{react.esm-BjO203QT.js.map → react.esm-BDo_tPxu.js.map} +1 -1
  169. package/dist/storybook__react.d.js +4252 -4509
  170. package/dist/storybook__react.d.js.map +1 -1
  171. package/package.json +19 -19
  172. package/dist/RteEditor.module-CUi7Vqe8.js +0 -37
  173. package/dist/RteEditor.module-CUi7Vqe8.js.map +0 -1
  174. package/dist/chunk-HERDX7MO-DaYu-eWo.js +0 -11320
  175. package/dist/chunk-HERDX7MO-DaYu-eWo.js.map +0 -1
  176. package/dist/index-DRQMriwT.js.map +0 -1
  177. package/dist/react-18-C6foUf2n.js +0 -42
  178. package/dist/react-18-C6foUf2n.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r as n, s as a } from "../../react.esm-BjO203QT.js";
4
- import { u as e } from "../../index-BKK3EWVW.js";
3
+ import { r as n, s as a } from "../../react.esm-BDo_tPxu.js";
4
+ import { u as e } from "../../index-ZQcmo1D_.js";
5
5
  import { Accordion as i } from "./Accordion.js";
6
6
  describe("Accordion", () => {
7
7
  it("should render", () => {
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r as c, s as e, f as s, w as d } from "../../react.esm-BjO203QT.js";
4
- import { u as r } from "../../index-BKK3EWVW.js";
3
+ import { r as c, s as e, f as s, w as d } from "../../react.esm-BDo_tPxu.js";
4
+ import { u as r } from "../../index-ZQcmo1D_.js";
5
5
  import { AccordionCard as a } from "./AccordionCard.js";
6
6
  describe("AccordionCard", () => {
7
7
  it("should render", () => {
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r as n, s as t, w as a } from "../../react.esm-BjO203QT.js";
4
- import { u as l } from "../../index-BKK3EWVW.js";
3
+ import { r as n, s as t, w as a } from "../../react.esm-BDo_tPxu.js";
4
+ import { u as l } from "../../index-ZQcmo1D_.js";
5
5
  import { ActionList as o } from "./ActionList.js";
6
6
  const T = jest.fn(), c = [
7
7
  /* @__PURE__ */ i("button", { type: "button", onClick: T, children: "Test Action 1" }, "1"),
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r, s as t } from "../../react.esm-BjO203QT.js";
3
+ import { r, s as t } from "../../react.esm-BDo_tPxu.js";
4
4
  import { AppStatusBar as s } from "./AppStatusBar.js";
5
5
  describe("AppStatusBar", () => {
6
6
  it("should render", () => {
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r as t, s as r } from "../../react.esm-BjO203QT.js";
3
+ import { r as t, s as r } from "../../react.esm-BDo_tPxu.js";
4
4
  import { Attention as n } from "./Attention.js";
5
5
  describe("Attention", () => {
6
6
  it("should render (variant primary)", () => {
@@ -1,6 +1,6 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r as e, s as o } from "../../react.esm-BjO203QT.js";
3
+ import { r as e, s as o } from "../../react.esm-BDo_tPxu.js";
4
4
  import { Backdrop as t } from "./Backdrop.js";
5
5
  describe("Backdrop", () => {
6
6
  it("should render", () => {
@@ -1,5 +1,5 @@
1
1
  import { jsx as t, jsxs as a, Fragment as s } from "react/jsx-runtime";
2
- import { f as l } from "../../index-DRQMriwT.js";
2
+ import { f as l } from "../../index-B4NxQN5d.js";
3
3
  import { Button as n } from "./Button.js";
4
4
  const c = "<Button variant={variant} onClick={onClictFunction}>{children}</Button>", h = {
5
5
  title: "Atoms/Buttons/Button",
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r as n, s as t, f as c } from "../../react.esm-BjO203QT.js";
3
+ import { r as n, s as t, f as c } from "../../react.esm-BDo_tPxu.js";
4
4
  import { Button as o } from "./Button.js";
5
5
  const s = jest.fn();
6
6
  describe("Button", () => {
@@ -1,5 +1,5 @@
1
1
  import { jsx as t, jsxs as a, Fragment as l } from "react/jsx-runtime";
2
- import { f as s } from "../../index-DRQMriwT.js";
2
+ import { f as s } from "../../index-B4NxQN5d.js";
3
3
  import { BrowserRouter as c } from "react-router";
4
4
  import { LinkButton as n } from "./LinkButton.js";
5
5
  const d = `
@@ -1,6 +1,6 @@
1
1
  import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r as n, s as t, f as c } from "../../react.esm-BjO203QT.js";
3
+ import { r as n, s as t, f as c } from "../../react.esm-BDo_tPxu.js";
4
4
  import { BrowserRouter as u, Routes as a, Route as d } from "react-router";
5
5
  import { LinkButton as o } from "./LinkButton.js";
6
6
  const r = ({ children: i }) => /* @__PURE__ */ s(u, { children: [
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as s, Fragment as l } from "react/jsx-runtime";
2
- import { f as c } from "../../index-DRQMriwT.js";
2
+ import { f as c } from "../../index-B4NxQN5d.js";
3
3
  import { MenuButton as t } from "./MenuButton.js";
4
4
  const d = `
5
5
  // Has all LabelHTMLAttributes props available except "className" and "style"
@@ -1,6 +1,6 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r as u, s as e, f as c } from "../../react.esm-BjO203QT.js";
3
+ import { r as u, s as e, f as c } from "../../react.esm-BDo_tPxu.js";
4
4
  import { createRef as s } from "react";
5
5
  import { MenuButton as r } from "./MenuButton.js";
6
6
  const n = jest.fn();
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r, s as d } from "../../react.esm-BjO203QT.js";
3
+ import { r, s as d } from "../../react.esm-BDo_tPxu.js";
4
4
  import { Card as o } from "./Card.js";
5
5
  describe("Card", () => {
6
6
  it("should render", () => {
@@ -1,5 +1,5 @@
1
1
  import { jsxs as g, jsx as o } from "react/jsx-runtime";
2
- import { f as e } from "../../index-DRQMriwT.js";
2
+ import { f as e } from "../../index-B4NxQN5d.js";
3
3
  import { Checkbox as n } from "./Checkbox.js";
4
4
  import { FormField as t } from "../FormField/FormField.js";
5
5
  import { Label as i } from "../Label/Label.js";
@@ -1,7 +1,7 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r as o, s as t } from "../../react.esm-BjO203QT.js";
4
- import { u as s } from "../../index-BKK3EWVW.js";
3
+ import { r as o, s as t } from "../../react.esm-BDo_tPxu.js";
4
+ import { u as s } from "../../index-ZQcmo1D_.js";
5
5
  import { Checkbox as r } from "./Checkbox.js";
6
6
  describe("Checkbox", () => {
7
7
  it("should render", () => {
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as t, Fragment as l } from "react/jsx-runtime";
2
- import { f as o } from "../../index-DRQMriwT.js";
2
+ import { f as o } from "../../index-B4NxQN5d.js";
3
3
  import { CheckboxButtonBar as i } from "./CheckboxButtonBar.js";
4
4
  import { Periods as r } from "../Periods/Periods.js";
5
5
  const u = "<CheckboxButtonBar checkboxes={} defaultValues={} label={} labelPosition={} required={} notValidatedText={} disableGroup={} onSetValues={} />", B = {
@@ -1,6 +1,6 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r as c, s as t } from "../../react.esm-BjO203QT.js";
3
+ import { r as c, s as t } from "../../react.esm-BDo_tPxu.js";
4
4
  import { CheckboxButtonBar as a } from "./CheckboxButtonBar.js";
5
5
  const n = jest.fn(), d = [
6
6
  {
@@ -18,7 +18,7 @@ import "../IconButton/IconButton.js";
18
18
  import "../Input/Input.js";
19
19
  import "../InputField/InputField.js";
20
20
  import "react-router";
21
- import "../../TablePlugin-CqCjNBW_.js";
21
+ import "../../TablePlugin-DmE96vN7.js";
22
22
  import "../RteEditor/Providers/LanguageProvider.js";
23
23
  import "../RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
24
24
  import "../RteEditor/hooks/components/Flyout.js";
@@ -1,85 +1,141 @@
1
- import { jsx as h, jsxs as b } from "react/jsx-runtime";
2
- import { f as C } from "../../index-DRQMriwT.js";
3
- import { a as u } from "../../chunk-HERDX7MO-DaYu-eWo.js";
4
- import { useState as f } from "react";
5
- import { CheckboxTree as p } from "./CheckboxTree.js";
6
- import { Chip as g } from "../Chip/Chip.js";
7
- const E = (e, r, t) => {
8
- const l = Array.from({ length: r }, (o, c) => c + 1), n = (o) => {
9
- const c = Math.ceil(parseInt(o) / t), i = c === t ? "" : `.${parseInt(o) % t || t}`;
10
- return `${c}${i}`;
11
- }, s = l.map((o) => ({
12
- itemName: n(String(o)),
1
+ import { jsx as d, jsxs as y } from "react/jsx-runtime";
2
+ import { s as O, f as _ } from "../../index-B4NxQN5d.js";
3
+ import { I as C, a as v } from "../../chunk-SS2NHR7W-qmI2h7CJ.js";
4
+ import { useState as R } from "react";
5
+ import { CheckboxTree as u } from "./CheckboxTree.js";
6
+ import { Chip as w } from "../Chip/Chip.js";
7
+ var D = "storybook/actions", S = `${D}/action-event`, x = {
8
+ depth: 10,
9
+ clearOnStoryChange: !0,
10
+ limit: 50
11
+ }, T = (e, t) => {
12
+ let r = Object.getPrototypeOf(e);
13
+ return !r || t(r) ? r : T(r, t);
14
+ }, V = (e) => !!(typeof e == "object" && e && T(e, (t) => /^Synthetic(?:Base)?Event$/.test(t.constructor.name)) && typeof e.persist == "function"), j = (e) => {
15
+ if (V(e)) {
16
+ let t = Object.create(
17
+ e.constructor.prototype,
18
+ Object.getOwnPropertyDescriptors(e)
19
+ );
20
+ t.persist();
21
+ let r = Object.getOwnPropertyDescriptor(t, "view"), n = r?.value;
22
+ return typeof n == "object" && n?.constructor.name === "Window" && Object.defineProperty(t, "view", {
23
+ ...r,
24
+ value: Object.create(n.constructor.prototype)
25
+ }), t;
26
+ }
27
+ return e;
28
+ };
29
+ function b(e, t = {}) {
30
+ let r = {
31
+ ...x,
32
+ ...t
33
+ }, n = function(...i) {
34
+ if (t.implicit) {
35
+ let g = ("__STORYBOOK_PREVIEW__" in O ? O.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
36
+ (p) => p.phase === "playing" || p.phase === "rendering"
37
+ );
38
+ if (g) {
39
+ let p = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, f = new C({
40
+ phase: g.phase,
41
+ name: e,
42
+ deprecated: p
43
+ });
44
+ if (p)
45
+ console.warn(f);
46
+ else
47
+ throw f;
48
+ }
49
+ }
50
+ let s = v.getChannel(), h = Date.now().toString(36) + Math.random().toString(36).substring(2), o = 5, c = i.map(j), a = i.length > 1 ? c : c[0], l = {
51
+ id: h,
52
+ count: 0,
53
+ data: { name: e, args: a },
54
+ options: {
55
+ ...r,
56
+ maxDepth: o + (r.depth || 3)
57
+ }
58
+ };
59
+ s.emit(S, l);
60
+ };
61
+ return n.isAction = !0, n.implicit = t.implicit, n;
62
+ }
63
+ const A = (e, t, r) => {
64
+ const n = Array.from({ length: t }, (o, c) => c + 1), i = (o) => {
65
+ const c = Math.ceil(parseInt(o) / r), a = c === r ? "" : `.${parseInt(o) % r || r}`;
66
+ return `${c}${a}`;
67
+ }, s = n.map((o) => ({
68
+ itemName: i(String(o)),
13
69
  itemValue: o,
14
70
  disabled: !1
15
71
  }));
16
- return l.reduce((o, c, i) => {
17
- const m = Math.ceil(c / t);
18
- return e.includes(String(i + 1)) && (o[m] || (o[m] = {
19
- itemName: `Semester ${m}`,
72
+ return n.reduce((o, c, a) => {
73
+ const l = Math.ceil(c / r);
74
+ return e.includes(String(a + 1)) && (o[l] || (o[l] = {
75
+ itemName: `Semester ${l}`,
20
76
  children: []
21
- }), o[m].children.push({
22
- ...s[i],
23
- itemValue: String(s[i].itemValue)
77
+ }), o[l].children.push({
78
+ ...s[a],
79
+ itemValue: String(s[a].itemValue)
24
80
  })), o;
25
81
  }, []);
26
- }, x = 7, O = 3, T = E(
82
+ }, I = 7, P = 3, E = A(
27
83
  ["1", "2", "3", "4", "5", "6", "7"],
28
- x,
29
- O
30
- ), _ = "<CheckboxTree title={} checkboxTree={} selectedValues={} onChange={} />", P = {
84
+ I,
85
+ P
86
+ ), $ = "<CheckboxTree title={} checkboxTree={} selectedValues={} onChange={} />", U = {
31
87
  title: "Organisms/CheckboxTree",
32
- component: p,
88
+ component: u,
33
89
  parameters: {
34
- inspectComponent: p,
35
- codeString: _
90
+ inspectComponent: u,
91
+ codeString: $
36
92
  }
37
- }, $ = (e) => /* @__PURE__ */ h(p, { ...e }), k = $.bind({});
38
- k.args = {
93
+ }, k = (e) => /* @__PURE__ */ d(u, { ...e }), N = k.bind({});
94
+ N.args = {
39
95
  title: "Periode",
40
- checkboxTree: T,
96
+ checkboxTree: E,
41
97
  // eslint-disable-next-line @typescript-eslint/no-magic-numbers
42
98
  selectedValues: ["3", "4"],
43
- onChange: C()
99
+ onChange: _()
44
100
  };
45
- const a = 3, V = (e) => {
46
- const r = Math.ceil(parseInt(e) / a), t = r === a ? "" : `.${parseInt(e) % a || a}`;
47
- return `${r}${t}`;
48
- }, R = (e) => {
49
- const [r, t] = e.split(".").map(Number);
50
- return `${(r - 1) * a + (t || 1)}`;
51
- }, j = () => {
52
- const [e, r] = f(["5", "4", "1"]), t = (n) => {
101
+ const m = 3, M = (e) => {
102
+ const t = Math.ceil(parseInt(e) / m), r = t === m ? "" : `.${parseInt(e) % m || m}`;
103
+ return `${t}${r}`;
104
+ }, B = (e) => {
105
+ const [t, r] = e.split(".").map(Number);
106
+ return `${(t - 1) * m + (r || 1)}`;
107
+ }, Y = () => {
108
+ const [e, t] = R(["5", "4", "1"]), r = (i) => {
53
109
  const s = JSON.parse(JSON.stringify(e)).filter(
54
- (d) => d !== R(n)
110
+ (h) => h !== B(i)
55
111
  );
56
- r(() => s), u("onChange value:")(s);
57
- }, l = (n) => {
58
- r([...n]), u("onChange value:")(n);
112
+ t(() => s), b("onChange value:")(s);
113
+ }, n = (i) => {
114
+ t([...i]), b("onChange value:")(i);
59
115
  };
60
- return /* @__PURE__ */ b("div", { style: { width: "15rem" }, children: [
61
- /* @__PURE__ */ h("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.5rem", width: "100%", marginBottom: "1rem" }, children: e && e.map((n, s) => /* @__PURE__ */ h(
62
- g,
116
+ return /* @__PURE__ */ y("div", { style: { width: "15rem" }, children: [
117
+ /* @__PURE__ */ d("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.5rem", width: "100%", marginBottom: "1rem" }, children: e && e.map((i, s) => /* @__PURE__ */ d(
118
+ w,
63
119
  {
64
- label: V(n),
65
- onDelete: t
120
+ label: M(i),
121
+ onDelete: r
66
122
  },
67
- `${s}_${n}`
123
+ `${s}_${i}`
68
124
  )) }),
69
- /* @__PURE__ */ h(
70
- p,
125
+ /* @__PURE__ */ d(
126
+ u,
71
127
  {
72
128
  title: "Periode",
73
- checkboxTree: T,
129
+ checkboxTree: E,
74
130
  selectedValues: e,
75
- onChange: l
131
+ onChange: n
76
132
  }
77
133
  )
78
134
  ] });
79
135
  };
80
136
  export {
81
- k as CheckboxTreeExample,
82
- j as CheckboxTreeWithChips,
83
- P as default
137
+ N as CheckboxTreeExample,
138
+ Y as CheckboxTreeWithChips,
139
+ U as default
84
140
  };
85
141
  //# sourceMappingURL=CheckboxTree.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxTree.stories.js","sources":["../../../src/components/CheckboxTree/CheckboxTree.stories.tsx"],"sourcesContent":["import { fn } from 'storybook/test';\nimport { action } from 'storybook/actions';\nimport { useState } from 'react';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { CheckboxLeaf, CheckboxBranch, CheckboxTreeProps } from './CheckboxTree';\n\nimport { CheckboxTree } from './CheckboxTree';\n\nimport { Chip } from 'components/Chip';\n\nconst createPeriodTree = (periodIndices: string[], numberOfPeriods: number, periodPerSemester: number) => {\n const allPeriods = Array.from({ length: numberOfPeriods }, (_, idx) => idx + 1);\n\n const periodValueToLabel = (value: string) => {\n const semester = Math.ceil(parseInt(value) / periodPerSemester);\n const period = semester === periodPerSemester ? '' : `.${parseInt(value) % periodPerSemester || periodPerSemester}`;\n return `${semester}${period}`;\n };\n\n const periodTree = allPeriods.map((periodIndex) => ({\n itemName: periodValueToLabel(String(periodIndex)),\n itemValue: periodIndex,\n disabled: false,\n }));\n\n const periodTreeObject = allPeriods.reduce((periods, currentPeriod, periodIndex) => {\n const semester = Math.ceil(currentPeriod / periodPerSemester);\n if (periodIndices.includes(String(periodIndex + 1))) {\n if (!periods[semester]) {\n periods[semester] = {\n itemName: `Semester ${semester}`,\n children: [],\n };\n }\n periods[semester].children.push({\n ...periodTree[periodIndex],\n itemValue: String(periodTree[periodIndex].itemValue),\n } as CheckboxLeaf);\n }\n return periods;\n }, [] as CheckboxBranch[]);\n\n return periodTreeObject;\n};\n\nconst NUMBER_OF_PERIODS = 7;\nconst PERIOD_PER_SEMESTER = 3;\n\nconst MOCK_CHECKBOX_TREE = createPeriodTree(\n ['1', '2', '3', '4', '5', '6', '7'],\n NUMBER_OF_PERIODS,\n PERIOD_PER_SEMESTER\n);\n\nconst codeString = '<CheckboxTree title={} checkboxTree={} selectedValues={} 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 selectedValues: ['3', '4'],\n onChange: fn(),\n};\n\nconst PERIOD_SEGMENT = 3;\n\nconst periodValueToLabel = (value: string) => {\n const semester = Math.ceil(parseInt(value) / PERIOD_SEGMENT);\n const period = semester === PERIOD_SEGMENT ? '' : `.${parseInt(value) % PERIOD_SEGMENT || PERIOD_SEGMENT}`;\n return `${semester}${period}`;\n};\n\nconst periodLabelToValue = (value: string): string => {\n const [row, col] = value.split('.').map(Number);\n return `${(row - 1) * PERIOD_SEGMENT + (col || 1)}`;\n};\n\nexport const CheckboxTreeWithChips: StoryFn<CheckboxTreeProps> = () => {\n const [activeFilters, setActiveFilters] = useState<string[]>(['5', '4', '1']);\n\n const handleRemoveActiveFilter = (filterToRemove: string) => {\n const newActiveFilters = JSON.parse(JSON.stringify(activeFilters)).filter(\n (filter: string) => filter !== periodLabelToValue(filterToRemove)\n );\n\n setActiveFilters(() => newActiveFilters);\n action('onChange value:')(newActiveFilters);\n };\n\n const handlePeriodChange = (value: string[]) => {\n setActiveFilters([...value]);\n action('onChange value:')(value);\n };\n\n return (\n <div style={{ width: '15rem' }}>\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem', width: '100%', marginBottom: '1rem' }}>\n {activeFilters &&\n activeFilters.map((activeFilter, index) => (\n <Chip\n label={periodValueToLabel(activeFilter)}\n onDelete={handleRemoveActiveFilter}\n key={`${index}_${activeFilter}`}\n />\n ))}\n </div>\n <CheckboxTree\n title=\"Periode\"\n checkboxTree={MOCK_CHECKBOX_TREE}\n selectedValues={activeFilters}\n onChange={handlePeriodChange}\n />\n </div>\n );\n};\n"],"names":["createPeriodTree","periodIndices","numberOfPeriods","periodPerSemester","allPeriods","_","idx","periodValueToLabel","value","semester","period","periodTree","periodIndex","periods","currentPeriod","NUMBER_OF_PERIODS","PERIOD_PER_SEMESTER","MOCK_CHECKBOX_TREE","codeString","CheckboxTree_stories","CheckboxTree","Template","args","jsx","CheckboxTreeExample","fn","PERIOD_SEGMENT","periodLabelToValue","row","col","CheckboxTreeWithChips","activeFilters","setActiveFilters","useState","handleRemoveActiveFilter","filterToRemove","newActiveFilters","filter","action","handlePeriodChange","activeFilter","index","Chip"],"mappings":";;;;;;AAWA,MAAMA,IAAmB,CAACC,GAAyBC,GAAyBC,MAA8B;AACxG,QAAMC,IAAa,MAAM,KAAK,EAAE,QAAQF,EAAA,GAAmB,CAACG,GAAGC,MAAQA,IAAM,CAAC,GAExEC,IAAqB,CAACC,MAAkB;AAC5C,UAAMC,IAAW,KAAK,KAAK,SAASD,CAAK,IAAIL,CAAiB,GACxDO,IAASD,MAAaN,IAAoB,KAAK,IAAI,SAASK,CAAK,IAAIL,KAAqBA,CAAiB;AACjH,WAAO,GAAGM,CAAQ,GAAGC,CAAM;AAAA,EAC7B,GAEMC,IAAaP,EAAW,IAAI,CAACQ,OAAiB;AAAA,IAClD,UAAUL,EAAmB,OAAOK,CAAW,CAAC;AAAA,IAChD,WAAWA;AAAA,IACX,UAAU;AAAA,EAAA,EACV;AAmBF,SAjByBR,EAAW,OAAO,CAACS,GAASC,GAAeF,MAAgB;AAClF,UAAMH,IAAW,KAAK,KAAKK,IAAgBX,CAAiB;AAC5D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B,IAAM,KAAKF,KAAkBG,KAAO,EAAE;AACnD,GAEaC,IAAoD,MAAM;AACrE,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAmB,CAAC,KAAK,KAAK,GAAG,CAAC,GAEtEC,IAA2B,CAACC,MAA2B;AAC3D,UAAMC,IAAmB,KAAK,MAAM,KAAK,UAAUL,CAAa,CAAC,EAAE;AAAA,MACjE,CAACM,MAAmBA,MAAWV,EAAmBQ,CAAc;AAAA,IAAA;AAGlE,IAAAH,EAAiB,MAAMI,CAAgB,GACvCE,EAAO,iBAAiB,EAAEF,CAAgB;AAAA,EAC5C,GAEMG,IAAqB,CAAC/B,MAAoB;AAC9C,IAAAwB,EAAiB,CAAC,GAAGxB,CAAK,CAAC,GAC3B8B,EAAO,iBAAiB,EAAE9B,CAAK;AAAA,EACjC;AAEA,2BACG,OAAA,EAAI,OAAO,EAAE,OAAO,WACnB,UAAA;AAAA,IAAA,gBAAAe,EAAC,SAAI,OAAO,EAAE,SAAS,QAAQ,UAAU,QAAQ,KAAK,UAAU,OAAO,QAAQ,cAAc,UAC1F,UAAAQ,KACCA,EAAc,IAAI,CAACS,GAAcC,MAC/B,gBAAAlB;AAAA,MAACmB;AAAA,MAAA;AAAA,QACC,OAAOnC,EAAmBiC,CAAY;AAAA,QACtC,UAAUN;AAAA,MAAA;AAAA,MACL,GAAGO,CAAK,IAAID,CAAY;AAAA,IAAA,CAEhC,GACL;AAAA,IACA,gBAAAjB;AAAA,MAACH;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,cAAcH;AAAA,QACd,gBAAgBc;AAAA,QAChB,UAAUQ;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,GACF;AAEJ;"}
1
+ {"version":3,"file":"CheckboxTree.stories.js","sources":["../../../node_modules/storybook/dist/_browser-chunks/chunk-6XWLIJQL.js","../../../node_modules/storybook/dist/_browser-chunks/chunk-EUVGDK4H.js","../../../src/components/CheckboxTree/CheckboxTree.stories.tsx"],"sourcesContent":["// src/actions/constants.ts\nvar PARAM_KEY = \"actions\", ADDON_ID = \"storybook/actions\", PANEL_ID = `${ADDON_ID}/panel`, EVENT_ID = `${ADDON_ID}/action-event`, CLEAR_ID = `${ADDON_ID}/action-clear`, CYCLIC_KEY = \"$___storybook.isCyclic\";\n\nexport {\n PARAM_KEY,\n ADDON_ID,\n PANEL_ID,\n EVENT_ID,\n CLEAR_ID,\n CYCLIC_KEY\n};\n","import {\n EVENT_ID\n} from \"./chunk-6XWLIJQL.js\";\n\n// src/actions/runtime/configureActions.ts\nvar config = {\n depth: 10,\n clearOnStoryChange: !0,\n limit: 50\n}, configureActions = (options = {}) => {\n Object.assign(config, options);\n};\n\n// src/actions/runtime/action.ts\nimport { ImplicitActionsDuringRendering } from \"storybook/internal/preview-errors\";\nimport { global } from \"@storybook/global\";\nimport { addons } from \"storybook/preview-api\";\nvar findProto = (obj, callback) => {\n let proto = Object.getPrototypeOf(obj);\n return !proto || callback(proto) ? proto : findProto(proto, callback);\n}, isReactSyntheticEvent = (e) => !!(typeof e == \"object\" && e && findProto(e, (proto) => /^Synthetic(?:Base)?Event$/.test(proto.constructor.name)) && typeof e.persist == \"function\"), serializeArg = (a) => {\n if (isReactSyntheticEvent(a)) {\n let e = Object.create(\n a.constructor.prototype,\n Object.getOwnPropertyDescriptors(a)\n );\n e.persist();\n let viewDescriptor = Object.getOwnPropertyDescriptor(e, \"view\"), view = viewDescriptor?.value;\n return typeof view == \"object\" && view?.constructor.name === \"Window\" && Object.defineProperty(e, \"view\", {\n ...viewDescriptor,\n value: Object.create(view.constructor.prototype)\n }), e;\n }\n return a;\n};\nfunction action(name, options = {}) {\n let actionOptions = {\n ...config,\n ...options\n }, handler = function(...args) {\n if (options.implicit) {\n let storyRenderer = (\"__STORYBOOK_PREVIEW__\" in global ? global.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(\n (render) => render.phase === \"playing\" || render.phase === \"rendering\"\n );\n if (storyRenderer) {\n let deprecated = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, error = new ImplicitActionsDuringRendering({\n phase: storyRenderer.phase,\n name,\n deprecated\n });\n if (deprecated)\n console.warn(error);\n else\n throw error;\n }\n }\n let channel = addons.getChannel(), id = Date.now().toString(36) + Math.random().toString(36).substring(2), minDepth = 5, serializedArgs = args.map(serializeArg), normalizedArgs = args.length > 1 ? serializedArgs : serializedArgs[0], actionDisplayToEmit = {\n id,\n count: 0,\n data: { name, args: normalizedArgs },\n options: {\n ...actionOptions,\n maxDepth: minDepth + (actionOptions.depth || 3)\n }\n };\n channel.emit(EVENT_ID, actionDisplayToEmit);\n };\n return handler.isAction = !0, handler.implicit = options.implicit, handler;\n}\n\n// src/actions/runtime/actions.ts\nvar actions = (...args) => {\n let options = config, names = args;\n names.length === 1 && Array.isArray(names[0]) && ([names] = names), names.length !== 1 && typeof names[names.length - 1] != \"string\" && (options = {\n ...config,\n ...names.pop()\n });\n let namesObject = names[0];\n (names.length !== 1 || typeof namesObject == \"string\") && (namesObject = {}, names.forEach((name) => {\n namesObject[name] = name;\n }));\n let actionsObject = {};\n return Object.keys(namesObject).forEach((name) => {\n actionsObject[name] = action(namesObject[name], options);\n }), actionsObject;\n};\n\nexport {\n config,\n configureActions,\n action,\n actions\n};\n","import { fn } from 'storybook/test';\nimport { action } from 'storybook/actions';\nimport { useState } from 'react';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { CheckboxLeaf, CheckboxBranch, CheckboxTreeProps } from './CheckboxTree';\n\nimport { CheckboxTree } from './CheckboxTree';\n\nimport { Chip } from 'components/Chip';\n\nconst createPeriodTree = (periodIndices: string[], numberOfPeriods: number, periodPerSemester: number) => {\n const allPeriods = Array.from({ length: numberOfPeriods }, (_, idx) => idx + 1);\n\n const periodValueToLabel = (value: string) => {\n const semester = Math.ceil(parseInt(value) / periodPerSemester);\n const period = semester === periodPerSemester ? '' : `.${parseInt(value) % periodPerSemester || periodPerSemester}`;\n return `${semester}${period}`;\n };\n\n const periodTree = allPeriods.map((periodIndex) => ({\n itemName: periodValueToLabel(String(periodIndex)),\n itemValue: periodIndex,\n disabled: false,\n }));\n\n const periodTreeObject = allPeriods.reduce((periods, currentPeriod, periodIndex) => {\n const semester = Math.ceil(currentPeriod / periodPerSemester);\n if (periodIndices.includes(String(periodIndex + 1))) {\n if (!periods[semester]) {\n periods[semester] = {\n itemName: `Semester ${semester}`,\n children: [],\n };\n }\n periods[semester].children.push({\n ...periodTree[periodIndex],\n itemValue: String(periodTree[periodIndex].itemValue),\n } as CheckboxLeaf);\n }\n return periods;\n }, [] as CheckboxBranch[]);\n\n return periodTreeObject;\n};\n\nconst NUMBER_OF_PERIODS = 7;\nconst PERIOD_PER_SEMESTER = 3;\n\nconst MOCK_CHECKBOX_TREE = createPeriodTree(\n ['1', '2', '3', '4', '5', '6', '7'],\n NUMBER_OF_PERIODS,\n PERIOD_PER_SEMESTER\n);\n\nconst codeString = '<CheckboxTree title={} checkboxTree={} selectedValues={} 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 selectedValues: ['3', '4'],\n onChange: fn(),\n};\n\nconst PERIOD_SEGMENT = 3;\n\nconst periodValueToLabel = (value: string) => {\n const semester = Math.ceil(parseInt(value) / PERIOD_SEGMENT);\n const period = semester === PERIOD_SEGMENT ? '' : `.${parseInt(value) % PERIOD_SEGMENT || PERIOD_SEGMENT}`;\n return `${semester}${period}`;\n};\n\nconst periodLabelToValue = (value: string): string => {\n const [row, col] = value.split('.').map(Number);\n return `${(row - 1) * PERIOD_SEGMENT + (col || 1)}`;\n};\n\nexport const CheckboxTreeWithChips: StoryFn<CheckboxTreeProps> = () => {\n const [activeFilters, setActiveFilters] = useState<string[]>(['5', '4', '1']);\n\n const handleRemoveActiveFilter = (filterToRemove: string) => {\n const newActiveFilters = JSON.parse(JSON.stringify(activeFilters)).filter(\n (filter: string) => filter !== periodLabelToValue(filterToRemove)\n );\n\n setActiveFilters(() => newActiveFilters);\n action('onChange value:')(newActiveFilters);\n };\n\n const handlePeriodChange = (value: string[]) => {\n setActiveFilters([...value]);\n action('onChange value:')(value);\n };\n\n return (\n <div style={{ width: '15rem' }}>\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem', width: '100%', marginBottom: '1rem' }}>\n {activeFilters &&\n activeFilters.map((activeFilter, index) => (\n <Chip\n label={periodValueToLabel(activeFilter)}\n onDelete={handleRemoveActiveFilter}\n key={`${index}_${activeFilter}`}\n />\n ))}\n </div>\n <CheckboxTree\n title=\"Periode\"\n checkboxTree={MOCK_CHECKBOX_TREE}\n selectedValues={activeFilters}\n onChange={handlePeriodChange}\n />\n </div>\n );\n};\n"],"names":["ADDON_ID","EVENT_ID","config","findProto","obj","callback","proto","isReactSyntheticEvent","serializeArg","a","e","viewDescriptor","view","action","name","options","actionOptions","handler","args","storyRenderer","global","render","deprecated","error","ImplicitActionsDuringRendering","channel","addons","id","minDepth","serializedArgs","normalizedArgs","actionDisplayToEmit","createPeriodTree","periodIndices","numberOfPeriods","periodPerSemester","allPeriods","_","idx","periodValueToLabel","value","semester","period","periodTree","periodIndex","periods","currentPeriod","NUMBER_OF_PERIODS","PERIOD_PER_SEMESTER","MOCK_CHECKBOX_TREE","codeString","CheckboxTree_stories","CheckboxTree","Template","jsx","CheckboxTreeExample","fn","PERIOD_SEGMENT","periodLabelToValue","row","col","CheckboxTreeWithChips","activeFilters","setActiveFilters","useState","handleRemoveActiveFilter","filterToRemove","newActiveFilters","filter","handlePeriodChange","activeFilter","index","Chip"],"mappings":";;;;;;AACG,IAAwBA,IA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f as t } from "../../index-DRQMriwT.js";
2
+ import { f as t } from "../../index-B4NxQN5d.js";
3
3
  import { Chip as e } from "./Chip.js";
4
4
  const s = "<Chip label={string} onDelete={onDeleteFunction(label)}/>", b = {
5
5
  title: "Atoms/Chip",
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as l, Fragment as s } from "react/jsx-runtime";
2
- import { f as e } from "../../index-DRQMriwT.js";
2
+ import { f as e } from "../../index-B4NxQN5d.js";
3
3
  import { ControlsButton as t } from "./ControlsButton.js";
4
4
  import { Icons as a } from "../Icon/icons/index.js";
5
5
  import { Periods as i } from "../Periods/Periods.js";
@@ -1,6 +1,6 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import { OverlayProvider as p } from "@react-aria/overlays";
3
- import { f as m } from "../../index-DRQMriwT.js";
3
+ import { f as m } from "../../index-B4NxQN5d.js";
4
4
  import { useState as c } from "react";
5
5
  import { Drawer as r } from "./Drawer.js";
6
6
  import { Button as o } from "../Buttons/Button.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import "../../index-ApPj4mI1.js";
3
- import { r as s, s as e, f as r } from "../../react.esm-BjO203QT.js";
3
+ import { r as s, s as e, f as r } from "../../react.esm-BDo_tPxu.js";
4
4
  import { FeedbackBar as c } from "./FeedbackBar.js";
5
5
  describe("FeedbackBar", () => {
6
6
  it("should render with children text", () => {
@@ -16,9 +16,11 @@ export interface FormInputProps {
16
16
  notValidatedText?: string;
17
17
  /** Returns array of selected values as number */
18
18
  onChange?: (value: string) => void;
19
+ /** Sets max length for the standard input */
20
+ maxLength?: number;
19
21
  /** Determines if the container wrapper is rendered. */
20
22
  noContainer?: boolean;
21
23
  /** Optional custom input that will replace the default input */
22
24
  customInput?: ReactNode;
23
25
  }
24
- export declare const FormInput: ({ id, label, labelPosition, type, required, notValid, notValidatedText, onChange, noContainer, customInput, }: FormInputProps) => import("react/jsx-runtime").JSX.Element;
26
+ export declare const FormInput: ({ id, label, labelPosition, type, required, notValid, notValidatedText, onChange, maxLength, noContainer, customInput, }: FormInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,13 @@
1
- import { jsxs as c, Fragment as v, jsx as r } from "react/jsx-runtime";
2
- import { c as l } from "../../clsx-OuTLNxxd.js";
1
+ import { jsxs as l, Fragment as k, jsx as r } from "react/jsx-runtime";
2
+ import { c as f } from "../../clsx-OuTLNxxd.js";
3
3
  import "../Accordion/Accordion.js";
4
4
  import "react";
5
5
  import "../Buttons/Button.js";
6
6
  import "../Buttons/LinkButton.js";
7
7
  import "@react-aria/button";
8
8
  import "../Checkbox/Checkbox.js";
9
- import { Label as k } from "../Label/Label.js";
10
- import { FeedbackBox as g } from "../FeedbackBox/FeedbackBox.js";
9
+ import { Label as g } from "../Label/Label.js";
10
+ import { FeedbackBox as x } from "../FeedbackBox/FeedbackBox.js";
11
11
  import "@react-aria/dialog";
12
12
  import "@react-aria/focus";
13
13
  import "@react-aria/overlays";
@@ -17,7 +17,7 @@ import "../IconButton/IconButton.js";
17
17
  import "../Input/Input.js";
18
18
  import "../InputField/InputField.js";
19
19
  import "react-router";
20
- import "../../TablePlugin-CqCjNBW_.js";
20
+ import "../../TablePlugin-DmE96vN7.js";
21
21
  import "../RteEditor/Providers/LanguageProvider.js";
22
22
  import "../RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
23
23
  import "../RteEditor/hooks/components/Flyout.js";
@@ -37,41 +37,43 @@ import '../../assets/FormInput.css';const t = {
37
37
  "form-input__input-container": "_form-input__input-container_rt0pn_35",
38
38
  "form-input__input": "_form-input__input_rt0pn_25",
39
39
  "not-valid": "_not-valid_rt0pn_60"
40
- }, T = ({
40
+ }, V = ({
41
41
  id: o,
42
42
  label: i,
43
- labelPosition: f = "top",
43
+ labelPosition: u = "top",
44
44
  type: p = "text",
45
- required: u = !1,
46
- notValid: s = !1,
45
+ required: s = !1,
46
+ notValid: d = !1,
47
47
  notValidatedText: e = "",
48
48
  onChange: m,
49
- noContainer: d = !1,
50
- customInput: _
49
+ maxLength: _,
50
+ noContainer: b = !1,
51
+ customInput: a
51
52
  }) => {
52
- const b = (n) => ["e", "E", "+", "-"].includes(n.key) && n.preventDefault(), h = (n) => {
53
+ const h = (n) => ["e", "E", "+", "-"].includes(n.key) && n.preventDefault(), v = (n) => {
53
54
  typeof m == "function" && m(n.target.value);
54
- }, a = /* @__PURE__ */ c(v, { children: [
55
- i && /* @__PURE__ */ r(k, { htmlFor: o, required: u, alignRight: !0, children: i }),
56
- /* @__PURE__ */ c("div", { className: t["form-input__input-feedback-container"], children: [
57
- _ || /* @__PURE__ */ r("div", { className: t["form-input__input-container"], children: /* @__PURE__ */ r(
55
+ }, c = /* @__PURE__ */ l(k, { children: [
56
+ i && /* @__PURE__ */ r(g, { htmlFor: o, required: s, alignRight: !0, children: i }),
57
+ /* @__PURE__ */ l("div", { className: t["form-input__input-feedback-container"], children: [
58
+ a || /* @__PURE__ */ r("div", { className: t["form-input__input-container"], children: /* @__PURE__ */ r(
58
59
  "input",
59
60
  {
60
61
  id: o,
61
62
  type: p,
62
- ...p === "number" && { onKeyDown: b },
63
- onChange: h,
64
- className: l(t["form-input__input"], {
65
- [t["not-valid"]]: s
66
- })
63
+ ...p === "number" && { onKeyDown: h },
64
+ onChange: v,
65
+ className: f(t["form-input__input"], {
66
+ [t["not-valid"]]: d
67
+ }),
68
+ ..._ ? { maxLength: _ } : {}
67
69
  }
68
70
  ) }),
69
- e !== "" && /* @__PURE__ */ r(g, { level: "error", feedback: e })
71
+ e !== "" && /* @__PURE__ */ r(x, { level: "error", feedback: e })
70
72
  ] })
71
73
  ] });
72
- return d ? a : /* @__PURE__ */ r("div", { className: l(t["form-input__container"], t[`form-input__container--label-${f}`]), children: a });
74
+ return b ? c : /* @__PURE__ */ r("div", { className: f(t["form-input__container"], t[`form-input__container--label-${u}`]), children: c });
73
75
  };
74
76
  export {
75
- T as FormInput
77
+ V as FormInput
76
78
  };
77
79
  //# sourceMappingURL=FormInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormInput.js","sources":["../../../src/components/FormInput/FormInput.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { ReactNode } from 'react';\n\nimport styles from './FormInput.module.css';\n\nimport { FeedbackBox, Label } from 'components';\n\nexport interface FormInputProps {\n /** The id of the input element. */\n id: string;\n /** label text if empthy the label is not renderd */\n label: string;\n /** label position `top` or `left`. The default is `top`. */\n labelPosition?: 'top' | 'left';\n /** The type of the input element. */\n type?: 'text' | 'password' | 'email' | 'number';\n /** Shows red * */\n required?: boolean;\n /** `true` to color border red to show not valid; otherwise, `false`. */\n notValid?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange?: (value: string) => void;\n /** Determines if the container wrapper is rendered. */\n noContainer?: boolean;\n /** Optional custom input that will replace the default input */\n customInput?: ReactNode;\n}\n\nexport const FormInput = ({\n id,\n label,\n labelPosition = 'top',\n type = 'text',\n required = false,\n notValid = false,\n notValidatedText = '',\n onChange,\n noContainer = false,\n customInput,\n}: FormInputProps) => {\n const blockInvalidChar = (event: React.KeyboardEvent<HTMLInputElement>) =>\n ['e', 'E', '+', '-'].includes(event.key) && event.preventDefault();\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (typeof onChange === 'function') {\n onChange(event.target.value);\n }\n };\n\n const componentContent = (\n <>\n {label && (\n <Label htmlFor={id} required={required} alignRight>\n {label}\n </Label>\n )}\n\n <div className={styles['form-input__input-feedback-container']}>\n {customInput ? (\n customInput\n ) : (\n <div className={styles['form-input__input-container']}>\n <input\n id={id}\n type={type}\n {...(type === 'number' && { onKeyDown: blockInvalidChar })}\n onChange={handleChange}\n className={clsx(styles['form-input__input'], {\n [styles['not-valid']]: notValid,\n })}\n />\n </div>\n )}\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n </>\n );\n\n return noContainer ? (\n componentContent\n ) : (\n <div className={clsx(styles['form-input__container'], styles[`form-input__container--label-${labelPosition}`])}>\n {componentContent}\n </div>\n );\n};\n"],"names":["FormInput","id","label","labelPosition","type","required","notValid","notValidatedText","onChange","noContainer","customInput","blockInvalidChar","event","handleChange","componentContent","jsxs","Fragment","Label","styles","jsx","clsx","FeedbackBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BaA,IAAY,CAAC;AAAA,EACxB,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,kBAAAC,IAAmB;AAAA,EACnB,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,aAAAC;AACF,MAAsB;AACpB,QAAMC,IAAmB,CAACC,MACxB,CAAC,KAAK,KAAK,KAAK,GAAG,EAAE,SAASA,EAAM,GAAG,KAAKA,EAAM,eAAA,GAE9CC,IAAe,CAACD,MAA+C;AACnE,IAAI,OAAOJ,KAAa,cACtBA,EAASI,EAAM,OAAO,KAAK;AAAA,EAE/B,GAEME,IACJ,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAd,uBACEe,GAAA,EAAM,SAAShB,GAAI,UAAAI,GAAoB,YAAU,IAC/C,UAAAH,EAAA,CACH;AAAA,IAGF,gBAAAa,EAAC,OAAA,EAAI,WAAWG,EAAO,sCAAsC,GAC1D,UAAA;AAAA,MAAAR,KAGC,gBAAAS,EAAC,OAAA,EAAI,WAAWD,EAAO,6BAA6B,GAClD,UAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAAlB;AAAA,UACA,MAAAG;AAAA,UACC,GAAIA,MAAS,YAAY,EAAE,WAAWO,EAAA;AAAA,UACvC,UAAUE;AAAA,UACV,WAAWO,EAAKF,EAAO,mBAAmB,GAAG;AAAA,YAC3C,CAACA,EAAO,WAAW,CAAC,GAAGZ;AAAA,UAAA,CACxB;AAAA,QAAA;AAAA,MAAA,GAEL;AAAA,MAEDC,MAAqB,MAAM,gBAAAY,EAACE,KAAY,OAAM,SAAQ,UAAUd,EAAA,CAAkB;AAAA,IAAA,EAAA,CACrF;AAAA,EAAA,GACF;AAGF,SAAOE,IACLK,IAEA,gBAAAK,EAAC,OAAA,EAAI,WAAWC,EAAKF,EAAO,uBAAuB,GAAGA,EAAO,gCAAgCf,CAAa,EAAE,CAAC,GAC1G,UAAAW,GACH;AAEJ;"}
1
+ {"version":3,"file":"FormInput.js","sources":["../../../src/components/FormInput/FormInput.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { ReactNode } from 'react';\n\nimport styles from './FormInput.module.css';\n\nimport { FeedbackBox, Label } from 'components';\n\nexport interface FormInputProps {\n /** The id of the input element. */\n id: string;\n /** label text if empthy the label is not renderd */\n label: string;\n /** label position `top` or `left`. The default is `top`. */\n labelPosition?: 'top' | 'left';\n /** The type of the input element. */\n type?: 'text' | 'password' | 'email' | 'number';\n /** Shows red * */\n required?: boolean;\n /** `true` to color border red to show not valid; otherwise, `false`. */\n notValid?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange?: (value: string) => void;\n /** Sets max length for the standard input */\n maxLength?: number;\n /** Determines if the container wrapper is rendered. */\n noContainer?: boolean;\n /** Optional custom input that will replace the default input */\n customInput?: ReactNode;\n}\n\nexport const FormInput = ({\n id,\n label,\n labelPosition = 'top',\n type = 'text',\n required = false,\n notValid = false,\n notValidatedText = '',\n onChange,\n maxLength,\n noContainer = false,\n customInput,\n}: FormInputProps) => {\n const blockInvalidChar = (event: React.KeyboardEvent<HTMLInputElement>) =>\n ['e', 'E', '+', '-'].includes(event.key) && event.preventDefault();\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (typeof onChange === 'function') {\n onChange(event.target.value);\n }\n };\n\n const componentContent = (\n <>\n {label && (\n <Label htmlFor={id} required={required} alignRight>\n {label}\n </Label>\n )}\n\n <div className={styles['form-input__input-feedback-container']}>\n {customInput ? (\n customInput\n ) : (\n <div className={styles['form-input__input-container']}>\n <input\n id={id}\n type={type}\n {...(type === 'number' && { onKeyDown: blockInvalidChar })}\n onChange={handleChange}\n className={clsx(styles['form-input__input'], {\n [styles['not-valid']]: notValid,\n })}\n {...(maxLength ? { maxLength } : {})}\n />\n </div>\n )}\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n </>\n );\n\n return noContainer ? (\n componentContent\n ) : (\n <div className={clsx(styles['form-input__container'], styles[`form-input__container--label-${labelPosition}`])}>\n {componentContent}\n </div>\n );\n};\n"],"names":["FormInput","id","label","labelPosition","type","required","notValid","notValidatedText","onChange","maxLength","noContainer","customInput","blockInvalidChar","event","handleChange","componentContent","jsxs","Fragment","Label","styles","jsx","clsx","FeedbackBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCaA,IAAY,CAAC;AAAA,EACxB,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,kBAAAC,IAAmB;AAAA,EACnB,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,aAAAC;AACF,MAAsB;AACpB,QAAMC,IAAmB,CAACC,MACxB,CAAC,KAAK,KAAK,KAAK,GAAG,EAAE,SAASA,EAAM,GAAG,KAAKA,EAAM,eAAA,GAE9CC,IAAe,CAACD,MAA+C;AACnE,IAAI,OAAOL,KAAa,cACtBA,EAASK,EAAM,OAAO,KAAK;AAAA,EAE/B,GAEME,IACJ,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAf,uBACEgB,GAAA,EAAM,SAASjB,GAAI,UAAAI,GAAoB,YAAU,IAC/C,UAAAH,EAAA,CACH;AAAA,IAGF,gBAAAc,EAAC,OAAA,EAAI,WAAWG,EAAO,sCAAsC,GAC1D,UAAA;AAAA,MAAAR,KAGC,gBAAAS,EAAC,OAAA,EAAI,WAAWD,EAAO,6BAA6B,GAClD,UAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAAnB;AAAA,UACA,MAAAG;AAAA,UACC,GAAIA,MAAS,YAAY,EAAE,WAAWQ,EAAA;AAAA,UACvC,UAAUE;AAAA,UACV,WAAWO,EAAKF,EAAO,mBAAmB,GAAG;AAAA,YAC3C,CAACA,EAAO,WAAW,CAAC,GAAGb;AAAA,UAAA,CACxB;AAAA,UACA,GAAIG,IAAY,EAAE,WAAAA,MAAc,CAAA;AAAA,QAAC;AAAA,MAAA,GAEtC;AAAA,MAEDF,MAAqB,MAAM,gBAAAa,EAACE,KAAY,OAAM,SAAQ,UAAUf,EAAA,CAAkB;AAAA,IAAA,EAAA,CACrF;AAAA,EAAA,GACF;AAGF,SAAOG,IACLK,IAEA,gBAAAK,EAAC,OAAA,EAAI,WAAWC,EAAKF,EAAO,uBAAuB,GAAGA,EAAO,gCAAgChB,CAAa,EAAE,CAAC,GAC1G,UAAAY,GACH;AAEJ;"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { f as i } from "../../index-DRQMriwT.js";
2
+ import { f as i } from "../../index-B4NxQN5d.js";
3
3
  import { FormInput as a } from "./FormInput.js";
4
4
  import { SelectListbox as o } from "../SelectListbox/SelectListbox.js";
5
5
  const m = `
@@ -1,5 +1,5 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { f as r } from "../../index-DRQMriwT.js";
2
+ import { f as r } from "../../index-B4NxQN5d.js";
3
3
  import { IconButton as t } from "./IconButton.js";
4
4
  import { Icon as i } from "../Icon/Icon.js";
5
5
  const l = `<IconButton variant={variant} aria-label={aria-label} onClick={onClickFunction}>