@chayns-components/core 5.0.0-beta.2 → 5.0.0-beta.200
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 +89 -0
- package/lib/components/accordion/Accordion.js +122 -0
- package/lib/components/accordion/Accordion.js.map +1 -0
- package/lib/components/accordion/Accordion.styles.d.ts +7 -0
- package/lib/components/accordion/Accordion.styles.js +81 -0
- package/lib/components/accordion/Accordion.styles.js.map +1 -0
- package/lib/components/accordion/accordion-body/AccordionBody.d.ts +18 -0
- package/lib/components/accordion/accordion-body/AccordionBody.js +45 -0
- package/lib/components/accordion/accordion-body/AccordionBody.js.map +1 -0
- package/lib/components/accordion/accordion-body/AccordionBody.styles.d.ts +4 -0
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js +25 -0
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -0
- package/lib/components/accordion/accordion-content/AccordionContent.d.ts +17 -0
- package/lib/components/accordion/accordion-content/AccordionContent.js +32 -0
- package/lib/components/accordion/accordion-content/AccordionContent.js.map +1 -0
- package/lib/components/accordion/accordion-content/AccordionContent.styles.d.ts +6 -0
- package/lib/components/accordion/accordion-content/AccordionContent.styles.js +35 -0
- package/lib/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -0
- package/lib/components/accordion/accordion-group/AccordionGroup.d.ts +26 -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 +17 -0
- package/lib/components/accordion/accordion-head/AccordionHead.js +129 -0
- package/lib/components/accordion/accordion-head/AccordionHead.js.map +1 -0
- package/lib/components/accordion/accordion-head/AccordionHead.styles.d.ts +19 -0
- package/lib/components/accordion/accordion-head/AccordionHead.styles.js +164 -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 +21 -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 +13 -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 +28 -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 +34 -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 +176 -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 +61 -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 +21 -0
- package/lib/components/badge/Badge.js +28 -0
- package/lib/components/badge/Badge.js.map +1 -0
- package/lib/components/badge/Badge.styles.d.ts +4 -0
- package/lib/components/badge/Badge.styles.js +32 -0
- package/lib/components/badge/Badge.styles.js.map +1 -0
- package/lib/components/button/Button.d.ts +33 -0
- package/lib/components/button/Button.js +43 -0
- package/lib/components/button/Button.js.map +1 -0
- package/lib/components/button/Button.styles.d.ts +7 -0
- package/lib/components/button/Button.styles.js +60 -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 +44 -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 +131 -0
- package/lib/components/checkbox/Checkbox.styles.js.map +1 -0
- package/lib/components/color-scheme-provider/ColorSchemeProvider.d.ts +44 -0
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js +75 -0
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -0
- 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 +128 -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 +30 -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 +30 -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 +19 -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 +23 -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 +157 -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 +13 -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 +17 -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 +78 -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 +117 -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 +109 -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 +288 -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 +34 -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 +89 -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 +15 -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 +48 -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 +109 -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 +19 -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 +46 -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 +105 -0
- package/lib/components/grid-image/GridImage.styles.js.map +1 -0
- package/lib/components/icon/Icon.d.ts +41 -0
- package/lib/components/icon/Icon.js +74 -0
- package/lib/components/icon/Icon.js.map +1 -0
- package/lib/components/icon/Icon.styles.d.ts +15 -0
- package/lib/components/icon/Icon.styles.js +76 -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 +44 -0
- package/lib/components/input/Input.js +85 -0
- package/lib/components/input/Input.js.map +1 -0
- package/lib/components/input/Input.styles.d.ts +7 -0
- package/lib/components/input/Input.styles.js +71 -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 +54 -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 +92 -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 +56 -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 +58 -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 +14 -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 +21 -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 +19 -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 +100 -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 +110 -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 +23 -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 +32 -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 +44 -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 +52 -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 +141 -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 +94 -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 +13 -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 +32 -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 +100 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -0
- package/lib/components/popup/Popup.d.ts +26 -0
- package/lib/components/popup/Popup.js +147 -0
- package/lib/components/popup/Popup.js.map +1 -0
- package/lib/components/popup/Popup.styles.d.ts +2 -0
- package/lib/components/popup/Popup.styles.js +22 -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 +64 -0
- package/lib/components/popup/popup-content/PopupContent.js.map +1 -0
- package/lib/components/popup/popup-content/PopupContent.styles.d.ts +6 -0
- package/lib/components/popup/popup-content/PopupContent.styles.js +90 -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 +17 -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 +39 -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 +39 -0
- package/lib/components/progress-bar/ProgressBar.styles.js.map +1 -0
- package/lib/components/radio-button/RadioButton.d.ts +22 -0
- package/lib/components/radio-button/RadioButton.js +71 -0
- package/lib/components/radio-button/RadioButton.js.map +1 -0
- package/lib/components/radio-button/RadioButton.styles.d.ts +13 -0
- package/lib/components/radio-button/RadioButton.styles.js +105 -0
- package/lib/components/radio-button/RadioButton.styles.js.map +1 -0
- package/lib/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +21 -0
- package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js +54 -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 +23 -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 +27 -0
- package/lib/components/scroll-view/ScrollView.styles.js.map +1 -0
- package/lib/components/search-box/SearchBox.d.ts +26 -0
- package/lib/components/search-box/SearchBox.js +149 -0
- package/lib/components/search-box/SearchBox.js.map +1 -0
- package/lib/components/search-box/SearchBox.styles.d.ts +6 -0
- package/lib/components/search-box/SearchBox.styles.js +51 -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 +30 -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 +30 -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 +18 -0
- package/lib/components/search-input/SearchInput.js +94 -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 +30 -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 +114 -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 +27 -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 +52 -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 +76 -0
- package/lib/components/slider/Slider.styles.js.map +1 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.d.ts +22 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.js +34 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.js.map +1 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.styles.d.ts +13 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js +72 -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 +63 -0
- package/lib/components/text-area/TextArea.js.map +1 -0
- package/lib/components/text-area/TextArea.styles.d.ts +8 -0
- package/lib/components/text-area/TextArea.styles.js +46 -0
- package/lib/components/text-area/TextArea.styles.js.map +1 -0
- package/lib/components/textstring/TextString.d.ts +22 -0
- package/lib/components/textstring/TextString.js +48 -0
- package/lib/components/textstring/TextString.js.map +1 -0
- package/lib/components/textstring/TextString.styles.d.ts +1 -0
- package/lib/components/textstring/TextString.styles.js +11 -0
- package/lib/components/textstring/TextString.styles.js.map +1 -0
- package/lib/components/textstring/types.d.ts +8 -0
- package/lib/components/textstring/types.js +6 -0
- package/lib/components/textstring/types.js.map +1 -0
- package/lib/components/textstring-provider/TextStringProvider.d.ts +17 -0
- package/lib/components/textstring-provider/TextStringProvider.js +39 -0
- package/lib/components/textstring-provider/TextStringProvider.js.map +1 -0
- package/lib/components/textstring-provider/utils.d.ts +7 -0
- package/lib/components/textstring-provider/utils.js +19 -0
- package/lib/components/textstring-provider/utils.js.map +1 -0
- package/lib/components/tooltip/Tooltip.d.ts +10 -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 +11 -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 +21 -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 +32 -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 +46 -0
- package/lib/index.js +288 -0
- package/lib/index.js.map +1 -0
- package/lib/types/chayns.d.ts +61 -0
- package/lib/types/chayns.js +14 -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/types/language.d.ts +52 -0
- package/lib/types/language.js +6 -0
- package/lib/types/language.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 +70 -0
- package/lib/utils/fileDialog.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 +66 -61
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_styledComponents","_Icon","_interopRequireDefault","_Input","_SearchInput","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SearchInput","_ref","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","transition","duration","icons","onClick","size","StyledMotionSearchInputContentWrapper","width","placeholderElement","color","text","ref","displayName","_default","exports"],"sources":["../../../src/components/search-input/SearchInput.tsx"],"sourcesContent":["import { AnimatePresence } from 'framer-motion';\nimport React, { ChangeEventHandler, FC, useCallback, useEffect, useRef, useState } 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 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> = ({ onActiveChange, onChange, placeholder, value }) => {\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 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 onChange={onChange}\n placeholder={placeholder}\n placeholderElement={\n <Icon color={theme.text} icons={['far fa-search']} size={14} />\n }\n ref={inputRef}\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;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAK8B,SAAAK,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAV,wBAAAM,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,W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D,aAAA,CAAAwD,eAAe;IAACC,OAAO,EAAE;EAAM,GAC3BpB,QAAQ,iBACLnC,MAAA,CAAAS,OAAA,CAAAyC,aAAA,CAAC5C,YAAA,CAAA4D,qCAAqC;IAClCT,OAAO,EAAE;MAAEC,OAAO,EAAE,CAAC;MAAES,KAAK,EAAE;IAAO,CAAE;IACvCR,IAAI,EAAE;MAAED,OAAO,EAAE,CAAC;MAAES,KAAK,EAAE;IAAE,CAAE;IAC/BZ,OAAO,EAAE;MAAEG,OAAO,EAAE,CAAC;MAAES,KAAK,EAAE;IAAE,CAAE;IAClC5C,GAAG,EAAC,2BAA2B;IAC/BsC,UAAU,EAAE;MAAEC,QAAQ,EAAE;IAAI;EAAE,gBAE9B9D,MAAA,CAAAS,OAAA,CAAAyC,aAAA,CAAC7C,MAAA,CAAAI,OAAK;IACFuB,QAAQ,EAAEA,QAAS;IACnBC,WAAW,EAAEA,WAAY;IACzBmC,kBAAkB,eACdpE,MAAA,CAAAS,OAAA,CAAAyC,aAAA,CAAC/C,KAAA,CAAAM,OAAI;MAAC4D,KAAK,EAAE5B,KAAK,CAAC6B,IAAK;MAACP,KAAK,EAAE,CAAC,eAAe,CAAE;MAACE,IAAI,EAAE;IAAG,CAAE,CACjE;IACDM,GAAG,EAAEhC,QAAS;IACdL,KAAK,EAAEA;EAAM,CAChB,CACkC,CAE9B,CACF,CAAC;AAE5B,CAAC;AAEDL,WAAW,CAAC2C,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAEzB5C,WAAW;AAAA6C,OAAA,CAAAjE,OAAA,GAAAgE,QAAA"}
|
|
@@ -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,30 @@
|
|
|
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 = _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
|
+
exports.StyledSearchInput = StyledSearchInput;
|
|
19
|
+
const StyledMotionSearchInputContentWrapper = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
`;
|
|
22
|
+
exports.StyledMotionSearchInputContentWrapper = StyledMotionSearchInputContentWrapper;
|
|
23
|
+
const StyledMotionSearchInputIconWrapper = _styledComponents.default.div`
|
|
24
|
+
height: 18px;
|
|
25
|
+
width: 18px;
|
|
26
|
+
`;
|
|
27
|
+
exports.StyledMotionSearchInputIconWrapper = StyledMotionSearchInputIconWrapper;
|
|
28
|
+
const StyledMotionSearchInputIconWrapperContent = (0, _styledComponents.default)(_framerMotion.motion.div)``;
|
|
29
|
+
exports.StyledMotionSearchInputIconWrapperContent = StyledMotionSearchInputIconWrapperContent;
|
|
30
|
+
//# sourceMappingURL=SearchInput.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","obj","__esModule","default","StyledSearchInput","styled","div","exports","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,GAAGC,yBAAM,CAACC,GAAI;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAACC,OAAA,CAAAH,iBAAA,GAAAA,iBAAA;AAEK,MAAMI,qCAAqC,GAAG,IAAAH,yBAAM,EAACI,oBAAM,CAACH,GAAG,CAAE;AACxE;AACA,CAAC;AAACC,OAAA,CAAAC,qCAAA,GAAAA,qCAAA;AAEK,MAAME,kCAAkC,GAAGL,yBAAM,CAACC,GAAI;AAC7D;AACA;AACA,CAAC;AAACC,OAAA,CAAAG,kCAAA,GAAAA,kCAAA;AAEK,MAAMC,yCAAyC,GAAG,IAAAN,yBAAM,EAACI,oBAAM,CAACH,GAAG,CAAE,EAAC;AAACC,OAAA,CAAAI,yCAAA,GAAAA,yCAAA"}
|
|
@@ -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,114 @@
|
|
|
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(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
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 ? void 0 : _contextMenuRef$curre.hide();
|
|
36
|
+
};
|
|
37
|
+
const handleShare = key => {
|
|
38
|
+
var _contextMenuRef$curre2;
|
|
39
|
+
(_contextMenuRef$curre2 = contextMenuRef.current) === null || _contextMenuRef$curre2 === void 0 ? 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 ? 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 = SharingBar;
|
|
113
|
+
exports.default = _default;
|
|
114
|
+
//# 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","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","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","_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 </StyledSharingBar>\n );\n};\n\nSharingBar.displayName = 'SharingBar';\n\nexport default SharingBar;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;A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CAAA,KAAMZ,WAAW,CAAC,MAAM,CAAC;IAClCa,IAAI,EAAE;EACV,CAAC,EACD;IACIF,KAAK,EAAE,CAAC,cAAc,CAAC;IACvBhD,GAAG,EAAE,aAAa;IAClBiD,OAAO,EAAEpC,mBAAmB;IAC5BqC,IAAI,EAAE;EACV,CAAC,CACJ;EAED,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;IAAA,IAAAC,sBAAA;IAChC,CAAAA,sBAAA,GAAAzC,cAAc,CAACwB,OAAO,cAAAiB,sBAAA,uBAAtBA,sBAAA,CAAwBC,IAAI,CAAC,CAAC;EAClC,CAAC;EAED,oBACI5E,MAAA,CAAAS,OAAA,CAAAsC,aAAA,CAACzC,WAAA,CAAAuE,gBAAgB;IAACL,OAAO,EAAEE;EAAsB,gBAC7C1E,MAAA,CAAAS,OAAA,CAAAsC,aAAA,CAACzC,WAAA,CAAAwE,2BAA2B,qBACxB9E,MAAA,CAAAS,OAAA,CAAAsC,aAAA,CAAC1C,KAAA,CAAAI,OAAI;IAAC8D,KAAK,EAAE,CAAC,mBAAmB;EAAE,CAAE,CACZ,CAAC,eAC9BvE,MAAA,CAAAS,OAAA,CAAAsC,aAAA,CAAC5C,YAAA,CAAAM,OAAW;IAACsE,KAAK,EAAET,gBAAiB;IAACU,GAAG,EAAE9C,cAAe;IAAC+C,SAAS,EAAEhD;EAAe,GAChF,IACQ,CAAC,eACdjC,MAAA,CAAAS,OAAA,CAAAsC,aAAA,CAACzC,WAAA,CAAA4E,oBAAoB,QAAEnD,KAA4B,CACrC,CAAC;AAE3B,CAAC;AAEDF,UAAU,CAACsD,WAAW,GAAG,YAAY;AAAC,IAAAC,QAAA,GAEvBvD,UAAU;AAAAwD,OAAA,CAAA5E,OAAA,GAAA2E,QAAA"}
|
|
@@ -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,27 @@
|
|
|
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 = _styledComponents.default.div`
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
`;
|
|
14
|
+
exports.StyledSharingBar = StyledSharingBar;
|
|
15
|
+
const StyledSharingBarIconWrapper = _styledComponents.default.div``;
|
|
16
|
+
exports.StyledSharingBarIconWrapper = StyledSharingBarIconWrapper;
|
|
17
|
+
const StyledSharingBarText = _styledComponents.default.p`
|
|
18
|
+
color: ${_ref => {
|
|
19
|
+
let {
|
|
20
|
+
theme
|
|
21
|
+
} = _ref;
|
|
22
|
+
return theme.text;
|
|
23
|
+
}};
|
|
24
|
+
margin: 0 0 0 5px;
|
|
25
|
+
`;
|
|
26
|
+
exports.StyledSharingBarText = StyledSharingBarText;
|
|
27
|
+
//# sourceMappingURL=SharingBar.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharingBar.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledSharingBar","styled","div","exports","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,GAAGC,yBAAM,CAACC,GAAI;AAC3C;AACA;AACA;AACA,CAAC;AAACC,OAAA,CAAAH,gBAAA,GAAAA,gBAAA;AAEK,MAAMI,2BAA2B,GAAGH,yBAAM,CAACC,GAAI,EAAC;AAACC,OAAA,CAAAC,2BAAA,GAAAA,2BAAA;AAIjD,MAAMC,oBAAoB,GAAGJ,yBAAM,CAACK,CAA6B;AACxE,aAAaC,IAAA;EAAA,IAAC;IAAEC;EAAiC,CAAC,GAAAD,IAAA;EAAA,OAAKC,KAAK,CAACC,IAAI;AAAA,CAAC;AAClE;AACA,CAAC;AAACN,OAAA,CAAAE,oBAAA,GAAAA,oBAAA"}
|
|
@@ -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,52 @@
|
|
|
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(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
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 = Slider;
|
|
51
|
+
exports.default = _default;
|
|
52
|
+
//# sourceMappingURL=Slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.js","names":["_react","_interopRequireWildcard","require","_Slider","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","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,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA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AAK;IACtCL,cAAc,CAACM,MAAM,CAACD,KAAK,CAACE,MAAM,CAACV,KAAK,CAAC,CAAC;IAE1C,IAAIC,QAAQ,EAAE;MACVA,QAAQ,CAACQ,MAAM,CAACD,KAAK,CAACE,MAAM,CAACV,KAAK,CAAC,CAAC;IACxC;EACJ,CAAC,EACD,CAACC,QAAQ,CACb,CAAC;EAED,OAAO,IAAAU,cAAO,EACV,mBACIzC,MAAA,CAAAW,OAAA,CAAA+B,aAAA,CAACvC,OAAA,CAAAwC,YAAY,qBACT3C,MAAA,CAAAW,OAAA,CAAA+B,aAAA,CAACvC,OAAA,CAAAyC,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,GAEfvB,MAAM;AAAAwB,OAAA,CAAAvC,OAAA,GAAAsC,QAAA"}
|
|
@@ -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,76 @@
|
|
|
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 = _styledComponents.default.div`
|
|
10
|
+
width: 100%;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
`;
|
|
13
|
+
exports.StyledSlider = StyledSlider;
|
|
14
|
+
const StyledSliderInput = _styledComponents.default.input`
|
|
15
|
+
width: 100%;
|
|
16
|
+
border-radius: 100px;
|
|
17
|
+
-webkit-appearance: none;
|
|
18
|
+
height: 10px;
|
|
19
|
+
background: ${_ref => {
|
|
20
|
+
var _theme$, _theme$2, _theme$3, _theme$4;
|
|
21
|
+
let {
|
|
22
|
+
theme,
|
|
23
|
+
min,
|
|
24
|
+
max,
|
|
25
|
+
value
|
|
26
|
+
} = _ref;
|
|
27
|
+
return `linear-gradient(
|
|
28
|
+
to right,
|
|
29
|
+
${(_theme$ = theme['409']) !== null && _theme$ !== void 0 ? _theme$ : ''} 0%,
|
|
30
|
+
${(_theme$2 = theme['409']) !== null && _theme$2 !== void 0 ? _theme$2 : ''}
|
|
31
|
+
${(value - min) / (max - min) * 100}%,
|
|
32
|
+
${(_theme$3 = theme['403']) !== null && _theme$3 !== void 0 ? _theme$3 : ''}
|
|
33
|
+
${(value - min) / (max - min) * 100}%,
|
|
34
|
+
${(_theme$4 = theme['403']) !== null && _theme$4 !== void 0 ? _theme$4 : ''}
|
|
35
|
+
)`;
|
|
36
|
+
}};
|
|
37
|
+
|
|
38
|
+
outline: none;
|
|
39
|
+
opacity: 0.7;
|
|
40
|
+
-webkit-transition: 0.2s;
|
|
41
|
+
transition: opacity 0.2s;
|
|
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
|
+
exports.StyledSliderInput = StyledSliderInput;
|
|
76
|
+
//# sourceMappingURL=Slider.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledSlider","styled","div","exports","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\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,GAAGC,yBAAM,CAACC,GAAI;AACvC;AACA;AACA,CAAC;AAACC,OAAA,CAAAH,YAAA,GAAAA,YAAA;AAIK,MAAMI,iBAAiB,GAAGH,yBAAM,CAACI,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,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;AAACR,OAAA,CAAAC,iBAAA,GAAAA,iBAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export declare enum SmallWaitCursorSpeed {
|
|
3
|
+
Slow = 1.5,
|
|
4
|
+
Medium = 1,
|
|
5
|
+
Fast = 0.5
|
|
6
|
+
}
|
|
7
|
+
export type SmallWaitCursorProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Specifies whether the wait cursor should be displayed with a background.
|
|
10
|
+
*/
|
|
11
|
+
shouldShowBackground?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Specifies whether the wait cursor should be displayed.
|
|
14
|
+
*/
|
|
15
|
+
shouldShowWaitCursor: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The speed of the animation in seconds. Use the SmallWaitCursorSpeed enum for this prop.
|
|
18
|
+
*/
|
|
19
|
+
speed?: SmallWaitCursorSpeed;
|
|
20
|
+
};
|
|
21
|
+
declare const SmallWaitCursor: FC<SmallWaitCursorProps>;
|
|
22
|
+
export default SmallWaitCursor;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.SmallWaitCursorSpeed = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _SmallWaitCursor = require("./SmallWaitCursor.styles");
|
|
9
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
+
// noinspection JSUnusedGlobalSymbols
|
|
12
|
+
let SmallWaitCursorSpeed = /*#__PURE__*/function (SmallWaitCursorSpeed) {
|
|
13
|
+
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Slow"] = 1.5] = "Slow";
|
|
14
|
+
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Medium"] = 1] = "Medium";
|
|
15
|
+
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Fast"] = 0.5] = "Fast";
|
|
16
|
+
return SmallWaitCursorSpeed;
|
|
17
|
+
}({});
|
|
18
|
+
exports.SmallWaitCursorSpeed = SmallWaitCursorSpeed;
|
|
19
|
+
const SmallWaitCursor = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
shouldShowWaitCursor,
|
|
22
|
+
shouldShowBackground = true,
|
|
23
|
+
speed = SmallWaitCursorSpeed.Medium
|
|
24
|
+
} = _ref;
|
|
25
|
+
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursor, {
|
|
26
|
+
shouldShowWaitCursor: shouldShowWaitCursor
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursorWaitCursor, {
|
|
28
|
+
speed: speed
|
|
29
|
+
}), shouldShowBackground && /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursorBackground, null)), [shouldShowBackground, shouldShowWaitCursor, speed]);
|
|
30
|
+
};
|
|
31
|
+
SmallWaitCursor.displayName = 'SmallWaitCursor';
|
|
32
|
+
var _default = SmallWaitCursor;
|
|
33
|
+
exports.default = _default;
|
|
34
|
+
//# sourceMappingURL=SmallWaitCursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmallWaitCursor.js","names":["_react","_interopRequireWildcard","require","_SmallWaitCursor","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SmallWaitCursorSpeed","exports","SmallWaitCursor","_ref","shouldShowWaitCursor","shouldShowBackground","speed","Medium","useMemo","createElement","StyledSmallWaitCursor","StyledSmallWaitCursorWaitCursor","StyledSmallWaitCursorBackground","displayName","_default"],"sources":["../../../src/components/small-wait-cursor/SmallWaitCursor.tsx"],"sourcesContent":["import React, { FC, useMemo } from 'react';\nimport {\n StyledSmallWaitCursor,\n StyledSmallWaitCursorBackground,\n StyledSmallWaitCursorWaitCursor,\n} from './SmallWaitCursor.styles';\n\n// noinspection JSUnusedGlobalSymbols\nexport enum SmallWaitCursorSpeed {\n Slow = 1.5,\n Medium = 1,\n Fast = 0.5,\n}\n\nexport type SmallWaitCursorProps = {\n /**\n * Specifies whether the wait cursor should be displayed with a background.\n */\n shouldShowBackground?: boolean;\n /**\n * Specifies whether the wait cursor should be displayed.\n */\n shouldShowWaitCursor: boolean;\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 shouldShowWaitCursor,\n shouldShowBackground = true,\n speed = SmallWaitCursorSpeed.Medium,\n}) =>\n useMemo(\n () => (\n <StyledSmallWaitCursor shouldShowWaitCursor={shouldShowWaitCursor}>\n <StyledSmallWaitCursorWaitCursor speed={speed} />\n {shouldShowBackground && <StyledSmallWaitCursorBackground />}\n </StyledSmallWaitCursor>\n ),\n [shouldShowBackground, shouldShowWaitCursor, speed]\n );\n\nSmallWaitCursor.displayName = 'SmallWaitCursor';\n\nexport default SmallWaitCursor;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAIkC,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GA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B,EAAEA;EAAqB,gBAC9D9B,MAAA,CAAAW,OAAA,CAAAwB,aAAA,CAAChC,gBAAA,CAAAkC,+BAA+B;IAACL,KAAK,EAAEA;EAAM,CAAE,CAAC,EAChDD,oBAAoB,iBAAI/B,MAAA,CAAAW,OAAA,CAAAwB,aAAA,CAAChC,gBAAA,CAAAmC,+BAA+B,MAAE,CACxC,CAC1B,EACD,CAACP,oBAAoB,EAAED,oBAAoB,EAAEE,KAAK,CACtD,CAAC;AAAA;AAELJ,eAAe,CAACW,WAAW,GAAG,iBAAiB;AAAC,IAAAC,QAAA,GAEjCZ,eAAe;AAAAD,OAAA,CAAAhB,OAAA,GAAA6B,QAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const StyledSmallWaitCursor: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
shouldShowWaitCursor: boolean;
|
|
3
|
+
} & {
|
|
4
|
+
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
5
|
+
}, never>;
|
|
6
|
+
export declare const StyledSmallWaitCursorBackground: import("styled-components").StyledComponent<"div", any, {
|
|
7
|
+
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
8
|
+
}, never>;
|
|
9
|
+
export declare const StyledSmallWaitCursorWaitCursor: import("styled-components").StyledComponent<"div", any, {
|
|
10
|
+
speed: number;
|
|
11
|
+
} & {
|
|
12
|
+
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
13
|
+
}, never>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledSmallWaitCursorWaitCursor = exports.StyledSmallWaitCursorBackground = exports.StyledSmallWaitCursor = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
|
+
const StyledSmallWaitCursor = _styledComponents.default.div`
|
|
11
|
+
position: relative;
|
|
12
|
+
height: 30px;
|
|
13
|
+
width: 30px;
|
|
14
|
+
opacity: ${_ref => {
|
|
15
|
+
let {
|
|
16
|
+
shouldShowWaitCursor
|
|
17
|
+
} = _ref;
|
|
18
|
+
return shouldShowWaitCursor ? 1 : 0;
|
|
19
|
+
}};
|
|
20
|
+
`;
|
|
21
|
+
exports.StyledSmallWaitCursor = StyledSmallWaitCursor;
|
|
22
|
+
const StyledSmallWaitCursorBackground = _styledComponents.default.div`
|
|
23
|
+
background-color: ${_ref2 => {
|
|
24
|
+
let {
|
|
25
|
+
theme
|
|
26
|
+
} = _ref2;
|
|
27
|
+
return theme['100'];
|
|
28
|
+
}};
|
|
29
|
+
border-radius: 50%;
|
|
30
|
+
height: 30px;
|
|
31
|
+
width: 30px;
|
|
32
|
+
position: relative;
|
|
33
|
+
z-index: 1;
|
|
34
|
+
`;
|
|
35
|
+
exports.StyledSmallWaitCursorBackground = StyledSmallWaitCursorBackground;
|
|
36
|
+
const spin = (0, _styledComponents.keyframes)`
|
|
37
|
+
from {
|
|
38
|
+
transform: rotate(0deg);
|
|
39
|
+
}
|
|
40
|
+
to {
|
|
41
|
+
transform: rotate(360deg);
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
const StyledSmallWaitCursorWaitCursor = _styledComponents.default.div`
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: 5px;
|
|
47
|
+
left: 5px;
|
|
48
|
+
z-index: 2;
|
|
49
|
+
border-style: solid;
|
|
50
|
+
border-width: 3px;
|
|
51
|
+
border-color: ${_ref3 => {
|
|
52
|
+
let {
|
|
53
|
+
theme
|
|
54
|
+
} = _ref3;
|
|
55
|
+
return theme.headline;
|
|
56
|
+
}};
|
|
57
|
+
height: 20px;
|
|
58
|
+
width: 20px;
|
|
59
|
+
border-radius: 50%;
|
|
60
|
+
display: inline-block;
|
|
61
|
+
border-top: 3px solid transparent;
|
|
62
|
+
|
|
63
|
+
animation: ${spin} ${_ref4 => {
|
|
64
|
+
let {
|
|
65
|
+
speed
|
|
66
|
+
} = _ref4;
|
|
67
|
+
return speed;
|
|
68
|
+
}}s linear
|
|
69
|
+
infinite;
|
|
70
|
+
`;
|
|
71
|
+
exports.StyledSmallWaitCursorWaitCursor = StyledSmallWaitCursorWaitCursor;
|
|
72
|
+
//# sourceMappingURL=SmallWaitCursor.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmallWaitCursor.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledSmallWaitCursor","styled","div","_ref","shouldShowWaitCursor","exports","StyledSmallWaitCursorBackground","_ref2","theme","spin","keyframes","StyledSmallWaitCursorWaitCursor","_ref3","headline","_ref4","speed"],"sources":["../../../src/components/small-wait-cursor/SmallWaitCursor.styles.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledSmallWaitCursorProps = WithTheme<{\n shouldShowWaitCursor: boolean;\n}>;\n\nexport const StyledSmallWaitCursor = styled.div<StyledSmallWaitCursorProps>`\n position: relative;\n height: 30px;\n width: 30px;\n opacity: ${({ shouldShowWaitCursor }: StyledSmallWaitCursorProps) =>\n shouldShowWaitCursor ? 1 : 0};\n`;\n\ntype StyledSmallWaitCursorBackgroundProps = WithTheme<unknown>;\n\nexport const StyledSmallWaitCursorBackground = styled.div<StyledSmallWaitCursorBackgroundProps>`\n background-color: ${({ theme }: StyledSmallWaitCursorBackgroundProps) => theme['100']};\n border-radius: 50%;\n height: 30px;\n width: 30px;\n position: relative;\n z-index: 1;\n`;\n\ntype StyledSmallWaitCursorWaitCursorProps = WithTheme<{\n speed: number;\n}>;\n\nconst spin = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`;\n\nexport const StyledSmallWaitCursorWaitCursor = styled.div<StyledSmallWaitCursorWaitCursorProps>`\n position: absolute;\n top: 5px;\n left: 5px;\n z-index: 2;\n border-style: solid;\n border-width: 3px;\n border-color: ${({ theme }: StyledSmallWaitCursorWaitCursorProps) => theme.headline};\n height: 20px;\n width: 20px;\n border-radius: 50%;\n display: inline-block;\n border-top: 3px solid transparent;\n\n animation: ${spin} ${({ speed }: StyledSmallWaitCursorWaitCursorProps) => speed}s linear\n infinite;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAsD,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,S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