@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
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { ReactComponent } from "@webiny/icons/text_fields.svg";
|
|
3
|
+
import { ReactComponent as image_svg_ReactComponent } from "@webiny/icons/image.svg";
|
|
4
|
+
import { ReactComponent as smart_button_svg_ReactComponent } from "@webiny/icons/smart_button.svg";
|
|
5
|
+
import { DragCursor } from "./DragCursor.js";
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/DragCursor",
|
|
8
|
+
component: DragCursor,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "padded"
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
label: {
|
|
14
|
+
control: "text"
|
|
15
|
+
},
|
|
16
|
+
isOverSlot: {
|
|
17
|
+
control: "boolean"
|
|
18
|
+
},
|
|
19
|
+
icon: {
|
|
20
|
+
control: false
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const DragCursor_stories = meta;
|
|
25
|
+
const OnDrag = {
|
|
26
|
+
args: {
|
|
27
|
+
label: "Header",
|
|
28
|
+
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
29
|
+
isOverSlot: false
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const OnSlot = {
|
|
33
|
+
args: {
|
|
34
|
+
...OnDrag.args,
|
|
35
|
+
isOverSlot: true
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const NoIcon = {
|
|
39
|
+
args: {
|
|
40
|
+
label: "Header",
|
|
41
|
+
isOverSlot: false
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const NoIconOnSlot = {
|
|
45
|
+
args: {
|
|
46
|
+
...NoIcon.args,
|
|
47
|
+
isOverSlot: true
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const AllVariants = {
|
|
51
|
+
args: OnDrag.args,
|
|
52
|
+
render: ()=>/*#__PURE__*/ react.createElement("div", {
|
|
53
|
+
className: "flex flex-col gap-md"
|
|
54
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
55
|
+
className: "flex items-center gap-md"
|
|
56
|
+
}, /*#__PURE__*/ react.createElement(DragCursor, {
|
|
57
|
+
label: "Header",
|
|
58
|
+
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
59
|
+
isOverSlot: false
|
|
60
|
+
}), /*#__PURE__*/ react.createElement(DragCursor, {
|
|
61
|
+
label: "Header",
|
|
62
|
+
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
63
|
+
isOverSlot: true
|
|
64
|
+
})), /*#__PURE__*/ react.createElement("div", {
|
|
65
|
+
className: "flex items-center gap-md"
|
|
66
|
+
}, /*#__PURE__*/ react.createElement(DragCursor, {
|
|
67
|
+
label: "Image",
|
|
68
|
+
icon: /*#__PURE__*/ react.createElement(image_svg_ReactComponent, null),
|
|
69
|
+
isOverSlot: false
|
|
70
|
+
}), /*#__PURE__*/ react.createElement(DragCursor, {
|
|
71
|
+
label: "Image",
|
|
72
|
+
icon: /*#__PURE__*/ react.createElement(image_svg_ReactComponent, null),
|
|
73
|
+
isOverSlot: true
|
|
74
|
+
})), /*#__PURE__*/ react.createElement("div", {
|
|
75
|
+
className: "flex items-center gap-md"
|
|
76
|
+
}, /*#__PURE__*/ react.createElement(DragCursor, {
|
|
77
|
+
label: "Button",
|
|
78
|
+
icon: /*#__PURE__*/ react.createElement(smart_button_svg_ReactComponent, null),
|
|
79
|
+
isOverSlot: false
|
|
80
|
+
}), /*#__PURE__*/ react.createElement(DragCursor, {
|
|
81
|
+
label: "Button",
|
|
82
|
+
icon: /*#__PURE__*/ react.createElement(smart_button_svg_ReactComponent, null),
|
|
83
|
+
isOverSlot: true
|
|
84
|
+
})), /*#__PURE__*/ react.createElement("div", {
|
|
85
|
+
className: "flex items-center gap-md"
|
|
86
|
+
}, /*#__PURE__*/ react.createElement(DragCursor, {
|
|
87
|
+
label: "No icon",
|
|
88
|
+
isOverSlot: false
|
|
89
|
+
}), /*#__PURE__*/ react.createElement(DragCursor, {
|
|
90
|
+
label: "No icon",
|
|
91
|
+
isOverSlot: true
|
|
92
|
+
})))
|
|
93
|
+
};
|
|
94
|
+
export default DragCursor_stories;
|
|
95
|
+
export { AllVariants, NoIcon, NoIconOnSlot, OnDrag, OnSlot };
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=DragCursor.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DragCursor/DragCursor.stories.js","sources":["../../src/DragCursor/DragCursor.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { ReactComponent as TextIcon } from \"@webiny/icons/text_fields.svg\";\nimport { ReactComponent as ImageIcon } from \"@webiny/icons/image.svg\";\nimport { ReactComponent as ButtonIcon } from \"@webiny/icons/smart_button.svg\";\nimport { DragCursor } from \"./DragCursor.js\";\n\nconst meta: Meta<typeof DragCursor> = {\n title: \"Components/DragCursor\",\n component: DragCursor,\n parameters: {\n layout: \"padded\"\n },\n argTypes: {\n label: { control: \"text\" },\n isOverSlot: { control: \"boolean\" },\n icon: { control: false }\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof DragCursor>;\n\nexport const OnDrag: Story = {\n args: {\n label: \"Header\",\n icon: <TextIcon />,\n isOverSlot: false\n }\n};\n\nexport const OnSlot: Story = {\n args: {\n ...OnDrag.args,\n isOverSlot: true\n }\n};\n\nexport const NoIcon: Story = {\n args: {\n label: \"Header\",\n isOverSlot: false\n }\n};\n\nexport const NoIconOnSlot: Story = {\n args: {\n ...NoIcon.args,\n isOverSlot: true\n }\n};\n\nexport const AllVariants: Story = {\n args: OnDrag.args,\n render: () => (\n <div className={\"flex flex-col gap-md\"}>\n <div className={\"flex items-center gap-md\"}>\n <DragCursor label={\"Header\"} icon={<TextIcon />} isOverSlot={false} />\n <DragCursor label={\"Header\"} icon={<TextIcon />} isOverSlot={true} />\n </div>\n <div className={\"flex items-center gap-md\"}>\n <DragCursor label={\"Image\"} icon={<ImageIcon />} isOverSlot={false} />\n <DragCursor label={\"Image\"} icon={<ImageIcon />} isOverSlot={true} />\n </div>\n <div className={\"flex items-center gap-md\"}>\n <DragCursor label={\"Button\"} icon={<ButtonIcon />} isOverSlot={false} />\n <DragCursor label={\"Button\"} icon={<ButtonIcon />} isOverSlot={true} />\n </div>\n <div className={\"flex items-center gap-md\"}>\n <DragCursor label={\"No icon\"} isOverSlot={false} />\n <DragCursor label={\"No icon\"} isOverSlot={true} />\n </div>\n </div>\n )\n};\n"],"names":["meta","DragCursor","OnDrag","TextIcon","OnSlot","NoIcon","NoIconOnSlot","AllVariants","ImageIcon","ButtonIcon"],"mappings":";;;;;AAOA,MAAMA,OAAgC;IAClC,OAAO;IACP,WAAWC;IACX,YAAY;QACR,QAAQ;IACZ;IACA,UAAU;QACN,OAAO;YAAE,SAAS;QAAO;QACzB,YAAY;YAAE,SAAS;QAAU;QACjC,MAAM;YAAE,SAAS;QAAM;IAC3B;AACJ;AAEA,2BAAeD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 @@ interface DrawerProps extends React.ComponentPropsWithoutRef<typeof DrawerRoot>,
|
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
10
|
bodyPadding?: boolean;
|
|
11
11
|
headerSeparator?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Controls rendered in the header, next to the close button.
|
|
14
|
+
*/
|
|
15
|
+
headerActions?: React.ReactNode;
|
|
12
16
|
footerSeparator?: boolean;
|
|
13
17
|
description?: React.ReactNode;
|
|
14
18
|
children: React.ReactNode;
|
|
@@ -18,39 +22,25 @@ interface DrawerProps extends React.ComponentPropsWithoutRef<typeof DrawerRoot>,
|
|
|
18
22
|
onClose?: () => void;
|
|
19
23
|
onOpen?: () => void;
|
|
20
24
|
}
|
|
21
|
-
declare const
|
|
25
|
+
declare const DrawerBase: {
|
|
22
26
|
(props: DrawerProps): React.JSX.Element;
|
|
23
27
|
displayName: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
displayName: string;
|
|
28
|
-
};
|
|
28
|
+
};
|
|
29
|
+
declare const Drawer: typeof DrawerBase & {
|
|
30
|
+
original: typeof DrawerBase;
|
|
29
31
|
originalName: string;
|
|
30
32
|
displayName: string;
|
|
31
33
|
} & {
|
|
32
|
-
original: {
|
|
33
|
-
|
|
34
|
-
displayName: string;
|
|
35
|
-
} & {
|
|
36
|
-
original: {
|
|
37
|
-
(props: DrawerProps): React.JSX.Element;
|
|
38
|
-
displayName: string;
|
|
39
|
-
};
|
|
34
|
+
original: typeof DrawerBase & {
|
|
35
|
+
original: typeof DrawerBase;
|
|
40
36
|
originalName: string;
|
|
41
37
|
displayName: string;
|
|
42
38
|
};
|
|
43
39
|
originalName: string;
|
|
44
40
|
displayName: string;
|
|
45
41
|
} & {
|
|
46
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<{
|
|
47
|
-
|
|
48
|
-
displayName: string;
|
|
49
|
-
} & {
|
|
50
|
-
original: {
|
|
51
|
-
(props: DrawerProps): React.JSX.Element;
|
|
52
|
-
displayName: string;
|
|
53
|
-
};
|
|
42
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DrawerBase & {
|
|
43
|
+
original: typeof DrawerBase;
|
|
54
44
|
originalName: string;
|
|
55
45
|
displayName: string;
|
|
56
46
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -93,21 +83,21 @@ declare const Drawer: {
|
|
|
93
83
|
displayName: string;
|
|
94
84
|
}>) => (props: unknown) => React.JSX.Element;
|
|
95
85
|
};
|
|
96
|
-
Icon: ((
|
|
97
|
-
original: (
|
|
86
|
+
Icon: ((props: import("../index.js").IconProps) => React.JSX.Element) & {
|
|
87
|
+
original: (props: import("../index.js").IconProps) => React.JSX.Element;
|
|
98
88
|
originalName: string;
|
|
99
89
|
displayName: string;
|
|
100
90
|
} & {
|
|
101
|
-
original: ((
|
|
102
|
-
original: (
|
|
91
|
+
original: ((props: import("../index.js").IconProps) => React.JSX.Element) & {
|
|
92
|
+
original: (props: import("../index.js").IconProps) => React.JSX.Element;
|
|
103
93
|
originalName: string;
|
|
104
94
|
displayName: string;
|
|
105
95
|
};
|
|
106
96
|
originalName: string;
|
|
107
97
|
displayName: string;
|
|
108
98
|
} & {
|
|
109
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<((
|
|
110
|
-
original: (
|
|
99
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<((props: import("../index.js").IconProps) => React.JSX.Element) & {
|
|
100
|
+
original: (props: import("../index.js").IconProps) => React.JSX.Element;
|
|
111
101
|
originalName: string;
|
|
112
102
|
displayName: string;
|
|
113
103
|
}>) => (props: unknown) => React.JSX.Element;
|
package/Drawer/Drawer.js
CHANGED
|
@@ -13,7 +13,7 @@ import { CancelButton } from "./components/CancelButton.js";
|
|
|
13
13
|
import * as __rspack_external_react from "react";
|
|
14
14
|
const DrawerBase = (props)=>{
|
|
15
15
|
const { rootProps, triggerProps, contentProps, headerProps, bodyProps, footerProps } = __rspack_external_react.useMemo(()=>{
|
|
16
|
-
const { defaultOpen, open, onOpenChange: originalOnOpenChange, onClose, onOpen, modal = false, dir, trigger, title, icon, description, showCloseButton, headerSeparator, children, bodyPadding, actions, info, footerSeparator, ...rest } = props;
|
|
16
|
+
const { defaultOpen, open, onOpenChange: originalOnOpenChange, onClose, onOpen, modal = false, dir, trigger, title, icon, description, showCloseButton, headerSeparator, headerActions, children, bodyPadding, actions, info, footerSeparator, ...rest } = props;
|
|
17
17
|
const onOpenChange = (open)=>{
|
|
18
18
|
originalOnOpenChange && originalOnOpenChange(open);
|
|
19
19
|
if (onClose && !open) onClose();
|
|
@@ -35,6 +35,7 @@ const DrawerBase = (props)=>{
|
|
|
35
35
|
icon,
|
|
36
36
|
description,
|
|
37
37
|
showCloseButton,
|
|
38
|
+
headerActions,
|
|
38
39
|
separator: headerSeparator
|
|
39
40
|
},
|
|
40
41
|
bodyProps: {
|
package/Drawer/Drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer/Drawer.js","sources":["../../src/Drawer/Drawer.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { DrawerContent } from \"./components/DrawerContent.js\";\nimport { DrawerFooter } from \"./components/DrawerFooter.js\";\nimport { DrawerHeader } from \"./components/DrawerHeader.js\";\nimport { DrawerOverlay } from \"./components/DrawerOverlay.js\";\nimport { DrawerPortal } from \"./components/DrawerPortal.js\";\nimport { DrawerRoot } from \"./components/DrawerRoot.js\";\nimport { DrawerTrigger } from \"./components/DrawerTrigger.js\";\nimport { DrawerBody } from \"~/Drawer/components/DrawerBody.js\";\nimport { Icon } from \"./components/Icon.js\";\nimport { ConfirmButton } from \"./components/ConfirmButton.js\";\nimport { CancelButton } from \"./components/CancelButton.js\";\n\ninterface DrawerProps\n extends\n React.ComponentPropsWithoutRef<typeof DrawerRoot>,\n Omit<React.ComponentPropsWithoutRef<typeof DrawerContent>, \"title\"> {\n trigger?: React.ReactNode;\n title?: React.ReactNode;\n icon?: React.ReactElement;\n modal?: boolean;\n showCloseButton?: boolean;\n bodyPadding?: boolean;\n headerSeparator?: boolean;\n footerSeparator?: boolean;\n description?: React.ReactNode;\n children: React.ReactNode;\n actions?: React.ReactNode;\n info?: React.ReactNode;\n width?: React.CSSProperties[\"width\"];\n onClose?: () => void;\n onOpen?: () => void;\n}\n\nconst DrawerBase = (props: DrawerProps) => {\n const { rootProps, triggerProps, contentProps, headerProps, bodyProps, footerProps } =\n React.useMemo(() => {\n const {\n // Root props.\n defaultOpen,\n open,\n onOpenChange: originalOnOpenChange,\n onClose,\n onOpen,\n\n // We want the drawer to always allow interaction with the outside elements.\n modal = false,\n dir,\n\n // Trigger props.\n trigger,\n\n // Header props.\n title,\n icon,\n description,\n showCloseButton,\n headerSeparator,\n\n // Body props.\n children,\n bodyPadding,\n\n // Footer props.\n actions,\n info,\n footerSeparator,\n\n // Content props.\n ...rest\n } = props;\n\n // Handles dialog open state changes, calling original and onClose / onOpen callbacks as needed\n const onOpenChange = (open: boolean) => {\n originalOnOpenChange && originalOnOpenChange(open);\n\n if (onClose && !open) {\n onClose();\n }\n\n if (onOpen && open) {\n onOpen();\n }\n };\n\n return {\n rootProps: {\n defaultOpen,\n open,\n onOpenChange,\n modal,\n dir\n },\n triggerProps: {\n // Temporary fix. We need this because `ref` doesn't get passed to components\n // that are decorated with `makeDecoratable`. This will be fixed in the future.\n children: <div>{trigger}</div>\n },\n headerProps: {\n title,\n icon,\n description,\n showCloseButton,\n separator: headerSeparator\n },\n bodyProps: { children, bodyPadding },\n footerProps: { info, actions, separator: footerSeparator },\n contentProps: rest\n };\n }, [props]);\n\n return (\n <DrawerRoot {...rootProps}>\n {triggerProps.children && <DrawerTrigger {...triggerProps} asChild />}\n <DrawerPortal>\n <div data-role=\"drawer\" className={\"absolute z-overlay\"}>\n {rootProps.modal && <DrawerOverlay />}\n <DrawerContent {...contentProps} modal={rootProps.modal}>\n <DrawerHeader {...headerProps} />\n <DrawerBody {...bodyProps} />\n <DrawerFooter {...footerProps} />\n </DrawerContent>\n </div>\n </DrawerPortal>\n </DrawerRoot>\n );\n};\n\nDrawerBase.displayName = \"Drawer\";\n\nconst DecoratableDrawer = makeDecoratable(\"Drawer\", DrawerBase);\n\nconst Drawer = withStaticProps(DecoratableDrawer, {\n ConfirmButton,\n CancelButton,\n Icon\n});\n\nexport { Drawer, type DrawerProps };\n"],"names":["DrawerBase","props","rootProps","triggerProps","contentProps","headerProps","bodyProps","footerProps","React","defaultOpen","open","originalOnOpenChange","onClose","onOpen","modal","dir","trigger","title","icon","description","showCloseButton","headerSeparator","children","bodyPadding","actions","info","footerSeparator","rest","onOpenChange","DrawerRoot","DrawerTrigger","DrawerPortal","DrawerOverlay","DrawerContent","DrawerHeader","DrawerBody","DrawerFooter","DecoratableDrawer","makeDecoratable","Drawer","withStaticProps","ConfirmButton","CancelButton","Icon"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Drawer/Drawer.js","sources":["../../src/Drawer/Drawer.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { DrawerContent } from \"./components/DrawerContent.js\";\nimport { DrawerFooter } from \"./components/DrawerFooter.js\";\nimport { DrawerHeader } from \"./components/DrawerHeader.js\";\nimport { DrawerOverlay } from \"./components/DrawerOverlay.js\";\nimport { DrawerPortal } from \"./components/DrawerPortal.js\";\nimport { DrawerRoot } from \"./components/DrawerRoot.js\";\nimport { DrawerTrigger } from \"./components/DrawerTrigger.js\";\nimport { DrawerBody } from \"~/Drawer/components/DrawerBody.js\";\nimport { Icon } from \"./components/Icon.js\";\nimport { ConfirmButton } from \"./components/ConfirmButton.js\";\nimport { CancelButton } from \"./components/CancelButton.js\";\n\ninterface DrawerProps\n extends\n React.ComponentPropsWithoutRef<typeof DrawerRoot>,\n Omit<React.ComponentPropsWithoutRef<typeof DrawerContent>, \"title\"> {\n trigger?: React.ReactNode;\n title?: React.ReactNode;\n icon?: React.ReactElement;\n modal?: boolean;\n showCloseButton?: boolean;\n bodyPadding?: boolean;\n headerSeparator?: boolean;\n /**\n * Controls rendered in the header, next to the close button.\n */\n headerActions?: React.ReactNode;\n footerSeparator?: boolean;\n description?: React.ReactNode;\n children: React.ReactNode;\n actions?: React.ReactNode;\n info?: React.ReactNode;\n width?: React.CSSProperties[\"width\"];\n onClose?: () => void;\n onOpen?: () => void;\n}\n\nconst DrawerBase = (props: DrawerProps) => {\n const { rootProps, triggerProps, contentProps, headerProps, bodyProps, footerProps } =\n React.useMemo(() => {\n const {\n // Root props.\n defaultOpen,\n open,\n onOpenChange: originalOnOpenChange,\n onClose,\n onOpen,\n\n // We want the drawer to always allow interaction with the outside elements.\n modal = false,\n dir,\n\n // Trigger props.\n trigger,\n\n // Header props.\n title,\n icon,\n description,\n showCloseButton,\n headerSeparator,\n headerActions,\n\n // Body props.\n children,\n bodyPadding,\n\n // Footer props.\n actions,\n info,\n footerSeparator,\n\n // Content props.\n ...rest\n } = props;\n\n // Handles dialog open state changes, calling original and onClose / onOpen callbacks as needed\n const onOpenChange = (open: boolean) => {\n originalOnOpenChange && originalOnOpenChange(open);\n\n if (onClose && !open) {\n onClose();\n }\n\n if (onOpen && open) {\n onOpen();\n }\n };\n\n return {\n rootProps: {\n defaultOpen,\n open,\n onOpenChange,\n modal,\n dir\n },\n triggerProps: {\n // Temporary fix. We need this because `ref` doesn't get passed to components\n // that are decorated with `makeDecoratable`. This will be fixed in the future.\n children: <div>{trigger}</div>\n },\n headerProps: {\n title,\n icon,\n description,\n showCloseButton,\n headerActions,\n separator: headerSeparator\n },\n bodyProps: { children, bodyPadding },\n footerProps: { info, actions, separator: footerSeparator },\n contentProps: rest\n };\n }, [props]);\n\n return (\n <DrawerRoot {...rootProps}>\n {triggerProps.children && <DrawerTrigger {...triggerProps} asChild />}\n <DrawerPortal>\n <div data-role=\"drawer\" className={\"absolute z-overlay\"}>\n {rootProps.modal && <DrawerOverlay />}\n <DrawerContent {...contentProps} modal={rootProps.modal}>\n <DrawerHeader {...headerProps} />\n <DrawerBody {...bodyProps} />\n <DrawerFooter {...footerProps} />\n </DrawerContent>\n </div>\n </DrawerPortal>\n </DrawerRoot>\n );\n};\n\nDrawerBase.displayName = \"Drawer\";\n\nconst DecoratableDrawer = makeDecoratable(\"Drawer\", DrawerBase);\n\nconst Drawer = withStaticProps(DecoratableDrawer, {\n ConfirmButton,\n CancelButton,\n Icon\n});\n\nexport { Drawer, type DrawerProps };\n"],"names":["DrawerBase","props","rootProps","triggerProps","contentProps","headerProps","bodyProps","footerProps","React","defaultOpen","open","originalOnOpenChange","onClose","onOpen","modal","dir","trigger","title","icon","description","showCloseButton","headerSeparator","headerActions","children","bodyPadding","actions","info","footerSeparator","rest","onOpenChange","DrawerRoot","DrawerTrigger","DrawerPortal","DrawerOverlay","DrawerContent","DrawerHeader","DrawerBody","DrawerFooter","DecoratableDrawer","makeDecoratable","Drawer","withStaticProps","ConfirmButton","CancelButton","Icon"],"mappings":";;;;;;;;;;;;;AAuCA,MAAMA,aAAa,CAACC;IAChB,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAEC,YAAY,EAAEC,WAAW,EAAEC,SAAS,EAAEC,WAAW,EAAE,GAChFC,wBAAAA,OAAa,CAAC;QACV,MAAM,EAEFC,WAAW,EACXC,IAAI,EACJ,cAAcC,oBAAoB,EAClCC,OAAO,EACPC,MAAM,EAGNC,QAAQ,KAAK,EACbC,GAAG,EAGHC,OAAO,EAGPC,KAAK,EACLC,IAAI,EACJC,WAAW,EACXC,eAAe,EACfC,eAAe,EACfC,aAAa,EAGbC,QAAQ,EACRC,WAAW,EAGXC,OAAO,EACPC,IAAI,EACJC,eAAe,EAGf,GAAGC,MACN,GAAG3B;QAGJ,MAAM4B,eAAe,CAACnB;YAClBC,wBAAwBA,qBAAqBD;YAE7C,IAAIE,WAAW,CAACF,MACZE;YAGJ,IAAIC,UAAUH,MACVG;QAER;QAEA,OAAO;YACH,WAAW;gBACPJ;gBACAC;gBACAmB;gBACAf;gBACAC;YACJ;YACA,cAAc;gBAGV,UAAU,WAAV,GAAU,sCAAC,aAAKC;YACpB;YACA,aAAa;gBACTC;gBACAC;gBACAC;gBACAC;gBACAE;gBACA,WAAWD;YACf;YACA,WAAW;gBAAEE;gBAAUC;YAAY;YACnC,aAAa;gBAAEE;gBAAMD;gBAAS,WAAWE;YAAgB;YACzD,cAAcC;QAClB;IACJ,GAAG;QAAC3B;KAAM;IAEd,OAAO,WAAP,GACI,sCAAC6B,YAAe5B,WACXC,aAAa,QAAQ,IAAI,WAAJ,GAAI,sCAAC4B,eAAaA;QAAE,GAAG5B,YAAY;QAAE;sBAC3D,sCAAC6B,cAAYA,MAAAA,WAAAA,GACT,sCAAC;QAAI,aAAU;QAAS,WAAW;OAC9B9B,UAAU,KAAK,IAAI,WAAJ,GAAI,sCAAC+B,eAAaA,OAAAA,WAAAA,GAClC,sCAACC,eAAaA;QAAE,GAAG9B,YAAY;QAAE,OAAOF,UAAU,KAAK;qBACnD,sCAACiC,cAAiB9B,cAAAA,WAAAA,GAClB,sCAAC+B,YAAe9B,YAAAA,WAAAA,GAChB,sCAAC+B,cAAiB9B;AAM1C;AAEAP,WAAW,WAAW,GAAG;AAEzB,MAAMsC,oBAAoBC,gBAAgB,UAAUvC;AAEpD,MAAMwC,SAASC,gBAAgBH,mBAAmB;IAC9CI,eAAaA;IACbC,cAAYA;IACZC,MAAIA;AACR"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Drawer } from "./Drawer.js";
|
|
3
3
|
declare const meta: Meta<typeof Drawer>;
|
|
4
4
|
export default meta;
|
|
@@ -16,5 +16,6 @@ export declare const CustomWidth: Story;
|
|
|
16
16
|
export declare const WithTabs: Story;
|
|
17
17
|
export declare const DropdownMenuInDrawer: Story;
|
|
18
18
|
export declare const WithIcon: Story;
|
|
19
|
+
export declare const WithHeaderActions: Story;
|
|
19
20
|
export declare const AsModal: Story;
|
|
20
21
|
export declare const Documentation: Story;
|
package/Drawer/Drawer.stories.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { Drawer } from "./Drawer.js";
|
|
3
|
-
import { Button } from "../Button/index.js";
|
|
3
|
+
import { Button, IconButton } from "../Button/index.js";
|
|
4
4
|
import { DropdownMenu } from "../DropdownMenu/index.js";
|
|
5
5
|
import { Tabs } from "../Tabs/index.js";
|
|
6
6
|
import { ReactComponent } from "@webiny/icons/ring_volume.svg";
|
|
7
|
+
import { ReactComponent as refresh_svg_ReactComponent } from "@webiny/icons/refresh.svg";
|
|
7
8
|
const meta = {
|
|
8
9
|
title: "Components/Drawer",
|
|
9
10
|
component: Drawer,
|
|
@@ -140,6 +141,7 @@ const WithTabs = {
|
|
|
140
141
|
bodyPadding: false,
|
|
141
142
|
headerSeparator: false,
|
|
142
143
|
children: /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Tabs, {
|
|
144
|
+
separator: true,
|
|
143
145
|
spacing: "lg",
|
|
144
146
|
tabs: [
|
|
145
147
|
/*#__PURE__*/ react.createElement(Tabs.Tab, {
|
|
@@ -197,6 +199,20 @@ const WithIcon = {
|
|
|
197
199
|
children: /*#__PURE__*/ react.createElement(react.Fragment, null, "The icon helps to visually identify the purpose of this drawer.")
|
|
198
200
|
}
|
|
199
201
|
};
|
|
202
|
+
const WithHeaderActions = {
|
|
203
|
+
args: {
|
|
204
|
+
...Default.args,
|
|
205
|
+
headerActions: /*#__PURE__*/ react.createElement(IconButton, {
|
|
206
|
+
variant: "ghost",
|
|
207
|
+
size: "md",
|
|
208
|
+
iconSize: "lg",
|
|
209
|
+
title: "Refresh",
|
|
210
|
+
"aria-label": "Refresh",
|
|
211
|
+
icon: /*#__PURE__*/ react.createElement(refresh_svg_ReactComponent, null)
|
|
212
|
+
}),
|
|
213
|
+
children: /*#__PURE__*/ react.createElement(react.Fragment, null, "Header actions sit next to the close button.")
|
|
214
|
+
}
|
|
215
|
+
};
|
|
200
216
|
const AsModal = {
|
|
201
217
|
args: {
|
|
202
218
|
...Default.args,
|
|
@@ -286,6 +302,9 @@ const Documentation = {
|
|
|
286
302
|
control: "boolean",
|
|
287
303
|
defaultValue: true
|
|
288
304
|
},
|
|
305
|
+
headerActions: {
|
|
306
|
+
description: "Controls rendered in the header, next to the close button, e.g. icon buttons."
|
|
307
|
+
},
|
|
289
308
|
footerSeparator: {
|
|
290
309
|
description: "Show separator above the footer",
|
|
291
310
|
control: "boolean",
|
|
@@ -306,6 +325,6 @@ const Documentation = {
|
|
|
306
325
|
}
|
|
307
326
|
};
|
|
308
327
|
export default Drawer_stories;
|
|
309
|
-
export { AsModal, ControlledVisibility, CustomWidth, Default, Documentation, DropdownMenuInDrawer, SizeExtraLarge, SizeLarge, SizeMedium, SizeSmall, WithDropdownMenu, WithIcon, WithOpenCloseEventHandler, WithTabs, WithoutCloseButton };
|
|
328
|
+
export { AsModal, ControlledVisibility, CustomWidth, Default, Documentation, DropdownMenuInDrawer, SizeExtraLarge, SizeLarge, SizeMedium, SizeSmall, WithDropdownMenu, WithHeaderActions, WithIcon, WithOpenCloseEventHandler, WithTabs, WithoutCloseButton };
|
|
310
329
|
|
|
311
330
|
//# sourceMappingURL=Drawer.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer/Drawer.stories.js","sources":["../../src/Drawer/Drawer.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react-webpack5\";\nimport { Drawer } from \"./Drawer.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { DropdownMenu } from \"~/DropdownMenu/index.js\";\nimport { Tabs } from \"~/Tabs/index.js\";\nimport { ReactComponent as DoorbellIcon } from \"@webiny/icons/ring_volume.svg\";\n\nconst meta: Meta<typeof Drawer> = {\n title: \"Components/Drawer\",\n component: Drawer,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Drawer>;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n title: \"Drawer Title\",\n description: \"A short dialog description.\",\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md\"}>\n The amazing, splendid, and most useful umbrella, resistant to rain and friendly\n to winds, is something that deserves all admiration. Crafted with perfect\n textures, it bravely withstands storms and gently shades the rays of the sun. A\n remarkable innovation, with an ergonomically designed grip most suited to the\n hand, it remains stable even in the fiercest weather.\n </p>\n <p className={\"mb-md\"}>\n Its fabric, woven from the highest quality materials, ensures that you stay dry,\n no matter the intensity of the rain. With a frame engineered for strength yet\n lightweight enough to carry with ease, this umbrella is a marvel of modern\n design. Not just a shield against the elements, but a companion in your everyday\n journey, it provides peace of mind, knowing you’re prepared for whatever the\n skies may bring.\n </p>\n <p className={\"mb-md\"}>\n The sleek, stylish design complements any outfit, making it not only a practical\n accessory but also a fashion statement. With its smooth opening mechanism, you\n can effortlessly transition from a sunny day to a rainy one without missing a\n beat. Whether you are navigating through a busy city street or enjoying a quiet\n stroll in the park, this umbrella offers unmatched comfort and protection.\n </p>\n <p className={\"mb-md\"}>\n Indeed, it is not just an umbrella — it is an experience. One that elevates your\n daily routine, making every step in both sun and storm feel just a little bit\n brighter.\n </p>\n </>\n ),\n onOpenChange: opened => {\n console.log(`Drawer is ${opened ? \"opened\" : \"closed\"}.`);\n },\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true\n },\n argTypes: {}\n};\n\nexport const SizeSmall: Story = {\n args: {\n ...Default.args,\n size: \"sm\"\n }\n};\n\nexport const SizeMedium: Story = {\n args: {\n ...Default.args,\n size: \"md\"\n }\n};\n\nexport const SizeLarge: Story = {\n args: {\n ...Default.args,\n size: \"lg\"\n }\n};\n\nexport const SizeExtraLarge: Story = {\n args: {\n ...Default.args,\n size: \"xl\"\n }\n};\n\nexport const ControlledVisibility: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text={\"Open\"} onClick={() => setOpen(true)} />\n <Drawer\n {...props}\n open={open}\n onOpenChange={open => {\n if (!open) {\n setOpen(false);\n }\n }}\n />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer's visibility is controlled by the open state.</>\n }\n};\n\nexport const WithOpenCloseEventHandler: Story = {\n args: {\n ...Default.args,\n onClose: () => {\n console.log(\"onClose triggered\");\n },\n onOpen: () => {\n console.log(\"onOpen triggered\");\n }\n }\n};\n\nexport const WithDropdownMenu: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item\n text={\"Open Drawer\"}\n content={\"Open Drawer\"}\n onClick={() => setOpen(true)}\n />\n </DropdownMenu>\n\n <Drawer {...props} open={open} onOpenChange={() => setOpen(false)} />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const WithoutCloseButton: Story = {\n args: {\n ...Default.args,\n showCloseButton: false,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const CustomWidth: Story = {\n args: {\n ...Default.args,\n width: 1000,\n children: <>This drawer has a custom width of 1000px, making it wider than the default.</>\n }\n};\n\nexport const WithTabs: Story = {\n args: {\n ...Default.args,\n bodyPadding: false,\n headerSeparator: false,\n children: (\n <>\n <Tabs\n spacing={\"lg\"}\n tabs={[\n <Tabs.Tab\n key=\"account\"\n value=\"account\"\n trigger={\"Account\"}\n content={\"Make changes to your account here.\"}\n />,\n <Tabs.Tab\n key=\"company\"\n value=\"company\"\n trigger={\"Company\"}\n content={\"Make changes to your company info here.\"}\n />,\n <Tabs.Tab\n key=\"security\"\n value=\"security\"\n trigger={\"Security\"}\n content={\"Make changes to your security settings here.\"}\n />,\n <Tabs.Tab\n key=\"development\"\n value=\"development\"\n trigger={\"Development\"}\n content={\"Make changes to your development settings here.\"}\n />\n ]}\n />\n </>\n )\n }\n};\n\nexport const DropdownMenuInDrawer: Story = {\n args: {\n ...Default.args,\n children: (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item content={\"Billing\"} />\n <DropdownMenu.Item content={\"Settings\"} />\n <DropdownMenu.Item content={\"Keyboard shortcuts\"} />\n </DropdownMenu>\n </>\n )\n }\n};\n\nexport const WithIcon: Story = {\n args: {\n ...Default.args,\n icon: <Drawer.Icon icon={<DoorbellIcon />} label={\"Icon label...\"} />,\n children: <>The icon helps to visually identify the purpose of this drawer.</>\n }\n};\n\nexport const AsModal: Story = {\n args: {\n ...Default.args,\n modal: true,\n children: (\n <>\n This drawer has modal=true, which means it will show an overlay behind it and\n prevent interaction with the content underneath.\n </>\n )\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text=\"Open Drawer\" onClick={() => setOpen(true)} />\n\n <Drawer {...args} open={open} onOpenChange={open => setOpen(open)} />\n </>\n );\n },\n args: {\n title: \"Drawer Title\",\n description: \"A short drawer description.\",\n showCloseButton: true,\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true,\n side: \"right\",\n modal: false,\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md, mt-md\"}>\n This is the drawer content area. You can place any content here including forms,\n text, images, or other components.\n </p>\n <p className={\"mb-md\"}>\n Drawers are useful for displaying additional information or actions without\n navigating away from the current page.\n </p>\n </>\n ),\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n width: undefined\n },\n argTypes: {\n title: {\n description: \"Title displayed in the header\",\n control: \"text\"\n },\n description: {\n description: \"Description displayed below the title\",\n control: \"text\"\n },\n side: {\n description: \"Side from which the drawer appears\",\n control: \"select\",\n options: [\"left\", \"right\"],\n defaultValue: \"right\"\n },\n size: {\n description: \"Controls the size of the drawer\",\n control: \"select\",\n options: [\"sm\", \"md\", \"lg\", \"xl\"],\n defaultValue: \"md\"\n },\n showCloseButton: {\n description: \"Show close button in the top-right corner\",\n control: \"boolean\",\n defaultValue: true\n },\n modal: {\n description: \"Whether the drawer should behave as a modal\",\n control: \"boolean\",\n defaultValue: false\n },\n bodyPadding: {\n description: \"Add padding to the drawer body\",\n control: \"boolean\",\n defaultValue: true\n },\n headerSeparator: {\n description: \"Show separator below the header\",\n control: \"boolean\",\n defaultValue: true\n },\n footerSeparator: {\n description: \"Show separator above the footer\",\n control: \"boolean\",\n defaultValue: true\n },\n width: {\n description:\n 'Width defines the horizontal size of the Drawer and accepts any valid CSS width value. You can pass a number (interpreted as pixels) or a string like \"80%\", \"50vw\", \"auto\", etc., following React.CSSProperties[\"width\"] types.'\n },\n info: {\n description:\n \"Additional info displayed below the description, please refer to the example below for details.\"\n },\n children: {\n description:\n \"Content of the Drawer, please refer to the 'With Dropdown Menu' and ''With Tabs' example below for details.\"\n },\n actions: {\n description:\n \"Actions displayed in the footer, please refer to the code example for details.\"\n }\n }\n};\n"],"names":["meta","Drawer","Default","Button","opened","console","SizeSmall","SizeMedium","SizeLarge","SizeExtraLarge","ControlledVisibility","props","open","setOpen","React","WithOpenCloseEventHandler","WithDropdownMenu","DropdownMenu","WithoutCloseButton","CustomWidth","WithTabs","Tabs","DropdownMenuInDrawer","WithIcon","DoorbellIcon","AsModal","Documentation","args","undefined"],"mappings":";;;;;;AAQA,MAAMA,OAA4B;IAC9B,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,uBAAeD;AAIR,MAAME,UAAiB;IAC1B,MAAM;QACF,SAAS,WAAT,GAAS,oB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;YAAE,WAAW;WAAgB,sIAI9B,oBAAC;YAAE,WAAW;WAAS;QAM/B,SAAS,WAAT,GACI,wDACI,oBAACX,OAAO,YAAY,uBACpB,oBAACA,OAAO,aAAa;QAG7B,OAAO2B;IACX;IACA,UAAU;QACN,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAQ;aAAQ;YAC1B,cAAc;QAClB;QACA,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAM;gBAAM;gBAAM;aAAK;YACjC,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,OAAO;YACH,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,aAAa;YACT,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,iBAAiB;YACb,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,OAAO;YACH,aACI;QACR;QACA,MAAM;YACF,aACI;QACR;QACA,UAAU;YACN,aACI;QACR;QACA,SAAS;YACL,aACI;QACR;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"Drawer/Drawer.stories.js","sources":["../../src/Drawer/Drawer.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Drawer } from \"./Drawer.js\";\nimport { Button, IconButton } from \"~/Button/index.js\";\nimport { DropdownMenu } from \"~/DropdownMenu/index.js\";\nimport { Tabs } from \"~/Tabs/index.js\";\nimport { ReactComponent as DoorbellIcon } from \"@webiny/icons/ring_volume.svg\";\nimport { ReactComponent as RefreshIcon } from \"@webiny/icons/refresh.svg\";\n\nconst meta: Meta<typeof Drawer> = {\n title: \"Components/Drawer\",\n component: Drawer,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Drawer>;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n title: \"Drawer Title\",\n description: \"A short dialog description.\",\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md\"}>\n The amazing, splendid, and most useful umbrella, resistant to rain and friendly\n to winds, is something that deserves all admiration. Crafted with perfect\n textures, it bravely withstands storms and gently shades the rays of the sun. A\n remarkable innovation, with an ergonomically designed grip most suited to the\n hand, it remains stable even in the fiercest weather.\n </p>\n <p className={\"mb-md\"}>\n Its fabric, woven from the highest quality materials, ensures that you stay dry,\n no matter the intensity of the rain. With a frame engineered for strength yet\n lightweight enough to carry with ease, this umbrella is a marvel of modern\n design. Not just a shield against the elements, but a companion in your everyday\n journey, it provides peace of mind, knowing you’re prepared for whatever the\n skies may bring.\n </p>\n <p className={\"mb-md\"}>\n The sleek, stylish design complements any outfit, making it not only a practical\n accessory but also a fashion statement. With its smooth opening mechanism, you\n can effortlessly transition from a sunny day to a rainy one without missing a\n beat. Whether you are navigating through a busy city street or enjoying a quiet\n stroll in the park, this umbrella offers unmatched comfort and protection.\n </p>\n <p className={\"mb-md\"}>\n Indeed, it is not just an umbrella — it is an experience. One that elevates your\n daily routine, making every step in both sun and storm feel just a little bit\n brighter.\n </p>\n </>\n ),\n onOpenChange: opened => {\n console.log(`Drawer is ${opened ? \"opened\" : \"closed\"}.`);\n },\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true\n },\n argTypes: {}\n};\n\nexport const SizeSmall: Story = {\n args: {\n ...Default.args,\n size: \"sm\"\n }\n};\n\nexport const SizeMedium: Story = {\n args: {\n ...Default.args,\n size: \"md\"\n }\n};\n\nexport const SizeLarge: Story = {\n args: {\n ...Default.args,\n size: \"lg\"\n }\n};\n\nexport const SizeExtraLarge: Story = {\n args: {\n ...Default.args,\n size: \"xl\"\n }\n};\n\nexport const ControlledVisibility: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text={\"Open\"} onClick={() => setOpen(true)} />\n <Drawer\n {...props}\n open={open}\n onOpenChange={open => {\n if (!open) {\n setOpen(false);\n }\n }}\n />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer's visibility is controlled by the open state.</>\n }\n};\n\nexport const WithOpenCloseEventHandler: Story = {\n args: {\n ...Default.args,\n onClose: () => {\n console.log(\"onClose triggered\");\n },\n onOpen: () => {\n console.log(\"onOpen triggered\");\n }\n }\n};\n\nexport const WithDropdownMenu: Story = {\n render: props => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item\n text={\"Open Drawer\"}\n content={\"Open Drawer\"}\n onClick={() => setOpen(true)}\n />\n </DropdownMenu>\n\n <Drawer {...props} open={open} onOpenChange={() => setOpen(false)} />\n </>\n );\n },\n args: {\n ...Default.args,\n trigger: null,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const WithoutCloseButton: Story = {\n args: {\n ...Default.args,\n showCloseButton: false,\n children: <>This drawer is opened from a dropdown menu item.</>\n }\n};\n\nexport const CustomWidth: Story = {\n args: {\n ...Default.args,\n width: 1000,\n children: <>This drawer has a custom width of 1000px, making it wider than the default.</>\n }\n};\n\nexport const WithTabs: Story = {\n args: {\n ...Default.args,\n bodyPadding: false,\n headerSeparator: false,\n children: (\n <>\n <Tabs\n separator={true}\n spacing={\"lg\"}\n tabs={[\n <Tabs.Tab\n key=\"account\"\n value=\"account\"\n trigger={\"Account\"}\n content={\"Make changes to your account here.\"}\n />,\n <Tabs.Tab\n key=\"company\"\n value=\"company\"\n trigger={\"Company\"}\n content={\"Make changes to your company info here.\"}\n />,\n <Tabs.Tab\n key=\"security\"\n value=\"security\"\n trigger={\"Security\"}\n content={\"Make changes to your security settings here.\"}\n />,\n <Tabs.Tab\n key=\"development\"\n value=\"development\"\n trigger={\"Development\"}\n content={\"Make changes to your development settings here.\"}\n />\n ]}\n />\n </>\n )\n }\n};\n\nexport const DropdownMenuInDrawer: Story = {\n args: {\n ...Default.args,\n children: (\n <>\n <DropdownMenu trigger={<Button variant=\"primary\" text={\"Open\"} />}>\n <DropdownMenu.Item content={\"Billing\"} />\n <DropdownMenu.Item content={\"Settings\"} />\n <DropdownMenu.Item content={\"Keyboard shortcuts\"} />\n </DropdownMenu>\n </>\n )\n }\n};\n\nexport const WithIcon: Story = {\n args: {\n ...Default.args,\n icon: <Drawer.Icon icon={<DoorbellIcon />} label={\"Icon label...\"} />,\n children: <>The icon helps to visually identify the purpose of this drawer.</>\n }\n};\n\nexport const WithHeaderActions: Story = {\n args: {\n ...Default.args,\n headerActions: (\n <IconButton\n variant={\"ghost\"}\n size={\"md\"}\n iconSize={\"lg\"}\n title={\"Refresh\"}\n aria-label={\"Refresh\"}\n icon={<RefreshIcon />}\n />\n ),\n children: <>Header actions sit next to the close button.</>\n }\n};\n\nexport const AsModal: Story = {\n args: {\n ...Default.args,\n modal: true,\n children: (\n <>\n This drawer has modal=true, which means it will show an overlay behind it and\n prevent interaction with the content underneath.\n </>\n )\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n const [open, setOpen] = React.useState(false);\n\n return (\n <>\n <Button variant=\"primary\" text=\"Open Drawer\" onClick={() => setOpen(true)} />\n\n <Drawer {...args} open={open} onOpenChange={open => setOpen(open)} />\n </>\n );\n },\n args: {\n title: \"Drawer Title\",\n description: \"A short drawer description.\",\n showCloseButton: true,\n bodyPadding: true,\n headerSeparator: true,\n footerSeparator: true,\n side: \"right\",\n modal: false,\n info: (\n <>\n Learn more about this <a href={\"#\"}>here</a>.\n </>\n ),\n children: (\n <>\n <p className={\"mb-md, mt-md\"}>\n This is the drawer content area. You can place any content here including forms,\n text, images, or other components.\n </p>\n <p className={\"mb-md\"}>\n Drawers are useful for displaying additional information or actions without\n navigating away from the current page.\n </p>\n </>\n ),\n actions: (\n <>\n <Drawer.CancelButton />\n <Drawer.ConfirmButton />\n </>\n ),\n width: undefined\n },\n argTypes: {\n title: {\n description: \"Title displayed in the header\",\n control: \"text\"\n },\n description: {\n description: \"Description displayed below the title\",\n control: \"text\"\n },\n side: {\n description: \"Side from which the drawer appears\",\n control: \"select\",\n options: [\"left\", \"right\"],\n defaultValue: \"right\"\n },\n size: {\n description: \"Controls the size of the drawer\",\n control: \"select\",\n options: [\"sm\", \"md\", \"lg\", \"xl\"],\n defaultValue: \"md\"\n },\n showCloseButton: {\n description: \"Show close button in the top-right corner\",\n control: \"boolean\",\n defaultValue: true\n },\n modal: {\n description: \"Whether the drawer should behave as a modal\",\n control: \"boolean\",\n defaultValue: false\n },\n bodyPadding: {\n description: \"Add padding to the drawer body\",\n control: \"boolean\",\n defaultValue: true\n },\n headerSeparator: {\n description: \"Show separator below the header\",\n control: \"boolean\",\n defaultValue: true\n },\n headerActions: {\n description:\n \"Controls rendered in the header, next to the close button, e.g. icon buttons.\"\n },\n footerSeparator: {\n description: \"Show separator above the footer\",\n control: \"boolean\",\n defaultValue: true\n },\n width: {\n description:\n 'Width defines the horizontal size of the Drawer and accepts any valid CSS width value. You can pass a number (interpreted as pixels) or a string like \"80%\", \"50vw\", \"auto\", etc., following React.CSSProperties[\"width\"] types.'\n },\n info: {\n description:\n \"Additional info displayed below the description, please refer to the example below for details.\"\n },\n children: {\n description:\n \"Content of the Drawer, please refer to the 'With Dropdown Menu' and ''With Tabs' example below for details.\"\n },\n actions: {\n description:\n \"Actions displayed in the footer, please refer to the code example for details.\"\n }\n }\n};\n"],"names":["meta","Drawer","Default","Button","opened","console","SizeSmall","SizeMedium","SizeLarge","SizeExtraLarge","ControlledVisibility","props","open","setOpen","React","WithOpenCloseEventHandler","WithDropdownMenu","DropdownMenu","WithoutCloseButton","CustomWidth","WithTabs","Tabs","DropdownMenuInDrawer","WithIcon","DoorbellIcon","WithH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;IACJ;AACJ"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ButtonProps } from "../../Button/index.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
declare const CancelButtonBase: (props: ButtonProps) => React.JSX.Element;
|
|
4
|
+
export declare const CancelButton: typeof CancelButtonBase & {
|
|
5
|
+
original: typeof CancelButtonBase;
|
|
5
6
|
originalName: string;
|
|
6
7
|
displayName: string;
|
|
7
8
|
} & {
|
|
8
|
-
original:
|
|
9
|
-
original:
|
|
9
|
+
original: typeof CancelButtonBase & {
|
|
10
|
+
original: typeof CancelButtonBase;
|
|
10
11
|
originalName: string;
|
|
11
12
|
displayName: string;
|
|
12
13
|
};
|
|
13
14
|
originalName: string;
|
|
14
15
|
displayName: string;
|
|
15
16
|
} & {
|
|
16
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
17
|
-
original:
|
|
17
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof CancelButtonBase & {
|
|
18
|
+
original: typeof CancelButtonBase;
|
|
18
19
|
originalName: string;
|
|
19
20
|
displayName: string;
|
|
20
21
|
}>) => (props: unknown) => React.JSX.Element;
|
|
21
22
|
};
|
|
23
|
+
export {};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ButtonProps } from "../../Button/index.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
declare const ConfirmButtonBase: (props: ButtonProps) => React.JSX.Element;
|
|
4
|
+
export declare const ConfirmButton: typeof ConfirmButtonBase & {
|
|
5
|
+
original: typeof ConfirmButtonBase;
|
|
5
6
|
originalName: string;
|
|
6
7
|
displayName: string;
|
|
7
8
|
} & {
|
|
8
|
-
original:
|
|
9
|
-
original:
|
|
9
|
+
original: typeof ConfirmButtonBase & {
|
|
10
|
+
original: typeof ConfirmButtonBase;
|
|
10
11
|
originalName: string;
|
|
11
12
|
displayName: string;
|
|
12
13
|
};
|
|
13
14
|
originalName: string;
|
|
14
15
|
displayName: string;
|
|
15
16
|
} & {
|
|
16
|
-
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<
|
|
17
|
-
original:
|
|
17
|
+
createDecorator: (decorator: import("@webiny/react-composition/types").ComponentDecorator<typeof ConfirmButtonBase & {
|
|
18
|
+
original: typeof ConfirmButtonBase;
|
|
18
19
|
originalName: string;
|
|
19
20
|
displayName: string;
|
|
20
21
|
}>) => (props: unknown) => React.JSX.Element;
|
|
21
22
|
};
|
|
23
|
+
export {};
|
|
@@ -6,7 +6,7 @@ export interface DrawerContentProps extends React.ComponentPropsWithoutRef<typeo
|
|
|
6
6
|
modal?: boolean;
|
|
7
7
|
}
|
|
8
8
|
declare const drawerVariants: (props?: ({
|
|
9
|
-
size?: "
|
|
9
|
+
size?: "lg" | "md" | "sm" | "xl" | null | undefined;
|
|
10
10
|
side?: "left" | "right" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
declare const DrawerContent: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type DrawerProps } from "../Drawer.js";
|
|
3
|
-
export type DrawerHeaderProps = Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & Pick<DrawerProps, "title" | "icon" | "description" | "showCloseButton"> & {
|
|
3
|
+
export type DrawerHeaderProps = Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & Pick<DrawerProps, "title" | "icon" | "description" | "showCloseButton" | "headerActions"> & {
|
|
4
4
|
separator?: DrawerProps["headerSeparator"];
|
|
5
5
|
};
|
|
6
|
-
export declare const DrawerHeader: ({ title, icon, description, showCloseButton, separator, className, ...props }: DrawerHeaderProps) => React.JSX.Element | null;
|
|
6
|
+
export declare const DrawerHeader: ({ title, icon, description, showCloseButton, headerActions, separator, className, ...props }: DrawerHeaderProps) => React.JSX.Element | null;
|
|
@@ -6,29 +6,32 @@ import { IconButton } from "../../Button/index.js";
|
|
|
6
6
|
import { Dialog } from "radix-ui";
|
|
7
7
|
import { Separator } from "../../Separator/index.js";
|
|
8
8
|
import * as __rspack_external_react from "react";
|
|
9
|
-
const DrawerHeader = ({ title, icon, description, showCloseButton, separator, className, ...props })=>{
|
|
10
|
-
const nothingToRender = (0, __rspack_external_react.useMemo)(()=>!title && !description && !icon && !showCloseButton, [
|
|
9
|
+
const DrawerHeader = ({ title, icon, description, showCloseButton, headerActions, separator, className, ...props })=>{
|
|
10
|
+
const nothingToRender = (0, __rspack_external_react.useMemo)(()=>!title && !description && !icon && !showCloseButton && !headerActions, [
|
|
11
11
|
title,
|
|
12
12
|
description,
|
|
13
13
|
icon,
|
|
14
|
-
showCloseButton
|
|
14
|
+
showCloseButton,
|
|
15
|
+
headerActions
|
|
15
16
|
]);
|
|
16
17
|
if (nothingToRender) return null;
|
|
17
18
|
return /*#__PURE__*/ __rspack_external_react.createElement(__rspack_external_react.Fragment, null, /*#__PURE__*/ __rspack_external_react.createElement("div", {
|
|
18
19
|
...props,
|
|
19
20
|
className: cn("flex flex-col gap-sm px-lg py-md text-center sm:text-left text-neutral-primary", className)
|
|
20
|
-
}, /*#__PURE__*/ __rspack_external_react.createElement(DrawerTitle, {
|
|
21
|
-
className: "flex justify-between"
|
|
22
21
|
}, /*#__PURE__*/ __rspack_external_react.createElement("div", {
|
|
23
|
-
className: "flex gap-
|
|
24
|
-
},
|
|
22
|
+
className: "flex items-center justify-between gap-sm"
|
|
23
|
+
}, /*#__PURE__*/ __rspack_external_react.createElement(DrawerTitle, {
|
|
24
|
+
className: "items-center gap-xs"
|
|
25
|
+
}, icon, title), /*#__PURE__*/ __rspack_external_react.createElement("div", {
|
|
26
|
+
className: "flex items-center gap-xs"
|
|
27
|
+
}, headerActions, false !== showCloseButton && /*#__PURE__*/ __rspack_external_react.createElement(Dialog.Close, {
|
|
25
28
|
asChild: true
|
|
26
29
|
}, /*#__PURE__*/ __rspack_external_react.createElement(IconButton, {
|
|
27
30
|
size: "md",
|
|
28
31
|
iconSize: "lg",
|
|
29
32
|
variant: "ghost",
|
|
30
33
|
icon: /*#__PURE__*/ __rspack_external_react.createElement(ReactComponent, null)
|
|
31
|
-
}))), description && /*#__PURE__*/ __rspack_external_react.createElement(DrawerDescription, null, description)), separator && /*#__PURE__*/ __rspack_external_react.createElement(Separator, null));
|
|
34
|
+
})))), description && /*#__PURE__*/ __rspack_external_react.createElement(DrawerDescription, null, description)), separator && /*#__PURE__*/ __rspack_external_react.createElement(Separator, null));
|
|
32
35
|
};
|
|
33
36
|
export { DrawerHeader };
|
|
34
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer/components/DrawerHeader.js","sources":["../../../src/Drawer/components/DrawerHeader.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"~/utils.js\";\nimport { type DrawerProps } from \"../Drawer.js\";\nimport { DrawerTitle } from \"./DrawerTitle.js\";\nimport { DrawerDescription } from \"./DrawerDescription.js\";\nimport { ReactComponent as XIcon } from \"@webiny/icons/close.svg\";\nimport { IconButton } from \"~/Button/index.js\";\nimport { Dialog as DrawerPrimitive } from \"radix-ui\";\nimport { useMemo } from \"react\";\nimport { Separator } from \"~/Separator/index.js\";\n\nexport type DrawerHeaderProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> &\n Pick<DrawerProps, \"title\" | \"icon\" | \"description\" | \"showCloseButton\"> & {\n separator?: DrawerProps[\"headerSeparator\"];\n };\n\nexport const DrawerHeader = ({\n title,\n icon,\n description,\n showCloseButton,\n separator,\n className,\n ...props\n}: DrawerHeaderProps) => {\n const nothingToRender = useMemo(() => {\n return !title && !description && !icon && !showCloseButton;\n }, [title, description, icon, showCloseButton]);\n\n if (nothingToRender) {\n return null;\n }\n\n return (\n <>\n <div\n {...props}\n className={cn(\n \"flex flex-col gap-sm px-lg py-md text-center sm:text-left text-neutral-primary\",\n className\n )}\n >\n <
|
|
1
|
+
{"version":3,"file":"Drawer/components/DrawerHeader.js","sources":["../../../src/Drawer/components/DrawerHeader.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"~/utils.js\";\nimport { type DrawerProps } from \"../Drawer.js\";\nimport { DrawerTitle } from \"./DrawerTitle.js\";\nimport { DrawerDescription } from \"./DrawerDescription.js\";\nimport { ReactComponent as XIcon } from \"@webiny/icons/close.svg\";\nimport { IconButton } from \"~/Button/index.js\";\nimport { Dialog as DrawerPrimitive } from \"radix-ui\";\nimport { useMemo } from \"react\";\nimport { Separator } from \"~/Separator/index.js\";\n\nexport type DrawerHeaderProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> &\n Pick<DrawerProps, \"title\" | \"icon\" | \"description\" | \"showCloseButton\" | \"headerActions\"> & {\n separator?: DrawerProps[\"headerSeparator\"];\n };\n\nexport const DrawerHeader = ({\n title,\n icon,\n description,\n showCloseButton,\n headerActions,\n separator,\n className,\n ...props\n}: DrawerHeaderProps) => {\n const nothingToRender = useMemo(() => {\n return !title && !description && !icon && !showCloseButton && !headerActions;\n }, [title, description, icon, showCloseButton, headerActions]);\n\n if (nothingToRender) {\n return null;\n }\n\n return (\n <>\n <div\n {...props}\n className={cn(\n \"flex flex-col gap-sm px-lg py-md text-center sm:text-left text-neutral-primary\",\n className\n )}\n >\n {/* Buttons stay outside the title, so they don't become part of the dialog's name. */}\n <div className={\"flex items-center justify-between gap-sm\"}>\n <DrawerTitle className={\"items-center gap-xs\"}>\n {icon}\n {title}\n </DrawerTitle>\n\n <div className={\"flex items-center gap-xs\"}>\n {headerActions}\n {showCloseButton !== false && (\n <DrawerPrimitive.Close asChild>\n <IconButton\n size=\"md\"\n iconSize=\"lg\"\n variant={\"ghost\"}\n icon={<XIcon />}\n />\n </DrawerPrimitive.Close>\n )}\n </div>\n </div>\n {description && <DrawerDescription>{description}</DrawerDescription>}\n </div>\n {separator && <Separator />}\n </>\n );\n};\n"],"names":["DrawerHeader","title","icon","description","showCloseButton","headerActions","separator","className","props","nothingToRender","useMemo","cn","DrawerTitle","DrawerPrimitive","IconButton","XIcon","DrawerDescription","Separator"],"mappings":";;;;;;;;AAgBO,MAAMA,eAAe,CAAC,EACzBC,KAAK,EACLC,IAAI,EACJC,WAAW,EACXC,eAAe,EACfC,aAAa,EACbC,SAAS,EACTC,SAAS,EACT,GAAGC,OACa;IAChB,MAAMC,kBAAkBC,AAAAA,IAAAA,wBAAAA,OAAAA,AAAAA,EAAQ,IACrB,CAACT,SAAS,CAACE,eAAe,CAACD,QAAQ,CAACE,mBAAmB,CAACC,eAChE;QAACJ;QAAOE;QAAaD;QAAME;QAAiBC;KAAc;IAE7D,IAAII,iBACA,OAAO;IAGX,OAAO,WAAP,GACI,4FACI,sCAAC;QACI,GAAGD,KAAK;QACT,WAAWG,GACP,kFACAJ;qBAIJ,sCAAC;QAAI,WAAW;qBACZ,sCAACK,aAAWA;QAAC,WAAW;OACnBV,MACAD,QAAAA,WAAAA,GAGL,sCAAC;QAAI,WAAW;OACXI,eACAD,AAAoB,UAApBA,mBAA6B,WAAT,GACjB,sCAACS,OAAAA,KAAqB;QAAC;qBACnB,sCAACC,YAAUA;QACP,MAAK;QACL,UAAS;QACT,SAAS;QACT,oBAAM,sCAACC,gBAAKA;WAM/BZ,eAAe,WAAfA,GAAe,sCAACa,mBAAiBA,MAAEb,eAEvCG,aAAa,WAAbA,GAAa,sCAACW,WAASA;AAGpC"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { IconProps as IconComponentProps } from "../../Icon/index.js";
|
|
3
3
|
type IconProps = IconComponentProps;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
declare const IconBase: (props: IconProps) => React.JSX.Element;
|
|
5
|
+
export declare const Icon: typeof IconBase & {
|
|
6
|
+
original: typeof IconBase;
|
|
6
7
|
originalName: string;
|
|
7
8
|
displayName: string;
|
|
8
9
|
} & {
|
|
9
|
-
original:
|
|
10
|
-
original:
|
|
10
|
+
original: typeof IconBase & {
|
|
11
|
+
original: typeof IconBase;
|
|
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 IconBase & {
|
|
19
|
+
original: typeof IconBase;
|
|
19
20
|
originalName: string;
|
|
20
21
|
displayName: string;
|
|
21
22
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeDecoratable } from "../../utils.js";
|
|
2
2
|
import { Icon } from "../../Icon/index.js";
|
|
3
3
|
import * as __rspack_external_react from "react";
|
|
4
|
-
const IconBase = (
|
|
4
|
+
const IconBase = (props)=>/*#__PURE__*/ __rspack_external_react.createElement(Icon, {
|
|
5
5
|
size: "lg",
|
|
6
6
|
color: "neutral-strong",
|
|
7
|
-
...props
|
|
8
|
-
className: cn("pt-xs", className)
|
|
7
|
+
...props
|
|
9
8
|
});
|
|
10
9
|
const Icon_Icon = makeDecoratable("Icon", IconBase);
|
|
11
10
|
export { Icon_Icon as Icon };
|