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

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":"DropdownMenu/DropdownMenu.stories.js","sources":["../../src/DropdownMenu/DropdownMenu.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react-webpack5\";\nimport { DropdownMenu } from \"./DropdownMenu.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { ReactComponent as Cloud } from \"@webiny/icons/cloud.svg\";\nimport { ReactComponent as LogOut } from \"@webiny/icons/logout.svg\";\nimport { ReactComponent as LifeBuoy } from \"@webiny/icons/safety_check.svg\";\nimport { ReactComponent as CreditCard } from \"@webiny/icons/credit_score.svg\";\nimport { ReactComponent as Plus } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as PlusCircle } from \"@webiny/icons/add_circle.svg\";\nimport { ReactComponent as Settings } from \"@webiny/icons/settings.svg\";\nimport { ReactComponent as Users } from \"@webiny/icons/people.svg\";\nimport { ReactComponent as UserPlus } from \"@webiny/icons/person_add.svg\";\nimport { ReactComponent as User } from \"@webiny/icons/person.svg\";\nimport { ReactComponent as Keyboard } from \"@webiny/icons/keyboard.svg\";\nimport { ReactComponent as Mail } from \"@webiny/icons/mail.svg\";\nimport { ReactComponent as MessageSquare } from \"@webiny/icons/chat_bubble.svg\";\nimport { ReactComponent as LinkIcon } from \"@webiny/icons/link.svg\";\nimport { Text } from \"~/Text/index.js\";\n\nconst meta: Meta<typeof DropdownMenu> = {\n title: \"Components/Dropdown Menu\",\n component: DropdownMenu,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof DropdownMenu>;\n\nconst { Label, Separator, Group, Item, Link, CheckboxItem } = DropdownMenu;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2 (target: _blank)\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n target={\"_blank\"}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const SimpleMenuWithIcons: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithSubMenus: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon element={<User />} label={\"Profile\"} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon label={\"Team\"} element={<Users />} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon label={\"Invite user\"} element={<UserPlus />} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nconst TARGET_LEVELS = [\n {\n id: \"viewer\",\n label: \"Viewer\",\n description: \"Can view content, but not modify it\"\n },\n {\n id: \"editor\",\n label: \"Editor\",\n description: \"Can view and modify content\"\n },\n {\n id: \"owner\",\n label: \"Owner\",\n description: \"Can edit and manage content permissions\"\n }\n];\n\nexport const WithCheckboxItems: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n {TARGET_LEVELS.map(level => (\n <CheckboxItem\n key={level.id}\n checked={level.id === \"viewer\"}\n text={\n <div>\n <Text as={\"div\"}>{level.label}</Text>\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong\"}>\n {level.description}\n </Text>\n </div>\n }\n onClick={() => {\n console.log(\"Selected level:\", level.id);\n }}\n />\n ))}\n <DropdownMenu.Separator />\n <DropdownMenu.Item text={\"Remove access\"} />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithOnOpenChange: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n onOpenChange: opened => {\n console.log(`Menu is ${opened ? \"opened\" : \"closed\"}.`);\n },\n children: (\n <>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const Documentation: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {\n trigger: {\n description:\n \"The trigger element that opens the menu. Please refer to the example code for details.\"\n },\n children: {\n description: \"The content of the menu. Please refer to the example code for details.\"\n }\n }\n};\n"],"names":["meta","DropdownMenu","Label","Separator","Group","Item","Link","CheckboxItem","Default","Button","User","CreditCard","Settings","Keyboard","Users","UserPlus","Mail","MessageSquare","PlusCircle","Plus","LifeBuoy","Cloud","LogOut","LinkIcon","SimpleMenuWithIcons","WithSubMenus","TARGET_LEVELS","WithCheckboxItems","level","Text","console","WithOnOpenChange","opened","Documentation"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,MAAMA,OAAkC;IACpC,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,6BAAeD;AAIf,MAAM,EAAEE,OAAAA,KAAK,EAAEC,WAAAA,SAAS,EAAEC,OAAAA,KAAK,EAAEC,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAEC,cAAAA,YAAY,EAAE,GAAGN;AAEvD,MAAMO,UAAiB;IAC1B,MAAM;QACF,SAAS,WAAT,GAAS,oBAACC,QAAMA;YAAC,SAAQ;YAAU,MAAM;;QACzC,UAAU,WAAV,GACI,wDACI,oBAACP,OAAKA;YAAC,MAAM;0BACb,oBAACG,MAAIA;YAAC,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAO;gBAAW,uBAAS,oBAACK,2BAAIA;;YAAS,MAAM;0BACtE,oBAACN,OAAKA,MAAAA,WAAAA,GACF,oBAACC,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACM,iCAAUA;gBAAK,OAAO;;YACjD,MAAM;0BAEV,oBAACN,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACO,6BAAQA;gBAAK,OAAO;;YAC/C,MAAM;0BAEV,oBAACP,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACQ,6BAAQA;gBAAK,OAAO;;YAC/C,MAAM;2BAGd,oBAACV,WAASA,OAAAA,WAAAA,GACV,oBAACC,OAAKA,MAAAA,WAAAA,GACF,oBAACC,MAAIA;YAAC,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACS,2BAAKA;gBAAK,OAAO;;YAAY,MAAM;0BACpE,oBAACT,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACU,+BAAQA;gBAAK,OAAO;;YAC/C,MAAM;yBAE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AACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;0BAEtD,oBAACjB,MAAIA;YACD,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;;IAIlE;IACA,UAAU;QACN,SAAS;YACL,aACI;QACR;QACA,UAAU;YACN,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"file":"DropdownMenu/DropdownMenu.stories.js","sources":["../../src/DropdownMenu/DropdownMenu.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { DropdownMenu } from \"./DropdownMenu.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { ReactComponent as Cloud } from \"@webiny/icons/cloud.svg\";\nimport { ReactComponent as LogOut } from \"@webiny/icons/logout.svg\";\nimport { ReactComponent as LifeBuoy } from \"@webiny/icons/safety_check.svg\";\nimport { ReactComponent as CreditCard } from \"@webiny/icons/credit_score.svg\";\nimport { ReactComponent as Plus } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as PlusCircle } from \"@webiny/icons/add_circle.svg\";\nimport { ReactComponent as Settings } from \"@webiny/icons/settings.svg\";\nimport { ReactComponent as Users } from \"@webiny/icons/people.svg\";\nimport { ReactComponent as UserPlus } from \"@webiny/icons/person_add.svg\";\nimport { ReactComponent as User } from \"@webiny/icons/person.svg\";\nimport { ReactComponent as Keyboard } from \"@webiny/icons/keyboard.svg\";\nimport { ReactComponent as Mail } from \"@webiny/icons/mail.svg\";\nimport { ReactComponent as MessageSquare } from \"@webiny/icons/chat_bubble.svg\";\nimport { ReactComponent as LinkIcon } from \"@webiny/icons/link.svg\";\nimport { Text } from \"~/Text/index.js\";\n\nconst meta: Meta<typeof DropdownMenu> = {\n title: \"Components/Dropdown Menu\",\n component: DropdownMenu,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof DropdownMenu>;\n\nconst { Label, Separator, Group, Item, Link, CheckboxItem } = DropdownMenu;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2 (target: _blank)\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n target={\"_blank\"}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const SimpleMenuWithIcons: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithSubMenus: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon element={<User />} label={\"Profile\"} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon label={\"Team\"} element={<Users />} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon label={\"Invite user\"} element={<UserPlus />} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nconst TARGET_LEVELS = [\n {\n id: \"viewer\",\n label: \"Viewer\",\n description: \"Can view content, but not modify it\"\n },\n {\n id: \"editor\",\n label: \"Editor\",\n description: \"Can view and modify content\"\n },\n {\n id: \"owner\",\n label: \"Owner\",\n description: \"Can edit and manage content permissions\"\n }\n];\n\nexport const WithCheckboxItems: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n {TARGET_LEVELS.map(level => (\n <CheckboxItem\n key={level.id}\n checked={level.id === \"viewer\"}\n text={\n <div>\n <Text as={\"div\"}>{level.label}</Text>\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong\"}>\n {level.description}\n </Text>\n </div>\n }\n onClick={() => {\n console.log(\"Selected level:\", level.id);\n }}\n />\n ))}\n <DropdownMenu.Separator />\n <DropdownMenu.Item text={\"Remove access\"} />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithOnOpenChange: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n onOpenChange: opened => {\n console.log(`Menu is ${opened ? \"opened\" : \"closed\"}.`);\n },\n children: (\n <>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const Documentation: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {\n trigger: {\n description:\n \"The trigger element that opens the menu. Please refer to the example code for details.\"\n },\n children: {\n description: \"The content of the menu. Please refer to the example code for details.\"\n }\n }\n};\n"],"names":["meta","DropdownMenu","Label","Separator","Group","Item","Link","CheckboxItem","Default","Button","User","CreditCard","Settings","Keyboard","Users","UserPlus","Mail","MessageSquare","PlusCircle","Plus","LifeBuoy","Cloud","LogOut","LinkIcon","SimpleMenuWithIcons","WithSubMenus","TARGET_LEVELS","WithCheckboxItems","level","Text","console","WithOnOpenChange","opened","Documentation"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,MAAMA,OAAkC;IACpC,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,6BAAeD;AAIf,MAAM,EAAEE,OAAAA,KAAK,EAAEC,WAAAA,SAAS,EAAEC,OAAAA,KAAK,EAAEC,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAEC,cAAAA,YAAY,EAAE,GAAGN;AAEvD,MAAMO,UAAiB;IAC1B,MAAM;QACF,SAAS,WAAT,GAAS,oBAACC,QAAMA;YAAC,SAAQ;YAAU,MAAM;;QACzC,UAAU,WAAV,GACI,wDACI,oBAACP,OAAKA;YAAC,MAAM;0BACb,oBAACG,MAAIA;YAAC,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAO;gBAAW,uBAAS,oBAACK,2BAAIA;;YAAS,MAAM;0BACtE,oBAACN,OAAKA,MAAAA,WAAAA,GACF,oBAACC,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACM,iCAAUA;gBAAK,OAAO;;YACjD,MAAM;0BAEV,oBAACN,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBA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OAAO;gBAAO,uBAAS,oBAACgB,gBAAKA;;YAC9C,MAAM;YACN;0BAEJ,oBAAClB,WAASA,OAAAA,WAAAA,GACV,oBAACE,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAO;gBAAW,uBAAS,oBAACiB,2BAAMA;;YACnD,MAAM;0BAEV,oBAACnB,WAASA,OAAAA,WAAAA,GACV,oBAACD,OAAKA;YAAC,MAAM;0BACb,oBAACI,MAAIA;YACD,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;0BAEtD,oBAACjB,MAAIA;YACD,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;0BAEtD,oBAACjB,MAAIA;YACD,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;;IAIlE;IACA,UAAU;QACN,SAAS;YACL,aACI;QACR;QACA,UAAU;YACN,aAAa;QACjB;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 { FilePicker } from "../FilePicker/index.js";
3
3
  declare const meta: Meta<typeof FilePicker>;
4
4
  export default meta;
@@ -1 +1 @@
1
- {"version":3,"file":"FilePicker/FilePicker.stories.js","sources":["../../src/FilePicker/FilePicker.stories.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react-webpack5\";\nimport { type FileItemDto, FilePicker } from \"~/FilePicker/index.js\";\n\nconst getRandomNumber = (min: number, max: number): number =>\n Math.floor(Math.random() * (max - min + 1)) + min;\n\nconst getFile = (): FileItemDto => {\n const width = getRandomNumber(500, 2000); // Random width between 500 and 2000\n const height = getRandomNumber(500, 2000); // Random height between 500 and 2000\n const fileSize = getRandomNumber(500000, 5000000); // Random file size between 500KB and 5MB\n\n return {\n name: \"selected-file.jpg\",\n mimeType: \"image/jpeg\",\n size: fileSize,\n url: `https://picsum.photos/${width}/${height}`\n };\n};\n\nconst meta: Meta<typeof FilePicker> = {\n title: \"Components/Form/FilePicker\",\n component: FilePicker,\n argTypes: {\n onSelectItem: { action: \"onSelectItem\" },\n onEditItem: { action: \"onEditItem\" },\n onRemoveItem: { action: \"onRemoveItem\" },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [selectedFile, setSelectedFile] = useState(args.value);\n return (\n <FilePicker\n {...args}\n value={selectedFile}\n onSelectItem={() => setSelectedFile(getFile())}\n onRemoveItem={() => setSelectedFile(null)}\n onEditItem={() => alert(`Editing File`)}\n />\n );\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof FilePicker>;\n\nexport const Default: Story = {};\n\nexport const AreaType: Story = {\n args: {\n ...Default.args,\n type: \"area\"\n }\n};\n\nexport const AreaWithLabel: Story = {\n args: {\n ...AreaType.args,\n label: \"Any field label\"\n }\n};\n\nexport const AreaWithLabelRequired: Story = {\n args: {\n ...AreaType.args,\n label: \"Any field label\",\n required: true\n }\n};\n\nexport const AreaWithDescription: Story = {\n args: {\n ...AreaType.args,\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const AreaWithNotes: Story = {\n args: {\n ...AreaType.args,\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const AreaWithErrors: Story = {\n args: {\n ...AreaType.args,\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const AreaDisabled: Story = {\n args: {\n ...AreaType.args,\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const AreaWithValidateFunction: Story = {\n args: {\n ...AreaType.args\n },\n render: args => {\n const [validation, setValidation] = useState<any>({ isValid: true, message: undefined });\n\n const validate = async () => {\n setValidation({ isValid: false, message: \"Any custom error message.\" });\n };\n\n return <FilePicker {...args} validate={validate} validation={validation} />;\n }\n};\n\nexport const AreaFullExample: Story = {\n args: {\n ...AreaType.args,\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 Compact: Story = {\n args: {\n ...Default.args,\n type: \"compact\"\n }\n};\n\nexport const CompactWithLabel: Story = {\n args: {\n ...Compact.args,\n label: \"Any field label\"\n }\n};\n\nexport const CompactWithLabelRequired: Story = {\n args: {\n ...Compact.args,\n label: \"Any field label\",\n required: true\n }\n};\n\nexport const CompactWithDescription: Story = {\n args: {\n ...Compact.args,\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const CompactWithNotes: Story = {\n args: {\n ...Compact.args,\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const CompactWithErrors: Story = {\n args: {\n ...Compact.args,\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const CompactDisabled: Story = {\n args: {\n ...Compact.args,\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const CompactWithValidateFunction: Story = {\n args: {\n ...Compact.args\n },\n render: args => {\n const [validation, setValidation] = useState<any>({ isValid: true, message: undefined });\n\n const validate = async () => {\n setValidation({ isValid: false, message: \"Any custom error message.\" });\n };\n\n return <FilePicker {...args} validate={validate} validation={validation} />;\n }\n};\n\nexport const CompactFullExample: Story = {\n args: {\n ...Compact.args,\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 Documentation: Story = {\n render: args => {\n const [selectedFile, setSelectedFile] = useState(args.value);\n const [validation, setValidation] = useState({ isValid: true, message: \"\" });\n\n // Update value when args.value changes\n useEffect(() => {\n setSelectedFile(args.value);\n }, [args.value]);\n\n const handleSelect = () => {\n setSelectedFile(getFile());\n setValidation({ isValid: true, message: \"\" });\n };\n\n const handleEdit = (file: any) => {\n if (file) {\n console.log(\"Editing file:\", file);\n alert(`Editing File: ${file.name}`);\n }\n };\n\n const handleRemove = () => {\n setSelectedFile(null);\n\n if (args.required) {\n setValidation({ isValid: false, message: \"Please select a file\" });\n }\n };\n\n // Validate on required change or value change\n useEffect(() => {\n if (args.required && !selectedFile) {\n setValidation({ isValid: false, message: \"Please select a file\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n }, [args.required, selectedFile]);\n\n return (\n <FilePicker\n {...args}\n value={selectedFile}\n onSelectItem={handleSelect}\n onRemoveItem={handleRemove}\n onEditItem={handleEdit}\n validation={validation}\n />\n );\n },\n args: {\n label: \"Upload Image\",\n required: true,\n disabled: false,\n description: \"Select a file to upload (JPG, PNG, PDF)\",\n note: \"Note: Maximum file size is 5MB\",\n type: \"area\",\n value: null,\n validation: undefined,\n onSelectItem: undefined,\n onEditItem: undefined,\n onRemoveItem: undefined\n },\n argTypes: {\n label: {\n description: \"Label text for the file picker\",\n control: \"text\"\n },\n required: {\n description: \"Makes the field required when set to true\",\n control: \"boolean\"\n },\n disabled: {\n description: \"Disables the file picker when set to true\",\n control: \"boolean\"\n },\n description: {\n description: \"Additional description text below the field\",\n control: \"text\"\n },\n note: {\n description: \"Additional note text below the field\",\n control: \"text\"\n },\n type: {\n description: \"The visual style of the file picker\",\n control: \"radio\",\n options: [\"area\", \"compact\"]\n },\n value: {\n description: \"The currently selected file\",\n control: \"object\"\n },\n validation: {\n description:\n \"Object containing validation state and message. Please refer to the example code for details on usage.\"\n },\n onSelectItem: {\n description: \"Function called when a file is selected\"\n },\n onEditItem: {\n description: \"Function called when a file is edited\"\n },\n onRemoveItem: {\n description: \"Function called when a file is removed\"\n }\n }\n};\n"],"names":["getRandomNumber","min","max","Math","getFile","width","height","fileSize","meta","FilePicker","args","selectedFile","setSelectedFile","useState","alert","Default","AreaType","AreaWithLabel","AreaWithLabelRequired","AreaWithDescription","AreaWithNotes","AreaWithErrors","AreaDisabled","AreaWithValidateFunction","validation","setValidation","undefined","validate","AreaFullExample","Compact","CompactWithLabel","CompactWithLabelRequired","CompactWithDescription","CompactWithNotes","CompactWithErrors","CompactDisabled","CompactWithValidateFunction","CompactFullExample","Documentation","useEffect","handleSelect","handleEdit","file","console","handleRemove"],"mappings":";;AAIA,MAAMA,kBAAkB,CAACC,KAAaC,MAClCC,KAAK,KAAK,CAACA,KAAK,MAAM,KAAMD,CAAAA,MAAMD,MAAM,MAAMA;AAElD,MAAMG,UAAU;IACZ,MAAMC,QAAQL,gBAAgB,KAAK;IACnC,MAAMM,SAASN,gBAAgB,KAAK;IACpC,MAAMO,WAAWP,gBAAgB,QAAQ;IAEzC,OAAO;QACH,MAAM;QACN,UAAU;QACV,MAAMO;QACN,KAAK,CAAC,sBAAsB,EAAEF,MAAM,CAAC,EAAEC,QAAQ;IACnD;AACJ;AAEA,MAAME,OAAgC;IAClC,OAAO;IACP,WAAWC;IACX,UAAU;QACN,cAAc;YAAE,QAAQ;QAAe;QACvC,YAAY;YAAE,QAAQ;QAAa;QACnC,cAAc;YAAE,QAAQ;QAAe;QACvC,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,cAAcC,gBAAgB,GAAGC,SAASH,KAAK,KAAK;QAC3D,OAAO,WAAP,GACI,oBAACD,YAAUA;YACN,GAAGC,IAAI;YACR,OAAOC;YACP,cAAc,IAAMC,gBAAgBR;YACpC,cAAc,IAAMQ,gBAAgB;YACpC,YAAY,IAAME,MAAM;;IAGpC;AACJ;AAEA,2BAAeN;AAGR,MAAMO,UAAiB,CAAC;AAExB,MAAMC,WAAkB;IAC3B,MAAM;QACF,GAAGD,QAAQ,IAAI;QACf,MAAM;IACV;AACJ;AAEO,MAAME,gBAAuB;IAChC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aAAa,CAACC;YAChB,IAAIA,MAAM;gBACNC,QAAQ,GAAG,CAAC,iBAAiBD;gBAC7B5B,MAAM,CAAC,cAAc,EAAE4B,KAAK,IAAI,EAAE;YACtC;QACJ;QAEA,MAAME,eAAe;YACjBhC,gBAAgB;YAEhB,IAAIF,KAAK,QAAQ,EACbe,cAAc;gBAAE,SAAS;gBAAO,SAAS;YAAuB;QAExE;QAGAc,UAAU;YACF7B,KAAK,QAAQ,IAAI,CAACC,eAClBc,cAAc;gBAAE,SAAS;gBAAO,SAAS;YAAuB,KAEhEA,cAAc;gBAAE,SAAS;gBAAM,SAAS;YAAG;QAEnD,GAAG;YAACf,KAAK,QAAQ;YAAEC;SAAa;QAEhC,OAAO,WAAP,GACI,oBAACF,YAAUA;YACN,GAAGC,IAAI;YACR,OAAOC;YACP,cAAc6B;YACd,cAAcI;YACd,YAAYH;YACZ,YAAYjB;;IAGxB;IACA,MAAM;QACF,OAAO;QACP,UAAU;QACV,UAAU;QACV,aAAa;QACb,MAAM;QACN,MAAM;QACN,OAAO;QACP,YAAYE;QACZ,cAAcA;QACd,YAAYA;QACZ,cAAcA;IAClB;IACA,UAAU;QACN,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,UAAU;YACN,aAAa;YACb,SAAS;QACb;QACA,UAAU;YACN,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAQ;aAAU;QAChC;QACA,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,YAAY;YACR,aACI;QACR;QACA,cAAc;YACV,aAAa;QACjB;QACA,YAAY;YACR,aAAa;QACjB;QACA,cAAc;YACV,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"file":"FilePicker/FilePicker.stories.js","sources":["../../src/FilePicker/FilePicker.stories.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { type FileItemDto, FilePicker } from \"~/FilePicker/index.js\";\n\nconst getRandomNumber = (min: number, max: number): number =>\n Math.floor(Math.random() * (max - min + 1)) + min;\n\nconst getFile = (): FileItemDto => {\n const width = getRandomNumber(500, 2000); // Random width between 500 and 2000\n const height = getRandomNumber(500, 2000); // Random height between 500 and 2000\n const fileSize = getRandomNumber(500000, 5000000); // Random file size between 500KB and 5MB\n\n return {\n name: \"selected-file.jpg\",\n mimeType: \"image/jpeg\",\n size: fileSize,\n url: `https://picsum.photos/${width}/${height}`\n };\n};\n\nconst meta: Meta<typeof FilePicker> = {\n title: \"Components/Form/FilePicker\",\n component: FilePicker,\n argTypes: {\n onSelectItem: { action: \"onSelectItem\" },\n onEditItem: { action: \"onEditItem\" },\n onRemoveItem: { action: \"onRemoveItem\" },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [selectedFile, setSelectedFile] = useState(args.value);\n return (\n <FilePicker\n {...args}\n value={selectedFile}\n onSelectItem={() => setSelectedFile(getFile())}\n onRemoveItem={() => setSelectedFile(null)}\n onEditItem={() => alert(`Editing File`)}\n />\n );\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof FilePicker>;\n\nexport const Default: Story = {};\n\nexport const AreaType: Story = {\n args: {\n ...Default.args,\n type: \"area\"\n }\n};\n\nexport const AreaWithLabel: Story = {\n args: {\n ...AreaType.args,\n label: \"Any field label\"\n }\n};\n\nexport const AreaWithLabelRequired: Story = {\n args: {\n ...AreaType.args,\n label: \"Any field label\",\n required: true\n }\n};\n\nexport const AreaWithDescription: Story = {\n args: {\n ...AreaType.args,\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const AreaWithNotes: Story = {\n args: {\n ...AreaType.args,\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const AreaWithErrors: Story = {\n args: {\n ...AreaType.args,\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const AreaDisabled: Story = {\n args: {\n ...AreaType.args,\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const AreaWithValidateFunction: Story = {\n args: {\n ...AreaType.args\n },\n render: args => {\n const [validation, setValidation] = useState<any>({ isValid: true, message: undefined });\n\n const validate = async () => {\n setValidation({ isValid: false, message: \"Any custom error message.\" });\n };\n\n return <FilePicker {...args} validate={validate} validation={validation} />;\n }\n};\n\nexport const AreaFullExample: Story = {\n args: {\n ...AreaType.args,\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 Compact: Story = {\n args: {\n ...Default.args,\n type: \"compact\"\n }\n};\n\nexport const CompactWithLabel: Story = {\n args: {\n ...Compact.args,\n label: \"Any field label\"\n }\n};\n\nexport const CompactWithLabelRequired: Story = {\n args: {\n ...Compact.args,\n label: \"Any field label\",\n required: true\n }\n};\n\nexport const CompactWithDescription: Story = {\n args: {\n ...Compact.args,\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const CompactWithNotes: Story = {\n args: {\n ...Compact.args,\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const CompactWithErrors: Story = {\n args: {\n ...Compact.args,\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const CompactDisabled: Story = {\n args: {\n ...Compact.args,\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const CompactWithValidateFunction: Story = {\n args: {\n ...Compact.args\n },\n render: args => {\n const [validation, setValidation] = useState<any>({ isValid: true, message: undefined });\n\n const validate = async () => {\n setValidation({ isValid: false, message: \"Any custom error message.\" });\n };\n\n return <FilePicker {...args} validate={validate} validation={validation} />;\n }\n};\n\nexport const CompactFullExample: Story = {\n args: {\n ...Compact.args,\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 Documentation: Story = {\n render: args => {\n const [selectedFile, setSelectedFile] = useState(args.value);\n const [validation, setValidation] = useState({ isValid: true, message: \"\" });\n\n // Update value when args.value changes\n useEffect(() => {\n setSelectedFile(args.value);\n }, [args.value]);\n\n const handleSelect = () => {\n setSelectedFile(getFile());\n setValidation({ isValid: true, message: \"\" });\n };\n\n const handleEdit = (file: any) => {\n if (file) {\n console.log(\"Editing file:\", file);\n alert(`Editing File: ${file.name}`);\n }\n };\n\n const handleRemove = () => {\n setSelectedFile(null);\n\n if (args.required) {\n setValidation({ isValid: false, message: \"Please select a file\" });\n }\n };\n\n // Validate on required change or value change\n useEffect(() => {\n if (args.required && !selectedFile) {\n setValidation({ isValid: false, message: \"Please select a file\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n }, [args.required, selectedFile]);\n\n return (\n <FilePicker\n {...args}\n value={selectedFile}\n onSelectItem={handleSelect}\n onRemoveItem={handleRemove}\n onEditItem={handleEdit}\n validation={validation}\n />\n );\n },\n args: {\n label: \"Upload Image\",\n required: true,\n disabled: false,\n description: \"Select a file to upload (JPG, PNG, PDF)\",\n note: \"Note: Maximum file size is 5MB\",\n type: \"area\",\n value: null,\n validation: undefined,\n onSelectItem: undefined,\n onEditItem: undefined,\n onRemoveItem: undefined\n },\n argTypes: {\n label: {\n description: \"Label text for the file picker\",\n control: \"text\"\n },\n required: {\n description: \"Makes the field required when set to true\",\n control: \"boolean\"\n },\n disabled: {\n description: \"Disables the file picker when set to true\",\n control: \"boolean\"\n },\n description: {\n description: \"Additional description text below the field\",\n control: \"text\"\n },\n note: {\n description: \"Additional note text below the field\",\n control: \"text\"\n },\n type: {\n description: \"The visual style of the file picker\",\n control: \"radio\",\n options: [\"area\", \"compact\"]\n },\n value: {\n description: \"The currently selected file\",\n control: \"object\"\n },\n validation: {\n description:\n \"Object containing validation state and message. Please refer to the example code for details on usage.\"\n },\n onSelectItem: {\n description: \"Function called when a file is selected\"\n },\n onEditItem: {\n description: \"Function called when a file is edited\"\n },\n onRemoveItem: {\n description: \"Function called when a file is removed\"\n }\n }\n};\n"],"names":["getRandomNumber","min","max","Math","getFile","width","height","fileSize","meta","FilePicker","args","selectedFile","setSelectedFile","useState","alert","Default","AreaType","AreaWithLabel","AreaWithLabelRequired","AreaWithDescription","AreaWithNotes","AreaWithErrors","AreaDisabled","AreaWithValidateFunction","validation","setValidation","undefined","validate","AreaFullExample","Compact","CompactWithLabel","CompactWithLabelRequired","CompactWithDescription","CompactWithNotes","CompactWithErrors","CompactDisabled","CompactWithValidateFunction","CompactFullExample","Documentation","useEffect","handleSelect","handleEdit","file","console","handleRemove"],"mappings":";;AAIA,MAAMA,kBAAkB,CAACC,KAAaC,MAClCC,KAAK,KAAK,CAACA,KAAK,MAAM,KAAMD,CAAAA,MAAMD,MAAM,MAAMA;AAElD,MAAMG,UAAU;IACZ,MAAMC,QAAQL,gBAAgB,KAAK;IACnC,MAAMM,SAASN,gBAAgB,KAAK;IACpC,MAAMO,WAAWP,gBAAgB,QAAQ;IAEzC,OAAO;QACH,MAAM;QACN,UAAU;QACV,MAAMO;QACN,KAAK,CAAC,sBAAsB,EAAEF,MAAM,CAAC,EAAEC,QAAQ;IACnD;AACJ;AAEA,MAAME,OAAgC;IAClC,OAAO;IACP,WAAWC;IACX,UAAU;QACN,cAAc;YAAE,QAAQ;QAAe;QACvC,YAAY;YAAE,QAAQ;QAAa;QACnC,cAAc;YAAE,QAAQ;QAAe;QACvC,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,cAAcC,gBAAgB,GAAGC,SAASH,KAAK,KAAK;QAC3D,OAAO,WAAP,GACI,oBAACD,YAAUA;YACN,GAAGC,IAAI;YACR,OAAOC;YACP,cAAc,IAAMC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QACb;QACA,YAAY;YACR,aACI;QACR;QACA,cAAc;YACV,aAAa;QACjB;QACA,YAAY;YACR,aAAa;QACjB;QACA,cAAc;YACV,aAAa;QACjB;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 { FilePickerPrimitive } from "./FilePickerPrimitive.js";
3
3
  declare const meta: Meta<typeof FilePickerPrimitive>;
4
4
  export default meta;
@@ -1 +1 @@
1
- {"version":3,"file":"FilePicker/primitives/FilePickerPrimitive.stories.js","sources":["../../../src/FilePicker/primitives/FilePickerPrimitive.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react-webpack5\";\nimport { FilePickerPrimitive } from \"./FilePickerPrimitive.js\";\nimport type { FileItemDto } from \"~/FilePicker//index.js\";\n\nconst getRandomNumber = (min: number, max: number): number =>\n Math.floor(Math.random() * (max - min + 1)) + min;\n\nconst getFile = (): FileItemDto => {\n const width = getRandomNumber(500, 2000); // Random width between 500 and 2000\n const height = getRandomNumber(500, 2000); // Random height between 500 and 2000\n const fileSize = getRandomNumber(500000, 5000000); // Random file size between 500KB and 5MB\n\n return {\n name: \"selected-file.jpg\",\n mimeType: \"image/jpeg\",\n size: fileSize,\n url: `https://picsum.photos/${width}/${height}`\n };\n};\n\nconst meta: Meta<typeof FilePickerPrimitive> = {\n title: \"Components/Form Primitives/FilePicker\",\n component: FilePickerPrimitive,\n argTypes: {\n onSelectItem: { action: \"onSelectItem\" },\n onEditItem: { action: \"onEditItem\" },\n onRemoveItem: { action: \"onRemoveItem\" },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [selectedFile, setSelectedFile] = useState(args.value);\n return (\n <FilePickerPrimitive\n {...args}\n value={selectedFile}\n onSelectItem={() => setSelectedFile(getFile())}\n onRemoveItem={() => setSelectedFile(null)}\n onEditItem={() => alert(`Editing File`)}\n />\n );\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof FilePickerPrimitive>;\n\nexport const Default: Story = {\n args: {\n label: \"Upload background image\"\n }\n};\n\nexport const AreaType: Story = {\n args: {\n ...Default.args,\n type: \"area\"\n }\n};\n\nexport const AreaPrimaryVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"primary\"\n }\n};\n\nexport const AreaPrimaryVariantDisabled: Story = {\n args: {\n ...AreaPrimaryVariant.args,\n disabled: true\n }\n};\n\nexport const AreaPrimaryVariantInvalid: Story = {\n args: {\n ...AreaPrimaryVariant.args,\n invalid: true\n }\n};\n\nexport const AreaSecondaryVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"secondary\"\n }\n};\n\nexport const AreaSecondaryVariantDisabled: Story = {\n args: {\n ...AreaSecondaryVariant.args,\n disabled: true\n }\n};\n\nexport const AreaSecondaryVariantInvalid: Story = {\n args: {\n ...AreaSecondaryVariant.args,\n invalid: true\n }\n};\n\nexport const AreaGhostVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"ghost\"\n }\n};\n\nexport const AreaGhostVariantDisabled: Story = {\n args: {\n ...AreaGhostVariant.args,\n disabled: true\n }\n};\n\nexport const AreaGhostVariantInvalid: Story = {\n args: {\n ...AreaGhostVariant.args,\n invalid: true\n }\n};\n\nexport const AreaWithImagePreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.Image {...props} />\n }\n};\n\nexport const AreaWithImagePreviewLight: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithImagePreviewBase: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithImagePreviewTransparent: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.RichItem {...props} />\n }\n};\n\nexport const AreaWithRichItemPreviewLight: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreviewBase: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreviewTransparent: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemThumbnailPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"thumbnail\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemFileTypePreview: Story = {\n args: {\n ...AreaType.args,\n value: {\n name: \"export.csv\",\n url: \"export.csv\",\n mimeType: \"text/csv\",\n size: 100000\n },\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"file-type\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemFileTypePlaceholder: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"placeholder\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.TextOnly {...props} />\n }\n};\n\nexport const AreaWithTextOnlyPreviewLight: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreviewBase: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreviewTransparent: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const CompactType: Story = {\n args: {\n ...Default.args,\n type: \"compact\"\n }\n};\n\nexport const CompactPrimaryVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"primary\"\n }\n};\n\nexport const CompactPrimaryVariantDisabled: Story = {\n args: {\n ...CompactPrimaryVariant.args,\n disabled: true\n }\n};\n\nexport const CompactPrimaryVariantInvalid: Story = {\n args: {\n ...CompactPrimaryVariant.args,\n invalid: true\n }\n};\n\nexport const CompactSecondaryVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"secondary\"\n }\n};\n\nexport const CompactSecondaryVariantDisabled: Story = {\n args: {\n ...CompactSecondaryVariant.args,\n disabled: true\n }\n};\n\nexport const CompactSecondaryVariantInvalid: Story = {\n args: {\n ...CompactSecondaryVariant.args,\n invalid: true\n }\n};\n\nexport const CompactGhostVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"ghost\"\n }\n};\n\nexport const CompactGhostVariantDisabled: Story = {\n args: {\n ...CompactGhostVariant.args,\n disabled: true\n }\n};\n\nexport const CompactGhostVariantInvalid: Story = {\n args: {\n ...CompactGhostVariant.args,\n invalid: true\n }\n};\n\nexport const CompactWithTextOnlyPreviewSmall: Story = {\n args: {\n ...CompactType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.TextOnly {...props} small={true} />\n }\n};\n"],"names":["getRandomNumber","min","max","Math","getFile","width","height","fileSize","meta","FilePickerPrimitive","args","selectedFile","setSelectedFile","useState","alert","Default","AreaType","AreaPrimaryVariant","AreaPrimaryVariantDisabled","AreaPrimaryVariantInvalid","AreaSecondaryVariant","AreaSecondaryVariantDisabled","AreaSecondaryVariantInvalid","AreaGhostVariant","AreaGhostVariantDisabled","AreaGhostVariantInvalid","AreaWithImagePreview","props","AreaWithImagePreviewLight","AreaWithImagePreviewBase","AreaWithImagePreviewTransparent","AreaWithRichItemPreview","AreaWithRichItemPreviewLight","AreaWithRichItemPreviewBase","AreaWithRichItemPreviewTransparent","AreaWithRichItemThumbnailPreview","AreaWithRichItemFileTypePreview","AreaWithRichItemFileTypePlaceholder","AreaWithTextOnlyPreview","AreaWithTextOnlyPreviewLight","AreaWithTextOnlyPreviewBase","AreaWithTextOnlyPreviewTransparent","CompactType","CompactPrimaryVariant","CompactPrimaryVariantDisabled","CompactPrimaryVariantInvalid","CompactSecondaryVariant","CompactSecondaryVariantDisabled","CompactSecondaryVariantInvalid","CompactGhostVariant","CompactGhostVariantDisabled","CompactGhostVariantInvalid","CompactWithTextOnlyPreviewSmall"],"mappings":";;AAKA,MAAMA,kBAAkB,CAACC,KAAaC,MAClCC,KAAK,KAAK,CAACA,KAAK,MAAM,KAAMD,CAAAA,MAAMD,MAAM,MAAMA;AAElD,MAAMG,UAAU;IACZ,MAAMC,QAAQL,gBAAgB,KAAK;IACnC,MAAMM,SAASN,gBAAgB,KAAK;IACpC,MAAMO,WAAWP,gBAAgB,QAAQ;IAEzC,OAAO;QACH,MAAM;QACN,UAAU;QACV,MAAMO;QACN,KAAK,CAAC,sBAAsB,EAAEF,MAAM,CAAC,EAAEC,QAAQ;IACnD;AACJ;AAEA,MAAME,OAAyC;IAC3C,OAAO;IACP,WAAWC;IACX,UAAU;QACN,cAAc;YAAE,QAAQ;QAAe;QACvC,YAAY;YAAE,QAAQ;QAAa;QACnC,cAAc;YAAE,QAAQ;QAAe;QACvC,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,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"}
1
+ {"version":3,"file":"FilePicker/primitives/FilePickerPrimitive.stories.js","sources":["../../../src/FilePicker/primitives/FilePickerPrimitive.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { FilePickerPrimitive } from \"./FilePickerPrimitive.js\";\nimport type { FileItemDto } from \"~/FilePicker//index.js\";\n\nconst getRandomNumber = (min: number, max: number): number =>\n Math.floor(Math.random() * (max - min + 1)) + min;\n\nconst getFile = (): FileItemDto => {\n const width = getRandomNumber(500, 2000); // Random width between 500 and 2000\n const height = getRandomNumber(500, 2000); // Random height between 500 and 2000\n const fileSize = getRandomNumber(500000, 5000000); // Random file size between 500KB and 5MB\n\n return {\n name: \"selected-file.jpg\",\n mimeType: \"image/jpeg\",\n size: fileSize,\n url: `https://picsum.photos/${width}/${height}`\n };\n};\n\nconst meta: Meta<typeof FilePickerPrimitive> = {\n title: \"Components/Form Primitives/FilePicker\",\n component: FilePickerPrimitive,\n argTypes: {\n onSelectItem: { action: \"onSelectItem\" },\n onEditItem: { action: \"onEditItem\" },\n onRemoveItem: { action: \"onRemoveItem\" },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [selectedFile, setSelectedFile] = useState(args.value);\n return (\n <FilePickerPrimitive\n {...args}\n value={selectedFile}\n onSelectItem={() => setSelectedFile(getFile())}\n onRemoveItem={() => setSelectedFile(null)}\n onEditItem={() => alert(`Editing File`)}\n />\n );\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof FilePickerPrimitive>;\n\nexport const Default: Story = {\n args: {\n label: \"Upload background image\"\n }\n};\n\nexport const AreaType: Story = {\n args: {\n ...Default.args,\n type: \"area\"\n }\n};\n\nexport const AreaPrimaryVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"primary\"\n }\n};\n\nexport const AreaPrimaryVariantDisabled: Story = {\n args: {\n ...AreaPrimaryVariant.args,\n disabled: true\n }\n};\n\nexport const AreaPrimaryVariantInvalid: Story = {\n args: {\n ...AreaPrimaryVariant.args,\n invalid: true\n }\n};\n\nexport const AreaSecondaryVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"secondary\"\n }\n};\n\nexport const AreaSecondaryVariantDisabled: Story = {\n args: {\n ...AreaSecondaryVariant.args,\n disabled: true\n }\n};\n\nexport const AreaSecondaryVariantInvalid: Story = {\n args: {\n ...AreaSecondaryVariant.args,\n invalid: true\n }\n};\n\nexport const AreaGhostVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"ghost\"\n }\n};\n\nexport const AreaGhostVariantDisabled: Story = {\n args: {\n ...AreaGhostVariant.args,\n disabled: true\n }\n};\n\nexport const AreaGhostVariantInvalid: Story = {\n args: {\n ...AreaGhostVariant.args,\n invalid: true\n }\n};\n\nexport const AreaWithImagePreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.Image {...props} />\n }\n};\n\nexport const AreaWithImagePreviewLight: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithImagePreviewBase: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithImagePreviewTransparent: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.RichItem {...props} />\n }\n};\n\nexport const AreaWithRichItemPreviewLight: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreviewBase: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreviewTransparent: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemThumbnailPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"thumbnail\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemFileTypePreview: Story = {\n args: {\n ...AreaType.args,\n value: {\n name: \"export.csv\",\n url: \"export.csv\",\n mimeType: \"text/csv\",\n size: 100000\n },\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"file-type\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemFileTypePlaceholder: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"placeholder\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.TextOnly {...props} />\n }\n};\n\nexport const AreaWithTextOnlyPreviewLight: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreviewBase: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreviewTransparent: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const CompactType: Story = {\n args: {\n ...Default.args,\n type: \"compact\"\n }\n};\n\nexport const CompactPrimaryVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"primary\"\n }\n};\n\nexport const CompactPrimaryVariantDisabled: Story = {\n args: {\n ...CompactPrimaryVariant.args,\n disabled: true\n }\n};\n\nexport const CompactPrimaryVariantInvalid: Story = {\n args: {\n ...CompactPrimaryVariant.args,\n invalid: true\n }\n};\n\nexport const CompactSecondaryVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"secondary\"\n }\n};\n\nexport const CompactSecondaryVariantDisabled: Story = {\n args: {\n ...CompactSecondaryVariant.args,\n disabled: true\n }\n};\n\nexport const CompactSecondaryVariantInvalid: Story = {\n args: {\n ...CompactSecondaryVariant.args,\n invalid: true\n }\n};\n\nexport const CompactGhostVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"ghost\"\n }\n};\n\nexport const CompactGhostVariantDisabled: Story = {\n args: {\n ...CompactGhostVariant.args,\n disabled: true\n }\n};\n\nexport const CompactGhostVariantInvalid: Story = {\n args: {\n ...CompactGhostVariant.args,\n invalid: true\n }\n};\n\nexport const CompactWithTextOnlyPreviewSmall: Story = {\n args: {\n ...CompactType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.TextOnly {...props} small={true} />\n }\n};\n"],"names":["getRandomNumber","min","max","Math","getFile","width","height","fileSize","meta","FilePickerPrimitive","args","selectedFile","setSelectedFile","useState","alert","Default","AreaType","AreaPrimaryVariant","AreaPrimaryVariantDisabled","AreaPrimaryVariantInvalid","AreaSecondaryVariant","AreaSecondaryVariantDisabled","AreaSecondaryVariantInvalid","AreaGhostVariant","AreaGhostVariantDisabled","AreaGhostVariantInvalid","AreaWithImagePreview","props","AreaWithImagePreviewLight","AreaWithImagePreviewBase","AreaWithImagePreviewTransparent","AreaWithRichItemPreview","AreaWithRichItemPreviewLight","AreaWithRichItemPreviewBase","AreaWithRichItemPreviewTransparent","AreaWithRichItemThumbnailPreview","AreaWithRichItemFileTypePreview","AreaWithRichItemFileTypePlaceholder","AreaWithTextOnlyPreview","AreaWithTextOnlyPreviewLight","AreaWithTextOnlyPreviewBase","AreaWithTextOnlyPreviewTransparent","CompactType","CompactPrimaryVariant","CompactPrimaryVariantDisabled","CompactPrimaryVariantInvalid","CompactSecondaryVariant","CompactSecondaryVariantDisabled","CompactSecondaryVariantInvalid","CompactGhostVariant","CompactGhostVariantDisabled","CompactGhostVariantInvalid","CompactWithTextOnlyPreviewSmall"],"mappings":";;AAKA,MAAMA,kBAAkB,CAACC,KAAaC,MAClCC,KAAK,KAAK,CAACA,KAAK,MAAM,KAAMD,CAAAA,MAAMD,MAAM,MAAMA;AAElD,MAAMG,UAAU;IACZ,MAAMC,QAAQL,gBAAgB,KAAK;IACnC,MAAMM,SAASN,gBAAgB,KAAK;IACpC,MAAMO,WAAWP,gBAAgB,QAAQ;IAEzC,OAAO;QACH,MAAM;QACN,UAAU;QACV,MAAMO;QACN,KAAK,CAAC,sBAAsB,EAAEF,MAAM,CAAC,EAAEC,QAAQ;IACnD;AACJ;AAEA,MAAME,OAAyC;IAC3C,OAAO;IACP,WAAWC;IACX,UAAU;QACN,cAAc;YAAE,QAAQ;QAAe;QACvC,YAAY;YAAE,QAAQ;QAAa;QACnC,cAAc;YAAE,QAAQ;QAAe;QACvC,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,cAAcC,gBAAgB,GAAGC,SAASH,KAAK,KAAK;QAC3D,OAAO,WAAP,GACI,oBAACD,qBAAmBA;YACf,GAAGC,IAAI;YACR,OAAOC;YACP,cAAc,IAAMC,gBAAgBR;YACpC,cAAc,IAAMQ,gBAAgB;YACpC,YAAY,IAAME,MAAM;;IAGpC;AACJ;AAEA,oCAAeN;AAGR,MAAMO,UAAiB;IAC1B,MAAM;QACF,OAAO;IACX;AACJ;AAEO,MAAMC,WAAkB;IAC3B,MAAM;QACF,GAAGD,QA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,MAAM;QACF,GAAGD,YAAY,IAAI;QACnB,SAAS;IACb;AACJ;AAEO,MAAME,gCAAuC;IAChD,MAAM;QACF,GAAGD,sBAAsB,IAAI;QAC7B,UAAU;IACd;AACJ;AAEO,MAAME,+BAAsC;IAC/C,MAAM;QACF,GAAGF,sBAAsB,IAAI;QAC7B,SAAS;IACb;AACJ;AAEO,MAAMG,0BAAiC;IAC1C,MAAM;QACF,GAAGJ,YAAY,IAAI;QACnB,SAAS;IACb;AACJ;AAEO,MAAMK,kCAAyC;IAClD,MAAM;QACF,GAAGD,wBAAwB,IAAI;QAC/B,UAAU;IACd;AACJ;AAEO,MAAME,iCAAwC;IACjD,MAAM;QACF,GAAGF,wBAAwB,IAAI;QAC/B,SAAS;IACb;AACJ;AAEO,MAAMG,sBAA6B;IACtC,MAAM;QACF,GAAGP,YAAY,IAAI;QACnB,SAAS;IACb;AACJ;AAEO,MAAMQ,8BAAqC;IAC9C,MAAM;QACF,GAAGD,oBAAoB,IAAI;QAC3B,UAAU;IACd;AACJ;AAEO,MAAME,6BAAoC;IAC7C,MAAM;QACF,GAAGF,oBAAoB,IAAI;QAC3B,SAAS;IACb;AACJ;AAEO,MAAMG,kCAAyC;IAClD,MAAM;QACF,GAAGV,YAAY,IAAI;QACnB,mBAAmBf,CAAAA,QAAAA,WAAAA,GAAS,oBAAClB,oBAAoB,OAAO,CAAC,QAAQ;gBAAE,GAAGkB,KAAK;gBAAE,OAAO;;IACxF;AACJ"}
@@ -0,0 +1,60 @@
1
+ import React from "react";
2
+ type FillViewportProps = React.HTMLAttributes<HTMLDivElement>;
3
+ declare const FillViewportHeight: (({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element) & {
4
+ original: ({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element;
5
+ originalName: string;
6
+ displayName: string;
7
+ } & {
8
+ original: (({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element) & {
9
+ original: ({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element;
10
+ originalName: string;
11
+ displayName: string;
12
+ };
13
+ originalName: string;
14
+ displayName: string;
15
+ } & {
16
+ createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<(({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element) & {
17
+ original: ({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element;
18
+ originalName: string;
19
+ displayName: string;
20
+ }>) => (props: unknown) => React.JSX.Element;
21
+ };
22
+ declare const FillViewportWidth: (({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element) & {
23
+ original: ({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element;
24
+ originalName: string;
25
+ displayName: string;
26
+ } & {
27
+ original: (({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element) & {
28
+ original: ({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element;
29
+ originalName: string;
30
+ displayName: string;
31
+ };
32
+ originalName: string;
33
+ displayName: string;
34
+ } & {
35
+ createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<(({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element) & {
36
+ original: ({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element;
37
+ originalName: string;
38
+ displayName: string;
39
+ }>) => (props: unknown) => React.JSX.Element;
40
+ };
41
+ declare const FillViewport: (({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element) & {
42
+ original: ({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element;
43
+ originalName: string;
44
+ displayName: string;
45
+ } & {
46
+ original: (({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element) & {
47
+ original: ({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element;
48
+ originalName: string;
49
+ displayName: string;
50
+ };
51
+ originalName: string;
52
+ displayName: string;
53
+ } & {
54
+ createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<(({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element) & {
55
+ original: ({ children, style: userStyle, ...rest }: FillViewportProps) => React.JSX.Element;
56
+ originalName: string;
57
+ displayName: string;
58
+ }>) => (props: unknown) => React.JSX.Element;
59
+ };
60
+ export { FillViewportHeight, FillViewportWidth, FillViewport };
@@ -0,0 +1,67 @@
1
+ import react, { useEffect, useRef, useState } from "react";
2
+ import { makeDecoratable } from "../utils.js";
3
+ function useFillViewportStyle(axis) {
4
+ const ref = useRef(null);
5
+ const [style, setStyle] = useState();
6
+ useEffect(()=>{
7
+ const el = ref.current;
8
+ if (!el) return;
9
+ const measure = ()=>{
10
+ const rect = el.getBoundingClientRect();
11
+ const next = {};
12
+ if ("width" === axis || "both" === axis) next.width = window.innerWidth - rect.left;
13
+ if ("height" === axis || "both" === axis) next.height = window.innerHeight - rect.top;
14
+ setStyle(next);
15
+ };
16
+ measure();
17
+ const ro = new ResizeObserver(measure);
18
+ ro.observe(document.documentElement);
19
+ return ()=>ro.disconnect();
20
+ }, []);
21
+ return {
22
+ ref,
23
+ style
24
+ };
25
+ }
26
+ const BaseFillViewportHeight = ({ children, style: userStyle, ...rest })=>{
27
+ const { ref, style } = useFillViewportStyle("height");
28
+ return /*#__PURE__*/ react.createElement("div", {
29
+ ...rest,
30
+ ref: ref,
31
+ "data-fill-viewport": "height",
32
+ style: void 0 !== style ? {
33
+ height: style.height,
34
+ ...userStyle
35
+ } : userStyle
36
+ }, children);
37
+ };
38
+ const BaseFillViewportWidth = ({ children, style: userStyle, ...rest })=>{
39
+ const { ref, style } = useFillViewportStyle("width");
40
+ return /*#__PURE__*/ react.createElement("div", {
41
+ ...rest,
42
+ ref: ref,
43
+ "data-fill-viewport": "width",
44
+ style: void 0 !== style ? {
45
+ width: style.width,
46
+ ...userStyle
47
+ } : userStyle
48
+ }, children);
49
+ };
50
+ const BaseFillViewport = ({ children, style: userStyle, ...rest })=>{
51
+ const { ref, style } = useFillViewportStyle("both");
52
+ return /*#__PURE__*/ react.createElement("div", {
53
+ ...rest,
54
+ ref: ref,
55
+ "data-fill-viewport": "both",
56
+ style: void 0 !== style ? {
57
+ ...style,
58
+ ...userStyle
59
+ } : userStyle
60
+ }, children);
61
+ };
62
+ const FillViewportHeight = makeDecoratable("FillViewportHeight", BaseFillViewportHeight);
63
+ const FillViewportWidth = makeDecoratable("FillViewportWidth", BaseFillViewportWidth);
64
+ const FillViewport = makeDecoratable("FillViewport", BaseFillViewport);
65
+ export { FillViewport, FillViewportHeight, FillViewportWidth };
66
+
67
+ //# sourceMappingURL=FillViewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FillViewport/FillViewport.js","sources":["../../src/FillViewport/FillViewport.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport { makeDecoratable } from \"~/utils.js\";\n\ninterface FillViewportStyle {\n width?: number;\n height?: number;\n}\n\nfunction useFillViewportStyle(axis: \"width\" | \"height\" | \"both\") {\n const ref = useRef<HTMLDivElement>(null);\n const [style, setStyle] = useState<FillViewportStyle>();\n\n useEffect(() => {\n const el = ref.current;\n if (!el) {\n return;\n }\n\n const measure = () => {\n const rect = el.getBoundingClientRect();\n const next: FillViewportStyle = {};\n\n if (axis === \"width\" || axis === \"both\") {\n next.width = window.innerWidth - rect.left;\n }\n\n if (axis === \"height\" || axis === \"both\") {\n next.height = window.innerHeight - rect.top;\n }\n\n setStyle(next);\n };\n\n measure();\n\n const ro = new ResizeObserver(measure);\n ro.observe(document.documentElement);\n\n return () => ro.disconnect();\n }, []);\n\n return { ref, style };\n}\n\ntype FillViewportProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst BaseFillViewportHeight = ({ children, style: userStyle, ...rest }: FillViewportProps) => {\n const { ref, style } = useFillViewportStyle(\"height\");\n\n return (\n <div\n {...rest}\n ref={ref}\n data-fill-viewport=\"height\"\n style={style !== undefined ? { height: style.height, ...userStyle } : userStyle}\n >\n {children}\n </div>\n );\n};\n\nconst BaseFillViewportWidth = ({ children, style: userStyle, ...rest }: FillViewportProps) => {\n const { ref, style } = useFillViewportStyle(\"width\");\n\n return (\n <div\n {...rest}\n ref={ref}\n data-fill-viewport=\"width\"\n style={style !== undefined ? { width: style.width, ...userStyle } : userStyle}\n >\n {children}\n </div>\n );\n};\n\nconst BaseFillViewport = ({ children, style: userStyle, ...rest }: FillViewportProps) => {\n const { ref, style } = useFillViewportStyle(\"both\");\n\n return (\n <div\n {...rest}\n ref={ref}\n data-fill-viewport=\"both\"\n style={style !== undefined ? { ...style, ...userStyle } : userStyle}\n >\n {children}\n </div>\n );\n};\n\nconst FillViewportHeight = makeDecoratable(\"FillViewportHeight\", BaseFillViewportHeight);\nconst FillViewportWidth = makeDecoratable(\"FillViewportWidth\", BaseFillViewportWidth);\nconst FillViewport = makeDecoratable(\"FillViewport\", BaseFillViewport);\n\nexport { FillViewportHeight, FillViewportWidth, FillViewport };\n"],"names":["useFillViewportStyle","axis","ref","useRef","style","setStyle","useState","useEffect","el","measure","rect","next","window","ro","ResizeObserver","document","BaseFillViewportHeight","children","userStyle","rest","undefined","BaseFillViewportWidth","BaseFillViewport","FillViewportHeight","makeDecoratable","FillViewportWidth","FillViewport"],"mappings":";;AAQA,SAASA,qBAAqBC,IAAiC;IAC3D,MAAMC,MAAMC,OAAuB;IACnC,MAAM,CAACC,OAAOC,SAAS,GAAGC;IAE1BC,UAAU;QACN,MAAMC,KAAKN,IAAI,OAAO;QACtB,IAAI,CAACM,IACD;QAGJ,MAAMC,UAAU;YACZ,MAAMC,OAAOF,GAAG,qBAAqB;YACrC,MAAMG,OAA0B,CAAC;YAEjC,IAAIV,AAAS,YAATA,QAAoBA,AAAS,WAATA,MACpBU,KAAK,KAAK,GAAGC,OAAO,UAAU,GAAGF,KAAK,IAAI;YAG9C,IAAIT,AAAS,aAATA,QAAqBA,AAAS,WAATA,MACrBU,KAAK,MAAM,GAAGC,OAAO,WAAW,GAAGF,KAAK,GAAG;YAG/CL,SAASM;QACb;QAEAF;QAEA,MAAMI,KAAK,IAAIC,eAAeL;QAC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
@@ -0,0 +1 @@
1
+ export * from "./FillViewport.js";
@@ -0,0 +1 @@
1
+ export * from "./FillViewport.js";
package/Grid/Grid.d.ts CHANGED
@@ -31,7 +31,7 @@ declare const gridVariants: (props?: ({
31
31
  gap?: "none" | "small" | "compact" | "micro" | "comfortable" | "spacious" | null | undefined;
32
32
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
33
33
  interface GridProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof gridVariants> {
34
- children: null | React.ReactElement<ColumnProps, typeof Column> | Array<React.ReactElement<ColumnProps, typeof Column>>;
34
+ children: null | React.ReactElement<ColumnProps, typeof Column> | Array<React.ReactElement<ColumnProps, typeof Column> | null>;
35
35
  }
36
36
  declare const Grid: (({ gap, children, className, ...props }: GridProps) => React.JSX.Element) & {
37
37
  original: ({ gap, children, className, ...props }: GridProps) => React.JSX.Element;
package/Grid/Grid.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Grid/Grid.js","sources":["../../src/Grid/Grid.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, cva, withStaticProps, makeDecoratable, type VariantProps } from \"~/utils.js\";\n\nconst columnVariants = cva(\"\", {\n variants: {\n span: {\n auto: \"col-auto\",\n 1: \"col-span-1\",\n 2: \"col-span-2\",\n 3: \"col-span-3\",\n 4: \"col-span-4\",\n 5: \"col-span-5\",\n 6: \"col-span-6\",\n 7: \"col-span-7\",\n 8: \"col-span-8\",\n 9: \"col-span-9\",\n 10: \"col-span-10\",\n 11: \"col-span-11\",\n 12: \"col-span-12\"\n },\n offset: {\n 1: \"col-start-2\",\n 2: \"col-start-3\",\n 3: \"col-start-4\",\n 4: \"col-start-5\",\n 5: \"col-start-6\",\n 6: \"col-start-7\",\n 7: \"col-start-8\",\n 8: \"col-start-9\",\n 9: \"col-start-10\",\n 10: \"col-start-11\",\n 11: \"col-start-12\"\n },\n align: {\n top: \"self-start\",\n middle: \"self-center\",\n bottom: \"self-end\"\n }\n },\n defaultVariants: {\n span: \"auto\"\n }\n});\n\ninterface ColumnProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof columnVariants> {\n children?: React.ReactNode;\n}\n\nconst ColumnBase = ({ span, align, children, className, offset, ...props }: ColumnProps) => {\n return (\n <div {...props} className={cn(columnVariants({ span, offset, align }), className)}>\n {children}\n </div>\n );\n};\n\nconst Column = makeDecoratable(\"Column\", ColumnBase);\n\nconst gridVariants = cva(\"grid\", {\n variants: {\n gap: {\n none: \"gap-0\",\n micro: \"gap-xs\",\n small: \"gap-sm\",\n compact: \"gap-md\",\n comfortable: \"gap-lg\",\n spacious: \"gap-xl\"\n }\n },\n defaultVariants: {\n gap: \"comfortable\"\n }\n});\n\ninterface GridProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof gridVariants> {\n children:\n | null\n | React.ReactElement<ColumnProps, typeof Column>\n | Array<React.ReactElement<ColumnProps, typeof Column>>;\n}\n\nconst GridBase = ({ gap, children, className, ...props }: GridProps) => {\n return (\n <div {...props} className={cn(\"grid-cols-12\", gridVariants({ gap }), className)}>\n {children}\n </div>\n );\n};\n\nconst DecoratableGrid = makeDecoratable(\"Grid\", GridBase);\n\nconst Grid = withStaticProps(DecoratableGrid, { Column });\n\nexport { Grid, type GridProps, type ColumnProps };\n"],"names":["columnVariants","cva","ColumnBase","span","align","children","className","offset","props","cn","Column","makeDecoratable","gridVariants","GridBase","gap","DecoratableGrid","Grid","withStaticProps"],"mappings":";;AAGA,MAAMA,iBAAiBC,IAAI,IAAI;IAC3B,UAAU;QACN,MAAM;YACF,MAAM;YACN,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,IAAI;YACJ,IAAI;YACJ,IAAI;QACR;QACA,QAAQ;YACJ,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,IAAI;YACJ,IAAI;QACR;QACA,OAAO;YACH,KAAK;YACL,QAAQ;YACR,QAAQ;QACZ;IACJ;IACA,iBAAiB;QACb,MAAM;IACV;AACJ;AAOA,MAAMC,aAAa,CAAC,EAAEC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,EAAE,GAAGC,OAAoB,GAC5E,WAAP,GACI,oBAAC;QAAK,GAAGA,KAAK;QAAE,WAAWC,GAAGT,eAAe;YAAEG;YAAMI;YAAQH;QAAM,IAAIE;OAClED;AAKb,MAAMK,SAASC,gBAAgB,UAAUT;AAEzC,MAAMU,eAAeX,IAAI,QAAQ;IAC7B,UAAU;QACN,KAAK;YACD,MAAM;YACN,OAAO;YACP,OAAO;YACP,SAAS;YACT,aAAa;YACb,UAAU;QACd;IACJ;IACA,iBAAiB;QACb,KAAK;IACT;AACJ;AAUA,MAAMY,WAAW,CAAC,EAAEC,GAAG,EAAET,QAAQ,EAAEC,SAAS,EAAE,GAAGE,OAAkB,GACxD,WAAP,GACI,oBAAC;QAAK,GAAGA,KAAK;QAAE,WAAWC,GAAG,gBAAgBG,aAAa;YAAEE;QAAI,IAAIR;OAChED;AAKb,MAAMU,kBAAkBJ,gBAAgB,QAAQE;AAEhD,MAAMG,OAAOC,gBAAgBF,iBAAiB;IAAEL,QAAAA;AAAO"}
1
+ {"version":3,"file":"Grid/Grid.js","sources":["../../src/Grid/Grid.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, cva, withStaticProps, makeDecoratable, type VariantProps } from \"~/utils.js\";\n\nconst columnVariants = cva(\"\", {\n variants: {\n span: {\n auto: \"col-auto\",\n 1: \"col-span-1\",\n 2: \"col-span-2\",\n 3: \"col-span-3\",\n 4: \"col-span-4\",\n 5: \"col-span-5\",\n 6: \"col-span-6\",\n 7: \"col-span-7\",\n 8: \"col-span-8\",\n 9: \"col-span-9\",\n 10: \"col-span-10\",\n 11: \"col-span-11\",\n 12: \"col-span-12\"\n },\n offset: {\n 1: \"col-start-2\",\n 2: \"col-start-3\",\n 3: \"col-start-4\",\n 4: \"col-start-5\",\n 5: \"col-start-6\",\n 6: \"col-start-7\",\n 7: \"col-start-8\",\n 8: \"col-start-9\",\n 9: \"col-start-10\",\n 10: \"col-start-11\",\n 11: \"col-start-12\"\n },\n align: {\n top: \"self-start\",\n middle: \"self-center\",\n bottom: \"self-end\"\n }\n },\n defaultVariants: {\n span: \"auto\"\n }\n});\n\ninterface ColumnProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof columnVariants> {\n children?: React.ReactNode;\n}\n\nconst ColumnBase = ({ span, align, children, className, offset, ...props }: ColumnProps) => {\n return (\n <div {...props} className={cn(columnVariants({ span, offset, align }), className)}>\n {children}\n </div>\n );\n};\n\nconst Column = makeDecoratable(\"Column\", ColumnBase);\n\nconst gridVariants = cva(\"grid\", {\n variants: {\n gap: {\n none: \"gap-0\",\n micro: \"gap-xs\",\n small: \"gap-sm\",\n compact: \"gap-md\",\n comfortable: \"gap-lg\",\n spacious: \"gap-xl\"\n }\n },\n defaultVariants: {\n gap: \"comfortable\"\n }\n});\n\ninterface GridProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof gridVariants> {\n children:\n | null\n | React.ReactElement<ColumnProps, typeof Column>\n | Array<React.ReactElement<ColumnProps, typeof Column> | null>;\n}\n\nconst GridBase = ({ gap, children, className, ...props }: GridProps) => {\n return (\n <div {...props} className={cn(\"grid-cols-12\", gridVariants({ gap }), className)}>\n {children}\n </div>\n );\n};\n\nconst DecoratableGrid = makeDecoratable(\"Grid\", GridBase);\n\nconst Grid = withStaticProps(DecoratableGrid, { Column });\n\nexport { Grid, type GridProps, type ColumnProps };\n"],"names":["columnVariants","cva","ColumnBase","span","align","children","className","offset","props","cn","Column","makeDecoratable","gridVariants","GridBase","gap","DecoratableGrid","Grid","withStaticProps"],"mappings":";;AAGA,MAAMA,iBAAiBC,IAAI,IAAI;IAC3B,UAAU;QACN,MAAM;YACF,MAAM;YACN,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,IAAI;YACJ,IAAI;YACJ,IAAI;QACR;QACA,QAAQ;YACJ,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,IAAI;YACJ,IAAI;QACR;QACA,OAAO;YACH,KAAK;YACL,QAAQ;YACR,QAAQ;QACZ;IACJ;IACA,iBAAiB;QACb,MAAM;IACV;AACJ;AAOA,MAAMC,aAAa,CAAC,EAAEC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,EAAE,GAAGC,OAAoB,GAC5E,WAAP,GACI,oBAAC;QAAK,GAAGA,KAAK;QAAE,WAAWC,GAAGT,eAAe;YAAEG;YAAMI;YAAQH;QAAM,IAAIE;OAClED;AAKb,MAAMK,SAASC,gBAAgB,UAAUT;AAEzC,MAAMU,eAAeX,IAAI,QAAQ;IAC7B,UAAU;QACN,KAAK;YACD,MAAM;YACN,OAAO;YACP,OAAO;YACP,SAAS;YACT,aAAa;YACb,UAAU;QACd;IACJ;IACA,iBAAiB;QACb,KAAK;IACT;AACJ;AAUA,MAAMY,WAAW,CAAC,EAAEC,GAAG,EAAET,QAAQ,EAAEC,SAAS,EAAE,GAAGE,OAAkB,GACxD,WAAP,GACI,oBAAC;QAAK,GAAGA,KAAK;QAAE,WAAWC,GAAG,gBAAgBG,aAAa;YAAEE;QAAI,IAAIR;OAChED;AAKb,MAAMU,kBAAkBJ,gBAAgB,QAAQE;AAEhD,MAAMG,OAAOC,gBAAgBF,iBAAiB;IAAEL,QAAAA;AAAO"}
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryObj } from "@storybook/react-webpack5";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Grid } from "./Grid.js";
3
3
  declare const meta: Meta<typeof Grid>;
4
4
  export default meta;
@@ -1 +1 @@
1
- {"version":3,"file":"Grid/Grid.stories.js","sources":["../../src/Grid/Grid.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react-webpack5\";\n\nimport { Grid } from \"./Grid.js\";\nimport { StyledColumn } from \"./stories/StyledColumn.js\";\n\nconst meta: Meta<typeof Grid> = {\n title: \"Components/Grid\",\n component: Grid,\n parameters: {\n layout: \"padded\"\n }\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Grid>;\n\nexport const Default: Story = {\n args: {\n className: \"bg-neutral-light p-md w-full\",\n children: (\n <>\n <StyledColumn index={1} />\n <StyledColumn index={2} span={3} />\n <StyledColumn index={3} />\n <StyledColumn index={4} />\n <StyledColumn index={5} />\n <StyledColumn index={6} />\n <StyledColumn index={7} span={2} />\n <StyledColumn index={8} />\n <StyledColumn index={9} />\n </>\n )\n }\n};\n\nexport const WithGapNone: Story = {\n args: {\n ...Default.args,\n gap: \"none\"\n }\n};\n\nexport const WithGapMicro: Story = {\n args: {\n ...Default.args,\n gap: \"micro\"\n }\n};\n\nexport const WithGapSmall: Story = {\n args: {\n ...Default.args,\n gap: \"small\"\n }\n};\n\nexport const WithGapCompact: Story = {\n args: {\n ...Default.args,\n gap: \"compact\"\n }\n};\n\nexport const WithGapComfortable: Story = {\n args: {\n ...Default.args,\n gap: \"comfortable\"\n }\n};\n\nexport const WithGapSpacious: Story = {\n args: {\n ...Default.args,\n gap: \"spacious\"\n }\n};\n\nexport const WithOffset: Story = {\n parameters: {\n layout: \"padded\"\n },\n args: {\n ...Default.args,\n children: (\n <>\n {/* Row 1 */}\n <StyledColumn span={8} offset={2} index={1} />\n <Grid.Column span={2} />\n\n {/* Row 2 */}\n <StyledColumn span={8} offset={4} index={1} />\n\n {/* Row 3 */}\n <StyledColumn span={10} offset={1} index={1} />\n <Grid.Column span={1} />\n\n {/* Row 4 */}\n <StyledColumn span={12} index={1} />\n </>\n )\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n return (\n <Grid {...args}>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 1\n </Grid.Column>\n <Grid.Column\n className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\"\n span={3}\n >\n Col 2<br />\n Span: 3\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 3\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 4\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 5\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 6\n </Grid.Column>\n <Grid.Column\n className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\"\n span={2}\n >\n Col 7<br />\n Span: 2\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 8\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 9\n </Grid.Column>\n </Grid>\n );\n },\n args: {\n gap: \"comfortable\",\n className: \"bg-neutral-light p-md w-full\"\n },\n argTypes: {\n gap: {\n description: \"Spacing between grid columns\",\n control: \"select\",\n options: [\"none\", \"micro\", \"small\", \"compact\", \"comfortable\", \"spacious\"],\n defaultValue: \"comfortable\"\n },\n className: {\n description:\n \"Additional CSS class names. You can pass multiple class names that will be applied to Grid.\",\n control: \"text\"\n }\n }\n};\n"],"names":["meta","Grid","Default","StyledColumn","WithGapNone","WithGapMicro","WithGapSmall","WithGapCompact","WithGapComfortable","WithGapSpacious","WithOffset","Documentation","args"],"mappings":";;;AAMA,MAAMA,OAA0B;IAC5B,OAAO;IACP,WAAWC;IACX,YAAY;QACR,QAAQ;IACZ;AACJ;AAEA,qBAAeD;AAIR,MAAME,UAAiB;IAC1B,MAAM;QACF,WAAW;QACX,UAAU,WAAV,GACI,w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AI,OAAO;;IAG3C;AACJ;AAEO,MAAMQ,gBAAuB;IAChC,QAAQC,CAAAA,OACG,WAAP,GACI,oBAACX,MAASW,MAAAA,WAAAA,GACN,oBAACX,KAAK,MAAM;YAAC,WAAU;WAAuD,wBAG9E,oBAACA,KAAK,MAAM;YACR,WAAU;YACV,MAAM;WACT,uBACQ,oBAAC,aAAK,0BAGf,oBAACA,KAAK,MAAM;YAAC,WAAU;WAAuD,wBAG9E,oBAACA,KAAK,MAAM;YAAC,WAAU;WAAuD,wBAG9E,oBAACA,KAAK,MAAM;YAAC,WAAU;WAAuD,wBAG9E,oBAACA,KAAK,MAAM;YAAC,WAAU;WAAuD,wBAG9E,oBAACA,KAAK,MAAM;YACR,WAAU;YACV,MAAM;WACT,uBACQ,oBAAC,aAAK,0BAGf,oBAACA,KAAK,MAAM;YAAC,WAAU;WAAuD,wBAG9E,oBAACA,KAAK,MAAM;YAAC,WAAU;WAAuD;IAM1F,MAAM;QACF,KAAK;QACL,WAAW;IACf;IACA,UAAU;QACN,KAAK;YACD,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAQ;gBAAS;gBAAS;gBAAW;gBAAe;aAAW;YACzE,cAAc;QAClB;QACA,WAAW;YACP,aACI;YACJ,SAAS;QACb;IACJ;AACJ"}
1
+ {"version":3,"file":"Grid/Grid.stories.js","sources":["../../src/Grid/Grid.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\n\nimport { Grid } from \"./Grid.js\";\nimport { StyledColumn } from \"./stories/StyledColumn.js\";\n\nconst meta: Meta<typeof Grid> = {\n title: \"Components/Grid\",\n component: Grid,\n parameters: {\n layout: \"padded\"\n }\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Grid>;\n\nexport const Default: Story = {\n args: {\n className: \"bg-neutral-light p-md w-full\",\n children: (\n <>\n <StyledColumn index={1} />\n <StyledColumn index={2} span={3} />\n <StyledColumn index={3} />\n <StyledColumn index={4} />\n <StyledColumn index={5} />\n <StyledColumn index={6} />\n <StyledColumn index={7} span={2} />\n <StyledColumn index={8} />\n <StyledColumn index={9} />\n </>\n )\n }\n};\n\nexport const WithGapNone: Story = {\n args: {\n ...Default.args,\n gap: \"none\"\n }\n};\n\nexport const WithGapMicro: Story = {\n args: {\n ...Default.args,\n gap: \"micro\"\n }\n};\n\nexport const WithGapSmall: Story = {\n args: {\n ...Default.args,\n gap: \"small\"\n }\n};\n\nexport const WithGapCompact: Story = {\n args: {\n ...Default.args,\n gap: \"compact\"\n }\n};\n\nexport const WithGapComfortable: Story = {\n args: {\n ...Default.args,\n gap: \"comfortable\"\n }\n};\n\nexport const WithGapSpacious: Story = {\n args: {\n ...Default.args,\n gap: \"spacious\"\n }\n};\n\nexport const WithOffset: Story = {\n parameters: {\n layout: \"padded\"\n },\n args: {\n ...Default.args,\n children: (\n <>\n {/* Row 1 */}\n <StyledColumn span={8} offset={2} index={1} />\n <Grid.Column span={2} />\n\n {/* Row 2 */}\n <StyledColumn span={8} offset={4} index={1} />\n\n {/* Row 3 */}\n <StyledColumn span={10} offset={1} index={1} />\n <Grid.Column span={1} />\n\n {/* Row 4 */}\n <StyledColumn span={12} index={1} />\n </>\n )\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n return (\n <Grid {...args}>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 1\n </Grid.Column>\n <Grid.Column\n className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\"\n span={3}\n >\n Col 2<br />\n Span: 3\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 3\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 4\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 5\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 6\n </Grid.Column>\n <Grid.Column\n className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\"\n span={2}\n >\n Col 7<br />\n Span: 2\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 8\n </Grid.Column>\n <Grid.Column className=\"bg-primary text-neutral-light p-2 text-md rounded-sm\">\n Col 9\n </Grid.Column>\n </Grid>\n );\n },\n args: {\n gap: \"comfortable\",\n className: \"bg-neutral-light p-md w-full\"\n },\n argTypes: {\n gap: {\n description: \"Spacing between grid columns\",\n control: \"select\",\n options: [\"none\", \"micro\", \"small\", \"compact\", \"comfortable\", \"spacious\"],\n defaultValue: \"comfortable\"\n },\n className: {\n description:\n \"Additional CSS class names. You can pass multiple class names that will be applied to Grid.\",\n control: \"text\"\n }\n }\n};\n"],"names":["meta","Grid","Default","StyledColumn","WithGapNone","WithGapMicro","WithGapSmall","WithGapCompact","WithGapComfortable","WithGapSpacious","WithOffset","Documentation","args"],"mappings":";;;AAMA,MAAMA,OAA0B;IAC5B,OAAO;IACP,WAAWC;IACX,YAAY;QACR,QAAQ;IACZ;AACJ;AAEA,qBAAeD;AAIR,MAAME,UAAiB;IAC1B,MAAM;QACF,WAAW;QACX,UAAU,WAAV,GACI,wDACI,oBAACC,cAAYA;YAAC,OAAO;0BACrB,oBAACA,cAAYA;YAAC,OAAO;YAAG,MAAM;0BAC9B,oBAACA,cAAYA;YAAC,OAAO;0BACrB,oBAACA,cAAYA;YAAC,OAAO;0BACrB,oBAACA,cAAYA;YAAC,OAAO;0BACrB,oBAACA,cAAYA;YAAC,OAAO;0BACrB,oBAACA,cAAYA;YAAC,OAAO;YAAG,MAAM;0BAC9B,oBAACA,cAAYA;YAAC,OAAO;0BACrB,oBAACA,cAAYA;YAAC,OAAO;;IAGjC;AACJ;AAEO,MAAMC,cAAqB;IAC9B,MAAM;QACF,GAAGF,QAAQ,IAAI;QACf,KAAK;IACT;AACJ;AAEO,MAAMG,eAAsB;IAC/B,MAAM;QACF,GAAGH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T,uBACQ,oBAAC,aAAK,0BAGf,oBAACA,KAAK,MAAM;YAAC,WAAU;WAAuD,wBAG9E,oBAACA,KAAK,MAAM;YAAC,WAAU;WAAuD;IAM1F,MAAM;QACF,KAAK;QACL,WAAW;IACf;IACA,UAAU;QACN,KAAK;YACD,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAQ;gBAAS;gBAAS;gBAAW;gBAAe;aAAW;YACzE,cAAc;QAClB;QACA,WAAW;YACP,aACI;YACJ,SAAS;QACb;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 { HeaderBar } from "./HeaderBar.js";
3
3
  declare const meta: Meta<typeof HeaderBar>;
4
4
  export default meta;
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderBar/HeaderBar.stories.js","sources":["../../src/HeaderBar/HeaderBar.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react-webpack5\";\nimport { ReactComponent as KeyboardArrowRightIcon } from \"@webiny/icons/keyboard_arrow_down.svg\";\nimport { HeaderBar } from \"./HeaderBar.js\";\nimport React from \"react\";\nimport { Button, IconButton } from \"~/Button/index.js\";\nimport { Avatar } from \"~/Avatar/index.js\";\nimport { Text } from \"~/Text/index.js\";\n\nconst meta: Meta<typeof HeaderBar> = {\n title: \"Components/HeaderBar\",\n component: HeaderBar,\n decorators: [\n Story => (\n <div className=\"bg-[#f4f4f4] h-[500px] w-[850px] rounded-[5px] px-[50px] content-center\">\n <Story />\n </div>\n )\n ]\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof HeaderBar>;\n\nconst StartExample = () => (\n <Text size={\"sm\"} className={\"text-neutral-dimmed\"}>\n {\"Headless CMS / Articles / The best article ever\"}\n </Text>\n);\n\nconst MiddleExample = () => <>Content in the middle</>;\n\nconst EndExample = () => (\n <div className={\"flex gap-x-sm\"}>\n <Button variant={\"ghost\"} size={\"md\"} text={\"Root tenant\"} />\n <div className={\"flex items-center rounded-md gap-xxs py-xs px-xs bg-neutral-light\"}>\n <Avatar\n size={\"sm\"}\n variant={\"strong\"}\n image={<Avatar.Image src={\"https://i.pravatar.cc/300\"} />}\n fallback={<Avatar.Fallback delayMs={0}>W</Avatar.Fallback>}\n />\n <IconButton\n variant={\"ghost\"}\n size={\"xs\"}\n color={\"neutral-strong\"}\n icon={<KeyboardArrowRightIcon />}\n onClick={() => console.log(\"clicked\")}\n />\n </div>\n </div>\n);\n\nexport const Default: Story = {\n args: {\n start: <StartExample />,\n middle: <MiddleExample />,\n end: <EndExample />\n }\n};\n\nexport const StartContentOnly: Story = {\n args: {\n start: <StartExample />\n }\n};\n\nexport const MiddleContentOnly: Story = {\n args: {\n middle: <MiddleExample />\n }\n};\n\nexport const EndContentOnly: Story = {\n args: {\n end: <EndExample />\n }\n};\n\nexport const StartEndContentOnly: Story = {\n args: {\n start: <StartExample />,\n end: <EndExample />\n }\n};\n\nexport const MoreStartContent: Story = {\n args: {\n start: (\n <>\n <StartExample />\n <StartExample />\n <StartExample />\n </>\n ),\n middle: <MiddleExample />,\n end: <EndExample />\n }\n};\n\nexport const Documentation: Story = {\n args: {\n start: <StartExample />,\n middle: <MiddleExample />,\n end: <EndExample />\n },\n argTypes: {\n start: {\n description: \"Content displayed at the start of the header bar\"\n },\n middle: {\n description: \"Content displayed in the middle of the header bar\"\n },\n end: {\n description: \"Content displayed at the end of the header bar\"\n }\n }\n};\n"],"names":["meta","HeaderBar","Story","StartExample","Text","MiddleExample","EndExample","Button","Avatar","IconButton","KeyboardArrowRightIcon","console","Default","StartContentOnly","MiddleContentOnly","EndContentOnly","StartEndContentOnly","MoreStartContent","Documentation"],"mappings":";;;;;;AAQA,MAAMA,OAA+B;IACjC,OAAO;IACP,WAAWC;IACX,YAAY;QACRC,CAAAA,QAAAA,WAAAA,GACI,oBAAC;gBAAI,WAAU;6BACX,oBAACA,OAAAA;KAGZ;AACL;AAEA,0BAAeF;AA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AAK,WAAL,GAAK,oBAACC,YAAUA;IACpB;AACJ;AAEO,MAAMY,gBAAuB;IAChC,MAAM;QACF,OAAO,WAAP,GAAO,oBAACf,cAAYA;QACpB,QAAQ,WAAR,GAAQ,oBAACE,eAAaA;QACtB,KAAK,WAAL,GAAK,oBAACC,YAAUA;IACpB;IACA,UAAU;QACN,OAAO;YACH,aAAa;QACjB;QACA,QAAQ;YACJ,aAAa;QACjB;QACA,KAAK;YACD,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"file":"HeaderBar/HeaderBar.stories.js","sources":["../../src/HeaderBar/HeaderBar.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react\";\nimport { ReactComponent as KeyboardArrowRightIcon } from \"@webiny/icons/keyboard_arrow_down.svg\";\nimport { HeaderBar } from \"./HeaderBar.js\";\nimport React from \"react\";\nimport { Button, IconButton } from \"~/Button/index.js\";\nimport { Avatar } from \"~/Avatar/index.js\";\nimport { Text } from \"~/Text/index.js\";\n\nconst meta: Meta<typeof HeaderBar> = {\n title: \"Components/HeaderBar\",\n component: HeaderBar,\n decorators: [\n Story => (\n <div className=\"bg-[#f4f4f4] h-[500px] w-[850px] rounded-[5px] px-[50px] content-center\">\n <Story />\n </div>\n )\n ]\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof HeaderBar>;\n\nconst StartExample = () => (\n <Text size={\"sm\"} className={\"text-neutral-dimmed\"}>\n {\"Headless CMS / Articles / The best article ever\"}\n </Text>\n);\n\nconst MiddleExample = () => <>Content in the middle</>;\n\nconst EndExample = () => (\n <div className={\"flex gap-x-sm\"}>\n <Button variant={\"ghost\"} size={\"md\"} text={\"Root tenant\"} />\n <div className={\"flex items-center rounded-md gap-xxs py-xs px-xs bg-neutral-light\"}>\n <Avatar\n size={\"sm\"}\n variant={\"strong\"}\n image={<Avatar.Image src={\"https://i.pravatar.cc/300\"} />}\n fallback={<Avatar.Fallback delayMs={0}>W</Avatar.Fallback>}\n />\n <IconButton\n variant={\"ghost\"}\n size={\"xs\"}\n color={\"neutral-strong\"}\n icon={<KeyboardArrowRightIcon />}\n onClick={() => console.log(\"clicked\")}\n />\n </div>\n </div>\n);\n\nexport const Default: Story = {\n args: {\n start: <StartExample />,\n middle: <MiddleExample />,\n end: <EndExample />\n }\n};\n\nexport const StartContentOnly: Story = {\n args: {\n start: <StartExample />\n }\n};\n\nexport const MiddleContentOnly: Story = {\n args: {\n middle: <MiddleExample />\n }\n};\n\nexport const EndContentOnly: Story = {\n args: {\n end: <EndExample />\n }\n};\n\nexport const StartEndContentOnly: Story = {\n args: {\n start: <StartExample />,\n end: <EndExample />\n }\n};\n\nexport const MoreStartContent: Story = {\n args: {\n start: (\n <>\n <StartExample />\n <StartExample />\n <StartExample />\n </>\n ),\n middle: <MiddleExample />,\n end: <EndExample />\n }\n};\n\nexport const Documentation: Story = {\n args: {\n start: <StartExample />,\n middle: <MiddleExample />,\n end: <EndExample />\n },\n argTypes: {\n start: {\n description: \"Content displayed at the start of the header bar\"\n },\n middle: {\n description: \"Content displayed in the middle of the header bar\"\n },\n end: {\n description: \"Content displayed at the end of the header bar\"\n }\n }\n};\n"],"names":["meta","HeaderBar","Story","StartExample","Text","MiddleExample","EndExample","Button","Avatar","IconButton","KeyboardArrowRightIcon","console","Default","StartContentOnly","MiddleContentOnly","EndContentOnly","StartEndContentOnly","MoreStartContent","Documentation"],"mappings":";;;;;;AAQA,MAAMA,OAA+B;IACjC,OAAO;IACP,WAAWC;IACX,YAAY;QACRC,CAAAA,QAAAA,WAAAA,GACI,oBAAC;gBAAI,WAAU;6BACX,oBAACA,OAAAA;KAGZ;AACL;AAEA,0BAAeF;AAIf,MAAMG,eAAe,kBACjB,oBAACC,MAAIA;QAAC,MAAM;QAAM,WAAW;OACxB;AAIT,MAAMC,gBAAgB,kBAAM,0CAAE;AAE9B,MAAMC,aAAa,kBACf,oBAAC;QAAI,WAAW;qBACZ,oBAACC,QAAMA;QAAC,SAAS;QAAS,MAAM;QAAM,MAA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AAU;QACN,OAAO;YACH,aAAa;QACjB;QACA,QAAQ;YACJ,aAAa;QACjB;QACA,KAAK;YACD,aAAa;QACjB;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 { Heading } from "./Heading.js";
3
3
  declare const meta: Meta<typeof Heading>;
4
4
  export default meta;