@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
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _framerMotion = require("framer-motion");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _styledComponents = require("styled-components");
|
|
10
|
+
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
11
|
+
var _Input = _interopRequireDefault(require("../input/Input"));
|
|
12
|
+
var _SearchInput = require("./SearchInput.styles");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
const SearchInput = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
iconColor,
|
|
19
|
+
onActiveChange,
|
|
20
|
+
onChange,
|
|
21
|
+
placeholder,
|
|
22
|
+
value
|
|
23
|
+
} = _ref;
|
|
24
|
+
const [isActive, setIsActive] = (0, _react.useState)(typeof value === 'string' && value.trim() !== '');
|
|
25
|
+
const inputRef = (0, _react.useRef)(null);
|
|
26
|
+
const theme = (0, _styledComponents.useTheme)();
|
|
27
|
+
const handleBackIconClick = (0, _react.useCallback)(() => setIsActive(false), []);
|
|
28
|
+
const handleSearchIconClick = (0, _react.useCallback)(() => setIsActive(true), []);
|
|
29
|
+
(0, _react.useEffect)(() => {
|
|
30
|
+
if (typeof onActiveChange === 'function') {
|
|
31
|
+
onActiveChange(isActive);
|
|
32
|
+
}
|
|
33
|
+
if (isActive) {
|
|
34
|
+
var _inputRef$current;
|
|
35
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
36
|
+
}
|
|
37
|
+
}, [isActive, onActiveChange]);
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_SearchInput.StyledSearchInput, {
|
|
39
|
+
className: "beta-chayns-search-input"
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_SearchInput.StyledMotionSearchInputIconWrapper, null, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
|
|
41
|
+
initial: false
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_SearchInput.StyledMotionSearchInputIconWrapperContent, {
|
|
43
|
+
animate: {
|
|
44
|
+
opacity: 1
|
|
45
|
+
},
|
|
46
|
+
exit: {
|
|
47
|
+
opacity: 0,
|
|
48
|
+
position: 'absolute'
|
|
49
|
+
},
|
|
50
|
+
initial: {
|
|
51
|
+
opacity: 0
|
|
52
|
+
},
|
|
53
|
+
key: isActive ? 'backIcon' : 'searchIcon',
|
|
54
|
+
transition: {
|
|
55
|
+
duration: 0.3
|
|
56
|
+
}
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
58
|
+
color: iconColor,
|
|
59
|
+
icons: isActive ? ['fa fa-arrow-left'] : ['fa fa-search'],
|
|
60
|
+
onClick: isActive ? handleBackIconClick : handleSearchIconClick,
|
|
61
|
+
size: 18
|
|
62
|
+
})))), /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
|
|
63
|
+
initial: false
|
|
64
|
+
}, isActive && /*#__PURE__*/_react.default.createElement(_SearchInput.StyledMotionSearchInputContentWrapper, {
|
|
65
|
+
animate: {
|
|
66
|
+
opacity: 1,
|
|
67
|
+
width: '100%'
|
|
68
|
+
},
|
|
69
|
+
exit: {
|
|
70
|
+
opacity: 0,
|
|
71
|
+
width: 0
|
|
72
|
+
},
|
|
73
|
+
initial: {
|
|
74
|
+
opacity: 0,
|
|
75
|
+
width: 0
|
|
76
|
+
},
|
|
77
|
+
key: "searchInputContentWrapper",
|
|
78
|
+
transition: {
|
|
79
|
+
duration: 0.3
|
|
80
|
+
}
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
82
|
+
iconElement: /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
83
|
+
color: theme.text,
|
|
84
|
+
icons: ['far fa-search']
|
|
85
|
+
}),
|
|
86
|
+
onChange: onChange,
|
|
87
|
+
placeholder: placeholder,
|
|
88
|
+
ref: inputRef,
|
|
89
|
+
shouldShowClearIcon: true,
|
|
90
|
+
value: value
|
|
91
|
+
}))));
|
|
92
|
+
};
|
|
93
|
+
SearchInput.displayName = 'SearchInput';
|
|
94
|
+
var _default = exports.default = SearchInput;
|
|
95
|
+
//# sourceMappingURL=SearchInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_styledComponents","_Icon","_interopRequireDefault","_Input","_SearchInput","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","SearchInput","_ref","iconColor","onActiveChange","onChange","placeholder","value","isActive","setIsActive","useState","trim","inputRef","useRef","theme","useTheme","handleBackIconClick","useCallback","handleSearchIconClick","useEffect","_inputRef$current","current","focus","createElement","StyledSearchInput","className","StyledMotionSearchInputIconWrapper","AnimatePresence","initial","StyledMotionSearchInputIconWrapperContent","animate","opacity","exit","position","key","transition","duration","color","icons","onClick","size","StyledMotionSearchInputContentWrapper","width","iconElement","text","ref","shouldShowClearIcon","displayName","_default","exports"],"sources":["../../../src/components/search-input/SearchInput.tsx"],"sourcesContent":["import { AnimatePresence } from 'framer-motion';\nimport React, {\n ChangeEventHandler,\n CSSProperties,\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Icon from '../icon/Icon';\nimport Input, { InputRef } from '../input/Input';\nimport {\n StyledMotionSearchInputContentWrapper,\n StyledMotionSearchInputIconWrapper,\n StyledMotionSearchInputIconWrapperContent,\n StyledSearchInput,\n} from './SearchInput.styles';\n\nexport type SearchInputProps = {\n /**\n * Color of the icon\n */\n iconColor?: CSSProperties['color'];\n /**\n * Function that is executed when the active state of the input changes\n */\n onActiveChange?: (isActive: boolean) => void;\n /**\n * Function that is executed when the text of the input changes\n */\n onChange: ChangeEventHandler<HTMLInputElement>;\n /**\n * Placeholder for the input field\n */\n placeholder?: string;\n /**\n * Value if the input field should be controlled\n */\n value?: string;\n};\n\nconst SearchInput: FC<SearchInputProps> = ({\n iconColor,\n onActiveChange,\n onChange,\n placeholder,\n value,\n}) => {\n const [isActive, setIsActive] = useState(typeof value === 'string' && value.trim() !== '');\n\n const inputRef = useRef<InputRef>(null);\n\n const theme = useTheme() as Theme;\n\n const handleBackIconClick = useCallback(() => setIsActive(false), []);\n\n const handleSearchIconClick = useCallback(() => setIsActive(true), []);\n\n useEffect(() => {\n if (typeof onActiveChange === 'function') {\n onActiveChange(isActive);\n }\n\n if (isActive) {\n inputRef.current?.focus();\n }\n }, [isActive, onActiveChange]);\n\n return (\n <StyledSearchInput className=\"beta-chayns-search-input\">\n <StyledMotionSearchInputIconWrapper>\n <AnimatePresence initial={false}>\n <StyledMotionSearchInputIconWrapperContent\n animate={{ opacity: 1 }}\n exit={{ opacity: 0, position: 'absolute' }}\n initial={{ opacity: 0 }}\n key={isActive ? 'backIcon' : 'searchIcon'}\n transition={{ duration: 0.3 }}\n >\n <Icon\n color={iconColor}\n icons={isActive ? ['fa fa-arrow-left'] : ['fa fa-search']}\n onClick={isActive ? handleBackIconClick : handleSearchIconClick}\n size={18}\n />\n </StyledMotionSearchInputIconWrapperContent>\n </AnimatePresence>\n </StyledMotionSearchInputIconWrapper>\n <AnimatePresence initial={false}>\n {isActive && (\n <StyledMotionSearchInputContentWrapper\n animate={{ opacity: 1, width: '100%' }}\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n key=\"searchInputContentWrapper\"\n transition={{ duration: 0.3 }}\n >\n <Input\n iconElement={<Icon color={theme.text} icons={['far fa-search']} />}\n onChange={onChange}\n placeholder={placeholder}\n ref={inputRef}\n shouldShowClearIcon\n value={value}\n />\n </StyledMotionSearchInputContentWrapper>\n )}\n </AnimatePresence>\n </StyledSearchInput>\n );\n};\n\nSearchInput.displayName = 'SearchInput';\n\nexport default SearchInput;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AASA,IAAAG,iBAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAD,sBAAA,CAAAL,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,MAAA,CAAAS,OAAA,CAAA0C,aAAA,CAAChD,KAAA,CAAAM,OAAI;MAACwD,KAAK,EAAEvB,KAAK,CAAC8B,IAAK;MAACN,KAAK,EAAE,CAAC,eAAe;IAAE,CAAE,CAAE;IACnEjC,QAAQ,EAAEA,QAAS;IACnBC,WAAW,EAAEA,WAAY;IACzBuC,GAAG,EAAEjC,QAAS;IACdkC,mBAAmB;IACnBvC,KAAK,EAAEA;EAAM,CAChB,CACkC,CAE9B,CACF,CAAC;AAE5B,CAAC;AAEDN,WAAW,CAAC8C,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAApE,OAAA,GAEzBoB,WAAW"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const StyledSearchInput: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const StyledMotionSearchInputContentWrapper: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, {}, never>;
|
|
3
|
+
export declare const StyledMotionSearchInputIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const StyledMotionSearchInputIconWrapperContent: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, {}, never>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledSearchInput = exports.StyledMotionSearchInputIconWrapperContent = exports.StyledMotionSearchInputIconWrapper = exports.StyledMotionSearchInputContentWrapper = 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 StyledSearchInput = exports.StyledSearchInput = _styledComponents.default.div`
|
|
11
|
+
align-items: center;
|
|
12
|
+
display: flex;
|
|
13
|
+
gap: 8px;
|
|
14
|
+
height: 42px;
|
|
15
|
+
justify-content: flex-end;
|
|
16
|
+
width: 100%;
|
|
17
|
+
`;
|
|
18
|
+
const StyledMotionSearchInputContentWrapper = exports.StyledMotionSearchInputContentWrapper = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
`;
|
|
21
|
+
const StyledMotionSearchInputIconWrapper = exports.StyledMotionSearchInputIconWrapper = _styledComponents.default.div`
|
|
22
|
+
height: 18px;
|
|
23
|
+
width: 18px;
|
|
24
|
+
`;
|
|
25
|
+
const StyledMotionSearchInputIconWrapperContent = exports.StyledMotionSearchInputIconWrapperContent = (0, _styledComponents.default)(_framerMotion.motion.div)``;
|
|
26
|
+
//# sourceMappingURL=SearchInput.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","obj","__esModule","default","StyledSearchInput","exports","styled","div","StyledMotionSearchInputContentWrapper","motion","StyledMotionSearchInputIconWrapper","StyledMotionSearchInputIconWrapperContent"],"sources":["../../../src/components/search-input/SearchInput.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled from 'styled-components';\n\nexport const StyledSearchInput = styled.div`\n align-items: center;\n display: flex;\n gap: 8px;\n height: 42px;\n justify-content: flex-end;\n width: 100%;\n`;\n\nexport const StyledMotionSearchInputContentWrapper = styled(motion.div)`\n overflow: hidden;\n`;\n\nexport const StyledMotionSearchInputIconWrapper = styled.div`\n height: 18px;\n width: 18px;\n`;\n\nexport const StyledMotionSearchInputIconWrapperContent = styled(motion.div)``;\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;AAEhC,MAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGE,yBAAM,CAACC,GAAI;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,qCAAqC,GAAAH,OAAA,CAAAG,qCAAA,GAAG,IAAAF,yBAAM,EAACG,oBAAM,CAACF,GAAG,CAAE;AACxE;AACA,CAAC;AAEM,MAAMG,kCAAkC,GAAAL,OAAA,CAAAK,kCAAA,GAAGJ,yBAAM,CAACC,GAAI;AAC7D;AACA;AACA,CAAC;AAEM,MAAMI,yCAAyC,GAAAN,OAAA,CAAAM,yCAAA,GAAG,IAAAL,yBAAM,EAACG,oBAAM,CAACF,GAAG,CAAE,EAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import type { ContextMenuAlignment } from '../context-menu/constants/alignment';
|
|
3
|
+
export type SharingBarProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The label that should be displayed.
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* The link that should be shared.
|
|
10
|
+
*/
|
|
11
|
+
link: string;
|
|
12
|
+
/**
|
|
13
|
+
* The alignment of the sharing options.
|
|
14
|
+
*/
|
|
15
|
+
popupAlignment: ContextMenuAlignment;
|
|
16
|
+
};
|
|
17
|
+
declare const SharingBar: FC<SharingBarProps>;
|
|
18
|
+
export default SharingBar;
|
|
@@ -0,0 +1,113 @@
|
|
|
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 _ContextMenu = _interopRequireDefault(require("../context-menu/ContextMenu"));
|
|
9
|
+
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
10
|
+
var _SharingBar = require("./SharingBar.styles");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
const SharingBar = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
label,
|
|
17
|
+
link,
|
|
18
|
+
popupAlignment
|
|
19
|
+
} = _ref;
|
|
20
|
+
const contextMenuRef = (0, _react.useRef)(null);
|
|
21
|
+
const handleImageDownload = async () => {
|
|
22
|
+
var _contextMenuRef$curre;
|
|
23
|
+
const image = await fetch(`https://cube.tobit.cloud/qr-code-generator/v1.0/png?value=${link}&color=005EB8&text=Teilen`);
|
|
24
|
+
const imageBlog = await image.blob();
|
|
25
|
+
const imageURL = URL.createObjectURL(imageBlog);
|
|
26
|
+
const url = document.createElement('a');
|
|
27
|
+
|
|
28
|
+
// Removes illegal characters from the name and shortens it to a maximum of 50 characters
|
|
29
|
+
const fileName = `CallingCode_Share`.replace(/[^\w-]+/g, '_').trim().slice(0, 75);
|
|
30
|
+
url.href = imageURL;
|
|
31
|
+
url.download = fileName;
|
|
32
|
+
document.body.appendChild(url);
|
|
33
|
+
url.click();
|
|
34
|
+
document.body.removeChild(url);
|
|
35
|
+
(_contextMenuRef$curre = contextMenuRef.current) === null || _contextMenuRef$curre === void 0 || _contextMenuRef$curre.hide();
|
|
36
|
+
};
|
|
37
|
+
const handleShare = key => {
|
|
38
|
+
var _contextMenuRef$curre2;
|
|
39
|
+
(_contextMenuRef$curre2 = contextMenuRef.current) === null || _contextMenuRef$curre2 === void 0 || _contextMenuRef$curre2.hide();
|
|
40
|
+
const encodedUrl = encodeURIComponent(link);
|
|
41
|
+
let preparedLink;
|
|
42
|
+
switch (key) {
|
|
43
|
+
case 'whatsapp':
|
|
44
|
+
preparedLink = `https://wa.me/?text=${encodedUrl}`;
|
|
45
|
+
break;
|
|
46
|
+
case 'facebook':
|
|
47
|
+
preparedLink = `https://www.facebook.com/sharer.php?u=${encodedUrl}`;
|
|
48
|
+
break;
|
|
49
|
+
case 'twitter':
|
|
50
|
+
preparedLink = `https://twitter.com/intent/tweet?url=${encodedUrl}`;
|
|
51
|
+
break;
|
|
52
|
+
case 'mail':
|
|
53
|
+
preparedLink = `mailto:?subject=&body= ${encodedUrl}`;
|
|
54
|
+
break;
|
|
55
|
+
case 'copy':
|
|
56
|
+
void navigator.clipboard.writeText(link);
|
|
57
|
+
break;
|
|
58
|
+
default:
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
if (!preparedLink) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
window.open(preparedLink);
|
|
65
|
+
};
|
|
66
|
+
const contextMenuItems = [{
|
|
67
|
+
icons: ['fa fa-copy'],
|
|
68
|
+
key: 'copy',
|
|
69
|
+
onClick: () => handleShare('copy'),
|
|
70
|
+
text: 'Zwischenablage'
|
|
71
|
+
}, {
|
|
72
|
+
icons: ['fa-brands fa-whatsapp'],
|
|
73
|
+
key: 'whatsapp',
|
|
74
|
+
onClick: () => handleShare('whatsapp'),
|
|
75
|
+
text: 'Whatsapp'
|
|
76
|
+
}, {
|
|
77
|
+
icons: ['fa-brands fa-facebook-f'],
|
|
78
|
+
key: 'facebook',
|
|
79
|
+
onClick: () => handleShare('facebook'),
|
|
80
|
+
text: 'Facebook'
|
|
81
|
+
}, {
|
|
82
|
+
icons: ['fa-brands fa-twitter'],
|
|
83
|
+
key: 'twitter',
|
|
84
|
+
onClick: () => handleShare('twitter'),
|
|
85
|
+
text: 'Twitter'
|
|
86
|
+
}, {
|
|
87
|
+
icons: ['fa fa-envelope'],
|
|
88
|
+
key: 'mail',
|
|
89
|
+
onClick: () => handleShare('mail'),
|
|
90
|
+
text: 'Mail'
|
|
91
|
+
}, {
|
|
92
|
+
icons: ['fa fa-qrcode'],
|
|
93
|
+
key: 'callingCode',
|
|
94
|
+
onClick: handleImageDownload,
|
|
95
|
+
text: 'Calling Code herunterladen'
|
|
96
|
+
}];
|
|
97
|
+
const handleSharingBarClick = () => {
|
|
98
|
+
var _contextMenuRef$curre3;
|
|
99
|
+
(_contextMenuRef$curre3 = contextMenuRef.current) === null || _contextMenuRef$curre3 === void 0 || _contextMenuRef$curre3.show();
|
|
100
|
+
};
|
|
101
|
+
return /*#__PURE__*/_react.default.createElement(_SharingBar.StyledSharingBar, {
|
|
102
|
+
onClick: handleSharingBarClick
|
|
103
|
+
}, /*#__PURE__*/_react.default.createElement(_SharingBar.StyledSharingBarIconWrapper, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
104
|
+
icons: ['fa fa-share-nodes']
|
|
105
|
+
})), /*#__PURE__*/_react.default.createElement(_ContextMenu.default, {
|
|
106
|
+
items: contextMenuItems,
|
|
107
|
+
ref: contextMenuRef,
|
|
108
|
+
alignment: popupAlignment
|
|
109
|
+
}, null), /*#__PURE__*/_react.default.createElement(_SharingBar.StyledSharingBarText, null, label));
|
|
110
|
+
};
|
|
111
|
+
SharingBar.displayName = 'SharingBar';
|
|
112
|
+
var _default = exports.default = SharingBar;
|
|
113
|
+
//# sourceMappingURL=SharingBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharingBar.js","names":["_react","_interopRequireWildcard","require","_ContextMenu","_interopRequireDefault","_Icon","_SharingBar","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","SharingBar","_ref","label","link","popupAlignment","contextMenuRef","useRef","handleImageDownload","_contextMenuRef$curre","image","fetch","imageBlog","blob","imageURL","URL","createObjectURL","url","document","createElement","fileName","replace","trim","slice","href","download","body","appendChild","click","removeChild","current","hide","handleShare","key","_contextMenuRef$curre2","encodedUrl","encodeURIComponent","preparedLink","navigator","clipboard","writeText","window","open","contextMenuItems","icons","onClick","text","handleSharingBarClick","_contextMenuRef$curre3","show","StyledSharingBar","StyledSharingBarIconWrapper","items","ref","alignment","StyledSharingBarText","displayName","_default","exports"],"sources":["../../../src/components/sharing-bar/SharingBar.tsx"],"sourcesContent":["import React, { FC, useRef } from 'react';\nimport type { ContextMenuAlignment } from '../context-menu/constants/alignment';\nimport ContextMenu from '../context-menu/ContextMenu';\nimport Icon from '../icon/Icon';\nimport {\n StyledSharingBar,\n StyledSharingBarIconWrapper,\n StyledSharingBarText,\n} from './SharingBar.styles';\n\nexport type SharingBarProps = {\n /**\n * The label that should be displayed.\n */\n label: string;\n /**\n * The link that should be shared.\n */\n link: string;\n /**\n * The alignment of the sharing options.\n */\n popupAlignment: ContextMenuAlignment;\n};\n\nconst SharingBar: FC<SharingBarProps> = ({ label, link, popupAlignment }) => {\n const contextMenuRef = useRef<{ hide: VoidFunction; show: VoidFunction }>(null);\n\n const handleImageDownload = async () => {\n const image = await fetch(\n `https://cube.tobit.cloud/qr-code-generator/v1.0/png?value=${link}&color=005EB8&text=Teilen`\n );\n const imageBlog = await image.blob();\n const imageURL = URL.createObjectURL(imageBlog);\n\n const url = document.createElement('a');\n\n // Removes illegal characters from the name and shortens it to a maximum of 50 characters\n const fileName = `CallingCode_Share`\n .replace(/[^\\w-]+/g, '_')\n .trim()\n .slice(0, 75);\n\n url.href = imageURL;\n url.download = fileName;\n\n document.body.appendChild(url);\n\n url.click();\n\n document.body.removeChild(url);\n\n contextMenuRef.current?.hide();\n };\n\n const handleShare = (key: string) => {\n contextMenuRef.current?.hide();\n\n const encodedUrl = encodeURIComponent(link);\n let preparedLink;\n\n switch (key) {\n case 'whatsapp':\n preparedLink = `https://wa.me/?text=${encodedUrl}`;\n break;\n case 'facebook':\n preparedLink = `https://www.facebook.com/sharer.php?u=${encodedUrl}`;\n break;\n case 'twitter':\n preparedLink = `https://twitter.com/intent/tweet?url=${encodedUrl}`;\n break;\n case 'mail':\n preparedLink = `mailto:?subject=&body= ${encodedUrl}`;\n break;\n case 'copy':\n void navigator.clipboard.writeText(link);\n break;\n default:\n break;\n }\n\n if (!preparedLink) {\n return;\n }\n\n window.open(preparedLink);\n };\n\n const contextMenuItems = [\n {\n icons: ['fa fa-copy'],\n key: 'copy',\n onClick: () => handleShare('copy'),\n text: 'Zwischenablage',\n },\n {\n icons: ['fa-brands fa-whatsapp'],\n key: 'whatsapp',\n onClick: () => handleShare('whatsapp'),\n text: 'Whatsapp',\n },\n {\n icons: ['fa-brands fa-facebook-f'],\n key: 'facebook',\n onClick: () => handleShare('facebook'),\n text: 'Facebook',\n },\n {\n icons: ['fa-brands fa-twitter'],\n key: 'twitter',\n onClick: () => handleShare('twitter'),\n text: 'Twitter',\n },\n {\n icons: ['fa fa-envelope'],\n key: 'mail',\n onClick: () => handleShare('mail'),\n text: 'Mail',\n },\n {\n icons: ['fa fa-qrcode'],\n key: 'callingCode',\n onClick: handleImageDownload,\n text: 'Calling Code herunterladen',\n },\n ];\n\n const handleSharingBarClick = () => {\n contextMenuRef.current?.show();\n };\n\n return (\n <StyledSharingBar onClick={handleSharingBarClick}>\n <StyledSharingBarIconWrapper>\n <Icon icons={['fa fa-share-nodes']} />\n </StyledSharingBarIconWrapper>\n <ContextMenu items={contextMenuItems} ref={contextMenuRef} alignment={popupAlignment}>\n {null}\n </ContextMenu>\n <StyledSharingBarText>{label}</StyledSharingBarText>\n </StyledShar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AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7E,OAAA,GAEvBoB,UAAU"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const StyledSharingBar: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const StyledSharingBarIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const StyledSharingBarText: import("styled-components").StyledComponent<"p", any, {
|
|
4
|
+
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
5
|
+
}, never>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledSharingBarText = exports.StyledSharingBarIconWrapper = exports.StyledSharingBar = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const StyledSharingBar = exports.StyledSharingBar = _styledComponents.default.div`
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
`;
|
|
14
|
+
const StyledSharingBarIconWrapper = exports.StyledSharingBarIconWrapper = _styledComponents.default.div``;
|
|
15
|
+
const StyledSharingBarText = exports.StyledSharingBarText = _styledComponents.default.p`
|
|
16
|
+
color: ${_ref => {
|
|
17
|
+
let {
|
|
18
|
+
theme
|
|
19
|
+
} = _ref;
|
|
20
|
+
return theme.text;
|
|
21
|
+
}};
|
|
22
|
+
margin: 0 0 0 5px;
|
|
23
|
+
`;
|
|
24
|
+
//# sourceMappingURL=SharingBar.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharingBar.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledSharingBar","exports","styled","div","StyledSharingBarIconWrapper","StyledSharingBarText","p","_ref","theme","text"],"sources":["../../../src/components/sharing-bar/SharingBar.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledSharingBar = styled.div`\n cursor: pointer;\n display: flex;\n align-items: center;\n`;\n\nexport const StyledSharingBarIconWrapper = styled.div``;\n\ntype StyledSharingBarTextProps = WithTheme<unknown>;\n\nexport const StyledSharingBarText = styled.p<StyledSharingBarTextProps>`\n color: ${({ theme }: StyledSharingBarTextProps) => theme.text};\n margin: 0 0 0 5px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGhC,MAAMG,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,yBAAM,CAACC,GAAI;AAC3C;AACA;AACA;AACA,CAAC;AAEM,MAAMC,2BAA2B,GAAAH,OAAA,CAAAG,2BAAA,GAAGF,yBAAM,CAACC,GAAI,EAAC;AAIhD,MAAME,oBAAoB,GAAAJ,OAAA,CAAAI,oBAAA,GAAGH,yBAAM,CAACI,CAA6B;AACxE,aAAaC,IAAA;EAAA,IAAC;IAAEC;EAAiC,CAAC,GAAAD,IAAA;EAAA,OAAKC,KAAK,CAACC,IAAI;AAAA,CAAC;AAClE;AACA,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export type SliderProps = {
|
|
3
|
+
/**
|
|
4
|
+
* The maximum value of the slider.
|
|
5
|
+
*/
|
|
6
|
+
maxValue: number;
|
|
7
|
+
/**
|
|
8
|
+
* The minimum value of the slider.
|
|
9
|
+
*/
|
|
10
|
+
minValue: number;
|
|
11
|
+
/**
|
|
12
|
+
* Function that will be executed when the value is changed.
|
|
13
|
+
*/
|
|
14
|
+
onChange?: (value: number) => void;
|
|
15
|
+
/**
|
|
16
|
+
* the Value that the slider should have.
|
|
17
|
+
*/
|
|
18
|
+
value?: number;
|
|
19
|
+
};
|
|
20
|
+
declare const Slider: FC<SliderProps>;
|
|
21
|
+
export default Slider;
|
|
@@ -0,0 +1,51 @@
|
|
|
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 _Slider = require("./Slider.styles");
|
|
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 Slider = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
maxValue,
|
|
14
|
+
minValue,
|
|
15
|
+
value,
|
|
16
|
+
onChange
|
|
17
|
+
} = _ref;
|
|
18
|
+
const [editedValue, setEditedValue] = (0, _react.useState)(0);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* This function sets the value
|
|
22
|
+
*/
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
24
|
+
if (typeof value !== 'number') {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (value >= minValue && value <= maxValue) {
|
|
28
|
+
setEditedValue(value);
|
|
29
|
+
}
|
|
30
|
+
}, [maxValue, minValue, value]);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* This function updates the value
|
|
34
|
+
*/
|
|
35
|
+
const handleInputChange = (0, _react.useCallback)(event => {
|
|
36
|
+
setEditedValue(Number(event.target.value));
|
|
37
|
+
if (onChange) {
|
|
38
|
+
onChange(Number(event.target.value));
|
|
39
|
+
}
|
|
40
|
+
}, [onChange]);
|
|
41
|
+
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_Slider.StyledSlider, null, /*#__PURE__*/_react.default.createElement(_Slider.StyledSliderInput, {
|
|
42
|
+
type: "range",
|
|
43
|
+
value: editedValue,
|
|
44
|
+
max: maxValue,
|
|
45
|
+
min: minValue,
|
|
46
|
+
onChange: handleInputChange
|
|
47
|
+
})), [editedValue, handleInputChange, maxValue, minValue]);
|
|
48
|
+
};
|
|
49
|
+
Slider.displayName = 'Slider';
|
|
50
|
+
var _default = exports.default = Slider;
|
|
51
|
+
//# sourceMappingURL=Slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.js","names":["_react","_interopRequireWildcard","require","_Slider","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","Slider","_ref","maxValue","minValue","value","onChange","editedValue","setEditedValue","useState","useEffect","handleInputChange","useCallback","event","Number","target","useMemo","createElement","StyledSlider","StyledSliderInput","type","max","min","displayName","_default","exports"],"sources":["../../../src/components/slider/Slider.tsx"],"sourcesContent":["import React, { ChangeEvent, FC, useCallback, useEffect, useMemo, useState } from 'react';\nimport { StyledSlider, StyledSliderInput } from './Slider.styles';\n\nexport type SliderProps = {\n /**\n * The maximum value of the slider.\n */\n maxValue: number;\n /**\n * The minimum value of the slider.\n */\n minValue: number;\n /**\n * Function that will be executed when the value is changed.\n */\n onChange?: (value: number) => void;\n /**\n * the Value that the slider should have.\n */\n value?: number;\n};\n\nconst Slider: FC<SliderProps> = ({ maxValue, minValue, value, onChange }) => {\n const [editedValue, setEditedValue] = useState(0);\n\n /**\n * This function sets the value\n */\n useEffect(() => {\n if (typeof value !== 'number') {\n return;\n }\n\n if (value >= minValue && value <= maxValue) {\n setEditedValue(value);\n }\n }, [maxValue, minValue, value]);\n\n /**\n * This function updates the value\n */\n const handleInputChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setEditedValue(Number(event.target.value));\n\n if (onChange) {\n onChange(Number(event.target.value));\n }\n },\n [onChange]\n );\n\n return useMemo(\n () => (\n <StyledSlider>\n <StyledSliderInput\n type=\"range\"\n value={editedValue}\n max={maxValue}\n min={minValue}\n onChange={handleInputChange}\n />\n </StyledSlider>\n ),\n [editedValue, handleInputChange, maxValue, minValue]\n );\n};\n\nSlider.displayName = 'Slider';\n\nexport default Slider;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAAkE,SAAAE,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,SAAAJ,wBAAAI,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,CAAA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KAAK,CAACE,MAAM,CAACV,KAAK,CAAC,CAAC;IACxC;EACJ,CAAC,EACD,CAACC,QAAQ,CACb,CAAC;EAED,OAAO,IAAAU,cAAO,EACV,mBACIxC,MAAA,CAAAU,OAAA,CAAA+B,aAAA,CAACtC,OAAA,CAAAuC,YAAY,qBACT1C,MAAA,CAAAU,OAAA,CAAA+B,aAAA,CAACtC,OAAA,CAAAwC,iBAAiB;IACdC,IAAI,EAAC,OAAO;IACZf,KAAK,EAAEE,WAAY;IACnBc,GAAG,EAAElB,QAAS;IACdmB,GAAG,EAAElB,QAAS;IACdE,QAAQ,EAAEK;EAAkB,CAC/B,CACS,CACjB,EACD,CAACJ,WAAW,EAAEI,iBAAiB,EAAER,QAAQ,EAAEC,QAAQ,CACvD,CAAC;AACL,CAAC;AAEDH,MAAM,CAACsB,WAAW,GAAG,QAAQ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvC,OAAA,GAEfe,MAAM"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const StyledSlider: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const StyledSliderInput: import("styled-components").StyledComponent<"input", any, {
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
value: number;
|
|
6
|
+
} & {
|
|
7
|
+
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
8
|
+
}, never>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledSliderInput = exports.StyledSlider = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const StyledSlider = exports.StyledSlider = _styledComponents.default.div`
|
|
10
|
+
width: 100%;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
`;
|
|
13
|
+
const StyledSliderInput = exports.StyledSliderInput = _styledComponents.default.input`
|
|
14
|
+
width: 100%;
|
|
15
|
+
border-radius: 100px;
|
|
16
|
+
-webkit-appearance: none;
|
|
17
|
+
height: 10px;
|
|
18
|
+
background: ${_ref => {
|
|
19
|
+
var _theme$, _theme$2, _theme$3, _theme$4;
|
|
20
|
+
let {
|
|
21
|
+
theme,
|
|
22
|
+
min,
|
|
23
|
+
max,
|
|
24
|
+
value
|
|
25
|
+
} = _ref;
|
|
26
|
+
return `linear-gradient(
|
|
27
|
+
to right,
|
|
28
|
+
${(_theme$ = theme['409']) !== null && _theme$ !== void 0 ? _theme$ : ''} 0%,
|
|
29
|
+
${(_theme$2 = theme['409']) !== null && _theme$2 !== void 0 ? _theme$2 : ''}
|
|
30
|
+
${(value - min) / (max - min) * 100}%,
|
|
31
|
+
${(_theme$3 = theme['403']) !== null && _theme$3 !== void 0 ? _theme$3 : ''}
|
|
32
|
+
${(value - min) / (max - min) * 100}%,
|
|
33
|
+
${(_theme$4 = theme['403']) !== null && _theme$4 !== void 0 ? _theme$4 : ''}
|
|
34
|
+
)`;
|
|
35
|
+
}};
|
|
36
|
+
|
|
37
|
+
outline: none;
|
|
38
|
+
opacity: 0.7;
|
|
39
|
+
-webkit-transition: 0.2s;
|
|
40
|
+
transition: opacity 0.2s;
|
|
41
|
+
cursor: pointer !important;
|
|
42
|
+
|
|
43
|
+
// Slider thumb for chrome
|
|
44
|
+
&::-webkit-slider-thumb {
|
|
45
|
+
-webkit-appearance: none;
|
|
46
|
+
appearance: none;
|
|
47
|
+
width: 20px;
|
|
48
|
+
height: 20px;
|
|
49
|
+
background-color: ${_ref2 => {
|
|
50
|
+
let {
|
|
51
|
+
theme
|
|
52
|
+
} = _ref2;
|
|
53
|
+
return theme['100'];
|
|
54
|
+
}};
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
border-radius: 50%;
|
|
57
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// slider thumb for firefox
|
|
61
|
+
&::-moz-range-thumb {
|
|
62
|
+
width: 20px;
|
|
63
|
+
height: 20px;
|
|
64
|
+
background-color: ${_ref3 => {
|
|
65
|
+
let {
|
|
66
|
+
theme
|
|
67
|
+
} = _ref3;
|
|
68
|
+
return theme['100'];
|
|
69
|
+
}};
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
border-radius: 50%;
|
|
72
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
//# sourceMappingURL=Slider.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledSlider","exports","styled","div","StyledSliderInput","input","_ref","_theme$","_theme$2","_theme$3","_theme$4","theme","min","max","value","_ref2","_ref3"],"sources":["../../../src/components/slider/Slider.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledSlider = styled.div`\n width: 100%;\n cursor: pointer;\n`;\n\ntype StyledSliderInputProps = WithTheme<{ min: number; max: number; value: number }>;\n\nexport const StyledSliderInput = styled.input<StyledSliderInputProps>`\n width: 100%;\n border-radius: 100px;\n -webkit-appearance: none;\n height: 10px;\n background: ${({ theme, min, max, value }: StyledSliderInputProps) =>\n `linear-gradient(\n to right,\n ${theme['409'] ?? ''} 0%,\n ${theme['409'] ?? ''}\n ${((value - min) / (max - min)) * 100}%,\n ${theme['403'] ?? ''}\n ${((value - min) / (max - min)) * 100}%,\n ${theme['403'] ?? ''}\n )`};\n\n outline: none;\n opacity: 0.7;\n -webkit-transition: 0.2s;\n transition: opacity 0.2s;\n cursor: pointer !important;\n\n // Slider thumb for chrome\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background-color: ${({ theme }: StyledSliderInputProps) => theme['100']};\n cursor: pointer;\n border-radius: 50%;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);\n }\n\n // slider thumb for firefox\n &::-moz-range-thumb {\n width: 20px;\n height: 20px;\n background-color: ${({ theme }: StyledSliderInputProps) => theme['100']};\n cursor: pointer;\n border-radius: 50%;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGhC,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,yBAAM,CAACC,GAAI;AACvC;AACA;AACA,CAAC;AAIM,MAAMC,iBAAiB,GAAAH,OAAA,CAAAG,iBAAA,GAAGF,yBAAM,CAACG,KAA8B;AACtE;AACA;AACA;AACA;AACA,kBAAkBC,IAAA;EAAA,IAAAC,OAAA,EAAAC,QAAA,EAAAC,QAAA,EAAAC,QAAA;EAAA,IAAC;IAAEC,KAAK;IAAEC,GAAG;IAAEC,GAAG;IAAEC;EAA8B,CAAC,GAAAR,IAAA;EAAA,OAC5D;AACT;AACA,cAAY,CAAAC,OAAA,GAAEI,KAAK,CAAC,KAAK,CAAC,cAAAJ,OAAA,cAAAA,OAAA,GAAI,EAAG;AACjC,cAAY,CAAAC,QAAA,GAAEG,KAAK,CAAC,KAAK,CAAC,cAAAH,QAAA,cAAAA,QAAA,GAAI,EAAG;AACjC,cAAe,CAACM,KAAK,GAAGF,GAAG,KAAKC,GAAG,GAAGD,GAAG,CAAC,GAAI,GAAI;AAClD,cAAY,CAAAH,QAAA,GAAEE,KAAK,CAAC,KAAK,CAAC,cAAAF,QAAA,cAAAA,QAAA,GAAI,EAAG;AACjC,cAAe,CAACK,KAAK,GAAGF,GAAG,KAAKC,GAAG,GAAGD,GAAG,CAAC,GAAI,GAAI;AAClD,cAAY,CAAAF,QAAA,GAAEC,KAAK,CAAC,KAAK,CAAC,cAAAD,QAAA,cAAAA,QAAA,GAAI,EAAG;AACjC,UAAU;AAAA,CAAC;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4BK,KAAA;EAAA,IAAC;IAAEJ;EAA8B,CAAC,GAAAI,KAAA;EAAA,OAAKJ,KAAK,CAAC,KAAK,CAAC;AAAA,CAAC;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4BK,KAAA;EAAA,IAAC;IAAEL;EAA8B,CAAC,GAAAK,KAAA;EAAA,OAAKL,KAAK,CAAC,KAAK,CAAC;AAAA,CAAC;AAChF;AACA;AACA;AACA;AACA,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CSSProperties, FC } from 'react';
|
|
2
|
+
export declare enum SmallWaitCursorSize {
|
|
3
|
+
Small = 16,
|
|
4
|
+
Medium = 30
|
|
5
|
+
}
|
|
6
|
+
export declare enum SmallWaitCursorSpeed {
|
|
7
|
+
Slow = 1.5,
|
|
8
|
+
Medium = 1,
|
|
9
|
+
Fast = 0.5
|
|
10
|
+
}
|
|
11
|
+
export type SmallWaitCursorProps = {
|
|
12
|
+
color?: CSSProperties['color'];
|
|
13
|
+
/**
|
|
14
|
+
* Specifies whether the wait cursor should be displayed with a background.
|
|
15
|
+
*/
|
|
16
|
+
shouldHideBackground?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Specifies whether the wait cursor should be displayed.
|
|
19
|
+
*/
|
|
20
|
+
shouldHideWaitCursor?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The size of the wait cursor in pixels. Use the SmallWaitCursorSize enum for this prop.
|
|
23
|
+
*/
|
|
24
|
+
size?: SmallWaitCursorSize;
|
|
25
|
+
/**
|
|
26
|
+
* The speed of the animation in seconds. Use the SmallWaitCursorSpeed enum for this prop.
|
|
27
|
+
*/
|
|
28
|
+
speed?: SmallWaitCursorSpeed;
|
|
29
|
+
};
|
|
30
|
+
declare const SmallWaitCursor: FC<SmallWaitCursorProps>;
|
|
31
|
+
export default SmallWaitCursor;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.SmallWaitCursorSpeed = exports.SmallWaitCursorSize = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _SmallWaitCursor = require("./SmallWaitCursor.styles");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
// noinspection JSUnusedGlobalSymbols
|
|
11
|
+
let SmallWaitCursorSize = exports.SmallWaitCursorSize = /*#__PURE__*/function (SmallWaitCursorSize) {
|
|
12
|
+
SmallWaitCursorSize[SmallWaitCursorSize["Small"] = 16] = "Small";
|
|
13
|
+
SmallWaitCursorSize[SmallWaitCursorSize["Medium"] = 30] = "Medium";
|
|
14
|
+
return SmallWaitCursorSize;
|
|
15
|
+
}({});
|
|
16
|
+
let SmallWaitCursorSpeed = exports.SmallWaitCursorSpeed = /*#__PURE__*/function (SmallWaitCursorSpeed) {
|
|
17
|
+
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Slow"] = 1.5] = "Slow";
|
|
18
|
+
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Medium"] = 1] = "Medium";
|
|
19
|
+
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Fast"] = 0.5] = "Fast";
|
|
20
|
+
return SmallWaitCursorSpeed;
|
|
21
|
+
}({});
|
|
22
|
+
const SmallWaitCursor = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
color,
|
|
25
|
+
shouldHideBackground = false,
|
|
26
|
+
shouldHideWaitCursor = false,
|
|
27
|
+
size = SmallWaitCursorSize.Medium,
|
|
28
|
+
speed = SmallWaitCursorSpeed.Medium
|
|
29
|
+
} = _ref;
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursor, {
|
|
31
|
+
shouldShowWaitCursor: !shouldHideWaitCursor,
|
|
32
|
+
size: size
|
|
33
|
+
}, /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursorWaitCursor, {
|
|
34
|
+
color: color,
|
|
35
|
+
shouldHideBackground: shouldHideBackground,
|
|
36
|
+
size: size,
|
|
37
|
+
speed: speed
|
|
38
|
+
}), !shouldHideBackground && /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursorBackground, null));
|
|
39
|
+
};
|
|
40
|
+
SmallWaitCursor.displayName = 'SmallWaitCursor';
|
|
41
|
+
var _default = exports.default = SmallWaitCursor;
|
|
42
|
+
//# sourceMappingURL=SmallWaitCursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmallWaitCursor.js","names":["_react","_interopRequireDefault","require","_SmallWaitCursor","obj","__esModule","default","SmallWaitCursorSize","exports","SmallWaitCursorSpeed","SmallWaitCursor","_ref","color","shouldHideBackground","shouldHideWaitCursor","size","Medium","speed","createElement","StyledSmallWaitCursor","shouldShowWaitCursor","StyledSmallWaitCursorWaitCursor","StyledSmallWaitCursorBackground","displayName","_default"],"sources":["../../../src/components/small-wait-cursor/SmallWaitCursor.tsx"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nimport React, { CSSProperties, FC } from 'react';\nimport {\n StyledSmallWaitCursor,\n StyledSmallWaitCursorBackground,\n StyledSmallWaitCursorWaitCursor,\n} from './SmallWaitCursor.styles';\n\nexport enum SmallWaitCursorSize {\n Small = 16,\n Medium = 30,\n}\n\nexport enum SmallWaitCursorSpeed {\n Slow = 1.5,\n Medium = 1,\n Fast = 0.5,\n}\n\nexport type SmallWaitCursorProps = {\n color?: CSSProperties['color'];\n /**\n * Specifies whether the wait cursor should be displayed with a background.\n */\n shouldHideBackground?: boolean;\n /**\n * Specifies whether the wait cursor should be displayed.\n */\n shouldHideWaitCursor?: boolean;\n /**\n * The size of the wait cursor in pixels. Use the SmallWaitCursorSize enum for this prop.\n */\n size?: SmallWaitCursorSize;\n /**\n * The speed of the animation in seconds. Use the SmallWaitCursorSpeed enum for this prop.\n */\n speed?: SmallWaitCursorSpeed;\n};\n\nconst SmallWaitCursor: FC<SmallWaitCursorProps> = ({\n color,\n shouldHideBackground = false,\n shouldHideWaitCursor = false,\n size = SmallWaitCursorSize.Medium,\n speed = SmallWaitCursorSpeed.Medium,\n}) => (\n <StyledSmallWaitCursor shouldShowWaitCursor={!shouldHideWaitCursor} size={size}>\n <StyledSmallWaitCursorWaitCursor\n color={color}\n shouldHideBackground={shouldHideBackground}\n size={size}\n speed={speed}\n />\n {!shouldHideBackground && <StyledSmallWaitCursorBackground />}\n </StyledSmallWaitCursor>\n);\n\nSmallWaitCursor.displayName = 'SmallWaitCursor';\n\nexport default SmallWaitCursor;\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAIkC,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAPlC;AAAA,IASYG,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,0BAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAAA,IAKnBE,oBAAoB,GAAAD,OAAA,CAAAC,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AA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