@webiny/admin-ui 6.4.12-beta.5 → 6.5.0-beta.1

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 (316) hide show
  1. package/Accordion/Accordion.d.ts +7 -6
  2. package/Accordion/components/AccordionContent.js +4 -1
  3. package/Accordion/components/AccordionContent.js.map +1 -1
  4. package/Accordion/components/AccordionItem.d.ts +8 -6
  5. package/Accordion/components/AccordionItem.js.map +1 -1
  6. package/Accordion/components/AccordionItemAction.d.ts +7 -6
  7. package/Accordion/components/AccordionItemDragHandle.d.ts +2 -1
  8. package/Accordion/components/AccordionItemDragHandle.js +2 -1
  9. package/Accordion/components/AccordionItemDragHandle.js.map +1 -1
  10. package/Accordion/components/AccordionItemIcon.d.ts +7 -6
  11. package/Accordion/components/AccordionItemSeparator.d.ts +7 -6
  12. package/Accordion/components/AccordionTrigger.js +4 -2
  13. package/Accordion/components/AccordionTrigger.js.map +1 -1
  14. package/Alert/Alert.d.ts +21 -19
  15. package/AutoComplete/AutoComplete.d.ts +7 -6
  16. package/AutoComplete/primitives/AutoCompletePrimitive.d.ts +7 -6
  17. package/Avatar/Avatar.d.ts +9 -8
  18. package/Avatar/components/AvatarFallback.d.ts +7 -6
  19. package/Avatar/components/AvatarImage.d.ts +7 -6
  20. package/BetaBadge/BetaBadge.d.ts +6 -0
  21. package/BetaBadge/BetaBadge.js +7 -0
  22. package/BetaBadge/BetaBadge.js.map +1 -0
  23. package/Button/Button.d.ts +10 -9
  24. package/Button/CopyButton.d.ts +7 -6
  25. package/Button/IconButton.d.ts +10 -9
  26. package/Calendar/Calendar.d.ts +7 -6
  27. package/Calendar/calendarClassNames.js +1 -1
  28. package/Calendar/calendarClassNames.js.map +1 -1
  29. package/Card/Card.d.ts +8 -22
  30. package/Card/components/CancelAction.d.ts +8 -6
  31. package/Card/components/CardContent.d.ts +6 -6
  32. package/Card/components/CardTitle.d.ts +2 -2
  33. package/Card/components/ConfirmAction.d.ts +8 -6
  34. package/Card/components/Icon.d.ts +7 -6
  35. package/Checkbox/Checkbox.d.ts +7 -6
  36. package/Checkbox/primitives/CheckboxPrimitive.d.ts +17 -12
  37. package/CheckboxGroup/CheckboxGroup.d.ts +7 -6
  38. package/CheckboxGroup/primitives/CheckboxGroupPrimitive.d.ts +20 -12
  39. package/CodeEditor/CodeEditor.d.ts +7 -6
  40. package/CodeEditor/CodeEditorPrimitive.d.ts +7 -6
  41. package/CodeEditor/CodeEditorPrimitive.js +3 -1
  42. package/CodeEditor/CodeEditorPrimitive.js.map +1 -1
  43. package/ColorPicker/ColorPicker.d.ts +7 -6
  44. package/ColorPicker/primitives/ColorPickerPrimitive.d.ts +7 -6
  45. package/Command/Command.d.ts +10 -8
  46. package/Command/components/List.d.ts +1 -1
  47. package/Command/components/List.js +9 -5
  48. package/Command/components/List.js.map +1 -1
  49. package/DataList/DataListModal.d.ts +6 -3
  50. package/DataTable/DataTable.d.ts +13 -22
  51. package/DataTable/DataTable.js +6 -14
  52. package/DataTable/DataTable.js.map +1 -1
  53. package/DataTable/components/ColumnsVisibility.d.ts +4 -5
  54. package/DataTable/components/ColumnsVisibility.js +3 -6
  55. package/DataTable/components/ColumnsVisibility.js.map +1 -1
  56. package/DatePicker/DatePicker.d.ts +11 -7
  57. package/DatePicker/DatePicker.js +10 -2
  58. package/DatePicker/DatePicker.js.map +1 -1
  59. package/DatePicker/primitives/DatePickerPrimitive.d.ts +7 -6
  60. package/DatePicker/primitives/DateTimePicker.d.ts +1 -1
  61. package/DatePicker/primitives/DateTimePicker.js +23 -16
  62. package/DatePicker/primitives/DateTimePicker.js.map +1 -1
  63. package/DatePicker/primitives/components/DatePickerTrigger.js +1 -1
  64. package/DatePicker/primitives/components/DatePickerTrigger.js.map +1 -1
  65. package/DatePicker/utils/dateHelpers.d.ts +1 -1
  66. package/DatePicker/utils/dateHelpers.js +2 -1
  67. package/DatePicker/utils/dateHelpers.js.map +1 -1
  68. package/DatePicker/utils/timezoneHelpers.d.ts +3 -0
  69. package/DatePicker/utils/timezoneHelpers.js +32 -0
  70. package/DatePicker/utils/timezoneHelpers.js.map +1 -0
  71. package/DatePicker/utils/types.d.ts +2 -0
  72. package/Dialog/Dialog.d.ts +8 -22
  73. package/Dialog/components/CancelAction.d.ts +8 -6
  74. package/Dialog/components/ConfirmAction.d.ts +8 -6
  75. package/Dialog/components/DialogContent.d.ts +1 -1
  76. package/Dialog/components/DialogFooter.d.ts +1 -1
  77. package/Dialog/components/DialogTitle.d.ts +1 -1
  78. package/Dialog/components/Icon.d.ts +7 -6
  79. package/Drawer/Drawer.d.ts +8 -22
  80. package/Drawer/Drawer.stories.js +1 -0
  81. package/Drawer/Drawer.stories.js.map +1 -1
  82. package/Drawer/components/CancelButton.d.ts +8 -6
  83. package/Drawer/components/ConfirmButton.d.ts +8 -6
  84. package/Drawer/components/DrawerContent.d.ts +1 -1
  85. package/Drawer/components/Icon.d.ts +7 -6
  86. package/DropdownMenu/components/DropdownMenuItem.d.ts +3 -2
  87. package/DropdownMenu/components/DropdownMenuItem.js +9 -2
  88. package/DropdownMenu/components/DropdownMenuItem.js.map +1 -1
  89. package/DropdownMenu/components/DropdownMenuLink.d.ts +9 -8
  90. package/DropdownMenu/components/DropdownMenuSeparator.d.ts +7 -6
  91. package/EditableTitle/EditableTitle.d.ts +7 -6
  92. package/EmptyState/EmptyState.d.ts +43 -0
  93. package/EmptyState/EmptyState.js +93 -0
  94. package/EmptyState/EmptyState.js.map +1 -0
  95. package/EmptyState/EmptyState.stories.d.ts +13 -0
  96. package/EmptyState/EmptyState.stories.js +136 -0
  97. package/EmptyState/EmptyState.stories.js.map +1 -0
  98. package/EmptyState/illustrations/ContentIllustration.d.ts +2 -0
  99. package/EmptyState/illustrations/ContentIllustration.js +100 -0
  100. package/EmptyState/illustrations/ContentIllustration.js.map +1 -0
  101. package/EmptyState/illustrations/LayoutIllustration.d.ts +2 -0
  102. package/EmptyState/illustrations/LayoutIllustration.js +93 -0
  103. package/EmptyState/illustrations/LayoutIllustration.js.map +1 -0
  104. package/EmptyState/illustrations/ListingIllustration.d.ts +2 -0
  105. package/EmptyState/illustrations/ListingIllustration.js +92 -0
  106. package/EmptyState/illustrations/ListingIllustration.js.map +1 -0
  107. package/EmptyState/illustrations/SelectIllustration.d.ts +2 -0
  108. package/EmptyState/illustrations/SelectIllustration.js +100 -0
  109. package/EmptyState/illustrations/SelectIllustration.js.map +1 -0
  110. package/EmptyState/illustrations/TableIllustration.d.ts +2 -0
  111. package/EmptyState/illustrations/TableIllustration.js +233 -0
  112. package/EmptyState/illustrations/TableIllustration.js.map +1 -0
  113. package/EmptyState/illustrations/UploadIllustration.d.ts +2 -0
  114. package/EmptyState/illustrations/UploadIllustration.js +77 -0
  115. package/EmptyState/illustrations/UploadIllustration.js.map +1 -0
  116. package/EmptyState/illustrations/index.d.ts +6 -0
  117. package/EmptyState/illustrations/index.js +6 -0
  118. package/EmptyState/index.d.ts +1 -0
  119. package/EmptyState/index.js +1 -0
  120. package/FilePicker/FilePicker.d.ts +19 -18
  121. package/FilePicker/FilePicker.stories.d.ts +0 -6
  122. package/FilePicker/FilePicker.stories.js +1 -24
  123. package/FilePicker/FilePicker.stories.js.map +1 -1
  124. package/FilePicker/primitives/FilePickerPrimitive.d.ts +20 -19
  125. package/FilePicker/primitives/components/Trigger.d.ts +1 -1
  126. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.d.ts +19 -7
  127. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js +15 -6
  128. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js.map +1 -1
  129. package/FilePicker/primitives/components/previews/ItemActions.js.map +1 -1
  130. package/FilePicker/primitives/components/previews/ItemDescription.js +1 -1
  131. package/FilePicker/primitives/components/previews/ItemDescription.js.map +1 -1
  132. package/FilePicker/primitives/components/previews/RichItemPreview/FileType.d.ts +0 -4
  133. package/FilePicker/primitives/components/previews/RichItemPreview/FileType.js.map +1 -1
  134. package/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.d.ts +0 -3
  135. package/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.js.map +1 -1
  136. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.d.ts +12 -6
  137. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js +6 -4
  138. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js.map +1 -1
  139. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.d.ts +6 -1
  140. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.js +3 -2
  141. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.js.map +1 -1
  142. package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.d.ts +5 -5
  143. package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.js +7 -3
  144. package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.js.map +1 -1
  145. package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.d.ts +0 -5
  146. package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.js.map +1 -1
  147. package/FilePicker/primitives/components/previews/TextOnlyPreview/TextOnlyPreview.d.ts +7 -6
  148. package/FilePicker/primitives/components/previews/TruncatedFileName.d.ts +0 -4
  149. package/FilePicker/primitives/components/previews/TruncatedFileName.js.map +1 -1
  150. package/FilePicker/primitives/components/previews/fileName.d.ts +0 -8
  151. package/FilePicker/primitives/components/previews/fileName.js.map +1 -1
  152. package/FilePicker/primitives/components/previews/variants.d.ts +1 -1
  153. package/FillViewport/FillViewport.d.ts +21 -18
  154. package/FormComponent/Description.d.ts +7 -6
  155. package/FormComponent/ErrorMessage.d.ts +7 -6
  156. package/FormComponent/Label.d.ts +7 -6
  157. package/FormComponent/Note.d.ts +7 -6
  158. package/Grid/Grid.d.ts +24 -22
  159. package/HeaderBar/HeaderBar.d.ts +7 -6
  160. package/Heading/Heading.d.ts +8 -7
  161. package/Icon/Icon.d.ts +9 -8
  162. package/IconPicker/IconPicker.d.ts +7 -6
  163. package/IconPicker/domains/IconPickerIcon.js +1 -1
  164. package/IconPicker/domains/IconPickerIcon.js.map +1 -1
  165. package/IconPicker/primitives/IconPickerPrimitive.d.ts +1 -1
  166. package/IconPicker/primitives/IconPickerPrimitive.js +1 -2
  167. package/IconPicker/primitives/IconPickerPrimitive.js.map +1 -1
  168. package/IconPicker/primitives/components/IconPickerTrigger.d.ts +1 -1
  169. package/ImageEditor/AspectRatioPreview.d.ts +16 -0
  170. package/ImageEditor/AspectRatioPreview.js +26 -0
  171. package/ImageEditor/AspectRatioPreview.js.map +1 -0
  172. package/ImageEditor/CropHotspotEditor.d.ts +22 -0
  173. package/ImageEditor/CropHotspotEditor.js +402 -0
  174. package/ImageEditor/CropHotspotEditor.js.map +1 -0
  175. package/ImageEditor/ImageEditor.d.ts +18 -0
  176. package/ImageEditor/ImageEditor.js +151 -0
  177. package/ImageEditor/ImageEditor.js.map +1 -0
  178. package/ImageEditor/ImageEditor.stories.d.ts +6 -0
  179. package/ImageEditor/ImageEditor.stories.js +42 -0
  180. package/ImageEditor/ImageEditor.stories.js.map +1 -0
  181. package/ImageEditor/MetaFields.d.ts +12 -0
  182. package/ImageEditor/MetaFields.js +20 -0
  183. package/ImageEditor/MetaFields.js.map +1 -0
  184. package/ImageEditor/SectionLabel.d.ts +8 -0
  185. package/ImageEditor/SectionLabel.js +7 -0
  186. package/ImageEditor/SectionLabel.js.map +1 -0
  187. package/ImageEditor/geometry.d.ts +46 -0
  188. package/ImageEditor/geometry.js +126 -0
  189. package/ImageEditor/geometry.js.map +1 -0
  190. package/ImageEditor/index.d.ts +3 -0
  191. package/ImageEditor/index.js +3 -0
  192. package/ImageEditor/types.d.ts +52 -0
  193. package/ImageEditor/types.js +35 -0
  194. package/ImageEditor/types.js.map +1 -0
  195. package/Input/Input.d.ts +7 -6
  196. package/Input/InputPrimitive.d.ts +9 -8
  197. package/Label/Label.d.ts +8 -7
  198. package/Label/components/LabelValue.d.ts +1 -1
  199. package/Link/Link.d.ts +2 -2
  200. package/List/List.d.ts +8 -7
  201. package/List/components/ListItem.d.ts +7 -6
  202. package/List/components/ListItemAction.d.ts +7 -6
  203. package/List/components/ListItemHandle.d.ts +7 -6
  204. package/List/components/ListItemIcon.d.ts +7 -6
  205. package/List/components/ListItemSeparator.d.ts +7 -6
  206. package/Loader/Loader.d.ts +9 -8
  207. package/Loader/OverlayLoader.d.ts +7 -6
  208. package/MultiAutoComplete/MultiAutoComplete.d.ts +7 -6
  209. package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.d.ts +7 -6
  210. package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.test.js +1 -1
  211. package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.test.js.map +1 -1
  212. package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenterWithFreeInput.d.ts +3 -3
  213. package/MultiAutoComplete/primitives/useMultiAutoComplete.d.ts +3 -3
  214. package/MultiAutoComplete/primitives/useMultiAutoComplete.js +2 -3
  215. package/MultiAutoComplete/primitives/useMultiAutoComplete.js.map +1 -1
  216. package/MultiFilePicker/MultiFilePicker.d.ts +19 -18
  217. package/MultiFilePicker/primitives/MultiFilePickerPrimitive.d.ts +19 -18
  218. package/MultiSelect/MultiSelect.d.ts +7 -6
  219. package/MultiSelect/primitives/MultiSelectPrimitive.d.ts +10 -6
  220. package/MultiSelect/primitives/MultiSelectPrimitive.js +12 -5
  221. package/MultiSelect/primitives/MultiSelectPrimitive.js.map +1 -1
  222. package/Popover/Popover.d.ts +7 -6
  223. package/Popover/Popover.stories.d.ts +7 -0
  224. package/Popover/Popover.stories.js +24 -1
  225. package/Popover/Popover.stories.js.map +1 -1
  226. package/Popover/primitives/PopoverPrimitive.d.ts +7 -7
  227. package/Popover/primitives/components/PopoverContent.js +6 -1
  228. package/Popover/primitives/components/PopoverContent.js.map +1 -1
  229. package/ProgressBar/ProgressBar.d.ts +7 -6
  230. package/RadioGroup/RadioGroup.d.ts +7 -6
  231. package/RadioGroup/primitives/Radio.d.ts +7 -6
  232. package/RadioGroup/primitives/RadioGroupPrimitive.d.ts +5 -1
  233. package/RangeSlider/RangeSlider.d.ts +7 -6
  234. package/ScrollArea/ScrollArea.d.ts +12 -2
  235. package/ScrollArea/ScrollArea.js +11 -4
  236. package/ScrollArea/ScrollArea.js.map +1 -1
  237. package/SegmentedControl/SegmentedControl.d.ts +8 -7
  238. package/SegmentedControl/SegmentedControlTabs.d.ts +5 -2
  239. package/SegmentedControl/primitives/SegmentedControlPrimitive.d.ts +1 -1
  240. package/Select/Select.d.ts +7 -6
  241. package/Select/primitives/components/SelectContent.js +4 -6
  242. package/Select/primitives/components/SelectContent.js.map +1 -1
  243. package/Select/primitives/components/SelectTrigger.d.ts +2 -2
  244. package/Separator/Separator.d.ts +9 -8
  245. package/Sidebar/Sidebar.d.ts +7 -6
  246. package/Sidebar/components/SidebarIcon.d.ts +7 -6
  247. package/Sidebar/components/SidebarProvider.d.ts +4 -4
  248. package/Sidebar/components/items/SidebarMenuGroup.d.ts +9 -8
  249. package/Sidebar/components/items/SidebarMenuItem.d.ts +11 -10
  250. package/Sidebar/components/items/SidebarMenuItemIcon.d.ts +7 -6
  251. package/Sidebar/components/items/SidebarMenuLink.d.ts +11 -10
  252. package/Sidebar/components/items/SidebarMenuProvider.d.ts +4 -4
  253. package/Sidebar/components/items/SidebarMenuRootItem.d.ts +9 -7
  254. package/Skeleton/Skeleton.d.ts +9 -7
  255. package/Skeleton/Skeleton.js +10 -4
  256. package/Skeleton/Skeleton.js.map +1 -1
  257. package/Skeleton/Skeleton.stories.d.ts +2 -0
  258. package/Skeleton/Skeleton.stories.js +28 -2
  259. package/Skeleton/Skeleton.stories.js.map +1 -1
  260. package/Slider/Slider.d.ts +7 -6
  261. package/SteppedProgress/SteppedProgress.d.ts +7 -6
  262. package/SteppedProgress/SteppedProgressItem.d.ts +7 -6
  263. package/Switch/Switch.d.ts +7 -6
  264. package/Switch/primitives/SwitchPrimitive.d.ts +10 -6
  265. package/Table/Table.d.ts +12 -10
  266. package/Table/components/Direction.d.ts +1 -1
  267. package/Tabs/Tabs.d.ts +8 -6
  268. package/Tabs/Tabs.js +5 -2
  269. package/Tabs/Tabs.js.map +1 -1
  270. package/Tabs/components/Content.d.ts +1 -1
  271. package/Tabs/components/List.d.ts +2 -2
  272. package/Tabs/components/Tab.d.ts +7 -6
  273. package/Tabs/components/Trigger.d.ts +3 -2
  274. package/Tabs/components/Trigger.js +8 -3
  275. package/Tabs/components/Trigger.js.map +1 -1
  276. package/Tag/Tag.d.ts +8 -7
  277. package/Tags/Tags.d.ts +7 -6
  278. package/Tags/primitives/TagsPrimitive.d.ts +7 -6
  279. package/Text/Text.d.ts +8 -7
  280. package/Textarea/Textarea.d.ts +7 -6
  281. package/Textarea/TextareaPrimitive.d.ts +9 -8
  282. package/Toast/Toast.d.ts +7 -6
  283. package/Toast/components/ToastActions.d.ts +7 -6
  284. package/Toast/components/ToastDescription.d.ts +7 -6
  285. package/Toast/components/ToastTitle.d.ts +7 -6
  286. package/Toast/useToast.stories.js.map +1 -1
  287. package/Toggle/Toggle.d.ts +7 -6
  288. package/Toggle/primitives/TogglePrimitive.d.ts +13 -9
  289. package/ToggleGroup/ToggleGroup.d.ts +7 -6
  290. package/ToggleGroup/primitives/ToggleGroupPrimitive.d.ts +13 -9
  291. package/Tooltip/Tooltip.d.ts +7 -6
  292. package/Tree/Tree.d.ts +7 -6
  293. package/Tree/components/Item.d.ts +7 -6
  294. package/Tree/components/ItemCollapseTrigger.d.ts +7 -6
  295. package/Tree/components/ItemContent.d.ts +8 -6
  296. package/Tree/components/ItemDragHandle.d.ts +7 -6
  297. package/Tree/components/ItemIcon.d.ts +7 -6
  298. package/Tree/components/ItemPlaceholder.d.ts +7 -6
  299. package/Tree/components/ItemSubIndentation.d.ts +7 -6
  300. package/Widget/Widget.d.ts +8 -22
  301. package/Widget/components/Icon.d.ts +7 -6
  302. package/Widget/components/WidgetAction.d.ts +8 -6
  303. package/Widget/components/WidgetContent.d.ts +5 -5
  304. package/exports/admin/ui.d.ts +2 -0
  305. package/exports/admin/ui.js +2 -0
  306. package/hooks/index.d.ts +1 -0
  307. package/hooks/index.js +1 -0
  308. package/hooks/useEscapeScrollLock.d.ts +13 -0
  309. package/hooks/useEscapeScrollLock.js +21 -0
  310. package/hooks/useEscapeScrollLock.js.map +1 -0
  311. package/index.d.ts +3 -0
  312. package/index.js +3 -0
  313. package/package.json +25 -25
  314. package/theme.css +41 -1
  315. package/utils.js +52 -34
  316. package/utils.js.map +1 -1
@@ -3,21 +3,22 @@ import { type IconProps } from "../../../Icon/index.js";
3
3
  interface SidebarMenuItemIconProps extends Omit<IconProps, "icon"> {
4
4
  element?: React.ReactNode;
5
5
  }
6
- declare const SidebarMenuItemIcon: (({ element, ...props }: SidebarMenuItemIconProps) => React.JSX.Element | null) & {
7
- original: ({ element, ...props }: SidebarMenuItemIconProps) => React.JSX.Element | null;
6
+ declare const SidebarMenuItemIconBase: ({ element, ...props }: SidebarMenuItemIconProps) => React.JSX.Element | null;
7
+ declare const SidebarMenuItemIcon: typeof SidebarMenuItemIconBase & {
8
+ original: typeof SidebarMenuItemIconBase;
8
9
  originalName: string;
9
10
  displayName: string;
10
11
  } & {
11
- original: (({ element, ...props }: SidebarMenuItemIconProps) => React.JSX.Element | null) & {
12
- original: ({ element, ...props }: SidebarMenuItemIconProps) => React.JSX.Element | null;
12
+ original: typeof SidebarMenuItemIconBase & {
13
+ original: typeof SidebarMenuItemIconBase;
13
14
  originalName: string;
14
15
  displayName: string;
15
16
  };
16
17
  originalName: string;
17
18
  displayName: string;
18
19
  } & {
19
- createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ element, ...props }: SidebarMenuItemIconProps) => React.JSX.Element | null) & {
20
- original: ({ element, ...props }: SidebarMenuItemIconProps) => React.JSX.Element | null;
20
+ createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<typeof SidebarMenuItemIconBase & {
21
+ original: typeof SidebarMenuItemIconBase;
21
22
  originalName: string;
22
23
  displayName: string;
23
24
  }>) => (props: unknown) => React.JSX.Element;
@@ -1,23 +1,24 @@
1
1
  import React from "react";
2
2
  import { type SidebarMenuItemLinkProps } from "./SidebarMenuItem.js";
3
3
  import { type SidebarMenuItemIconProps } from "../../../Sidebar/components/items/SidebarMenuItemIcon.js";
4
- import { type SidebarMenuItemActionProps } from "../../../Sidebar/components/items/SidebarMenuItemAction.js";
5
- import { type SidebarMenuItemBadgeProps } from "../../../Sidebar/components/items/SidebarMenuItemBadge.js";
6
- declare const SidebarMenuLink: ((props: SidebarMenuItemLinkProps) => React.JSX.Element) & {
7
- original: (props: SidebarMenuItemLinkProps) => React.JSX.Element;
4
+ import { SidebarMenuItemAction, type SidebarMenuItemActionProps } from "../../../Sidebar/components/items/SidebarMenuItemAction.js";
5
+ import { SidebarMenuItemBadge, type SidebarMenuItemBadgeProps } from "../../../Sidebar/components/items/SidebarMenuItemBadge.js";
6
+ declare const SidebarMenuLinkBase: (props: SidebarMenuItemLinkProps) => React.JSX.Element;
7
+ declare const SidebarMenuLink: typeof SidebarMenuLinkBase & {
8
+ original: typeof SidebarMenuLinkBase;
8
9
  originalName: string;
9
10
  displayName: string;
10
11
  } & {
11
- original: ((props: SidebarMenuItemLinkProps) => React.JSX.Element) & {
12
- original: (props: SidebarMenuItemLinkProps) => React.JSX.Element;
12
+ original: typeof SidebarMenuLinkBase & {
13
+ original: typeof SidebarMenuLinkBase;
13
14
  originalName: string;
14
15
  displayName: string;
15
16
  };
16
17
  originalName: string;
17
18
  displayName: string;
18
19
  } & {
19
- createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<((props: SidebarMenuItemLinkProps) => React.JSX.Element) & {
20
- original: (props: SidebarMenuItemLinkProps) => React.JSX.Element;
20
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof SidebarMenuLinkBase & {
21
+ original: typeof SidebarMenuLinkBase;
21
22
  originalName: string;
22
23
  displayName: string;
23
24
  }>) => (props: unknown) => React.JSX.Element;
@@ -41,7 +42,7 @@ declare const SidebarMenuLink: ((props: SidebarMenuItemLinkProps) => React.JSX.E
41
42
  displayName: string;
42
43
  }>) => (props: unknown) => React.JSX.Element;
43
44
  };
44
- Action: ({ element, showOnHover, className, ...props }: SidebarMenuItemActionProps) => React.JSX.Element | null;
45
- Badge: ({ text }: SidebarMenuItemBadgeProps) => React.JSX.Element;
45
+ Action: typeof SidebarMenuItemAction;
46
+ Badge: typeof SidebarMenuItemBadge;
46
47
  };
47
48
  export { SidebarMenuLink, type SidebarMenuItemLinkProps, type SidebarMenuItemIconProps, type SidebarMenuItemActionProps, type SidebarMenuItemBadgeProps };
@@ -11,8 +11,8 @@ interface SidebarMenuProviderProps {
11
11
  }
12
12
  declare const SidebarMenuContext: React.Context<SidebarMenuContext>;
13
13
  declare function useSidebarMenu(): SidebarMenuContext;
14
- declare const SidebarMenuProvider: {
15
- ({ level, parentIcon, children }: SidebarMenuProviderProps): React.JSX.Element;
16
- displayName: string;
17
- };
14
+ declare function SidebarMenuProvider({ level, parentIcon, children }: SidebarMenuProviderProps): React.JSX.Element;
15
+ declare namespace SidebarMenuProvider {
16
+ var displayName: string;
17
+ }
18
18
  export { SidebarMenuProvider, useSidebarMenu };
@@ -1,20 +1,22 @@
1
1
  import React from "react";
2
+ import { SidebarMenuItemAction } from "./SidebarMenuItemAction.js";
2
3
  import { type SidebarMenuItemProps } from "./SidebarMenuItem.js";
3
- declare const SidebarMenuRootItem: (({ children, className, pinnable, action, ...buttonProps }: SidebarMenuItemProps) => React.JSX.Element) & {
4
- original: ({ children, className, pinnable, action, ...buttonProps }: SidebarMenuItemProps) => React.JSX.Element;
4
+ declare const SidebarMenuItemBase: ({ children, className, pinnable, action, ...buttonProps }: SidebarMenuItemProps) => React.JSX.Element;
5
+ declare const SidebarMenuRootItem: typeof SidebarMenuItemBase & {
6
+ original: typeof SidebarMenuItemBase;
5
7
  originalName: string;
6
8
  displayName: string;
7
9
  } & {
8
- original: (({ children, className, pinnable, action, ...buttonProps }: SidebarMenuItemProps) => React.JSX.Element) & {
9
- original: ({ children, className, pinnable, action, ...buttonProps }: SidebarMenuItemProps) => React.JSX.Element;
10
+ original: typeof SidebarMenuItemBase & {
11
+ original: typeof SidebarMenuItemBase;
10
12
  originalName: string;
11
13
  displayName: string;
12
14
  };
13
15
  originalName: string;
14
16
  displayName: string;
15
17
  } & {
16
- createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ children, className, pinnable, action, ...buttonProps }: SidebarMenuItemProps) => React.JSX.Element) & {
17
- original: ({ children, className, pinnable, action, ...buttonProps }: SidebarMenuItemProps) => React.JSX.Element;
18
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof SidebarMenuItemBase & {
19
+ original: typeof SidebarMenuItemBase;
18
20
  originalName: string;
19
21
  displayName: string;
20
22
  }>) => (props: unknown) => React.JSX.Element;
@@ -38,6 +40,6 @@ declare const SidebarMenuRootItem: (({ children, className, pinnable, action, ..
38
40
  displayName: string;
39
41
  }>) => (props: unknown) => React.JSX.Element;
40
42
  };
41
- Action: ({ element, showOnHover, className, ...props }: import("./SidebarMenuItemAction.js").SidebarMenuItemActionProps) => React.JSX.Element | null;
43
+ Action: typeof SidebarMenuItemAction;
42
44
  };
43
45
  export { SidebarMenuRootItem, type SidebarMenuItemProps };
@@ -2,25 +2,27 @@ import React from "react";
2
2
  import { type VariantProps } from "../utils.js";
3
3
  declare const skeletonVariants: (props?: ({
4
4
  type?: "area" | "text" | "thumbnail" | null | undefined;
5
- size?: "sm" | "md" | "lg" | "xl" | "xs" | "xxl" | "3xl" | null | undefined;
5
+ size?: "3xl" | "lg" | "md" | "sm" | "xl" | "xs" | "xxl" | null | undefined;
6
+ shade?: "dark" | "light" | null | undefined;
6
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
8
  interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof skeletonVariants> {
8
9
  }
9
- declare const Skeleton: (({ size, type, className, ...props }: SkeletonProps) => React.JSX.Element) & {
10
- original: ({ size, type, className, ...props }: SkeletonProps) => React.JSX.Element;
10
+ declare const DecoratableSkeleton: ({ size, type, shade, className, ...props }: SkeletonProps) => React.JSX.Element;
11
+ declare const Skeleton: typeof DecoratableSkeleton & {
12
+ original: typeof DecoratableSkeleton;
11
13
  originalName: string;
12
14
  displayName: string;
13
15
  } & {
14
- original: (({ size, type, className, ...props }: SkeletonProps) => React.JSX.Element) & {
15
- original: ({ size, type, className, ...props }: SkeletonProps) => React.JSX.Element;
16
+ original: typeof DecoratableSkeleton & {
17
+ original: typeof DecoratableSkeleton;
16
18
  originalName: string;
17
19
  displayName: string;
18
20
  };
19
21
  originalName: string;
20
22
  displayName: string;
21
23
  } & {
22
- createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<(({ size, type, className, ...props }: SkeletonProps) => React.JSX.Element) & {
23
- original: ({ size, type, className, ...props }: SkeletonProps) => React.JSX.Element;
24
+ createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof DecoratableSkeleton & {
25
+ original: typeof DecoratableSkeleton;
24
26
  originalName: string;
25
27
  displayName: string;
26
28
  }>) => (props: unknown) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import react from "react";
2
2
  import { cn, cva, makeDecoratable } from "../utils.js";
3
- const skeletonVariants = cva("animate-skeleton-pulse rounded-sm", {
3
+ const skeletonVariants = cva("rounded-sm", {
4
4
  variants: {
5
5
  type: {
6
6
  text: "w-full",
@@ -15,6 +15,10 @@ const skeletonVariants = cva("animate-skeleton-pulse rounded-sm", {
15
15
  xl: "h-xl",
16
16
  xxl: "h-[40px]",
17
17
  "3xl": "h-xxl"
18
+ },
19
+ shade: {
20
+ dark: "animate-skeleton-pulse",
21
+ light: "animate-skeleton-pulse-light"
18
22
  }
19
23
  },
20
24
  compoundVariants: [
@@ -31,13 +35,15 @@ const skeletonVariants = cva("animate-skeleton-pulse rounded-sm", {
31
35
  ],
32
36
  defaultVariants: {
33
37
  type: "area",
34
- size: "lg"
38
+ size: "lg",
39
+ shade: "dark"
35
40
  }
36
41
  });
37
- const DecoratableSkeleton = ({ size, type, className, ...props })=>/*#__PURE__*/ react.createElement("div", {
42
+ const DecoratableSkeleton = ({ size, type, shade, className, ...props })=>/*#__PURE__*/ react.createElement("div", {
38
43
  className: cn(skeletonVariants({
39
44
  size,
40
- type
45
+ type,
46
+ shade
41
47
  }), className),
42
48
  ...props
43
49
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton/Skeleton.js","sources":["../../src/Skeleton/Skeleton.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, cva, type VariantProps, makeDecoratable } from \"~/utils.js\";\n\nconst skeletonVariants = cva(\"animate-skeleton-pulse rounded-sm\", {\n variants: {\n type: {\n text: \"w-full\",\n thumbnail: \"aspect-square\",\n area: \"size-full\"\n },\n size: {\n xs: \"h-sm\",\n sm: \"h-sm-extra\",\n md: \"h-md\",\n lg: \"h-lg\",\n xl: \"h-xl\",\n xxl: \"h-[40px]\",\n \"3xl\": \"h-xxl\"\n }\n },\n compoundVariants: [\n // The following compound variants are not supported by the current version of the design system.\n {\n type: \"thumbnail\",\n size: \"xs\",\n class: \"hidden!\"\n },\n {\n type: \"text\",\n size: \"3xl\",\n class: \"hidden!\"\n }\n ],\n defaultVariants: {\n type: \"area\",\n size: \"lg\"\n }\n});\n\ninterface SkeletonProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof skeletonVariants> {}\n\nconst DecoratableSkeleton = ({ size, type, className, ...props }: SkeletonProps) => {\n return <div className={cn(skeletonVariants({ size, type }), className)} {...props} />;\n};\n\nconst Skeleton = makeDecoratable(\"Skeleton\", DecoratableSkeleton);\n\nexport { Skeleton, type SkeletonProps };\n"],"names":["skeletonVariants","cva","DecoratableSkeleton","size","type","className","props","cn","Skeleton","makeDecoratable"],"mappings":";;AAGA,MAAMA,mBAAmBC,IAAI,qCAAqC;IAC9D,UAAU;QACN,MAAM;YACF,MAAM;YACN,WAAW;YACX,MAAM;QACV;QACA,MAAM;YACF,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,KAAK;YACL,OAAO;QACX;IACJ;IACA,kBAAkB;QAEd;YACI,MAAM;YACN,MAAM;YACN,OAAO;QACX;QACA;YACI,MAAM;YACN,MAAM;YACN,OAAO;QACX;KACH;IACD,iBAAiB;QACb,MAAM;QACN,MAAM;IACV;AACJ;AAKA,MAAMC,sBAAsB,CAAC,EAAEC,IAAI,EAAEC,IAAI,EAAEC,SAAS,EAAE,GAAGC,OAAsB,GACpE,WAAP,GAAO,oBAAC;QAAI,WAAWC,GAAGP,iBAAiB;YAAEG;YAAMC;QAAK,IAAIC;QAAa,GAAGC,KAAK;;AAGrF,MAAME,WAAWC,gBAAgB,YAAYP"}
1
+ {"version":3,"file":"Skeleton/Skeleton.js","sources":["../../src/Skeleton/Skeleton.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, cva, type VariantProps, makeDecoratable } from \"~/utils.js\";\n\nconst skeletonVariants = cva(\"rounded-sm\", {\n variants: {\n type: {\n text: \"w-full\",\n thumbnail: \"aspect-square\",\n area: \"size-full\"\n },\n size: {\n xs: \"h-sm\",\n sm: \"h-sm-extra\",\n md: \"h-md\",\n lg: \"h-lg\",\n xl: \"h-xl\",\n xxl: \"h-[40px]\",\n \"3xl\": \"h-xxl\"\n },\n shade: {\n dark: \"animate-skeleton-pulse\",\n light: \"animate-skeleton-pulse-light\"\n }\n },\n compoundVariants: [\n // The following compound variants are not supported by the current version of the design system.\n {\n type: \"thumbnail\",\n size: \"xs\",\n class: \"hidden!\"\n },\n {\n type: \"text\",\n size: \"3xl\",\n class: \"hidden!\"\n }\n ],\n defaultVariants: {\n type: \"area\",\n size: \"lg\",\n shade: \"dark\"\n }\n});\n\ninterface SkeletonProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof skeletonVariants> {}\n\nconst DecoratableSkeleton = ({ size, type, shade, className, ...props }: SkeletonProps) => {\n return <div className={cn(skeletonVariants({ size, type, shade }), className)} {...props} />;\n};\n\nconst Skeleton = makeDecoratable(\"Skeleton\", DecoratableSkeleton);\n\nexport { Skeleton, type SkeletonProps };\n"],"names":["skeletonVariants","cva","DecoratableSkeleton","size","type","shade","className","props","cn","Skeleton","makeDecoratable"],"mappings":";;AAGA,MAAMA,mBAAmBC,IAAI,cAAc;IACvC,UAAU;QACN,MAAM;YACF,MAAM;YACN,WAAW;YACX,MAAM;QACV;QACA,MAAM;YACF,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,KAAK;YACL,OAAO;QACX;QACA,OAAO;YACH,MAAM;YACN,OAAO;QACX;IACJ;IACA,kBAAkB;QAEd;YACI,MAAM;YACN,MAAM;YACN,OAAO;QACX;QACA;YACI,MAAM;YACN,MAAM;YACN,OAAO;QACX;KACH;IACD,iBAAiB;QACb,MAAM;QACN,MAAM;QACN,OAAO;IACX;AACJ;AAKA,MAAMC,sBAAsB,CAAC,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,SAAS,EAAE,GAAGC,OAAsB,GAC3E,WAAP,GAAO,oBAAC;QAAI,WAAWC,GAAGR,iBAAiB;YAAEG;YAAMC;YAAMC;QAAM,IAAIC;QAAa,GAAGC,KAAK;;AAG5F,MAAME,WAAWC,gBAAgB,YAAYR"}
@@ -15,4 +15,6 @@ export declare const Large: Story;
15
15
  export declare const ExtraLarge: Story;
16
16
  export declare const DoubleExtraLarge: Story;
17
17
  export declare const TripleExtraLarge: Story;
18
+ export declare const Dark: Story;
19
+ export declare const Light: Story;
18
20
  export declare const Documentation: Story;
@@ -26,6 +26,13 @@ const meta = {
26
26
  "xxl",
27
27
  "3xl"
28
28
  ]
29
+ },
30
+ shade: {
31
+ control: "select",
32
+ options: [
33
+ "dark",
34
+ "light"
35
+ ]
29
36
  }
30
37
  }
31
38
  };
@@ -98,10 +105,21 @@ const TripleExtraLarge = {
98
105
  size: "3xl"
99
106
  }
100
107
  };
108
+ const Dark = {
109
+ args: {
110
+ shade: "dark"
111
+ }
112
+ };
113
+ const Light = {
114
+ args: {
115
+ shade: "light"
116
+ }
117
+ };
101
118
  const Documentation = {
102
119
  args: {
103
120
  type: "area",
104
- size: "lg"
121
+ size: "lg",
122
+ shade: "dark"
105
123
  },
106
124
  argTypes: {
107
125
  type: {
@@ -125,10 +143,18 @@ const Documentation = {
125
143
  "xxl",
126
144
  "3xl"
127
145
  ]
146
+ },
147
+ shade: {
148
+ control: "select",
149
+ description: "The shade of the skeleton",
150
+ options: [
151
+ "dark",
152
+ "light"
153
+ ]
128
154
  }
129
155
  }
130
156
  };
131
157
  export default Skeleton_stories;
132
- export { Area, Default, Documentation, DoubleExtraLarge, ExtraLarge, ExtraSmall, Large, Medium, MultipleAreas, Small, Text, Thumbnail, TripleExtraLarge };
158
+ export { Area, Dark, Default, Documentation, DoubleExtraLarge, ExtraLarge, ExtraSmall, Large, Light, Medium, MultipleAreas, Small, Text, Thumbnail, TripleExtraLarge };
133
159
 
134
160
  //# sourceMappingURL=Skeleton.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton/Skeleton.stories.js","sources":["../../src/Skeleton/Skeleton.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Skeleton } from \"./Skeleton.js\";\n\nconst meta: Meta<typeof Skeleton> = {\n title: \"Components/Skeleton\",\n component: Skeleton,\n parameters: {\n layout: \"padded\"\n },\n argTypes: {\n type: {\n control: \"select\",\n options: [\"text\", \"thumbnail\", \"area\"]\n },\n size: {\n control: \"select\",\n options: [\"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"xxl\", \"3xl\"]\n }\n }\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Skeleton>;\n\nexport const Default: Story = {};\n\nexport const Text: Story = {\n args: {\n type: \"text\"\n }\n};\n\nexport const Thumbnail: Story = {\n args: {\n type: \"thumbnail\"\n }\n};\n\nexport const Area: Story = {\n args: {\n type: \"area\",\n className: \"w-1/2 h-32\"\n }\n};\n\nexport const MultipleAreas: Story = {\n render: () => (\n <div className=\"flex gap-md\">\n <div className=\"flex flex-col gap-md\">\n <Skeleton type=\"area\" className={\"w-32 h-32\"} />\n <Skeleton type=\"area\" className={\"w-32 h-32\"} />\n </div>\n <div>\n <Skeleton type=\"area\" className=\"w-32 h-full\" />\n </div>\n </div>\n )\n};\n\nexport const ExtraSmall: Story = {\n args: {\n size: \"xs\"\n }\n};\n\nexport const Small: Story = {\n args: {\n size: \"sm\"\n }\n};\n\nexport const Medium: Story = {\n args: {\n size: \"md\"\n }\n};\n\nexport const Large: Story = {\n args: {\n size: \"lg\"\n }\n};\n\nexport const ExtraLarge: Story = {\n args: {\n size: \"xl\"\n }\n};\n\nexport const DoubleExtraLarge: Story = {\n args: {\n size: \"xxl\"\n }\n};\n\nexport const TripleExtraLarge: Story = {\n args: {\n size: \"3xl\"\n }\n};\n\nexport const Documentation: Story = {\n args: {\n type: \"area\",\n size: \"lg\"\n },\n argTypes: {\n type: {\n control: \"select\",\n description: \"The type of skeleton to display\",\n options: [\"text\", \"thumbnail\", \"area\"]\n },\n size: {\n control: \"select\",\n description: \"The size of the skeleton\",\n options: [\"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"xxl\", \"3xl\"]\n }\n }\n};\n"],"names":["meta","Skeleton","Default","Text","Thumbnail","Area","MultipleAreas","ExtraSmall","Small","Medium","Large","ExtraLarge","DoubleExtraLarge","TripleExtraLarge","Documentation"],"mappings":";;AAIA,MAAMA,OAA8B;IAChC,OAAO;IACP,WAAWC;IACX,YAAY;QACR,QAAQ;IACZ;IACA,UAAU;QACN,MAAM;YACF,SAAS;YACT,SAAS;gBAAC;gBAAQ;gBAAa;aAAO;QAC1C;QACA,MAAM;YACF,SAAS;YACT,SAAS;gBAAC;gBAAM;gBAAM;gBAAM;gBAAM;gBAAM;gBAAO;aAAM;QACzD;IACJ;AACJ;AAEA,yBAAeD;AAIR,MAAME,UAAiB,CAAC;AAExB,MAAMC,OAAc;IACvB,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,YAAmB;IAC5B,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,OAAc;IACvB,MAAM;QACF,MAAM;QACN,WAAW;IACf;AACJ;AAEO,MAAMC,gBAAuB;IAChC,QAAQ,kBACJ,oBAAC;YAAI,WAAU;yBACX,oBAAC;YAAI,WAAU;yBACX,oBAACL,UAAQA;YAAC,MAAK;YAAO,WAAW;0BACjC,oBAACA,UAAQA;YAAC,MAAK;YAAO,WAAW;2BAErC,oBAAC,2BACG,oBAACA,UAAQA;YAAC,MAAK;YAAO,WAAU;;AAIhD;AAEO,MAAMM,aAAoB;IAC7B,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,QAAe;IACxB,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,SAAgB;IACzB,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,QAAe;IACxB,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,aAAoB;IAC7B,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,mBAA0B;IACnC,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,mBAA0B;IACnC,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,gBAAuB;IAChC,MAAM;QACF,MAAM;QACN,MAAM;IACV;IACA,UAAU;QACN,MAAM;YACF,SAAS;YACT,aAAa;YACb,SAAS;gBAAC;gBAAQ;gBAAa;aAAO;QAC1C;QACA,MAAM;YACF,SAAS;YACT,aAAa;YACb,SAAS;gBAAC;gBAAM;gBAAM;gBAAM;gBAAM;gBAAM;gBAAO;aAAM;QACzD;IACJ;AACJ"}
1
+ {"version":3,"file":"Skeleton/Skeleton.stories.js","sources":["../../src/Skeleton/Skeleton.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Skeleton } from \"./Skeleton.js\";\n\nconst meta: Meta<typeof Skeleton> = {\n title: \"Components/Skeleton\",\n component: Skeleton,\n parameters: {\n layout: \"padded\"\n },\n argTypes: {\n type: {\n control: \"select\",\n options: [\"text\", \"thumbnail\", \"area\"]\n },\n size: {\n control: \"select\",\n options: [\"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"xxl\", \"3xl\"]\n },\n shade: {\n control: \"select\",\n options: [\"dark\", \"light\"]\n }\n }\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Skeleton>;\n\nexport const Default: Story = {};\n\nexport const Text: Story = {\n args: {\n type: \"text\"\n }\n};\n\nexport const Thumbnail: Story = {\n args: {\n type: \"thumbnail\"\n }\n};\n\nexport const Area: Story = {\n args: {\n type: \"area\",\n className: \"w-1/2 h-32\"\n }\n};\n\nexport const MultipleAreas: Story = {\n render: () => (\n <div className=\"flex gap-md\">\n <div className=\"flex flex-col gap-md\">\n <Skeleton type=\"area\" className={\"w-32 h-32\"} />\n <Skeleton type=\"area\" className={\"w-32 h-32\"} />\n </div>\n <div>\n <Skeleton type=\"area\" className=\"w-32 h-full\" />\n </div>\n </div>\n )\n};\n\nexport const ExtraSmall: Story = {\n args: {\n size: \"xs\"\n }\n};\n\nexport const Small: Story = {\n args: {\n size: \"sm\"\n }\n};\n\nexport const Medium: Story = {\n args: {\n size: \"md\"\n }\n};\n\nexport const Large: Story = {\n args: {\n size: \"lg\"\n }\n};\n\nexport const ExtraLarge: Story = {\n args: {\n size: \"xl\"\n }\n};\n\nexport const DoubleExtraLarge: Story = {\n args: {\n size: \"xxl\"\n }\n};\n\nexport const TripleExtraLarge: Story = {\n args: {\n size: \"3xl\"\n }\n};\n\nexport const Dark: Story = {\n args: {\n shade: \"dark\"\n }\n};\n\nexport const Light: Story = {\n args: {\n shade: \"light\"\n }\n};\n\nexport const Documentation: Story = {\n args: {\n type: \"area\",\n size: \"lg\",\n shade: \"dark\"\n },\n argTypes: {\n type: {\n control: \"select\",\n description: \"The type of skeleton to display\",\n options: [\"text\", \"thumbnail\", \"area\"]\n },\n size: {\n control: \"select\",\n description: \"The size of the skeleton\",\n options: [\"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"xxl\", \"3xl\"]\n },\n shade: {\n control: \"select\",\n description: \"The shade of the skeleton\",\n options: [\"dark\", \"light\"]\n }\n }\n};\n"],"names":["meta","Skeleton","Default","Text","Thumbnail","Area","MultipleAreas","ExtraSmall","Small","Medium","Large","ExtraLarge","DoubleExtraLarge","TripleExtraLarge","Dark","Light","Documentation"],"mappings":";;AAIA,MAAMA,OAA8B;IAChC,OAAO;IACP,WAAWC;IACX,YAAY;QACR,QAAQ;IACZ;IACA,UAAU;QACN,MAAM;YACF,SAAS;YACT,SAAS;gBAAC;gBAAQ;gBAAa;aAAO;QAC1C;QACA,MAAM;YACF,SAAS;YACT,SAAS;gBAAC;gBAAM;gBAAM;gBAAM;gBAAM;gBAAM;gBAAO;aAAM;QACzD;QACA,OAAO;YACH,SAAS;YACT,SAAS;gBAAC;gBAAQ;aAAQ;QAC9B;IACJ;AACJ;AAEA,yBAAeD;AAIR,MAAME,UAAiB,CAAC;AAExB,MAAMC,OAAc;IACvB,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,YAAmB;IAC5B,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,OAAc;IACvB,MAAM;QACF,MAAM;QACN,WAAW;IACf;AACJ;AAEO,MAAMC,gBAAuB;IAChC,QAAQ,kBACJ,oBAAC;YAAI,WAAU;yBACX,oBAAC;YAAI,WAAU;yBACX,oBAACL,UAAQA;YAAC,MAAK;YAAO,WAAW;0BACjC,oBAACA,UAAQA;YAAC,MAAK;YAAO,WAAW;2BAErC,oBAAC,2BACG,oBAACA,UAAQA;YAAC,MAAK;YAAO,WAAU;;AAIhD;AAEO,MAAMM,aAAoB;IAC7B,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,QAAe;IACxB,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,SAAgB;IACzB,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,QAAe;IACxB,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,aAAoB;IAC7B,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,mBAA0B;IACnC,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,mBAA0B;IACnC,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,OAAc;IACvB,MAAM;QACF,OAAO;IACX;AACJ;AAEO,MAAMC,QAAe;IACxB,MAAM;QACF,OAAO;IACX;AACJ;AAEO,MAAMC,gBAAuB;IAChC,MAAM;QACF,MAAM;QACN,MAAM;QACN,OAAO;IACX;IACA,UAAU;QACN,MAAM;YACF,SAAS;YACT,aAAa;YACb,SAAS;gBAAC;gBAAQ;gBAAa;aAAO;QAC1C;QACA,MAAM;YACF,SAAS;YACT,aAAa;YACb,SAAS;gBAAC;gBAAM;gBAAM;gBAAM;gBAAM;gBAAM;gBAAO;aAAM;QACzD;QACA,OAAO;YACH,SAAS;YACT,aAAa;YACb,SAAS;gBAAC;gBAAQ;aAAQ;QAC9B;IACJ;AACJ"}
@@ -7,21 +7,22 @@ import type { FormComponentProps } from "../FormComponent/index.js";
7
7
  type SliderProps = FormComponentProps & SliderPrimitiveProps & {
8
8
  labelPosition?: "top" | "side";
9
9
  };
10
- declare const Slider: (({ description, note, hint, validation, labelPosition, ...props }: SliderProps) => React.JSX.Element) & {
11
- original: ({ description, note, hint, validation, labelPosition, ...props }: SliderProps) => React.JSX.Element;
10
+ declare const DecoratableSlider: ({ description, note, hint, validation, labelPosition, ...props }: SliderProps) => React.JSX.Element;
11
+ declare const Slider: typeof DecoratableSlider & {
12
+ original: typeof DecoratableSlider;
12
13
  originalName: string;
13
14
  displayName: string;
14
15
  } & {
15
- original: (({ description, note, hint, validation, labelPosition, ...props }: SliderProps) => React.JSX.Element) & {
16
- original: ({ description, note, hint, validation, labelPosition, ...props }: SliderProps) => React.JSX.Element;
16
+ original: typeof DecoratableSlider & {
17
+ original: typeof DecoratableSlider;
17
18
  originalName: string;
18
19
  displayName: string;
19
20
  };
20
21
  originalName: string;
21
22
  displayName: string;
22
23
  } & {
23
- createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ description, note, hint, validation, labelPosition, ...props }: SliderProps) => React.JSX.Element) & {
24
- original: ({ description, note, hint, validation, labelPosition, ...props }: SliderProps) => React.JSX.Element;
24
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableSlider & {
25
+ original: typeof DecoratableSlider;
25
26
  originalName: string;
26
27
  displayName: string;
27
28
  }>) => (props: unknown) => React.JSX.Element;
@@ -3,21 +3,22 @@ import type { ProgressItemParams } from "./domains/index.js";
3
3
  interface SteppedProgressProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  items: ProgressItemParams[];
5
5
  }
6
- declare const SteppedProgress: (({ items, ...props }: SteppedProgressProps) => React.JSX.Element) & {
7
- original: ({ items, ...props }: SteppedProgressProps) => React.JSX.Element;
6
+ declare const DecoratableSteppedProgress: ({ items, ...props }: SteppedProgressProps) => React.JSX.Element;
7
+ declare const SteppedProgress: typeof DecoratableSteppedProgress & {
8
+ original: typeof DecoratableSteppedProgress;
8
9
  originalName: string;
9
10
  displayName: string;
10
11
  } & {
11
- original: (({ items, ...props }: SteppedProgressProps) => React.JSX.Element) & {
12
- original: ({ items, ...props }: SteppedProgressProps) => React.JSX.Element;
12
+ original: typeof DecoratableSteppedProgress & {
13
+ original: typeof DecoratableSteppedProgress;
13
14
  originalName: string;
14
15
  displayName: string;
15
16
  };
16
17
  originalName: string;
17
18
  displayName: string;
18
19
  } & {
19
- createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ items, ...props }: SteppedProgressProps) => React.JSX.Element) & {
20
- original: ({ items, ...props }: SteppedProgressProps) => React.JSX.Element;
20
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableSteppedProgress & {
21
+ original: typeof DecoratableSteppedProgress;
21
22
  originalName: string;
22
23
  displayName: string;
23
24
  }>) => (props: unknown) => React.JSX.Element;
@@ -1,21 +1,22 @@
1
1
  import React from "react";
2
2
  import { type ProgressItemFormatted } from "./domains/index.js";
3
3
  type SteppedProgressItemProps = React.HTMLAttributes<HTMLDivElement> & ProgressItemFormatted;
4
- declare const SteppedProgressItem: (({ label, state, errored, disabled, className, ...props }: SteppedProgressItemProps) => React.JSX.Element) & {
5
- original: ({ label, state, errored, disabled, className, ...props }: SteppedProgressItemProps) => React.JSX.Element;
4
+ declare const DecoratableSteppedProgressItem: ({ label, state, errored, disabled, className, ...props }: SteppedProgressItemProps) => React.JSX.Element;
5
+ declare const SteppedProgressItem: typeof DecoratableSteppedProgressItem & {
6
+ original: typeof DecoratableSteppedProgressItem;
6
7
  originalName: string;
7
8
  displayName: string;
8
9
  } & {
9
- original: (({ label, state, errored, disabled, className, ...props }: SteppedProgressItemProps) => React.JSX.Element) & {
10
- original: ({ label, state, errored, disabled, className, ...props }: SteppedProgressItemProps) => React.JSX.Element;
10
+ original: typeof DecoratableSteppedProgressItem & {
11
+ original: typeof DecoratableSteppedProgressItem;
11
12
  originalName: string;
12
13
  displayName: string;
13
14
  };
14
15
  originalName: string;
15
16
  displayName: string;
16
17
  } & {
17
- createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ label, state, errored, disabled, className, ...props }: SteppedProgressItemProps) => React.JSX.Element) & {
18
- original: ({ label, state, errored, disabled, className, ...props }: SteppedProgressItemProps) => React.JSX.Element;
18
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableSteppedProgressItem & {
19
+ original: typeof DecoratableSteppedProgressItem;
19
20
  originalName: string;
20
21
  displayName: string;
21
22
  }>) => (props: unknown) => React.JSX.Element;
@@ -2,21 +2,22 @@ import React from "react";
2
2
  import type { SwitchPrimitiveProps } from "./primitives/index.js";
3
3
  import type { FormComponentProps } from "../FormComponent/index.js";
4
4
  type SwitchProps = SwitchPrimitiveProps & FormComponentProps;
5
- declare const Switch: (({ note, validation, ...props }: SwitchProps) => React.JSX.Element) & {
6
- original: ({ note, validation, ...props }: SwitchProps) => React.JSX.Element;
5
+ declare const DecoratableSwitch: ({ note, validation, ...props }: SwitchProps) => React.JSX.Element;
6
+ declare const Switch: typeof DecoratableSwitch & {
7
+ original: typeof DecoratableSwitch;
7
8
  originalName: string;
8
9
  displayName: string;
9
10
  } & {
10
- original: (({ note, validation, ...props }: SwitchProps) => React.JSX.Element) & {
11
- original: ({ note, validation, ...props }: SwitchProps) => React.JSX.Element;
11
+ original: typeof DecoratableSwitch & {
12
+ original: typeof DecoratableSwitch;
12
13
  originalName: string;
13
14
  displayName: string;
14
15
  };
15
16
  originalName: string;
16
17
  displayName: string;
17
18
  } & {
18
- createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ note, validation, ...props }: SwitchProps) => React.JSX.Element) & {
19
- original: ({ note, validation, ...props }: SwitchProps) => React.JSX.Element;
19
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableSwitch & {
20
+ original: typeof DecoratableSwitch;
20
21
  originalName: string;
21
22
  displayName: string;
22
23
  }>) => (props: unknown) => React.JSX.Element;
@@ -14,21 +14,25 @@ type SwitchPrimitiveProps = Omit<SwitchPrimitives.SwitchProps, "defaultChecked"
14
14
  type SwitchPrimitivVm = {
15
15
  item?: SwitchItemFormatted;
16
16
  };
17
- declare const SwitchPrimitive: ((props: SwitchPrimitiveProps) => React.JSX.Element | null) & {
18
- original: (props: SwitchPrimitiveProps) => React.JSX.Element | null;
17
+ /**
18
+ * Switch
19
+ */
20
+ declare const DecoratableSwitchPrimitive: (props: SwitchPrimitiveProps) => React.JSX.Element | null;
21
+ declare const SwitchPrimitive: typeof DecoratableSwitchPrimitive & {
22
+ original: typeof DecoratableSwitchPrimitive;
19
23
  originalName: string;
20
24
  displayName: string;
21
25
  } & {
22
- original: ((props: SwitchPrimitiveProps) => React.JSX.Element | null) & {
23
- original: (props: SwitchPrimitiveProps) => React.JSX.Element | null;
26
+ original: typeof DecoratableSwitchPrimitive & {
27
+ original: typeof DecoratableSwitchPrimitive;
24
28
  originalName: string;
25
29
  displayName: string;
26
30
  };
27
31
  originalName: string;
28
32
  displayName: string;
29
33
  } & {
30
- createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<((props: SwitchPrimitiveProps) => React.JSX.Element | null) & {
31
- original: (props: SwitchPrimitiveProps) => React.JSX.Element | null;
34
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableSwitchPrimitive & {
35
+ original: typeof DecoratableSwitchPrimitive;
32
36
  originalName: string;
33
37
  displayName: string;
34
38
  }>) => (props: unknown) => React.JSX.Element;
package/Table/Table.d.ts CHANGED
@@ -1,20 +1,22 @@
1
1
  import * as React from "react";
2
2
  import { type VariantProps } from "../utils.js";
3
+ import { Body, Caption, Cell, Direction, Footer, Head, Header, Resizer, Row } from "../Table/components/index.js";
3
4
  declare const tableVariants: (props?: ({
4
5
  bordered?: boolean | null | undefined;
5
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
7
  interface TableProps extends React.HTMLAttributes<HTMLTableElement>, VariantProps<typeof tableVariants> {
7
8
  sticky?: boolean;
8
9
  }
9
- declare const Table: (({ className, bordered, sticky, ...props }: TableProps) => React.JSX.Element) & {
10
- Body: ({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>) => React.JSX.Element;
11
- Caption: ({ className, ...props }: React.HTMLAttributes<HTMLTableCaptionElement>) => React.JSX.Element;
12
- Cell: ({ className, truncate, ...props }: import("~/Table/components/index.js").CellProps) => React.JSX.Element;
13
- Direction: ({ className, direction }: import("~/Table/components/index.js").DirectionProps) => React.JSX.Element | null;
14
- Footer: ({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>) => React.JSX.Element;
15
- Head: ({ className, children, truncate, ...props }: import("~/Table/components/index.js").HeadProps) => React.JSX.Element;
16
- Header: ({ className, sticky, ...props }: import("~/Table/components/index.js").HeaderProps) => React.JSX.Element;
17
- Resizer: ({ className, isResizing, ...props }: import("~/Table/components/index.js").ResizerProps) => React.JSX.Element;
18
- Row: ({ className, selected, ...props }: import("~/Table/components/index.js").RowProps) => React.JSX.Element;
10
+ declare const BaseTable: ({ className, bordered, sticky, ...props }: TableProps) => React.JSX.Element;
11
+ declare const Table: typeof BaseTable & {
12
+ Body: typeof Body;
13
+ Caption: typeof Caption;
14
+ Cell: typeof Cell;
15
+ Direction: typeof Direction;
16
+ Footer: typeof Footer;
17
+ Head: typeof Head;
18
+ Header: typeof Header;
19
+ Resizer: typeof Resizer;
20
+ Row: typeof Row;
19
21
  };
20
22
  export { Table, type TableProps };
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { type VariantProps } from "../../utils.js";
3
3
  declare const directionVariants: (props?: ({
4
- direction?: "desc" | "asc" | null | undefined;
4
+ direction?: "asc" | "desc" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  interface DirectionProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof directionVariants> {
7
7
  }
package/Tabs/Tabs.d.ts CHANGED
@@ -7,22 +7,24 @@ interface TabsProps extends Omit<TabsPrimitive.TabsProps, "children"> {
7
7
  size?: VariantProps<typeof tabListVariants>["size"];
8
8
  spacing?: VariantProps<typeof tabListVariants>["spacing"];
9
9
  separator?: VariantProps<typeof tabListVariants>["separator"];
10
+ loading?: boolean;
10
11
  }
11
- declare const Tabs: (({ defaultValue: initialValue, size, spacing, separator, tabs: tabComponents, ...props }: TabsProps) => React.JSX.Element) & {
12
- original: ({ defaultValue: initialValue, size, spacing, separator, tabs: tabComponents, ...props }: TabsProps) => React.JSX.Element;
12
+ declare const DecoratableTabs: ({ defaultValue: initialValue, size, spacing, separator, loading, tabs: tabComponents, ...props }: TabsProps) => React.JSX.Element;
13
+ declare const Tabs: typeof DecoratableTabs & {
14
+ original: typeof DecoratableTabs;
13
15
  originalName: string;
14
16
  displayName: string;
15
17
  } & {
16
- original: (({ defaultValue: initialValue, size, spacing, separator, tabs: tabComponents, ...props }: TabsProps) => React.JSX.Element) & {
17
- original: ({ defaultValue: initialValue, size, spacing, separator, tabs: tabComponents, ...props }: TabsProps) => React.JSX.Element;
18
+ original: typeof DecoratableTabs & {
19
+ original: typeof DecoratableTabs;
18
20
  originalName: string;
19
21
  displayName: string;
20
22
  };
21
23
  originalName: string;
22
24
  displayName: string;
23
25
  } & {
24
- createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ defaultValue: initialValue, size, spacing, separator, tabs: tabComponents, ...props }: TabsProps) => React.JSX.Element) & {
25
- original: ({ defaultValue: initialValue, size, spacing, separator, tabs: tabComponents, ...props }: TabsProps) => React.JSX.Element;
26
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableTabs & {
27
+ original: typeof DecoratableTabs;
26
28
  originalName: string;
27
29
  displayName: string;
28
30
  }>) => (props: unknown) => React.JSX.Element;
package/Tabs/Tabs.js CHANGED
@@ -3,7 +3,7 @@ import { Tabs } from "radix-ui";
3
3
  import { makeDecoratable, withStaticProps } from "../utils.js";
4
4
  import { Content, List, Tab, TabsContext, Trigger } from "./components/index.js";
5
5
  const Root = Tabs.Root;
6
- const DecoratableTabs = ({ defaultValue: initialValue, size, spacing, separator, tabs: tabComponents, ...props })=>{
6
+ const DecoratableTabs = ({ defaultValue: initialValue, size, spacing, separator, loading, tabs: tabComponents, ...props })=>{
7
7
  const [tabs, setTabs] = useState([]);
8
8
  const defaultValue = useMemo(()=>initialValue || tabComponents.find((tab)=>!tab.props.disabled && false !== tab.props.visible)?.props.value, [
9
9
  initialValue,
@@ -19,6 +19,7 @@ const DecoratableTabs = ({ defaultValue: initialValue, size, spacing, separator,
19
19
  disabled: tab.disabled,
20
20
  icon: tab.icon,
21
21
  key: tab.id,
22
+ loading: loading,
22
23
  size: size,
23
24
  text: tab.trigger,
24
25
  value: tab.value,
@@ -26,7 +27,9 @@ const DecoratableTabs = ({ defaultValue: initialValue, size, spacing, separator,
26
27
  }))), [
27
28
  tabs,
28
29
  size,
29
- spacing
30
+ spacing,
31
+ separator,
32
+ loading
30
33
  ]);
31
34
  const contents = useMemo(()=>tabs.map((tab)=>/*#__PURE__*/ react.createElement(Content, {
32
35
  key: tab.id,
package/Tabs/Tabs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs/Tabs.js","sources":["../../src/Tabs/Tabs.tsx"],"sourcesContent":["import React, { useMemo, useState } from \"react\";\nimport { Tabs as TabsPrimitive } from \"radix-ui\";\nimport { makeDecoratable, type VariantProps, withStaticProps } from \"~/utils.js\";\nimport type { ITabsContext, TabItem, TabProps, tabListVariants } from \"./components/index.js\";\nimport { Content, List, Tab, TabsContext, Trigger } from \"./components/index.js\";\n\nconst Root = TabsPrimitive.Root;\n\ninterface TabsProps extends Omit<TabsPrimitive.TabsProps, \"children\"> {\n tabs: React.ReactElement<TabProps>[];\n size?: VariantProps<typeof tabListVariants>[\"size\"];\n spacing?: VariantProps<typeof tabListVariants>[\"spacing\"];\n separator?: VariantProps<typeof tabListVariants>[\"separator\"];\n}\n\nconst DecoratableTabs = ({\n defaultValue: initialValue,\n size,\n spacing,\n separator,\n tabs: tabComponents,\n ...props\n}: TabsProps) => {\n const [tabs, setTabs] = useState<TabItem[]>([]);\n\n const defaultValue = useMemo(() => {\n return (\n initialValue ||\n tabComponents.find(tab => !tab.props.disabled && tab.props.visible !== false)?.props\n .value\n );\n }, [initialValue, tabComponents]);\n\n const triggers = useMemo(\n () => (\n <List\n key={tabs.map(tab => tab.id).join(\";\")}\n size={size}\n spacing={spacing}\n separator={separator}\n >\n {tabs.map(tab => (\n <Trigger\n data-testid={tab[\"data-testid\"]}\n disabled={tab.disabled}\n icon={tab.icon}\n key={tab.id}\n size={size}\n text={tab.trigger}\n value={tab.value}\n visible={tab.visible}\n />\n ))}\n </List>\n ),\n [tabs, size, spacing]\n );\n\n const contents = useMemo(\n () =>\n tabs.map(tab => (\n <Content\n key={tab.id}\n value={tab.value}\n content={tab.content}\n spacing={tab.spacing ?? spacing}\n className={tab.className}\n />\n )),\n [tabs, spacing]\n );\n\n const context: ITabsContext = useMemo(\n () => ({\n addTab(props) {\n setTabs(tabs => {\n const existingIndex = tabs.findIndex(tab => tab.value === props.value);\n if (existingIndex > -1) {\n return [\n ...tabs.slice(0, existingIndex),\n props,\n ...tabs.slice(existingIndex + 1)\n ];\n }\n return [...tabs, props];\n });\n },\n removeTab(id) {\n setTabs(tabs => tabs.filter(tab => tab.id !== id));\n }\n }),\n [setTabs]\n );\n\n return (\n <Root {...props} defaultValue={defaultValue}>\n {triggers}\n {contents}\n <TabsContext.Provider value={context}>{tabComponents}</TabsContext.Provider>\n </Root>\n );\n};\n\nconst BaseTabs = makeDecoratable(\"Tabs\", DecoratableTabs);\n\nconst Tabs = withStaticProps(BaseTabs, {\n Tab\n});\n\nexport { Tabs, type TabsProps };\n"],"names":["Root","TabsPrimitive","DecoratableTabs","initialValue","size","spacing","separator","tabComponents","props","tabs","setTabs","useState","defaultValue","useMemo","tab","triggers","List","Trigger","contents","Content","context","existingIndex","id","TabsContext","BaseTabs","makeDecoratable","Tabs","withStaticProps","Tab"],"mappings":";;;;AAMA,MAAMA,OAAOC,KAAAA,IAAkB;AAS/B,MAAMC,kBAAkB,CAAC,EACrB,cAAcC,YAAY,EAC1BC,IAAI,EACJC,OAAO,EACPC,SAAS,EACT,MAAMC,aAAa,EACnB,GAAGC,OACK;IACR,MAAM,CAACC,MAAMC,QAAQ,GAAGC,SAAoB,EAAE;IAE9C,MAAMC,eAAeC,QAAQ,IAErBV,gBACAI,cAAc,IAAI,CAACO,CAAAA,MAAO,CAACA,IAAI,KAAK,CAAC,QAAQ,IAAIA,AAAsB,UAAtBA,IAAI,KAAK,CAAC,OAAO,GAAa,MAC1E,OAEV;QAACX;QAAcI;KAAc;IAEhC,MAAMQ,WAAWF,QACb,kBACI,oBAACG,MAAIA;YACD,KAAKP,KAAK,GAAG,CAACK,CAAAA,MAAOA,IAAI,EAAE,EAAE,IAAI,CAAC;YAClC,MAAMV;YACN,SAASC;YACT,WAAWC;WAEVG,KAAK,GAAG,CAACK,CAAAA,MAAAA,WAAAA,GACN,oBAACG,SAAOA;gBACJ,eAAaH,GAAG,CAAC,cAAc;gBAC/B,UAAUA,IAAI,QAAQ;gBACtB,MAAMA,IAAI,IAAI;gBACd,KAAKA,IAAI,EAAE;gBACX,MAAMV;gBACN,MAAMU,IAAI,OAAO;gBACjB,OAAOA,IAAI,KAAK;gBAChB,SAASA,IAAI,OAAO;kBAKpC;QAACL;QAAML;QAAMC;KAAQ;IAGzB,MAAMa,WAAWL,QACb,IACIJ,KAAK,GAAG,CAACK,CAAAA,MAAAA,WAAAA,GACL,oBAACK,SAAOA;gBACJ,KAAKL,IAAI,EAAE;gBACX,OAAOA,IAAI,KAAK;gBAChB,SAASA,IAAI,OAAO;gBACpB,SAASA,IAAI,OAAO,IAAIT;gBACxB,WAAWS,IAAI,SAAS;iBAGpC;QAACL;QAAMJ;KAAQ;IAGnB,MAAMe,UAAwBP,QAC1B,IAAO;YACH,QAAOL,KAAK;gBACRE,QAAQD,CAAAA;oBACJ,MAAMY,gBAAgBZ,KAAK,SAAS,CAACK,CAAAA,MAAOA,IAAI,KAAK,KAAKN,MAAM,KAAK;oBACrE,IAAIa,gBAAgB,IAChB,OAAO;2BACAZ,KAAK,KAAK,CAAC,GAAGY;wBACjBb;2BACGC,KAAK,KAAK,CAACY,gBAAgB;qBACjC;oBAEL,OAAO;2BAAIZ;wBAAMD;qBAAM;gBAC3B;YACJ;YACA,WAAUc,EAAE;gBACRZ,QAAQD,CAAAA,OAAQA,KAAK,MAAM,CAACK,CAAAA,MAAOA,IAAI,EAAE,KAAKQ;YAClD;QACJ,IACA;QAACZ;KAAQ;IAGb,OAAO,WAAP,GACI,oBAACV,MAAIA;QAAE,GAAGQ,KAAK;QAAE,cAAcI;OAC1BG,UACAG,UAAAA,WAAAA,GACD,oBAACK,YAAY,QAAQ;QAAC,OAAOH;OAAUb;AAGnD;AAEA,MAAMiB,WAAWC,gBAAgB,QAAQvB;AAEzC,MAAMwB,YAAOC,gBAAgBH,UAAU;IACnCI,KAAGA;AACP"}
1
+ {"version":3,"file":"Tabs/Tabs.js","sources":["../../src/Tabs/Tabs.tsx"],"sourcesContent":["import React, { useMemo, useState } from \"react\";\nimport { Tabs as TabsPrimitive } from \"radix-ui\";\nimport { makeDecoratable, type VariantProps, withStaticProps } from \"~/utils.js\";\nimport type { ITabsContext, TabItem, TabProps, tabListVariants } from \"./components/index.js\";\nimport { Content, List, Tab, TabsContext, Trigger } from \"./components/index.js\";\n\nconst Root = TabsPrimitive.Root;\n\ninterface TabsProps extends Omit<TabsPrimitive.TabsProps, \"children\"> {\n tabs: React.ReactElement<TabProps>[];\n size?: VariantProps<typeof tabListVariants>[\"size\"];\n spacing?: VariantProps<typeof tabListVariants>[\"spacing\"];\n separator?: VariantProps<typeof tabListVariants>[\"separator\"];\n loading?: boolean;\n}\n\nconst DecoratableTabs = ({\n defaultValue: initialValue,\n size,\n spacing,\n separator,\n loading,\n tabs: tabComponents,\n ...props\n}: TabsProps) => {\n const [tabs, setTabs] = useState<TabItem[]>([]);\n\n const defaultValue = useMemo(() => {\n return (\n initialValue ||\n tabComponents.find(tab => !tab.props.disabled && tab.props.visible !== false)?.props\n .value\n );\n }, [initialValue, tabComponents]);\n\n const triggers = useMemo(\n () => (\n <List\n key={tabs.map(tab => tab.id).join(\";\")}\n size={size}\n spacing={spacing}\n separator={separator}\n >\n {tabs.map(tab => (\n <Trigger\n data-testid={tab[\"data-testid\"]}\n disabled={tab.disabled}\n icon={tab.icon}\n key={tab.id}\n loading={loading}\n size={size}\n text={tab.trigger}\n value={tab.value}\n visible={tab.visible}\n />\n ))}\n </List>\n ),\n [tabs, size, spacing, separator, loading]\n );\n\n const contents = useMemo(\n () =>\n tabs.map(tab => (\n <Content\n key={tab.id}\n value={tab.value}\n content={tab.content}\n spacing={tab.spacing ?? spacing}\n className={tab.className}\n />\n )),\n [tabs, spacing]\n );\n\n const context: ITabsContext = useMemo(\n () => ({\n addTab(props) {\n setTabs(tabs => {\n const existingIndex = tabs.findIndex(tab => tab.value === props.value);\n if (existingIndex > -1) {\n return [\n ...tabs.slice(0, existingIndex),\n props,\n ...tabs.slice(existingIndex + 1)\n ];\n }\n return [...tabs, props];\n });\n },\n removeTab(id) {\n setTabs(tabs => tabs.filter(tab => tab.id !== id));\n }\n }),\n [setTabs]\n );\n\n return (\n <Root {...props} defaultValue={defaultValue}>\n {triggers}\n {contents}\n <TabsContext.Provider value={context}>{tabComponents}</TabsContext.Provider>\n </Root>\n );\n};\n\nconst BaseTabs = makeDecoratable(\"Tabs\", DecoratableTabs);\n\nconst Tabs = withStaticProps(BaseTabs, {\n Tab\n});\n\nexport { Tabs, type TabsProps };\n"],"names":["Root","TabsPrimitive","DecoratableTabs","initialValue","size","spacing","separator","loading","tabComponents","props","tabs","setTabs","useState","defaultValue","useMemo","tab","triggers","List","Trigger","contents","Content","context","existingIndex","id","TabsContext","BaseTabs","makeDecoratable","Tabs","withStaticProps","Tab"],"mappings":";;;;AAMA,MAAMA,OAAOC,KAAAA,IAAkB;AAU/B,MAAMC,kBAAkB,CAAC,EACrB,cAAcC,YAAY,EAC1BC,IAAI,EACJC,OAAO,EACPC,SAAS,EACTC,OAAO,EACP,MAAMC,aAAa,EACnB,GAAGC,OACK;IACR,MAAM,CAACC,MAAMC,QAAQ,GAAGC,SAAoB,EAAE;IAE9C,MAAMC,eAAeC,QAAQ,IAErBX,gBACAK,cAAc,IAAI,CAACO,CAAAA,MAAO,CAACA,IAAI,KAAK,CAAC,QAAQ,IAAIA,AAAsB,UAAtBA,IAAI,KAAK,CAAC,OAAO,GAAa,MAC1E,OAEV;QAACZ;QAAcK;KAAc;IAEhC,MAAMQ,WAAWF,QACb,kBACI,oBAACG,MAAIA;YACD,KAAKP,KAAK,GAAG,CAACK,CAAAA,MAAOA,IAAI,EAAE,EAAE,IAAI,CAAC;YAClC,MAAMX;YACN,SAASC;YACT,WAAWC;WAEVI,KAAK,GAAG,CAACK,CAAAA,MAAAA,WAAAA,GACN,oBAACG,SAAOA;gBACJ,eAAaH,GAAG,CAAC,cAAc;gBAC/B,UAAUA,IAAI,QAAQ;gBACtB,MAAMA,IAAI,IAAI;gBACd,KAAKA,IAAI,EAAE;gBACX,SAASR;gBACT,MAAMH;gBACN,MAAMW,IAAI,OAAO;gBACjB,OAAOA,IAAI,KAAK;gBAChB,SAASA,IAAI,OAAO;kBAKpC;QAACL;QAAMN;QAAMC;QAASC;QAAWC;KAAQ;IAG7C,MAAMY,WAAWL,QACb,IACIJ,KAAK,GAAG,CAACK,CAAAA,MAAAA,WAAAA,GACL,oBAACK,SAAOA;gBACJ,KAAKL,IAAI,EAAE;gBACX,OAAOA,IAAI,KAAK;gBAChB,SAASA,IAAI,OAAO;gBACpB,SAASA,IAAI,OAAO,IAAIV;gBACxB,WAAWU,IAAI,SAAS;iBAGpC;QAACL;QAAML;KAAQ;IAGnB,MAAMgB,UAAwBP,QAC1B,IAAO;YACH,QAAOL,KAAK;gBACRE,QAAQD,CAAAA;oBACJ,MAAMY,gBAAgBZ,KAAK,SAAS,CAACK,CAAAA,MAAOA,IAAI,KAAK,KAAKN,MAAM,KAAK;oBACrE,IAAIa,gBAAgB,IAChB,OAAO;2BACAZ,KAAK,KAAK,CAAC,GAAGY;wBACjBb;2BACGC,KAAK,KAAK,CAACY,gBAAgB;qBACjC;oBAEL,OAAO;2BAAIZ;wBAAMD;qBAAM;gBAC3B;YACJ;YACA,WAAUc,EAAE;gBACRZ,QAAQD,CAAAA,OAAQA,KAAK,MAAM,CAACK,CAAAA,MAAOA,IAAI,EAAE,KAAKQ;YAClD;QACJ,IACA;QAACZ;KAAQ;IAGb,OAAO,WAAP,GACI,oBAACX,MAAIA;QAAE,GAAGS,KAAK;QAAE,cAAcI;OAC1BG,UACAG,UAAAA,WAAAA,GACD,oBAACK,YAAY,QAAQ;QAAC,OAAOH;OAAUb;AAGnD;AAEA,MAAMiB,WAAWC,gBAAgB,QAAQxB;AAEzC,MAAMyB,YAAOC,gBAAgBH,UAAU;IACnCI,KAAGA;AACP"}
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { Tabs as TabsPrimitive } from "radix-ui";
3
3
  import { type VariantProps } from "../../utils.js";
4
4
  declare const tabContentVariants: (props?: ({
5
- spacing?: "sm" | "md" | "lg" | "xl" | "xs" | "xxl" | null | undefined;
5
+ spacing?: "lg" | "md" | "sm" | "xl" | "xs" | "xxl" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  type ContentProps = Omit<TabsPrimitive.TabsContentProps, "children" | "content"> & VariantProps<typeof tabContentVariants> & {
8
8
  content: React.ReactNode;