@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
|
@@ -6,7 +6,7 @@ import { FileItem, type FileItemDto, type FileItemFormatted } from "../domains/i
|
|
|
6
6
|
import type { FilePreviewRendererProps, TriggerRendererProps } from "./components/types.js";
|
|
7
7
|
declare const filePickerVariants: (props?: ({
|
|
8
8
|
type?: "area" | "compact" | null | undefined;
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "ghost" | "primary" | "secondary" | null | undefined;
|
|
10
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
11
|
interface FilePickerPrimitiveProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof filePickerVariants> {
|
|
12
12
|
/**
|
|
@@ -63,60 +63,61 @@ interface FilePickerPrimitiveProps extends React.HTMLAttributes<HTMLDivElement>,
|
|
|
63
63
|
*/
|
|
64
64
|
value?: FileItemDto | string | null;
|
|
65
65
|
}
|
|
66
|
-
declare const
|
|
67
|
-
|
|
66
|
+
declare const BaseFilePickerPrimitive: ({ className, containerStyle, description, disabled, invalid, label, onEditItem, onRemoveItem, onSelectItem, placeholder, renderFilePreview, renderTrigger, type, value, variant }: FilePickerPrimitiveProps) => React.JSX.Element;
|
|
67
|
+
declare const FilePickerPrimitive: typeof BaseFilePickerPrimitive & {
|
|
68
|
+
original: typeof BaseFilePickerPrimitive;
|
|
68
69
|
originalName: string;
|
|
69
70
|
displayName: string;
|
|
70
71
|
} & {
|
|
71
|
-
original:
|
|
72
|
-
original:
|
|
72
|
+
original: typeof BaseFilePickerPrimitive & {
|
|
73
|
+
original: typeof BaseFilePickerPrimitive;
|
|
73
74
|
originalName: string;
|
|
74
75
|
displayName: string;
|
|
75
76
|
};
|
|
76
77
|
originalName: string;
|
|
77
78
|
displayName: string;
|
|
78
79
|
} & {
|
|
79
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
80
|
-
original:
|
|
80
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof BaseFilePickerPrimitive & {
|
|
81
|
+
original: typeof BaseFilePickerPrimitive;
|
|
81
82
|
originalName: string;
|
|
82
83
|
displayName: string;
|
|
83
84
|
}>) => (props: unknown) => React.JSX.Element;
|
|
84
85
|
} & {
|
|
85
86
|
Preview: {
|
|
86
|
-
Image: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("./index.js").ImagePreviewProps) => React.JSX.Element) & {
|
|
87
|
-
original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("./index.js").ImagePreviewProps) => React.JSX.Element;
|
|
87
|
+
Image: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("./index.js").ImagePreviewProps) => React.JSX.Element) & {
|
|
88
|
+
original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("./index.js").ImagePreviewProps) => React.JSX.Element;
|
|
88
89
|
originalName: string;
|
|
89
90
|
displayName: string;
|
|
90
91
|
} & {
|
|
91
|
-
original: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("./index.js").ImagePreviewProps) => React.JSX.Element) & {
|
|
92
|
-
original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("./index.js").ImagePreviewProps) => React.JSX.Element;
|
|
92
|
+
original: (({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("./index.js").ImagePreviewProps) => React.JSX.Element) & {
|
|
93
|
+
original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("./index.js").ImagePreviewProps) => React.JSX.Element;
|
|
93
94
|
originalName: string;
|
|
94
95
|
displayName: string;
|
|
95
96
|
};
|
|
96
97
|
originalName: string;
|
|
97
98
|
displayName: string;
|
|
98
99
|
} & {
|
|
99
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("./index.js").ImagePreviewProps) => React.JSX.Element) & {
|
|
100
|
-
original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem }: import("./index.js").ImagePreviewProps) => React.JSX.Element;
|
|
100
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("./index.js").ImagePreviewProps) => React.JSX.Element) & {
|
|
101
|
+
original: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: import("./index.js").ImagePreviewProps) => React.JSX.Element;
|
|
101
102
|
originalName: string;
|
|
102
103
|
displayName: string;
|
|
103
104
|
}>) => (props: unknown) => React.JSX.Element;
|
|
104
105
|
};
|
|
105
|
-
RichItem: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element) & {
|
|
106
|
-
original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element;
|
|
106
|
+
RichItem: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element) & {
|
|
107
|
+
original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element;
|
|
107
108
|
originalName: string;
|
|
108
109
|
displayName: string;
|
|
109
110
|
} & {
|
|
110
|
-
original: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element) & {
|
|
111
|
-
original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element;
|
|
111
|
+
original: (({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element) & {
|
|
112
|
+
original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element;
|
|
112
113
|
originalName: string;
|
|
113
114
|
displayName: string;
|
|
114
115
|
};
|
|
115
116
|
originalName: string;
|
|
116
117
|
displayName: string;
|
|
117
118
|
} & {
|
|
118
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element) & {
|
|
119
|
-
original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element;
|
|
119
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element) & {
|
|
120
|
+
original: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: import("./index.js").RichItemPreviewProps) => React.JSX.Element;
|
|
120
121
|
originalName: string;
|
|
121
122
|
displayName: string;
|
|
122
123
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePicker/primitives/FilePickerPrimitive.stories.js","sources":["../../../src/FilePicker/primitives/FilePickerPrimitive.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react-webpack5\";\nimport { FilePickerPrimitive } from \"./FilePickerPrimitive.js\";\nimport type { FileItemDto } from \"~/FilePicker//index.js\";\n\nconst getRandomNumber = (min: number, max: number): number =>\n Math.floor(Math.random() * (max - min + 1)) + min;\n\nconst getFile = (): FileItemDto => {\n const width = getRandomNumber(500, 2000); // Random width between 500 and 2000\n const height = getRandomNumber(500, 2000); // Random height between 500 and 2000\n const fileSize = getRandomNumber(500000, 5000000); // Random file size between 500KB and 5MB\n\n return {\n name: \"selected-file.jpg\",\n mimeType: \"image/jpeg\",\n size: fileSize,\n url: `https://picsum.photos/${width}/${height}`\n };\n};\n\nconst meta: Meta<typeof FilePickerPrimitive> = {\n title: \"Components/Form Primitives/FilePicker\",\n component: FilePickerPrimitive,\n argTypes: {\n onSelectItem: { action: \"onSelectItem\" },\n onEditItem: { action: \"onEditItem\" },\n onRemoveItem: { action: \"onRemoveItem\" },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [selectedFile, setSelectedFile] = useState(args.value);\n return (\n <FilePickerPrimitive\n {...args}\n value={selectedFile}\n onSelectItem={() => setSelectedFile(getFile())}\n onRemoveItem={() => setSelectedFile(null)}\n onEditItem={() => alert(`Editing File`)}\n />\n );\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof FilePickerPrimitive>;\n\nexport const Default: Story = {\n args: {\n label: \"Upload background image\"\n }\n};\n\nexport const AreaType: Story = {\n args: {\n ...Default.args,\n type: \"area\"\n }\n};\n\nexport const AreaPrimaryVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"primary\"\n }\n};\n\nexport const AreaPrimaryVariantDisabled: Story = {\n args: {\n ...AreaPrimaryVariant.args,\n disabled: true\n }\n};\n\nexport const AreaPrimaryVariantInvalid: Story = {\n args: {\n ...AreaPrimaryVariant.args,\n invalid: true\n }\n};\n\nexport const AreaSecondaryVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"secondary\"\n }\n};\n\nexport const AreaSecondaryVariantDisabled: Story = {\n args: {\n ...AreaSecondaryVariant.args,\n disabled: true\n }\n};\n\nexport const AreaSecondaryVariantInvalid: Story = {\n args: {\n ...AreaSecondaryVariant.args,\n invalid: true\n }\n};\n\nexport const AreaGhostVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"ghost\"\n }\n};\n\nexport const AreaGhostVariantDisabled: Story = {\n args: {\n ...AreaGhostVariant.args,\n disabled: true\n }\n};\n\nexport const AreaGhostVariantInvalid: Story = {\n args: {\n ...AreaGhostVariant.args,\n invalid: true\n }\n};\n\nexport const AreaWithImagePreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.Image {...props} />\n }\n};\n\nexport const AreaWithImagePreviewLight: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithImagePreviewBase: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithImagePreviewTransparent: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.RichItem {...props} />\n }\n};\n\nexport const AreaWithRichItemPreviewLight: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreviewBase: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreviewTransparent: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemThumbnailPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"thumbnail\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemFileTypePreview: Story = {\n args: {\n ...AreaType.args,\n value: {\n name: \"export.csv\",\n url: \"export.csv\",\n mimeType: \"text/csv\",\n size: 100000\n },\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"file-type\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemFileTypePlaceholder: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"placeholder\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.TextOnly {...props} />\n }\n};\n\nexport const AreaWithTextOnlyPreviewLight: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreviewBase: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreviewTransparent: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const CompactType: Story = {\n args: {\n ...Default.args,\n type: \"compact\"\n }\n};\n\nexport const CompactPrimaryVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"primary\"\n }\n};\n\nexport const CompactPrimaryVariantDisabled: Story = {\n args: {\n ...CompactPrimaryVariant.args,\n disabled: true\n }\n};\n\nexport const CompactPrimaryVariantInvalid: Story = {\n args: {\n ...CompactPrimaryVariant.args,\n invalid: true\n }\n};\n\nexport const CompactSecondaryVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"secondary\"\n }\n};\n\nexport const CompactSecondaryVariantDisabled: Story = {\n args: {\n ...CompactSecondaryVariant.args,\n disabled: true\n }\n};\n\nexport const CompactSecondaryVariantInvalid: Story = {\n args: {\n ...CompactSecondaryVariant.args,\n invalid: true\n }\n};\n\nexport const CompactGhostVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"ghost\"\n }\n};\n\nexport const CompactGhostVariantDisabled: Story = {\n args: {\n ...CompactGhostVariant.args,\n disabled: true\n }\n};\n\nexport const CompactGhostVariantInvalid: Story = {\n args: {\n ...CompactGhostVariant.args,\n invalid: true\n }\n};\n\nexport const CompactWithTextOnlyPreviewSmall: Story = {\n args: {\n ...CompactType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.TextOnly {...props} small={true} />\n }\n};\n"],"names":["getRandomNumber","min","max","Math","getFile","width","height","fileSize","meta","FilePickerPrimitive","args","selectedFile","setSelectedFile","useState","alert","Default","AreaType","AreaPrimaryVariant","AreaPrimaryVariantDisabled","AreaPrimaryVariantInvalid","AreaSecondaryVariant","AreaSecondaryVariantDisabled","AreaSecondaryVariantInvalid","AreaGhostVariant","AreaGhostVariantDisabled","AreaGhostVariantInvalid","AreaWithImagePreview","props","AreaWithImagePreviewLight","AreaWithImagePreviewBase","AreaWithImagePreviewTransparent","AreaWithRichItemPreview","AreaWithRichItemPreviewLight","AreaWithRichItemPreviewBase","AreaWithRichItemPreviewTransparent","AreaWithRichItemThumbnailPreview","AreaWithRichItemFileTypePreview","AreaWithRichItemFileTypePlaceholder","AreaWithTextOnlyPreview","AreaWithTextOnlyPreviewLight","AreaWithTextOnlyPreviewBase","AreaWithTextOnlyPreviewTransparent","CompactType","CompactPrimaryVariant","CompactPrimaryVariantDisabled","CompactPrimaryVariantInvalid","CompactSecondaryVariant","CompactSecondaryVariantDisabled","CompactSecondaryVariantInvalid","CompactGhostVariant","CompactGhostVariantDisabled","CompactGhostVariantInvalid","CompactWithTextOnlyPreviewSmall"],"mappings":";;AAKA,MAAMA,kBAAkB,CAACC,KAAaC,MAClCC,KAAK,KAAK,CAACA,KAAK,MAAM,KAAMD,CAAAA,MAAMD,MAAM,MAAMA;AAElD,MAAMG,UAAU;IACZ,MAAMC,QAAQL,gBAAgB,KAAK;IACnC,MAAMM,SAASN,gBAAgB,KAAK;IACpC,MAAMO,WAAWP,gBAAgB,QAAQ;IAEzC,OAAO;QACH,MAAM;QACN,UAAU;QACV,MAAMO;QACN,KAAK,CAAC,sBAAsB,EAAEF,MAAM,CAAC,EAAEC,QAAQ;IACnD;AACJ;AAEA,MAAME,OAAyC;IAC3C,OAAO;IACP,WAAWC;IACX,UAAU;QACN,cAAc;YAAE,QAAQ;QAAe;QACvC,YAAY;YAAE,QAAQ;QAAa;QACnC,cAAc;YAAE,QAAQ;QAAe;QACvC,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,cAAcC,gBAAgB,GAAGC,SAASH,KAAK,KAAK;QAC3D,OAAO,WAAP,GACI,oBAACD,qBAAmBA;YACf,GAAGC,IAAI;YACR,OAAOC;YACP,cAAc,IAA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f,oBAAClB,oBAAoB,OAAO,CAAC,QAAQ;gBAAC,SAAS;gBAAgB,GAAGkB,KAAK;;IAE/E;AACJ;AAEO,MAAMe,cAAqB;IAC9B,MAAM;QACF,GAAG3B,QAAQ,IAAI;QACf,MAAM;IACV;AACJ;AAEO,MAAM4B,wBAA+B;IACxC,MAAM;QACF,GAAGD,YAAY,IAAI;QACnB,SAAS;IACb;AACJ;AAEO,MAAME,gCAAuC;IAChD,MAAM;QACF,GAAGD,sBAAsB,IAAI;QAC7B,UAAU;IACd;AACJ;AAEO,MAAME,+BAAsC;IAC/C,MAAM;QACF,GAAGF,sBAAsB,IAAI;QAC7B,SAAS;IACb;AACJ;AAEO,MAAMG,0BAAiC;IAC1C,MAAM;QACF,GAAGJ,YAAY,IAAI;QACnB,SAAS;IACb;AACJ;AAEO,MAAMK,kCAAyC;IAClD,MAAM;QACF,GAAGD,wBAAwB,IAAI;QAC/B,UAAU;IACd;AACJ;AAEO,MAAME,iCAAwC;IACjD,MAAM;QACF,GAAGF,wBAAwB,IAAI;QAC/B,SAAS;IACb;AACJ;AAEO,MAAMG,sBAA6B;IACtC,MAAM;QACF,GAAGP,YAAY,IAAI;QACnB,SAAS;IACb;AACJ;AAEO,MAAMQ,8BAAqC;IAC9C,MAAM;QACF,GAAGD,oBAAoB,IAAI;QAC3B,UAAU;IACd;AACJ;AAEO,MAAME,6BAAoC;IAC7C,MAAM;QACF,GAAGF,oBAAoB,IAAI;QAC3B,SAAS;IACb;AACJ;AAEO,MAAMG,kCAAyC;IAClD,MAAM;QACF,GAAGV,YAAY,IAAI;QACnB,mBAAmBf,CAAAA,QAAAA,WAAAA,GAAS,oBAAClB,oBAAoB,OAAO,CAAC,QAAQ;gBAAE,GAAGkB,KAAK;gBAAE,OAAO;;IACxF;AACJ"}
|
|
1
|
+
{"version":3,"file":"FilePicker/primitives/FilePickerPrimitive.stories.js","sources":["../../../src/FilePicker/primitives/FilePickerPrimitive.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { FilePickerPrimitive } from \"./FilePickerPrimitive.js\";\nimport type { FileItemDto } from \"~/FilePicker//index.js\";\n\nconst getRandomNumber = (min: number, max: number): number =>\n Math.floor(Math.random() * (max - min + 1)) + min;\n\nconst getFile = (): FileItemDto => {\n const width = getRandomNumber(500, 2000); // Random width between 500 and 2000\n const height = getRandomNumber(500, 2000); // Random height between 500 and 2000\n const fileSize = getRandomNumber(500000, 5000000); // Random file size between 500KB and 5MB\n\n return {\n name: \"selected-file.jpg\",\n mimeType: \"image/jpeg\",\n size: fileSize,\n url: `https://picsum.photos/${width}/${height}`\n };\n};\n\nconst meta: Meta<typeof FilePickerPrimitive> = {\n title: \"Components/Form Primitives/FilePicker\",\n component: FilePickerPrimitive,\n argTypes: {\n onSelectItem: { action: \"onSelectItem\" },\n onEditItem: { action: \"onEditItem\" },\n onRemoveItem: { action: \"onRemoveItem\" },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [selectedFile, setSelectedFile] = useState(args.value);\n return (\n <FilePickerPrimitive\n {...args}\n value={selectedFile}\n onSelectItem={() => setSelectedFile(getFile())}\n onRemoveItem={() => setSelectedFile(null)}\n onEditItem={() => alert(`Editing File`)}\n />\n );\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof FilePickerPrimitive>;\n\nexport const Default: Story = {\n args: {\n label: \"Upload background image\"\n }\n};\n\nexport const AreaType: Story = {\n args: {\n ...Default.args,\n type: \"area\"\n }\n};\n\nexport const AreaPrimaryVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"primary\"\n }\n};\n\nexport const AreaPrimaryVariantDisabled: Story = {\n args: {\n ...AreaPrimaryVariant.args,\n disabled: true\n }\n};\n\nexport const AreaPrimaryVariantInvalid: Story = {\n args: {\n ...AreaPrimaryVariant.args,\n invalid: true\n }\n};\n\nexport const AreaSecondaryVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"secondary\"\n }\n};\n\nexport const AreaSecondaryVariantDisabled: Story = {\n args: {\n ...AreaSecondaryVariant.args,\n disabled: true\n }\n};\n\nexport const AreaSecondaryVariantInvalid: Story = {\n args: {\n ...AreaSecondaryVariant.args,\n invalid: true\n }\n};\n\nexport const AreaGhostVariant: Story = {\n args: {\n ...AreaType.args,\n variant: \"ghost\"\n }\n};\n\nexport const AreaGhostVariantDisabled: Story = {\n args: {\n ...AreaGhostVariant.args,\n disabled: true\n }\n};\n\nexport const AreaGhostVariantInvalid: Story = {\n args: {\n ...AreaGhostVariant.args,\n invalid: true\n }\n};\n\nexport const AreaWithImagePreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.Image {...props} />\n }\n};\n\nexport const AreaWithImagePreviewLight: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithImagePreviewBase: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithImagePreviewTransparent: Story = {\n args: {\n ...AreaWithImagePreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.Image variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.RichItem {...props} />\n }\n};\n\nexport const AreaWithRichItemPreviewLight: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreviewBase: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemPreviewTransparent: Story = {\n args: {\n ...AreaWithRichItemPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemThumbnailPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"thumbnail\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemFileTypePreview: Story = {\n args: {\n ...AreaType.args,\n value: {\n name: \"export.csv\",\n url: \"export.csv\",\n mimeType: \"text/csv\",\n size: 100000\n },\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"file-type\"} {...props} />\n )\n }\n};\n\nexport const AreaWithRichItemFileTypePlaceholder: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.RichItem preview={\"placeholder\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreview: Story = {\n args: {\n ...AreaType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.TextOnly {...props} />\n }\n};\n\nexport const AreaWithTextOnlyPreviewLight: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"light\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreviewBase: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"base\"} {...props} />\n )\n }\n};\n\nexport const AreaWithTextOnlyPreviewTransparent: Story = {\n args: {\n ...AreaWithTextOnlyPreview.args,\n renderFilePreview: props => (\n <FilePickerPrimitive.Preview.TextOnly variant={\"transparent\"} {...props} />\n )\n }\n};\n\nexport const CompactType: Story = {\n args: {\n ...Default.args,\n type: \"compact\"\n }\n};\n\nexport const CompactPrimaryVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"primary\"\n }\n};\n\nexport const CompactPrimaryVariantDisabled: Story = {\n args: {\n ...CompactPrimaryVariant.args,\n disabled: true\n }\n};\n\nexport const CompactPrimaryVariantInvalid: Story = {\n args: {\n ...CompactPrimaryVariant.args,\n invalid: true\n }\n};\n\nexport const CompactSecondaryVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"secondary\"\n }\n};\n\nexport const CompactSecondaryVariantDisabled: Story = {\n args: {\n ...CompactSecondaryVariant.args,\n disabled: true\n }\n};\n\nexport const CompactSecondaryVariantInvalid: Story = {\n args: {\n ...CompactSecondaryVariant.args,\n invalid: true\n }\n};\n\nexport const CompactGhostVariant: Story = {\n args: {\n ...CompactType.args,\n variant: \"ghost\"\n }\n};\n\nexport const CompactGhostVariantDisabled: Story = {\n args: {\n ...CompactGhostVariant.args,\n disabled: true\n }\n};\n\nexport const CompactGhostVariantInvalid: Story = {\n args: {\n ...CompactGhostVariant.args,\n invalid: true\n }\n};\n\nexport const CompactWithTextOnlyPreviewSmall: Story = {\n args: {\n ...CompactType.args,\n renderFilePreview: props => <FilePickerPrimitive.Preview.TextOnly {...props} small={true} />\n }\n};\n"],"names":["getRandomNumber","min","max","Math","getFile","width","height","fileSize","meta","FilePickerPrimitive","args","selectedFile","setSelectedFile","useState","alert","Default","AreaType","AreaPrimaryVariant","AreaPrimaryVariantDisabled","AreaPrimaryVariantInvalid","AreaSecondaryVariant","AreaSecondaryVariantDisabled","AreaSecondaryVariantInvalid","AreaGhostVariant","AreaGhostVariantDisabled","AreaGhostVariantInvalid","AreaWithImagePreview","props","AreaWithImagePreviewLight","AreaWithImagePreviewBase","AreaWithImagePreviewTransparent","AreaWithRichItemPreview","AreaWithRichItemPreviewLight","AreaWithRichItemPreviewBase","AreaWithRichItemPreviewTransparent","AreaWithRichItemThumbnailPreview","AreaWithRichItemFileTypePreview","AreaWithRichItemFileTypePlaceholder","AreaWithTextOnlyPreview","AreaWithTextOnlyPreviewLight","AreaWithTextOnlyPreviewBase","AreaWithTextOnlyPreviewTransparent","CompactType","CompactPrimaryVariant","CompactPrimaryVariantDisabled","CompactPrimaryVariantInvalid","CompactSecondaryVariant","CompactSecondaryVariantDisabled","CompactSecondaryVariantInvalid","CompactGhostVariant","CompactGhostVariantDisabled","CompactGhostVariantInvalid","CompactWithTextOnlyPreviewSmall"],"mappings":";;AAKA,MAAMA,kBAAkB,CAACC,KAAaC,MAClCC,KAAK,KAAK,CAACA,KAAK,MAAM,KAAMD,CAAAA,MAAMD,MAAM,MAAMA;AAElD,MAAMG,UAAU;IACZ,MAAMC,QAAQL,gBAAgB,KAAK;IACnC,MAAMM,SAASN,gBAAgB,KAAK;IACpC,MAAMO,WAAWP,gBAAgB,QAAQ;IAEzC,OAAO;QACH,MAAM;QACN,UAAU;QACV,MAAMO;QACN,KAAK,CAAC,sBAAsB,EAAEF,MAAM,CAAC,EAAEC,QAAQ;IACnD;AACJ;AAEA,MAAME,OAAyC;IAC3C,OAAO;IACP,WAAWC;IACX,UAAU;QACN,cAAc;YAAE,QAAQ;QAAe;QACvC,YAAY;YAAE,QAAQ;QAAa;QACnC,cAAc;YAAE,QAAQ;QAAe;QACvC,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,cAAcC,gBAAgB,GAAGC,SAASH,KAAK,KAAK;QAC3D,OAAO,WAAP,GACI,oBAACD,qBAAmBA;YACf,GAAGC,IAAI;YACR,OAAOC;YACP,cAAc,IAAMC,gBAAgBR;YACpC,cAAc,IAAMQ,gBAAgB;YACpC,YAAY,IAAME,MAAM;;IAGpC;AACJ;AAEA,oCAAeN;AAGR,MAAMO,UAAiB;IAC1B,MAAM;QACF,OAAO;IACX;AACJ;AAEO,MAAMC,WAAkB;IAC3B,MAAM;QACF,GAAGD,QAAQ,IAAI;QACf,MAAM;IACV;AACJ;AAEO,MAAME,qBAA4B;IACrC,MAAM;QACF,GAAGD,SAAS,IAAI;QAChB,SAAS;IACb;AACJ;AAEO,M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,UAAU;IACd;AACJ;AAEO,MAAME,+BAAsC;IAC/C,MAAM;QACF,GAAGF,sBAAsB,IAAI;QAC7B,SAAS;IACb;AACJ;AAEO,MAAMG,0BAAiC;IAC1C,MAAM;QACF,GAAGJ,YAAY,IAAI;QACnB,SAAS;IACb;AACJ;AAEO,MAAMK,kCAAyC;IAClD,MAAM;QACF,GAAGD,wBAAwB,IAAI;QAC/B,UAAU;IACd;AACJ;AAEO,MAAME,iCAAwC;IACjD,MAAM;QACF,GAAGF,wBAAwB,IAAI;QAC/B,SAAS;IACb;AACJ;AAEO,MAAMG,sBAA6B;IACtC,MAAM;QACF,GAAGP,YAAY,IAAI;QACnB,SAAS;IACb;AACJ;AAEO,MAAMQ,8BAAqC;IAC9C,MAAM;QACF,GAAGD,oBAAoB,IAAI;QAC3B,UAAU;IACd;AACJ;AAEO,MAAME,6BAAoC;IAC7C,MAAM;QACF,GAAGF,oBAAoB,IAAI;QAC3B,SAAS;IACb;AACJ;AAEO,MAAMG,kCAAyC;IAClD,MAAM;QACF,GAAGV,YAAY,IAAI;QACnB,mBAAmBf,CAAAA,QAAAA,WAAAA,GAAS,oBAAClB,oBAAoB,OAAO,CAAC,QAAQ;gBAAE,GAAGkB,KAAK;gBAAE,OAAO;;IACxF;AACJ"}
|
|
@@ -3,7 +3,7 @@ import { type VariantProps } from "../../../utils.js";
|
|
|
3
3
|
import type { TriggerDefaultProps } from "../../../FilePicker/primitives/components/types.js";
|
|
4
4
|
declare const triggerVariants: (props?: ({
|
|
5
5
|
type?: "area" | "compact" | null | undefined;
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "ghost" | "primary" | "secondary" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
interface TriggerProps extends TriggerDefaultProps, VariantProps<typeof triggerVariants> {
|
|
9
9
|
renderTrigger?: (props: any) => React.ReactElement<any>;
|
|
@@ -1,21 +1,33 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { FilePreviewDefaultProps } from "../../types.js";
|
|
3
|
-
type ImagePreviewProps = FilePreviewDefaultProps
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
type ImagePreviewProps = FilePreviewDefaultProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Optional custom image renderer. Lets a consumer render, e.g., a cropped /
|
|
6
|
+
* focal-point-aware thumbnail while keeping all of the preview chrome. When
|
|
7
|
+
* omitted (or it returns a falsy value) a plain `<img>` is rendered.
|
|
8
|
+
*/
|
|
9
|
+
renderImage?: (args: {
|
|
10
|
+
url: string;
|
|
11
|
+
name: string;
|
|
12
|
+
className: string;
|
|
13
|
+
}) => React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
declare const DecoratableImagePreview: ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage }: ImagePreviewProps) => React.JSX.Element;
|
|
16
|
+
declare const ImagePreview: typeof DecoratableImagePreview & {
|
|
17
|
+
original: typeof DecoratableImagePreview;
|
|
6
18
|
originalName: string;
|
|
7
19
|
displayName: string;
|
|
8
20
|
} & {
|
|
9
|
-
original:
|
|
10
|
-
original:
|
|
21
|
+
original: typeof DecoratableImagePreview & {
|
|
22
|
+
original: typeof DecoratableImagePreview;
|
|
11
23
|
originalName: string;
|
|
12
24
|
displayName: string;
|
|
13
25
|
};
|
|
14
26
|
originalName: string;
|
|
15
27
|
displayName: string;
|
|
16
28
|
} & {
|
|
17
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
18
|
-
original:
|
|
29
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableImagePreview & {
|
|
30
|
+
original: typeof DecoratableImagePreview;
|
|
19
31
|
originalName: string;
|
|
20
32
|
displayName: string;
|
|
21
33
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -2,7 +2,19 @@ import react from "react";
|
|
|
2
2
|
import { cn, makeDecoratable } from "../../../../../utils.js";
|
|
3
3
|
import { previewVariants } from "../variants.js";
|
|
4
4
|
import { ItemActions } from "../ItemActions.js";
|
|
5
|
-
const
|
|
5
|
+
const IMAGE_CLASS = "object-contain size-full";
|
|
6
|
+
const DecoratableImagePreview = ({ value, className, variant, disabled, onRemoveItem, onReplaceItem, onEditItem, renderImage })=>{
|
|
7
|
+
let image = /*#__PURE__*/ react.createElement("img", {
|
|
8
|
+
src: value.url,
|
|
9
|
+
alt: value.name,
|
|
10
|
+
className: IMAGE_CLASS
|
|
11
|
+
});
|
|
12
|
+
if ("function" == typeof renderImage) image = renderImage({
|
|
13
|
+
url: value.url,
|
|
14
|
+
name: value.name,
|
|
15
|
+
className: IMAGE_CLASS
|
|
16
|
+
});
|
|
17
|
+
return /*#__PURE__*/ react.createElement("div", {
|
|
6
18
|
className: cn("flex justify-center items-center py-sm rounded-md relative", previewVariants({
|
|
7
19
|
variant
|
|
8
20
|
}), className),
|
|
@@ -11,11 +23,7 @@ const DecoratableImagePreview = ({ value, className, variant, disabled, onRemove
|
|
|
11
23
|
className: "cursor-pointer size-[128px] flex justify-center items-center",
|
|
12
24
|
"data-role": "select-image",
|
|
13
25
|
onClick: onReplaceItem
|
|
14
|
-
}, /*#__PURE__*/ react.createElement("
|
|
15
|
-
src: value.url,
|
|
16
|
-
alt: value.name,
|
|
17
|
-
className: "object-contain size-full"
|
|
18
|
-
})), /*#__PURE__*/ react.createElement("div", {
|
|
26
|
+
}, image), /*#__PURE__*/ react.createElement("div", {
|
|
19
27
|
className: "absolute top-1 right-1.5"
|
|
20
28
|
}, /*#__PURE__*/ react.createElement(ItemActions, {
|
|
21
29
|
onRemoveItem: onRemoveItem,
|
|
@@ -23,6 +31,7 @@ const DecoratableImagePreview = ({ value, className, variant, disabled, onRemove
|
|
|
23
31
|
disabled: disabled,
|
|
24
32
|
className: "flex-col"
|
|
25
33
|
})));
|
|
34
|
+
};
|
|
26
35
|
const ImagePreview = makeDecoratable("FileImagePreview", DecoratableImagePreview);
|
|
27
36
|
export { ImagePreview };
|
|
28
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js","sources":["../../../../../../src/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\nimport { previewVariants } from \"../variants.js\";\nimport type { FilePreviewDefaultProps } from \"../../types.js\";\nimport { ItemActions } from \"~/FilePicker/primitives/components/previews/ItemActions.js\";\n\ntype ImagePreviewProps = FilePreviewDefaultProps;\n\nconst DecoratableImagePreview = ({\n value,\n className,\n variant,\n disabled,\n onRemoveItem,\n onReplaceItem,\n onEditItem\n}: ImagePreviewProps) => {\n return (\n <div\n className={cn(\n \"flex justify-center items-center py-sm rounded-md relative\",\n previewVariants({ variant }),\n className\n )}\n data-testid={\"image-preview\"}\n >\n <div\n className={\"cursor-pointer size-[128px] flex justify-center items-center\"}\n data-role={\"select-image\"}\n onClick={onReplaceItem}\n >\n
|
|
1
|
+
{"version":3,"file":"FilePicker/primitives/components/previews/ImagePreview/ImagePreview.js","sources":["../../../../../../src/FilePicker/primitives/components/previews/ImagePreview/ImagePreview.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\nimport { previewVariants } from \"../variants.js\";\nimport type { FilePreviewDefaultProps } from \"../../types.js\";\nimport { ItemActions } from \"~/FilePicker/primitives/components/previews/ItemActions.js\";\n\ntype ImagePreviewProps = FilePreviewDefaultProps & {\n /**\n * Optional custom image renderer. Lets a consumer render, e.g., a cropped /\n * focal-point-aware thumbnail while keeping all of the preview chrome. When\n * omitted (or it returns a falsy value) a plain `<img>` is rendered.\n */\n renderImage?: (args: { url: string; name: string; className: string }) => React.ReactNode;\n};\n\nconst IMAGE_CLASS = \"object-contain size-full\";\n\nconst DecoratableImagePreview = ({\n value,\n className,\n variant,\n disabled,\n onRemoveItem,\n onReplaceItem,\n onEditItem,\n renderImage\n}: ImagePreviewProps) => {\n let image: React.ReactElement | React.ReactNode = (\n <img src={value.url} alt={value.name} className={IMAGE_CLASS} />\n );\n\n if (typeof renderImage === \"function\") {\n image = renderImage({ url: value.url, name: value.name, className: IMAGE_CLASS });\n }\n\n return (\n <div\n className={cn(\n \"flex justify-center items-center py-sm rounded-md relative\",\n previewVariants({ variant }),\n className\n )}\n data-testid={\"image-preview\"}\n >\n <div\n className={\"cursor-pointer size-[128px] flex justify-center items-center\"}\n data-role={\"select-image\"}\n onClick={onReplaceItem}\n >\n {image}\n </div>\n <div className={\"absolute top-1 right-1.5\"}>\n <ItemActions\n onRemoveItem={onRemoveItem}\n onEditItem={onEditItem}\n disabled={disabled}\n className={\"flex-col\"}\n />\n </div>\n </div>\n );\n};\n\nconst ImagePreview = makeDecoratable(\"FileImagePreview\", DecoratableImagePreview);\n\nexport { ImagePreview, type ImagePreviewProps };\n"],"names":["IMAGE_CLASS","DecoratableImagePreview","value","className","variant","disabled","onRemoveItem","onReplaceItem","onEditItem","renderImage","image","cn","previewVariants","ItemActions","ImagePreview","makeDecoratable"],"mappings":";;;;AAeA,MAAMA,cAAc;AAEpB,MAAMC,0BAA0B,CAAC,EAC7BC,KAAK,EACLC,SAAS,EACTC,OAAO,EACPC,QAAQ,EACRC,YAAY,EACZC,aAAa,EACbC,UAAU,EACVC,WAAW,EACK;IAChB,IAAIC,QAAAA,WAAAA,GACA,oBAAC;QAAI,KAAKR,MAAM,GAAG;QAAE,KAAKA,MAAM,IAAI;QAAE,WAAWF;;IAGrD,IAAI,AAAuB,cAAvB,OAAOS,aACPC,QAAQD,YAAY;QAAE,KAAKP,MAAM,GAAG;QAAE,MAAMA,MAAM,IAAI;QAAE,WAAWF;IAAY;IAGnF,OAAO,WAAP,GACI,oBAAC;QACG,WAAWW,GACP,8DACAC,gBAAgB;YAAER;QAAQ,IAC1BD;QAEJ,eAAa;qBAEb,oBAAC;QACG,WAAW;QACX,aAAW;QACX,SAASI;OAERG,QAAAA,WAAAA,GAEL,oBAAC;QAAI,WAAW;qBACZ,oBAACG,aAAWA;QACR,cAAcP;QACd,YAAYE;QACZ,UAAUH;QACV,WAAW;;AAK/B;AAEA,MAAMS,eAAeC,gBAAgB,oBAAoBd"}
|
|
@@ -11,7 +11,7 @@ const ItemActions = ({ disabled, onRemoveItem, onEditItem, onReplaceItem, small,
|
|
|
11
11
|
return /*#__PURE__*/ react.createElement("div", {
|
|
12
12
|
...props,
|
|
13
13
|
className: cn("flex justify-center items-center gap-xs", className)
|
|
14
|
-
},
|
|
14
|
+
}, onReplaceItem && /*#__PURE__*/ react.createElement(IconButton, {
|
|
15
15
|
icon: /*#__PURE__*/ react.createElement(Icon, {
|
|
16
16
|
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
17
17
|
label: "Replace",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePicker/primitives/components/previews/ItemActions.js","sources":["../../../../../src/FilePicker/primitives/components/previews/ItemActions.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as ReplaceIcon } from \"@webiny/icons/file_upload.svg\";\nimport { ReactComponent as EditIcon } from \"@webiny/icons/edit.svg\";\nimport { ReactComponent as TrashIcon } from \"@webiny/icons/delete.svg\";\nimport { IconButton } from \"~/Button/index.js\";\nimport { Icon } from \"~/Icon/index.js\";\nimport { cn } from \"~/utils.js\";\n\ninterface ItemActionsProps extends React.HTMLAttributes<HTMLDivElement> {\n onRemoveItem?: () => void;\n onEditItem?: () => void;\n onReplaceItem?: () => void;\n disabled?: boolean;\n small?: boolean;\n}\n\nconst ItemActions = ({\n disabled,\n onRemoveItem,\n onEditItem,\n onReplaceItem,\n small,\n className,\n ...props\n}: ItemActionsProps) => {\n const iconSize = small ? \"default\" : \"lg\";\n const buttonSize = small ? \"xs\" : \"sm\";\n\n return (\n <div {...props} className={cn(\"flex justify-center items-center gap-xs\", className)}>\n {
|
|
1
|
+
{"version":3,"file":"FilePicker/primitives/components/previews/ItemActions.js","sources":["../../../../../src/FilePicker/primitives/components/previews/ItemActions.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as ReplaceIcon } from \"@webiny/icons/file_upload.svg\";\nimport { ReactComponent as EditIcon } from \"@webiny/icons/edit.svg\";\nimport { ReactComponent as TrashIcon } from \"@webiny/icons/delete.svg\";\nimport { IconButton } from \"~/Button/index.js\";\nimport { Icon } from \"~/Icon/index.js\";\nimport { cn } from \"~/utils.js\";\n\ninterface ItemActionsProps extends React.HTMLAttributes<HTMLDivElement> {\n onRemoveItem?: () => void;\n onEditItem?: () => void;\n onReplaceItem?: () => void;\n disabled?: boolean;\n small?: boolean;\n}\n\nconst ItemActions = ({\n disabled,\n onRemoveItem,\n onEditItem,\n onReplaceItem,\n small,\n className,\n ...props\n}: ItemActionsProps) => {\n const iconSize = small ? \"default\" : \"lg\";\n const buttonSize = small ? \"xs\" : \"sm\";\n\n return (\n <div {...props} className={cn(\"flex justify-center items-center gap-xs\", className)}>\n {onReplaceItem && (\n <IconButton\n icon={\n <Icon\n icon={<ReplaceIcon />}\n label={\"Replace\"}\n size={\"md\"}\n color={\"neutral-light\"}\n />\n }\n variant={\"ghost\"}\n size={buttonSize}\n iconSize={iconSize}\n onClick={onReplaceItem}\n disabled={disabled}\n />\n )}\n\n {onEditItem && (\n <IconButton\n icon={\n <Icon\n icon={<EditIcon />}\n label={\"Edit\"}\n size={\"md\"}\n color={\"neutral-light\"}\n />\n }\n variant={\"ghost\"}\n size={buttonSize}\n iconSize={iconSize}\n onClick={onEditItem}\n disabled={disabled}\n />\n )}\n\n {onRemoveItem && (\n <IconButton\n icon={\n <Icon\n icon={<TrashIcon />}\n label={\"Remove\"}\n size={\"md\"}\n color={\"neutral-light\"}\n />\n }\n variant={\"ghost\"}\n size={buttonSize}\n iconSize={iconSize}\n onClick={onRemoveItem}\n disabled={disabled}\n />\n )}\n </div>\n );\n};\n\nexport { ItemActions, type ItemActionsProps };\n"],"names":["ItemActions","disabled","onRemoveItem","onEditItem","onReplaceItem","small","className","props","iconSize","buttonSize","cn","IconButton","Icon","ReplaceIcon","EditIcon","TrashIcon"],"mappings":";;;;;;;AAgBA,MAAMA,cAAc,CAAC,EACjBC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,aAAa,EACbC,KAAK,EACLC,SAAS,EACT,GAAGC,OACY;IACf,MAAMC,WAAWH,QAAQ,YAAY;IACrC,MAAMI,aAAaJ,QAAQ,OAAO;IAElC,OAAO,WAAP,GACI,oBAAC;QAAK,GAAGE,KAAK;QAAE,WAAWG,GAAG,2CAA2CJ;OACpEF,iBAAiB,WAAjBA,GACG,oBAACO,YAAUA;QACP,oBACI,oBAACC,MAAIA;YACD,oBAAM,oBAACC,gBAAWA;YAClB,OAAO;YACP,MAAM;YACN,OAAO;;QAGf,SAAS;QACT,MAAMJ;QACN,UAAUD;QACV,SAASJ;QACT,UAAUH;QAIjBE,cAAc,WAAdA,GACG,oBAACQ,YAAUA;QACP,oBACI,oBAACC,MAAIA;YACD,oBAAM,oBAACE,yBAAQA;YACf,OAAO;YACP,MAAM;YACN,OAAO;;QAGf,SAAS;QACT,MAAML;QACN,UAAUD;QACV,SAASL;QACT,UAAUF;QAIjBC,gBAAgB,WAAhBA,GACG,oBAACS,YAAUA;QACP,oBACI,oBAACC,MAAIA;YACD,oBAAM,oBAACG,2BAASA;YAChB,OAAO;YACP,MAAM;YACN,OAAO;;QAGf,SAAS;QACT,MAAMN;QACN,UAAUD;QACV,SAASN;QACT,UAAUD;;AAK9B"}
|
|
@@ -7,7 +7,7 @@ const ItemDescription = ({ className, disabled, item, small, ...props })=>{
|
|
|
7
7
|
unitSeparator: " "
|
|
8
8
|
});
|
|
9
9
|
return /*#__PURE__*/ react.createElement("div", {
|
|
10
|
-
className: cn("flex flex-col gap-xxs overflow-hidden
|
|
10
|
+
className: cn("flex flex-col gap-xxs overflow-hidden min-w-0", className),
|
|
11
11
|
...props
|
|
12
12
|
}, /*#__PURE__*/ react.createElement(Text, {
|
|
13
13
|
size: "sm",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePicker/primitives/components/previews/ItemDescription.js","sources":["../../../../../src/FilePicker/primitives/components/previews/ItemDescription.tsx"],"sourcesContent":["import React from \"react\";\nimport bytes from \"bytes\";\nimport { Text } from \"~/Text/index.js\";\nimport { cn } from \"~/utils.js\";\nimport type { FileItemFormatted } from \"~/FilePicker/index.js\";\n\ninterface ItemDescriptionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n item: FileItemFormatted;\n disabled?: boolean;\n small?: boolean;\n}\n\nconst ItemDescription = ({ className, disabled, item, small, ...props }: ItemDescriptionProps) => {\n const formattedSize = item.size && bytes.format(item.size, { unitSeparator: \" \" });\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"FilePicker/primitives/components/previews/ItemDescription.js","sources":["../../../../../src/FilePicker/primitives/components/previews/ItemDescription.tsx"],"sourcesContent":["import React from \"react\";\nimport bytes from \"bytes\";\nimport { Text } from \"~/Text/index.js\";\nimport { cn } from \"~/utils.js\";\nimport type { FileItemFormatted } from \"~/FilePicker/index.js\";\n\ninterface ItemDescriptionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n item: FileItemFormatted;\n disabled?: boolean;\n small?: boolean;\n}\n\nconst ItemDescription = ({ className, disabled, item, small, ...props }: ItemDescriptionProps) => {\n const formattedSize = item.size && bytes.format(item.size, { unitSeparator: \" \" });\n\n return (\n <div className={cn(\"flex flex-col gap-xxs overflow-hidden min-w-0\", className)} {...props}>\n <Text\n size=\"sm\"\n as=\"div\"\n className={cn(\n \"truncate overflow-hidden whitespace-nowrap w-full\",\n disabled ? \"text-neutral-disabled\" : \"text-neutral-primary\"\n )}\n >\n {item.name}\n </Text>\n {!small && (formattedSize || item.mimeType) && (\n <Text\n size=\"sm\"\n className={cn(\n \"truncate overflow-hidden whitespace-nowrap w-full\",\n disabled ? \"text-neutral-disabled\" : \"text-neutral-muted\"\n )}\n >\n {[formattedSize, item.mimeType].filter(Boolean).join(\" - \")}\n </Text>\n )}\n </div>\n );\n};\n\nexport { ItemDescription, type ItemDescriptionProps };\n"],"names":["ItemDescription","className","disabled","item","small","props","formattedSize","bytes","cn","Text","Boolean"],"mappings":";;;;AAYA,MAAMA,kBAAkB,CAAC,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGC,OAA6B;IACzF,MAAMC,gBAAgBH,KAAK,IAAI,IAAII,MAAM,MAAM,CAACJ,KAAK,IAAI,EAAE;QAAE,eAAe;IAAI;IAEhF,OAAO,WAAP,GACI,oBAAC;QAAI,WAAWK,GAAG,iDAAiDP;QAAa,GAAGI,KAAK;qBACrF,oBAACI,MAAIA;QACD,MAAK;QACL,IAAG;QACH,WAAWD,GACP,qDACAN,WAAW,0BAA0B;OAGxCC,KAAK,IAAI,GAEb,CAACC,SAAUE,CAAAA,iBAAiBH,KAAK,QAAO,mBACrC,oBAACM,MAAIA;QACD,MAAK;QACL,WAAWD,GACP,qDACAN,WAAW,0BAA0B;OAGxC;QAACI;QAAeH,KAAK,QAAQ;KAAC,CAAC,MAAM,CAACO,SAAS,IAAI,CAAC;AAKzE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FileItemFormatted } from "../../../../../FilePicker/index.js";
|
|
3
|
+
type FileTypeProps = Pick<FileItemFormatted, "mimeType" | "name">;
|
|
4
|
+
declare const FileType: ({ mimeType, name }: FileTypeProps) => React.JSX.Element;
|
|
5
|
+
export { FileType, type FileTypeProps };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import csv from "../assets/csv.js";
|
|
3
|
+
import doc from "../assets/doc.js";
|
|
4
|
+
import docx from "../assets/docx.js";
|
|
5
|
+
import file from "../assets/file.js";
|
|
6
|
+
import pdf from "../assets/pdf.js";
|
|
7
|
+
import ppt from "../assets/ppt.js";
|
|
8
|
+
import pptx from "../assets/pptx.js";
|
|
9
|
+
import txt from "../assets/txt.js";
|
|
10
|
+
import xls from "../assets/xls.js";
|
|
11
|
+
import xlsx from "../assets/xlsx.js";
|
|
12
|
+
const FileType = ({ mimeType = "", name })=>{
|
|
13
|
+
const getMimeTypeSrc = (mimeType)=>{
|
|
14
|
+
switch(mimeType){
|
|
15
|
+
case "text/csv":
|
|
16
|
+
return csv;
|
|
17
|
+
case "application/msword":
|
|
18
|
+
return doc;
|
|
19
|
+
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
|
|
20
|
+
return docx;
|
|
21
|
+
case "application/pdf":
|
|
22
|
+
return pdf;
|
|
23
|
+
case "application/vnd.ms-powerpoint":
|
|
24
|
+
return ppt;
|
|
25
|
+
case "application/vnd.openxmlformats-officedocument.presentationml.presentation":
|
|
26
|
+
return pptx;
|
|
27
|
+
case "text/plain":
|
|
28
|
+
return txt;
|
|
29
|
+
case "application/vnd.ms-excel":
|
|
30
|
+
return xls;
|
|
31
|
+
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
|
32
|
+
return xlsx;
|
|
33
|
+
default:
|
|
34
|
+
return file;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return /*#__PURE__*/ react.createElement("img", {
|
|
38
|
+
src: getMimeTypeSrc(mimeType),
|
|
39
|
+
alt: name,
|
|
40
|
+
className: "size-full object-contain p-sm-extra"
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
export { FileType };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=FileType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilePicker/primitives/components/previews/RichItemPreview/FileType.js","sources":["../../../../../../src/FilePicker/primitives/components/previews/RichItemPreview/FileType.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FileItemFormatted } from \"~/FilePicker/index.js\";\n\nimport csvThumb from \"../assets/csv.svg\";\nimport docThumb from \"../assets/doc.svg\";\nimport docxThumb from \"../assets/docx.svg\";\nimport fileThumb from \"../assets/file.svg\";\nimport pdfThumb from \"../assets/pdf.svg\";\nimport pptThumb from \"../assets/ppt.svg\";\nimport pptxThumb from \"../assets/pptx.svg\";\nimport txtThumb from \"../assets/txt.svg\";\nimport xlsThumb from \"../assets/xls.svg\";\nimport xlsxThumb from \"../assets/xlsx.svg\";\n\ntype FileTypeProps = Pick<FileItemFormatted, \"mimeType\" | \"name\">;\n\nconst FileType = ({ mimeType = \"\", name }: FileTypeProps) => {\n const getMimeTypeSrc = (mimeType: string) => {\n switch (mimeType) {\n case \"text/csv\": // .csv\n return csvThumb;\n case \"application/msword\": // .doc\n return docThumb;\n case \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\": // .docx\n return docxThumb;\n case \"application/pdf\": // .pdf\n return pdfThumb;\n case \"application/vnd.ms-powerpoint\": // .ppt\n return pptThumb;\n case \"application/vnd.openxmlformats-officedocument.presentationml.presentation\": // .pptx\n return pptxThumb;\n case \"text/plain\": // .txt\n return txtThumb;\n case \"application/vnd.ms-excel\": // .xls\n return xlsThumb;\n case \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\": // .xlsx\n return xlsxThumb;\n default:\n return fileThumb;\n }\n };\n\n return (\n <img\n src={getMimeTypeSrc(mimeType)}\n alt={name}\n className=\"size-full object-contain p-sm-extra\"\n />\n );\n};\n\nexport { FileType, type FileTypeProps };\n"],"names":["FileType","mimeType","name","getMimeTypeSrc","csvThumb","docThumb","docxThumb","pdfThumb","pptThumb","pptxThumb","txtThumb","xlsThumb","xlsxThumb","fileThumb"],"mappings":";;;;;;;;;;;AAgBA,MAAMA,WAAW,CAAC,EAAEC,WAAW,EAAE,EAAEC,IAAI,EAAiB;IACpD,MAAMC,iBAAiB,CAACF;QACpB,OAAQA;YACJ,KAAK;gBACD,OAAOG;YACX,KAAK;gBACD,OAAOC;YACX,KAAK;gBACD,OAAOC;YACX,KAAK;gBACD,OAAOC;YACX,KAAK;gBACD,OAAOC;YACX,KAAK;gBACD,OAAOC;YACX,KAAK;gBACD,OAAOC;YACX,KAAK;gBACD,OAAOC;YACX,KAAK;gBACD,OAAOC;YACX;gBACI,OAAOC;QACf;IACJ;IAEA,OAAO,WAAP,GACI,oBAAC;QACG,KAAKV,eAAeF;QACpB,KAAKC;QACL,WAAU;;AAGtB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FileItemFormatted } from "../../../../../FilePicker/index.js";
|
|
3
|
+
type PlaceholderProps = Pick<FileItemFormatted, "name">;
|
|
4
|
+
declare const Placeholder: ({ name }: PlaceholderProps) => React.JSX.Element;
|
|
5
|
+
export { Placeholder, type PlaceholderProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { ReactComponent } from "@webiny/icons/image.svg";
|
|
3
|
+
import { Icon } from "../../../../../Icon/index.js";
|
|
4
|
+
const Placeholder = ({ name })=>/*#__PURE__*/ react.createElement("div", {
|
|
5
|
+
className: "size-full flex justify-center items-center bg-transparent"
|
|
6
|
+
}, /*#__PURE__*/ react.createElement(Icon, {
|
|
7
|
+
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
8
|
+
label: name,
|
|
9
|
+
size: "lg",
|
|
10
|
+
color: "neutral-light"
|
|
11
|
+
}));
|
|
12
|
+
export { Placeholder };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=Placeholder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilePicker/primitives/components/previews/RichItemPreview/Placeholder.js","sources":["../../../../../../src/FilePicker/primitives/components/previews/RichItemPreview/Placeholder.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as PlaceholderIcon } from \"@webiny/icons/image.svg\";\nimport type { FileItemFormatted } from \"~/FilePicker/index.js\";\nimport { Icon } from \"~/Icon/index.js\";\n\ntype PlaceholderProps = Pick<FileItemFormatted, \"name\">;\n\nconst Placeholder = ({ name }: PlaceholderProps) => {\n return (\n <div className={\"size-full flex justify-center items-center bg-transparent\"}>\n <Icon icon={<PlaceholderIcon />} label={name} size={\"lg\"} color={\"neutral-light\"} />\n </div>\n );\n};\n\nexport { Placeholder, type PlaceholderProps };\n"],"names":["Placeholder","name","Icon","PlaceholderIcon"],"mappings":";;;AAOA,MAAMA,cAAc,CAAC,EAAEC,IAAI,EAAoB,GACpC,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACC,MAAIA;QAAC,oBAAM,oBAACC,gBAAeA;QAAK,OAAOF;QAAM,MAAM;QAAM,OAAO"}
|
|
@@ -2,22 +2,28 @@ import React from "react";
|
|
|
2
2
|
import type { FilePreviewDefaultProps } from "../../types.js";
|
|
3
3
|
type RichItemPreviewProps = FilePreviewDefaultProps & {
|
|
4
4
|
preview?: "thumbnail" | "file-type" | "placeholder";
|
|
5
|
+
/** Optional custom image renderer for the thumbnail (e.g. a cropped preview). */
|
|
6
|
+
renderImage?: (args: {
|
|
7
|
+
url: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}) => React.ReactNode;
|
|
5
10
|
};
|
|
6
|
-
declare const
|
|
7
|
-
|
|
11
|
+
declare const DecoratableRichItemPreview: ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props }: RichItemPreviewProps) => React.JSX.Element;
|
|
12
|
+
declare const RichItemPreview: typeof DecoratableRichItemPreview & {
|
|
13
|
+
original: typeof DecoratableRichItemPreview;
|
|
8
14
|
originalName: string;
|
|
9
15
|
displayName: string;
|
|
10
16
|
} & {
|
|
11
|
-
original:
|
|
12
|
-
original:
|
|
17
|
+
original: typeof DecoratableRichItemPreview & {
|
|
18
|
+
original: typeof DecoratableRichItemPreview;
|
|
13
19
|
originalName: string;
|
|
14
20
|
displayName: string;
|
|
15
21
|
};
|
|
16
22
|
originalName: string;
|
|
17
23
|
displayName: string;
|
|
18
24
|
} & {
|
|
19
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
20
|
-
original:
|
|
25
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableRichItemPreview & {
|
|
26
|
+
original: typeof DecoratableRichItemPreview;
|
|
21
27
|
originalName: string;
|
|
22
28
|
displayName: string;
|
|
23
29
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -1,36 +1,78 @@
|
|
|
1
1
|
import react from "react";
|
|
2
|
+
import bytes from "bytes";
|
|
2
3
|
import { cn, makeDecoratable } from "../../../../../utils.js";
|
|
4
|
+
import { Text } from "../../../../../Text/index.js";
|
|
3
5
|
import { RichItemThumbnail } from "./RichItemThumbnail.js";
|
|
6
|
+
import { ThumbnailActions } from "./ThumbnailActions.js";
|
|
4
7
|
import { ItemDescription } from "../ItemDescription.js";
|
|
5
8
|
import { ItemActions } from "../ItemActions.js";
|
|
9
|
+
import { TruncatedFileName } from "../TruncatedFileName.js";
|
|
6
10
|
import { previewVariants } from "../variants.js";
|
|
7
|
-
const DecoratableRichItemPreview = ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, ...props })
|
|
11
|
+
const DecoratableRichItemPreview = ({ className, disabled, onRemoveItem, onReplaceItem, onEditItem, value, variant, preview, renderImage, ...props })=>{
|
|
12
|
+
const actions = {
|
|
13
|
+
onRemoveItem,
|
|
14
|
+
onReplaceItem,
|
|
15
|
+
onEditItem,
|
|
16
|
+
disabled
|
|
17
|
+
};
|
|
18
|
+
const formattedSize = value.size ? bytes.format(value.size, {
|
|
19
|
+
unitSeparator: " ",
|
|
20
|
+
decimalPlaces: 0
|
|
21
|
+
}) : "";
|
|
22
|
+
const details = [
|
|
23
|
+
value.mimeType,
|
|
24
|
+
formattedSize
|
|
25
|
+
].filter(Boolean).join(" - ");
|
|
26
|
+
return /*#__PURE__*/ react.createElement("div", {
|
|
8
27
|
"data-testid": "image-preview",
|
|
9
|
-
className: cn("w-full rounded-md", previewVariants({
|
|
28
|
+
className: cn("w-full rounded-md @container", previewVariants({
|
|
10
29
|
variant,
|
|
11
30
|
disabled
|
|
12
31
|
}), className),
|
|
13
32
|
...props
|
|
14
33
|
}, /*#__PURE__*/ react.createElement("div", {
|
|
15
34
|
"data-role": "select-image",
|
|
16
|
-
className: "
|
|
35
|
+
className: "@min-[280px]:hidden"
|
|
17
36
|
}, /*#__PURE__*/ react.createElement("div", {
|
|
18
|
-
className: "flex
|
|
37
|
+
className: "flex flex-col gap-xs p-xs"
|
|
38
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
39
|
+
className: "group relative cursor-pointer",
|
|
40
|
+
onClick: onReplaceItem
|
|
41
|
+
}, /*#__PURE__*/ react.createElement(RichItemThumbnail, {
|
|
42
|
+
...value,
|
|
43
|
+
variant: "banner",
|
|
44
|
+
disabled: disabled,
|
|
45
|
+
preview: preview,
|
|
46
|
+
renderImage: renderImage
|
|
47
|
+
}), /*#__PURE__*/ react.createElement(ThumbnailActions, actions)), /*#__PURE__*/ react.createElement("div", {
|
|
48
|
+
className: "flex flex-col gap-xxs min-w-0 px-xxs pb-xxs"
|
|
49
|
+
}, /*#__PURE__*/ react.createElement(TruncatedFileName, {
|
|
50
|
+
name: value.name,
|
|
51
|
+
className: disabled ? "text-neutral-disabled" : "text-neutral-primary"
|
|
52
|
+
}), details ? /*#__PURE__*/ react.createElement(Text, {
|
|
53
|
+
size: "sm",
|
|
54
|
+
className: cn("truncate", disabled ? "text-neutral-disabled" : "text-neutral-muted")
|
|
55
|
+
}, details) : null))), /*#__PURE__*/ react.createElement("div", {
|
|
56
|
+
"data-role": "select-image",
|
|
57
|
+
className: "hidden @min-[280px]:flex items-center gap-sm-extra min-w-0"
|
|
58
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
59
|
+
className: "shrink-0 cursor-pointer",
|
|
19
60
|
onClick: onReplaceItem
|
|
20
61
|
}, /*#__PURE__*/ react.createElement(RichItemThumbnail, {
|
|
21
62
|
...value,
|
|
22
63
|
disabled: disabled,
|
|
23
|
-
preview: preview
|
|
24
|
-
|
|
64
|
+
preview: preview,
|
|
65
|
+
renderImage: renderImage
|
|
66
|
+
})), /*#__PURE__*/ react.createElement(ItemDescription, {
|
|
25
67
|
item: value,
|
|
26
|
-
disabled: disabled
|
|
27
|
-
})), /*#__PURE__*/ react.createElement(ItemActions, {
|
|
28
|
-
onRemoveItem: onRemoveItem,
|
|
29
|
-
onReplaceItem: onReplaceItem,
|
|
30
|
-
onEditItem: onEditItem,
|
|
31
68
|
disabled: disabled,
|
|
32
|
-
|
|
69
|
+
onClick: onReplaceItem,
|
|
70
|
+
className: "grow basis-0 cursor-pointer"
|
|
71
|
+
}), /*#__PURE__*/ react.createElement(ItemActions, {
|
|
72
|
+
...actions,
|
|
73
|
+
className: "ml-auto pr-sm-extra"
|
|
33
74
|
})));
|
|
75
|
+
};
|
|
34
76
|
const RichItemPreview = makeDecoratable("RichItemPreview", DecoratableRichItemPreview);
|
|
35
77
|
export { RichItemPreview };
|
|
36
78
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js","sources":["../../../../../../src/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\nimport { RichItemThumbnail } from \"./RichItemThumbnail.js\";\nimport { ItemDescription } from \"../ItemDescription.js\";\nimport { ItemActions } from \"~/FilePicker/primitives/components/previews/ItemActions.js\";\nimport { previewVariants } from \"../variants.js\";\nimport type { FilePreviewDefaultProps } from \"../../types.js\";\n\ntype RichItemPreviewProps = FilePreviewDefaultProps & {\n preview?: \"thumbnail\" | \"file-type\" | \"placeholder\";\n};\n\nconst DecoratableRichItemPreview = ({\n className,\n disabled,\n onRemoveItem,\n onReplaceItem,\n onEditItem,\n value,\n variant,\n preview,\n ...props\n}: RichItemPreviewProps) => {\n return (\n <div\n data-testid=\"image-preview\"\n className={cn(\"w-full rounded-md\"
|
|
1
|
+
{"version":3,"file":"FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.js","sources":["../../../../../../src/FilePicker/primitives/components/previews/RichItemPreview/RichItemPreview.tsx"],"sourcesContent":["import React from \"react\";\nimport bytes from \"bytes\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\nimport { Text } from \"~/Text/index.js\";\nimport { RichItemThumbnail } from \"./RichItemThumbnail.js\";\nimport { ThumbnailActions } from \"./ThumbnailActions.js\";\nimport { ItemDescription } from \"../ItemDescription.js\";\nimport { ItemActions } from \"~/FilePicker/primitives/components/previews/ItemActions.js\";\nimport { TruncatedFileName } from \"../TruncatedFileName.js\";\nimport { previewVariants } from \"../variants.js\";\nimport type { FilePreviewDefaultProps } from \"../../types.js\";\n\ntype RichItemPreviewProps = FilePreviewDefaultProps & {\n preview?: \"thumbnail\" | \"file-type\" | \"placeholder\";\n /** Optional custom image renderer for the thumbnail (e.g. a cropped preview). */\n renderImage?: (args: { url: string; name: string }) => React.ReactNode;\n};\n\nconst DecoratableRichItemPreview = ({\n className,\n disabled,\n onRemoveItem,\n onReplaceItem,\n onEditItem,\n value,\n variant,\n preview,\n renderImage,\n ...props\n}: RichItemPreviewProps) => {\n const actions = { onRemoveItem, onReplaceItem, onEditItem, disabled };\n\n const formattedSize = value.size\n ? bytes.format(value.size, { unitSeparator: \" \", decimalPlaces: 0 })\n : \"\";\n const details = [value.mimeType, formattedSize].filter(Boolean).join(\" - \");\n\n return (\n <div\n data-testid=\"image-preview\"\n className={cn(\n \"w-full rounded-md @container\",\n previewVariants({ variant, disabled }),\n className\n )}\n {...props}\n >\n {/* Stacked layout for narrow containers (below 280px). */}\n <div data-role=\"select-image\" className={\"@min-[280px]:hidden\"}>\n <div className={\"flex flex-col gap-xs p-xs\"}>\n <div className={\"group relative cursor-pointer\"} onClick={onReplaceItem}>\n <RichItemThumbnail\n {...value}\n variant={\"banner\"}\n disabled={disabled}\n preview={preview}\n renderImage={renderImage}\n />\n <ThumbnailActions {...actions} />\n </div>\n\n <div className={\"flex flex-col gap-xxs min-w-0 px-xxs pb-xxs\"}>\n <TruncatedFileName\n name={value.name}\n className={disabled ? \"text-neutral-disabled\" : \"text-neutral-primary\"}\n />\n {details ? (\n <Text\n size=\"sm\"\n className={cn(\n \"truncate\",\n disabled ? \"text-neutral-disabled\" : \"text-neutral-muted\"\n )}\n >\n {details}\n </Text>\n ) : null}\n </div>\n </div>\n </div>\n\n {/* Side-by-side layout for wider containers (280px+). */}\n <div\n data-role=\"select-image\"\n className={\"hidden @min-[280px]:flex items-center gap-sm-extra min-w-0\"}\n >\n <div className={\"shrink-0 cursor-pointer\"} onClick={onReplaceItem}>\n <RichItemThumbnail\n {...value}\n disabled={disabled}\n preview={preview}\n renderImage={renderImage}\n />\n </div>\n\n <ItemDescription\n item={value}\n disabled={disabled}\n onClick={onReplaceItem}\n className={\"grow basis-0 cursor-pointer\"}\n />\n\n <ItemActions {...actions} className={\"ml-auto pr-sm-extra\"} />\n </div>\n </div>\n );\n};\n\nconst RichItemPreview = makeDecoratable(\"RichItemPreview\", DecoratableRichItemPreview);\n\nexport { RichItemPreview, type RichItemPreviewProps };\n"],"names":["DecoratableRichItemPreview","className","disabled","onRemoveItem","onReplaceItem","onEditItem","value","variant","preview","renderImage","props","actions","formattedSize","bytes","details","Boolean","cn","previewVariants","RichItemThumbnail","ThumbnailActions","TruncatedFileName","Text","ItemDescription","ItemActions","RichItemPreview","makeDecoratable"],"mappings":";;;;;;;;;;AAkBA,MAAMA,6BAA6B,CAAC,EAChCC,SAAS,EACTC,QAAQ,EACRC,YAAY,EACZC,aAAa,EACbC,UAAU,EACVC,KAAK,EACLC,OAAO,EACPC,OAAO,EACPC,WAAW,EACX,GAAGC,OACgB;IACnB,MAAMC,UAAU;QAAER;QAAcC;QAAeC;QAAYH;IAAS;IAEpE,MAAMU,gBAAgBN,MAAM,IAAI,GAC1BO,MAAM,MAAM,CAACP,MAAM,IAAI,EAAE;QAAE,eAAe;QAAK,eAAe;IAAE,KAChE;IACN,MAAMQ,UAAU;QAACR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