@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer/components/Icon.js","sources":["../../../src/Drawer/components/Icon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"Drawer/components/Icon.js","sources":["../../../src/Drawer/components/Icon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport type { IconProps as IconComponentProps } from \"~/Icon/index.js\";\nimport { Icon as IconComponent } from \"~/Icon/index.js\";\n\ntype IconProps = IconComponentProps;\n\nconst IconBase = (props: IconProps) => {\n return <IconComponent size={\"lg\"} color={\"neutral-strong\"} {...props} />;\n};\n\nexport const Icon = makeDecoratable(\"Icon\", IconBase);\n"],"names":["IconBase","props","IconComponent","Icon","makeDecoratable"],"mappings":";;;AAOA,MAAMA,WAAW,CAACC,QACP,WAAP,GAAO,sCAACC,MAAaA;QAAC,MAAM;QAAM,OAAO;QAAmB,GAAGD,KAAK;;AAGjE,MAAME,YAAOC,gBAAgB,QAAQJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu/DropdownMenu.stories.js","sources":["../../src/DropdownMenu/DropdownMenu.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react-webpack5\";\nimport { DropdownMenu } from \"./DropdownMenu.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { ReactComponent as Cloud } from \"@webiny/icons/cloud.svg\";\nimport { ReactComponent as LogOut } from \"@webiny/icons/logout.svg\";\nimport { ReactComponent as LifeBuoy } from \"@webiny/icons/safety_check.svg\";\nimport { ReactComponent as CreditCard } from \"@webiny/icons/credit_score.svg\";\nimport { ReactComponent as Plus } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as PlusCircle } from \"@webiny/icons/add_circle.svg\";\nimport { ReactComponent as Settings } from \"@webiny/icons/settings.svg\";\nimport { ReactComponent as Users } from \"@webiny/icons/people.svg\";\nimport { ReactComponent as UserPlus } from \"@webiny/icons/person_add.svg\";\nimport { ReactComponent as User } from \"@webiny/icons/person.svg\";\nimport { ReactComponent as Keyboard } from \"@webiny/icons/keyboard.svg\";\nimport { ReactComponent as Mail } from \"@webiny/icons/mail.svg\";\nimport { ReactComponent as MessageSquare } from \"@webiny/icons/chat_bubble.svg\";\nimport { ReactComponent as LinkIcon } from \"@webiny/icons/link.svg\";\nimport { Text } from \"~/Text/index.js\";\n\nconst meta: Meta<typeof DropdownMenu> = {\n title: \"Components/Dropdown Menu\",\n component: DropdownMenu,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof DropdownMenu>;\n\nconst { Label, Separator, Group, Item, Link, CheckboxItem } = DropdownMenu;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2 (target: _blank)\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n target={\"_blank\"}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const SimpleMenuWithIcons: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithSubMenus: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon element={<User />} label={\"Profile\"} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon label={\"Team\"} element={<Users />} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon label={\"Invite user\"} element={<UserPlus />} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nconst TARGET_LEVELS = [\n {\n id: \"viewer\",\n label: \"Viewer\",\n description: \"Can view content, but not modify it\"\n },\n {\n id: \"editor\",\n label: \"Editor\",\n description: \"Can view and modify content\"\n },\n {\n id: \"owner\",\n label: \"Owner\",\n description: \"Can edit and manage content permissions\"\n }\n];\n\nexport const WithCheckboxItems: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n {TARGET_LEVELS.map(level => (\n <CheckboxItem\n key={level.id}\n checked={level.id === \"viewer\"}\n text={\n <div>\n <Text as={\"div\"}>{level.label}</Text>\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong\"}>\n {level.description}\n </Text>\n </div>\n }\n onClick={() => {\n console.log(\"Selected level:\", level.id);\n }}\n />\n ))}\n <DropdownMenu.Separator />\n <DropdownMenu.Item text={\"Remove access\"} />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithOnOpenChange: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n onOpenChange: opened => {\n console.log(`Menu is ${opened ? \"opened\" : \"closed\"}.`);\n },\n children: (\n <>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const Documentation: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {\n trigger: {\n description:\n \"The trigger element that opens the menu. Please refer to the example code for details.\"\n },\n children: {\n description: \"The content of the menu. Please refer to the example code for details.\"\n }\n }\n};\n"],"names":["meta","DropdownMenu","Label","Separator","Group","Item","Link","CheckboxItem","Default","Button","User","CreditCard","Settings","Keyboard","Users","UserPlus","Mail","MessageSquare","PlusCircle","Plus","LifeBuoy","Cloud","LogOut","LinkIcon","SimpleMenuWithIcons","WithSubMenus","TARGET_LEVELS","WithCheckboxItems","level","Text","console","WithOnOpenChange","opened","Documentation"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,MAAMA,OAAkC;IACpC,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,6BAAeD;AAIf,MAAM,EAAEE,OAAAA,KAAK,EAAEC,WAAAA,SAAS,EAAEC,OAAAA,KAAK,EAAEC,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAEC,cAAAA,YAAY,EAAE,GAAGN;AAEvD,MAAMO,UAAiB;IAC1B,MAAM;QACF,SAAS,WAAT,GAAS,oBAACC,QAAMA;YAAC,SAAQ;YAAU,MAAM;;QACzC,UAAU,WAAV,GACI,wDACI,oBAACP,OAAKA;YAAC,MAAM;0BACb,oBAACG,MAAIA;YAAC,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAO;gBAAW,uBAAS,oBAACK,2BAAIA;;YAAS,MAAM;0BACtE,oBAACN,OAAKA,MAAAA,WAAAA,GACF,oBAACC,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACM,iCAAUA;gBAAK,OAAO;;YACjD,MAAM;0BAEV,oBAACN,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACO,6BAAQA;gBAAK,OAAO;;YAC/C,MAAM;0BAEV,oBAACP,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACQ,6BAAQA;gBAAK,OAAO;;YAC/C,MAAM;2BAGd,oBAACV,WAASA,OAAAA,WAAAA,GACV,oBAACC,OAAKA,MAAAA,WAAAA,GACF,o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AAA,GACV,oBAACD,OAAKA;YAAC,MAAM;0BACb,oBAACI,MAAIA;YACD,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;0BAEtD,oBAACjB,MAAIA;YACD,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;0BAEtD,oBAACjB,MAAIA;YACD,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;;IAIlE;IACA,UAAU;QACN,SAAS;YACL,aACI;QACR;QACA,UAAU;YACN,aAAa;QACjB;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"DropdownMenu/DropdownMenu.stories.js","sources":["../../src/DropdownMenu/DropdownMenu.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { DropdownMenu } from \"./DropdownMenu.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { ReactComponent as Cloud } from \"@webiny/icons/cloud.svg\";\nimport { ReactComponent as LogOut } from \"@webiny/icons/logout.svg\";\nimport { ReactComponent as LifeBuoy } from \"@webiny/icons/safety_check.svg\";\nimport { ReactComponent as CreditCard } from \"@webiny/icons/credit_score.svg\";\nimport { ReactComponent as Plus } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as PlusCircle } from \"@webiny/icons/add_circle.svg\";\nimport { ReactComponent as Settings } from \"@webiny/icons/settings.svg\";\nimport { ReactComponent as Users } from \"@webiny/icons/people.svg\";\nimport { ReactComponent as UserPlus } from \"@webiny/icons/person_add.svg\";\nimport { ReactComponent as User } from \"@webiny/icons/person.svg\";\nimport { ReactComponent as Keyboard } from \"@webiny/icons/keyboard.svg\";\nimport { ReactComponent as Mail } from \"@webiny/icons/mail.svg\";\nimport { ReactComponent as MessageSquare } from \"@webiny/icons/chat_bubble.svg\";\nimport { ReactComponent as LinkIcon } from \"@webiny/icons/link.svg\";\nimport { Text } from \"~/Text/index.js\";\n\nconst meta: Meta<typeof DropdownMenu> = {\n title: \"Components/Dropdown Menu\",\n component: DropdownMenu,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof DropdownMenu>;\n\nconst { Label, Separator, Group, Item, Link, CheckboxItem } = DropdownMenu;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2 (target: _blank)\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n target={\"_blank\"}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const SimpleMenuWithIcons: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithSubMenus: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon element={<User />} label={\"Profile\"} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon label={\"Team\"} element={<Users />} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon label={\"Invite user\"} element={<UserPlus />} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nconst TARGET_LEVELS = [\n {\n id: \"viewer\",\n label: \"Viewer\",\n description: \"Can view content, but not modify it\"\n },\n {\n id: \"editor\",\n label: \"Editor\",\n description: \"Can view and modify content\"\n },\n {\n id: \"owner\",\n label: \"Owner\",\n description: \"Can edit and manage content permissions\"\n }\n];\n\nexport const WithCheckboxItems: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n {TARGET_LEVELS.map(level => (\n <CheckboxItem\n key={level.id}\n checked={level.id === \"viewer\"}\n text={\n <div>\n <Text as={\"div\"}>{level.label}</Text>\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong\"}>\n {level.description}\n </Text>\n </div>\n }\n onClick={() => {\n console.log(\"Selected level:\", level.id);\n }}\n />\n ))}\n <DropdownMenu.Separator />\n <DropdownMenu.Item text={\"Remove access\"} />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithOnOpenChange: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n onOpenChange: opened => {\n console.log(`Menu is ${opened ? \"opened\" : \"closed\"}.`);\n },\n children: (\n <>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const Documentation: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {\n trigger: {\n description:\n \"The trigger element that opens the menu. Please refer to the example code for details.\"\n },\n children: {\n description: \"The content of the menu. Please refer to the example code for details.\"\n }\n }\n};\n"],"names":["meta","DropdownMenu","Label","Separator","Group","Item","Link","CheckboxItem","Default","Button","User","CreditCard","Settings","Keyboard","Users","UserPlus","Mail","MessageSquare","PlusCircle","Plus","LifeBuoy","Cloud","LogOut","LinkIcon","SimpleMenuWithIcons","WithSubMenus","TARGET_LEVELS","WithCheckboxItems","level","Text","console","WithOnOpenChange","opened","Documentation"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,MAAMA,OAAkC;IACpC,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,6BAAeD;AAIf,MAAM,EAAEE,OAAAA,KAAK,EAAEC,WAAAA,SAAS,EAAEC,OAAAA,KAAK,EAAEC,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAEC,cAAAA,YAAY,EAAE,GAAGN;AAEvD,MAAMO,UAAiB;IAC1B,MAAM;QACF,SAAS,WAAT,GAAS,oBAACC,QAAMA;YAAC,SAAQ;YAAU,MAAM;;QACzC,UAAU,WAAV,GACI,wDACI,oBAACP,OAAKA;YAAC,MAAM;0BACb,oBAACG,MAAIA;YAAC,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAO;gBAAW,uBAAS,oBAACK,2BA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wBAAIA;;YAClD,MAAM;2BAGd,oBAAChB,WAASA,OAAAA,WAAAA,GACV,oBAACE,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAO;gBAAW,uBAAS,oBAACe,iCAAQA;;YACrD,MAAM;0BAEV,oBAACf,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAO;gBAAO,uBAAS,oBAACgB,gBAAKA;;YAC9C,MAAM;YACN;0BAEJ,oBAAClB,WAASA,OAAAA,WAAAA,GACV,oBAACE,MAAIA;YACD,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAO;gBAAW,uBAAS,oBAACiB,2BAAMA;;YACnD,MAAM;0BAEV,oBAACnB,WAASA,OAAAA,WAAAA,GACV,oBAACD,OAAKA;YAAC,MAAM;0BACb,oBAACI,MAAIA;YACD,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;0BAEtD,oBAACjB,MAAIA;YACD,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;0BAEtD,oBAACjB,MAAIA;YACD,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;;IAIlE;IACA,UAAU;QACN,SAAS;YACL,aACI;QACR;QACA,UAAU;YACN,aAAa;QACjB;IACJ;AACJ"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { type DropdownMenuItemIconProps } from "./DropdownMenuItemIcon.js";
|
|
2
|
+
import { DropdownMenuItemIcon, type DropdownMenuItemIconProps } from "./DropdownMenuItemIcon.js";
|
|
3
3
|
import { LinkComponentProps } from "../../index.js";
|
|
4
4
|
interface DropdownMenuItemBaseProps {
|
|
5
5
|
icon?: React.ReactNode;
|
|
6
6
|
readOnly?: boolean;
|
|
7
|
+
variant?: "destructive";
|
|
7
8
|
text?: React.ReactNode;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
onClick?: React.MouseEventHandler;
|
|
11
|
+
/**
|
|
12
|
+
* Keep the menu open after selecting this item. Useful for items that toggle a value
|
|
13
|
+
* (e.g. a checkbox), where the user expects to make multiple selections in one session.
|
|
14
|
+
*/
|
|
15
|
+
preventClose?: boolean;
|
|
10
16
|
}
|
|
11
17
|
type DropdownMenuItemButtonProps = (DropdownMenuItemBaseProps & React.HTMLAttributes<HTMLDivElement>) & {
|
|
12
18
|
to?: never;
|
|
@@ -32,6 +38,6 @@ declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuItem
|
|
|
32
38
|
displayName: string;
|
|
33
39
|
}>) => (props: unknown) => React.JSX.Element;
|
|
34
40
|
} & {
|
|
35
|
-
Icon:
|
|
41
|
+
Icon: typeof DropdownMenuItemIcon;
|
|
36
42
|
};
|
|
37
43
|
export { DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuItemButtonProps, type DropdownMenuItemLinkProps, type DropdownMenuItemIconProps };
|
|
@@ -16,6 +16,12 @@ const variants = cva([
|
|
|
16
16
|
"[&_a]:no-underline! [&_a]:text-neutral-primary!"
|
|
17
17
|
], {
|
|
18
18
|
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
destructive: [
|
|
21
|
+
"text-destructive-primary!",
|
|
22
|
+
"[&_svg]:fill-destructive"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
19
25
|
readOnly: {
|
|
20
26
|
true: "pointer-events-none"
|
|
21
27
|
}
|
|
@@ -24,7 +30,7 @@ const variants = cva([
|
|
|
24
30
|
readOnly: false
|
|
25
31
|
}
|
|
26
32
|
});
|
|
27
|
-
const DropdownMenuItemBase = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, icon, text, readOnly, disabled, onClick, children, ...linkProps }, ref)=>{
|
|
33
|
+
const DropdownMenuItemBase = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, icon, text, readOnly, variant, disabled, onClick, preventClose, children, ...linkProps }, ref)=>{
|
|
28
34
|
const { linkComponent: LinkComponent } = useAdminUi();
|
|
29
35
|
if (children) return /*#__PURE__*/ __rspack_external_react.createElement(DropdownMenuSubRoot, null, /*#__PURE__*/ __rspack_external_react.createElement(DropdownMenuSubTrigger, null, icon, /*#__PURE__*/ __rspack_external_react.createElement("span", null, text)), /*#__PURE__*/ __rspack_external_react.createElement(DropdownMenuPortal, null, /*#__PURE__*/ __rspack_external_react.createElement(DropdownMenuSubContent, null, children)));
|
|
30
36
|
const sharedProps = {
|
|
@@ -43,8 +49,10 @@ const DropdownMenuItemBase = /*#__PURE__*/ __rspack_external_react.forwardRef(({
|
|
|
43
49
|
disabled: disabled,
|
|
44
50
|
ref: ref,
|
|
45
51
|
className: cn(variants({
|
|
46
|
-
readOnly
|
|
47
|
-
|
|
52
|
+
readOnly,
|
|
53
|
+
variant
|
|
54
|
+
}), className),
|
|
55
|
+
onSelect: preventClose ? (event)=>event.preventDefault() : void 0
|
|
48
56
|
}, content);
|
|
49
57
|
});
|
|
50
58
|
DropdownMenuItemBase.displayName = DropdownMenu.Item.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu/components/DropdownMenuItem.js","sources":["../../../src/DropdownMenu/components/DropdownMenuItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, cva, makeDecoratable } from \"~/utils.js\";\nimport { DropdownMenuSubRoot } from \"./DropdownMenuSubRoot.js\";\nimport { DropdownMenuSubTrigger } from \"./DropdownMenuSubTrigger.js\";\nimport { DropdownMenuPortal } from \"./DropdownMenuPortal.js\";\nimport { DropdownMenuSubContent } from \"./DropdownMenuSubContent.js\";\nimport { DropdownMenuItemIcon, type DropdownMenuItemIconProps } from \"./DropdownMenuItemIcon.js\";\nimport { LinkComponentProps, useAdminUi } from \"~/index.js\";\n\ninterface DropdownMenuItemBaseProps {\n icon?: React.ReactNode;\n readOnly?: boolean;\n text?: React.ReactNode;\n disabled?: boolean;\n onClick?: React.MouseEventHandler;\n}\n\ntype DropdownMenuItemButtonProps = (DropdownMenuItemBaseProps &\n React.HTMLAttributes<HTMLDivElement>) & { to?: never };\ntype DropdownMenuItemLinkProps = DropdownMenuItemBaseProps & LinkComponentProps;\n\ntype DropdownMenuItemProps = DropdownMenuItemButtonProps | DropdownMenuItemLinkProps;\n\nconst variants = cva(\n [\n \"group relative cursor-default select-none items-center rounded-sm\",\n \"text-md text-neutral-primary no-underline!\",\n \"px-xs-plus outline-none transition-colors\",\n \"[&_svg]:fill-neutral-xstrong [&_svg]:pointer-events-none [&_svg]:size-md [&_svg]:shrink-0\",\n \"data-disabled:pointer-events-none data-disabled:text-neutral-disabled\",\n \"[&_a]:no-underline! [&_a]:text-neutral-primary!\"\n ],\n {\n variants: {\n readOnly: {\n true: \"pointer-events-none\"\n }\n },\n defaultVariants: {\n readOnly: false\n }\n }\n);\n\nconst DropdownMenuItemBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(({
|
|
1
|
+
{"version":3,"file":"DropdownMenu/components/DropdownMenuItem.js","sources":["../../../src/DropdownMenu/components/DropdownMenuItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, cva, makeDecoratable } from \"~/utils.js\";\nimport { DropdownMenuSubRoot } from \"./DropdownMenuSubRoot.js\";\nimport { DropdownMenuSubTrigger } from \"./DropdownMenuSubTrigger.js\";\nimport { DropdownMenuPortal } from \"./DropdownMenuPortal.js\";\nimport { DropdownMenuSubContent } from \"./DropdownMenuSubContent.js\";\nimport { DropdownMenuItemIcon, type DropdownMenuItemIconProps } from \"./DropdownMenuItemIcon.js\";\nimport { LinkComponentProps, useAdminUi } from \"~/index.js\";\n\ninterface DropdownMenuItemBaseProps {\n icon?: React.ReactNode;\n readOnly?: boolean;\n variant?: \"destructive\";\n text?: React.ReactNode;\n disabled?: boolean;\n onClick?: React.MouseEventHandler;\n /**\n * Keep the menu open after selecting this item. Useful for items that toggle a value\n * (e.g. a checkbox), where the user expects to make multiple selections in one session.\n */\n preventClose?: boolean;\n}\n\ntype DropdownMenuItemButtonProps = (DropdownMenuItemBaseProps &\n React.HTMLAttributes<HTMLDivElement>) & { to?: never };\ntype DropdownMenuItemLinkProps = DropdownMenuItemBaseProps & LinkComponentProps;\n\ntype DropdownMenuItemProps = DropdownMenuItemButtonProps | DropdownMenuItemLinkProps;\n\nconst variants = cva(\n [\n \"group relative cursor-default select-none items-center rounded-sm\",\n \"text-md text-neutral-primary no-underline!\",\n \"px-xs-plus outline-none transition-colors\",\n \"[&_svg]:fill-neutral-xstrong [&_svg]:pointer-events-none [&_svg]:size-md [&_svg]:shrink-0\",\n \"data-disabled:pointer-events-none data-disabled:text-neutral-disabled\",\n \"[&_a]:no-underline! [&_a]:text-neutral-primary!\"\n ],\n {\n variants: {\n variant: {\n destructive: [\"text-destructive-primary!\", \"[&_svg]:fill-destructive\"]\n },\n readOnly: {\n true: \"pointer-events-none\"\n }\n },\n defaultVariants: {\n readOnly: false\n }\n }\n);\n\nconst DropdownMenuItemBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(\n (\n {\n className,\n icon,\n text,\n readOnly,\n variant,\n disabled,\n onClick,\n preventClose,\n children,\n ...linkProps\n },\n ref\n ) => {\n const { linkComponent: LinkComponent } = useAdminUi();\n\n if (children) {\n return (\n <DropdownMenuSubRoot>\n <DropdownMenuSubTrigger>\n {icon}\n <span>{text}</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuPortal>\n <DropdownMenuSubContent>{children}</DropdownMenuSubContent>\n </DropdownMenuPortal>\n </DropdownMenuSubRoot>\n );\n }\n const sharedProps = {\n className: cn(\n \"flex px-sm py-xs-plus gap-sm-extra items-center text-md rounded-sm transition-colors group-focus:bg-neutral-dimmed\",\n {\n \"[&_svg]:fill-neutral-disabled!\": disabled\n }\n )\n };\n\n const content = linkProps.to ? (\n <LinkComponent {...sharedProps} {...linkProps}>\n {icon}\n <span>{text}</span>\n </LinkComponent>\n ) : (\n <div {...sharedProps} onClick={onClick}>\n {icon}\n <span>{text}</span>\n </div>\n );\n\n return (\n <DropdownMenuPrimitive.Item\n disabled={disabled}\n ref={ref}\n className={cn(variants({ readOnly, variant }), className)}\n onSelect={preventClose ? event => event.preventDefault() : undefined}\n >\n {content}\n </DropdownMenuPrimitive.Item>\n );\n }\n);\n\nDropdownMenuItemBase.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DecoratableDropdownMenuItem = makeDecoratable(\"DropdownMenuItem\", DropdownMenuItemBase);\n\nconst DropdownMenuItem = Object.assign(DecoratableDropdownMenuItem, {\n Icon: DropdownMenuItemIcon\n});\n\nexport {\n DropdownMenuItem,\n type DropdownMenuItemProps,\n type DropdownMenuItemButtonProps,\n type DropdownMenuItemLinkProps,\n type DropdownMenuItemIconProps\n};\n"],"names":["variants","cva","DropdownMenuItemBase","React","className","icon","text","readOnly","variant","disabled","onClick","preventClose","children","linkProps","ref","LinkComponent","useAdminUi","DropdownMenuSubRoot","DropdownMenuSubTrigger","DropdownMenuPortal","DropdownMenuSubContent","sharedProps","cn","content","DropdownMenuPrimitive","event","undefined","DecoratableDropdownMenuItem","makeDecoratable","DropdownMenuItem","Object","DropdownMenuItemIcon"],"mappings":";;;;;;;;;AA8BA,MAAMA,WAAWC,IACb;IACI;IACA;IACA;IACA;IACA;IACA;CACH,EACD;IACI,UAAU;QACN,SAAS;YACL,aAAa;gBAAC;gBAA6B;aAA2B;QAC1E;QACA,UAAU;YACN,MAAM;QACV;IACJ;IACA,iBAAiB;QACb,UAAU;IACd;AACJ;AAGJ,MAAMC,uBAAuB,WAAHA,GAAGC,wBAAAA,UAAgB,CAIzC,CACI,EACIC,SAAS,EACTC,IAAI,EACJC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,YAAY,EACZC,QAAQ,EACR,GAAGC,WACN,EACDC;IAEA,MAAM,EAAE,eAAeC,aAAa,EAAE,GAAGC;IAEzC,IAAIJ,UACA,OAAO,WAAP,GACI,sCAACK,qBAAmBA,MAAAA,WAAAA,GAChB,sCAACC,wBAAsBA,MAClBb,MAAAA,WAAAA,GACD,sCAAC,cAAMC,QAAAA,WAAAA,GAEX,sCAACa,oBAAkBA,MAAAA,WAAAA,GACf,sCAACC,wBAAsBA,MAAER;IAKzC,MAAMS,cAAc;QAChB,WAAWC,GACP,sHACA;YACI,kCAAkCb;QACtC;IAER;IAEA,MAAMc,UAAUV,UAAU,EAAE,GAAG,WAAH,GACxB,sCAACE,eAAAA;QAAe,GAAGM,WAAW;QAAG,GAAGR,SAAS;OACxCR,MAAAA,WAAAA,GACD,sCAAC,cAAMC,SAAAA,WAAAA,GAGX,sCAAC;QAAK,GAAGe,WAAW;QAAE,SAASX;OAC1BL,MAAAA,WAAAA,GACD,sCAAC,cAAMC;IAIf,OAAO,WAAP,GACI,sCAACkB,aAAAA,IAA0B;QACvB,UAAUf;QACV,KAAKK;QACL,WAAWQ,GAAGtB,SAAS;YAAEO;YAAUC;QAAQ,IAAIJ;QAC/C,UAAUO,eAAec,CAAAA,QAASA,MAAM,cAAc,KAAKC;OAE1DH;AAGb;AAGJrB,qBAAqB,WAAW,GAAGsB,aAAAA,IAAAA,CAAAA,WAAsC;AAEzE,MAAMG,8BAA8BC,gBAAgB,oBAAoB1B;AAExE,MAAM2B,mBAAmBC,OAAO,MAAM,CAACH,6BAA6B;IAChE,MAAMI;AACV"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type DropdownMenuItemLinkProps } from "./DropdownMenuItem.js";
|
|
3
|
-
import { type DropdownMenuItemIconProps } from "./DropdownMenuItemIcon.js";
|
|
3
|
+
import { DropdownMenuItemIcon, type DropdownMenuItemIconProps } from "./DropdownMenuItemIcon.js";
|
|
4
4
|
export type DropdownMenuLinkProps = DropdownMenuItemLinkProps;
|
|
5
|
-
declare const
|
|
6
|
-
|
|
5
|
+
declare const DropdownMenuLinkBase: (props: DropdownMenuLinkProps) => React.JSX.Element;
|
|
6
|
+
declare const DropdownMenuLink: typeof DropdownMenuLinkBase & {
|
|
7
|
+
original: typeof DropdownMenuLinkBase;
|
|
7
8
|
originalName: string;
|
|
8
9
|
displayName: string;
|
|
9
10
|
} & {
|
|
10
|
-
original:
|
|
11
|
-
original:
|
|
11
|
+
original: typeof DropdownMenuLinkBase & {
|
|
12
|
+
original: typeof DropdownMenuLinkBase;
|
|
12
13
|
originalName: string;
|
|
13
14
|
displayName: string;
|
|
14
15
|
};
|
|
15
16
|
originalName: string;
|
|
16
17
|
displayName: string;
|
|
17
18
|
} & {
|
|
18
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
19
|
-
original:
|
|
19
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DropdownMenuLinkBase & {
|
|
20
|
+
original: typeof DropdownMenuLinkBase;
|
|
20
21
|
originalName: string;
|
|
21
22
|
displayName: string;
|
|
22
23
|
}>) => (props: unknown) => React.JSX.Element;
|
|
23
24
|
} & {
|
|
24
|
-
Icon:
|
|
25
|
+
Icon: typeof DropdownMenuItemIcon;
|
|
25
26
|
};
|
|
26
27
|
export { DropdownMenuLink, type DropdownMenuItemLinkProps, type DropdownMenuItemIconProps };
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type SeparatorProps } from "../../Separator/index.js";
|
|
3
3
|
type DropdownMenuSeparatorProps = SeparatorProps;
|
|
4
|
-
declare const
|
|
5
|
-
|
|
4
|
+
declare const DropdownMenuSeparatorBase: (props: DropdownMenuSeparatorProps) => React.JSX.Element;
|
|
5
|
+
declare const DropdownMenuSeparator: typeof DropdownMenuSeparatorBase & {
|
|
6
|
+
original: typeof DropdownMenuSeparatorBase;
|
|
6
7
|
originalName: string;
|
|
7
8
|
displayName: string;
|
|
8
9
|
} & {
|
|
9
|
-
original:
|
|
10
|
-
original:
|
|
10
|
+
original: typeof DropdownMenuSeparatorBase & {
|
|
11
|
+
original: typeof DropdownMenuSeparatorBase;
|
|
11
12
|
originalName: string;
|
|
12
13
|
displayName: string;
|
|
13
14
|
};
|
|
14
15
|
originalName: string;
|
|
15
16
|
displayName: string;
|
|
16
17
|
} & {
|
|
17
|
-
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<
|
|
18
|
-
original:
|
|
18
|
+
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof DropdownMenuSeparatorBase & {
|
|
19
|
+
original: typeof DropdownMenuSeparatorBase;
|
|
19
20
|
originalName: string;
|
|
20
21
|
displayName: string;
|
|
21
22
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface EditableTitleProps {
|
|
3
|
+
/**
|
|
4
|
+
* The current title value.
|
|
5
|
+
*/
|
|
6
|
+
value: string;
|
|
7
|
+
/**
|
|
8
|
+
* Called with the new value when editing is committed (blur or Enter).
|
|
9
|
+
*/
|
|
10
|
+
onCommit: (value: string) => void;
|
|
11
|
+
/**
|
|
12
|
+
* If true, the title is rendered as plain (non-editable) text.
|
|
13
|
+
*/
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Placeholder shown in the input while editing.
|
|
17
|
+
*/
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Focus the input when entering edit mode. Defaults to `true`.
|
|
21
|
+
*/
|
|
22
|
+
autoFocus?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Select the input's content when entering edit mode. Defaults to `true`.
|
|
25
|
+
*/
|
|
26
|
+
autoSelect?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Content rendered before the title (e.g. a language tag).
|
|
29
|
+
*/
|
|
30
|
+
startContent?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Tooltip content shown when hovering the resting title.
|
|
33
|
+
*/
|
|
34
|
+
tooltip?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Controls the editing state. When provided, the component is controlled
|
|
37
|
+
* and `onEditingChange` must be used to react to state changes.
|
|
38
|
+
*/
|
|
39
|
+
isEditing?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Called whenever the editing state should change.
|
|
42
|
+
*/
|
|
43
|
+
onEditingChange?: (editing: boolean) => void;
|
|
44
|
+
className?: string;
|
|
45
|
+
"data-testid"?: string;
|
|
46
|
+
}
|
|
47
|
+
declare const DecoratableEditableTitle: ({ value, onCommit, readOnly, placeholder, autoFocus, autoSelect, startContent, tooltip, isEditing: controlledEditing, onEditingChange, className, "data-testid": dataTestId }: EditableTitleProps) => React.JSX.Element;
|
|
48
|
+
declare const EditableTitle: typeof DecoratableEditableTitle & {
|
|
49
|
+
original: typeof DecoratableEditableTitle;
|
|
50
|
+
originalName: string;
|
|
51
|
+
displayName: string;
|
|
52
|
+
} & {
|
|
53
|
+
original: typeof DecoratableEditableTitle & {
|
|
54
|
+
original: typeof DecoratableEditableTitle;
|
|
55
|
+
originalName: string;
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|
|
58
|
+
originalName: string;
|
|
59
|
+
displayName: string;
|
|
60
|
+
} & {
|
|
61
|
+
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof DecoratableEditableTitle & {
|
|
62
|
+
original: typeof DecoratableEditableTitle;
|
|
63
|
+
originalName: string;
|
|
64
|
+
displayName: string;
|
|
65
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
66
|
+
};
|
|
67
|
+
export { EditableTitle, type EditableTitleProps };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import react, { useCallback, useState } from "react";
|
|
2
|
+
import { Heading } from "../Heading/index.js";
|
|
3
|
+
import { Input } from "../Input/index.js";
|
|
4
|
+
import { Tooltip } from "../Tooltip/index.js";
|
|
5
|
+
import { cn, makeDecoratable } from "../utils.js";
|
|
6
|
+
const DecoratableEditableTitle = ({ value, onCommit, readOnly, placeholder, autoFocus = true, autoSelect = true, startContent, tooltip, isEditing: controlledEditing, onEditingChange, className, "data-testid": dataTestId })=>{
|
|
7
|
+
const isControlled = void 0 !== controlledEditing;
|
|
8
|
+
const [uncontrolledEditing, setUncontrolledEditing] = useState(false);
|
|
9
|
+
const [localValue, setLocalValue] = useState();
|
|
10
|
+
const isEditing = isControlled ? controlledEditing : uncontrolledEditing;
|
|
11
|
+
const setEditing = useCallback((editing)=>{
|
|
12
|
+
if (!isControlled) setUncontrolledEditing(editing);
|
|
13
|
+
onEditingChange?.(editing);
|
|
14
|
+
}, [
|
|
15
|
+
isControlled,
|
|
16
|
+
onEditingChange
|
|
17
|
+
]);
|
|
18
|
+
const startEditing = useCallback(()=>{
|
|
19
|
+
setLocalValue(value);
|
|
20
|
+
setEditing(true);
|
|
21
|
+
}, [
|
|
22
|
+
value,
|
|
23
|
+
setEditing
|
|
24
|
+
]);
|
|
25
|
+
const commit = useCallback((next)=>{
|
|
26
|
+
onCommit(next);
|
|
27
|
+
setLocalValue(void 0);
|
|
28
|
+
setEditing(false);
|
|
29
|
+
}, [
|
|
30
|
+
onCommit,
|
|
31
|
+
setEditing
|
|
32
|
+
]);
|
|
33
|
+
const cancel = useCallback(()=>{
|
|
34
|
+
setLocalValue(void 0);
|
|
35
|
+
setEditing(false);
|
|
36
|
+
}, [
|
|
37
|
+
setEditing
|
|
38
|
+
]);
|
|
39
|
+
const wrapper = (children)=>/*#__PURE__*/ react.createElement("div", {
|
|
40
|
+
className: cn("flex min-w-0 flex-row items-center gap-sm", className)
|
|
41
|
+
}, startContent, children);
|
|
42
|
+
if (readOnly) return wrapper(/*#__PURE__*/ react.createElement(Heading, {
|
|
43
|
+
level: 5,
|
|
44
|
+
className: "text-accent-primary truncate px-sm-extra py-xs-plus",
|
|
45
|
+
"data-testid": dataTestId
|
|
46
|
+
}, value));
|
|
47
|
+
if (isEditing) return wrapper(/*#__PURE__*/ react.createElement(Input, {
|
|
48
|
+
autoFocus: autoFocus,
|
|
49
|
+
autoSelect: autoSelect,
|
|
50
|
+
size: "md",
|
|
51
|
+
variant: "secondary",
|
|
52
|
+
placeholder: placeholder,
|
|
53
|
+
value: localValue ?? value,
|
|
54
|
+
onChange: setLocalValue,
|
|
55
|
+
onBlur: (e)=>commit(e.currentTarget.value),
|
|
56
|
+
onEnter: (e)=>commit(e.currentTarget.value),
|
|
57
|
+
onEscape: cancel
|
|
58
|
+
}));
|
|
59
|
+
const trigger = /*#__PURE__*/ react.createElement("div", {
|
|
60
|
+
onClick: startEditing,
|
|
61
|
+
"data-testid": dataTestId,
|
|
62
|
+
className: cn("font-sans text-h5 cursor-pointer truncate rounded-md", "px-[calc(var(--padding-sm-extra)-var(--border-width-sm))] py-[calc(var(--padding-xs)-var(--border-width-sm))]", "border-sm border-transparent text-accent-primary", "hover:bg-neutral-light")
|
|
63
|
+
}, value);
|
|
64
|
+
return wrapper(tooltip ? /*#__PURE__*/ react.createElement(Tooltip, {
|
|
65
|
+
side: "bottom",
|
|
66
|
+
content: tooltip,
|
|
67
|
+
trigger: trigger
|
|
68
|
+
}) : trigger);
|
|
69
|
+
};
|
|
70
|
+
const EditableTitle = makeDecoratable("EditableTitle", DecoratableEditableTitle);
|
|
71
|
+
export { EditableTitle };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=EditableTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditableTitle/EditableTitle.js","sources":["../../src/EditableTitle/EditableTitle.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { Heading } from \"~/Heading/index.js\";\nimport { Input } from \"~/Input/index.js\";\nimport { Tooltip } from \"~/Tooltip/index.js\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\n\ninterface EditableTitleProps {\n /**\n * The current title value.\n */\n value: string;\n /**\n * Called with the new value when editing is committed (blur or Enter).\n */\n onCommit: (value: string) => void;\n /**\n * If true, the title is rendered as plain (non-editable) text.\n */\n readOnly?: boolean;\n /**\n * Placeholder shown in the input while editing.\n */\n placeholder?: string;\n /**\n * Focus the input when entering edit mode. Defaults to `true`.\n */\n autoFocus?: boolean;\n /**\n * Select the input's content when entering edit mode. Defaults to `true`.\n */\n autoSelect?: boolean;\n /**\n * Content rendered before the title (e.g. a language tag).\n */\n startContent?: React.ReactNode;\n /**\n * Tooltip content shown when hovering the resting title.\n */\n tooltip?: React.ReactNode;\n /**\n * Controls the editing state. When provided, the component is controlled\n * and `onEditingChange` must be used to react to state changes.\n */\n isEditing?: boolean;\n /**\n * Called whenever the editing state should change.\n */\n onEditingChange?: (editing: boolean) => void;\n className?: string;\n \"data-testid\"?: string;\n}\n\nconst DecoratableEditableTitle = ({\n value,\n onCommit,\n readOnly,\n placeholder,\n autoFocus = true,\n autoSelect = true,\n startContent,\n tooltip,\n isEditing: controlledEditing,\n onEditingChange,\n className,\n \"data-testid\": dataTestId\n}: EditableTitleProps) => {\n const isControlled = controlledEditing !== undefined;\n const [uncontrolledEditing, setUncontrolledEditing] = useState(false);\n const [localValue, setLocalValue] = useState<string | undefined>();\n\n const isEditing = isControlled ? controlledEditing : uncontrolledEditing;\n\n const setEditing = useCallback(\n (editing: boolean) => {\n if (!isControlled) {\n setUncontrolledEditing(editing);\n }\n onEditingChange?.(editing);\n },\n [isControlled, onEditingChange]\n );\n\n const startEditing = useCallback(() => {\n setLocalValue(value);\n setEditing(true);\n }, [value, setEditing]);\n\n const commit = useCallback(\n (next: string) => {\n onCommit(next);\n setLocalValue(undefined);\n setEditing(false);\n },\n [onCommit, setEditing]\n );\n\n const cancel = useCallback(() => {\n setLocalValue(undefined);\n setEditing(false);\n }, [setEditing]);\n\n const wrapper = (children: React.ReactNode) => (\n <div className={cn(\"flex min-w-0 flex-row items-center gap-sm\", className)}>\n {startContent}\n {children}\n </div>\n );\n\n if (readOnly) {\n return wrapper(\n <Heading\n level={5}\n className={\"text-accent-primary truncate px-sm-extra py-xs-plus\"}\n data-testid={dataTestId}\n >\n {value}\n </Heading>\n );\n }\n\n if (isEditing) {\n return wrapper(\n <Input\n autoFocus={autoFocus}\n autoSelect={autoSelect}\n size={\"md\"}\n variant={\"secondary\"}\n placeholder={placeholder}\n value={localValue ?? value}\n onChange={setLocalValue}\n onBlur={e => commit(e.currentTarget.value)}\n onEnter={e => commit(e.currentTarget.value)}\n onEscape={cancel}\n />\n );\n }\n\n const trigger = (\n <div\n onClick={startEditing}\n data-testid={dataTestId}\n className={cn(\n \"font-sans text-h5 cursor-pointer truncate rounded-md\",\n \"px-[calc(var(--padding-sm-extra)-var(--border-width-sm))] py-[calc(var(--padding-xs)-var(--border-width-sm))]\",\n \"border-sm border-transparent text-accent-primary\",\n \"hover:bg-neutral-light\"\n )}\n >\n {value}\n </div>\n );\n\n return wrapper(\n tooltip ? <Tooltip side={\"bottom\"} content={tooltip} trigger={trigger} /> : trigger\n );\n};\n\nconst EditableTitle = makeDecoratable(\"EditableTitle\", DecoratableEditableTitle);\n\nexport { EditableTitle, type EditableTitleProps };\n"],"names":["DecoratableEditableTitle","value","onCommit","readOnly","placeholder","autoFocus","autoSelect","startContent","tooltip","controlledEditing","onEditingChange","className","dataTestId","isControlled","undefined","uncontrolledEditing","setUncontrolledEditing","useState","localValue","setLocalValue","isEditing","setEditing","useCallback","editing","startEditing","commit","next","cancel","wrapper","children","cn","Heading","Input","e","trigger","Tooltip","EditableTitle","makeDecoratable"],"mappings":";;;;;AAoDA,MAAMA,2BAA2B,CAAC,EAC9BC,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,YAAY,IAAI,EAChBC,aAAa,IAAI,EACjBC,YAAY,EACZC,OAAO,EACP,WAAWC,iBAAiB,EAC5BC,eAAe,EACfC,SAAS,EACT,eAA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AU,SAAS3B;QAAS,SAAS0B;SAAcA;AAEpF;AAEA,MAAME,gBAAgBC,gBAAgB,iBAAiBrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./EditableTitle.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./EditableTitle.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type VariantProps } from "../utils.js";
|
|
3
|
+
import { ContentIllustration, LayoutIllustration, ListingIllustration, SelectIllustration, TableIllustration, UploadIllustration } from "./illustrations/index.js";
|
|
4
|
+
declare const ILLUSTRATIONS: {
|
|
5
|
+
content: typeof ContentIllustration;
|
|
6
|
+
table: typeof TableIllustration;
|
|
7
|
+
listing: typeof ListingIllustration;
|
|
8
|
+
layout: typeof LayoutIllustration;
|
|
9
|
+
upload: typeof UploadIllustration;
|
|
10
|
+
select: typeof SelectIllustration;
|
|
11
|
+
};
|
|
12
|
+
type EmptyStateType = keyof typeof ILLUSTRATIONS;
|
|
13
|
+
declare const emptyStateVariants: (props?: ({
|
|
14
|
+
size?: "lg" | "md" | "sm" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof emptyStateVariants> {
|
|
17
|
+
type?: EmptyStateType;
|
|
18
|
+
title?: React.ReactNode;
|
|
19
|
+
description?: React.ReactNode;
|
|
20
|
+
illustration?: boolean;
|
|
21
|
+
actions?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare const DecoratableEmptyState: ({ size, type, title, description, illustration, actions, className, ...props }: EmptyStateProps) => React.JSX.Element;
|
|
24
|
+
declare const EmptyState: typeof DecoratableEmptyState & {
|
|
25
|
+
original: typeof DecoratableEmptyState;
|
|
26
|
+
originalName: string;
|
|
27
|
+
displayName: string;
|
|
28
|
+
} & {
|
|
29
|
+
original: typeof DecoratableEmptyState & {
|
|
30
|
+
original: typeof DecoratableEmptyState;
|
|
31
|
+
originalName: string;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
originalName: string;
|
|
35
|
+
displayName: string;
|
|
36
|
+
} & {
|
|
37
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableEmptyState & {
|
|
38
|
+
original: typeof DecoratableEmptyState;
|
|
39
|
+
originalName: string;
|
|
40
|
+
displayName: string;
|
|
41
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
42
|
+
};
|
|
43
|
+
export { EmptyState, type EmptyStateProps, type EmptyStateType };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { cn, cva, makeDecoratable } from "../utils.js";
|
|
3
|
+
import { Text } from "../Text/index.js";
|
|
4
|
+
import { ContentIllustration, LayoutIllustration, ListingIllustration, SelectIllustration, TableIllustration, UploadIllustration } from "./illustrations/index.js";
|
|
5
|
+
const ILLUSTRATIONS = {
|
|
6
|
+
content: ContentIllustration,
|
|
7
|
+
table: TableIllustration,
|
|
8
|
+
listing: ListingIllustration,
|
|
9
|
+
layout: LayoutIllustration,
|
|
10
|
+
upload: UploadIllustration,
|
|
11
|
+
select: SelectIllustration
|
|
12
|
+
};
|
|
13
|
+
const emptyStateVariants = cva("w-full flex flex-col items-center justify-center text-center px-lg", {
|
|
14
|
+
variants: {
|
|
15
|
+
size: {
|
|
16
|
+
sm: "gap-md py-[56px]",
|
|
17
|
+
md: "gap-md-plus py-[80px]",
|
|
18
|
+
lg: "gap-lg py-[96px]"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
size: "md"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const ILLUSTRATION_DIMENSIONS = {
|
|
26
|
+
sm: {
|
|
27
|
+
width: 88,
|
|
28
|
+
height: 73
|
|
29
|
+
},
|
|
30
|
+
md: {
|
|
31
|
+
width: 145,
|
|
32
|
+
height: 120
|
|
33
|
+
},
|
|
34
|
+
lg: {
|
|
35
|
+
width: 181,
|
|
36
|
+
height: 150
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const contentVariants = cva("flex flex-col items-center w-full text-neutral-strong [word-break:break-word]", {
|
|
40
|
+
variants: {
|
|
41
|
+
size: {
|
|
42
|
+
sm: "gap-sm",
|
|
43
|
+
md: "gap-sm",
|
|
44
|
+
lg: "gap-sm-extra"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
size: "md"
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const TITLE_SIZE = {
|
|
52
|
+
sm: "lg",
|
|
53
|
+
md: "lg",
|
|
54
|
+
lg: "xl"
|
|
55
|
+
};
|
|
56
|
+
const DESCRIPTION_SIZE = {
|
|
57
|
+
sm: "sm",
|
|
58
|
+
md: "md",
|
|
59
|
+
lg: "md"
|
|
60
|
+
};
|
|
61
|
+
const DecoratableEmptyState = ({ size = "md", type = "content", title, description, illustration = true, actions, className, ...props })=>{
|
|
62
|
+
const resolvedSize = size ?? "md";
|
|
63
|
+
const Illustration = ILLUSTRATIONS[type];
|
|
64
|
+
return /*#__PURE__*/ react.createElement("div", {
|
|
65
|
+
className: cn(emptyStateVariants({
|
|
66
|
+
size: resolvedSize
|
|
67
|
+
}), className),
|
|
68
|
+
...props
|
|
69
|
+
}, illustration ? /*#__PURE__*/ react.createElement(Illustration, {
|
|
70
|
+
className: "shrink-0",
|
|
71
|
+
width: ILLUSTRATION_DIMENSIONS[resolvedSize].width,
|
|
72
|
+
height: ILLUSTRATION_DIMENSIONS[resolvedSize].height,
|
|
73
|
+
"aria-hidden": true
|
|
74
|
+
}) : null, title || description ? /*#__PURE__*/ react.createElement("div", {
|
|
75
|
+
className: contentVariants({
|
|
76
|
+
size: resolvedSize
|
|
77
|
+
})
|
|
78
|
+
}, title ? /*#__PURE__*/ react.createElement(Text, {
|
|
79
|
+
as: "div",
|
|
80
|
+
size: TITLE_SIZE[resolvedSize],
|
|
81
|
+
className: "font-semibold max-w-[520px]"
|
|
82
|
+
}, title) : null, description ? /*#__PURE__*/ react.createElement(Text, {
|
|
83
|
+
as: "div",
|
|
84
|
+
size: DESCRIPTION_SIZE[resolvedSize],
|
|
85
|
+
className: "max-w-[600px]"
|
|
86
|
+
}, description) : null) : null, actions ? /*#__PURE__*/ react.createElement("div", {
|
|
87
|
+
className: "flex items-center justify-center gap-sm-extra"
|
|
88
|
+
}, actions) : null);
|
|
89
|
+
};
|
|
90
|
+
const EmptyState = makeDecoratable("EmptyState", DecoratableEmptyState);
|
|
91
|
+
export { EmptyState };
|
|
92
|
+
|
|
93
|
+
//# sourceMappingURL=EmptyState.js.map
|