@chayns-components/core 5.0.0-beta.44 → 5.0.0-beta.441
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 +3 -19
- package/lib/api/image/post.d.ts +16 -0
- package/lib/api/image/post.js +34 -0
- package/lib/api/image/post.js.map +1 -0
- package/lib/api/signature/delete.d.ts +1 -0
- package/lib/api/signature/delete.js +34 -0
- package/lib/api/signature/delete.js.map +1 -0
- package/lib/api/signature/get.d.ts +1 -0
- package/lib/api/signature/get.js +40 -0
- package/lib/api/signature/get.js.map +1 -0
- package/lib/api/signature/put.d.ts +1 -0
- package/lib/api/signature/put.js +38 -0
- package/lib/api/signature/put.js.map +1 -0
- package/lib/api/theme/get.d.ts +2 -0
- package/lib/api/theme/get.js +21 -0
- package/lib/api/theme/get.js.map +1 -0
- package/lib/api/video/post.d.ts +16 -0
- package/lib/api/video/post.js +31 -0
- package/lib/api/video/post.js.map +1 -0
- package/lib/components/accordion/Accordion.d.ts +32 -3
- package/lib/components/accordion/Accordion.js +61 -22
- package/lib/components/accordion/Accordion.js.map +1 -1
- package/lib/components/accordion/Accordion.styles.d.ts +6 -4
- package/lib/components/accordion/Accordion.styles.js +55 -33
- package/lib/components/accordion/Accordion.styles.js.map +1 -1
- package/lib/components/accordion/accordion-body/AccordionBody.d.ts +21 -2
- package/lib/components/accordion/accordion-body/AccordionBody.js +17 -11
- package/lib/components/accordion/accordion-body/AccordionBody.js.map +1 -1
- package/lib/components/accordion/accordion-body/AccordionBody.styles.d.ts +268 -1
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js +14 -4
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
- package/lib/components/accordion/accordion-content/AccordionContent.d.ts +9 -2
- package/lib/components/accordion/accordion-content/AccordionContent.js +5 -4
- package/lib/components/accordion/accordion-content/AccordionContent.js.map +1 -1
- package/lib/components/accordion/accordion-content/AccordionContent.styles.d.ts +6 -4
- package/lib/components/accordion/accordion-content/AccordionContent.styles.js +3 -4
- package/lib/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
- package/lib/components/accordion/accordion-group/AccordionGroup.d.ts +4 -3
- package/lib/components/accordion/accordion-group/AccordionGroup.js +6 -6
- package/lib/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
- package/lib/components/accordion/accordion-head/AccordionHead.d.ts +3 -1
- package/lib/components/accordion/accordion-head/AccordionHead.js +32 -14
- package/lib/components/accordion/accordion-head/AccordionHead.js.map +1 -1
- package/lib/components/accordion/accordion-head/AccordionHead.styles.d.ts +2421 -12
- package/lib/components/accordion/accordion-head/AccordionHead.styles.js +56 -39
- package/lib/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
- package/lib/components/accordion/accordion-intro/AccordionIntro.d.ts +1 -1
- package/lib/components/accordion/accordion-intro/AccordionIntro.js +1 -2
- package/lib/components/accordion/accordion-intro/AccordionIntro.js.map +1 -1
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.d.ts +2 -1
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js +1 -2
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js.map +1 -1
- package/lib/components/accordion/accordion-item/AccordionItem.d.ts +9 -0
- package/lib/components/accordion/accordion-item/AccordionItem.js +27 -0
- package/lib/components/accordion/accordion-item/AccordionItem.js.map +1 -0
- package/lib/components/accordion/accordion-item/AccordionItem.styles.d.ts +7 -0
- package/lib/components/accordion/accordion-item/AccordionItem.styles.js +33 -0
- package/lib/components/accordion/accordion-item/AccordionItem.styles.js.map +1 -0
- package/lib/components/amount-control/AmountControl.d.ts +22 -0
- package/lib/components/amount-control/AmountControl.js +185 -0
- package/lib/components/amount-control/AmountControl.js.map +1 -0
- package/lib/components/amount-control/AmountControl.styles.d.ts +288 -0
- package/lib/components/amount-control/AmountControl.styles.js +58 -0
- package/lib/components/amount-control/AmountControl.styles.js.map +1 -0
- package/lib/components/badge/Badge.d.ts +1 -1
- package/lib/components/badge/Badge.js +1 -2
- package/lib/components/badge/Badge.js.map +1 -1
- package/lib/components/badge/Badge.styles.d.ts +5 -3
- package/lib/components/badge/Badge.styles.js +3 -4
- package/lib/components/badge/Badge.styles.js.map +1 -1
- package/lib/components/button/Button.d.ts +6 -2
- package/lib/components/button/Button.js +56 -4
- package/lib/components/button/Button.js.map +1 -1
- package/lib/components/button/Button.styles.d.ts +539 -4
- package/lib/components/button/Button.styles.js +43 -17
- package/lib/components/button/Button.styles.js.map +1 -1
- package/lib/components/checkbox/Checkbox.d.ts +11 -3
- package/lib/components/checkbox/Checkbox.js +13 -8
- package/lib/components/checkbox/Checkbox.js.map +1 -1
- package/lib/components/checkbox/Checkbox.styles.d.ts +12 -5
- package/lib/components/checkbox/Checkbox.styles.js +51 -36
- package/lib/components/checkbox/Checkbox.styles.js.map +1 -1
- package/lib/components/color-scheme-provider/ColorSchemeProvider.d.ts +8 -2
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js +56 -24
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/components/combobox/ComboBox.d.ts +43 -0
- package/lib/components/combobox/ComboBox.js +192 -0
- package/lib/components/combobox/ComboBox.js.map +1 -0
- package/lib/components/combobox/ComboBox.styles.d.ts +291 -0
- package/lib/components/combobox/ComboBox.styles.js +206 -0
- package/lib/components/combobox/ComboBox.styles.js.map +1 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.d.ts +12 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.js +40 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.js.map +1 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.styles.d.ts +11 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js +62 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js.map +1 -0
- package/lib/components/content-card/ContentCard.d.ts +13 -0
- package/lib/components/content-card/ContentCard.js +21 -0
- package/lib/components/content-card/ContentCard.js.map +1 -0
- package/lib/components/content-card/ContentCard.styles.d.ts +2 -0
- package/lib/components/content-card/ContentCard.styles.js +39 -0
- package/lib/components/content-card/ContentCard.styles.js.map +1 -0
- package/lib/components/context-menu/ContextMenu.d.ts +6 -6
- package/lib/components/context-menu/ContextMenu.js +25 -26
- package/lib/components/context-menu/ContextMenu.js.map +1 -1
- package/lib/components/context-menu/ContextMenu.styles.d.ts +2 -1
- package/lib/components/context-menu/ContextMenu.styles.js +1 -2
- package/lib/components/context-menu/ContextMenu.styles.js.map +1 -1
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.d.ts +2 -2
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.js +9 -8
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +274 -9
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js +19 -24
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -1
- package/lib/components/file-input/FileInput.d.ts +29 -0
- package/lib/components/file-input/FileInput.js +121 -0
- package/lib/components/file-input/FileInput.js.map +1 -0
- package/lib/components/file-input/FileInput.styles.d.ts +277 -0
- package/lib/components/file-input/FileInput.styles.js +46 -0
- package/lib/components/file-input/FileInput.styles.js.map +1 -0
- package/lib/components/file-input/file-list/FileListItem.d.ts +9 -0
- package/lib/components/file-input/file-list/FileListItem.js +36 -0
- package/lib/components/file-input/file-list/FileListItem.js.map +1 -0
- package/lib/components/file-input/file-list/FileListItem.styles.d.ts +2 -0
- package/lib/components/file-input/file-list/FileListItem.styles.js +10 -0
- package/lib/components/file-input/file-list/FileListItem.styles.js.map +1 -0
- package/lib/components/filter-buttons/FilterButtons.d.ts +22 -0
- package/lib/components/filter-buttons/FilterButtons.js +88 -0
- package/lib/components/filter-buttons/FilterButtons.js.map +1 -0
- package/lib/components/filter-buttons/FilterButtons.styles.d.ts +2 -0
- package/lib/components/filter-buttons/FilterButtons.styles.js +14 -0
- package/lib/components/filter-buttons/FilterButtons.styles.js.map +1 -0
- package/lib/components/filter-buttons/filter-button/FilterButton.d.ts +14 -0
- package/lib/components/filter-buttons/filter-button/FilterButton.js +47 -0
- package/lib/components/filter-buttons/filter-button/FilterButton.js.map +1 -0
- package/lib/components/filter-buttons/filter-button/FilterButton.styles.d.ts +287 -0
- package/lib/components/filter-buttons/filter-button/FilterButton.styles.js +106 -0
- package/lib/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -0
- package/lib/components/grid-image/GridImage.d.ts +1 -1
- package/lib/components/grid-image/GridImage.js +3 -4
- package/lib/components/grid-image/GridImage.js.map +1 -1
- package/lib/components/grid-image/GridImage.styles.d.ts +12 -11
- package/lib/components/grid-image/GridImage.styles.js +4 -8
- package/lib/components/grid-image/GridImage.styles.js.map +1 -1
- package/lib/components/icon/Icon.d.ts +1 -1
- package/lib/components/icon/Icon.js +7 -6
- package/lib/components/icon/Icon.js.map +1 -1
- package/lib/components/icon/Icon.styles.d.ts +7 -7
- package/lib/components/icon/Icon.styles.js +6 -8
- package/lib/components/icon/Icon.styles.js.map +1 -1
- package/lib/components/input/Input.d.ts +43 -3
- package/lib/components/input/Input.js +65 -15
- package/lib/components/input/Input.js.map +1 -1
- package/lib/components/input/Input.styles.d.ts +548 -6
- package/lib/components/input/Input.styles.js +104 -34
- package/lib/components/input/Input.styles.js.map +1 -1
- package/lib/components/list/List.d.ts +1 -1
- package/lib/components/list/List.js +4 -6
- package/lib/components/list/List.js.map +1 -1
- package/lib/components/list/list-item/ListItem.d.ts +2 -2
- package/lib/components/list/list-item/ListItem.js +7 -6
- package/lib/components/list/list-item/ListItem.js.map +1 -1
- package/lib/components/list/list-item/ListItem.styles.d.ts +6 -4
- package/lib/components/list/list-item/ListItem.styles.js +14 -26
- package/lib/components/list/list-item/ListItem.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-body/ListItemBody.d.ts +6 -2
- package/lib/components/list/list-item/list-item-body/ListItemBody.js +28 -7
- package/lib/components/list/list-item/list-item-body/ListItemBody.js.map +1 -1
- package/lib/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +267 -1
- package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js +1 -2
- package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-content/ListItemContent.d.ts +8 -2
- package/lib/components/list/list-item/list-item-content/ListItemContent.js +1 -2
- package/lib/components/list/list-item/list-item-content/ListItemContent.js.map +1 -1
- package/lib/components/list/list-item/list-item-content/ListItemContent.styles.d.ts +2 -1
- package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js +1 -2
- package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/ListItemHead.d.ts +1 -1
- package/lib/components/list/list-item/list-item-head/ListItemHead.js +4 -5
- package/lib/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +544 -14
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js +13 -24
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.d.ts +1 -1
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js +1 -2
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.d.ts +2 -1
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js +1 -2
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.d.ts +1 -1
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js +3 -4
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.d.ts +8 -7
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js +2 -4
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js.map +1 -1
- package/lib/components/mention-finder/MentionFinder.d.ts +31 -0
- package/lib/components/mention-finder/MentionFinder.js +139 -0
- package/lib/components/mention-finder/MentionFinder.js.map +1 -0
- package/lib/components/mention-finder/MentionFinder.styles.d.ts +270 -0
- package/lib/components/mention-finder/MentionFinder.styles.js +92 -0
- package/lib/components/mention-finder/MentionFinder.styles.js.map +1 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.d.ts +10 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js +31 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js.map +1 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.d.ts +10 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js +91 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -0
- package/lib/components/number-input/NumberInput.d.ts +54 -0
- package/lib/components/number-input/NumberInput.js +142 -0
- package/lib/components/number-input/NumberInput.js.map +1 -0
- package/lib/components/popup/Popup.d.ts +30 -0
- package/lib/components/popup/Popup.js +161 -0
- package/lib/components/popup/Popup.js.map +1 -0
- package/lib/components/popup/Popup.styles.d.ts +5 -0
- package/lib/components/popup/Popup.styles.js +28 -0
- package/lib/components/popup/Popup.styles.js.map +1 -0
- package/lib/components/popup/popup-content/PopupContent.d.ts +10 -0
- package/lib/components/popup/popup-content/PopupContent.js +69 -0
- package/lib/components/popup/popup-content/PopupContent.js.map +1 -0
- package/lib/components/popup/popup-content/PopupContent.styles.d.ts +274 -0
- package/lib/components/popup/popup-content/PopupContent.styles.js +92 -0
- package/lib/components/popup/popup-content/PopupContent.styles.js.map +1 -0
- package/lib/components/progress-bar/ProgressBar.d.ts +13 -0
- package/lib/components/progress-bar/ProgressBar.js +39 -0
- package/lib/components/progress-bar/ProgressBar.js.map +1 -0
- package/lib/components/progress-bar/ProgressBar.styles.d.ts +272 -0
- package/lib/components/progress-bar/ProgressBar.styles.js +37 -0
- package/lib/components/progress-bar/ProgressBar.styles.js.map +1 -0
- package/lib/components/radio-button/RadioButton.d.ts +30 -0
- package/lib/components/radio-button/RadioButton.js +100 -0
- package/lib/components/radio-button/RadioButton.js.map +1 -0
- package/lib/components/radio-button/RadioButton.styles.d.ts +287 -0
- package/lib/components/radio-button/RadioButton.styles.js +105 -0
- package/lib/components/radio-button/RadioButton.styles.js.map +1 -0
- package/lib/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +17 -0
- package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js +46 -0
- package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -0
- package/lib/components/scroll-view/ScrollView.d.ts +13 -0
- package/lib/components/scroll-view/ScrollView.js +27 -0
- package/lib/components/scroll-view/ScrollView.js.map +1 -0
- package/lib/components/scroll-view/ScrollView.styles.d.ts +9 -0
- package/lib/components/scroll-view/ScrollView.styles.js +49 -0
- package/lib/components/scroll-view/ScrollView.styles.js.map +1 -0
- package/lib/components/search-box/SearchBox.d.ts +38 -0
- package/lib/components/search-box/SearchBox.js +255 -0
- package/lib/components/search-box/SearchBox.js.map +1 -0
- package/lib/components/search-box/SearchBox.styles.d.ts +274 -0
- package/lib/components/search-box/SearchBox.styles.js +79 -0
- package/lib/components/search-box/SearchBox.styles.js.map +1 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.d.ts +11 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.js +35 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.js.map +1 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.styles.d.ts +13 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js +63 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js.map +1 -0
- package/lib/components/search-input/SearchInput.d.ts +33 -0
- package/lib/components/search-input/SearchInput.js +102 -0
- package/lib/components/search-input/SearchInput.js.map +1 -0
- package/lib/components/search-input/SearchInput.styles.d.ts +534 -0
- package/lib/components/search-input/SearchInput.styles.js +26 -0
- package/lib/components/search-input/SearchInput.styles.js.map +1 -0
- package/lib/components/select-button/SelectButton.d.ts +34 -0
- package/lib/components/select-button/SelectButton.js +65 -0
- package/lib/components/select-button/SelectButton.js.map +1 -0
- package/lib/components/select-button/SelectButton.styles.d.ts +2 -0
- package/lib/components/select-button/SelectButton.styles.js +10 -0
- package/lib/components/select-button/SelectButton.styles.js.map +1 -0
- package/lib/components/setup-wizard/SetupWizard.d.ts +23 -0
- package/lib/components/setup-wizard/SetupWizard.js +79 -0
- package/lib/components/setup-wizard/SetupWizard.js.map +1 -0
- package/lib/components/setup-wizard/SetupWizard.styles.d.ts +2 -0
- package/lib/components/setup-wizard/SetupWizard.styles.js +10 -0
- package/lib/components/setup-wizard/SetupWizard.styles.js.map +1 -0
- package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.d.ts +25 -0
- package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +60 -0
- package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -0
- package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.styles.d.ts +3 -0
- package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.styles.js +14 -0
- package/lib/components/setup-wizard/setup-wizard-item/SetupWizardItem.styles.js.map +1 -0
- package/lib/components/sharing-bar/SharingBar.d.ts +18 -0
- package/lib/components/sharing-bar/SharingBar.js +110 -0
- package/lib/components/sharing-bar/SharingBar.js.map +1 -0
- package/lib/components/sharing-bar/SharingBar.styles.d.ts +6 -0
- package/lib/components/sharing-bar/SharingBar.styles.js +24 -0
- package/lib/components/sharing-bar/SharingBar.styles.js.map +1 -0
- package/lib/components/signature/Signature.d.ts +33 -0
- package/lib/components/signature/Signature.js +104 -0
- package/lib/components/signature/Signature.js.map +1 -0
- package/lib/components/signature/Signature.styles.d.ts +5 -0
- package/lib/components/signature/Signature.styles.js +21 -0
- package/lib/components/signature/Signature.styles.js.map +1 -0
- package/lib/components/slider/Slider.d.ts +45 -0
- package/lib/components/slider/Slider.js +183 -0
- package/lib/components/slider/Slider.js.map +1 -0
- package/lib/components/slider/Slider.styles.d.ts +16 -0
- package/lib/components/slider/Slider.styles.js +106 -0
- package/lib/components/slider/Slider.styles.js.map +1 -0
- package/lib/components/slider-button/SliderButton.d.ts +23 -0
- package/lib/components/slider-button/SliderButton.js +156 -0
- package/lib/components/slider-button/SliderButton.js.map +1 -0
- package/lib/components/slider-button/SliderButton.styles.d.ts +279 -0
- package/lib/components/slider-button/SliderButton.styles.js +69 -0
- package/lib/components/slider-button/SliderButton.styles.js.map +1 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.d.ts +31 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.js +42 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.js.map +1 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.styles.d.ts +19 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js +101 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js.map +1 -0
- package/lib/components/tag-input/TagInput.d.ts +22 -0
- package/lib/components/tag-input/TagInput.js +88 -0
- package/lib/components/tag-input/TagInput.js.map +1 -0
- package/lib/components/tag-input/TagInput.styles.d.ts +9 -0
- package/lib/components/tag-input/TagInput.styles.js +48 -0
- package/lib/components/tag-input/TagInput.styles.js.map +1 -0
- package/lib/components/text-area/TextArea.d.ts +29 -0
- package/lib/components/text-area/TextArea.js +57 -0
- package/lib/components/text-area/TextArea.js.map +1 -0
- package/lib/components/text-area/TextArea.styles.d.ts +15 -0
- package/lib/components/text-area/TextArea.styles.js +101 -0
- package/lib/components/text-area/TextArea.styles.js.map +1 -0
- package/lib/components/tooltip/Tooltip.d.ts +22 -0
- package/lib/components/tooltip/Tooltip.js +36 -0
- package/lib/components/tooltip/Tooltip.js.map +1 -0
- package/lib/components/tooltip/Tooltip.styles.d.ts +2 -0
- package/lib/components/tooltip/Tooltip.styles.js +10 -0
- package/lib/components/tooltip/Tooltip.styles.js.map +1 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.d.ts +13 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.js +31 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.js.map +1 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.styles.d.ts +15 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js +44 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js.map +1 -0
- package/lib/components/truncation/Truncation.d.ts +29 -0
- package/lib/components/truncation/Truncation.js +136 -0
- package/lib/components/truncation/Truncation.js.map +1 -0
- package/lib/components/truncation/Truncation.styles.d.ts +270 -0
- package/lib/components/truncation/Truncation.styles.js +27 -0
- package/lib/components/truncation/Truncation.styles.js.map +1 -0
- package/lib/constants/mentionFinder.d.ts +4 -0
- package/lib/constants/mentionFinder.js +12 -0
- package/lib/constants/mentionFinder.js.map +1 -0
- package/lib/constants/numberInput.d.ts +5 -0
- package/lib/constants/numberInput.js +12 -0
- package/lib/constants/numberInput.js.map +1 -0
- package/lib/constants/signature.d.ts +1 -0
- package/lib/constants/signature.js +8 -0
- package/lib/constants/signature.js.map +1 -0
- package/lib/hooks/colorMode.d.ts +2 -0
- package/lib/hooks/colorMode.js +20 -0
- package/lib/hooks/colorMode.js.map +1 -0
- package/lib/hooks/uuid.js.map +1 -1
- package/lib/index.d.ts +42 -0
- package/lib/index.js +237 -0
- package/lib/index.js.map +1 -1
- package/lib/types/chayns.d.ts +67 -1
- package/lib/types/chayns.js +3 -4
- package/lib/types/chayns.js.map +1 -1
- package/lib/types/colorSchemeProvider.d.ts +15 -0
- package/lib/types/colorSchemeProvider.js +15 -0
- package/lib/types/colorSchemeProvider.js.map +1 -0
- package/lib/types/comboBox.d.ts +4 -0
- package/lib/types/comboBox.js +12 -0
- package/lib/types/comboBox.js.map +1 -0
- package/lib/{components/context-menu/constants/alignment.js → types/contextMenu.js} +4 -5
- package/lib/types/contextMenu.js.map +1 -0
- package/lib/types/file.d.ts +42 -0
- package/lib/types/file.js +2 -0
- package/lib/types/file.js.map +1 -0
- package/lib/types/filterButtons.d.ts +15 -0
- package/lib/types/filterButtons.js +17 -0
- package/lib/types/filterButtons.js.map +1 -0
- package/lib/types/popup.d.ts +16 -0
- package/lib/types/popup.js +16 -0
- package/lib/types/popup.js.map +1 -0
- package/lib/types/radioButton.d.ts +4 -0
- package/lib/types/radioButton.js +2 -0
- package/lib/types/radioButton.js.map +1 -0
- package/lib/types/searchBox.d.ts +5 -0
- package/lib/types/searchBox.js +2 -0
- package/lib/types/searchBox.js.map +1 -0
- package/lib/types/selectButton.d.ts +4 -0
- package/lib/types/selectButton.js +2 -0
- package/lib/types/selectButton.js.map +1 -0
- package/lib/types/signature.d.ts +10 -0
- package/lib/types/signature.js +2 -0
- package/lib/types/signature.js.map +1 -0
- package/lib/types/slider-button.d.ts +4 -0
- package/lib/types/slider-button.js +2 -0
- package/lib/types/slider-button.js.map +1 -0
- package/lib/types/tagInput.d.ts +4 -0
- package/lib/types/tagInput.js +2 -0
- package/lib/types/tagInput.js.map +1 -0
- package/lib/types/tooltip.d.ts +9 -0
- package/lib/types/tooltip.js +2 -0
- package/lib/types/tooltip.js.map +1 -0
- package/lib/{components/accordion/utils.js → utils/accordion.js} +1 -1
- package/lib/utils/accordion.js.map +1 -0
- package/lib/utils/amountControl.d.ts +7 -0
- package/lib/utils/amountControl.js +22 -0
- package/lib/utils/amountControl.js.map +1 -0
- package/lib/utils/calculate.d.ts +5 -0
- package/lib/utils/calculate.js +73 -0
- package/lib/utils/calculate.js.map +1 -0
- package/lib/utils/file.d.ts +363 -0
- package/lib/utils/file.js +402 -0
- package/lib/utils/file.js.map +1 -0
- package/lib/utils/fileDialog.d.ts +7 -0
- package/lib/utils/fileDialog.js +73 -0
- package/lib/utils/fileDialog.js.map +1 -0
- package/lib/utils/font.d.ts +8 -0
- package/lib/utils/font.js +75 -0
- package/lib/utils/font.js.map +1 -0
- package/lib/{components/icon/utils.js → utils/icon.js} +2 -3
- package/lib/utils/icon.js.map +1 -0
- package/lib/utils/isTobitEmployee.d.ts +1 -0
- package/lib/utils/isTobitEmployee.js +28 -0
- package/lib/utils/isTobitEmployee.js.map +1 -0
- package/lib/utils/numberInput.d.ts +23 -0
- package/lib/utils/numberInput.js +92 -0
- package/lib/utils/numberInput.js.map +1 -0
- package/lib/utils/searchBox.d.ts +7 -0
- package/lib/utils/searchBox.js +23 -0
- package/lib/utils/searchBox.js.map +1 -0
- package/lib/utils/slider.d.ts +7 -0
- package/lib/utils/slider.js +35 -0
- package/lib/utils/slider.js.map +1 -0
- package/lib/utils/sliderButton.d.ts +15 -0
- package/lib/utils/sliderButton.js +53 -0
- package/lib/utils/sliderButton.js.map +1 -0
- package/lib/utils/truncation.d.ts +1 -0
- package/lib/utils/truncation.js +34 -0
- package/lib/utils/truncation.js.map +1 -0
- package/lib/utils/uploadFile.d.ts +9 -0
- package/lib/utils/uploadFile.js +47 -0
- package/lib/utils/uploadFile.js.map +1 -0
- package/package.json +24 -21
- package/lib/components/accordion/utils.js.map +0 -1
- package/lib/components/context-menu/constants/alignment.js.map +0 -1
- package/lib/components/icon/utils.js.map +0 -1
- /package/lib/{components/context-menu/constants/alignment.d.ts → types/contextMenu.d.ts} +0 -0
- /package/lib/{components/accordion/utils.d.ts → utils/accordion.d.ts} +0 -0
- /package/lib/{components/icon/utils.d.ts → utils/icon.d.ts} +0 -0
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledIconWrapper = exports.StyledButton = void 0;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
exports.StyledMotionWaitCursorWrapper = exports.StyledMotionChildrenWrapper = exports.StyledIconWrapper = exports.StyledButton = void 0;
|
|
7
|
+
var _framerMotion = require("framer-motion");
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
const StyledButton = exports.StyledButton = _styledComponents.default.button`
|
|
12
|
+
align-items: center;
|
|
10
13
|
background-color: ${_ref => {
|
|
11
14
|
let {
|
|
12
15
|
isSecondary,
|
|
@@ -24,28 +27,46 @@ const StyledButton = _styledComponents.default.button`
|
|
|
24
27
|
} = _ref2;
|
|
25
28
|
return isSecondary ? theme.text : 'white';
|
|
26
29
|
}};
|
|
27
|
-
cursor:
|
|
28
|
-
display: inline-block;
|
|
29
|
-
line-height: 1.15;
|
|
30
|
-
min-height: 30px;
|
|
31
|
-
opacity: ${_ref3 => {
|
|
30
|
+
cursor: ${_ref3 => {
|
|
32
31
|
let {
|
|
33
|
-
|
|
32
|
+
isDisabled
|
|
34
33
|
} = _ref3;
|
|
35
|
-
return
|
|
34
|
+
return isDisabled ? 'default' : 'pointer';
|
|
36
35
|
}};
|
|
37
|
-
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
line-height: 1.15;
|
|
38
|
+
min-height: 32px;
|
|
39
|
+
opacity: ${_ref4 => {
|
|
38
40
|
let {
|
|
39
|
-
|
|
41
|
+
disabled
|
|
40
42
|
} = _ref4;
|
|
41
|
-
return
|
|
43
|
+
return disabled ? 0.5 : 1;
|
|
42
44
|
}};
|
|
43
45
|
position: relative;
|
|
44
46
|
user-select: none;
|
|
45
47
|
transition: opacity 0.3s ease;
|
|
48
|
+
|
|
49
|
+
${_ref5 => {
|
|
50
|
+
let {
|
|
51
|
+
hasIcon,
|
|
52
|
+
hasChildren
|
|
53
|
+
} = _ref5;
|
|
54
|
+
if (hasIcon) {
|
|
55
|
+
if (hasChildren) {
|
|
56
|
+
return (0, _styledComponents.css)`
|
|
57
|
+
padding: 7px 12px 7px 42px;
|
|
58
|
+
`;
|
|
59
|
+
}
|
|
60
|
+
return (0, _styledComponents.css)`
|
|
61
|
+
padding: 7px 12px 7px 18px;
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
return (0, _styledComponents.css)`
|
|
65
|
+
padding: 7px 12px 7px 12px;
|
|
66
|
+
`;
|
|
67
|
+
}}
|
|
46
68
|
`;
|
|
47
|
-
exports.
|
|
48
|
-
const StyledIconWrapper = _styledComponents.default.span`
|
|
69
|
+
const StyledIconWrapper = exports.StyledIconWrapper = _styledComponents.default.span`
|
|
49
70
|
align-items: center;
|
|
50
71
|
background-color: rgba(255, 255, 255, 0.2);
|
|
51
72
|
bottom: 0;
|
|
@@ -56,5 +77,10 @@ const StyledIconWrapper = _styledComponents.default.span`
|
|
|
56
77
|
top: 0;
|
|
57
78
|
width: 30px;
|
|
58
79
|
`;
|
|
59
|
-
exports.
|
|
80
|
+
const StyledMotionChildrenWrapper = exports.StyledMotionChildrenWrapper = (0, _styledComponents.default)(_framerMotion.motion.div)``;
|
|
81
|
+
const StyledMotionWaitCursorWrapper = exports.StyledMotionWaitCursorWrapper = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
82
|
+
align-items: center;
|
|
83
|
+
display: flex;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
`;
|
|
60
86
|
//# sourceMappingURL=Button.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.styles.js","names":["StyledButton","styled","button","isSecondary","theme","text","disabled","hasIcon","StyledIconWrapper","span"],"sources":["../../../src/components/button/Button.styles.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Button.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StyledButton","exports","styled","button","_ref","isSecondary","theme","_ref2","text","_ref3","isDisabled","_ref4","disabled","_ref5","hasIcon","hasChildren","css","StyledIconWrapper","span","StyledMotionChildrenWrapper","motion","div","StyledMotionWaitCursorWrapper"],"sources":["../../../src/components/button/Button.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled, { css } from 'styled-components';\nimport type { FramerMotionBugFix, WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { ButtonProps } from './Button';\n\ntype StyledButtonProps = ButtonProps &\n WithTheme<{\n hasIcon: boolean;\n hasChildren: boolean;\n isDisabled?: boolean;\n }>;\n\nexport const StyledButton = styled.button<StyledButtonProps>`\n align-items: center;\n background-color: ${({ isSecondary, theme }: StyledButtonProps) =>\n isSecondary ? theme['202'] : theme['408']};\n border-radius: 3px;\n box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.2);\n border: none;\n color: ${({ isSecondary, theme }: StyledButtonProps) => (isSecondary ? theme.text : 'white')};\n cursor: ${({ isDisabled }) => (isDisabled ? 'default' : 'pointer')};\n display: inline-flex;\n line-height: 1.15;\n min-height: 32px;\n opacity: ${({ disabled }) => (disabled ? 0.5 : 1)};\n position: relative;\n user-select: none;\n transition: opacity 0.3s ease;\n\n ${({ hasIcon, hasChildren }) => {\n if (hasIcon) {\n if (hasChildren) {\n return css`\n padding: 7px 12px 7px 42px;\n `;\n }\n return css`\n padding: 7px 12px 7px 18px;\n `;\n }\n return css`\n padding: 7px 12px 7px 12px;\n `;\n }}\n`;\n\nexport const StyledIconWrapper = styled.span`\n align-items: center;\n background-color: rgba(255, 255, 255, 0.2);\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n position: absolute;\n top: 0;\n width: 30px;\n`;\n\nexport const StyledMotionChildrenWrapper = styled(motion.div)<FramerMotionBugFix>``;\n\nexport const StyledMotionWaitCursorWrapper = styled(motion.div)<FramerMotionBugFix>`\n align-items: center;\n display: flex;\n justify-content: center;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgD,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAA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;AACN,CAAC;AAEM,MAAMC,iBAAiB,GAAAhB,OAAA,CAAAgB,iBAAA,GAAGf,yBAAM,CAACgB,IAAK;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,2BAA2B,GAAAlB,OAAA,CAAAkB,2BAAA,GAAG,IAAAjB,yBAAM,EAACkB,oBAAM,CAACC,GAAG,CAAsB,EAAC;AAE5E,MAAMC,6BAA6B,GAAArB,OAAA,CAAAqB,6BAAA,GAAG,IAAApB,yBAAM,EAACkB,oBAAM,CAACC,GAAG,CAAsB;AACpF;AACA;AACA;AACA,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ChangeEventHandler, FC,
|
|
2
|
-
export
|
|
1
|
+
import { ChangeEventHandler, FC, ReactElement } from 'react';
|
|
2
|
+
export type CheckboxProps = {
|
|
3
3
|
/**
|
|
4
4
|
* Text for checkbox or switch
|
|
5
5
|
*/
|
|
6
|
-
children?:
|
|
6
|
+
children?: ReactElement | string;
|
|
7
7
|
/**
|
|
8
8
|
* Indicates whether the checkbox or switch is selected
|
|
9
9
|
*/
|
|
@@ -12,6 +12,10 @@ export declare type CheckboxProps = {
|
|
|
12
12
|
* Disables the checkbox or switch so it cannot be toggled
|
|
13
13
|
*/
|
|
14
14
|
isDisabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Classname for the label
|
|
17
|
+
*/
|
|
18
|
+
labelClassName?: string;
|
|
15
19
|
/**
|
|
16
20
|
* Function to be executed if the checked value changes
|
|
17
21
|
*/
|
|
@@ -20,6 +24,10 @@ export declare type CheckboxProps = {
|
|
|
20
24
|
* Changes the design to use switch instead of checkbox
|
|
21
25
|
*/
|
|
22
26
|
shouldShowAsSwitch?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the Checkbox should be displayed centered to the label or at the top
|
|
29
|
+
*/
|
|
30
|
+
shouldShowCentered?: boolean;
|
|
23
31
|
};
|
|
24
32
|
declare const Checkbox: FC<CheckboxProps>;
|
|
25
33
|
export default Checkbox;
|
|
@@ -6,18 +6,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _uuid = require("../../hooks/uuid");
|
|
9
|
+
var _calculate = require("../../utils/calculate");
|
|
9
10
|
var _Checkbox = require("./Checkbox.styles");
|
|
10
|
-
function _getRequireWildcardCache(
|
|
11
|
-
function _interopRequireWildcard(
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
13
|
const Checkbox = _ref => {
|
|
13
14
|
let {
|
|
14
15
|
children,
|
|
15
16
|
isChecked,
|
|
16
17
|
isDisabled,
|
|
18
|
+
labelClassName,
|
|
17
19
|
onChange,
|
|
18
|
-
shouldShowAsSwitch
|
|
20
|
+
shouldShowAsSwitch,
|
|
21
|
+
shouldShowCentered = false
|
|
19
22
|
} = _ref;
|
|
20
|
-
const [isActive, setIsActive] = (0, _react.useState)(isChecked
|
|
23
|
+
const [isActive, setIsActive] = (0, _react.useState)(isChecked ?? false);
|
|
21
24
|
const handleChange = (0, _react.useCallback)(event => {
|
|
22
25
|
setIsActive(event.target.checked);
|
|
23
26
|
if (typeof onChange === 'function') {
|
|
@@ -25,6 +28,7 @@ const Checkbox = _ref => {
|
|
|
25
28
|
}
|
|
26
29
|
}, [onChange]);
|
|
27
30
|
const uuid = (0, _uuid.useUuid)();
|
|
31
|
+
const lineHeight = (0, _react.useMemo)(() => shouldShowCentered ? undefined : (0, _calculate.getHeightOfSingleTextLine)(), [shouldShowCentered]);
|
|
28
32
|
return /*#__PURE__*/_react.default.createElement(_Checkbox.StyledCheckbox, null, /*#__PURE__*/_react.default.createElement(_Checkbox.StyledCheckboxInput, {
|
|
29
33
|
checked: isChecked,
|
|
30
34
|
disabled: isDisabled,
|
|
@@ -32,13 +36,14 @@ const Checkbox = _ref => {
|
|
|
32
36
|
onChange: handleChange,
|
|
33
37
|
type: "checkbox"
|
|
34
38
|
}), /*#__PURE__*/_react.default.createElement(_Checkbox.StyledCheckboxLabel, {
|
|
39
|
+
className: labelClassName,
|
|
35
40
|
htmlFor: uuid,
|
|
36
|
-
isChecked: isChecked
|
|
41
|
+
isChecked: isChecked ?? isActive,
|
|
37
42
|
isDisabled: isDisabled,
|
|
38
|
-
shouldShowAsSwitch: shouldShowAsSwitch
|
|
43
|
+
shouldShowAsSwitch: shouldShowAsSwitch,
|
|
44
|
+
lineHeight: lineHeight
|
|
39
45
|
}, children));
|
|
40
46
|
};
|
|
41
47
|
Checkbox.displayName = 'Checkbox';
|
|
42
|
-
var _default = Checkbox;
|
|
43
|
-
exports.default = _default;
|
|
48
|
+
var _default = exports.default = Checkbox;
|
|
44
49
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","names":["Checkbox","children","isChecked","isDisabled","onChange","shouldShowAsSwitch","isActive","setIsActive","useState","handleChange","useCallback","event","target","checked","uuid","useUuid","displayName"],"sources":["../../../src/components/checkbox/Checkbox.tsx"],"sourcesContent":["import React, {\n ChangeEvent,\n ChangeEventHandler,\n FC,\n
|
|
1
|
+
{"version":3,"file":"Checkbox.js","names":["_react","_interopRequireWildcard","require","_uuid","_calculate","_Checkbox","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","Checkbox","_ref","children","isChecked","isDisabled","labelClassName","onChange","shouldShowAsSwitch","shouldShowCentered","isActive","setIsActive","useState","handleChange","useCallback","event","target","checked","uuid","useUuid","lineHeight","useMemo","undefined","getHeightOfSingleTextLine","createElement","StyledCheckbox","StyledCheckboxInput","disabled","id","type","StyledCheckboxLabel","className","htmlFor","displayName","_default","exports"],"sources":["../../../src/components/checkbox/Checkbox.tsx"],"sourcesContent":["import React, {\n ChangeEvent,\n ChangeEventHandler,\n FC,\n ReactElement,\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport { getHeightOfSingleTextLine } from '../../utils/calculate';\nimport { StyledCheckbox, StyledCheckboxInput, StyledCheckboxLabel } from './Checkbox.styles';\n\nexport type CheckboxProps = {\n /**\n * Text for checkbox or switch\n */\n children?: ReactElement | string;\n /**\n * Indicates whether the checkbox or switch is selected\n */\n isChecked?: boolean;\n /**\n * Disables the checkbox or switch so it cannot be toggled\n */\n isDisabled?: boolean;\n /**\n * Classname for the label\n */\n labelClassName?: string;\n /**\n * Function to be executed if the checked value changes\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Changes the design to use switch instead of checkbox\n */\n shouldShowAsSwitch?: boolean;\n /**\n * Whether the Checkbox should be displayed centered to the label or at the top\n */\n shouldShowCentered?: boolean;\n};\n\nconst Checkbox: FC<CheckboxProps> = ({\n children,\n isChecked,\n isDisabled,\n labelClassName,\n onChange,\n shouldShowAsSwitch,\n shouldShowCentered = false,\n}) => {\n const [isActive, setIsActive] = useState(isChecked ?? false);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setIsActive(event.target.checked);\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n },\n [onChange],\n );\n\n const uuid = useUuid();\n\n const lineHeight = useMemo(\n () => (shouldShowCentered ? undefined : getHeightOfSingleTextLine()),\n [shouldShowCentered],\n );\n\n return (\n <StyledCheckbox>\n <StyledCheckboxInput\n checked={isChecked}\n disabled={isDisabled}\n id={uuid}\n onChange={handleChange}\n type=\"checkbox\"\n />\n <StyledCheckboxLabel\n className={labelClassName}\n htmlFor={uuid}\n isChecked={isChecked ?? isActive}\n isDisabled={isDisabled}\n shouldShowAsSwitch={shouldShowAsSwitch}\n lineHeight={lineHeight}\n >\n {children}\n </StyledCheckboxLabel>\n </StyledCheckbox>\n );\n};\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AASA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAA6F,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA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AA,CAAAsC,aAAA,CAAC7C,SAAA,CAAA+C,mBAAmB;IAChBT,OAAO,EAAEb,SAAU;IACnBuB,QAAQ,EAAEtB,UAAW;IACrBuB,EAAE,EAAEV,IAAK;IACTX,QAAQ,EAAEM,YAAa;IACvBgB,IAAI,EAAC;EAAU,CAClB,CAAC,eACFvD,MAAA,CAAAY,OAAA,CAAAsC,aAAA,CAAC7C,SAAA,CAAAmD,mBAAmB;IAChBC,SAAS,EAAEzB,cAAe;IAC1B0B,OAAO,EAAEd,IAAK;IACdd,SAAS,EAAEA,SAAS,IAAIM,QAAS;IACjCL,UAAU,EAAEA,UAAW;IACvBG,kBAAkB,EAAEA,kBAAmB;IACvCY,UAAU,EAAEA;EAAW,GAEtBjB,QACgB,CACT,CAAC;AAEzB,CAAC;AAEDF,QAAQ,CAACgC,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjD,OAAA,GAEnBe,QAAQ"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';
|
|
1
3
|
import type { CheckboxProps } from './Checkbox';
|
|
2
|
-
export declare const StyledCheckbox: import("styled-components").
|
|
3
|
-
export declare const StyledCheckboxInput: import("styled-components").
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare const StyledCheckbox: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
5
|
+
export declare const StyledCheckboxInput: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>>;
|
|
6
|
+
type StyledCheckboxLabelProps = WithTheme<{
|
|
7
|
+
shouldShowAsSwitch?: CheckboxProps['shouldShowAsSwitch'];
|
|
8
|
+
isDisabled?: CheckboxProps['isDisabled'];
|
|
9
|
+
isChecked?: CheckboxProps['isChecked'];
|
|
10
|
+
lineHeight?: number;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const StyledCheckboxLabel: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, StyledCheckboxLabelProps>>;
|
|
13
|
+
export {};
|
|
@@ -5,62 +5,69 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.StyledCheckboxLabel = exports.StyledCheckboxInput = exports.StyledCheckbox = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
-
function _getRequireWildcardCache(
|
|
9
|
-
function _interopRequireWildcard(
|
|
10
|
-
const StyledCheckbox = _styledComponents.default.div`
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
const StyledCheckbox = exports.StyledCheckbox = _styledComponents.default.div`
|
|
11
11
|
align-items: center;
|
|
12
12
|
display: flex;
|
|
13
13
|
position: relative;
|
|
14
14
|
`;
|
|
15
|
-
exports.
|
|
16
|
-
const StyledCheckboxInput = _styledComponents.default.input`
|
|
15
|
+
const StyledCheckboxInput = exports.StyledCheckboxInput = _styledComponents.default.input`
|
|
17
16
|
display: none;
|
|
18
17
|
`;
|
|
19
|
-
exports.
|
|
20
|
-
|
|
21
|
-
cursor: ${_ref => {
|
|
18
|
+
const StyledCheckboxLabel = exports.StyledCheckboxLabel = _styledComponents.default.label`
|
|
19
|
+
color: ${_ref => {
|
|
22
20
|
let {
|
|
23
|
-
|
|
21
|
+
theme
|
|
24
22
|
} = _ref;
|
|
25
|
-
return
|
|
23
|
+
return theme.text;
|
|
26
24
|
}};
|
|
27
|
-
|
|
25
|
+
cursor: ${_ref2 => {
|
|
28
26
|
let {
|
|
29
27
|
isDisabled
|
|
30
28
|
} = _ref2;
|
|
29
|
+
return isDisabled ? 'default' : 'pointer';
|
|
30
|
+
}};
|
|
31
|
+
opacity: ${_ref3 => {
|
|
32
|
+
let {
|
|
33
|
+
isDisabled
|
|
34
|
+
} = _ref3;
|
|
31
35
|
return isDisabled ? 0.5 : 1;
|
|
32
36
|
}};
|
|
33
|
-
padding-left: ${
|
|
37
|
+
padding-left: ${_ref4 => {
|
|
34
38
|
let {
|
|
35
39
|
shouldShowAsSwitch
|
|
36
|
-
} =
|
|
40
|
+
} = _ref4;
|
|
37
41
|
return shouldShowAsSwitch ? '48px' : '20px';
|
|
38
42
|
}};
|
|
39
43
|
transition: opacity 0.2s ease;
|
|
40
44
|
user-select: none;
|
|
41
45
|
|
|
42
46
|
&:after {
|
|
43
|
-
${
|
|
47
|
+
${_ref5 => {
|
|
44
48
|
let {
|
|
45
49
|
isChecked,
|
|
46
|
-
shouldShowAsSwitch
|
|
47
|
-
|
|
50
|
+
shouldShowAsSwitch,
|
|
51
|
+
lineHeight
|
|
52
|
+
} = _ref5;
|
|
48
53
|
return shouldShowAsSwitch ? (0, _styledComponents.css)`
|
|
49
54
|
background-color: white;
|
|
50
55
|
border-radius: 50%;
|
|
51
56
|
box-shadow: 0 1px 4px rgb(0 0 0 / 35%);
|
|
52
57
|
height: 16px;
|
|
53
58
|
left: 7px;
|
|
54
|
-
|
|
59
|
+
top: ${lineHeight ? `${lineHeight / 1.5}px` : '50%'};
|
|
60
|
+
transform: translateX(${isChecked ? '18px' : 0}) translateY(-50%);
|
|
55
61
|
transition: transform 0.2s ease;
|
|
56
62
|
width: 16px;
|
|
57
63
|
` : (0, _styledComponents.css)`
|
|
58
64
|
border-right: 2px solid #fff;
|
|
59
65
|
border-bottom: 2px solid #fff;
|
|
60
66
|
height: 10px;
|
|
61
|
-
left:
|
|
67
|
+
left: 2px;
|
|
62
68
|
opacity: ${isChecked ? 1 : 0};
|
|
63
|
-
|
|
69
|
+
top: ${lineHeight ? `calc(${lineHeight / 1.5}px - 2px)` : 'calc(50% - 2px)'};
|
|
70
|
+
transform: rotateZ(37deg) translateY(-50%);
|
|
64
71
|
transition: opacity 0.2s ease;
|
|
65
72
|
width: 5.5px;
|
|
66
73
|
`;
|
|
@@ -68,58 +75,66 @@ const StyledCheckboxLabel = _styledComponents.default.label`
|
|
|
68
75
|
|
|
69
76
|
content: ' ';
|
|
70
77
|
position: absolute;
|
|
71
|
-
top: 50%;
|
|
72
|
-
transform-origin: 100% 100%;
|
|
73
78
|
}
|
|
74
79
|
|
|
75
80
|
&:before {
|
|
76
|
-
background-color: ${
|
|
81
|
+
background-color: ${_ref6 => {
|
|
77
82
|
let {
|
|
78
83
|
isChecked,
|
|
79
84
|
shouldShowAsSwitch,
|
|
80
85
|
theme
|
|
81
|
-
} =
|
|
86
|
+
} = _ref6;
|
|
82
87
|
if (shouldShowAsSwitch) {
|
|
83
88
|
return isChecked ? theme.green : theme.red;
|
|
84
89
|
}
|
|
85
90
|
return isChecked ? theme['408'] : theme['403'];
|
|
86
91
|
}};
|
|
87
|
-
border: 1px solid rgba(${
|
|
92
|
+
border: 1px solid rgba(${_ref7 => {
|
|
88
93
|
let {
|
|
89
94
|
theme
|
|
90
|
-
} =
|
|
95
|
+
} = _ref7;
|
|
91
96
|
return theme['409-rgb'];
|
|
92
97
|
}}, 0.5);
|
|
93
|
-
border-radius: ${
|
|
98
|
+
border-radius: ${_ref8 => {
|
|
94
99
|
let {
|
|
95
100
|
shouldShowAsSwitch
|
|
96
|
-
} =
|
|
101
|
+
} = _ref8;
|
|
97
102
|
return shouldShowAsSwitch ? '100px' : 0;
|
|
98
103
|
}};
|
|
99
104
|
content: ' ';
|
|
100
|
-
height: ${
|
|
105
|
+
height: ${_ref9 => {
|
|
101
106
|
let {
|
|
102
107
|
shouldShowAsSwitch
|
|
103
|
-
} =
|
|
108
|
+
} = _ref9;
|
|
104
109
|
return shouldShowAsSwitch ? '13px' : '15px';
|
|
105
110
|
}};
|
|
106
|
-
left: ${
|
|
111
|
+
left: ${_ref10 => {
|
|
107
112
|
let {
|
|
108
113
|
shouldShowAsSwitch
|
|
109
|
-
} =
|
|
114
|
+
} = _ref10;
|
|
110
115
|
return shouldShowAsSwitch ? '10px' : 0;
|
|
111
116
|
}};
|
|
112
117
|
position: absolute;
|
|
113
|
-
top: 50%;
|
|
114
|
-
transform: translateY(-50%);
|
|
115
118
|
transition: background-color 0.2s ease;
|
|
116
|
-
width: ${
|
|
119
|
+
width: ${_ref11 => {
|
|
117
120
|
let {
|
|
118
121
|
shouldShowAsSwitch
|
|
119
|
-
} =
|
|
122
|
+
} = _ref11;
|
|
120
123
|
return shouldShowAsSwitch ? '28px' : '15px';
|
|
121
124
|
}};
|
|
125
|
+
${_ref12 => {
|
|
126
|
+
let {
|
|
127
|
+
lineHeight
|
|
128
|
+
} = _ref12;
|
|
129
|
+
return lineHeight ? (0, _styledComponents.css)`
|
|
130
|
+
top: ${lineHeight / 1.5}px;
|
|
131
|
+
transform: translateY(-50%);
|
|
132
|
+
` : (0, _styledComponents.css)`
|
|
133
|
+
top: 50%;
|
|
134
|
+
transform: translateY(-50%);
|
|
135
|
+
`;
|
|
136
|
+
}}
|
|
137
|
+
}
|
|
122
138
|
}
|
|
123
139
|
`;
|
|
124
|
-
exports.StyledCheckboxLabel = StyledCheckboxLabel;
|
|
125
140
|
//# sourceMappingURL=Checkbox.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.styles.js","names":["StyledCheckbox","styled","div","StyledCheckboxInput","input","StyledCheckboxLabel","label","isDisabled","shouldShowAsSwitch","isChecked","css","
|
|
1
|
+
{"version":3,"file":"Checkbox.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StyledCheckbox","exports","styled","div","StyledCheckboxInput","input","StyledCheckboxLabel","label","_ref","theme","text","_ref2","isDisabled","_ref3","_ref4","shouldShowAsSwitch","_ref5","isChecked","lineHeight","css","_ref6","green","red","_ref7","_ref8","_ref9","_ref10","_ref11","_ref12"],"sources":["../../../src/components/checkbox/Checkbox.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { CheckboxProps } from './Checkbox';\n\nexport const StyledCheckbox = styled.div`\n align-items: center;\n display: flex;\n position: relative;\n`;\n\nexport const StyledCheckboxInput = styled.input`\n display: none;\n`;\n\ntype StyledCheckboxLabelProps = WithTheme<{\n shouldShowAsSwitch?: CheckboxProps['shouldShowAsSwitch'];\n isDisabled?: CheckboxProps['isDisabled'];\n isChecked?: CheckboxProps['isChecked'];\n lineHeight?: number;\n}>;\n\nexport const StyledCheckboxLabel = styled.label<StyledCheckboxLabelProps>`\n color: ${({ theme }: StyledCheckboxLabelProps) => theme.text};\n cursor: ${({ isDisabled }) => (isDisabled ? 'default' : 'pointer')};\n opacity: ${({ isDisabled }) => (isDisabled ? 0.5 : 1)};\n padding-left: ${({ shouldShowAsSwitch }) => (shouldShowAsSwitch ? '48px' : '20px')};\n transition: opacity 0.2s ease;\n user-select: none;\n\n &:after {\n ${({ isChecked, shouldShowAsSwitch, lineHeight }) =>\n shouldShowAsSwitch\n ? css`\n background-color: white;\n border-radius: 50%;\n box-shadow: 0 1px 4px rgb(0 0 0 / 35%);\n height: 16px;\n left: 7px;\n top: ${lineHeight ? `${lineHeight / 1.5}px` : '50%'};\n transform: translateX(${isChecked ? '18px' : 0}) translateY(-50%);\n transition: transform 0.2s ease;\n width: 16px;\n `\n : css`\n border-right: 2px solid #fff;\n border-bottom: 2px solid #fff;\n height: 10px;\n left: 2px;\n opacity: ${isChecked ? 1 : 0};\n top: ${lineHeight ? `calc(${lineHeight / 1.5}px - 2px)` : 'calc(50% - 2px)'};\n transform: rotateZ(37deg) translateY(-50%);\n transition: opacity 0.2s ease;\n width: 5.5px;\n `}\n\n content: ' ';\n position: absolute;\n }\n\n &:before {\n background-color: ${({\n isChecked,\n shouldShowAsSwitch,\n theme,\n }: StyledCheckboxLabelProps) => {\n if (shouldShowAsSwitch) {\n return isChecked ? theme.green : theme.red;\n }\n\n return isChecked ? theme['408'] : theme['403'];\n }};\n border: 1px solid rgba(${({ theme }: StyledCheckboxLabelProps) => theme['409-rgb']}, 0.5);\n border-radius: ${({ shouldShowAsSwitch }) => (shouldShowAsSwitch ? '100px' : 0)};\n content: ' ';\n height: ${({ shouldShowAsSwitch }) => (shouldShowAsSwitch ? '13px' : '15px')};\n left: ${({ shouldShowAsSwitch }) => (shouldShowAsSwitch ? '10px' : 0)};\n position: absolute;\n transition: background-color 0.2s ease;\n width: ${({ shouldShowAsSwitch }) => (shouldShowAsSwitch ? '28px' : '15px')};\n ${({ lineHeight }) =>\n lineHeight\n ? css`\n top: ${lineHeight / 1.5}px;\n transform: translateY(-50%);\n `\n : css`\n top: 50%;\n transform: translateY(-50%);\n `}\n }\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GA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SAAS,GAAGR,KAAK,CAAC,KAAK,CAAC,GAAGA,KAAK,CAAC,KAAK,CAAC;AAClD,CAAE;AACV,iCAAiCc,KAAA;EAAA,IAAC;IAAEd;EAAgC,CAAC,GAAAc,KAAA;EAAA,OAAKd,KAAK,CAAC,SAAS,CAAC;AAAA,CAAC;AAC3F,yBAAyBe,KAAA;EAAA,IAAC;IAAET;EAAmB,CAAC,GAAAS,KAAA;EAAA,OAAMT,kBAAkB,GAAG,OAAO,GAAG,CAAC;AAAA,CAAE;AACxF;AACA,kBAAkBU,KAAA;EAAA,IAAC;IAAEV;EAAmB,CAAC,GAAAU,KAAA;EAAA,OAAMV,kBAAkB,GAAG,MAAM,GAAG,MAAM;AAAA,CAAE;AACrF,gBAAgBW,MAAA;EAAA,IAAC;IAAEX;EAAmB,CAAC,GAAAW,MAAA;EAAA,OAAMX,kBAAkB,GAAG,MAAM,GAAG,CAAC;AAAA,CAAE;AAC9E;AACA;AACA,iBAAiBY,MAAA;EAAA,IAAC;IAAEZ;EAAmB,CAAC,GAAAY,MAAA;EAAA,OAAMZ,kBAAkB,GAAG,MAAM,GAAG,MAAM;AAAA,CAAE;AACpF,UAAUa,MAAA;EAAA,IAAC;IAAEV;EAAW,CAAC,GAAAU,MAAA;EAAA,OACbV,UAAU,GACJ,IAAAC,qBAAG,CAAC;AACtB,6BAA6BD,UAAU,GAAG,GAAI;AAC9C;AACA,mBAAmB,GACD,IAAAC,qBAAG,CAAC;AACtB;AACA;AACA,mBAAmB;AAAA,CAAC;AACpB;AACA;AACA,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
+
import type { DesignSettings } from '../../types/colorSchemeProvider';
|
|
2
3
|
declare enum ColorMode {
|
|
3
4
|
Classic = 0,
|
|
4
5
|
Dark = 1,
|
|
5
6
|
Light = 2
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
+
type ColorSchemeProviderProps = {
|
|
8
9
|
/**
|
|
9
10
|
* The content of the application or the components for which the styles should be set
|
|
10
11
|
*/
|
|
@@ -23,6 +24,10 @@ declare type ColorSchemeProviderProps = {
|
|
|
23
24
|
cssVariables?: {
|
|
24
25
|
[key: string]: string | number;
|
|
25
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* The design settings of a page.
|
|
29
|
+
*/
|
|
30
|
+
designSettings?: DesignSettings;
|
|
26
31
|
/**
|
|
27
32
|
* The secondary hex color to be used for the children
|
|
28
33
|
*/
|
|
@@ -37,8 +42,9 @@ declare type ColorSchemeProviderProps = {
|
|
|
37
42
|
export interface Theme {
|
|
38
43
|
[key: string]: string;
|
|
39
44
|
}
|
|
40
|
-
export
|
|
45
|
+
export type WithTheme<T> = T & {
|
|
41
46
|
theme: Theme;
|
|
42
47
|
};
|
|
48
|
+
export type FramerMotionBugFix = WithTheme<unknown>;
|
|
43
49
|
declare const ColorSchemeProvider: FC<ColorSchemeProviderProps>;
|
|
44
50
|
export default ColorSchemeProvider;
|
|
@@ -7,57 +7,90 @@ exports.default = void 0;
|
|
|
7
7
|
var _colors = require("@chayns/colors");
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _styledComponents = require("styled-components");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
(function (
|
|
10
|
+
var _font = require("../../utils/font");
|
|
11
|
+
var _chaynsApi = require("chayns-api");
|
|
12
|
+
var _get = require("../../api/theme/get");
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
var ColorMode = /*#__PURE__*/function (ColorMode) {
|
|
14
16
|
ColorMode[ColorMode["Classic"] = 0] = "Classic";
|
|
15
17
|
ColorMode[ColorMode["Dark"] = 1] = "Dark";
|
|
16
18
|
ColorMode[ColorMode["Light"] = 2] = "Light";
|
|
17
|
-
|
|
19
|
+
return ColorMode;
|
|
20
|
+
}(ColorMode || {}); // ToDo remove type after the framer-motion bug is Fixed
|
|
18
21
|
const GlobalStyle = (0, _styledComponents.createGlobalStyle)`
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
${_font.generateFontFaces}
|
|
23
|
+
|
|
24
|
+
.ellipsis {
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
text-overflow: ellipsis;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
}
|
|
24
29
|
`;
|
|
25
30
|
const ColorSchemeProvider = _ref => {
|
|
26
31
|
let {
|
|
27
32
|
children,
|
|
28
|
-
color
|
|
29
|
-
colorMode
|
|
33
|
+
color,
|
|
34
|
+
colorMode,
|
|
30
35
|
cssVariables = {},
|
|
31
36
|
secondaryColor,
|
|
32
|
-
style = {}
|
|
37
|
+
style = {},
|
|
38
|
+
designSettings
|
|
33
39
|
} = _ref;
|
|
34
40
|
const [colors, setColors] = (0, _react.useState)({});
|
|
35
|
-
const [
|
|
41
|
+
const [theme, setTheme] = (0, _react.useState)({});
|
|
42
|
+
const [internalDesignSettings, setInternalDesignSettings] = (0, _react.useState)();
|
|
43
|
+
(0, _react.useEffect)(() => {
|
|
44
|
+
if (designSettings) {
|
|
45
|
+
setInternalDesignSettings(designSettings);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
void (0, _get.getDesignSettings)().then(result => {
|
|
49
|
+
setInternalDesignSettings(result);
|
|
50
|
+
});
|
|
51
|
+
}, [designSettings]);
|
|
52
|
+
const site = (0, _chaynsApi.getSite)();
|
|
53
|
+
const internalColorMode = colorMode ?? site.colorMode;
|
|
54
|
+
const internalColor = color ?? site.color;
|
|
36
55
|
(0, _react.useEffect)(() => {
|
|
37
56
|
const availableColors = (0, _colors.getAvailableColorList)();
|
|
38
57
|
const newColors = {};
|
|
39
|
-
const
|
|
58
|
+
const newTheme = {};
|
|
40
59
|
availableColors.forEach(colorName => {
|
|
41
60
|
const hexColor = (0, _colors.getColorFromPalette)(colorName, {
|
|
42
|
-
color,
|
|
43
|
-
colorMode,
|
|
61
|
+
color: internalColor,
|
|
62
|
+
colorMode: internalColorMode,
|
|
44
63
|
secondaryColor
|
|
45
64
|
});
|
|
46
65
|
if (hexColor) {
|
|
47
66
|
const rgbColor = (0, _colors.hexToRgb255)(hexColor);
|
|
48
67
|
newColors[`--chayns-color--${colorName}`] = hexColor;
|
|
49
|
-
|
|
68
|
+
newTheme[colorName] = hexColor;
|
|
50
69
|
if (rgbColor) {
|
|
51
70
|
newColors[`--chayns-color-rgb--${colorName}`] = `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;
|
|
52
|
-
|
|
71
|
+
newTheme[`${colorName}-rgb`] = `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;
|
|
53
72
|
}
|
|
54
73
|
}
|
|
55
74
|
});
|
|
75
|
+
if (internalDesignSettings) {
|
|
76
|
+
Object.keys(internalDesignSettings).forEach(key => {
|
|
77
|
+
if (key === 'iconStyle') {
|
|
78
|
+
newTheme[key] = (0, _font.convertIconStyle)(internalDesignSettings.iconStyle);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// ToDo: Find better solution
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
86
|
+
newTheme[key] = internalDesignSettings[key];
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
setTheme(newTheme);
|
|
56
90
|
setColors(newColors);
|
|
57
|
-
|
|
58
|
-
}, [color, colorMode, secondaryColor]);
|
|
91
|
+
}, [internalColor, internalColorMode, internalDesignSettings, secondaryColor]);
|
|
59
92
|
return /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
|
|
60
|
-
theme:
|
|
93
|
+
theme: theme
|
|
61
94
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
62
95
|
style: {
|
|
63
96
|
...colors,
|
|
@@ -67,6 +100,5 @@ const ColorSchemeProvider = _ref => {
|
|
|
67
100
|
}, children), /*#__PURE__*/_react.default.createElement(GlobalStyle, null));
|
|
68
101
|
};
|
|
69
102
|
ColorSchemeProvider.displayName = 'ColorSchemeProvider';
|
|
70
|
-
var _default = ColorSchemeProvider;
|
|
71
|
-
exports.default = _default;
|
|
103
|
+
var _default = exports.default = ColorSchemeProvider;
|
|
72
104
|
//# sourceMappingURL=ColorSchemeProvider.js.map
|