@chayns-components/core 5.4.13-alpha.0 → 5.4.13
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 +3 -5
- 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 +8 -19
- 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 +3 -5
- 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 +8 -19
- 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 +9 -15
- 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,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useListItemFocus = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
const useListItemFocus = ({
|
|
9
|
-
uuid,
|
|
10
|
-
listGroupUuid,
|
|
11
|
-
isInKeyboardNavigationGroup,
|
|
12
|
-
updateActiveListItemUuid
|
|
13
|
-
}) => {
|
|
14
|
-
const [isFocusWithinListItem, setIsFocusWithinListItem] = (0, _react.useState)(false);
|
|
15
|
-
const handleFocus = (0, _react.useCallback)(event => {
|
|
16
|
-
setIsFocusWithinListItem(true);
|
|
17
|
-
if (event.currentTarget === event.target && isInKeyboardNavigationGroup && typeof updateActiveListItemUuid === 'function') {
|
|
18
|
-
updateActiveListItemUuid(uuid);
|
|
19
|
-
}
|
|
20
|
-
}, [isInKeyboardNavigationGroup, updateActiveListItemUuid, uuid]);
|
|
21
|
-
const handleBlur = (0, _react.useCallback)(event => {
|
|
22
|
-
const nextFocusedElement = event.relatedTarget;
|
|
23
|
-
const currentListItemElement = event.currentTarget;
|
|
24
|
-
if (nextFocusedElement && currentListItemElement.contains(nextFocusedElement)) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
setIsFocusWithinListItem(false);
|
|
28
|
-
if (!isInKeyboardNavigationGroup || typeof updateActiveListItemUuid !== 'function' || typeof listGroupUuid !== 'string') {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (!nextFocusedElement) {
|
|
32
|
-
updateActiveListItemUuid(undefined);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const nextFocusedListItem = nextFocusedElement.closest(`[data-uuid^="${listGroupUuid}---"]`);
|
|
36
|
-
if (!nextFocusedListItem) {
|
|
37
|
-
updateActiveListItemUuid(undefined);
|
|
38
|
-
}
|
|
39
|
-
}, [isInKeyboardNavigationGroup, listGroupUuid, updateActiveListItemUuid]);
|
|
40
|
-
return {
|
|
41
|
-
isFocusWithinListItem,
|
|
42
|
-
handleFocus,
|
|
43
|
-
handleBlur
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
exports.useListItemFocus = useListItemFocus;
|
|
47
|
-
//# sourceMappingURL=useListItemFocus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useListItemFocus.js","names":["_react","require","useListItemFocus","uuid","listGroupUuid","isInKeyboardNavigationGroup","updateActiveListItemUuid","isFocusWithinListItem","setIsFocusWithinListItem","useState","handleFocus","useCallback","event","currentTarget","target","handleBlur","nextFocusedElement","relatedTarget","currentListItemElement","contains","undefined","nextFocusedListItem","closest","exports"],"sources":["../../../../../src/components/list/list-item/useListItemFocus.ts"],"sourcesContent":["import { type FocusEvent, useCallback, useState } from 'react';\n\ntype UseListItemFocusParams = {\n uuid: string;\n listGroupUuid?: string;\n isInKeyboardNavigationGroup: boolean;\n updateActiveListItemUuid?: (uuid?: string) => void;\n};\n\nexport const useListItemFocus = ({\n uuid,\n listGroupUuid,\n isInKeyboardNavigationGroup,\n updateActiveListItemUuid,\n}: UseListItemFocusParams) => {\n const [isFocusWithinListItem, setIsFocusWithinListItem] = useState(false);\n\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLDivElement>) => {\n setIsFocusWithinListItem(true);\n\n if (\n event.currentTarget === event.target &&\n isInKeyboardNavigationGroup &&\n typeof updateActiveListItemUuid === 'function'\n ) {\n updateActiveListItemUuid(uuid);\n }\n },\n [isInKeyboardNavigationGroup, updateActiveListItemUuid, uuid],\n );\n\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLDivElement>) => {\n const nextFocusedElement = event.relatedTarget as HTMLElement | null;\n const currentListItemElement = event.currentTarget as HTMLElement;\n\n if (nextFocusedElement && currentListItemElement.contains(nextFocusedElement)) {\n return;\n }\n\n setIsFocusWithinListItem(false);\n\n if (\n !isInKeyboardNavigationGroup ||\n typeof updateActiveListItemUuid !== 'function' ||\n typeof listGroupUuid !== 'string'\n ) {\n return;\n }\n\n if (!nextFocusedElement) {\n updateActiveListItemUuid(undefined);\n return;\n }\n\n const nextFocusedListItem = nextFocusedElement.closest<HTMLElement>(\n `[data-uuid^=\"${listGroupUuid}---\"]`,\n );\n\n if (!nextFocusedListItem) {\n updateActiveListItemUuid(undefined);\n }\n },\n [isInKeyboardNavigationGroup, listGroupUuid, updateActiveListItemUuid],\n );\n\n return {\n isFocusWithinListItem,\n handleFocus,\n handleBlur,\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AASO,MAAMC,gBAAgB,GAAGA,CAAC;EAC7BC,IAAI;EACJC,aAAa;EACbC,2BAA2B;EAC3BC;AACoB,CAAC,KAAK;EAC1B,MAAM,CAACC,qBAAqB,EAAEC,wBAAwB,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEzE,MAAMC,WAAW,GAAG,IAAAC,kBAAW,EAC1BC,KAAiC,IAAK;IACnCJ,wBAAwB,CAAC,IAAI,CAAC;IAE9B,IACII,KAAK,CAACC,aAAa,KAAKD,KAAK,CAACE,MAAM,IACpCT,2BAA2B,IAC3B,OAAOC,wBAAwB,KAAK,UAAU,EAChD;MACEA,wBAAwB,CAACH,IAAI,CAAC;IAClC;EACJ,CAAC,EACD,CAACE,2BAA2B,EAAEC,wBAAwB,EAAEH,IAAI,CAChE,CAAC;EAED,MAAMY,UAAU,GAAG,IAAAJ,kBAAW,EACzBC,KAAiC,IAAK;IACnC,MAAMI,kBAAkB,GAAGJ,KAAK,CAACK,aAAmC;IACpE,MAAMC,sBAAsB,GAAGN,KAAK,CAACC,aAA4B;IAEjE,IAAIG,kBAAkB,IAAIE,sBAAsB,CAACC,QAAQ,CAACH,kBAAkB,CAAC,EAAE;MAC3E;IACJ;IAEAR,wBAAwB,CAAC,KAAK,CAAC;IAE/B,IACI,CAACH,2BAA2B,IAC5B,OAAOC,wBAAwB,KAAK,UAAU,IAC9C,OAAOF,aAAa,KAAK,QAAQ,EACnC;MACE;IACJ;IAEA,IAAI,CAACY,kBAAkB,EAAE;MACrBV,wBAAwB,CAACc,SAAS,CAAC;MACnC;IACJ;IAEA,MAAMC,mBAAmB,GAAGL,kBAAkB,CAACM,OAAO,CAClD,gBAAgBlB,aAAa,OACjC,CAAC;IAED,IAAI,CAACiB,mBAAmB,EAAE;MACtBf,wBAAwB,CAACc,SAAS,CAAC;IACvC;EACJ,CAAC,EACD,CAACf,2BAA2B,EAAED,aAAa,EAAEE,wBAAwB,CACzE,CAAC;EAED,OAAO;IACHC,qBAAqB;IACrBG,WAAW;IACXK;EACJ,CAAC;AACL,CAAC;AAACQ,OAAA,CAAArB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SliderButton.types.js","names":[],"sources":["../../../../src/components/slider-button/SliderButton.types.ts"],"sourcesContent":["import type { SliderButtonItem } from '../../types/slider-button';\n\nexport type SliderButtonProps = {\n /**\n * Whether the button is disabled and cannot be clicked anymore.\n */\n isDisabled?: boolean;\n /**\n * Displays the button in the secondary style.\n */\n isSecondary?: boolean;\n /**\n * The items that should be displayed in the slider button.\n */\n items: SliderButtonItem[];\n /**\n * Function to be executed when a button is selected. The id of the selected button is passed as an argument.\n * @param id\n */\n onChange?: (id: string) => void;\n /**\n * The id of the button that should be selected.\n */\n selectedButtonId?: string;\n /**\n *\n */\n isRounded?: boolean;\n /**\n * Enables keyboard-only focus highlighting.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useSliderButtonPopupKeyboard = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
const useSliderButtonPopupKeyboard = ({
|
|
9
|
-
isPopupOpen,
|
|
10
|
-
popupItems,
|
|
11
|
-
currentPopupId,
|
|
12
|
-
shownItemsCount,
|
|
13
|
-
popupItemRefs,
|
|
14
|
-
popupRef,
|
|
15
|
-
focusThumb,
|
|
16
|
-
onSelectPopupItem
|
|
17
|
-
}) => {
|
|
18
|
-
const [focusedPopupIndex, setFocusedPopupIndex] = (0, _react.useState)(0);
|
|
19
|
-
(0, _react.useEffect)(() => {
|
|
20
|
-
if (!isPopupOpen) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const selectedIndex = popupItems.findIndex(({
|
|
24
|
-
id
|
|
25
|
-
}) => id === currentPopupId);
|
|
26
|
-
const initialIndex = selectedIndex >= 0 ? selectedIndex : 0;
|
|
27
|
-
setFocusedPopupIndex(initialIndex);
|
|
28
|
-
window.requestAnimationFrame(() => {
|
|
29
|
-
var _popupItemRefs$curren;
|
|
30
|
-
(_popupItemRefs$curren = popupItemRefs.current[initialIndex]) === null || _popupItemRefs$curren === void 0 || _popupItemRefs$curren.focus();
|
|
31
|
-
});
|
|
32
|
-
}, [currentPopupId, isPopupOpen, popupItems, popupItemRefs]);
|
|
33
|
-
const handlePopupKeyDown = (0, _react.useCallback)(event => {
|
|
34
|
-
if (!isPopupOpen || popupItems.length === 0) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
38
|
-
var _popupItemRefs$curren2;
|
|
39
|
-
event.preventDefault();
|
|
40
|
-
const direction = event.key === 'ArrowDown' ? 1 : -1;
|
|
41
|
-
const nextIndex = (focusedPopupIndex + direction + popupItems.length) % popupItems.length;
|
|
42
|
-
setFocusedPopupIndex(nextIndex);
|
|
43
|
-
(_popupItemRefs$curren2 = popupItemRefs.current[nextIndex]) === null || _popupItemRefs$curren2 === void 0 || _popupItemRefs$curren2.focus();
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
const nextItem = popupItems[focusedPopupIndex];
|
|
49
|
-
if (nextItem) {
|
|
50
|
-
onSelectPopupItem(nextItem.id, Math.max(0, shownItemsCount - 1));
|
|
51
|
-
}
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (event.key === 'Escape' || event.key === 'ArrowLeft' || event.key === 'Tab') {
|
|
55
|
-
var _popupRef$current;
|
|
56
|
-
event.preventDefault();
|
|
57
|
-
(_popupRef$current = popupRef.current) === null || _popupRef$current === void 0 || _popupRef$current.hide();
|
|
58
|
-
focusThumb();
|
|
59
|
-
}
|
|
60
|
-
}, [focusThumb, focusedPopupIndex, isPopupOpen, onSelectPopupItem, popupItemRefs, popupItems, popupRef, shownItemsCount]);
|
|
61
|
-
return {
|
|
62
|
-
handlePopupKeyDown
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
exports.useSliderButtonPopupKeyboard = useSliderButtonPopupKeyboard;
|
|
66
|
-
//# sourceMappingURL=useSliderButtonPopupKeyboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSliderButtonPopupKeyboard.js","names":["_react","require","useSliderButtonPopupKeyboard","isPopupOpen","popupItems","currentPopupId","shownItemsCount","popupItemRefs","popupRef","focusThumb","onSelectPopupItem","focusedPopupIndex","setFocusedPopupIndex","useState","useEffect","selectedIndex","findIndex","id","initialIndex","window","requestAnimationFrame","_popupItemRefs$curren","current","focus","handlePopupKeyDown","useCallback","event","length","key","_popupItemRefs$curren2","preventDefault","direction","nextIndex","nextItem","Math","max","_popupRef$current","hide","exports"],"sources":["../../../../src/components/slider-button/useSliderButtonPopupKeyboard.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport type { KeyboardEventHandler, MutableRefObject } from 'react';\nimport type { PopupRef } from '../../types/popup';\nimport type { SliderButtonItem } from '../../types/slider-button';\n\ntype UseSliderButtonPopupKeyboardProps = {\n isPopupOpen: boolean;\n popupItems: SliderButtonItem[];\n currentPopupId: string;\n shownItemsCount: number;\n popupItemRefs: MutableRefObject<Array<HTMLDivElement | null>>;\n popupRef: MutableRefObject<PopupRef | null>;\n focusThumb: VoidFunction;\n onSelectPopupItem: (id: string, index: number) => void;\n};\n\nexport const useSliderButtonPopupKeyboard = ({\n isPopupOpen,\n popupItems,\n currentPopupId,\n shownItemsCount,\n popupItemRefs,\n popupRef,\n focusThumb,\n onSelectPopupItem,\n}: UseSliderButtonPopupKeyboardProps) => {\n const [focusedPopupIndex, setFocusedPopupIndex] = useState(0);\n\n useEffect(() => {\n if (!isPopupOpen) {\n return;\n }\n\n const selectedIndex = popupItems.findIndex(({ id }) => id === currentPopupId);\n const initialIndex = selectedIndex >= 0 ? selectedIndex : 0;\n\n setFocusedPopupIndex(initialIndex);\n\n window.requestAnimationFrame(() => {\n popupItemRefs.current[initialIndex]?.focus();\n });\n }, [currentPopupId, isPopupOpen, popupItems, popupItemRefs]);\n\n const handlePopupKeyDown = useCallback<KeyboardEventHandler<HTMLDivElement>>(\n (event) => {\n if (!isPopupOpen || popupItems.length === 0) {\n return;\n }\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n\n const direction = event.key === 'ArrowDown' ? 1 : -1;\n const nextIndex =\n (focusedPopupIndex + direction + popupItems.length) % popupItems.length;\n\n setFocusedPopupIndex(nextIndex);\n popupItemRefs.current[nextIndex]?.focus();\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n\n const nextItem = popupItems[focusedPopupIndex];\n\n if (nextItem) {\n onSelectPopupItem(nextItem.id, Math.max(0, shownItemsCount - 1));\n }\n\n return;\n }\n\n if (event.key === 'Escape' || event.key === 'ArrowLeft' || event.key === 'Tab') {\n event.preventDefault();\n popupRef.current?.hide();\n focusThumb();\n }\n },\n [\n focusThumb,\n focusedPopupIndex,\n isPopupOpen,\n onSelectPopupItem,\n popupItemRefs,\n popupItems,\n popupRef,\n shownItemsCount,\n ],\n );\n\n return { handlePopupKeyDown };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAgBO,MAAMC,4BAA4B,GAAGA,CAAC;EACzCC,WAAW;EACXC,UAAU;EACVC,cAAc;EACdC,eAAe;EACfC,aAAa;EACbC,QAAQ;EACRC,UAAU;EACVC;AAC+B,CAAC,KAAK;EACrC,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAG,IAAAC,eAAQ,EAAC,CAAC,CAAC;EAE7D,IAAAC,gBAAS,EAAC,MAAM;IACZ,IAAI,CAACX,WAAW,EAAE;MACd;IACJ;IAEA,MAAMY,aAAa,GAAGX,UAAU,CAACY,SAAS,CAAC,CAAC;MAAEC;IAAG,CAAC,KAAKA,EAAE,KAAKZ,cAAc,CAAC;IAC7E,MAAMa,YAAY,GAAGH,aAAa,IAAI,CAAC,GAAGA,aAAa,GAAG,CAAC;IAE3DH,oBAAoB,CAACM,YAAY,CAAC;IAElCC,MAAM,CAACC,qBAAqB,CAAC,MAAM;MAAA,IAAAC,qBAAA;MAC/B,CAAAA,qBAAA,GAAAd,aAAa,CAACe,OAAO,CAACJ,YAAY,CAAC,cAAAG,qBAAA,eAAnCA,qBAAA,CAAqCE,KAAK,CAAC,CAAC;IAChD,CAAC,CAAC;EACN,CAAC,EAAE,CAAClB,cAAc,EAAEF,WAAW,EAAEC,UAAU,EAAEG,aAAa,CAAC,CAAC;EAE5D,MAAMiB,kBAAkB,GAAG,IAAAC,kBAAW,EACjCC,KAAK,IAAK;IACP,IAAI,CAACvB,WAAW,IAAIC,UAAU,CAACuB,MAAM,KAAK,CAAC,EAAE;MACzC;IACJ;IAEA,IAAID,KAAK,CAACE,GAAG,KAAK,WAAW,IAAIF,KAAK,CAACE,GAAG,KAAK,SAAS,EAAE;MAAA,IAAAC,sBAAA;MACtDH,KAAK,CAACI,cAAc,CAAC,CAAC;MAEtB,MAAMC,SAAS,GAAGL,KAAK,CAACE,GAAG,KAAK,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC;MACpD,MAAMI,SAAS,GACX,CAACrB,iBAAiB,GAAGoB,SAAS,GAAG3B,UAAU,CAACuB,MAAM,IAAIvB,UAAU,CAACuB,MAAM;MAE3Ef,oBAAoB,CAACoB,SAAS,CAAC;MAC/B,CAAAH,sBAAA,GAAAtB,aAAa,CAACe,OAAO,CAACU,SAAS,CAAC,cAAAH,sBAAA,eAAhCA,sBAAA,CAAkCN,KAAK,CAAC,CAAC;MACzC;IACJ;IAEA,IAAIG,KAAK,CAACE,GAAG,KAAK,OAAO,IAAIF,KAAK,CAACE,GAAG,KAAK,GAAG,EAAE;MAC5CF,KAAK,CAACI,cAAc,CAAC,CAAC;MAEtB,MAAMG,QAAQ,GAAG7B,UAAU,CAACO,iBAAiB,CAAC;MAE9C,IAAIsB,QAAQ,EAAE;QACVvB,iBAAiB,CAACuB,QAAQ,CAAChB,EAAE,EAAEiB,IAAI,CAACC,GAAG,CAAC,CAAC,EAAE7B,eAAe,GAAG,CAAC,CAAC,CAAC;MACpE;MAEA;IACJ;IAEA,IAAIoB,KAAK,CAACE,GAAG,KAAK,QAAQ,IAAIF,KAAK,CAACE,GAAG,KAAK,WAAW,IAAIF,KAAK,CAACE,GAAG,KAAK,KAAK,EAAE;MAAA,IAAAQ,iBAAA;MAC5EV,KAAK,CAACI,cAAc,CAAC,CAAC;MACtB,CAAAM,iBAAA,GAAA5B,QAAQ,CAACc,OAAO,cAAAc,iBAAA,eAAhBA,iBAAA,CAAkBC,IAAI,CAAC,CAAC;MACxB5B,UAAU,CAAC,CAAC;IAChB;EACJ,CAAC,EACD,CACIA,UAAU,EACVE,iBAAiB,EACjBR,WAAW,EACXO,iBAAiB,EACjBH,aAAa,EACbH,UAAU,EACVI,QAAQ,EACRF,eAAe,CAEvB,CAAC;EAED,OAAO;IAAEkB;EAAmB,CAAC;AACjC,CAAC;AAACc,OAAA,CAAApC,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useSliderButtonThumbKeyboard = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
const useSliderButtonThumbKeyboard = ({
|
|
9
|
-
currentId,
|
|
10
|
-
currentIndex,
|
|
11
|
-
shownItemsCount,
|
|
12
|
-
items,
|
|
13
|
-
onSelectThumbItem
|
|
14
|
-
}) => {
|
|
15
|
-
const handleThumbKeyDown = (0, _react.useCallback)(event => {
|
|
16
|
-
var _items$currentIndex, _items$;
|
|
17
|
-
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
18
|
-
var _items$nextIndex;
|
|
19
|
-
event.preventDefault();
|
|
20
|
-
const direction = event.key === 'ArrowRight' ? 1 : -1;
|
|
21
|
-
const maxVisibleIndex = Math.max(0, shownItemsCount - 1);
|
|
22
|
-
const nextIndex = Math.min(maxVisibleIndex, Math.max(0, currentIndex + direction));
|
|
23
|
-
if (nextIndex === currentIndex) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const hasMoreItems = items.length > shownItemsCount;
|
|
27
|
-
const nextId = hasMoreItems && nextIndex === shownItemsCount - 1 ? 'more' : (_items$nextIndex = items[nextIndex]) === null || _items$nextIndex === void 0 ? void 0 : _items$nextIndex.id;
|
|
28
|
-
if (nextId) {
|
|
29
|
-
onSelectThumbItem(nextId, nextIndex);
|
|
30
|
-
}
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (event.key !== 'Enter' && event.key !== ' ') {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
event.preventDefault();
|
|
37
|
-
const fallbackId = currentId || ((_items$currentIndex = items[currentIndex]) === null || _items$currentIndex === void 0 ? void 0 : _items$currentIndex.id) || ((_items$ = items[0]) === null || _items$ === void 0 ? void 0 : _items$.id);
|
|
38
|
-
if (fallbackId) {
|
|
39
|
-
onSelectThumbItem(fallbackId, currentIndex);
|
|
40
|
-
}
|
|
41
|
-
}, [currentId, currentIndex, items, onSelectThumbItem, shownItemsCount]);
|
|
42
|
-
return {
|
|
43
|
-
handleThumbKeyDown
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
exports.useSliderButtonThumbKeyboard = useSliderButtonThumbKeyboard;
|
|
47
|
-
//# sourceMappingURL=useSliderButtonThumbKeyboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSliderButtonThumbKeyboard.js","names":["_react","require","useSliderButtonThumbKeyboard","currentId","currentIndex","shownItemsCount","items","onSelectThumbItem","handleThumbKeyDown","useCallback","event","_items$currentIndex","_items$","key","_items$nextIndex","preventDefault","direction","maxVisibleIndex","Math","max","nextIndex","min","hasMoreItems","length","nextId","id","fallbackId","exports"],"sources":["../../../../src/components/slider-button/useSliderButtonThumbKeyboard.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport type { KeyboardEventHandler } from 'react';\nimport type { SliderButtonItem } from '../../types/slider-button';\n\ntype UseSliderButtonThumbKeyboardProps = {\n currentId: string;\n currentIndex: number;\n shownItemsCount: number;\n items: SliderButtonItem[];\n onSelectThumbItem: (id: string, index: number) => void;\n};\n\nexport const useSliderButtonThumbKeyboard = ({\n currentId,\n currentIndex,\n shownItemsCount,\n items,\n onSelectThumbItem,\n}: UseSliderButtonThumbKeyboardProps) => {\n const handleThumbKeyDown = useCallback<KeyboardEventHandler<HTMLDivElement>>(\n (event) => {\n if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n event.preventDefault();\n\n const direction = event.key === 'ArrowRight' ? 1 : -1;\n const maxVisibleIndex = Math.max(0, shownItemsCount - 1);\n const nextIndex = Math.min(maxVisibleIndex, Math.max(0, currentIndex + direction));\n\n if (nextIndex === currentIndex) {\n return;\n }\n\n const hasMoreItems = items.length > shownItemsCount;\n const nextId =\n hasMoreItems && nextIndex === shownItemsCount - 1\n ? 'more'\n : items[nextIndex]?.id;\n\n if (nextId) {\n onSelectThumbItem(nextId, nextIndex);\n }\n\n return;\n }\n\n if (event.key !== 'Enter' && event.key !== ' ') {\n return;\n }\n\n event.preventDefault();\n\n const fallbackId = currentId || items[currentIndex]?.id || items[0]?.id;\n\n if (fallbackId) {\n onSelectThumbItem(fallbackId, currentIndex);\n }\n },\n [currentId, currentIndex, items, onSelectThumbItem, shownItemsCount],\n );\n\n return { handleThumbKeyDown };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAYO,MAAMC,4BAA4B,GAAGA,CAAC;EACzCC,SAAS;EACTC,YAAY;EACZC,eAAe;EACfC,KAAK;EACLC;AAC+B,CAAC,KAAK;EACrC,MAAMC,kBAAkB,GAAG,IAAAC,kBAAW,EACjCC,KAAK,IAAK;IAAA,IAAAC,mBAAA,EAAAC,OAAA;IACP,IAAIF,KAAK,CAACG,GAAG,KAAK,WAAW,IAAIH,KAAK,CAACG,GAAG,KAAK,YAAY,EAAE;MAAA,IAAAC,gBAAA;MACzDJ,KAAK,CAACK,cAAc,CAAC,CAAC;MAEtB,MAAMC,SAAS,GAAGN,KAAK,CAACG,GAAG,KAAK,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC;MACrD,MAAMI,eAAe,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEd,eAAe,GAAG,CAAC,CAAC;MACxD,MAAMe,SAAS,GAAGF,IAAI,CAACG,GAAG,CAACJ,eAAe,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEf,YAAY,GAAGY,SAAS,CAAC,CAAC;MAElF,IAAII,SAAS,KAAKhB,YAAY,EAAE;QAC5B;MACJ;MAEA,MAAMkB,YAAY,GAAGhB,KAAK,CAACiB,MAAM,GAAGlB,eAAe;MACnD,MAAMmB,MAAM,GACRF,YAAY,IAAIF,SAAS,KAAKf,eAAe,GAAG,CAAC,GAC3C,MAAM,IAAAS,gBAAA,GACNR,KAAK,CAACc,SAAS,CAAC,cAAAN,gBAAA,uBAAhBA,gBAAA,CAAkBW,EAAE;MAE9B,IAAID,MAAM,EAAE;QACRjB,iBAAiB,CAACiB,MAAM,EAAEJ,SAAS,CAAC;MACxC;MAEA;IACJ;IAEA,IAAIV,KAAK,CAACG,GAAG,KAAK,OAAO,IAAIH,KAAK,CAACG,GAAG,KAAK,GAAG,EAAE;MAC5C;IACJ;IAEAH,KAAK,CAACK,cAAc,CAAC,CAAC;IAEtB,MAAMW,UAAU,GAAGvB,SAAS,MAAAQ,mBAAA,GAAIL,KAAK,CAACF,YAAY,CAAC,cAAAO,mBAAA,uBAAnBA,mBAAA,CAAqBc,EAAE,OAAAb,OAAA,GAAIN,KAAK,CAAC,CAAC,CAAC,cAAAM,OAAA,uBAARA,OAAA,CAAUa,EAAE;IAEvE,IAAIC,UAAU,EAAE;MACZnB,iBAAiB,CAACmB,UAAU,EAAEtB,YAAY,CAAC;IAC/C;EACJ,CAAC,EACD,CAACD,SAAS,EAAEC,YAAY,EAAEE,KAAK,EAAEC,iBAAiB,EAAEF,eAAe,CACvE,CAAC;EAED,OAAO;IAAEG;EAAmB,CAAC;AACjC,CAAC;AAACmB,OAAA,CAAAzB,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useKeyboardFocusHighlighting = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _ColorSchemeProvider = require("../components/color-scheme-provider/ColorSchemeProvider");
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return */
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Tracks whether focus highlighting should be visible for keyboard navigation.
|
|
13
|
-
* Keyboard mode is enabled via Tab and reset by mouse interaction.
|
|
14
|
-
*/
|
|
15
|
-
const useKeyboardFocusHighlighting = isEnabledProp => {
|
|
16
|
-
const colorScheme = (0, _react.useContext)(_ColorSchemeProvider.ColorSchemeContext);
|
|
17
|
-
const contextIsEnabled = (colorScheme === null || colorScheme === void 0 ? void 0 : colorScheme.shouldEnableKeyboardHighlighting) === true;
|
|
18
|
-
const isEnabled = isEnabledProp ?? contextIsEnabled;
|
|
19
|
-
const [isKeyboardNavigation, setIsKeyboardNavigation] = (0, _react.useState)(false);
|
|
20
|
-
(0, _react.useEffect)(() => {
|
|
21
|
-
const canListen = isEnabled && typeof window !== 'undefined';
|
|
22
|
-
const enableKeyboardNavigation = () => {
|
|
23
|
-
setIsKeyboardNavigation(true);
|
|
24
|
-
};
|
|
25
|
-
const handleKeyDown = event => {
|
|
26
|
-
// Ignore pure modifier presses, but treat any real keyboard interaction as keyboard navigation.
|
|
27
|
-
if (event.ctrlKey || event.altKey || event.metaKey) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (['Shift', 'Control', 'Alt', 'Meta'].includes(event.key)) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
enableKeyboardNavigation();
|
|
34
|
-
};
|
|
35
|
-
const handleFocusIn = event => {
|
|
36
|
-
const {
|
|
37
|
-
target
|
|
38
|
-
} = event;
|
|
39
|
-
|
|
40
|
-
// Fallback for first tab-focus when the keydown was not observed.
|
|
41
|
-
if (target instanceof HTMLElement && typeof target.matches === 'function' && target.matches(':focus-visible')) {
|
|
42
|
-
enableKeyboardNavigation();
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const disableKeyboardNavigation = () => {
|
|
46
|
-
setIsKeyboardNavigation(current => current ? false : current);
|
|
47
|
-
};
|
|
48
|
-
if (canListen) {
|
|
49
|
-
window.addEventListener('keydown', handleKeyDown);
|
|
50
|
-
window.addEventListener('focusin', handleFocusIn);
|
|
51
|
-
window.addEventListener('mousedown', disableKeyboardNavigation);
|
|
52
|
-
window.addEventListener('mousemove', disableKeyboardNavigation);
|
|
53
|
-
} else {
|
|
54
|
-
setIsKeyboardNavigation(false);
|
|
55
|
-
}
|
|
56
|
-
return () => {
|
|
57
|
-
if (canListen) {
|
|
58
|
-
window.removeEventListener('keydown', handleKeyDown);
|
|
59
|
-
window.removeEventListener('focusin', handleFocusIn);
|
|
60
|
-
window.removeEventListener('mousedown', disableKeyboardNavigation);
|
|
61
|
-
window.removeEventListener('mousemove', disableKeyboardNavigation);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}, [isEnabled]);
|
|
65
|
-
return Boolean(isEnabled && isKeyboardNavigation);
|
|
66
|
-
};
|
|
67
|
-
exports.useKeyboardFocusHighlighting = useKeyboardFocusHighlighting;
|
|
68
|
-
//# sourceMappingURL=useKeyboardFocusHighlighting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboardFocusHighlighting.js","names":["_react","require","_ColorSchemeProvider","useKeyboardFocusHighlighting","isEnabledProp","colorScheme","useContext","ColorSchemeContext","contextIsEnabled","shouldEnableKeyboardHighlighting","isEnabled","isKeyboardNavigation","setIsKeyboardNavigation","useState","useEffect","canListen","window","enableKeyboardNavigation","handleKeyDown","event","ctrlKey","altKey","metaKey","includes","key","handleFocusIn","target","HTMLElement","matches","disableKeyboardNavigation","current","addEventListener","removeEventListener","Boolean","exports"],"sources":["../../../src/hooks/useKeyboardFocusHighlighting.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return */\nimport { useContext, useEffect, useState } from 'react';\nimport {\n ColorSchemeContext,\n type ColorSchemeContextProps,\n} from '../components/color-scheme-provider/ColorSchemeProvider';\n\n/**\n * Tracks whether focus highlighting should be visible for keyboard navigation.\n * Keyboard mode is enabled via Tab and reset by mouse interaction.\n */\nexport const useKeyboardFocusHighlighting = (isEnabledProp?: boolean): boolean => {\n const colorScheme = useContext<ColorSchemeContextProps | undefined>(ColorSchemeContext);\n const contextIsEnabled: boolean = colorScheme?.shouldEnableKeyboardHighlighting === true;\n const isEnabled: boolean = isEnabledProp ?? contextIsEnabled;\n\n const [isKeyboardNavigation, setIsKeyboardNavigation] = useState(false);\n\n useEffect(() => {\n const canListen = isEnabled && typeof window !== 'undefined';\n\n const enableKeyboardNavigation = () => {\n setIsKeyboardNavigation(true);\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n // Ignore pure modifier presses, but treat any real keyboard interaction as keyboard navigation.\n if (event.ctrlKey || event.altKey || event.metaKey) {\n return;\n }\n\n if (['Shift', 'Control', 'Alt', 'Meta'].includes(event.key)) {\n return;\n }\n\n enableKeyboardNavigation();\n };\n\n const handleFocusIn = (event: FocusEvent) => {\n const { target } = event;\n\n // Fallback for first tab-focus when the keydown was not observed.\n if (\n target instanceof HTMLElement &&\n typeof target.matches === 'function' &&\n target.matches(':focus-visible')\n ) {\n enableKeyboardNavigation();\n }\n };\n\n const disableKeyboardNavigation = () => {\n setIsKeyboardNavigation((current) => (current ? false : current));\n };\n\n if (canListen) {\n window.addEventListener('keydown', handleKeyDown);\n window.addEventListener('focusin', handleFocusIn);\n window.addEventListener('mousedown', disableKeyboardNavigation);\n window.addEventListener('mousemove', disableKeyboardNavigation);\n } else {\n setIsKeyboardNavigation(false);\n }\n\n return () => {\n if (canListen) {\n window.removeEventListener('keydown', handleKeyDown);\n window.removeEventListener('focusin', handleFocusIn);\n window.removeEventListener('mousedown', disableKeyboardNavigation);\n window.removeEventListener('mousemove', disableKeyboardNavigation);\n }\n };\n }, [isEnabled]);\n\n return Boolean(isEnabled && isKeyboardNavigation);\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AAFA;;AAOA;AACA;AACA;AACA;AACO,MAAME,4BAA4B,GAAIC,aAAuB,IAAc;EAC9E,MAAMC,WAAW,GAAG,IAAAC,iBAAU,EAAsCC,uCAAkB,CAAC;EACvF,MAAMC,gBAAyB,GAAG,CAAAH,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEI,gCAAgC,MAAK,IAAI;EACxF,MAAMC,SAAkB,GAAGN,aAAa,IAAII,gBAAgB;EAE5D,MAAM,CAACG,oBAAoB,EAAEC,uBAAuB,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEvE,IAAAC,gBAAS,EAAC,MAAM;IACZ,MAAMC,SAAS,GAAGL,SAAS,IAAI,OAAOM,MAAM,KAAK,WAAW;IAE5D,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;MACnCL,uBAAuB,CAAC,IAAI,CAAC;IACjC,CAAC;IAED,MAAMM,aAAa,GAAIC,KAAoB,IAAK;MAC5C;MACA,IAAIA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACE,MAAM,IAAIF,KAAK,CAACG,OAAO,EAAE;QAChD;MACJ;MAEA,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAACC,QAAQ,CAACJ,KAAK,CAACK,GAAG,CAAC,EAAE;QACzD;MACJ;MAEAP,wBAAwB,CAAC,CAAC;IAC9B,CAAC;IAED,MAAMQ,aAAa,GAAIN,KAAiB,IAAK;MACzC,MAAM;QAAEO;MAAO,CAAC,GAAGP,KAAK;;MAExB;MACA,IACIO,MAAM,YAAYC,WAAW,IAC7B,OAAOD,MAAM,CAACE,OAAO,KAAK,UAAU,IACpCF,MAAM,CAACE,OAAO,CAAC,gBAAgB,CAAC,EAClC;QACEX,wBAAwB,CAAC,CAAC;MAC9B;IACJ,CAAC;IAED,MAAMY,yBAAyB,GAAGA,CAAA,KAAM;MACpCjB,uBAAuB,CAAEkB,OAAO,IAAMA,OAAO,GAAG,KAAK,GAAGA,OAAQ,CAAC;IACrE,CAAC;IAED,IAAIf,SAAS,EAAE;MACXC,MAAM,CAACe,gBAAgB,CAAC,SAAS,EAAEb,aAAa,CAAC;MACjDF,MAAM,CAACe,gBAAgB,CAAC,SAAS,EAAEN,aAAa,CAAC;MACjDT,MAAM,CAACe,gBAAgB,CAAC,WAAW,EAAEF,yBAAyB,CAAC;MAC/Db,MAAM,CAACe,gBAAgB,CAAC,WAAW,EAAEF,yBAAyB,CAAC;IACnE,CAAC,MAAM;MACHjB,uBAAuB,CAAC,KAAK,CAAC;IAClC;IAEA,OAAO,MAAM;MACT,IAAIG,SAAS,EAAE;QACXC,MAAM,CAACgB,mBAAmB,CAAC,SAAS,EAAEd,aAAa,CAAC;QACpDF,MAAM,CAACgB,mBAAmB,CAAC,SAAS,EAAEP,aAAa,CAAC;QACpDT,MAAM,CAACgB,mBAAmB,CAAC,WAAW,EAAEH,yBAAyB,CAAC;QAClEb,MAAM,CAACgB,mBAAmB,CAAC,WAAW,EAAEH,yBAAyB,CAAC;MACtE;IACJ,CAAC;EACL,CAAC,EAAE,CAACnB,SAAS,CAAC,CAAC;EAEf,OAAOuB,OAAO,CAACvB,SAAS,IAAIC,oBAAoB,CAAC;AACrD,CAAC;AAACuB,OAAA,CAAA/B,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.keyboardFocusHighlightingRingCss = exports.keyboardFocusHighlightingCircleRingCss = void 0;
|
|
7
|
-
var _styledComponents = require("styled-components");
|
|
8
|
-
/**
|
|
9
|
-
* Shared focus ring for components with keyboard-only highlighting.
|
|
10
|
-
* Apply this only when keyboard highlighting is enabled/active.
|
|
11
|
-
*/
|
|
12
|
-
const keyboardFocusHighlightingRingCss = exports.keyboardFocusHighlightingRingCss = (0, _styledComponents.css)`
|
|
13
|
-
outline: solid 2px color-mix(in srgb, white 70%, transparent);
|
|
14
|
-
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
|
|
15
|
-
border-radius: 3px;
|
|
16
|
-
outline-offset: 1px;
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Circular focus ring variant for round controls (e.g. RadioButton).
|
|
21
|
-
*/
|
|
22
|
-
const keyboardFocusHighlightingCircleRingCss = exports.keyboardFocusHighlightingCircleRingCss = (0, _styledComponents.css)`
|
|
23
|
-
outline: solid 2px color-mix(in srgb, white 70%, transparent);
|
|
24
|
-
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
|
|
25
|
-
border-radius: 50%;
|
|
26
|
-
outline-offset: 1px;
|
|
27
|
-
color: white;
|
|
28
|
-
`;
|
|
29
|
-
//# sourceMappingURL=keyboardFocusHighlighting.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyboardFocusHighlighting.styles.js","names":["_styledComponents","require","keyboardFocusHighlightingRingCss","exports","css","keyboardFocusHighlightingCircleRingCss"],"sources":["../../../src/utils/keyboardFocusHighlighting.styles.ts"],"sourcesContent":["import { css } from 'styled-components';\n\n/**\n * Shared focus ring for components with keyboard-only highlighting.\n * Apply this only when keyboard highlighting is enabled/active.\n */\nexport const keyboardFocusHighlightingRingCss = css`\n outline: solid 2px color-mix(in srgb, white 70%, transparent);\n box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);\n border-radius: 3px;\n outline-offset: 1px;\n`;\n\n/**\n * Circular focus ring variant for round controls (e.g. RadioButton).\n */\nexport const keyboardFocusHighlightingCircleRingCss = css`\n outline: solid 2px color-mix(in srgb, white 70%, transparent);\n box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);\n border-radius: 50%;\n outline-offset: 1px;\n color: white;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMC,gCAAgC,GAAAC,OAAA,CAAAD,gCAAA,GAAG,IAAAE,qBAAG;AACnD;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACO,MAAMC,sCAAsC,GAAAF,OAAA,CAAAE,sCAAA,GAAG,IAAAD,qBAAG;AACzD;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { useCallback, useState } from 'react';
|
|
2
|
-
export const useListItemFocus = ({
|
|
3
|
-
uuid,
|
|
4
|
-
listGroupUuid,
|
|
5
|
-
isInKeyboardNavigationGroup,
|
|
6
|
-
updateActiveListItemUuid
|
|
7
|
-
}) => {
|
|
8
|
-
const [isFocusWithinListItem, setIsFocusWithinListItem] = useState(false);
|
|
9
|
-
const handleFocus = useCallback(event => {
|
|
10
|
-
setIsFocusWithinListItem(true);
|
|
11
|
-
if (event.currentTarget === event.target && isInKeyboardNavigationGroup && typeof updateActiveListItemUuid === 'function') {
|
|
12
|
-
updateActiveListItemUuid(uuid);
|
|
13
|
-
}
|
|
14
|
-
}, [isInKeyboardNavigationGroup, updateActiveListItemUuid, uuid]);
|
|
15
|
-
const handleBlur = useCallback(event => {
|
|
16
|
-
const nextFocusedElement = event.relatedTarget;
|
|
17
|
-
const currentListItemElement = event.currentTarget;
|
|
18
|
-
if (nextFocusedElement && currentListItemElement.contains(nextFocusedElement)) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
setIsFocusWithinListItem(false);
|
|
22
|
-
if (!isInKeyboardNavigationGroup || typeof updateActiveListItemUuid !== 'function' || typeof listGroupUuid !== 'string') {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (!nextFocusedElement) {
|
|
26
|
-
updateActiveListItemUuid(undefined);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const nextFocusedListItem = nextFocusedElement.closest(`[data-uuid^="${listGroupUuid}---"]`);
|
|
30
|
-
if (!nextFocusedListItem) {
|
|
31
|
-
updateActiveListItemUuid(undefined);
|
|
32
|
-
}
|
|
33
|
-
}, [isInKeyboardNavigationGroup, listGroupUuid, updateActiveListItemUuid]);
|
|
34
|
-
return {
|
|
35
|
-
isFocusWithinListItem,
|
|
36
|
-
handleFocus,
|
|
37
|
-
handleBlur
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=useListItemFocus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useListItemFocus.js","names":["useCallback","useState","useListItemFocus","uuid","listGroupUuid","isInKeyboardNavigationGroup","updateActiveListItemUuid","isFocusWithinListItem","setIsFocusWithinListItem","handleFocus","event","currentTarget","target","handleBlur","nextFocusedElement","relatedTarget","currentListItemElement","contains","undefined","nextFocusedListItem","closest"],"sources":["../../../../../src/components/list/list-item/useListItemFocus.ts"],"sourcesContent":["import { type FocusEvent, useCallback, useState } from 'react';\n\ntype UseListItemFocusParams = {\n uuid: string;\n listGroupUuid?: string;\n isInKeyboardNavigationGroup: boolean;\n updateActiveListItemUuid?: (uuid?: string) => void;\n};\n\nexport const useListItemFocus = ({\n uuid,\n listGroupUuid,\n isInKeyboardNavigationGroup,\n updateActiveListItemUuid,\n}: UseListItemFocusParams) => {\n const [isFocusWithinListItem, setIsFocusWithinListItem] = useState(false);\n\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLDivElement>) => {\n setIsFocusWithinListItem(true);\n\n if (\n event.currentTarget === event.target &&\n isInKeyboardNavigationGroup &&\n typeof updateActiveListItemUuid === 'function'\n ) {\n updateActiveListItemUuid(uuid);\n }\n },\n [isInKeyboardNavigationGroup, updateActiveListItemUuid, uuid],\n );\n\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLDivElement>) => {\n const nextFocusedElement = event.relatedTarget as HTMLElement | null;\n const currentListItemElement = event.currentTarget as HTMLElement;\n\n if (nextFocusedElement && currentListItemElement.contains(nextFocusedElement)) {\n return;\n }\n\n setIsFocusWithinListItem(false);\n\n if (\n !isInKeyboardNavigationGroup ||\n typeof updateActiveListItemUuid !== 'function' ||\n typeof listGroupUuid !== 'string'\n ) {\n return;\n }\n\n if (!nextFocusedElement) {\n updateActiveListItemUuid(undefined);\n return;\n }\n\n const nextFocusedListItem = nextFocusedElement.closest<HTMLElement>(\n `[data-uuid^=\"${listGroupUuid}---\"]`,\n );\n\n if (!nextFocusedListItem) {\n updateActiveListItemUuid(undefined);\n }\n },\n [isInKeyboardNavigationGroup, listGroupUuid, updateActiveListItemUuid],\n );\n\n return {\n isFocusWithinListItem,\n handleFocus,\n handleBlur,\n };\n};\n"],"mappings":"AAAA,SAA0BA,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAS9D,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAC7BC,IAAI;EACJC,aAAa;EACbC,2BAA2B;EAC3BC;AACoB,CAAC,KAAK;EAC1B,MAAM,CAACC,qBAAqB,EAAEC,wBAAwB,CAAC,GAAGP,QAAQ,CAAC,KAAK,CAAC;EAEzE,MAAMQ,WAAW,GAAGT,WAAW,CAC1BU,KAAiC,IAAK;IACnCF,wBAAwB,CAAC,IAAI,CAAC;IAE9B,IACIE,KAAK,CAACC,aAAa,KAAKD,KAAK,CAACE,MAAM,IACpCP,2BAA2B,IAC3B,OAAOC,wBAAwB,KAAK,UAAU,EAChD;MACEA,wBAAwB,CAACH,IAAI,CAAC;IAClC;EACJ,CAAC,EACD,CAACE,2BAA2B,EAAEC,wBAAwB,EAAEH,IAAI,CAChE,CAAC;EAED,MAAMU,UAAU,GAAGb,WAAW,CACzBU,KAAiC,IAAK;IACnC,MAAMI,kBAAkB,GAAGJ,KAAK,CAACK,aAAmC;IACpE,MAAMC,sBAAsB,GAAGN,KAAK,CAACC,aAA4B;IAEjE,IAAIG,kBAAkB,IAAIE,sBAAsB,CAACC,QAAQ,CAACH,kBAAkB,CAAC,EAAE;MAC3E;IACJ;IAEAN,wBAAwB,CAAC,KAAK,CAAC;IAE/B,IACI,CAACH,2BAA2B,IAC5B,OAAOC,wBAAwB,KAAK,UAAU,IAC9C,OAAOF,aAAa,KAAK,QAAQ,EACnC;MACE;IACJ;IAEA,IAAI,CAACU,kBAAkB,EAAE;MACrBR,wBAAwB,CAACY,SAAS,CAAC;MACnC;IACJ;IAEA,MAAMC,mBAAmB,GAAGL,kBAAkB,CAACM,OAAO,CAClD,gBAAgBhB,aAAa,OACjC,CAAC;IAED,IAAI,CAACe,mBAAmB,EAAE;MACtBb,wBAAwB,CAACY,SAAS,CAAC;IACvC;EACJ,CAAC,EACD,CAACb,2BAA2B,EAAED,aAAa,EAAEE,wBAAwB,CACzE,CAAC;EAED,OAAO;IACHC,qBAAqB;IACrBE,WAAW;IACXI;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SliderButton.types.js","names":[],"sources":["../../../../src/components/slider-button/SliderButton.types.ts"],"sourcesContent":["import type { SliderButtonItem } from '../../types/slider-button';\n\nexport type SliderButtonProps = {\n /**\n * Whether the button is disabled and cannot be clicked anymore.\n */\n isDisabled?: boolean;\n /**\n * Displays the button in the secondary style.\n */\n isSecondary?: boolean;\n /**\n * The items that should be displayed in the slider button.\n */\n items: SliderButtonItem[];\n /**\n * Function to be executed when a button is selected. The id of the selected button is passed as an argument.\n * @param id\n */\n onChange?: (id: string) => void;\n /**\n * The id of the button that should be selected.\n */\n selectedButtonId?: string;\n /**\n *\n */\n isRounded?: boolean;\n /**\n * Enables keyboard-only focus highlighting.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
export const useSliderButtonPopupKeyboard = ({
|
|
3
|
-
isPopupOpen,
|
|
4
|
-
popupItems,
|
|
5
|
-
currentPopupId,
|
|
6
|
-
shownItemsCount,
|
|
7
|
-
popupItemRefs,
|
|
8
|
-
popupRef,
|
|
9
|
-
focusThumb,
|
|
10
|
-
onSelectPopupItem
|
|
11
|
-
}) => {
|
|
12
|
-
const [focusedPopupIndex, setFocusedPopupIndex] = useState(0);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (!isPopupOpen) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const selectedIndex = popupItems.findIndex(({
|
|
18
|
-
id
|
|
19
|
-
}) => id === currentPopupId);
|
|
20
|
-
const initialIndex = selectedIndex >= 0 ? selectedIndex : 0;
|
|
21
|
-
setFocusedPopupIndex(initialIndex);
|
|
22
|
-
window.requestAnimationFrame(() => {
|
|
23
|
-
popupItemRefs.current[initialIndex]?.focus();
|
|
24
|
-
});
|
|
25
|
-
}, [currentPopupId, isPopupOpen, popupItems, popupItemRefs]);
|
|
26
|
-
const handlePopupKeyDown = useCallback(event => {
|
|
27
|
-
if (!isPopupOpen || popupItems.length === 0) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
31
|
-
event.preventDefault();
|
|
32
|
-
const direction = event.key === 'ArrowDown' ? 1 : -1;
|
|
33
|
-
const nextIndex = (focusedPopupIndex + direction + popupItems.length) % popupItems.length;
|
|
34
|
-
setFocusedPopupIndex(nextIndex);
|
|
35
|
-
popupItemRefs.current[nextIndex]?.focus();
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
39
|
-
event.preventDefault();
|
|
40
|
-
const nextItem = popupItems[focusedPopupIndex];
|
|
41
|
-
if (nextItem) {
|
|
42
|
-
onSelectPopupItem(nextItem.id, Math.max(0, shownItemsCount - 1));
|
|
43
|
-
}
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (event.key === 'Escape' || event.key === 'ArrowLeft' || event.key === 'Tab') {
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
popupRef.current?.hide();
|
|
49
|
-
focusThumb();
|
|
50
|
-
}
|
|
51
|
-
}, [focusThumb, focusedPopupIndex, isPopupOpen, onSelectPopupItem, popupItemRefs, popupItems, popupRef, shownItemsCount]);
|
|
52
|
-
return {
|
|
53
|
-
handlePopupKeyDown
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=useSliderButtonPopupKeyboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSliderButtonPopupKeyboard.js","names":["useCallback","useEffect","useState","useSliderButtonPopupKeyboard","isPopupOpen","popupItems","currentPopupId","shownItemsCount","popupItemRefs","popupRef","focusThumb","onSelectPopupItem","focusedPopupIndex","setFocusedPopupIndex","selectedIndex","findIndex","id","initialIndex","window","requestAnimationFrame","current","focus","handlePopupKeyDown","event","length","key","preventDefault","direction","nextIndex","nextItem","Math","max","hide"],"sources":["../../../../src/components/slider-button/useSliderButtonPopupKeyboard.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport type { KeyboardEventHandler, MutableRefObject } from 'react';\nimport type { PopupRef } from '../../types/popup';\nimport type { SliderButtonItem } from '../../types/slider-button';\n\ntype UseSliderButtonPopupKeyboardProps = {\n isPopupOpen: boolean;\n popupItems: SliderButtonItem[];\n currentPopupId: string;\n shownItemsCount: number;\n popupItemRefs: MutableRefObject<Array<HTMLDivElement | null>>;\n popupRef: MutableRefObject<PopupRef | null>;\n focusThumb: VoidFunction;\n onSelectPopupItem: (id: string, index: number) => void;\n};\n\nexport const useSliderButtonPopupKeyboard = ({\n isPopupOpen,\n popupItems,\n currentPopupId,\n shownItemsCount,\n popupItemRefs,\n popupRef,\n focusThumb,\n onSelectPopupItem,\n}: UseSliderButtonPopupKeyboardProps) => {\n const [focusedPopupIndex, setFocusedPopupIndex] = useState(0);\n\n useEffect(() => {\n if (!isPopupOpen) {\n return;\n }\n\n const selectedIndex = popupItems.findIndex(({ id }) => id === currentPopupId);\n const initialIndex = selectedIndex >= 0 ? selectedIndex : 0;\n\n setFocusedPopupIndex(initialIndex);\n\n window.requestAnimationFrame(() => {\n popupItemRefs.current[initialIndex]?.focus();\n });\n }, [currentPopupId, isPopupOpen, popupItems, popupItemRefs]);\n\n const handlePopupKeyDown = useCallback<KeyboardEventHandler<HTMLDivElement>>(\n (event) => {\n if (!isPopupOpen || popupItems.length === 0) {\n return;\n }\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n\n const direction = event.key === 'ArrowDown' ? 1 : -1;\n const nextIndex =\n (focusedPopupIndex + direction + popupItems.length) % popupItems.length;\n\n setFocusedPopupIndex(nextIndex);\n popupItemRefs.current[nextIndex]?.focus();\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n\n const nextItem = popupItems[focusedPopupIndex];\n\n if (nextItem) {\n onSelectPopupItem(nextItem.id, Math.max(0, shownItemsCount - 1));\n }\n\n return;\n }\n\n if (event.key === 'Escape' || event.key === 'ArrowLeft' || event.key === 'Tab') {\n event.preventDefault();\n popupRef.current?.hide();\n focusThumb();\n }\n },\n [\n focusThumb,\n focusedPopupIndex,\n isPopupOpen,\n onSelectPopupItem,\n popupItemRefs,\n popupItems,\n popupRef,\n shownItemsCount,\n ],\n );\n\n return { handlePopupKeyDown };\n};\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAgBxD,OAAO,MAAMC,4BAA4B,GAAGA,CAAC;EACzCC,WAAW;EACXC,UAAU;EACVC,cAAc;EACdC,eAAe;EACfC,aAAa;EACbC,QAAQ;EACRC,UAAU;EACVC;AAC+B,CAAC,KAAK;EACrC,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGX,QAAQ,CAAC,CAAC,CAAC;EAE7DD,SAAS,CAAC,MAAM;IACZ,IAAI,CAACG,WAAW,EAAE;MACd;IACJ;IAEA,MAAMU,aAAa,GAAGT,UAAU,CAACU,SAAS,CAAC,CAAC;MAAEC;IAAG,CAAC,KAAKA,EAAE,KAAKV,cAAc,CAAC;IAC7E,MAAMW,YAAY,GAAGH,aAAa,IAAI,CAAC,GAAGA,aAAa,GAAG,CAAC;IAE3DD,oBAAoB,CAACI,YAAY,CAAC;IAElCC,MAAM,CAACC,qBAAqB,CAAC,MAAM;MAC/BX,aAAa,CAACY,OAAO,CAACH,YAAY,CAAC,EAAEI,KAAK,CAAC,CAAC;IAChD,CAAC,CAAC;EACN,CAAC,EAAE,CAACf,cAAc,EAAEF,WAAW,EAAEC,UAAU,EAAEG,aAAa,CAAC,CAAC;EAE5D,MAAMc,kBAAkB,GAAGtB,WAAW,CACjCuB,KAAK,IAAK;IACP,IAAI,CAACnB,WAAW,IAAIC,UAAU,CAACmB,MAAM,KAAK,CAAC,EAAE;MACzC;IACJ;IAEA,IAAID,KAAK,CAACE,GAAG,KAAK,WAAW,IAAIF,KAAK,CAACE,GAAG,KAAK,SAAS,EAAE;MACtDF,KAAK,CAACG,cAAc,CAAC,CAAC;MAEtB,MAAMC,SAAS,GAAGJ,KAAK,CAACE,GAAG,KAAK,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC;MACpD,MAAMG,SAAS,GACX,CAAChB,iBAAiB,GAAGe,SAAS,GAAGtB,UAAU,CAACmB,MAAM,IAAInB,UAAU,CAACmB,MAAM;MAE3EX,oBAAoB,CAACe,SAAS,CAAC;MAC/BpB,aAAa,CAACY,OAAO,CAACQ,SAAS,CAAC,EAAEP,KAAK,CAAC,CAAC;MACzC;IACJ;IAEA,IAAIE,KAAK,CAACE,GAAG,KAAK,OAAO,IAAIF,KAAK,CAACE,GAAG,KAAK,GAAG,EAAE;MAC5CF,KAAK,CAACG,cAAc,CAAC,CAAC;MAEtB,MAAMG,QAAQ,GAAGxB,UAAU,CAACO,iBAAiB,CAAC;MAE9C,IAAIiB,QAAQ,EAAE;QACVlB,iBAAiB,CAACkB,QAAQ,CAACb,EAAE,EAAEc,IAAI,CAACC,GAAG,CAAC,CAAC,EAAExB,eAAe,GAAG,CAAC,CAAC,CAAC;MACpE;MAEA;IACJ;IAEA,IAAIgB,KAAK,CAACE,GAAG,KAAK,QAAQ,IAAIF,KAAK,CAACE,GAAG,KAAK,WAAW,IAAIF,KAAK,CAACE,GAAG,KAAK,KAAK,EAAE;MAC5EF,KAAK,CAACG,cAAc,CAAC,CAAC;MACtBjB,QAAQ,CAACW,OAAO,EAAEY,IAAI,CAAC,CAAC;MACxBtB,UAAU,CAAC,CAAC;IAChB;EACJ,CAAC,EACD,CACIA,UAAU,EACVE,iBAAiB,EACjBR,WAAW,EACXO,iBAAiB,EACjBH,aAAa,EACbH,UAAU,EACVI,QAAQ,EACRF,eAAe,CAEvB,CAAC;EAED,OAAO;IAAEe;EAAmB,CAAC;AACjC,CAAC","ignoreList":[]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
export const useSliderButtonThumbKeyboard = ({
|
|
3
|
-
currentId,
|
|
4
|
-
currentIndex,
|
|
5
|
-
shownItemsCount,
|
|
6
|
-
items,
|
|
7
|
-
onSelectThumbItem
|
|
8
|
-
}) => {
|
|
9
|
-
const handleThumbKeyDown = useCallback(event => {
|
|
10
|
-
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
11
|
-
event.preventDefault();
|
|
12
|
-
const direction = event.key === 'ArrowRight' ? 1 : -1;
|
|
13
|
-
const maxVisibleIndex = Math.max(0, shownItemsCount - 1);
|
|
14
|
-
const nextIndex = Math.min(maxVisibleIndex, Math.max(0, currentIndex + direction));
|
|
15
|
-
if (nextIndex === currentIndex) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const hasMoreItems = items.length > shownItemsCount;
|
|
19
|
-
const nextId = hasMoreItems && nextIndex === shownItemsCount - 1 ? 'more' : items[nextIndex]?.id;
|
|
20
|
-
if (nextId) {
|
|
21
|
-
onSelectThumbItem(nextId, nextIndex);
|
|
22
|
-
}
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (event.key !== 'Enter' && event.key !== ' ') {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
event.preventDefault();
|
|
29
|
-
const fallbackId = currentId || items[currentIndex]?.id || items[0]?.id;
|
|
30
|
-
if (fallbackId) {
|
|
31
|
-
onSelectThumbItem(fallbackId, currentIndex);
|
|
32
|
-
}
|
|
33
|
-
}, [currentId, currentIndex, items, onSelectThumbItem, shownItemsCount]);
|
|
34
|
-
return {
|
|
35
|
-
handleThumbKeyDown
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=useSliderButtonThumbKeyboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSliderButtonThumbKeyboard.js","names":["useCallback","useSliderButtonThumbKeyboard","currentId","currentIndex","shownItemsCount","items","onSelectThumbItem","handleThumbKeyDown","event","key","preventDefault","direction","maxVisibleIndex","Math","max","nextIndex","min","hasMoreItems","length","nextId","id","fallbackId"],"sources":["../../../../src/components/slider-button/useSliderButtonThumbKeyboard.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport type { KeyboardEventHandler } from 'react';\nimport type { SliderButtonItem } from '../../types/slider-button';\n\ntype UseSliderButtonThumbKeyboardProps = {\n currentId: string;\n currentIndex: number;\n shownItemsCount: number;\n items: SliderButtonItem[];\n onSelectThumbItem: (id: string, index: number) => void;\n};\n\nexport const useSliderButtonThumbKeyboard = ({\n currentId,\n currentIndex,\n shownItemsCount,\n items,\n onSelectThumbItem,\n}: UseSliderButtonThumbKeyboardProps) => {\n const handleThumbKeyDown = useCallback<KeyboardEventHandler<HTMLDivElement>>(\n (event) => {\n if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n event.preventDefault();\n\n const direction = event.key === 'ArrowRight' ? 1 : -1;\n const maxVisibleIndex = Math.max(0, shownItemsCount - 1);\n const nextIndex = Math.min(maxVisibleIndex, Math.max(0, currentIndex + direction));\n\n if (nextIndex === currentIndex) {\n return;\n }\n\n const hasMoreItems = items.length > shownItemsCount;\n const nextId =\n hasMoreItems && nextIndex === shownItemsCount - 1\n ? 'more'\n : items[nextIndex]?.id;\n\n if (nextId) {\n onSelectThumbItem(nextId, nextIndex);\n }\n\n return;\n }\n\n if (event.key !== 'Enter' && event.key !== ' ') {\n return;\n }\n\n event.preventDefault();\n\n const fallbackId = currentId || items[currentIndex]?.id || items[0]?.id;\n\n if (fallbackId) {\n onSelectThumbItem(fallbackId, currentIndex);\n }\n },\n [currentId, currentIndex, items, onSelectThumbItem, shownItemsCount],\n );\n\n return { handleThumbKeyDown };\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AAYnC,OAAO,MAAMC,4BAA4B,GAAGA,CAAC;EACzCC,SAAS;EACTC,YAAY;EACZC,eAAe;EACfC,KAAK;EACLC;AAC+B,CAAC,KAAK;EACrC,MAAMC,kBAAkB,GAAGP,WAAW,CACjCQ,KAAK,IAAK;IACP,IAAIA,KAAK,CAACC,GAAG,KAAK,WAAW,IAAID,KAAK,CAACC,GAAG,KAAK,YAAY,EAAE;MACzDD,KAAK,CAACE,cAAc,CAAC,CAAC;MAEtB,MAAMC,SAAS,GAAGH,KAAK,CAACC,GAAG,KAAK,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC;MACrD,MAAMG,eAAe,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEV,eAAe,GAAG,CAAC,CAAC;MACxD,MAAMW,SAAS,GAAGF,IAAI,CAACG,GAAG,CAACJ,eAAe,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEX,YAAY,GAAGQ,SAAS,CAAC,CAAC;MAElF,IAAII,SAAS,KAAKZ,YAAY,EAAE;QAC5B;MACJ;MAEA,MAAMc,YAAY,GAAGZ,KAAK,CAACa,MAAM,GAAGd,eAAe;MACnD,MAAMe,MAAM,GACRF,YAAY,IAAIF,SAAS,KAAKX,eAAe,GAAG,CAAC,GAC3C,MAAM,GACNC,KAAK,CAACU,SAAS,CAAC,EAAEK,EAAE;MAE9B,IAAID,MAAM,EAAE;QACRb,iBAAiB,CAACa,MAAM,EAAEJ,SAAS,CAAC;MACxC;MAEA;IACJ;IAEA,IAAIP,KAAK,CAACC,GAAG,KAAK,OAAO,IAAID,KAAK,CAACC,GAAG,KAAK,GAAG,EAAE;MAC5C;IACJ;IAEAD,KAAK,CAACE,cAAc,CAAC,CAAC;IAEtB,MAAMW,UAAU,GAAGnB,SAAS,IAAIG,KAAK,CAACF,YAAY,CAAC,EAAEiB,EAAE,IAAIf,KAAK,CAAC,CAAC,CAAC,EAAEe,EAAE;IAEvE,IAAIC,UAAU,EAAE;MACZf,iBAAiB,CAACe,UAAU,EAAElB,YAAY,CAAC;IAC/C;EACJ,CAAC,EACD,CAACD,SAAS,EAAEC,YAAY,EAAEE,KAAK,EAAEC,iBAAiB,EAAEF,eAAe,CACvE,CAAC;EAED,OAAO;IAAEG;EAAmB,CAAC;AACjC,CAAC","ignoreList":[]}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return */
|
|
2
|
-
import { useContext, useEffect, useState } from 'react';
|
|
3
|
-
import { ColorSchemeContext } from '../components/color-scheme-provider/ColorSchemeProvider';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Tracks whether focus highlighting should be visible for keyboard navigation.
|
|
7
|
-
* Keyboard mode is enabled via Tab and reset by mouse interaction.
|
|
8
|
-
*/
|
|
9
|
-
export const useKeyboardFocusHighlighting = isEnabledProp => {
|
|
10
|
-
const colorScheme = useContext(ColorSchemeContext);
|
|
11
|
-
const contextIsEnabled = colorScheme?.shouldEnableKeyboardHighlighting === true;
|
|
12
|
-
const isEnabled = isEnabledProp ?? contextIsEnabled;
|
|
13
|
-
const [isKeyboardNavigation, setIsKeyboardNavigation] = useState(false);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const canListen = isEnabled && typeof window !== 'undefined';
|
|
16
|
-
const enableKeyboardNavigation = () => {
|
|
17
|
-
setIsKeyboardNavigation(true);
|
|
18
|
-
};
|
|
19
|
-
const handleKeyDown = event => {
|
|
20
|
-
// Ignore pure modifier presses, but treat any real keyboard interaction as keyboard navigation.
|
|
21
|
-
if (event.ctrlKey || event.altKey || event.metaKey) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (['Shift', 'Control', 'Alt', 'Meta'].includes(event.key)) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
enableKeyboardNavigation();
|
|
28
|
-
};
|
|
29
|
-
const handleFocusIn = event => {
|
|
30
|
-
const {
|
|
31
|
-
target
|
|
32
|
-
} = event;
|
|
33
|
-
|
|
34
|
-
// Fallback for first tab-focus when the keydown was not observed.
|
|
35
|
-
if (target instanceof HTMLElement && typeof target.matches === 'function' && target.matches(':focus-visible')) {
|
|
36
|
-
enableKeyboardNavigation();
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const disableKeyboardNavigation = () => {
|
|
40
|
-
setIsKeyboardNavigation(current => current ? false : current);
|
|
41
|
-
};
|
|
42
|
-
if (canListen) {
|
|
43
|
-
window.addEventListener('keydown', handleKeyDown);
|
|
44
|
-
window.addEventListener('focusin', handleFocusIn);
|
|
45
|
-
window.addEventListener('mousedown', disableKeyboardNavigation);
|
|
46
|
-
window.addEventListener('mousemove', disableKeyboardNavigation);
|
|
47
|
-
} else {
|
|
48
|
-
setIsKeyboardNavigation(false);
|
|
49
|
-
}
|
|
50
|
-
return () => {
|
|
51
|
-
if (canListen) {
|
|
52
|
-
window.removeEventListener('keydown', handleKeyDown);
|
|
53
|
-
window.removeEventListener('focusin', handleFocusIn);
|
|
54
|
-
window.removeEventListener('mousedown', disableKeyboardNavigation);
|
|
55
|
-
window.removeEventListener('mousemove', disableKeyboardNavigation);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}, [isEnabled]);
|
|
59
|
-
return Boolean(isEnabled && isKeyboardNavigation);
|
|
60
|
-
};
|
|
61
|
-
//# sourceMappingURL=useKeyboardFocusHighlighting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboardFocusHighlighting.js","names":["useContext","useEffect","useState","ColorSchemeContext","useKeyboardFocusHighlighting","isEnabledProp","colorScheme","contextIsEnabled","shouldEnableKeyboardHighlighting","isEnabled","isKeyboardNavigation","setIsKeyboardNavigation","canListen","window","enableKeyboardNavigation","handleKeyDown","event","ctrlKey","altKey","metaKey","includes","key","handleFocusIn","target","HTMLElement","matches","disableKeyboardNavigation","current","addEventListener","removeEventListener","Boolean"],"sources":["../../../src/hooks/useKeyboardFocusHighlighting.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return */\nimport { useContext, useEffect, useState } from 'react';\nimport {\n ColorSchemeContext,\n type ColorSchemeContextProps,\n} from '../components/color-scheme-provider/ColorSchemeProvider';\n\n/**\n * Tracks whether focus highlighting should be visible for keyboard navigation.\n * Keyboard mode is enabled via Tab and reset by mouse interaction.\n */\nexport const useKeyboardFocusHighlighting = (isEnabledProp?: boolean): boolean => {\n const colorScheme = useContext<ColorSchemeContextProps | undefined>(ColorSchemeContext);\n const contextIsEnabled: boolean = colorScheme?.shouldEnableKeyboardHighlighting === true;\n const isEnabled: boolean = isEnabledProp ?? contextIsEnabled;\n\n const [isKeyboardNavigation, setIsKeyboardNavigation] = useState(false);\n\n useEffect(() => {\n const canListen = isEnabled && typeof window !== 'undefined';\n\n const enableKeyboardNavigation = () => {\n setIsKeyboardNavigation(true);\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n // Ignore pure modifier presses, but treat any real keyboard interaction as keyboard navigation.\n if (event.ctrlKey || event.altKey || event.metaKey) {\n return;\n }\n\n if (['Shift', 'Control', 'Alt', 'Meta'].includes(event.key)) {\n return;\n }\n\n enableKeyboardNavigation();\n };\n\n const handleFocusIn = (event: FocusEvent) => {\n const { target } = event;\n\n // Fallback for first tab-focus when the keydown was not observed.\n if (\n target instanceof HTMLElement &&\n typeof target.matches === 'function' &&\n target.matches(':focus-visible')\n ) {\n enableKeyboardNavigation();\n }\n };\n\n const disableKeyboardNavigation = () => {\n setIsKeyboardNavigation((current) => (current ? false : current));\n };\n\n if (canListen) {\n window.addEventListener('keydown', handleKeyDown);\n window.addEventListener('focusin', handleFocusIn);\n window.addEventListener('mousedown', disableKeyboardNavigation);\n window.addEventListener('mousemove', disableKeyboardNavigation);\n } else {\n setIsKeyboardNavigation(false);\n }\n\n return () => {\n if (canListen) {\n window.removeEventListener('keydown', handleKeyDown);\n window.removeEventListener('focusin', handleFocusIn);\n window.removeEventListener('mousedown', disableKeyboardNavigation);\n window.removeEventListener('mousemove', disableKeyboardNavigation);\n }\n };\n }, [isEnabled]);\n\n return Boolean(isEnabled && isKeyboardNavigation);\n};\n"],"mappings":"AAAA;AACA,SAASA,UAAU,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACvD,SACIC,kBAAkB,QAEf,yDAAyD;;AAEhE;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GAAIC,aAAuB,IAAc;EAC9E,MAAMC,WAAW,GAAGN,UAAU,CAAsCG,kBAAkB,CAAC;EACvF,MAAMI,gBAAyB,GAAGD,WAAW,EAAEE,gCAAgC,KAAK,IAAI;EACxF,MAAMC,SAAkB,GAAGJ,aAAa,IAAIE,gBAAgB;EAE5D,MAAM,CAACG,oBAAoB,EAAEC,uBAAuB,CAAC,GAAGT,QAAQ,CAAC,KAAK,CAAC;EAEvED,SAAS,CAAC,MAAM;IACZ,MAAMW,SAAS,GAAGH,SAAS,IAAI,OAAOI,MAAM,KAAK,WAAW;IAE5D,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;MACnCH,uBAAuB,CAAC,IAAI,CAAC;IACjC,CAAC;IAED,MAAMI,aAAa,GAAIC,KAAoB,IAAK;MAC5C;MACA,IAAIA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACE,MAAM,IAAIF,KAAK,CAACG,OAAO,EAAE;QAChD;MACJ;MAEA,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAACC,QAAQ,CAACJ,KAAK,CAACK,GAAG,CAAC,EAAE;QACzD;MACJ;MAEAP,wBAAwB,CAAC,CAAC;IAC9B,CAAC;IAED,MAAMQ,aAAa,GAAIN,KAAiB,IAAK;MACzC,MAAM;QAAEO;MAAO,CAAC,GAAGP,KAAK;;MAExB;MACA,IACIO,MAAM,YAAYC,WAAW,IAC7B,OAAOD,MAAM,CAACE,OAAO,KAAK,UAAU,IACpCF,MAAM,CAACE,OAAO,CAAC,gBAAgB,CAAC,EAClC;QACEX,wBAAwB,CAAC,CAAC;MAC9B;IACJ,CAAC;IAED,MAAMY,yBAAyB,GAAGA,CAAA,KAAM;MACpCf,uBAAuB,CAAEgB,OAAO,IAAMA,OAAO,GAAG,KAAK,GAAGA,OAAQ,CAAC;IACrE,CAAC;IAED,IAAIf,SAAS,EAAE;MACXC,MAAM,CAACe,gBAAgB,CAAC,SAAS,EAAEb,aAAa,CAAC;MACjDF,MAAM,CAACe,gBAAgB,CAAC,SAAS,EAAEN,aAAa,CAAC;MACjDT,MAAM,CAACe,gBAAgB,CAAC,WAAW,EAAEF,yBAAyB,CAAC;MAC/Db,MAAM,CAACe,gBAAgB,CAAC,WAAW,EAAEF,yBAAyB,CAAC;IACnE,CAAC,MAAM;MACHf,uBAAuB,CAAC,KAAK,CAAC;IAClC;IAEA,OAAO,MAAM;MACT,IAAIC,SAAS,EAAE;QACXC,MAAM,CAACgB,mBAAmB,CAAC,SAAS,EAAEd,aAAa,CAAC;QACpDF,MAAM,CAACgB,mBAAmB,CAAC,SAAS,EAAEP,aAAa,CAAC;QACpDT,MAAM,CAACgB,mBAAmB,CAAC,WAAW,EAAEH,yBAAyB,CAAC;QAClEb,MAAM,CAACgB,mBAAmB,CAAC,WAAW,EAAEH,yBAAyB,CAAC;MACtE;IACJ,CAAC;EACL,CAAC,EAAE,CAACjB,SAAS,CAAC,CAAC;EAEf,OAAOqB,OAAO,CAACrB,SAAS,IAAIC,oBAAoB,CAAC;AACrD,CAAC","ignoreList":[]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { css } from 'styled-components';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Shared focus ring for components with keyboard-only highlighting.
|
|
5
|
-
* Apply this only when keyboard highlighting is enabled/active.
|
|
6
|
-
*/
|
|
7
|
-
export const keyboardFocusHighlightingRingCss = css`
|
|
8
|
-
outline: solid 2px color-mix(in srgb, white 70%, transparent);
|
|
9
|
-
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
|
|
10
|
-
border-radius: 3px;
|
|
11
|
-
outline-offset: 1px;
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Circular focus ring variant for round controls (e.g. RadioButton).
|
|
16
|
-
*/
|
|
17
|
-
export const keyboardFocusHighlightingCircleRingCss = css`
|
|
18
|
-
outline: solid 2px color-mix(in srgb, white 70%, transparent);
|
|
19
|
-
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
|
|
20
|
-
border-radius: 50%;
|
|
21
|
-
outline-offset: 1px;
|
|
22
|
-
color: white;
|
|
23
|
-
`;
|
|
24
|
-
//# sourceMappingURL=keyboardFocusHighlighting.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyboardFocusHighlighting.styles.js","names":["css","keyboardFocusHighlightingRingCss","keyboardFocusHighlightingCircleRingCss"],"sources":["../../../src/utils/keyboardFocusHighlighting.styles.ts"],"sourcesContent":["import { css } from 'styled-components';\n\n/**\n * Shared focus ring for components with keyboard-only highlighting.\n * Apply this only when keyboard highlighting is enabled/active.\n */\nexport const keyboardFocusHighlightingRingCss = css`\n outline: solid 2px color-mix(in srgb, white 70%, transparent);\n box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);\n border-radius: 3px;\n outline-offset: 1px;\n`;\n\n/**\n * Circular focus ring variant for round controls (e.g. RadioButton).\n */\nexport const keyboardFocusHighlightingCircleRingCss = css`\n outline: solid 2px color-mix(in srgb, white 70%, transparent);\n box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);\n border-radius: 50%;\n outline-offset: 1px;\n color: white;\n`;\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,mBAAmB;;AAEvC;AACA;AACA;AACA;AACA,OAAO,MAAMC,gCAAgC,GAAGD,GAAG;AACnD;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAME,sCAAsC,GAAGF,GAAG;AACzD;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|