@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
@@ -1,7 +1,7 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { useState as d, useRef as g } from "react";
3
- import { fn as i } from "../../index-MQ0yPLdl.js";
4
- import { InputField as l } from "./InputField.js";
3
+ import { fn as l } from "../../index-MQ0yPLdl.js";
4
+ import { InputField as a } from "./InputField.js";
5
5
  import { Container as u } from "../../storyComponents/Container/Container.js";
6
6
  import { Icon as f } from "../Icon/Icon.js";
7
7
  import "@react-aria/button";
@@ -26,7 +26,7 @@ const C = `
26
26
  return { ...t, variant: e.toString() };
27
27
  }, z = {
28
28
  title: "Atoms/InputField",
29
- component: l,
29
+ component: a,
30
30
  argTypes: {
31
31
  variant: {
32
32
  options: ["large"],
@@ -46,16 +46,17 @@ const C = `
46
46
  }
47
47
  },
48
48
  parameters: {
49
+ inspectComponent: a,
49
50
  codeString: C
50
51
  }
51
- }, a = (t) => {
52
- const [e, n] = d(""), p = g(null), s = (c) => {
53
- n(c.target.value), i()("handleChange");
52
+ }, o = (t) => {
53
+ const [e, i] = d(""), p = g(null), s = (c) => {
54
+ i(c.target.value), l()("handleChange");
54
55
  }, m = () => {
55
- n(""), i()("handleClear");
56
+ i(""), l()("handleClear");
56
57
  };
57
58
  return /* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(
58
- l,
59
+ a,
59
60
  {
60
61
  ...h(t),
61
62
  value: e,
@@ -64,22 +65,22 @@ const C = `
64
65
  ref: p
65
66
  }
66
67
  ) });
67
- }, o = {
68
+ }, n = {
68
69
  type: "text",
69
70
  variant: void 0,
70
71
  id: "4f9ca77d"
71
- }, v = a.bind({});
72
+ }, v = o.bind({});
72
73
  v.args = {
73
- ...o
74
+ ...n
74
75
  };
75
- const b = a.bind({});
76
+ const b = o.bind({});
76
77
  b.args = {
77
- ...o,
78
+ ...n,
78
79
  clearTrigger: "Clear"
79
80
  };
80
- const y = a.bind({});
81
+ const y = o.bind({});
81
82
  y.args = {
82
- ...o,
83
+ ...n,
83
84
  clearTrigger: /* @__PURE__ */ r(f, { name: "Cross" })
84
85
  };
85
86
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"InputField.stories.js","sources":["../../../src/components/InputField/InputField.stories.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { fn } from '@storybook/test';\n\nimport type { ChangeEvent } from 'react';\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { InputFieldProps } from './InputField';\n\nimport { InputField } from './InputField';\n\nimport { Container } from 'storyComponents/Container';\nimport { Icon } from 'components';\n\nconst codeString = `\n// Has all HTMLInputElement props available except \"className\" and \"style\" \n<InputField aria-labelledby={aria-labelledby} id={id} onChange={onChangeFunction}\n value={value} type={type} clearTrigger={clearTrigger} />\n`;\n\nconst transformArgs = (args: InputFieldProps) => {\n // args.variant is provided as an array because the control type is set to a checkbox. So this transforms the selected value into its proper value: a string\n const variantArray = (args.variant as unknown as string[]) ?? [];\n return { ...args, ...{ variant: variantArray.toString() } } as InputFieldProps;\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/InputField',\n component: InputField,\n argTypes: {\n variant: {\n options: ['large'],\n control: 'check',\n },\n type: {\n control: 'radio',\n options: ['text', 'password', 'email'],\n },\n id: {\n control: 'text',\n },\n autoComplete: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<InputFieldProps>;\n\nconst Template: StoryFn<InputFieldProps> = (args) => {\n const [inputValue, setInputValue] = useState<InputFieldProps['value']>('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setInputValue(event.target.value);\n fn()('handleChange');\n };\n\n const handleClear = () => {\n setInputValue('');\n fn()('handleClear');\n };\n\n return (\n <Container>\n <InputField\n {...transformArgs(args)}\n value={inputValue}\n onChange={handleChange}\n onClear={handleClear}\n ref={inputRef}\n />\n </Container>\n );\n};\n\nconst defaultArgs: Partial<InputFieldProps> = {\n type: 'text',\n variant: undefined,\n id: '4f9ca77d',\n};\n\nexport const InputFieldExample = Template.bind({});\nInputFieldExample.args = {\n ...defaultArgs,\n};\n\nexport const WithStringClearTrigger = Template.bind({});\nWithStringClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: 'Clear',\n};\n\nexport const WithIconClearTrigger = Template.bind({});\nWithIconClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: <Icon name=\"Cross\" />,\n};\n"],"names":["codeString","transformArgs","args","variantArray","InputField_stories","InputField","Template","inputValue","setInputValue","useState","inputRef","useRef","handleChange","event","fn","handleClear","Container","jsx","defaultArgs","InputFieldExample","WithStringClearTrigger","WithIconClearTrigger","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,MAAMA,IAAa;AAAA;AAAA;AAAA;AAAA,GAMbC,IAAgB,CAACC,MAA0B;AAEzC,QAAAC,IAAgBD,EAAK,WAAmC;AACvD,SAAA,EAAE,GAAGA,GAAW,SAASC,EAAa,SAAS;AACxD,GAGeC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,OAAO;AAAA,MACjB,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS,CAAC,QAAQ,YAAY,OAAO;AAAA,IACvC;AAAA,IACA,IAAI;AAAA,MACF,SAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,YAAAL;AAAA,EACF;AACF,GAEMM,IAAqC,CAACJ,MAAS;AACnD,QAAM,CAACK,GAAYC,CAAa,IAAIC,EAAmC,EAAE,GACnEC,IAAWC,EAAyB,IAAI,GAExCC,IAAe,CAACC,MAAyC;AAC/C,IAAAL,EAAAK,EAAM,OAAO,KAAK,GAChCC,EAAA,EAAK,cAAc;AAAA,EAAA,GAGfC,IAAc,MAAM;AACxB,IAAAP,EAAc,EAAE,GAChBM,EAAA,EAAK,aAAa;AAAA,EAAA;AAGpB,2BACGE,GACC,EAAA,UAAA,gBAAAC;AAAA,IAACZ;AAAA,IAAA;AAAA,MACE,GAAGJ,EAAcC,CAAI;AAAA,MACtB,OAAOK;AAAA,MACP,UAAUK;AAAA,MACV,SAASG;AAAA,MACT,KAAKL;AAAA,IAAA;AAAA,EAET,EAAA,CAAA;AAEJ,GAEMQ,IAAwC;AAAA,EAC5C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,IAAI;AACN,GAEaC,IAAoBb,EAAS,KAAK,EAAE;AACjDa,EAAkB,OAAO;AAAA,EACvB,GAAGD;AACL;AAEO,MAAME,IAAyBd,EAAS,KAAK,EAAE;AACtDc,EAAuB,OAAO;AAAA,EAC5B,GAAGF;AAAA,EACH,cAAc;AAChB;AAEO,MAAMG,IAAuBf,EAAS,KAAK,EAAE;AACpDe,EAAqB,OAAO;AAAA,EAC1B,GAAGH;AAAA,EACH,cAAc,gBAAAD,EAACK,GAAK,EAAA,MAAK,QAAQ,CAAA;AACnC;"}
1
+ {"version":3,"file":"InputField.stories.js","sources":["../../../src/components/InputField/InputField.stories.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { fn } from '@storybook/test';\n\nimport type { ChangeEvent } from 'react';\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { InputFieldProps } from './InputField';\n\nimport { InputField } from './InputField';\n\nimport { Container } from 'storyComponents/Container';\nimport { Icon } from 'components';\n\nconst codeString = `\n// Has all HTMLInputElement props available except \"className\" and \"style\" \n<InputField aria-labelledby={aria-labelledby} id={id} onChange={onChangeFunction}\n value={value} type={type} clearTrigger={clearTrigger} />\n`;\n\nconst transformArgs = (args: InputFieldProps) => {\n // args.variant is provided as an array because the control type is set to a checkbox. So this transforms the selected value into its proper value: a string\n const variantArray = (args.variant as unknown as string[]) ?? [];\n return { ...args, ...{ variant: variantArray.toString() } } as InputFieldProps;\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/InputField',\n component: InputField,\n argTypes: {\n variant: {\n options: ['large'],\n control: 'check',\n },\n type: {\n control: 'radio',\n options: ['text', 'password', 'email'],\n },\n id: {\n control: 'text',\n },\n autoComplete: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: InputField,\n codeString: codeString,\n },\n} as Meta<InputFieldProps>;\n\nconst Template: StoryFn<InputFieldProps> = (args) => {\n const [inputValue, setInputValue] = useState<InputFieldProps['value']>('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setInputValue(event.target.value);\n fn()('handleChange');\n };\n\n const handleClear = () => {\n setInputValue('');\n fn()('handleClear');\n };\n\n return (\n <Container>\n <InputField\n {...transformArgs(args)}\n value={inputValue}\n onChange={handleChange}\n onClear={handleClear}\n ref={inputRef}\n />\n </Container>\n );\n};\n\nconst defaultArgs: Partial<InputFieldProps> = {\n type: 'text',\n variant: undefined,\n id: '4f9ca77d',\n};\n\nexport const InputFieldExample = Template.bind({});\nInputFieldExample.args = {\n ...defaultArgs,\n};\n\nexport const WithStringClearTrigger = Template.bind({});\nWithStringClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: 'Clear',\n};\n\nexport const WithIconClearTrigger = Template.bind({});\nWithIconClearTrigger.args = {\n ...defaultArgs,\n clearTrigger: <Icon name=\"Cross\" />,\n};\n"],"names":["codeString","transformArgs","args","variantArray","InputField_stories","InputField","Template","inputValue","setInputValue","useState","inputRef","useRef","handleChange","event","fn","handleClear","Container","jsx","defaultArgs","InputFieldExample","WithStringClearTrigger","WithIconClearTrigger","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,MAAMA,IAAa;AAAA;AAAA;AAAA;AAAA,GAMbC,IAAgB,CAACC,MAA0B;AAEzC,QAAAC,IAAgBD,EAAK,WAAmC;AACvD,SAAA,EAAE,GAAGA,GAAW,SAASC,EAAa,SAAS;AACxD,GAGeC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,OAAO;AAAA,MACjB,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS,CAAC,QAAQ,YAAY,OAAO;AAAA,IACvC;AAAA,IACA,IAAI;AAAA,MACF,SAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAL;AAAA,EACF;AACF,GAEMM,IAAqC,CAACJ,MAAS;AACnD,QAAM,CAACK,GAAYC,CAAa,IAAIC,EAAmC,EAAE,GACnEC,IAAWC,EAAyB,IAAI,GAExCC,IAAe,CAACC,MAAyC;AAC/C,IAAAL,EAAAK,EAAM,OAAO,KAAK,GAChCC,EAAA,EAAK,cAAc;AAAA,EAAA,GAGfC,IAAc,MAAM;AACxB,IAAAP,EAAc,EAAE,GAChBM,EAAA,EAAK,aAAa;AAAA,EAAA;AAGpB,2BACGE,GACC,EAAA,UAAA,gBAAAC;AAAA,IAACZ;AAAA,IAAA;AAAA,MACE,GAAGJ,EAAcC,CAAI;AAAA,MACtB,OAAOK;AAAA,MACP,UAAUK;AAAA,MACV,SAASG;AAAA,MACT,KAAKL;AAAA,IAAA;AAAA,EAET,EAAA,CAAA;AAEJ,GAEMQ,IAAwC;AAAA,EAC5C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,IAAI;AACN,GAEaC,IAAoBb,EAAS,KAAK,EAAE;AACjDa,EAAkB,OAAO;AAAA,EACvB,GAAGD;AACL;AAEO,MAAME,IAAyBd,EAAS,KAAK,EAAE;AACtDc,EAAuB,OAAO;AAAA,EAC5B,GAAGF;AAAA,EACH,cAAc;AAChB;AAEO,MAAMG,IAAuBf,EAAS,KAAK,EAAE;AACpDe,EAAqB,OAAO;AAAA,EAC1B,GAAGH;AAAA,EACH,cAAc,gBAAAD,EAACK,GAAK,EAAA,MAAK,QAAQ,CAAA;AACnC;"}
@@ -1,6 +1,11 @@
1
1
  import { LabelHTMLAttributes } from 'react';
2
2
  export interface LabelProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'className' | 'style'> {
3
+ /** The id of the element for which the label is intended. */
3
4
  htmlFor: string;
5
+ /** `true` if the font-weight needs to be unset; otherwise, `false`. The default is `false`. */
4
6
  noFontWeight?: boolean;
7
+ /** `true` to show an asterisk to indicate an item is required; otherwise, `false`. */
8
+ required?: boolean;
5
9
  }
6
- export declare const Label: ({ children, htmlFor, noFontWeight, ...restProps }: LabelProps) => import("react/jsx-runtime").JSX.Element;
10
+ /** Represents a component that renders a label for an input element. */
11
+ export declare const Label: ({ children, htmlFor, noFontWeight, required, ...restProps }: LabelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,20 +1,22 @@
1
1
  import { jsx as b } from "react/jsx-runtime";
2
- import { c as o } from "../../clsx-OuTLNxxd.js";
3
- import '../../assets/Label.css';const n = "_label_1b4r9_1", l = {
2
+ import { c as r } from "../../clsx-OuTLNxxd.js";
3
+ import '../../assets/Label.css';const n = "_label_ok9qo_1", e = {
4
4
  label: n,
5
- "label--unset-font-weight": "_label--unset-font-weight_1b4r9_6"
6
- }, _ = ({ children: e, htmlFor: t, noFontWeight: s, ...a }) => /* @__PURE__ */ b(
5
+ "label--required": "_label--required_ok9qo_6",
6
+ "label--unset-font-weight": "_label--unset-font-weight_ok9qo_14"
7
+ }, c = ({ children: l, htmlFor: o, noFontWeight: a, required: t = !1, ...s }) => /* @__PURE__ */ b(
7
8
  "label",
8
9
  {
9
- ...a,
10
- htmlFor: t,
11
- className: o(l.label, {
12
- [l["label--unset-font-weight"]]: s
10
+ ...s,
11
+ htmlFor: o,
12
+ className: r(e.label, {
13
+ [e["label--unset-font-weight"]]: a,
14
+ [e["label--required"]]: t
13
15
  }),
14
- children: e
16
+ children: l
15
17
  }
16
18
  );
17
19
  export {
18
- _ as Label
20
+ c as Label
19
21
  };
20
22
  //# sourceMappingURL=Label.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sources":["../../../src/components/Label/Label.tsx"],"sourcesContent":["import clsx from 'clsx';\n\nimport type { LabelHTMLAttributes } from 'react';\n\nimport styles from './Label.module.css';\n\nexport interface LabelProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'className' | 'style'> {\n htmlFor: string;\n noFontWeight?: boolean;\n}\n\nexport const Label = ({ children, htmlFor, noFontWeight, ...restProps }: LabelProps) => (\n <label\n {...restProps}\n htmlFor={htmlFor}\n className={clsx(styles['label'], {\n [styles['label--unset-font-weight']]: noFontWeight,\n })}\n >\n {children}\n </label>\n);\n"],"names":["Label","children","htmlFor","noFontWeight","restProps","jsx","clsx","styles"],"mappings":";;;;;GAWaA,IAAQ,CAAC,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,GAAc,GAAGC,QAC1D,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACE,GAAGD;AAAA,IACJ,SAAAF;AAAA,IACA,WAAWI,EAAKC,EAAO,OAAU;AAAA,MAC/B,CAACA,EAAO,0BAA0B,CAAC,GAAGJ;AAAA,IAAA,CACvC;AAAA,IAEA,UAAAF;AAAA,EAAA;AACH;"}
1
+ {"version":3,"file":"Label.js","sources":["../../../src/components/Label/Label.tsx"],"sourcesContent":["import clsx from 'clsx';\n\nimport type { LabelHTMLAttributes } from 'react';\n\nimport styles from './Label.module.css';\n\nexport interface LabelProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'className' | 'style'> {\n /** The id of the element for which the label is intended. */\n htmlFor: string;\n /** `true` if the font-weight needs to be unset; otherwise, `false`. The default is `false`. */\n noFontWeight?: boolean;\n /** `true` to show an asterisk to indicate an item is required; otherwise, `false`. */\n required?: boolean;\n}\n\n/** Represents a component that renders a label for an input element. */\nexport const Label = ({ children, htmlFor, noFontWeight, required = false, ...restProps }: LabelProps) => (\n <label\n {...restProps}\n htmlFor={htmlFor}\n className={clsx(styles['label'], {\n [styles['label--unset-font-weight']]: noFontWeight,\n [styles['label--required']]: required,\n })}\n >\n {children}\n </label>\n);\n"],"names":["Label","children","htmlFor","noFontWeight","required","restProps","jsx","clsx","styles"],"mappings":";;;;;;GAgBaA,IAAQ,CAAC,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,GAAc,UAAAC,IAAW,IAAO,GAAGC,EAAA,MAC5E,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACE,GAAGD;AAAA,IACJ,SAAAH;AAAA,IACA,WAAWK,EAAKC,EAAO,OAAU;AAAA,MAC/B,CAACA,EAAO,0BAA0B,CAAC,GAAGL;AAAA,MACtC,CAACK,EAAO,iBAAiB,CAAC,GAAGJ;AAAA,IAAA,CAC9B;AAAA,IAEA,UAAAH;AAAA,EAAA;AACH;"}
@@ -15,6 +15,7 @@ const a = `
15
15
  }
16
16
  },
17
17
  parameters: {
18
+ inspectComponent: t,
18
19
  codeString: a
19
20
  }
20
21
  }, e = (l) => /* @__PURE__ */ r(t, { ...l }), o = {
@@ -1 +1 @@
1
- {"version":3,"file":"Label.stories.js","sources":["../../../src/components/Label/Label.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { LabelProps } from './Label';\n\nimport { Label } from './Label';\n\nconst codeString = `\n// Has all LabelHTMLAttributes props available except \"className\" and \"style\" \n <Label htmlFor={htmlFor}>{children}</Label>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Label',\n component: Label,\n argTypes: {\n htmlFor: {\n control: 'text',\n },\n children: {\n control: 'text',\n },\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<LabelProps>;\n\nconst Template: StoryFn<LabelProps> = (args) => <Label {...args} />;\n\nconst defaultArgs: Partial<LabelProps> = {\n children: 'Lorem Ipsum',\n htmlFor: 'bd79f7ec',\n};\n\nexport const LabelExample = Template.bind({});\nLabelExample.args = {\n ...defaultArgs,\n};\n\nexport const WithNoFontWeight = Template.bind({});\nWithNoFontWeight.args = {\n ...defaultArgs,\n noFontWeight: true,\n};\n"],"names":["codeString","Label_stories","Label","Template","args","jsx","defaultArgs","LabelExample","WithNoFontWeight"],"mappings":";;AAKA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAgC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAO,GAAGE,EAAM,CAAA,GAE3DE,IAAmC;AAAA,EACvC,UAAU;AAAA,EACV,SAAS;AACX,GAEaC,IAAeJ,EAAS,KAAK,EAAE;AAC5CI,EAAa,OAAO;AAAA,EAClB,GAAGD;AACL;AAEO,MAAME,IAAmBL,EAAS,KAAK,EAAE;AAChDK,EAAiB,OAAO;AAAA,EACtB,GAAGF;AAAA,EACH,cAAc;AAChB;"}
1
+ {"version":3,"file":"Label.stories.js","sources":["../../../src/components/Label/Label.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { LabelProps } from './Label';\n\nimport { Label } from './Label';\n\nconst codeString = `\n// Has all LabelHTMLAttributes props available except \"className\" and \"style\" \n <Label htmlFor={htmlFor}>{children}</Label>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Label',\n component: Label,\n argTypes: {\n htmlFor: {\n control: 'text',\n },\n children: {\n control: 'text',\n },\n },\n parameters: {\n inspectComponent: Label,\n codeString: codeString,\n },\n} as Meta<LabelProps>;\n\nconst Template: StoryFn<LabelProps> = (args) => <Label {...args} />;\n\nconst defaultArgs: Partial<LabelProps> = {\n children: 'Lorem Ipsum',\n htmlFor: 'bd79f7ec',\n};\n\nexport const LabelExample = Template.bind({});\nLabelExample.args = {\n ...defaultArgs,\n};\n\nexport const WithNoFontWeight = Template.bind({});\nWithNoFontWeight.args = {\n ...defaultArgs,\n noFontWeight: true,\n};\n"],"names":["codeString","Label_stories","Label","Template","args","jsx","defaultArgs","LabelExample","WithNoFontWeight"],"mappings":";;AAKA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAgC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAO,GAAGE,EAAM,CAAA,GAE3DE,IAAmC;AAAA,EACvC,UAAU;AAAA,EACV,SAAS;AACX,GAEaC,IAAeJ,EAAS,KAAK,EAAE;AAC5CI,EAAa,OAAO;AAAA,EAClB,GAAGD;AACL;AAEO,MAAME,IAAmBL,EAAS,KAAK,EAAE;AAChDK,EAAiB,OAAO;AAAA,EACtB,GAAGF;AAAA,EACH,cAAc;AAChB;"}
@@ -4,8 +4,12 @@ import { MouseEvent, RefObject } from 'react';
4
4
  import { UIButtonVariant } from 'types/UserInterface';
5
5
  export interface MenuButtonProps extends AriaButtonProps<'button'> {
6
6
  buttonRef: RefObject<HTMLButtonElement>;
7
+ /** The variant of the button. */
7
8
  variant: UIButtonVariant;
9
+ /** The icon to show. */
8
10
  iconName?: IconProps['name'];
11
+ /** The callback function that is invoked when the button is clicked. */
9
12
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
10
13
  }
14
+ /** Represents a button that is used to open a menu. */
11
15
  export declare function MenuButton({ buttonRef, variant, iconName, children, ...restProps }: MenuButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { jsxs as e, jsx as p } from "react/jsx-runtime";
2
2
  import { useButton as c } from "@react-aria/button";
3
3
  import { c as f } from "../../clsx-OuTLNxxd.js";
4
- import { s as r } from "../../Button.module-Gr3KvBvb.js";
5
4
  import { Icon as i } from "../Icon/Icon.js";
5
+ import { s as r } from "../../Button.module-Gr3KvBvb.js";
6
6
  function B({ buttonRef: t, variant: s, iconName: o, children: n, ...m }) {
7
7
  const { buttonProps: u } = c(m, t);
8
8
  return /* @__PURE__ */ e("button", { ...u, ref: t, className: f(r.button, r[`button--${s}`]), children: [
@@ -1 +1 @@
1
- {"version":3,"file":"MenuButton.js","sources":["../../../src/components/MenuButton/MenuButton.tsx"],"sourcesContent":["import { useButton } from '@react-aria/button';\nimport { clsx } from 'clsx';\n\nimport type { AriaButtonProps } from '@react-aria/button';\nimport type { IconProps } from 'components/Icon';\nimport type { MouseEvent, RefObject } from 'react';\nimport type { UIButtonVariant } from 'types/UserInterface';\n\nimport styles from 'components/Button/Button.module.css';\nimport { Icon } from 'components/Icon';\n\nexport interface MenuButtonProps extends AriaButtonProps<'button'> {\n buttonRef: RefObject<HTMLButtonElement>;\n variant: UIButtonVariant;\n iconName?: IconProps['name'];\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n}\n\nexport function MenuButton({ buttonRef, variant, iconName, children, ...restProps }: MenuButtonProps) {\n const { buttonProps } = useButton(restProps, buttonRef);\n\n return (\n <button {...buttonProps} ref={buttonRef} className={clsx(styles['button'], styles[`button--${variant}`])}>\n {children}\n {iconName && <Icon name={iconName} />}\n </button>\n );\n}\n"],"names":["MenuButton","buttonRef","variant","iconName","children","restProps","buttonProps","useButton","clsx","styles","jsx","Icon"],"mappings":";;;;;AAkBgB,SAAAA,EAAW,EAAE,WAAAC,GAAW,SAAAC,GAAS,UAAAC,GAAU,UAAAC,GAAU,GAAGC,KAA8B;AACpG,QAAM,EAAE,aAAAC,EAAgB,IAAAC,EAAUF,GAAWJ,CAAS;AAEtD,2BACG,UAAQ,EAAA,GAAGK,GAAa,KAAKL,GAAW,WAAWO,EAAKC,EAAO,QAAWA,EAAO,WAAWP,CAAO,EAAE,CAAC,GACpG,UAAA;AAAA,IAAAE;AAAA,IACAD,KAAY,gBAAAO,EAACC,GAAK,EAAA,MAAMR,EAAU,CAAA;AAAA,EACrC,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"MenuButton.js","sources":["../../../src/components/MenuButton/MenuButton.tsx"],"sourcesContent":["import { useButton } from '@react-aria/button';\nimport { clsx } from 'clsx';\n\nimport type { AriaButtonProps } from '@react-aria/button';\nimport type { IconProps } from 'components/Icon';\nimport type { MouseEvent, RefObject } from 'react';\nimport type { UIButtonVariant } from 'types/UserInterface';\n\nimport { Icon } from 'components/Icon';\nimport styles from 'components/Button/Button.module.css';\n\nexport interface MenuButtonProps extends AriaButtonProps<'button'> {\n buttonRef: RefObject<HTMLButtonElement>;\n /** The variant of the button. */\n variant: UIButtonVariant;\n /** The icon to show. */\n iconName?: IconProps['name'];\n /** The callback function that is invoked when the button is clicked. */\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n}\n\n/** Represents a button that is used to open a menu. */\nexport function MenuButton({ buttonRef, variant, iconName, children, ...restProps }: MenuButtonProps) {\n const { buttonProps } = useButton(restProps, buttonRef);\n\n return (\n <button {...buttonProps} ref={buttonRef} className={clsx(styles['button'], styles[`button--${variant}`])}>\n {children}\n {iconName && <Icon name={iconName} />}\n </button>\n );\n}\n"],"names":["MenuButton","buttonRef","variant","iconName","children","restProps","buttonProps","useButton","clsx","styles","jsx","Icon"],"mappings":";;;;;AAsBgB,SAAAA,EAAW,EAAE,WAAAC,GAAW,SAAAC,GAAS,UAAAC,GAAU,UAAAC,GAAU,GAAGC,KAA8B;AACpG,QAAM,EAAE,aAAAC,EAAgB,IAAAC,EAAUF,GAAWJ,CAAS;AAEtD,2BACG,UAAQ,EAAA,GAAGK,GAAa,KAAKL,GAAW,WAAWO,EAAKC,EAAO,QAAWA,EAAO,WAAWP,CAAO,EAAE,CAAC,GACpG,UAAA;AAAA,IAAAE;AAAA,IACAD,KAAY,gBAAAO,EAACC,GAAK,EAAA,MAAMR,EAAU,CAAA;AAAA,EACrC,EAAA,CAAA;AAEJ;"}
@@ -1,12 +1,12 @@
1
- import { jsxs as l, Fragment as s, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as s, Fragment as l, jsx as n } from "react/jsx-runtime";
2
2
  import { fn as c } from "../../index-MQ0yPLdl.js";
3
- import { MenuButton as a } from "./MenuButton.js";
3
+ import { MenuButton as e } from "./MenuButton.js";
4
4
  const d = `
5
5
  // Has all LabelHTMLAttributes props available except "className" and "style"
6
6
  <MenuButton variant={variant} onClick={onClickFunction} onKeyDown={onKeyDown} onKeyUp={onKeyUp} buttonRef={buttonRef}>{children}</MenuButton>
7
7
  `, b = {
8
8
  title: "Atoms/MenuButton",
9
- component: a,
9
+ component: e,
10
10
  argTypes: {
11
11
  variant: {
12
12
  options: ["primary", "secondary", "destructive-primary", "destructive-secondary", "blank", "blank-icon"],
@@ -14,23 +14,24 @@ const d = `
14
14
  }
15
15
  },
16
16
  parameters: {
17
+ inspectComponent: e,
17
18
  codeString: d
18
19
  }
19
- }, r = (o) => /* @__PURE__ */ n(a, { ...o }), i = {
20
+ }, r = (a) => /* @__PURE__ */ n(e, { ...a }), o = {
20
21
  variant: "primary",
21
22
  onClick: c()
22
23
  }, p = r.bind({});
23
24
  p.args = {
24
25
  children: "Click me!",
25
- ...i
26
+ ...o
26
27
  };
27
- const e = r.bind({});
28
- e.args = {
29
- ...i,
28
+ const t = r.bind({});
29
+ t.args = {
30
+ ...o,
30
31
  iconName: "EllipsisVertical"
31
32
  };
32
- e.argTypes = {
33
- ...e.argTypes,
33
+ t.argTypes = {
34
+ ...t.argTypes,
34
35
  children: {
35
36
  table: {
36
37
  disable: !0
@@ -38,16 +39,16 @@ e.argTypes = {
38
39
  }
39
40
  }
40
41
  };
41
- const t = r.bind({});
42
- t.args = {
43
- ...i,
44
- children: /* @__PURE__ */ l(s, { children: [
42
+ const i = r.bind({});
43
+ i.args = {
44
+ ...o,
45
+ children: /* @__PURE__ */ s(l, { children: [
45
46
  /* @__PURE__ */ n("div", { children: "Child 1" }),
46
47
  /* @__PURE__ */ n("div", { children: "Child 2" })
47
48
  ] })
48
49
  };
49
- t.argTypes = {
50
- ...t.argTypes,
50
+ i.argTypes = {
51
+ ...i.argTypes,
51
52
  children: {
52
53
  table: {
53
54
  disable: !0
@@ -57,8 +58,8 @@ t.argTypes = {
57
58
  };
58
59
  export {
59
60
  p as MenuButtonExample,
60
- e as WithIconChildren,
61
- t as WithMultipleChildren,
61
+ t as WithIconChildren,
62
+ i as WithMultipleChildren,
62
63
  b as default
63
64
  };
64
65
  //# sourceMappingURL=MenuButton.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuButton.stories.js","sources":["../../../src/components/MenuButton/MenuButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { MenuButtonProps } from './MenuButton';\n\nimport { MenuButton } from './MenuButton';\n\nconst codeString = `\n// Has all LabelHTMLAttributes props available except \"className\" and \"style\" \n <MenuButton variant={variant} onClick={onClickFunction} onKeyDown={onKeyDown} onKeyUp={onKeyUp} buttonRef={buttonRef}>{children}</MenuButton>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/MenuButton',\n component: MenuButton,\n argTypes: {\n variant: {\n options: ['primary', 'secondary', 'destructive-primary', 'destructive-secondary', 'blank', 'blank-icon'],\n control: { type: 'radio' },\n },\n },\n parameters: {\n codeString: codeString,\n },\n} as Meta<MenuButtonProps>;\n\nconst Template: StoryFn<MenuButtonProps> = (args) => <MenuButton {...args} />;\n\nconst defaultArgs: Partial<MenuButtonProps> = {\n variant: 'primary',\n onClick: fn(),\n};\n\nexport const MenuButtonExample = Template.bind({});\nMenuButtonExample.args = {\n children: 'Click me!',\n ...defaultArgs,\n};\n\nexport const WithIconChildren = Template.bind({});\nWithIconChildren.args = {\n ...defaultArgs,\n iconName: 'EllipsisVertical',\n};\n\nWithIconChildren.argTypes = {\n ...WithIconChildren.argTypes,\n children: {\n table: {\n disable: true, // Disable children controls for this specific story\n },\n },\n};\n\nexport const WithMultipleChildren = Template.bind({});\nWithMultipleChildren.args = {\n ...defaultArgs,\n children: (\n <>\n <div>Child 1</div>\n <div>Child 2</div>\n </>\n ),\n};\n\nWithMultipleChildren.argTypes = {\n ...WithMultipleChildren.argTypes,\n children: {\n table: {\n disable: true, // Disable children controls for this specific story\n },\n },\n};\n"],"names":["codeString","MenuButton_stories","MenuButton","Template","args","jsx","defaultArgs","fn","MenuButtonExample","WithIconChildren","WithMultipleChildren","jsxs","Fragment"],"mappings":";;;AAOA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,WAAW,aAAa,uBAAuB,yBAAyB,SAAS,YAAY;AAAA,MACvG,SAAS,EAAE,MAAM,QAAQ;AAAA,IAC3B;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAqC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAY,GAAGE,EAAM,CAAA,GAErEE,IAAwC;AAAA,EAC5C,SAAS;AAAA,EACT,SAASC,EAAG;AACd,GAEaC,IAAoBL,EAAS,KAAK,EAAE;AACjDK,EAAkB,OAAO;AAAA,EACvB,UAAU;AAAA,EACV,GAAGF;AACL;AAEO,MAAMG,IAAmBN,EAAS,KAAK,EAAE;AAChDM,EAAiB,OAAO;AAAA,EACtB,GAAGH;AAAA,EACH,UAAU;AACZ;AAEAG,EAAiB,WAAW;AAAA,EAC1B,GAAGA,EAAiB;AAAA,EACpB,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA;AAAA,IACX;AAAA,EACF;AACF;AAEO,MAAMC,IAAuBP,EAAS,KAAK,EAAE;AACpDO,EAAqB,OAAO;AAAA,EAC1B,GAAGJ;AAAA,EACH,UAEI,gBAAAK,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAP,EAAC,SAAI,UAAO,UAAA,CAAA;AAAA,IACZ,gBAAAA,EAAC,SAAI,UAAO,UAAA,CAAA;AAAA,EAAA,GACd;AAEJ;AAEAK,EAAqB,WAAW;AAAA,EAC9B,GAAGA,EAAqB;AAAA,EACxB,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA;AAAA,IACX;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"MenuButton.stories.js","sources":["../../../src/components/MenuButton/MenuButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { MenuButtonProps } from './MenuButton';\n\nimport { MenuButton } from './MenuButton';\n\nconst codeString = `\n// Has all LabelHTMLAttributes props available except \"className\" and \"style\" \n <MenuButton variant={variant} onClick={onClickFunction} onKeyDown={onKeyDown} onKeyUp={onKeyUp} buttonRef={buttonRef}>{children}</MenuButton>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/MenuButton',\n component: MenuButton,\n argTypes: {\n variant: {\n options: ['primary', 'secondary', 'destructive-primary', 'destructive-secondary', 'blank', 'blank-icon'],\n control: { type: 'radio' },\n },\n },\n parameters: {\n inspectComponent: MenuButton,\n codeString: codeString,\n },\n} as Meta<MenuButtonProps>;\n\nconst Template: StoryFn<MenuButtonProps> = (args) => <MenuButton {...args} />;\n\nconst defaultArgs: Partial<MenuButtonProps> = {\n variant: 'primary',\n onClick: fn(),\n};\n\nexport const MenuButtonExample = Template.bind({});\nMenuButtonExample.args = {\n children: 'Click me!',\n ...defaultArgs,\n};\n\nexport const WithIconChildren = Template.bind({});\nWithIconChildren.args = {\n ...defaultArgs,\n iconName: 'EllipsisVertical',\n};\n\nWithIconChildren.argTypes = {\n ...WithIconChildren.argTypes,\n children: {\n table: {\n disable: true, // Disable children controls for this specific story\n },\n },\n};\n\nexport const WithMultipleChildren = Template.bind({});\nWithMultipleChildren.args = {\n ...defaultArgs,\n children: (\n <>\n <div>Child 1</div>\n <div>Child 2</div>\n </>\n ),\n};\n\nWithMultipleChildren.argTypes = {\n ...WithMultipleChildren.argTypes,\n children: {\n table: {\n disable: true, // Disable children controls for this specific story\n },\n },\n};\n"],"names":["codeString","MenuButton_stories","MenuButton","Template","args","jsx","defaultArgs","fn","MenuButtonExample","WithIconChildren","WithMultipleChildren","jsxs","Fragment"],"mappings":";;;AAOA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,WAAW,aAAa,uBAAuB,yBAAyB,SAAS,YAAY;AAAA,MACvG,SAAS,EAAE,MAAM,QAAQ;AAAA,IAC3B;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAqC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAY,GAAGE,EAAM,CAAA,GAErEE,IAAwC;AAAA,EAC5C,SAAS;AAAA,EACT,SAASC,EAAG;AACd,GAEaC,IAAoBL,EAAS,KAAK,EAAE;AACjDK,EAAkB,OAAO;AAAA,EACvB,UAAU;AAAA,EACV,GAAGF;AACL;AAEO,MAAMG,IAAmBN,EAAS,KAAK,EAAE;AAChDM,EAAiB,OAAO;AAAA,EACtB,GAAGH;AAAA,EACH,UAAU;AACZ;AAEAG,EAAiB,WAAW;AAAA,EAC1B,GAAGA,EAAiB;AAAA,EACpB,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA;AAAA,IACX;AAAA,EACF;AACF;AAEO,MAAMC,IAAuBP,EAAS,KAAK,EAAE;AACpDO,EAAqB,OAAO;AAAA,EAC1B,GAAGJ;AAAA,EACH,UAEI,gBAAAK,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAP,EAAC,SAAI,UAAO,UAAA,CAAA;AAAA,IACZ,gBAAAA,EAAC,SAAI,UAAO,UAAA,CAAA;AAAA,EAAA,GACd;AAEJ;AAEAK,EAAqB,WAAW;AAAA,EAC9B,GAAGA,EAAqB;AAAA,EACxB,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA;AAAA,IACX;AAAA,EACF;AACF;"}
@@ -1,2 +1,3 @@
1
1
  import { NavLinkProps } from 'react-router-dom';
2
+ /** Represents a component for a [NavLink](https://reactrouter.com/en/main/components/nav-link) with styling. */
2
3
  export declare const MenuLink: (props: Omit<NavLinkProps, "style">) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"MenuLink.js","sources":["../../../src/components/MenuLink/MenuLink.tsx"],"sourcesContent":["import classNames from 'clsx';\nimport { NavLink } from 'react-router-dom';\n\nimport type { NavLinkProps } from 'react-router-dom';\n\nimport styles from './MenuLink.module.css';\n\n// Omit style so it cannot be accidentally used\nexport const MenuLink = (props: Omit<NavLinkProps, 'style'>) => (\n <NavLink\n {...props}\n className={({ isActive }) => classNames(styles['menu-link'], { [styles['menu-link--active']]: isActive })}\n />\n);\n"],"names":["MenuLink","props","jsx","NavLink","isActive","classNames","styles"],"mappings":";;;;;;GAQaA,IAAW,CAACC,MACvB,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACE,GAAGF;AAAA,IACJ,WAAW,CAAC,EAAE,UAAAG,EAAS,MAAMC,EAAWC,EAAO,WAAW,GAAG,EAAE,CAACA,EAAO,mBAAmB,CAAC,GAAGF,GAAU;AAAA,EAAA;AAC1G;"}
1
+ {"version":3,"file":"MenuLink.js","sources":["../../../src/components/MenuLink/MenuLink.tsx"],"sourcesContent":["import classNames from 'clsx';\nimport { NavLink } from 'react-router-dom';\n\nimport type { NavLinkProps } from 'react-router-dom';\n\nimport styles from './MenuLink.module.css';\n\n/** Represents a component for a [NavLink](https://reactrouter.com/en/main/components/nav-link) with styling. */\n// Omit style so it cannot be accidentally used\nexport const MenuLink = (props: Omit<NavLinkProps, 'style'>) => (\n <NavLink\n {...props}\n className={({ isActive }) => classNames(styles['menu-link'], { [styles['menu-link--active']]: isActive })}\n />\n);\n"],"names":["MenuLink","props","jsx","NavLink","isActive","classNames","styles"],"mappings":";;;;;;GASaA,IAAW,CAACC,MACvB,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACE,GAAGF;AAAA,IACJ,WAAW,CAAC,EAAE,UAAAG,EAAS,MAAMC,EAAWC,EAAO,WAAW,GAAG,EAAE,CAACA,EAAO,mBAAmB,CAAC,GAAGF,GAAU;AAAA,EAAA;AAC1G;"}
@@ -1,20 +1,21 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { MemoryRouter as o } from "react-router-dom";
3
- import { MenuLink as i } from "./MenuLink.js";
3
+ import { MenuLink as t } from "./MenuLink.js";
4
4
  import '../../assets/MenuLink2.css';const r = `
5
5
  // Can only be used wrapped in a 'react-router-dom' <MemoryRouter />
6
6
  <MenuLink to={linkUrl}>{children}</MenuLink>
7
7
  `, s = {
8
8
  title: "Atoms/MenuLink",
9
- component: i,
9
+ component: t,
10
10
  parameters: {
11
+ inspectComponent: t,
11
12
  codeString: r
12
13
  }
13
- }, t = [
14
+ }, i = [
14
15
  { to: "/menu-link-1", title: "Menu Link One" },
15
16
  { to: "/menu-link-2", title: "Menu Link Two" },
16
17
  { to: "/menu-link-3", title: "Menu Link Three" }
17
- ], m = () => /* @__PURE__ */ e(o, { initialEntries: t.map((n) => n.to), initialIndex: 0, children: /* @__PURE__ */ e("nav", { className: "navbar", children: t.map((n) => /* @__PURE__ */ e(i, { to: n.to, children: n.title }, n.to)) }) }), c = m.bind({});
18
+ ], m = () => /* @__PURE__ */ e(o, { initialEntries: i.map((n) => n.to), initialIndex: 0, children: /* @__PURE__ */ e("nav", { className: "navbar", children: i.map((n) => /* @__PURE__ */ e(t, { to: n.to, children: n.title }, n.to)) }) }), c = m.bind({});
18
19
  export {
19
20
  c as MenuLinkExample,
20
21
  s as default
@@ -1 +1 @@
1
- {"version":3,"file":"MenuLink.stories.js","sources":["../../../src/components/MenuLink/MenuLink.stories.tsx"],"sourcesContent":["import { MemoryRouter, type NavLinkProps } from 'react-router-dom';\n\nimport type { Meta, StoryFn } from '@storybook/react';\n\nimport { MenuLink } from './MenuLink';\n\nimport './MenuLink.stories.css';\n\nconst codeString = `\n// Can only be used wrapped in a 'react-router-dom' <MemoryRouter />\n <MenuLink to={linkUrl}>{children}</MenuLink>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/MenuLink',\n component: MenuLink,\n parameters: {\n codeString: codeString,\n },\n} as Meta<Omit<NavLinkProps, 'style'>>;\n\nconst menuLinks = [\n { to: '/menu-link-1', title: 'Menu Link One' },\n { to: '/menu-link-2', title: 'Menu Link Two' },\n { to: '/menu-link-3', title: 'Menu Link Three' },\n];\n\nconst Template: StoryFn<Omit<NavLinkProps, 'style'>> = () => {\n return (\n <MemoryRouter initialEntries={menuLinks.map((link) => link.to)} initialIndex={0}>\n <nav className=\"navbar\">\n {menuLinks.map((link) => (\n <MenuLink key={link.to} to={link.to}>\n {link.title}\n </MenuLink>\n ))}\n </nav>\n </MemoryRouter>\n );\n};\n\nexport const MenuLinkExample = Template.bind({});\n"],"names":["codeString","MenuLink_stories","MenuLink","menuLinks","Template","jsx","MemoryRouter","link","MenuLinkExample"],"mappings":";;;AAQA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAY;AAAA,EAChB,EAAE,IAAI,gBAAgB,OAAO,gBAAgB;AAAA,EAC7C,EAAE,IAAI,gBAAgB,OAAO,gBAAgB;AAAA,EAC7C,EAAE,IAAI,gBAAgB,OAAO,kBAAkB;AACjD,GAEMC,IAAiD,MAElD,gBAAAC,EAAAC,GAAA,EAAa,gBAAgBH,EAAU,IAAI,CAACI,MAASA,EAAK,EAAE,GAAG,cAAc,GAC5E,4BAAC,OAAI,EAAA,WAAU,UACZ,UAAAJ,EAAU,IAAI,CAACI,MACd,gBAAAF,EAACH,KAAuB,IAAIK,EAAK,IAC9B,UAAAA,EAAK,SADOA,EAAK,EAEpB,CACD,GACH,EACF,CAAA,GAISC,IAAkBJ,EAAS,KAAK,CAAE,CAAA;"}
1
+ {"version":3,"file":"MenuLink.stories.js","sources":["../../../src/components/MenuLink/MenuLink.stories.tsx"],"sourcesContent":["import { MemoryRouter, type NavLinkProps } from 'react-router-dom';\n\nimport type { Meta, StoryFn } from '@storybook/react';\n\nimport { MenuLink } from './MenuLink';\n\nimport './MenuLink.stories.css';\n\nconst codeString = `\n// Can only be used wrapped in a 'react-router-dom' <MemoryRouter />\n <MenuLink to={linkUrl}>{children}</MenuLink>\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/MenuLink',\n component: MenuLink,\n parameters: {\n inspectComponent: MenuLink,\n codeString: codeString,\n },\n} as Meta<Omit<NavLinkProps, 'style'>>;\n\nconst menuLinks = [\n { to: '/menu-link-1', title: 'Menu Link One' },\n { to: '/menu-link-2', title: 'Menu Link Two' },\n { to: '/menu-link-3', title: 'Menu Link Three' },\n];\n\nconst Template: StoryFn<Omit<NavLinkProps, 'style'>> = () => {\n return (\n <MemoryRouter initialEntries={menuLinks.map((link) => link.to)} initialIndex={0}>\n <nav className=\"navbar\">\n {menuLinks.map((link) => (\n <MenuLink key={link.to} to={link.to}>\n {link.title}\n </MenuLink>\n ))}\n </nav>\n </MemoryRouter>\n );\n};\n\nexport const MenuLinkExample = Template.bind({});\n"],"names":["codeString","MenuLink_stories","MenuLink","menuLinks","Template","jsx","MemoryRouter","link","MenuLinkExample"],"mappings":";;;AAQA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAY;AAAA,EAChB,EAAE,IAAI,gBAAgB,OAAO,gBAAgB;AAAA,EAC7C,EAAE,IAAI,gBAAgB,OAAO,gBAAgB;AAAA,EAC7C,EAAE,IAAI,gBAAgB,OAAO,kBAAkB;AACjD,GAEMC,IAAiD,MAElD,gBAAAC,EAAAC,GAAA,EAAa,gBAAgBH,EAAU,IAAI,CAACI,MAASA,EAAK,EAAE,GAAG,cAAc,GAC5E,4BAAC,OAAI,EAAA,WAAU,UACZ,UAAAJ,EAAU,IAAI,CAACI,MACd,gBAAAF,EAACH,KAAuB,IAAIK,EAAK,IAC9B,UAAAA,EAAK,SADOA,EAAK,EAEpB,CACD,GACH,EACF,CAAA,GAISC,IAAkBJ,EAAS,KAAK,CAAE,CAAA;"}
@@ -1,5 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface MetaDataListProps {
3
+ /** A list of key value pairs to display. The value is be a [ReactNode](https://reactnative.dev/docs/react-node). */
3
4
  items: Record<string, ReactNode>;
4
5
  }
6
+ /** Represents a component of a list of key value pairs. */
5
7
  export declare const MetaDataList: ({ items }: MetaDataListProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"MetaDataList.js","sources":["../../../src/components/MetaDataList/MetaDataList.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport styles from './MetaDataList.module.css';\n\nexport interface MetaDataListProps {\n items: Record<string, ReactNode>;\n}\n\nexport const MetaDataList = ({ items }: MetaDataListProps) => (\n <dl className={styles['meta-data-list']}>\n {Object.entries(items).map(([term, description]) => (\n <div key={term} className={styles['meta-data-list__item']}>\n <dt className={styles['meta-data-list__term']}>{term}</dt>\n <dd className={styles['meta-data-list__description']}>{description}</dd>\n </div>\n ))}\n </dl>\n);\n"],"names":["MetaDataList","items","jsx","styles","term","description","jsxs"],"mappings":";;;;;;GAQaA,IAAe,CAAC,EAAE,OAAAC,EAAM,MAClC,gBAAAC,EAAA,MAAA,EAAG,WAAWC,EAAO,gBAAgB,GACnC,UAAO,OAAA,QAAQF,CAAK,EAAE,IAAI,CAAC,CAACG,GAAMC,CAAW,MAC5C,gBAAAC,EAAC,OAAe,EAAA,WAAWH,EAAO,sBAAsB,GACtD,UAAA;AAAA,EAAA,gBAAAD,EAAC,MAAG,EAAA,WAAWC,EAAO,sBAAsB,GAAI,UAAKC,GAAA;AAAA,oBACpD,MAAG,EAAA,WAAWD,EAAO,6BAA6B,GAAI,UAAYE,GAAA;AAAA,EAF3D,GAAAD,CAGV,CACD,EACH,CAAA;"}
1
+ {"version":3,"file":"MetaDataList.js","sources":["../../../src/components/MetaDataList/MetaDataList.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport styles from './MetaDataList.module.css';\n\nexport interface MetaDataListProps {\n /** A list of key value pairs to display. The value is be a [ReactNode](https://reactnative.dev/docs/react-node). */\n items: Record<string, ReactNode>;\n}\n\n/** Represents a component of a list of key value pairs. */\nexport const MetaDataList = ({ items }: MetaDataListProps) => (\n <dl className={styles['meta-data-list']}>\n {Object.entries(items).map(([term, description]) => (\n <div key={term} className={styles['meta-data-list__item']}>\n <dt className={styles['meta-data-list__term']}>{term}</dt>\n <dd className={styles['meta-data-list__description']}>{description}</dd>\n </div>\n ))}\n </dl>\n);\n"],"names":["MetaDataList","items","jsx","styles","term","description","jsxs"],"mappings":";;;;;;GAUaA,IAAe,CAAC,EAAE,OAAAC,EAAM,MAClC,gBAAAC,EAAA,MAAA,EAAG,WAAWC,EAAO,gBAAgB,GACnC,UAAO,OAAA,QAAQF,CAAK,EAAE,IAAI,CAAC,CAACG,GAAMC,CAAW,MAC5C,gBAAAC,EAAC,OAAe,EAAA,WAAWH,EAAO,sBAAsB,GACtD,UAAA;AAAA,EAAA,gBAAAD,EAAC,MAAG,EAAA,WAAWC,EAAO,sBAAsB,GAAI,UAAKC,GAAA;AAAA,oBACpD,MAAG,EAAA,WAAWD,EAAO,6BAA6B,GAAI,UAAYE,GAAA;AAAA,EAF3D,GAAAD,CAGV,CACD,EACH,CAAA;"}
@@ -1,13 +1,14 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { MetaDataList as e } from "./MetaDataList.js";
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { MetaDataList as t } from "./MetaDataList.js";
3
3
  import { Container as o } from "../../storyComponents/Container/Container.js";
4
4
  const i = "<MetaDataList items={items} />", c = {
5
5
  title: "Atoms/MetaDataList",
6
- component: e,
6
+ component: t,
7
7
  parameters: {
8
+ inspectComponent: t,
8
9
  codeString: i
9
10
  }
10
- }, s = (a) => /* @__PURE__ */ t(o, { children: /* @__PURE__ */ t(e, { ...a }) }), m = s.bind({});
11
+ }, s = (a) => /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(t, { ...a }) }), m = s.bind({});
11
12
  m.args = {
12
13
  items: {
13
14
  "item one": "foo",
@@ -1 +1 @@
1
- {"version":3,"file":"MetaDataList.stories.js","sources":["../../../src/components/MetaDataList/MetaDataList.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { MetaDataListProps } from './MetaDataList';\n\nimport { MetaDataList } from './MetaDataList';\n\nimport { Container } from 'storyComponents/Container/';\n\nconst codeString = '<MetaDataList items={items} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/MetaDataList',\n component: MetaDataList,\n parameters: {\n codeString: codeString,\n },\n} as Meta<MetaDataListProps>;\n\nconst Template: StoryFn<MetaDataListProps> = (args) => (\n <Container>\n <MetaDataList {...args} />\n </Container>\n);\n\nexport const MetaDataListExample = Template.bind({});\nMetaDataListExample.args = {\n items: {\n 'item one': 'foo',\n 'item two': 'bar',\n 'item three': 'baz',\n },\n};\n"],"names":["codeString","MetaDataList_stories","MetaDataList","Template","args","jsx","Container","MetaDataListExample"],"mappings":";;;AAOA,MAAMA,IAAa,kCAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,YAAAF;AAAA,EACF;AACF,GAEMG,IAAuC,CAACC,MAC5C,gBAAAC,EAACC,KACC,UAAC,gBAAAD,EAAAH,GAAA,EAAc,GAAGE,EAAM,CAAA,EAC1B,CAAA,GAGWG,IAAsBJ,EAAS,KAAK,EAAE;AACnDI,EAAoB,OAAO;AAAA,EACzB,OAAO;AAAA,IACL,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB;AACF;"}
1
+ {"version":3,"file":"MetaDataList.stories.js","sources":["../../../src/components/MetaDataList/MetaDataList.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { MetaDataListProps } from './MetaDataList';\n\nimport { MetaDataList } from './MetaDataList';\n\nimport { Container } from 'storyComponents/Container/';\n\nconst codeString = '<MetaDataList items={items} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/MetaDataList',\n component: MetaDataList,\n parameters: {\n inspectComponent: MetaDataList,\n codeString: codeString,\n },\n} as Meta<MetaDataListProps>;\n\nconst Template: StoryFn<MetaDataListProps> = (args) => (\n <Container>\n <MetaDataList {...args} />\n </Container>\n);\n\nexport const MetaDataListExample = Template.bind({});\nMetaDataListExample.args = {\n items: {\n 'item one': 'foo',\n 'item two': 'bar',\n 'item three': 'baz',\n },\n};\n"],"names":["codeString","MetaDataList_stories","MetaDataList","Template","args","jsx","Container","MetaDataListExample"],"mappings":";;;AAOA,MAAMA,IAAa,kCAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAuC,CAACC,MAC5C,gBAAAC,EAACC,KACC,UAAC,gBAAAD,EAAAH,GAAA,EAAc,GAAGE,EAAM,CAAA,EAC1B,CAAA,GAGWG,IAAsBJ,EAAS,KAAK,EAAE;AACnDI,EAAoB,OAAO;AAAA,EACzB,OAAO;AAAA,IACL,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB;AACF;"}
@@ -1,23 +1,42 @@
1
- import { AriaDialogProps } from '@react-types/dialog';
2
1
  import { FormHTMLAttributes, PropsWithChildren, ReactNode } from 'react';
2
+ import { AriaDialogProps } from '@react-types/dialog';
3
3
  export interface ModalDialogProps {
4
+ /** The buttons of the dialog. */
4
5
  buttons?: ReactNode;
6
+ /** `true` if the dialog can be closed by clicking outside of it; otherwise, `false`. The default is `false`. */
5
7
  isDismissable?: boolean;
8
+ /** `true` to disable closing the dialog with the keyboard; otherwise, `false`. The default is `false`. */
6
9
  isKeyboardDismissDisabled?: boolean;
10
+ /** `true` to show a spinner, if the contents of the dialog is lazy loaded; otherwise, `false`. The default is `false`. */
7
11
  isLoading?: boolean;
12
+ /** The `aria-valuetext` value of the [Spinner](/story/atoms-spinner--spinner-example) component. The default is `'Loading'` Used together with `isLoading`. */
8
13
  spinnerAriaValueText?: string;
14
+ /** The `aria-label` value of the [OverlayCloseButton](/story/atoms-overlayclosebutton--overlay-close-button-example) component. The default is `'Close'` */
9
15
  closeButtonAriaValueText?: string;
16
+ /** `true` to render the dialog opened; otherwise, `false`. The default is `false`. */
10
17
  isOpen: boolean;
18
+ /** `true` to disable form validation; otherwise, `false`. The default is `false`. */
11
19
  noValidate?: boolean;
20
+ /** The callback function that is invoked when the dialog is closed. */
12
21
  onClose?(): void;
22
+ /** The callback function that is invoked when the form is submitted. */
13
23
  onSubmit?: FormHTMLAttributes<HTMLFormElement>['onSubmit'];
24
+ /** The `aria-role` value of the dialog. Possible values are `'dialog'`, `'alertdialog'`. The default is `'dialog'`. */
14
25
  role?: AriaDialogProps['role'];
26
+ /** The title of the dialog. */
15
27
  title?: string;
28
+ /** The contents of the dialog header. */
16
29
  headerContent?: ReactNode;
30
+ /** The variant of the dialog. */
17
31
  variant?: 'confirm' | 'dialog';
32
+ /** `true` to add padding to the dialog; otherwise, `false`. The default is `false`. */
18
33
  padded?: boolean;
34
+ /** `true` to display the dialog in a slimmer form; otherwise, `false`. The default is `false`. */
19
35
  slim?: boolean;
36
+ /** `true` to display the dialog in a wider form; otherwise, `false`. The default is `false`. */
20
37
  wide?: boolean;
38
+ /** `true` to show a border between the main content of the dialog and the buttons; otherwise, `false`. The default is `false`. */
21
39
  noButtonBorder?: boolean;
22
40
  }
41
+ /** Represents a component for a modal dialog. */
23
42
  export declare function ModalDialog(props: PropsWithChildren<ModalDialogProps>): import("react/jsx-runtime").JSX.Element | null;
@@ -1 +1 @@
1
- {"version":3,"file":"ModalDialog.js","sources":["../../../src/components/ModalDialog/ModalDialog.tsx"],"sourcesContent":["import { useDialog } from '@react-aria/dialog';\nimport { FocusScope } from '@react-aria/focus';\nimport { OverlayContainer, useModal, useOverlay, usePreventScroll } from '@react-aria/overlays';\nimport classNames from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport type { AriaDialogProps } from '@react-types/dialog';\nimport type { FormHTMLAttributes, KeyboardEvent, PropsWithChildren, ReactNode } from 'react';\n\nimport styles from './ModalDialog.module.css';\n\nimport { Backdrop } from 'components/Backdrop';\nimport { OverlayCloseButton } from 'components/OverlayCloseButton';\nimport { Spinner } from 'components/Spinner';\n\nexport interface ModalDialogProps {\n buttons?: ReactNode;\n isDismissable?: boolean;\n isKeyboardDismissDisabled?: boolean;\n isLoading?: boolean;\n spinnerAriaValueText?: string;\n closeButtonAriaValueText?: string;\n isOpen: boolean;\n noValidate?: boolean;\n onClose?(): void;\n onSubmit?: FormHTMLAttributes<HTMLFormElement>['onSubmit'];\n role?: AriaDialogProps['role'];\n title?: string;\n headerContent?: ReactNode;\n variant?: 'confirm' | 'dialog';\n padded?: boolean;\n slim?: boolean;\n wide?: boolean;\n noButtonBorder?: boolean;\n}\n\nexport function ModalDialog(props: PropsWithChildren<ModalDialogProps>) {\n const {\n buttons,\n children,\n isDismissable = true,\n isKeyboardDismissDisabled = !isDismissable,\n isLoading,\n spinnerAriaValueText = 'Loading',\n closeButtonAriaValueText = 'Close',\n isOpen,\n noValidate = false,\n onClose,\n onSubmit,\n role = 'dialog',\n title,\n headerContent,\n variant = 'dialog',\n padded,\n slim,\n wide,\n noButtonBorder = false,\n } = props;\n\n const ref = useRef<HTMLDivElement>(null);\n const formRef = useRef<HTMLFormElement>(null);\n const [isScrollable, setIsScrollable] = useState(false);\n const [isScrolledToBottom, setIsScrolledToBottom] = useState(false);\n\n const { dialogProps, titleProps } = useDialog({ role }, ref);\n const { modalProps } = useModal({ isDisabled: !isOpen });\n const { overlayProps, underlayProps } = useOverlay(\n { isDismissable, isKeyboardDismissDisabled, isOpen, onClose },\n ref\n );\n\n usePreventScroll({ isDisabled: !isOpen });\n\n useEffect(() => {\n const formElement = formRef.current;\n\n function checkScrollable() {\n if (formElement) {\n const scrollHeight = formElement.scrollHeight;\n const clientHeight = formElement.clientHeight;\n const scrollTop = formElement.scrollTop;\n\n setIsScrollable(scrollHeight > clientHeight);\n setIsScrolledToBottom(scrollTop + clientHeight >= scrollHeight);\n }\n }\n\n function handleScrollAndResize() {\n checkScrollable();\n }\n\n if (formElement) {\n formElement.addEventListener('scroll', handleScrollAndResize);\n window.addEventListener('resize', handleScrollAndResize);\n }\n\n const timeoutId = setTimeout(() => {\n checkScrollable();\n }, 0);\n\n return () => {\n if (formElement) {\n formElement.removeEventListener('scroll', handleScrollAndResize);\n }\n window.removeEventListener('resize', handleScrollAndResize);\n clearTimeout(timeoutId);\n };\n }, [isOpen, headerContent]);\n\n function onKeyUp(event: KeyboardEvent) {\n event.stopPropagation();\n }\n\n if (!isOpen) return null;\n\n return (\n <OverlayContainer>\n <Backdrop {...underlayProps}>\n {isLoading ? (\n <Spinner ariaValueText={spinnerAriaValueText} />\n ) : (\n <>\n {/* eslint-disable-next-line jsx-a11y/no-autofocus */}\n <FocusScope autoFocus contain restoreFocus>\n <div\n {...dialogProps}\n {...modalProps}\n {...overlayProps}\n className={classNames(styles['modal-dialog'], {\n [styles['modal-dialog--confirm']]: variant === 'confirm',\n [styles['modal-dialog--padded']]: padded,\n [styles['modal-dialog--slim']]: slim,\n [styles['modal-dialog--wide']]: wide,\n })}\n onKeyUp={onKeyUp}\n role=\"presentation\"\n ref={ref}\n >\n {(title || headerContent) && variant === 'dialog' && (\n <>\n {title && (\n <h1 {...titleProps} className={styles['modal-dialog__title']}>\n {title}\n </h1>\n )}\n {headerContent}\n {variant === 'dialog' && (\n <span className={styles['modal-dialog__close']}>\n <OverlayCloseButton\n aria-label={closeButtonAriaValueText}\n onClick={onClose}\n paddedModal={padded}\n />\n </span>\n )}\n </>\n )}\n <form\n className={classNames(styles['modal-dialog__content'], {\n [styles['modal-dialog--content-with-buttons']]: buttons,\n })}\n onSubmit={onSubmit}\n noValidate={noValidate}\n ref={formRef}\n >\n <div className={classNames({ [styles['modal-dialog__children']]: !noButtonBorder })}>{children}</div>\n {buttons && (\n <div\n className={classNames(styles['modal-dialog__buttons'], {\n [styles['modal-dialog__buttons--border']]: !noButtonBorder,\n [styles['modal-dialog__buttons--shadow']]: isScrollable && !isScrolledToBottom,\n })}\n >\n {buttons}\n </div>\n )}\n </form>\n </div>\n </FocusScope>\n </>\n )}\n </Backdrop>\n </OverlayContainer>\n );\n}\n"],"names":["ModalDialog","props","buttons","children","isDismissable","isKeyboardDismissDisabled","isLoading","spinnerAriaValueText","closeButtonAriaValueText","isOpen","noValidate","onClose","onSubmit","role","title","headerContent","variant","padded","slim","wide","noButtonBorder","ref","useRef","formRef","isScrollable","setIsScrollable","useState","isScrolledToBottom","setIsScrolledToBottom","dialogProps","titleProps","useDialog","modalProps","useModal","overlayProps","underlayProps","useOverlay","usePreventScroll","useEffect","formElement","checkScrollable","scrollHeight","clientHeight","scrollTop","handleScrollAndResize","timeoutId","onKeyUp","event","jsx","OverlayContainer","Backdrop","Spinner","Fragment","FocusScope","jsxs","classNames","styles","OverlayCloseButton"],"mappings":"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"}
1
+ {"version":3,"file":"ModalDialog.js","sources":["../../../src/components/ModalDialog/ModalDialog.tsx"],"sourcesContent":["import { useDialog } from '@react-aria/dialog';\nimport { FocusScope } from '@react-aria/focus';\nimport { OverlayContainer, useModal, useOverlay, usePreventScroll } from '@react-aria/overlays';\nimport classNames from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport type { FormHTMLAttributes, KeyboardEvent, PropsWithChildren, ReactNode } from 'react';\nimport type { AriaDialogProps } from '@react-types/dialog';\n\nimport styles from './ModalDialog.module.css';\n\nimport { Backdrop } from 'components/Backdrop';\nimport { OverlayCloseButton } from 'components/OverlayCloseButton';\nimport { Spinner } from 'components/Spinner';\n\nexport interface ModalDialogProps {\n /** The buttons of the dialog. */\n buttons?: ReactNode;\n /** `true` if the dialog can be closed by clicking outside of it; otherwise, `false`. The default is `false`. */\n isDismissable?: boolean;\n /** `true` to disable closing the dialog with the keyboard; otherwise, `false`. The default is `false`. */\n isKeyboardDismissDisabled?: boolean;\n /** `true` to show a spinner, if the contents of the dialog is lazy loaded; otherwise, `false`. The default is `false`. */\n isLoading?: boolean;\n /** The `aria-valuetext` value of the [Spinner](/story/atoms-spinner--spinner-example) component. The default is `'Loading'` Used together with `isLoading`. */\n spinnerAriaValueText?: string;\n /** The `aria-label` value of the [OverlayCloseButton](/story/atoms-overlayclosebutton--overlay-close-button-example) component. The default is `'Close'` */\n closeButtonAriaValueText?: string;\n /** `true` to render the dialog opened; otherwise, `false`. The default is `false`. */\n isOpen: boolean;\n /** `true` to disable form validation; otherwise, `false`. The default is `false`. */\n noValidate?: boolean;\n /** The callback function that is invoked when the dialog is closed. */\n onClose?(): void;\n /** The callback function that is invoked when the form is submitted. */\n onSubmit?: FormHTMLAttributes<HTMLFormElement>['onSubmit'];\n /** The `aria-role` value of the dialog. Possible values are `'dialog'`, `'alertdialog'`. The default is `'dialog'`. */\n role?: AriaDialogProps['role'];\n /** The title of the dialog. */\n title?: string;\n /** The contents of the dialog header. */\n headerContent?: ReactNode;\n /** The variant of the dialog. */\n variant?: 'confirm' | 'dialog';\n /** `true` to add padding to the dialog; otherwise, `false`. The default is `false`. */\n padded?: boolean;\n /** `true` to display the dialog in a slimmer form; otherwise, `false`. The default is `false`. */\n slim?: boolean;\n /** `true` to display the dialog in a wider form; otherwise, `false`. The default is `false`. */\n wide?: boolean;\n /** `true` to show a border between the main content of the dialog and the buttons; otherwise, `false`. The default is `false`. */\n noButtonBorder?: boolean;\n}\n\n/** Represents a component for a modal dialog. */\nexport function ModalDialog(props: PropsWithChildren<ModalDialogProps>) {\n const {\n buttons,\n children,\n isDismissable = true,\n isKeyboardDismissDisabled = !isDismissable,\n isLoading,\n spinnerAriaValueText = 'Loading',\n closeButtonAriaValueText = 'Close',\n isOpen,\n noValidate = false,\n onClose,\n onSubmit,\n role = 'dialog',\n title,\n headerContent,\n variant = 'dialog',\n padded,\n slim,\n wide,\n noButtonBorder = false,\n } = props;\n\n const ref = useRef<HTMLDivElement>(null);\n const formRef = useRef<HTMLFormElement>(null);\n const [isScrollable, setIsScrollable] = useState(false);\n const [isScrolledToBottom, setIsScrolledToBottom] = useState(false);\n\n const { dialogProps, titleProps } = useDialog({ role }, ref);\n const { modalProps } = useModal({ isDisabled: !isOpen });\n const { overlayProps, underlayProps } = useOverlay(\n { isDismissable, isKeyboardDismissDisabled, isOpen, onClose },\n ref\n );\n\n usePreventScroll({ isDisabled: !isOpen });\n\n useEffect(() => {\n const formElement = formRef.current;\n\n function checkScrollable() {\n if (formElement) {\n const scrollHeight = formElement.scrollHeight;\n const clientHeight = formElement.clientHeight;\n const scrollTop = formElement.scrollTop;\n\n setIsScrollable(scrollHeight > clientHeight);\n setIsScrolledToBottom(scrollTop + clientHeight >= scrollHeight);\n }\n }\n\n function handleScrollAndResize() {\n checkScrollable();\n }\n\n if (formElement) {\n formElement.addEventListener('scroll', handleScrollAndResize);\n window.addEventListener('resize', handleScrollAndResize);\n }\n\n const timeoutId = setTimeout(() => {\n checkScrollable();\n }, 0);\n\n return () => {\n if (formElement) {\n formElement.removeEventListener('scroll', handleScrollAndResize);\n }\n window.removeEventListener('resize', handleScrollAndResize);\n clearTimeout(timeoutId);\n };\n }, [isOpen, headerContent]);\n\n function onKeyUp(event: KeyboardEvent) {\n event.stopPropagation();\n }\n\n if (!isOpen) return null;\n\n return (\n <OverlayContainer>\n <Backdrop {...underlayProps}>\n {isLoading ? (\n <Spinner ariaValueText={spinnerAriaValueText} />\n ) : (\n <>\n {/* eslint-disable-next-line jsx-a11y/no-autofocus */}\n <FocusScope autoFocus contain restoreFocus>\n <div\n {...dialogProps}\n {...modalProps}\n {...overlayProps}\n className={classNames(styles['modal-dialog'], {\n [styles['modal-dialog--confirm']]: variant === 'confirm',\n [styles['modal-dialog--padded']]: padded,\n [styles['modal-dialog--slim']]: slim,\n [styles['modal-dialog--wide']]: wide,\n })}\n onKeyUp={onKeyUp}\n role=\"presentation\"\n ref={ref}\n >\n {(title || headerContent) && variant === 'dialog' && (\n <>\n {title && (\n <h1 {...titleProps} className={styles['modal-dialog__title']}>\n {title}\n </h1>\n )}\n {headerContent}\n {variant === 'dialog' && (\n <span className={styles['modal-dialog__close']}>\n <OverlayCloseButton\n aria-label={closeButtonAriaValueText}\n onClick={onClose}\n paddedModal={padded}\n />\n </span>\n )}\n </>\n )}\n <form\n className={classNames(styles['modal-dialog__content'], {\n [styles['modal-dialog--content-with-buttons']]: buttons,\n })}\n onSubmit={onSubmit}\n noValidate={noValidate}\n ref={formRef}\n >\n <div className={classNames({ [styles['modal-dialog__children']]: !noButtonBorder })}>{children}</div>\n {buttons && (\n <div\n className={classNames(styles['modal-dialog__buttons'], {\n [styles['modal-dialog__buttons--border']]: !noButtonBorder,\n [styles['modal-dialog__buttons--shadow']]: isScrollable && !isScrolledToBottom,\n })}\n >\n {buttons}\n </div>\n )}\n </form>\n </div>\n </FocusScope>\n </>\n )}\n </Backdrop>\n </OverlayContainer>\n );\n}\n"],"names":["ModalDialog","props","buttons","children","isDismissable","isKeyboardDismissDisabled","isLoading","spinnerAriaValueText","closeButtonAriaValueText","isOpen","noValidate","onClose","onSubmit","role","title","headerContent","variant","padded","slim","wide","noButtonBorder","ref","useRef","formRef","isScrollable","setIsScrollable","useState","isScrolledToBottom","setIsScrolledToBottom","dialogProps","titleProps","useDialog","modalProps","useModal","overlayProps","underlayProps","useOverlay","usePreventScroll","useEffect","formElement","checkScrollable","scrollHeight","clientHeight","scrollTop","handleScrollAndResize","timeoutId","onKeyUp","event","jsx","OverlayContainer","Backdrop","Spinner","Fragment","FocusScope","jsxs","classNames","styles","OverlayCloseButton"],"mappings":"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"}
@@ -1,8 +1,8 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { ModalProvider as n } from "@react-aria/overlays";
2
+ import { ModalProvider as l } from "@react-aria/overlays";
3
3
  import { fn as i } from "../../index-MQ0yPLdl.js";
4
- import { ModalDialog as o } from "./ModalDialog.js";
5
- import { Button as l } from "../Button/Button.js";
4
+ import { ModalDialog as t } from "./ModalDialog.js";
5
+ import { Button as n } from "../Button/Button.js";
6
6
  import { ButtonGroup as m } from "../ButtonGroup/ButtonGroup.js";
7
7
  import { FormField as r } from "../FormField/FormField.js";
8
8
  import { InputField as d } from "../InputField/InputField.js";
@@ -14,7 +14,7 @@ const p = `
14
14
  onSubmit={onSubmitFunction} buttons={buttons}> {children} </ModalDialog>
15
15
  `, F = {
16
16
  title: "Molecules/ModalDialog",
17
- component: o,
17
+ component: t,
18
18
  argTypes: {
19
19
  isOpen: {
20
20
  table: {
@@ -45,9 +45,10 @@ const p = `
45
45
  }
46
46
  },
47
47
  parameters: {
48
+ inspectComponent: t,
48
49
  codeString: p
49
50
  }
50
- }, u = (t) => /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(o, { ...t, children: /* @__PURE__ */ a(r, { outerSpace: !0, children: [
51
+ }, u = (o) => /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(t, { ...o, children: /* @__PURE__ */ a(r, { outerSpace: !0, children: [
51
52
  /* @__PURE__ */ e(c, { htmlFor: "text-field", children: "Example Text Field" }),
52
53
  /* @__PURE__ */ e(d, { id: "text-field" })
53
54
  ] }) }) }), s = {
@@ -63,8 +64,8 @@ const p = `
63
64
  onSubmit: i(),
64
65
  onClose: i(),
65
66
  buttons: /* @__PURE__ */ a(m, { reversed: !0, children: [
66
- /* @__PURE__ */ e(l, { variant: "primary", onClick: i(), children: "OK" }),
67
- /* @__PURE__ */ e(l, { variant: "secondary", onClick: i(), children: "Cancel" })
67
+ /* @__PURE__ */ e(n, { variant: "primary", onClick: i(), children: "OK" }),
68
+ /* @__PURE__ */ e(n, { variant: "secondary", onClick: i(), children: "Cancel" })
68
69
  ] }),
69
70
  isOpen: !0
70
71
  }, b = u.bind({});
@@ -77,7 +78,7 @@ g.args = {
77
78
  isLoading: !0,
78
79
  spinnerAriaValueText: "Loading"
79
80
  };
80
- const f = (t) => /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(o, { ...t, children: /* @__PURE__ */ a(r, { outerSpace: !0, children: [
81
+ const f = (o) => /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(t, { ...o, children: /* @__PURE__ */ a(r, { outerSpace: !0, children: [
81
82
  /* @__PURE__ */ e("div", { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ac dui et nibh eleifend ultricies a id nulla. Pellentesque eleifend sem a tellus dictum tempus. Proin non leo id risus placerat vulputate at ac erat. Ut fringilla imperdiet sollicitudin. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Cras molestie ante ac magna ornare rhoncus non at quam. Mauris elementum luctus euismod. Pellentesque molestie malesuada purus, sed egestas lacus interdum sit amet. Morbi blandit lacus sit amet dictum pulvinar. Ut semper nunc ac enim imperdiet, non interdum diam gravida. In nunc tortor, mollis ac molestie dignissim, elementum sed quam. Suspendisse mollis venenatis libero, pellentesque vestibulum elit consequat et. Aliquam fringilla tellus id libero tempus, sit amet suscipit augue tristique. Quisque cursus neque vel justo tristique, eget semper turpis elementum. Etiam venenatis mattis sapien ac mattis. Mauris vitae ultrices erat." }),
82
83
  /* @__PURE__ */ e("div", { children: "Aliquam facilisis massa sed justo rhoncus bibendum. Sed lobortis urna orci, vitae porta leo placerat nec. Nam porta porttitor ornare. Suspendisse vehicula nunc nec egestas finibus. Aliquam non luctus risus. Phasellus ac diam tincidunt, bibendum sem eget, sollicitudin neque. Curabitur mauris risus, feugiat ac euismod non, vulputate ac justo. Curabitur pretium vehicula augue, blandit porta odio rutrum sit amet. Proin semper enim ut sapien tempor, a ornare ipsum faucibus." })
83
84
  ] }) }) }), h = f.bind({});