@chayns-components/core 5.4.8-alpha.0 → 5.4.12
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/AGENTS.md +0 -12
- package/lib/cjs/components/accordion/Accordion.js +12 -107
- package/lib/cjs/components/accordion/Accordion.js.map +1 -1
- package/lib/cjs/components/accordion/Accordion.styles.js +3 -23
- package/lib/cjs/components/accordion/Accordion.styles.js.map +1 -1
- package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js +1 -3
- package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
- package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js +19 -36
- package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
- package/lib/cjs/components/accordion/accordion-head/AccordionHead.js +3 -6
- package/lib/cjs/components/accordion/accordion-head/AccordionHead.js.map +1 -1
- package/lib/cjs/components/accordion/accordion-head/AccordionHead.styles.js +0 -14
- package/lib/cjs/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
- package/lib/cjs/components/amount-control/AmountControl.js +17 -31
- package/lib/cjs/components/amount-control/AmountControl.js.map +1 -1
- package/lib/cjs/components/amount-control/AmountControl.styles.js +2 -18
- package/lib/cjs/components/amount-control/AmountControl.styles.js.map +1 -1
- package/lib/cjs/components/button/Button.js +1 -5
- package/lib/cjs/components/button/Button.js.map +1 -1
- package/lib/cjs/components/button/Button.styles.js +0 -10
- package/lib/cjs/components/button/Button.styles.js.map +1 -1
- package/lib/cjs/components/button/Button.types.js.map +1 -1
- package/lib/cjs/components/checkbox/Checkbox.js +1 -5
- package/lib/cjs/components/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/components/checkbox/Checkbox.styles.js +2 -29
- package/lib/cjs/components/checkbox/Checkbox.styles.js.map +1 -1
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +2 -7
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js +2 -8
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
- package/lib/cjs/components/combobox/ComboBox.js +11 -68
- package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
- package/lib/cjs/components/combobox/ComboBox.styles.js +0 -11
- package/lib/cjs/components/combobox/ComboBox.styles.js.map +1 -1
- package/lib/cjs/components/combobox/ComboBox.types.js.map +1 -1
- package/lib/cjs/components/context-menu/ContextMenu.js +42 -146
- package/lib/cjs/components/context-menu/ContextMenu.js.map +1 -1
- package/lib/cjs/components/context-menu/ContextMenu.styles.js +0 -38
- package/lib/cjs/components/context-menu/ContextMenu.styles.js.map +1 -1
- package/lib/cjs/components/context-menu/ContextMenu.types.js.map +1 -1
- package/lib/cjs/components/context-menu/ContextMenu.utils.js +1 -27
- package/lib/cjs/components/context-menu/ContextMenu.utils.js.map +1 -1
- package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.js +8 -3
- package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
- package/lib/cjs/components/file-input/FileInput.js +2 -4
- package/lib/cjs/components/file-input/FileInput.js.map +1 -1
- package/lib/cjs/components/file-list/file-item/FileItem.js +25 -48
- package/lib/cjs/components/file-list/file-item/FileItem.js.map +1 -1
- package/lib/cjs/components/file-list/file-item/FileItem.styles.js +1 -25
- package/lib/cjs/components/file-list/file-item/FileItem.styles.js.map +1 -1
- package/lib/cjs/components/file-select/FileSelect.js +4 -27
- package/lib/cjs/components/file-select/FileSelect.js.map +1 -1
- package/lib/cjs/components/file-select/FileSelect.styles.js +0 -10
- package/lib/cjs/components/file-select/FileSelect.styles.js.map +1 -1
- package/lib/cjs/components/filter/Filter.js +16 -51
- package/lib/cjs/components/filter/Filter.js.map +1 -1
- package/lib/cjs/components/filter/Filter.styles.js +0 -9
- package/lib/cjs/components/filter/Filter.styles.js.map +1 -1
- package/lib/cjs/components/filter/filter-content/FilterContent.js +5 -14
- package/lib/cjs/components/filter/filter-content/FilterContent.js.map +1 -1
- package/lib/cjs/components/filter/filter-content/FilterContent.types.js.map +1 -1
- package/lib/cjs/components/filter-buttons/FilterButtons.js +4 -69
- package/lib/cjs/components/filter-buttons/FilterButtons.js.map +1 -1
- package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js +2 -40
- package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
- package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js +0 -11
- package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
- package/lib/cjs/components/grid-image/GridImage.js +2 -20
- package/lib/cjs/components/grid-image/GridImage.js.map +1 -1
- package/lib/cjs/components/grid-image/GridImage.styles.js +2 -11
- package/lib/cjs/components/grid-image/GridImage.styles.js.map +1 -1
- package/lib/cjs/components/grouped-image/GroupedImage.js +4 -23
- package/lib/cjs/components/grouped-image/GroupedImage.js.map +1 -1
- package/lib/cjs/components/grouped-image/GroupedImage.styles.js +0 -9
- package/lib/cjs/components/grouped-image/GroupedImage.styles.js.map +1 -1
- package/lib/cjs/components/highlight-slider/HighlightSlider.js +3 -13
- package/lib/cjs/components/highlight-slider/HighlightSlider.js.map +1 -1
- package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +4 -21
- package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js.map +1 -1
- package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js +2 -11
- package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
- package/lib/cjs/components/icon/Icon.js +5 -24
- package/lib/cjs/components/icon/Icon.js.map +1 -1
- package/lib/cjs/components/icon/Icon.styles.js +0 -23
- package/lib/cjs/components/icon/Icon.styles.js.map +1 -1
- package/lib/cjs/components/input/Input.js +8 -29
- package/lib/cjs/components/input/Input.js.map +1 -1
- package/lib/cjs/components/input/Input.styles.js +3 -38
- package/lib/cjs/components/input/Input.styles.js.map +1 -1
- package/lib/cjs/components/list/List.js +37 -124
- package/lib/cjs/components/list/List.js.map +1 -1
- package/lib/cjs/components/list/List.utils.js +1 -213
- package/lib/cjs/components/list/List.utils.js.map +1 -1
- package/lib/cjs/components/list/list-item/ListItem.js +3 -84
- package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
- package/lib/cjs/components/list/list-item/ListItem.styles.js +0 -7
- package/lib/cjs/components/list/list-item/ListItem.styles.js.map +1 -1
- package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js +1 -5
- package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
- package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js +1 -5
- package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
- package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +0 -1
- package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -1
- package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +0 -3
- package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -1
- package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +0 -1
- package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
- package/lib/cjs/components/mention-finder/MentionFinder.js +5 -43
- package/lib/cjs/components/mention-finder/MentionFinder.js.map +1 -1
- package/lib/cjs/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -1
- package/lib/cjs/components/multi-action-button/MultiActionButton.js +3 -36
- package/lib/cjs/components/multi-action-button/MultiActionButton.js.map +1 -1
- package/lib/cjs/components/multi-action-button/MultiActionButton.styles.js +0 -6
- package/lib/cjs/components/multi-action-button/MultiActionButton.styles.js.map +1 -1
- package/lib/cjs/components/multi-action-button/MultiActionButton.types.js.map +1 -1
- package/lib/cjs/components/multi-action-button/action-button/ActionButton.js +1 -7
- package/lib/cjs/components/multi-action-button/action-button/ActionButton.js.map +1 -1
- package/lib/cjs/components/multi-action-button/action-button/ActionButton.styles.js +0 -12
- package/lib/cjs/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
- package/lib/cjs/components/number-input/NumberInput.js +10 -13
- package/lib/cjs/components/number-input/NumberInput.js.map +1 -1
- package/lib/cjs/components/page-provider/PageProvider.js +2 -4
- package/lib/cjs/components/page-provider/PageProvider.js.map +1 -1
- package/lib/cjs/components/popup/Popup.js +1 -8
- package/lib/cjs/components/popup/Popup.js.map +1 -1
- package/lib/cjs/components/radio-button/RadioButton.js +15 -29
- package/lib/cjs/components/radio-button/RadioButton.js.map +1 -1
- package/lib/cjs/components/radio-button/RadioButton.styles.js +9 -20
- package/lib/cjs/components/radio-button/RadioButton.styles.js.map +1 -1
- package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js +4 -7
- package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/lib/cjs/components/search-box/SearchBox.js +6 -21
- package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
- package/lib/cjs/components/search-input/SearchInput.js +43 -56
- package/lib/cjs/components/search-input/SearchInput.js.map +1 -1
- package/lib/cjs/components/search-input/SearchInput.styles.js +2 -26
- package/lib/cjs/components/search-input/SearchInput.styles.js.map +1 -1
- package/lib/cjs/components/select-button/SelectButton.js +2 -4
- package/lib/cjs/components/select-button/SelectButton.js.map +1 -1
- package/lib/cjs/components/setup-wizard/SetupWizard.js +4 -10
- package/lib/cjs/components/setup-wizard/SetupWizard.js.map +1 -1
- package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +3 -5
- package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
- package/lib/cjs/components/sharing-bar/SharingBar.js +6 -31
- package/lib/cjs/components/sharing-bar/SharingBar.js.map +1 -1
- package/lib/cjs/components/sharing-bar/SharingBar.styles.js +0 -5
- package/lib/cjs/components/sharing-bar/SharingBar.styles.js.map +1 -1
- package/lib/cjs/components/sharing-button/SharingButton.js +2 -4
- package/lib/cjs/components/sharing-button/SharingButton.js.map +1 -1
- package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js +1 -3
- package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
- package/lib/cjs/components/signature/Signature.js +3 -6
- package/lib/cjs/components/signature/Signature.js.map +1 -1
- package/lib/cjs/components/slider/Slider.js +7 -30
- package/lib/cjs/components/slider/Slider.js.map +1 -1
- package/lib/cjs/components/slider/Slider.styles.js +2 -9
- package/lib/cjs/components/slider/Slider.styles.js.map +1 -1
- package/lib/cjs/components/slider-button/SliderButton.js +6 -63
- package/lib/cjs/components/slider-button/SliderButton.js.map +1 -1
- package/lib/cjs/components/slider-button/SliderButton.styles.js +2 -15
- package/lib/cjs/components/slider-button/SliderButton.styles.js.map +1 -1
- package/lib/cjs/components/tag-input/TagInput.js +36 -92
- package/lib/cjs/components/tag-input/TagInput.js.map +1 -1
- package/lib/cjs/components/tag-input/TagInput.styles.js +3 -29
- package/lib/cjs/components/tag-input/TagInput.styles.js.map +1 -1
- package/lib/cjs/components/text-area/TextArea.js +8 -17
- package/lib/cjs/components/text-area/TextArea.js.map +1 -1
- package/lib/cjs/components/text-area/TextArea.styles.js +1 -15
- package/lib/cjs/components/text-area/TextArea.styles.js.map +1 -1
- package/lib/cjs/components/truncation/Truncation.js +3 -17
- package/lib/cjs/components/truncation/Truncation.js.map +1 -1
- package/lib/cjs/components/truncation/Truncation.styles.js +1 -18
- package/lib/cjs/components/truncation/Truncation.styles.js.map +1 -1
- package/lib/cjs/utils/file.js.map +1 -1
- package/lib/esm/components/accordion/Accordion.js +12 -105
- package/lib/esm/components/accordion/Accordion.js.map +1 -1
- package/lib/esm/components/accordion/Accordion.styles.js +3 -23
- package/lib/esm/components/accordion/Accordion.styles.js.map +1 -1
- package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js +1 -3
- package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
- package/lib/esm/components/accordion/accordion-group/AccordionGroup.js +19 -33
- package/lib/esm/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
- package/lib/esm/components/accordion/accordion-head/AccordionHead.js +3 -6
- package/lib/esm/components/accordion/accordion-head/AccordionHead.js.map +1 -1
- package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js +0 -14
- package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
- package/lib/esm/components/amount-control/AmountControl.js +16 -30
- package/lib/esm/components/amount-control/AmountControl.js.map +1 -1
- package/lib/esm/components/amount-control/AmountControl.styles.js +2 -18
- package/lib/esm/components/amount-control/AmountControl.styles.js.map +1 -1
- package/lib/esm/components/button/Button.js +1 -5
- package/lib/esm/components/button/Button.js.map +1 -1
- package/lib/esm/components/button/Button.styles.js +0 -10
- package/lib/esm/components/button/Button.styles.js.map +1 -1
- package/lib/esm/components/button/Button.types.js.map +1 -1
- package/lib/esm/components/checkbox/Checkbox.js +1 -5
- package/lib/esm/components/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/components/checkbox/Checkbox.styles.js +2 -29
- package/lib/esm/components/checkbox/Checkbox.styles.js.map +1 -1
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +2 -7
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js +2 -8
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.js +7 -61
- package/lib/esm/components/combobox/ComboBox.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.styles.js +0 -11
- package/lib/esm/components/combobox/ComboBox.styles.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.types.js.map +1 -1
- package/lib/esm/components/context-menu/ContextMenu.js +42 -145
- package/lib/esm/components/context-menu/ContextMenu.js.map +1 -1
- package/lib/esm/components/context-menu/ContextMenu.styles.js +0 -38
- package/lib/esm/components/context-menu/ContextMenu.styles.js.map +1 -1
- package/lib/esm/components/context-menu/ContextMenu.types.js.map +1 -1
- package/lib/esm/components/context-menu/ContextMenu.utils.js +0 -24
- package/lib/esm/components/context-menu/ContextMenu.utils.js.map +1 -1
- package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.js +8 -3
- package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
- package/lib/esm/components/file-input/FileInput.js +2 -4
- package/lib/esm/components/file-input/FileInput.js.map +1 -1
- package/lib/esm/components/file-list/file-item/FileItem.js +26 -49
- package/lib/esm/components/file-list/file-item/FileItem.js.map +1 -1
- package/lib/esm/components/file-list/file-item/FileItem.styles.js +0 -24
- package/lib/esm/components/file-list/file-item/FileItem.styles.js.map +1 -1
- package/lib/esm/components/file-select/FileSelect.js +4 -27
- package/lib/esm/components/file-select/FileSelect.js.map +1 -1
- package/lib/esm/components/file-select/FileSelect.styles.js +0 -10
- package/lib/esm/components/file-select/FileSelect.styles.js.map +1 -1
- package/lib/esm/components/filter/Filter.js +16 -52
- package/lib/esm/components/filter/Filter.js.map +1 -1
- package/lib/esm/components/filter/Filter.styles.js +0 -9
- package/lib/esm/components/filter/Filter.styles.js.map +1 -1
- package/lib/esm/components/filter/filter-content/FilterContent.js +5 -15
- package/lib/esm/components/filter/filter-content/FilterContent.js.map +1 -1
- package/lib/esm/components/filter/filter-content/FilterContent.types.js.map +1 -1
- package/lib/esm/components/filter-buttons/FilterButtons.js +5 -69
- package/lib/esm/components/filter-buttons/FilterButtons.js.map +1 -1
- package/lib/esm/components/filter-buttons/filter-button/FilterButton.js +2 -40
- package/lib/esm/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
- package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js +0 -11
- package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
- package/lib/esm/components/grid-image/GridImage.js +2 -20
- package/lib/esm/components/grid-image/GridImage.js.map +1 -1
- package/lib/esm/components/grid-image/GridImage.styles.js +1 -10
- package/lib/esm/components/grid-image/GridImage.styles.js.map +1 -1
- package/lib/esm/components/grouped-image/GroupedImage.js +4 -22
- package/lib/esm/components/grouped-image/GroupedImage.js.map +1 -1
- package/lib/esm/components/grouped-image/GroupedImage.styles.js +0 -9
- package/lib/esm/components/grouped-image/GroupedImage.styles.js.map +1 -1
- package/lib/esm/components/highlight-slider/HighlightSlider.js +3 -13
- package/lib/esm/components/highlight-slider/HighlightSlider.js.map +1 -1
- package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +3 -20
- package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js.map +1 -1
- package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js +1 -10
- package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
- package/lib/esm/components/icon/Icon.js +7 -26
- package/lib/esm/components/icon/Icon.js.map +1 -1
- package/lib/esm/components/icon/Icon.styles.js +0 -23
- package/lib/esm/components/icon/Icon.styles.js.map +1 -1
- package/lib/esm/components/input/Input.js +4 -24
- package/lib/esm/components/input/Input.js.map +1 -1
- package/lib/esm/components/input/Input.styles.js +3 -38
- package/lib/esm/components/input/Input.styles.js.map +1 -1
- package/lib/esm/components/list/List.js +37 -123
- package/lib/esm/components/list/List.js.map +1 -1
- package/lib/esm/components/list/List.utils.js +0 -202
- package/lib/esm/components/list/List.utils.js.map +1 -1
- package/lib/esm/components/list/list-item/ListItem.js +4 -85
- package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
- package/lib/esm/components/list/list-item/ListItem.styles.js +0 -7
- package/lib/esm/components/list/list-item/ListItem.styles.js.map +1 -1
- package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js +2 -6
- package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
- package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js +0 -4
- package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
- package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +0 -1
- package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -1
- package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +1 -4
- package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -1
- package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +0 -1
- package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
- package/lib/esm/components/mention-finder/MentionFinder.js +3 -39
- package/lib/esm/components/mention-finder/MentionFinder.js.map +1 -1
- package/lib/esm/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -1
- package/lib/esm/components/multi-action-button/MultiActionButton.js +3 -36
- package/lib/esm/components/multi-action-button/MultiActionButton.js.map +1 -1
- package/lib/esm/components/multi-action-button/MultiActionButton.styles.js +0 -6
- package/lib/esm/components/multi-action-button/MultiActionButton.styles.js.map +1 -1
- package/lib/esm/components/multi-action-button/MultiActionButton.types.js.map +1 -1
- package/lib/esm/components/multi-action-button/action-button/ActionButton.js +1 -7
- package/lib/esm/components/multi-action-button/action-button/ActionButton.js.map +1 -1
- package/lib/esm/components/multi-action-button/action-button/ActionButton.styles.js +0 -12
- package/lib/esm/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
- package/lib/esm/components/number-input/NumberInput.js +10 -13
- package/lib/esm/components/number-input/NumberInput.js.map +1 -1
- package/lib/esm/components/page-provider/PageProvider.js +2 -4
- package/lib/esm/components/page-provider/PageProvider.js.map +1 -1
- package/lib/esm/components/popup/Popup.js +1 -8
- package/lib/esm/components/popup/Popup.js.map +1 -1
- package/lib/esm/components/radio-button/RadioButton.js +15 -29
- package/lib/esm/components/radio-button/RadioButton.js.map +1 -1
- package/lib/esm/components/radio-button/RadioButton.styles.js +9 -20
- package/lib/esm/components/radio-button/RadioButton.styles.js.map +1 -1
- package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js +4 -7
- package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/lib/esm/components/search-box/SearchBox.js +4 -18
- package/lib/esm/components/search-box/SearchBox.js.map +1 -1
- package/lib/esm/components/search-input/SearchInput.js +44 -56
- package/lib/esm/components/search-input/SearchInput.js.map +1 -1
- package/lib/esm/components/search-input/SearchInput.styles.js +1 -25
- package/lib/esm/components/search-input/SearchInput.styles.js.map +1 -1
- package/lib/esm/components/select-button/SelectButton.js +2 -4
- package/lib/esm/components/select-button/SelectButton.js.map +1 -1
- package/lib/esm/components/setup-wizard/SetupWizard.js +4 -10
- package/lib/esm/components/setup-wizard/SetupWizard.js.map +1 -1
- package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +3 -5
- package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
- package/lib/esm/components/sharing-bar/SharingBar.js +5 -30
- package/lib/esm/components/sharing-bar/SharingBar.js.map +1 -1
- package/lib/esm/components/sharing-bar/SharingBar.styles.js +0 -5
- package/lib/esm/components/sharing-bar/SharingBar.styles.js.map +1 -1
- package/lib/esm/components/sharing-button/SharingButton.js +2 -4
- package/lib/esm/components/sharing-button/SharingButton.js.map +1 -1
- package/lib/esm/components/sharing-context-menu/SharingContextMenu.js +1 -3
- package/lib/esm/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
- package/lib/esm/components/signature/Signature.js +3 -6
- package/lib/esm/components/signature/Signature.js.map +1 -1
- package/lib/esm/components/slider/Slider.js +7 -30
- package/lib/esm/components/slider/Slider.js.map +1 -1
- package/lib/esm/components/slider/Slider.styles.js +1 -8
- package/lib/esm/components/slider/Slider.styles.js.map +1 -1
- package/lib/esm/components/slider-button/SliderButton.js +6 -62
- package/lib/esm/components/slider-button/SliderButton.js.map +1 -1
- package/lib/esm/components/slider-button/SliderButton.styles.js +1 -14
- package/lib/esm/components/slider-button/SliderButton.styles.js.map +1 -1
- package/lib/esm/components/tag-input/TagInput.js +35 -86
- package/lib/esm/components/tag-input/TagInput.js.map +1 -1
- package/lib/esm/components/tag-input/TagInput.styles.js +1 -27
- package/lib/esm/components/tag-input/TagInput.styles.js.map +1 -1
- package/lib/esm/components/text-area/TextArea.js +9 -18
- package/lib/esm/components/text-area/TextArea.js.map +1 -1
- package/lib/esm/components/text-area/TextArea.styles.js +0 -14
- package/lib/esm/components/text-area/TextArea.styles.js.map +1 -1
- package/lib/esm/components/truncation/Truncation.js +4 -18
- package/lib/esm/components/truncation/Truncation.js.map +1 -1
- package/lib/esm/components/truncation/Truncation.styles.js +0 -17
- package/lib/esm/components/truncation/Truncation.styles.js.map +1 -1
- package/lib/esm/utils/file.js.map +1 -1
- package/lib/types/components/accordion/Accordion.d.ts +0 -5
- package/lib/types/components/accordion/Accordion.styles.d.ts +4 -8
- package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +2 -2
- package/lib/types/components/accordion/accordion-group/AccordionGroup.d.ts +2 -7
- package/lib/types/components/accordion/accordion-head/AccordionHead.d.ts +0 -1
- package/lib/types/components/accordion/accordion-head/AccordionHead.styles.d.ts +18 -18
- package/lib/types/components/amount-control/AmountControl.d.ts +0 -5
- package/lib/types/components/amount-control/AmountControl.styles.d.ts +4 -8
- package/lib/types/components/button/Button.styles.d.ts +6 -8
- package/lib/types/components/button/Button.types.d.ts +0 -8
- package/lib/types/components/checkbox/Checkbox.d.ts +0 -4
- package/lib/types/components/checkbox/Checkbox.styles.d.ts +1 -5
- package/lib/types/components/color-scheme-provider/ColorSchemeProvider.d.ts +0 -5
- package/lib/types/components/combobox/ComboBox.styles.d.ts +2 -4
- package/lib/types/components/combobox/ComboBox.types.d.ts +0 -5
- package/lib/types/components/context-menu/ContextMenu.styles.d.ts +2 -4
- package/lib/types/components/context-menu/ContextMenu.types.d.ts +0 -6
- package/lib/types/components/context-menu/ContextMenu.utils.d.ts +0 -10
- package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.d.ts +1 -1
- package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +2 -2
- package/lib/types/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.styles.d.ts +2 -2
- package/lib/types/components/expandable-content/ExpandableContent.styles.d.ts +2 -2
- package/lib/types/components/file-input/FileInput.d.ts +0 -4
- package/lib/types/components/file-input/FileInput.styles.d.ts +2 -2
- package/lib/types/components/file-list/file-item/FileItem.styles.d.ts +0 -3
- package/lib/types/components/file-select/FileSelect.d.ts +0 -4
- package/lib/types/components/file-select/FileSelect.styles.d.ts +4 -6
- package/lib/types/components/filter/Filter.d.ts +0 -1
- package/lib/types/components/filter/Filter.styles.d.ts +4 -6
- package/lib/types/components/filter/filter-content/FilterContent.types.d.ts +0 -4
- package/lib/types/components/filter-buttons/FilterButtons.d.ts +0 -4
- package/lib/types/components/filter-buttons/filter-button/FilterButton.d.ts +0 -5
- package/lib/types/components/filter-buttons/filter-button/FilterButton.styles.d.ts +8 -12
- package/lib/types/components/grid-image/GridImage.d.ts +0 -4
- package/lib/types/components/grid-image/GridImage.styles.d.ts +2 -4
- package/lib/types/components/grouped-image/GroupedImage.d.ts +0 -4
- package/lib/types/components/grouped-image/GroupedImage.styles.d.ts +6 -8
- package/lib/types/components/highlight-slider/HighlightSlider.d.ts +0 -4
- package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.d.ts +0 -3
- package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.d.ts +5 -9
- package/lib/types/components/icon/Icon.d.ts +0 -4
- package/lib/types/components/icon/Icon.styles.d.ts +0 -1
- package/lib/types/components/input/Input.d.ts +0 -4
- package/lib/types/components/input/Input.styles.d.ts +9 -17
- package/lib/types/components/list/List.d.ts +0 -11
- package/lib/types/components/list/List.utils.d.ts +1 -32
- package/lib/types/components/list/list-item/ListItem.d.ts +0 -4
- package/lib/types/components/list/list-item/ListItem.styles.d.ts +64 -64
- package/lib/types/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +2 -2
- package/lib/types/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +194 -195
- package/lib/types/components/masonry/masonry-item/MasonryItem.styles.d.ts +2 -2
- package/lib/types/components/mention-finder/MentionFinder.styles.d.ts +4 -4
- package/lib/types/components/multi-action-button/MultiActionButton.styles.d.ts +2 -2
- package/lib/types/components/multi-action-button/MultiActionButton.types.d.ts +0 -7
- package/lib/types/components/multi-action-button/action-button/ActionButton.d.ts +1 -4
- package/lib/types/components/multi-action-button/action-button/ActionButton.styles.d.ts +2 -4
- package/lib/types/components/number-input/NumberInput.d.ts +0 -4
- package/lib/types/components/popup/popup-content-wrapper/PopupContentWrapper.styles.d.ts +2 -2
- package/lib/types/components/progress-bar/ProgressBar.styles.d.ts +6 -6
- package/lib/types/components/radio-button/RadioButton.d.ts +0 -4
- package/lib/types/components/radio-button/RadioButton.styles.d.ts +11 -17
- package/lib/types/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +0 -5
- package/lib/types/components/search-box/SearchBox.d.ts +0 -4
- package/lib/types/components/search-box/SearchBox.styles.d.ts +2 -2
- package/lib/types/components/search-input/SearchInput.d.ts +0 -4
- package/lib/types/components/search-input/SearchInput.styles.d.ts +9 -17
- package/lib/types/components/select-button/SelectButton.d.ts +0 -4
- package/lib/types/components/setup-wizard/SetupWizard.d.ts +0 -5
- package/lib/types/components/sharing-bar/SharingBar.d.ts +0 -4
- package/lib/types/components/sharing-button/SharingButton.d.ts +1 -1
- package/lib/types/components/sharing-context-menu/SharingContextMenu.d.ts +2 -10
- package/lib/types/components/signature/Signature.d.ts +0 -4
- package/lib/types/components/skeleton/base-skeleton/BaseSkeleton.styles.d.ts +4 -4
- package/lib/types/components/slider/Slider.d.ts +0 -8
- package/lib/types/components/slider/Slider.styles.d.ts +14 -18
- package/lib/types/components/slider-button/SliderButton.d.ts +28 -1
- package/lib/types/components/slider-button/SliderButton.styles.d.ts +4 -6
- package/lib/types/components/tag-input/TagInput.d.ts +0 -4
- package/lib/types/components/tag-input/TagInput.styles.d.ts +2 -12
- package/lib/types/components/text-area/TextArea.d.ts +0 -4
- package/lib/types/components/text-area/TextArea.styles.d.ts +0 -1
- package/lib/types/components/truncation/Truncation.d.ts +0 -4
- package/lib/types/components/truncation/Truncation.styles.d.ts +2 -7
- package/lib/types/utils/file.d.ts +1 -1
- package/package.json +3 -3
- package/lib/cjs/components/list/list-item/useListItemFocus.js +0 -47
- package/lib/cjs/components/list/list-item/useListItemFocus.js.map +0 -1
- package/lib/cjs/components/slider-button/SliderButton.types.js +0 -6
- package/lib/cjs/components/slider-button/SliderButton.types.js.map +0 -1
- package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js +0 -66
- package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js.map +0 -1
- package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js +0 -47
- package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js.map +0 -1
- package/lib/cjs/hooks/useKeyboardFocusHighlighting.js +0 -68
- package/lib/cjs/hooks/useKeyboardFocusHighlighting.js.map +0 -1
- package/lib/cjs/utils/keyboardFocusHighlighting.styles.js +0 -29
- package/lib/cjs/utils/keyboardFocusHighlighting.styles.js.map +0 -1
- package/lib/esm/components/list/list-item/useListItemFocus.js +0 -40
- package/lib/esm/components/list/list-item/useListItemFocus.js.map +0 -1
- package/lib/esm/components/slider-button/SliderButton.types.js +0 -2
- package/lib/esm/components/slider-button/SliderButton.types.js.map +0 -1
- package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js +0 -56
- package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js.map +0 -1
- package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js +0 -38
- package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js.map +0 -1
- package/lib/esm/hooks/useKeyboardFocusHighlighting.js +0 -61
- package/lib/esm/hooks/useKeyboardFocusHighlighting.js.map +0 -1
- package/lib/esm/utils/keyboardFocusHighlighting.styles.js +0 -24
- package/lib/esm/utils/keyboardFocusHighlighting.styles.js.map +0 -1
- package/lib/types/components/list/list-item/useListItemFocus.d.ts +0 -13
- package/lib/types/components/slider-button/SliderButton.types.d.ts +0 -32
- package/lib/types/components/slider-button/useSliderButtonPopupKeyboard.d.ts +0 -17
- package/lib/types/components/slider-button/useSliderButtonThumbKeyboard.d.ts +0 -13
- package/lib/types/hooks/useKeyboardFocusHighlighting.d.ts +0 -5
- package/lib/types/utils/keyboardFocusHighlighting.styles.d.ts +0 -9
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { StyledCornerElement, StyledCornerImage, StyledGroupedImage, StyledGroupImageElement } from './GroupedImage.styles';
|
|
3
3
|
import CareOfClipPath from './clip-paths/CareOfClipPath';
|
|
4
4
|
import { useUuid } from '../../hooks/uuid';
|
|
5
5
|
import SecondImageClipPath from './clip-paths/SecondImageClipPath';
|
|
6
|
-
import { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';
|
|
7
6
|
const GroupedImage = ({
|
|
8
7
|
cornerImage,
|
|
9
8
|
height = 40,
|
|
@@ -13,25 +12,12 @@ const GroupedImage = ({
|
|
|
13
12
|
shouldPreventBackground = false,
|
|
14
13
|
shouldShowRoundImage = false,
|
|
15
14
|
cornerElement,
|
|
16
|
-
onImageError
|
|
17
|
-
shouldEnableKeyboardHighlighting
|
|
15
|
+
onImageError
|
|
18
16
|
}) => {
|
|
19
17
|
const hasCornerImage = Boolean(cornerImage);
|
|
20
18
|
const hasCornerElement = Boolean(cornerElement);
|
|
21
19
|
const hasMultipleImages = images.length > 1;
|
|
22
20
|
const uuid = useUuid();
|
|
23
|
-
const isClickable = typeof onClick === 'function';
|
|
24
|
-
const isKeyboardFocusable = isClickable && shouldEnableKeyboardHighlighting;
|
|
25
|
-
const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(shouldEnableKeyboardHighlighting);
|
|
26
|
-
const handleKeyDown = useCallback(event => {
|
|
27
|
-
if (!isClickable) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
31
|
-
event.preventDefault();
|
|
32
|
-
onClick?.(event);
|
|
33
|
-
}
|
|
34
|
-
}, [isClickable, onClick]);
|
|
35
21
|
const imageElements = images.slice(0, 2).map((src, index) => /*#__PURE__*/React.createElement(StyledGroupImageElement, {
|
|
36
22
|
$background: imageBackground,
|
|
37
23
|
$isSecondImage: index === 1,
|
|
@@ -58,12 +44,8 @@ const GroupedImage = ({
|
|
|
58
44
|
onError: event => typeof onImageError === 'function' && onImageError(event, index)
|
|
59
45
|
})))));
|
|
60
46
|
return /*#__PURE__*/React.createElement(StyledGroupedImage, {
|
|
61
|
-
onClick:
|
|
62
|
-
|
|
63
|
-
tabIndex: isKeyboardFocusable ? 0 : -1,
|
|
64
|
-
role: isClickable ? 'button' : undefined,
|
|
65
|
-
$height: height,
|
|
66
|
-
$shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting
|
|
47
|
+
onClick: onClick,
|
|
48
|
+
$height: height
|
|
67
49
|
}, hasCornerImage && /*#__PURE__*/React.createElement(CareOfClipPath, {
|
|
68
50
|
height: height,
|
|
69
51
|
uuid: uuid,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupedImage.js","names":["React","
|
|
1
|
+
{"version":3,"file":"GroupedImage.js","names":["React","StyledCornerElement","StyledCornerImage","StyledGroupedImage","StyledGroupImageElement","CareOfClipPath","useUuid","SecondImageClipPath","GroupedImage","cornerImage","height","imageBackground","images","onClick","shouldPreventBackground","shouldShowRoundImage","cornerElement","onImageError","hasCornerImage","Boolean","hasCornerElement","hasMultipleImages","length","uuid","imageElements","slice","map","src","index","createElement","$background","$isSecondImage","$hasCornerImage","$hasMultipleImages","$shouldPreventBackground","$shouldShowRoundImage","$uuid","key","width","viewBox","xmlns","preserveAspectRatio","alt","onError","event","$height","imageFactors","displayName"],"sources":["../../../../src/components/grouped-image/GroupedImage.tsx"],"sourcesContent":["import React, { CSSProperties, FC, MouseEventHandler, ReactNode, SyntheticEvent } from 'react';\nimport {\n StyledCornerElement,\n StyledCornerImage,\n StyledGroupedImage,\n StyledGroupImageElement,\n} from './GroupedImage.styles';\nimport CareOfClipPath from './clip-paths/CareOfClipPath';\nimport { useUuid } from '../../hooks/uuid';\nimport SecondImageClipPath from './clip-paths/SecondImageClipPath';\n\ninterface GroupedImageProps {\n /**\n * Optional image to display in the bottom right corner of the grouped image.\n */\n cornerImage?: string;\n /**\n * Height of the grouped image container.\n */\n height?: number;\n /**\n * Background for the single images.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * Array of image URLs to display in the grouped image. If only one image is provided, it will be displayed as a full image.\n */\n images: string[];\n /**\n * Optional click handler for the grouped image.\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Whether to prevent the background of the images from being set.\n */\n shouldPreventBackground?: boolean;\n /**\n * Whether to show the images in a round shape.\n */\n shouldShowRoundImage?: boolean;\n /**\n * Optional Element to display in the right corner of the image\n */\n cornerElement?: ReactNode;\n /**\n * Optional handler for image load errors.\n */\n onImageError?: (event: SyntheticEvent<HTMLImageElement, Event>, index: number) => void;\n}\n\nconst GroupedImage: FC<GroupedImageProps> = ({\n cornerImage,\n height = 40,\n imageBackground,\n images,\n onClick,\n shouldPreventBackground = false,\n shouldShowRoundImage = false,\n cornerElement,\n onImageError,\n}) => {\n const hasCornerImage = Boolean(cornerImage);\n const hasCornerElement = Boolean(cornerElement);\n const hasMultipleImages = images.length > 1;\n const uuid = useUuid();\n\n const imageElements = images.slice(0, 2).map((src, index) => (\n <StyledGroupImageElement\n $background={imageBackground}\n $isSecondImage={index === 1}\n $hasCornerImage={hasCornerImage}\n $hasMultipleImages={hasMultipleImages}\n $shouldPreventBackground={shouldPreventBackground}\n $shouldShowRoundImage={shouldShowRoundImage}\n $uuid={uuid}\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 40 40\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid slice\"\n >\n <foreignObject width=\"40\" height=\"40\">\n <img\n alt={`image--${index}`}\n src={src}\n onError={(event) =>\n typeof onImageError === 'function' && onImageError(event, index)\n }\n />\n </foreignObject>\n </svg>\n </StyledGroupImageElement>\n ));\n\n return (\n <StyledGroupedImage onClick={onClick} $height={height}>\n {hasCornerImage && (\n <CareOfClipPath\n height={height}\n uuid={uuid}\n imageFactors={hasMultipleImages ? [0.76, 0.8] : [1]}\n />\n )}\n {hasMultipleImages && (\n <SecondImageClipPath\n height={height}\n uuid={uuid}\n shouldShowRoundImage={shouldShowRoundImage}\n />\n )}\n\n {imageElements}\n\n {hasCornerImage && (\n <StyledCornerImage\n $background={imageBackground}\n $shouldPreventBackground={shouldPreventBackground}\n $hasMultipleImages={hasMultipleImages}\n src={cornerImage}\n key=\"corner-image\"\n />\n )}\n {hasCornerElement && <StyledCornerElement>{cornerElement}</StyledCornerElement>}\n </StyledGroupedImage>\n );\n};\n\nGroupedImage.displayName = 'GroupedImage';\n\nexport default GroupedImage;\n"],"mappings":"AAAA,OAAOA,KAAK,MAA2E,OAAO;AAC9F,SACIC,mBAAmB,EACnBC,iBAAiB,EACjBC,kBAAkB,EAClBC,uBAAuB,QACpB,uBAAuB;AAC9B,OAAOC,cAAc,MAAM,6BAA6B;AACxD,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,OAAOC,mBAAmB,MAAM,kCAAkC;AAyClE,MAAMC,YAAmC,GAAGA,CAAC;EACzCC,WAAW;EACXC,MAAM,GAAG,EAAE;EACXC,eAAe;EACfC,MAAM;EACNC,OAAO;EACPC,uBAAuB,GAAG,KAAK;EAC/BC,oBAAoB,GAAG,KAAK;EAC5BC,aAAa;EACbC;AAC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,GACjDQ,cAAc,iBACXlB,KAAA,CAAA6B,aAAA,CAACxB,cAAc;IACXK,MAAM,EAAEA,MAAO;IACfa,IAAI,EAAEA,IAAK;IACXuB,YAAY,EAAEzB,iBAAiB,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;EAAE,CACvD,CACJ,EACAA,iBAAiB,iBACdrB,KAAA,CAAA6B,aAAA,CAACtB,mBAAmB;IAChBG,MAAM,EAAEA,MAAO;IACfa,IAAI,EAAEA,IAAK;IACXR,oBAAoB,EAAEA;EAAqB,CAC9C,CACJ,EAEAS,aAAa,EAEbN,cAAc,iBACXlB,KAAA,CAAA6B,aAAA,CAAC3B,iBAAiB;IACd4B,WAAW,EAAEnB,eAAgB;IAC7BuB,wBAAwB,EAAEpB,uBAAwB;IAClDmB,kBAAkB,EAAEZ,iBAAkB;IACtCM,GAAG,EAAElB,WAAY;IACjB4B,GAAG,EAAC;EAAc,CACrB,CACJ,EACAjB,gBAAgB,iBAAIpB,KAAA,CAAA6B,aAAA,CAAC5B,mBAAmB,QAAEe,aAAmC,CAC9D,CAAC;AAE7B,CAAC;AAEDR,YAAY,CAACuC,WAAW,GAAG,cAAc;AAEzC,eAAevC,YAAY","ignoreList":[]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { keyboardFocusHighlightingRingCss } from '../../utils/keyboardFocusHighlighting.styles';
|
|
3
2
|
export const StyledGroupedImage = styled.div`
|
|
4
3
|
flex: 0 0 auto;
|
|
5
4
|
height: ${({
|
|
@@ -9,14 +8,6 @@ export const StyledGroupedImage = styled.div`
|
|
|
9
8
|
width: ${({
|
|
10
9
|
$height
|
|
11
10
|
}) => $height}px;
|
|
12
|
-
|
|
13
|
-
${({
|
|
14
|
-
$shouldShowKeyboardHighlighting
|
|
15
|
-
}) => $shouldShowKeyboardHighlighting && css`
|
|
16
|
-
&:focus-visible {
|
|
17
|
-
${keyboardFocusHighlightingRingCss}
|
|
18
|
-
}
|
|
19
|
-
`}
|
|
20
11
|
`;
|
|
21
12
|
export const StyledGroupImageElement = styled.div.attrs(({
|
|
22
13
|
$isSecondImage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupedImage.styles.js","names":["styled","css","
|
|
1
|
+
{"version":3,"file":"GroupedImage.styles.js","names":["styled","css","StyledGroupedImage","div","$height","StyledGroupImageElement","attrs","$isSecondImage","$hasMultipleImages","$hasCornerImage","$uuid","clipPath","style","$shouldShowRoundImage","$background","$shouldPreventBackground","theme","StyledCornerImage","img","StyledCornerElement","span"],"sources":["../../../../src/components/grouped-image/GroupedImage.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { CSSProperties } from 'react';\nimport { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledGroupedImageProps = WithTheme<{\n $height: CSSProperties['height'];\n}>;\n\nexport const StyledGroupedImage = styled.div<StyledGroupedImageProps>`\n flex: 0 0 auto;\n height: ${({ $height }) => $height}px;\n position: relative;\n width: ${({ $height }) => $height}px;\n`;\n\ntype StyledImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $isSecondImage?: boolean;\n $shouldPreventBackground?: boolean;\n $shouldShowRoundImage?: boolean;\n $hasCornerImage: boolean;\n $hasMultipleImages: boolean;\n $uuid: string;\n}>;\n\nexport const StyledGroupImageElement = styled.div.attrs<StyledImageProps>(\n ({ $isSecondImage, $hasMultipleImages, $hasCornerImage, $uuid }) => {\n let clipPath: string | undefined;\n if (\n ($isSecondImage && $hasCornerImage) ||\n (!$isSecondImage && !$hasMultipleImages && $hasCornerImage)\n ) {\n clipPath = `url(#care-of-mask--${$uuid})`;\n } else if (!$isSecondImage && $hasMultipleImages) {\n clipPath = `url(#second-image-mask--${$uuid})`;\n }\n\n return {\n style: {\n clipPath,\n },\n };\n },\n)`\n aspect-ratio: 1;\n border-radius: ${({ $shouldShowRoundImage }) => ($shouldShowRoundImage ? '50%' : '0')};\n position: absolute;\n overflow: hidden;\n\n ${({ $hasMultipleImages, $isSecondImage }) => {\n if (!$hasMultipleImages) {\n return css`\n height: 100%;\n `;\n }\n\n if ($isSecondImage) {\n return css`\n height: 80%;\n `;\n }\n\n return css`\n height: 76%;\n `;\n }}\n\n ${({ $isSecondImage }) =>\n $isSecondImage\n ? css`\n bottom: 0;\n right: 0;\n `\n : css`\n top: 0;\n left: 0;\n `}\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n \n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n`;\n\ntype StyledCornerImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $shouldPreventBackground?: boolean;\n $hasMultipleImages: boolean;\n}>;\n\nexport const StyledCornerImage = styled.img<StyledCornerImageProps>`\n aspect-ratio: 1;\n bottom: 0;\n height: ${({ $hasMultipleImages }) => ($hasMultipleImages ? '28%' : '38%')};\n position: absolute;\n right: 0;\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n`;\n\nexport const StyledCornerElement = styled.span`\n height: 18px;\n width: 18px;\n position: absolute;\n bottom: 0;\n right: -5px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > * {\n max-height: 100%;\n max-width: 100%;\n display: block;\n }\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAQ/C,OAAO,MAAMC,kBAAkB,GAAGF,MAAM,CAACG,GAA4B;AACrE;AACA,cAAc,CAAC;EAAEC;AAAQ,CAAC,KAAKA,OAAO;AACtC;AACA,aAAa,CAAC;EAAEA;AAAQ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A;AACA;AACA,CAAC;AAQD,OAAO,MAAMC,iBAAiB,GAAGjB,MAAM,CAACkB,GAA2B;AACnE;AACA;AACA,cAAc,CAAC;EAAEV;AAAmB,CAAC,KAAMA,kBAAkB,GAAG,KAAK,GAAG,KAAM;AAC9E;AACA;AACA;AACA,MAAM,CAAC;EAAEM,WAAW;EAAEC,wBAAwB;EAAEC;AAAM,CAAC,KAC/C,CAACD,wBAAwB,IACzBd,GAAG;AACX,0BAA0Ba,WAAW,IAAI,QAAQE,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,QAAQ;AACrF,yCAAyCA,KAAK,CAAC,SAAS,CAAC;AACzD,SAAS;AACT,CAAC;AAED,OAAO,MAAMG,mBAAmB,GAAGnB,MAAM,CAACoB,IAAI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { StyledHighlightSlider } from './HighlightSlider.styles';
|
|
3
3
|
import HighlightSliderItem from './highlight-slider-item/HighlightSliderItem';
|
|
4
|
-
import { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';
|
|
5
|
-
import { useColorScheme } from '../color-scheme-provider/ColorSchemeProvider';
|
|
6
4
|
const DEFAULT_HIGHLIGHT_SLIDER_COLORS = {
|
|
7
5
|
backgroundColor: '#E0E0E0',
|
|
8
6
|
fillColor: '#808080'
|
|
@@ -12,13 +10,8 @@ const HighlightSlider = ({
|
|
|
12
10
|
colors = DEFAULT_HIGHLIGHT_SLIDER_COLORS,
|
|
13
11
|
onIndexChange,
|
|
14
12
|
currentIndex,
|
|
15
|
-
duration = 10
|
|
16
|
-
shouldEnableKeyboardHighlighting
|
|
13
|
+
duration = 10
|
|
17
14
|
}) => {
|
|
18
|
-
const colorScheme = useColorScheme();
|
|
19
|
-
const isInteractive = typeof onIndexChange === 'function';
|
|
20
|
-
const shouldEnableKeyboardHighlightingEffective = shouldEnableKeyboardHighlighting ?? colorScheme?.shouldEnableKeyboardHighlighting ?? false;
|
|
21
|
-
const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(shouldEnableKeyboardHighlightingEffective && isInteractive);
|
|
22
15
|
const handleFinish = useCallback(index => {
|
|
23
16
|
if (typeof onIndexChange === 'function') {
|
|
24
17
|
onIndexChange(index >= count - 1 ? 0 : index + 1);
|
|
@@ -39,11 +32,8 @@ const HighlightSlider = ({
|
|
|
39
32
|
isActive: currentIndex === index,
|
|
40
33
|
isFinished: currentIndex > index,
|
|
41
34
|
onClick: handleClick,
|
|
42
|
-
onFinish: handleFinish
|
|
43
|
-
|
|
44
|
-
shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting,
|
|
45
|
-
isInteractive: isInteractive
|
|
46
|
-
})), [colors, count, currentIndex, duration, handleClick, handleFinish, shouldEnableKeyboardHighlightingEffective, shouldShowKeyboardHighlighting, isInteractive]);
|
|
35
|
+
onFinish: handleFinish
|
|
36
|
+
})), [colors, count, currentIndex, duration, handleClick, handleFinish]);
|
|
47
37
|
return /*#__PURE__*/React.createElement(StyledHighlightSlider, null, content);
|
|
48
38
|
};
|
|
49
39
|
HighlightSlider.displayName = 'HighlightSlider';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightSlider.js","names":["React","useCallback","useMemo","StyledHighlightSlider","HighlightSliderItem","
|
|
1
|
+
{"version":3,"file":"HighlightSlider.js","names":["React","useCallback","useMemo","StyledHighlightSlider","HighlightSliderItem","DEFAULT_HIGHLIGHT_SLIDER_COLORS","backgroundColor","fillColor","HighlightSlider","count","colors","onIndexChange","currentIndex","duration","handleFinish","index","handleClick","content","Array","from","length","map","value","createElement","key","isActive","isFinished","onClick","onFinish","displayName"],"sources":["../../../../src/components/highlight-slider/HighlightSlider.tsx"],"sourcesContent":["import React, { FC, useCallback, useMemo } from 'react';\nimport { StyledHighlightSlider } from './HighlightSlider.styles';\nimport HighlightSliderItem, {\n HighlightSliderItemColors,\n} from './highlight-slider-item/HighlightSliderItem';\n\nconst DEFAULT_HIGHLIGHT_SLIDER_COLORS: HighlightSliderItemColors = {\n backgroundColor: '#E0E0E0',\n fillColor: '#808080',\n};\n\nexport type HighlightSliderProps = {\n /**\n * The Colors of the slider.\n */\n colors?: HighlightSliderItemColors;\n /**\n * The total number of sections, that should be displayed.\n */\n count: number;\n /**\n * The current index.\n */\n currentIndex: number;\n /**\n * The duration of the animation of a single item in seconds.\n */\n duration?: number;\n /**\n * Function to be executed if the index has changed.\n */\n onIndexChange?: (index: number) => void;\n};\n\nconst HighlightSlider: FC<HighlightSliderProps> = ({\n count,\n colors = DEFAULT_HIGHLIGHT_SLIDER_COLORS,\n onIndexChange,\n currentIndex,\n duration = 10,\n}) => {\n const handleFinish = useCallback(\n (index: number) => {\n if (typeof onIndexChange === 'function') {\n onIndexChange(index >= count - 1 ? 0 : index + 1);\n }\n },\n [count, onIndexChange],\n );\n\n const handleClick = useCallback(\n (index: number) => {\n if (typeof onIndexChange === 'function') {\n onIndexChange(index);\n }\n },\n [onIndexChange],\n );\n\n const content = useMemo(\n () =>\n Array.from({ length: count }).map((value, index) => (\n <HighlightSliderItem\n key={`highlight-slider-item--${value as number}`}\n index={index}\n duration={duration}\n colors={colors}\n isActive={currentIndex === index}\n isFinished={currentIndex > index}\n onClick={handleClick}\n onFinish={handleFinish}\n />\n )),\n [colors, count, currentIndex, duration, handleClick, handleFinish],\n );\n\n return <StyledHighlightSlider>{content}</StyledHighlightSlider>;\n};\n\nHighlightSlider.displayName = 'HighlightSlider';\n\nexport default HighlightSlider;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACvD,SAASC,qBAAqB,QAAQ,0BAA0B;AAChE,OAAOC,mBAAmB,MAEnB,6CAA6C;AAEpD,MAAMC,+BAA0D,GAAG;EAC/DC,eAAe,EAAE,SA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AAC;AACnE,CAAC;AAEDT,eAAe,CAACqB,WAAW,GAAG,iBAAiB;AAE/C,eAAerB,eAAe","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { StyledHighlightSliderItem, StyledHighlightSliderItemBackground, StyledHighlightSliderItemProgress } from './HighlightSliderItem.styles';
|
|
3
3
|
import { StyledProgressBarProgressWrapper } from '../../progress-bar/ProgressBar.styles';
|
|
4
4
|
import { useUuid } from '../../../hooks/uuid';
|
|
@@ -9,28 +9,11 @@ const HighlightSliderItem = ({
|
|
|
9
9
|
onFinish,
|
|
10
10
|
index,
|
|
11
11
|
onClick,
|
|
12
|
-
duration
|
|
13
|
-
isInteractive,
|
|
14
|
-
shouldEnableKeyboardHighlighting,
|
|
15
|
-
shouldShowKeyboardHighlighting = false
|
|
12
|
+
duration
|
|
16
13
|
}) => {
|
|
17
14
|
const uuid = useUuid();
|
|
18
|
-
const isKeyboardFocusable = isInteractive && shouldEnableKeyboardHighlighting;
|
|
19
|
-
const handleKeyDown = useCallback(event => {
|
|
20
|
-
if (!isInteractive) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
24
|
-
event.preventDefault();
|
|
25
|
-
onClick(index);
|
|
26
|
-
}
|
|
27
|
-
}, [index, isInteractive, onClick]);
|
|
28
15
|
return /*#__PURE__*/React.createElement(StyledHighlightSliderItem, {
|
|
29
|
-
onClick:
|
|
30
|
-
onKeyDown: isKeyboardFocusable ? handleKeyDown : undefined,
|
|
31
|
-
tabIndex: isKeyboardFocusable ? 0 : -1,
|
|
32
|
-
role: isInteractive ? 'button' : undefined,
|
|
33
|
-
$shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting
|
|
16
|
+
onClick: () => onClick(index)
|
|
34
17
|
}, /*#__PURE__*/React.createElement(StyledProgressBarProgressWrapper, null, isActive && /*#__PURE__*/React.createElement(StyledHighlightSliderItemProgress, {
|
|
35
18
|
key: `highlight-slider-item-active--${uuid}`,
|
|
36
19
|
initial: {
|
package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightSliderItem.js","names":["React","
|
|
1
|
+
{"version":3,"file":"HighlightSliderItem.js","names":["React","StyledHighlightSliderItem","StyledHighlightSliderItemBackground","StyledHighlightSliderItemProgress","StyledProgressBarProgressWrapper","useUuid","HighlightSliderItem","colors","isActive","isFinished","onFinish","index","onClick","duration","uuid","createElement","key","initial","width","left","animate","exit","onAnimationComplete","$backgroundColor","fillColor","transition","ease","style","backgroundColor","displayName"],"sources":["../../../../../src/components/highlight-slider/highlight-slider-item/HighlightSliderItem.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n StyledHighlightSliderItem,\n StyledHighlightSliderItemBackground,\n StyledHighlightSliderItemProgress,\n} from './HighlightSliderItem.styles';\nimport { StyledProgressBarProgressWrapper } from '../../progress-bar/ProgressBar.styles';\nimport { useUuid } from '../../../hooks/uuid';\n\nexport interface HighlightSliderItemColors {\n backgroundColor: string;\n fillColor: string;\n}\n\nexport type HighlightSliderItemProps = {\n index: number;\n isActive: boolean;\n isFinished: boolean;\n onClick: (index: number) => void;\n onFinish: (index: number) => void;\n duration: number;\n colors: HighlightSliderItemColors;\n};\n\nconst HighlightSliderItem: FC<HighlightSliderItemProps> = ({\n colors,\n isActive,\n isFinished,\n onFinish,\n index,\n onClick,\n duration,\n}) => {\n const uuid = useUuid();\n\n return (\n <StyledHighlightSliderItem onClick={() => onClick(index)}>\n <StyledProgressBarProgressWrapper>\n {isActive && (\n <StyledHighlightSliderItemProgress\n key={`highlight-slider-item-active--${uuid}`}\n initial={{ width: '100%', left: '-100%' }}\n animate={{ width: '100%', left: '0%' }}\n exit={{ width: '100%', left: '0%' }}\n onAnimationComplete={() => onFinish(index)}\n $backgroundColor={colors.fillColor}\n transition={{\n ease: 'linear',\n duration,\n }}\n />\n )}\n {isFinished && (\n <StyledHighlightSliderItemProgress\n key={`highlight-slider-item-finished--${uuid}`}\n style={{ width: '100%', left: '0%' }}\n $backgroundColor={colors.fillColor}\n />\n )}\n <StyledHighlightSliderItemBackground $backgroundColor={colors.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n </StyledHighlightSliderItem>\n );\n};\n\nHighlightSliderItem.displayName = 'HighlightSliderItem';\n\nexport default HighlightSliderItem;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SACIC,yBAAyB,EACzBC,mCAAmC,EACnCC,iCAAiC,QAC9B,8BAA8B;AACrC,SAASC,gCAAgC,QAAQ,uCAAuC;AACxF,SAASC,OAAO,QAAQ,qBAAqB;AAiB7C,MAAMC,mBAAiD,GAAGA,CAAC;EACvDC,MAAM;EACNC,QAAQ;EACRC,UAAU;EACVC,QAAQ;EACRC,KAAK;EACLC,OAAO;EACPC;AACJ,CAAC,KAAK;EACF,MAAMC,IAAI,GAAGT,OAAO,CAAC,CAAC;EAEtB,oBACIL,KAAA,CAAAe,aAAA,CAACd,yBAAyB;IAACW,OAAO,EAAEA,CAAA,KAAMA,OAAO,CAACD,KAAK;EAAE,gBACrDX,KAAA,CAAAe,aAAA,CAACX,gCAAgC,QAC5BI,QAAQ,iBACLR,KAAA,CAAAe,aAAA,CAACZ,iCAAiC;IAC9Ba,GAAG,EAAE,iCAAiCF,IAAI,EAAG;IAC7CG,OAAO,EAAE;MAAEC,KAAK,EAAE,MAAM;MAAEC,IAAI,EAAE;IAAQ,CAAE;IAC1CC,OAAO,EAAE;MAAEF,KAAK,EAAE,MAAM;MAAEC,IAAI,EAAE;IAAK,CAAE;IACvCE,IAAI,EAAE;MAAEH,KAAK,EAAE,MAAM;MAAEC,IAAI,EAAE;IAAK,CAAE;IACpCG,mBAAmB,EAAEA,CAAA,KAAMZ,QAAQ,CAACC,KAAK,CAAE;IAC3CY,gBAAgB,EAAEhB,MAAM,CAACiB,SAAU;IACnCC,UAAU,EAAE;MACRC,IAAI,EAAE,QAAQ;MACdb;IACJ;EAAE,CACL,CACJ,EACAJ,UAAU,iBACPT,KAAA,CAAAe,aAAA,CAACZ,iCAAiC;IAC9Ba,GAAG,EAAE,mCAAmCF,IAAI,EAAG;IAC/Ca,KAAK,EAAE;MAAET,KAAK,EAAE,MAAM;MAAEC,IAAI,EAAE;IAAK,CAAE;IACrCI,gBAAgB,EAAEhB,MAAM,CAACiB;EAAU,CACtC,CACJ,eACDxB,KAAA,CAAAe,aAAA,CAACb,mCAAmC;IAACqB,gBAAgB,EAAEhB,MAAM,CAACqB;EAAgB,CAAE,CAClD,CACX,CAAC;AAEpC,CAAC;AAEDtB,mBAAmB,CAACuB,WAAW,GAAG,qBAAqB;AAEvD,eAAevB,mBAAmB","ignoreList":[]}
|
package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import styled
|
|
1
|
+
import styled from 'styled-components';
|
|
2
2
|
import { motion } from 'motion/react';
|
|
3
|
-
import { keyboardFocusHighlightingRingCss } from '../../../utils/keyboardFocusHighlighting.styles';
|
|
4
3
|
export const StyledHighlightSliderItem = styled.div`
|
|
5
4
|
overflow: hidden;
|
|
6
5
|
position: relative;
|
|
@@ -8,14 +7,6 @@ export const StyledHighlightSliderItem = styled.div`
|
|
|
8
7
|
height: 4px;
|
|
9
8
|
border-radius: 4px;
|
|
10
9
|
cursor: pointer;
|
|
11
|
-
|
|
12
|
-
${({
|
|
13
|
-
$shouldShowKeyboardHighlighting
|
|
14
|
-
}) => $shouldShowKeyboardHighlighting && css`
|
|
15
|
-
&:focus-visible {
|
|
16
|
-
${keyboardFocusHighlightingRingCss}
|
|
17
|
-
}
|
|
18
|
-
`}
|
|
19
10
|
`;
|
|
20
11
|
export const StyledHighlightSliderItemProgress = styled(motion.div)`
|
|
21
12
|
height: 4px;
|
package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightSliderItem.styles.js","names":["styled","
|
|
1
|
+
{"version":3,"file":"HighlightSliderItem.styles.js","names":["styled","motion","StyledHighlightSliderItem","div","StyledHighlightSliderItemProgress","$backgroundColor","StyledHighlightSliderItemBackground"],"sources":["../../../../../src/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { motion } from 'motion/react';\nimport { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledHighlightSliderItem = styled.div`\n overflow: hidden;\n position: relative;\n width: 100%;\n height: 4px;\n border-radius: 4px;\n cursor: pointer;\n`;\ntype StyledHighlightSliderItemProgressProps = WithTheme<{ $backgroundColor: string }>;\n\nexport const StyledHighlightSliderItemProgress = styled(\n motion.div,\n)<StyledHighlightSliderItemProgressProps>`\n height: 4px;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n background-color: ${({ $backgroundColor }: StyledHighlightSliderItemProgressProps) =>\n $backgroundColor};\n`;\n\ntype StyledHighlightSliderItemBackgroundProps = WithTheme<{ $backgroundColor: string }>;\n\nexport const StyledHighlightSliderItemBackground = styled(\n motion.div,\n)<StyledHighlightSliderItemBackgroundProps>`\n height: 4px;\n width: 100%;\n border-radius: 2px;\n background-color: ${({ $backgroundColor }: StyledHighlightSliderItemBackgroundProps) =>\n $backgroundColor};\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AACtC,SAASC,MAAM,QAAQ,cAAc;AAGrC,OAAO,MAAMC,yBAAyB,GAAGF,MAAM,CAACG,GAAG;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAGD,OAAO,MAAMC,iCAAiC,GAAGJ,MAAM,CACnDC,MAAM,CAACE,GACX,CAAyC;AACzC;AACA;AACA;AACA;AACA;AACA,wBAAwB,CAAC;EAAEE;AAAyD,CAAC,KAC7EA,gBAAgB;AACxB,CAAC;AAID,OAAO,MAAMC,mCAAmC,GAAGN,MAAM,CACrDC,MAAM,CAACE,GACX,CAA2C;AAC3C;AACA;AACA;AACA,wBAAwB,CAAC;EAAEE;AAA2D,CAAC,KAC/EA,gBAAgB;AACxB,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { getStackSizeFactor } from '../../utils/icon';
|
|
4
|
-
import {
|
|
5
|
-
import { useColorScheme } from '../color-scheme-provider/ColorSchemeProvider';
|
|
6
|
-
import { StyledIcon as StyledIconElement, StyledIconWrapper } from './Icon.styles';
|
|
4
|
+
import { StyledIcon, StyledIconWrapper } from './Icon.styles';
|
|
7
5
|
import { useTheme } from 'styled-components';
|
|
8
6
|
const Icon = ({
|
|
9
7
|
className,
|
|
@@ -15,14 +13,9 @@ const Icon = ({
|
|
|
15
13
|
onMouseDown,
|
|
16
14
|
tabIndex,
|
|
17
15
|
size = 15,
|
|
18
|
-
shouldStopPropagation
|
|
19
|
-
shouldEnableKeyboardHighlighting
|
|
16
|
+
shouldStopPropagation
|
|
20
17
|
}) => {
|
|
21
18
|
const theme = useTheme();
|
|
22
|
-
const colorScheme = useColorScheme();
|
|
23
|
-
const shouldEnableKeyboardHighlightingEffective = shouldEnableKeyboardHighlighting ?? colorScheme?.shouldEnableKeyboardHighlighting ?? false;
|
|
24
|
-
const isClickable = typeof onClick === 'function' && !isDisabled;
|
|
25
|
-
const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(shouldEnableKeyboardHighlightingEffective && isClickable);
|
|
26
19
|
const handleClick = event => {
|
|
27
20
|
if (shouldStopPropagation) {
|
|
28
21
|
event.stopPropagation();
|
|
@@ -39,15 +32,6 @@ const Icon = ({
|
|
|
39
32
|
onDoubleClick(event);
|
|
40
33
|
}
|
|
41
34
|
};
|
|
42
|
-
const handleKeyDown = event => {
|
|
43
|
-
if (!isClickable) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
handleClick(event);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
35
|
let maxStackSizeFactor = 1;
|
|
52
36
|
icons.forEach(icon => {
|
|
53
37
|
const stackSizeFactor = getStackSizeFactor(icon);
|
|
@@ -58,17 +42,14 @@ const Icon = ({
|
|
|
58
42
|
const shouldUseStackedIcon = icons.length > 1;
|
|
59
43
|
const wrapperClasses = clsx('beta-chayns-icon', shouldUseStackedIcon ? 'fa-stack' : '', className);
|
|
60
44
|
return /*#__PURE__*/React.createElement(StyledIconWrapper, {
|
|
61
|
-
tabIndex:
|
|
45
|
+
tabIndex: tabIndex,
|
|
62
46
|
className: wrapperClasses,
|
|
63
47
|
$isDisabled: isDisabled,
|
|
64
|
-
onClick:
|
|
65
|
-
$isOnClick:
|
|
48
|
+
onClick: typeof onClick === 'function' && !isDisabled ? handleClick : undefined,
|
|
49
|
+
$isOnClick: typeof onClick === 'function' && !isDisabled,
|
|
66
50
|
onDoubleClick: typeof onDoubleClick === 'function' && !isDisabled ? handleDoubleClick : undefined,
|
|
67
51
|
onMouseDown: typeof onMouseDown === 'function' && !isDisabled ? onMouseDown : undefined,
|
|
68
|
-
|
|
69
|
-
$shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting,
|
|
70
|
-
$size: size,
|
|
71
|
-
role: isClickable ? 'button' : undefined
|
|
52
|
+
$size: size
|
|
72
53
|
}, icons.map(icon => {
|
|
73
54
|
const stackSizeFactor = getStackSizeFactor(icon);
|
|
74
55
|
const iconStyle = `${theme?.iconStyle ?? 'fa-regular'} `;
|
|
@@ -76,7 +57,7 @@ const Icon = ({
|
|
|
76
57
|
const iconClasses = clsx(themedIcon, {
|
|
77
58
|
'fa-stack-1x': shouldUseStackedIcon && stackSizeFactor === undefined
|
|
78
59
|
});
|
|
79
|
-
return /*#__PURE__*/React.createElement(
|
|
60
|
+
return /*#__PURE__*/React.createElement(StyledIcon, {
|
|
80
61
|
className: iconClasses,
|
|
81
62
|
$color: icon.includes('fa-inverse') ? 'white' : color,
|
|
82
63
|
$fontSize: (stackSizeFactor || 1) / maxStackSizeFactor * size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","names":["clsx","React","getStackSizeFactor","useKeyboardFocusHighlighting","useColorScheme","StyledIcon","StyledIconElement","StyledIconWrapper","useTheme","Icon","className","color","icons","isDisabled","onClick","onDoubleClick","onMouseDown","tabIndex","size","shouldStopPropagation","shouldEnableKeyboardHighlighting","theme","colorScheme","shouldEnableKeyboardHighlightingEffective","isClickable","shouldShowKeyboardHighlighting","handleClick","event","stopPropagation","handleDoubleClick","handleKeyDown","key","preventDefault","maxStackSizeFactor","forEach","icon","stackSizeFactor","shouldUseStackedIcon","length","wrapperClasses","createElement","$isDisabled","undefined","$isOnClick","onKeyDown","$shouldShowKeyboardHighlighting","$size","role","map","iconStyle","themedIcon","replace","iconClasses","$color","includes","$fontSize","$isStacked","displayName"],"sources":["../../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React, { FC, KeyboardEventHandler, MouseEventHandler } from 'react';\nimport { getStackSizeFactor } from '../../utils/icon';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\nimport { useColorScheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { StyledIcon as StyledIconElement, StyledIconWrapper } from './Icon.styles';\nimport { useTheme } from 'styled-components';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport type IconProps = {\n /**\n * Additional class name for the icon wrapper element.\n * @description\n * This class name is applied to the wrapper element that contains the icon. It can be used to\n * style the icon wrapper element.\n * @example\n * <Icon className=\"my-custom-class\" icons={['fa-user']} />\n * @optional\n */\n className?: string;\n /**\n * The color of the icon.\n * @description\n * This property can be used to set the color of the icon. The color is only used for icons that\n * don't have a predefined color (e.g., 'fa-inverse' icons will always be white). If no color is\n * specified, the icon color of the theme or the text color will be used.\n * @example\n * <Icon color=\"red\" icons={['fa-user']} />\n * @optional\n */\n color?: string;\n /**\n * The icon(s) to be displayed.\n * @description\n * This property can be used to set the icon(s) to be displayed. The icon(s) must be specified as\n * an array of strings. Each string must be a valid icon name.\n * @example\n * <Icon icons={['fa-user']} />\n * <Icon icons={['fa fa-circle fa-stack-2x', 'fa fa-french-fries fa-inverse']} />\n */\n icons: string[];\n /**\n * Whether the icon should be disabled.\n * @description\n * This property can be used to disable the icon. When the icon is disabled, it will not be\n * clickable, and it will not emit any events.\n * @example\n * <Icon icons={['fa-user']} isDisabled />\n * @optional\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when the icon is clicked.\n * @description\n * This function is executed when the icon is clicked. It can be used to handle the click event.\n * @example\n * <Icon icons={['fa-user']} onClick={() => console.log('Icon clicked')} />\n * @optional\n */\n onClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is double-clicked.\n * @description\n * This function is executed when the icon is double-clicked. It can be used to handle the\n * double-click event.\n * @example\n * <Icon icons={['fa-user']} onDoubleClick={() => console.log('Icon double-clicked')} />\n * @optional\n */\n onDoubleClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is pressed.\n * @description\n * This function is executed when the icon is pressed. It can be used to handle the mouse down event.\n * @example\n * <Icon icons={['fa-user']} onMouseDown={() => console.log('Icon pressed')} />\n * @optional\n */\n onMouseDown?: MouseEventHandler<HTMLSpanElement>;\n /**\n * The size of the icon.\n * @description\n * This property can be used to set the size of the icon. The size must be specified as a number\n * in pixels.\n * @default 15\n * @example\n * <Icon icons={['fa-user']} size={20} />\n * @optional\n */\n size?: number;\n /**\n * Stops event propagation on click.\n * @description\n * This property can be used to prevent the icon from propagating the click event to its parent\n * elements.\n * @example\n * <Icon icons={['fa-user']} shouldStopPropagation />\n * @optional\n */\n shouldStopPropagation?: boolean;\n /**\n * Optional tab index for the icon.\n */\n tabIndex?: number;\n /**\n * Enables keyboard-only focus highlighting for clickable icons.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n\nconst Icon: FC<IconProps> = ({\n className,\n color,\n icons,\n isDisabled,\n onClick,\n onDoubleClick,\n onMouseDown,\n tabIndex,\n size = 15,\n shouldStopPropagation,\n shouldEnableKeyboardHighlighting,\n}) => {\n const theme = useTheme() as Theme;\n const colorScheme = useColorScheme();\n const shouldEnableKeyboardHighlightingEffective =\n shouldEnableKeyboardHighlighting ?? colorScheme?.shouldEnableKeyboardHighlighting ?? false;\n\n const isClickable = typeof onClick === 'function' && !isDisabled;\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlightingEffective && isClickable,\n );\n\n const handleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n const handleDoubleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onDoubleClick === 'function') {\n onDoubleClick(event);\n }\n };\n\n const handleKeyDown: KeyboardEventHandler<HTMLSpanElement> = (event) => {\n if (!isClickable) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClick(event as unknown as React.MouseEvent<HTMLSpanElement>);\n }\n };\n\n let maxStackSizeFactor = 1;\n\n icons.forEach((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n if (stackSizeFactor && stackSizeFactor > maxStackSizeFactor) {\n maxStackSizeFactor = stackSizeFactor;\n }\n });\n\n const shouldUseStackedIcon = icons.length > 1;\n\n const wrapperClasses = clsx(\n 'beta-chayns-icon',\n shouldUseStackedIcon ? 'fa-stack' : '',\n className,\n );\n\n return (\n <StyledIconWrapper\n tabIndex={\n shouldEnableKeyboardHighlightingEffective && isClickable\n ? (tabIndex ?? 0)\n : tabIndex\n }\n className={wrapperClasses}\n $isDisabled={isDisabled}\n onClick={isClickable ? handleClick : undefined}\n $isOnClick={isClickable}\n onDoubleClick={\n typeof onDoubleClick === 'function' && !isDisabled ? handleDoubleClick : undefined\n }\n onMouseDown={typeof onMouseDown === 'function' && !isDisabled ? onMouseDown : undefined}\n onKeyDown={shouldEnableKeyboardHighlightingEffective ? handleKeyDown : undefined}\n $shouldShowKeyboardHighlighting={shouldShowKeyboardHighlighting}\n $size={size}\n role={isClickable ? 'button' : undefined}\n >\n {icons.map((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n const iconStyle = `${(theme?.iconStyle as string) ?? 'fa-regular'} `;\n const themedIcon = icon?.replace(/^fa\\s/, iconStyle);\n\n const iconClasses = clsx(themedIcon, {\n 'fa-stack-1x': shouldUseStackedIcon && stackSizeFactor === undefined,\n });\n\n return (\n <StyledIconElement\n className={iconClasses}\n $color={icon.includes('fa-inverse') ? 'white' : color}\n $fontSize={((stackSizeFactor || 1) / maxStackSizeFactor) * size}\n $isStacked={shouldUseStackedIcon}\n key={icon}\n $size={size}\n />\n );\n })}\n </StyledIconWrapper>\n );\n};\n\nIcon.displayName = 'Icon';\n\nexport default Icon;\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AACvB,OAAOC,KAAK,MAAuD,OAAO;AAC1E,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,SAASC,4BAA4B,QAAQ,0CAA0C;AACvF,SAASC,cAAc,QAAQ,8CAA8C;AAC7E,SAASC,UAAU,IAAIC,iBAAiB,EAAEC,iBAAiB,QAAQ,eAAe;AAClF,SAASC,QAAQ,QAAQ,mBAAmB;AAwG5C,MAAMC,IAAmB,GAAGA,CAAC;EACzBC,SAAS;EACTC,KAAK;EACLC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPC,aAAa;EACbC,WAAW;EACXC,QAAQ;EACRC,IAAI,GAAG,EAAE;EACTC,qBAAqB;EACrBC;AACJ,CAAC,KAAK;EACF,MAAMC,KAAK,GAA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,EAAElB,IAAI,CAACmB,QAAQ,CAAC,YAAY,CAAC,GAAG,OAAO,GAAG3C,KAAM;MACtD4C,SAAS,EAAG,CAACnB,eAAe,IAAI,CAAC,IAAIH,kBAAkB,GAAIf,IAAK;MAChEsC,UAAU,EAAEnB,oBAAqB;MACjCN,GAAG,EAAEI,IAAK;MACVW,KAAK,EAAE5B;IAAK,CACf,CAAC;EAEV,CAAC,CACc,CAAC;AAE5B,CAAC;AAEDT,IAAI,CAACgD,WAAW,GAAG,MAAM;AAEzB,eAAehD,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Icon.js","names":["clsx","React","getStackSizeFactor","StyledIcon","StyledIconWrapper","useTheme","Icon","className","color","icons","isDisabled","onClick","onDoubleClick","onMouseDown","tabIndex","size","shouldStopPropagation","theme","handleClick","event","stopPropagation","handleDoubleClick","maxStackSizeFactor","forEach","icon","stackSizeFactor","shouldUseStackedIcon","length","wrapperClasses","createElement","$isDisabled","undefined","$isOnClick","$size","map","iconStyle","themedIcon","replace","iconClasses","$color","includes","$fontSize","$isStacked","key","displayName"],"sources":["../../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React, { FC, MouseEventHandler } from 'react';\nimport { getStackSizeFactor } from '../../utils/icon';\nimport { StyledIcon, StyledIconWrapper } from './Icon.styles';\nimport { useTheme } from 'styled-components';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport type IconProps = {\n /**\n * Additional class name for the icon wrapper element.\n * @description\n * This class name is applied to the wrapper element that contains the icon. It can be used to\n * style the icon wrapper element.\n * @example\n * <Icon className=\"my-custom-class\" icons={['fa-user']} />\n * @optional\n */\n className?: string;\n /**\n * The color of the icon.\n * @description\n * This property can be used to set the color of the icon. The color is only used for icons that\n * don't have a predefined color (e.g., 'fa-inverse' icons will always be white). If no color is\n * specified, the icon color of the theme or the text color will be used.\n * @example\n * <Icon color=\"red\" icons={['fa-user']} />\n * @optional\n */\n color?: string;\n /**\n * The icon(s) to be displayed.\n * @description\n * This property can be used to set the icon(s) to be displayed. The icon(s) must be specified as\n * an array of strings. Each string must be a valid icon name.\n * @example\n * <Icon icons={['fa-user']} />\n * <Icon icons={['fa fa-circle fa-stack-2x', 'fa fa-french-fries fa-inverse']} />\n */\n icons: string[];\n /**\n * Whether the icon should be disabled.\n * @description\n * This property can be used to disable the icon. When the icon is disabled, it will not be\n * clickable, and it will not emit any events.\n * @example\n * <Icon icons={['fa-user']} isDisabled />\n * @optional\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when the icon is clicked.\n * @description\n * This function is executed when the icon is clicked. It can be used to handle the click event.\n * @example\n * <Icon icons={['fa-user']} onClick={() => console.log('Icon clicked')} />\n * @optional\n */\n onClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is double-clicked.\n * @description\n * This function is executed when the icon is double-clicked. It can be used to handle the\n * double-click event.\n * @example\n * <Icon icons={['fa-user']} onDoubleClick={() => console.log('Icon double-clicked')} />\n * @optional\n */\n onDoubleClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is pressed.\n * @description\n * This function is executed when the icon is pressed. It can be used to handle the mouse down event.\n * @example\n * <Icon icons={['fa-user']} onMouseDown={() => console.log('Icon pressed')} />\n * @optional\n */\n onMouseDown?: MouseEventHandler<HTMLSpanElement>;\n /**\n * The size of the icon.\n * @description\n * This property can be used to set the size of the icon. The size must be specified as a number\n * in pixels.\n * @default 15\n * @example\n * <Icon icons={['fa-user']} size={20} />\n * @optional\n */\n size?: number;\n /**\n * Stops event propagation on click.\n * @description\n * This property can be used to prevent the icon from propagating the click event to its parent\n * elements.\n * @example\n * <Icon icons={['fa-user']} shouldStopPropagation />\n * @optional\n */\n shouldStopPropagation?: boolean;\n /**\n * Optional tab index for the icon.\n */\n tabIndex?: number;\n};\n\nconst Icon: FC<IconProps> = ({\n className,\n color,\n icons,\n isDisabled,\n onClick,\n onDoubleClick,\n onMouseDown,\n tabIndex,\n size = 15,\n shouldStopPropagation,\n}) => {\n const theme = useTheme() as Theme;\n\n const handleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n const handleDoubleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onDoubleClick === 'function') {\n onDoubleClick(event);\n }\n };\n\n let maxStackSizeFactor = 1;\n\n icons.forEach((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n if (stackSizeFactor && stackSizeFactor > maxStackSizeFactor) {\n maxStackSizeFactor = stackSizeFactor;\n }\n });\n\n const shouldUseStackedIcon = icons.length > 1;\n\n const wrapperClasses = clsx(\n 'beta-chayns-icon',\n shouldUseStackedIcon ? 'fa-stack' : '',\n className,\n );\n\n return (\n <StyledIconWrapper\n tabIndex={tabIndex}\n className={wrapperClasses}\n $isDisabled={isDisabled}\n onClick={typeof onClick === 'function' && !isDisabled ? handleClick : undefined}\n $isOnClick={typeof onClick === 'function' && !isDisabled}\n onDoubleClick={\n typeof onDoubleClick === 'function' && !isDisabled ? handleDoubleClick : undefined\n }\n onMouseDown={typeof onMouseDown === 'function' && !isDisabled ? onMouseDown : undefined}\n $size={size}\n >\n {icons.map((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n const iconStyle = `${(theme?.iconStyle as string) ?? 'fa-regular'} `;\n const themedIcon = icon?.replace(/^fa\\s/, iconStyle);\n\n const iconClasses = clsx(themedIcon, {\n 'fa-stack-1x': shouldUseStackedIcon && stackSizeFactor === undefined,\n });\n\n return (\n <StyledIcon\n className={iconClasses}\n $color={icon.includes('fa-inverse') ? 'white' : color}\n $fontSize={((stackSizeFactor || 1) / maxStackSizeFactor) * size}\n $isStacked={shouldUseStackedIcon}\n key={icon}\n $size={size}\n />\n );\n })}\n </StyledIconWrapper>\n );\n};\n\nIcon.displayName = 'Icon';\n\n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CAAC,CACc,CAAC;AAE5B,CAAC;AAEDT,IAAI,CAACsC,WAAW,GAAG,MAAM;AAEzB,eAAetC,IAAI","ignoreList":[]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { keyboardFocusHighlightingCircleRingCss } from '../../utils/keyboardFocusHighlighting.styles';
|
|
3
2
|
export const StyledIconWrapper = styled.span`
|
|
4
3
|
align-items: center;
|
|
5
4
|
cursor: ${({
|
|
@@ -20,28 +19,6 @@ export const StyledIconWrapper = styled.span`
|
|
|
20
19
|
$size
|
|
21
20
|
}) => `${$size}px`};
|
|
22
21
|
|
|
23
|
-
${({
|
|
24
|
-
$shouldShowKeyboardHighlighting,
|
|
25
|
-
$size
|
|
26
|
-
}) => $shouldShowKeyboardHighlighting && css`
|
|
27
|
-
&:focus-visible {
|
|
28
|
-
outline: none;
|
|
29
|
-
color: inherit;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&:focus-visible::after {
|
|
33
|
-
${keyboardFocusHighlightingCircleRingCss};
|
|
34
|
-
content: '';
|
|
35
|
-
position: absolute;
|
|
36
|
-
top: 50%;
|
|
37
|
-
left: 50%;
|
|
38
|
-
width: ${$size + 14}px;
|
|
39
|
-
height: ${$size + 14}px;
|
|
40
|
-
transform: translate(-50%, -50%);
|
|
41
|
-
pointer-events: none;
|
|
42
|
-
}
|
|
43
|
-
`}
|
|
44
|
-
|
|
45
22
|
// To insure that stacked icons have the same size as normal icons.
|
|
46
23
|
&&.fa-stack {
|
|
47
24
|
height: fit-content;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.styles.js","names":["styled","css","
|
|
1
|
+
{"version":3,"file":"Icon.styles.js","names":["styled","css","StyledIconWrapper","span","$isDisabled","$isOnClick","$size","StyledIcon","i","$color","theme","iconColor","text","$isStacked","undefined","$fontSize","StyledUnicodeIcon","headline","$icon","iconStyle"],"sources":["../../../../src/components/icon/Icon.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledIconWrapperProps = {\n $isDisabled?: boolean;\n $isOnClick: boolean;\n $size: number;\n};\n\nexport const StyledIconWrapper = styled.span<StyledIconWrapperProps>`\n align-items: center;\n cursor: ${({ $isDisabled, $isOnClick }) =>\n $isOnClick && !$isDisabled ? 'pointer' : 'inherit'};\n display: inline-flex;\n min-height: ${({ $size }) => `${$size}px`};\n justify-content: center;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n position: relative;\n transition: opacity 0.3s ease;\n min-width: ${({ $size }) => `${$size}px`};\n\n // To insure that stacked icons have the same size as normal icons.\n &&.fa-stack {\n height: fit-content;\n width: fit-content;\n line-height: ${({ $size }) => $size}px;\n }\n`;\n\ntype StyledIconProps = WithTheme<{\n $fontSize: number;\n $isStacked?: boolean;\n $color?: string;\n $size: number;\n}>;\n\nexport const StyledIcon = styled.i<StyledIconProps>`\n color: ${({ $color, theme }: StyledIconProps) => $color || theme.iconColor || theme.text};\n display: ${({ $isStacked }) => ($isStacked ? undefined : 'inline-flex')};\n font-size: ${({ $fontSize }) => `${$fontSize}px`};\n\n ${({ $fontSize, $size }) =>\n $fontSize !== $size &&\n css`\n top: 50%;\n transform: translateY(-50%);\n `}\n`;\n\ntype StyledUnicodeIconProps = WithTheme<{ $icon: string }>;\n\nexport const StyledUnicodeIcon = styled.i<StyledUnicodeIconProps>`\n align-items: center;\n justify-content: center;\n display: flex;\n color: ${({ theme }: StyledUnicodeIconProps) => theme.iconColor || theme.headline};\n\n &:before {\n content: ${({ $icon }) => `\"\\\\${$icon}\" !important`};\n }\n &:after {\n content: ${({ theme, $icon }) => {\n if (theme.iconStyle === 'fa-duotone') {\n return `\"\\\\${$icon}\" !important`;\n }\n return '';\n }};\n }\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAS/C,OAAO,MAAMC,iBAA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S,KAAK,YAAY,EAAE;IAClC,OAAO,MAAMD,KAAK,cAAc;EACpC;EACA,OAAO,EAAE;AACb,CAAC;AACT;AACA,CAAC","ignoreList":[]}
|
|
@@ -7,7 +7,6 @@ import { StyledInput, StyledInputContent, StyledInputContentWrapper, StyledInput
|
|
|
7
7
|
import { ContentCardType } from '../../types/contentCard';
|
|
8
8
|
import { useCursorRepaint } from '../../hooks/resize';
|
|
9
9
|
import Tooltip from '../tooltip/Tooltip';
|
|
10
|
-
import { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';
|
|
11
10
|
export let InputSize = /*#__PURE__*/function (InputSize) {
|
|
12
11
|
InputSize["Small"] = "small";
|
|
13
12
|
InputSize["Medium"] = "medium";
|
|
@@ -38,8 +37,7 @@ const Input = /*#__PURE__*/forwardRef(({
|
|
|
38
37
|
shouldPreventPlaceholderAnimation = false,
|
|
39
38
|
id,
|
|
40
39
|
shouldShowTransparentBackground = false,
|
|
41
|
-
autoComplete
|
|
42
|
-
shouldEnableKeyboardHighlighting
|
|
40
|
+
autoComplete
|
|
43
41
|
}, ref) => {
|
|
44
42
|
const [hasValue, setHasValue] = useState(typeof value === 'string' && value !== '');
|
|
45
43
|
const [placeholderWidth, setPlaceholderWidth] = useState(0);
|
|
@@ -65,13 +63,6 @@ const Input = /*#__PURE__*/forwardRef(({
|
|
|
65
63
|
}
|
|
66
64
|
}
|
|
67
65
|
}, [onChange]);
|
|
68
|
-
const handleClearIconKeyDown = useCallback(event => {
|
|
69
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
70
|
-
event.preventDefault();
|
|
71
|
-
handleClearIconClick();
|
|
72
|
-
inputRef.current?.focus();
|
|
73
|
-
}
|
|
74
|
-
}, [handleClearIconClick]);
|
|
75
66
|
|
|
76
67
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
77
68
|
const shouldShowBorder = rightElement?.props?.style?.backgroundColor === undefined;
|
|
@@ -100,9 +91,6 @@ const Input = /*#__PURE__*/forwardRef(({
|
|
|
100
91
|
} else if (areaProvider.shouldChangeColor) {
|
|
101
92
|
backgroundColor = theme['000'];
|
|
102
93
|
}
|
|
103
|
-
const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(shouldEnableKeyboardHighlighting && !isDisabled);
|
|
104
|
-
const borderColor = color?.border;
|
|
105
|
-
const placeholderColor = color?.placeholder;
|
|
106
94
|
const labelPosition = useMemo(() => {
|
|
107
95
|
if (hasValue && !shouldRemainPlaceholder && !shouldPreventPlaceholderAnimation) {
|
|
108
96
|
return shouldShowOnlyBottomBorder ? {
|
|
@@ -128,8 +116,7 @@ const Input = /*#__PURE__*/forwardRef(({
|
|
|
128
116
|
$shouldRoundRightCorners: shouldShowBorder,
|
|
129
117
|
$shouldShowOnlyBottomBorder: shouldShowOnlyBottomBorder,
|
|
130
118
|
$size: size,
|
|
131
|
-
$borderColor:
|
|
132
|
-
$shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting
|
|
119
|
+
$borderColor: color?.border
|
|
133
120
|
}, leftElement && /*#__PURE__*/React.createElement(StyledInputIconWrapper, null, leftElement), /*#__PURE__*/React.createElement(StyledInputContent, {
|
|
134
121
|
$shouldShowOnlyBottomBorder: shouldShowOnlyBottomBorder
|
|
135
122
|
}, /*#__PURE__*/React.createElement(StyledInputField, {
|
|
@@ -171,30 +158,23 @@ const Input = /*#__PURE__*/forwardRef(({
|
|
|
171
158
|
duration: shouldPreventPlaceholderAnimation ? 0 : 0.1
|
|
172
159
|
}
|
|
173
160
|
}, /*#__PURE__*/React.createElement(StyledInputLabel, {
|
|
174
|
-
$color:
|
|
161
|
+
$color: color?.placeholder,
|
|
175
162
|
$isInvalid: isInvalid
|
|
176
163
|
}, placeholder))), shouldShowClearIcon && /*#__PURE__*/React.createElement(StyledMotionInputClearIcon, {
|
|
177
164
|
$shouldShowOnlyBottomBorder: shouldShowOnlyBottomBorder,
|
|
178
165
|
$size: size,
|
|
179
|
-
$shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting,
|
|
180
166
|
animate: {
|
|
181
167
|
opacity: hasValue ? 1 : 0
|
|
182
168
|
},
|
|
183
169
|
initial: false,
|
|
184
170
|
onClick: handleClearIconClick,
|
|
185
|
-
onKeyDown: handleClearIconKeyDown,
|
|
186
|
-
tabIndex: shouldShowKeyboardHighlighting && hasValue && !isDisabled ? 0 : -1,
|
|
187
|
-
role: shouldShowKeyboardHighlighting ? 'button' : undefined,
|
|
188
|
-
"aria-hidden": !hasValue,
|
|
189
171
|
transition: {
|
|
190
172
|
type: 'tween'
|
|
191
173
|
}
|
|
192
174
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
193
175
|
icons: ['fa fa-times'],
|
|
194
176
|
color: isInvalid ? theme.wrong : undefined
|
|
195
|
-
})), rightElement && shouldShowBorder && /*#__PURE__*/React.createElement(StyledInputRightElement,
|
|
196
|
-
$isInline: true
|
|
197
|
-
}, rightElement)), rightElement && !shouldShowBorder && /*#__PURE__*/React.createElement(StyledInputRightElement, null, rightElement)), [isDisabled, shouldShowTransparentBackground, backgroundColor, isInvalid, shouldShowBorder, shouldShowOnlyBottomBorder, size, leftElement, internalColor, placeholderWidth, id, onBlur, handleInputFieldChange, onFocus, onKeyDown, onPaste, type, value, shouldUseAutoFocus, inputMode, autoComplete, shouldShowCenteredContent, shouldPreventPlaceholderAnimation, hasValue, shouldRemainPlaceholder, theme.fontSize, theme.wrong, labelPosition, borderColor, placeholderColor, placeholder, shouldShowClearIcon, handleClearIconClick, handleClearIconKeyDown, rightElement, shouldEnableKeyboardHighlighting, shouldShowKeyboardHighlighting]);
|
|
177
|
+
})), rightElement && shouldShowBorder && rightElement), rightElement && !shouldShowBorder && /*#__PURE__*/React.createElement(StyledInputRightElement, null, rightElement)), [isDisabled, shouldShowTransparentBackground, backgroundColor, isInvalid, shouldShowBorder, shouldShowOnlyBottomBorder, size, leftElement, internalColor, placeholderWidth, id, onBlur, handleInputFieldChange, onFocus, onKeyDown, onPaste, type, value, shouldUseAutoFocus, inputMode, autoComplete, shouldShowCenteredContent, shouldPreventPlaceholderAnimation, hasValue, shouldRemainPlaceholder, theme.fontSize, theme.wrong, labelPosition, color?.placeholder, placeholder, shouldShowClearIcon, handleClearIconClick, rightElement]);
|
|
198
178
|
if (isDisabled && typeof disabledHint === 'string') {
|
|
199
179
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
200
180
|
item: {
|