@quen-ui/components 0.0.14 → 1.0.1
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/README.md +2 -2
- package/dist/Accordion/Accordion.cjs.js +88 -0
- package/dist/Accordion/Accordion.d.ts +3 -0
- package/dist/Accordion/Accordion.es.js +89 -0
- package/dist/Accordion/AccordionGroup.cjs.js +82 -0
- package/dist/Accordion/AccordionGroup.d.ts +12 -0
- package/dist/Accordion/AccordionGroup.es.js +82 -0
- package/dist/Accordion/AccordionItem.cjs.js +71 -0
- package/dist/Accordion/AccordionItem.d.ts +3 -0
- package/dist/Accordion/AccordionItem.es.js +72 -0
- package/dist/Accordion/helpers.cjs.js +24 -0
- package/dist/Accordion/helpers.d.ts +25 -0
- package/dist/Accordion/helpers.es.js +24 -0
- package/dist/Accordion/index.cjs.js +7 -0
- package/dist/Accordion/index.d.ts +8 -0
- package/dist/Accordion/index.es.js +7 -0
- package/dist/Accordion/styles.cjs.js +97 -0
- package/dist/Accordion/styles.d.ts +23 -0
- package/dist/Accordion/styles.es.js +97 -0
- package/dist/Accordion/types.d.ts +142 -0
- package/dist/Accordion/useAccordionState.cjs.js +34 -0
- package/dist/Accordion/useAccordionState.d.ts +12 -0
- package/dist/Accordion/useAccordionState.es.js +34 -0
- package/dist/Alert/Alert.cjs.js +1 -1
- package/dist/Alert/Alert.es.js +1 -1
- package/dist/Alert/styles.cjs.js +14 -10
- package/dist/Alert/styles.es.js +14 -10
- package/dist/Avatar/styles.cjs.js +16 -11
- package/dist/Avatar/styles.es.js +16 -11
- package/dist/Badge/styles.cjs.js +7 -7
- package/dist/Badge/styles.es.js +7 -7
- package/dist/Breadcrumbs/BreadcrumbItem.cjs.js +6 -6
- package/dist/Breadcrumbs/BreadcrumbItem.es.js +6 -6
- package/dist/Breadcrumbs/Breadcrumbs.cjs.js +2 -3
- package/dist/Breadcrumbs/Breadcrumbs.es.js +2 -3
- package/dist/Breadcrumbs/styles.cjs.js +15 -15
- package/dist/Breadcrumbs/styles.es.js +15 -15
- package/dist/Button/Button.cjs.js +3 -3
- package/dist/Button/Button.es.js +6 -6
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/styles.cjs.js +49 -54
- package/dist/Button/styles.es.js +50 -55
- package/dist/Button/types.d.ts +2 -3
- package/dist/Calendar/Calendar.cjs.js +200 -0
- package/dist/Calendar/Calendar.d.ts +4 -0
- package/dist/Calendar/Calendar.es.js +201 -0
- package/dist/Calendar/DaysLevel.cjs.js +93 -0
- package/dist/Calendar/DaysLevel.d.ts +3 -0
- package/dist/Calendar/DaysLevel.es.js +94 -0
- package/dist/Calendar/MonthLevel.cjs.js +23 -0
- package/dist/Calendar/MonthLevel.d.ts +3 -0
- package/dist/Calendar/MonthLevel.es.js +24 -0
- package/dist/Calendar/YearsLevel.cjs.js +24 -0
- package/dist/Calendar/YearsLevel.d.ts +3 -0
- package/dist/Calendar/YearsLevel.es.js +25 -0
- package/dist/Calendar/helpers.cjs.js +60 -0
- package/dist/Calendar/helpers.d.ts +9 -0
- package/dist/Calendar/helpers.es.js +60 -0
- package/dist/Calendar/index.d.ts +2 -0
- package/dist/Calendar/styles.cjs.js +116 -0
- package/dist/Calendar/styles.d.ts +16 -0
- package/dist/Calendar/styles.es.js +116 -0
- package/dist/Calendar/types.d.ts +115 -0
- package/dist/Card/Card.cjs.js +4 -2
- package/dist/Card/Card.d.ts +1 -1
- package/dist/Card/Card.es.js +4 -2
- package/dist/Card/styles.cjs.js +2 -2
- package/dist/Card/styles.es.js +2 -2
- package/dist/Card/types.d.ts +2 -0
- package/dist/Checkbox/Checkbox.cjs.js +1 -1
- package/dist/Checkbox/Checkbox.es.js +1 -1
- package/dist/Checkbox/CheckboxGroup.cjs.js +22 -25
- package/dist/Checkbox/CheckboxGroup.es.js +22 -25
- package/dist/Checkbox/styles.cjs.js +24 -23
- package/dist/Checkbox/styles.es.js +24 -23
- package/dist/ColorPicker/ColorPicker.cjs.js +404 -0
- package/dist/ColorPicker/ColorPicker.d.ts +3 -0
- package/dist/ColorPicker/ColorPicker.es.js +405 -0
- package/dist/ColorPicker/InputColor.cjs.js +94 -0
- package/dist/ColorPicker/InputColor.d.ts +3 -0
- package/dist/ColorPicker/InputColor.es.js +95 -0
- package/dist/ColorPicker/InputsColor.cjs.js +177 -0
- package/dist/ColorPicker/InputsColor.d.ts +3 -0
- package/dist/ColorPicker/InputsColor.es.js +178 -0
- package/dist/ColorPicker/helpers.cjs.js +32 -0
- package/dist/ColorPicker/helpers.d.ts +4 -0
- package/dist/ColorPicker/helpers.es.js +32 -0
- package/dist/ColorPicker/index.cjs.js +7 -0
- package/dist/ColorPicker/index.d.ts +8 -0
- package/dist/ColorPicker/index.es.js +7 -0
- package/dist/ColorPicker/styles.cjs.js +234 -0
- package/dist/ColorPicker/styles.d.ts +43 -0
- package/dist/ColorPicker/styles.es.js +234 -0
- package/dist/ColorPicker/types.d.ts +56 -0
- package/dist/Divider/styles.cjs.js +12 -10
- package/dist/Divider/styles.es.js +12 -10
- package/dist/Drawer/Drawer.cjs.js +5 -1
- package/dist/Drawer/Drawer.es.js +5 -1
- package/dist/Drawer/styles.cjs.js +4 -5
- package/dist/Drawer/styles.es.js +4 -5
- package/dist/Dropdown/Dropdown.cjs.js +31 -2
- package/dist/Dropdown/Dropdown.d.ts +2 -2
- package/dist/Dropdown/Dropdown.es.js +32 -3
- package/dist/Dropdown/DropdownItem.cjs.js +4 -5
- package/dist/Dropdown/DropdownItem.es.js +4 -5
- package/dist/Dropdown/DropdownList.cjs.js +3 -2
- package/dist/Dropdown/DropdownList.es.js +6 -5
- package/dist/Dropdown/DropdownPortal.cjs.js +8 -5
- package/dist/Dropdown/DropdownPortal.d.ts +5 -3
- package/dist/Dropdown/DropdownPortal.es.js +9 -6
- package/dist/Dropdown/helpers.cjs.js +1 -1
- package/dist/Dropdown/helpers.es.js +1 -1
- package/dist/Dropdown/styles.cjs.js +28 -27
- package/dist/Dropdown/styles.d.ts +2 -0
- package/dist/Dropdown/styles.es.js +28 -27
- package/dist/EmptyState/EmptyState.cjs.js +51 -0
- package/dist/EmptyState/EmptyState.d.ts +3 -0
- package/dist/EmptyState/EmptyState.es.js +52 -0
- package/dist/EmptyState/index.d.ts +2 -0
- package/dist/EmptyState/types.d.ts +10 -0
- package/dist/Flex/Flex.d.ts +1 -1
- package/dist/Flex/types.d.ts +1 -0
- package/dist/Form/Field.cjs.js +175 -0
- package/dist/Form/Field.d.ts +3 -0
- package/dist/Form/Field.es.js +176 -0
- package/dist/Form/FieldArray.cjs.js +24 -0
- package/dist/Form/FieldArray.d.ts +3 -0
- package/dist/Form/FieldArray.es.js +25 -0
- package/dist/Form/Form.cjs.js +69 -0
- package/dist/Form/Form.d.ts +3 -0
- package/dist/Form/Form.es.js +69 -0
- package/dist/Form/defaultValidateMessages.cjs.js +51 -0
- package/dist/Form/defaultValidateMessages.d.ts +47 -0
- package/dist/Form/defaultValidateMessages.es.js +51 -0
- package/dist/Form/helpers.cjs.js +8 -0
- package/dist/Form/helpers.d.ts +1 -0
- package/dist/Form/helpers.es.js +8 -0
- package/dist/Form/index.cjs.js +13 -0
- package/dist/Form/index.d.ts +14 -0
- package/dist/Form/index.es.js +13 -0
- package/dist/Form/types.d.ts +147 -0
- package/dist/Form/useForm.cjs.js +230 -0
- package/dist/Form/useForm.d.ts +2 -0
- package/dist/Form/useForm.es.js +230 -0
- package/dist/Form/useWatch.cjs.js +14 -0
- package/dist/Form/useWatch.d.ts +3 -0
- package/dist/Form/useWatch.es.js +14 -0
- package/dist/Highlight/Highlight.cjs.js +113 -0
- package/dist/Highlight/Highlight.d.ts +3 -0
- package/dist/Highlight/Highlight.es.js +114 -0
- package/dist/Highlight/helpers.cjs.js +147 -0
- package/dist/Highlight/helpers.d.ts +27 -0
- package/dist/Highlight/helpers.es.js +147 -0
- package/dist/Highlight/index.d.ts +2 -0
- package/dist/Highlight/styles.cjs.js +11 -0
- package/dist/Highlight/styles.d.ts +4 -0
- package/dist/Highlight/styles.es.js +11 -0
- package/dist/Highlight/types.d.ts +53 -0
- package/dist/Image/styles.cjs.js +4 -5
- package/dist/Image/styles.es.js +4 -5
- package/dist/InputBase/InputBase.cjs.js +32 -0
- package/dist/InputBase/InputBase.d.ts +4 -0
- package/dist/InputBase/InputBase.es.js +33 -0
- package/dist/InputBase/index.d.ts +2 -0
- package/dist/InputBase/styles.cjs.js +61 -0
- package/dist/InputBase/styles.d.ts +7 -0
- package/dist/InputBase/styles.es.js +61 -0
- package/dist/InputBase/types.d.ts +25 -0
- package/dist/InputDate/InputDate.cjs.js +344 -0
- package/dist/InputDate/InputDate.d.ts +4 -0
- package/dist/InputDate/InputDate.es.js +345 -0
- package/dist/InputDate/helpers.cjs.js +78 -0
- package/dist/InputDate/helpers.d.ts +5 -0
- package/dist/InputDate/helpers.es.js +78 -0
- package/dist/InputDate/index.d.ts +2 -0
- package/dist/InputDate/styles.cjs.js +35 -0
- package/dist/InputDate/styles.d.ts +5 -0
- package/dist/InputDate/styles.es.js +35 -0
- package/dist/InputDate/types.d.ts +23 -0
- package/dist/InputNumber/InputNumber.cjs.js +70 -73
- package/dist/InputNumber/InputNumber.d.ts +1 -1
- package/dist/InputNumber/InputNumber.es.js +72 -75
- package/dist/InputNumber/styles.cjs.js +20 -60
- package/dist/InputNumber/styles.d.ts +4 -8
- package/dist/InputNumber/styles.es.js +21 -61
- package/dist/InputNumber/types.d.ts +2 -18
- package/dist/Layout/Header.cjs.js +27 -23
- package/dist/Layout/Header.d.ts +1 -1
- package/dist/Layout/Header.es.js +28 -24
- package/dist/Layout/Sidebar.cjs.js +24 -25
- package/dist/Layout/Sidebar.d.ts +1 -1
- package/dist/Layout/Sidebar.es.js +25 -26
- package/dist/Layout/index.d.ts +2 -2
- package/dist/Layout/styles.cjs.js +16 -52
- package/dist/Layout/styles.d.ts +2 -15
- package/dist/Layout/styles.es.js +16 -52
- package/dist/Layout/types.d.ts +7 -22
- package/dist/Loader/styles.cjs.js +5 -4
- package/dist/Loader/styles.es.js +5 -4
- package/dist/LoadingOverlay/LoadingOverlay.cjs.js +22 -0
- package/dist/LoadingOverlay/LoadingOverlay.d.ts +3 -0
- package/dist/LoadingOverlay/LoadingOverlay.es.js +23 -0
- package/dist/LoadingOverlay/index.d.ts +2 -0
- package/dist/LoadingOverlay/styles.cjs.js +28 -0
- package/dist/LoadingOverlay/styles.d.ts +5 -0
- package/dist/LoadingOverlay/styles.es.js +28 -0
- package/dist/LoadingOverlay/types.d.ts +16 -0
- package/dist/Menu/Menu.cjs.js +42 -0
- package/dist/Menu/Menu.d.ts +3 -0
- package/dist/Menu/Menu.es.js +43 -0
- package/dist/Menu/MenuItem.cjs.js +112 -0
- package/dist/Menu/MenuItem.d.ts +3 -0
- package/dist/Menu/MenuItem.es.js +113 -0
- package/dist/Menu/helpers.cjs.js +20 -0
- package/dist/Menu/helpers.d.ts +17 -0
- package/dist/Menu/helpers.es.js +20 -0
- package/dist/Menu/index.d.ts +2 -0
- package/dist/Menu/styles.cjs.js +98 -0
- package/dist/Menu/styles.d.ts +16 -0
- package/dist/Menu/styles.es.js +98 -0
- package/dist/Menu/types.d.ts +85 -0
- package/dist/Modal/Modal.cjs.js +15 -5
- package/dist/Modal/Modal.d.ts +1 -1
- package/dist/Modal/Modal.es.js +16 -6
- package/dist/Modal/styles.cjs.js +39 -9
- package/dist/Modal/styles.d.ts +4 -0
- package/dist/Modal/styles.es.js +40 -10
- package/dist/Modal/types.d.ts +2 -0
- package/dist/Notification/Notification.cjs.js +3 -3
- package/dist/Notification/Notification.es.js +3 -3
- package/dist/Notification/NotificationInstance.cjs.js +8 -15
- package/dist/Notification/NotificationInstance.es.js +8 -15
- package/dist/Notification/NotificationsStore.cjs.js +2 -7
- package/dist/Notification/NotificationsStore.es.js +2 -7
- package/dist/Notification/styles.cjs.js +6 -6
- package/dist/Notification/styles.es.js +6 -6
- package/dist/Pagination/Pagination.cjs.js +114 -0
- package/dist/Pagination/Pagination.d.ts +3 -0
- package/dist/Pagination/Pagination.es.js +115 -0
- package/dist/Pagination/index.d.ts +2 -0
- package/dist/Pagination/styles.cjs.js +54 -0
- package/dist/Pagination/styles.d.ts +2 -0
- package/dist/Pagination/styles.es.js +54 -0
- package/dist/Pagination/types.d.ts +49 -0
- package/dist/Progress/Progress.cjs.js +1 -1
- package/dist/Progress/Progress.es.js +1 -1
- package/dist/Progress/styles.cjs.js +5 -50
- package/dist/Progress/styles.es.js +5 -50
- package/dist/Progress/types.d.ts +1 -0
- package/dist/RadioButton/RadioButton.cjs.js +1 -1
- package/dist/RadioButton/RadioButton.es.js +1 -1
- package/dist/RadioButton/RadioButtonGroup.cjs.js +19 -22
- package/dist/RadioButton/RadioButtonGroup.es.js +19 -22
- package/dist/RadioButton/styles.cjs.js +11 -13
- package/dist/RadioButton/styles.es.js +11 -13
- package/dist/RichTextEditor/RichTextEditor.cjs.js +289 -0
- package/dist/RichTextEditor/RichTextEditor.d.ts +4 -0
- package/dist/RichTextEditor/RichTextEditor.es.js +290 -0
- package/dist/RichTextEditor/RichTextEditorColorControl.cjs.js +38 -0
- package/dist/RichTextEditor/RichTextEditorColorControl.d.ts +3 -0
- package/dist/RichTextEditor/RichTextEditorColorControl.es.js +39 -0
- package/dist/RichTextEditor/RichTextEditorTableControl.cjs.js +62 -0
- package/dist/RichTextEditor/RichTextEditorTableControl.d.ts +3 -0
- package/dist/RichTextEditor/RichTextEditorTableControl.es.js +63 -0
- package/dist/RichTextEditor/helpers.cjs.js +151 -0
- package/dist/RichTextEditor/helpers.d.ts +10 -0
- package/dist/RichTextEditor/helpers.es.js +151 -0
- package/dist/RichTextEditor/index.d.ts +2 -0
- package/dist/RichTextEditor/plugins.cjs.js +548 -0
- package/dist/RichTextEditor/plugins.d.ts +2 -0
- package/dist/RichTextEditor/plugins.es.js +548 -0
- package/dist/RichTextEditor/styles.cjs.js +60 -0
- package/dist/RichTextEditor/styles.d.ts +7 -0
- package/dist/RichTextEditor/styles.es.js +60 -0
- package/dist/RichTextEditor/types.d.ts +79 -0
- package/dist/Select/Select.cjs.js +30 -18
- package/dist/Select/Select.es.js +30 -18
- package/dist/Select/helpers.cjs.js +1 -1
- package/dist/Select/helpers.d.ts +24 -24
- package/dist/Select/helpers.es.js +1 -1
- package/dist/Select/styles.cjs.js +91 -118
- package/dist/Select/styles.d.ts +4 -5
- package/dist/Select/styles.es.js +91 -118
- package/dist/Select/types.d.ts +3 -23
- package/dist/Select/useSelect.cjs.js +8 -14
- package/dist/Select/useSelect.d.ts +20 -20
- package/dist/Select/useSelect.es.js +8 -14
- package/dist/Skeleton/Skeleton.cjs.js +35 -0
- package/dist/Skeleton/Skeleton.d.ts +3 -0
- package/dist/Skeleton/Skeleton.es.js +36 -0
- package/dist/Skeleton/SkeletonAvatar.cjs.js +17 -0
- package/dist/Skeleton/SkeletonAvatar.d.ts +3 -0
- package/dist/Skeleton/SkeletonAvatar.es.js +18 -0
- package/dist/Skeleton/SkeletonButton.cjs.js +21 -0
- package/dist/Skeleton/SkeletonButton.d.ts +3 -0
- package/dist/Skeleton/SkeletonButton.es.js +22 -0
- package/dist/Skeleton/SkeletonCard.cjs.js +15 -0
- package/dist/Skeleton/SkeletonCard.d.ts +3 -0
- package/dist/Skeleton/SkeletonCard.es.js +16 -0
- package/dist/Skeleton/SkeletonLayout.cjs.js +60 -0
- package/dist/Skeleton/SkeletonLayout.d.ts +3 -0
- package/dist/Skeleton/SkeletonLayout.es.js +61 -0
- package/dist/Skeleton/SkeletonList.cjs.js +39 -0
- package/dist/Skeleton/SkeletonList.d.ts +3 -0
- package/dist/Skeleton/SkeletonList.es.js +40 -0
- package/dist/Skeleton/SkeletonTextBlock.cjs.js +7 -0
- package/dist/Skeleton/SkeletonTextBlock.d.ts +5 -0
- package/dist/Skeleton/SkeletonTextBlock.es.js +8 -0
- package/dist/Skeleton/index.cjs.js +17 -0
- package/dist/Skeleton/index.d.ts +18 -0
- package/dist/Skeleton/index.es.js +17 -0
- package/dist/Skeleton/styles.cjs.js +59 -0
- package/dist/Skeleton/styles.d.ts +3 -0
- package/dist/Skeleton/styles.es.js +59 -0
- package/dist/Skeleton/types.d.ts +74 -0
- package/dist/Slider/Slider.cjs.js +282 -0
- package/dist/Slider/Slider.d.ts +3 -0
- package/dist/Slider/Slider.es.js +283 -0
- package/dist/Slider/index.d.ts +2 -0
- package/dist/Slider/styles.cjs.js +156 -0
- package/dist/Slider/styles.d.ts +35 -0
- package/dist/Slider/styles.es.js +156 -0
- package/dist/Slider/types.d.ts +53 -0
- package/dist/Spoiler/Spoiler.cjs.js +62 -0
- package/dist/Spoiler/Spoiler.d.ts +3 -0
- package/dist/Spoiler/Spoiler.es.js +63 -0
- package/dist/Spoiler/index.d.ts +2 -0
- package/dist/Spoiler/styles.cjs.js +15 -0
- package/dist/Spoiler/styles.d.ts +4 -0
- package/dist/Spoiler/styles.es.js +15 -0
- package/dist/Spoiler/types.d.ts +23 -0
- package/dist/Switch/Switch.cjs.js +32 -6
- package/dist/Switch/Switch.d.ts +2 -2
- package/dist/Switch/Switch.es.js +33 -7
- package/dist/Switch/styles.cjs.js +24 -7
- package/dist/Switch/styles.d.ts +4 -0
- package/dist/Switch/styles.es.js +24 -7
- package/dist/Switch/types.d.ts +3 -0
- package/dist/Tabs/Tab.cjs.js +8 -8
- package/dist/Tabs/Tab.es.js +8 -8
- package/dist/Tabs/TabPanel.cjs.js +3 -3
- package/dist/Tabs/TabPanel.es.js +3 -3
- package/dist/Tabs/Tabs.cjs.js +5 -4
- package/dist/Tabs/Tabs.d.ts +1 -1
- package/dist/Tabs/Tabs.es.js +5 -4
- package/dist/Tabs/TabsList.cjs.js +25 -1
- package/dist/Tabs/TabsList.d.ts +2 -2
- package/dist/Tabs/TabsList.es.js +25 -1
- package/dist/Tabs/styles.cjs.js +104 -34
- package/dist/Tabs/styles.d.ts +2 -0
- package/dist/Tabs/styles.es.js +104 -34
- package/dist/Tabs/types.d.ts +7 -3
- package/dist/Tag/Tag.cjs.js +4 -1
- package/dist/Tag/Tag.d.ts +1 -1
- package/dist/Tag/Tag.es.js +4 -1
- package/dist/Tag/styles.cjs.js +14 -9
- package/dist/Tag/styles.d.ts +2 -0
- package/dist/Tag/styles.es.js +14 -9
- package/dist/Tag/types.d.ts +6 -0
- package/dist/TextField/TextField.cjs.js +57 -56
- package/dist/TextField/TextField.d.ts +1 -1
- package/dist/TextField/TextField.es.js +58 -57
- package/dist/TextField/styles.cjs.js +9 -50
- package/dist/TextField/styles.d.ts +3 -8
- package/dist/TextField/styles.es.js +10 -51
- package/dist/TextField/types.d.ts +2 -20
- package/dist/Textarea/Textarea.cjs.js +57 -56
- package/dist/Textarea/Textarea.d.ts +1 -1
- package/dist/Textarea/Textarea.es.js +58 -57
- package/dist/Textarea/styles.cjs.js +10 -62
- package/dist/Textarea/styles.d.ts +3 -8
- package/dist/Textarea/styles.es.js +12 -64
- package/dist/Textarea/types.d.ts +2 -21
- package/dist/Tooltip/Tooltip.cjs.js +3 -1
- package/dist/Tooltip/Tooltip.d.ts +1 -1
- package/dist/Tooltip/Tooltip.es.js +3 -1
- package/dist/Tooltip/types.d.ts +3 -0
- package/dist/assets/box.svg.cjs.js +21 -0
- package/dist/assets/box.svg.es.js +5 -0
- package/dist/index.cjs.js +30 -0
- package/dist/index.d.ts +17 -2
- package/dist/index.es.js +30 -0
- package/dist/message/Message.cjs.js +42 -0
- package/dist/message/Message.d.ts +3 -0
- package/dist/message/Message.es.js +43 -0
- package/dist/message/MessageContext.cjs.js +101 -0
- package/dist/message/MessageContext.d.ts +4 -0
- package/dist/message/MessageContext.es.js +101 -0
- package/dist/message/index.cjs.js +8 -0
- package/dist/message/index.d.ts +6 -0
- package/dist/message/index.es.js +8 -0
- package/dist/message/styles.cjs.js +79 -0
- package/dist/message/styles.d.ts +11 -0
- package/dist/message/styles.es.js +79 -0
- package/dist/message/types.d.ts +42 -0
- package/dist/typography/Text/Text.es.js +3 -3
- package/dist/typography/Title/Title.cjs.js +2 -0
- package/dist/typography/Title/Title.d.ts +1 -1
- package/dist/typography/Title/Title.es.js +2 -0
- package/dist/typography/Title/styles.cjs.js +3 -0
- package/dist/typography/Title/styles.es.js +3 -0
- package/dist/typography/Title/types.d.ts +1 -0
- package/package.json +17 -13
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useLayoutEffect } from "react";
|
|
2
|
+
import { useState, useRef, useEffect, useLayoutEffect } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import { useTransitionState } from "react-transition-state";
|
|
5
|
+
import { useOnClickOutside } from "@quen-ui/hooks";
|
|
5
6
|
import { DropdownWrapper } from "./styles.es.js";
|
|
6
7
|
import DropdownPortal from "./DropdownPortal.es.js";
|
|
7
8
|
import { DEFAULT_RECT_ELEMENT, calculateRectElement } from "./helpers.es.js";
|
|
@@ -11,20 +12,37 @@ const Dropdown = ({
|
|
|
11
12
|
direction = "bottom",
|
|
12
13
|
width,
|
|
13
14
|
anchorRef,
|
|
15
|
+
onClickClose,
|
|
14
16
|
...props
|
|
15
17
|
}) => {
|
|
16
18
|
const [anchorRect, setAnchorRect] = useState(DEFAULT_RECT_ELEMENT);
|
|
19
|
+
const dropdownRef = useRef(null);
|
|
17
20
|
const [containerDropdown, setContainerDropdown] = useState(null);
|
|
18
21
|
const [state, toggle] = useTransitionState({
|
|
19
22
|
timeout: 500,
|
|
20
23
|
unmountOnExit: true,
|
|
21
24
|
initialEntered: open
|
|
22
25
|
});
|
|
26
|
+
useOnClickOutside(
|
|
27
|
+
anchorRef,
|
|
28
|
+
() => {
|
|
29
|
+
if (typeof open === "undefined") {
|
|
30
|
+
toggle(false);
|
|
31
|
+
onClickClose?.();
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
excludeRef: dropdownRef
|
|
36
|
+
}
|
|
37
|
+
);
|
|
23
38
|
const calculateAnchorRect = () => {
|
|
24
39
|
if (anchorRef && anchorRef.current) {
|
|
25
40
|
setAnchorRect(calculateRectElement(anchorRef.current));
|
|
26
41
|
}
|
|
27
42
|
};
|
|
43
|
+
const handleClickAnchorRef = () => {
|
|
44
|
+
toggle();
|
|
45
|
+
};
|
|
28
46
|
useEffect(() => {
|
|
29
47
|
window.addEventListener("resize", calculateAnchorRect);
|
|
30
48
|
window.addEventListener("scroll", calculateAnchorRect, true);
|
|
@@ -34,7 +52,17 @@ const Dropdown = ({
|
|
|
34
52
|
};
|
|
35
53
|
}, [anchorRect]);
|
|
36
54
|
useEffect(() => {
|
|
37
|
-
|
|
55
|
+
if (typeof open === "undefined") {
|
|
56
|
+
anchorRef.current?.addEventListener("click", handleClickAnchorRef);
|
|
57
|
+
}
|
|
58
|
+
return () => {
|
|
59
|
+
anchorRef.current?.removeEventListener("click", handleClickAnchorRef);
|
|
60
|
+
};
|
|
61
|
+
}, [anchorRef]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (typeof open !== "undefined") {
|
|
64
|
+
toggle(open);
|
|
65
|
+
}
|
|
38
66
|
}, [open]);
|
|
39
67
|
useLayoutEffect(() => {
|
|
40
68
|
calculateAnchorRect();
|
|
@@ -55,7 +83,8 @@ const Dropdown = ({
|
|
|
55
83
|
transitionStatus: state.status,
|
|
56
84
|
anchorRef,
|
|
57
85
|
anchorRect,
|
|
58
|
-
width: width || "max-content"
|
|
86
|
+
width: width || "max-content",
|
|
87
|
+
ref: dropdownRef
|
|
59
88
|
}
|
|
60
89
|
),
|
|
61
90
|
containerDropdown
|
|
@@ -11,19 +11,18 @@ const DropdownItem = ({
|
|
|
11
11
|
size
|
|
12
12
|
}) => {
|
|
13
13
|
const handleClick = (event) => {
|
|
14
|
-
var _a;
|
|
15
14
|
event.preventDefault();
|
|
16
|
-
|
|
17
|
-
onItemClick
|
|
15
|
+
getItemOnClick?.(item)?.(item, event);
|
|
16
|
+
onItemClick?.(item, event);
|
|
18
17
|
};
|
|
19
18
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20
19
|
styles.DropdownItemStyled,
|
|
21
20
|
{
|
|
22
21
|
size,
|
|
23
|
-
|
|
22
|
+
disabled: getItemDisabled?.(item),
|
|
24
23
|
onClick: handleClick,
|
|
25
24
|
children: [
|
|
26
|
-
getItemLeftContent
|
|
25
|
+
getItemLeftContent?.(item),
|
|
27
26
|
getItemLabel(item)
|
|
28
27
|
]
|
|
29
28
|
}
|
|
@@ -10,19 +10,18 @@ const DropdownItem = ({
|
|
|
10
10
|
size
|
|
11
11
|
}) => {
|
|
12
12
|
const handleClick = (event) => {
|
|
13
|
-
var _a;
|
|
14
13
|
event.preventDefault();
|
|
15
|
-
|
|
16
|
-
onItemClick
|
|
14
|
+
getItemOnClick?.(item)?.(item, event);
|
|
15
|
+
onItemClick?.(item, event);
|
|
17
16
|
};
|
|
18
17
|
return /* @__PURE__ */ jsxs(
|
|
19
18
|
DropdownItemStyled,
|
|
20
19
|
{
|
|
21
20
|
size,
|
|
22
|
-
|
|
21
|
+
disabled: getItemDisabled?.(item),
|
|
23
22
|
onClick: handleClick,
|
|
24
23
|
children: [
|
|
25
|
-
getItemLeftContent
|
|
24
|
+
getItemLeftContent?.(item),
|
|
26
25
|
getItemLabel(item)
|
|
27
26
|
]
|
|
28
27
|
}
|
|
@@ -61,6 +61,7 @@ const DropdownList = (props, ref) => {
|
|
|
61
61
|
direction,
|
|
62
62
|
className,
|
|
63
63
|
width,
|
|
64
|
+
isContent: Boolean(content),
|
|
64
65
|
...otherProps,
|
|
65
66
|
children: content ? content : groups.map((groupItems, index) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
|
|
66
67
|
/* @__PURE__ */ jsxRuntime.jsx(styles.DropdownItemsWrapper, { children: groupItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -74,10 +75,10 @@ const DropdownList = (props, ref) => {
|
|
|
74
75
|
getItemOnClick,
|
|
75
76
|
onItemClick: otherProps.onItemClick
|
|
76
77
|
},
|
|
77
|
-
getItemKey
|
|
78
|
+
getItemKey?.(item)
|
|
78
79
|
)) }),
|
|
79
80
|
index !== groups.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(Divider, { direction: "horizontal" })
|
|
80
|
-
] }, getItemGroupId
|
|
81
|
+
] }, getItemGroupId?.(groupItems[0])))
|
|
81
82
|
}
|
|
82
83
|
);
|
|
83
84
|
};
|
|
@@ -5,7 +5,7 @@ import Divider from "../Divider/Divider.es.js";
|
|
|
5
5
|
import { DropdownListWrapper, DropdownItemsWrapper } from "./styles.es.js";
|
|
6
6
|
import { withDefaultGetters } from "./helpers.es.js";
|
|
7
7
|
import DropdownItem from "./DropdownItem.es.js";
|
|
8
|
-
const DropdownList = (props, ref) => {
|
|
8
|
+
const DropdownList$1 = (props, ref) => {
|
|
9
9
|
const {
|
|
10
10
|
items = [],
|
|
11
11
|
sortGroup,
|
|
@@ -60,6 +60,7 @@ const DropdownList = (props, ref) => {
|
|
|
60
60
|
direction,
|
|
61
61
|
className,
|
|
62
62
|
width,
|
|
63
|
+
isContent: Boolean(content),
|
|
63
64
|
...otherProps,
|
|
64
65
|
children: content ? content : groups.map((groupItems, index) => /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
65
66
|
/* @__PURE__ */ jsx(DropdownItemsWrapper, { children: groupItems.map((item) => /* @__PURE__ */ jsx(
|
|
@@ -73,14 +74,14 @@ const DropdownList = (props, ref) => {
|
|
|
73
74
|
getItemOnClick,
|
|
74
75
|
onItemClick: otherProps.onItemClick
|
|
75
76
|
},
|
|
76
|
-
getItemKey
|
|
77
|
+
getItemKey?.(item)
|
|
77
78
|
)) }),
|
|
78
79
|
index !== groups.length - 1 && /* @__PURE__ */ jsx(Divider, { direction: "horizontal" })
|
|
79
|
-
] }, getItemGroupId
|
|
80
|
+
] }, getItemGroupId?.(groupItems[0])))
|
|
80
81
|
}
|
|
81
82
|
);
|
|
82
83
|
};
|
|
83
|
-
const DropdownList
|
|
84
|
+
const DropdownList = forwardRef(DropdownList$1);
|
|
84
85
|
export {
|
|
85
|
-
DropdownList
|
|
86
|
+
DropdownList as default
|
|
86
87
|
};
|
|
@@ -9,19 +9,18 @@ const DropdownPortal = ({
|
|
|
9
9
|
height,
|
|
10
10
|
transitionStatus,
|
|
11
11
|
...props
|
|
12
|
-
}) => {
|
|
12
|
+
}, ref) => {
|
|
13
13
|
const [dropdownRect, setDropdownRect] = React.useState(helpers.DEFAULT_RECT_ELEMENT);
|
|
14
14
|
const maxHeight = React.useMemo(
|
|
15
15
|
() => document.documentElement.scrollHeight - anchorRect.height - anchorRect.y - 8,
|
|
16
16
|
[anchorRect]
|
|
17
17
|
);
|
|
18
|
-
const dropdownRef = React.useRef(null);
|
|
19
18
|
const portalDirection = React.useMemo(
|
|
20
19
|
() => helpers.getDirection({ anchorRect, direction, dropdownRect, offset: 8 }),
|
|
21
20
|
[dropdownRect, direction]
|
|
22
21
|
);
|
|
23
22
|
React.useLayoutEffect(() => {
|
|
24
|
-
setDropdownRect(helpers.calculateRectElement(
|
|
23
|
+
setDropdownRect(helpers.calculateRectElement(ref.current));
|
|
25
24
|
}, []);
|
|
26
25
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27
26
|
styles.DropdownListStyled,
|
|
@@ -31,11 +30,15 @@ const DropdownPortal = ({
|
|
|
31
30
|
anchorRect,
|
|
32
31
|
dropdownRect,
|
|
33
32
|
maxHeight,
|
|
34
|
-
ref
|
|
33
|
+
ref,
|
|
35
34
|
height,
|
|
36
35
|
minWidth: anchorRect.width,
|
|
36
|
+
isContent: Boolean(props.content),
|
|
37
37
|
...props
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
|
-
|
|
41
|
+
const DropdownPortal$1 = React.forwardRef(
|
|
42
|
+
DropdownPortal
|
|
43
|
+
);
|
|
44
|
+
module.exports = DropdownPortal$1;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactElement, RefAttributes } from 'react';
|
|
2
2
|
import { TDropdownPortalProps } from './types';
|
|
3
|
-
declare const
|
|
4
|
-
|
|
3
|
+
declare const _default: {
|
|
4
|
+
<T>(props: TDropdownPortalProps<T> & RefAttributes<HTMLDivElement>): ReactElement;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useMemo,
|
|
2
|
+
import { forwardRef, useState, useMemo, useLayoutEffect } from "react";
|
|
3
3
|
import { DEFAULT_RECT_ELEMENT, getDirection, calculateRectElement } from "./helpers.es.js";
|
|
4
4
|
import { DropdownListStyled } from "./styles.es.js";
|
|
5
|
-
const DropdownPortal = ({
|
|
5
|
+
const DropdownPortal$1 = ({
|
|
6
6
|
direction,
|
|
7
7
|
anchorRect,
|
|
8
8
|
height,
|
|
9
9
|
transitionStatus,
|
|
10
10
|
...props
|
|
11
|
-
}) => {
|
|
11
|
+
}, ref) => {
|
|
12
12
|
const [dropdownRect, setDropdownRect] = useState(DEFAULT_RECT_ELEMENT);
|
|
13
13
|
const maxHeight = useMemo(
|
|
14
14
|
() => document.documentElement.scrollHeight - anchorRect.height - anchorRect.y - 8,
|
|
15
15
|
[anchorRect]
|
|
16
16
|
);
|
|
17
|
-
const dropdownRef = useRef(null);
|
|
18
17
|
const portalDirection = useMemo(
|
|
19
18
|
() => getDirection({ anchorRect, direction, dropdownRect, offset: 8 }),
|
|
20
19
|
[dropdownRect, direction]
|
|
21
20
|
);
|
|
22
21
|
useLayoutEffect(() => {
|
|
23
|
-
setDropdownRect(calculateRectElement(
|
|
22
|
+
setDropdownRect(calculateRectElement(ref.current));
|
|
24
23
|
}, []);
|
|
25
24
|
return /* @__PURE__ */ jsx(
|
|
26
25
|
DropdownListStyled,
|
|
@@ -30,13 +29,17 @@ const DropdownPortal = ({
|
|
|
30
29
|
anchorRect,
|
|
31
30
|
dropdownRect,
|
|
32
31
|
maxHeight,
|
|
33
|
-
ref
|
|
32
|
+
ref,
|
|
34
33
|
height,
|
|
35
34
|
minWidth: anchorRect.width,
|
|
35
|
+
isContent: Boolean(props.content),
|
|
36
36
|
...props
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
};
|
|
40
|
+
const DropdownPortal = forwardRef(
|
|
41
|
+
DropdownPortal$1
|
|
42
|
+
);
|
|
40
43
|
export {
|
|
41
44
|
DropdownPortal as default
|
|
42
45
|
};
|
|
@@ -17,7 +17,7 @@ const defaultGetItemLeadContent = (item) => item.leftContent;
|
|
|
17
17
|
const defaultGetItemDisabled = (item) => item.disabled;
|
|
18
18
|
const defaultGetItemLabel = (item) => item.label;
|
|
19
19
|
const defaultGetItemOnClick = (item) => item.onClick;
|
|
20
|
-
const defaultGetItemGroupId = (item) => item
|
|
20
|
+
const defaultGetItemGroupId = (item) => item?.groupId;
|
|
21
21
|
function withDefaultGetters(props) {
|
|
22
22
|
return {
|
|
23
23
|
...props,
|
|
@@ -15,7 +15,7 @@ const defaultGetItemLeadContent = (item) => item.leftContent;
|
|
|
15
15
|
const defaultGetItemDisabled = (item) => item.disabled;
|
|
16
16
|
const defaultGetItemLabel = (item) => item.label;
|
|
17
17
|
const defaultGetItemOnClick = (item) => item.onClick;
|
|
18
|
-
const defaultGetItemGroupId = (item) => item
|
|
18
|
+
const defaultGetItemGroupId = (item) => item?.groupId;
|
|
19
19
|
function withDefaultGetters(props) {
|
|
20
20
|
return {
|
|
21
21
|
...props,
|
|
@@ -54,18 +54,19 @@ const getDirectionStyles = ({
|
|
|
54
54
|
return styled.css``;
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
const getBorderRadius = (direction) => {
|
|
57
|
+
const getBorderRadius = (direction, theme) => {
|
|
58
|
+
const { radius } = theme.components.Dropdown;
|
|
58
59
|
switch (direction) {
|
|
59
60
|
case "bottomLeft":
|
|
60
|
-
return
|
|
61
|
+
return `0 ${radius} ${radius} ${radius}`;
|
|
61
62
|
case "bottomRight":
|
|
62
|
-
return
|
|
63
|
+
return `${radius} 0 ${radius} ${radius}`;
|
|
63
64
|
case "topLeft":
|
|
64
|
-
return
|
|
65
|
+
return `${radius} ${radius} ${radius} 0`;
|
|
65
66
|
case "topRight":
|
|
66
|
-
return
|
|
67
|
+
return `${radius} ${radius} 0 ${radius}`;
|
|
67
68
|
default:
|
|
68
|
-
return
|
|
69
|
+
return radius;
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
72
|
const DropdownWrapper = styled.div`
|
|
@@ -74,14 +75,14 @@ const DropdownWrapper = styled.div`
|
|
|
74
75
|
height: max-content;
|
|
75
76
|
`;
|
|
76
77
|
const DropdownListWrapper = styled.div.withConfig({
|
|
77
|
-
shouldForwardProp: (prop) => !["anchorRef", "width", "height", "direction"].includes(prop)
|
|
78
|
+
shouldForwardProp: (prop) => !["anchorRef", "width", "height", "direction", "isContent"].includes(prop)
|
|
78
79
|
})`
|
|
79
|
-
${({ theme, direction }) => styled.css`
|
|
80
|
-
background: ${theme.
|
|
81
|
-
padding-top: 0.5rem;
|
|
82
|
-
padding-bottom: 0.5rem;
|
|
83
|
-
border-radius: ${getBorderRadius(direction)};
|
|
84
|
-
border: 1px solid ${theme.
|
|
80
|
+
${({ theme, direction, isContent }) => styled.css`
|
|
81
|
+
background: ${theme.components.Dropdown.background};
|
|
82
|
+
padding-top: ${!isContent && "0.5rem"};
|
|
83
|
+
padding-bottom: ${!isContent && "0.5rem"};
|
|
84
|
+
border-radius: ${getBorderRadius(direction, theme)};
|
|
85
|
+
border: 1px solid ${theme.components.Dropdown.borderColor};
|
|
85
86
|
`};
|
|
86
87
|
${({ width }) => width && styled.css`
|
|
87
88
|
width: ${width};
|
|
@@ -101,7 +102,8 @@ const DropdownListStyled = styled(DropdownList).withConfig({
|
|
|
101
102
|
"anchorRect",
|
|
102
103
|
"dropdownRect",
|
|
103
104
|
"maxHeight",
|
|
104
|
-
"minWidth"
|
|
105
|
+
"minWidth",
|
|
106
|
+
"isContent"
|
|
105
107
|
].includes(prop)
|
|
106
108
|
})`
|
|
107
109
|
position: absolute;
|
|
@@ -109,7 +111,7 @@ const DropdownListStyled = styled(DropdownList).withConfig({
|
|
|
109
111
|
max-height: ${({ maxHeight }) => maxHeight}px;
|
|
110
112
|
height: ${({ height }) => height || "max-content"};
|
|
111
113
|
width: ${({ width }) => width || "max-content"};
|
|
112
|
-
min-width: ${({ minWidth }) => `${minWidth}px`};
|
|
114
|
+
min-width: ${({ minWidth, isContent }) => isContent ? "max-content" : `${minWidth}px`};
|
|
113
115
|
|
|
114
116
|
${({ transitionStatus }) => (transitionStatus === "preEnter" || transitionStatus === "exiting") && styled.css`
|
|
115
117
|
opacity: 0;
|
|
@@ -126,22 +128,21 @@ const DropdownItemsWrapper = styled.div`
|
|
|
126
128
|
`;
|
|
127
129
|
const DropdownItemStyled = styled(Text)`
|
|
128
130
|
justify-content: flex-start;
|
|
129
|
-
cursor: ${({
|
|
131
|
+
cursor: ${({ disabled }) => disabled ? "not-allowed" : "pointer"};
|
|
130
132
|
padding: 0.25rem;
|
|
131
133
|
display: flex;
|
|
132
134
|
gap: 0.25rem;
|
|
133
|
-
|
|
135
|
+
|
|
134
136
|
${({ disabled }) => disabled ? styled.css`
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
`}
|
|
137
|
+
background: ${({ theme }) => theme.components.Dropdown.disabledBackground};
|
|
138
|
+
color: ${({ theme }) => theme.components.Dropdown.disabledColor};
|
|
139
|
+
` : styled.css`
|
|
140
|
+
&:hover {
|
|
141
|
+
padding-left: calc(0.25rem - 2px);
|
|
142
|
+
background: ${({ theme }) => theme.components.Dropdown.hoverBackground};
|
|
143
|
+
border-left: 2px solid ${({ theme }) => theme.components.Dropdown.borderLeftColor};
|
|
144
|
+
}
|
|
145
|
+
`}
|
|
145
146
|
`;
|
|
146
147
|
exports.DropdownItemStyled = DropdownItemStyled;
|
|
147
148
|
exports.DropdownItemsWrapper = DropdownItemsWrapper;
|
|
@@ -13,11 +13,13 @@ type TDropdownListStyledProps<ITEM> = TDropdownListProps<ITEM> & {
|
|
|
13
13
|
height?: string;
|
|
14
14
|
transitionStatus: TransitionStatus;
|
|
15
15
|
minWidth: number;
|
|
16
|
+
isContent?: boolean;
|
|
16
17
|
};
|
|
17
18
|
type TDropdownStyledProps = Required<Pick<IDropdownProps, "direction">> & {
|
|
18
19
|
top?: number;
|
|
19
20
|
left?: number;
|
|
20
21
|
width?: string;
|
|
22
|
+
isContent?: boolean;
|
|
21
23
|
};
|
|
22
24
|
export declare const DropdownWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
23
25
|
export declare const DropdownListWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, TDropdownStyledProps>> & string;
|
|
@@ -52,18 +52,19 @@ const getDirectionStyles = ({
|
|
|
52
52
|
return css``;
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
const getBorderRadius = (direction) => {
|
|
55
|
+
const getBorderRadius = (direction, theme) => {
|
|
56
|
+
const { radius } = theme.components.Dropdown;
|
|
56
57
|
switch (direction) {
|
|
57
58
|
case "bottomLeft":
|
|
58
|
-
return
|
|
59
|
+
return `0 ${radius} ${radius} ${radius}`;
|
|
59
60
|
case "bottomRight":
|
|
60
|
-
return
|
|
61
|
+
return `${radius} 0 ${radius} ${radius}`;
|
|
61
62
|
case "topLeft":
|
|
62
|
-
return
|
|
63
|
+
return `${radius} ${radius} ${radius} 0`;
|
|
63
64
|
case "topRight":
|
|
64
|
-
return
|
|
65
|
+
return `${radius} ${radius} 0 ${radius}`;
|
|
65
66
|
default:
|
|
66
|
-
return
|
|
67
|
+
return radius;
|
|
67
68
|
}
|
|
68
69
|
};
|
|
69
70
|
const DropdownWrapper = styled.div`
|
|
@@ -72,14 +73,14 @@ const DropdownWrapper = styled.div`
|
|
|
72
73
|
height: max-content;
|
|
73
74
|
`;
|
|
74
75
|
const DropdownListWrapper = styled.div.withConfig({
|
|
75
|
-
shouldForwardProp: (prop) => !["anchorRef", "width", "height", "direction"].includes(prop)
|
|
76
|
+
shouldForwardProp: (prop) => !["anchorRef", "width", "height", "direction", "isContent"].includes(prop)
|
|
76
77
|
})`
|
|
77
|
-
${({ theme, direction }) => css`
|
|
78
|
-
background: ${theme.
|
|
79
|
-
padding-top: 0.5rem;
|
|
80
|
-
padding-bottom: 0.5rem;
|
|
81
|
-
border-radius: ${getBorderRadius(direction)};
|
|
82
|
-
border: 1px solid ${theme.
|
|
78
|
+
${({ theme, direction, isContent }) => css`
|
|
79
|
+
background: ${theme.components.Dropdown.background};
|
|
80
|
+
padding-top: ${!isContent && "0.5rem"};
|
|
81
|
+
padding-bottom: ${!isContent && "0.5rem"};
|
|
82
|
+
border-radius: ${getBorderRadius(direction, theme)};
|
|
83
|
+
border: 1px solid ${theme.components.Dropdown.borderColor};
|
|
83
84
|
`};
|
|
84
85
|
${({ width }) => width && css`
|
|
85
86
|
width: ${width};
|
|
@@ -99,7 +100,8 @@ const DropdownListStyled = styled(DropdownList).withConfig({
|
|
|
99
100
|
"anchorRect",
|
|
100
101
|
"dropdownRect",
|
|
101
102
|
"maxHeight",
|
|
102
|
-
"minWidth"
|
|
103
|
+
"minWidth",
|
|
104
|
+
"isContent"
|
|
103
105
|
].includes(prop)
|
|
104
106
|
})`
|
|
105
107
|
position: absolute;
|
|
@@ -107,7 +109,7 @@ const DropdownListStyled = styled(DropdownList).withConfig({
|
|
|
107
109
|
max-height: ${({ maxHeight }) => maxHeight}px;
|
|
108
110
|
height: ${({ height }) => height || "max-content"};
|
|
109
111
|
width: ${({ width }) => width || "max-content"};
|
|
110
|
-
min-width: ${({ minWidth }) => `${minWidth}px`};
|
|
112
|
+
min-width: ${({ minWidth, isContent }) => isContent ? "max-content" : `${minWidth}px`};
|
|
111
113
|
|
|
112
114
|
${({ transitionStatus }) => (transitionStatus === "preEnter" || transitionStatus === "exiting") && css`
|
|
113
115
|
opacity: 0;
|
|
@@ -124,22 +126,21 @@ const DropdownItemsWrapper = styled.div`
|
|
|
124
126
|
`;
|
|
125
127
|
const DropdownItemStyled = styled(Text)`
|
|
126
128
|
justify-content: flex-start;
|
|
127
|
-
cursor: ${({
|
|
129
|
+
cursor: ${({ disabled }) => disabled ? "not-allowed" : "pointer"};
|
|
128
130
|
padding: 0.25rem;
|
|
129
131
|
display: flex;
|
|
130
132
|
gap: 0.25rem;
|
|
131
|
-
|
|
133
|
+
|
|
132
134
|
${({ disabled }) => disabled ? css`
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
`}
|
|
135
|
+
background: ${({ theme }) => theme.components.Dropdown.disabledBackground};
|
|
136
|
+
color: ${({ theme }) => theme.components.Dropdown.disabledColor};
|
|
137
|
+
` : css`
|
|
138
|
+
&:hover {
|
|
139
|
+
padding-left: calc(0.25rem - 2px);
|
|
140
|
+
background: ${({ theme }) => theme.components.Dropdown.hoverBackground};
|
|
141
|
+
border-left: 2px solid ${({ theme }) => theme.components.Dropdown.borderLeftColor};
|
|
142
|
+
}
|
|
143
|
+
`}
|
|
143
144
|
`;
|
|
144
145
|
export {
|
|
145
146
|
DropdownItemStyled,
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const Flex = require("../Flex/Flex.cjs.js");
|
|
5
|
+
const Title = require("../typography/Title/Title.cjs.js");
|
|
6
|
+
const Text = require("../typography/Text/Text.cjs.js");
|
|
7
|
+
const box = require("../assets/box.svg.cjs.js");
|
|
8
|
+
const EmptyState = ({
|
|
9
|
+
image,
|
|
10
|
+
imageStyle,
|
|
11
|
+
className,
|
|
12
|
+
style,
|
|
13
|
+
title = "No data",
|
|
14
|
+
description = "There is no data",
|
|
15
|
+
children
|
|
16
|
+
}) => {
|
|
17
|
+
const Image = React.useMemo(() => {
|
|
18
|
+
if (image) {
|
|
19
|
+
if (typeof image === "string") {
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21
|
+
"img",
|
|
22
|
+
{
|
|
23
|
+
src: image,
|
|
24
|
+
alt: title,
|
|
25
|
+
style: imageStyle || { width: "64px", height: "64px" }
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return image;
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx(box, { width: 64, height: 64, style: imageStyle });
|
|
32
|
+
}, [image]);
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
34
|
+
Flex,
|
|
35
|
+
{
|
|
36
|
+
direction: "column",
|
|
37
|
+
className,
|
|
38
|
+
style,
|
|
39
|
+
align: "center",
|
|
40
|
+
justify: "center",
|
|
41
|
+
gap: "xs",
|
|
42
|
+
children: [
|
|
43
|
+
Image,
|
|
44
|
+
/* @__PURE__ */ jsxRuntime.jsx(Title, { size: "s", children: title }),
|
|
45
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { children: description }),
|
|
46
|
+
children
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
module.exports = EmptyState;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import Flex from "../Flex/Flex.es.js";
|
|
4
|
+
import Title from "../typography/Title/Title.es.js";
|
|
5
|
+
import Text from "../typography/Text/Text.es.js";
|
|
6
|
+
import SvgBox from "../assets/box.svg.es.js";
|
|
7
|
+
const EmptyState = ({
|
|
8
|
+
image,
|
|
9
|
+
imageStyle,
|
|
10
|
+
className,
|
|
11
|
+
style,
|
|
12
|
+
title = "No data",
|
|
13
|
+
description = "There is no data",
|
|
14
|
+
children
|
|
15
|
+
}) => {
|
|
16
|
+
const Image = useMemo(() => {
|
|
17
|
+
if (image) {
|
|
18
|
+
if (typeof image === "string") {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
"img",
|
|
21
|
+
{
|
|
22
|
+
src: image,
|
|
23
|
+
alt: title,
|
|
24
|
+
style: imageStyle || { width: "64px", height: "64px" }
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
return image;
|
|
29
|
+
}
|
|
30
|
+
return /* @__PURE__ */ jsx(SvgBox, { width: 64, height: 64, style: imageStyle });
|
|
31
|
+
}, [image]);
|
|
32
|
+
return /* @__PURE__ */ jsxs(
|
|
33
|
+
Flex,
|
|
34
|
+
{
|
|
35
|
+
direction: "column",
|
|
36
|
+
className,
|
|
37
|
+
style,
|
|
38
|
+
align: "center",
|
|
39
|
+
justify: "center",
|
|
40
|
+
gap: "xs",
|
|
41
|
+
children: [
|
|
42
|
+
Image,
|
|
43
|
+
/* @__PURE__ */ jsx(Title, { size: "s", children: title }),
|
|
44
|
+
/* @__PURE__ */ jsx(Text, { children: description }),
|
|
45
|
+
children
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
EmptyState as default
|
|
52
|
+
};
|
package/dist/Flex/Flex.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IFlexProps } from './types';
|
|
3
|
-
declare const Flex: React.ForwardRefExoticComponent<IFlexProps & React.RefAttributes<unknown>>;
|
|
3
|
+
declare const Flex: React.ForwardRefExoticComponent<Omit<IFlexProps, "ref"> & React.RefAttributes<unknown>>;
|
|
4
4
|
export default Flex;
|
package/dist/Flex/types.d.ts
CHANGED
|
@@ -20,4 +20,5 @@ export interface IFlexProps {
|
|
|
20
20
|
/** Main-axis alignment (justify-content) */
|
|
21
21
|
justify?: "start" | "center" | "end" | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly";
|
|
22
22
|
wrap?: "wrap" | "wrap-reverse" | "no-wrap";
|
|
23
|
+
[key: string]: any;
|
|
23
24
|
}
|