@webiny/admin-ui 6.4.11 → 6.6.0-alpha.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 (317) 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/Breadcrumbs/Breadcrumbs.d.ts +54 -0
  24. package/Breadcrumbs/Breadcrumbs.js +66 -0
  25. package/Breadcrumbs/Breadcrumbs.js.map +1 -0
  26. package/Breadcrumbs/Breadcrumbs.stories.d.ts +9 -0
  27. package/Breadcrumbs/Breadcrumbs.stories.js +71 -0
  28. package/Breadcrumbs/Breadcrumbs.stories.js.map +1 -0
  29. package/Breadcrumbs/index.d.ts +1 -0
  30. package/Breadcrumbs/index.js +1 -0
  31. package/Button/Button.d.ts +10 -9
  32. package/Button/CopyButton.d.ts +7 -6
  33. package/Button/IconButton.d.ts +10 -9
  34. package/Calendar/Calendar.d.ts +7 -6
  35. package/Calendar/calendarClassNames.js +1 -1
  36. package/Calendar/calendarClassNames.js.map +1 -1
  37. package/Card/Card.d.ts +8 -22
  38. package/Card/components/CancelAction.d.ts +8 -6
  39. package/Card/components/CardContent.d.ts +6 -6
  40. package/Card/components/CardTitle.d.ts +2 -2
  41. package/Card/components/ConfirmAction.d.ts +8 -6
  42. package/Card/components/Icon.d.ts +7 -6
  43. package/Checkbox/Checkbox.d.ts +7 -6
  44. package/Checkbox/primitives/CheckboxPrimitive.d.ts +17 -12
  45. package/CheckboxGroup/CheckboxGroup.d.ts +7 -6
  46. package/CheckboxGroup/primitives/CheckboxGroupPrimitive.d.ts +20 -12
  47. package/CodeEditor/CodeEditor.d.ts +7 -6
  48. package/CodeEditor/CodeEditorPrimitive.d.ts +7 -6
  49. package/CodeEditor/CodeEditorPrimitive.js +3 -1
  50. package/CodeEditor/CodeEditorPrimitive.js.map +1 -1
  51. package/ColorPicker/ColorPicker.d.ts +7 -6
  52. package/ColorPicker/primitives/ColorPickerPrimitive.d.ts +7 -6
  53. package/Command/Command.d.ts +10 -8
  54. package/DataList/DataListModal.d.ts +6 -3
  55. package/DataTable/DataTable.d.ts +23 -12
  56. package/DataTable/DataTable.js +12 -4
  57. package/DataTable/DataTable.js.map +1 -1
  58. package/DataTable/components/ColumnsVisibility.d.ts +5 -4
  59. package/DataTable/components/ColumnsVisibility.js +6 -3
  60. package/DataTable/components/ColumnsVisibility.js.map +1 -1
  61. package/DatePicker/DatePicker.d.ts +7 -6
  62. package/DatePicker/primitives/DatePickerPrimitive.d.ts +7 -6
  63. package/DatePicker/primitives/DateTimePicker.d.ts +1 -1
  64. package/DatePicker/primitives/DateTimePicker.js +15 -3
  65. package/DatePicker/primitives/DateTimePicker.js.map +1 -1
  66. package/DatePicker/primitives/components/DatePickerTrigger.js +1 -1
  67. package/DatePicker/primitives/components/DatePickerTrigger.js.map +1 -1
  68. package/DatePicker/utils/types.d.ts +2 -0
  69. package/Dialog/Dialog.d.ts +8 -22
  70. package/Dialog/components/CancelAction.d.ts +8 -6
  71. package/Dialog/components/ConfirmAction.d.ts +8 -6
  72. package/Dialog/components/DialogContent.d.ts +1 -1
  73. package/Dialog/components/DialogFooter.d.ts +1 -1
  74. package/Dialog/components/DialogTitle.d.ts +1 -1
  75. package/Dialog/components/Icon.d.ts +7 -6
  76. package/Drawer/Drawer.d.ts +8 -22
  77. package/Drawer/Drawer.stories.js +1 -0
  78. package/Drawer/Drawer.stories.js.map +1 -1
  79. package/Drawer/components/CancelButton.d.ts +8 -6
  80. package/Drawer/components/ConfirmButton.d.ts +8 -6
  81. package/Drawer/components/DrawerContent.d.ts +1 -1
  82. package/Drawer/components/Icon.d.ts +7 -6
  83. package/DropdownMenu/components/DropdownMenuItem.d.ts +3 -2
  84. package/DropdownMenu/components/DropdownMenuItem.js +9 -2
  85. package/DropdownMenu/components/DropdownMenuItem.js.map +1 -1
  86. package/DropdownMenu/components/DropdownMenuLink.d.ts +9 -8
  87. package/DropdownMenu/components/DropdownMenuSeparator.d.ts +7 -6
  88. package/EditableTitle/EditableTitle.d.ts +7 -6
  89. package/EmptyState/EmptyState.d.ts +43 -0
  90. package/EmptyState/EmptyState.js +93 -0
  91. package/EmptyState/EmptyState.js.map +1 -0
  92. package/EmptyState/EmptyState.stories.d.ts +13 -0
  93. package/EmptyState/EmptyState.stories.js +136 -0
  94. package/EmptyState/EmptyState.stories.js.map +1 -0
  95. package/EmptyState/illustrations/ContentIllustration.d.ts +2 -0
  96. package/EmptyState/illustrations/ContentIllustration.js +100 -0
  97. package/EmptyState/illustrations/ContentIllustration.js.map +1 -0
  98. package/EmptyState/illustrations/LayoutIllustration.d.ts +2 -0
  99. package/EmptyState/illustrations/LayoutIllustration.js +93 -0
  100. package/EmptyState/illustrations/LayoutIllustration.js.map +1 -0
  101. package/EmptyState/illustrations/ListingIllustration.d.ts +2 -0
  102. package/EmptyState/illustrations/ListingIllustration.js +92 -0
  103. package/EmptyState/illustrations/ListingIllustration.js.map +1 -0
  104. package/EmptyState/illustrations/SelectIllustration.d.ts +2 -0
  105. package/EmptyState/illustrations/SelectIllustration.js +100 -0
  106. package/EmptyState/illustrations/SelectIllustration.js.map +1 -0
  107. package/EmptyState/illustrations/TableIllustration.d.ts +2 -0
  108. package/EmptyState/illustrations/TableIllustration.js +233 -0
  109. package/EmptyState/illustrations/TableIllustration.js.map +1 -0
  110. package/EmptyState/illustrations/UploadIllustration.d.ts +2 -0
  111. package/EmptyState/illustrations/UploadIllustration.js +77 -0
  112. package/EmptyState/illustrations/UploadIllustration.js.map +1 -0
  113. package/EmptyState/illustrations/index.d.ts +6 -0
  114. package/EmptyState/illustrations/index.js +6 -0
  115. package/EmptyState/index.d.ts +1 -0
  116. package/EmptyState/index.js +1 -0
  117. package/FilePicker/FilePicker.d.ts +19 -18
  118. package/FilePicker/FilePicker.stories.d.ts +0 -6
  119. package/FilePicker/FilePicker.stories.js +1 -24
  120. package/FilePicker/FilePicker.stories.js.map +1 -1
  121. package/FilePicker/primitives/FilePickerPrimitive.d.ts +20 -19
  122. package/FilePicker/primitives/components/Trigger.d.ts +1 -1
  123. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.d.ts +19 -7
  124. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js +15 -6
  125. package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js.map +1 -1
  126. package/FilePicker/primitives/components/previews/ItemActions.js +1 -1
  127. package/FilePicker/primitives/components/previews/ItemActions.js.map +1 -1
  128. package/FilePicker/primitives/components/previews/ItemDescription.js +1 -1
  129. package/FilePicker/primitives/components/previews/ItemDescription.js.map +1 -1
  130. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.d.ts +12 -6
  131. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js +13 -52
  132. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js.map +1 -1
  133. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.d.ts +8 -4
  134. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.js +66 -8
  135. package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.js.map +1 -1
  136. package/FilePicker/primitives/components/previews/TextOnlyPreview/TextOnlyPreview.d.ts +7 -6
  137. package/FilePicker/primitives/components/previews/index.d.ts +0 -1
  138. package/FilePicker/primitives/components/previews/index.js +0 -1
  139. package/FilePicker/primitives/components/previews/variants.d.ts +1 -1
  140. package/FillViewport/FillViewport.d.ts +21 -18
  141. package/FormComponent/Description.d.ts +7 -6
  142. package/FormComponent/ErrorMessage.d.ts +7 -6
  143. package/FormComponent/Label.d.ts +7 -6
  144. package/FormComponent/Note.d.ts +7 -6
  145. package/Grid/Grid.d.ts +24 -22
  146. package/HeaderBar/HeaderBar.d.ts +7 -6
  147. package/Heading/Heading.d.ts +8 -7
  148. package/Icon/Icon.d.ts +9 -8
  149. package/IconPicker/IconPicker.d.ts +7 -6
  150. package/IconPicker/primitives/IconPickerPrimitive.d.ts +1 -1
  151. package/IconPicker/primitives/components/IconPickerTrigger.d.ts +1 -1
  152. package/ImageEditor/AspectRatioPreview.d.ts +16 -0
  153. package/ImageEditor/AspectRatioPreview.js +26 -0
  154. package/ImageEditor/AspectRatioPreview.js.map +1 -0
  155. package/ImageEditor/CropHotspotEditor.d.ts +22 -0
  156. package/ImageEditor/CropHotspotEditor.js +402 -0
  157. package/ImageEditor/CropHotspotEditor.js.map +1 -0
  158. package/ImageEditor/ImageEditor.d.ts +18 -0
  159. package/ImageEditor/ImageEditor.js +151 -0
  160. package/ImageEditor/ImageEditor.js.map +1 -0
  161. package/ImageEditor/ImageEditor.stories.d.ts +6 -0
  162. package/ImageEditor/ImageEditor.stories.js +42 -0
  163. package/ImageEditor/ImageEditor.stories.js.map +1 -0
  164. package/ImageEditor/MetaFields.d.ts +12 -0
  165. package/ImageEditor/MetaFields.js +20 -0
  166. package/ImageEditor/MetaFields.js.map +1 -0
  167. package/ImageEditor/SectionLabel.d.ts +8 -0
  168. package/ImageEditor/SectionLabel.js +7 -0
  169. package/ImageEditor/SectionLabel.js.map +1 -0
  170. package/ImageEditor/geometry.d.ts +46 -0
  171. package/ImageEditor/geometry.js +126 -0
  172. package/ImageEditor/geometry.js.map +1 -0
  173. package/ImageEditor/index.d.ts +3 -0
  174. package/ImageEditor/index.js +3 -0
  175. package/ImageEditor/types.d.ts +52 -0
  176. package/ImageEditor/types.js +35 -0
  177. package/ImageEditor/types.js.map +1 -0
  178. package/Input/Input.d.ts +7 -6
  179. package/Input/InputPrimitive.d.ts +9 -8
  180. package/Label/Label.d.ts +8 -7
  181. package/Label/components/LabelValue.d.ts +1 -1
  182. package/Link/Link.d.ts +3 -3
  183. package/Link/Link.js +1 -1
  184. package/Link/Link.js.map +1 -1
  185. package/List/List.d.ts +8 -7
  186. package/List/components/ListItem.d.ts +7 -6
  187. package/List/components/ListItemAction.d.ts +7 -6
  188. package/List/components/ListItemHandle.d.ts +7 -6
  189. package/List/components/ListItemIcon.d.ts +7 -6
  190. package/List/components/ListItemSeparator.d.ts +7 -6
  191. package/Loader/Loader.d.ts +9 -8
  192. package/Loader/OverlayLoader.d.ts +7 -6
  193. package/Markdown/Markdown.d.ts +47 -0
  194. package/Markdown/Markdown.js +17 -0
  195. package/Markdown/Markdown.js.map +1 -0
  196. package/Markdown/index.d.ts +1 -0
  197. package/Markdown/index.js +1 -0
  198. package/MultiAutoComplete/MultiAutoComplete.d.ts +7 -6
  199. package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.d.ts +7 -6
  200. package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenterWithFreeInput.d.ts +3 -3
  201. package/MultiAutoComplete/primitives/useMultiAutoComplete.d.ts +3 -3
  202. package/MultiFilePicker/MultiFilePicker.d.ts +19 -18
  203. package/MultiFilePicker/primitives/MultiFilePickerPrimitive.d.ts +19 -18
  204. package/MultiSelect/MultiSelect.d.ts +7 -6
  205. package/MultiSelect/primitives/MultiSelectPrimitive.d.ts +10 -6
  206. package/MultiSelect/primitives/MultiSelectPrimitive.js +1 -1
  207. package/MultiSelect/primitives/MultiSelectPrimitive.js.map +1 -1
  208. package/Popover/Popover.d.ts +7 -6
  209. package/Popover/primitives/PopoverPrimitive.d.ts +7 -7
  210. package/ProgressBar/ProgressBar.d.ts +7 -6
  211. package/RadioGroup/RadioGroup.d.ts +7 -6
  212. package/RadioGroup/primitives/Radio.d.ts +7 -6
  213. package/RadioGroup/primitives/RadioGroupPrimitive.d.ts +5 -1
  214. package/RangeSlider/RangeSlider.d.ts +7 -6
  215. package/SegmentedControl/SegmentedControl.d.ts +8 -7
  216. package/SegmentedControl/SegmentedControlTabs.d.ts +5 -2
  217. package/SegmentedControl/primitives/SegmentedControlPrimitive.d.ts +1 -1
  218. package/Select/Select.d.ts +7 -6
  219. package/Select/primitives/components/SelectContent.js +1 -1
  220. package/Select/primitives/components/SelectContent.js.map +1 -1
  221. package/Select/primitives/components/SelectTrigger.d.ts +2 -2
  222. package/Separator/Separator.d.ts +9 -8
  223. package/Sidebar/Sidebar.d.ts +7 -6
  224. package/Sidebar/components/SidebarContent.js +1 -1
  225. package/Sidebar/components/SidebarContent.js.map +1 -1
  226. package/Sidebar/components/SidebarIcon.d.ts +7 -6
  227. package/Sidebar/components/SidebarProvider.d.ts +4 -4
  228. package/Sidebar/components/SidebarRoot.js +1 -1
  229. package/Sidebar/components/SidebarRoot.js.map +1 -1
  230. package/Sidebar/components/items/SidebarMenuGroup.d.ts +9 -8
  231. package/Sidebar/components/items/SidebarMenuItem.d.ts +11 -10
  232. package/Sidebar/components/items/SidebarMenuItemIcon.d.ts +7 -6
  233. package/Sidebar/components/items/SidebarMenuLink.d.ts +11 -10
  234. package/Sidebar/components/items/SidebarMenuProvider.d.ts +4 -4
  235. package/Sidebar/components/items/SidebarMenuRootItem.d.ts +9 -7
  236. package/Sidebar/components/items/SidebarMenuSubButton.js +5 -8
  237. package/Sidebar/components/items/SidebarMenuSubButton.js.map +1 -1
  238. package/Sidebar/components/items/SidebarMenuSubItem.js +3 -3
  239. package/Sidebar/components/items/SidebarMenuSubItem.js.map +1 -1
  240. package/Skeleton/Skeleton.d.ts +9 -7
  241. package/Skeleton/Skeleton.js +10 -4
  242. package/Skeleton/Skeleton.js.map +1 -1
  243. package/Skeleton/Skeleton.stories.d.ts +2 -0
  244. package/Skeleton/Skeleton.stories.js +28 -2
  245. package/Skeleton/Skeleton.stories.js.map +1 -1
  246. package/Slider/Slider.d.ts +7 -6
  247. package/SteppedProgress/SteppedProgress.d.ts +7 -6
  248. package/SteppedProgress/SteppedProgressItem.d.ts +7 -6
  249. package/Switch/Switch.d.ts +7 -6
  250. package/Switch/primitives/SwitchPrimitive.d.ts +10 -6
  251. package/Table/Table.d.ts +12 -10
  252. package/Table/components/Direction.d.ts +1 -1
  253. package/Tabs/Tabs.d.ts +8 -6
  254. package/Tabs/Tabs.js +5 -2
  255. package/Tabs/Tabs.js.map +1 -1
  256. package/Tabs/components/Content.d.ts +1 -1
  257. package/Tabs/components/List.d.ts +2 -2
  258. package/Tabs/components/Tab.d.ts +7 -6
  259. package/Tabs/components/Trigger.d.ts +3 -2
  260. package/Tabs/components/Trigger.js +8 -3
  261. package/Tabs/components/Trigger.js.map +1 -1
  262. package/Tag/Tag.d.ts +8 -7
  263. package/Tags/Tags.d.ts +7 -6
  264. package/Tags/primitives/TagsPrimitive.d.ts +7 -6
  265. package/Text/Text.d.ts +8 -7
  266. package/Textarea/Textarea.d.ts +7 -6
  267. package/Textarea/TextareaPrimitive.d.ts +9 -8
  268. package/Toast/Toast.d.ts +7 -6
  269. package/Toast/components/ToastActions.d.ts +7 -6
  270. package/Toast/components/ToastDescription.d.ts +7 -6
  271. package/Toast/components/ToastTitle.d.ts +7 -6
  272. package/Toast/useToast.stories.js.map +1 -1
  273. package/Toggle/Toggle.d.ts +7 -6
  274. package/Toggle/primitives/TogglePrimitive.d.ts +13 -9
  275. package/ToggleGroup/ToggleGroup.d.ts +7 -6
  276. package/ToggleGroup/primitives/ToggleGroupPrimitive.d.ts +13 -9
  277. package/Tooltip/Tooltip.d.ts +7 -6
  278. package/Tree/Tree.d.ts +7 -6
  279. package/Tree/components/Item.d.ts +7 -6
  280. package/Tree/components/ItemCollapseTrigger.d.ts +7 -6
  281. package/Tree/components/ItemContent.d.ts +8 -6
  282. package/Tree/components/ItemDragHandle.d.ts +7 -6
  283. package/Tree/components/ItemIcon.d.ts +7 -6
  284. package/Tree/components/ItemPlaceholder.d.ts +7 -6
  285. package/Tree/components/ItemSubIndentation.d.ts +7 -6
  286. package/Tree/useTree.js +2 -6
  287. package/Tree/useTree.js.map +1 -1
  288. package/Widget/Widget.d.ts +8 -22
  289. package/Widget/components/Icon.d.ts +7 -6
  290. package/Widget/components/WidgetAction.d.ts +8 -6
  291. package/Widget/components/WidgetContent.d.ts +5 -5
  292. package/exports/admin/ui.d.ts +2 -0
  293. package/exports/admin/ui.js +2 -0
  294. package/index.d.ts +5 -0
  295. package/index.js +5 -0
  296. package/package.json +29 -29
  297. package/theme.css +22 -1
  298. package/utils.js +52 -34
  299. package/utils.js.map +1 -1
  300. package/FilePicker/primitives/components/previews/RichItemPreview/FileType.d.ts +0 -9
  301. package/FilePicker/primitives/components/previews/RichItemPreview/FileType.js +0 -45
  302. package/FilePicker/primitives/components/previews/RichItemPreview/FileType.js.map +0 -1
  303. package/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.d.ts +0 -8
  304. package/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.js +0 -14
  305. package/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.js.map +0 -1
  306. package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.d.ts +0 -11
  307. package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.js +0 -20
  308. package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.js.map +0 -1
  309. package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.d.ts +0 -15
  310. package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.js +0 -46
  311. package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.js.map +0 -1
  312. package/FilePicker/primitives/components/previews/TruncatedFileName.d.ts +0 -11
  313. package/FilePicker/primitives/components/previews/TruncatedFileName.js +0 -20
  314. package/FilePicker/primitives/components/previews/TruncatedFileName.js.map +0 -1
  315. package/FilePicker/primitives/components/previews/fileName.d.ts +0 -12
  316. package/FilePicker/primitives/components/previews/fileName.js +0 -26
  317. package/FilePicker/primitives/components/previews/fileName.js.map +0 -1
@@ -7,21 +7,22 @@ interface SidebarProps extends Omit<React.ComponentPropsWithoutRef<typeof Sideba
7
7
  children: React.ReactNode;
8
8
  footer?: React.ReactNode;
9
9
  }
10
- declare const Sidebar: ((props: SidebarProps) => React.JSX.Element) & {
11
- original: (props: SidebarProps) => React.JSX.Element;
10
+ declare const SidebarBase: (props: SidebarProps) => React.JSX.Element;
11
+ declare const Sidebar: typeof SidebarBase & {
12
+ original: typeof SidebarBase;
12
13
  originalName: string;
13
14
  displayName: string;
14
15
  } & {
15
- original: ((props: SidebarProps) => React.JSX.Element) & {
16
- original: (props: SidebarProps) => React.JSX.Element;
16
+ original: typeof SidebarBase & {
17
+ original: typeof SidebarBase;
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<((props: SidebarProps) => React.JSX.Element) & {
24
- original: (props: SidebarProps) => React.JSX.Element;
24
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof SidebarBase & {
25
+ original: typeof SidebarBase;
25
26
  originalName: string;
26
27
  displayName: string;
27
28
  }>) => (props: unknown) => React.JSX.Element;
@@ -9,7 +9,7 @@ const SidebarContent = ({ className, children, ...props })=>{
9
9
  const { dir, onScroll, ...restProps } = props;
10
10
  return /*#__PURE__*/ react.createElement(ScrollArea, {
11
11
  "data-sidebar": "content",
12
- className: cn("flex text-neutral-primary min-h-0 flex-1 flex-col gap-2 [&_[data-radix-scroll-area-viewport]>div]:!block", className),
12
+ className: cn("flex text-neutral-primary min-h-0 flex-1 flex-col gap-2", className),
13
13
  ...restProps
14
14
  }, children);
15
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar/components/SidebarContent.js","sources":["../../../src/Sidebar/components/SidebarContent.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"~/utils.js\";\nimport { ScrollArea } from \"~/ScrollArea/index.js\";\nimport { useSidebar } from \"./SidebarProvider.js\";\n\nconst SidebarContent = ({ className, children, ...props }: React.ComponentProps<\"div\">) => {\n const { state } = useSidebar();\n const isExpanded = state === \"expanded\";\n\n if (isExpanded) {\n // Extract dir and onScroll props to avoid type conflicts with ScrollArea.\n // oxlint-disable-next-line typescript/no-unused-vars\n const { dir, onScroll, ...restProps } = props;\n return (\n <ScrollArea\n data-sidebar=\"content\"\n className={cn(\n \"flex text-neutral-primary min-h-0 flex-1 flex-col gap-2 [&_[data-radix-scroll-area-viewport]>div]:!block\",\n className\n )}\n {...restProps}\n >\n {children}\n </ScrollArea>\n );\n }\n\n return (\n <div\n {...props}\n data-sidebar=\"content\"\n className={cn(\n \"flex text-neutral-primary min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden group-data-[state=collapsed]:overflow-hidden\",\n className\n )}\n >\n {children}\n </div>\n );\n};\n\nexport { SidebarContent };\n"],"names":["SidebarContent","className","children","props","state","useSidebar","isExpanded","dir","onScroll","restProps","ScrollArea","cn"],"mappings":";;;;AAKA,MAAMA,iBAAiB,CAAC,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,OAAoC;IAClF,MAAM,EAAEC,KAAK,EAAE,GAAGC;IAClB,MAAMC,aAAaF,AAAU,eAAVA;IAEnB,IAAIE,YAAY;QAGZ,MAAM,EAAEC,GAAG,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGN;QACxC,OAAO,WAAP,GACI,oBAACO,YAAUA;YACP,gBAAa;YACb,WAAWC,GACP,4GACAV;YAEH,GAAGQ,SAAS;WAEZP;IAGb;IAEA,OAAO,WAAP,GACI,oBAAC;QACI,GAAGC,KAAK;QACT,gBAAa;QACb,WAAWQ,GACP,0IACAV;OAGHC;AAGb"}
1
+ {"version":3,"file":"Sidebar/components/SidebarContent.js","sources":["../../../src/Sidebar/components/SidebarContent.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"~/utils.js\";\nimport { ScrollArea } from \"~/ScrollArea/index.js\";\nimport { useSidebar } from \"./SidebarProvider.js\";\n\nconst SidebarContent = ({ className, children, ...props }: React.ComponentProps<\"div\">) => {\n const { state } = useSidebar();\n const isExpanded = state === \"expanded\";\n\n if (isExpanded) {\n // Extract dir and onScroll props to avoid type conflicts with ScrollArea.\n // oxlint-disable-next-line typescript/no-unused-vars\n const { dir, onScroll, ...restProps } = props;\n return (\n <ScrollArea\n data-sidebar=\"content\"\n className={cn(\"flex text-neutral-primary min-h-0 flex-1 flex-col gap-2\", className)}\n {...restProps}\n >\n {children}\n </ScrollArea>\n );\n }\n\n return (\n <div\n {...props}\n data-sidebar=\"content\"\n className={cn(\n \"flex text-neutral-primary min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden group-data-[state=collapsed]:overflow-hidden\",\n className\n )}\n >\n {children}\n </div>\n );\n};\n\nexport { SidebarContent };\n"],"names":["SidebarContent","className","children","props","state","useSidebar","isExpanded","dir","onScroll","restProps","ScrollArea","cn"],"mappings":";;;;AAKA,MAAMA,iBAAiB,CAAC,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,OAAoC;IAClF,MAAM,EAAEC,KAAK,EAAE,GAAGC;IAClB,MAAMC,aAAaF,AAAU,eAAVA;IAEnB,IAAIE,YAAY;QAGZ,MAAM,EAAEC,GAAG,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGN;QACxC,OAAO,WAAP,GACI,oBAACO,YAAUA;YACP,gBAAa;YACb,WAAWC,GAAG,2DAA2DV;YACxE,GAAGQ,SAAS;WAEZP;IAGb;IAEA,OAAO,WAAP,GACI,oBAAC;QACI,GAAGC,KAAK;QACT,gBAAa;QACb,WAAWQ,GACP,0IACAV;OAGHC;AAGb"}
@@ -3,21 +3,22 @@ import { type IconProps } from "../../Icon/index.js";
3
3
  interface SidebarIconProps extends Omit<IconProps, "icon"> {
4
4
  element?: React.ReactNode;
5
5
  }
6
- declare const SidebarIcon: (({ element, ...props }: SidebarIconProps) => React.JSX.Element) & {
7
- original: ({ element, ...props }: SidebarIconProps) => React.JSX.Element;
6
+ declare const SidebarIconBase: ({ element, ...props }: SidebarIconProps) => React.JSX.Element;
7
+ declare const SidebarIcon: typeof SidebarIconBase & {
8
+ original: typeof SidebarIconBase;
8
9
  originalName: string;
9
10
  displayName: string;
10
11
  } & {
11
- original: (({ element, ...props }: SidebarIconProps) => React.JSX.Element) & {
12
- original: ({ element, ...props }: SidebarIconProps) => React.JSX.Element;
12
+ original: typeof SidebarIconBase & {
13
+ original: typeof SidebarIconBase;
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 }: SidebarIconProps) => React.JSX.Element) & {
20
- original: ({ element, ...props }: SidebarIconProps) => React.JSX.Element;
20
+ createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<typeof SidebarIconBase & {
21
+ original: typeof SidebarIconBase;
21
22
  originalName: string;
22
23
  displayName: string;
23
24
  }>) => (props: unknown) => React.JSX.Element;
@@ -36,8 +36,8 @@ type SidebarProviderProps = React.HTMLAttributes<HTMLDivElement> & {
36
36
  state?: SidebarCachedState;
37
37
  onChangeState?: (state: SidebarCachedState) => void;
38
38
  };
39
- declare const SidebarProvider: {
40
- ({ className, children, state: cachedState, onChangeState, ...props }: SidebarProviderProps): React.JSX.Element;
41
- displayName: string;
42
- };
39
+ declare function SidebarProvider({ className, children, state: cachedState, onChangeState, ...props }: SidebarProviderProps): React.JSX.Element;
40
+ declare namespace SidebarProvider {
41
+ var displayName: string;
42
+ }
43
43
  export { SidebarProvider, useSidebar, type PinnedItemData };
@@ -56,7 +56,7 @@ const SidebarRoot = ({ side = "left", className, children, ...props })=>{
56
56
  ...props
57
57
  }, /*#__PURE__*/ react.createElement("div", {
58
58
  "data-sidebar": "sidebar",
59
- className: "flex h-full w-full py-xs flex-col overflow-hidden"
59
+ className: "flex h-full w-full py-xs flex-col"
60
60
  }, children)), /*#__PURE__*/ react.createElement("div", {
61
61
  "data-sidebar": "extra-hover-area",
62
62
  className: "absolute top-0 left-[theme(spacing.sidebar-collapsed)] h-full w-sm hidden group-data-[state=collapsed]:block"
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar/components/SidebarRoot.js","sources":["../../../src/Sidebar/components/SidebarRoot.tsx"],"sourcesContent":["import React, { useCallback, useRef } from \"react\";\nimport { cn, cva } from \"~/utils.js\";\nimport { useSidebar } from \"./SidebarProvider.js\";\n\ninterface SidebarRootProps extends React.ComponentProps<\"div\"> {\n side?: \"left\" | \"right\";\n}\n\nconst variants = cva(\"group peer block border-r-sm border-neutral-dimmed bg-neutral-light\", {\n variants: {\n pinned: {\n false: \"fixed top-0 z-sidebar \"\n }\n }\n});\n\nconst SidebarRoot = ({ side = \"left\", className, children, ...props }: SidebarRootProps) => {\n const { state, setExpanded, pinned, expanded } = useSidebar();\n\n const elementRef = useRef<HTMLDivElement>(null);\n\n // With this timeout, we prevent the sidebar glitching (quickly opening/closing) during mouse enter/leave events.\n const timeoutRef = useRef<number | null>(null);\n\n const onMouseEnter = useCallback<React.MouseEventHandler<HTMLDivElement>>(() => {\n // If the sidebar is pinned, we don't want to open the sidebar on mouse enter.\n if (pinned) {\n return;\n }\n\n if (timeoutRef.current) {\n window.clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n\n // Add delay before opening to prevent accidental openings\n timeoutRef.current = window.setTimeout(() => {\n // Only set expanded if it's not already expanded\n if (!expanded) {\n setExpanded(true);\n }\n }, 300);\n }, [pinned, setExpanded, expanded]);\n\n const onMouseLeave = useCallback<React.MouseEventHandler<HTMLDivElement>>(() => {\n // If the sidebar is pinned, we don't want to close the sidebar on mouse leave.\n if (pinned) {\n return;\n }\n\n if (timeoutRef.current) {\n window.clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n\n // With this timeout, we prevent the sidebar glitching (quickly opening/closing) during mouse enter/leave events.\n timeoutRef.current = window.setTimeout(() => {\n setExpanded(false);\n }, 300);\n }, [pinned, setExpanded]);\n\n return (\n <div\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n ref={elementRef}\n data-state={state}\n data-sidebar={\"root\"}\n data-side={side}\n className={variants({ pinned })}\n >\n <div\n className={cn(\n \"duration-175 relative h-svh w-sidebar-expanded bg-transparent transition-[width] ease-linear duration-175\",\n \"group-data-[side=right]:rotate-180\",\n \"group-data-[state=collapsed]:w-sidebar-collapsed\"\n )}\n />\n <div\n className={cn(\n \"duration-175 fixed inset-y-0 z-sidebar h-svh w-sidebar-expanded transition-[width] ease-linear md:flex\",\n side === \"left\" ? \"left-0\" : \"right-0\",\n \"group-data-[state=collapsed]:w-sidebar-collapsed group-data-[side=left]:border-r-px group-data-[side=right]:border-l-px\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n className=\"flex h-full w-full py-xs flex-col overflow-hidden\"\n >\n {children}\n </div>\n </div>\n\n <div\n data-sidebar={\"extra-hover-area\"}\n className={\n \"absolute top-0 left-[theme(spacing.sidebar-collapsed)] h-full w-sm hidden group-data-[state=collapsed]:block\"\n }\n />\n </div>\n );\n};\n\nexport { SidebarRoot, type SidebarRootProps };\n"],"names":["variants","cva","SidebarRoot","side","className","children","props","state","setExpanded","pinned","expanded","useSidebar","elementRef","useRef","timeoutRef","onMouseEnter","useCallback","window","onMouseLeave","cn"],"mappings":";;;AAQA,MAAMA,WAAWC,IAAI,uEAAuE;IACxF,UAAU;QACN,QAAQ;YACJ,OAAO;QACX;IACJ;AACJ;AAEA,MAAMC,cAAc,CAAC,EAAEC,OAAO,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,OAAyB;IACnF,MAAM,EAAEC,KAAK,EAAEC,WAAW,EAAEC,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IAEjD,MAAMC,aAAaC,OAAuB;IAG1C,MAAMC,aAAaD,OAAsB;IAEzC,MAAME,eAAeC,YAAqD;QAEtE,IAAIP,QACA;QAGJ,IAAIK,WAAW,OAAO,EAAE;YACpBG,OAAO,YAAY,CAACH,WAAW,OAAO;YACtCA,WAAW,OAAO,GAAG;QACzB;QAGAA,WAAW,OAAO,GAAGG,OAAO,UAAU,CAAC;YAEnC,IAAI,CAACP,UACDF,YAAY;QAEpB,GAAG;IACP,GAAG;QAACC;QAAQD;QAAaE;KAAS;IAElC,MAAMQ,eAAeF,YAAqD;QAEtE,IAAIP,QACA;QAGJ,IAAIK,WAAW,OAAO,EAAE;YACpBG,OAAO,YAAY,CAACH,WAAW,OAAO;YACtCA,WAAW,OAAO,GAAG;QACzB;QAGAA,WAAW,OAAO,GAAGG,OAAO,UAAU,CAAC;YACnCT,YAAY;QAChB,GAAG;IACP,GAAG;QAACC;QAAQD;KAAY;IAExB,OAAO,WAAP,GACI,oBAAC;QACG,cAAcO;QACd,cAAcG;QACd,KAAKN;QACL,cAAYL;QACZ,gBAAc;QACd,aAAWJ;QACX,WAAWH,SAAS;YAAES;QAAO;qBAE7B,oBAAC;QACG,WAAWU,GACP,6GACA,sCACA;sBAGR,oBAAC;QACG,WAAWA,GACP,0GACAhB,AAAS,WAATA,OAAkB,WAAW,WAC7B,2HACAC;QAEH,GAAGE,KAAK;qBAET,oBAAC;QACG,gBAAa;QACb,WAAU;OAETD,YAAAA,WAAAA,GAIT,oBAAC;QACG,gBAAc;QACd,WACI;;AAKpB"}
1
+ {"version":3,"file":"Sidebar/components/SidebarRoot.js","sources":["../../../src/Sidebar/components/SidebarRoot.tsx"],"sourcesContent":["import React, { useCallback, useRef } from \"react\";\nimport { cn, cva } from \"~/utils.js\";\nimport { useSidebar } from \"./SidebarProvider.js\";\n\ninterface SidebarRootProps extends React.ComponentProps<\"div\"> {\n side?: \"left\" | \"right\";\n}\n\nconst variants = cva(\"group peer block border-r-sm border-neutral-dimmed bg-neutral-light\", {\n variants: {\n pinned: {\n false: \"fixed top-0 z-sidebar \"\n }\n }\n});\n\nconst SidebarRoot = ({ side = \"left\", className, children, ...props }: SidebarRootProps) => {\n const { state, setExpanded, pinned, expanded } = useSidebar();\n\n const elementRef = useRef<HTMLDivElement>(null);\n\n // With this timeout, we prevent the sidebar glitching (quickly opening/closing) during mouse enter/leave events.\n const timeoutRef = useRef<number | null>(null);\n\n const onMouseEnter = useCallback<React.MouseEventHandler<HTMLDivElement>>(() => {\n // If the sidebar is pinned, we don't want to open the sidebar on mouse enter.\n if (pinned) {\n return;\n }\n\n if (timeoutRef.current) {\n window.clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n\n // Add delay before opening to prevent accidental openings\n timeoutRef.current = window.setTimeout(() => {\n // Only set expanded if it's not already expanded\n if (!expanded) {\n setExpanded(true);\n }\n }, 300);\n }, [pinned, setExpanded, expanded]);\n\n const onMouseLeave = useCallback<React.MouseEventHandler<HTMLDivElement>>(() => {\n // If the sidebar is pinned, we don't want to close the sidebar on mouse leave.\n if (pinned) {\n return;\n }\n\n if (timeoutRef.current) {\n window.clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n\n // With this timeout, we prevent the sidebar glitching (quickly opening/closing) during mouse enter/leave events.\n timeoutRef.current = window.setTimeout(() => {\n setExpanded(false);\n }, 300);\n }, [pinned, setExpanded]);\n\n return (\n <div\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n ref={elementRef}\n data-state={state}\n data-sidebar={\"root\"}\n data-side={side}\n className={variants({ pinned })}\n >\n <div\n className={cn(\n \"duration-175 relative h-svh w-sidebar-expanded bg-transparent transition-[width] ease-linear duration-175\",\n \"group-data-[side=right]:rotate-180\",\n \"group-data-[state=collapsed]:w-sidebar-collapsed\"\n )}\n />\n <div\n className={cn(\n \"duration-175 fixed inset-y-0 z-sidebar h-svh w-sidebar-expanded transition-[width] ease-linear md:flex\",\n side === \"left\" ? \"left-0\" : \"right-0\",\n \"group-data-[state=collapsed]:w-sidebar-collapsed group-data-[side=left]:border-r-px group-data-[side=right]:border-l-px\",\n className\n )}\n {...props}\n >\n <div data-sidebar=\"sidebar\" className=\"flex h-full w-full py-xs flex-col\">\n {children}\n </div>\n </div>\n\n <div\n data-sidebar={\"extra-hover-area\"}\n className={\n \"absolute top-0 left-[theme(spacing.sidebar-collapsed)] h-full w-sm hidden group-data-[state=collapsed]:block\"\n }\n />\n </div>\n );\n};\n\nexport { SidebarRoot, type SidebarRootProps };\n"],"names":["variants","cva","SidebarRoot","side","className","children","props","state","setExpanded","pinned","expanded","useSidebar","elementRef","useRef","timeoutRef","onMouseEnter","useCallback","window","onMouseLeave","cn"],"mappings":";;;AAQA,MAAMA,WAAWC,IAAI,uEAAuE;IACxF,UAAU;QACN,QAAQ;YACJ,OAAO;QACX;IACJ;AACJ;AAEA,MAAMC,cAAc,CAAC,EAAEC,OAAO,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,OAAyB;IACnF,MAAM,EAAEC,KAAK,EAAEC,WAAW,EAAEC,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IAEjD,MAAMC,aAAaC,OAAuB;IAG1C,MAAMC,aAAaD,OAAsB;IAEzC,MAAME,eAAeC,YAAqD;QAEtE,IAAIP,QACA;QAGJ,IAAIK,WAAW,OAAO,EAAE;YACpBG,OAAO,YAAY,CAACH,WAAW,OAAO;YACtCA,WAAW,OAAO,GAAG;QACzB;QAGAA,WAAW,OAAO,GAAGG,OAAO,UAAU,CAAC;YAEnC,IAAI,CAACP,UACDF,YAAY;QAEpB,GAAG;IACP,GAAG;QAACC;QAAQD;QAAaE;KAAS;IAElC,MAAMQ,eAAeF,YAAqD;QAEtE,IAAIP,QACA;QAGJ,IAAIK,WAAW,OAAO,EAAE;YACpBG,OAAO,YAAY,CAACH,WAAW,OAAO;YACtCA,WAAW,OAAO,GAAG;QACzB;QAGAA,WAAW,OAAO,GAAGG,OAAO,UAAU,CAAC;YACnCT,YAAY;QAChB,GAAG;IACP,GAAG;QAACC;QAAQD;KAAY;IAExB,OAAO,WAAP,GACI,oBAAC;QACG,cAAcO;QACd,cAAcG;QACd,KAAKN;QACL,cAAYL;QACZ,gBAAc;QACd,aAAWJ;QACX,WAAWH,SAAS;YAAES;QAAO;qBAE7B,oBAAC;QACG,WAAWU,GACP,6GACA,sCACA;sBAGR,oBAAC;QACG,WAAWA,GACP,0GACAhB,AAAS,WAATA,OAAkB,WAAW,WAC7B,2HACAC;QAEH,GAAGE,KAAK;qBAET,oBAAC;QAAI,gBAAa;QAAU,WAAU;OACjCD,YAAAA,WAAAA,GAIT,oBAAC;QACG,gBAAc;QACd,WACI;;AAKpB"}
@@ -1,22 +1,23 @@
1
1
  import React from "react";
2
2
  import { type SidebarMenuItemGroupProps } 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
- declare const SidebarMenuGroup: ((props: SidebarMenuItemGroupProps) => React.JSX.Element) & {
6
- original: (props: SidebarMenuItemGroupProps) => React.JSX.Element;
4
+ import { SidebarMenuItemAction, type SidebarMenuItemActionProps } from "../../../Sidebar/components/items/SidebarMenuItemAction.js";
5
+ declare const SidebarMenuGroupBase: (props: SidebarMenuItemGroupProps) => React.JSX.Element;
6
+ declare const SidebarMenuGroup: typeof SidebarMenuGroupBase & {
7
+ original: typeof SidebarMenuGroupBase;
7
8
  originalName: string;
8
9
  displayName: string;
9
10
  } & {
10
- original: ((props: SidebarMenuItemGroupProps) => React.JSX.Element) & {
11
- original: (props: SidebarMenuItemGroupProps) => React.JSX.Element;
11
+ original: typeof SidebarMenuGroupBase & {
12
+ original: typeof SidebarMenuGroupBase;
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<((props: SidebarMenuItemGroupProps) => React.JSX.Element) & {
19
- original: (props: SidebarMenuItemGroupProps) => React.JSX.Element;
19
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof SidebarMenuGroupBase & {
20
+ original: typeof SidebarMenuGroupBase;
20
21
  originalName: string;
21
22
  displayName: string;
22
23
  }>) => (props: unknown) => React.JSX.Element;
@@ -40,6 +41,6 @@ declare const SidebarMenuGroup: ((props: SidebarMenuItemGroupProps) => React.JSX
40
41
  displayName: string;
41
42
  }>) => (props: unknown) => React.JSX.Element;
42
43
  };
43
- Action: ({ element, showOnHover, className, ...props }: SidebarMenuItemActionProps) => React.JSX.Element | null;
44
+ Action: typeof SidebarMenuItemAction;
44
45
  };
45
46
  export { SidebarMenuGroup, type SidebarMenuItemGroupProps, type SidebarMenuItemIconProps, type SidebarMenuItemActionProps };
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { type SidebarMenuItemIconProps } from "./SidebarMenuItemIcon.js";
3
- import { type SidebarMenuItemActionProps } from "./SidebarMenuItemAction.js";
4
- import { type SidebarMenuItemBadgeProps } from "./SidebarMenuItemBadge.js";
3
+ import { SidebarMenuItemAction, type SidebarMenuItemActionProps } from "./SidebarMenuItemAction.js";
4
+ import { SidebarMenuItemBadge, type SidebarMenuItemBadgeProps } from "./SidebarMenuItemBadge.js";
5
5
  import { LinkProps } from "../../../index.js";
6
6
  export interface SidebarMenuItemBaseProps {
7
7
  text: React.ReactNode;
@@ -26,21 +26,22 @@ type SidebarMenuItemButtonProps = SidebarMenuItemBaseProps & {
26
26
  type SidebarMenuItemGroupProps = SidebarMenuItemButtonProps;
27
27
  type SidebarMenuItemLinkProps = SidebarMenuItemBaseProps & LinkProps;
28
28
  type SidebarMenuItemProps = SidebarMenuItemButtonProps | SidebarMenuItemLinkProps;
29
- declare const SidebarMenuItem: ((props: SidebarMenuItemProps) => React.JSX.Element) & {
30
- original: (props: SidebarMenuItemProps) => React.JSX.Element;
29
+ declare const SidebarMenuItemBase: (props: SidebarMenuItemProps) => React.JSX.Element;
30
+ declare const SidebarMenuItem: typeof SidebarMenuItemBase & {
31
+ original: typeof SidebarMenuItemBase;
31
32
  originalName: string;
32
33
  displayName: string;
33
34
  } & {
34
- original: ((props: SidebarMenuItemProps) => React.JSX.Element) & {
35
- original: (props: SidebarMenuItemProps) => React.JSX.Element;
35
+ original: typeof SidebarMenuItemBase & {
36
+ original: typeof SidebarMenuItemBase;
36
37
  originalName: string;
37
38
  displayName: string;
38
39
  };
39
40
  originalName: string;
40
41
  displayName: string;
41
42
  } & {
42
- createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<((props: SidebarMenuItemProps) => React.JSX.Element) & {
43
- original: (props: SidebarMenuItemProps) => React.JSX.Element;
43
+ createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof SidebarMenuItemBase & {
44
+ original: typeof SidebarMenuItemBase;
44
45
  originalName: string;
45
46
  displayName: string;
46
47
  }>) => (props: unknown) => React.JSX.Element;
@@ -64,7 +65,7 @@ declare const SidebarMenuItem: ((props: SidebarMenuItemProps) => React.JSX.Eleme
64
65
  displayName: string;
65
66
  }>) => (props: unknown) => React.JSX.Element;
66
67
  };
67
- Action: ({ element, showOnHover, className, ...props }: SidebarMenuItemActionProps) => React.JSX.Element | null;
68
- Badge: ({ text }: SidebarMenuItemBadgeProps) => React.JSX.Element;
68
+ Action: typeof SidebarMenuItemAction;
69
+ Badge: typeof SidebarMenuItemBadge;
69
70
  };
70
71
  export { SidebarMenuItem, type SidebarMenuItemProps, type SidebarMenuItemButtonProps, type SidebarMenuItemLinkProps, type SidebarMenuItemGroupProps, type SidebarMenuItemIconProps, type SidebarMenuItemActionProps, type SidebarMenuItemBadgeProps };
@@ -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 };
@@ -1,5 +1,5 @@
1
1
  import react from "react";
2
- import { cn, cva } from "../../../utils.js";
2
+ import { cva } from "../../../utils.js";
3
3
  import { DivButton } from "./DivButton.js";
4
4
  import { SidebarMenuItemBadge } from "./SidebarMenuItemBadge.js";
5
5
  import { useAdminUi } from "../../../index.js";
@@ -35,28 +35,25 @@ const SidebarMenuSubButton = ({ onClick, variant, active, disabled, icon, pinned
35
35
  className: variants({
36
36
  variant,
37
37
  disabled,
38
- className: cn(className, action && "pr-xl")
38
+ className
39
39
  }),
40
40
  onClick
41
41
  };
42
- const textContent = /*#__PURE__*/ react.createElement("span", {
43
- className: "truncate"
44
- }, text);
45
42
  const content = to ? /*#__PURE__*/ react.createElement(LinkComponent, {
46
43
  ...sharedProps,
47
44
  to: to,
48
45
  ...linkProps
49
- }, icon, textContent, badge && ("string" == typeof badge ? /*#__PURE__*/ react.createElement(SidebarMenuItemBadge, {
46
+ }, icon, text, badge && ("string" == typeof badge ? /*#__PURE__*/ react.createElement(SidebarMenuItemBadge, {
50
47
  text: badge
51
48
  }) : badge)) : /*#__PURE__*/ react.createElement(DivButton, {
52
49
  ...sharedProps,
53
50
  disabled: disabled,
54
51
  tabIndex: "group-label" === variant ? -1 : void 0
55
- }, icon, textContent, badge && ("string" == typeof badge ? /*#__PURE__*/ react.createElement(SidebarMenuItemBadge, {
52
+ }, icon, text, badge && ("string" == typeof badge ? /*#__PURE__*/ react.createElement(SidebarMenuItemBadge, {
56
53
  text: badge
57
54
  }) : badge));
58
55
  return /*#__PURE__*/ react.createElement("div", {
59
- className: "flex items-center w-full min-w-0 relative group/menu-sub-button"
56
+ className: "flex items-center w-full relative group/menu-sub-button"
60
57
  }, content, action && /*#__PURE__*/ react.createElement("div", {
61
58
  className: "absolute top-0 right-0 mr-sm h-full flex items-center"
62
59
  }, action));
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar/components/items/SidebarMenuSubButton.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuSubButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, cva } from \"~/utils.js\";\nimport type { SidebarMenuItemProps } from \"./SidebarMenuRootItem.js\";\nimport { DivButton } from \"./DivButton.js\";\nimport { SidebarMenuItemBadge } from \"./SidebarMenuItemBadge.js\";\nimport { DistributedOmit } from \"type-fest\";\nimport { useAdminUi } from \"~/index.js\";\n\nconst variants = cva(\n [\n \"flex w-full cursor-pointer items-center gap-sm\",\n \"text-md text-neutral-primary no-underline!\",\n \"rounded-md p-xs-plus pr-sm outline-none\",\n \"whitespace-nowrap overflow-hidden\",\n \"hover:bg-neutral-dark/5\",\n \"group-hover/menu-sub-button:bg-neutral-dark/5\",\n \"focus:bg-neutral-dark/5 focus:ring-none focus:ring-transparent\",\n \"data-[active=true]:bg-neutral-dark/5 data-[active=true]:font-semibold data-[active=true]:pointer-events-none\",\n \"group-data-[state=collapsed]:hidden\"\n ],\n {\n variants: {\n variant: {\n \"group-label\": [\n \"uppercase font-semibold text-neutral-muted! text-sm\",\n \"pt-md pb-xs-plus pointer-events-none\",\n \"hover:bg-transparent! group-hover/menu-sub-button:bg-transparent! focus:bg-transparent! cursor-default!\"\n ]\n },\n disabled: {\n true: \"pointer-events-none text-neutral-disabled!\"\n }\n }\n }\n);\n\ntype SidebarMenuSubButtonProps = DistributedOmit<SidebarMenuItemProps, \"children\">;\n\nconst SidebarMenuSubButton = ({\n onClick,\n variant,\n active,\n disabled,\n icon,\n\n // oxlint-disable-next-line\n pinnedIcon,\n\n action,\n text,\n badge,\n className,\n to,\n ...linkProps\n}: SidebarMenuSubButtonProps) => {\n const { linkComponent: LinkComponent } = useAdminUi();\n\n const sharedProps = {\n \"data-sidebar\": \"menu-sub-button\",\n \"data-active\": active,\n className: variants({ variant, disabled, className: cn(className, action && \"pr-xl\") }),\n onClick\n };\n\n const textContent = <span className=\"truncate\">{text}</span>;\n\n const content = to ? (\n <LinkComponent {...sharedProps} to={to} {...linkProps}>\n {icon}\n {textContent}\n {badge && (typeof badge === \"string\" ? <SidebarMenuItemBadge text={badge} /> : badge)}\n </LinkComponent>\n ) : (\n // We can't use the default button element here because the content of the button\n // can also contain a button, which is not allowed in HTML.\n <DivButton\n {...sharedProps}\n disabled={disabled}\n tabIndex={variant === \"group-label\" ? -1 : undefined}\n >\n {icon}\n {textContent}\n {badge && (typeof badge === \"string\" ? <SidebarMenuItemBadge text={badge} /> : badge)}\n </DivButton>\n );\n\n return (\n <div className={\"flex items-center w-full min-w-0 relative group/menu-sub-button\"}>\n {content}\n\n {action && (\n <div className=\"absolute top-0 right-0 mr-sm h-full flex items-center\">\n {action}\n </div>\n )}\n </div>\n );\n};\n\nexport { SidebarMenuSubButton };\n"],"names":["variants","cva","SidebarMenuSubButton","onClick","variant","active","disabled","icon","pinnedIcon","action","text","badge","className","to","linkProps","LinkComponent","useAdminUi","sharedProps","cn","textContent","content","SidebarMenuItemBadge","DivButton","undefined"],"mappings":";;;;;AAQA,MAAMA,WAAWC,IACb;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH,EACD;IACI,UAAU;QACN,SAAS;YACL,eAAe;gBACX;gBACA;gBACA;aACH;QACL;QACA,UAAU;YACN,MAAM;QACV;IACJ;AACJ;AAKJ,MAAMC,uBAAuB,CAAC,EAC1BC,OAAO,EACPC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,IAAI,EAGJC,UAAU,EAEVC,MAAM,EACNC,IAAI,EACJC,KAAK,EACLC,SAAS,EACTC,EAAE,EACF,GAAGC,WACqB;IACxB,MAAM,EAAE,eAAeC,aAAa,EAAE,GAAGC;IAEzC,MAAMC,cAAc;QAChB,gBAAgB;QAChB,eAAeZ;QACf,WAAWL,SAAS;YAAEI;YAASE;YAAU,WAAWY,GAAGN,WAAWH,UAAU;QAAS;QACrFN;IACJ;IAEA,MAAMgB,cAAc,WAAdA,GAAc,oBAAC;QAAK,WAAU;OAAYT;IAEhD,MAAMU,UAAUP,KAAK,WAALA,GACZ,oBAACE,eAAAA;QAAe,GAAGE,WAAW;QAAE,IAAIJ;QAAK,GAAGC,SAAS;OAChDP,MACAY,aACAR,SAAU,CAAiB,YAAjB,OAAOA,QAAqB,WAAX,GAAW,oBAACU,sBAAoBA;QAAC,MAAMV;SAAYA,KAAI,K,cAKvF,oBAACW,WAASA;QACL,GAAGL,WAAW;QACf,UAAUX;QACV,UAAUF,AAAY,kBAAZA,UAA4B,KAAKmB;OAE1ChB,MACAY,aACAR,SAAU,CAAiB,YAAjB,OAAOA,QAAqB,WAAX,GAAW,oBAACU,sBAAoBA;QAAC,MAAMV;SAAYA,KAAI;IAI3F,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;OACXS,SAEAX,UAAU,WAAVA,GACG,oBAAC;QAAI,WAAU;OACVA;AAKrB"}
1
+ {"version":3,"file":"Sidebar/components/items/SidebarMenuSubButton.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuSubButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { cva } from \"~/utils.js\";\nimport type { SidebarMenuItemProps } from \"./SidebarMenuRootItem.js\";\nimport { DivButton } from \"./DivButton.js\";\nimport { SidebarMenuItemBadge } from \"./SidebarMenuItemBadge.js\";\nimport { DistributedOmit } from \"type-fest\";\nimport { useAdminUi } from \"~/index.js\";\n\nconst variants = cva(\n [\n \"flex w-full cursor-pointer items-center gap-sm\",\n \"text-md text-neutral-primary no-underline!\",\n \"rounded-md p-xs-plus pr-sm outline-none\",\n \"whitespace-nowrap overflow-hidden\",\n \"hover:bg-neutral-dark/5\",\n \"group-hover/menu-sub-button:bg-neutral-dark/5\",\n \"focus:bg-neutral-dark/5 focus:ring-none focus:ring-transparent\",\n \"data-[active=true]:bg-neutral-dark/5 data-[active=true]:font-semibold data-[active=true]:pointer-events-none\",\n \"group-data-[state=collapsed]:hidden\"\n ],\n {\n variants: {\n variant: {\n \"group-label\": [\n \"uppercase font-semibold text-neutral-muted! text-sm\",\n \"pt-md pb-xs-plus pointer-events-none\",\n \"hover:bg-transparent! group-hover/menu-sub-button:bg-transparent! focus:bg-transparent! cursor-default!\"\n ]\n },\n disabled: {\n true: \"pointer-events-none text-neutral-disabled!\"\n }\n }\n }\n);\n\ntype SidebarMenuSubButtonProps = DistributedOmit<SidebarMenuItemProps, \"children\">;\n\nconst SidebarMenuSubButton = ({\n onClick,\n variant,\n active,\n disabled,\n icon,\n\n // oxlint-disable-next-line\n pinnedIcon,\n\n action,\n text,\n badge,\n className,\n to,\n ...linkProps\n}: SidebarMenuSubButtonProps) => {\n const { linkComponent: LinkComponent } = useAdminUi();\n\n const sharedProps = {\n \"data-sidebar\": \"menu-sub-button\",\n \"data-active\": active,\n className: variants({ variant, disabled, className }),\n onClick\n };\n\n const content = to ? (\n <LinkComponent {...sharedProps} to={to} {...linkProps}>\n {icon}\n {text}\n {badge && (typeof badge === \"string\" ? <SidebarMenuItemBadge text={badge} /> : badge)}\n </LinkComponent>\n ) : (\n // We can't use the default button element here because the content of the button\n // can also contain a button, which is not allowed in HTML.\n <DivButton\n {...sharedProps}\n disabled={disabled}\n tabIndex={variant === \"group-label\" ? -1 : undefined}\n >\n {icon}\n {text}\n {badge && (typeof badge === \"string\" ? <SidebarMenuItemBadge text={badge} /> : badge)}\n </DivButton>\n );\n\n return (\n <div className={\"flex items-center w-full relative group/menu-sub-button\"}>\n {content}\n\n {action && (\n <div className=\"absolute top-0 right-0 mr-sm h-full flex items-center\">\n {action}\n </div>\n )}\n </div>\n );\n};\n\nexport { SidebarMenuSubButton };\n"],"names":["variants","cva","SidebarMenuSubButton","onClick","variant","active","disabled","icon","pinnedIcon","action","text","badge","className","to","linkProps","LinkComponent","useAdminUi","sharedProps","content","SidebarMenuItemBadge","DivButton","undefined"],"mappings":";;;;;AAQA,MAAMA,WAAWC,IACb;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH,EACD;IACI,UAAU;QACN,SAAS;YACL,eAAe;gBACX;gBACA;gBACA;aACH;QACL;QACA,UAAU;YACN,MAAM;QACV;IACJ;AACJ;AAKJ,MAAMC,uBAAuB,CAAC,EAC1BC,OAAO,EACPC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,IAAI,EAGJC,UAAU,EAEVC,MAAM,EACNC,IAAI,EACJC,KAAK,EACLC,SAAS,EACTC,EAAE,EACF,GAAGC,WACqB;IACxB,MAAM,EAAE,eAAeC,aAAa,EAAE,GAAGC;IAEzC,MAAMC,cAAc;QAChB,gBAAgB;QAChB,eAAeZ;QACf,WAAWL,SAAS;YAAEI;YAASE;YAAUM;QAAU;QACnDT;IACJ;IAEA,MAAMe,UAAUL,KAAK,WAALA,GACZ,oBAACE,eAAAA;QAAe,GAAGE,WAAW;QAAE,IAAIJ;QAAK,GAAGC,SAAS;OAChDP,MACAG,MACAC,SAAU,CAAiB,YAAjB,OAAOA,QAAqB,WAAX,GAAW,oBAACQ,sBAAoBA;QAAC,MAAMR;SAAYA,KAAI,K,cAKvF,oBAACS,WAASA;QACL,GAAGH,WAAW;QACf,UAAUX;QACV,UAAUF,AAAY,kBAAZA,UAA4B,KAAKiB;OAE1Cd,MACAG,MACAC,SAAU,CAAiB,YAAjB,OAAOA,QAAqB,WAAX,GAAW,oBAACQ,sBAAoBA;QAAC,MAAMR;SAAYA,KAAI;IAI3F,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;OACXO,SAEAT,UAAU,WAAVA,GACG,oBAAC;QAAI,WAAU;OACVA;AAKrB"}
@@ -117,7 +117,7 @@ const SidebarMenuSubItem = ({ children, className, pinnable, action, collapsible
117
117
  className: "flex items-center gap-xs"
118
118
  }, pinAction, chevron) : chevron;
119
119
  if (!collapsible) return /*#__PURE__*/ react.createElement("div", {
120
- className: "flex items-center min-w-0"
120
+ className: "flex items-center"
121
121
  }, /*#__PURE__*/ react.createElement(SidebarMenuSubItemIndentation, {
122
122
  lvl: currentLevel,
123
123
  variant: buttonProps.variant
@@ -127,7 +127,7 @@ const SidebarMenuSubItem = ({ children, className, pinnable, action, collapsible
127
127
  open: isSectionExpanded,
128
128
  onOpenChange: toggleSectionExpanded
129
129
  }, /*#__PURE__*/ react.createElement("div", {
130
- className: "flex items-center min-w-0"
130
+ className: "flex items-center"
131
131
  }, /*#__PURE__*/ react.createElement(SidebarMenuSubItemIndentation, {
132
132
  lvl: currentLevel,
133
133
  variant: buttonProps.variant
@@ -153,7 +153,7 @@ const SidebarMenuSubItem = ({ children, className, pinnable, action, collapsible
153
153
  ]);
154
154
  return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement("li", {
155
155
  "data-sidebar": "menu-sub-item",
156
- className: cn("group/menu-sub-item relative flex min-w-0", className)
156
+ className: cn("group/menu-sub-item relative flex", className)
157
157
  }, sidebarMenuSubButton), children && !collapsible ? children : null);
158
158
  };
159
159
  export { SidebarMenuSubItem };
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar/components/items/SidebarMenuSubItem.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuSubItem.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { cn } from \"~/utils.js\";\nimport { Collapsible } from \"radix-ui\";\nimport { SidebarMenuSubButton } from \"./SidebarMenuSubButton.js\";\nimport { SidebarMenuSubItemIndentation } from \"./SidebarMenuSubItemIndentation.js\";\nimport { SidebarMenuSub } from \"./SidebarMenuSub.js\";\nimport { Icon } from \"~/Icon/index.js\";\nimport { ReactComponent as KeyboardArrowRightIcon } from \"@webiny/icons/keyboard_arrow_down.svg\";\nimport { ReactComponent as PinIcon } from \"@webiny/icons/push_pin.svg\";\nimport { ReactComponent as UnPinIcon } from \"@webiny/icons/push_pin_off.svg\";\nimport { useSidebarMenu } from \"./SidebarMenuProvider.js\";\nimport { type SidebarMenuItemProps } from \"./SidebarMenuItem.js\";\nimport { useSidebar } from \"~/Sidebar/index.js\";\nimport { SidebarMenuItemAction } from \"./SidebarMenuItemAction.js\";\n\nconst SidebarMenuSubItem = ({\n children,\n className,\n pinnable,\n action,\n collapsible = true,\n ...buttonProps\n}: SidebarMenuItemProps) => {\n const { currentLevel, parentIcon } = useSidebarMenu();\n const sidebar = useSidebar();\n const [showChevron, setShowChevron] = useState(false);\n\n const menuItemId = useMemo(() => {\n return btoa(`sidebar-item-${currentLevel}-${buttonProps.text}`);\n }, [buttonProps.text, currentLevel]);\n\n const isSectionExpanded = useMemo(() => {\n return sidebar.isSectionExpanded(menuItemId);\n }, [sidebar.expandedSections]);\n\n const toggleSectionExpanded = useCallback(() => {\n sidebar.toggleSectionExpanded(menuItemId);\n }, [isSectionExpanded]);\n\n const isPinned = sidebar.isItemPinned(menuItemId);\n\n // Icon to use when this item is pinned\n const pinnedItemIcon = useMemo(() => {\n if (buttonProps.pinnedIcon) {\n return buttonProps.pinnedIcon;\n }\n\n return buttonProps.icon || parentIcon;\n }, [buttonProps.pinnedIcon, buttonProps.icon, parentIcon]);\n\n // Register when pinned, unregister when unpinned\n // Re-register when active state changes to keep pinned items in sync\n React.useEffect(() => {\n if (pinnable && isPinned) {\n sidebar.registerPinnedItem({\n id: menuItemId,\n text: buttonProps.text,\n icon: pinnedItemIcon,\n to: buttonProps.to,\n onClick: buttonProps.onClick,\n active: buttonProps.active\n });\n } else if (pinnable && !isPinned) {\n // Only unregister if this item is explicitly unpinned\n sidebar.unregisterPinnedItem(menuItemId);\n }\n }, [pinnable, isPinned, pinnedItemIcon, menuItemId, buttonProps.active]);\n\n const pinAction = useMemo(() => {\n if (!pinnable) {\n return action;\n }\n\n const handlePinClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n e.preventDefault();\n\n if (isPinned) {\n sidebar.unregisterPinnedItem(menuItemId);\n } else {\n sidebar.registerPinnedItem({\n id: menuItemId,\n text: buttonProps.text,\n icon: pinnedItemIcon,\n to: buttonProps.to,\n onClick: buttonProps.onClick,\n active: buttonProps.active\n });\n }\n\n sidebar.toggleItemPinned(menuItemId);\n };\n\n const pinButton = (\n <SidebarMenuItemAction\n element={isPinned ? <UnPinIcon /> : <PinIcon />}\n onClick={handlePinClick}\n showOnHover={true}\n />\n );\n\n // If there's a custom action, combine them\n // Don't modify the custom action - it should keep its original behavior\n if (action) {\n return (\n <div className=\"flex items-center gap-xs\">\n {pinButton}\n {action}\n </div>\n );\n }\n\n return pinButton;\n }, [pinnable, isPinned, pinnedItemIcon, action, sidebar, menuItemId]);\n\n useEffect(() => {\n if (sidebar.expanded) {\n const timer = setTimeout(() => {\n setShowChevron(true);\n }, 100);\n return () => clearTimeout(timer);\n }\n setShowChevron(false);\n return undefined;\n }, [sidebar.expanded]);\n\n const sidebarMenuSubButton = useMemo(() => {\n if (!children) {\n return (\n <>\n <SidebarMenuSubItemIndentation\n lvl={currentLevel}\n variant={buttonProps.variant}\n />\n <SidebarMenuSubButton {...buttonProps} action={pinAction} />\n </>\n );\n }\n\n const chevron = showChevron ? (\n <Icon\n label={\"Expand / Collapse\"}\n size={\"sm\"}\n className={\n \"ml-auto transition-transform duration-100 group-data-[state=open]/menu-sub-item-collapsible:rotate-180 group-data-[state=collapsed]:hidden\"\n }\n color={\"neutral-strong\"}\n data-sidebar={\"menu-item-expanded-indicator\"}\n icon={<KeyboardArrowRightIcon />}\n />\n ) : null;\n\n const collapsibleAction = pinnable ? (\n <div className=\"flex items-center gap-xs\">\n {pinAction}\n {chevron}\n </div>\n ) : (\n chevron\n );\n\n if (!collapsible) {\n return (\n <div className={\"flex items-center min-w-0\"}>\n <SidebarMenuSubItemIndentation\n lvl={currentLevel}\n variant={buttonProps.variant}\n />\n <SidebarMenuSubButton {...buttonProps} />\n </div>\n );\n }\n\n return (\n <Collapsible.Root\n className=\"w-full group/menu-sub-item-collapsible\"\n open={isSectionExpanded}\n onOpenChange={toggleSectionExpanded}\n >\n <div className={\"flex items-center min-w-0\"}>\n <SidebarMenuSubItemIndentation\n lvl={currentLevel}\n variant={buttonProps.variant}\n />\n <Collapsible.Trigger asChild>\n <SidebarMenuSubButton\n {...buttonProps}\n action={collapsibleAction}\n className={\n \"group-data-[state=open]/menu-sub-item-collapsible:font-semibold!\"\n }\n />\n </Collapsible.Trigger>\n </div>\n <Collapsible.Content>\n <SidebarMenuSub parentIcon={buttonProps.icon}>{children}</SidebarMenuSub>\n </Collapsible.Content>\n </Collapsible.Root>\n );\n }, [\n children,\n buttonProps,\n currentLevel,\n menuItemId,\n isSectionExpanded,\n toggleSectionExpanded,\n showChevron,\n pinnable,\n pinAction\n ]);\n\n return (\n <>\n <li\n data-sidebar=\"menu-sub-item\"\n className={cn(\"group/menu-sub-item relative flex min-w-0\", className)}\n >\n {sidebarMenuSubButton}\n </li>\n {children && !collapsible ? children : null}\n </>\n );\n};\n\nexport { SidebarMenuSubItem };\n"],"names":["SidebarMenuSubItem","children","className","pinnable","action","collapsible","buttonProps","currentLevel","parentIcon","useSidebarMenu","sidebar","useSidebar","showChevron","setShowChevron","useState","menuItemId","useMemo","btoa","isSectionExpanded","toggleSectionExpanded","useCallback","isPinned","pinnedItemIcon","React","pinAction","handlePinClick","e","pinButton","SidebarMenuItemAction","UnPinIcon","PinIcon","useEffect","timer","setTimeout","clearTimeout","sidebarMenuSubButton","SidebarMenuSubItemIndentation","SidebarMenuSubButton","chevron","Icon","KeyboardArrowRightIcon","collapsibleAction","Collapsible","SidebarMenuSub","cn"],"mappings":"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"}
1
+ {"version":3,"file":"Sidebar/components/items/SidebarMenuSubItem.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuSubItem.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { cn } from \"~/utils.js\";\nimport { Collapsible } from \"radix-ui\";\nimport { SidebarMenuSubButton } from \"./SidebarMenuSubButton.js\";\nimport { SidebarMenuSubItemIndentation } from \"./SidebarMenuSubItemIndentation.js\";\nimport { SidebarMenuSub } from \"./SidebarMenuSub.js\";\nimport { Icon } from \"~/Icon/index.js\";\nimport { ReactComponent as KeyboardArrowRightIcon } from \"@webiny/icons/keyboard_arrow_down.svg\";\nimport { ReactComponent as PinIcon } from \"@webiny/icons/push_pin.svg\";\nimport { ReactComponent as UnPinIcon } from \"@webiny/icons/push_pin_off.svg\";\nimport { useSidebarMenu } from \"./SidebarMenuProvider.js\";\nimport { type SidebarMenuItemProps } from \"./SidebarMenuItem.js\";\nimport { useSidebar } from \"~/Sidebar/index.js\";\nimport { SidebarMenuItemAction } from \"./SidebarMenuItemAction.js\";\n\nconst SidebarMenuSubItem = ({\n children,\n className,\n pinnable,\n action,\n collapsible = true,\n ...buttonProps\n}: SidebarMenuItemProps) => {\n const { currentLevel, parentIcon } = useSidebarMenu();\n const sidebar = useSidebar();\n const [showChevron, setShowChevron] = useState(false);\n\n const menuItemId = useMemo(() => {\n return btoa(`sidebar-item-${currentLevel}-${buttonProps.text}`);\n }, [buttonProps.text, currentLevel]);\n\n const isSectionExpanded = useMemo(() => {\n return sidebar.isSectionExpanded(menuItemId);\n }, [sidebar.expandedSections]);\n\n const toggleSectionExpanded = useCallback(() => {\n sidebar.toggleSectionExpanded(menuItemId);\n }, [isSectionExpanded]);\n\n const isPinned = sidebar.isItemPinned(menuItemId);\n\n // Icon to use when this item is pinned\n const pinnedItemIcon = useMemo(() => {\n if (buttonProps.pinnedIcon) {\n return buttonProps.pinnedIcon;\n }\n\n return buttonProps.icon || parentIcon;\n }, [buttonProps.pinnedIcon, buttonProps.icon, parentIcon]);\n\n // Register when pinned, unregister when unpinned\n // Re-register when active state changes to keep pinned items in sync\n React.useEffect(() => {\n if (pinnable && isPinned) {\n sidebar.registerPinnedItem({\n id: menuItemId,\n text: buttonProps.text,\n icon: pinnedItemIcon,\n to: buttonProps.to,\n onClick: buttonProps.onClick,\n active: buttonProps.active\n });\n } else if (pinnable && !isPinned) {\n // Only unregister if this item is explicitly unpinned\n sidebar.unregisterPinnedItem(menuItemId);\n }\n }, [pinnable, isPinned, pinnedItemIcon, menuItemId, buttonProps.active]);\n\n const pinAction = useMemo(() => {\n if (!pinnable) {\n return action;\n }\n\n const handlePinClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n e.preventDefault();\n\n if (isPinned) {\n sidebar.unregisterPinnedItem(menuItemId);\n } else {\n sidebar.registerPinnedItem({\n id: menuItemId,\n text: buttonProps.text,\n icon: pinnedItemIcon,\n to: buttonProps.to,\n onClick: buttonProps.onClick,\n active: buttonProps.active\n });\n }\n\n sidebar.toggleItemPinned(menuItemId);\n };\n\n const pinButton = (\n <SidebarMenuItemAction\n element={isPinned ? <UnPinIcon /> : <PinIcon />}\n onClick={handlePinClick}\n showOnHover={true}\n />\n );\n\n // If there's a custom action, combine them\n // Don't modify the custom action - it should keep its original behavior\n if (action) {\n return (\n <div className=\"flex items-center gap-xs\">\n {pinButton}\n {action}\n </div>\n );\n }\n\n return pinButton;\n }, [pinnable, isPinned, pinnedItemIcon, action, sidebar, menuItemId]);\n\n useEffect(() => {\n if (sidebar.expanded) {\n const timer = setTimeout(() => {\n setShowChevron(true);\n }, 100);\n return () => clearTimeout(timer);\n }\n setShowChevron(false);\n return undefined;\n }, [sidebar.expanded]);\n\n const sidebarMenuSubButton = useMemo(() => {\n if (!children) {\n return (\n <>\n <SidebarMenuSubItemIndentation\n lvl={currentLevel}\n variant={buttonProps.variant}\n />\n <SidebarMenuSubButton {...buttonProps} action={pinAction} />\n </>\n );\n }\n\n const chevron = showChevron ? (\n <Icon\n label={\"Expand / Collapse\"}\n size={\"sm\"}\n className={\n \"ml-auto transition-transform duration-100 group-data-[state=open]/menu-sub-item-collapsible:rotate-180 group-data-[state=collapsed]:hidden\"\n }\n color={\"neutral-strong\"}\n data-sidebar={\"menu-item-expanded-indicator\"}\n icon={<KeyboardArrowRightIcon />}\n />\n ) : null;\n\n const collapsibleAction = pinnable ? (\n <div className=\"flex items-center gap-xs\">\n {pinAction}\n {chevron}\n </div>\n ) : (\n chevron\n );\n\n if (!collapsible) {\n return (\n <div className={\"flex items-center\"}>\n <SidebarMenuSubItemIndentation\n lvl={currentLevel}\n variant={buttonProps.variant}\n />\n <SidebarMenuSubButton {...buttonProps} />\n </div>\n );\n }\n\n return (\n <Collapsible.Root\n className=\"w-full group/menu-sub-item-collapsible\"\n open={isSectionExpanded}\n onOpenChange={toggleSectionExpanded}\n >\n <div className={\"flex items-center\"}>\n <SidebarMenuSubItemIndentation\n lvl={currentLevel}\n variant={buttonProps.variant}\n />\n <Collapsible.Trigger asChild>\n <SidebarMenuSubButton\n {...buttonProps}\n action={collapsibleAction}\n className={\n \"group-data-[state=open]/menu-sub-item-collapsible:font-semibold!\"\n }\n />\n </Collapsible.Trigger>\n </div>\n <Collapsible.Content>\n <SidebarMenuSub parentIcon={buttonProps.icon}>{children}</SidebarMenuSub>\n </Collapsible.Content>\n </Collapsible.Root>\n );\n }, [\n children,\n buttonProps,\n currentLevel,\n menuItemId,\n isSectionExpanded,\n toggleSectionExpanded,\n showChevron,\n pinnable,\n pinAction\n ]);\n\n return (\n <>\n <li\n data-sidebar=\"menu-sub-item\"\n className={cn(\"group/menu-sub-item relative flex\", className)}\n >\n {sidebarMenuSubButton}\n </li>\n {children && !collapsible ? children : null}\n </>\n );\n};\n\nexport { SidebarMenuSubItem };\n"],"names":["SidebarMenuSubItem","children","className","pinnable","action","collapsible","buttonProps","currentLevel","parentIcon","useSidebarMenu","sidebar","useSidebar","showChevron","setShowChevron","useState","menuItemId","useMemo","btoa","isSectionExpanded","toggleSectionExpanded","useCallback","isPinned","pinnedItemIcon","React","pinAction","handlePinClick","e","pinButton","SidebarMenuItemAction","UnPinIcon","PinIcon","useEffect","timer","setTimeout","clearTimeout","sidebarMenuSubButton","SidebarMenuSubItemIndentation","SidebarMenuSubButton","chevron","Icon","KeyboardArrowRightIcon","collapsibleAction","Collapsible","SidebarMenuSub","cn"],"mappings":"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"}
@@ -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"}