@webiny/admin-ui 6.0.0-alpha.0 → 6.0.0-alpha.2
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 +1 -20
- package/Accordion/Accordion.js.map +1 -1
- package/Accordion/Accordion.mdx +11 -4
- package/Accordion/Accordion.stories.d.ts +1 -1
- package/Accordion/Accordion.stories.js +15 -9
- package/Accordion/Accordion.stories.js.map +1 -1
- package/Accordion/components/AccordionContent.js +1 -1
- package/Accordion/components/AccordionContent.js.map +1 -1
- package/Accordion/components/AccordionItem.d.ts +1 -19
- package/Accordion/components/AccordionItem.js +3 -7
- package/Accordion/components/AccordionItem.js.map +1 -1
- package/Accordion/components/AccordionItemAction.d.ts +1 -1
- package/Accordion/components/AccordionItemAction.js.map +1 -1
- package/Accordion/components/AccordionItemDragHandle.d.ts +8 -0
- package/Accordion/components/AccordionItemDragHandle.js +36 -0
- package/Accordion/components/AccordionItemDragHandle.js.map +1 -0
- package/Accordion/components/AccordionItemIcon.d.ts +1 -1
- package/Accordion/components/AccordionItemIcon.js.map +1 -1
- package/Accordion/components/AccordionTrigger.d.ts +2 -2
- package/Accordion/components/AccordionTrigger.js +5 -4
- package/Accordion/components/AccordionTrigger.js.map +1 -1
- package/Alert/Alert.d.ts +1 -1
- package/AutoComplete/AutoComplete.d.ts +2 -2
- package/AutoComplete/AutoComplete.js.map +1 -1
- package/AutoComplete/domains/AutoCompleteOption.d.ts +1 -1
- package/AutoComplete/domains/AutoCompleteOption.js.map +1 -1
- package/AutoComplete/domains/AutoCompleteOptionDto.d.ts +1 -1
- package/AutoComplete/domains/AutoCompleteOptionDto.js.map +1 -1
- package/AutoComplete/primitives/AutoCompletePrimitive.d.ts +3 -6
- package/AutoComplete/primitives/AutoCompletePrimitive.js +1 -0
- package/AutoComplete/primitives/AutoCompletePrimitive.js.map +1 -1
- package/AutoComplete/primitives/AutoCompletePrimitive.stories.d.ts +3 -0
- package/AutoComplete/primitives/AutoCompletePrimitive.stories.js +30 -0
- package/AutoComplete/primitives/AutoCompletePrimitive.stories.js.map +1 -1
- package/AutoComplete/primitives/components/AutoCompleteInputIcons.d.ts +1 -0
- package/AutoComplete/primitives/components/AutoCompleteInputIcons.js +3 -2
- package/AutoComplete/primitives/components/AutoCompleteInputIcons.js.map +1 -1
- package/AutoComplete/primitives/components/AutoCompleteList.d.ts +1 -1
- package/AutoComplete/primitives/components/AutoCompleteList.js.map +1 -1
- package/AutoComplete/primitives/presenters/AutoCompleteListOptionsPresenter.d.ts +2 -2
- package/AutoComplete/primitives/presenters/AutoCompleteListOptionsPresenter.js.map +1 -1
- package/AutoComplete/primitives/presenters/AutoCompletePresenter.d.ts +3 -3
- package/AutoComplete/primitives/presenters/AutoCompletePresenter.js.map +1 -1
- package/AutoComplete/primitives/useAutoComplete.d.ts +1 -1
- package/AutoComplete/primitives/useAutoComplete.js.map +1 -1
- package/Button/Button.js +2 -2
- package/Button/Button.js.map +1 -1
- package/Button/CopyButton.d.ts +2 -3
- package/Button/CopyButton.js.map +1 -1
- package/Button/IconButton.d.ts +1 -1
- package/Button/IconButton.js +2 -2
- package/Button/IconButton.js.map +1 -1
- package/Card/Card.d.ts +2 -1
- package/Card/Card.js.map +1 -1
- package/Card/components/CardFooter.d.ts +1 -1
- package/Card/components/CardFooter.js.map +1 -1
- package/Card/components/CardHeader.d.ts +1 -1
- package/Card/components/CardHeader.js.map +1 -1
- package/Card/components/CardRoot.d.ts +4 -4
- package/Card/components/CardRoot.js.map +1 -1
- package/Checkbox/Checkbox.d.ts +2 -2
- package/Checkbox/Checkbox.js.map +1 -1
- package/Checkbox/domains/CheckboxItem.d.ts +1 -1
- package/Checkbox/domains/CheckboxItem.js.map +1 -1
- package/Checkbox/domains/CheckboxItemDto.d.ts +1 -1
- package/Checkbox/domains/CheckboxItemDto.js.map +1 -1
- package/Checkbox/domains/CheckboxItemFormatted.d.ts +1 -1
- package/Checkbox/domains/CheckboxItemFormatted.js.map +1 -1
- package/Checkbox/domains/CheckboxItemMapper.d.ts +2 -2
- package/Checkbox/domains/CheckboxItemMapper.js.map +1 -1
- package/Checkbox/primitives/CheckboxPrimitive.d.ts +6 -0
- package/Checkbox/primitives/presenters/CheckboxPresenter.d.ts +1 -1
- package/Checkbox/primitives/presenters/CheckboxPresenter.js.map +1 -1
- package/Checkbox/primitives/useCheckbox.d.ts +1 -1
- package/Checkbox/primitives/useCheckbox.js.map +1 -1
- package/CheckboxGroup/CheckboxGroup.d.ts +2 -2
- package/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/CheckboxGroup/primitives/CheckboxGroupPrimitive.d.ts +1 -1
- package/CheckboxGroup/primitives/CheckboxGroupPrimitive.js.map +1 -1
- package/CheckboxGroup/primitives/presenters/CheckboxGroupPresenter.d.ts +1 -1
- package/CheckboxGroup/primitives/presenters/CheckboxGroupPresenter.js.map +1 -1
- package/CheckboxGroup/primitives/useCheckboxGroup.d.ts +1 -1
- package/CheckboxGroup/primitives/useCheckboxGroup.js.map +1 -1
- package/CodeEditor/CodeEditor.d.ts +2 -2
- package/CodeEditor/CodeEditor.js.map +1 -1
- package/CodeEditor/CodeEditorPrimitive.d.ts +1 -3
- package/CodeEditor/CodeEditorPrimitive.js +1 -2
- package/CodeEditor/CodeEditorPrimitive.js.map +1 -1
- package/ColorPicker/ColorPicker.d.ts +2 -2
- package/ColorPicker/ColorPicker.js.map +1 -1
- package/ColorPicker/primitives/presenters/ColorPickerPresenter.d.ts +1 -1
- package/ColorPicker/primitives/presenters/ColorPickerPresenter.js.map +1 -1
- package/ColorPicker/primitives/presenters/ColorPickerPresenter.test.js.map +1 -1
- package/ColorPicker/primitives/useColorPicker.d.ts +1 -1
- package/ColorPicker/primitives/useColorPicker.js.map +1 -1
- package/Command/Command.d.ts +5 -5
- package/Command/components/Input.d.ts +1 -1
- package/Command/components/Input.js.map +1 -1
- package/Command/domain/CommandOption.d.ts +1 -1
- package/Command/domain/CommandOption.js.map +1 -1
- package/Command/domain/CommandOptionFormatter.d.ts +2 -2
- package/Command/domain/CommandOptionFormatter.js.map +1 -1
- package/DataList/DataList.d.ts +1 -1
- package/DataList/DataList.js.map +1 -1
- package/DataList/DataListIcons.d.ts +1 -1
- package/DataList/DataListIcons.js.map +1 -1
- package/DataList/DataListWithSections.d.ts +1 -1
- package/DataList/DataListWithSections.js.map +1 -1
- package/DataList/components/Filters.d.ts +1 -1
- package/DataList/components/Filters.js.map +1 -1
- package/DataList/components/Loader.d.ts +1 -1
- package/DataList/components/Loader.js.map +1 -1
- package/DataList/components/MultiSelectActions.d.ts +1 -1
- package/DataList/components/MultiSelectActions.js.map +1 -1
- package/DataList/components/MultiSelectAll.d.ts +1 -1
- package/DataList/components/MultiSelectAll.js.map +1 -1
- package/DataList/components/Pagination.d.ts +1 -1
- package/DataList/components/Pagination.js.map +1 -1
- package/DataList/components/RefreshButton.d.ts +1 -1
- package/DataList/components/RefreshButton.js.map +1 -1
- package/DataList/components/Sorters.d.ts +1 -1
- package/DataList/components/Sorters.js.map +1 -1
- package/DataTable/DataTable.d.ts +1 -1
- package/DataTable/DataTable.js.map +1 -1
- package/DataTable/DataTable.stories.d.ts +2 -1
- package/DataTable/DataTable.stories.js.map +1 -1
- package/DataTable/components/ColumnsVisibility.d.ts +1 -1
- package/DataTable/components/ColumnsVisibility.js.map +1 -1
- package/Dialog/components/CancelButton.d.ts +1 -1
- package/Dialog/components/CancelButton.js.map +1 -1
- package/Dialog/components/ConfirmButton.d.ts +1 -1
- package/Dialog/components/ConfirmButton.js.map +1 -1
- 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 +1 -1
- package/Dialog/components/Icon.js.map +1 -1
- package/Drawer/components/CancelButton.d.ts +1 -1
- package/Drawer/components/CancelButton.js.map +1 -1
- package/Drawer/components/ConfirmButton.d.ts +1 -1
- package/Drawer/components/ConfirmButton.js.map +1 -1
- package/Drawer/components/Icon.d.ts +1 -1
- package/Drawer/components/Icon.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuItem.d.ts +1 -1
- package/DropdownMenu/components/DropdownMenuItem.js.map +1 -1
- package/FilePicker/FilePicker.js +9 -13
- package/FilePicker/FilePicker.js.map +1 -1
- package/FilePicker/domains/FileItemFormatter.d.ts +1 -1
- package/FilePicker/domains/FileItemFormatter.js.map +1 -1
- package/FilePicker/primitives/FilePickerPrimitive.d.ts +12 -8
- package/FilePicker/primitives/FilePickerPrimitive.js +15 -5
- package/FilePicker/primitives/FilePickerPrimitive.js.map +1 -1
- package/FilePicker/primitives/components/Description.d.ts +8 -0
- package/FilePicker/primitives/components/Description.js +19 -0
- package/FilePicker/primitives/components/Description.js.map +1 -0
- package/FilePicker/primitives/components/Label.d.ts +3 -3
- package/FilePicker/primitives/components/Label.js +8 -9
- package/FilePicker/primitives/components/Label.js.map +1 -1
- package/FilePicker/primitives/components/Trigger.js +22 -16
- package/FilePicker/primitives/components/Trigger.js.map +1 -1
- package/FilePicker/primitives/components/index.d.ts +1 -0
- package/FilePicker/primitives/components/index.js +1 -0
- package/FilePicker/primitives/components/index.js.map +1 -1
- package/FilePicker/primitives/components/previews/FilePreview.d.ts +2 -2
- package/FilePicker/primitives/components/previews/FilePreview.js.map +1 -1
- package/FilePicker/primitives/components/types.d.ts +2 -2
- package/FilePicker/primitives/components/types.js.map +1 -1
- package/FormComponent/FormComponent.d.ts +2 -2
- package/FormComponent/FormComponent.js.map +1 -1
- package/FormComponent/Label.js.map +1 -1
- package/Grid/Grid.d.ts +4 -4
- package/Heading/Heading.d.ts +1 -1
- package/IconPicker/IconPicker.d.ts +2 -2
- package/IconPicker/IconPicker.js.map +1 -1
- package/IconPicker/domains/IconPickerFontAwesome.d.ts +1 -1
- package/IconPicker/domains/IconPickerFontAwesome.js.map +1 -1
- package/IconPicker/domains/IconPickerIcon.d.ts +1 -1
- package/IconPicker/domains/IconPickerIcon.js.map +1 -1
- package/IconPicker/domains/IconPickerIconFormatter.d.ts +2 -2
- package/IconPicker/domains/IconPickerIconFormatter.js.map +1 -1
- package/IconPicker/primitives/IconPickerPrimitive.d.ts +2 -2
- package/IconPicker/primitives/IconPickerPrimitive.js.map +1 -1
- package/IconPicker/primitives/components/IconPickerGrid.d.ts +1 -1
- package/IconPicker/primitives/components/IconPickerGrid.js.map +1 -1
- package/IconPicker/primitives/components/IconPickerIcon.d.ts +1 -1
- package/IconPicker/primitives/components/IconPickerIcon.js.map +1 -1
- package/IconPicker/primitives/components/IconPickerInput.js.map +1 -1
- package/IconPicker/primitives/presenters/IconPickerPresenter.d.ts +1 -1
- package/IconPicker/primitives/presenters/IconPickerPresenter.js.map +1 -1
- package/IconPicker/primitives/useIconPicker.d.ts +1 -1
- package/IconPicker/primitives/useIconPicker.js.map +1 -1
- package/Input/InputPrimitive.d.ts +5 -14
- package/Input/InputPrimitive.js +15 -124
- package/Input/InputPrimitive.js.map +1 -1
- package/Input/InputPrimitive.stories.js +19 -4
- package/Input/InputPrimitive.stories.js.map +1 -1
- package/Link/Link.d.ts +1 -1
- package/List/components/ListItemAction.d.ts +1 -1
- package/List/components/ListItemAction.js.map +1 -1
- package/List/components/ListItemHandle.d.ts +1 -1
- package/List/components/ListItemHandle.js.map +1 -1
- package/List/components/ListItemIcon.d.ts +1 -1
- package/List/components/ListItemIcon.js.map +1 -1
- package/Loader/OverlayLoader.d.ts +1 -1
- package/Loader/OverlayLoader.js.map +1 -1
- package/MultiAutoComplete/MultiAutoComplete.d.ts +2 -2
- package/MultiAutoComplete/MultiAutoComplete.js.map +1 -1
- package/MultiAutoComplete/domains/MultiAutoCompleteOption.d.ts +1 -1
- package/MultiAutoComplete/domains/MultiAutoCompleteOption.js.map +1 -1
- package/MultiAutoComplete/domains/MultiAutoCompleteOptionDto.d.ts +1 -1
- package/MultiAutoComplete/domains/MultiAutoCompleteOptionDto.js.map +1 -1
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.d.ts +3 -3
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.js +1 -0
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.js.map +1 -1
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.stories.d.ts +3 -0
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.stories.js +78 -4
- package/MultiAutoComplete/primitives/MultiAutoCompletePrimitive.stories.js.map +1 -1
- package/MultiAutoComplete/primitives/components/MultiAutoCompleteInput.d.ts +2 -2
- package/MultiAutoComplete/primitives/components/MultiAutoCompleteInput.js +7 -13
- package/MultiAutoComplete/primitives/components/MultiAutoCompleteInput.js.map +1 -1
- package/MultiAutoComplete/primitives/components/MultiAutoCompleteInputIcons.d.ts +1 -0
- package/MultiAutoComplete/primitives/components/MultiAutoCompleteInputIcons.js +3 -2
- package/MultiAutoComplete/primitives/components/MultiAutoCompleteInputIcons.js.map +1 -1
- package/MultiAutoComplete/primitives/components/MultiAutoCompleteList.d.ts +1 -1
- package/MultiAutoComplete/primitives/components/MultiAutoCompleteList.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenter.d.ts +2 -2
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenter.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenterWithUniqueValues.d.ts +2 -2
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenterWithUniqueValues.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.d.ts +5 -5
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.js +4 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenter.test.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenterWithFreeInput.d.ts +2 -2
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenterWithFreeInput.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompletePresenterWithFreeInput.test.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteSelectedOptionsPresenter.d.ts +2 -2
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteSelectedOptionsPresenter.js +4 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteSelectedOptionsPresenter.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteTemporaryOptionPresenter.d.ts +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteTemporaryOptionPresenter.js.map +1 -1
- package/MultiAutoComplete/primitives/useMultiAutoComplete.d.ts +1 -1
- package/MultiAutoComplete/primitives/useMultiAutoComplete.js.map +1 -1
- package/MultiFilePicker/MultiFilePicker.js +8 -12
- package/MultiFilePicker/MultiFilePicker.js.map +1 -1
- package/MultiFilePicker/primitives/MultiFilePickerPrimitive.d.ts +18 -10
- package/MultiFilePicker/primitives/MultiFilePickerPrimitive.js +16 -6
- package/MultiFilePicker/primitives/MultiFilePickerPrimitive.js.map +1 -1
- package/RadioGroup/RadioGroup.d.ts +2 -2
- package/RadioGroup/RadioGroup.js.map +1 -1
- package/RadioGroup/domains/RadioItem.d.ts +1 -1
- package/RadioGroup/domains/RadioItem.js.map +1 -1
- package/RadioGroup/domains/RadioItemFormatted.d.ts +1 -1
- package/RadioGroup/domains/RadioItemFormatted.js.map +1 -1
- package/RadioGroup/domains/RadioItemFormatter.d.ts +2 -2
- package/RadioGroup/domains/RadioItemFormatter.js.map +1 -1
- package/RadioGroup/domains/RadioItemParams.d.ts +1 -1
- package/RadioGroup/domains/RadioItemParams.js.map +1 -1
- package/RadioGroup/primitives/RadioGroupPrimitive.d.ts +1 -1
- package/RadioGroup/primitives/RadioGroupPrimitive.js +1 -1
- package/RadioGroup/primitives/RadioGroupPrimitive.js.map +1 -1
- package/RadioGroup/primitives/presenters/RadioGroupPresenter.d.ts +2 -2
- package/RadioGroup/primitives/presenters/RadioGroupPresenter.js.map +1 -1
- package/RadioGroup/primitives/useRadioGroup.d.ts +1 -1
- package/RadioGroup/primitives/useRadioGroup.js.map +1 -1
- package/RangeSlider/RangeSlider.d.ts +2 -2
- package/RangeSlider/RangeSlider.js.map +1 -1
- package/RangeSlider/primitives/RangeSliderPrimitive.d.ts +1 -1
- package/RangeSlider/primitives/RangeSliderPrimitive.js.map +1 -1
- package/RangeSlider/primitives/presenters/RangeSliderPresenter.d.ts +1 -1
- package/RangeSlider/primitives/presenters/RangeSliderPresenter.js.map +1 -1
- package/RangeSlider/primitives/useRangeSlider.d.ts +1 -1
- package/RangeSlider/primitives/useRangeSlider.js.map +1 -1
- package/RichTextEditor/RichTextEditor.d.ts +2 -2
- package/RichTextEditor/RichTextEditor.js.map +1 -1
- package/RichTextEditor/RichTextEditorPrimitive.d.ts +1 -1
- package/RichTextEditor/RichTextEditorPrimitive.js.map +1 -1
- package/RichTextEditor/createPropsFromConfig.d.ts +1 -1
- package/RichTextEditor/createPropsFromConfig.js.map +1 -1
- package/Select/Select.d.ts +2 -2
- package/Select/Select.js.map +1 -1
- package/Select/domains/SelectOption.d.ts +1 -1
- package/Select/domains/SelectOption.js.map +1 -1
- package/Select/domains/SelectOptionMapper.d.ts +2 -2
- package/Select/domains/SelectOptionMapper.js.map +1 -1
- package/Select/primitives/SelectPrimitive.d.ts +2 -2
- package/Select/primitives/SelectPrimitive.js +4 -3
- package/Select/primitives/SelectPrimitive.js.map +1 -1
- package/Select/primitives/SelectPrimitive.stories.d.ts +3 -0
- package/Select/primitives/SelectPrimitive.stories.js +28 -0
- package/Select/primitives/SelectPrimitive.stories.js.map +1 -1
- package/Select/primitives/components/SelectTrigger.d.ts +1 -1
- package/Select/primitives/components/SelectTrigger.js +6 -1
- package/Select/primitives/components/SelectTrigger.js.map +1 -1
- package/Select/primitives/presenters/SelectPresenter.d.ts +2 -1
- package/Select/primitives/presenters/SelectPresenter.js.map +1 -1
- package/Select/primitives/useSelect.d.ts +1 -1
- package/Select/primitives/useSelect.js.map +1 -1
- package/Separator/Separator.d.ts +2 -2
- package/Sidebar/components/SidebarRoot.js +1 -4
- package/Sidebar/components/SidebarRoot.js.map +1 -1
- package/Sidebar/components/items/SidebarMenuItem.d.ts +1 -1
- package/Sidebar/components/items/SidebarMenuItem.js.map +1 -1
- package/Skeleton/Skeleton.d.ts +1 -1
- package/Slider/Slider.d.ts +2 -2
- package/Slider/Slider.js.map +1 -1
- package/Slider/primitives/SliderPrimitive.d.ts +1 -1
- package/Slider/primitives/SliderPrimitive.js.map +1 -1
- package/Slider/primitives/components/SliderThumb.d.ts +1 -1
- package/Slider/primitives/components/SliderThumb.js.map +1 -1
- package/Slider/primitives/components/SliderTooltip.d.ts +1 -1
- package/Slider/primitives/presenters/SliderPresenter.d.ts +1 -1
- package/Slider/primitives/presenters/SliderPresenter.js.map +1 -1
- package/Slider/primitives/useSlider.d.ts +1 -1
- package/Slider/primitives/useSlider.js.map +1 -1
- package/Switch/Switch.d.ts +2 -2
- package/Switch/Switch.js.map +1 -1
- package/Switch/domains/SwitchItem.d.ts +1 -1
- package/Switch/domains/SwitchItem.js.map +1 -1
- package/Switch/domains/SwitchItemDto.d.ts +1 -1
- package/Switch/domains/SwitchItemDto.js.map +1 -1
- package/Switch/domains/SwitchItemFormatted.d.ts +1 -1
- package/Switch/domains/SwitchItemFormatted.js.map +1 -1
- package/Switch/domains/SwitchItemMapper.d.ts +2 -2
- package/Switch/domains/SwitchItemMapper.js.map +1 -1
- package/Switch/primitives/SwitchPrimitive.d.ts +1 -1
- package/Switch/primitives/SwitchPrimitive.js.map +1 -1
- package/Switch/primitives/presenters/SwitchPresenter.d.ts +2 -2
- package/Switch/primitives/presenters/SwitchPresenter.js.map +1 -1
- package/Switch/primitives/useSwitch.d.ts +1 -1
- package/Switch/primitives/useSwitch.js.map +1 -1
- package/Tabs/Tabs.d.ts +1 -1
- package/Tabs/Tabs.js.map +1 -1
- package/Tabs/components/Context.d.ts +1 -1
- package/Tabs/components/Context.js.map +1 -1
- package/Tabs/components/Tab.d.ts +2 -2
- package/Tabs/components/Tab.js.map +1 -1
- package/Tag/Tag.d.ts +1 -1
- package/Tag/Tag.js.map +1 -1
- package/Tags/Tags.d.ts +24 -0
- package/Tags/Tags.js +59 -0
- package/Tags/Tags.js.map +1 -0
- package/Tags/Tags.stories.d.ts +13 -0
- package/Tags/Tags.stories.js +92 -0
- package/Tags/Tags.stories.js.map +1 -0
- package/Tags/domain/TagItem.d.ts +18 -0
- package/Tags/domain/TagItem.js +26 -0
- package/Tags/domain/TagItem.js.map +1 -0
- package/Tags/domain/TagItemDto.d.ts +5 -0
- package/Tags/domain/TagItemDto.js +3 -0
- package/Tags/domain/TagItemDto.js.map +1 -0
- package/Tags/domain/TagItemFormatted.d.ts +5 -0
- package/Tags/domain/TagItemFormatted.js +3 -0
- package/Tags/domain/TagItemFormatted.js.map +1 -0
- package/Tags/domain/TagItemMapper.d.ts +5 -0
- package/Tags/domain/TagItemMapper.js +11 -0
- package/Tags/domain/TagItemMapper.js.map +1 -0
- package/Tags/domain/index.d.ts +4 -0
- package/Tags/domain/index.js +6 -0
- package/Tags/domain/index.js.map +1 -0
- package/Tags/index.d.ts +1 -0
- package/Tags/index.js +3 -0
- package/Tags/index.js.map +1 -0
- package/Tags/primitives/TagsPrimitive.d.ts +81 -0
- package/Tags/primitives/TagsPrimitive.js +54 -0
- package/Tags/primitives/TagsPrimitive.js.map +1 -0
- package/Tags/primitives/TagsPrimitive.stories.d.ts +26 -0
- package/Tags/primitives/TagsPrimitive.stories.js +185 -0
- package/Tags/primitives/TagsPrimitive.stories.js.map +1 -0
- package/Tags/primitives/index.d.ts +1 -0
- package/Tags/primitives/index.js +3 -0
- package/Tags/primitives/index.js.map +1 -0
- package/Tags/primitives/presenters/TagsInputPresenter.d.ts +22 -0
- package/Tags/primitives/presenters/TagsInputPresenter.js +22 -0
- package/Tags/primitives/presenters/TagsInputPresenter.js.map +1 -0
- package/Tags/primitives/presenters/TagsPresenter.d.ts +42 -0
- package/Tags/primitives/presenters/TagsPresenter.js +68 -0
- package/Tags/primitives/presenters/TagsPresenter.js.map +1 -0
- package/Tags/primitives/presenters/TagsPresenter.test.d.ts +1 -0
- package/Tags/primitives/presenters/TagsPresenter.test.js +220 -0
- package/Tags/primitives/presenters/TagsPresenter.test.js.map +1 -0
- package/Tags/primitives/presenters/TagsValuesPresenter.d.ts +28 -0
- package/Tags/primitives/presenters/TagsValuesPresenter.js +41 -0
- package/Tags/primitives/presenters/TagsValuesPresenter.js.map +1 -0
- package/Tags/primitives/presenters/index.d.ts +3 -0
- package/Tags/primitives/presenters/index.js +5 -0
- package/Tags/primitives/presenters/index.js.map +1 -0
- package/Tags/primitives/useTags.d.ts +15 -0
- package/Tags/primitives/useTags.js +36 -0
- package/Tags/primitives/useTags.js.map +1 -0
- package/Textarea/Textarea.d.ts +3 -3
- package/Textarea/Textarea.js.map +1 -1
- package/Toast/Toast.d.ts +1 -1
- package/Toast/Toast.js.map +1 -1
- package/Toast/useToast.js +8 -2
- package/Toast/useToast.js.map +1 -1
- package/Tooltip/Tooltip.d.ts +1 -1
- package/Tooltip/Tooltip.js.map +1 -1
- package/Tree/components/ItemDragHandle.d.ts +2 -1
- package/Tree/components/ItemDragHandle.js.map +1 -1
- package/Tree/domains/NodeFormatter.d.ts +1 -1
- package/Tree/domains/NodeFormatter.js.map +1 -1
- package/Tree/useTree.d.ts +1 -1
- package/Tree/useTree.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +9 -8
- package/utils.d.ts +1 -1
- package/utils.js.map +1 -1
- package/Accordion/components/AccordionItemHandle.d.ts +0 -26
- package/Accordion/components/AccordionItemHandle.js +0 -29
- package/Accordion/components/AccordionItemHandle.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","cn","cva","makeDecoratable","inputIconVariants","variants","inputSize","md","lg","xl","position","start","end","disabled","true","defaultVariants","compoundVariants","class","InputIcon","icon","className","createElement","cloneElement","props","size","inputVariants","variant","primary","secondary","ghost","iconPosition","both","invalid","getIconPosition","startIcon","endIcon","DecoratableInputPrimitive","autoSelect","forwardEventOnChange","inputRef","maxLength","onChange","originalOnChange","onEnter","onEscape","onKeyDown","originalOnKeyDown","onFocus","originalOnFocus","value","useCallback","event","target","e","key","select","Object","assign","ref","InputPrimitive"],"sources":["InputPrimitive.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Icon as BaseIcon } from \"~/Icon\";\nimport { cn, cva, type VariantProps, makeDecoratable } from \"~/utils\";\n\n/**\n * Icon\n */\nconst inputIconVariants = cva(\"wby-absolute wby-fill-neutral-xstrong\", {\n variants: {\n // Define dummy variants to be used in combination with `compoundVariants` below.\n inputSize: {\n md: \"wby-top-sm\",\n lg: \"wby-top-sm-extra\",\n xl: \"wby-top-md\"\n },\n position: {\n start: \"\",\n end: \"\"\n },\n disabled: {\n true: \"wby-fill-neutral-disabled\"\n }\n },\n defaultVariants: {\n inputSize: \"lg\",\n position: \"start\"\n },\n compoundVariants: [\n // The icon position is `absolute` and is adjusted horizontally across its parent using left and right.\n {\n inputSize: \"md\",\n position: \"start\",\n class: \"wby-left-[calc(theme(spacing.sm-plus)-theme(borderWidth.sm))]\"\n },\n {\n inputSize: \"md\",\n position: \"end\",\n class: \"wby-right-[calc(theme(spacing.sm-plus)-theme(borderWidth.sm))]\"\n },\n {\n inputSize: \"lg\",\n position: \"start\",\n class: \"wby-left-[calc(theme(spacing.sm-plus)-theme(borderWidth.sm))]\"\n },\n {\n inputSize: \"lg\",\n position: \"end\",\n class: \"wby-right-[calc(theme(spacing.sm-plus)-theme(borderWidth.sm))]\"\n },\n {\n inputSize: \"xl\",\n position: \"start\",\n class: \"wby-left-[calc(theme(spacing.md)-theme(borderWidth.sm))]\"\n },\n {\n inputSize: \"xl\",\n position: \"end\",\n class: \"wby-right-[calc(theme(spacing.md)-theme(borderWidth.sm))]\"\n }\n ]\n});\n\ninterface InputIconProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof inputIconVariants> {\n icon: React.ReactElement;\n}\n\nconst InputIcon = ({ icon, disabled, position, inputSize, className }: InputIconProps) => {\n return (\n <div className={cn(inputIconVariants({ position, disabled, inputSize }), className)}>\n {React.cloneElement(icon, {\n ...icon.props,\n size: inputSize === \"xl\" ? \"lg\" : \"sm\" // Map icon size based on the input size.\n })}\n </div>\n );\n};\n\n/**\n * Input\n *\n * We support both `disabled` and `data-disabled` as well as `focused` and `data-focused` variants\n * because these variants can be used by both input and div elements. The last one is used by `MultiAutocomplete` component,\n * where the `inputVariants` is used to style a div that wraps multiple elements (input, Tags, icons, etc.)\n */\nconst inputVariants = cva(\n [\n \"wby-w-full wby-border-sm wby-text-md wby-peer\",\n \"focus-visible:wby-outline-none\",\n \"disabled:wby-cursor-not-allowed data-[disabled=true]:wby-cursor-not-allowed\",\n \"file:wby-bg-transparent file:wby-border-none file:wby-text-sm file:wby-font-semibold\"\n ],\n {\n variants: {\n size: {\n md: [\n \"wby-rounded-md\",\n \"wby-py-[calc(theme(padding.xs-plus)-theme(borderWidth.sm))] wby-px-[calc(theme(padding.sm-extra)-theme(borderWidth.sm))]\"\n ],\n lg: [\n \"wby-rounded-md\",\n \"wby-py-[calc(theme(padding.sm-plus)-theme(borderWidth.sm))] wby-px-[calc(theme(padding.sm-extra)-theme(borderWidth.sm))]\"\n ],\n xl: [\n \"wby-rounded-lg wby-leading-6\",\n \"wby-py-[calc(theme(padding.md)-theme(borderWidth.sm))] wby-px-[calc(theme(padding.md)-theme(borderWidth.sm))]\"\n ]\n },\n variant: {\n primary: [\n \"wby-bg-neutral-base wby-border-neutral-muted wby-text-neutral-strong placeholder:wby-text-neutral-dimmed\",\n \"hover:wby-border-neutral-strong\",\n \"focus:wby-border-neutral-black\",\n \"data-[focused=true]:wby-border-neutral-black\",\n \"disabled:wby-bg-neutral-disabled disabled:wby-border-neutral-dimmed disabled:wby-text-neutral-disabled disabled:placeholder:wby-text-neutral-disabled\",\n \"data-[disabled=true]:wby-bg-neutral-disabled data-[disabled=true]:wby-border-neutral-dimmed data-[disabled=true]:wby-text-neutral-disabled data-[disabled=true]:placeholder:wby-text-neutral-disabled\"\n ],\n secondary: [\n \"wby-bg-neutral-light wby-border-neutral-subtle wby-text-neutral-strong placeholder:wby-text-neutral-dimmed\",\n \"hover:wby-bg-neutral-dimmed\",\n \"focus:wby-bg-neutral-base focus:wby-border-neutral-black\",\n \"data-[focused=true]:wby-bg-neutral-base data-[focused=true]:wby-border-neutral-black\",\n \"disabled:wby-bg-neutral-disabled disabled:wby-text-neutral-disabled disabled:placeholder:wby-text-neutral-disabled\",\n \"data-[disabled=true]:wby-bg-neutral-disabled data-[disabled=true]:wby-text-neutral-disabled data-[disabled=true]:placeholder:wby-text-neutral-disabled\"\n ],\n ghost: [\n \"wby-bg-transparent wby-border-transparent wby-text-neutral-strong placeholder:wby-text-neutral-dimmed\",\n \"hover:wby-bg-neutral-dark/5\",\n \"focus:wby-bg-neutral-dark/5\",\n \"data-[focused=true]:wby-bg-neutral-dark/5\",\n \"disabled:wby-bg-transparent disabled:wby-text-neutral-disabled disabled:placeholder:wby-text-neutral-disabled\",\n \"data-[disabled=true]:wby-bg-transparent data-[disabled=true]:wby-text-neutral-disabled data-[disabled=true]:placeholder:wby-text-neutral-disabled\"\n ],\n \"ghost-negative\": [\n \"wby-bg-transparent wby-border-transparent wby-text-neutral-light/50 placeholder:wby-text-neutral-light/50\",\n \"hover:wby-bg-neutral-base/20\",\n \"focus:wby-bg-neutral-base focus:wby-text-neutral-primary focus:placeholder:wby-text-neutral-dimmed\",\n \"data-[focused=true]:wby-bg-neutral-base data-[focused=true]:wby-bg-neutral-primary data-[focused=true]:placeholder:wby-text-neutral-dimmed\",\n \"disabled:wby-bg-transparent disabled:wby-text-neutral-disabled/50 disabled:placeholder:wby-text-neutral-disabled/50\",\n \"data-[disabled=true]:wby-bg-transparent data-[disabled=true]:wby-text-neutral-disabled/50 data-[disabled=true]:placeholder:wby-text-neutral-disabled/50\"\n ]\n },\n iconPosition: {\n start: \"wby-pl-[calc(theme(padding.xl)-theme(borderWidth.sm))]\",\n end: \"wby-pr-[calc(theme(padding.xl)-theme(borderWidth.sm))]\",\n both: [\n \"wby-pl-[calc(theme(padding.xl)-theme(borderWidth.sm))]\",\n \"wby-pr-[calc(theme(padding.xl)-theme(borderWidth.sm))]\"\n ]\n },\n invalid: {\n true: \"\"\n }\n },\n compoundVariants: [\n // Prevent text overlap with icons, add extra padding for icons.\n {\n size: \"lg\",\n iconPosition: \"start\",\n class: \"wby-pl-[calc(theme(padding.xl)-theme(borderWidth.sm))]\"\n },\n {\n size: \"lg\",\n iconPosition: \"end\",\n class: \"wby-pr-[calc(theme(padding.xl)-theme(borderWidth.sm))]\"\n },\n {\n size: \"lg\",\n iconPosition: \"both\",\n class: [\n \"wby-pl-[calc(theme(padding.xl)-theme(borderWidth.sm))]\",\n \"wby-pr-[calc(theme(padding.xl)-theme(borderWidth.sm))]\"\n ]\n },\n {\n size: \"xl\",\n iconPosition: \"start\",\n class: \"wby-pl-[calc(theme(padding.xxl)+theme(padding.xs)-theme(borderWidth.sm))]\"\n },\n {\n size: \"xl\",\n iconPosition: \"end\",\n class: \"wby-pr-[calc(theme(padding.xxl)+theme(padding.xs)-theme(borderWidth.sm))]\"\n },\n {\n size: \"xl\",\n iconPosition: \"both\",\n class: [\n \"wby-pl-[calc(theme(padding.xxl)+theme(padding.xs)-theme(borderWidth.sm))]\",\n \"wby-pr-[calc(theme(padding.xxl)+theme(padding.xs)-theme(borderWidth.sm))]\"\n ]\n },\n // Add specific classNames in case of invalid inputs: note the difference between the ghost and the other variants.\n {\n variant: \"primary\",\n invalid: true,\n class: \"!wby-border-destructive-default\"\n },\n {\n variant: \"secondary\",\n invalid: true,\n class: \"!wby-border-destructive-default\"\n },\n {\n variant: \"ghost\",\n invalid: true,\n class: \"!wby-border-destructive-subtle !wby-bg-destructive-subtle\"\n },\n {\n variant: \"ghost-negative\",\n invalid: true,\n class: \"!wby-border-destructive-default !wby-bg-destructive-subtle wby-text-neutral-primary placeholder:wby-text-neutral-dimmed\"\n }\n ],\n defaultVariants: {\n size: \"lg\",\n variant: \"primary\"\n }\n }\n);\n\ntype InputPrimitiveProps<TValue = any> = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n \"size\" | \"onChange\"\n> &\n VariantProps<typeof inputVariants> & {\n /**\n * Icon to be displayed at the start of the input field.\n */\n startIcon?: React.ReactElement<typeof BaseIcon> | React.ReactElement;\n /**\n * Icon to be displayed at the end of the input field.\n */\n endIcon?: React.ReactElement<typeof BaseIcon> | React.ReactElement;\n /**\n * Maximum length of the input field.\n */\n maxLength?: React.InputHTMLAttributes<HTMLInputElement>[\"size\"];\n /**\n * Reference to the input element.\n */\n inputRef?: React.Ref<HTMLInputElement>;\n /**\n * If true, it will pass the native `event` to the `onChange` callback\n */\n forwardEventOnChange?: boolean;\n /**\n * Callback function to be called when the Enter key is pressed.\n */\n onEnter?: InputPrimitiveProps[\"onKeyDown\"];\n /**\n * Callback function to be called when the Esc key is pressed.\n */\n onEscape?: InputPrimitiveProps[\"onKeyDown\"];\n /**\n * A callback that is executed each time a value is changed.\n */\n onChange?: (value: TValue) => void;\n /**\n * If true, will select the value in the input on focus.\n */\n autoSelect?: boolean;\n };\n\nconst getIconPosition = (\n startIcon?: InputPrimitiveProps[\"startIcon\"],\n endIcon?: InputPrimitiveProps[\"endIcon\"]\n): \"start\" | \"end\" | \"both\" | undefined => {\n if (startIcon && endIcon) {\n return \"both\";\n }\n if (startIcon) {\n return \"start\";\n }\n if (endIcon) {\n return \"end\";\n }\n return;\n};\n\nconst DecoratableInputPrimitive = ({\n autoSelect,\n className,\n disabled,\n endIcon,\n forwardEventOnChange,\n inputRef,\n invalid,\n maxLength,\n onChange: originalOnChange,\n onEnter,\n onEscape,\n onKeyDown: originalOnKeyDown,\n onFocus: originalOnFocus,\n size,\n startIcon,\n value,\n variant,\n ...props\n}: InputPrimitiveProps) => {\n const iconPosition = getIconPosition(startIcon, endIcon);\n\n const onChange = React.useCallback(\n (event: React.SyntheticEvent<HTMLInputElement>) => {\n if (!originalOnChange) {\n return;\n }\n\n // @ts-expect-error\n originalOnChange(forwardEventOnChange ? event : event.target.value);\n },\n [forwardEventOnChange, originalOnChange]\n );\n\n const onKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (typeof onEnter === \"function\" && e.key === \"Enter\") {\n onEnter(e);\n }\n\n if (typeof onEscape === \"function\" && e.key === \"Escape\") {\n onEscape(e);\n }\n\n if (typeof originalOnKeyDown === \"function\") {\n return originalOnKeyDown(e);\n }\n },\n [originalOnKeyDown, onEnter]\n );\n\n const onFocus = React.useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n if (originalOnFocus) {\n originalOnFocus(e);\n }\n\n if (autoSelect) {\n e.target.select();\n }\n },\n [originalOnFocus, autoSelect]\n );\n\n return (\n <div className={cn(\"wby-relative wby-flex wby-items-center wby-w-full\", className)}>\n {startIcon && (\n <InputIcon\n disabled={disabled}\n icon={startIcon}\n inputSize={size}\n position={\"start\"}\n />\n )}\n <input\n {...props}\n ref={inputRef}\n className={cn(inputVariants({ variant, size, iconPosition, invalid }))}\n disabled={disabled}\n size={maxLength}\n onChange={onChange}\n onKeyDown={onKeyDown}\n value={value ?? \"\"}\n onFocus={onFocus}\n />\n {endIcon && (\n <InputIcon disabled={disabled} icon={endIcon} inputSize={size} position={\"end\"} />\n )}\n </div>\n );\n};\n\nconst InputPrimitive = makeDecoratable(\"InputPrimitive\", DecoratableInputPrimitive);\n\nexport {\n InputIcon,\n InputPrimitive,\n getIconPosition,\n inputVariants,\n inputIconVariants,\n type InputIconProps,\n type InputPrimitiveProps\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,EAAE,EAAEC,GAAG,EAAqBC,eAAe;;AAEpD;AACA;AACA;A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EAAE;MACZgB,CAAC,CAACD,MAAM,CAACG,MAAM,CAAC,CAAC;IACrB;EACJ,CAAC,EACD,CAACP,eAAe,EAAEX,UAAU,CAChC,CAAC;EAED,oBACIrC,KAAA,CAAAqB,aAAA;IAAKD,SAAS,EAAEnB,EAAE,CAAC,mDAAmD,EAAEmB,SAAS;EAAE,GAC9Ec,SAAS,iBACNlC,KAAA,CAAAqB,aAAA,CAACH,SAAS;IACNL,QAAQ,EAAEA,QAAS;IACnBM,IAAI,EAAEe,SAAU;IAChB5B,SAAS,EAAEkB,IAAK;IAChBd,QAAQ,EAAE;EAAQ,CACrB,CACJ,eACDV,KAAA,CAAAqB,aAAA,UAAAmC,MAAA,CAAAC,MAAA,KACQlC,KAAK;IACTmC,GAAG,EAAEnB,QAAS;IACdnB,SAAS,EAAEnB,EAAE,CAACwB,aAAa,CAAC;MAAEC,OAAO;MAAEF,IAAI;MAAEM,YAAY;MAAEE;IAAQ,CAAC,CAAC,CAAE;IACvEnB,QAAQ,EAAEA,QAAS;IACnBW,IAAI,EAAEgB,SAAU;IAChBC,QAAQ,EAAEA,QAAS;IACnBI,SAAS,EAAEA,SAAU;IACrBI,KAAK,EAAEA,KAAK,IAAI,EAAG;IACnBF,OAAO,EAAEA;EAAQ,EACpB,CAAC,EACDZ,OAAO,iBACJnC,KAAA,CAAAqB,aAAA,CAACH,SAAS;IAACL,QAAQ,EAAEA,QAAS;IAACM,IAAI,EAAEgB,OAAQ;IAAC7B,SAAS,EAAEkB,IAAK;IAACd,QAAQ,EAAE;EAAM,CAAE,CAEpF,CAAC;AAEd,CAAC;AAED,MAAMiD,cAAc,GAAGxD,eAAe,CAAC,gBAAgB,EAAEiC,yBAAyB,CAAC;AAEnF,SACIlB,SAAS,EACTyC,cAAc,EACd1B,eAAe,EACfR,aAAa,EACbrB,iBAAiB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","cn","cva","makeDecoratable","InputIcon","icon","inputSize","className","createElement","cloneElement","props","size","inputVariants","variants","md","lg","xl","variant","primary","secondary","ghost","invalid","true","compoundVariants","class","defaultVariants","DecoratableInputPrimitive","autoSelect","disabled","endIcon","forwardEventOnChange","inputRef","maxLength","onChange","originalOnChange","onEnter","onEscape","onKeyDown","originalOnKeyDown","onFocus","originalOnFocus","startIcon","value","useCallback","event","target","e","key","select","Object","assign","ref","InputPrimitive"],"sources":["InputPrimitive.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { Icon as BaseIcon } from \"~/Icon\";\nimport { cn, cva, type VariantProps, makeDecoratable } from \"~/utils\";\n\ninterface InputIconProps extends React.HTMLAttributes<HTMLDivElement> {\n icon: React.ReactElement;\n inputSize?: VariantProps<typeof inputVariants>[\"size\"];\n}\n\nconst InputIcon = ({ icon, inputSize, className }: InputIconProps) => {\n return (\n <div className={cn(\"wby-fill-inherit\", className)}>\n {React.cloneElement(icon, {\n ...icon.props,\n size: inputSize === \"xl\" ? \"lg\" : \"sm\" // Map icon size based on the input size.\n })}\n </div>\n );\n};\n\n/**\n * Input\n *\n * We support both `disabled` and `data-disabled` as well as `focused` and `data-focused` variants\n * because these variants can be used by both input and div elements. The last one is used by `MultiAutocomplete` component,\n * where the `inputVariants` is used to style a div that wraps multiple elements (input, Tags, icons, etc.)\n */\nconst inputVariants = cva(\n [\n \"wby-relative wby-flex wby-items-center wby-gap-sm wby-w-full\",\n \"wby-border-sm wby-text-md\",\n \"has-[:disabled]:wby-cursor-not-allowed data-[disabled=true]:wby-cursor-not-allowed\"\n ],\n {\n variants: {\n size: {\n md: [\n \"wby-rounded-md\",\n \"wby-py-[calc(theme(padding.xs-plus)-theme(borderWidth.sm))] wby-px-[calc(theme(padding.sm-extra)-theme(borderWidth.sm))]\"\n ],\n lg: [\n \"wby-rounded-md\",\n \"wby-py-[calc(theme(padding.sm-plus)-theme(borderWidth.sm))] wby-px-[calc(theme(padding.sm-extra)-theme(borderWidth.sm))]\"\n ],\n xl: [\n \"wby-rounded-lg wby-leading-6\",\n \"wby-py-[calc(theme(padding.md)-theme(borderWidth.sm))] wby-px-[calc(theme(padding.md)-theme(borderWidth.sm))]\"\n ]\n },\n variant: {\n primary: [\n \"wby-bg-neutral-base wby-border-neutral-muted wby-text-neutral-strong placeholder:wby-text-neutral-dimmed wby-fill-neutral-xstrong\",\n \"hover:wby-border-neutral-strong\",\n \"focus-within:!wby-border-neutral-black\",\n \"data-[focused=true]:!wby-border-neutral-black\",\n \"has-[:disabled]:wby-bg-neutral-disabled has-[:disabled]:wby-border-neutral-muted has-[:disabled]:hover:wby-border-neutral-muted has-[:disabled]:wby-text-neutral-disabled has-[:disabled]:placeholder:wby-text-neutral-disabled has-[:disabled]:wby-fill-neutral-disabled\",\n \"data-[disabled=true]:wby-bg-neutral-disabled data-[disabled=true]:wby-border-neutral-muted data-[disabled=true]:wby-text-neutral-disabled data-[disabled=true]:placeholder:wby-text-neutral-disabled data-[disabled=true]:wby-fill-neutral-disabled\"\n ],\n secondary: [\n \"wby-bg-neutral-light wby-border-neutral-subtle wby-text-neutral-strong placeholder:wby-text-neutral-dimmed wby-fill-neutral-xstrong\",\n \"hover:wby-bg-neutral-dimmed\",\n \"focus-within:!wby-bg-neutral-base focus-within:!wby-border-neutral-black\",\n \"data-[focused=true]:!wby-bg-neutral-base data-[focused=true]:!wby-border-neutral-black\",\n \"has-[:disabled]:wby-bg-neutral-disabled has-[:disabled]:wby-text-neutral-disabled has-[:disabled]:placeholder:wby-text-neutral-disabled has-[:disabled]:wby-fill-neutral-disabled\",\n \"data-[disabled=true]:wby-bg-neutral-disabled data-[disabled=true]:wby-text-neutral-disabled data-[disabled=true]:placeholder:wby-text-neutral-disabled data-[disabled=true]:wby-fill-neutral-disabled\"\n ],\n ghost: [\n \"wby-bg-transparent wby-border-transparent wby-text-neutral-strong placeholder:wby-text-neutral-dimmed\",\n \"hover:wby-bg-neutral-dark/5\",\n \"focus-within:!wby-bg-neutral-dark/5\",\n \"data-[focused=true]:!wby-bg-neutral-dark/5\",\n \"has-[:disabled]:wby-bg-transparent has-[:disabled]:wby-text-neutral-disabled has-[:disabled]:placeholder:wby-text-neutral-disabled has-[:disabled]:wby-fill-neutral-disabled\",\n \"data-[disabled=true]:wby-bg-transparent data-[disabled=true]:wby-text-neutral-disabled data-[disabled=true]:placeholder:wby-text-neutral-disabled data-[disabled=true]:wby-fill-neutral-disabled\"\n ],\n \"ghost-negative\": [\n \"wby-bg-transparent wby-border-transparent wby-text-neutral-light/50 placeholder:wby-text-neutral-light/50 wby-fill-neutral-base/50\",\n \"hover:wby-bg-neutral-base/20\",\n \"focus-within:!wby-bg-neutral-base focus-within:!wby-text-neutral-primary focus-within:!placeholder:wby-text-neutral-dimmed focus-within:!wby-fill-neutral-xstrong\",\n \"data-[focused=true]:!wby-bg-neutral-base data-[focused=true]:!wby-text-neutral-primary data-[focused=true]:!placeholder:wby-text-neutral-dimmed data-[focused=true]:!wby-fill-neutral-xstrong\",\n \"has-[:disabled]:wby-bg-transparent has-[:disabled]:wby-text-neutral-disabled/50 has-[:disabled]:placeholder:wby-text-neutral-disabled/50\",\n \"data-[disabled=true]:wby-bg-transparent data-[disabled=true]:wby-text-neutral-disabled/50 data-[disabled=true]:placeholder:wby-text-neutral-disabled/50\"\n ]\n },\n invalid: {\n true: \"\"\n }\n },\n compoundVariants: [\n // Add specific classNames in case of invalid inputs: note the difference between the ghost and the other variants.\n {\n variant: \"primary\",\n invalid: true,\n class: \"!wby-border-destructive-default\"\n },\n {\n variant: \"secondary\",\n invalid: true,\n class: \"!wby-border-destructive-default\"\n },\n {\n variant: \"ghost\",\n invalid: true,\n class: \"!wby-border-destructive-subtle !wby-bg-destructive-subtle\"\n },\n {\n variant: \"ghost-negative\",\n invalid: true,\n class: \"!wby-border-destructive-default !wby-bg-destructive-subtle wby-text-neutral-primary placeholder:wby-text-neutral-dimmed !wby-fill-neutral-xstrong\"\n }\n ],\n defaultVariants: {\n size: \"lg\",\n variant: \"primary\"\n }\n }\n);\n\ntype InputPrimitiveProps<TValue = any> = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n \"size\" | \"onChange\"\n> &\n VariantProps<typeof inputVariants> & {\n /**\n * Icon to be displayed at the start of the input field.\n */\n startIcon?: React.ReactElement<typeof BaseIcon> | React.ReactElement;\n /**\n * Icon to be displayed at the end of the input field.\n */\n endIcon?: React.ReactElement<typeof BaseIcon> | React.ReactElement;\n /**\n * Maximum length of the input field.\n */\n maxLength?: React.InputHTMLAttributes<HTMLInputElement>[\"size\"];\n /**\n * Reference to the input element.\n */\n inputRef?: React.Ref<HTMLInputElement>;\n /**\n * If true, it will pass the native `event` to the `onChange` callback\n */\n forwardEventOnChange?: boolean;\n /**\n * Callback function to be called when the Enter key is pressed.\n */\n onEnter?: InputPrimitiveProps[\"onKeyDown\"];\n /**\n * Callback function to be called when the Esc key is pressed.\n */\n onEscape?: InputPrimitiveProps[\"onKeyDown\"];\n /**\n * A callback that is executed each time a value is changed.\n */\n onChange?: (value: TValue) => void;\n /**\n * If true, will select the value in the input on focus.\n */\n autoSelect?: boolean;\n };\n\nconst DecoratableInputPrimitive = ({\n autoSelect,\n className,\n disabled,\n endIcon,\n forwardEventOnChange,\n inputRef,\n invalid,\n maxLength,\n onChange: originalOnChange,\n onEnter,\n onEscape,\n onKeyDown: originalOnKeyDown,\n onFocus: originalOnFocus,\n size,\n startIcon,\n value,\n variant,\n ...props\n}: InputPrimitiveProps) => {\n const onChange = React.useCallback(\n (event: React.SyntheticEvent<HTMLInputElement>) => {\n if (!originalOnChange) {\n return;\n }\n\n // @ts-expect-error\n originalOnChange(forwardEventOnChange ? event : event.target.value);\n },\n [forwardEventOnChange, originalOnChange]\n );\n\n const onKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (typeof onEnter === \"function\" && e.key === \"Enter\") {\n onEnter(e);\n }\n\n if (typeof onEscape === \"function\" && e.key === \"Escape\") {\n onEscape(e);\n }\n\n if (typeof originalOnKeyDown === \"function\") {\n return originalOnKeyDown(e);\n }\n },\n [originalOnKeyDown, onEnter]\n );\n\n const onFocus = React.useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n if (originalOnFocus) {\n originalOnFocus(e);\n }\n\n if (autoSelect) {\n e.target.select();\n }\n },\n [originalOnFocus, autoSelect]\n );\n\n return (\n <div className={cn(inputVariants({ variant, size, invalid }), className)}>\n {startIcon && <InputIcon icon={startIcon} />}\n <input\n {...props}\n ref={inputRef}\n className={cn([\n \"wby-w-full wby-bg-transparent wby-border-none wby-text-md wby-peer\",\n \"focus-visible:wby-outline-none\",\n \"disabled:wby-cursor-not-allowed\",\n \"file:wby-text-sm file:wby-font-semibold\"\n ])}\n disabled={disabled}\n size={maxLength}\n onChange={onChange}\n onKeyDown={onKeyDown}\n value={value ?? \"\"}\n onFocus={onFocus}\n />\n {endIcon && <InputIcon icon={endIcon} />}\n </div>\n );\n};\n\nconst InputPrimitive = makeDecoratable(\"InputPrimitive\", DecoratableInputPrimitive);\n\nexport { InputIcon, InputPrimitive, inputVariants, type InputIconProps, type InputPrimitiveProps };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,EAAE,EAAEC,GAAG,EAAqBC,eAAe;AAOpD,MAAMC,SAAS,GAAGA,CAAC;EAAEC,IAAI;EAAEC,SAAS;EAAEC;AAA0B,CAAC,KAAK;EAClE,oBACIP,KAAA,CAAAQ,aAAA;IAAKD,SAAS,EAAEN,EAAE,CAAC,kBAAkB,EAAEM,SAAS;EAAE,gBAC7CP,KAAK,CAACS,YAAY,CAACJ,IAAI,EAAE;IACtB,GAAGA,IAAI,CAACK,KAAK;IACbC,IAAI,EAAEL,SAAS,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;EAC3C,CAAC,CACA,CAAC;AAEd,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,aAAa,GAAGV,GAAG,CACrB,CACI,8DAA8D,EAC9D,2BAA2B,EAC3B,oFAAoF,CACvF,EACD;EACIW,QAAQ,EAAE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ACD,CAACR,eAAe,EAAEb,UAAU,CAChC,CAAC;EAED,oBACI3B,KAAA,CAAAQ,aAAA;IAAKD,SAAS,EAAEN,EAAE,CAACW,aAAa,CAAC;MAAEK,OAAO;MAAEN,IAAI;MAAEU;IAAQ,CAAC,CAAC,EAAEd,SAAS;EAAE,GACpEkC,SAAS,iBAAIzC,KAAA,CAAAQ,aAAA,CAACJ,SAAS;IAACC,IAAI,EAAEoC;EAAU,CAAE,CAAC,eAC5CzC,KAAA,CAAAQ,aAAA,UAAAyC,MAAA,CAAAC,MAAA,KACQxC,KAAK;IACTyC,GAAG,EAAEpB,QAAS;IACdxB,SAAS,EAAEN,EAAE,CAAC,CACV,oEAAoE,EACpE,gCAAgC,EAChC,iCAAiC,EACjC,yCAAyC,CAC5C,CAAE;IACH2B,QAAQ,EAAEA,QAAS;IACnBjB,IAAI,EAAEqB,SAAU;IAChBC,QAAQ,EAAEA,QAAS;IACnBI,SAAS,EAAEA,SAAU;IACrBK,KAAK,EAAEA,KAAK,IAAI,EAAG;IACnBH,OAAO,EAAEA;EAAQ,EACpB,CAAC,EACDV,OAAO,iBAAI7B,KAAA,CAAAQ,aAAA,CAACJ,SAAS;IAACC,IAAI,EAAEwB;EAAQ,CAAE,CACtC,CAAC;AAEd,CAAC;AAED,MAAMuB,cAAc,GAAGjD,eAAe,CAAC,gBAAgB,EAAEuB,yBAAyB,CAAC;AAEnF,SAAStB,SAAS,EAAEgD,cAAc,EAAExC,aAAa","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import { ReactComponent as NotificationsIcon } from "@webiny/icons/notifications.svg";
|
|
3
3
|
import { ReactComponent as CalendarIcon } from "@webiny/icons/calendar_month.svg";
|
|
4
4
|
import { InputPrimitive } from "./InputPrimitive";
|
|
@@ -24,6 +24,17 @@ const meta = {
|
|
|
24
24
|
},
|
|
25
25
|
parameters: {
|
|
26
26
|
layout: "padded"
|
|
27
|
+
},
|
|
28
|
+
render: args => {
|
|
29
|
+
const [value, setValue] = useState(args.value);
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "wby-w-full"
|
|
32
|
+
}, /*#__PURE__*/React.createElement(InputPrimitive, Object.assign({}, args, {
|
|
33
|
+
value: value,
|
|
34
|
+
onChange: setValue
|
|
35
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "wby-mt-4 wby-text-center"
|
|
37
|
+
}, "Current selected value: ", /*#__PURE__*/React.createElement("pre", null, value)));
|
|
27
38
|
}
|
|
28
39
|
};
|
|
29
40
|
export default meta;
|
|
@@ -79,6 +90,7 @@ export const WithStartAndEndIcons = {
|
|
|
79
90
|
};
|
|
80
91
|
export const PrimaryVariant = {
|
|
81
92
|
args: {
|
|
93
|
+
...WithStartAndEndIcons.args,
|
|
82
94
|
variant: "primary",
|
|
83
95
|
placeholder: "Custom placeholder"
|
|
84
96
|
}
|
|
@@ -97,6 +109,7 @@ export const PrimaryVariantInvalid = {
|
|
|
97
109
|
};
|
|
98
110
|
export const SecondaryVariant = {
|
|
99
111
|
args: {
|
|
112
|
+
...WithStartAndEndIcons.args,
|
|
100
113
|
variant: "secondary",
|
|
101
114
|
placeholder: "Custom placeholder"
|
|
102
115
|
}
|
|
@@ -115,6 +128,7 @@ export const SecondaryVariantInvalid = {
|
|
|
115
128
|
};
|
|
116
129
|
export const GhostVariant = {
|
|
117
130
|
args: {
|
|
131
|
+
...WithStartAndEndIcons.args,
|
|
118
132
|
variant: "ghost",
|
|
119
133
|
placeholder: "Custom placeholder"
|
|
120
134
|
}
|
|
@@ -133,11 +147,12 @@ export const GhostVariantInvalid = {
|
|
|
133
147
|
};
|
|
134
148
|
export const GhostNegativeVariant = {
|
|
135
149
|
args: {
|
|
150
|
+
...WithStartAndEndIcons.args,
|
|
136
151
|
variant: "ghost-negative",
|
|
137
152
|
placeholder: "Custom placeholder"
|
|
138
153
|
},
|
|
139
154
|
decorators: [Story => /*#__PURE__*/React.createElement("div", {
|
|
140
|
-
className: "wby-bg-neutral-dark wby-p-xl"
|
|
155
|
+
className: "wby-bg-neutral-dark wby-text-neutral-light wby-p-xl"
|
|
141
156
|
}, /*#__PURE__*/React.createElement(Story, null))]
|
|
142
157
|
};
|
|
143
158
|
export const GhostNegativeVariantDisabled = {
|
|
@@ -146,7 +161,7 @@ export const GhostNegativeVariantDisabled = {
|
|
|
146
161
|
disabled: true
|
|
147
162
|
},
|
|
148
163
|
decorators: [Story => /*#__PURE__*/React.createElement("div", {
|
|
149
|
-
className: "wby-bg-neutral-dark wby-p-xl"
|
|
164
|
+
className: "wby-bg-neutral-dark wby-text-neutral-light wby-p-xl"
|
|
150
165
|
}, /*#__PURE__*/React.createElement(Story, null))]
|
|
151
166
|
};
|
|
152
167
|
export const GhostNegativeVariantInvalid = {
|
|
@@ -155,7 +170,7 @@ export const GhostNegativeVariantInvalid = {
|
|
|
155
170
|
invalid: true
|
|
156
171
|
},
|
|
157
172
|
decorators: [Story => /*#__PURE__*/React.createElement("div", {
|
|
158
|
-
className: "wby-bg-neutral-dark wby-p-xl"
|
|
173
|
+
className: "wby-bg-neutral-dark wby-text-neutral-light wby-p-xl"
|
|
159
174
|
}, /*#__PURE__*/React.createElement(Story, null))]
|
|
160
175
|
};
|
|
161
176
|
export const WithForwardEventOnChange = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ReactComponent","NotificationsIcon","CalendarIcon","InputPrimitive","Icon","meta","title","component","argTypes","onChange","action","onEnter","onKeyDown","type","control","options","defaultValue","parameters","layout","Default","MediumSize","args","placeholder","size","LargeSize","ExtraLargeSize","WithStartIcon","startIcon","createElement","label","icon","WithEndIcon","endIcon","WithStartAndEndIcons","PrimaryVariant","variant","PrimaryVariantDisabled","disabled","PrimaryVariantInvalid","invalid","SecondaryVariant","SecondaryVariantDisabled","SecondaryVariantInvalid","GhostVariant","GhostVariantDisabled","GhostVariantInvalid","GhostNegativeVariant","decorators","Story","className","GhostNegativeVariantDisabled","GhostNegativeVariantInvalid","WithForwardEventOnChange","forwardEventOnChange"],"sources":["InputPrimitive.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { ReactComponent as NotificationsIcon } from \"@webiny/icons/notifications.svg\";\nimport { ReactComponent as CalendarIcon } from \"@webiny/icons/calendar_month.svg\";\n\nimport { InputPrimitive } from \"./InputPrimitive\";\nimport { Icon } from \"~/Icon\";\n\nconst meta: Meta<typeof InputPrimitive> = {\n title: \"Components/Form Primitives/Input\",\n component: InputPrimitive,\n argTypes: {\n onChange: { action: \"onChange\" },\n onEnter: { action: \"onEnter\" },\n onKeyDown: { action: \"onKeyDown\" },\n type: {\n control: \"select\",\n options: [\n \"text\",\n \"number\",\n \"email\",\n \"password\",\n \"tel\",\n \"url\",\n \"search\",\n \"date\",\n \"datetime-local\",\n \"month\",\n \"week\",\n \"time\",\n \"color\",\n \"file\",\n \"checkbox\",\n \"radio\",\n \"range\",\n \"hidden\",\n \"button\",\n \"submit\",\n \"reset\",\n \"image\"\n ],\n defaultValue: \"text\"\n }\n },\n parameters: {\n layout: \"padded\"\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof InputPrimitive>;\n\nexport const Default: Story = {};\n\nexport const MediumSize: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n size: \"md\"\n }\n};\n\nexport const LargeSize: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n size: \"lg\"\n }\n};\n\nexport const ExtraLargeSize: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n size: \"xl\"\n }\n};\n\nexport const WithStartIcon: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n startIcon: <Icon label={\"Bell\"} icon={<NotificationsIcon />} />\n }\n};\n\nexport const WithEndIcon: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n endIcon: <Icon label={\"Calendar\"} icon={<CalendarIcon />} />\n }\n};\n\nexport const WithStartAndEndIcons: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n startIcon: <Icon label={\"Bell\"} icon={<NotificationsIcon />} />,\n endIcon: <Icon label={\"Calendar\"} icon={<CalendarIcon />} />\n }\n};\n\nexport const PrimaryVariant: Story = {\n args: {\n variant: \"primary\",\n placeholder: \"Custom placeholder\"\n }\n};\n\nexport const PrimaryVariantDisabled: Story = {\n args: {\n ...PrimaryVariant.args,\n disabled: true\n }\n};\n\nexport const PrimaryVariantInvalid: Story = {\n args: {\n ...PrimaryVariant.args,\n invalid: true\n }\n};\n\nexport const SecondaryVariant: Story = {\n args: {\n variant: \"secondary\",\n placeholder: \"Custom placeholder\"\n }\n};\n\nexport const SecondaryVariantDisabled: Story = {\n args: {\n ...SecondaryVariant.args,\n disabled: true\n }\n};\n\nexport const SecondaryVariantInvalid: Story = {\n args: {\n ...SecondaryVariant.args,\n invalid: true\n }\n};\n\nexport const GhostVariant: Story = {\n args: {\n variant: \"ghost\",\n placeholder: \"Custom placeholder\"\n }\n};\n\nexport const GhostVariantDisabled: Story = {\n args: {\n ...GhostVariant.args,\n disabled: true\n }\n};\n\nexport const GhostVariantInvalid: Story = {\n args: {\n ...GhostVariant.args,\n invalid: true\n }\n};\n\nexport const GhostNegativeVariant: Story = {\n args: {\n variant: \"ghost-negative\",\n placeholder: \"Custom placeholder\"\n },\n decorators: [\n Story => (\n <div className=\"wby-bg-neutral-dark wby-p-xl\">\n <Story />\n </div>\n )\n ]\n};\n\nexport const GhostNegativeVariantDisabled: Story = {\n args: {\n ...GhostNegativeVariant.args,\n disabled: true\n },\n decorators: [\n Story => (\n <div className=\"wby-bg-neutral-dark wby-p-xl\">\n <Story />\n </div>\n )\n ]\n};\n\nexport const GhostNegativeVariantInvalid: Story = {\n args: {\n ...GhostNegativeVariant.args,\n invalid: true\n },\n decorators: [\n Story => (\n <div className=\"wby-bg-neutral-dark wby-p-xl\">\n <Story />\n </div>\n )\n ]\n};\n\nexport const WithForwardEventOnChange: Story = {\n args: {\n ...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AAK,iBACDjD,KAAA,CAAA6B,aAAA;IAAKqB,SAAS,EAAC;EAA8B,gBACzClD,KAAA,CAAA6B,aAAA,CAACoB,KAAK,MAAE,CACP,CACR;AAET,CAAC;AAED,OAAO,MAAMG,2BAAkC,GAAG;EAC9C9B,IAAI,EAAE;IACF,GAAGyB,oBAAoB,CAACzB,IAAI;IAC5BkB,OAAO,EAAE;EACb,CAAC;EACDQ,UAAU,EAAE,CACRC,KAAK,iBACDjD,KAAA,CAAA6B,aAAA;IAAKqB,SAAS,EAAC;EAA8B,gBACzClD,KAAA,CAAA6B,aAAA,CAACoB,KAAK,MAAE,CACP,CACR;AAET,CAAC;AAED,OAAO,MAAMI,wBAA+B,GAAG;EAC3C/B,IAAI,EAAE;IACF,GAAGF,OAAO,CAACE,IAAI;IACfgC,oBAAoB,EAAE;EAC1B;AACJ,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useState","ReactComponent","NotificationsIcon","CalendarIcon","InputPrimitive","Icon","meta","title","component","argTypes","onChange","action","onEnter","onKeyDown","type","control","options","defaultValue","parameters","layout","render","args","value","setValue","createElement","className","Object","assign","Default","MediumSize","placeholder","size","LargeSize","ExtraLargeSize","WithStartIcon","startIcon","label","icon","WithEndIcon","endIcon","WithStartAndEndIcons","PrimaryVariant","variant","PrimaryVariantDisabled","disabled","PrimaryVariantInvalid","invalid","SecondaryVariant","SecondaryVariantDisabled","SecondaryVariantInvalid","GhostVariant","GhostVariantDisabled","GhostVariantInvalid","GhostNegativeVariant","decorators","Story","GhostNegativeVariantDisabled","GhostNegativeVariantInvalid","WithForwardEventOnChange","forwardEventOnChange"],"sources":["InputPrimitive.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { ReactComponent as NotificationsIcon } from \"@webiny/icons/notifications.svg\";\nimport { ReactComponent as CalendarIcon } from \"@webiny/icons/calendar_month.svg\";\n\nimport { InputPrimitive } from \"./InputPrimitive\";\nimport { Icon } from \"~/Icon\";\n\nconst meta: Meta<typeof InputPrimitive> = {\n title: \"Components/Form Primitives/Input\",\n component: InputPrimitive,\n argTypes: {\n onChange: { action: \"onChange\" },\n onEnter: { action: \"onEnter\" },\n onKeyDown: { action: \"onKeyDown\" },\n type: {\n control: \"select\",\n options: [\n \"text\",\n \"number\",\n \"email\",\n \"password\",\n \"tel\",\n \"url\",\n \"search\",\n \"date\",\n \"datetime-local\",\n \"month\",\n \"week\",\n \"time\",\n \"color\",\n \"file\",\n \"checkbox\",\n \"radio\",\n \"range\",\n \"hidden\",\n \"button\",\n \"submit\",\n \"reset\",\n \"image\"\n ],\n defaultValue: \"text\"\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [value, setValue] = useState(args.value);\n return (\n <div className={\"wby-w-full\"}>\n <InputPrimitive {...args} value={value} onChange={setValue} />\n <div className={\"wby-mt-4 wby-text-center\"}>\n Current selected value: <pre>{value}</pre>\n </div>\n </div>\n );\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof InputPrimitive>;\n\nexport const Default: Story = {};\n\nexport const MediumSize: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n size: \"md\"\n }\n};\n\nexport const LargeSize: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n size: \"lg\"\n }\n};\n\nexport const ExtraLargeSize: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n size: \"xl\"\n }\n};\n\nexport const WithStartIcon: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n startIcon: <Icon label={\"Bell\"} icon={<NotificationsIcon />} />\n }\n};\n\nexport const WithEndIcon: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n endIcon: <Icon label={\"Calendar\"} icon={<CalendarIcon />} />\n }\n};\n\nexport const WithStartAndEndIcons: Story = {\n args: {\n placeholder: \"Custom placeholder\",\n startIcon: <Icon label={\"Bell\"} icon={<NotificationsIcon />} />,\n endIcon: <Icon label={\"Calendar\"} icon={<CalendarIcon />} />\n }\n};\n\nexport const PrimaryVariant: Story = {\n args: {\n ...WithStartAndEndIcons.args,\n variant: \"primary\",\n placeholder: \"Custom placeholder\"\n }\n};\n\nexport const PrimaryVariantDisabled: Story = {\n args: {\n ...PrimaryVariant.args,\n disabled: true\n }\n};\n\nexport const PrimaryVariantInvalid: Story = {\n args: {\n ...PrimaryVariant.args,\n invalid: true\n }\n};\n\nexport const SecondaryVariant: Story = {\n args: {\n ...WithStartAndEndIcons.args,\n variant: \"secondary\",\n placeholder: \"Custom placeholder\"\n }\n};\n\nexport const SecondaryVariantDisabled: Story = {\n args: {\n ...SecondaryVariant.args,\n disabled: true\n }\n};\n\nexport const SecondaryVariantInvalid: Story = {\n args: {\n ...SecondaryVariant.args,\n invalid: true\n }\n};\n\nexport const GhostVariant: Story = {\n args: {\n ...WithStartAndEndIcons.args,\n variant: \"ghost\",\n placeholder: \"Custom placeholder\"\n }\n};\n\nexport const GhostVariantDisabled: Story = {\n args: {\n ...GhostVariant.args,\n disabled: true\n }\n};\n\nexport const GhostVariantInvalid: Story = {\n args: {\n ...GhostVariant.args,\n invalid: true\n }\n};\n\nexport const GhostNegativeVariant: Story = {\n args: {\n ...WithStartAndEndIcons.args,\n variant: \"ghost-negative\",\n placeholder: \"Custom placeholder\"\n },\n decorators: [\n Story => (\n <div className=\"wby-bg-neutral-dark wby-text-neutral-light wby-p-xl\">\n <Story />\n </div>\n )\n ]\n};\n\nexport const GhostNegativeVariantDisabled: Story = {\n args: {\n ...GhostNegativeVariant.args,\n disabled: true\n },\n decorators: [\n Story => (\n <div className=\"wby-bg-neutral-dark wby-text-neutral-light wby-p-xl\">\n <Story />\n </div>\n )\n ]\n};\n\nexport const GhostNegativeVariantInvalid: Story = {\n args: {\n ...GhostNegativeVariant.args,\n invalid: true\n },\n decorators: [\n Story => (\n <div className=\"wby-bg-neutral-dark wby-text-neutral-light wby-p-xl\">\n <Story />\n </div>\n )\n ]\n};\n\nexport const WithForwardEventOnChange: Story = {\n args: {\n ...Default.args,\n forward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 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { type VariantProps } from "../utils";
|
|
3
3
|
import { type LinkProps as WebinyReactRouterLinkProps } from "@webiny/react-router";
|
|
4
4
|
declare const linkVariants: (props?: ({
|
|
5
|
-
size?: "
|
|
5
|
+
size?: "sm" | "md" | "lg" | "xl" | "inherit" | null | undefined;
|
|
6
6
|
variant?: "primary" | "secondary" | "primary-negative" | "secondary-negative" | null | undefined;
|
|
7
7
|
underline?: boolean | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { IconButtonProps as IconButtonProps } from "../../Button";
|
|
2
|
+
import type { IconButtonProps as IconButtonProps } from "../../Button";
|
|
3
3
|
type ListItemActionProps = IconButtonProps;
|
|
4
4
|
declare const ListItemAction: ((props: ListItemActionProps) => React.JSX.Element) & {
|
|
5
5
|
original: (props: ListItemActionProps) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","makeDecoratable","withStaticProps","IconButton","ListItemSeparator","DecoratableListItemAction","props","createElement","Object","assign","variant","size","ListItemAction","Separator"],"sources":["ListItemAction.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils\";\nimport {
|
|
1
|
+
{"version":3,"names":["React","makeDecoratable","withStaticProps","IconButton","ListItemSeparator","DecoratableListItemAction","props","createElement","Object","assign","variant","size","ListItemAction","Separator"],"sources":["ListItemAction.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils\";\nimport type { IconButtonProps as IconButtonProps } from \"~/Button\";\nimport { IconButton } from \"~/Button\";\nimport { ListItemSeparator } from \"./ListItemSeparator\";\n\ntype ListItemActionProps = IconButtonProps;\n\nconst DecoratableListItemAction = (props: ListItemActionProps) => {\n return <IconButton variant={\"ghost\"} size={\"sm\"} {...props} />;\n};\n\nconst ListItemAction = withStaticProps(\n makeDecoratable(\"ListItemAction\", DecoratableListItemAction),\n {\n Separator: ListItemSeparator\n }\n);\n\nexport { ListItemAction, type ListItemActionProps };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,eAAe,EAAEC,eAAe;AAEzC,SAASC,UAAU;AACnB,SAASC,iBAAiB;AAI1B,MAAMC,yBAAyB,GAAIC,KAA0B,IAAK;EAC9D,oBAAON,KAAA,CAAAO,aAAA,CAACJ,UAAU,EAAAK,MAAA,CAAAC,MAAA;IAACC,OAAO,EAAE,OAAQ;IAACC,IAAI,EAAE;EAAK,GAAKL,KAAK,CAAG,CAAC;AAClE,CAAC;AAED,MAAMM,cAAc,GAAGV,eAAe,CAClCD,eAAe,CAAC,gBAAgB,EAAEI,yBAAyB,CAAC,EAC5D;EACIQ,SAAS,EAAET;AACf,CACJ,CAAC;AAED,SAASQ,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ReactComponent","DragHandleIcon","makeDecoratable","Icon","DecoratableListItemHandle","props","createElement","Object","assign","size","color","className","icon","label","ListItemHandle"],"sources":["ListItemHandle.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { ReactComponent as DragHandleIcon } from \"@webiny/icons/drag_indicator.svg\";\nimport { makeDecoratable } from \"~/utils\";\nimport {
|
|
1
|
+
{"version":3,"names":["React","ReactComponent","DragHandleIcon","makeDecoratable","Icon","DecoratableListItemHandle","props","createElement","Object","assign","size","color","className","icon","label","ListItemHandle"],"sources":["ListItemHandle.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { ReactComponent as DragHandleIcon } from \"@webiny/icons/drag_indicator.svg\";\nimport { makeDecoratable } from \"~/utils\";\nimport type { IconProps as IconProps } from \"~/Icon\";\nimport { Icon } from \"~/Icon\";\n\ninterface ListItemHandleProps extends Omit<IconProps, \"icon\" | \"label\"> {\n icon?: React.ReactElement;\n label?: string;\n}\n\nconst DecoratableListItemHandle = (props: ListItemHandleProps) => {\n return (\n <Icon\n size={\"md\"}\n color={\"neutral-light\"}\n className={\"wby-mx-xxs wby-cursor-grab\"}\n icon={<DragHandleIcon />}\n label={\"Drag handle\"}\n {...props}\n />\n );\n};\n\nconst ListItemHandle = makeDecoratable(\"ListItemHandle\", DecoratableListItemHandle);\n\nexport { ListItemHandle, type ListItemHandleProps };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,IAAIC,cAAc,QAAQ,kCAAkC;AACnF,SAASC,eAAe;AAExB,SAASC,IAAI;AAOb,MAAMC,yBAAyB,GAAIC,KAA0B,IAAK;EAC9D,oBACIN,KAAA,CAAAO,aAAA,CAACH,IAAI,EAAAI,MAAA,CAAAC,MAAA;IACDC,IAAI,EAAE,IAAK;IACXC,KAAK,EAAE,eAAgB;IACvBC,SAAS,EAAE,4BAA6B;IACxCC,IAAI,eAAEb,KAAA,CAAAO,aAAA,CAACL,cAAc,MAAE,CAAE;IACzBY,KAAK,EAAE;EAAc,GACjBR,KAAK,CACZ,CAAC;AAEV,CAAC;AAED,MAAMS,cAAc,GAAGZ,eAAe,CAAC,gBAAgB,EAAEE,yBAAyB,CAAC;AAEnF,SAASU,cAAc","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { IconProps as IconComponentProps } from "../../Icon";
|
|
2
|
+
import type { IconProps as IconComponentProps } from "../../Icon";
|
|
3
3
|
type ListItemIconProps = IconComponentProps;
|
|
4
4
|
export declare const ListItemIcon: ((props: ListItemIconProps) => React.JSX.Element) & {
|
|
5
5
|
original: (props: ListItemIconProps) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","makeDecoratable","Icon","IconComponent","DecoratableListItemIcon","props","createElement","Object","assign","size","color","ListItemIcon"],"sources":["ListItemIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable } from \"~/utils\";\nimport {
|
|
1
|
+
{"version":3,"names":["React","makeDecoratable","Icon","IconComponent","DecoratableListItemIcon","props","createElement","Object","assign","size","color","ListItemIcon"],"sources":["ListItemIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable } from \"~/utils\";\nimport type { IconProps as IconComponentProps } from \"~/Icon\";\nimport { Icon as IconComponent } from \"~/Icon\";\n\ntype ListItemIconProps = IconComponentProps;\n\nconst DecoratableListItemIcon = (props: ListItemIconProps) => {\n return <IconComponent size={\"md\"} color={\"inherit\"} {...props} />;\n};\n\nexport const ListItemIcon = makeDecoratable(\"ListItemIcon\", DecoratableListItemIcon);\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,eAAe;AAExB,SAASC,IAAI,IAAIC,aAAa;AAI9B,MAAMC,uBAAuB,GAAIC,KAAwB,IAAK;EAC1D,oBAAOL,KAAA,CAAAM,aAAA,CAACH,aAAa,EAAAI,MAAA,CAAAC,MAAA;IAACC,IAAI,EAAE,IAAK;IAACC,KAAK,EAAE;EAAU,GAAKL,KAAK,CAAG,CAAC;AACrE,CAAC;AAED,OAAO,MAAMM,YAAY,GAAGV,eAAe,CAAC,cAAc,EAAEG,uBAAuB,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { LoaderProps } from "./Loader";
|
|
2
|
+
import type { LoaderProps } from "./Loader";
|
|
3
3
|
type OverlayLoaderProps = LoaderProps;
|
|
4
4
|
declare const OverlayLoader: (({ className, size, ...props }: OverlayLoaderProps) => React.JSX.Element) & {
|
|
5
5
|
original: ({ className, size, ...props }: OverlayLoaderProps) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Loader","cn","makeDecoratable","DecoratableOverlayLoader","className","size","props","createElement","Object","assign","OverlayLoader"],"sources":["OverlayLoader.tsx"],"sourcesContent":["import React from \"react\";\nimport { Loader
|
|
1
|
+
{"version":3,"names":["React","Loader","cn","makeDecoratable","DecoratableOverlayLoader","className","size","props","createElement","Object","assign","OverlayLoader"],"sources":["OverlayLoader.tsx"],"sourcesContent":["import React from \"react\";\nimport type { LoaderProps } from \"./Loader\";\nimport { Loader } from \"./Loader\";\nimport { cn, makeDecoratable } from \"~/utils\";\n\ntype OverlayLoaderProps = LoaderProps;\n\nconst DecoratableOverlayLoader = ({ className, size = \"lg\", ...props }: OverlayLoaderProps) => {\n return (\n <div\n className={cn(\n \"wby-w-full wby-h-full wby-absolute wby-inset-0 wby-bg-neutral-base/80 wby-flex wby-items-center wby-justify-center wby-z-30\",\n className\n )}\n >\n <Loader {...props} size={size} />\n </div>\n );\n};\n\nconst OverlayLoader = makeDecoratable(\"OverlayLoader\", DecoratableOverlayLoader);\n\nexport { OverlayLoader, type OverlayLoaderProps };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,MAAM;AACf,SAASC,EAAE,EAAEC,eAAe;AAI5B,MAAMC,wBAAwB,GAAGA,CAAC;EAAEC,SAAS;EAAEC,IAAI,GAAG,IAAI;EAAE,GAAGC;AAA0B,CAAC,KAAK;EAC3F,oBACIP,KAAA,CAAAQ,aAAA;IACIH,SAAS,EAAEH,EAAE,CACT,6HAA6H,EAC7HG,SACJ;EAAE,gBAEFL,KAAA,CAAAQ,aAAA,CAACP,MAAM,EAAAQ,MAAA,CAAAC,MAAA,KAAKH,KAAK;IAAED,IAAI,EAAEA;EAAK,EAAE,CAC/B,CAAC;AAEd,CAAC;AAED,MAAMK,aAAa,GAAGR,eAAe,CAAC,eAAe,EAAEC,wBAAwB,CAAC;AAEhF,SAASO,aAAa","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { MultiAutoCompletePrimitiveProps } from "./primitives";
|
|
3
|
-
import { FormComponentProps } from "../FormComponent";
|
|
2
|
+
import type { MultiAutoCompletePrimitiveProps } from "./primitives";
|
|
3
|
+
import type { FormComponentProps } from "../FormComponent";
|
|
4
4
|
type MultiAutoCompleteProps = MultiAutoCompletePrimitiveProps & FormComponentProps;
|
|
5
5
|
declare const MultiAutoComplete: (({ label, description, note, required, disabled, validation, ...props }: MultiAutoCompleteProps) => React.JSX.Element) & {
|
|
6
6
|
original: ({ label, description, note, required, disabled, validation, ...props }: MultiAutoCompleteProps) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","useState","useEffect","useRef","makeDecoratable","MultiAutoCompletePrimitive","FormComponentDescription","FormComponentErrorMessage","FormComponentLabel","FormComponentNote","DecoratableMultiAutoComplete","label","description","note","required","disabled","validation","props","isValid","validationIsValid","message","validationMessage","invalid","inputRef","inputId","setInputId","current","id","createElement","className","text","htmlFor","Object","assign","MultiAutoComplete"],"sources":["MultiAutoComplete.tsx"],"sourcesContent":["import React, { useMemo, useState, useEffect, useRef } from \"react\";\nimport { makeDecoratable } from \"~/utils\";\nimport {
|
|
1
|
+
{"version":3,"names":["React","useMemo","useState","useEffect","useRef","makeDecoratable","MultiAutoCompletePrimitive","FormComponentDescription","FormComponentErrorMessage","FormComponentLabel","FormComponentNote","DecoratableMultiAutoComplete","label","description","note","required","disabled","validation","props","isValid","validationIsValid","message","validationMessage","invalid","inputRef","inputId","setInputId","current","id","createElement","className","text","htmlFor","Object","assign","MultiAutoComplete"],"sources":["MultiAutoComplete.tsx"],"sourcesContent":["import React, { useMemo, useState, useEffect, useRef } from \"react\";\nimport { makeDecoratable } from \"~/utils\";\nimport type { MultiAutoCompletePrimitiveProps } from \"./primitives\";\nimport { MultiAutoCompletePrimitive } from \"./primitives\";\nimport type { FormComponentProps } from \"~/FormComponent\";\nimport {\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel,\n FormComponentNote\n} from \"~/FormComponent\";\n\ntype MultiAutoCompleteProps = MultiAutoCompletePrimitiveProps & FormComponentProps;\n\nconst DecoratableMultiAutoComplete = ({\n label,\n description,\n note,\n required,\n disabled,\n validation,\n ...props\n}: MultiAutoCompleteProps) => {\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n const invalid = useMemo(() => validationIsValid === false, [validationIsValid]);\n\n // Retrieve the internally generated ID from cmdk's <Command.Input> to sync with the external <label>\n const inputRef = useRef<HTMLInputElement>(null);\n const [inputId, setInputId] = useState<string>();\n\n useEffect(() => {\n if (inputRef.current?.id) {\n setInputId(inputRef.current.id);\n }\n }, []);\n\n return (\n <div className={\"wby-w-full\"}>\n <FormComponentLabel\n text={label}\n required={required}\n disabled={disabled}\n invalid={invalid}\n htmlFor={inputId}\n />\n <FormComponentDescription text={description} disabled={disabled} />\n <MultiAutoCompletePrimitive\n {...props}\n inputRef={inputRef}\n label={label}\n disabled={disabled}\n invalid={invalid}\n />\n <FormComponentErrorMessage\n text={validationMessage}\n invalid={invalid}\n disabled={disabled}\n />\n <FormComponentNote text={note} disabled={disabled} />\n </div>\n );\n};\n\nconst MultiAutoComplete = makeDecoratable(\"MultiAutoComplete\", DecoratableMultiAutoComplete);\n\nexport { MultiAutoComplete };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACnE,SAASC,eAAe;AAExB,SAASC,0BAA0B;AAEnC,SACIC,wBAAwB,EACxBC,yBAAyB,EACzBC,kBAAkB,EAClBC,iBAAiB;AAKrB,MAAMC,4BAA4B,GAAGA,CAAC;EAClCC,KAAK;EACLC,WAAW;EACXC,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACRC,UAAU;EACV,GAAGC;AACiB,CAAC,KAAK;EAC1B,MAAM;IAAEC,OAAO,EAAEC,iBAAiB;IAAEC,OAAO,EAAEC;EAAkB,CAAC,GAAGL,UAAU,IAAI,CAAC,CAAC;EACnF,MAAMM,OAAO,GAAGtB,OAAO,CAAC,MAAMmB,iBAAiB,KAAK,KAAK,EAAE,CAACA,iB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C;AAE5F,SAASwB,iBAAiB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MultiAutoCompleteOptionDto } from "./MultiAutoCompleteOptionDto";
|
|
1
|
+
import type { MultiAutoCompleteOptionDto } from "./MultiAutoCompleteOptionDto";
|
|
2
2
|
export type MultiAutoCompleteOption = MultiAutoCompleteOptionDto | string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["MultiAutoCompleteOption.ts"],"sourcesContent":["import { MultiAutoCompleteOptionDto } from \"./MultiAutoCompleteOptionDto\";\n\nexport type MultiAutoCompleteOption = MultiAutoCompleteOptionDto | string;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["MultiAutoCompleteOption.ts"],"sourcesContent":["import type { MultiAutoCompleteOptionDto } from \"./MultiAutoCompleteOptionDto\";\n\nexport type MultiAutoCompleteOption = MultiAutoCompleteOptionDto | string;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CommandOptionDto } from "../../Command";
|
|
1
|
+
import type { CommandOptionDto } from "../../Command";
|
|
2
2
|
export type MultiAutoCompleteOptionDto = CommandOptionDto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["MultiAutoCompleteOptionDto.ts"],"sourcesContent":["import { CommandOptionDto } from \"~/Command\";\n\nexport type MultiAutoCompleteOptionDto = CommandOptionDto;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["MultiAutoCompleteOptionDto.ts"],"sourcesContent":["import type { CommandOptionDto } from \"~/Command\";\n\nexport type MultiAutoCompleteOptionDto = CommandOptionDto;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { InputPrimitiveProps } from "../../Input";
|
|
3
|
-
import { MultiAutoCompleteOption } from "../domains";
|
|
4
|
-
import { Icon } from "../../Icon";
|
|
2
|
+
import type { InputPrimitiveProps } from "../../Input";
|
|
3
|
+
import type { MultiAutoCompleteOption } from "../domains";
|
|
4
|
+
import type { Icon } from "../../Icon";
|
|
5
5
|
interface MultiAutoCompletePrimitiveProps {
|
|
6
6
|
/**
|
|
7
7
|
* Allows free input of values not present in the options.
|
|
@@ -58,6 +58,7 @@ const DecoratableMultiAutoCompletePrimitive = props => {
|
|
|
58
58
|
startIcon: props.startIcon,
|
|
59
59
|
endIcon: /*#__PURE__*/React.createElement(MultiAutoCompleteInputIcons, {
|
|
60
60
|
inputSize: props.size,
|
|
61
|
+
inputVariant: props.variant,
|
|
61
62
|
displayResetAction: !vm.selectedOptionsVm.empty && vm.inputVm.displayResetAction,
|
|
62
63
|
disabled: props.disabled,
|
|
63
64
|
loading: props.loading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Command","PopoverPrimitive","makeDecoratable","useMultiAutoComplete","MultiAutoCompleteInput","MultiAutoCompleteInputIcons","MultiAutoCompleteList","DecoratableMultiAutoCompletePrimitive","props","vm","setListOpenState","setSelectedOption","searchOption","removeSelectedOption","resetSelectedOptions","createOption","handleKeyDown","useCallback","event","disabled","optionsListVm","open","key","toLowerCase","handleSelectOption","value","handleCreateOption","createElement","onOpenChange","label","String","onKeyDown","Trigger","asChild","inputRef","inputVm","placeholder","changeValue","closeList","openList","variant","size","invalid","selectedOptionRenderer","selectedOptions","selectedOptionsVm","options","startIcon","endIcon","inputSize","displayResetAction","empty","loading","onResetValue","Content","style","width","onOpenAutoFocus","e","preventDefault","emptyMessage","loadingMessage","onOptionCreate","onOptionSelect","optionRenderer","temporaryOption","temporaryOptionVm","option","MultiAutoCompletePrimitive"],"sources":["MultiAutoCompletePrimitive.tsx"],"sourcesContent":["import React, { KeyboardEvent } from \"react\";\nimport { Command } from \"~/Command\";\nimport { PopoverPrimitive } from \"~/Popover\";\nimport { InputPrimitiveProps } from \"~/Input\";\nimport { makeDecoratable } from \"~/utils\";\nimport { useMultiAutoComplete } from \"./useMultiAutoComplete\";\nimport {\n MultiAutoCompleteInput,\n MultiAutoCompleteInputIcons,\n MultiAutoCompleteList\n} from \"./components\";\nimport { MultiAutoCompleteOption } from \"../domains\";\nimport { Icon } from \"~/Icon\";\n\ninterface MultiAutoCompletePrimitiveProps {\n /**\n * Allows free input of values not present in the options.\n */\n allowFreeInput?: boolean;\n /**\n * Indicates if the reset action should be displayed.\n */\n displayResetAction?: boolean;\n /**\n * Indicates if the field is disabled.\n */\n disabled?: boolean;\n /**\n * Message to display when there are no options.\n */\n emptyMessage?: React.ReactNode;\n /**\n * Indicates if the input field is invalid.\n * Refer to `InputPrimitiveProps[\"invalid\"]` for possible values.\n */\n invalid?: InputPrimitiveProps[\"invalid\"];\n /**\n * Message to display when there are no options loaded or selected.\n * Use it to invite the user to interact with the autocomplete by typing a value.\n */\n initialMessage?: React.ReactNode;\n /**\n * Reference to the input element.\n */\n inputRef?: React.Ref<HTMLInputElement>;\n /**\n * Accessible label for the command menu. Not shown visibly.\n */\n label?: React.ReactNode;\n /**\n * Indicates if the autocomplete is loading options.\n */\n loading?: boolean;\n /**\n * Message to display while loading options.\n */\n loadingMessage?: React.ReactNode;\n /**\n * Callback triggered when the open state changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Callback triggered when a value has been searched by the user.\n */\n onValueSearch?: (value: string) => void;\n /**\n * Callback triggered when the values change.\n */\n onValuesChange: (values: string[]) => void;\n /**\n * Callback triggered to reset the values.\n */\n onValuesReset?: () => void;\n /**\n * List of options for the autocomplete.\n */\n options?: MultiAutoCompleteOption[];\n /**\n * Custom renderer for the options.\n */\n optionRenderer?: (item: any, index: number) => React.ReactNode;\n /**\n * Placeholder text for the input field.\n */\n placeholder?: string;\n /**\n * Size of the input field.\n * Refer to `InputPrimitiveProps[\"size\"]` for possible values.\n */\n size?: InputPrimitiveProps[\"size\"];\n /**\n * Custom renderer for the selected options.\n */\n selectedOptionRenderer?: (item: any, index: number) => React.ReactNode;\n /**\n * Icon to be displayed at the start of the input field.\n */\n startIcon?: React.ReactElement<typeof Icon> | React.ReactElement;\n /**\n * Ensures that each value is unique.\n */\n uniqueValues?: boolean;\n /**\n * Variant of the input field.\n * Refer to `InputPrimitiveProps[\"variant\"]` for possible values.\n */\n variant?: InputPrimitiveProps[\"variant\"];\n /**\n * Optional selected items.\n */\n values?: string[];\n}\n\nconst DecoratableMultiAutoCompletePrimitive = (props: MultiAutoCompletePrimitiveProps) => {\n const {\n vm,\n setListOpenState,\n setSelectedOption,\n searchOption,\n removeSelectedOption,\n resetSelectedOptions,\n createOption\n } = useMultiAutoComplete(props);\n\n const handleKeyDown = React.useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (props.disabled) {\n return;\n }\n\n if (!vm.optionsListVm.open) {\n setListOpenState(true);\n }\n\n if (event.key.toLowerCase() === \"escape\") {\n setListOpenState(false);\n }\n },\n [props.disabled, setListOpenState, setSelectedOption, vm.optionsListVm.open]\n );\n\n const handleSelectOption = React.useCallback(\n (value: string) => {\n setSelectedOption(value);\n setListOpenState(false);\n },\n [setSelectedOption, setListOpenState]\n );\n\n const handleCreateOption = React.useCallback(\n (value: string) => {\n createOption(value);\n setListOpenState(false);\n },\n [createOption, setListOpenState]\n );\n\n return (\n <PopoverPrimitive open={vm.optionsListVm.open} onOpenChange={() => setListOpenState(true)}>\n <Command label={String(props.label)} onKeyDown={handleKeyDown}>\n <PopoverPrimitive.Trigger asChild>\n <span>\n <MultiAutoCompleteInput\n inputRef={props.inputRef}\n value={vm.inputVm.value}\n placeholder={vm.inputVm.placeholder}\n changeValue={searchOption}\n closeList={() => setListOpenState(false)}\n openList={() => setListOpenState(true)}\n variant={props.variant}\n size={props.size}\n invalid={props.invalid}\n removeSelectedOption={removeSelectedOption}\n selectedOptionRenderer={props.selectedOptionRenderer}\n selectedOptions={vm.selectedOptionsVm.options}\n disabled={props.disabled}\n startIcon={props.startIcon}\n endIcon={\n <MultiAutoCompleteInputIcons\n inputSize={props.size}\n displayResetAction={\n !vm.selectedOptionsVm.empty && vm.inputVm.displayResetAction\n }\n disabled={props.disabled}\n loading={props.loading}\n onResetValue={resetSelectedOptions}\n onOpenChange={() => setListOpenState(!vm.optionsListVm.open)}\n />\n }\n />\n </span>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Content\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n onOpenAutoFocus={e => e.preventDefault()}\n >\n <MultiAutoCompleteList\n emptyMessage={vm.optionsListVm.emptyMessage}\n empty={vm.optionsListVm.empty}\n loading={props.loading}\n loadingMessage={vm.optionsListVm.loadingMessage}\n onOptionCreate={handleCreateOption}\n onOptionSelect={handleSelectOption}\n optionRenderer={props.optionRenderer}\n options={vm.optionsListVm.options}\n temporaryOption={vm.temporaryOptionVm.option}\n />\n </PopoverPrimitive.Content>\n </Command>\n </PopoverPrimitive>\n );\n};\n\nconst MultiAutoCompletePrimitive = makeDecoratable(\n \"MultiAutoCompletePrimitive\",\n DecoratableMultiAutoCompletePrimitive\n);\n\nexport { MultiAutoCompletePrimitive, type MultiAutoCompletePrimitiveProps };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAyB,OAAO;AAC5C,SAASC,OAAO;AAChB,SAASC,gBAAgB;AAEzB,SAASC,eAAe;AACxB,SAASC,oBAAoB;AAC7B,SACIC,sBAAsB,EACtBC,2BAA2B,EAC3BC,qBAAqB;AAwGzB,MAAMC,qCAAqC,GAAIC,KAAsC,IAAK;EACtF,MAAM;IACFC,EAAE;IACFC,gBAAgB;IAChBC,iBAAiB;IACjBC,YAAY;IACZC,oBAAoB;IACpBC,oBAAoB;IACpBC;EACJ,CAAC,GAAGZ,oBAAoB,CAACK,KAAK,CAAC;EAE/B,MAAMQ,aAAa,GAAGjB,KAAK,CAACkB,WAAW,CAClCC,KAAoC,IAAK;IACtC,IAAIV,KAAK,CAACW,QAAQ,EAAE;MAChB;IACJ;IAEA,IAAI,CAACV,EAAE,CAACW,aAAa,CAACC,IA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D,EAAE,CAACW,aAAa,CAACwC,YAAa;IAC5CT,KAAK,EAAE1C,EAAE,CAACW,aAAa,CAAC+B,KAAM;IAC9BC,OAAO,EAAE5C,KAAK,CAAC4C,OAAQ;IACvBS,cAAc,EAAEpD,EAAE,CAACW,aAAa,CAACyC,cAAe;IAChDC,cAAc,EAAEpC,kBAAmB;IACnCqC,cAAc,EAAEvC,kBAAmB;IACnCwC,cAAc,EAAExD,KAAK,CAACwD,cAAe;IACrClB,OAAO,EAAErC,EAAE,CAACW,aAAa,CAAC0B,OAAQ;IAClCmB,eAAe,EAAExD,EAAE,CAACyD,iBAAiB,CAACC;EAAO,CAChD,CACqB,CACrB,CACK,CAAC;AAE3B,CAAC;AAED,MAAMC,0BAA0B,GAAGlE,eAAe,CAC9C,4BAA4B,EAC5BK,qCACJ,CAAC;AAED,SAAS6D,0BAA0B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Command","PopoverPrimitive","makeDecoratable","useMultiAutoComplete","MultiAutoCompleteInput","MultiAutoCompleteInputIcons","MultiAutoCompleteList","DecoratableMultiAutoCompletePrimitive","props","vm","setListOpenState","setSelectedOption","searchOption","removeSelectedOption","resetSelectedOptions","createOption","handleKeyDown","useCallback","event","disabled","optionsListVm","open","key","toLowerCase","handleSelectOption","value","handleCreateOption","createElement","onOpenChange","label","String","onKeyDown","Trigger","asChild","inputRef","inputVm","placeholder","changeValue","closeList","openList","variant","size","invalid","selectedOptionRenderer","selectedOptions","selectedOptionsVm","options","startIcon","endIcon","inputSize","inputVariant","displayResetAction","empty","loading","onResetValue","Content","style","width","onOpenAutoFocus","e","preventDefault","emptyMessage","loadingMessage","onOptionCreate","onOptionSelect","optionRenderer","temporaryOption","temporaryOptionVm","option","MultiAutoCompletePrimitive"],"sources":["MultiAutoCompletePrimitive.tsx"],"sourcesContent":["import type { KeyboardEvent } from \"react\";\nimport React from \"react\";\nimport { Command } from \"~/Command\";\nimport { PopoverPrimitive } from \"~/Popover\";\nimport type { InputPrimitiveProps } from \"~/Input\";\nimport { makeDecoratable } from \"~/utils\";\nimport { useMultiAutoComplete } from \"./useMultiAutoComplete\";\nimport {\n MultiAutoCompleteInput,\n MultiAutoCompleteInputIcons,\n MultiAutoCompleteList\n} from \"./components\";\nimport type { MultiAutoCompleteOption } from \"../domains\";\nimport type { Icon } from \"~/Icon\";\n\ninterface MultiAutoCompletePrimitiveProps {\n /**\n * Allows free input of values not present in the options.\n */\n allowFreeInput?: boolean;\n /**\n * Indicates if the reset action should be displayed.\n */\n displayResetAction?: boolean;\n /**\n * Indicates if the field is disabled.\n */\n disabled?: boolean;\n /**\n * Message to display when there are no options.\n */\n emptyMessage?: React.ReactNode;\n /**\n * Indicates if the input field is invalid.\n * Refer to `InputPrimitiveProps[\"invalid\"]` for possible values.\n */\n invalid?: InputPrimitiveProps[\"invalid\"];\n /**\n * Message to display when there are no options loaded or selected.\n * Use it to invite the user to interact with the autocomplete by typing a value.\n */\n initialMessage?: React.ReactNode;\n /**\n * Reference to the input element.\n */\n inputRef?: React.Ref<HTMLInputElement>;\n /**\n * Accessible label for the command menu. Not shown visibly.\n */\n label?: React.ReactNode;\n /**\n * Indicates if the autocomplete is loading options.\n */\n loading?: boolean;\n /**\n * Message to display while loading options.\n */\n loadingMessage?: React.ReactNode;\n /**\n * Callback triggered when the open state changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Callback triggered when a value has been searched by the user.\n */\n onValueSearch?: (value: string) => void;\n /**\n * Callback triggered when the values change.\n */\n onValuesChange: (values: string[]) => void;\n /**\n * Callback triggered to reset the values.\n */\n onValuesReset?: () => void;\n /**\n * List of options for the autocomplete.\n */\n options?: MultiAutoCompleteOption[];\n /**\n * Custom renderer for the options.\n */\n optionRenderer?: (item: any, index: number) => React.ReactNode;\n /**\n * Placeholder text for the input field.\n */\n placeholder?: string;\n /**\n * Size of the input field.\n * Refer to `InputPrimitiveProps[\"size\"]` for possible values.\n */\n size?: InputPrimitiveProps[\"size\"];\n /**\n * Custom renderer for the selected options.\n */\n selectedOptionRenderer?: (item: any, index: number) => React.ReactNode;\n /**\n * Icon to be displayed at the start of the input field.\n */\n startIcon?: React.ReactElement<typeof Icon> | React.ReactElement;\n /**\n * Ensures that each value is unique.\n */\n uniqueValues?: boolean;\n /**\n * Variant of the input field.\n * Refer to `InputPrimitiveProps[\"variant\"]` for possible values.\n */\n variant?: InputPrimitiveProps[\"variant\"];\n /**\n * Optional selected items.\n */\n values?: string[];\n}\n\nconst DecoratableMultiAutoCompletePrimitive = (props: MultiAutoCompletePrimitiveProps) => {\n const {\n vm,\n setListOpenState,\n setSelectedOption,\n searchOption,\n removeSelectedOption,\n resetSelectedOptions,\n createOption\n } = useMultiAutoComplete(props);\n\n const handleKeyDown = React.useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (props.disabled) {\n return;\n }\n\n if (!vm.optionsListVm.open) {\n setListOpenState(true);\n }\n\n if (event.key.toLowerCase() === \"escape\") {\n setListOpenState(false);\n }\n },\n [props.disabled, setListOpenState, setSelectedOption, vm.optionsListVm.open]\n );\n\n const handleSelectOption = React.useCallback(\n (value: string) => {\n setSelectedOption(value);\n setListOpenState(false);\n },\n [setSelectedOption, setListOpenState]\n );\n\n const handleCreateOption = React.useCallback(\n (value: string) => {\n createOption(value);\n setListOpenState(false);\n },\n [createOption, setListOpenState]\n );\n\n return (\n <PopoverPrimitive open={vm.optionsListVm.open} onOpenChange={() => setListOpenState(true)}>\n <Command label={String(props.label)} onKeyDown={handleKeyDown}>\n <PopoverPrimitive.Trigger asChild>\n <span>\n <MultiAutoCompleteInput\n inputRef={props.inputRef}\n value={vm.inputVm.value}\n placeholder={vm.inputVm.placeholder}\n changeValue={searchOption}\n closeList={() => setListOpenState(false)}\n openList={() => setListOpenState(true)}\n variant={props.variant}\n size={props.size}\n invalid={props.invalid}\n removeSelectedOption={removeSelectedOption}\n selectedOptionRenderer={props.selectedOptionRenderer}\n selectedOptions={vm.selectedOptionsVm.options}\n disabled={props.disabled}\n startIcon={props.startIcon}\n endIcon={\n <MultiAutoCompleteInputIcons\n inputSize={props.size}\n inputVariant={props.variant}\n displayResetAction={\n !vm.selectedOptionsVm.empty && vm.inputVm.displayResetAction\n }\n disabled={props.disabled}\n loading={props.loading}\n onResetValue={resetSelectedOptions}\n onOpenChange={() => setListOpenState(!vm.optionsListVm.open)}\n />\n }\n />\n </span>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Content\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n onOpenAutoFocus={e => e.preventDefault()}\n >\n <MultiAutoCompleteList\n emptyMessage={vm.optionsListVm.emptyMessage}\n empty={vm.optionsListVm.empty}\n loading={props.loading}\n loadingMessage={vm.optionsListVm.loadingMessage}\n onOptionCreate={handleCreateOption}\n onOptionSelect={handleSelectOption}\n optionRenderer={props.optionRenderer}\n options={vm.optionsListVm.options}\n temporaryOption={vm.temporaryOptionVm.option}\n />\n </PopoverPrimitive.Content>\n </Command>\n </PopoverPrimitive>\n );\n};\n\nconst MultiAutoCompletePrimitive = makeDecoratable(\n \"MultiAutoCompletePrimitive\",\n DecoratableMultiAutoCompletePrimitive\n);\n\nexport { MultiAutoCompletePrimitive, type MultiAutoCompletePrimitiveProps };\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO;AAChB,SAASC,gBAAgB;AAEzB,SAASC,eAAe;AACxB,SAASC,oBAAoB;AAC7B,SACIC,sBAAsB,EACtBC,2BAA2B,EAC3BC,qBAAqB;AAwGzB,MAAMC,qCAAqC,GAAIC,KAAsC,IAAK;EACtF,MAAM;IACFC,EAAE;IACFC,gBAAgB;IAChBC,iBAAiB;IACjBC,YAAY;IACZC,oBAAoB;IACpBC,oBAAoB;IACpBC;EACJ,CAAC,GAAGZ,oBAAoB,CAACK,KAAK,CAAC;EAE/B,MAAMQ,aAAa,GAAGjB,KAAK,CAACkB,WAAW,CAClCC,KAAoC,IAAK;IACtC,IAAIV,KAAK,CAACW,QAAQ,EAAE;MACh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CAAC,CAACC,cAAc,CAAC;EAAE,gBAEzC7D,KAAA,CAAA4B,aAAA,CAACrB,qBAAqB;IAClBuD,YAAY,EAAEpD,EAAE,CAACW,aAAa,CAACyC,YAAa;IAC5CT,KAAK,EAAE3C,EAAE,CAACW,aAAa,CAACgC,KAAM;IAC9BC,OAAO,EAAE7C,KAAK,CAAC6C,OAAQ;IACvBS,cAAc,EAAErD,EAAE,CAACW,aAAa,CAAC0C,cAAe;IAChDC,cAAc,EAAErC,kBAAmB;IACnCsC,cAAc,EAAExC,kBAAmB;IACnCyC,cAAc,EAAEzD,KAAK,CAACyD,cAAe;IACrCnB,OAAO,EAAErC,EAAE,CAACW,aAAa,CAAC0B,OAAQ;IAClCoB,eAAe,EAAEzD,EAAE,CAAC0D,iBAAiB,CAACC;EAAO,CAChD,CACqB,CACrB,CACK,CAAC;AAE3B,CAAC;AAED,MAAMC,0BAA0B,GAAGnE,eAAe,CAC9C,4BAA4B,EAC5BK,qCACJ,CAAC;AAED,SAAS8D,0BAA0B","ignoreList":[]}
|
|
@@ -19,6 +19,9 @@ export declare const SecondaryVariantInvalid: Story;
|
|
|
19
19
|
export declare const GhostVariant: Story;
|
|
20
20
|
export declare const GhostVariantDisabled: Story;
|
|
21
21
|
export declare const GhostVariantInvalid: Story;
|
|
22
|
+
export declare const GhostNegativeVariant: Story;
|
|
23
|
+
export declare const GhostNegativeVariantDisabled: Story;
|
|
24
|
+
export declare const GhostNegativeVariantInvalid: Story;
|
|
22
25
|
export declare const WithPredefinedValue: Story;
|
|
23
26
|
export declare const WithCustomPlaceholder: Story;
|
|
24
27
|
export declare const WithCustomEmptyMessage: Story;
|
|
@@ -32,7 +32,7 @@ const meta = {
|
|
|
32
32
|
onValuesChange: setValues
|
|
33
33
|
})), /*#__PURE__*/React.createElement("div", {
|
|
34
34
|
className: "wby-mt-4 wby-text-center"
|
|
35
|
-
}, "Current selected values: ", values));
|
|
35
|
+
}, "Current selected values: ", values?.join(",")));
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
export default meta;
|
|
@@ -134,10 +134,84 @@ export const GhostVariantInvalid = {
|
|
|
134
134
|
invalid: true
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
|
+
export const GhostNegativeVariant = {
|
|
138
|
+
args: {
|
|
139
|
+
...Default.args,
|
|
140
|
+
variant: "ghost-negative",
|
|
141
|
+
placeholder: "Custom placeholder"
|
|
142
|
+
},
|
|
143
|
+
decorators: [Story => /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
className: "wby-bg-neutral-dark wby-text-neutral-light wby-p-xl"
|
|
145
|
+
}, /*#__PURE__*/React.createElement(Story, null))]
|
|
146
|
+
};
|
|
147
|
+
export const GhostNegativeVariantDisabled = {
|
|
148
|
+
args: {
|
|
149
|
+
...GhostNegativeVariant.args,
|
|
150
|
+
disabled: true
|
|
151
|
+
},
|
|
152
|
+
decorators: [Story => /*#__PURE__*/React.createElement("div", {
|
|
153
|
+
className: "wby-bg-neutral-dark wby-text-neutral-light wby-p-xl"
|
|
154
|
+
}, /*#__PURE__*/React.createElement(Story, null))]
|
|
155
|
+
};
|
|
156
|
+
export const GhostNegativeVariantInvalid = {
|
|
157
|
+
args: {
|
|
158
|
+
...GhostNegativeVariant.args,
|
|
159
|
+
invalid: true
|
|
160
|
+
},
|
|
161
|
+
decorators: [Story => /*#__PURE__*/React.createElement("div", {
|
|
162
|
+
className: "wby-bg-neutral-dark wby-text-neutral-light wby-p-xl"
|
|
163
|
+
}, /*#__PURE__*/React.createElement(Story, null))]
|
|
164
|
+
};
|
|
137
165
|
export const WithPredefinedValue = {
|
|
138
166
|
args: {
|
|
139
167
|
...Default.args,
|
|
140
|
-
|
|
168
|
+
options: [{
|
|
169
|
+
label: "Eastern Standard Time (EST)",
|
|
170
|
+
value: "est"
|
|
171
|
+
}, {
|
|
172
|
+
label: "Central Standard Time (CST)",
|
|
173
|
+
value: "cst"
|
|
174
|
+
}, {
|
|
175
|
+
label: "Pacific Standard Time (PST)",
|
|
176
|
+
value: "pst"
|
|
177
|
+
}, {
|
|
178
|
+
label: "Greenwich Mean Time (GMT)",
|
|
179
|
+
value: "gmt"
|
|
180
|
+
}, {
|
|
181
|
+
label: "Central European Time (CET)",
|
|
182
|
+
value: "cet"
|
|
183
|
+
}, {
|
|
184
|
+
label: "Central Africa Time (CAT)",
|
|
185
|
+
value: "cat"
|
|
186
|
+
}, {
|
|
187
|
+
label: "India Standard Time (IST)",
|
|
188
|
+
value: "ist"
|
|
189
|
+
}, {
|
|
190
|
+
label: "China Standard Time (CST)",
|
|
191
|
+
value: "cst_china"
|
|
192
|
+
}, {
|
|
193
|
+
label: "Japan Standard Time (JST)",
|
|
194
|
+
value: "jst"
|
|
195
|
+
}, {
|
|
196
|
+
label: "Australian Western Standard Time (AWST)",
|
|
197
|
+
value: "awst"
|
|
198
|
+
}, {
|
|
199
|
+
label: "New Zealand Standard Time (NZST)",
|
|
200
|
+
value: "nzst"
|
|
201
|
+
}, {
|
|
202
|
+
label: "Fiji Time (FJT)",
|
|
203
|
+
value: "fjt"
|
|
204
|
+
}, {
|
|
205
|
+
label: "Argentina Time (ART)",
|
|
206
|
+
value: "art"
|
|
207
|
+
}, {
|
|
208
|
+
label: "Bolivia Time (BOT)",
|
|
209
|
+
value: "bot"
|
|
210
|
+
}, {
|
|
211
|
+
label: "Brasilia Time (BRT)",
|
|
212
|
+
value: "brt"
|
|
213
|
+
}],
|
|
214
|
+
values: ["est", "ist", "brt"]
|
|
141
215
|
}
|
|
142
216
|
};
|
|
143
217
|
export const WithCustomPlaceholder = {
|
|
@@ -403,7 +477,7 @@ export const WithCustomSelectedOptionRenderer = {
|
|
|
403
477
|
selectedOptionRenderer: selectedOptionRenderer
|
|
404
478
|
})), /*#__PURE__*/React.createElement("div", {
|
|
405
479
|
className: "wby-mt-4 wby-text-center"
|
|
406
|
-
}, "Current selected values: ", values));
|
|
480
|
+
}, "Current selected values: ", values?.join(",")));
|
|
407
481
|
}
|
|
408
482
|
};
|
|
409
483
|
export const WithSeparators = {
|
|
@@ -578,7 +652,7 @@ export const WithExternalValueControl = {
|
|
|
578
652
|
onClick: () => setValues(args.values)
|
|
579
653
|
})), /*#__PURE__*/React.createElement("div", {
|
|
580
654
|
className: "wby-mt-4 wby-text-center"
|
|
581
|
-
}, "Current selected values: ", values));
|
|
655
|
+
}, "Current selected values: ", values?.join(",")));
|
|
582
656
|
}
|
|
583
657
|
};
|
|
584
658
|
|