@quen-ui/components 0.0.14 → 1.0.0
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 +7 -3
- 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 +33 -4
- 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 +17 -7
- 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 +10 -17
- 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 +571 -0
- package/dist/RichTextEditor/plugins.d.ts +2 -0
- package/dist/RichTextEditor/plugins.es.js +571 -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/_virtual/client.cjs.js +5 -0
- package/dist/_virtual/client.cjs2.js +4 -0
- package/dist/_virtual/client.es.js +5 -0
- package/dist/_virtual/client.es2.js +4 -0
- package/dist/_virtual/index.cjs.js +4 -0
- package/dist/_virtual/index.es.js +4 -0
- package/dist/_virtual/react-dom-client.development.cjs.js +4 -0
- package/dist/_virtual/react-dom-client.development.es.js +4 -0
- package/dist/_virtual/react-dom-client.production.cjs.js +4 -0
- package/dist/_virtual/react-dom-client.production.es.js +4 -0
- package/dist/_virtual/scheduler.development.cjs.js +4 -0
- package/dist/_virtual/scheduler.development.es.js +4 -0
- package/dist/_virtual/scheduler.production.cjs.js +4 -0
- package/dist/_virtual/scheduler.production.es.js +4 -0
- package/dist/assets/box.svg.cjs.js +21 -0
- package/dist/assets/box.svg.es.js +5 -0
- package/dist/index.d.ts +1 -50
- 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/node_modules/@tabler/icons-react/dist/esm/createReactComponent.cjs.js +30 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/createReactComponent.es.js +31 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.cjs.js +23 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.es.js +24 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAlignCenter.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAlignCenter.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAlignJustified.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAlignJustified.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAlignLeft.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAlignLeft.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAlignRight.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAlignRight.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowBackUp.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowBackUp.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowForwardUp.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowForwardUp.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconBlockquote.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconBlockquote.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconBold.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconBold.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconClearFormatting.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconClearFormatting.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconH1.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconH1.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconH2.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconH2.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconHighlight.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconHighlight.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconImageInPicture.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconImageInPicture.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconItalic.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconItalic.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconList.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconList.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconListNumbers.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconListNumbers.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconStrikethrough.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconStrikethrough.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSubscript.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSubscript.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSuperscript.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSuperscript.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTable.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTable.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTextColor.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTextColor.es.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconUnderline.cjs.js +7 -0
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconUnderline.es.js +7 -0
- package/dist/node_modules/react-dom/cjs/react-dom-client.development.cjs.js +19870 -0
- package/dist/node_modules/react-dom/cjs/react-dom-client.development.es.js +19870 -0
- package/dist/node_modules/react-dom/cjs/react-dom-client.production.cjs.js +11524 -0
- package/dist/node_modules/react-dom/cjs/react-dom-client.production.es.js +11524 -0
- package/dist/node_modules/react-dom/client.cjs.js +31 -0
- package/dist/node_modules/react-dom/client.es.js +31 -0
- package/dist/node_modules/scheduler/cjs/scheduler.development.cjs.js +264 -0
- package/dist/node_modules/scheduler/cjs/scheduler.development.es.js +264 -0
- package/dist/node_modules/scheduler/cjs/scheduler.production.cjs.js +259 -0
- package/dist/node_modules/scheduler/cjs/scheduler.production.es.js +259 -0
- package/dist/node_modules/scheduler/index.cjs.js +17 -0
- package/dist/node_modules/scheduler/index.es.js +17 -0
- package/dist/packages/components/index.cjs.js +93 -0
- package/dist/packages/components/index.es.js +93 -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 +16 -13
- package/dist/index.cjs.js +0 -63
- package/dist/index.es.js +0 -63
|
@@ -27,7 +27,7 @@ const CheckboxInputStyled = styled.input.withConfig({
|
|
|
27
27
|
})`
|
|
28
28
|
width: ${({ size }) => getSizing(size)};
|
|
29
29
|
height: ${({ size }) => getSizing(size)};
|
|
30
|
-
border: 1px solid ${({ theme }) => theme.
|
|
30
|
+
border: 1px solid ${({ theme }) => theme.components.Checkbox.borderColor};
|
|
31
31
|
transition:
|
|
32
32
|
border-color 0.15s,
|
|
33
33
|
background-color 0.15s;
|
|
@@ -36,6 +36,7 @@ const CheckboxInputStyled = styled.input.withConfig({
|
|
|
36
36
|
cursor: pointer;
|
|
37
37
|
position: relative;
|
|
38
38
|
-webkit-appearance: none;
|
|
39
|
+
border-radius: ${({ theme }) => theme.components.Checkbox.radius};
|
|
39
40
|
|
|
40
41
|
&::before {
|
|
41
42
|
content: "";
|
|
@@ -45,9 +46,9 @@ const CheckboxInputStyled = styled.input.withConfig({
|
|
|
45
46
|
box-sizing: border-box;
|
|
46
47
|
width: calc(${({ size }) => getSizing(size)} * 0.6);
|
|
47
48
|
height: calc(${({ size }) => getSizing(size)} * 0.35);
|
|
48
|
-
background-color: ${({ theme }) => theme.
|
|
49
|
-
border-left: 1px solid ${({ theme }) => theme.
|
|
50
|
-
border-bottom: 1px solid ${({ theme }) => theme.
|
|
49
|
+
background-color: ${({ theme }) => theme.components.Checkbox.backgroundFilled};
|
|
50
|
+
border-left: 1px solid ${({ theme }) => theme.components.Checkbox.checkColor};
|
|
51
|
+
border-bottom: 1px solid ${({ theme }) => theme.components.Checkbox.checkColor};
|
|
51
52
|
opacity: 0;
|
|
52
53
|
transition:
|
|
53
54
|
opacity 0.15s,
|
|
@@ -58,25 +59,25 @@ const CheckboxInputStyled = styled.input.withConfig({
|
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
&:disabled {
|
|
61
|
-
background-color: ${({ theme }) => theme.
|
|
62
|
-
border: 1px solid ${({ theme }) => theme.
|
|
62
|
+
background-color: ${({ theme }) => theme.components.Checkbox.disabledBackground};
|
|
63
|
+
border: 1px solid ${({ theme }) => theme.components.Checkbox.borderDisabledColor};
|
|
63
64
|
cursor: not-allowed;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
&:disabled:checked {
|
|
67
|
-
background-color: ${({ theme }) => theme.
|
|
68
|
-
border: 1px solid ${({ theme }) => theme.
|
|
68
|
+
background-color: ${({ theme }) => theme.components.Checkbox.disabledBackground};
|
|
69
|
+
border: 1px solid ${({ theme }) => theme.components.Checkbox.borderDisabledColor};
|
|
69
70
|
cursor: not-allowed;
|
|
70
71
|
|
|
71
72
|
&:before {
|
|
72
|
-
background-color: ${({ theme }) => theme.
|
|
73
|
-
border-left: 1px solid ${({ theme }) => theme.
|
|
74
|
-
border-bottom: 1px solid ${({ theme }) => theme.
|
|
73
|
+
background-color: ${({ theme }) => theme.components.Checkbox.disabledBackground};
|
|
74
|
+
border-left: 1px solid ${({ theme }) => theme.components.Checkbox.disabledCheckColor};
|
|
75
|
+
border-bottom: 1px solid ${({ theme }) => theme.components.Checkbox.disabledCheckColor};
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
&:checked {
|
|
78
|
-
background-color: ${({ theme }) => theme.
|
|
79
|
-
border-color: ${({ theme }) => theme.
|
|
79
|
+
background-color: ${({ theme }) => theme.components.Checkbox.backgroundFilled};
|
|
80
|
+
border-color: ${({ theme }) => theme.components.Checkbox.borderColor};
|
|
80
81
|
|
|
81
82
|
&::before {
|
|
82
83
|
opacity: 1;
|
|
@@ -85,15 +86,15 @@ const CheckboxInputStyled = styled.input.withConfig({
|
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
&:hover:not(:disabled) {
|
|
88
|
-
border: 1px solid ${({ theme }) => theme.
|
|
89
|
+
border: 1px solid ${({ theme }) => theme.components.Checkbox.backgroundFilled};
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
&:hover:checked:not(:disabled) {
|
|
92
|
-
border-color: ${({ theme }) => theme.
|
|
93
|
-
background-color: ${({ theme }) => theme.
|
|
93
|
+
border-color: ${({ theme }) => theme.components.Checkbox.backgroundFilled};
|
|
94
|
+
background-color: ${({ theme }) => theme.components.Checkbox.backgroundFilled};
|
|
94
95
|
|
|
95
96
|
&:before {
|
|
96
|
-
background-color: ${({ theme }) => theme.
|
|
97
|
+
background-color: ${({ theme }) => theme.components.Checkbox.backgroundFilled};
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
|
|
@@ -101,14 +102,14 @@ const CheckboxInputStyled = styled.input.withConfig({
|
|
|
101
102
|
&,
|
|
102
103
|
&:hover,
|
|
103
104
|
&:checked {
|
|
104
|
-
background-color: ${({ theme: theme2 }) => theme2.
|
|
105
|
-
border-color: ${({ theme: theme2 }) => theme2.
|
|
105
|
+
background-color: ${({ theme: theme2 }) => theme2.components.Checkbox.backgroundFilled};
|
|
106
|
+
border-color: ${({ theme: theme2 }) => theme2.components.Checkbox.borderColor};
|
|
106
107
|
&::before {
|
|
107
108
|
top: calc(calc(${getSizing(size)} - 0.125rem) / 2);
|
|
108
109
|
left: 0.125rem;
|
|
109
110
|
width: calc(${getSizing(size)} - 0.125rem * 2 - 0.125rem);
|
|
110
111
|
height: 0.125rem;
|
|
111
|
-
background-color: ${theme.
|
|
112
|
+
background-color: ${theme.components.Checkbox.checkColor};
|
|
112
113
|
border: none;
|
|
113
114
|
opacity: 1;
|
|
114
115
|
transition:
|
|
@@ -128,15 +129,15 @@ const CheckboxGroupWrapper = styled.div.withConfig({
|
|
|
128
129
|
flex-direction: ${({ direction }) => direction === "horizontal" ? "row" : "column"};
|
|
129
130
|
|
|
130
131
|
.checkbox-group__required {
|
|
131
|
-
color: ${({ theme }) => theme.
|
|
132
|
+
color: ${({ theme }) => theme.components.Checkbox.errorColor};
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
.checkbox-group__error-message {
|
|
135
|
-
color: ${({ theme }) => theme.
|
|
136
|
+
color: ${({ theme }) => theme.components.Checkbox.errorColor};
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
${({ isError, theme }) => isError && css`
|
|
139
|
-
border-left: 2px solid ${theme.
|
|
140
|
+
border-left: 2px solid ${theme.components.Checkbox.borderErrorColor};
|
|
140
141
|
padding-left: 0.5rem;
|
|
141
142
|
`};
|
|
142
143
|
`;
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const polished = require("polished");
|
|
5
|
+
const hooks = require("@quen-ui/hooks");
|
|
6
|
+
const styles = require("./styles.cjs.js");
|
|
7
|
+
const helpers = require("./helpers.cjs.js");
|
|
8
|
+
const InputsColor = require("./InputsColor.cjs.js");
|
|
9
|
+
const Flex = require("../Flex/Flex.cjs.js");
|
|
10
|
+
const getHslValue = (value) => {
|
|
11
|
+
if (value < 0) {
|
|
12
|
+
return 0;
|
|
13
|
+
} else if (value > 1) {
|
|
14
|
+
return 1;
|
|
15
|
+
}
|
|
16
|
+
return value;
|
|
17
|
+
};
|
|
18
|
+
const getHslHue = (value) => {
|
|
19
|
+
if (value < 0) {
|
|
20
|
+
return 0;
|
|
21
|
+
} else if (value > 360) {
|
|
22
|
+
return 360;
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
};
|
|
26
|
+
const ColorPicker = ({
|
|
27
|
+
value,
|
|
28
|
+
defaultValue,
|
|
29
|
+
onChange,
|
|
30
|
+
disabled,
|
|
31
|
+
format = "hex",
|
|
32
|
+
onChangeComplete,
|
|
33
|
+
size = "m",
|
|
34
|
+
className,
|
|
35
|
+
style,
|
|
36
|
+
hideInputs,
|
|
37
|
+
hidePresets,
|
|
38
|
+
presets
|
|
39
|
+
}) => {
|
|
40
|
+
const [internal, setInternal] = hooks.useControllableState({
|
|
41
|
+
value,
|
|
42
|
+
defaultValue,
|
|
43
|
+
onChange
|
|
44
|
+
});
|
|
45
|
+
const initialHsl = React.useMemo(
|
|
46
|
+
() => helpers.parseColor(internal ?? defaultValue),
|
|
47
|
+
[defaultValue]
|
|
48
|
+
);
|
|
49
|
+
const isAlpha = React.useMemo(() => {
|
|
50
|
+
return ["hexa", "rgba", "hsla"].includes(format);
|
|
51
|
+
}, [format]);
|
|
52
|
+
const [hsl, setHsl] = React.useState(initialHsl);
|
|
53
|
+
const [position, setPosition] = React.useState({
|
|
54
|
+
x: 0,
|
|
55
|
+
y: 0
|
|
56
|
+
});
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
if (["hex", "hsl", "rgb"].includes(format)) {
|
|
59
|
+
pushChange({ ...hsl, alpha: 1 }, true);
|
|
60
|
+
}
|
|
61
|
+
}, [format]);
|
|
62
|
+
const pushChange = React.useCallback(
|
|
63
|
+
(next, isComplete = false) => {
|
|
64
|
+
if (!disabled) {
|
|
65
|
+
const out = {
|
|
66
|
+
hue: next.hue,
|
|
67
|
+
saturation: next.saturation,
|
|
68
|
+
lightness: next.lightness,
|
|
69
|
+
alpha: "alpha" in next ? helpers.clamp(next.alpha, 0, 1) : 1
|
|
70
|
+
};
|
|
71
|
+
setHsl(out);
|
|
72
|
+
const formatted = helpers.formatColor(out, format);
|
|
73
|
+
setInternal(formatted);
|
|
74
|
+
if (isComplete && onChangeComplete) {
|
|
75
|
+
onChangeComplete(formatted);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
[setInternal, onChangeComplete, format, disabled]
|
|
80
|
+
);
|
|
81
|
+
const satRef = React.useRef(null);
|
|
82
|
+
const isDraggingRef = React.useRef(false);
|
|
83
|
+
const getRelativePositionFromEvent = (e, el) => {
|
|
84
|
+
const rect = el.getBoundingClientRect();
|
|
85
|
+
let clientX = 0, clientY = 0;
|
|
86
|
+
if (e.touches) {
|
|
87
|
+
const t = e.touches[0];
|
|
88
|
+
clientX = t.clientX;
|
|
89
|
+
clientY = t.clientY;
|
|
90
|
+
} else {
|
|
91
|
+
const m = e;
|
|
92
|
+
clientX = m.clientX;
|
|
93
|
+
clientY = m.clientY;
|
|
94
|
+
}
|
|
95
|
+
const x = Number(((clientX - rect.left) / rect.width).toFixed(2));
|
|
96
|
+
const y = Number(((clientY - rect.top) / rect.height).toFixed(2));
|
|
97
|
+
return { x, y };
|
|
98
|
+
};
|
|
99
|
+
const getSaturationLightness = (e, el) => {
|
|
100
|
+
const { x, y } = getRelativePositionFromEvent(e, el);
|
|
101
|
+
setPosition({ x: getHslValue(x), y: getHslValue(y) });
|
|
102
|
+
return {
|
|
103
|
+
saturation: getHslValue(x),
|
|
104
|
+
lightness: getHslValue(1 - 0.5 * x - y + 0.5 * x * y)
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
React.useEffect(() => {
|
|
108
|
+
function onPointerMove(e) {
|
|
109
|
+
if (!isDraggingRef.current || !satRef.current) return;
|
|
110
|
+
const { saturation, lightness } = getSaturationLightness(
|
|
111
|
+
e,
|
|
112
|
+
satRef.current
|
|
113
|
+
);
|
|
114
|
+
pushChange({
|
|
115
|
+
...hsl,
|
|
116
|
+
saturation,
|
|
117
|
+
lightness
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function onPointerUp(e) {
|
|
121
|
+
if (!isDraggingRef.current) return;
|
|
122
|
+
isDraggingRef.current = false;
|
|
123
|
+
if (satRef.current) {
|
|
124
|
+
const { saturation, lightness } = getSaturationLightness(
|
|
125
|
+
e,
|
|
126
|
+
satRef.current
|
|
127
|
+
);
|
|
128
|
+
pushChange(
|
|
129
|
+
{
|
|
130
|
+
...hsl,
|
|
131
|
+
saturation,
|
|
132
|
+
lightness
|
|
133
|
+
},
|
|
134
|
+
true
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
window.removeEventListener("pointermove", onPointerMove);
|
|
138
|
+
window.removeEventListener("pointerup", onPointerUp);
|
|
139
|
+
}
|
|
140
|
+
if (typeof window !== "undefined") {
|
|
141
|
+
window.addEventListener("pointermove", onPointerMove);
|
|
142
|
+
window.addEventListener("pointerup", onPointerUp);
|
|
143
|
+
}
|
|
144
|
+
return () => {
|
|
145
|
+
if (typeof window !== "undefined") {
|
|
146
|
+
window.removeEventListener("pointermove", onPointerMove);
|
|
147
|
+
window.removeEventListener("pointerup", onPointerUp);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}, [hsl, pushChange]);
|
|
151
|
+
const onSatPointerDown = (e) => {
|
|
152
|
+
if (disabled) return;
|
|
153
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
154
|
+
isDraggingRef.current = true;
|
|
155
|
+
if (satRef.current) {
|
|
156
|
+
const { saturation, lightness } = getSaturationLightness(
|
|
157
|
+
e.nativeEvent,
|
|
158
|
+
satRef.current
|
|
159
|
+
);
|
|
160
|
+
pushChange({
|
|
161
|
+
...hsl,
|
|
162
|
+
saturation,
|
|
163
|
+
lightness
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
const hueRef = React.useRef(null);
|
|
168
|
+
const onHuePointerDown = (e) => {
|
|
169
|
+
if (disabled) return;
|
|
170
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
171
|
+
const onMove = (ev) => {
|
|
172
|
+
if (!hueRef.current) return;
|
|
173
|
+
const pos = getRelativePositionFromEvent(ev, hueRef.current);
|
|
174
|
+
const hue = pos.x * 360;
|
|
175
|
+
pushChange({ ...hsl, hue: getHslHue(hue) });
|
|
176
|
+
};
|
|
177
|
+
const onUp = (ev) => {
|
|
178
|
+
if (!hueRef.current) return;
|
|
179
|
+
const pos = getRelativePositionFromEvent(ev, hueRef.current);
|
|
180
|
+
const hue = pos.x * 360;
|
|
181
|
+
pushChange({ ...hsl, hue: getHslHue(hue) }, true);
|
|
182
|
+
window.removeEventListener("pointermove", onMove);
|
|
183
|
+
window.removeEventListener("pointerup", onUp);
|
|
184
|
+
};
|
|
185
|
+
window.addEventListener("pointermove", onMove);
|
|
186
|
+
window.addEventListener("pointerup", onUp);
|
|
187
|
+
};
|
|
188
|
+
const alphaRef = React.useRef(null);
|
|
189
|
+
const onAlphaPointerDown = (e) => {
|
|
190
|
+
if (disabled) return;
|
|
191
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
192
|
+
const onMove = (ev) => {
|
|
193
|
+
if (!alphaRef.current) return;
|
|
194
|
+
const pos = getRelativePositionFromEvent(ev, alphaRef.current);
|
|
195
|
+
const alpha = pos.x;
|
|
196
|
+
pushChange({ ...hsl, alpha }, false);
|
|
197
|
+
};
|
|
198
|
+
const onUp = (ev) => {
|
|
199
|
+
if (!alphaRef.current) return;
|
|
200
|
+
const pos = getRelativePositionFromEvent(ev, alphaRef.current);
|
|
201
|
+
const alpha = pos.x;
|
|
202
|
+
pushChange({ ...hsl, alpha }, true);
|
|
203
|
+
window.removeEventListener("pointermove", onMove);
|
|
204
|
+
window.removeEventListener("pointerup", onUp);
|
|
205
|
+
};
|
|
206
|
+
window.addEventListener("pointermove", onMove);
|
|
207
|
+
window.addEventListener("pointerup", onUp);
|
|
208
|
+
};
|
|
209
|
+
const [inputValue, setInputValue] = React.useState(() => helpers.formatColor(hsl, format));
|
|
210
|
+
React.useEffect(() => {
|
|
211
|
+
setInputValue(helpers.formatColor(hsl, format));
|
|
212
|
+
}, [hsl, format]);
|
|
213
|
+
const onChangeHexInput = (v) => {
|
|
214
|
+
setInputValue(v);
|
|
215
|
+
try {
|
|
216
|
+
const parsed = helpers.parseColor(v);
|
|
217
|
+
pushChange(parsed, false);
|
|
218
|
+
} catch (err) {
|
|
219
|
+
window.console.error(err);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
const applyInput = () => {
|
|
223
|
+
try {
|
|
224
|
+
const parsed = helpers.parseColor(inputValue);
|
|
225
|
+
pushChange(parsed, true);
|
|
226
|
+
} catch (err) {
|
|
227
|
+
window.console.error(err);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
const onPresetClick = (p) => {
|
|
231
|
+
const parsed = helpers.parseColor(p);
|
|
232
|
+
pushChange(parsed, true);
|
|
233
|
+
};
|
|
234
|
+
const onHueKeyDown = (e) => {
|
|
235
|
+
if (disabled) return;
|
|
236
|
+
let delta = 0;
|
|
237
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowDown") delta = -1;
|
|
238
|
+
if (e.key === "ArrowRight" || e.key === "ArrowUp") delta = 1;
|
|
239
|
+
if (e.key === "PageUp") delta = 10;
|
|
240
|
+
if (e.key === "PageDown") delta = -10;
|
|
241
|
+
if (delta !== 0) {
|
|
242
|
+
e.preventDefault();
|
|
243
|
+
pushChange({ ...hsl }, true);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
const onChangeRGBInput = (value2) => {
|
|
247
|
+
pushChange(polished.parseToHsl(polished.rgbToColorString(value2)), true);
|
|
248
|
+
};
|
|
249
|
+
const hex = polished.hslToColorString(hsl);
|
|
250
|
+
const rgb = polished.parseToRgb(hex);
|
|
251
|
+
return /* @__PURE__ */ jsxRuntime.jsx(styles.ColorPickerWrapper, { size, className, style, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
252
|
+
styles.ColorPickerPanel,
|
|
253
|
+
{
|
|
254
|
+
role: "group",
|
|
255
|
+
"aria-label": "Color picker panel",
|
|
256
|
+
size,
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", gap: "s", children: [
|
|
259
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
260
|
+
styles.ColorPickerSaturationWrapStyled,
|
|
261
|
+
{
|
|
262
|
+
ref: satRef,
|
|
263
|
+
onPointerDown: onSatPointerDown,
|
|
264
|
+
"aria-label": "Saturation and lightness",
|
|
265
|
+
role: "application",
|
|
266
|
+
children: [
|
|
267
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
268
|
+
styles.ColorPickerSaturationGradientStyled,
|
|
269
|
+
{
|
|
270
|
+
color: `hsl(${hsl.hue}, 100%, 50%)`
|
|
271
|
+
}
|
|
272
|
+
),
|
|
273
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
274
|
+
styles.ColorPickerThumbStyled,
|
|
275
|
+
{
|
|
276
|
+
size,
|
|
277
|
+
left: position.x * 100,
|
|
278
|
+
top: position.y * 100
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: "s", children: [
|
|
285
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", gap: "s", style: { width: "100%" }, children: [
|
|
286
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
287
|
+
styles.ColorPickerSliderStyled,
|
|
288
|
+
{
|
|
289
|
+
size,
|
|
290
|
+
ref: hueRef,
|
|
291
|
+
onPointerDown: onHuePointerDown,
|
|
292
|
+
role: "slider",
|
|
293
|
+
tabIndex: 0,
|
|
294
|
+
onKeyDown: onHueKeyDown,
|
|
295
|
+
"aria-valuenow": Math.round(hsl.hue),
|
|
296
|
+
"aria-label": "Hue",
|
|
297
|
+
children: [
|
|
298
|
+
/* @__PURE__ */ jsxRuntime.jsx(styles.ColorPickerSliderHueTrackStyled, {}),
|
|
299
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
300
|
+
styles.ColorPickerSliderThumbStyled,
|
|
301
|
+
{
|
|
302
|
+
size,
|
|
303
|
+
left: hsl.hue / 360 * 100
|
|
304
|
+
}
|
|
305
|
+
)
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
),
|
|
309
|
+
isAlpha && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
310
|
+
styles.ColorPickerSliderStyled,
|
|
311
|
+
{
|
|
312
|
+
size,
|
|
313
|
+
ref: alphaRef,
|
|
314
|
+
onPointerDown: onAlphaPointerDown,
|
|
315
|
+
role: "slider",
|
|
316
|
+
tabIndex: 0,
|
|
317
|
+
onKeyDown: onHueKeyDown,
|
|
318
|
+
"aria-valuenow": Math.round(hsl.hue),
|
|
319
|
+
"aria-label": "Alpha",
|
|
320
|
+
children: [
|
|
321
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
322
|
+
styles.ColorPickerSliderTrackStyled,
|
|
323
|
+
{
|
|
324
|
+
bg: `linear-gradient(to right, rgba(${rgb.red},${rgb.green},${rgb.blue},0) 0%, rgba(${rgb.red},${rgb.green},${rgb.blue},1) 100%)`
|
|
325
|
+
}
|
|
326
|
+
),
|
|
327
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
328
|
+
styles.ColorPickerSliderThumbStyled,
|
|
329
|
+
{
|
|
330
|
+
size,
|
|
331
|
+
left: "alpha" in hsl ? (hsl.alpha ?? 1) * 100 : 100
|
|
332
|
+
}
|
|
333
|
+
)
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
),
|
|
337
|
+
!isAlpha && !hideInputs && /* @__PURE__ */ jsxRuntime.jsx(
|
|
338
|
+
InputsColor,
|
|
339
|
+
{
|
|
340
|
+
disabled,
|
|
341
|
+
format,
|
|
342
|
+
onChangeHex: onChangeHexInput,
|
|
343
|
+
onBlur: applyInput,
|
|
344
|
+
size,
|
|
345
|
+
onChangeRGB: onChangeRGBInput,
|
|
346
|
+
hsl,
|
|
347
|
+
onChangeHSL: (value2) => pushChange(value2, true)
|
|
348
|
+
}
|
|
349
|
+
)
|
|
350
|
+
] }),
|
|
351
|
+
size !== "xs" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
352
|
+
styles.ColorPickerPreviewSwatchStyled,
|
|
353
|
+
{
|
|
354
|
+
hiddenInputs: hideInputs,
|
|
355
|
+
isAlpha,
|
|
356
|
+
size,
|
|
357
|
+
color: helpers.formatColor(hsl, "rgba"),
|
|
358
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "quen-ui__color-picker__preview-swatch__inner" })
|
|
359
|
+
}
|
|
360
|
+
)
|
|
361
|
+
] }),
|
|
362
|
+
size === "xs" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
363
|
+
styles.ColorPickerPreviewSwatchStyled,
|
|
364
|
+
{
|
|
365
|
+
size,
|
|
366
|
+
color: helpers.formatColor(hsl, "rgba"),
|
|
367
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "quen-ui__color-picker__preview-swatch__inner" })
|
|
368
|
+
}
|
|
369
|
+
)
|
|
370
|
+
] }),
|
|
371
|
+
(isAlpha && !hideInputs || !hidePresets && presets?.length) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", gap: "s", children: [
|
|
372
|
+
isAlpha && !hideInputs && /* @__PURE__ */ jsxRuntime.jsx(Flex, { direction: "column", gap: "s", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
373
|
+
InputsColor,
|
|
374
|
+
{
|
|
375
|
+
disabled,
|
|
376
|
+
format,
|
|
377
|
+
onChangeHex: onChangeHexInput,
|
|
378
|
+
onBlur: applyInput,
|
|
379
|
+
size,
|
|
380
|
+
onChangeRGB: onChangeRGBInput,
|
|
381
|
+
hsl,
|
|
382
|
+
onChangeHSL: (value2) => pushChange(value2, true)
|
|
383
|
+
}
|
|
384
|
+
) }),
|
|
385
|
+
!hidePresets && presets?.length && /* @__PURE__ */ jsxRuntime.jsx(Flex, { gap: "s", wrap: "wrap", children: presets.map((p, i) => {
|
|
386
|
+
const active = helpers.formatColor(helpers.parseColor(p), "hex") === helpers.formatColor(hsl, "hex");
|
|
387
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
388
|
+
styles.ColorPickerPresetStyled,
|
|
389
|
+
{
|
|
390
|
+
size,
|
|
391
|
+
color: typeof p === "string" ? p : helpers.formatColor(helpers.parseColor(p), "rgba"),
|
|
392
|
+
active,
|
|
393
|
+
onClick: () => !disabled && onPresetClick(p),
|
|
394
|
+
"aria-pressed": active
|
|
395
|
+
},
|
|
396
|
+
i
|
|
397
|
+
);
|
|
398
|
+
}) })
|
|
399
|
+
] })
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
) });
|
|
403
|
+
};
|
|
404
|
+
module.exports = ColorPicker;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IColorPickerProps } from './types';
|
|
2
|
+
declare const ColorPicker: ({ value, defaultValue, onChange, disabled, format, onChangeComplete, size, className, style, hideInputs, hidePresets, presets }: IColorPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default ColorPicker;
|