@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
|
@@ -26,6 +26,13 @@ const meta = {
|
|
|
26
26
|
"xxl",
|
|
27
27
|
"3xl"
|
|
28
28
|
]
|
|
29
|
+
},
|
|
30
|
+
shade: {
|
|
31
|
+
control: "select",
|
|
32
|
+
options: [
|
|
33
|
+
"dark",
|
|
34
|
+
"light"
|
|
35
|
+
]
|
|
29
36
|
}
|
|
30
37
|
}
|
|
31
38
|
};
|
|
@@ -98,10 +105,21 @@ const TripleExtraLarge = {
|
|
|
98
105
|
size: "3xl"
|
|
99
106
|
}
|
|
100
107
|
};
|
|
108
|
+
const Dark = {
|
|
109
|
+
args: {
|
|
110
|
+
shade: "dark"
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const Light = {
|
|
114
|
+
args: {
|
|
115
|
+
shade: "light"
|
|
116
|
+
}
|
|
117
|
+
};
|
|
101
118
|
const Documentation = {
|
|
102
119
|
args: {
|
|
103
120
|
type: "area",
|
|
104
|
-
size: "lg"
|
|
121
|
+
size: "lg",
|
|
122
|
+
shade: "dark"
|
|
105
123
|
},
|
|
106
124
|
argTypes: {
|
|
107
125
|
type: {
|
|
@@ -125,10 +143,18 @@ const Documentation = {
|
|
|
125
143
|
"xxl",
|
|
126
144
|
"3xl"
|
|
127
145
|
]
|
|
146
|
+
},
|
|
147
|
+
shade: {
|
|
148
|
+
control: "select",
|
|
149
|
+
description: "The shade of the skeleton",
|
|
150
|
+
options: [
|
|
151
|
+
"dark",
|
|
152
|
+
"light"
|
|
153
|
+
]
|
|
128
154
|
}
|
|
129
155
|
}
|
|
130
156
|
};
|
|
131
157
|
export default Skeleton_stories;
|
|
132
|
-
export { Area, Default, Documentation, DoubleExtraLarge, ExtraLarge, ExtraSmall, Large, Medium, MultipleAreas, Small, Text, Thumbnail, TripleExtraLarge };
|
|
158
|
+
export { Area, Dark, Default, Documentation, DoubleExtraLarge, ExtraLarge, ExtraSmall, Large, Light, Medium, MultipleAreas, Small, Text, Thumbnail, TripleExtraLarge };
|
|
133
159
|
|
|
134
160
|
//# sourceMappingURL=Skeleton.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton/Skeleton.stories.js","sources":["../../src/Skeleton/Skeleton.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react
|
|
1
|
+
{"version":3,"file":"Skeleton/Skeleton.stories.js","sources":["../../src/Skeleton/Skeleton.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Skeleton } from \"./Skeleton.js\";\n\nconst meta: Meta<typeof Skeleton> = {\n title: \"Components/Skeleton\",\n component: Skeleton,\n parameters: {\n layout: \"padded\"\n },\n argTypes: {\n type: {\n control: \"select\",\n options: [\"text\", \"thumbnail\", \"area\"]\n },\n size: {\n control: \"select\",\n options: [\"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"xxl\", \"3xl\"]\n },\n shade: {\n control: \"select\",\n options: [\"dark\", \"light\"]\n }\n }\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof Skeleton>;\n\nexport const Default: Story = {};\n\nexport const Text: Story = {\n args: {\n type: \"text\"\n }\n};\n\nexport const Thumbnail: Story = {\n args: {\n type: \"thumbnail\"\n }\n};\n\nexport const Area: Story = {\n args: {\n type: \"area\",\n className: \"w-1/2 h-32\"\n }\n};\n\nexport const MultipleAreas: Story = {\n render: () => (\n <div className=\"flex gap-md\">\n <div className=\"flex flex-col gap-md\">\n <Skeleton type=\"area\" className={\"w-32 h-32\"} />\n <Skeleton type=\"area\" className={\"w-32 h-32\"} />\n </div>\n <div>\n <Skeleton type=\"area\" className=\"w-32 h-full\" />\n </div>\n </div>\n )\n};\n\nexport const ExtraSmall: Story = {\n args: {\n size: \"xs\"\n }\n};\n\nexport const Small: Story = {\n args: {\n size: \"sm\"\n }\n};\n\nexport const Medium: Story = {\n args: {\n size: \"md\"\n }\n};\n\nexport const Large: Story = {\n args: {\n size: \"lg\"\n }\n};\n\nexport const ExtraLarge: Story = {\n args: {\n size: \"xl\"\n }\n};\n\nexport const DoubleExtraLarge: Story = {\n args: {\n size: \"xxl\"\n }\n};\n\nexport const TripleExtraLarge: Story = {\n args: {\n size: \"3xl\"\n }\n};\n\nexport const Dark: Story = {\n args: {\n shade: \"dark\"\n }\n};\n\nexport const Light: Story = {\n args: {\n shade: \"light\"\n }\n};\n\nexport const Documentation: Story = {\n args: {\n type: \"area\",\n size: \"lg\",\n shade: \"dark\"\n },\n argTypes: {\n type: {\n control: \"select\",\n description: \"The type of skeleton to display\",\n options: [\"text\", \"thumbnail\", \"area\"]\n },\n size: {\n control: \"select\",\n description: \"The size of the skeleton\",\n options: [\"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"xxl\", \"3xl\"]\n },\n shade: {\n control: \"select\",\n description: \"The shade of the skeleton\",\n options: [\"dark\", \"light\"]\n }\n }\n};\n"],"names":["meta","Skeleton","Default","Text","Thumbnail","Area","MultipleAreas","ExtraSmall","Small","Medium","Large","ExtraLarge","DoubleExtraLarge","Trip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AO;IACX;AACJ;AAEO,MAAMC,QAAe;IACxB,MAAM;QACF,OAAO;IACX;AACJ;AAEO,MAAMC,gBAAuB;IAChC,MAAM;QACF,MAAM;QACN,MAAM;QACN,OAAO;IACX;IACA,UAAU;QACN,MAAM;YACF,SAAS;YACT,aAAa;YACb,SAAS;gBAAC;gBAAQ;gBAAa;aAAO;QAC1C;QACA,MAAM;YACF,SAAS;YACT,aAAa;YACb,SAAS;gBAAC;gBAAM;gBAAM;gBAAM;gBAAM;gBAAM;gBAAO;aAAM;QACzD;QACA,OAAO;YACH,SAAS;YACT,aAAa;YACb,SAAS;gBAAC;gBAAQ;aAAQ;QAC9B;IACJ;AACJ"}
|
package/Slider/Slider.d.ts
CHANGED
|
@@ -7,21 +7,22 @@ import type { FormComponentProps } from "../FormComponent/index.js";
|
|
|
7
7
|
type SliderProps = FormComponentProps & SliderPrimitiveProps & {
|
|
8
8
|
labelPosition?: "top" | "side";
|
|
9
9
|
};
|
|
10
|
-
declare const
|
|
11
|
-
|
|
10
|
+
declare const DecoratableSlider: ({ description, note, hint, validation, labelPosition, ...props }: SliderProps) => React.JSX.Element;
|
|
11
|
+
declare const Slider: typeof DecoratableSlider & {
|
|
12
|
+
original: typeof DecoratableSlider;
|
|
12
13
|
originalName: string;
|
|
13
14
|
displayName: string;
|
|
14
15
|
} & {
|
|
15
|
-
original:
|
|
16
|
-
original:
|
|
16
|
+
original: typeof DecoratableSlider & {
|
|
17
|
+
original: typeof DecoratableSlider;
|
|
17
18
|
originalName: string;
|
|
18
19
|
displayName: string;
|
|
19
20
|
};
|
|
20
21
|
originalName: string;
|
|
21
22
|
displayName: string;
|
|
22
23
|
} & {
|
|
23
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
24
|
-
original:
|
|
24
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableSlider & {
|
|
25
|
+
original: typeof DecoratableSlider;
|
|
25
26
|
originalName: string;
|
|
26
27
|
displayName: string;
|
|
27
28
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider/Slider.stories.js","sources":["../../src/Slider/Slider.stories.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react-webpack5\";\nimport { Slider } from \"./Slider.js\";\n\nconst meta: Meta<typeof Slider> = {\n title: \"Components/Form/Slider\",\n component: Slider,\n argTypes: {\n onValueChange: { action: \"onValueChange\" },\n onValueCommit: { action: \"onValueCommit\" },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [value, setValue] = useState(args.value);\n return <Slider {...args} value={value} onValueChange={value => setValue(value)} />;\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof Slider>;\n\nexport const Default: Story = {};\n\nexport const WithLabel: Story = {\n args: {\n ...Default.args,\n label: \"Any field label\"\n }\n};\n\nexport const WithLabelRequired: Story = {\n args: {\n ...Default.args,\n label: \"Any field label\",\n required: true\n }\n};\n\nexport const WithDescription: Story = {\n args: {\n ...Default.args,\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const WithNotes: Story = {\n args: {\n ...Default.args,\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const WithErrors: Story = {\n args: {\n ...Default.args,\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const Disabled: Story = {\n args: {\n ...Default.args,\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const FullExample: Story = {\n args: {\n ...Default.args,\n label: \"Any field label\",\n required: true,\n description: \"Provide the required information for processing your request.\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const WithSideLabel: Story = {\n args: {\n ...Default.args,\n label: \"Any field label\",\n labelPosition: \"side\"\n }\n};\n\nexport const WithSideLabelRequired: Story = {\n args: {\n ...WithSideLabel.args,\n required: true\n }\n};\n\nexport const WithSideLabelAndDescription: Story = {\n args: {\n ...WithSideLabel.args,\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const WithSideLabelAndNotes: Story = {\n args: {\n ...WithSideLabel.args,\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const WithSideLabelAndErrors: Story = {\n args: {\n ...WithSideLabel.args,\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const WithSideLabelDisabled: Story = {\n args: {\n ...WithSideLabel.args,\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const WithSideLabelFullExample: Story = {\n args: {\n ...WithSideLabel.args,\n label: \"Any field label\",\n required: true,\n description: \"Provide the required information for processing your request.\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n const [value, setValue] = useState(args.value || 50);\n const [validation, setValidation] = useState({ isValid: true, message: \"\" });\n\n // Update value when args.value changes\n useEffect(() => {\n setValue(args.value ?? 50);\n }, [args.value]);\n\n const handleChange = (newValue: number) => {\n setValue(newValue);\n\n if (args.required && newValue === 0) {\n setValidation({ isValid: false, message: \"Please select a value\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n };\n\n // Validate on required change or value change\n useEffect(() => {\n if (args.required && value === 0) {\n setValidation({ isValid: false, message: \"Please select a value\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n }, [args.required, value]);\n\n return (\n <Slider\n {...args}\n value={value}\n onValueChange={handleChange}\n validation={validation}\n required={args.required}\n showTooltip={args.showTooltip}\n transformValue={args.transformValue}\n />\n );\n },\n args: {\n label: \"Volume Level\",\n required: true,\n disabled: false,\n description: \"Adjust the volume level of your device\",\n note: \"Note: Higher values may cause distortion on some devices\",\n min: 0,\n max: 100,\n step: 1,\n value: 50,\n showTooltip: true,\n transformValue: (value: number) => `${value}%`,\n validation: undefined\n },\n argTypes: {\n label: {\n description: \"Label text for the slider\",\n control: \"text\"\n },\n required: {\n description: \"Makes the field required when set to true\",\n control: \"boolean\"\n },\n disabled: {\n description: \"Disables the slider when set to true\",\n control: \"boolean\"\n },\n description: {\n description: \"Additional description text below the field\",\n control: \"text\"\n },\n note: {\n description: \"Additional note text below the field\",\n control: \"text\"\n },\n min: {\n description: \"Minimum value for the slider\",\n control: \"number\"\n },\n max: {\n description: \"Maximum value for the slider\",\n control: \"number\"\n },\n step: {\n description: \"Step increment for the slider\",\n control: \"number\"\n },\n value: {\n description: \"Current value of the slider\",\n control: \"number\"\n },\n showTooltip: {\n description: \"Whether to show a tooltip with the current value\",\n control: \"boolean\",\n defaultValue: true\n },\n transformValue: {\n description: \"Function to transform the numeric value to display text\"\n },\n labelPosition: {\n description: \"Position of the label relative to the slider\",\n control: \"radio\",\n options: [\"top\", \"side\"]\n },\n validation: {\n description:\n \"Object containing validation state and message. Please refer to the example code for details on usage.\"\n },\n onValueChange: {\n description: \"Function called when the slider value changes\"\n },\n onValueCommit: {\n description: \"Function called when the slider value is committed (on release)\"\n }\n }\n};\n"],"names":["meta","Slider","args","value","setValue","useState","Default","WithLabel","WithLabelRequired","WithDescription","WithNotes","WithErrors","Disabled","FullExample","WithSideLabel","WithSideLabelRequired","WithSideLabelAndDescription","WithSideLabelAndNotes","WithSideLabelAndErrors","WithSideLabelDisabled","WithSideLabelFullExample","Documentation","validation","setValidation","useEffect","handleChange","newValue","undefined"],"mappings":";;AAIA,MAAMA,OAA4B;IAC9B,OAAO;IACP,WAAWC;IACX,UAAU;QACN,eAAe;YAAE,QAAQ;QAAgB;QACzC,eAAe;YAAE,QAAQ;QAAgB;QACzC,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,OAAOC,SAAS,GAAGC,SAASH,KAAK,KAAK;QAC7C,OAA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;QACP,aAAa;QACb,gBAAgB,CAACC,QAAkB,GAAGA,MAAM,CAAC,CAAC;QAC9C,YAAYwB;IAChB;IACA,UAAU;QACN,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,UAAU;YACN,aAAa;YACb,SAAS;QACb;QACA,UAAU;YACN,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;QACb;QACA,KAAK;YACD,aAAa;YACb,SAAS;QACb;QACA,KAAK;YACD,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;QACb;QACA,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,gBAAgB;YACZ,aAAa;QACjB;QACA,eAAe;YACX,aAAa;YACb,SAAS;YACT,SAAS;gBAAC;gBAAO;aAAO;QAC5B;QACA,YAAY;YACR,aACI;QACR;QACA,eAAe;YACX,aAAa;QACjB;QACA,eAAe;YACX,aAAa;QACjB;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"Slider/Slider.stories.js","sources":["../../src/Slider/Slider.stories.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Slider } from \"./Slider.js\";\n\nconst meta: Meta<typeof Slider> = {\n title: \"Components/Form/Slider\",\n component: Slider,\n argTypes: {\n onValueChange: { action: \"onValueChange\" },\n onValueCommit: { action: \"onValueCommit\" },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [value, setValue] = useState(args.value);\n return <Slider {...args} value={value} onValueChange={value => setValue(value)} />;\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof Slider>;\n\nexport const Default: Story = {};\n\nexport const WithLabel: Story = {\n args: {\n ...Default.args,\n label: \"Any field label\"\n }\n};\n\nexport const WithLabelRequired: Story = {\n args: {\n ...Default.args,\n label: \"Any field label\",\n required: true\n }\n};\n\nexport const WithDescription: Story = {\n args: {\n ...Default.args,\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const WithNotes: Story = {\n args: {\n ...Default.args,\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const WithErrors: Story = {\n args: {\n ...Default.args,\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const Disabled: Story = {\n args: {\n ...Default.args,\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const FullExample: Story = {\n args: {\n ...Default.args,\n label: \"Any field label\",\n required: true,\n description: \"Provide the required information for processing your request.\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const WithSideLabel: Story = {\n args: {\n ...Default.args,\n label: \"Any field label\",\n labelPosition: \"side\"\n }\n};\n\nexport const WithSideLabelRequired: Story = {\n args: {\n ...WithSideLabel.args,\n required: true\n }\n};\n\nexport const WithSideLabelAndDescription: Story = {\n args: {\n ...WithSideLabel.args,\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const WithSideLabelAndNotes: Story = {\n args: {\n ...WithSideLabel.args,\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const WithSideLabelAndErrors: Story = {\n args: {\n ...WithSideLabel.args,\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const WithSideLabelDisabled: Story = {\n args: {\n ...WithSideLabel.args,\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const WithSideLabelFullExample: Story = {\n args: {\n ...WithSideLabel.args,\n label: \"Any field label\",\n required: true,\n description: \"Provide the required information for processing your request.\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n const [value, setValue] = useState(args.value || 50);\n const [validation, setValidation] = useState({ isValid: true, message: \"\" });\n\n // Update value when args.value changes\n useEffect(() => {\n setValue(args.value ?? 50);\n }, [args.value]);\n\n const handleChange = (newValue: number) => {\n setValue(newValue);\n\n if (args.required && newValue === 0) {\n setValidation({ isValid: false, message: \"Please select a value\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n };\n\n // Validate on required change or value change\n useEffect(() => {\n if (args.required && value === 0) {\n setValidation({ isValid: false, message: \"Please select a value\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n }, [args.required, value]);\n\n return (\n <Slider\n {...args}\n value={value}\n onValueChange={handleChange}\n validation={validation}\n required={args.required}\n showTooltip={args.showTooltip}\n transformValue={args.transformValue}\n />\n );\n },\n args: {\n label: \"Volume Level\",\n required: true,\n disabled: false,\n description: \"Adjust the volume level of your device\",\n note: \"Note: Higher values may cause distortion on some devices\",\n min: 0,\n max: 100,\n step: 1,\n value: 50,\n showTooltip: true,\n transformValue: (value: number) => `${value}%`,\n validation: undefined\n },\n argTypes: {\n label: {\n description: \"Label text for the slider\",\n control: \"text\"\n },\n required: {\n description: \"Makes the field required when set to true\",\n control: \"boolean\"\n },\n disabled: {\n description: \"Disables the slider when set to true\",\n control: \"boolean\"\n },\n description: {\n description: \"Additional description text below the field\",\n control: \"text\"\n },\n note: {\n description: \"Additional note text below the field\",\n control: \"text\"\n },\n min: {\n description: \"Minimum value for the slider\",\n control: \"number\"\n },\n max: {\n description: \"Maximum value for the slider\",\n control: \"number\"\n },\n step: {\n description: \"Step increment for the slider\",\n control: \"number\"\n },\n value: {\n description: \"Current value of the slider\",\n control: \"number\"\n },\n showTooltip: {\n description: \"Whether to show a tooltip with the current value\",\n control: \"boolean\",\n defaultValue: true\n },\n transformValue: {\n description: \"Function to transform the numeric value to display text\"\n },\n labelPosition: {\n description: \"Position of the label relative to the slider\",\n control: \"radio\",\n options: [\"top\", \"side\"]\n },\n validation: {\n description:\n \"Object containing validation state and message. Please refer to the example code for details on usage.\"\n },\n onValueChange: {\n description: \"Function called when the slider value changes\"\n },\n onValueCommit: {\n description: \"Function called when the slider value is committed (on release)\"\n }\n }\n};\n"],"names":["meta","Slider","args","value","setValue","useState","Default","WithLabel","WithLabelRequired","WithDescription","WithNotes","WithErrors","Disabled","FullExample","WithSideLabel","WithSideLabelRequired","WithSideLabelAndDescription","WithSideLabelAndNotes","WithSideLabelAndErrors","WithSideLabelDisabled","WithSideLabelFullExample","Documentation","validation","setValidation","useEffect","handleChange","newValue","undefined"],"mappings":";;AAIA,MAAMA,OAA4B;IAC9B,OAAO;IACP,WAAWC;IACX,UAAU;QACN,eAAe;YAAE,QAAQ;QAAgB;QACzC,eAAe;YAAE,QAAQ;QAAgB;QACzC,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,OAAOC,SAAS,GAAGC,SAASH,KAAK,KAAK;QAC7C,OAAO,WAAP,GAAO,oBAACD,QAAMA;YAAE,GAAGC,IAAI;YAAE,OAAOC;YAAO,eAAeA,CAAAA,QAASC,SAASD;;IAC5E;AACJ;AAEA,uBAAeH;AAGR,MAAMM,UAAiB,CAAC;AAExB,MAAMC,YAAmB;IAC5B,MAAM;QACF,GAAGD,QAAQ,IAAI;QACf,OAAO;IACX;AACJ;AAEO,MAAME,oBAA2B;IACpC,MAAM;QACF,GAAGF,QAAQ,IAAI;QACf,OAAO;QACP,UAAU;IACd;AACJ;AAEO,MAAMG,kBAAyB;IAClC,MAAM;QACF,GAAGH,QAAQ,IAAI;QACf,aAAa;IACjB;AACJ;AAEO,MAAMI,YAAmB;IAC5B,MAAM;QACF,GAAGJ,QAAQ,IAAI;QACf,MAAM;IACV;AACJ;AAEO,MAAMK,aAAoB;IAC7B,MAAM;QACF,GAAGL,QAAQ,IAAI;QACf,YAAY;YACR,SAAS;YACT,SAAS;QACb;IACJ;AACJ;AAEO,MAAMM,WAAkB;IAC3B,MAAM;QACF,GAA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B;QACA,eAAe;YACX,aAAa;QACjB;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider/primitives/SliderPrimitive.stories.js","sources":["../../../src/Slider/primitives/SliderPrimitive.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react
|
|
1
|
+
{"version":3,"file":"Slider/primitives/SliderPrimitive.stories.js","sources":["../../../src/Slider/primitives/SliderPrimitive.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { SliderPrimitive } from \"./SliderPrimitive.js\";\nimport { Button } from \"~/Button/index.js\";\n\nconst meta: Meta<typeof SliderPrimitive> = {\n title: \"Components/Form Primitives/Slider\",\n component: SliderPrimitive,\n argTypes: {\n onValueChange: { action: \"onValueChange\" },\n onValueCommit: { action: \"onValueCommit\" }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [value, setValue] = useState(args.value);\n return <SliderPrimitive {...args} value={value} onValueChange={value => setValue(value)} />;\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof SliderPrimitive>;\n\nexport const Default: Story = {};\n\nexport const WithDefaultValue: Story = {\n args: {\n value: 50\n }\n};\n\nexport const WithMinAndMaxValues: Story = {\n args: {\n min: 10,\n max: 20\n }\n};\n\nexport const WithNegativeMinValue: Story = {\n args: {\n min: -100,\n max: 100,\n value: 0\n }\n};\n\nexport const WithSteps: Story = {\n args: {\n step: 10\n }\n};\n\nexport const Disabled: Story = {\n args: {\n disabled: true,\n value: 50\n }\n};\n\nexport const WithTooltip: Story = {\n args: {\n showTooltip: true\n }\n};\n\nexport const WithTooltipSideTop: Story = {\n args: {\n showTooltip: true,\n tooltipSide: \"top\"\n }\n};\n\nexport const WithTooltipAndCustomValueTransformer: Story = {\n args: {\n showTooltip: true,\n transformValue: (value: number) => {\n return `${Math.round(value)}%`;\n }\n }\n};\n\nexport const WithExternalValueControl: Story = {\n args: {\n showTooltip: true,\n transformValue: (value: number) => {\n return `${Math.round(value)}%`;\n }\n },\n render: args => {\n const defaultValue = 50;\n const [value, setValue] = useState(defaultValue);\n return (\n <div className={\"w-full\"}>\n <div>\n <SliderPrimitive\n {...args}\n value={value}\n onValueChange={value => setValue(value)}\n />\n </div>\n <div className={\"mt-4 text-center\"}>\n <Button text={\"Reset\"} onClick={() => setValue(defaultValue)} />\n </div>\n <div className={\"mt-4 text-center\"}>\n Current value: <code>{value}</code>\n </div>\n </div>\n );\n }\n};\n"],"names":["meta","SliderPrimitive","args","value","setValue","useState","Default","WithDefaultValue","WithMinAndMaxValues","WithNegativeMinValue","WithSteps","Disabled","WithTooltip","WithTooltipSideTop","WithTooltipAndCustomValueTransformer","Math","WithExternalValueControl","defaultValue","Button"],"mappings":";;;AAKA,MAAMA,OAAqC;IACvC,OAAO;IACP,WAAWC;IACX,UAAU;QACN,eAAe;YAAE,QAAQ;QAAgB;QACzC,eAAe;YAAE,QAAQ;QAAgB;IAC7C;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,OAAOC,SAAS,GAAGC,SAASH,KAAK,KAAK;QAC7C,OAAO,WAAP,GAAO,oBAACD,iBAAeA;YAAE,GAAGC,IAAI;YAAE,OAAOC;YAAO,eAAeA,CAAAA,QAASC,SAASD;;IACrF;AACJ;AAEA,gCAAeH;AAGR,MAAMM,UAAiB,CAAC;AAExB,MAAMC,mBAA0B;IACnC,MAAM;QACF,OAAO;IACX;AACJ;AAEO,MAAMC,sBAA6B;IACtC,MAAM;QACF,KAAK;QACL,KAAK;IACT;AACJ;AAEO,MAAMC,uBAA8B;IACvC,MAAM;QACF,KAAK;QACL,KAAK;QACL,OAAO;IACX;AACJ;AAEO,MAAMC,YAAmB;IAC5B,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,WAAkB;IAC3B,MAAM;QACF,UAAU;QACV,OAAO;IACX;AACJ;AAEO,MAAMC,cAAqB;IAC9B,MAAM;QACF,aAAa;IACjB;AACJ;AAEO,MAAMC,qBAA4B;IACrC,MAAM;QACF,aAAa;QACb,aAAa;IACjB;AACJ;AAEO,MAAMC,uCAA8C;IACvD,MAAM;QACF,aAAa;QACb,gBAAgB,CAACX,QACN,GAAGY,KAAK,KAAK,CAACZ,OAAO,CAAC,CAAC;IAEtC;AACJ;AAEO,MAAMa,2BAAkC;IAC3C,MAAM;QACF,aAAa;QACb,gBAAgB,CAACb,QACN,GAAGY,KAAK,KAAK,CAACZ,OAAO,CAAC,CAAC;IAEtC;IACA,QAAQD,CAAAA;QACJ,MAAMe,eAAe;QACrB,MAAM,CAACd,OAAOC,SAAS,GAAGC,SAASY;QACnC,OAAO,WAAP,GACI,oBAAC;YAAI,WAAW;yBACZ,oBAAC,2BACG,oBAAChB,iBAAeA;YACX,GAAGC,IAAI;YACR,OAAOC;YACP,eAAeA,CAAAA,QAASC,SAASD;2BAGzC,oBAAC;YAAI,WAAW;yBACZ,oBAACe,QAAMA;YAAC,MAAM;YAAS,SAAS,IAAMd,SAASa;2BAEnD,oBAAC;YAAI,WAAW;WAAoB,iCACjB,oBAAC,cAAMd;IAItC;AACJ"}
|
|
@@ -3,21 +3,22 @@ import type { ProgressItemParams } from "./domains/index.js";
|
|
|
3
3
|
interface SteppedProgressProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
items: ProgressItemParams[];
|
|
5
5
|
}
|
|
6
|
-
declare const
|
|
7
|
-
|
|
6
|
+
declare const DecoratableSteppedProgress: ({ items, ...props }: SteppedProgressProps) => React.JSX.Element;
|
|
7
|
+
declare const SteppedProgress: typeof DecoratableSteppedProgress & {
|
|
8
|
+
original: typeof DecoratableSteppedProgress;
|
|
8
9
|
originalName: string;
|
|
9
10
|
displayName: string;
|
|
10
11
|
} & {
|
|
11
|
-
original:
|
|
12
|
-
original:
|
|
12
|
+
original: typeof DecoratableSteppedProgress & {
|
|
13
|
+
original: typeof DecoratableSteppedProgress;
|
|
13
14
|
originalName: string;
|
|
14
15
|
displayName: string;
|
|
15
16
|
};
|
|
16
17
|
originalName: string;
|
|
17
18
|
displayName: string;
|
|
18
19
|
} & {
|
|
19
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
20
|
-
original:
|
|
20
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableSteppedProgress & {
|
|
21
|
+
original: typeof DecoratableSteppedProgress;
|
|
21
22
|
originalName: string;
|
|
22
23
|
displayName: string;
|
|
23
24
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SteppedProgress/SteppedProgress.stories.js","sources":["../../src/SteppedProgress/SteppedProgress.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react
|
|
1
|
+
{"version":3,"file":"SteppedProgress/SteppedProgress.stories.js","sources":["../../src/SteppedProgress/SteppedProgress.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { SteppedProgress } from \"./SteppedProgress.js\";\nimport { ProgressItemState } from \"~/SteppedProgress/domains/index.js\";\n\nconst meta: Meta<typeof SteppedProgress> = {\n title: \"Components/SteppedProgress\",\n component: SteppedProgress,\n argTypes: {},\n parameters: {\n layout: \"padded\"\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof SteppedProgress>;\n\nexport const Default: Story = {\n args: {\n items: [\n {\n label: \"Step\"\n },\n {\n label: \"Step In Progress\",\n state: ProgressItemState.IN_PROGRESS\n },\n {\n label: \"Step Completed\",\n state: ProgressItemState.COMPLETED\n },\n {\n label: \"Completed Affirmative\",\n state: ProgressItemState.COMPLETED_AFFIRMATIVE\n }\n ]\n }\n};\n\nexport const WithMultipleLines: Story = {\n decorators: [\n Story => (\n <div\n style={{\n width: \"240px\"\n }}\n >\n <Story />\n </div>\n )\n ],\n args: {\n items: [\n {\n label: \"Step but with multiple lines of text.\"\n },\n {\n label: \"Step in progress but with multiple lines of text.\",\n state: ProgressItemState.IN_PROGRESS\n },\n {\n label: \"Step completed but with multiple lines of text.\",\n state: ProgressItemState.COMPLETED\n },\n {\n label: \"Completed affirmative but with multiple lines of text.\",\n state: ProgressItemState.COMPLETED_AFFIRMATIVE\n }\n ]\n }\n};\n\nexport const Disabled: Story = {\n args: {\n items: [\n {\n label: \"Step\",\n disabled: true\n },\n {\n label: \"Step In Progress\",\n state: ProgressItemState.IN_PROGRESS,\n disabled: true\n },\n {\n label: \"Step Completed\",\n state: ProgressItemState.COMPLETED,\n disabled: true\n },\n {\n label: \"Completed Affirmative\",\n state: ProgressItemState.COMPLETED_AFFIRMATIVE,\n disabled: true\n }\n ]\n }\n};\n\nexport const Errored: Story = {\n args: {\n items: [\n {\n label: \"Step\",\n errored: true\n },\n {\n label: \"Step In Progress\",\n state: ProgressItemState.IN_PROGRESS,\n errored: true\n },\n {\n label: \"Step Completed\",\n state: ProgressItemState.COMPLETED,\n errored: true\n },\n {\n label: \"Completed Affirmative\",\n state: ProgressItemState.COMPLETED_AFFIRMATIVE,\n errored: true\n }\n ]\n }\n};\n\nexport const DisabledAndErrored: Story = {\n args: {\n items: [\n {\n label: \"Step\",\n disabled: true,\n errored: true\n },\n {\n label: \"Step In Progress\",\n state: ProgressItemState.IN_PROGRESS,\n disabled: true,\n errored: true\n },\n {\n label: \"Step Completed\",\n state: ProgressItemState.COMPLETED,\n disabled: true,\n errored: true\n },\n {\n label: \"Completed Affirmative\",\n state: ProgressItemState.COMPLETED_AFFIRMATIVE,\n disabled: true,\n errored: true\n }\n ]\n }\n};\n"],"names":["meta","SteppedProgress","Default","ProgressItemState","WithMultipleLines","Story","Disabled","Errored","DisabledAndErrored"],"mappings":";;;AAKA,MAAMA,OAAqC;IACvC,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;IACX,YAAY;QACR,QAAQ;IACZ;AACJ;AAEA,gCAAeD;AAGR,MAAME,UAAiB;IAC1B,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gBACP,OAAOL,kBAAkB,WAAW;gBACpC,UAAU;gBACV,SAAS;YACb;YACA;gBACI,OAAO;gBACP,OAAOA,kBAAkB,SAAS;gBAClC,UAAU;gBACV,SAAS;YACb;YACA;gBACI,OAAO;gBACP,OAAOA,kBAAkB,qBAAqB;gBAC9C,UAAU;gBACV,SAAS;YACb;SACH;IACL;AACJ"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type ProgressItemFormatted } from "./domains/index.js";
|
|
3
3
|
type SteppedProgressItemProps = React.HTMLAttributes<HTMLDivElement> & ProgressItemFormatted;
|
|
4
|
-
declare const
|
|
5
|
-
|
|
4
|
+
declare const DecoratableSteppedProgressItem: ({ label, state, errored, disabled, className, ...props }: SteppedProgressItemProps) => React.JSX.Element;
|
|
5
|
+
declare const SteppedProgressItem: typeof DecoratableSteppedProgressItem & {
|
|
6
|
+
original: typeof DecoratableSteppedProgressItem;
|
|
6
7
|
originalName: string;
|
|
7
8
|
displayName: string;
|
|
8
9
|
} & {
|
|
9
|
-
original:
|
|
10
|
-
original:
|
|
10
|
+
original: typeof DecoratableSteppedProgressItem & {
|
|
11
|
+
original: typeof DecoratableSteppedProgressItem;
|
|
11
12
|
originalName: string;
|
|
12
13
|
displayName: string;
|
|
13
14
|
};
|
|
14
15
|
originalName: string;
|
|
15
16
|
displayName: string;
|
|
16
17
|
} & {
|
|
17
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
18
|
-
original:
|
|
18
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableSteppedProgressItem & {
|
|
19
|
+
original: typeof DecoratableSteppedProgressItem;
|
|
19
20
|
originalName: string;
|
|
20
21
|
displayName: string;
|
|
21
22
|
}>) => (props: unknown) => React.JSX.Element;
|
package/Switch/Switch.d.ts
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SwitchPrimitiveProps } from "./primitives/index.js";
|
|
3
|
-
import type
|
|
4
|
-
type SwitchProps = SwitchPrimitiveProps & FormComponentProps;
|
|
5
|
-
declare const
|
|
6
|
-
|
|
3
|
+
import { type FormComponentProps } from "../FormComponent/index.js";
|
|
4
|
+
type SwitchProps = Omit<SwitchPrimitiveProps, "label"> & FormComponentProps;
|
|
5
|
+
declare const DecoratableSwitch: ({ label, description, hint, note, required, disabled, validation, ...props }: SwitchProps) => React.JSX.Element;
|
|
6
|
+
declare const Switch: typeof DecoratableSwitch & {
|
|
7
|
+
original: typeof DecoratableSwitch;
|
|
7
8
|
originalName: string;
|
|
8
9
|
displayName: string;
|
|
9
10
|
} & {
|
|
10
|
-
original:
|
|
11
|
-
original:
|
|
11
|
+
original: typeof DecoratableSwitch & {
|
|
12
|
+
original: typeof DecoratableSwitch;
|
|
12
13
|
originalName: string;
|
|
13
14
|
displayName: string;
|
|
14
15
|
};
|
|
15
16
|
originalName: string;
|
|
16
17
|
displayName: string;
|
|
17
18
|
} & {
|
|
18
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
19
|
-
original:
|
|
19
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableSwitch & {
|
|
20
|
+
original: typeof DecoratableSwitch;
|
|
20
21
|
originalName: string;
|
|
21
22
|
displayName: string;
|
|
22
23
|
}>) => (props: unknown) => React.JSX.Element;
|
|
23
24
|
};
|
|
24
|
-
export { Switch };
|
|
25
|
+
export { Switch, type SwitchProps };
|
package/Switch/Switch.js
CHANGED
|
@@ -1,24 +1,38 @@
|
|
|
1
1
|
import react, { useMemo } from "react";
|
|
2
|
-
import { makeDecoratable } from "../utils.js";
|
|
2
|
+
import { generateId, makeDecoratable } from "../utils.js";
|
|
3
3
|
import { SwitchPrimitive } from "./primitives/index.js";
|
|
4
|
-
import { FormComponentErrorMessage, FormComponentNote } from "../FormComponent/index.js";
|
|
5
|
-
const DecoratableSwitch = ({ note, validation, ...props })=>{
|
|
4
|
+
import { FormComponentDescription, FormComponentErrorMessage, FormComponentLabel, FormComponentNote } from "../FormComponent/index.js";
|
|
5
|
+
const DecoratableSwitch = ({ label, description, hint, note, required, disabled, validation, ...props })=>{
|
|
6
6
|
const { isValid: validationIsValid, message: validationMessage } = validation || {};
|
|
7
|
+
const id = useMemo(()=>generateId(props.id), [
|
|
8
|
+
props.id
|
|
9
|
+
]);
|
|
7
10
|
const invalid = useMemo(()=>false === validationIsValid, [
|
|
8
11
|
validationIsValid
|
|
9
12
|
]);
|
|
10
13
|
return /*#__PURE__*/ react.createElement("div", {
|
|
11
14
|
className: "w-full"
|
|
12
|
-
}, /*#__PURE__*/ react.createElement(
|
|
15
|
+
}, /*#__PURE__*/ react.createElement(FormComponentLabel, {
|
|
16
|
+
htmlFor: id,
|
|
17
|
+
text: label,
|
|
18
|
+
required: required,
|
|
19
|
+
disabled: disabled,
|
|
20
|
+
invalid: invalid,
|
|
21
|
+
hint: hint
|
|
22
|
+
}), /*#__PURE__*/ react.createElement(FormComponentDescription, {
|
|
23
|
+
text: description,
|
|
24
|
+
disabled: disabled
|
|
25
|
+
}), /*#__PURE__*/ react.createElement(SwitchPrimitive, {
|
|
13
26
|
...props,
|
|
14
|
-
|
|
27
|
+
id: id,
|
|
28
|
+
disabled: disabled
|
|
15
29
|
}), /*#__PURE__*/ react.createElement(FormComponentErrorMessage, {
|
|
16
30
|
text: validationMessage,
|
|
17
31
|
invalid: invalid,
|
|
18
|
-
disabled:
|
|
32
|
+
disabled: disabled
|
|
19
33
|
}), /*#__PURE__*/ react.createElement(FormComponentNote, {
|
|
20
34
|
text: note,
|
|
21
|
-
disabled:
|
|
35
|
+
disabled: disabled
|
|
22
36
|
}));
|
|
23
37
|
};
|
|
24
38
|
const Switch = makeDecoratable("Switch", DecoratableSwitch);
|
package/Switch/Switch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch/Switch.js","sources":["../../src/Switch/Switch.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport type { SwitchPrimitiveProps } from \"./primitives/index.js\";\nimport { SwitchPrimitive } from \"./primitives/index.js\";\nimport
|
|
1
|
+
{"version":3,"file":"Switch/Switch.js","sources":["../../src/Switch/Switch.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { generateId, makeDecoratable } from \"~/utils.js\";\nimport type { SwitchPrimitiveProps } from \"./primitives/index.js\";\nimport { SwitchPrimitive } from \"./primitives/index.js\";\nimport {\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel,\n FormComponentNote,\n type FormComponentProps\n} from \"~/FormComponent/index.js\";\n\ntype SwitchProps = Omit<SwitchPrimitiveProps, \"label\"> & FormComponentProps;\n\nconst DecoratableSwitch = ({\n label,\n description,\n hint,\n note,\n required,\n disabled,\n validation,\n ...props\n}: SwitchProps) => {\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n const id = useMemo(() => generateId(props.id), [props.id]);\n const invalid = useMemo(() => validationIsValid === false, [validationIsValid]);\n\n return (\n <div className={\"w-full\"}>\n <FormComponentLabel\n htmlFor={id}\n text={label}\n required={required}\n disabled={disabled}\n invalid={invalid}\n hint={hint}\n />\n <FormComponentDescription text={description} disabled={disabled} />\n <SwitchPrimitive {...props} id={id} disabled={disabled} />\n <FormComponentErrorMessage\n text={validationMessage}\n invalid={invalid}\n disabled={disabled}\n />\n <FormComponentNote text={note} disabled={disabled} />\n </div>\n );\n};\n\nconst Switch = makeDecoratable(\"Switch\", DecoratableSwitch);\n\nexport { Switch, type SwitchProps };\n"],"names":["DecoratableSwitch","label","description","hint","note","required","disabled","validation","props","validationIsValid","validationMessage","id","useMemo","generateId","invalid","FormComponentLabel","FormComponentDescription","SwitchPrimitive","FormComponentErrorMessage","FormComponentNote","Switch","makeDecoratable"],"mappings":";;;;AAcA,MAAMA,oBAAoB,CAAC,EACvBC,KAAK,EACLC,WAAW,EACXC,IAAI,EACJC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACV,GAAGC,OACO;IACV,MAAM,EAAE,SAASC,iBAAiB,EAAE,SAASC,iBAAiB,EAAE,GAAGH,cAAc,CAAC;IAClF,MAAMI,KAAKC,QAAQ,IAAMC,WAAWL,MAAM,EAAE,GAAG;QAACA,MAAM,EAAE;KAAC;IACzD,MAAMM,UAAUF,QAAQ,IAAMH,AAAsB,UAAtBA,mBAA6B;QAACA;KAAkB;IAE9E,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACM,oBAAkBA;QACf,SAASJ;QACT,MAAMV;QACN,UAAUI;QACV,UAAUC;QACV,SAASQ;QACT,MAAMX;sBAEV,oBAACa,0BAAwBA;QAAC,MAAMd;QAAa,UAAUI;sBACvD,oBAACW,iBAAeA;QAAE,GAAGT,KAAK;QAAE,IAAIG;QAAI,UAAUL;sBAC9C,oBAACY,2BAAyBA;QACtB,MAAMR;QACN,SAASI;QACT,UAAUR;sBAEd,oBAACa,mBAAiBA;QAAC,MAAMf;QAAM,UAAUE;;AAGrD;AAEA,MAAMc,SAASC,gBAAgB,UAAUrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch/Switch.stories.js","sources":["../../src/Switch/Switch.stories.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react
|
|
1
|
+
{"version":3,"file":"Switch/Switch.stories.js","sources":["../../src/Switch/Switch.stories.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { Switch } from \"~/Switch/index.js\";\nimport { Tooltip } from \"~/Tooltip/index.js\";\n\nconst meta: Meta<typeof Switch> = {\n title: \"Components/Form/Switch\",\n component: Switch,\n parameters: {\n layout: \"padded\"\n },\n argTypes: {\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n decorators: [\n Story => (\n <Tooltip.Provider>\n <Story />\n </Tooltip.Provider>\n )\n ],\n render: args => {\n const [checked, setChecked] = useState(args.checked);\n return <Switch {...args} checked={checked} onChange={value => setChecked(value)} />;\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof Switch>;\n\nexport const Default: Story = {\n args: {\n label: \"Any field label\"\n }\n};\n\nexport const WithLabelRequired: Story = {\n args: {\n label: \"Any field label\",\n required: true\n }\n};\n\nexport const WithDescription: Story = {\n args: {\n ...Default.args,\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const WithNotes: Story = {\n args: {\n ...Default.args,\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const WithErrors: Story = {\n args: {\n ...Default.args,\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const Disabled: Story = {\n args: {\n ...Default.args,\n disabled: true\n }\n};\n\nexport const FullExample: Story = {\n args: {\n ...Default.args,\n label: \"Any field label\",\n required: true,\n description: \"Provide the required information for processing your request.\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const Documentation: Story = {\n render: args => {\n const [checked, setChecked] = useState(args.checked || false);\n const [validation, setValidation] = useState({ isValid: true, message: \"\" });\n\n // Update checked state when args.checked changes\n useEffect(() => {\n setChecked(args.checked || false);\n }, [args.checked]);\n\n const handleChange = (isChecked: boolean) => {\n setChecked(isChecked);\n\n // Simple required validation\n if (args.required && !isChecked) {\n setValidation({ isValid: false, message: \"This field is required\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n };\n\n // Validate on required change\n useEffect(() => {\n if (args.required && !checked) {\n setValidation({ isValid: false, message: \"This field is required\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n }, [args.required, checked]);\n\n return (\n <Switch\n {...args}\n checked={checked}\n onChange={handleChange}\n validation={validation}\n required={args.required}\n />\n );\n },\n args: {\n label: \"Enable feature\",\n checked: false,\n disabled: false,\n required: true,\n description: \"Enabling this feature will activate additional functionality.\",\n note: \"Note: This setting can be changed at any time.\",\n validation: undefined\n },\n argTypes: {\n label: {\n description: \"Label text for the switch\",\n control: \"text\"\n },\n checked: {\n description: \"Determines if the switch is checked\",\n control: \"boolean\"\n },\n disabled: {\n description: \"Disables the switch when set to true\",\n control: \"boolean\"\n },\n required: {\n description: \"Makes the switch required when set to true\",\n control: \"boolean\"\n },\n description: {\n description: \"Additional description text below the switch\",\n control: \"text\"\n },\n note: {\n description: \"Additional note text below the switch\",\n control: \"text\"\n },\n validation: {\n description:\n \"Object containing validation state and message. Please refer to the example code for details on usage.\"\n },\n onChange: {\n description: \"Function called when the switch state changes\"\n }\n }\n};\n"],"names":["meta","Switch","Story","Tooltip","args","checked","setChecked","useState","value","Default","WithLabelRequired","WithDescription","WithNotes","WithErrors","Disabled","FullExample","Documentation","validation","setValidation","useEffect","handleChange","isChecked","undefined"],"mappings":";;;AAKA,MAAMA,OAA4B;IAC9B,OAAO;IACP,WAAWC;IACX,YAAY;QACR,QAAQ;IACZ;IACA,UAAU;QACN,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACRC,CAAAA,QAAAA,WAAAA,GACI,oBAACC,QAAQ,QAAQ,sBACb,oBAACD,OAAAA;KAGZ;IACD,QAAQE,CAAAA;QACJ,MAAM,CAACC,SAASC,WAAW,GAAGC,SAASH,KAAK,OAAO;QACnD,OAAO,WAAP,GAAO,oBAACH,QAAMA;YAAE,GAAGG,IAAI;YAAE,SAASC;YAAS,UAAUG,CAAAA,QAASF,WAAWE;;IAC7E;AACJ;AAEA,uBAAeR;AAGR,MAAMS,UAAiB;IAC1B,MAAM;QACF,OAAO;IACX;AACJ;AAEO,MAAMC,oBAA2B;IACpC,MAAM;QACF,OAAO;QACP,UAAU;IACd;AACJ;AAEO,MAAMC,kBAAyB;IAClC,MAAM;QACF,GAAGF,QAAQ,IAAI;QACf,aAAa;IACjB;AACJ;AAEO,MAAMG,YAAmB;IAC5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YkB;IAChB;IACA,UAAU;QACN,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,SAAS;YACL,aAAa;YACb,SAAS;QACb;QACA,UAAU;YACN,aAAa;YACb,SAAS;QACb;QACA,UAAU;YACN,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;QACb;QACA,YAAY;YACR,aACI;QACR;QACA,UAAU;YACN,aAAa;QACjB;IACJ;AACJ"}
|
|
@@ -14,21 +14,25 @@ type SwitchPrimitiveProps = Omit<SwitchPrimitives.SwitchProps, "defaultChecked"
|
|
|
14
14
|
type SwitchPrimitivVm = {
|
|
15
15
|
item?: SwitchItemFormatted;
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Switch
|
|
19
|
+
*/
|
|
20
|
+
declare const DecoratableSwitchPrimitive: (props: SwitchPrimitiveProps) => React.JSX.Element | null;
|
|
21
|
+
declare const SwitchPrimitive: typeof DecoratableSwitchPrimitive & {
|
|
22
|
+
original: typeof DecoratableSwitchPrimitive;
|
|
19
23
|
originalName: string;
|
|
20
24
|
displayName: string;
|
|
21
25
|
} & {
|
|
22
|
-
original:
|
|
23
|
-
original:
|
|
26
|
+
original: typeof DecoratableSwitchPrimitive & {
|
|
27
|
+
original: typeof DecoratableSwitchPrimitive;
|
|
24
28
|
originalName: string;
|
|
25
29
|
displayName: string;
|
|
26
30
|
};
|
|
27
31
|
originalName: string;
|
|
28
32
|
displayName: string;
|
|
29
33
|
} & {
|
|
30
|
-
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<
|
|
31
|
-
original:
|
|
34
|
+
createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<typeof DecoratableSwitchPrimitive & {
|
|
35
|
+
original: typeof DecoratableSwitchPrimitive;
|
|
32
36
|
originalName: string;
|
|
33
37
|
displayName: string;
|
|
34
38
|
}>) => (props: unknown) => React.JSX.Element;
|
|
@@ -18,7 +18,7 @@ const SwitchRenderer = ({ id, label, changeChecked, description, className, labe
|
|
|
18
18
|
className: cn(switchVariants({
|
|
19
19
|
labelPosition
|
|
20
20
|
}), className)
|
|
21
|
-
}, /*#__PURE__*/ __rspack_external_react.createElement(Label, {
|
|
21
|
+
}, label && /*#__PURE__*/ __rspack_external_react.createElement(Label, {
|
|
22
22
|
htmlFor: id,
|
|
23
23
|
text: label,
|
|
24
24
|
disabled: disabled,
|
|
@@ -30,10 +30,11 @@ const SwitchRenderer = ({ id, label, changeChecked, description, className, labe
|
|
|
30
30
|
id: id,
|
|
31
31
|
checked: checked,
|
|
32
32
|
className: cn([
|
|
33
|
-
"peer inline-flex h-md w-[26px]
|
|
33
|
+
"peer inline-flex h-md w-[26px] shrink-0 cursor-pointer items-center rounded-xxl border-sm transition-colors",
|
|
34
34
|
"border-transparent data-[state=checked]:bg-secondary data-[state=unchecked]:bg-neutral-strong",
|
|
35
35
|
"focus-visible:outline-none focus-visible:border-success focus-visible:ring-lg focus-visible:ring-primary-dimmed",
|
|
36
|
-
"disabled:cursor-not-allowed disabled:bg-neutral-muted disabled:data-[state=checked]:bg-neutral-muted"
|
|
36
|
+
"disabled:cursor-not-allowed disabled:bg-neutral-muted disabled:data-[state=checked]:bg-neutral-muted",
|
|
37
|
+
label && "mt-xxs"
|
|
37
38
|
]),
|
|
38
39
|
disabled: disabled,
|
|
39
40
|
onCheckedChange: changeChecked
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch/primitives/SwitchPrimitive.js","sources":["../../../src/Switch/primitives/SwitchPrimitive.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Switch as SwitchPrimitives } from \"radix-ui\";\nimport { cn, cva, makeDecoratable, type VariantProps } from \"~/utils.js\";\nimport { Label } from \"~/Label/index.js\";\nimport { useSwitch } from \"./useSwitch.js\";\nimport type { SwitchItemDto, SwitchItemFormatted } from \"../domains/index.js\";\n\n/**\n * Switch Renderer\n */\n\nconst switchVariants = cva(\"inline-flex items-start space-x-sm\", {\n variants: {\n labelPosition: {\n start: \"\",\n end: \"flex-row-reverse space-x-sm-extra space-x-reverse\"\n }\n },\n defaultVariants: {\n labelPosition: \"start\"\n }\n});\n\ntype SwitchPrimitiveProps = Omit<\n SwitchPrimitives.SwitchProps,\n \"defaultChecked\" | \"onCheckedChange\" | \"onChange\"\n> &\n VariantProps<typeof switchVariants> &\n SwitchItemDto & {\n onChange?: (checked: boolean) => void;\n };\n\ntype SwitchPrimitivVm = {\n item?: SwitchItemFormatted;\n};\n\ntype SwitchRendererProps = Omit<SwitchPrimitiveProps, \"onCheckedChange\"> &\n NonNullable<SwitchPrimitivVm[\"item\"]> & {\n changeChecked: (checked: boolean) => void;\n description?: React.ReactNode;\n };\n\nconst SwitchRenderer = ({\n id,\n label,\n changeChecked,\n description,\n className,\n labelPosition,\n disabled,\n required,\n checked\n}: SwitchRendererProps) => {\n return (\n <div className={cn(switchVariants({ labelPosition }), className)}>\n <Label\n
|
|
1
|
+
{"version":3,"file":"Switch/primitives/SwitchPrimitive.js","sources":["../../../src/Switch/primitives/SwitchPrimitive.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Switch as SwitchPrimitives } from \"radix-ui\";\nimport { cn, cva, makeDecoratable, type VariantProps } from \"~/utils.js\";\nimport { Label } from \"~/Label/index.js\";\nimport { useSwitch } from \"./useSwitch.js\";\nimport type { SwitchItemDto, SwitchItemFormatted } from \"../domains/index.js\";\n\n/**\n * Switch Renderer\n */\n\nconst switchVariants = cva(\"inline-flex items-start space-x-sm\", {\n variants: {\n labelPosition: {\n start: \"\",\n end: \"flex-row-reverse space-x-sm-extra space-x-reverse\"\n }\n },\n defaultVariants: {\n labelPosition: \"start\"\n }\n});\n\ntype SwitchPrimitiveProps = Omit<\n SwitchPrimitives.SwitchProps,\n \"defaultChecked\" | \"onCheckedChange\" | \"onChange\"\n> &\n VariantProps<typeof switchVariants> &\n SwitchItemDto & {\n onChange?: (checked: boolean) => void;\n };\n\ntype SwitchPrimitivVm = {\n item?: SwitchItemFormatted;\n};\n\ntype SwitchRendererProps = Omit<SwitchPrimitiveProps, \"onCheckedChange\"> &\n NonNullable<SwitchPrimitivVm[\"item\"]> & {\n changeChecked: (checked: boolean) => void;\n description?: React.ReactNode;\n };\n\nconst SwitchRenderer = ({\n id,\n label,\n changeChecked,\n description,\n className,\n labelPosition,\n disabled,\n required,\n checked\n}: SwitchRendererProps) => {\n return (\n <div className={cn(switchVariants({ labelPosition }), className)}>\n {label && (\n <Label\n htmlFor={id}\n text={label}\n disabled={disabled}\n required={required}\n hint={description}\n weight={\"light\"}\n className={\"text-md\"}\n />\n )}\n <SwitchPrimitives.Root\n id={id}\n checked={checked}\n className={cn([\n \"peer inline-flex h-md w-[26px] shrink-0 cursor-pointer items-center rounded-xxl border-sm transition-colors\",\n \"border-transparent data-[state=checked]:bg-secondary data-[state=unchecked]:bg-neutral-strong\",\n \"focus-visible:outline-none focus-visible:border-success focus-visible:ring-lg focus-visible:ring-primary-dimmed\",\n \"disabled:cursor-not-allowed disabled:bg-neutral-muted disabled:data-[state=checked]:bg-neutral-muted\",\n // Nudges the switch down to line up with the inline label's text.\n label && \"mt-xxs\"\n ])}\n disabled={disabled}\n onCheckedChange={changeChecked}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-sm-plus w-sm-plus rounded-xxl bg-neutral-base shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-sm-extra data-[state=unchecked]:translate-x-xxs\"\n )}\n />\n </SwitchPrimitives.Root>\n </div>\n );\n};\n\n/**\n * Switch\n */\nconst DecoratableSwitchPrimitive = (props: SwitchPrimitiveProps) => {\n const { vm, changeChecked } = useSwitch(props);\n\n if (!vm.item) {\n return null;\n }\n\n return <SwitchRenderer {...props} {...vm.item} changeChecked={changeChecked} />;\n};\nconst SwitchPrimitive = makeDecoratable(\"SwitchPrimitive\", DecoratableSwitchPrimitive);\n\nexport { SwitchPrimitive, type SwitchPrimitiveProps, type SwitchPrimitivVm };\n"],"names":["switchVariants","cva","SwitchRenderer","id","label","changeChecked","description","className","labelPosition","disabled","required","checked","cn","Label","SwitchPrimitives","DecoratableSwitchPrimitive","props","vm","useSwitch","SwitchPrimitive","makeDecoratable"],"mappings":";;;;;AAWA,MAAMA,iBAAiBC,IAAI,sCAAsC;IAC7D,UAAU;QACN,eAAe;YACX,OAAO;YACP,KAAK;QACT;IACJ;IACA,iBAAiB;QACb,eAAe;IACnB;AACJ;AAqBA,MAAMC,iBAAiB,CAAC,EACpBC,EAAE,EACFC,KAAK,EACLC,aAAa,EACbC,WAAW,EACXC,SAAS,EACTC,aAAa,EACbC,QAAQ,EACRC,QAAQ,EACRC,OAAO,EACW,GACX,WAAP,GACI,sCAAC;QAAI,WAAWC,GAAGZ,eAAe;YAAEQ;QAAc,IAAID;OACjDH,SAAS,WAATA,GACG,sCAACS,OAAKA;QACF,SAASV;QACT,MAAMC;QACN,UAAUK;QACV,UAAUC;QACV,MAAMJ;QACN,QAAQ;QACR,WAAW;sBAGnB,sCAACQ,OAAAA,IAAqB;QAClB,IAAIX;QACJ,SAASQ;QACT,WAAWC,GAAG;YACV;YACA;YACA;YACA;YAEAR,SAAS;SACZ;QACD,UAAUK;QACV,iBAAiBJ;qBAEjB,sCAACS,OAAAA,KAAsB;QACnB,WAAWF,GACP;;AAWxB,MAAMG,6BAA6B,CAACC;IAChC,MAAM,EAAEC,EAAE,EAAEZ,aAAa,EAAE,GAAGa,UAAUF;IAExC,IAAI,CAACC,GAAG,IAAI,EACR,OAAO;IAGX,OAAO,WAAP,GAAO,sCAACf,gBAAcA;QAAE,GAAGc,KAAK;QAAG,GAAGC,GAAG,IAAI;QAAE,eAAeZ;;AAClE;AACA,MAAMc,kBAAkBC,gBAAgB,mBAAmBL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch/primitives/SwitchPrimitive.stories.js","sources":["../../../src/Switch/primitives/SwitchPrimitive.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react
|
|
1
|
+
{"version":3,"file":"Switch/primitives/SwitchPrimitive.stories.js","sources":["../../../src/Switch/primitives/SwitchPrimitive.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { SwitchPrimitive } from \"./SwitchPrimitive.js\";\n\nconst meta: Meta<typeof SwitchPrimitive> = {\n title: \"Components/Form Primitives/Switch\",\n component: SwitchPrimitive,\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [checked, setChecked] = useState(args.checked);\n return (\n <SwitchPrimitive {...args} checked={checked} onChange={value => setChecked(value)} />\n );\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof SwitchPrimitive>;\n\nexport const Default: Story = {\n args: {\n label: \"Label\"\n }\n};\n\nexport const WithLeadingLabel: Story = {\n args: {\n label: \"Leading label\",\n labelPosition: \"start\"\n }\n};\n\nexport const WithLongLeadingLabel: Story = {\n args: {\n label: \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eu aliquam lacus. Morbi eleifend, eros et vestibulum lobortis, mi elit scelerisque neque, sit amet dictum orci sem ac ante. In hac habitasse platea dictumst. Pellentesque molestie nisl tortor, eu dictum velit mollis vitae. Maecenas nec risus sit amet ante efficitur venenatis id eget eros. Aenean mollis vel dolor vitae vestibulum. Integer consectetur id diam eget iaculis. Praesent egestas ullamcorper libero vel eleifend.\",\n labelPosition: \"start\"\n }\n};\n\nexport const WithTrailingLabel: Story = {\n args: {\n label: \"Trailing label\",\n labelPosition: \"end\"\n }\n};\n\nexport const WithLongTrailingLabel: Story = {\n args: {\n label: \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eu aliquam lacus. Morbi eleifend, eros et vestibulum lobortis, mi elit scelerisque neque, sit amet dictum orci sem ac ante. In hac habitasse platea dictumst. Pellentesque molestie nisl tortor, eu dictum velit mollis vitae. Maecenas nec risus sit amet ante efficitur venenatis id eget eros. Aenean mollis vel dolor vitae vestibulum. Integer consectetur id diam eget iaculis. Praesent egestas ullamcorper libero vel eleifend.\",\n labelPosition: \"end\"\n }\n};\n\nexport const Checked: Story = {\n args: {\n checked: true\n }\n};\n\nexport const Disabled: Story = {\n args: {\n label: \"Label\",\n disabled: true\n }\n};\n"],"names":["meta","SwitchPrimitive","args","checked","setChecked","useState","value","Default","WithLeadingLabel","WithLongLeadingLabel","WithTrailingLabel","WithLongTrailingLabel","Checked","Disabled"],"mappings":";;AAIA,MAAMA,OAAqC;IACvC,OAAO;IACP,WAAWC;IACX,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,SAASC,WAAW,GAAGC,SAASH,KAAK,OAAO;QACnD,OAAO,WAAP,GACI,oBAACD,iBAAeA;YAAE,GAAGC,IAAI;YAAE,SAASC;YAAS,UAAUG,CAAAA,QAASF,WAAWE;;IAEnF;AACJ;AAEA,gCAAeN;AAGR,MAAMO,UAAiB;IAC1B,MAAM;QACF,OAAO;IACX;AACJ;AAEO,MAAMC,mBAA0B;IACnC,MAAM;QACF,OAAO;QACP,eAAe;IACnB;AACJ;AAEO,MAAMC,uBAA8B;IACvC,MAAM;QACF,OAAO;QACP,eAAe;IACnB;AACJ;AAEO,MAAMC,oBAA2B;IACpC,MAAM;QACF,OAAO;QACP,eAAe;IACnB;AACJ;AAEO,MAAMC,wBAA+B;IACxC,MAAM;QACF,OAAO;QACP,eAAe;IACnB;AACJ;AAEO,MAAMC,UAAiB;IAC1B,MAAM;QACF,SAAS;IACb;AACJ;AAEO,MAAMC,WAAkB;IAC3B,MAAM;QACF,OAAO;QACP,UAAU;IACd;AACJ"}
|