@chayns-components/core 5.0.0-beta.3 → 5.0.0-beta.300
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 -9
- 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/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 +72 -6
- package/lib/components/accordion/Accordion.js +109 -166
- package/lib/components/accordion/Accordion.js.map +1 -1
- package/lib/components/accordion/Accordion.styles.d.ts +7 -0
- package/lib/components/accordion/Accordion.styles.js +108 -0
- package/lib/components/accordion/Accordion.styles.js.map +1 -0
- package/lib/components/accordion/accordion-body/AccordionBody.d.ts +16 -2
- package/lib/components/accordion/accordion-body/AccordionBody.js +25 -25
- package/lib/components/accordion/accordion-body/AccordionBody.js.map +1 -1
- package/lib/components/accordion/accordion-body/AccordionBody.styles.d.ts +4 -0
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js +24 -0
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -0
- package/lib/components/accordion/accordion-content/AccordionContent.d.ts +14 -3
- package/lib/components/accordion/accordion-content/AccordionContent.js +20 -24
- package/lib/components/accordion/accordion-content/AccordionContent.js.map +1 -1
- package/lib/components/accordion/accordion-content/AccordionContent.styles.d.ts +6 -0
- package/lib/components/accordion/accordion-content/AccordionContent.styles.js +34 -0
- package/lib/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -0
- package/lib/components/accordion/accordion-group/AccordionGroup.d.ts +27 -0
- package/lib/components/accordion/accordion-group/AccordionGroup.js +57 -0
- package/lib/components/accordion/accordion-group/AccordionGroup.js.map +1 -0
- package/lib/components/accordion/accordion-head/AccordionHead.d.ts +10 -4
- package/lib/components/accordion/accordion-head/AccordionHead.js +94 -127
- package/lib/components/accordion/accordion-head/AccordionHead.js.map +1 -1
- package/lib/components/accordion/accordion-head/AccordionHead.styles.d.ts +19 -0
- package/lib/components/accordion/accordion-head/AccordionHead.styles.js +153 -0
- package/lib/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.d.ts +9 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.js +20 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.js.map +1 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.d.ts +1 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js +12 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js.map +1 -0
- 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 +5 -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/accordion/utils.d.ts +11 -0
- package/lib/components/accordion/utils.js +36 -0
- package/lib/components/accordion/utils.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 +14 -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/amount-control/utils.d.ts +7 -0
- package/lib/components/amount-control/utils.js +22 -0
- package/lib/components/amount-control/utils.js.map +1 -0
- package/lib/components/badge/Badge.d.ts +9 -1
- package/lib/components/badge/Badge.js +15 -28
- package/lib/components/badge/Badge.js.map +1 -1
- package/lib/components/badge/Badge.styles.d.ts +4 -0
- package/lib/components/badge/Badge.styles.js +31 -0
- package/lib/components/badge/Badge.styles.js.map +1 -0
- package/lib/components/button/Button.d.ts +6 -2
- package/lib/components/button/Button.js +68 -47
- package/lib/components/button/Button.js.map +1 -1
- package/lib/components/button/Button.styles.d.ts +9 -0
- package/lib/components/button/Button.styles.js +66 -0
- package/lib/components/button/Button.styles.js.map +1 -0
- package/lib/components/checkbox/Checkbox.d.ts +25 -0
- package/lib/components/checkbox/Checkbox.js +43 -0
- package/lib/components/checkbox/Checkbox.js.map +1 -0
- package/lib/components/checkbox/Checkbox.styles.d.ts +6 -0
- package/lib/components/checkbox/Checkbox.styles.js +128 -0
- package/lib/components/checkbox/Checkbox.styles.js.map +1 -0
- package/lib/components/color-scheme-provider/ColorSchemeProvider.d.ts +7 -1
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js +45 -83
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/components/color-scheme-provider/font.d.ts +6 -0
- package/lib/components/color-scheme-provider/font.js +59 -0
- package/lib/components/color-scheme-provider/font.js.map +1 -0
- package/lib/components/combobox/ComboBox.d.ts +25 -0
- package/lib/components/combobox/ComboBox.js +143 -0
- package/lib/components/combobox/ComboBox.js.map +1 -0
- package/lib/components/combobox/ComboBox.styles.d.ts +17 -0
- package/lib/components/combobox/ComboBox.styles.js +123 -0
- package/lib/components/combobox/ComboBox.styles.js.map +1 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.d.ts +18 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.js +29 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.js.map +1 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.styles.d.ts +6 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js +28 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js.map +1 -0
- package/lib/components/content-card/ContentCard.d.ts +9 -0
- package/lib/components/content-card/ContentCard.js +18 -0
- package/lib/components/content-card/ContentCard.js.map +1 -0
- package/lib/components/content-card/ContentCard.styles.d.ts +1 -0
- package/lib/components/content-card/ContentCard.styles.js +22 -0
- package/lib/components/content-card/ContentCard.styles.js.map +1 -0
- package/lib/components/context-menu/ContextMenu.d.ts +51 -0
- package/lib/components/context-menu/ContextMenu.js +156 -0
- package/lib/components/context-menu/ContextMenu.js.map +1 -0
- package/lib/components/context-menu/ContextMenu.styles.d.ts +1 -0
- package/lib/components/context-menu/ContextMenu.styles.js +12 -0
- package/lib/components/context-menu/ContextMenu.styles.js.map +1 -0
- package/lib/components/context-menu/constants/alignment.d.ts +8 -0
- package/lib/components/context-menu/constants/alignment.js +16 -0
- package/lib/components/context-menu/constants/alignment.js.map +1 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.d.ts +10 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.js +77 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +11 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js +113 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -0
- package/lib/components/date-info/DateInfo.d.ts +40 -0
- package/lib/components/date-info/DateInfo.js +108 -0
- package/lib/components/date-info/DateInfo.js.map +1 -0
- package/lib/components/date-info/utils/format.d.ts +43 -0
- package/lib/components/date-info/utils/format.js +287 -0
- package/lib/components/date-info/utils/format.js.map +1 -0
- package/lib/components/date-info/utils/language.d.ts +1 -0
- package/lib/components/date-info/utils/language.js +35 -0
- package/lib/components/date-info/utils/language.js.map +1 -0
- package/lib/components/filter-button/FilterButton.d.ts +22 -0
- package/lib/components/filter-button/FilterButton.js +88 -0
- package/lib/components/filter-button/FilterButton.js.map +1 -0
- package/lib/components/filter-button/FilterButton.styles.d.ts +1 -0
- package/lib/components/filter-button/FilterButton.styles.js +14 -0
- package/lib/components/filter-button/FilterButton.styles.js.map +1 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.d.ts +14 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.js +47 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.js.map +1 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.d.ts +26 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.js +104 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.js.map +1 -0
- package/lib/components/filter-button/types.d.ts +15 -0
- package/lib/components/filter-button/types.js +17 -0
- package/lib/components/filter-button/types.js.map +1 -0
- package/lib/components/grid-image/GridImage.d.ts +19 -0
- package/lib/components/grid-image/GridImage.js +45 -0
- package/lib/components/grid-image/GridImage.js.map +1 -0
- package/lib/components/grid-image/GridImage.styles.d.ts +21 -0
- package/lib/components/grid-image/GridImage.styles.js +101 -0
- package/lib/components/grid-image/GridImage.styles.js.map +1 -0
- package/lib/components/icon/Icon.d.ts +11 -3
- package/lib/components/icon/Icon.js +37 -82
- package/lib/components/icon/Icon.js.map +1 -1
- package/lib/components/icon/Icon.styles.d.ts +15 -0
- package/lib/components/icon/Icon.styles.js +74 -0
- package/lib/components/icon/Icon.styles.js.map +1 -0
- package/lib/components/icon/utils.d.ts +1 -0
- package/lib/components/icon/utils.js +13 -0
- package/lib/components/icon/utils.js.map +1 -0
- package/lib/components/input/Input.d.ts +65 -0
- package/lib/components/input/Input.js +119 -0
- package/lib/components/input/Input.js.map +1 -0
- package/lib/components/input/Input.styles.d.ts +15 -0
- package/lib/components/input/Input.styles.js +98 -0
- package/lib/components/input/Input.styles.js.map +1 -0
- package/lib/components/list/List.d.ts +18 -0
- package/lib/components/list/List.js +52 -0
- package/lib/components/list/List.js.map +1 -0
- package/lib/components/list/list-item/ListItem.d.ts +67 -0
- package/lib/components/list/list-item/ListItem.js +91 -0
- package/lib/components/list/list-item/ListItem.js.map +1 -0
- package/lib/components/list/list-item/ListItem.styles.d.ts +6 -0
- package/lib/components/list/list-item/ListItem.styles.js +55 -0
- package/lib/components/list/list-item/ListItem.styles.js.map +1 -0
- package/lib/components/list/list-item/list-item-body/ListItemBody.d.ts +6 -0
- package/lib/components/list/list-item/list-item-body/ListItemBody.js +57 -0
- package/lib/components/list/list-item/list-item-body/ListItemBody.js.map +1 -0
- package/lib/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +1 -0
- package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js +13 -0
- package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js.map +1 -0
- package/lib/components/list/list-item/list-item-content/ListItemContent.d.ts +3 -0
- package/lib/components/list/list-item/list-item-content/ListItemContent.js +20 -0
- package/lib/components/list/list-item/list-item-content/ListItemContent.js.map +1 -0
- package/lib/components/list/list-item/list-item-content/ListItemContent.styles.d.ts +1 -0
- package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js +18 -0
- package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/ListItemHead.d.ts +18 -0
- package/lib/components/list/list-item/list-item-head/ListItemHead.js +99 -0
- package/lib/components/list/list-item/list-item-head/ListItemHead.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +20 -0
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js +99 -0
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.d.ts +6 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js +22 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.d.ts +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js +31 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.d.ts +7 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js +43 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.d.ts +10 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js +50 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js.map +1 -0
- package/lib/components/mention-finder/MentionFinder.d.ts +31 -0
- package/lib/components/mention-finder/MentionFinder.js +140 -0
- package/lib/components/mention-finder/MentionFinder.js.map +1 -0
- package/lib/components/mention-finder/MentionFinder.styles.d.ts +5 -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/constants/alignment.d.ts +4 -0
- package/lib/components/mention-finder/constants/alignment.js +12 -0
- package/lib/components/mention-finder/constants/alignment.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 +8 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js +95 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -0
- package/lib/components/number-input/NumberInput.d.ts +46 -0
- package/lib/components/number-input/NumberInput.js +123 -0
- package/lib/components/number-input/NumberInput.js.map +1 -0
- package/lib/components/number-input/constants/number.d.ts +4 -0
- package/lib/components/number-input/constants/number.js +11 -0
- package/lib/components/number-input/constants/number.js.map +1 -0
- package/lib/components/number-input/utils/number.d.ts +21 -0
- package/lib/components/number-input/utils/number.js +64 -0
- package/lib/components/number-input/utils/number.js.map +1 -0
- package/lib/components/popup/Popup.d.ts +26 -0
- package/lib/components/popup/Popup.js +154 -0
- package/lib/components/popup/Popup.js.map +1 -0
- package/lib/components/popup/Popup.styles.d.ts +4 -0
- package/lib/components/popup/Popup.styles.js +25 -0
- package/lib/components/popup/Popup.styles.js.map +1 -0
- package/lib/components/popup/popup-content/PopupContent.d.ts +9 -0
- package/lib/components/popup/popup-content/PopupContent.js +63 -0
- package/lib/components/popup/popup-content/PopupContent.js.map +1 -0
- package/lib/components/popup/popup-content/PopupContent.styles.d.ts +7 -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/popup/types.d.ts +16 -0
- package/lib/components/popup/types.js +16 -0
- package/lib/components/popup/types.js.map +1 -0
- package/lib/components/progress-bar/ProgressBar.d.ts +9 -0
- package/lib/components/progress-bar/ProgressBar.js +38 -0
- package/lib/components/progress-bar/ProgressBar.js.map +1 -0
- package/lib/components/progress-bar/ProgressBar.styles.d.ts +7 -0
- package/lib/components/progress-bar/ProgressBar.styles.js +36 -0
- package/lib/components/progress-bar/ProgressBar.styles.js.map +1 -0
- package/lib/components/radio-button/RadioButton.d.ts +26 -0
- package/lib/components/radio-button/RadioButton.js +85 -0
- package/lib/components/radio-button/RadioButton.js.map +1 -0
- package/lib/components/radio-button/RadioButton.styles.d.ts +22 -0
- package/lib/components/radio-button/RadioButton.styles.js +95 -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/radio-button/types.d.ts +4 -0
- package/lib/components/radio-button/types.js +6 -0
- package/lib/components/radio-button/types.js.map +1 -0
- package/lib/components/scroll-view/ScrollView.d.ts +9 -0
- package/lib/components/scroll-view/ScrollView.js +22 -0
- package/lib/components/scroll-view/ScrollView.js.map +1 -0
- package/lib/components/scroll-view/ScrollView.styles.d.ts +6 -0
- package/lib/components/scroll-view/ScrollView.styles.js +26 -0
- package/lib/components/scroll-view/ScrollView.styles.js.map +1 -0
- package/lib/components/search-box/SearchBox.d.ts +30 -0
- package/lib/components/search-box/SearchBox.js +179 -0
- package/lib/components/search-box/SearchBox.js.map +1 -0
- package/lib/components/search-box/SearchBox.styles.d.ts +7 -0
- package/lib/components/search-box/SearchBox.styles.js +56 -0
- package/lib/components/search-box/SearchBox.styles.js.map +1 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.d.ts +9 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.js +29 -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 +6 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js +28 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js.map +1 -0
- package/lib/components/search-box/types.d.ts +4 -0
- package/lib/components/search-box/types.js +6 -0
- package/lib/components/search-box/types.js.map +1 -0
- package/lib/components/search-box/utils.d.ts +7 -0
- package/lib/components/search-box/utils.js +23 -0
- package/lib/components/search-box/utils.js.map +1 -0
- package/lib/components/search-input/SearchInput.d.ts +25 -0
- package/lib/components/search-input/SearchInput.js +95 -0
- package/lib/components/search-input/SearchInput.js.map +1 -0
- package/lib/components/search-input/SearchInput.styles.d.ts +4 -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/sharing-bar/SharingBar.d.ts +18 -0
- package/lib/components/sharing-bar/SharingBar.js +113 -0
- package/lib/components/sharing-bar/SharingBar.js.map +1 -0
- package/lib/components/sharing-bar/SharingBar.styles.d.ts +5 -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/slider/Slider.d.ts +21 -0
- package/lib/components/slider/Slider.js +51 -0
- package/lib/components/slider/Slider.js.map +1 -0
- package/lib/components/slider/Slider.styles.d.ts +8 -0
- package/lib/components/slider/Slider.styles.js +75 -0
- package/lib/components/slider/Slider.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 +18 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js +102 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js.map +1 -0
- package/lib/components/text-area/TextArea.d.ts +25 -0
- package/lib/components/text-area/TextArea.js +70 -0
- package/lib/components/text-area/TextArea.js.map +1 -0
- package/lib/components/text-area/TextArea.styles.d.ts +11 -0
- package/lib/components/text-area/TextArea.styles.js +73 -0
- package/lib/components/text-area/TextArea.styles.js.map +1 -0
- package/lib/components/tooltip/Tooltip.d.ts +18 -0
- package/lib/components/tooltip/Tooltip.js +32 -0
- package/lib/components/tooltip/Tooltip.js.map +1 -0
- package/lib/components/tooltip/Tooltip.styles.d.ts +1 -0
- package/lib/components/tooltip/Tooltip.styles.js +10 -0
- package/lib/components/tooltip/Tooltip.styles.js.map +1 -0
- package/lib/components/tooltip/interface.d.ts +4 -0
- package/lib/components/tooltip/interface.js +6 -0
- package/lib/components/tooltip/interface.js.map +1 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.d.ts +7 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.js +20 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.js.map +1 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.styles.d.ts +7 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js +29 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js.map +1 -0
- package/lib/hooks/uuid.d.ts +1 -0
- package/lib/hooks/uuid.js +14 -0
- package/lib/hooks/uuid.js.map +1 -0
- package/lib/index.d.ts +41 -0
- package/lib/index.js +263 -11
- package/lib/index.js.map +1 -1
- package/lib/types/chayns.d.ts +112 -0
- package/lib/types/chayns.js +13 -0
- package/lib/types/chayns.js.map +1 -0
- package/lib/types/file.d.ts +42 -0
- package/lib/types/file.js +6 -0
- package/lib/types/file.js.map +1 -0
- package/lib/utils/calculate.d.ts +2 -0
- package/lib/utils/calculate.js +40 -0
- package/lib/utils/calculate.js.map +1 -0
- package/lib/utils/fileDialog.d.ts +7 -0
- package/lib/utils/fileDialog.js +74 -0
- package/lib/utils/fileDialog.js.map +1 -0
- package/lib/utils/isTobitEmployee.d.ts +1 -0
- package/lib/utils/isTobitEmployee.js +31 -0
- package/lib/utils/isTobitEmployee.js.map +1 -0
- package/lib/utils/uploadFile.d.ts +9 -0
- package/lib/utils/uploadFile.js +48 -0
- package/lib/utils/uploadFile.js.map +1 -0
- package/package.json +68 -62
|
@@ -4,69 +4,90 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
-
|
|
8
|
+
var _framerMotion = require("framer-motion");
|
|
10
9
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
10
|
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
11
|
+
var _SmallWaitCursor = _interopRequireWildcard(require("../small-wait-cursor/SmallWaitCursor"));
|
|
12
|
+
var _Button = require("./Button.styles");
|
|
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; }
|
|
18
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return props.disabled ? 0.5 : 1;
|
|
32
|
-
}, function (_ref3) {
|
|
33
|
-
var hasIcon = _ref3.hasIcon;
|
|
34
|
-
return "7px 12px 7px ".concat(hasIcon ? '42px' : '12px');
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
var StyledIconWrapper = _styledComponents.default.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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"])));
|
|
38
|
-
|
|
39
|
-
var Button = function Button(_ref4) {
|
|
40
|
-
var children = _ref4.children,
|
|
41
|
-
className = _ref4.className,
|
|
42
|
-
icon = _ref4.icon,
|
|
43
|
-
isDisabled = _ref4.isDisabled,
|
|
44
|
-
isSecondary = _ref4.isSecondary,
|
|
45
|
-
onClick = _ref4.onClick,
|
|
46
|
-
shouldStopPropagation = _ref4.shouldStopPropagation;
|
|
47
|
-
|
|
48
|
-
var handleClick = function handleClick(event) {
|
|
16
|
+
const Button = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
children,
|
|
19
|
+
className,
|
|
20
|
+
icon,
|
|
21
|
+
isDisabled,
|
|
22
|
+
isSecondary,
|
|
23
|
+
onClick,
|
|
24
|
+
shouldShowWaitCursor,
|
|
25
|
+
shouldStopPropagation
|
|
26
|
+
} = _ref;
|
|
27
|
+
const handleClick = event => {
|
|
49
28
|
if (shouldStopPropagation) {
|
|
50
29
|
event.stopPropagation();
|
|
51
30
|
}
|
|
52
|
-
|
|
53
31
|
onClick(event);
|
|
54
32
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return /*#__PURE__*/_react.default.createElement(StyledButton, {
|
|
33
|
+
const buttonClasses = (0, _clsx.default)('beta-chayns-button ellipsis', className);
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(_Button.StyledButton, {
|
|
58
35
|
className: buttonClasses,
|
|
59
36
|
disabled: isDisabled,
|
|
60
37
|
hasIcon: typeof icon === 'string' && icon !== '',
|
|
61
38
|
isSecondary: isSecondary,
|
|
62
39
|
onClick: handleClick
|
|
63
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
|
|
41
|
+
initial: false
|
|
42
|
+
}, icon && /*#__PURE__*/_react.default.createElement(_Button.StyledIconWrapper, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
64
43
|
color: "white",
|
|
65
44
|
icons: [icon]
|
|
66
|
-
})),
|
|
45
|
+
})), shouldShowWaitCursor ? /*#__PURE__*/_react.default.createElement(_Button.StyledMotionWaitCursorWrapper, {
|
|
46
|
+
animate: {
|
|
47
|
+
opacity: 1,
|
|
48
|
+
width: 40
|
|
49
|
+
},
|
|
50
|
+
exit: {
|
|
51
|
+
opacity: 0,
|
|
52
|
+
width: 0
|
|
53
|
+
},
|
|
54
|
+
initial: {
|
|
55
|
+
opacity: 0,
|
|
56
|
+
width: 0
|
|
57
|
+
},
|
|
58
|
+
key: "wait-cursor",
|
|
59
|
+
style: {
|
|
60
|
+
overflow: 'hidden'
|
|
61
|
+
},
|
|
62
|
+
transition: {
|
|
63
|
+
duration: 0.2
|
|
64
|
+
}
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.default, {
|
|
66
|
+
color: "white",
|
|
67
|
+
shouldHideBackground: true,
|
|
68
|
+
size: _SmallWaitCursor.SmallWaitCursorSize.Small
|
|
69
|
+
})) : /*#__PURE__*/_react.default.createElement(_Button.StyledMotionChildrenWrapper, {
|
|
70
|
+
animate: {
|
|
71
|
+
opacity: 1,
|
|
72
|
+
width: 'auto'
|
|
73
|
+
},
|
|
74
|
+
exit: {
|
|
75
|
+
opacity: 0,
|
|
76
|
+
width: 0
|
|
77
|
+
},
|
|
78
|
+
initial: {
|
|
79
|
+
opacity: 0,
|
|
80
|
+
width: 0
|
|
81
|
+
},
|
|
82
|
+
key: "children",
|
|
83
|
+
style: {
|
|
84
|
+
overflow: 'hidden'
|
|
85
|
+
},
|
|
86
|
+
transition: {
|
|
87
|
+
duration: 0.2
|
|
88
|
+
}
|
|
89
|
+
}, children)));
|
|
67
90
|
};
|
|
68
|
-
|
|
69
91
|
Button.displayName = 'Button';
|
|
70
|
-
var _default = Button;
|
|
71
|
-
exports.default = _default;
|
|
92
|
+
var _default = exports.default = Button;
|
|
72
93
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Button.js","names":["_clsx","_interopRequireDefault","require","_framerMotion","_react","_Icon","_SmallWaitCursor","_interopRequireWildcard","_Button","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","Button","_ref","children","className","icon","isDisabled","isSecondary","onClick","shouldShowWaitCursor","shouldStopPropagation","handleClick","event","stopPropagation","buttonClasses","clsx","createElement","StyledButton","disabled","hasIcon","AnimatePresence","initial","StyledIconWrapper","color","icons","StyledMotionWaitCursorWrapper","animate","opacity","width","exit","key","style","overflow","transition","duration","shouldHideBackground","size","SmallWaitCursorSize","Small","StyledMotionChildrenWrapper","displayName","_default","exports"],"sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { AnimatePresence } from 'framer-motion';\nimport React, { FC, MouseEventHandler, ReactNode } from 'react';\nimport Icon from '../icon/Icon';\nimport SmallWaitCursor, { SmallWaitCursorSize } from '../small-wait-cursor/SmallWaitCursor';\nimport {\n StyledButton,\n StyledIconWrapper,\n StyledMotionChildrenWrapper,\n StyledMotionWaitCursorWrapper,\n} from './Button.styles';\n\nexport type ButtonProps = {\n /**\n * The label of the button\n */\n children: ReactNode;\n /**\n * Additional class names for the button element\n */\n className?: string;\n /**\n * An icon that is displayed on the left-hand side of the button text\n */\n icon?: string;\n /**\n * Disables the button so that it cannot be clicked anymore\n */\n isDisabled?: boolean;\n /**\n * Displays the button in the secondary style\n */\n isSecondary?: boolean;\n /**\n * Function to be executed when the button is clicked\n */\n onClick: MouseEventHandler<HTMLButtonElement>;\n /**\n * Shows a wait cursor instead of button text\n */\n shouldShowWaitCursor?: boolean;\n /**\n * Stops event propagation on click\n */\n shouldStopPropagation?: boolean;\n};\n\nconst Button: FC<ButtonProps> = ({\n children,\n className,\n icon,\n isDisabled,\n isSecondary,\n onClick,\n shouldShowWaitCursor,\n shouldStopPropagation,\n}) => {\n const handleClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n onClick(event);\n };\n\n const buttonClasses = clsx('beta-chayns-button ellipsis', className);\n\n return (\n <StyledButton\n className={buttonClasses}\n disabled={isDisabled}\n hasIcon={typeof icon === 'string' && icon !== ''}\n isSecondary={isSecondary}\n onClick={handleClick}\n >\n <AnimatePresence initial={false}>\n {icon && (\n <StyledIconWrapper>\n <Icon color=\"white\" icons={[icon]} />\n </StyledIconWrapper>\n )}\n {shouldShowWaitCursor ? (\n <StyledMotionWaitCursorWrapper\n animate={{ opacity: 1, width: 40 }}\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n key=\"wait-cursor\"\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2 }}\n >\n <SmallWaitCursor\n color=\"white\"\n shouldHideBackground\n size={SmallWaitCursorSize.Small}\n />\n </StyledMotionWaitCursorWrapper>\n ) : (\n <StyledMotionChildrenWrapper\n animate={{ opacity: 1, width: 'auto' }}\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n key=\"children\"\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2 }}\n >\n {children}\n </StyledMotionChildrenWrapper>\n )}\n </AnimatePresence>\n </StyledButton>\n );\n};\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,gBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKyB,SAAAO,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,SAAAH,wBAAAG,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,o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,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAE,CAAE;IAClCE,GAAG,EAAC,UAAU;IACdC,KAAK,EAAE;MAAEC,QAAQ,EAAE;IAAS,CAAE;IAC9BC,UAAU,EAAE;MAAEC,QAAQ,EAAE;IAAI;EAAE,GAE7B/B,QACwB,CAEpB,CACP,CAAC;AAEvB,CAAC;AAEDF,MAAM,CAACuC,WAAW,GAAG,QAAQ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAzD,OAAA,GAEfgB,MAAM"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ButtonProps } from './Button';
|
|
2
|
+
export declare const StyledButton: import("styled-components").StyledComponent<"button", any, ButtonProps & {
|
|
3
|
+
hasIcon: boolean;
|
|
4
|
+
} & {
|
|
5
|
+
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const StyledIconWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
8
|
+
export declare const StyledMotionChildrenWrapper: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, {}, never>;
|
|
9
|
+
export declare const StyledMotionWaitCursorWrapper: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, {}, never>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledMotionWaitCursorWrapper = exports.StyledMotionChildrenWrapper = exports.StyledIconWrapper = exports.StyledButton = void 0;
|
|
7
|
+
var _framerMotion = require("framer-motion");
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const StyledButton = exports.StyledButton = _styledComponents.default.button`
|
|
11
|
+
align-items: center;
|
|
12
|
+
background-color: ${_ref => {
|
|
13
|
+
let {
|
|
14
|
+
isSecondary,
|
|
15
|
+
theme
|
|
16
|
+
} = _ref;
|
|
17
|
+
return isSecondary ? theme['202'] : theme['408'];
|
|
18
|
+
}};
|
|
19
|
+
border-radius: 3px;
|
|
20
|
+
box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.2);
|
|
21
|
+
border: none;
|
|
22
|
+
color: ${_ref2 => {
|
|
23
|
+
let {
|
|
24
|
+
isSecondary,
|
|
25
|
+
theme
|
|
26
|
+
} = _ref2;
|
|
27
|
+
return isSecondary ? theme.text : 'white';
|
|
28
|
+
}};
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
line-height: 1.15;
|
|
32
|
+
min-height: 32px;
|
|
33
|
+
opacity: ${_ref3 => {
|
|
34
|
+
let {
|
|
35
|
+
disabled
|
|
36
|
+
} = _ref3;
|
|
37
|
+
return disabled ? 0.5 : 1;
|
|
38
|
+
}};
|
|
39
|
+
padding: ${_ref4 => {
|
|
40
|
+
let {
|
|
41
|
+
hasIcon
|
|
42
|
+
} = _ref4;
|
|
43
|
+
return `7px 12px 7px ${hasIcon ? '42px' : '12px'}`;
|
|
44
|
+
}};
|
|
45
|
+
position: relative;
|
|
46
|
+
user-select: none;
|
|
47
|
+
transition: opacity 0.3s ease;
|
|
48
|
+
`;
|
|
49
|
+
const StyledIconWrapper = exports.StyledIconWrapper = _styledComponents.default.span`
|
|
50
|
+
align-items: center;
|
|
51
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
52
|
+
bottom: 0;
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
left: 0;
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: 0;
|
|
58
|
+
width: 30px;
|
|
59
|
+
`;
|
|
60
|
+
const StyledMotionChildrenWrapper = exports.StyledMotionChildrenWrapper = (0, _styledComponents.default)(_framerMotion.motion.div)``;
|
|
61
|
+
const StyledMotionWaitCursorWrapper = exports.StyledMotionWaitCursorWrapper = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
62
|
+
align-items: center;
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
`;
|
|
66
|
+
//# sourceMappingURL=Button.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","obj","__esModule","default","StyledButton","exports","styled","button","_ref","isSecondary","theme","_ref2","text","_ref3","disabled","_ref4","hasIcon","StyledIconWrapper","span","StyledMotionChildrenWrapper","motion","div","StyledMotionWaitCursorWrapper"],"sources":["../../../src/components/button/Button.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { ButtonProps } from './Button';\n\ntype StyledButtonProps = ButtonProps &\n WithTheme<{\n hasIcon: 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: pointer;\n display: inline-flex;\n line-height: 1.15;\n min-height: 32px;\n opacity: ${({ disabled }) => (disabled ? 0.5 : 1)};\n padding: ${({ hasIcon }) => `7px 12px 7px ${hasIcon ? '42px' : '12px'}`};\n position: relative;\n user-select: none;\n transition: opacity 0.3s ease;\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)``;\n\nexport const StyledMotionWaitCursorWrapper = styled(motion.div)`\n align-items: center;\n display: flex;\n justify-content: center;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAShC,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,yBAAM,CAACC,MAA0B;AAC7D;AACA,wBAAwBC,IAAA;EAAA,IAAC;IAAEC,WAAW;IAAEC;EAAyB,CAAC,GAAAF,IAAA;EAAA,OAC1DC,WAAW,GAAGC,KAAK,CAAC,KAAK,CAAC,GAAGA,KAAK,CAAC,KAAK,CAAC;AAAA,CAAC;AAClD;AACA;AACA;AACA,aAAaC,KAAA;EAAA,IAAC;IAAEF,WAAW;IAAEC;EAAyB,CAAC,GAAAC,KAAA;EAAA,OAAMF,WAAW,GAAGC,KAAK,CAACE,IAAI,GAAG,OAAO;AAAA,CAAE;AACjG;AACA;AACA;AACA;AACA,eAAeC,KAAA;EAAA,IAAC;IAAEC;EAAS,CAAC,GAAAD,KAAA;EAAA,OAAMC,QAAQ,GAAG,GAAG,GAAG,CAAC;AAAA,CAAE;AACtD,eAAeC,KAAA;EAAA,IAAC;IAAEC;EAAQ,CAAC,GAAAD,KAAA;EAAA,OAAM,gBAAeC,OAAO,GAAG,MAAM,GAAG,MAAO,EAAC;AAAA,CAAC;AAC5E;AACA;AACA;AACA,CAAC;AAEM,MAAMC,iBAAiB,GAAAZ,OAAA,CAAAY,iBAAA,GAAGX,yBAAM,CAACY,IAAK;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,2BAA2B,GAAAd,OAAA,CAAAc,2BAAA,GAAG,IAAAb,yBAAM,EAACc,oBAAM,CAACC,GAAG,CAAE,EAAC;AAExD,MAAMC,6BAA6B,GAAAjB,OAAA,CAAAiB,6BAAA,GAAG,IAAAhB,yBAAM,EAACc,oBAAM,CAACC,GAAG,CAAE;AAChE;AACA;AACA;AACA,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ChangeEventHandler, FC, ReactNode } from 'react';
|
|
2
|
+
export type CheckboxProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Text for checkbox or switch
|
|
5
|
+
*/
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Indicates whether the checkbox or switch is selected
|
|
9
|
+
*/
|
|
10
|
+
isChecked?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Disables the checkbox or switch so it cannot be toggled
|
|
13
|
+
*/
|
|
14
|
+
isDisabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Function to be executed if the checked value changes
|
|
17
|
+
*/
|
|
18
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
19
|
+
/**
|
|
20
|
+
* Changes the design to use switch instead of checkbox
|
|
21
|
+
*/
|
|
22
|
+
shouldShowAsSwitch?: boolean;
|
|
23
|
+
};
|
|
24
|
+
declare const Checkbox: FC<CheckboxProps>;
|
|
25
|
+
export default Checkbox;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _uuid = require("../../hooks/uuid");
|
|
9
|
+
var _Checkbox = require("./Checkbox.styles");
|
|
10
|
+
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); }
|
|
11
|
+
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
|
+
const Checkbox = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
isChecked,
|
|
16
|
+
isDisabled,
|
|
17
|
+
onChange,
|
|
18
|
+
shouldShowAsSwitch
|
|
19
|
+
} = _ref;
|
|
20
|
+
const [isActive, setIsActive] = (0, _react.useState)(isChecked !== null && isChecked !== void 0 ? isChecked : false);
|
|
21
|
+
const handleChange = (0, _react.useCallback)(event => {
|
|
22
|
+
setIsActive(event.target.checked);
|
|
23
|
+
if (typeof onChange === 'function') {
|
|
24
|
+
onChange(event);
|
|
25
|
+
}
|
|
26
|
+
}, [onChange]);
|
|
27
|
+
const uuid = (0, _uuid.useUuid)();
|
|
28
|
+
return /*#__PURE__*/_react.default.createElement(_Checkbox.StyledCheckbox, null, /*#__PURE__*/_react.default.createElement(_Checkbox.StyledCheckboxInput, {
|
|
29
|
+
checked: isChecked,
|
|
30
|
+
disabled: isDisabled,
|
|
31
|
+
id: uuid,
|
|
32
|
+
onChange: handleChange,
|
|
33
|
+
type: "checkbox"
|
|
34
|
+
}), /*#__PURE__*/_react.default.createElement(_Checkbox.StyledCheckboxLabel, {
|
|
35
|
+
htmlFor: uuid,
|
|
36
|
+
isChecked: isChecked !== null && isChecked !== void 0 ? isChecked : isActive,
|
|
37
|
+
isDisabled: isDisabled,
|
|
38
|
+
shouldShowAsSwitch: shouldShowAsSwitch
|
|
39
|
+
}, children));
|
|
40
|
+
};
|
|
41
|
+
Checkbox.displayName = 'Checkbox';
|
|
42
|
+
var _default = exports.default = Checkbox;
|
|
43
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.js","names":["_react","_interopRequireWildcard","require","_uuid","_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","onChange","shouldShowAsSwitch","isActive","setIsActive","useState","handleChange","useCallback","event","target","checked","uuid","useUuid","createElement","StyledCheckbox","StyledCheckboxInput","disabled","id","type","StyledCheckboxLabel","htmlFor","displayName","_default","exports"],"sources":["../../../src/components/checkbox/Checkbox.tsx"],"sourcesContent":["import React, {\n ChangeEvent,\n ChangeEventHandler,\n FC,\n ReactNode,\n useCallback,\n useState,\n} from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport { StyledCheckbox, StyledCheckboxInput, StyledCheckboxLabel } from './Checkbox.styles';\n\nexport type CheckboxProps = {\n /**\n * Text for checkbox or switch\n */\n children?: ReactNode;\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 * 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\nconst Checkbox: FC<CheckboxProps> = ({\n children,\n isChecked,\n isDisabled,\n onChange,\n shouldShowAsSwitch,\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 return (\n <StyledCheckbox>\n <StyledCheckboxInput\n checked={isChecked}\n disabled={isDisabled}\n id={uuid}\n onChange={handleChange}\n type=\"checkbox\"\n />\n <StyledCheckboxLabel\n htmlFor={uuid}\n isChecked={isChecked ?? isActive}\n isDisabled={isDisabled}\n shouldShowAsSwitch={shouldShowAsSwitch}\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;AAQA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAA6F,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,SAAAL,wBAAAK,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,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,C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E,kBAAkB,EAAEA;EAAmB,GAEtCJ,QACgB,CACT,CAAC;AAEzB,CAAC;AAEDF,QAAQ,CAACyB,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1C,OAAA,GAEnBe,QAAQ"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CheckboxProps } from './Checkbox';
|
|
2
|
+
export declare const StyledCheckbox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const StyledCheckboxInput: import("styled-components").StyledComponent<"input", any, {}, never>;
|
|
4
|
+
export declare const StyledCheckboxLabel: import("styled-components").StyledComponent<"label", any, Omit<CheckboxProps, "children" | "onChange"> & {
|
|
5
|
+
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
6
|
+
}, never>;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledCheckboxLabel = exports.StyledCheckboxInput = exports.StyledCheckbox = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
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
|
+
align-items: center;
|
|
12
|
+
display: flex;
|
|
13
|
+
position: relative;
|
|
14
|
+
`;
|
|
15
|
+
const StyledCheckboxInput = exports.StyledCheckboxInput = _styledComponents.default.input`
|
|
16
|
+
display: none;
|
|
17
|
+
`;
|
|
18
|
+
const StyledCheckboxLabel = exports.StyledCheckboxLabel = _styledComponents.default.label`
|
|
19
|
+
color: ${_ref => {
|
|
20
|
+
let {
|
|
21
|
+
theme
|
|
22
|
+
} = _ref;
|
|
23
|
+
return theme.text;
|
|
24
|
+
}};
|
|
25
|
+
cursor: ${_ref2 => {
|
|
26
|
+
let {
|
|
27
|
+
isDisabled
|
|
28
|
+
} = _ref2;
|
|
29
|
+
return isDisabled ? 'default' : 'pointer';
|
|
30
|
+
}};
|
|
31
|
+
opacity: ${_ref3 => {
|
|
32
|
+
let {
|
|
33
|
+
isDisabled
|
|
34
|
+
} = _ref3;
|
|
35
|
+
return isDisabled ? 0.5 : 1;
|
|
36
|
+
}};
|
|
37
|
+
padding-left: ${_ref4 => {
|
|
38
|
+
let {
|
|
39
|
+
shouldShowAsSwitch
|
|
40
|
+
} = _ref4;
|
|
41
|
+
return shouldShowAsSwitch ? '48px' : '20px';
|
|
42
|
+
}};
|
|
43
|
+
transition: opacity 0.2s ease;
|
|
44
|
+
user-select: none;
|
|
45
|
+
|
|
46
|
+
&:after {
|
|
47
|
+
${_ref5 => {
|
|
48
|
+
let {
|
|
49
|
+
isChecked,
|
|
50
|
+
shouldShowAsSwitch
|
|
51
|
+
} = _ref5;
|
|
52
|
+
return shouldShowAsSwitch ? (0, _styledComponents.css)`
|
|
53
|
+
background-color: white;
|
|
54
|
+
border-radius: 50%;
|
|
55
|
+
box-shadow: 0 1px 4px rgb(0 0 0 / 35%);
|
|
56
|
+
height: 16px;
|
|
57
|
+
left: 7px;
|
|
58
|
+
top: 3.5px;
|
|
59
|
+
transform: translateX(${isChecked ? '18px' : 0});
|
|
60
|
+
transition: transform 0.2s ease;
|
|
61
|
+
width: 16px;
|
|
62
|
+
` : (0, _styledComponents.css)`
|
|
63
|
+
border-right: 2px solid #fff;
|
|
64
|
+
border-bottom: 2px solid #fff;
|
|
65
|
+
height: 10px;
|
|
66
|
+
left: 1px;
|
|
67
|
+
opacity: ${isChecked ? 1 : 0};
|
|
68
|
+
top: 7px;
|
|
69
|
+
transform: rotateZ(37deg);
|
|
70
|
+
transition: opacity 0.2s ease;
|
|
71
|
+
width: 5.5px;
|
|
72
|
+
`;
|
|
73
|
+
}}
|
|
74
|
+
|
|
75
|
+
content: ' ';
|
|
76
|
+
position: absolute;
|
|
77
|
+
transform-origin: 100% 100%;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&:before {
|
|
81
|
+
background-color: ${_ref6 => {
|
|
82
|
+
let {
|
|
83
|
+
isChecked,
|
|
84
|
+
shouldShowAsSwitch,
|
|
85
|
+
theme
|
|
86
|
+
} = _ref6;
|
|
87
|
+
if (shouldShowAsSwitch) {
|
|
88
|
+
return isChecked ? theme.green : theme.red;
|
|
89
|
+
}
|
|
90
|
+
return isChecked ? theme['408'] : theme['403'];
|
|
91
|
+
}};
|
|
92
|
+
border: 1px solid rgba(${_ref7 => {
|
|
93
|
+
let {
|
|
94
|
+
theme
|
|
95
|
+
} = _ref7;
|
|
96
|
+
return theme['409-rgb'];
|
|
97
|
+
}}, 0.5);
|
|
98
|
+
border-radius: ${_ref8 => {
|
|
99
|
+
let {
|
|
100
|
+
shouldShowAsSwitch
|
|
101
|
+
} = _ref8;
|
|
102
|
+
return shouldShowAsSwitch ? '100px' : 0;
|
|
103
|
+
}};
|
|
104
|
+
content: ' ';
|
|
105
|
+
height: ${_ref9 => {
|
|
106
|
+
let {
|
|
107
|
+
shouldShowAsSwitch
|
|
108
|
+
} = _ref9;
|
|
109
|
+
return shouldShowAsSwitch ? '13px' : '15px';
|
|
110
|
+
}};
|
|
111
|
+
left: ${_ref10 => {
|
|
112
|
+
let {
|
|
113
|
+
shouldShowAsSwitch
|
|
114
|
+
} = _ref10;
|
|
115
|
+
return shouldShowAsSwitch ? '10px' : 0;
|
|
116
|
+
}};
|
|
117
|
+
position: absolute;
|
|
118
|
+
top: 5px;
|
|
119
|
+
transition: background-color 0.2s ease;
|
|
120
|
+
width: ${_ref11 => {
|
|
121
|
+
let {
|
|
122
|
+
shouldShowAsSwitch
|
|
123
|
+
} = _ref11;
|
|
124
|
+
return shouldShowAsSwitch ? '28px' : '15px';
|
|
125
|
+
}};
|
|
126
|
+
}
|
|
127
|
+
`;
|
|
128
|
+
//# sourceMappingURL=Checkbox.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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","css","_ref6","green","red","_ref7","_ref8","_ref9","_ref10","_ref11"],"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<Omit<CheckboxProps, 'children' | 'onChange'>>;\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 }) =>\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: 3.5px;\n transform: translateX(${isChecked ? '18px' : 0});\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: 1px;\n opacity: ${isChecked ? 1 : 0};\n top: 7px;\n transform: rotateZ(37deg);\n transition: opacity 0.2s ease;\n width: 5.5px;\n `}\n\n content: ' ';\n position: absolute;\n transform-origin: 100% 100%;\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 top: 5px;\n transition: background-color 0.2s ease;\n width: ${({ shouldShowAsSwitch }) => (shouldShowAsSwitch ? '28px' : '15px')};\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,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,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CAAC;AAC3F,yBAAyBc,KAAA;EAAA,IAAC;IAAER;EAAmB,CAAC,GAAAQ,KAAA;EAAA,OAAMR,kBAAkB,GAAG,OAAO,GAAG,CAAC;AAAA,CAAE;AACxF;AACA,kBAAkBS,KAAA;EAAA,IAAC;IAAET;EAAmB,CAAC,GAAAS,KAAA;EAAA,OAAMT,kBAAkB,GAAG,MAAM,GAAG,MAAM;AAAA,CAAE;AACrF,gBAAgBU,MAAA;EAAA,IAAC;IAAEV;EAAmB,CAAC,GAAAU,MAAA;EAAA,OAAMV,kBAAkB,GAAG,MAAM,GAAG,CAAC;AAAA,CAAE;AAC9E;AACA;AACA;AACA,iBAAiBW,MAAA;EAAA,IAAC;IAAEX;EAAmB,CAAC,GAAAW,MAAA;EAAA,OAAMX,kBAAkB,GAAG,MAAM,GAAG,MAAM;AAAA,CAAE;AACpF;AACA,CAAC"}
|
|
@@ -4,7 +4,7 @@ declare enum ColorMode {
|
|
|
4
4
|
Dark = 1,
|
|
5
5
|
Light = 2
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
type ColorSchemeProviderProps = {
|
|
8
8
|
/**
|
|
9
9
|
* The content of the application or the components for which the styles should be set
|
|
10
10
|
*/
|
|
@@ -34,5 +34,11 @@ declare type ColorSchemeProviderProps = {
|
|
|
34
34
|
[key: string]: string | number;
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
+
export interface Theme {
|
|
38
|
+
[key: string]: string;
|
|
39
|
+
}
|
|
40
|
+
export type WithTheme<T> = T & {
|
|
41
|
+
theme: Theme;
|
|
42
|
+
};
|
|
37
43
|
declare const ColorSchemeProvider: FC<ColorSchemeProviderProps>;
|
|
38
44
|
export default ColorSchemeProvider;
|