@webiny/admin-ui 0.0.0-unstable.7be00a75a9 → 0.0.0-unstable.7c2def32a7
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.
- package/Accordion/Accordion.d.ts +7 -6
- package/Accordion/Accordion.stories.d.ts +1 -1
- package/Accordion/Accordion.stories.js.map +1 -1
- package/Accordion/components/AccordionContent.js +4 -1
- package/Accordion/components/AccordionContent.js.map +1 -1
- package/Accordion/components/AccordionItem.d.ts +8 -6
- package/Accordion/components/AccordionItem.js.map +1 -1
- package/Accordion/components/AccordionItemAction.d.ts +7 -6
- package/Accordion/components/AccordionItemDragHandle.d.ts +2 -1
- package/Accordion/components/AccordionItemDragHandle.js +2 -1
- package/Accordion/components/AccordionItemDragHandle.js.map +1 -1
- package/Accordion/components/AccordionItemIcon.d.ts +7 -6
- package/Accordion/components/AccordionItemSeparator.d.ts +7 -6
- package/Accordion/components/AccordionTrigger.js +4 -2
- package/Accordion/components/AccordionTrigger.js.map +1 -1
- package/Alert/Alert.d.ts +21 -19
- package/Alert/Alert.stories.d.ts +1 -1
- package/Alert/Alert.stories.js.map +1 -1
- package/AutoComplete/AutoComplete.d.ts +7 -6
- package/AutoComplete/AutoComplete.stories.d.ts +1 -1
- package/AutoComplete/AutoComplete.stories.js.map +1 -1
- package/AutoComplete/primitives/AutoCompletePrimitive.d.ts +13 -6
- package/AutoComplete/primitives/AutoCompletePrimitive.js +1 -0
- package/AutoComplete/primitives/AutoCompletePrimitive.js.map +1 -1
- package/AutoComplete/primitives/AutoCompletePrimitive.stories.d.ts +1 -1
- package/AutoComplete/primitives/AutoCompletePrimitive.stories.js.map +1 -1
- package/Avatar/Avatar.d.ts +9 -8
- package/Avatar/Avatar.stories.d.ts +1 -1
- package/Avatar/Avatar.stories.js.map +1 -1
- package/Avatar/components/AvatarFallback.d.ts +7 -6
- package/Avatar/components/AvatarImage.d.ts +7 -6
- package/BetaBadge/BetaBadge.d.ts +6 -0
- package/BetaBadge/BetaBadge.js +7 -0
- package/BetaBadge/BetaBadge.js.map +1 -0
- package/Breadcrumbs/Breadcrumbs.d.ts +54 -0
- package/Breadcrumbs/Breadcrumbs.js +66 -0
- package/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/Breadcrumbs/Breadcrumbs.stories.d.ts +9 -0
- package/Breadcrumbs/Breadcrumbs.stories.js +71 -0
- package/Breadcrumbs/Breadcrumbs.stories.js.map +1 -0
- package/Breadcrumbs/index.d.ts +1 -0
- package/Breadcrumbs/index.js +1 -0
- package/Button/Button.d.ts +10 -9
- package/Button/Button.js +7 -0
- package/Button/Button.js.map +1 -1
- package/Button/Button.mdx +13 -0
- package/Button/Button.stories.d.ts +2 -1
- package/Button/Button.stories.js +9 -2
- package/Button/Button.stories.js.map +1 -1
- package/Button/CopyButton.d.ts +7 -6
- package/Button/IconButton.d.ts +10 -9
- package/Button/IconButton.stories.d.ts +1 -1
- package/Button/IconButton.stories.js.map +1 -1
- package/Calendar/Calendar.d.ts +7 -6
- package/Calendar/calendarClassNames.js +1 -1
- package/Calendar/calendarClassNames.js.map +1 -1
- package/Card/Card.d.ts +8 -22
- package/Card/Card.stories.d.ts +1 -1
- package/Card/Card.stories.js.map +1 -1
- package/Card/components/CancelAction.d.ts +8 -6
- package/Card/components/CardContent.d.ts +6 -6
- package/Card/components/CardTitle.d.ts +2 -2
- package/Card/components/ConfirmAction.d.ts +8 -6
- package/Card/components/Icon.d.ts +7 -6
- package/Checkbox/Checkbox.d.ts +7 -6
- package/Checkbox/Checkbox.stories.d.ts +1 -1
- package/Checkbox/Checkbox.stories.js.map +1 -1
- package/Checkbox/primitives/CheckboxPrimitive.d.ts +17 -12
- package/Checkbox/primitives/CheckboxPrimitive.stories.d.ts +1 -1
- package/Checkbox/primitives/CheckboxPrimitive.stories.js.map +1 -1
- package/CheckboxGroup/CheckboxGroup.d.ts +7 -6
- package/CheckboxGroup/CheckboxGroup.stories.d.ts +1 -1
- package/CheckboxGroup/CheckboxGroup.stories.js.map +1 -1
- package/CheckboxGroup/primitives/CheckboxGroupPrimitive.d.ts +20 -12
- package/CheckboxGroup/primitives/CheckboxGroupPrimitive.stories.d.ts +1 -1
- package/CheckboxGroup/primitives/CheckboxGroupPrimitive.stories.js.map +1 -1
- package/CodeEditor/CodeEditor.d.ts +7 -6
- package/CodeEditor/CodeEditor.stories.d.ts +1 -1
- package/CodeEditor/CodeEditor.stories.js.map +1 -1
- package/CodeEditor/CodeEditorPrimitive.d.ts +7 -6
- package/CodeEditor/CodeEditorPrimitive.js +3 -1
- package/CodeEditor/CodeEditorPrimitive.js.map +1 -1
- package/CodeEditor/CodeEditorPrimitive.stories.d.ts +1 -1
- package/CodeEditor/CodeEditorPrimitive.stories.js.map +1 -1
- package/ColorPicker/ColorPicker.d.ts +7 -6
- package/ColorPicker/ColorPicker.stories.d.ts +1 -1
- package/ColorPicker/ColorPicker.stories.js.map +1 -1
- package/ColorPicker/primitives/ColorPickerPrimitive.d.ts +7 -6
- package/ColorPicker/primitives/ColorPickerPrimitive.stories.d.ts +1 -1
- package/ColorPicker/primitives/ColorPickerPrimitive.stories.js.map +1 -1
- package/Command/Command.d.ts +10 -8
- package/Command/components/List.d.ts +1 -1
- package/Command/components/List.js +9 -5
- package/Command/components/List.js.map +1 -1
- package/DataList/DataListModal.d.ts +6 -3
- package/DataTable/DataTable.d.ts +23 -12
- package/DataTable/DataTable.js +18 -7
- package/DataTable/DataTable.js.map +1 -1
- package/DataTable/DataTable.stories.d.ts +1 -1
- package/DataTable/DataTable.stories.js.map +1 -1
- package/DataTable/components/ColumnsVisibility.d.ts +5 -4
- package/DataTable/components/ColumnsVisibility.js +7 -3
- package/DataTable/components/ColumnsVisibility.js.map +1 -1
- package/DatePicker/DatePicker.d.ts +11 -7
- package/DatePicker/DatePicker.js +10 -2
- package/DatePicker/DatePicker.js.map +1 -1
- package/DatePicker/DatePicker.stories.d.ts +11 -1
- package/DatePicker/DatePicker.stories.js +44 -1
- package/DatePicker/DatePicker.stories.js.map +1 -1
- package/DatePicker/primitives/BirthdayPicker.d.ts +13 -0
- package/DatePicker/primitives/BirthdayPicker.js +355 -0
- package/DatePicker/primitives/BirthdayPicker.js.map +1 -0
- package/DatePicker/primitives/BirthdayPickerCell.d.ts +14 -0
- package/DatePicker/primitives/BirthdayPickerCell.js +19 -0
- package/DatePicker/primitives/BirthdayPickerCell.js.map +1 -0
- package/DatePicker/primitives/BirthdayPickerSegments.d.ts +9 -0
- package/DatePicker/primitives/BirthdayPickerSegments.js +43 -0
- package/DatePicker/primitives/BirthdayPickerSegments.js.map +1 -0
- package/DatePicker/primitives/DateOnlyPicker.js +2 -2
- package/DatePicker/primitives/DateOnlyPicker.js.map +1 -1
- package/DatePicker/primitives/DatePickerPrimitive.d.ts +7 -6
- package/DatePicker/primitives/DatePickerPrimitive.js +3 -0
- package/DatePicker/primitives/DatePickerPrimitive.js.map +1 -1
- package/DatePicker/primitives/DateRangePicker.js +3 -3
- package/DatePicker/primitives/DateRangePicker.js.map +1 -1
- package/DatePicker/primitives/DateTimePicker.d.ts +1 -1
- package/DatePicker/primitives/DateTimePicker.js +26 -18
- package/DatePicker/primitives/DateTimePicker.js.map +1 -1
- package/DatePicker/primitives/MultipleDatesPicker.js +3 -3
- package/DatePicker/primitives/MultipleDatesPicker.js.map +1 -1
- package/DatePicker/primitives/components/DatePickerTrigger.js +2 -2
- package/DatePicker/primitives/components/DatePickerTrigger.js.map +1 -1
- package/DatePicker/utils/birthdayHelpers.d.ts +77 -0
- package/DatePicker/utils/birthdayHelpers.js +145 -0
- package/DatePicker/utils/birthdayHelpers.js.map +1 -0
- package/DatePicker/utils/birthdayHelpers.test.d.ts +1 -0
- package/DatePicker/utils/birthdayHelpers.test.js +394 -0
- package/DatePicker/utils/birthdayHelpers.test.js.map +1 -0
- package/DatePicker/utils/dateHelpers.d.ts +6 -1
- package/DatePicker/utils/dateHelpers.js +13 -5
- package/DatePicker/utils/dateHelpers.js.map +1 -1
- package/DatePicker/utils/dateHelpers.test.d.ts +1 -0
- package/DatePicker/utils/dateHelpers.test.js +32 -0
- package/DatePicker/utils/dateHelpers.test.js.map +1 -0
- package/DatePicker/utils/index.d.ts +1 -0
- package/DatePicker/utils/index.js +1 -0
- package/DatePicker/utils/timezoneHelpers.d.ts +3 -0
- package/DatePicker/utils/timezoneHelpers.js +32 -0
- package/DatePicker/utils/timezoneHelpers.js.map +1 -0
- package/DatePicker/utils/types.d.ts +15 -2
- package/Dialog/Dialog.d.ts +8 -22
- package/Dialog/Dialog.stories.d.ts +1 -1
- package/Dialog/Dialog.stories.js.map +1 -1
- package/Dialog/components/CancelAction.d.ts +8 -6
- package/Dialog/components/ConfirmAction.d.ts +8 -6
- package/Dialog/components/DialogContent.d.ts +1 -1
- package/Dialog/components/DialogFooter.d.ts +1 -1
- package/Dialog/components/DialogTitle.d.ts +1 -1
- package/Dialog/components/Icon.d.ts +7 -6
- package/DragCursor/DragCursor.d.ts +7 -0
- package/DragCursor/DragCursor.js +21 -0
- package/DragCursor/DragCursor.js.map +1 -0
- package/DragCursor/DragCursor.stories.d.ts +10 -0
- package/DragCursor/DragCursor.stories.js +97 -0
- package/DragCursor/DragCursor.stories.js.map +1 -0
- package/DragCursor/index.d.ts +1 -0
- package/DragCursor/index.js +1 -0
- package/Drawer/Drawer.d.ts +18 -28
- package/Drawer/Drawer.js +2 -1
- package/Drawer/Drawer.js.map +1 -1
- package/Drawer/Drawer.stories.d.ts +2 -1
- package/Drawer/Drawer.stories.js +21 -2
- package/Drawer/Drawer.stories.js.map +1 -1
- package/Drawer/components/CancelButton.d.ts +8 -6
- package/Drawer/components/ConfirmButton.d.ts +8 -6
- package/Drawer/components/DrawerContent.d.ts +1 -1
- package/Drawer/components/DrawerHeader.d.ts +2 -2
- package/Drawer/components/DrawerHeader.js +11 -8
- package/Drawer/components/DrawerHeader.js.map +1 -1
- package/Drawer/components/Icon.d.ts +7 -6
- package/Drawer/components/Icon.js +3 -4
- package/Drawer/components/Icon.js.map +1 -1
- package/DropdownMenu/DropdownMenu.stories.d.ts +1 -1
- package/DropdownMenu/DropdownMenu.stories.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuItem.d.ts +8 -2
- package/DropdownMenu/components/DropdownMenuItem.js +11 -3
- package/DropdownMenu/components/DropdownMenuItem.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuLink.d.ts +9 -8
- package/DropdownMenu/components/DropdownMenuSeparator.d.ts +7 -6
- package/EditableTitle/EditableTitle.d.ts +67 -0
- package/EditableTitle/EditableTitle.js +73 -0
- package/EditableTitle/EditableTitle.js.map +1 -0
- package/EditableTitle/index.d.ts +1 -0
- package/EditableTitle/index.js +1 -0
- package/EmptyState/EmptyState.d.ts +43 -0
- package/EmptyState/EmptyState.js +93 -0
- package/EmptyState/EmptyState.js.map +1 -0
- package/EmptyState/EmptyState.stories.d.ts +13 -0
- package/EmptyState/EmptyState.stories.js +136 -0
- package/EmptyState/EmptyState.stories.js.map +1 -0
- package/EmptyState/illustrations/ContentIllustration.d.ts +2 -0
- package/EmptyState/illustrations/ContentIllustration.js +100 -0
- package/EmptyState/illustrations/ContentIllustration.js.map +1 -0
- package/EmptyState/illustrations/LayoutIllustration.d.ts +2 -0
- package/EmptyState/illustrations/LayoutIllustration.js +93 -0
- package/EmptyState/illustrations/LayoutIllustration.js.map +1 -0
- package/EmptyState/illustrations/ListingIllustration.d.ts +2 -0
- package/EmptyState/illustrations/ListingIllustration.js +92 -0
- package/EmptyState/illustrations/ListingIllustration.js.map +1 -0
- package/EmptyState/illustrations/SelectIllustration.d.ts +2 -0
- package/EmptyState/illustrations/SelectIllustration.js +100 -0
- package/EmptyState/illustrations/SelectIllustration.js.map +1 -0
- package/EmptyState/illustrations/TableIllustration.d.ts +2 -0
- package/EmptyState/illustrations/TableIllustration.js +233 -0
- package/EmptyState/illustrations/TableIllustration.js.map +1 -0
- package/EmptyState/illustrations/UploadIllustration.d.ts +2 -0
- package/EmptyState/illustrations/UploadIllustration.js +77 -0
- package/EmptyState/illustrations/UploadIllustration.js.map +1 -0
- package/EmptyState/illustrations/index.d.ts +6 -0
- package/EmptyState/illustrations/index.js +6 -0
- package/EmptyState/index.d.ts +1 -0
- package/EmptyState/index.js +1 -0
- package/FilePicker/FilePicker.d.ts +19 -18
- package/FilePicker/FilePicker.stories.d.ts +7 -1
- package/FilePicker/FilePicker.stories.js +24 -1
- package/FilePicker/FilePicker.stories.js.map +1 -1
- package/FilePicker/primitives/FilePickerPrimitive.d.ts +20 -19
- package/FilePicker/primitives/FilePickerPrimitive.stories.d.ts +1 -1
- package/FilePicker/primitives/FilePickerPrimitive.stories.js.map +1 -1
- package/FilePicker/primitives/components/Trigger.d.ts +1 -1
- package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.d.ts +19 -7
- package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js +15 -6
- package/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js.map +1 -1
- package/FilePicker/primitives/components/previews/ItemActions.js +1 -1
- package/FilePicker/primitives/components/previews/ItemActions.js.map +1 -1
- package/FilePicker/primitives/components/previews/ItemDescription.js +1 -1
- package/FilePicker/primitives/components/previews/ItemDescription.js.map +1 -1
- package/FilePicker/primitives/components/previews/RichItemPreview/FileType.d.ts +5 -0
- package/FilePicker/primitives/components/previews/RichItemPreview/FileType.js +45 -0
- package/FilePicker/primitives/components/previews/RichItemPreview/FileType.js.map +1 -0
- package/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.d.ts +5 -0
- package/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.js +14 -0
- package/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.js.map +1 -0
- package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.d.ts +12 -6
- package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js +54 -12
- package/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js.map +1 -1
- package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.d.ts +11 -1
- package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.js +8 -61
- package/FilePicker/primitives/components/previews/RichItemPreview/RichItemThumbnail.js.map +1 -1
- package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.d.ts +11 -0
- package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.js +24 -0
- package/FilePicker/primitives/components/previews/RichItemPreview/Thumbnail.js.map +1 -0
- package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.d.ts +10 -0
- package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.js +46 -0
- package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.js.map +1 -0
- package/FilePicker/primitives/components/previews/TextOnlyPreview/TextOnlyPreview.d.ts +7 -6
- package/FilePicker/primitives/components/previews/TruncatedFileName.d.ts +7 -0
- package/FilePicker/primitives/components/previews/TruncatedFileName.js +20 -0
- package/FilePicker/primitives/components/previews/TruncatedFileName.js.map +1 -0
- package/FilePicker/primitives/components/previews/fileName.d.ts +4 -0
- package/FilePicker/primitives/components/previews/fileName.js +26 -0
- package/FilePicker/primitives/components/previews/fileName.js.map +1 -0
- package/FilePicker/primitives/components/previews/index.d.ts +1 -0
- package/FilePicker/primitives/components/previews/index.js +1 -0
- package/FilePicker/primitives/components/previews/variants.d.ts +1 -1
- package/FillViewport/FillViewport.d.ts +63 -0
- package/FillViewport/FillViewport.js +67 -0
- package/FillViewport/FillViewport.js.map +1 -0
- package/FillViewport/index.d.ts +1 -0
- package/FillViewport/index.js +1 -0
- package/FormComponent/Description.d.ts +7 -6
- package/FormComponent/ErrorMessage.d.ts +7 -6
- package/FormComponent/Label.d.ts +7 -6
- package/FormComponent/Note.d.ts +7 -6
- package/Grid/Grid.d.ts +25 -23
- package/Grid/Grid.js.map +1 -1
- package/Grid/Grid.stories.d.ts +1 -1
- package/Grid/Grid.stories.js.map +1 -1
- package/HeaderBar/HeaderBar.d.ts +7 -6
- package/HeaderBar/HeaderBar.stories.d.ts +1 -1
- package/HeaderBar/HeaderBar.stories.js.map +1 -1
- package/Heading/Heading.d.ts +8 -7
- package/Heading/Heading.stories.d.ts +1 -1
- package/Heading/Heading.stories.js.map +1 -1
- package/Icon/Icon.d.ts +9 -8
- package/Icon/Icon.stories.d.ts +1 -1
- package/Icon/Icon.stories.js.map +1 -1
- package/IconPicker/IconPicker.d.ts +7 -6
- package/IconPicker/IconPicker.stories.d.ts +1 -1
- package/IconPicker/IconPicker.stories.js.map +1 -1
- package/IconPicker/primitives/IconPickerPrimitive.d.ts +1 -1
- package/IconPicker/primitives/IconPickerPrimitive.js +1 -2
- package/IconPicker/primitives/IconPickerPrimitive.js.map +1 -1
- package/IconPicker/primitives/IconPickerPrimitive.stories.d.ts +1 -1
- package/IconPicker/primitives/IconPickerPrimitive.stories.js.map +1 -1
- package/IconPicker/primitives/components/IconPickerTrigger.d.ts +1 -1
- package/ImageEditor/AspectRatioPreview.d.ts +16 -0
- package/ImageEditor/AspectRatioPreview.js +26 -0
- package/ImageEditor/AspectRatioPreview.js.map +1 -0
- package/ImageEditor/CropHotspotEditor.d.ts +22 -0
- package/ImageEditor/CropHotspotEditor.js +402 -0
- package/ImageEditor/CropHotspotEditor.js.map +1 -0
- package/ImageEditor/ImageEditor.d.ts +18 -0
- package/ImageEditor/ImageEditor.js +151 -0
- package/ImageEditor/ImageEditor.js.map +1 -0
- package/ImageEditor/ImageEditor.stories.d.ts +6 -0
- package/ImageEditor/ImageEditor.stories.js +42 -0
- package/ImageEditor/ImageEditor.stories.js.map +1 -0
- package/ImageEditor/MetaFields.d.ts +12 -0
- package/ImageEditor/MetaFields.js +20 -0
- package/ImageEditor/MetaFields.js.map +1 -0
- package/ImageEditor/SectionLabel.d.ts +8 -0
- package/ImageEditor/SectionLabel.js +7 -0
- package/ImageEditor/SectionLabel.js.map +1 -0
- package/ImageEditor/geometry.d.ts +46 -0
- package/ImageEditor/geometry.js +126 -0
- package/ImageEditor/geometry.js.map +1 -0
- package/ImageEditor/index.d.ts +3 -0
- package/ImageEditor/index.js +3 -0
- package/ImageEditor/types.d.ts +52 -0
- package/ImageEditor/types.js +35 -0
- package/ImageEditor/types.js.map +1 -0
- package/Input/Input.d.ts +7 -6
- package/Input/Input.stories.d.ts +1 -1
- package/Input/Input.stories.js.map +1 -1
- package/Input/InputPrimitive.d.ts +9 -8
- package/Input/InputPrimitive.stories.d.ts +1 -1
- package/Input/InputPrimitive.stories.js.map +1 -1
- package/Label/Label.d.ts +8 -7
- package/Label/Label.stories.d.ts +1 -1
- package/Label/Label.stories.js.map +1 -1
- package/Label/components/LabelValue.d.ts +1 -1
- package/Link/Link.d.ts +3 -3
- package/Link/Link.js +1 -1
- package/Link/Link.js.map +1 -1
- package/Link/Link.stories.d.ts +1 -1
- package/Link/Link.stories.js.map +1 -1
- package/List/List.d.ts +8 -7
- package/List/List.stories.d.ts +1 -1
- package/List/List.stories.js.map +1 -1
- package/List/components/ListItem.d.ts +7 -6
- package/List/components/ListItemAction.d.ts +7 -6
- package/List/components/ListItemHandle.d.ts +7 -6
- package/List/components/ListItemIcon.d.ts +7 -6
- package/List/components/ListItemSeparator.d.ts +7 -6
- package/Loader/Loader.d.ts +9 -8
- package/Loader/Loader.stories.d.ts +1 -1
- package/Loader/Loader.stories.js.map +1 -1
- package/Loader/OverlayLoader.d.ts +7 -6
- package/Loader/OverlayLoader.stories.d.ts +1 -1
- package/Loader/OverlayLoader.stories.js.map +1 -1
- package/Markdown/Markdown.d.ts +47 -0
- package/Markdown/Markdown.js +17 -0
- package/Markdown/Markdown.js.map +1 -0
- package/Markdown/index.d.ts +1 -0
- package/Markdown/index.js +1 -0
- package/MultiAutoComplete/MultiAutoComplete.d.ts +7 -6
- package/MultiAutoComplete/MultiAutoComplete.stories.d.ts +1 -1
- package/MultiAutoComplete/MultiAutoComplete.stories.js.map +1 -1
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.d.ts +13 -6
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.js +1 -0
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.js.map +1 -1
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.stories.d.ts +1 -1
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.stories.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenterWithFreeInput.d.ts +3 -3
- package/MultiAutoComplete/primitives/useMultiAutoComplete.d.ts +3 -3
- package/MultiFilePicker/MultiFilePicker.d.ts +19 -18
- package/MultiFilePicker/MultiFilePicker.stories.d.ts +1 -1
- package/MultiFilePicker/MultiFilePicker.stories.js.map +1 -1
- package/MultiFilePicker/primitives/MultiFilePickerPrimitive.d.ts +19 -18
- package/MultiFilePicker/primitives/MultiFilePickerPrimitive.stories.d.ts +1 -1
- package/MultiFilePicker/primitives/MultiFilePickerPrimitive.stories.js.map +1 -1
- package/MultiSelect/MultiSelect.d.ts +7 -6
- package/MultiSelect/MultiSelect.stories.d.ts +1 -1
- package/MultiSelect/MultiSelect.stories.js.map +1 -1
- package/MultiSelect/primitives/MultiSelectPrimitive.d.ts +10 -6
- package/MultiSelect/primitives/MultiSelectPrimitive.js +12 -5
- package/MultiSelect/primitives/MultiSelectPrimitive.js.map +1 -1
- package/Popover/Popover.d.ts +7 -6
- package/Popover/Popover.stories.d.ts +8 -1
- package/Popover/Popover.stories.js +24 -1
- package/Popover/Popover.stories.js.map +1 -1
- package/Popover/primitives/PopoverPrimitive.d.ts +7 -7
- package/Popover/primitives/components/PopoverContent.js +6 -1
- package/Popover/primitives/components/PopoverContent.js.map +1 -1
- package/ProgressBar/ProgressBar.d.ts +7 -6
- package/ProgressBar/ProgressBar.stories.d.ts +1 -1
- package/ProgressBar/ProgressBar.stories.js.map +1 -1
- package/RadioGroup/RadioGroup.d.ts +7 -6
- package/RadioGroup/RadioGroup.stories.d.ts +1 -1
- package/RadioGroup/RadioGroup.stories.js.map +1 -1
- package/RadioGroup/primitives/Radio.d.ts +7 -6
- package/RadioGroup/primitives/RadioGroupPrimitive.d.ts +5 -1
- package/RadioGroup/primitives/RadioGroupPrimitive.stories.d.ts +1 -1
- package/RadioGroup/primitives/RadioGroupPrimitive.stories.js.map +1 -1
- package/RangeSlider/RangeSlider.d.ts +7 -6
- package/RangeSlider/RangeSlider.stories.d.ts +1 -1
- package/RangeSlider/RangeSlider.stories.js.map +1 -1
- package/RangeSlider/primitives/RangeSliderPrimitive.stories.d.ts +1 -1
- package/RangeSlider/primitives/RangeSliderPrimitive.stories.js.map +1 -1
- package/ScrollArea/ScrollArea.d.ts +16 -2
- package/ScrollArea/ScrollArea.js +25 -11
- package/ScrollArea/ScrollArea.js.map +1 -1
- package/ScrollArea/ScrollArea.stories.d.ts +1 -1
- package/ScrollArea/ScrollArea.stories.js.map +1 -1
- package/SegmentedControl/SegmentedControl.d.ts +11 -6
- package/SegmentedControl/SegmentedControl.js +6 -2
- package/SegmentedControl/SegmentedControl.js.map +1 -1
- package/SegmentedControl/SegmentedControl.stories.d.ts +5 -1
- package/SegmentedControl/SegmentedControl.stories.js +100 -2
- package/SegmentedControl/SegmentedControl.stories.js.map +1 -1
- package/SegmentedControl/SegmentedControlTab.d.ts +10 -0
- package/SegmentedControl/SegmentedControlTab.js +21 -0
- package/SegmentedControl/SegmentedControlTab.js.map +1 -0
- package/SegmentedControl/SegmentedControlTabs.d.ts +14 -0
- package/SegmentedControl/SegmentedControlTabs.js +71 -0
- package/SegmentedControl/SegmentedControlTabs.js.map +1 -0
- package/SegmentedControl/SegmentedControlTabsContext.d.ts +19 -0
- package/SegmentedControl/SegmentedControlTabsContext.js +11 -0
- package/SegmentedControl/SegmentedControlTabsContext.js.map +1 -0
- package/SegmentedControl/index.d.ts +2 -0
- package/SegmentedControl/index.js +2 -0
- package/SegmentedControl/primitives/SegmentedControlPrimitive.d.ts +6 -2
- package/SegmentedControl/primitives/SegmentedControlPrimitive.js +4 -3
- package/SegmentedControl/primitives/SegmentedControlPrimitive.js.map +1 -1
- package/SegmentedControl/primitives/SegmentedControlPrimitive.stories.d.ts +2 -1
- package/SegmentedControl/primitives/SegmentedControlPrimitive.stories.js +8 -1
- package/SegmentedControl/primitives/SegmentedControlPrimitive.stories.js.map +1 -1
- package/Select/Select.d.ts +7 -6
- package/Select/Select.stories.d.ts +1 -1
- package/Select/Select.stories.js.map +1 -1
- package/Select/primitives/SelectPrimitive.stories.d.ts +1 -1
- package/Select/primitives/SelectPrimitive.stories.js.map +1 -1
- package/Select/primitives/components/SelectContent.js +4 -6
- package/Select/primitives/components/SelectContent.js.map +1 -1
- package/Select/primitives/components/SelectTrigger.d.ts +2 -2
- package/Separator/Separator.d.ts +9 -8
- package/Separator/Separator.stories.d.ts +1 -1
- package/Separator/Separator.stories.js.map +1 -1
- package/Sidebar/Sidebar.d.ts +9 -6
- package/Sidebar/Sidebar.stories.d.ts +1 -1
- package/Sidebar/Sidebar.stories.js.map +1 -1
- package/Sidebar/components/SidebarContent.js +1 -1
- package/Sidebar/components/SidebarContent.js.map +1 -1
- package/Sidebar/components/SidebarIcon.d.ts +7 -6
- package/Sidebar/components/SidebarProvider.d.ts +4 -4
- package/Sidebar/components/SidebarRoot.js +1 -1
- package/Sidebar/components/SidebarRoot.js.map +1 -1
- package/Sidebar/components/items/SidebarMenuGroup.d.ts +9 -8
- package/Sidebar/components/items/SidebarMenuItem.d.ts +13 -9
- package/Sidebar/components/items/SidebarMenuItem.js +3 -1
- package/Sidebar/components/items/SidebarMenuItem.js.map +1 -1
- package/Sidebar/components/items/SidebarMenuItemBadge.d.ts +6 -0
- package/Sidebar/components/items/SidebarMenuItemBadge.js +7 -0
- package/Sidebar/components/items/SidebarMenuItemBadge.js.map +1 -0
- package/Sidebar/components/items/SidebarMenuItemIcon.d.ts +7 -6
- package/Sidebar/components/items/SidebarMenuLink.d.ts +12 -9
- package/Sidebar/components/items/SidebarMenuLink.js +3 -1
- package/Sidebar/components/items/SidebarMenuLink.js.map +1 -1
- package/Sidebar/components/items/SidebarMenuProvider.d.ts +4 -4
- package/Sidebar/components/items/SidebarMenuRootButton.d.ts +1 -1
- package/Sidebar/components/items/SidebarMenuRootButton.js +8 -3
- package/Sidebar/components/items/SidebarMenuRootButton.js.map +1 -1
- package/Sidebar/components/items/SidebarMenuRootItem.d.ts +9 -7
- package/Sidebar/components/items/SidebarMenuSubButton.d.ts +1 -1
- package/Sidebar/components/items/SidebarMenuSubButton.js +14 -6
- package/Sidebar/components/items/SidebarMenuSubButton.js.map +1 -1
- package/Sidebar/components/items/SidebarMenuSubItem.js +3 -3
- package/Sidebar/components/items/SidebarMenuSubItem.js.map +1 -1
- package/Sidebar/components/items/SidebarMenuSubItemIndentation.js +2 -1
- package/Sidebar/components/items/SidebarMenuSubItemIndentation.js.map +1 -1
- package/Skeleton/Skeleton.d.ts +9 -7
- package/Skeleton/Skeleton.js +10 -4
- package/Skeleton/Skeleton.js.map +1 -1
- package/Skeleton/Skeleton.stories.d.ts +3 -1
- package/Skeleton/Skeleton.stories.js +28 -2
- package/Skeleton/Skeleton.stories.js.map +1 -1
- package/Slider/Slider.d.ts +7 -6
- package/Slider/Slider.stories.d.ts +1 -1
- package/Slider/Slider.stories.js.map +1 -1
- package/Slider/primitives/SliderPrimitive.stories.d.ts +1 -1
- package/Slider/primitives/SliderPrimitive.stories.js.map +1 -1
- package/SteppedProgress/SteppedProgress.d.ts +7 -6
- package/SteppedProgress/SteppedProgress.stories.d.ts +1 -1
- package/SteppedProgress/SteppedProgress.stories.js.map +1 -1
- package/SteppedProgress/SteppedProgressItem.d.ts +7 -6
- package/Switch/Switch.d.ts +10 -9
- package/Switch/Switch.js +21 -7
- package/Switch/Switch.js.map +1 -1
- package/Switch/Switch.stories.d.ts +1 -1
- package/Switch/Switch.stories.js.map +1 -1
- package/Switch/domains/SwitchItemDto.d.ts +1 -1
- package/Switch/primitives/SwitchPrimitive.d.ts +10 -6
- package/Switch/primitives/SwitchPrimitive.js +4 -3
- package/Switch/primitives/SwitchPrimitive.js.map +1 -1
- package/Switch/primitives/SwitchPrimitive.stories.d.ts +1 -1
- package/Switch/primitives/SwitchPrimitive.stories.js.map +1 -1
- package/Table/Table.d.ts +12 -10
- package/Table/components/Direction.d.ts +1 -1
- package/Tabs/Tabs.d.ts +14 -7
- package/Tabs/Tabs.js +32 -11
- package/Tabs/Tabs.js.map +1 -1
- package/Tabs/Tabs.mdx +27 -0
- package/Tabs/Tabs.stories.d.ts +2 -1
- package/Tabs/Tabs.stories.js +19 -1
- package/Tabs/Tabs.stories.js.map +1 -1
- package/Tabs/components/Content.d.ts +1 -1
- package/Tabs/components/List.d.ts +2 -2
- package/Tabs/components/Tab.d.ts +7 -6
- package/Tabs/components/Trigger.d.ts +3 -2
- package/Tabs/components/Trigger.js +8 -3
- package/Tabs/components/Trigger.js.map +1 -1
- package/Tag/Tag.d.ts +8 -7
- package/Tag/Tag.stories.d.ts +1 -1
- package/Tag/Tag.stories.js.map +1 -1
- package/Tags/Tags.d.ts +7 -6
- package/Tags/Tags.stories.d.ts +1 -1
- package/Tags/Tags.stories.js.map +1 -1
- package/Tags/primitives/TagsPrimitive.d.ts +7 -6
- package/Tags/primitives/TagsPrimitive.stories.d.ts +1 -1
- package/Tags/primitives/TagsPrimitive.stories.js.map +1 -1
- package/Text/Text.d.ts +8 -7
- package/Text/Text.stories.d.ts +1 -1
- package/Text/Text.stories.js.map +1 -1
- package/Textarea/Textarea.d.ts +7 -6
- package/Textarea/Textarea.stories.d.ts +1 -1
- package/Textarea/Textarea.stories.js.map +1 -1
- package/Textarea/TextareaPrimitive.d.ts +9 -8
- package/Textarea/TextareaPrimitive.stories.d.ts +1 -1
- package/Textarea/TextareaPrimitive.stories.js.map +1 -1
- package/TimeAgo/TimeAgo.stories.d.ts +1 -1
- package/TimeAgo/TimeAgo.stories.js.map +1 -1
- package/TimeAgo/getElapsedSeconds.js +3 -3
- package/TimeAgo/getElapsedSeconds.js.map +1 -1
- package/Toast/Toast.d.ts +7 -6
- package/Toast/components/ToastActions.d.ts +7 -6
- package/Toast/components/ToastDescription.d.ts +7 -6
- package/Toast/components/ToastTitle.d.ts +7 -6
- package/Toast/useToast.stories.d.ts +1 -1
- package/Toast/useToast.stories.js.map +1 -1
- package/Toggle/Toggle.d.ts +7 -6
- package/Toggle/Toggle.stories.d.ts +1 -1
- package/Toggle/Toggle.stories.js.map +1 -1
- package/Toggle/primitives/TogglePrimitive.d.ts +13 -9
- package/Toggle/primitives/TogglePrimitive.stories.d.ts +1 -1
- package/Toggle/primitives/TogglePrimitive.stories.js.map +1 -1
- package/ToggleGroup/ToggleGroup.d.ts +7 -6
- package/ToggleGroup/ToggleGroup.stories.d.ts +1 -1
- package/ToggleGroup/ToggleGroup.stories.js.map +1 -1
- package/ToggleGroup/domains/ToggleGroupItem.d.ts +3 -0
- package/ToggleGroup/domains/ToggleGroupItem.js +6 -1
- package/ToggleGroup/domains/ToggleGroupItem.js.map +1 -1
- package/ToggleGroup/domains/ToggleGroupItemFormatted.d.ts +1 -0
- package/ToggleGroup/domains/ToggleGroupItemFormatter.js +2 -1
- package/ToggleGroup/domains/ToggleGroupItemFormatter.js.map +1 -1
- package/ToggleGroup/domains/ToggleGroupItemParams.d.ts +1 -0
- package/ToggleGroup/primitives/ToggleGroupPrimitive.d.ts +13 -9
- package/ToggleGroup/primitives/ToggleGroupPrimitive.js +12 -3
- package/ToggleGroup/primitives/ToggleGroupPrimitive.js.map +1 -1
- package/ToggleGroup/primitives/ToggleGroupPrimitive.stories.d.ts +1 -1
- package/ToggleGroup/primitives/ToggleGroupPrimitive.stories.js.map +1 -1
- package/Tooltip/Tooltip.d.ts +7 -6
- package/Tooltip/Tooltip.stories.d.ts +1 -1
- package/Tooltip/Tooltip.stories.js.map +1 -1
- package/Tree/Tree.d.ts +7 -6
- package/Tree/Tree.stories.d.ts +1 -1
- package/Tree/Tree.stories.js.map +1 -1
- package/Tree/components/Item.d.ts +7 -6
- package/Tree/components/ItemCollapseTrigger.d.ts +7 -6
- package/Tree/components/ItemContent.d.ts +8 -6
- package/Tree/components/ItemDragHandle.d.ts +7 -6
- package/Tree/components/ItemIcon.d.ts +7 -6
- package/Tree/components/ItemPlaceholder.d.ts +7 -6
- package/Tree/components/ItemSubIndentation.d.ts +7 -6
- package/Tree/useTree.js +6 -2
- package/Tree/useTree.js.map +1 -1
- package/Widget/Widget.d.ts +8 -22
- package/Widget/Widget.stories.d.ts +1 -1
- package/Widget/Widget.stories.js.map +1 -1
- package/Widget/components/Icon.d.ts +7 -6
- package/Widget/components/WidgetAction.d.ts +8 -6
- package/Widget/components/WidgetContent.d.ts +5 -5
- package/exports/admin/ui.d.ts +3 -0
- package/exports/admin/ui.js +3 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +1 -0
- package/hooks/useEscapeScrollLock.d.ts +13 -0
- package/hooks/useEscapeScrollLock.js +21 -0
- package/hooks/useEscapeScrollLock.js.map +1 -0
- package/index.d.ts +8 -0
- package/index.js +8 -0
- package/package.json +33 -35
- package/theme.css +52 -0
- package/utils.js +53 -34
- package/utils.js.map +1 -1
|
@@ -2,6 +2,7 @@ import react from "react";
|
|
|
2
2
|
import { makeDecoratable, withStaticProps } from "../../../utils.js";
|
|
3
3
|
import { SidebarMenuItemIcon } from "./SidebarMenuItemIcon.js";
|
|
4
4
|
import { SidebarMenuItemAction } from "./SidebarMenuItemAction.js";
|
|
5
|
+
import { SidebarMenuItemBadge } from "./SidebarMenuItemBadge.js";
|
|
5
6
|
import { SidebarMenuSubItem } from "./SidebarMenuSubItem.js";
|
|
6
7
|
import { useSidebarMenu } from "./SidebarMenuProvider.js";
|
|
7
8
|
import { SidebarMenuRootItem } from "./SidebarMenuRootItem.js";
|
|
@@ -13,7 +14,8 @@ const SidebarMenuItemBase = (props)=>{
|
|
|
13
14
|
const DecoratableSidebarMenuItem = makeDecoratable("SidebarMenuItem", SidebarMenuItemBase);
|
|
14
15
|
const SidebarMenuItem = withStaticProps(DecoratableSidebarMenuItem, {
|
|
15
16
|
Icon: SidebarMenuItemIcon,
|
|
16
|
-
Action: SidebarMenuItemAction
|
|
17
|
+
Action: SidebarMenuItemAction,
|
|
18
|
+
Badge: SidebarMenuItemBadge
|
|
17
19
|
});
|
|
18
20
|
export { SidebarMenuItem };
|
|
19
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar/components/items/SidebarMenuItem.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuItem.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { SidebarMenuItemIcon, type SidebarMenuItemIconProps } from \"./SidebarMenuItemIcon.js\";\nimport { SidebarMenuItemAction, type SidebarMenuItemActionProps } from \"./SidebarMenuItemAction.js\";\nimport { SidebarMenuSubItem } from \"./SidebarMenuSubItem.js\";\nimport { useSidebarMenu } from \"./SidebarMenuProvider.js\";\nimport { SidebarMenuRootItem } from \"~/Sidebar/components/items/SidebarMenuRootItem.js\";\nimport { LinkProps } from \"~/index.js\";\n\nexport interface SidebarMenuItemBaseProps {\n text: React.ReactNode;\n className?: string;\n collapsible?: boolean;\n children?: React.ReactNode;\n onClick?: React.MouseEventHandler;\n icon?: React.ReactNode;\n action?: React.ReactNode;\n variant?: \"group-label\";\n active?: boolean;\n disabled?: boolean;\n pinnable?: boolean;\n pinnedIcon?: React.ReactNode;\n}\n\ntype SidebarMenuItemButtonProps = SidebarMenuItemBaseProps & {\n to?: never;\n route?: never;\n params?: never;\n};\n\ntype SidebarMenuItemGroupProps = SidebarMenuItemButtonProps;\ntype SidebarMenuItemLinkProps = SidebarMenuItemBaseProps & LinkProps;\n\ntype SidebarMenuItemProps = SidebarMenuItemButtonProps | SidebarMenuItemLinkProps;\n\nconst SidebarMenuItemBase = (props: SidebarMenuItemProps) => {\n const { currentLevel } = useSidebarMenu();\n\n if (currentLevel === 0) {\n return <SidebarMenuRootItem {...props} />;\n }\n\n return <SidebarMenuSubItem {...props} />;\n};\n\nconst DecoratableSidebarMenuItem = makeDecoratable(\"SidebarMenuItem\", SidebarMenuItemBase);\n\nconst SidebarMenuItem = withStaticProps(DecoratableSidebarMenuItem, {\n Icon: SidebarMenuItemIcon,\n Action: SidebarMenuItemAction\n});\n\nexport {\n SidebarMenuItem,\n type SidebarMenuItemProps,\n type SidebarMenuItemButtonProps,\n type SidebarMenuItemLinkProps,\n type SidebarMenuItemGroupProps,\n type SidebarMenuItemIconProps,\n type SidebarMenuItemActionProps\n};\n"],"names":["SidebarMenuItemBase","props","currentLevel","useSidebarMenu","SidebarMenuRootItem","SidebarMenuSubItem","DecoratableSidebarMenuItem","makeDecoratable","SidebarMenuItem","withStaticProps","SidebarMenuItemIcon","SidebarMenuItemAction"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sidebar/components/items/SidebarMenuItem.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuItem.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { SidebarMenuItemIcon, type SidebarMenuItemIconProps } from \"./SidebarMenuItemIcon.js\";\nimport { SidebarMenuItemAction, type SidebarMenuItemActionProps } from \"./SidebarMenuItemAction.js\";\nimport { SidebarMenuItemBadge, type SidebarMenuItemBadgeProps } from \"./SidebarMenuItemBadge.js\";\nimport { SidebarMenuSubItem } from \"./SidebarMenuSubItem.js\";\nimport { useSidebarMenu } from \"./SidebarMenuProvider.js\";\nimport { SidebarMenuRootItem } from \"~/Sidebar/components/items/SidebarMenuRootItem.js\";\nimport { LinkProps } from \"~/index.js\";\n\nexport interface SidebarMenuItemBaseProps {\n text: React.ReactNode;\n className?: string;\n collapsible?: boolean;\n children?: React.ReactNode;\n onClick?: React.MouseEventHandler;\n icon?: React.ReactNode;\n action?: React.ReactNode;\n variant?: \"group-label\";\n active?: boolean;\n disabled?: boolean;\n pinnable?: boolean;\n pinnedIcon?: React.ReactNode;\n badge?: React.ReactNode;\n}\n\ntype SidebarMenuItemButtonProps = SidebarMenuItemBaseProps & {\n to?: never;\n route?: never;\n params?: never;\n};\n\ntype SidebarMenuItemGroupProps = SidebarMenuItemButtonProps;\ntype SidebarMenuItemLinkProps = SidebarMenuItemBaseProps & LinkProps;\n\ntype SidebarMenuItemProps = SidebarMenuItemButtonProps | SidebarMenuItemLinkProps;\n\nconst SidebarMenuItemBase = (props: SidebarMenuItemProps) => {\n const { currentLevel } = useSidebarMenu();\n\n if (currentLevel === 0) {\n return <SidebarMenuRootItem {...props} />;\n }\n\n return <SidebarMenuSubItem {...props} />;\n};\n\nconst DecoratableSidebarMenuItem = makeDecoratable(\"SidebarMenuItem\", SidebarMenuItemBase);\n\nconst SidebarMenuItem = withStaticProps(DecoratableSidebarMenuItem, {\n Icon: SidebarMenuItemIcon,\n Action: SidebarMenuItemAction,\n Badge: SidebarMenuItemBadge\n});\n\nexport {\n SidebarMenuItem,\n type SidebarMenuItemProps,\n type SidebarMenuItemButtonProps,\n type SidebarMenuItemLinkProps,\n type SidebarMenuItemGroupProps,\n type SidebarMenuItemIconProps,\n type SidebarMenuItemActionProps,\n type SidebarMenuItemBadgeProps\n};\n"],"names":["SidebarMenuItemBase","props","currentLevel","useSidebarMenu","SidebarMenuRootItem","SidebarMenuSubItem","DecoratableSidebarMenuItem","makeDecoratable","SidebarMenuItem","withStaticProps","SidebarMenuItemIcon","SidebarMenuItemAction","SidebarMenuItemBadge"],"mappings":";;;;;;;;AAqCA,MAAMA,sBAAsB,CAACC;IACzB,MAAM,EAAEC,YAAY,EAAE,GAAGC;IAEzB,IAAID,AAAiB,MAAjBA,cACA,OAAO,WAAP,GAAO,oBAACE,qBAAwBH;IAGpC,OAAO,WAAP,GAAO,oBAACI,oBAAuBJ;AACnC;AAEA,MAAMK,6BAA6BC,gBAAgB,mBAAmBP;AAEtE,MAAMQ,kBAAkBC,gBAAgBH,4BAA4B;IAChE,MAAMI;IACN,QAAQC;IACR,OAAOC;AACX"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
const SidebarMenuItemBadge = ({ text })=>/*#__PURE__*/ react.createElement("span", {
|
|
3
|
+
className: "inline-flex items-center rounded-sm bg-primary/50 px-xs text-[10px] font-semibold text-neutral-light leading-none h-md shrink-0"
|
|
4
|
+
}, text);
|
|
5
|
+
export { SidebarMenuItemBadge };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=SidebarMenuItemBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar/components/items/SidebarMenuItemBadge.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuItemBadge.tsx"],"sourcesContent":["import React from \"react\";\n\ninterface SidebarMenuItemBadgeProps {\n text: React.ReactNode;\n}\n\nconst SidebarMenuItemBadge = ({ text }: SidebarMenuItemBadgeProps) => {\n return (\n <span\n className={\n \"inline-flex items-center rounded-sm bg-primary/50 px-xs text-[10px] font-semibold text-neutral-light leading-none h-md shrink-0\"\n }\n >\n {text}\n </span>\n );\n};\n\nexport { SidebarMenuItemBadge, type SidebarMenuItemBadgeProps };\n"],"names":["SidebarMenuItemBadge","text"],"mappings":";AAMA,MAAMA,uBAAuB,CAAC,EAAEC,IAAI,EAA6B,GACtD,WAAP,GACI,oBAAC;QACG,WACI;OAGHA"}
|
|
@@ -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
|
|
7
|
-
|
|
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:
|
|
12
|
-
original:
|
|
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<
|
|
20
|
-
original:
|
|
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,22 +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
|
-
|
|
6
|
-
|
|
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;
|
|
7
9
|
originalName: string;
|
|
8
10
|
displayName: string;
|
|
9
11
|
} & {
|
|
10
|
-
original:
|
|
11
|
-
original:
|
|
12
|
+
original: typeof SidebarMenuLinkBase & {
|
|
13
|
+
original: typeof SidebarMenuLinkBase;
|
|
12
14
|
originalName: string;
|
|
13
15
|
displayName: string;
|
|
14
16
|
};
|
|
15
17
|
originalName: string;
|
|
16
18
|
displayName: string;
|
|
17
19
|
} & {
|
|
18
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
19
|
-
original:
|
|
20
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof SidebarMenuLinkBase & {
|
|
21
|
+
original: typeof SidebarMenuLinkBase;
|
|
20
22
|
originalName: string;
|
|
21
23
|
displayName: string;
|
|
22
24
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -40,6 +42,7 @@ declare const SidebarMenuLink: ((props: SidebarMenuItemLinkProps) => React.JSX.E
|
|
|
40
42
|
displayName: string;
|
|
41
43
|
}>) => (props: unknown) => React.JSX.Element;
|
|
42
44
|
};
|
|
43
|
-
Action:
|
|
45
|
+
Action: typeof SidebarMenuItemAction;
|
|
46
|
+
Badge: typeof SidebarMenuItemBadge;
|
|
44
47
|
};
|
|
45
|
-
export { SidebarMenuLink, type SidebarMenuItemLinkProps, type SidebarMenuItemIconProps, type SidebarMenuItemActionProps };
|
|
48
|
+
export { SidebarMenuLink, type SidebarMenuItemLinkProps, type SidebarMenuItemIconProps, type SidebarMenuItemActionProps, type SidebarMenuItemBadgeProps };
|
|
@@ -3,11 +3,13 @@ import { SidebarMenuItem } from "./SidebarMenuItem.js";
|
|
|
3
3
|
import { makeDecoratable, withStaticProps } from "../../../utils.js";
|
|
4
4
|
import { SidebarMenuItemIcon } from "./SidebarMenuItemIcon.js";
|
|
5
5
|
import { SidebarMenuItemAction } from "./SidebarMenuItemAction.js";
|
|
6
|
+
import { SidebarMenuItemBadge } from "./SidebarMenuItemBadge.js";
|
|
6
7
|
const SidebarMenuLinkBase = (props)=>/*#__PURE__*/ react.createElement(SidebarMenuItem, props);
|
|
7
8
|
const DecoratableSidebarMenuLink = makeDecoratable("SidebarMenuLink", SidebarMenuLinkBase);
|
|
8
9
|
const SidebarMenuLink = withStaticProps(DecoratableSidebarMenuLink, {
|
|
9
10
|
Icon: SidebarMenuItemIcon,
|
|
10
|
-
Action: SidebarMenuItemAction
|
|
11
|
+
Action: SidebarMenuItemAction,
|
|
12
|
+
Badge: SidebarMenuItemBadge
|
|
11
13
|
});
|
|
12
14
|
export { SidebarMenuLink };
|
|
13
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar/components/items/SidebarMenuLink.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuLink.tsx"],"sourcesContent":["import React from \"react\";\nimport { SidebarMenuItem, type SidebarMenuItemLinkProps } from \"./SidebarMenuItem.js\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport {\n SidebarMenuItemIcon,\n type SidebarMenuItemIconProps\n} from \"~/Sidebar/components/items/SidebarMenuItemIcon.js\";\nimport {\n SidebarMenuItemAction,\n type SidebarMenuItemActionProps\n} from \"~/Sidebar/components/items/SidebarMenuItemAction.js\";\n\nconst SidebarMenuLinkBase = (props: SidebarMenuItemLinkProps) => {\n return <SidebarMenuItem {...props} />;\n};\n\nconst DecoratableSidebarMenuLink = makeDecoratable(\"SidebarMenuLink\", SidebarMenuLinkBase);\n\nconst SidebarMenuLink = withStaticProps(DecoratableSidebarMenuLink, {\n Icon: SidebarMenuItemIcon,\n Action: SidebarMenuItemAction\n});\n\nexport {\n SidebarMenuLink,\n type SidebarMenuItemLinkProps,\n type SidebarMenuItemIconProps,\n type SidebarMenuItemActionProps\n};\n"],"names":["SidebarMenuLinkBase","props","SidebarMenuItem","DecoratableSidebarMenuLink","makeDecoratable","SidebarMenuLink","withStaticProps","SidebarMenuItemIcon","SidebarMenuItemAction"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sidebar/components/items/SidebarMenuLink.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuLink.tsx"],"sourcesContent":["import React from \"react\";\nimport { SidebarMenuItem, type SidebarMenuItemLinkProps } from \"./SidebarMenuItem.js\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport {\n SidebarMenuItemIcon,\n type SidebarMenuItemIconProps\n} from \"~/Sidebar/components/items/SidebarMenuItemIcon.js\";\nimport {\n SidebarMenuItemAction,\n type SidebarMenuItemActionProps\n} from \"~/Sidebar/components/items/SidebarMenuItemAction.js\";\nimport {\n SidebarMenuItemBadge,\n type SidebarMenuItemBadgeProps\n} from \"~/Sidebar/components/items/SidebarMenuItemBadge.js\";\n\nconst SidebarMenuLinkBase = (props: SidebarMenuItemLinkProps) => {\n return <SidebarMenuItem {...props} />;\n};\n\nconst DecoratableSidebarMenuLink = makeDecoratable(\"SidebarMenuLink\", SidebarMenuLinkBase);\n\nconst SidebarMenuLink = withStaticProps(DecoratableSidebarMenuLink, {\n Icon: SidebarMenuItemIcon,\n Action: SidebarMenuItemAction,\n Badge: SidebarMenuItemBadge\n});\n\nexport {\n SidebarMenuLink,\n type SidebarMenuItemLinkProps,\n type SidebarMenuItemIconProps,\n type SidebarMenuItemActionProps,\n type SidebarMenuItemBadgeProps\n};\n"],"names":["SidebarMenuLinkBase","props","SidebarMenuItem","DecoratableSidebarMenuLink","makeDecoratable","SidebarMenuLink","withStaticProps","SidebarMenuItemIcon","SidebarMenuItemAction","SidebarMenuItemBadge"],"mappings":";;;;;;AAgBA,MAAMA,sBAAsB,CAACC,QAClB,WAAP,GAAO,oBAACC,iBAAoBD;AAGhC,MAAME,6BAA6BC,gBAAgB,mBAAmBJ;AAEtE,MAAMK,kBAAkBC,gBAAgBH,4BAA4B;IAChE,MAAMI;IACN,QAAQC;IACR,OAAOC;AACX"}
|
|
@@ -11,8 +11,8 @@ interface SidebarMenuProviderProps {
|
|
|
11
11
|
}
|
|
12
12
|
declare const SidebarMenuContext: React.Context<SidebarMenuContext>;
|
|
13
13
|
declare function useSidebarMenu(): SidebarMenuContext;
|
|
14
|
-
declare
|
|
15
|
-
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SidebarMenuItemProps } from "./SidebarMenuRootItem.js";
|
|
3
3
|
type SidebarMenuButtonBaseProps = Omit<SidebarMenuItemProps, "children">;
|
|
4
|
-
declare const SidebarMenuRootButton: ({ className, onClick, variant, active, disabled, icon, pinnedIcon, action, text, to, ...linkProps }: SidebarMenuButtonBaseProps) => React.JSX.Element;
|
|
4
|
+
declare const SidebarMenuRootButton: ({ className, onClick, variant, active, disabled, icon, pinnedIcon, action, text, badge, to, ...linkProps }: SidebarMenuButtonBaseProps) => React.JSX.Element;
|
|
5
5
|
export { SidebarMenuRootButton };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { cn, cva } from "../../../utils.js";
|
|
3
3
|
import { DivButton } from "./DivButton.js";
|
|
4
|
+
import { SidebarMenuItemBadge } from "./SidebarMenuItemBadge.js";
|
|
4
5
|
import { useAdminUi } from "../../../index.js";
|
|
5
6
|
const variants = cva([
|
|
6
7
|
"flex w-full items-center gap-sm rounded-md",
|
|
@@ -22,7 +23,7 @@ const variants = cva([
|
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
|
-
const SidebarMenuRootButton = ({ className, onClick, variant, active, disabled, icon, pinnedIcon, action, text, to, ...linkProps })=>{
|
|
26
|
+
const SidebarMenuRootButton = ({ className, onClick, variant, active, disabled, icon, pinnedIcon, action, text, badge, to, ...linkProps })=>{
|
|
26
27
|
const sharedProps = {
|
|
27
28
|
"data-sidebar": "menu-button",
|
|
28
29
|
"data-active": active,
|
|
@@ -37,11 +38,15 @@ const SidebarMenuRootButton = ({ className, onClick, variant, active, disabled,
|
|
|
37
38
|
...sharedProps,
|
|
38
39
|
to: to,
|
|
39
40
|
...linkProps
|
|
40
|
-
}, icon, text
|
|
41
|
+
}, icon, text, badge && ("string" == typeof badge ? /*#__PURE__*/ react.createElement(SidebarMenuItemBadge, {
|
|
42
|
+
text: badge
|
|
43
|
+
}) : badge)) : /*#__PURE__*/ react.createElement(DivButton, {
|
|
41
44
|
...sharedProps,
|
|
42
45
|
disabled: disabled,
|
|
43
46
|
tabIndex: "group-label" === variant ? -1 : void 0
|
|
44
|
-
}, icon, text
|
|
47
|
+
}, icon, text, badge && ("string" == typeof badge ? /*#__PURE__*/ react.createElement(SidebarMenuItemBadge, {
|
|
48
|
+
text: badge
|
|
49
|
+
}) : badge));
|
|
45
50
|
return /*#__PURE__*/ react.createElement("div", {
|
|
46
51
|
className: cn("flex items-center w-full relative group/menu-root-button", className)
|
|
47
52
|
}, content, action && /*#__PURE__*/ react.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar/components/items/SidebarMenuRootButton.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuRootButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, cva } from \"~/utils.js\";\nimport type { SidebarMenuItemProps } from \"./SidebarMenuRootItem.js\";\nimport { DivButton } from \"./DivButton.js\";\nimport { useAdminUi } from \"~/index.js\";\n\nconst variants = cva(\n [\n \"flex w-full items-center gap-sm rounded-md\",\n \"no-underline! text-neutral-primary cursor-pointer px-sm py-xs-plus text-left\",\n \"text-md outline-none transition-[width,height,padding]\",\n \"whitespace-nowrap overflow-hidden\",\n \"hover:bg-neutral-dark/5\",\n \"group-hover/menu-root-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=open]/menu-item-collapsible:font-semibold!\"\n ],\n {\n variants: {\n variant: {\n \"group-label\":\n \"text-neutral-muted! uppercase hover:bg-transparent! group-hover/menu-root-button:bg-transparent! focus:bg-transparent! cursor-default!\"\n },\n disabled: {\n true: \"pointer-events-none text-neutral-disabled!\"\n }\n }\n }\n);\n\ntype SidebarMenuButtonBaseProps = Omit<SidebarMenuItemProps, \"children\">;\n\nconst SidebarMenuRootButton = ({\n className,\n onClick,\n variant,\n active,\n disabled,\n icon,\n\n // oxlint-disable-next-line\n pinnedIcon,\n\n action,\n text,\n to,\n ...linkProps\n}: SidebarMenuButtonBaseProps) => {\n const sharedProps = {\n \"data-sidebar\": \"menu-button\",\n \"data-active\": active,\n className: variants({ variant, disabled }),\n onClick\n };\n\n const { linkComponent: LinkComponent } = useAdminUi();\n\n const content = to ? (\n <LinkComponent {...sharedProps} to={to} {...linkProps}>\n {icon}\n {text}\n </LinkComponent>\n ) : (\n <DivButton\n {...sharedProps}\n disabled={disabled}\n tabIndex={variant === \"group-label\" ? -1 : undefined}\n >\n {icon}\n {text}\n </DivButton>\n );\n\n return (\n <div className={cn(\"flex items-center w-full relative group/menu-root-button\", className)}>\n {content}\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 { SidebarMenuRootButton };\n"],"names":["variants","cva","SidebarMenuRootButton","className","onClick","variant","active","disabled","icon","pinnedIcon","action","text","to","linkProps","sharedProps","LinkComponent","useAdminUi","content","DivButton","undefined","cn"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sidebar/components/items/SidebarMenuRootButton.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuRootButton.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 { useAdminUi } from \"~/index.js\";\n\nconst variants = cva(\n [\n \"flex w-full items-center gap-sm rounded-md\",\n \"no-underline! text-neutral-primary cursor-pointer px-sm py-xs-plus text-left\",\n \"text-md outline-none transition-[width,height,padding]\",\n \"whitespace-nowrap overflow-hidden\",\n \"hover:bg-neutral-dark/5\",\n \"group-hover/menu-root-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=open]/menu-item-collapsible:font-semibold!\"\n ],\n {\n variants: {\n variant: {\n \"group-label\":\n \"text-neutral-muted! uppercase hover:bg-transparent! group-hover/menu-root-button:bg-transparent! focus:bg-transparent! cursor-default!\"\n },\n disabled: {\n true: \"pointer-events-none text-neutral-disabled!\"\n }\n }\n }\n);\n\ntype SidebarMenuButtonBaseProps = Omit<SidebarMenuItemProps, \"children\">;\n\nconst SidebarMenuRootButton = ({\n className,\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 to,\n ...linkProps\n}: SidebarMenuButtonBaseProps) => {\n const sharedProps = {\n \"data-sidebar\": \"menu-button\",\n \"data-active\": active,\n className: variants({ variant, disabled }),\n onClick\n };\n\n const { linkComponent: LinkComponent } = useAdminUi();\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 <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={cn(\"flex items-center w-full relative group/menu-root-button\", className)}>\n {content}\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 { SidebarMenuRootButton };\n"],"names":["variants","cva","SidebarMenuRootButton","className","onClick","variant","active","disabled","icon","pinnedIcon","action","text","badge","to","linkProps","sharedProps","LinkComponent","useAdminUi","content","SidebarMenuItemBadge","DivButton","undefined","cn"],"mappings":";;;;;AAOA,MAAMA,WAAWC,IACb;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH,EACD;IACI,UAAU;QACN,SAAS;YACL,eACI;QACR;QACA,UAAU;YACN,MAAM;QACV;IACJ;AACJ;AAKJ,MAAMC,wBAAwB,CAAC,EAC3BC,SAAS,EACTC,OAAO,EACPC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,IAAI,EAGJC,UAAU,EAEVC,MAAM,EACNC,IAAI,EACJC,KAAK,EACLC,EAAE,EACF,GAAGC,WACsB;IACzB,MAAMC,cAAc;QAChB,gBAAgB;QAChB,eAAeT;QACf,WAAWN,SAAS;YAAEK;YAASE;QAAS;QACxCH;IACJ;IAEA,MAAM,EAAE,eAAeY,aAAa,EAAE,GAAGC;IAEzC,MAAMC,UAAUL,KAAK,WAALA,GACZ,oBAACG,eAAAA;QAAe,GAAGD,WAAW;QAAE,IAAIF;QAAK,GAAGC,SAAS;OAChDN,MACAG,MACAC,SAAU,CAAiB,YAAjB,OAAOA,QAAqB,WAAX,GAAW,oBAACO,sBAAoBA;QAAC,MAAMP;SAAYA,KAAI,mBAGvF,oBAACQ,WAASA;QACL,GAAGL,WAAW;QACf,UAAUR;QACV,UAAUF,AAAY,kBAAZA,UAA4B,KAAKgB;OAE1Cb,MACAG,MACAC,SAAU,CAAiB,YAAjB,OAAOA,QAAqB,WAAX,GAAW,oBAACO,sBAAoBA;QAAC,MAAMP;SAAYA,KAAI;IAI3F,OAAO,WAAP,GACI,oBAAC;QAAI,WAAWU,GAAG,4DAA4DnB;OAC1Ee,SACAR,UAAU,WAAVA,GACG,oBAAC;QAAI,WAAU;OACVA;AAKrB"}
|
|
@@ -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
|
|
4
|
-
|
|
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:
|
|
9
|
-
original:
|
|
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<
|
|
17
|
-
original:
|
|
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:
|
|
43
|
+
Action: typeof SidebarMenuItemAction;
|
|
42
44
|
};
|
|
43
45
|
export { SidebarMenuRootItem, type SidebarMenuItemProps };
|
|
@@ -2,5 +2,5 @@ import React from "react";
|
|
|
2
2
|
import type { SidebarMenuItemProps } from "./SidebarMenuRootItem.js";
|
|
3
3
|
import { DistributedOmit } from "type-fest";
|
|
4
4
|
type SidebarMenuSubButtonProps = DistributedOmit<SidebarMenuItemProps, "children">;
|
|
5
|
-
declare const SidebarMenuSubButton: ({ onClick, variant, active, disabled, icon, pinnedIcon, action, text, className, to, ...linkProps }: SidebarMenuSubButtonProps) => React.JSX.Element;
|
|
5
|
+
declare const SidebarMenuSubButton: ({ onClick, variant, active, disabled, icon, pinnedIcon, action, text, badge, className, to, ...linkProps }: SidebarMenuSubButtonProps) => React.JSX.Element;
|
|
6
6
|
export { SidebarMenuSubButton };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import react from "react";
|
|
2
|
-
import { cva } from "../../../utils.js";
|
|
2
|
+
import { cn, cva } from "../../../utils.js";
|
|
3
3
|
import { DivButton } from "./DivButton.js";
|
|
4
|
+
import { SidebarMenuItemBadge } from "./SidebarMenuItemBadge.js";
|
|
4
5
|
import { useAdminUi } from "../../../index.js";
|
|
5
6
|
const variants = cva([
|
|
6
7
|
"flex w-full cursor-pointer items-center gap-sm",
|
|
@@ -26,7 +27,7 @@ const variants = cva([
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
});
|
|
29
|
-
const SidebarMenuSubButton = ({ onClick, variant, active, disabled, icon, pinnedIcon, action, text, className, to, ...linkProps })=>{
|
|
30
|
+
const SidebarMenuSubButton = ({ onClick, variant, active, disabled, icon, pinnedIcon, action, text, badge, className, to, ...linkProps })=>{
|
|
30
31
|
const { linkComponent: LinkComponent } = useAdminUi();
|
|
31
32
|
const sharedProps = {
|
|
32
33
|
"data-sidebar": "menu-sub-button",
|
|
@@ -34,21 +35,28 @@ const SidebarMenuSubButton = ({ onClick, variant, active, disabled, icon, pinned
|
|
|
34
35
|
className: variants({
|
|
35
36
|
variant,
|
|
36
37
|
disabled,
|
|
37
|
-
className
|
|
38
|
+
className: cn(className, action && "pr-xl")
|
|
38
39
|
}),
|
|
39
40
|
onClick
|
|
40
41
|
};
|
|
42
|
+
const textContent = /*#__PURE__*/ react.createElement("span", {
|
|
43
|
+
className: "truncate"
|
|
44
|
+
}, text);
|
|
41
45
|
const content = to ? /*#__PURE__*/ react.createElement(LinkComponent, {
|
|
42
46
|
...sharedProps,
|
|
43
47
|
to: to,
|
|
44
48
|
...linkProps
|
|
45
|
-
}, icon,
|
|
49
|
+
}, icon, textContent, badge && ("string" == typeof badge ? /*#__PURE__*/ react.createElement(SidebarMenuItemBadge, {
|
|
50
|
+
text: badge
|
|
51
|
+
}) : badge)) : /*#__PURE__*/ react.createElement(DivButton, {
|
|
46
52
|
...sharedProps,
|
|
47
53
|
disabled: disabled,
|
|
48
54
|
tabIndex: "group-label" === variant ? -1 : void 0
|
|
49
|
-
}, icon,
|
|
55
|
+
}, icon, textContent, badge && ("string" == typeof badge ? /*#__PURE__*/ react.createElement(SidebarMenuItemBadge, {
|
|
56
|
+
text: badge
|
|
57
|
+
}) : badge));
|
|
50
58
|
return /*#__PURE__*/ react.createElement("div", {
|
|
51
|
-
className: "flex items-center w-full relative group/menu-sub-button"
|
|
59
|
+
className: "flex items-center w-full min-w-0 relative group/menu-sub-button"
|
|
52
60
|
}, content, action && /*#__PURE__*/ react.createElement("div", {
|
|
53
61
|
className: "absolute top-0 right-0 mr-sm h-full flex items-center"
|
|
54
62
|
}, 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 { cva } from \"~/utils.js\";\nimport type { SidebarMenuItemProps } from \"./SidebarMenuRootItem.js\";\nimport { DivButton } from \"./DivButton.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 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 </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 </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","className","to","linkProps","LinkComponent","useAdminUi","sharedProps","content","DivButton","undefined"],"mappings":"
|
|
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"}
|
|
@@ -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"
|
|
120
|
+
className: "flex items-center min-w-0"
|
|
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"
|
|
130
|
+
className: "flex items-center min-w-0"
|
|
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", className)
|
|
156
|
+
className: cn("group/menu-sub-item relative flex min-w-0", 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\"}>\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":";;;;;;;;;;;;;AAeA,MAAMA,qBAAqB,CAAC,EACxBC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,cAAc,IAAI,EAClB,GAAGC,aACgB;IACnB,MAAM,EAAEC,YAAY,EAAEC,UAAU,EAAE,GAAGC;IACrC,MAAMC,UAAUC;IAChB,MAAM,CAACC,aAAaC,eAAe,GAAGC,SAAS;IAE/C,MAAMC,aAAaC,QAAQ,IAChBC,KAAK,CAAC,aAAa,EAAEV,aAAa,CAAC,EAAED,YAAY,IAAI,EAAE,GAC/D;QAACA,YAAY,IAAI;QAAEC;KAAa;IAEnC,MAAMW,oBAAoBF,QAAQ,IACvBN,QAAQ,iBAAiB,CAACK,aAClC;QAACL,QAAQ,gBAAgB;KAAC;IAE7B,MAAMS,wBAAwBC,YAAY;QACtCV,QAAQ,qBAAqB,CAACK;IAClC,GAAG;QAACG;KAAkB;IAEtB,MAAMG,WAAWX,QAAQ,YAAY,CAACK;IAGtC,MAAMO,iBAAiBN,QAAQ;QAC3B,IAAIV,YAAY,UAAU,EACtB,OAAOA,YAAY,UAAU;QAGjC,OAAOA,YAAY,IAAI,IAAIE;IAC/B,GAAG;QAACF,YAAY,UAAU;QAAEA,YAAY,IAAI;QAAEE;KAAW;IAIzDe,MAAAA,SAAe,CAAC;QACZ,IAAIpB,YAAYkB,UACZX,QAAQ,kBAAkB,CAAC;YACvB,IAAIK;YACJ,MAAMT,YAAY,IAAI;YACtB,MAAMgB;YACN,IAAIhB,YAAY,EAAE;YAClB,SAASA,YAAY,OAAO;YAC5B,QAAQA,YAAY,MAAM;QAC9B;aACG,IAAIH,YAAY,CAACkB,UAEpBX,QAAQ,oBAAoB,CAACK;IAErC,GAAG;QAACZ;QAAUkB;QAAUC;QAAgBP;QAAYT,YAAY,MAAM;KAAC;IAEvE,MAAMkB,YAAYR,QAAQ;QACtB,IAAI,CAACb,UACD,OAAOC;QAGX,MAAMqB,iBAAiB,CAACC;YACpBA,EAAE,eAAe;YACjBA,EAAE,cAAc;YAEhB,IAAIL,UACAX,QAAQ,oBAAoB,CAACK;iBAE7BL,QAAQ,kBAAkB,CAAC;gBACvB,IAAIK;gBACJ,MAAMT,YAAY,IAAI;gBACtB,MAAMgB;gBACN,IAAIhB,YAAY,EAAE;gBAClB,SAASA,YAAY,OAAO;gBAC5B,QAAQA,YAAY,MAAM;YAC9B;YAGJI,QAAQ,gBAAgB,CAACK;QAC7B;QAEA,MAAMY,YAAY,WAAZA,GACF,oBAACC,uBAAqBA;YAClB,SAASP,WAAW,WAAXA,GAAW,oBAACQ,iCAASA,QAAAA,WAAAA,GAAM,oBAACC,6BAAOA;YAC5C,SAASL;YACT,aAAa;;QAMrB,IAAIrB,QACA,OAAO,WAAP,GACI,oBAAC;YAAI,WAAU;WACVuB,WACAvB;QAKb,OAAOuB;IACX,GAAG;QAACxB;QAAUkB;QAAUC;QAAgBlB;QAAQM;QAASK;KAAW;IAEpEgB,UAAU;QACN,IAAIrB,QAAQ,QAAQ,EAAE;YAClB,MAAMsB,QAAQC,WAAW;gBACrBpB,eAAe;YACnB,GAAG;YACH,OAAO,IAAMqB,aAAaF;QAC9B;QACAnB,eAAe;IAEnB,GAAG;QAACH,QAAQ,QAAQ;KAAC;IAErB,MAAMyB,uBAAuBnB,QAAQ;QACjC,IAAI,CAACf,UACD,OAAO,WAAP,GACI,wDACI,oBAACmC,+BAA6BA;YAC1B,KAAK7B;YACL,SAASD,YAAY,OAAO;0BAEhC,oBAAC+B,sBAAoBA;YAAE,GAAG/B,WAAW;YAAE,QAAQkB;;QAK3D,MAAMc,UAAU1B,cAAc,WAAdA,GACZ,oBAAC2B,MAAIA;YACD,OAAO;YACP,MAAM;YACN,WACI;YAEJ,OAAO;YACP,gBAAc;YACd,oBAAM,oBAACC,gBAAsBA;aAEjC;QAEJ,MAAMC,oBAAoBtC,WAAW,WAAXA,GACtB,oBAAC;YAAI,WAAU;WACVqB,WACAc,WAGLA;QAGJ,IAAI,CAACjC,aACD,OAAO,WAAP,GACI,oBAAC;YAAI,WAAW;yBACZ,oBAAC+B,+BAA6BA;YAC1B,KAAK7B;YACL,SAASD,YAAY,OAAO;0BAEhC,oBAAC+B,sBAAyB/B;QAKtC,OAAO,WAAP,GACI,oBAACoC,YAAY,IAAI;YACb,WAAU;YACV,MAAMxB;YACN,cAAcC;yBAEd,oBAAC;YAAI,WAAW;yBACZ,oBAACiB,+BAA6BA;YAC1B,KAAK7B;YACL,SAASD,YAAY,OAAO;0BAEhC,oBAACoC,YAAY,OAAO;YAAC;yBACjB,oBAACL,sBAAoBA;YAChB,GAAG/B,WAAW;YACf,QAAQmC;YACR,WACI;4BAKhB,oBAACC,YAAY,OAAO,sBAChB,oBAACC,gBAAcA;YAAC,YAAYrC,YAAY,IAAI;WAAGL;IAI/D,GAAG;QACCA;QACAK;QACAC;QACAQ;QACAG;QACAC;QACAP;QACAT;QACAqB;KACH;IAED,OAAO,WAAP,GACI,wDACI,oBAAC;QACG,gBAAa;QACb,WAAWoB,GAAG,qCAAqC1C;OAElDiC,uBAEJlC,YAAY,CAACI,cAAcJ,WAAW;AAGnD"}
|
|
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":";;;;;;;;;;;;;AAeA,MAAMA,qBAAqB,CAAC,EACxBC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,cAAc,IAAI,EAClB,GAAGC,aACgB;IACnB,MAAM,EAAEC,YAAY,EAAEC,UAAU,EAAE,GAAGC;IACrC,MAAMC,UAAUC;IAChB,MAAM,CAACC,aAAaC,eAAe,GAAGC,SAAS;IAE/C,MAAMC,aAAaC,QAAQ,IAChBC,KAAK,CAAC,aAAa,EAAEV,aAAa,CAAC,EAAED,YAAY,IAAI,EAAE,GAC/D;QAACA,YAAY,IAAI;QAAEC;KAAa;IAEnC,MAAMW,oBAAoBF,QAAQ,IACvBN,QAAQ,iBAAiB,CAACK,aAClC;QAACL,QAAQ,gBAAgB;KAAC;IAE7B,MAAMS,wBAAwBC,YAAY;QACtCV,QAAQ,qBAAqB,CAACK;IAClC,GAAG;QAACG;KAAkB;IAEtB,MAAMG,WAAWX,QAAQ,YAAY,CAACK;IAGtC,MAAMO,iBAAiBN,QAAQ;QAC3B,IAAIV,YAAY,UAAU,EACtB,OAAOA,YAAY,UAAU;QAGjC,OAAOA,YAAY,IAAI,IAAIE;IAC/B,GAAG;QAACF,YAAY,UAAU;QAAEA,YAAY,IAAI;QAAEE;KAAW;IAIzDe,MAAAA,SAAe,CAAC;QACZ,IAAIpB,YAAYkB,UACZX,QAAQ,kBAAkB,CAAC;YACvB,IAAIK;YACJ,MAAMT,YAAY,IAAI;YACtB,MAAMgB;YACN,IAAIhB,YAAY,EAAE;YAClB,SAASA,YAAY,OAAO;YAC5B,QAAQA,YAAY,MAAM;QAC9B;aACG,IAAIH,YAAY,CAACkB,UAEpBX,QAAQ,oBAAoB,CAACK;IAErC,GAAG;QAACZ;QAAUkB;QAAUC;QAAgBP;QAAYT,YAAY,MAAM;KAAC;IAEvE,MAAMkB,YAAYR,QAAQ;QACtB,IAAI,CAACb,UACD,OAAOC;QAGX,MAAMqB,iBAAiB,CAACC;YACpBA,EAAE,eAAe;YACjBA,EAAE,cAAc;YAEhB,IAAIL,UACAX,QAAQ,oBAAoB,CAACK;iBAE7BL,QAAQ,kBAAkB,CAAC;gBACvB,IAAIK;gBACJ,MAAMT,YAAY,IAAI;gBACtB,MAAMgB;gBACN,IAAIhB,YAAY,EAAE;gBAClB,SAASA,YAAY,OAAO;gBAC5B,QAAQA,YAAY,MAAM;YAC9B;YAGJI,QAAQ,gBAAgB,CAACK;QAC7B;QAEA,MAAMY,YAAY,WAAZA,GACF,oBAACC,uBAAqBA;YAClB,SAASP,WAAW,WAAXA,GAAW,oBAACQ,iCAASA,QAAAA,WAAAA,GAAM,oBAACC,6BAAOA;YAC5C,SAASL;YACT,aAAa;;QAMrB,IAAIrB,QACA,OAAO,WAAP,GACI,oBAAC;YAAI,WAAU;WACVuB,WACAvB;QAKb,OAAOuB;IACX,GAAG;QAACxB;QAAUkB;QAAUC;QAAgBlB;QAAQM;QAASK;KAAW;IAEpEgB,UAAU;QACN,IAAIrB,QAAQ,QAAQ,EAAE;YAClB,MAAMsB,QAAQC,WAAW;gBACrBpB,eAAe;YACnB,GAAG;YACH,OAAO,IAAMqB,aAAaF;QAC9B;QACAnB,eAAe;IAEnB,GAAG;QAACH,QAAQ,QAAQ;KAAC;IAErB,MAAMyB,uBAAuBnB,QAAQ;QACjC,IAAI,CAACf,UACD,OAAO,WAAP,GACI,wDACI,oBAACmC,+BAA6BA;YAC1B,KAAK7B;YACL,SAASD,YAAY,OAAO;0BAEhC,oBAAC+B,sBAAoBA;YAAE,GAAG/B,WAAW;YAAE,QAAQkB;;QAK3D,MAAMc,UAAU1B,cAAc,WAAdA,GACZ,oBAAC2B,MAAIA;YACD,OAAO;YACP,MAAM;YACN,WACI;YAEJ,OAAO;YACP,gBAAc;YACd,oBAAM,oBAACC,gBAAsBA;aAEjC;QAEJ,MAAMC,oBAAoBtC,WAAW,WAAXA,GACtB,oBAAC;YAAI,WAAU;WACVqB,WACAc,WAGLA;QAGJ,IAAI,CAACjC,aACD,OAAO,WAAP,GACI,oBAAC;YAAI,WAAW;yBACZ,oBAAC+B,+BAA6BA;YAC1B,KAAK7B;YACL,SAASD,YAAY,OAAO;0BAEhC,oBAAC+B,sBAAyB/B;QAKtC,OAAO,WAAP,GACI,oBAACoC,YAAY,IAAI;YACb,WAAU;YACV,MAAMxB;YACN,cAAcC;yBAEd,oBAAC;YAAI,WAAW;yBACZ,oBAACiB,+BAA6BA;YAC1B,KAAK7B;YACL,SAASD,YAAY,OAAO;0BAEhC,oBAACoC,YAAY,OAAO;YAAC;yBACjB,oBAACL,sBAAoBA;YAChB,GAAG/B,WAAW;YACf,QAAQmC;YACR,WACI;4BAKhB,oBAACC,YAAY,OAAO,sBAChB,oBAACC,gBAAcA;YAAC,YAAYrC,YAAY,IAAI;WAAGL;IAI/D,GAAG;QACCA;QACAK;QACAC;QACAQ;QACAG;QACAC;QACAP;QACAT;QACAqB;KACH;IAED,OAAO,WAAP,GACI,wDACI,oBAAC;QACG,gBAAa;QACb,WAAWoB,GAAG,6CAA6C1C;OAE1DiC,uBAEJlC,YAAY,CAACI,cAAcJ,WAAW;AAGnD"}
|
|
@@ -24,7 +24,8 @@ const SidebarMenuSubItemIndentation = ({ lvl, variant })=>/*#__PURE__*/ react.cr
|
|
|
24
24
|
margin: "none",
|
|
25
25
|
variant: "strong",
|
|
26
26
|
className: separatorVariants({
|
|
27
|
-
variant
|
|
27
|
+
variant,
|
|
28
|
+
className: "!h-full"
|
|
28
29
|
})
|
|
29
30
|
}))));
|
|
30
31
|
export { SidebarMenuSubItemIndentation };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar/components/items/SidebarMenuSubItemIndentation.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuSubItemIndentation.tsx"],"sourcesContent":["import React from \"react\";\nimport { Separator } from \"~/Separator/index.js\";\n\nimport { cva, type VariantProps } from \"~/utils.js\";\n\nconst separatorVariants = cva([\"h-xl ml-px\"], {\n variants: {\n variant: {\n \"group-label\": \"h-[38px]!\"\n }\n }\n});\n\nexport interface SidebarMenuSubItemIndentationProps\n extends\n Omit<React.HTMLAttributes<HTMLLIElement>, \"content\">,\n VariantProps<typeof separatorVariants> {\n lvl: number;\n}\n\nconst SidebarMenuSubItemIndentation = ({ lvl, variant }: SidebarMenuSubItemIndentationProps) => {\n return (\n <div data-sidebar=\"indentation\" className={\"gap-x-xs flex mr-sm\"}>\n {Array.from({ length: lvl }, (_, index) => (\n <div data-sidebar={\"indentation-element\"} className={\"ml-md\"} key={lvl + index}>\n <Separator\n orientation={\"vertical\"}\n margin={\"none\"}\n variant={\"strong\"}\n className={separatorVariants({ variant })}\n />\n </div>\n ))}\n </div>\n );\n};\n\nexport { SidebarMenuSubItemIndentation };\n"],"names":["separatorVariants","cva","SidebarMenuSubItemIndentation","lvl","variant","Array","_","index","Separator"],"mappings":";;;AAKA,MAAMA,oBAAoBC,IAAI;IAAC;CAAa,EAAE;IAC1C,UAAU;QACN,SAAS;YACL,eAAe;QACnB;IACJ;AACJ;AASA,MAAMC,gCAAgC,CAAC,EAAEC,GAAG,EAAEC,OAAO,EAAsC,GAChF,WAAP,GACI,oBAAC;QAAI,gBAAa;QAAc,WAAW;OACtCC,MAAM,IAAI,CAAC;QAAE,QAAQF;IAAI,GAAG,CAACG,GAAGC,QAAAA,WAAAA,GAC7B,oBAAC;YAAI,gBAAc;YAAuB,WAAW;YAAS,KAAKJ,MAAMI;yBACrE,oBAACC,WAASA;YACN,aAAa;YACb,QAAQ;YACR,SAAS;YACT,WAAWR,kBAAkB;gBAAEI;
|
|
1
|
+
{"version":3,"file":"Sidebar/components/items/SidebarMenuSubItemIndentation.js","sources":["../../../../src/Sidebar/components/items/SidebarMenuSubItemIndentation.tsx"],"sourcesContent":["import React from \"react\";\nimport { Separator } from \"~/Separator/index.js\";\n\nimport { cva, type VariantProps } from \"~/utils.js\";\n\nconst separatorVariants = cva([\"h-xl ml-px\"], {\n variants: {\n variant: {\n \"group-label\": \"h-[38px]!\"\n }\n }\n});\n\nexport interface SidebarMenuSubItemIndentationProps\n extends\n Omit<React.HTMLAttributes<HTMLLIElement>, \"content\">,\n VariantProps<typeof separatorVariants> {\n lvl: number;\n}\n\nconst SidebarMenuSubItemIndentation = ({ lvl, variant }: SidebarMenuSubItemIndentationProps) => {\n return (\n <div data-sidebar=\"indentation\" className={\"gap-x-xs flex mr-sm\"}>\n {Array.from({ length: lvl }, (_, index) => (\n <div data-sidebar={\"indentation-element\"} className={\"ml-md\"} key={lvl + index}>\n <Separator\n orientation={\"vertical\"}\n margin={\"none\"}\n variant={\"strong\"}\n className={separatorVariants({ variant, className: \"!h-full\" })}\n />\n </div>\n ))}\n </div>\n );\n};\n\nexport { SidebarMenuSubItemIndentation };\n"],"names":["separatorVariants","cva","SidebarMenuSubItemIndentation","lvl","variant","Array","_","index","Separator"],"mappings":";;;AAKA,MAAMA,oBAAoBC,IAAI;IAAC;CAAa,EAAE;IAC1C,UAAU;QACN,SAAS;YACL,eAAe;QACnB;IACJ;AACJ;AASA,MAAMC,gCAAgC,CAAC,EAAEC,GAAG,EAAEC,OAAO,EAAsC,GAChF,WAAP,GACI,oBAAC;QAAI,gBAAa;QAAc,WAAW;OACtCC,MAAM,IAAI,CAAC;QAAE,QAAQF;IAAI,GAAG,CAACG,GAAGC,QAAAA,WAAAA,GAC7B,oBAAC;YAAI,gBAAc;YAAuB,WAAW;YAAS,KAAKJ,MAAMI;yBACrE,oBAACC,WAASA;YACN,aAAa;YACb,QAAQ;YACR,SAAS;YACT,WAAWR,kBAAkB;gBAAEI;gBAAS,WAAW;YAAU"}
|
package/Skeleton/Skeleton.d.ts
CHANGED
|
@@ -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?: "
|
|
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
|
|
10
|
-
|
|
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:
|
|
15
|
-
original:
|
|
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<
|
|
23
|
-
original:
|
|
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;
|
package/Skeleton/Skeleton.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { cn, cva, makeDecoratable } from "../utils.js";
|
|
3
|
-
const skeletonVariants = cva("
|
|
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
|
});
|
package/Skeleton/Skeleton.js.map
CHANGED
|
@@ -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(\"
|
|
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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Skeleton } from "./Skeleton.js";
|
|
3
3
|
declare const meta: Meta<typeof Skeleton>;
|
|
4
4
|
export default meta;
|
|
@@ -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;
|