@webiny/admin-ui 6.4.0-beta.3 → 6.4.0-beta.5

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 (224) hide show
  1. package/Accordion/Accordion.stories.d.ts +1 -1
  2. package/Accordion/Accordion.stories.js.map +1 -1
  3. package/Alert/Alert.stories.d.ts +1 -1
  4. package/Alert/Alert.stories.js.map +1 -1
  5. package/AutoComplete/AutoComplete.stories.d.ts +1 -1
  6. package/AutoComplete/AutoComplete.stories.js.map +1 -1
  7. package/AutoComplete/primitives/AutoCompletePrimitive.stories.d.ts +1 -1
  8. package/AutoComplete/primitives/AutoCompletePrimitive.stories.js.map +1 -1
  9. package/Avatar/Avatar.stories.d.ts +1 -1
  10. package/Avatar/Avatar.stories.js.map +1 -1
  11. package/Button/Button.stories.d.ts +1 -1
  12. package/Button/Button.stories.js.map +1 -1
  13. package/Button/IconButton.stories.d.ts +1 -1
  14. package/Button/IconButton.stories.js.map +1 -1
  15. package/Card/Card.stories.d.ts +1 -1
  16. package/Card/Card.stories.js.map +1 -1
  17. package/Checkbox/Checkbox.stories.d.ts +1 -1
  18. package/Checkbox/Checkbox.stories.js.map +1 -1
  19. package/Checkbox/primitives/CheckboxPrimitive.stories.d.ts +1 -1
  20. package/Checkbox/primitives/CheckboxPrimitive.stories.js.map +1 -1
  21. package/CheckboxGroup/CheckboxGroup.stories.d.ts +1 -1
  22. package/CheckboxGroup/CheckboxGroup.stories.js.map +1 -1
  23. package/CheckboxGroup/primitives/CheckboxGroupPrimitive.stories.d.ts +1 -1
  24. package/CheckboxGroup/primitives/CheckboxGroupPrimitive.stories.js.map +1 -1
  25. package/CodeEditor/CodeEditor.stories.d.ts +1 -1
  26. package/CodeEditor/CodeEditor.stories.js.map +1 -1
  27. package/CodeEditor/CodeEditorPrimitive.stories.d.ts +1 -1
  28. package/CodeEditor/CodeEditorPrimitive.stories.js.map +1 -1
  29. package/ColorPicker/ColorPicker.stories.d.ts +1 -1
  30. package/ColorPicker/ColorPicker.stories.js.map +1 -1
  31. package/ColorPicker/primitives/ColorPickerPrimitive.stories.d.ts +1 -1
  32. package/ColorPicker/primitives/ColorPickerPrimitive.stories.js.map +1 -1
  33. package/DataTable/DataTable.stories.d.ts +1 -1
  34. package/DataTable/DataTable.stories.js.map +1 -1
  35. package/DatePicker/DatePicker.stories.d.ts +1 -1
  36. package/DatePicker/DatePicker.stories.js.map +1 -1
  37. package/DatePicker/primitives/components/DatePickerTrigger.js +1 -1
  38. package/DatePicker/primitives/components/DatePickerTrigger.js.map +1 -1
  39. package/Dialog/Dialog.stories.d.ts +1 -1
  40. package/Dialog/Dialog.stories.js.map +1 -1
  41. package/DragCursor/DragCursor.d.ts +7 -0
  42. package/DragCursor/DragCursor.js +21 -0
  43. package/DragCursor/DragCursor.js.map +1 -0
  44. package/DragCursor/DragCursor.stories.d.ts +10 -0
  45. package/DragCursor/DragCursor.stories.js +97 -0
  46. package/DragCursor/DragCursor.stories.js.map +1 -0
  47. package/DragCursor/index.d.ts +1 -0
  48. package/DragCursor/index.js +1 -0
  49. package/Drawer/Drawer.stories.d.ts +1 -1
  50. package/Drawer/Drawer.stories.js.map +1 -1
  51. package/DropdownMenu/DropdownMenu.stories.d.ts +1 -1
  52. package/DropdownMenu/DropdownMenu.stories.js.map +1 -1
  53. package/FilePicker/FilePicker.stories.d.ts +1 -1
  54. package/FilePicker/FilePicker.stories.js.map +1 -1
  55. package/FilePicker/primitives/FilePickerPrimitive.stories.d.ts +1 -1
  56. package/FilePicker/primitives/FilePickerPrimitive.stories.js.map +1 -1
  57. package/FillViewport/FillViewport.d.ts +60 -0
  58. package/FillViewport/FillViewport.js +67 -0
  59. package/FillViewport/FillViewport.js.map +1 -0
  60. package/FillViewport/index.d.ts +1 -0
  61. package/FillViewport/index.js +1 -0
  62. package/Grid/Grid.d.ts +1 -1
  63. package/Grid/Grid.js.map +1 -1
  64. package/Grid/Grid.stories.d.ts +1 -1
  65. package/Grid/Grid.stories.js.map +1 -1
  66. package/HeaderBar/HeaderBar.stories.d.ts +1 -1
  67. package/HeaderBar/HeaderBar.stories.js.map +1 -1
  68. package/Heading/Heading.stories.d.ts +1 -1
  69. package/Heading/Heading.stories.js.map +1 -1
  70. package/Icon/Icon.stories.d.ts +1 -1
  71. package/Icon/Icon.stories.js.map +1 -1
  72. package/IconPicker/IconPicker.stories.d.ts +1 -1
  73. package/IconPicker/IconPicker.stories.js.map +1 -1
  74. package/IconPicker/primitives/IconPickerPrimitive.stories.d.ts +1 -1
  75. package/IconPicker/primitives/IconPickerPrimitive.stories.js.map +1 -1
  76. package/Input/Input.stories.d.ts +1 -1
  77. package/Input/Input.stories.js.map +1 -1
  78. package/Input/InputPrimitive.stories.d.ts +1 -1
  79. package/Input/InputPrimitive.stories.js.map +1 -1
  80. package/Label/Label.stories.d.ts +1 -1
  81. package/Label/Label.stories.js.map +1 -1
  82. package/Link/Link.stories.d.ts +1 -1
  83. package/Link/Link.stories.js.map +1 -1
  84. package/List/List.stories.d.ts +1 -1
  85. package/List/List.stories.js.map +1 -1
  86. package/Loader/Loader.stories.d.ts +1 -1
  87. package/Loader/Loader.stories.js.map +1 -1
  88. package/Loader/OverlayLoader.stories.d.ts +1 -1
  89. package/Loader/OverlayLoader.stories.js.map +1 -1
  90. package/MultiAutoComplete/MultiAutoComplete.stories.d.ts +1 -1
  91. package/MultiAutoComplete/MultiAutoComplete.stories.js.map +1 -1
  92. package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.stories.d.ts +1 -1
  93. package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.stories.js.map +1 -1
  94. package/MultiFilePicker/MultiFilePicker.stories.d.ts +1 -1
  95. package/MultiFilePicker/MultiFilePicker.stories.js.map +1 -1
  96. package/MultiFilePicker/primitives/MultiFilePickerPrimitive.stories.d.ts +1 -1
  97. package/MultiFilePicker/primitives/MultiFilePickerPrimitive.stories.js.map +1 -1
  98. package/MultiSelect/MultiSelect.stories.d.ts +1 -1
  99. package/MultiSelect/MultiSelect.stories.js.map +1 -1
  100. package/Popover/Popover.stories.d.ts +1 -1
  101. package/Popover/Popover.stories.js.map +1 -1
  102. package/ProgressBar/ProgressBar.stories.d.ts +1 -1
  103. package/ProgressBar/ProgressBar.stories.js.map +1 -1
  104. package/RadioGroup/RadioGroup.stories.d.ts +1 -1
  105. package/RadioGroup/RadioGroup.stories.js.map +1 -1
  106. package/RadioGroup/primitives/RadioGroupPrimitive.stories.d.ts +1 -1
  107. package/RadioGroup/primitives/RadioGroupPrimitive.stories.js.map +1 -1
  108. package/RangeSlider/RangeSlider.stories.d.ts +1 -1
  109. package/RangeSlider/RangeSlider.stories.js.map +1 -1
  110. package/RangeSlider/primitives/RangeSliderPrimitive.stories.d.ts +1 -1
  111. package/RangeSlider/primitives/RangeSliderPrimitive.stories.js.map +1 -1
  112. package/ScrollArea/ScrollArea.stories.d.ts +1 -1
  113. package/ScrollArea/ScrollArea.stories.js.map +1 -1
  114. package/SegmentedControl/SegmentedControl.d.ts +4 -0
  115. package/SegmentedControl/SegmentedControl.js +6 -2
  116. package/SegmentedControl/SegmentedControl.js.map +1 -1
  117. package/SegmentedControl/SegmentedControl.stories.d.ts +5 -1
  118. package/SegmentedControl/SegmentedControl.stories.js +100 -2
  119. package/SegmentedControl/SegmentedControl.stories.js.map +1 -1
  120. package/SegmentedControl/SegmentedControlTab.d.ts +10 -0
  121. package/SegmentedControl/SegmentedControlTab.js +21 -0
  122. package/SegmentedControl/SegmentedControlTab.js.map +1 -0
  123. package/SegmentedControl/SegmentedControlTabs.d.ts +11 -0
  124. package/SegmentedControl/SegmentedControlTabs.js +71 -0
  125. package/SegmentedControl/SegmentedControlTabs.js.map +1 -0
  126. package/SegmentedControl/SegmentedControlTabsContext.d.ts +19 -0
  127. package/SegmentedControl/SegmentedControlTabsContext.js +11 -0
  128. package/SegmentedControl/SegmentedControlTabsContext.js.map +1 -0
  129. package/SegmentedControl/index.d.ts +2 -0
  130. package/SegmentedControl/index.js +2 -0
  131. package/SegmentedControl/primitives/SegmentedControlPrimitive.d.ts +5 -1
  132. package/SegmentedControl/primitives/SegmentedControlPrimitive.js +4 -3
  133. package/SegmentedControl/primitives/SegmentedControlPrimitive.js.map +1 -1
  134. package/SegmentedControl/primitives/SegmentedControlPrimitive.stories.d.ts +2 -1
  135. package/SegmentedControl/primitives/SegmentedControlPrimitive.stories.js +8 -1
  136. package/SegmentedControl/primitives/SegmentedControlPrimitive.stories.js.map +1 -1
  137. package/Select/Select.stories.d.ts +1 -1
  138. package/Select/Select.stories.js.map +1 -1
  139. package/Select/primitives/SelectPrimitive.stories.d.ts +1 -1
  140. package/Select/primitives/SelectPrimitive.stories.js.map +1 -1
  141. package/Separator/Separator.stories.d.ts +1 -1
  142. package/Separator/Separator.stories.js.map +1 -1
  143. package/Sidebar/Sidebar.d.ts +2 -0
  144. package/Sidebar/Sidebar.stories.d.ts +1 -1
  145. package/Sidebar/Sidebar.stories.js.map +1 -1
  146. package/Sidebar/components/items/SidebarMenuItem.d.ts +4 -1
  147. package/Sidebar/components/items/SidebarMenuItem.js +3 -1
  148. package/Sidebar/components/items/SidebarMenuItem.js.map +1 -1
  149. package/Sidebar/components/items/SidebarMenuItemBadge.d.ts +6 -0
  150. package/Sidebar/components/items/SidebarMenuItemBadge.js +7 -0
  151. package/Sidebar/components/items/SidebarMenuItemBadge.js.map +1 -0
  152. package/Sidebar/components/items/SidebarMenuLink.d.ts +3 -1
  153. package/Sidebar/components/items/SidebarMenuLink.js +3 -1
  154. package/Sidebar/components/items/SidebarMenuLink.js.map +1 -1
  155. package/Sidebar/components/items/SidebarMenuRootButton.d.ts +1 -1
  156. package/Sidebar/components/items/SidebarMenuRootButton.js +8 -3
  157. package/Sidebar/components/items/SidebarMenuRootButton.js.map +1 -1
  158. package/Sidebar/components/items/SidebarMenuSubButton.d.ts +1 -1
  159. package/Sidebar/components/items/SidebarMenuSubButton.js +8 -3
  160. package/Sidebar/components/items/SidebarMenuSubButton.js.map +1 -1
  161. package/Sidebar/components/items/SidebarMenuSubItemIndentation.js +2 -1
  162. package/Sidebar/components/items/SidebarMenuSubItemIndentation.js.map +1 -1
  163. package/Skeleton/Skeleton.stories.d.ts +1 -1
  164. package/Skeleton/Skeleton.stories.js.map +1 -1
  165. package/Slider/Slider.stories.d.ts +1 -1
  166. package/Slider/Slider.stories.js.map +1 -1
  167. package/Slider/primitives/SliderPrimitive.stories.d.ts +1 -1
  168. package/Slider/primitives/SliderPrimitive.stories.js.map +1 -1
  169. package/SteppedProgress/SteppedProgress.stories.d.ts +1 -1
  170. package/SteppedProgress/SteppedProgress.stories.js.map +1 -1
  171. package/Switch/Switch.stories.d.ts +1 -1
  172. package/Switch/Switch.stories.js.map +1 -1
  173. package/Switch/primitives/SwitchPrimitive.stories.d.ts +1 -1
  174. package/Switch/primitives/SwitchPrimitive.stories.js.map +1 -1
  175. package/Tabs/Tabs.js.map +1 -1
  176. package/Tabs/Tabs.stories.d.ts +1 -1
  177. package/Tabs/Tabs.stories.js.map +1 -1
  178. package/Tag/Tag.stories.d.ts +1 -1
  179. package/Tag/Tag.stories.js.map +1 -1
  180. package/Tags/Tags.stories.d.ts +1 -1
  181. package/Tags/Tags.stories.js.map +1 -1
  182. package/Tags/primitives/TagsPrimitive.stories.d.ts +1 -1
  183. package/Tags/primitives/TagsPrimitive.stories.js.map +1 -1
  184. package/Text/Text.stories.d.ts +1 -1
  185. package/Text/Text.stories.js.map +1 -1
  186. package/Textarea/Textarea.stories.d.ts +1 -1
  187. package/Textarea/Textarea.stories.js.map +1 -1
  188. package/Textarea/TextareaPrimitive.stories.d.ts +1 -1
  189. package/Textarea/TextareaPrimitive.stories.js.map +1 -1
  190. package/TimeAgo/TimeAgo.stories.d.ts +1 -1
  191. package/TimeAgo/TimeAgo.stories.js.map +1 -1
  192. package/Toast/useToast.stories.d.ts +1 -1
  193. package/Toast/useToast.stories.js.map +1 -1
  194. package/Toggle/Toggle.stories.d.ts +1 -1
  195. package/Toggle/Toggle.stories.js.map +1 -1
  196. package/Toggle/primitives/TogglePrimitive.stories.d.ts +1 -1
  197. package/Toggle/primitives/TogglePrimitive.stories.js.map +1 -1
  198. package/ToggleGroup/ToggleGroup.stories.d.ts +1 -1
  199. package/ToggleGroup/ToggleGroup.stories.js.map +1 -1
  200. package/ToggleGroup/domains/ToggleGroupItem.d.ts +3 -0
  201. package/ToggleGroup/domains/ToggleGroupItem.js +6 -1
  202. package/ToggleGroup/domains/ToggleGroupItem.js.map +1 -1
  203. package/ToggleGroup/domains/ToggleGroupItemFormatted.d.ts +1 -0
  204. package/ToggleGroup/domains/ToggleGroupItemFormatter.js +2 -1
  205. package/ToggleGroup/domains/ToggleGroupItemFormatter.js.map +1 -1
  206. package/ToggleGroup/domains/ToggleGroupItemParams.d.ts +1 -0
  207. package/ToggleGroup/primitives/ToggleGroupPrimitive.js +11 -2
  208. package/ToggleGroup/primitives/ToggleGroupPrimitive.js.map +1 -1
  209. package/ToggleGroup/primitives/ToggleGroupPrimitive.stories.d.ts +1 -1
  210. package/ToggleGroup/primitives/ToggleGroupPrimitive.stories.js.map +1 -1
  211. package/Tooltip/Tooltip.stories.d.ts +1 -1
  212. package/Tooltip/Tooltip.stories.js.map +1 -1
  213. package/Tree/Tree.stories.d.ts +1 -1
  214. package/Tree/Tree.stories.js.map +1 -1
  215. package/Widget/Widget.stories.d.ts +1 -1
  216. package/Widget/Widget.stories.js.map +1 -1
  217. package/exports/admin/ui.d.ts +1 -0
  218. package/exports/admin/ui.js +1 -0
  219. package/index.d.ts +2 -0
  220. package/index.js +2 -0
  221. package/package.json +22 -23
  222. package/theme.css +3 -1
  223. package/utils.js +1 -0
  224. package/utils.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker/DatePicker.stories.js","sources":["../../src/DatePicker/DatePicker.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react-webpack5\";\nimport { addDays, nextSaturday } from \"date-fns\";\nimport { DatePicker } from \"./DatePicker.js\";\n\nconst meta: Meta<typeof DatePicker> = {\n title: \"Components/Form/DatePicker\",\n component: DatePicker,\n argTypes: {\n onChange: { action: \"onChange\" },\n type: {\n control: \"select\",\n options: [\n \"date\",\n \"time\",\n \"dateTimeLocal\",\n \"dateTimeTz\",\n \"month\",\n \"week\",\n \"year\",\n \"dateRange\",\n \"multipleDates\",\n \"multipleMonths\",\n \"multipleYears\"\n ],\n defaultValue: \"date\"\n },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [value, setValue] = useState<any>();\n return <DatePicker {...args} value={value} onChange={setValue} />;\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof DatePicker>;\n\nexport const Default: Story = {\n args: {\n type: \"date\"\n }\n};\n\nexport const WithLabel: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\"\n }\n};\n\nexport const WithLabelRequired: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n required: true\n }\n};\n\nexport const WithDescription: Story = {\n args: {\n type: \"date\",\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const WithNotes: Story = {\n args: {\n type: \"date\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const WithErrors: Story = {\n args: {\n type: \"date\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const Disabled: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const FullExample: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n required: true,\n description: \"Provide the required information for processing your request.\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const WithPresets: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n const presets = [\n { label: \"Today\", value: () => new Date() },\n { label: \"Tomorrow\", value: () => addDays(new Date(), 1) },\n { label: \"In 3 days\", value: () => addDays(new Date(), 3) },\n { label: \"In a week\", value: () => addDays(new Date(), 7) },\n { label: \"In 2 weeks\", value: () => addDays(new Date(), 14) },\n { label: \"Next Saturday\", value: () => nextSaturday(new Date()) }\n ];\n return (\n <DatePicker {...args} type=\"date\" value={value} onChange={setValue} presets={presets} />\n );\n },\n args: {\n label: \"Pick a date\",\n description: \"Choose a date or use a preset.\"\n }\n};\n\nexport const TypeTime: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"time\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Time\"\n }\n};\n\nexport const TypeDateTimeLocal: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"dateTimeLocal\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date & Time (local)\"\n }\n};\n\nexport const TypeDateTimeTz: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"dateTimeTz\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date & Time (with timezone)\"\n }\n};\n\nexport const TypeMonth: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"month\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Month\"\n }\n};\n\nexport const TypeWeek: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"week\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Week\"\n }\n};\n\nexport const TypeYear: Story = {\n render: args => {\n const [value, setValue] = useState<number | undefined>();\n return (\n <DatePicker\n {...args}\n type=\"year\"\n value={value}\n onChange={setValue}\n yearRange={[2015, 2035]}\n />\n );\n },\n args: {\n label: \"Year\"\n }\n};\n\nexport const TypeDateRange: Story = {\n render: args => {\n const [value, setValue] = useState<{ from?: string; to?: string } | undefined>();\n return <DatePicker {...args} type=\"dateRange\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date Range\"\n }\n};\n\nexport const TypeMultipleDates: Story = {\n render: args => {\n const [value, setValue] = useState<string[]>([]);\n return <DatePicker {...args} type=\"multipleDates\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Multiple Dates\"\n }\n};\n\nexport const TypeMultipleMonths: Story = {\n render: args => {\n const [value, setValue] = useState<string[]>([]);\n return <DatePicker {...args} type=\"multipleMonths\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Multiple Months\"\n }\n};\n\nexport const TypeMultipleYears: Story = {\n render: args => {\n const [value, setValue] = useState<number[]>([]);\n return (\n <DatePicker\n {...args}\n type=\"multipleYears\"\n value={value}\n onChange={setValue}\n yearRange={[2015, 2035]}\n />\n );\n },\n args: {\n label: \"Multiple Years\"\n }\n};\n\nconst formatValue = (value: any): string => {\n if (value === undefined || value === null) {\n return \"undefined\";\n }\n if (value instanceof Date) {\n return value.toISOString();\n }\n if (Array.isArray(value)) {\n return JSON.stringify(\n value.map((v: any) => (v instanceof Date ? v.toISOString() : v)),\n null,\n 2\n );\n }\n if (typeof value === \"object\") {\n return JSON.stringify(value, (_k, v) => (v instanceof Date ? v.toISOString() : v), 2);\n }\n return String(value);\n};\n\nconst DocumentationInner = (args: any) => {\n const isMultiple = (args.type as string)?.startsWith(\"multiple\");\n const [value, setValue] = useState<any>(isMultiple ? [] : undefined);\n const [validation, setValidation] = useState({ isValid: true, message: \"\" });\n\n const handleChange = (newValue: any) => {\n setValue(newValue);\n const isEmpty =\n newValue === undefined ||\n newValue === null ||\n newValue === \"\" ||\n (Array.isArray(newValue) && newValue.length === 0);\n if (args.required && isEmpty) {\n setValidation({ isValid: false, message: \"This field is required\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n };\n\n return (\n <div>\n <DatePicker {...args} value={value} onChange={handleChange} validation={validation} />\n <div className=\"mt-md rounded-md border-sm border-neutral-muted bg-neutral-light p-sm\">\n <div className=\"text-xs font-medium text-neutral-dimmed mb-xs\">Current value</div>\n <pre className=\"text-sm text-neutral-strong whitespace-pre-wrap m-0\">\n {formatValue(value)}\n </pre>\n </div>\n </div>\n );\n};\n\nexport const Documentation: Story = {\n render: args => {\n return <DocumentationInner key={args.type as string} {...args} />;\n },\n args: {\n type: \"date\",\n label: \"Event Date\",\n required: true,\n disabled: false,\n description: \"Select the date for your event\",\n note: \"Note: Choose a date that works for all participants\",\n placeholder: \"Pick a date\",\n validation: undefined\n },\n argTypes: {\n type: {\n description: \"The type of date picker variant to render\",\n control: \"select\",\n options: [\n \"date\",\n \"time\",\n \"dateTimeLocal\",\n \"dateTimeTz\",\n \"month\",\n \"week\",\n \"year\",\n \"dateRange\",\n \"multipleDates\",\n \"multipleMonths\",\n \"multipleYears\"\n ],\n defaultValue: \"date\"\n },\n label: {\n description: \"Label text displayed above the picker\",\n control: \"text\"\n },\n required: {\n description: \"Makes the field required\",\n control: \"boolean\",\n defaultValue: true\n },\n disabled: {\n description: \"Disables the date picker\",\n control: \"boolean\",\n defaultValue: false\n },\n description: {\n description: \"Helper text displayed below the label\",\n control: \"text\"\n },\n note: {\n description: \"Additional note displayed below the picker\",\n control: \"text\"\n },\n placeholder: {\n description: \"Placeholder text shown when no date is selected\",\n control: \"text\"\n },\n validation: {\n description:\n \"Object containing validation state and message. Please refer to the example code for details on usage.\"\n },\n onChange: {\n description: \"Callback function when the value changes\"\n }\n }\n};\n"],"names":["meta","DatePicker","args","value","setValue","useState","Default","WithLabel","WithLabelRequired","WithDescription","WithNotes","WithErrors","Disabled","FullExample","WithPresets","presets","Date","addDays","nextSaturday","TypeTime","TypeDateTimeLocal","TypeDateTimeTz","TypeMonth","TypeWeek","TypeYear","TypeDateRange","TypeMultipleDates","TypeMultipleMonths","TypeMultipleYears","formatValue","Array","JSON","v","_k","String","DocumentationInner","isMultiple","undefined","validation","setValidation","handleChange","newValue","isEmpty","Documentation"],"mappings":";;;AAKA,MAAMA,OAAgC;IAClC,OAAO;IACP,WAAWC;IACX,UAAU;QACN,UAAU;YAAE,QAAQ;QAAW;QAC/B,MAAM;YACF,SAAS;YACT,SAAS;g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AE,OAAOC;QAAO,UAAUqC;QAAc,YAAYF;sBACxE,oBAAC;QAAI,WAAU;qBACX,oBAAC;QAAI,WAAU;OAAgD,gCAC/D,oBAAC;QAAI,WAAU;OACVT,YAAY1B;AAKjC;AAEO,MAAMwC,gBAAuB;IAChC,QAAQzC,CAAAA,OACG,WAAP,GAAO,oBAACiC,oBAAkBA;YAAC,KAAKjC,KAAK,IAAI;YAAa,GAAGA,IAAI;;IAEjE,MAAM;QACF,MAAM;QACN,OAAO;QACP,UAAU;QACV,UAAU;QACV,aAAa;QACb,MAAM;QACN,aAAa;QACb,YAAYmC;IAChB;IACA,UAAU;QACN,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBACL;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;aACH;YACD,cAAc;QAClB;QACA,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,UAAU;YACN,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,UAAU;YACN,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,YAAY;YACR,aACI;QACR;QACA,UAAU;YACN,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"file":"DatePicker/DatePicker.stories.js","sources":["../../src/DatePicker/DatePicker.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { addDays, nextSaturday } from \"date-fns\";\nimport { DatePicker } from \"./DatePicker.js\";\n\nconst meta: Meta<typeof DatePicker> = {\n title: \"Components/Form/DatePicker\",\n component: DatePicker,\n argTypes: {\n onChange: { action: \"onChange\" },\n type: {\n control: \"select\",\n options: [\n \"date\",\n \"time\",\n \"dateTimeLocal\",\n \"dateTimeTz\",\n \"month\",\n \"week\",\n \"year\",\n \"dateRange\",\n \"multipleDates\",\n \"multipleMonths\",\n \"multipleYears\"\n ],\n defaultValue: \"date\"\n },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [value, setValue] = useState<any>();\n return <DatePicker {...args} value={value} onChange={setValue} />;\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof DatePicker>;\n\nexport const Default: Story = {\n args: {\n type: \"date\"\n }\n};\n\nexport const WithLabel: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\"\n }\n};\n\nexport const WithLabelRequired: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n required: true\n }\n};\n\nexport const WithDescription: Story = {\n args: {\n type: \"date\",\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const WithNotes: Story = {\n args: {\n type: \"date\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const WithErrors: Story = {\n args: {\n type: \"date\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const Disabled: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const FullExample: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n required: true,\n description: \"Provide the required information for processing your request.\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const WithPresets: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n const presets = [\n { label: \"Today\", value: () => new Date() },\n { label: \"Tomorrow\", value: () => addDays(new Date(), 1) },\n { label: \"In 3 days\", value: () => addDays(new Date(), 3) },\n { label: \"In a week\", value: () => addDays(new Date(), 7) },\n { label: \"In 2 weeks\", value: () => addDays(new Date(), 14) },\n { label: \"Next Saturday\", value: () => nextSaturday(new Date()) }\n ];\n return (\n <DatePicker {...args} type=\"date\" value={value} onChange={setValue} presets={presets} />\n );\n },\n args: {\n label: \"Pick a date\",\n description: \"Choose a date or use a preset.\"\n }\n};\n\nexport const TypeTime: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"time\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Time\"\n }\n};\n\nexport const TypeDateTimeLocal: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"dateTimeLocal\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date & Time (local)\"\n }\n};\n\nexport const TypeDateTimeTz: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"dateTimeTz\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date & Time (with timezone)\"\n }\n};\n\nexport const TypeMonth: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"month\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Month\"\n }\n};\n\nexport const TypeWeek: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"week\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Week\"\n }\n};\n\nexport const TypeYear: Story = {\n render: args => {\n const [value, setValue] = useState<number | undefined>();\n return (\n <DatePicker\n {...args}\n type=\"year\"\n value={value}\n onChange={setValue}\n yearRange={[2015, 2035]}\n />\n );\n },\n args: {\n label: \"Year\"\n }\n};\n\nexport const TypeDateRange: Story = {\n render: args => {\n const [value, setValue] = useState<{ from?: string; to?: string } | undefined>();\n return <DatePicker {...args} type=\"dateRange\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date Range\"\n }\n};\n\nexport const TypeMultipleDates: Story = {\n render: args => {\n const [value, setValue] = useState<string[]>([]);\n return <DatePicker {...args} type=\"multipleDates\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Multiple Dates\"\n }\n};\n\nexport const TypeMultipleMonths: Story = {\n render: args => {\n const [value, setValue] = useState<string[]>([]);\n return <DatePicker {...args} type=\"multipleMonths\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Multiple Months\"\n }\n};\n\nexport const TypeMultipleYears: Story = {\n render: args => {\n const [value, setValue] = useState<number[]>([]);\n return (\n <DatePicker\n {...args}\n type=\"multipleYears\"\n value={value}\n onChange={setValue}\n yearRange={[2015, 2035]}\n />\n );\n },\n args: {\n label: \"Multiple Years\"\n }\n};\n\nconst formatValue = (value: any): string => {\n if (value === undefined || value === null) {\n return \"undefined\";\n }\n if (value instanceof Date) {\n return value.toISOString();\n }\n if (Array.isArray(value)) {\n return JSON.stringify(\n value.map((v: any) => (v instanceof Date ? v.toISOString() : v)),\n null,\n 2\n );\n }\n if (typeof value === \"object\") {\n return JSON.stringify(value, (_k, v) => (v instanceof Date ? v.toISOString() : v), 2);\n }\n return String(value);\n};\n\nconst DocumentationInner = (args: any) => {\n const isMultiple = (args.type as string)?.startsWith(\"multiple\");\n const [value, setValue] = useState<any>(isMultiple ? [] : undefined);\n const [validation, setValidation] = useState({ isValid: true, message: \"\" });\n\n const handleChange = (newValue: any) => {\n setValue(newValue);\n const isEmpty =\n newValue === undefined ||\n newValue === null ||\n newValue === \"\" ||\n (Array.isArray(newValue) && newValue.length === 0);\n if (args.required && isEmpty) {\n setValidation({ isValid: false, message: \"This field is required\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n };\n\n return (\n <div>\n <DatePicker {...args} value={value} onChange={handleChange} validation={validation} />\n <div className=\"mt-md rounded-md border-sm border-neutral-muted bg-neutral-light p-sm\">\n <div className=\"text-xs font-medium text-neutral-dimmed mb-xs\">Current value</div>\n <pre className=\"text-sm text-neutral-strong whitespace-pre-wrap m-0\">\n {formatValue(value)}\n </pre>\n </div>\n </div>\n );\n};\n\nexport const Documentation: Story = {\n render: args => {\n return <DocumentationInner key={args.type as string} {...args} />;\n },\n args: {\n type: \"date\",\n label: \"Event Date\",\n required: true,\n disabled: false,\n description: \"Select the date for your event\",\n note: \"Note: Choose a date that works for all participants\",\n placeholder: \"Pick a date\",\n validation: undefined\n },\n argTypes: {\n type: {\n description: \"The type of date picker variant to render\",\n control: \"select\",\n options: [\n \"date\",\n \"time\",\n \"dateTimeLocal\",\n \"dateTimeTz\",\n \"month\",\n \"week\",\n \"year\",\n \"dateRange\",\n \"multipleDates\",\n \"multipleMonths\",\n \"multipleYears\"\n ],\n defaultValue: \"date\"\n },\n label: {\n description: \"Label text displayed above the picker\",\n control: \"text\"\n },\n required: {\n description: \"Makes the field required\",\n control: \"boolean\",\n defaultValue: true\n },\n disabled: {\n description: \"Disables the date picker\",\n control: \"boolean\",\n defaultValue: false\n },\n description: {\n description: \"Helper text displayed below the label\",\n control: \"text\"\n },\n note: {\n description: \"Additional note displayed below the picker\",\n control: \"text\"\n },\n placeholder: {\n description: \"Placeholder text shown when no date is selected\",\n control: \"text\"\n },\n validation: {\n description:\n \"Object containing validation state and message. Please refer to the example code for details on usage.\"\n },\n onChange: {\n description: \"Callback function when the value changes\"\n }\n }\n};\n"],"names":["meta","DatePicker","args","value","setValue","useState","Default","WithLabel","WithLabelRequired","WithDescription","WithNotes","WithErrors","Disabled","FullExample","WithPresets","presets","Date","addDays","nextSaturday","TypeTime","TypeDateTimeLocal","TypeDateTimeTz","TypeMonth","TypeWeek","TypeYear","TypeDateRange","TypeMultipleDates","TypeMultipleMonths","TypeMultipleYears","formatValue","Array","JSON","v","_k","String","DocumentationInner","isMultiple","undefined","validation","setValidation","handleChange","newValue","isEmpty","Documentation"],"mappings":";;;AAKA,MAAMA,OAAgC;IAClC,OAAO;IACP,WAAWC;IACX,UAAU;QACN,UAAU;YAAE,QAAQ;QAAW;QAC/B,MAAM;YACF,SAAS;YACT,SAAS;gBACL;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;aACH;YACD,cAAc;QAClB;QACA,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,OAAOC,SAAS,GAAG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,oBAAkBA;YAAC,KAAKjC,KAAK,IAAI;YAAa,GAAGA,IAAI;;IAEjE,MAAM;QACF,MAAM;QACN,OAAO;QACP,UAAU;QACV,UAAU;QACV,aAAa;QACb,MAAM;QACN,aAAa;QACb,YAAYmC;IAChB;IACA,UAAU;QACN,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBACL;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;aACH;YACD,cAAc;QAClB;QACA,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,UAAU;YACN,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,UAAU;YACN,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,YAAY;YACR,aACI;QACR;QACA,UAAU;YACN,aAAa;QACjB;IACJ;AACJ"}
@@ -22,7 +22,7 @@ const DatePickerTriggerInner = /*#__PURE__*/ forwardRef(({ displayValue, placeho
22
22
  }), "cursor-pointer justify-between select-none", disabled && "pointer-events-none opacity-50", className),
23
23
  ...props
24
24
  }, /*#__PURE__*/ react.createElement("span", {
25
- className: cn(!displayValue && "text-neutral-dimmed")
25
+ className: cn("truncate", !displayValue && "text-neutral-dimmed")
26
26
  }, displayValue || placeholder || "Select..."), /*#__PURE__*/ react.createElement(Icon, {
27
27
  icon: /*#__PURE__*/ react.createElement(IconComponent, null),
28
28
  label: iconLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker/primitives/components/DatePickerTrigger.js","sources":["../../../../src/DatePicker/primitives/components/DatePickerTrigger.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { ReactComponent as CalendarMonthIcon } from \"@webiny/icons/calendar_month.svg\";\nimport { ReactComponent as ScheduleIcon } from \"@webiny/icons/schedule.svg\";\nimport { Icon } from \"~/Icon/index.js\";\nimport { inputVariants, type InputPrimitiveProps } from \"~/Input/index.js\";\nimport { PopoverPrimitive } from \"~/Popover/index.js\";\nimport { cn } from \"~/utils.js\";\n\ninterface DatePickerTriggerProps {\n displayValue?: string;\n placeholder?: string;\n disabled?: boolean;\n size?: InputPrimitiveProps[\"size\"];\n variant?: InputPrimitiveProps[\"variant\"];\n invalid?: InputPrimitiveProps[\"invalid\"];\n iconType?: \"calendar\" | \"time\";\n}\n\nconst DatePickerTriggerInner = forwardRef<\n HTMLDivElement,\n DatePickerTriggerProps & React.HTMLAttributes<HTMLDivElement>\n>(\n (\n {\n displayValue,\n placeholder,\n disabled,\n size,\n variant,\n invalid,\n iconType = \"calendar\",\n className,\n ...props\n },\n ref\n ) => {\n const IconComponent = iconType === \"time\" ? ScheduleIcon : CalendarMonthIcon;\n const iconLabel = iconType === \"time\" ? \"Time\" : \"Calendar\";\n\n return (\n <PopoverPrimitive.Trigger asChild>\n <div\n ref={ref}\n role=\"button\"\n tabIndex={0}\n data-disabled={disabled}\n className={cn(\n inputVariants({ size, variant, invalid }),\n \"cursor-pointer justify-between select-none\",\n disabled && \"pointer-events-none opacity-50\",\n className\n )}\n {...props}\n >\n <span className={cn(!displayValue && \"text-neutral-dimmed\")}>\n {displayValue || placeholder || \"Select...\"}\n </span>\n <Icon icon={<IconComponent />} label={iconLabel} size=\"sm\" color=\"inherit\" />\n </div>\n </PopoverPrimitive.Trigger>\n );\n }\n);\n\nDatePickerTriggerInner.displayName = \"DatePickerTrigger\";\n\nexport { DatePickerTriggerInner as DatePickerTrigger, type DatePickerTriggerProps };\n"],"names":["DatePickerTriggerInner","forwardRef","displayValue","placeholder","disabled","size","variant","invalid","iconType","className","props","ref","IconComponent","ScheduleIcon","CalendarMonthIcon","iconLabel","PopoverPrimitive","cn","inputVariants","Icon"],"mappings":";;;;;;;AAkBA,MAAMA,yBAAyB,WAAHA,GAAGC,WAI3B,CACI,EACIC,YAAY,EACZC,WAAW,EACXC,QAAQ,EACRC,IAAI,EACJC,OAAO,EACPC,OAAO,EACPC,WAAW,UAAU,EACrBC,SAAS,EACT,GAAGC,OACN,EACDC;IAEA,MAAMC,gBAAgBJ,AAAa,WAAbA,WAAsBK,8BAAeC;IAC3D,MAAMC,YAAYP,AAAa,WAAbA,WAAsB,SAAS;IAEjD,OAAO,WAAP,GACI,oBAACQ,iBAAiB,OAAO;QAAC;qBACtB,oBAAC;QACG,KAAKL;QACL,MAAK;QACL,UAAU;QACV,iBAAeP;QACf,WAAWa,GACPC,cAAc;YAAEb;YAAMC;YAASC;QAAQ,IACvC,8CACAH,YAAY,kCACZK;QAEH,GAAGC,KAAK;qBAET,oBAAC;QAAK,WAAWO,GAAG,CAACf,gBAAgB;OAChCA,gBAAgBC,eAAe,4BAEpC,oBAACgB,MAAIA;QAAC,oBAAM,oBAACP,eAAAA;QAAkB,OAAOG;QAAW,MAAK;QAAK,OAAM;;AAIjF;AAGJf,uBAAuB,WAAW,GAAG"}
1
+ {"version":3,"file":"DatePicker/primitives/components/DatePickerTrigger.js","sources":["../../../../src/DatePicker/primitives/components/DatePickerTrigger.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { ReactComponent as CalendarMonthIcon } from \"@webiny/icons/calendar_month.svg\";\nimport { ReactComponent as ScheduleIcon } from \"@webiny/icons/schedule.svg\";\nimport { Icon } from \"~/Icon/index.js\";\nimport { inputVariants, type InputPrimitiveProps } from \"~/Input/index.js\";\nimport { PopoverPrimitive } from \"~/Popover/index.js\";\nimport { cn } from \"~/utils.js\";\n\ninterface DatePickerTriggerProps {\n displayValue?: string;\n placeholder?: string;\n disabled?: boolean;\n size?: InputPrimitiveProps[\"size\"];\n variant?: InputPrimitiveProps[\"variant\"];\n invalid?: InputPrimitiveProps[\"invalid\"];\n iconType?: \"calendar\" | \"time\";\n}\n\nconst DatePickerTriggerInner = forwardRef<\n HTMLDivElement,\n DatePickerTriggerProps & React.HTMLAttributes<HTMLDivElement>\n>(\n (\n {\n displayValue,\n placeholder,\n disabled,\n size,\n variant,\n invalid,\n iconType = \"calendar\",\n className,\n ...props\n },\n ref\n ) => {\n const IconComponent = iconType === \"time\" ? ScheduleIcon : CalendarMonthIcon;\n const iconLabel = iconType === \"time\" ? \"Time\" : \"Calendar\";\n\n return (\n <PopoverPrimitive.Trigger asChild>\n <div\n ref={ref}\n role=\"button\"\n tabIndex={0}\n data-disabled={disabled}\n className={cn(\n inputVariants({ size, variant, invalid }),\n \"cursor-pointer justify-between select-none\",\n disabled && \"pointer-events-none opacity-50\",\n className\n )}\n {...props}\n >\n <span className={cn(\"truncate\", !displayValue && \"text-neutral-dimmed\")}>\n {displayValue || placeholder || \"Select...\"}\n </span>\n <Icon icon={<IconComponent />} label={iconLabel} size=\"sm\" color=\"inherit\" />\n </div>\n </PopoverPrimitive.Trigger>\n );\n }\n);\n\nDatePickerTriggerInner.displayName = \"DatePickerTrigger\";\n\nexport { DatePickerTriggerInner as DatePickerTrigger, type DatePickerTriggerProps };\n"],"names":["DatePickerTriggerInner","forwardRef","displayValue","placeholder","disabled","size","variant","invalid","iconType","className","props","ref","IconComponent","ScheduleIcon","CalendarMonthIcon","iconLabel","PopoverPrimitive","cn","inputVariants","Icon"],"mappings":";;;;;;;AAkBA,MAAMA,yBAAyB,WAAHA,GAAGC,WAI3B,CACI,EACIC,YAAY,EACZC,WAAW,EACXC,QAAQ,EACRC,IAAI,EACJC,OAAO,EACPC,OAAO,EACPC,WAAW,UAAU,EACrBC,SAAS,EACT,GAAGC,OACN,EACDC;IAEA,MAAMC,gBAAgBJ,AAAa,WAAbA,WAAsBK,8BAAeC;IAC3D,MAAMC,YAAYP,AAAa,WAAbA,WAAsB,SAAS;IAEjD,OAAO,WAAP,GACI,oBAACQ,iBAAiB,OAAO;QAAC;qBACtB,oBAAC;QACG,KAAKL;QACL,MAAK;QACL,UAAU;QACV,iBAAeP;QACf,WAAWa,GACPC,cAAc;YAAEb;YAAMC;YAASC;QAAQ,IACvC,8CACAH,YAAY,kCACZK;QAEH,GAAGC,KAAK;qBAET,oBAAC;QAAK,WAAWO,GAAG,YAAY,CAACf,gBAAgB;OAC5CA,gBAAgBC,eAAe,4BAEpC,oBAACgB,MAAIA;QAAC,oBAAM,oBAACP,eAAAA;QAAkB,OAAOG;QAAW,MAAK;QAAK,OAAM;;AAIjF;AAGJf,uBAAuB,WAAW,GAAG"}
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryObj } from "@storybook/react-webpack5";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Dialog } from "./Dialog.js";
3
3
  declare const meta: Meta<typeof Dialog>;
4
4
  export default meta;
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog/Dialog.stories.js","sources":["../../src/Dialog/Dialog.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { library } from \"@fortawesome/fontawesome-svg-core\";\nimport { fas } from \"@fortawesome/free-solid-svg-icons\";\nimport type { Meta, StoryObj } from \"@storybook/react-webpack5\";\nimport { Dialog } from \"./Dialog.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { DropdownMenu } from \"~/DropdownMenu/index.js\";\nimport { ReactComponent as NotificationIcon } from \"@webiny/icons/notifications_active.svg\";\nimport { Tabs } from \"~/Tabs/index.js\";\nimport { IconPicker } from \"~/IconPicker/index.js\";\n\nlibrary.add(fas);\n\nconst meta: Meta<typeof Dialog> = {\n title: \"Components/Dialog\",\n component: Dialog,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Dialog>;\n\nexport const Default: Story = {\n args: {\n size: \"md\",\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n title: \"Dialog Title\",\n description: \"A short dialog description.\",\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n The amazing, splendid, and most useful umbrella, resistant to rain and friendly to\n winds, is something that deserves all admiration. Crafted with perfect textures, it\n bravely withstands storms and gently shades the rays of the sun. A remarkable\n innovation, with an ergonomically designed grip most suited to the hand, it remains\n stable even in the fiercest weather.\n </>\n ),\n onOpenChange: opened => {\n console.log(`Dialog is ${opened ? \"opened\" : \"closed\"}.`);\n },\n actions: (\n <>\n <Dialog.CancelAction />\n <Dialog.ConfirmAction />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const SizeSmall: Story = {\n args: {\n ...Default.args,\n size: \"sm\"\n }\n};\n\nexport const SizeMedium: Story = {\n args: {\n ...Default.args,\n size: \"md\"\n }\n};\n\nexport const SizeLarge: Story = {\n args: {\n ...Default.args,\n size: \"lg\"\n }\n};\n\nexport const SizeExtraLarge: Story = {\n args: {\n ...Default.args,\n size: \"xl\"\n }\n};\n\nexport const SizeFullScreen: Story = {\n args: {\n ...Default.args,\n size: \"full\"\n }\n};\n\nexport const ControlledVisibility: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text={\"Open\"} onClick={() => setOpen(true)} />\n <Dialog\n {...props}\n open={open}\n onOpenChange={open => {\n if (!open) {\n setOpen(false);\n }\n }}\n />\n </>\n );\n },\n args: { ...Default.args, trigger: null }\n};\n\nexport const WithOpenCloseEventHandler: Story = {\n args: {\n ...Default.args,\n onClose: () => {\n console.log(\"onClose triggered\");\n },\n onOpen: () => {\n console.log(\"onOpen triggered\");\n }\n }\n};\n\nexport const WithDropdownMenu: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item\n text={\"Open Dialog\"}\n content={\"Open Dialog\"}\n onClick={() => setOpen(true)}\n />\n </DropdownMenu>\n\n <Dialog {...props} open={open} onOpenChange={() => setOpen(false)} />\n </>\n );\n },\n args: { ...Default.args, trigger: null }\n};\n\nexport const WithoutCloseButton: Story = {\n args: { ...Default.args, showCloseButton: false }\n};\n\nexport const AlertDialog: Story = {\n args: {\n ...Default.args,\n info: null,\n showCloseButton: false,\n title: \"Confirm Action\",\n description: \"Are you sure you want to delete this item?\",\n children: (\n <>\n <p>This action cannot be undone.</p>\n <p>Deleted items cannot be recovered.</p>\n </>\n )\n }\n};\n\nexport const DropdownMenuInDialog: Story = {\n args: {\n ...Default.args,\n children: (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item text={\"Billing\"} />\n <DropdownMenu.Item text={\"Settings\"} />\n <DropdownMenu.Item text={\"Keyboard shortcuts\"} />\n </DropdownMenu>\n </>\n )\n }\n};\n\nexport const DropdownIconPickerInDialog: Story = {\n args: {\n ...Default.args\n },\n render: args => {\n const [value, setValue] = useState(\"\");\n return (\n <Dialog {...args}>\n <IconPicker\n icons={[\n { prefix: \"fas\", name: \"trash-restore-alt\" },\n { prefix: \"fas\", name: \"trash-can-arrow-up\" },\n { prefix: \"fas\", name: \"naira-sign\" },\n { prefix: \"fas\", name: \"cart-arrow-down\" },\n { prefix: \"fas\", name: \"walkie-talkie\" },\n { prefix: \"fas\", name: \"file-edit\" },\n { prefix: \"fas\", name: \"file-pen\" },\n { prefix: \"fas\", name: \"receipt\" },\n { prefix: \"fas\", name: \"pen-square\" },\n { prefix: \"fas\", name: \"pencil-square\" },\n { prefix: \"fas\", name: \"square-pen\" },\n { prefix: \"fas\", name: \"suitcase-rolling\" },\n { prefix: \"fas\", name: \"person-circle-exclamation\" },\n { prefix: \"fas\", name: \"chevron-down\" },\n { prefix: \"fas\", name: \"battery\" },\n { prefix: \"fas\", name: \"battery-5\" },\n { prefix: \"fas\", name: \"battery-full\" },\n { prefix: \"fas\", name: \"skull-crossbones\" },\n { prefix: \"fas\", name: \"code-compare\" },\n { prefix: \"fas\", name: \"list-dots\" },\n { prefix: \"fas\", name: \"list-ul\" },\n { prefix: \"fas\", name: \"school-lock\" },\n { prefix: \"fas\", name: \"tower-cell\" },\n { prefix: \"fas\", name: \"long-arrow-alt-down\" },\n { prefix: \"fas\", name: \"down-long\" },\n { prefix: \"fas\", name: \"ranking-star\" },\n { prefix: \"fas\", name: \"chess-king\" },\n { prefix: \"fas\", name: \"person-harassing\" },\n { prefix: \"fas\", name: \"brazilian-real-sign\" },\n { prefix: \"fas\", name: \"landmark-alt\" }\n ]}\n value={value}\n onChange={value => {\n console.log(\"Selected icon:\", value);\n setValue(value);\n }}\n />\n </Dialog>\n );\n }\n};\n\nexport const WithIcon: Story = {\n args: {\n ...Default.args,\n icon: <Dialog.Icon icon={<NotificationIcon />} label={\"Title icon\"} />\n }\n};\n\nexport const PreventOutsideDismiss: Story = {\n args: {\n ...Default.args,\n dismissible: false\n }\n};\n\nexport const WithTabs: Story = {\n args: {\n ...Default.args,\n bodyPadding: false,\n children: (\n <>\n <Tabs\n separator={true}\n spacing={\"lg\"}\n tabs={[\n <Tabs.Tab\n key={\"account\"}\n value={\"account\"}\n trigger={\"Account\"}\n content={\"Make changes to your account here.\"}\n />,\n <Tabs.Tab\n key={\"company\"}\n value={\"company\"}\n trigger={\"Company\"}\n content={\"Make changes to your company info here.\"}\n />,\n <Tabs.Tab\n key={\"security\"}\n value={\"security\"}\n trigger={\"Security\"}\n content={\"Make changes to your security settings here.\"}\n />,\n <Tabs.Tab\n key={\"development\"}\n value={\"development\"}\n trigger={\"Development\"}\n content={\"Make changes to your development settings here.\"}\n />\n ]}\n />\n </>\n )\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n const [open, setOpen] = useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text=\"Open Dialog\" onClick={() => setOpen(true)} />\n\n <Dialog {...args} open={open} onOpenChange={open => setOpen(open)} />\n </>\n );\n },\n args: {\n title: \"Dialog Title\",\n description: \"A short dialog description.\",\n showCloseButton: true,\n dismissible: true,\n bodyPadding: true,\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n This is the dialog content area. You can place any content here including forms,\n text, images, or other components.\n </>\n ),\n actions: (\n <>\n <Dialog.CancelAction />\n <Dialog.ConfirmAction />\n </>\n )\n },\n argTypes: {\n title: {\n description: \"Title displayed in the header\",\n control: \"text\"\n },\n description: {\n description: \"Description displayed below the title\",\n control: \"text\"\n },\n size: {\n description: \"Controls the size of the dialog\",\n control: \"select\",\n options: [\"sm\", \"md\", \"lg\", \"xl\", \"full\"]\n },\n showCloseButton: {\n description:\n \"Show close button, please refer to the 'Without Close Button' example below for details.\",\n control: \"boolean\",\n defaultValue: true\n },\n dismissible: {\n description:\n \"Allow dialog to be dismissed by clicking outside or pressing Escape, please refer to the 'Prevent Outside Dismiss' example below for details.\",\n control: \"boolean\",\n defaultValue: true\n },\n bodyPadding: {\n description: \"Add padding to the Dialog body.\",\n control: \"boolean\",\n defaultValue: true\n },\n info: {\n description:\n \"Additional info displayed below the description, please refer to the example below for details.\"\n },\n children: {\n description:\n \"Content of the dialog, please refer to the 'With Dropdown Menu' and ''With Tabs' example below for details.\"\n },\n actions: {\n description:\n \"Actions displayed in the footer, please refer to the code example for details.\"\n }\n }\n};\n"],"names":["library","fas","meta","Dialog","Default","Button","opened","console","SizeSmall","SizeMedium","SizeLarge","SizeExtraLarge","SizeFullScreen","ControlledVisibility","props","open","setOpen","React","WithOpenCloseEventHandler","WithDropdownMenu","DropdownMenu","WithoutCloseButton","AlertDialog","DropdownMenuInDialog","DropdownIconPickerInDialog","args","value","setValue","useState","IconPicker","WithIcon","NotificationIcon","PreventOutsideDismiss","WithTabs","Tabs","Documentation"],"mappings":";;;;;;;;;AAWAA,QAAQ,GAAG,CAACC;AAEZ,MAAMC,OAA4B;IAC9B,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,uBAAeD;AAIR,MAAME,UAAiB;IAC1B,MAAM;QACF,MAAM;QACN,SAAS,WAAT,GAAS,oBAACC,QAAMA;YAAC,SAAQ;YAAU,MAAM;;QACzC,OAAO;QACP,aAAa;QACb,MAAM,WAAN,GACI,0CAAE,wCACwB,oBAAC;YAAE,MAAM;WAAK,SAAQ;QAGpD,UAAU,WAAV,GACI,0CAAE;QAQN,cAAcC,CAAAA;YACVC,QAAQ,GAAG,CAAC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BACpB,oBAACA,OAAO,aAAa;IAGjC;IACA,UAAU;QACN,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAM;gBAAM;gBAAM;gBAAM;aAAO;QAC7C;QACA,iBAAiB;YACb,aACI;YACJ,SAAS;YACT,cAAc;QAClB;QACA,aAAa;YACT,aACI;YACJ,SAAS;YACT,cAAc;QAClB;QACA,aAAa;YACT,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,MAAM;YACF,aACI;QACR;QACA,UAAU;YACN,aACI;QACR;QACA,SAAS;YACL,aACI;QACR;IACJ;AACJ"}
1
+ {"version":3,"file":"Dialog/Dialog.stories.js","sources":["../../src/Dialog/Dialog.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { library } from \"@fortawesome/fontawesome-svg-core\";\nimport { fas } from \"@fortawesome/free-solid-svg-icons\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Dialog } from \"./Dialog.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { DropdownMenu } from \"~/DropdownMenu/index.js\";\nimport { ReactComponent as NotificationIcon } from \"@webiny/icons/notifications_active.svg\";\nimport { Tabs } from \"~/Tabs/index.js\";\nimport { IconPicker } from \"~/IconPicker/index.js\";\n\nlibrary.add(fas);\n\nconst meta: Meta<typeof Dialog> = {\n title: \"Components/Dialog\",\n component: Dialog,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Dialog>;\n\nexport const Default: Story = {\n args: {\n size: \"md\",\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n title: \"Dialog Title\",\n description: \"A short dialog description.\",\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n The amazing, splendid, and most useful umbrella, resistant to rain and friendly to\n winds, is something that deserves all admiration. Crafted with perfect textures, it\n bravely withstands storms and gently shades the rays of the sun. A remarkable\n innovation, with an ergonomically designed grip most suited to the hand, it remains\n stable even in the fiercest weather.\n </>\n ),\n onOpenChange: opened => {\n console.log(`Dialog is ${opened ? \"opened\" : \"closed\"}.`);\n },\n actions: (\n <>\n <Dialog.CancelAction />\n <Dialog.ConfirmAction />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const SizeSmall: Story = {\n args: {\n ...Default.args,\n size: \"sm\"\n }\n};\n\nexport const SizeMedium: Story = {\n args: {\n ...Default.args,\n size: \"md\"\n }\n};\n\nexport const SizeLarge: Story = {\n args: {\n ...Default.args,\n size: \"lg\"\n }\n};\n\nexport const SizeExtraLarge: Story = {\n args: {\n ...Default.args,\n size: \"xl\"\n }\n};\n\nexport const SizeFullScreen: Story = {\n args: {\n ...Default.args,\n size: \"full\"\n }\n};\n\nexport const ControlledVisibility: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text={\"Open\"} onClick={() => setOpen(true)} />\n <Dialog\n {...props}\n open={open}\n onOpenChange={open => {\n if (!open) {\n setOpen(false);\n }\n }}\n />\n </>\n );\n },\n args: { ...Default.args, trigger: null }\n};\n\nexport const WithOpenCloseEventHandler: Story = {\n args: {\n ...Default.args,\n onClose: () => {\n console.log(\"onClose triggered\");\n },\n onOpen: () => {\n console.log(\"onOpen triggered\");\n }\n }\n};\n\nexport const WithDropdownMenu: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item\n text={\"Open Dialog\"}\n content={\"Open Dialog\"}\n onClick={() => setOpen(true)}\n />\n </DropdownMenu>\n\n <Dialog {...props} open={open} onOpenChange={() => setOpen(false)} />\n </>\n );\n },\n args: { ...Default.args, trigger: null }\n};\n\nexport const WithoutCloseButton: Story = {\n args: { ...Default.args, showCloseButton: false }\n};\n\nexport const AlertDialog: Story = {\n args: {\n ...Default.args,\n info: null,\n showCloseButton: false,\n title: \"Confirm Action\",\n description: \"Are you sure you want to delete this item?\",\n children: (\n <>\n <p>This action cannot be undone.</p>\n <p>Deleted items cannot be recovered.</p>\n </>\n )\n }\n};\n\nexport const DropdownMenuInDialog: Story = {\n args: {\n ...Default.args,\n children: (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item text={\"Billing\"} />\n <DropdownMenu.Item text={\"Settings\"} />\n <DropdownMenu.Item text={\"Keyboard shortcuts\"} />\n </DropdownMenu>\n </>\n )\n }\n};\n\nexport const DropdownIconPickerInDialog: Story = {\n args: {\n ...Default.args\n },\n render: args => {\n const [value, setValue] = useState(\"\");\n return (\n <Dialog {...args}>\n <IconPicker\n icons={[\n { prefix: \"fas\", name: \"trash-restore-alt\" },\n { prefix: \"fas\", name: \"trash-can-arrow-up\" },\n { prefix: \"fas\", name: \"naira-sign\" },\n { prefix: \"fas\", name: \"cart-arrow-down\" },\n { prefix: \"fas\", name: \"walkie-talkie\" },\n { prefix: \"fas\", name: \"file-edit\" },\n { prefix: \"fas\", name: \"file-pen\" },\n { prefix: \"fas\", name: \"receipt\" },\n { prefix: \"fas\", name: \"pen-square\" },\n { prefix: \"fas\", name: \"pencil-square\" },\n { prefix: \"fas\", name: \"square-pen\" },\n { prefix: \"fas\", name: \"suitcase-rolling\" },\n { prefix: \"fas\", name: \"person-circle-exclamation\" },\n { prefix: \"fas\", name: \"chevron-down\" },\n { prefix: \"fas\", name: \"battery\" },\n { prefix: \"fas\", name: \"battery-5\" },\n { prefix: \"fas\", name: \"battery-full\" },\n { prefix: \"fas\", name: \"skull-crossbones\" },\n { prefix: \"fas\", name: \"code-compare\" },\n { prefix: \"fas\", name: \"list-dots\" },\n { prefix: \"fas\", name: \"list-ul\" },\n { prefix: \"fas\", name: \"school-lock\" },\n { prefix: \"fas\", name: \"tower-cell\" },\n { prefix: \"fas\", name: \"long-arrow-alt-down\" },\n { prefix: \"fas\", name: \"down-long\" },\n { prefix: \"fas\", name: \"ranking-star\" },\n { prefix: \"fas\", name: \"chess-king\" },\n { prefix: \"fas\", name: \"person-harassing\" },\n { prefix: \"fas\", name: \"brazilian-real-sign\" },\n { prefix: \"fas\", name: \"landmark-alt\" }\n ]}\n value={value}\n onChange={value => {\n console.log(\"Selected icon:\", value);\n setValue(value);\n }}\n />\n </Dialog>\n );\n }\n};\n\nexport const WithIcon: Story = {\n args: {\n ...Default.args,\n icon: <Dialog.Icon icon={<NotificationIcon />} label={\"Title icon\"} />\n }\n};\n\nexport const PreventOutsideDismiss: Story = {\n args: {\n ...Default.args,\n dismissible: false\n }\n};\n\nexport const WithTabs: Story = {\n args: {\n ...Default.args,\n bodyPadding: false,\n children: (\n <>\n <Tabs\n separator={true}\n spacing={\"lg\"}\n tabs={[\n <Tabs.Tab\n key={\"account\"}\n value={\"account\"}\n trigger={\"Account\"}\n content={\"Make changes to your account here.\"}\n />,\n <Tabs.Tab\n key={\"company\"}\n value={\"company\"}\n trigger={\"Company\"}\n content={\"Make changes to your company info here.\"}\n />,\n <Tabs.Tab\n key={\"security\"}\n value={\"security\"}\n trigger={\"Security\"}\n content={\"Make changes to your security settings here.\"}\n />,\n <Tabs.Tab\n key={\"development\"}\n value={\"development\"}\n trigger={\"Development\"}\n content={\"Make changes to your development settings here.\"}\n />\n ]}\n />\n </>\n )\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n const [open, setOpen] = useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text=\"Open Dialog\" onClick={() => setOpen(true)} />\n\n <Dialog {...args} open={open} onOpenChange={open => setOpen(open)} />\n </>\n );\n },\n args: {\n title: \"Dialog Title\",\n description: \"A short dialog description.\",\n showCloseButton: true,\n dismissible: true,\n bodyPadding: true,\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n This is the dialog content area. You can place any content here including forms,\n text, images, or other components.\n </>\n ),\n actions: (\n <>\n <Dialog.CancelAction />\n <Dialog.ConfirmAction />\n </>\n )\n },\n argTypes: {\n title: {\n description: \"Title displayed in the header\",\n control: \"text\"\n },\n description: {\n description: \"Description displayed below the title\",\n control: \"text\"\n },\n size: {\n description: \"Controls the size of the dialog\",\n control: \"select\",\n options: [\"sm\", \"md\", \"lg\", \"xl\", \"full\"]\n },\n showCloseButton: {\n description:\n \"Show close button, please refer to the 'Without Close Button' example below for details.\",\n control: \"boolean\",\n defaultValue: true\n },\n dismissible: {\n description:\n \"Allow dialog to be dismissed by clicking outside or pressing Escape, please refer to the 'Prevent Outside Dismiss' example below for details.\",\n control: \"boolean\",\n defaultValue: true\n },\n bodyPadding: {\n description: \"Add padding to the Dialog body.\",\n control: \"boolean\",\n defaultValue: true\n },\n info: {\n description:\n \"Additional info displayed below the description, please refer to the example below for details.\"\n },\n children: {\n description:\n \"Content of the dialog, please refer to the 'With Dropdown Menu' and ''With Tabs' example below for details.\"\n },\n actions: {\n description:\n \"Actions displayed in the footer, please refer to the code example for details.\"\n }\n }\n};\n"],"names":["library","fas","meta","Dialog","Default","Button","opened","console","SizeSmall","SizeMedium","SizeLarge","SizeExtraLarge","SizeFullScreen","ControlledVisibility","props","open","setOpen","React","WithOpenCloseEventHandler","WithDropdownMenu","DropdownMenu","WithoutCloseButton","AlertDialog","DropdownMenuInDialog","DropdownIconPickerInDialog","args","value","setValue","useState","IconPicker","WithIcon","NotificationIcon","PreventOutsideDismiss","WithTabs","Tabs","Documentation"],"mappings":";;;;;;;;;AAWAA,QAAQ,GAAG,CAACC;AAEZ,MAAMC,OAA4B;IAC9B,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,uBAAeD;AAIR,MAAME,UAAiB;IAC1B,MAAM;QACF,MAAM;QACN,SAAS,WAAT,GAAS,oBAACC,QAAMA;YAAC,SAAQ;YAAU,MAAM;;QACzC,OAAO;QACP,aAAa;QACb,MAAM,WAAN,GACI,0CAAE,wCACwB,oBAAC;YAAE,MAAM;WAAK,SAAQ;QAGpD,UAAU,WAAV,GAC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AE;QAKN,SAAS,WAAT,GACI,wDACI,oBAACZ,OAAO,YAAY,uBACpB,oBAACA,OAAO,aAAa;IAGjC;IACA,UAAU;QACN,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAM;gBAAM;gBAAM;gBAAM;aAAO;QAC7C;QACA,iBAAiB;YACb,aACI;YACJ,SAAS;YACT,cAAc;QAClB;QACA,aAAa;YACT,aACI;YACJ,SAAS;YACT,cAAc;QAClB;QACA,aAAa;YACT,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,MAAM;YACF,aACI;QACR;QACA,UAAU;YACN,aACI;QACR;QACA,SAAS;YACL,aACI;QACR;IACJ;AACJ"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ export interface DragCursorProps {
3
+ label: string;
4
+ icon?: React.ReactNode;
5
+ isOverSlot?: boolean;
6
+ }
7
+ export declare const DragCursor: ({ label, icon, isOverSlot }: DragCursorProps) => React.JSX.Element;
@@ -0,0 +1,21 @@
1
+ import react from "react";
2
+ import { Icon } from "../Icon/index.js";
3
+ const DragCursor = ({ label, icon, isOverSlot = false })=>{
4
+ const containerClass = isOverSlot ? "flex items-center gap-xs px-sm rounded-md border-2 border-accent-default bg-primary-subtle shadow-lg" : "flex items-center gap-xs px-sm rounded-md border-2 border-dotted border-accent-default bg-neutral-subtle shadow-lg";
5
+ return /*#__PURE__*/ react.createElement("div", {
6
+ className: containerClass,
7
+ style: {
8
+ height: 28
9
+ }
10
+ }, icon && /*#__PURE__*/ react.createElement(Icon, {
11
+ icon: icon,
12
+ label: label,
13
+ color: "neutral-strong",
14
+ size: "sm"
15
+ }), /*#__PURE__*/ react.createElement("span", {
16
+ className: "text-sm font-medium whitespace-nowrap text-neutral-primary"
17
+ }, label));
18
+ };
19
+ export { DragCursor };
20
+
21
+ //# sourceMappingURL=DragCursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DragCursor/DragCursor.js","sources":["../../src/DragCursor/DragCursor.tsx"],"sourcesContent":["import React from \"react\";\nimport { Icon } from \"~/Icon/index.js\";\n\nexport interface DragCursorProps {\n label: string;\n icon?: React.ReactNode;\n isOverSlot?: boolean;\n}\n\nexport const DragCursor = ({ label, icon, isOverSlot = false }: DragCursorProps) => {\n const containerClass = isOverSlot\n ? \"flex items-center gap-xs px-sm rounded-md border-2 border-accent-default bg-primary-subtle shadow-lg\"\n : \"flex items-center gap-xs px-sm rounded-md border-2 border-dotted border-accent-default bg-neutral-subtle shadow-lg\";\n\n return (\n <div className={containerClass} style={{ height: 28 }}>\n {icon && <Icon icon={icon} label={label} color={\"neutral-strong\"} size={\"sm\"} />}\n <span className={\"text-sm font-medium whitespace-nowrap text-neutral-primary\"}>\n {label}\n </span>\n </div>\n );\n};\n"],"names":["DragCursor","label","icon","isOverSlot","containerClass","Icon"],"mappings":";;AASO,MAAMA,aAAa,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAEC,aAAa,KAAK,EAAmB;IAC3E,MAAMC,iBAAiBD,aACjB,yGACA;IAEN,OAAO,WAAP,GACI,oBAAC;QAAI,WAAWC;QAAgB,OAAO;YAAE,QAAQ;QAAG;OAC/CF,QAAQ,WAARA,GAAQ,oBAACG,MAAIA;QAAC,MAAMH;QAAM,OAAOD;QAAO,OAAO;QAAkB,MAAM;sBACxE,oBAAC;QAAK,WAAW;OACZA;AAIjB"}
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { DragCursor } from "./DragCursor.js";
3
+ declare const meta: Meta<typeof DragCursor>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof DragCursor>;
6
+ export declare const OnDrag: Story;
7
+ export declare const OnSlot: Story;
8
+ export declare const NoIcon: Story;
9
+ export declare const NoIconOnSlot: Story;
10
+ export declare const AllVariants: Story;
@@ -0,0 +1,97 @@
1
+ import react from "react";
2
+ import { ReactComponent } from "@webiny/icons/text_fields.svg";
3
+ import { ReactComponent as image_svg_ReactComponent } from "@webiny/icons/image.svg";
4
+ import { ReactComponent as smart_button_svg_ReactComponent } from "@webiny/icons/smart_button.svg";
5
+ import { DragCursor } from "./DragCursor.js";
6
+ const meta = {
7
+ title: "Components/DragCursor",
8
+ component: DragCursor,
9
+ parameters: {
10
+ layout: "padded"
11
+ },
12
+ argTypes: {
13
+ label: {
14
+ control: "text"
15
+ },
16
+ isOverSlot: {
17
+ control: "boolean"
18
+ },
19
+ icon: {
20
+ control: false
21
+ }
22
+ }
23
+ };
24
+ const DragCursor_stories = meta;
25
+ const OnDrag = {
26
+ args: {
27
+ label: "Header",
28
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
29
+ isOverSlot: false
30
+ }
31
+ };
32
+ const OnSlot = {
33
+ args: {
34
+ ...OnDrag.args,
35
+ isOverSlot: true
36
+ }
37
+ };
38
+ const NoIcon = {
39
+ args: {
40
+ label: "Header",
41
+ isOverSlot: false
42
+ }
43
+ };
44
+ const NoIconOnSlot = {
45
+ args: {
46
+ ...NoIcon.args,
47
+ isOverSlot: true
48
+ }
49
+ };
50
+ const AllVariants = {
51
+ args: OnDrag.args,
52
+ render: ()=>/*#__PURE__*/ react.createElement("div", {
53
+ className: "flex flex-col gap-md"
54
+ }, /*#__PURE__*/ react.createElement("div", {
55
+ className: "flex items-center gap-md"
56
+ }, /*#__PURE__*/ react.createElement(DragCursor, {
57
+ label: "Header",
58
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
59
+ isOverSlot: false
60
+ }), /*#__PURE__*/ react.createElement(DragCursor, {
61
+ label: "Header",
62
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
63
+ isOverSlot: true
64
+ })), /*#__PURE__*/ react.createElement("div", {
65
+ className: "flex items-center gap-md"
66
+ }, /*#__PURE__*/ react.createElement(DragCursor, {
67
+ label: "Image",
68
+ icon: /*#__PURE__*/ react.createElement(image_svg_ReactComponent, null),
69
+ isOverSlot: false
70
+ }), /*#__PURE__*/ react.createElement(DragCursor, {
71
+ label: "Image",
72
+ icon: /*#__PURE__*/ react.createElement(image_svg_ReactComponent, null),
73
+ isOverSlot: true
74
+ })), /*#__PURE__*/ react.createElement("div", {
75
+ className: "flex items-center gap-md"
76
+ }, /*#__PURE__*/ react.createElement(DragCursor, {
77
+ label: "Button",
78
+ icon: /*#__PURE__*/ react.createElement(smart_button_svg_ReactComponent, null),
79
+ isOverSlot: false
80
+ }), /*#__PURE__*/ react.createElement(DragCursor, {
81
+ label: "Button",
82
+ icon: /*#__PURE__*/ react.createElement(smart_button_svg_ReactComponent, null),
83
+ isOverSlot: true
84
+ })), /*#__PURE__*/ react.createElement("div", {
85
+ className: "flex items-center gap-md"
86
+ }, /*#__PURE__*/ react.createElement(DragCursor, {
87
+ label: "No icon",
88
+ isOverSlot: false
89
+ }), /*#__PURE__*/ react.createElement(DragCursor, {
90
+ label: "No icon",
91
+ isOverSlot: true
92
+ })))
93
+ };
94
+ export default DragCursor_stories;
95
+ export { AllVariants, NoIcon, NoIconOnSlot, OnDrag, OnSlot };
96
+
97
+ //# sourceMappingURL=DragCursor.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DragCursor/DragCursor.stories.js","sources":["../../src/DragCursor/DragCursor.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { ReactComponent as TextIcon } from \"@webiny/icons/text_fields.svg\";\nimport { ReactComponent as ImageIcon } from \"@webiny/icons/image.svg\";\nimport { ReactComponent as ButtonIcon } from \"@webiny/icons/smart_button.svg\";\nimport { DragCursor } from \"./DragCursor.js\";\n\nconst meta: Meta<typeof DragCursor> = {\n title: \"Components/DragCursor\",\n component: DragCursor,\n parameters: {\n layout: \"padded\"\n },\n argTypes: {\n label: { control: \"text\" },\n isOverSlot: { control: \"boolean\" },\n icon: { control: false }\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof DragCursor>;\n\nexport const OnDrag: Story = {\n args: {\n label: \"Header\",\n icon: <TextIcon />,\n isOverSlot: false\n }\n};\n\nexport const OnSlot: Story = {\n args: {\n ...OnDrag.args,\n isOverSlot: true\n }\n};\n\nexport const NoIcon: Story = {\n args: {\n label: \"Header\",\n isOverSlot: false\n }\n};\n\nexport const NoIconOnSlot: Story = {\n args: {\n ...NoIcon.args,\n isOverSlot: true\n }\n};\n\nexport const AllVariants: Story = {\n args: OnDrag.args,\n render: () => (\n <div className={\"flex flex-col gap-md\"}>\n <div className={\"flex items-center gap-md\"}>\n <DragCursor label={\"Header\"} icon={<TextIcon />} isOverSlot={false} />\n <DragCursor label={\"Header\"} icon={<TextIcon />} isOverSlot={true} />\n </div>\n <div className={\"flex items-center gap-md\"}>\n <DragCursor label={\"Image\"} icon={<ImageIcon />} isOverSlot={false} />\n <DragCursor label={\"Image\"} icon={<ImageIcon />} isOverSlot={true} />\n </div>\n <div className={\"flex items-center gap-md\"}>\n <DragCursor label={\"Button\"} icon={<ButtonIcon />} isOverSlot={false} />\n <DragCursor label={\"Button\"} icon={<ButtonIcon />} isOverSlot={true} />\n </div>\n <div className={\"flex items-center gap-md\"}>\n <DragCursor label={\"No icon\"} isOverSlot={false} />\n <DragCursor label={\"No icon\"} isOverSlot={true} />\n </div>\n </div>\n )\n};\n"],"names":["meta","DragCursor","OnDrag","TextIcon","OnSlot","NoIcon","NoIconOnSlot","AllVariants","ImageIcon","ButtonIcon"],"mappings":";;;;;AAOA,MAAMA,OAAgC;IAClC,OAAO;IACP,WAAWC;IACX,YAAY;QACR,QAAQ;IACZ;IACA,UAAU;QACN,OAAO;YAAE,SAAS;QAAO;QACzB,YAAY;YAAE,SAAS;QAAU;QACjC,MAAM;YAAE,SAAS;QAAM;IAC3B;AACJ;AAEA,2BAAeD;AAGR,MAAME,SAAgB;IACzB,MAAM;QACF,OAAO;QACP,MAAM,WAAN,GAAM,oBAACC,gBAAQA;QACf,YAAY;IAChB;AACJ;AAEO,MAAMC,SAAgB;IACzB,MAAM;QACF,GAAGF,OAAO,IAAI;QACd,YAAY;IAChB;AACJ;AAEO,MAAMG,SAAgB;IACzB,MAAM;QACF,OAAO;QACP,YAAY;IAChB;AACJ;AAEO,MAAMC,eAAsB;IAC/B,MAAM;QACF,GAAGD,OAAO,IAAI;QACd,YAAY;IAChB;AACJ;AAEO,MAAME,cAAqB;IAC9B,MAAML,OAAO,IAAI;IACjB,QAAQ,kBACJ,oBAAC;YAAI,WAAW;yBACZ,oBAAC;YAAI,WAAW;yBACZ,oBAACD,YAAUA;YAAC,OAAO;YAAU,oBAAM,oBAACE,gBAAQA;YAAK,YAAY;0BAC7D,oBAACF,YAAUA;YAAC,OAAO;YAAU,oBAAM,oBAACE,gBAAQA;YAAK,YAAY;2BAEjE,oBAAC;YAAI,WAAW;yBACZ,oBAACF,YAAUA;YAAC,OAAO;YAAS,oBAAM,oBAACO,0BAASA;YAAK,YAAY;0BAC7D,oBAACP,YAAUA;YAAC,OAAO;YAAS,oBAAM,oBAACO,0BAASA;YAAK,YAAY;2BAEjE,oBAAC;YAAI,WAAW;yBACZ,oBAACP,YAAUA;YAAC,OAAO;YAAU,oBAAM,oBAACQ,iCAAUA;YAAK,YAAY;0BAC/D,oBAACR,YAAUA;YAAC,OAAO;YAAU,oBAAM,oBAACQ,iCAAUA;YAAK,YAAY;2BAEnE,oBAAC;YAAI,WAAW;yBACZ,oBAACR,YAAUA;YAAC,OAAO;YAAW,YAAY;0BAC1C,oBAACA,YAAUA;YAAC,OAAO;YAAW,YAAY;;AAI1D"}
@@ -0,0 +1 @@
1
+ export * from "./DragCursor.js";
@@ -0,0 +1 @@
1
+ export * from "./DragCursor.js";
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryObj } from "@storybook/react-webpack5";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Drawer } from "./Drawer.js";
3
3
  declare const meta: Meta<typeof Drawer>;
4
4
  export default meta;
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer/Drawer.stories.js","sources":["../../src/Drawer/Drawer.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react-webpack5\";\nimport { Drawer } from \"./Drawer.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { DropdownMenu } from \"~/DropdownMenu/index.js\";\nimport { Tabs } from \"~/Tabs/index.js\";\nimport { ReactComponent as DoorbellIcon } from \"@webiny/icons/ring_volume.svg\";\n\nconst meta: Meta<typeof Drawer> = {\n title: \"Components/Drawer\",\n component: Drawer,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Drawer>;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n title: \"Drawer Title\",\n description: \"A short dialog description.\",\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md\"}>\n The amazing, splendid, and most useful umbrella, resistant to rain and friendly\n to winds, is something that deserves all admiration. Crafted with perfect\n textures, it bravely withstands storms and gently shades the rays of the sun. A\n remarkable innovation, with an ergonomically designed grip most suited to the\n hand, it remains stable even in the fiercest weather.\n </p>\n <p className={\"mb-md\"}>\n Its fabric, woven from the highest quality materials, ensures that you stay dry,\n no matter the intensity of the rain. With a frame engineered for strength yet\n lightweight enough to carry with ease, this umbrella is a marvel of modern\n design. Not just a shield against the elements, but a companion in your everyday\n journey, it provides peace of mind, knowing you’re prepared for whatever the\n skies may bring.\n </p>\n <p className={\"mb-md\"}>\n The sleek, stylish design complements any outfit, making it not only a practical\n accessory but also a fashion statement. With its smooth opening mechanism, you\n can effortlessly transition from a sunny day to a rainy one without missing a\n beat. Whether you are navigating through a busy city street or enjoying a quiet\n stroll in the park, this umbrella offers unmatched comfort and protection.\n </p>\n <p className={\"mb-md\"}>\n Indeed, it is not just an umbrella — it is an experience. One that elevates your\n daily routine, making every step in both sun and storm feel just a little bit\n brighter.\n </p>\n </>\n ),\n onOpenChange: opened => {\n console.log(`Drawer is ${opened ? \"opened\" : \"closed\"}.`);\n },\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true\n },\n argTypes: {}\n};\n\nexport const SizeSmall: Story = {\n args: {\n ...Default.args,\n size: \"sm\"\n }\n};\n\nexport const SizeMedium: Story = {\n args: {\n ...Default.args,\n size: \"md\"\n }\n};\n\nexport const SizeLarge: Story = {\n args: {\n ...Default.args,\n size: \"lg\"\n }\n};\n\nexport const SizeExtraLarge: Story = {\n args: {\n ...Default.args,\n size: \"xl\"\n }\n};\n\nexport const ControlledVisibility: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text={\"Open\"} onClick={() => setOpen(true)} />\n <Drawer\n {...props}\n open={open}\n onOpenChange={open => {\n if (!open) {\n setOpen(false);\n }\n }}\n />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer&apos;s visibility is controlled by the open state.</>\n }\n};\n\nexport const WithOpenCloseEventHandler: Story = {\n args: {\n ...Default.args,\n onClose: () => {\n console.log(\"onClose triggered\");\n },\n onOpen: () => {\n console.log(\"onOpen triggered\");\n }\n }\n};\n\nexport const WithDropdownMenu: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item\n text={\"Open Drawer\"}\n content={\"Open Drawer\"}\n onClick={() => setOpen(true)}\n />\n </DropdownMenu>\n\n <Drawer {...props} open={open} onOpenChange={() => setOpen(false)} />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const WithoutCloseButton: Story = {\n args: {\n ...Default.args,\n showCloseButton: false,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const CustomWidth: Story = {\n args: {\n ...Default.args,\n width: 1000,\n children: <>This drawer has a custom width of 1000px, making it wider than the default.</>\n }\n};\n\nexport const WithTabs: Story = {\n args: {\n ...Default.args,\n bodyPadding: false,\n headerSeparator: false,\n children: (\n <>\n <Tabs\n spacing={\"lg\"}\n tabs={[\n <Tabs.Tab\n key=\"account\"\n value=\"account\"\n trigger={\"Account\"}\n content={\"Make changes to your account here.\"}\n />,\n <Tabs.Tab\n key=\"company\"\n value=\"company\"\n trigger={\"Company\"}\n content={\"Make changes to your company info here.\"}\n />,\n <Tabs.Tab\n key=\"security\"\n value=\"security\"\n trigger={\"Security\"}\n content={\"Make changes to your security settings here.\"}\n />,\n <Tabs.Tab\n key=\"development\"\n value=\"development\"\n trigger={\"Development\"}\n content={\"Make changes to your development settings here.\"}\n />\n ]}\n />\n </>\n )\n }\n};\n\nexport const DropdownMenuInDrawer: Story = {\n args: {\n ...Default.args,\n children: (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item content={\"Billing\"} />\n <DropdownMenu.Item content={\"Settings\"} />\n <DropdownMenu.Item content={\"Keyboard shortcuts\"} />\n </DropdownMenu>\n </>\n )\n }\n};\n\nexport const WithIcon: Story = {\n args: {\n ...Default.args,\n icon: <Drawer.Icon icon={<DoorbellIcon />} label={\"Icon label...\"} />,\n children: <>The icon helps to visually identify the purpose of this drawer.</>\n }\n};\n\nexport const AsModal: Story = {\n args: {\n ...Default.args,\n modal: true,\n children: (\n <>\n This drawer has modal=true, which means it will show an overlay behind it and\n prevent interaction with the content underneath.\n </>\n )\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text=\"Open Drawer\" onClick={() => setOpen(true)} />\n\n <Drawer {...args} open={open} onOpenChange={open => setOpen(open)} />\n </>\n );\n },\n args: {\n title: \"Drawer Title\",\n description: \"A short drawer description.\",\n showCloseButton: true,\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true,\n side: \"right\",\n modal: false,\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md, mt-md\"}>\n This is the drawer content area. You can place any content here including forms,\n text, images, or other components.\n </p>\n <p className={\"mb-md\"}>\n Drawers are useful for displaying additional information or actions without\n navigating away from the current page.\n </p>\n </>\n ),\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n width: undefined\n },\n argTypes: {\n title: {\n description: \"Title displayed in the header\",\n control: \"text\"\n },\n description: {\n description: \"Description displayed below the title\",\n control: \"text\"\n },\n side: {\n description: \"Side from which the drawer appears\",\n control: \"select\",\n options: [\"left\", \"right\"],\n defaultValue: \"right\"\n },\n size: {\n description: \"Controls the size of the drawer\",\n control: \"select\",\n options: [\"sm\", \"md\", \"lg\", \"xl\"],\n defaultValue: \"md\"\n },\n showCloseButton: {\n description: \"Show close button in the top-right corner\",\n control: \"boolean\",\n defaultValue: true\n },\n modal: {\n description: \"Whether the drawer should behave as a modal\",\n control: \"boolean\",\n defaultValue: false\n },\n bodyPadding: {\n description: \"Add padding to the drawer body\",\n control: \"boolean\",\n defaultValue: true\n },\n headerSeparator: {\n description: \"Show separator below the header\",\n control: \"boolean\",\n defaultValue: true\n },\n footerSeparator: {\n description: \"Show separator above the footer\",\n control: \"boolean\",\n defaultValue: true\n },\n width: {\n description:\n 'Width defines the horizontal size of the Drawer and accepts any valid CSS width value. You can pass a number (interpreted as pixels) or a string like \"80%\", \"50vw\", \"auto\", etc., following React.CSSProperties[\"width\"] types.'\n },\n info: {\n description:\n \"Additional info displayed below the description, please refer to the example below for details.\"\n },\n children: {\n description:\n \"Content of the Drawer, please refer to the 'With Dropdown Menu' and ''With Tabs' example below for details.\"\n },\n actions: {\n description:\n \"Actions displayed in the footer, please refer to the code example for details.\"\n }\n }\n};\n"],"names":["meta","Drawer","Default","Button","opened","console","SizeSmall","SizeMedium","SizeLarge","SizeExtraLarge","ControlledVisibility","props","open","setOpen","React","WithOpenCloseEventHandler","WithDropdownMenu","DropdownMenu","WithoutCloseButton","CustomWidth","WithTabs","Tabs","DropdownMenuInDrawer","WithIcon","DoorbellIcon","AsModal","Documentation","args","undefined"],"mappings":";;;;;;AAQA,MAAMA,OAA4B;IAC9B,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,uBAAeD;AAIR,MAAME,UAAiB;IAC1B,MAAM;QACF,SAAS,WAAT,GAAS,oBAACC,QAAMA;YAAC,SAAQ;YAAU,MAAM;;QACzC,OAAO;QACP,aAAa;QACb,MAAM,WAAN,GACI,0CAAE,wCACwB,oBAAC;YAAE,MAAM;WAAK,SAAQ;QAGpD,UAAU,WAAV,GACI,wDACI,oBAAC;YAAE,WAAW;WAAS,gYAOvB,oBAAC;YAAE,WAAW;WAAS,2aAQvB,oBAAC;YAAE,WAAW;WAAS,2ZAOvB,oBAAC;YAAE,WAAW;WAAS;QAO/B,cAAcC,CAAAA;YACVC,QAAQ,GAAG,CAAC,CAAC,UAAU,EAAED,SAAS,WAAW,SAAS,CAAC,CAAC;QAC5D;QACA,SAAS,WAAT,GACI,wDACI,oBAACH,OAAO,YAAY,uBACpB,oBAACA,OAAO,aAAa;QAG7B,aAAa;QACb,iBAAiB;QACjB,iBAAiB;IACrB;IACA,UAAU,CAAC;AACf;AAEO,MAAMK,YAAmB;IAC5B,MAAM;QACF,GAAGJ,QAAQ,IAAI;QACf,MAAM;IACV;AACJ;AAEO,MAAMK,aAAoB;IAC7B,MAAM;QACF,GAAGL,QAAQ,IAAI;QACf,MAAM;IACV;AACJ;AAEO,MAAMM,YAAmB;IAC5B,MAAM;QACF,GAAGN,QAAQ,IAAI;QACf,MAAM;IACV;AACJ;AAEO,MAAMO,iBAAwB;IACjC,MAAM;QACF,GAAGP,QAAQ,IAAI;QACf,MAAM;IACV;AACJ;AAEO,MAAMQ,uBAA8B;IACvC,QAAQC,CAAAA;QACJ,MAAM,CAACC,MAAMC,QAAQ,GAAGC,MAAAA,QAAc,CAAC;QA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I;YAAE,MAAMf;YAAM,cAAcA,CAAAA,OAAQC,QAAQD;;IAGxE;IACA,MAAM;QACF,OAAO;QACP,aAAa;QACb,iBAAiB;QACjB,aAAa;QACb,iBAAiB;QACjB,iBAAiB;QACjB,MAAM;QACN,OAAO;QACP,MAAM,WAAN,GACI,0CAAE,wCACwB,oBAAC;YAAE,MAAM;WAAK,SAAQ;QAGpD,UAAU,WAAV,GACI,wDACI,oBAAC;YAAE,WAAW;WAAgB,sIAI9B,oBAAC;YAAE,WAAW;WAAS;QAM/B,SAAS,WAAT,GACI,wDACI,oBAACX,OAAO,YAAY,uBACpB,oBAACA,OAAO,aAAa;QAG7B,OAAO2B;IACX;IACA,UAAU;QACN,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAQ;aAAQ;YAC1B,cAAc;QAClB;QACA,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAM;gBAAM;gBAAM;aAAK;YACjC,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,OAAO;YACH,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,aAAa;YACT,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,OAAO;YACH,aACI;QACR;QACA,MAAM;YACF,aACI;QACR;QACA,UAAU;YACN,aACI;QACR;QACA,SAAS;YACL,aACI;QACR;IACJ;AACJ"}
1
+ {"version":3,"file":"Drawer/Drawer.stories.js","sources":["../../src/Drawer/Drawer.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Drawer } from \"./Drawer.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { DropdownMenu } from \"~/DropdownMenu/index.js\";\nimport { Tabs } from \"~/Tabs/index.js\";\nimport { ReactComponent as DoorbellIcon } from \"@webiny/icons/ring_volume.svg\";\n\nconst meta: Meta<typeof Drawer> = {\n title: \"Components/Drawer\",\n component: Drawer,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Drawer>;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n title: \"Drawer Title\",\n description: \"A short dialog description.\",\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md\"}>\n The amazing, splendid, and most useful umbrella, resistant to rain and friendly\n to winds, is something that deserves all admiration. Crafted with perfect\n textures, it bravely withstands storms and gently shades the rays of the sun. A\n remarkable innovation, with an ergonomically designed grip most suited to the\n hand, it remains stable even in the fiercest weather.\n </p>\n <p className={\"mb-md\"}>\n Its fabric, woven from the highest quality materials, ensures that you stay dry,\n no matter the intensity of the rain. With a frame engineered for strength yet\n lightweight enough to carry with ease, this umbrella is a marvel of modern\n design. Not just a shield against the elements, but a companion in your everyday\n journey, it provides peace of mind, knowing you’re prepared for whatever the\n skies may bring.\n </p>\n <p className={\"mb-md\"}>\n The sleek, stylish design complements any outfit, making it not only a practical\n accessory but also a fashion statement. With its smooth opening mechanism, you\n can effortlessly transition from a sunny day to a rainy one without missing a\n beat. Whether you are navigating through a busy city street or enjoying a quiet\n stroll in the park, this umbrella offers unmatched comfort and protection.\n </p>\n <p className={\"mb-md\"}>\n Indeed, it is not just an umbrella — it is an experience. One that elevates your\n daily routine, making every step in both sun and storm feel just a little bit\n brighter.\n </p>\n </>\n ),\n onOpenChange: opened => {\n console.log(`Drawer is ${opened ? \"opened\" : \"closed\"}.`);\n },\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true\n },\n argTypes: {}\n};\n\nexport const SizeSmall: Story = {\n args: {\n ...Default.args,\n size: \"sm\"\n }\n};\n\nexport const SizeMedium: Story = {\n args: {\n ...Default.args,\n size: \"md\"\n }\n};\n\nexport const SizeLarge: Story = {\n args: {\n ...Default.args,\n size: \"lg\"\n }\n};\n\nexport const SizeExtraLarge: Story = {\n args: {\n ...Default.args,\n size: \"xl\"\n }\n};\n\nexport const ControlledVisibility: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text={\"Open\"} onClick={() => setOpen(true)} />\n <Drawer\n {...props}\n open={open}\n onOpenChange={open => {\n if (!open) {\n setOpen(false);\n }\n }}\n />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer&apos;s visibility is controlled by the open state.</>\n }\n};\n\nexport const WithOpenCloseEventHandler: Story = {\n args: {\n ...Default.args,\n onClose: () => {\n console.log(\"onClose triggered\");\n },\n onOpen: () => {\n console.log(\"onOpen triggered\");\n }\n }\n};\n\nexport const WithDropdownMenu: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item\n text={\"Open Drawer\"}\n content={\"Open Drawer\"}\n onClick={() => setOpen(true)}\n />\n </DropdownMenu>\n\n <Drawer {...props} open={open} onOpenChange={() => setOpen(false)} />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const WithoutCloseButton: Story = {\n args: {\n ...Default.args,\n showCloseButton: false,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const CustomWidth: Story = {\n args: {\n ...Default.args,\n width: 1000,\n children: <>This drawer has a custom width of 1000px, making it wider than the default.</>\n }\n};\n\nexport const WithTabs: Story = {\n args: {\n ...Default.args,\n bodyPadding: false,\n headerSeparator: false,\n children: (\n <>\n <Tabs\n spacing={\"lg\"}\n tabs={[\n <Tabs.Tab\n key=\"account\"\n value=\"account\"\n trigger={\"Account\"}\n content={\"Make changes to your account here.\"}\n />,\n <Tabs.Tab\n key=\"company\"\n value=\"company\"\n trigger={\"Company\"}\n content={\"Make changes to your company info here.\"}\n />,\n <Tabs.Tab\n key=\"security\"\n value=\"security\"\n trigger={\"Security\"}\n content={\"Make changes to your security settings here.\"}\n />,\n <Tabs.Tab\n key=\"development\"\n value=\"development\"\n trigger={\"Development\"}\n content={\"Make changes to your development settings here.\"}\n />\n ]}\n />\n </>\n )\n }\n};\n\nexport const DropdownMenuInDrawer: Story = {\n args: {\n ...Default.args,\n children: (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item content={\"Billing\"} />\n <DropdownMenu.Item content={\"Settings\"} />\n <DropdownMenu.Item content={\"Keyboard shortcuts\"} />\n </DropdownMenu>\n </>\n )\n }\n};\n\nexport const WithIcon: Story = {\n args: {\n ...Default.args,\n icon: <Drawer.Icon icon={<DoorbellIcon />} label={\"Icon label...\"} />,\n children: <>The icon helps to visually identify the purpose of this drawer.</>\n }\n};\n\nexport const AsModal: Story = {\n args: {\n ...Default.args,\n modal: true,\n children: (\n <>\n This drawer has modal=true, which means it will show an overlay behind it and\n prevent interaction with the content underneath.\n </>\n )\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text=\"Open Drawer\" onClick={() => setOpen(true)} />\n\n <Drawer {...args} open={open} onOpenChange={open => setOpen(open)} />\n </>\n );\n },\n args: {\n title: \"Drawer Title\",\n description: \"A short drawer description.\",\n showCloseButton: true,\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true,\n side: \"right\",\n modal: false,\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md, mt-md\"}>\n This is the drawer content area. You can place any content here including forms,\n text, images, or other components.\n </p>\n <p className={\"mb-md\"}>\n Drawers are useful for displaying additional information or actions without\n navigating away from the current page.\n </p>\n </>\n ),\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n width: undefined\n },\n argTypes: {\n title: {\n description: \"Title displayed in the header\",\n control: \"text\"\n },\n description: {\n description: \"Description displayed below the title\",\n control: \"text\"\n },\n side: {\n description: \"Side from which the drawer appears\",\n control: \"select\",\n options: [\"left\", \"right\"],\n defaultValue: \"right\"\n },\n size: {\n description: \"Controls the size of the drawer\",\n control: \"select\",\n options: [\"sm\", \"md\", \"lg\", \"xl\"],\n defaultValue: \"md\"\n },\n showCloseButton: {\n description: \"Show close button in the top-right corner\",\n control: \"boolean\",\n defaultValue: true\n },\n modal: {\n description: \"Whether the drawer should behave as a modal\",\n control: \"boolean\",\n defaultValue: false\n },\n bodyPadding: {\n description: \"Add padding to the drawer body\",\n control: \"boolean\",\n defaultValue: true\n },\n headerSeparator: {\n description: \"Show separator below the header\",\n control: \"boolean\",\n defaultValue: true\n },\n footerSeparator: {\n description: \"Show separator above the footer\",\n control: \"boolean\",\n defaultValue: true\n },\n width: {\n description:\n 'Width defines the horizontal size of the Drawer and accepts any valid CSS width value. You can pass a number (interpreted as pixels) or a string like \"80%\", \"50vw\", \"auto\", etc., following React.CSSProperties[\"width\"] types.'\n },\n info: {\n description:\n \"Additional info displayed below the description, please refer to the example below for details.\"\n },\n children: {\n description:\n \"Content of the Drawer, please refer to the 'With Dropdown Menu' and ''With Tabs' example below for details.\"\n },\n actions: {\n description:\n \"Actions displayed in the footer, please refer to the code example for details.\"\n }\n }\n};\n"],"names":["meta","Drawer","Default","Button","opened","console","SizeSmall","SizeMedium","SizeLarge","SizeExtraLarge","ControlledVisibility","props","open","setOpen","React","WithOpenCloseEventHandler","WithDropdownMenu","DropdownMenu","WithoutCloseButton","CustomWidth","WithTabs","Tabs","DropdownMenuInDrawer","WithIcon","DoorbellIcon","AsModal","Documentation","args","undefined"],"mappings":";;;;;;AAQA,MAAMA,O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jB,MAAM;QACN,OAAO;QACP,MAAM,WAAN,GACI,0CAAE,wCACwB,oBAAC;YAAE,MAAM;WAAK,SAAQ;QAGpD,UAAU,WAAV,GACI,wDACI,oBAAC;YAAE,WAAW;WAAgB,sIAI9B,oBAAC;YAAE,WAAW;WAAS;QAM/B,SAAS,WAAT,GACI,wDACI,oBAACX,OAAO,YAAY,uBACpB,oBAACA,OAAO,aAAa;QAG7B,OAAO2B;IACX;IACA,UAAU;QACN,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAQ;aAAQ;YAC1B,cAAc;QAClB;QACA,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAM;gBAAM;gBAAM;aAAK;YACjC,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,OAAO;YACH,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,aAAa;YACT,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,OAAO;YACH,aACI;QACR;QACA,MAAM;YACF,aACI;QACR;QACA,UAAU;YACN,aACI;QACR;QACA,SAAS;YACL,aACI;QACR;IACJ;AACJ"}
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryObj } from "@storybook/react-webpack5";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { DropdownMenu } from "./DropdownMenu.js";
3
3
  declare const meta: Meta<typeof DropdownMenu>;
4
4
  export default meta;