@chayns-components/core 5.3.9 → 5.3.11-alpha.0
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 +73 -2
- package/lib/cjs/components/accordion/Accordion.js +107 -12
- package/lib/cjs/components/accordion/Accordion.js.map +1 -1
- package/lib/cjs/components/accordion/Accordion.styles.js +23 -3
- package/lib/cjs/components/accordion/Accordion.styles.js.map +1 -1
- package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js +3 -1
- package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
- package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js +36 -19
- package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
- package/lib/cjs/components/accordion/accordion-head/AccordionHead.js +6 -3
- package/lib/cjs/components/accordion/accordion-head/AccordionHead.js.map +1 -1
- package/lib/cjs/components/accordion/accordion-head/AccordionHead.styles.js +14 -0
- package/lib/cjs/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
- package/lib/cjs/components/amount-control/AmountControl.js +31 -17
- package/lib/cjs/components/amount-control/AmountControl.js.map +1 -1
- package/lib/cjs/components/amount-control/AmountControl.styles.js +18 -2
- package/lib/cjs/components/amount-control/AmountControl.styles.js.map +1 -1
- package/lib/cjs/components/button/Button.js +5 -1
- package/lib/cjs/components/button/Button.js.map +1 -1
- package/lib/cjs/components/button/Button.styles.js +17 -0
- 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 +5 -1
- package/lib/cjs/components/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/components/checkbox/Checkbox.styles.js +29 -2
- package/lib/cjs/components/checkbox/Checkbox.styles.js.map +1 -1
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +7 -2
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js +8 -2
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
- package/lib/cjs/components/combobox/ComboBox.js +52 -5
- package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
- package/lib/cjs/components/combobox/ComboBox.styles.js +11 -0
- 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 +100 -6
- package/lib/cjs/components/context-menu/ContextMenu.js.map +1 -1
- package/lib/cjs/components/context-menu/ContextMenu.styles.js +38 -0
- 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/file-input/FileInput.js +4 -2
- package/lib/cjs/components/file-input/FileInput.js.map +1 -1
- package/lib/cjs/components/file-list/file-item/FileItem.js +23 -2
- package/lib/cjs/components/file-list/file-item/FileItem.js.map +1 -1
- package/lib/cjs/components/file-list/file-item/FileItem.styles.js +19 -1
- package/lib/cjs/components/file-list/file-item/FileItem.styles.js.map +1 -1
- package/lib/cjs/components/file-select/FileSelect.js +27 -4
- package/lib/cjs/components/file-select/FileSelect.js.map +1 -1
- package/lib/cjs/components/file-select/FileSelect.styles.js +10 -0
- package/lib/cjs/components/file-select/FileSelect.styles.js.map +1 -1
- package/lib/cjs/components/filter/Filter.js +51 -16
- package/lib/cjs/components/filter/Filter.js.map +1 -1
- package/lib/cjs/components/filter/Filter.styles.js +9 -0
- package/lib/cjs/components/filter/Filter.styles.js.map +1 -1
- package/lib/cjs/components/filter/filter-content/FilterContent.js +14 -5
- 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 +69 -4
- package/lib/cjs/components/filter-buttons/FilterButtons.js.map +1 -1
- package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js +40 -2
- package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
- package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js +11 -0
- package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
- package/lib/cjs/components/grid-image/GridImage.js +20 -2
- package/lib/cjs/components/grid-image/GridImage.js.map +1 -1
- package/lib/cjs/components/grid-image/GridImage.styles.js +11 -2
- package/lib/cjs/components/grid-image/GridImage.styles.js.map +1 -1
- package/lib/cjs/components/grouped-image/GroupedImage.js +23 -4
- package/lib/cjs/components/grouped-image/GroupedImage.js.map +1 -1
- package/lib/cjs/components/grouped-image/GroupedImage.styles.js +9 -0
- package/lib/cjs/components/grouped-image/GroupedImage.styles.js.map +1 -1
- package/lib/cjs/components/highlight-slider/HighlightSlider.js +10 -3
- package/lib/cjs/components/highlight-slider/HighlightSlider.js.map +1 -1
- package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +21 -4
- 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 +11 -2
- package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
- package/lib/cjs/components/icon/Icon.js +24 -5
- package/lib/cjs/components/icon/Icon.js.map +1 -1
- package/lib/cjs/components/icon/Icon.styles.js +23 -0
- package/lib/cjs/components/icon/Icon.styles.js.map +1 -1
- package/lib/cjs/components/input/Input.js +29 -8
- package/lib/cjs/components/input/Input.js.map +1 -1
- package/lib/cjs/components/input/Input.styles.js +33 -3
- package/lib/cjs/components/input/Input.styles.js.map +1 -1
- package/lib/cjs/components/list/List.js +124 -37
- package/lib/cjs/components/list/List.js.map +1 -1
- package/lib/cjs/components/list/List.utils.js +107 -1
- package/lib/cjs/components/list/List.utils.js.map +1 -1
- package/lib/cjs/components/list/list-item/ListItem.js +82 -3
- package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
- package/lib/cjs/components/list/list-item/ListItem.styles.js +9 -0
- 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 +40 -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 +5 -1
- 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 +32 -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 +32 -1
- 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 +30 -1
- package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
- package/lib/cjs/components/list/list-item/useListItemFocus.js +47 -0
- package/lib/cjs/components/list/list-item/useListItemFocus.js.map +1 -0
- package/lib/cjs/components/masonry/Masonry.context.js +17 -0
- package/lib/cjs/components/masonry/Masonry.context.js.map +1 -0
- package/lib/cjs/components/masonry/Masonry.hooks.js +53 -0
- package/lib/cjs/components/masonry/Masonry.hooks.js.map +1 -0
- package/lib/cjs/components/masonry/Masonry.js +81 -0
- package/lib/cjs/components/masonry/Masonry.js.map +1 -0
- package/lib/cjs/components/masonry/Masonry.styles.js +16 -0
- package/lib/cjs/components/masonry/Masonry.styles.js.map +1 -0
- package/lib/cjs/components/masonry/Masonry.types.js +6 -0
- package/lib/cjs/components/masonry/Masonry.types.js.map +1 -0
- package/lib/cjs/components/masonry/Masonry.utils.js +121 -0
- package/lib/cjs/components/masonry/Masonry.utils.js.map +1 -0
- package/lib/cjs/components/masonry/masonry-item/MasonryItem.js +77 -0
- package/lib/cjs/components/masonry/masonry-item/MasonryItem.js.map +1 -0
- package/lib/cjs/components/masonry/masonry-item/MasonryItem.styles.js +17 -0
- package/lib/cjs/components/masonry/masonry-item/MasonryItem.styles.js.map +1 -0
- package/lib/cjs/components/mention-finder/MentionFinder.js +31 -2
- 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 +36 -3
- package/lib/cjs/components/multi-action-button/MultiActionButton.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 +7 -1
- 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 +12 -0
- package/lib/cjs/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
- package/lib/cjs/components/number-input/NumberInput.js +13 -10
- package/lib/cjs/components/number-input/NumberInput.js.map +1 -1
- package/lib/cjs/components/page-provider/PageProvider.js +4 -2
- package/lib/cjs/components/page-provider/PageProvider.js.map +1 -1
- package/lib/cjs/components/popup/Popup.js +8 -1
- package/lib/cjs/components/popup/Popup.js.map +1 -1
- package/lib/cjs/components/radio-button/RadioButton.js +29 -15
- package/lib/cjs/components/radio-button/RadioButton.js.map +1 -1
- package/lib/cjs/components/radio-button/RadioButton.styles.js +19 -8
- package/lib/cjs/components/radio-button/RadioButton.styles.js.map +1 -1
- package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js +7 -4
- package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/lib/cjs/components/search-box/SearchBox.js +5 -2
- package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
- package/lib/cjs/components/search-input/SearchInput.js +40 -41
- package/lib/cjs/components/search-input/SearchInput.js.map +1 -1
- package/lib/cjs/components/search-input/SearchInput.styles.js +25 -2
- package/lib/cjs/components/search-input/SearchInput.styles.js.map +1 -1
- package/lib/cjs/components/select-button/SelectButton.js +4 -2
- package/lib/cjs/components/select-button/SelectButton.js.map +1 -1
- package/lib/cjs/components/setup-wizard/SetupWizard.js +7 -4
- package/lib/cjs/components/setup-wizard/SetupWizard.js.map +1 -1
- package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +5 -3
- package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
- package/lib/cjs/components/sharing-bar/SharingBar.js +31 -6
- package/lib/cjs/components/sharing-bar/SharingBar.js.map +1 -1
- package/lib/cjs/components/sharing-bar/SharingBar.styles.js +5 -0
- package/lib/cjs/components/sharing-bar/SharingBar.styles.js.map +1 -1
- package/lib/cjs/components/sharing-button/SharingButton.js +4 -2
- package/lib/cjs/components/sharing-button/SharingButton.js.map +1 -1
- package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js +3 -1
- package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
- package/lib/cjs/components/signature/Signature.js +6 -3
- package/lib/cjs/components/signature/Signature.js.map +1 -1
- package/lib/cjs/components/slider/Slider.js +30 -7
- package/lib/cjs/components/slider/Slider.js.map +1 -1
- package/lib/cjs/components/slider/Slider.styles.js +9 -2
- package/lib/cjs/components/slider/Slider.styles.js.map +1 -1
- package/lib/cjs/components/slider-button/SliderButton.js +63 -6
- package/lib/cjs/components/slider-button/SliderButton.js.map +1 -1
- package/lib/cjs/components/slider-button/SliderButton.styles.js +19 -2
- package/lib/cjs/components/slider-button/SliderButton.styles.js.map +1 -1
- package/lib/cjs/components/slider-button/SliderButton.types.js +6 -0
- package/lib/cjs/components/slider-button/SliderButton.types.js.map +1 -0
- package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js +66 -0
- package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js.map +1 -0
- package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js +47 -0
- package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js.map +1 -0
- package/lib/cjs/components/tag-input/TagInput.js +91 -36
- package/lib/cjs/components/tag-input/TagInput.js.map +1 -1
- package/lib/cjs/components/tag-input/TagInput.styles.js +31 -3
- package/lib/cjs/components/tag-input/TagInput.styles.js.map +1 -1
- package/lib/cjs/components/text-area/TextArea.js +17 -8
- package/lib/cjs/components/text-area/TextArea.js.map +1 -1
- package/lib/cjs/components/text-area/TextArea.styles.js +15 -1
- package/lib/cjs/components/text-area/TextArea.styles.js.map +1 -1
- package/lib/cjs/components/truncation/Truncation.js +17 -3
- package/lib/cjs/components/truncation/Truncation.js.map +1 -1
- package/lib/cjs/components/truncation/Truncation.styles.js +19 -1
- package/lib/cjs/components/truncation/Truncation.styles.js.map +1 -1
- package/lib/cjs/hooks/useKeyboardFocusHighlighting.js +68 -0
- package/lib/cjs/hooks/useKeyboardFocusHighlighting.js.map +1 -0
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/utils/file.js.map +1 -1
- package/lib/cjs/utils/keyboardFocusHighlighting.styles.js +30 -0
- package/lib/cjs/utils/keyboardFocusHighlighting.styles.js.map +1 -0
- package/lib/esm/components/accordion/Accordion.js +105 -12
- package/lib/esm/components/accordion/Accordion.js.map +1 -1
- package/lib/esm/components/accordion/Accordion.styles.js +23 -3
- package/lib/esm/components/accordion/Accordion.styles.js.map +1 -1
- package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js +3 -1
- package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
- package/lib/esm/components/accordion/accordion-group/AccordionGroup.js +33 -19
- package/lib/esm/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
- package/lib/esm/components/accordion/accordion-head/AccordionHead.js +6 -3
- package/lib/esm/components/accordion/accordion-head/AccordionHead.js.map +1 -1
- package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js +14 -0
- package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
- package/lib/esm/components/amount-control/AmountControl.js +30 -16
- package/lib/esm/components/amount-control/AmountControl.js.map +1 -1
- package/lib/esm/components/amount-control/AmountControl.styles.js +18 -2
- package/lib/esm/components/amount-control/AmountControl.styles.js.map +1 -1
- package/lib/esm/components/button/Button.js +5 -1
- package/lib/esm/components/button/Button.js.map +1 -1
- package/lib/esm/components/button/Button.styles.js +17 -0
- 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 +5 -1
- package/lib/esm/components/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/components/checkbox/Checkbox.styles.js +29 -2
- package/lib/esm/components/checkbox/Checkbox.styles.js.map +1 -1
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +7 -2
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js +8 -2
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.js +50 -5
- package/lib/esm/components/combobox/ComboBox.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.styles.js +11 -0
- 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 +99 -5
- package/lib/esm/components/context-menu/ContextMenu.js.map +1 -1
- package/lib/esm/components/context-menu/ContextMenu.styles.js +38 -0
- 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/file-input/FileInput.js +4 -2
- package/lib/esm/components/file-input/FileInput.js.map +1 -1
- package/lib/esm/components/file-list/file-item/FileItem.js +24 -3
- package/lib/esm/components/file-list/file-item/FileItem.js.map +1 -1
- package/lib/esm/components/file-list/file-item/FileItem.styles.js +18 -0
- package/lib/esm/components/file-list/file-item/FileItem.styles.js.map +1 -1
- package/lib/esm/components/file-select/FileSelect.js +27 -4
- package/lib/esm/components/file-select/FileSelect.js.map +1 -1
- package/lib/esm/components/file-select/FileSelect.styles.js +10 -0
- package/lib/esm/components/file-select/FileSelect.styles.js.map +1 -1
- package/lib/esm/components/filter/Filter.js +52 -16
- package/lib/esm/components/filter/Filter.js.map +1 -1
- package/lib/esm/components/filter/Filter.styles.js +9 -0
- package/lib/esm/components/filter/Filter.styles.js.map +1 -1
- package/lib/esm/components/filter/filter-content/FilterContent.js +15 -5
- 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 +69 -5
- package/lib/esm/components/filter-buttons/FilterButtons.js.map +1 -1
- package/lib/esm/components/filter-buttons/filter-button/FilterButton.js +40 -2
- package/lib/esm/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
- package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js +11 -0
- package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
- package/lib/esm/components/grid-image/GridImage.js +20 -2
- package/lib/esm/components/grid-image/GridImage.js.map +1 -1
- package/lib/esm/components/grid-image/GridImage.styles.js +10 -1
- package/lib/esm/components/grid-image/GridImage.styles.js.map +1 -1
- package/lib/esm/components/grouped-image/GroupedImage.js +22 -4
- package/lib/esm/components/grouped-image/GroupedImage.js.map +1 -1
- package/lib/esm/components/grouped-image/GroupedImage.styles.js +9 -0
- package/lib/esm/components/grouped-image/GroupedImage.styles.js.map +1 -1
- package/lib/esm/components/highlight-slider/HighlightSlider.js +10 -3
- package/lib/esm/components/highlight-slider/HighlightSlider.js.map +1 -1
- package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +20 -3
- 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 +10 -1
- package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
- package/lib/esm/components/icon/Icon.js +26 -7
- package/lib/esm/components/icon/Icon.js.map +1 -1
- package/lib/esm/components/icon/Icon.styles.js +23 -0
- package/lib/esm/components/icon/Icon.styles.js.map +1 -1
- package/lib/esm/components/input/Input.js +24 -4
- package/lib/esm/components/input/Input.js.map +1 -1
- package/lib/esm/components/input/Input.styles.js +33 -3
- package/lib/esm/components/input/Input.styles.js.map +1 -1
- package/lib/esm/components/list/List.js +123 -37
- package/lib/esm/components/list/List.js.map +1 -1
- package/lib/esm/components/list/List.utils.js +99 -0
- package/lib/esm/components/list/List.utils.js.map +1 -1
- package/lib/esm/components/list/list-item/ListItem.js +83 -4
- package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
- package/lib/esm/components/list/list-item/ListItem.styles.js +9 -0
- 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 +41 -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 +4 -0
- 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 +33 -2
- 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 +33 -2
- 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 +30 -1
- package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
- package/lib/esm/components/list/list-item/useListItemFocus.js +40 -0
- package/lib/esm/components/list/list-item/useListItemFocus.js.map +1 -0
- package/lib/esm/components/masonry/Masonry.context.js +10 -0
- package/lib/esm/components/masonry/Masonry.context.js.map +1 -0
- package/lib/esm/components/masonry/Masonry.hooks.js +44 -0
- package/lib/esm/components/masonry/Masonry.hooks.js.map +1 -0
- package/lib/esm/components/masonry/Masonry.js +74 -0
- package/lib/esm/components/masonry/Masonry.js.map +1 -0
- package/lib/esm/components/masonry/Masonry.styles.js +9 -0
- package/lib/esm/components/masonry/Masonry.styles.js.map +1 -0
- package/lib/esm/components/masonry/Masonry.types.js +2 -0
- package/lib/esm/components/masonry/Masonry.types.js.map +1 -0
- package/lib/esm/components/masonry/Masonry.utils.js +110 -0
- package/lib/esm/components/masonry/Masonry.utils.js.map +1 -0
- package/lib/esm/components/masonry/masonry-item/MasonryItem.js +69 -0
- package/lib/esm/components/masonry/masonry-item/MasonryItem.js.map +1 -0
- package/lib/esm/components/masonry/masonry-item/MasonryItem.styles.js +10 -0
- package/lib/esm/components/masonry/masonry-item/MasonryItem.styles.js.map +1 -0
- package/lib/esm/components/mention-finder/MentionFinder.js +30 -2
- 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 +36 -3
- package/lib/esm/components/multi-action-button/MultiActionButton.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 +7 -1
- 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 +12 -0
- package/lib/esm/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
- package/lib/esm/components/number-input/NumberInput.js +13 -10
- package/lib/esm/components/number-input/NumberInput.js.map +1 -1
- package/lib/esm/components/page-provider/PageProvider.js +4 -2
- package/lib/esm/components/page-provider/PageProvider.js.map +1 -1
- package/lib/esm/components/popup/Popup.js +8 -1
- package/lib/esm/components/popup/Popup.js.map +1 -1
- package/lib/esm/components/radio-button/RadioButton.js +29 -15
- package/lib/esm/components/radio-button/RadioButton.js.map +1 -1
- package/lib/esm/components/radio-button/RadioButton.styles.js +19 -8
- package/lib/esm/components/radio-button/RadioButton.styles.js.map +1 -1
- package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js +7 -4
- package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/lib/esm/components/search-box/SearchBox.js +5 -2
- package/lib/esm/components/search-box/SearchBox.js.map +1 -1
- package/lib/esm/components/search-input/SearchInput.js +41 -42
- package/lib/esm/components/search-input/SearchInput.js.map +1 -1
- package/lib/esm/components/search-input/SearchInput.styles.js +24 -1
- package/lib/esm/components/search-input/SearchInput.styles.js.map +1 -1
- package/lib/esm/components/select-button/SelectButton.js +4 -2
- package/lib/esm/components/select-button/SelectButton.js.map +1 -1
- package/lib/esm/components/setup-wizard/SetupWizard.js +7 -4
- package/lib/esm/components/setup-wizard/SetupWizard.js.map +1 -1
- package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +5 -3
- package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
- package/lib/esm/components/sharing-bar/SharingBar.js +30 -5
- package/lib/esm/components/sharing-bar/SharingBar.js.map +1 -1
- package/lib/esm/components/sharing-bar/SharingBar.styles.js +5 -0
- package/lib/esm/components/sharing-bar/SharingBar.styles.js.map +1 -1
- package/lib/esm/components/sharing-button/SharingButton.js +4 -2
- package/lib/esm/components/sharing-button/SharingButton.js.map +1 -1
- package/lib/esm/components/sharing-context-menu/SharingContextMenu.js +3 -1
- package/lib/esm/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
- package/lib/esm/components/signature/Signature.js +6 -3
- package/lib/esm/components/signature/Signature.js.map +1 -1
- package/lib/esm/components/slider/Slider.js +30 -7
- package/lib/esm/components/slider/Slider.js.map +1 -1
- package/lib/esm/components/slider/Slider.styles.js +8 -1
- package/lib/esm/components/slider/Slider.styles.js.map +1 -1
- package/lib/esm/components/slider-button/SliderButton.js +62 -6
- package/lib/esm/components/slider-button/SliderButton.js.map +1 -1
- package/lib/esm/components/slider-button/SliderButton.styles.js +18 -1
- package/lib/esm/components/slider-button/SliderButton.styles.js.map +1 -1
- package/lib/esm/components/slider-button/SliderButton.types.js +2 -0
- package/lib/esm/components/slider-button/SliderButton.types.js.map +1 -0
- package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js +56 -0
- package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js.map +1 -0
- package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js +38 -0
- package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js.map +1 -0
- package/lib/esm/components/tag-input/TagInput.js +85 -35
- package/lib/esm/components/tag-input/TagInput.js.map +1 -1
- package/lib/esm/components/tag-input/TagInput.styles.js +29 -1
- package/lib/esm/components/tag-input/TagInput.styles.js.map +1 -1
- package/lib/esm/components/text-area/TextArea.js +18 -9
- package/lib/esm/components/text-area/TextArea.js.map +1 -1
- package/lib/esm/components/text-area/TextArea.styles.js +14 -0
- package/lib/esm/components/text-area/TextArea.styles.js.map +1 -1
- package/lib/esm/components/truncation/Truncation.js +18 -4
- package/lib/esm/components/truncation/Truncation.js.map +1 -1
- package/lib/esm/components/truncation/Truncation.styles.js +18 -0
- package/lib/esm/components/truncation/Truncation.styles.js.map +1 -1
- package/lib/esm/hooks/useKeyboardFocusHighlighting.js +61 -0
- package/lib/esm/hooks/useKeyboardFocusHighlighting.js.map +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/utils/file.js.map +1 -1
- package/lib/esm/utils/keyboardFocusHighlighting.styles.js +25 -0
- package/lib/esm/utils/keyboardFocusHighlighting.styles.js.map +1 -0
- package/lib/types/components/accordion/Accordion.d.ts +5 -0
- package/lib/types/components/accordion/Accordion.styles.d.ts +8 -4
- package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +2 -2
- package/lib/types/components/accordion/accordion-group/AccordionGroup.d.ts +7 -2
- package/lib/types/components/accordion/accordion-head/AccordionHead.d.ts +1 -0
- package/lib/types/components/accordion/accordion-head/AccordionHead.styles.d.ts +18 -18
- package/lib/types/components/amount-control/AmountControl.d.ts +5 -0
- package/lib/types/components/amount-control/AmountControl.styles.d.ts +8 -4
- package/lib/types/components/button/Button.styles.d.ts +8 -6
- package/lib/types/components/button/Button.types.d.ts +8 -0
- package/lib/types/components/checkbox/Checkbox.d.ts +4 -0
- package/lib/types/components/checkbox/Checkbox.styles.d.ts +5 -1
- package/lib/types/components/color-scheme-provider/ColorSchemeProvider.d.ts +5 -0
- package/lib/types/components/combobox/ComboBox.styles.d.ts +4 -2
- package/lib/types/components/combobox/ComboBox.types.d.ts +5 -0
- package/lib/types/components/context-menu/ContextMenu.styles.d.ts +4 -2
- package/lib/types/components/context-menu/ContextMenu.types.d.ts +6 -0
- 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 +4 -0
- package/lib/types/components/file-input/FileInput.styles.d.ts +2 -2
- package/lib/types/components/file-list/file-item/FileItem.styles.d.ts +3 -0
- package/lib/types/components/file-select/FileSelect.d.ts +4 -0
- package/lib/types/components/file-select/FileSelect.styles.d.ts +6 -4
- package/lib/types/components/filter/Filter.d.ts +1 -0
- package/lib/types/components/filter/Filter.styles.d.ts +6 -4
- package/lib/types/components/filter/filter-content/FilterContent.types.d.ts +4 -0
- package/lib/types/components/filter-buttons/FilterButtons.d.ts +4 -0
- package/lib/types/components/filter-buttons/filter-button/FilterButton.d.ts +5 -0
- package/lib/types/components/filter-buttons/filter-button/FilterButton.styles.d.ts +12 -8
- package/lib/types/components/grid-image/GridImage.d.ts +4 -0
- package/lib/types/components/grid-image/GridImage.styles.d.ts +4 -2
- package/lib/types/components/grouped-image/GroupedImage.d.ts +4 -0
- package/lib/types/components/grouped-image/GroupedImage.styles.d.ts +8 -6
- package/lib/types/components/highlight-slider/HighlightSlider.d.ts +4 -0
- package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.d.ts +3 -0
- package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.d.ts +9 -5
- package/lib/types/components/icon/Icon.d.ts +4 -0
- package/lib/types/components/icon/Icon.styles.d.ts +1 -0
- package/lib/types/components/input/Input.d.ts +4 -0
- package/lib/types/components/input/Input.styles.d.ts +17 -9
- package/lib/types/components/list/List.d.ts +11 -0
- package/lib/types/components/list/List.utils.d.ts +16 -1
- 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.d.ts +1 -0
- package/lib/types/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +195 -194
- package/lib/types/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.d.ts +1 -0
- package/lib/types/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.d.ts +1 -0
- package/lib/types/components/list/list-item/list-item-head/list-item-title/ListItemTitle.d.ts +1 -0
- package/lib/types/components/list/list-item/useListItemFocus.d.ts +13 -0
- package/lib/types/components/masonry/Masonry.context.d.ts +3 -0
- package/lib/types/components/masonry/Masonry.d.ts +3 -0
- package/lib/types/components/masonry/Masonry.hooks.d.ts +22 -0
- package/lib/types/components/masonry/Masonry.styles.d.ts +5 -0
- package/lib/types/components/masonry/Masonry.types.d.ts +40 -0
- package/lib/types/components/masonry/Masonry.utils.d.ts +22 -0
- package/lib/types/components/masonry/masonry-item/MasonryItem.d.ts +5 -0
- package/lib/types/components/masonry/masonry-item/MasonryItem.styles.d.ts +5 -0
- 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 +7 -0
- package/lib/types/components/multi-action-button/action-button/ActionButton.d.ts +4 -1
- package/lib/types/components/multi-action-button/action-button/ActionButton.styles.d.ts +4 -2
- package/lib/types/components/number-input/NumberInput.d.ts +4 -0
- 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 +4 -0
- package/lib/types/components/radio-button/RadioButton.styles.d.ts +15 -9
- package/lib/types/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +5 -0
- package/lib/types/components/search-box/SearchBox.d.ts +4 -0
- package/lib/types/components/search-box/SearchBox.styles.d.ts +2 -2
- package/lib/types/components/search-input/SearchInput.d.ts +4 -0
- package/lib/types/components/search-input/SearchInput.styles.d.ts +17 -9
- package/lib/types/components/select-button/SelectButton.d.ts +4 -0
- package/lib/types/components/setup-wizard/SetupWizard.d.ts +5 -0
- package/lib/types/components/sharing-bar/SharingBar.d.ts +4 -0
- package/lib/types/components/sharing-button/SharingButton.d.ts +1 -1
- package/lib/types/components/sharing-context-menu/SharingContextMenu.d.ts +10 -2
- package/lib/types/components/signature/Signature.d.ts +4 -0
- package/lib/types/components/skeleton/base-skeleton/BaseSkeleton.styles.d.ts +4 -4
- package/lib/types/components/slider/Slider.d.ts +8 -0
- package/lib/types/components/slider/Slider.styles.d.ts +18 -14
- package/lib/types/components/slider-button/SliderButton.d.ts +1 -28
- package/lib/types/components/slider-button/SliderButton.styles.d.ts +6 -4
- package/lib/types/components/slider-button/SliderButton.types.d.ts +32 -0
- package/lib/types/components/slider-button/useSliderButtonPopupKeyboard.d.ts +17 -0
- package/lib/types/components/slider-button/useSliderButtonThumbKeyboard.d.ts +13 -0
- package/lib/types/components/tag-input/TagInput.d.ts +4 -0
- package/lib/types/components/tag-input/TagInput.styles.d.ts +12 -2
- package/lib/types/components/text-area/TextArea.d.ts +4 -0
- package/lib/types/components/text-area/TextArea.styles.d.ts +1 -0
- package/lib/types/components/truncation/Truncation.d.ts +4 -0
- package/lib/types/components/truncation/Truncation.styles.d.ts +7 -2
- package/lib/types/hooks/useKeyboardFocusHighlighting.d.ts +5 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/utils/file.d.ts +1 -1
- package/lib/types/utils/keyboardFocusHighlighting.styles.d.ts +9 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Truncation.js","names":["React","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","ClampPosition","debounce","truncateElement","StyledMotionTruncationContent","StyledTruncation","StyledTruncationClamp","StyledTruncationClampWrapper","StyledTruncationPseudoContent","Textstring","TextstringProvider","ttsToITextString","textStrings","useIsomorphicLayoutEffect","window","Truncation","collapsedHeight","clampPosition","Right","isOpen","moreLabel","lessLabel","onChange","children","internalIsOpen","setInternalIsOpen","showClamp","setShowClamp","newCollapsedHeight","setNewCollapsedHeight","originalHeight","setOriginalHeight","shouldShowCollapsedElement","setShouldShowCollapsedElement","hasSizeChanged","setHasSizeChanged","initialRender","setInitialRender","shouldSkipChangeCheck","setShouldSkipChangeCheck","originalSmallHeight","setOriginalSmallHeight","originalBigHeight","setOriginalBigHeight","parentRef","pseudoChildrenRef","childrenRef","originalChildrenRef","hasCollapsed","isAnimating","hasSizeRecentlyChanged","canResetSizeChanged","handleClampClick","event","current","setTimeout","handleAnimationEnd","offsetHeight","firstChild","removeChild","appendChild","style","visibility","resizeObserver","ResizeObserver","entries","observedHeight","contentRect","height","observe","disconnect","ts","components","truncation","internalMoreLabel","createElement","textstring","more","internalLessLabel","less","className","ref","animate","initial","transition","type","duration","onAnimationComplete","onAnimationStart","$position","libraryName","onClick"],"sources":["../../../../src/components/truncation/Truncation.tsx"],"sourcesContent":["import React, {\n FC,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { ClampPosition } from '../../types/truncation';\nimport { debounce } from '../../utils/debounce';\nimport { truncateElement } from '../../utils/truncation';\nimport {\n StyledMotionTruncationContent,\n StyledTruncation,\n StyledTruncationClamp,\n StyledTruncationClampWrapper,\n StyledTruncationPseudoContent,\n} from './Truncation.styles';\nimport { Textstring, TextstringProvider, ttsToITextString } from '@chayns-components/textstring';\nimport textStrings from '../../constants/textStrings';\n\nexport type TruncationProps = {\n /**\n * The elements that should be expanding or collapsing.\n */\n children: ReactElement;\n /**\n * The position of the clamp.\n */\n clampPosition?: ClampPosition;\n /**\n * The height of the children Element in it`s collapsed state.\n */\n collapsedHeight?: number;\n /**\n * If set to true, the content is exposed.\n */\n isOpen?: boolean;\n /**\n * A text that should be displayed if the content is expanded.\n */\n lessLabel?: string;\n /**\n * A text that should be displayed if the content is collapsed.\n */\n moreLabel?: string;\n /**\n * Function to be executed when the component is expanding or collapsing.\n */\n onChange?: (event: MouseEvent<HTMLAnchorElement>, isOpen: boolean) => void;\n};\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nconst Truncation: FC<TruncationProps> = ({\n collapsedHeight = 150,\n clampPosition = ClampPosition.Right,\n isOpen,\n moreLabel,\n lessLabel,\n onChange,\n children,\n}) => {\n const [internalIsOpen, setInternalIsOpen] = useState(false);\n const [showClamp, setShowClamp] = useState(true);\n const [newCollapsedHeight, setNewCollapsedHeight] = useState(collapsedHeight);\n const [originalHeight, setOriginalHeight] = useState(0);\n const [shouldShowCollapsedElement, setShouldShowCollapsedElement] = useState(true);\n const [hasSizeChanged, setHasSizeChanged] = useState(false);\n const [initialRender, setInitialRender] = useState(true);\n const [shouldSkipChangeCheck, setShouldSkipChangeCheck] = useState(false);\n\n const [originalSmallHeight, setOriginalSmallHeight] = useState(0);\n const [originalBigHeight, setOriginalBigHeight] = useState(0);\n\n useEffect(() => {\n setInitialRender(false);\n }, []);\n\n const parentRef = useRef<HTMLDivElement>(null);\n const pseudoChildrenRef = useRef<HTMLDivElement>(null);\n const childrenRef = useRef<HTMLDivElement>(null);\n const originalChildrenRef = useRef<HTMLDivElement>(null);\n const hasCollapsed = useRef(false);\n const isAnimating = useRef(false);\n const hasSizeRecentlyChanged = useRef(false);\n const canResetSizeChanged = useRef(true);\n\n useEffect(() => {\n if (typeof isOpen === 'boolean') {\n setInternalIsOpen(isOpen);\n setShowClamp(!isOpen);\n }\n }, [isOpen]);\n\n // Changes the state of the truncation\n const handleClampClick = useCallback<MouseEventHandler<HTMLAnchorElement>>(\n (event) => {\n setInternalIsOpen((current) => {\n if (typeof onChange === 'function') {\n onChange(event, !current);\n }\n\n return !current;\n });\n },\n [onChange],\n );\n\n useEffect(() => {\n if (children) {\n setShouldSkipChangeCheck(true);\n\n window.setTimeout(() => {\n setShouldSkipChangeCheck(false);\n }, 200);\n }\n }, [children]);\n\n const handleAnimationEnd = useCallback(() => {\n hasCollapsed.current = true;\n isAnimating.current = false;\n\n if (canResetSizeChanged.current) {\n setHasSizeChanged(false);\n canResetSizeChanged.current = false;\n }\n\n window.setTimeout(() => {\n hasSizeRecentlyChanged.current = false;\n }, 10);\n\n setShouldShowCollapsedElement(!internalIsOpen);\n\n window.setTimeout(() => {\n hasCollapsed.current = false;\n }, 30);\n }, [internalIsOpen]);\n\n useEffect(() => {\n if (!pseudoChildrenRef.current) {\n return;\n }\n\n setOriginalHeight(pseudoChildrenRef.current.offsetHeight);\n setOriginalBigHeight(pseudoChildrenRef.current.offsetHeight);\n\n truncateElement(pseudoChildrenRef.current, collapsedHeight);\n\n setNewCollapsedHeight(pseudoChildrenRef.current.offsetHeight);\n setOriginalSmallHeight(pseudoChildrenRef.current.offsetHeight);\n }, [collapsedHeight, pseudoChildrenRef, children]);\n\n // Checks if the clamp should be shown\n useEffect(() => {\n if (\n pseudoChildrenRef.current &&\n (!hasSizeChanged || shouldSkipChangeCheck) &&\n !initialRender\n ) {\n setShowClamp(originalHeight > newCollapsedHeight);\n }\n }, [\n shouldSkipChangeCheck,\n collapsedHeight,\n hasSizeChanged,\n initialRender,\n newCollapsedHeight,\n originalHeight,\n children,\n ]);\n\n useEffect(() => {\n if (childrenRef.current && pseudoChildrenRef.current && originalChildrenRef.current) {\n while (childrenRef.current.firstChild) {\n childrenRef.current.removeChild(childrenRef.current.firstChild);\n }\n\n childrenRef.current.appendChild(\n shouldShowCollapsedElement && !internalIsOpen\n ? pseudoChildrenRef.current\n : originalChildrenRef.current,\n );\n\n parentRef.current?.appendChild(\n shouldShowCollapsedElement && !internalIsOpen\n ? originalChildrenRef.current\n : pseudoChildrenRef.current,\n );\n\n (childrenRef.current.children[0] as HTMLDivElement).style.visibility = 'visible';\n }\n }, [children, internalIsOpen, shouldShowCollapsedElement]);\n\n useIsomorphicLayoutEffect(() => {\n if (originalChildrenRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries && entries[0]) {\n const observedHeight = entries[0].contentRect.height;\n\n setOriginalHeight(\n observedHeight < originalBigHeight ? originalBigHeight : observedHeight,\n );\n\n if (\n !hasCollapsed.current &&\n !isAnimating.current &&\n !hasSizeRecentlyChanged.current\n ) {\n void debounce(() => {\n canResetSizeChanged.current = true;\n }, 250)();\n\n setHasSizeChanged(true);\n hasSizeRecentlyChanged.current = true;\n }\n }\n });\n\n resizeObserver.observe(originalChildrenRef.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n\n return () => {};\n }, [originalBigHeight, children]);\n\n useIsomorphicLayoutEffect(() => {\n if (pseudoChildrenRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries && entries[0]) {\n const observedHeight = entries[0].contentRect.height;\n\n setNewCollapsedHeight(\n observedHeight < originalSmallHeight ? originalSmallHeight : observedHeight,\n );\n\n if (\n !hasCollapsed.current &&\n !isAnimating.current &&\n !hasSizeRecentlyChanged.current\n ) {\n void debounce(() => {\n canResetSizeChanged.current = true;\n }, 250)();\n\n setHasSizeChanged(true);\n hasSizeRecentlyChanged.current = true;\n }\n }\n });\n\n resizeObserver.observe(pseudoChildrenRef.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n\n return () => {};\n }, [originalSmallHeight, children]);\n\n const ts = textStrings.components.truncation;\n\n const internalMoreLabel = moreLabel ?? <Textstring textstring={ttsToITextString(ts.more)} />;\n const internalLessLabel = lessLabel ?? <Textstring textstring={ttsToITextString(ts.less)} />;\n\n return useMemo(\n () => (\n <StyledTruncation className=\"beta-chayns-truncation\" ref={parentRef}>\n <StyledTruncationPseudoContent ref={pseudoChildrenRef}>\n {children}\n </StyledTruncationPseudoContent>\n <StyledTruncationPseudoContent ref={originalChildrenRef}>\n {children}\n </StyledTruncationPseudoContent>\n <StyledMotionTruncationContent\n animate={{ height: internalIsOpen ? originalHeight : newCollapsedHeight }}\n initial={false}\n transition={{ type: 'tween', duration: hasSizeChanged ? 0 : 0.2 }}\n onAnimationComplete={handleAnimationEnd}\n onAnimationStart={() => {\n isAnimating.current = true;\n }}\n ref={childrenRef}\n />\n {showClamp && (\n <StyledTruncationClampWrapper $position={clampPosition}>\n <TextstringProvider libraryName=\"@chayns-components-core\">\n <StyledTruncationClamp onClick={handleClampClick}>\n {internalIsOpen ? internalLessLabel : internalMoreLabel}\n </StyledTruncationClamp>\n </TextstringProvider>\n </StyledTruncationClampWrapper>\n )}\n </StyledTruncation>\n ),\n [\n children,\n clampPosition,\n handleAnimationEnd,\n handleClampClick,\n hasSizeChanged,\n internalIsOpen,\n lessLabel,\n moreLabel,\n newCollapsedHeight,\n originalHeight,\n showClamp,\n ],\n );\n};\n\nexport default Truncation;\n"],"mappings":"AAAA,OAAOA,KAAK,IAKRC,WAAW,EACXC,SAAS,EACTC,eAAe,EACfC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACL,OAAO;AACd,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,QAAQ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AmB,EAAE/B,kBAAmB;IACxCgC,gBAAgB,EAAEA,CAAA,KAAM;MACpBvC,WAAW,CAACK,OAAO,GAAG,IAAI;IAC9B,CAAE;IACF2B,GAAG,EAAEnC;EAAY,CACpB,CAAC,EACDpB,SAAS,iBACNhC,KAAA,CAAAiF,aAAA,CAACpE,4BAA4B;IAACkF,SAAS,EAAExE;EAAc,gBACnDvB,KAAA,CAAAiF,aAAA,CAACjE,kBAAkB;IAACgF,WAAW,EAAC;EAAyB,gBACrDhG,KAAA,CAAAiF,aAAA,CAACrE,qBAAqB;IAACqF,OAAO,EAAEvC;EAAiB,GAC5C5B,cAAc,GAAGsD,iBAAiB,GAAGJ,iBACnB,CACP,CACM,CAEpB,CACrB,EACD,CACInD,QAAQ,EACRN,aAAa,EACbuC,kBAAkB,EAClBJ,gBAAgB,EAChBlB,cAAc,EACdV,cAAc,EACdH,SAAS,EACTD,SAAS,EACTQ,kBAAkB,EAClBE,cAAc,EACdJ,SAAS,CAEjB,CAAC;AACL,CAAC;AAED,eAAeX,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Truncation.js","names":["React","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","ClampPosition","debounce","truncateElement","StyledMotionTruncationContent","StyledTruncation","StyledTruncationClamp","StyledTruncationClampFocusWrapper","StyledTruncationClampWrapper","StyledTruncationPseudoContent","Textstring","TextstringProvider","ttsToITextString","textStrings","useKeyboardFocusHighlighting","useIsomorphicLayoutEffect","window","Truncation","collapsedHeight","clampPosition","Right","isOpen","moreLabel","lessLabel","onChange","children","shouldEnableKeyboardHighlighting","shouldShowKeyboardHighlighting","internalIsOpen","setInternalIsOpen","showClamp","setShowClamp","newCollapsedHeight","setNewCollapsedHeight","originalHeight","setOriginalHeight","shouldShowCollapsedElement","setShouldShowCollapsedElement","hasSizeChanged","setHasSizeChanged","initialRender","setInitialRender","shouldSkipChangeCheck","setShouldSkipChangeCheck","originalSmallHeight","setOriginalSmallHeight","originalBigHeight","setOriginalBigHeight","parentRef","pseudoChildrenRef","childrenRef","originalChildrenRef","hasCollapsed","isAnimating","hasSizeRecentlyChanged","canResetSizeChanged","handleClampClick","event","current","handleClampKeyDown","key","preventDefault","currentTarget","click","setTimeout","handleAnimationEnd","offsetHeight","firstChild","removeChild","appendChild","style","visibility","resizeObserver","ResizeObserver","entries","observedHeight","contentRect","height","observe","disconnect","ts","components","truncation","internalMoreLabel","createElement","textstring","more","internalLessLabel","less","className","ref","animate","initial","transition","type","duration","onAnimationComplete","onAnimationStart","$position","libraryName","$shouldShowKeyboardHighlighting","onClick","onKeyDown","role","tabIndex"],"sources":["../../../../src/components/truncation/Truncation.tsx"],"sourcesContent":["import React, {\n FC,\n KeyboardEventHandler,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { ClampPosition } from '../../types/truncation';\nimport { debounce } from '../../utils/debounce';\nimport { truncateElement } from '../../utils/truncation';\nimport {\n StyledMotionTruncationContent,\n StyledTruncation,\n StyledTruncationClamp,\n StyledTruncationClampFocusWrapper,\n StyledTruncationClampWrapper,\n StyledTruncationPseudoContent,\n} from './Truncation.styles';\nimport { Textstring, TextstringProvider, ttsToITextString } from '@chayns-components/textstring';\nimport textStrings from '../../constants/textStrings';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\n\nexport type TruncationProps = {\n /**\n * The elements that should be expanding or collapsing.\n */\n children: ReactElement;\n /**\n * The position of the clamp.\n */\n clampPosition?: ClampPosition;\n /**\n * The height of the children Element in it`s collapsed state.\n */\n collapsedHeight?: number;\n /**\n * If set to true, the content is exposed.\n */\n isOpen?: boolean;\n /**\n * A text that should be displayed if the content is expanded.\n */\n lessLabel?: string;\n /**\n * A text that should be displayed if the content is collapsed.\n */\n moreLabel?: string;\n /**\n * Function to be executed when the component is expanding or collapsing.\n */\n onChange?: (event: MouseEvent<HTMLAnchorElement>, isOpen: boolean) => void;\n /**\n * Enables keyboard-only focus highlighting.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nconst Truncation: FC<TruncationProps> = ({\n collapsedHeight = 150,\n clampPosition = ClampPosition.Right,\n isOpen,\n moreLabel,\n lessLabel,\n onChange,\n children,\n shouldEnableKeyboardHighlighting,\n}) => {\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting,\n );\n\n const [internalIsOpen, setInternalIsOpen] = useState(false);\n const [showClamp, setShowClamp] = useState(true);\n const [newCollapsedHeight, setNewCollapsedHeight] = useState(collapsedHeight);\n const [originalHeight, setOriginalHeight] = useState(0);\n const [shouldShowCollapsedElement, setShouldShowCollapsedElement] = useState(true);\n const [hasSizeChanged, setHasSizeChanged] = useState(false);\n const [initialRender, setInitialRender] = useState(true);\n const [shouldSkipChangeCheck, setShouldSkipChangeCheck] = useState(false);\n\n const [originalSmallHeight, setOriginalSmallHeight] = useState(0);\n const [originalBigHeight, setOriginalBigHeight] = useState(0);\n\n useEffect(() => {\n setInitialRender(false);\n }, []);\n\n const parentRef = useRef<HTMLDivElement>(null);\n const pseudoChildrenRef = useRef<HTMLDivElement>(null);\n const childrenRef = useRef<HTMLDivElement>(null);\n const originalChildrenRef = useRef<HTMLDivElement>(null);\n const hasCollapsed = useRef(false);\n const isAnimating = useRef(false);\n const hasSizeRecentlyChanged = useRef(false);\n const canResetSizeChanged = useRef(true);\n\n useEffect(() => {\n if (typeof isOpen === 'boolean') {\n setInternalIsOpen(isOpen);\n setShowClamp(!isOpen);\n }\n }, [isOpen]);\n\n // Changes the state of the truncation\n const handleClampClick = useCallback<MouseEventHandler<HTMLAnchorElement>>(\n (event) => {\n setInternalIsOpen((current) => {\n if (typeof onChange === 'function') {\n onChange(event, !current);\n }\n\n return !current;\n });\n },\n [onChange],\n );\n\n const handleClampKeyDown = useCallback<KeyboardEventHandler<HTMLAnchorElement>>((event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.currentTarget.click();\n }\n }, []);\n\n useEffect(() => {\n if (children) {\n setShouldSkipChangeCheck(true);\n\n window.setTimeout(() => {\n setShouldSkipChangeCheck(false);\n }, 200);\n }\n }, [children]);\n\n const handleAnimationEnd = useCallback(() => {\n hasCollapsed.current = true;\n isAnimating.current = false;\n\n if (canResetSizeChanged.current) {\n setHasSizeChanged(false);\n canResetSizeChanged.current = false;\n }\n\n window.setTimeout(() => {\n hasSizeRecentlyChanged.current = false;\n }, 10);\n\n setShouldShowCollapsedElement(!internalIsOpen);\n\n window.setTimeout(() => {\n hasCollapsed.current = false;\n }, 30);\n }, [internalIsOpen]);\n\n useEffect(() => {\n if (!pseudoChildrenRef.current) {\n return;\n }\n\n setOriginalHeight(pseudoChildrenRef.current.offsetHeight);\n setOriginalBigHeight(pseudoChildrenRef.current.offsetHeight);\n\n truncateElement(pseudoChildrenRef.current, collapsedHeight);\n\n setNewCollapsedHeight(pseudoChildrenRef.current.offsetHeight);\n setOriginalSmallHeight(pseudoChildrenRef.current.offsetHeight);\n }, [collapsedHeight, pseudoChildrenRef, children]);\n\n // Checks if the clamp should be shown\n useEffect(() => {\n if (\n pseudoChildrenRef.current &&\n (!hasSizeChanged || shouldSkipChangeCheck) &&\n !initialRender\n ) {\n setShowClamp(originalHeight > newCollapsedHeight);\n }\n }, [\n shouldSkipChangeCheck,\n collapsedHeight,\n hasSizeChanged,\n initialRender,\n newCollapsedHeight,\n originalHeight,\n children,\n ]);\n\n useEffect(() => {\n if (childrenRef.current && pseudoChildrenRef.current && originalChildrenRef.current) {\n while (childrenRef.current.firstChild) {\n childrenRef.current.removeChild(childrenRef.current.firstChild);\n }\n\n childrenRef.current.appendChild(\n shouldShowCollapsedElement && !internalIsOpen\n ? pseudoChildrenRef.current\n : originalChildrenRef.current,\n );\n\n parentRef.current?.appendChild(\n shouldShowCollapsedElement && !internalIsOpen\n ? originalChildrenRef.current\n : pseudoChildrenRef.current,\n );\n\n (childrenRef.current.children[0] as HTMLDivElement).style.visibility = 'visible';\n }\n }, [children, internalIsOpen, shouldShowCollapsedElement]);\n\n useIsomorphicLayoutEffect(() => {\n if (originalChildrenRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries && entries[0]) {\n const observedHeight = entries[0].contentRect.height;\n\n setOriginalHeight(\n observedHeight < originalBigHeight ? originalBigHeight : observedHeight,\n );\n\n if (\n !hasCollapsed.current &&\n !isAnimating.current &&\n !hasSizeRecentlyChanged.current\n ) {\n void debounce(() => {\n canResetSizeChanged.current = true;\n }, 250)();\n\n setHasSizeChanged(true);\n hasSizeRecentlyChanged.current = true;\n }\n }\n });\n\n resizeObserver.observe(originalChildrenRef.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n\n return () => {};\n }, [originalBigHeight, children]);\n\n useIsomorphicLayoutEffect(() => {\n if (pseudoChildrenRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries && entries[0]) {\n const observedHeight = entries[0].contentRect.height;\n\n setNewCollapsedHeight(\n observedHeight < originalSmallHeight ? originalSmallHeight : observedHeight,\n );\n\n if (\n !hasCollapsed.current &&\n !isAnimating.current &&\n !hasSizeRecentlyChanged.current\n ) {\n void debounce(() => {\n canResetSizeChanged.current = true;\n }, 250)();\n\n setHasSizeChanged(true);\n hasSizeRecentlyChanged.current = true;\n }\n }\n });\n\n resizeObserver.observe(pseudoChildrenRef.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n\n return () => {};\n }, [originalSmallHeight, children]);\n\n const ts = textStrings.components.truncation;\n\n const internalMoreLabel = moreLabel ?? <Textstring textstring={ttsToITextString(ts.more)} />;\n const internalLessLabel = lessLabel ?? <Textstring textstring={ttsToITextString(ts.less)} />;\n\n return useMemo(\n () => (\n <StyledTruncation className=\"beta-chayns-truncation\" ref={parentRef}>\n <StyledTruncationPseudoContent ref={pseudoChildrenRef}>\n {children}\n </StyledTruncationPseudoContent>\n <StyledTruncationPseudoContent ref={originalChildrenRef}>\n {children}\n </StyledTruncationPseudoContent>\n <StyledMotionTruncationContent\n animate={{ height: internalIsOpen ? originalHeight : newCollapsedHeight }}\n initial={false}\n transition={{ type: 'tween', duration: hasSizeChanged ? 0 : 0.2 }}\n onAnimationComplete={handleAnimationEnd}\n onAnimationStart={() => {\n isAnimating.current = true;\n }}\n ref={childrenRef}\n />\n {showClamp && (\n <StyledTruncationClampWrapper $position={clampPosition}>\n <TextstringProvider libraryName=\"@chayns-components-core\">\n <StyledTruncationClampFocusWrapper\n $shouldShowKeyboardHighlighting={shouldShowKeyboardHighlighting}\n >\n <StyledTruncationClamp\n onClick={handleClampClick}\n onKeyDown={handleClampKeyDown}\n role=\"button\"\n tabIndex={0}\n >\n {internalIsOpen ? internalLessLabel : internalMoreLabel}\n </StyledTruncationClamp>\n </StyledTruncationClampFocusWrapper>\n </TextstringProvider>\n </StyledTruncationClampWrapper>\n )}\n </StyledTruncation>\n ),\n [\n children,\n clampPosition,\n handleAnimationEnd,\n handleClampClick,\n handleClampKeyDown,\n hasSizeChanged,\n internalIsOpen,\n lessLabel,\n moreLabel,\n newCollapsedHeight,\n originalHeight,\n shouldShowKeyboardHighlighting,\n showClamp,\n ],\n );\n};\n\nexport default Truncation;\n"],"mappings":"AAAA,OAAOA,KAAK,IAMRC,WAAW,EACXC,SAAS,EACTC,eAAe,EACfC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACL,OAAO;AACd,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,eAAe,QAAQ,wBAAwB;AACxD,SACIC,6BAA6B,EAC7BC,gBAAgB,EAChBC,qBAAqB,EACrBC,iCAAiC,EACjCC,4BAA4B,EAC5BC,6BAA6B,QAC1B,qBAAqB;AAC5B,SAASC,UAAU,EAAEC,kBAAkB,EAAEC,gBAAgB,QAAQ,+BAA+B;AAChG,OAAOC,WAAW,MAAM,6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AAE;IAC1E4D,OAAO,EAAE,KAAM;IACfC,UAAU,EAAE;MAAEC,IAAI,EAAE,OAAO;MAAEC,QAAQ,EAAEzD,cAAc,GAAG,CAAC,GAAG;IAAI,CAAE;IAClE0D,mBAAmB,EAAE/B,kBAAmB;IACxCgC,gBAAgB,EAAEA,CAAA,KAAM;MACpB5C,WAAW,CAACK,OAAO,GAAG,IAAI;IAC9B,CAAE;IACFgC,GAAG,EAAExC;EAAY,CACpB,CAAC,EACDpB,SAAS,iBACNpC,KAAA,CAAA0F,aAAA,CAAC5E,4BAA4B;IAAC0F,SAAS,EAAE/E;EAAc,gBACnDzB,KAAA,CAAA0F,aAAA,CAACzE,kBAAkB;IAACwF,WAAW,EAAC;EAAyB,gBACrDzG,KAAA,CAAA0F,aAAA,CAAC7E,iCAAiC;IAC9B6F,+BAA+B,EAAEzE;EAA+B,gBAEhEjC,KAAA,CAAA0F,aAAA,CAAC9E,qBAAqB;IAClB+F,OAAO,EAAE7C,gBAAiB;IAC1B8C,SAAS,EAAE3C,kBAAmB;IAC9B4C,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAE;EAAE,GAEX5E,cAAc,GAAG2D,iBAAiB,GAAGJ,iBACnB,CACQ,CACnB,CACM,CAEpB,CACrB,EACD,CACI1D,QAAQ,EACRN,aAAa,EACb8C,kBAAkB,EAClBT,gBAAgB,EAChBG,kBAAkB,EAClBrB,cAAc,EACdV,cAAc,EACdL,SAAS,EACTD,SAAS,EACTU,kBAAkB,EAClBE,cAAc,EACdP,8BAA8B,EAC9BG,SAAS,CAEjB,CAAC;AACL,CAAC;AAED,eAAeb,UAAU","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { motion } from 'motion/react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { ClampPosition } from '../../types/truncation';
|
|
4
|
+
import { keyboardFocusHighlightingRingCss } from '../../utils/keyboardFocusHighlighting.styles';
|
|
4
5
|
export const StyledTruncation = styled.div`
|
|
5
6
|
position: relative;
|
|
6
7
|
overflow: hidden;
|
|
@@ -38,8 +39,25 @@ export const StyledTruncationClampWrapper = styled.div`
|
|
|
38
39
|
}
|
|
39
40
|
}}
|
|
40
41
|
`;
|
|
42
|
+
export const StyledTruncationClampFocusWrapper = styled.div`
|
|
43
|
+
display: inline-block;
|
|
44
|
+
border-radius: 3px;
|
|
45
|
+
|
|
46
|
+
${({
|
|
47
|
+
$shouldShowKeyboardHighlighting
|
|
48
|
+
}) => $shouldShowKeyboardHighlighting && css`
|
|
49
|
+
&:focus-within {
|
|
50
|
+
transition: none;
|
|
51
|
+
${keyboardFocusHighlightingRingCss};
|
|
52
|
+
color: inherit;
|
|
53
|
+
outline: 2px solid rgba(255, 255, 255, 0.7);
|
|
54
|
+
}
|
|
55
|
+
`}
|
|
56
|
+
`;
|
|
41
57
|
export const StyledTruncationClamp = styled.a`
|
|
42
58
|
cursor: pointer;
|
|
43
59
|
z-index: 2;
|
|
60
|
+
display: inline-block;
|
|
61
|
+
line-height: 1.2;
|
|
44
62
|
`;
|
|
45
63
|
//# sourceMappingURL=Truncation.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Truncation.styles.js","names":["motion","styled","css","ClampPosition","StyledTruncation","div","StyledMotionTruncationContent","StyledTruncationPseudoContent","StyledTruncationClampWrapper","$position","Left","Middle","StyledTruncationClamp","a"],"sources":["../../../../src/components/truncation/Truncation.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport { ClampPosition } from '../../types/truncation';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledTruncation = styled.div`\n position: relative;\n overflow: hidden;\n`;\n\n// Fix framer-motion bug\nexport const StyledMotionTruncationContent = styled(motion.div)`\n overflow: hidden;\n position: relative;\n`;\n\nexport const StyledTruncationPseudoContent = styled.div`\n visibility: hidden;\n position: absolute;\n width: 100%;\n`;\n\ntype StyledTruncationClampWrapperProps = WithTheme<{ $position: ClampPosition }>;\n\nexport const StyledTruncationClampWrapper = styled.div<StyledTruncationClampWrapperProps>`\n display: flex;\n\n ${({ $position }) => {\n switch ($position) {\n case ClampPosition.Left:\n return css`\n justify-content: left;\n `;\n case ClampPosition.Middle:\n return css`\n justify-content: center;\n `;\n default:\n return css`\n justify-content: right;\n `;\n }\n }}\n`;\n\nexport const StyledTruncationClamp = styled.a`\n cursor: pointer;\n z-index: 2;\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,aAAa,QAAQ,wBAAwB;
|
|
1
|
+
{"version":3,"file":"Truncation.styles.js","names":["motion","styled","css","ClampPosition","keyboardFocusHighlightingRingCss","StyledTruncation","div","StyledMotionTruncationContent","StyledTruncationPseudoContent","StyledTruncationClampWrapper","$position","Left","Middle","StyledTruncationClampFocusWrapper","$shouldShowKeyboardHighlighting","StyledTruncationClamp","a"],"sources":["../../../../src/components/truncation/Truncation.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport { ClampPosition } from '../../types/truncation';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { keyboardFocusHighlightingRingCss } from '../../utils/keyboardFocusHighlighting.styles';\n\nexport const StyledTruncation = styled.div`\n position: relative;\n overflow: hidden;\n`;\n\n// Fix framer-motion bug\nexport const StyledMotionTruncationContent = styled(motion.div)`\n overflow: hidden;\n position: relative;\n`;\n\nexport const StyledTruncationPseudoContent = styled.div`\n visibility: hidden;\n position: absolute;\n width: 100%;\n`;\n\ntype StyledTruncationClampWrapperProps = WithTheme<{ $position: ClampPosition }>;\n\nexport const StyledTruncationClampWrapper = styled.div<StyledTruncationClampWrapperProps>`\n display: flex;\n\n ${({ $position }) => {\n switch ($position) {\n case ClampPosition.Left:\n return css`\n justify-content: left;\n `;\n case ClampPosition.Middle:\n return css`\n justify-content: center;\n `;\n default:\n return css`\n justify-content: right;\n `;\n }\n }}\n`;\n\ntype StyledTruncationClampProps = {\n $shouldShowKeyboardHighlighting: boolean;\n};\n\nexport const StyledTruncationClampFocusWrapper = styled.div<StyledTruncationClampProps>`\n display: inline-block;\n border-radius: 3px;\n\n ${({ $shouldShowKeyboardHighlighting }) =>\n $shouldShowKeyboardHighlighting &&\n css`\n &:focus-within {\n transition: none;\n ${keyboardFocusHighlightingRingCss};\n color: inherit;\n outline: 2px solid rgba(255, 255, 255, 0.7);\n }\n `}\n`;\n\nexport const StyledTruncationClamp = styled.a`\n cursor: pointer;\n z-index: 2;\n display: inline-block;\n line-height: 1.2;\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,aAAa,QAAQ,wBAAwB;AAEtD,SAASC,gCAAgC,QAAQ,8CAA8C;AAE/F,OAAO,MAAMC,gBAAgB,GAAGJ,MAAM,CAACK,GAAG;AAC1C;AACA;AACA,CAAC;;AAED;AACA,OAAO,MAAMC,6BAA6B,GAAGN,MAAM,CAACD,MAAM,CAACM,GAAG,CAAC;AAC/D;AACA;AACA,CAAC;AAED,OAAO,MAAME,6BAA6B,GAAGP,MAAM,CAACK,GAAG;AACvD;AACA;AACA;AACA,CAAC;AAID,OAAO,MAAMG,4BAA4B,GAAGR,MAAM,CAACK,GAAsC;AACzF;AACA;AACA,MAAM,CAAC;EAAEI;AAAU,CAAC,KAAK;EACjB,QAAQA,SAAS;IACb,KAAKP,aAAa,CAACQ,IAAI;MACnB,OAAOT,GAAG;AAC1B;AACA,iBAAiB;IACL,KAAKC,aAAa,CAACS,MAAM;MACrB,OAAOV,GAAG;AAC1B;AACA,iBAAiB;IACL;MACI,OAAOA,GAAG;AAC1B;AACA,iBAAiB;EACT;AACJ,CAAC;AACL,CAAC;AAMD,OAAO,MAAMW,iCAAiC,GAAGZ,MAAM,CAACK,GAA+B;AACvF;AACA;AACA;AACA,MAAM,CAAC;EAAEQ;AAAgC,CAAC,KAClCA,+BAA+B,IAC/BZ,GAAG;AACX;AACA;AACA,kBAAkBE,gCAAgC;AAClD;AACA;AACA;AACA,SAAS;AACT,CAAC;AAED,OAAO,MAAMW,qBAAqB,GAAGd,MAAM,CAACe,CAAC;AAC7C;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
package/lib/esm/index.js
CHANGED
|
@@ -81,4 +81,5 @@ export { uploadFile } from './utils/uploadFile';
|
|
|
81
81
|
export { ComboBoxSize } from './components/combobox/ComboBox.types';
|
|
82
82
|
export { default as Skeleton } from './components/skeleton';
|
|
83
83
|
export { SkeletonAnimationType } from './components/skeleton/types';
|
|
84
|
+
export { default as Masonry } from './components/masonry/Masonry';
|
|
84
85
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","Accordion","AccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","VerificationBadge","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","useColorScheme","BadgeSize","BadgeDesign","useContainer","ContainerAnchor","DropdownDirection","useIsMeasuredClone","useCombinedRefs","Filter","AnimatedNumber","FileList","FileSelect","DropdownBodyWrapper","ComboBox","ContentCard","HighlightSlider","ContextMenu","ContextMenuAlignment","ExpandableContent","FileInput","STREAMINGSERVICE_FILE_TYPES","TSIMG_FILE_TYPES","FilterButton","FilterButtons","GridImage","GroupedImage","Icon","Input","InputSize","List","ListItemContent","ListItem","LIST_ITEM_MARKER","withListItemMarker","withListItemMarkerForwardRef","MentionFinder","MultiActionButton","NumberInput","PageProvider","Popup","PopupContent","ProgressBar","PopupAlignment","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingContextMenu","SharingBar","SharingButton","Signature","SliderButton","Slider","SmallWaitCursor","SmallWaitCursorSize","SmallWaitCursorSpeed","TagInput","TextArea","Tooltip","Truncation","MentionFinderPopupAlignment","useElementSize","ContentCardType","isValidFileType","FilterButtonItemShape","FilterButtonSize","MultiActionButtonHeight","MultiActionButtonStatusType","ClampPosition","useIsTouch","filterFilesByMimeType","getFileAsArrayBuffer","selectFiles","isTobitEmployee","getUsableHeight","uploadFile","ComboBoxSize","Skeleton","SkeletonAnimationType"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './components/badge/Badge.types';\nexport type {\n ColorSchemeContextProps,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport { DropdownDirection, type DropdownCoordinates } from './types/dropdown';\nexport { useIsMeasuredClone } from './hooks/element';\nexport { useCombinedRefs } from './hooks/ref';\nexport { default as Filter, type FilterRightIcon } from './components/filter/Filter';\nexport {\n type SortItem,\n type SearchConfig,\n type SortConfig,\n type CheckboxConfig,\n type FilterButtonConfig,\n type FilterRef,\n} from './types/filter';\nexport { default as AnimatedNumber } from './components/animated-number/AnimatedNumber';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport { default as DropdownBodyWrapper } from './components/dropdown-body-wrapper/DropdownBodyWrapper';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as HighlightSlider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu.types';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport {\n default as FileInput,\n type FileInputRef,\n STREAMINGSERVICE_FILE_TYPES,\n TSIMG_FILE_TYPES,\n} from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as GroupedImage } from './components/grouped-image/GroupedImage';\nexport { default as Icon, type IconProps } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n type ListItemRef,\n type ListItemSize,\n} from './components/list/list-item/ListItem';\nexport {\n type ListItemMarkedForwardRefComponent,\n type ListItemMarkedComponent,\n type ListItemMetaProps,\n LIST_ITEM_MARKER,\n withListItemMarker,\n withListItemMarkerForwardRef,\n} from './components/list/list-item/ListItem.utils';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as MultiActionButton } from './components/multi-action-button/MultiActionButton';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport type { PopupProps } from './components/popup/Popup.types';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingContextMenu } from './components/sharing-context-menu/SharingContextMenu';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as SharingButton } from './components/sharing-button/SharingButton';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport type { Tag } from './types/tagInput';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport type { TagInputRef } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/element';\nexport type { BrowserName } from './types/chayns';\nexport { ContentCardType } from './types/contentCard';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport {\n type MultiActionButtonAction,\n type MultiActionButtonActionEvent,\n type MultiActionButtonActionStatus,\n MultiActionButtonHeight,\n type MultiActionButtonProps,\n type MultiActionButtonSecondaryContextMenu,\n MultiActionButtonStatusType,\n} from './components/multi-action-button/MultiActionButton.types';\nexport { ClampPosition } from './types/truncation';\nexport { useIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';\nexport { ComboBoxSize } from './components/combobox/ComboBox.types';\nexport type {\n IComboBoxItem as ComboBoxItem,\n ComboBoxTextStyles,\n IComboBoxItems as ComboBoxItems,\n ComboBoxRef,\n} from './components/combobox/ComboBox.types';\nexport { default as Skeleton } from './components/skeleton';\nexport { SkeletonAnimationType } from './components/skeleton/types';\n"],"mappings":"AAAA;;AAEA,SAASA,OAAO,IAAIC,SAAS,QAAQ,kCAAkC;AACvE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,2DAA2D;AACvG,SAASF,OAAO,IAAIG,cAAc,QAAQ,uDAAuD;AACjG,SAASH,OAAO,IAAII,cAAc,QAAQ,uDAAuD;AACjG,SAASJ,OAAO,IAAIK,aAAa,QAAQ,qDAAqD;AAC9F,SAASL,OAAO,IAAIM,aAAa,QAAQ,2CAA2C;AACpF,SAASN,OAAO,IAAIO,iBAAiB,QAAQ,mDAAmD;AAChG,SACIC,WAAW,EACXR,OAAO,IAAIS,YAAY,QACpB,gDAAgD;AACvD,SAAST,OAAO,IAAIU,KAAK,QAAQ,0BAA0B;AAC3D,SAASV,OAAO,IAAIW,MAAM,QAAQ,4BAA4B;AAC9D,SAASX,OAAO,IAAIY,QAAQ,QAAQ,gCAAgC;AACpE,SACIZ,OAAO,IAAIa,mBAAmB,EAC9BC,cAAc,QACX,wDAAwD;AAC/D,SAASC,SAAS,EAAEC,WAAW,QAAQ,gCAAgC;AAKvE,SAASC,YAAY,EAAEC,eAAe,QAAQ,mBAAmB;AACjE,SAASC,iBAAiB,QAAkC,kBAAkB;AAC9E,SAASC,kBAAkB,QAAQ,iBAAiB;AACpD,SAASC,eA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3E,OAAO,IAAI4E,OAAO,QAAQ,8BAA8B;AACjE,SAAS5E,OAAO,IAAI6E,UAAU,QAAQ,oCAAoC;AAC1E,SAASC,2BAA2B,QAAQ,2BAA2B;AACvE,SAASC,cAAc,QAAQ,iBAAiB;AAEhD,SAASC,eAAe,QAAQ,qBAAqB;AAErD,SAASC,eAAe,QAAQ,cAAc;AAE9C,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ,uBAAuB;AAW/E,SAIIC,uBAAuB,EAGvBC,2BAA2B,QACxB,0DAA0D;AACjE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,qBAAqB,EAAEC,oBAAoB,EAAEC,WAAW,QAAQ,oBAAoB;AAC7F,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,UAAU,QAAQ,oBAAoB;AAE/C,SAASC,YAAY,QAAQ,sCAAsC;AAOnE,SAAS9F,OAAO,IAAI+F,QAAQ,QAAQ,uBAAuB;AAC3D,SAASC,qBAAqB,QAAQ,6BAA6B","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","Accordion","AccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","VerificationBadge","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","useColorScheme","BadgeSize","BadgeDesign","useContainer","ContainerAnchor","DropdownDirection","useIsMeasuredClone","useCombinedRefs","Filter","AnimatedNumber","FileList","FileSelect","DropdownBodyWrapper","ComboBox","ContentCard","HighlightSlider","ContextMenu","ContextMenuAlignment","ExpandableContent","FileInput","STREAMINGSERVICE_FILE_TYPES","TSIMG_FILE_TYPES","FilterButton","FilterButtons","GridImage","GroupedImage","Icon","Input","InputSize","List","ListItemContent","ListItem","LIST_ITEM_MARKER","withListItemMarker","withListItemMarkerForwardRef","MentionFinder","MultiActionButton","NumberInput","PageProvider","Popup","PopupContent","ProgressBar","PopupAlignment","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingContextMenu","SharingBar","SharingButton","Signature","SliderButton","Slider","SmallWaitCursor","SmallWaitCursorSize","SmallWaitCursorSpeed","TagInput","TextArea","Tooltip","Truncation","MentionFinderPopupAlignment","useElementSize","ContentCardType","isValidFileType","FilterButtonItemShape","FilterButtonSize","MultiActionButtonHeight","MultiActionButtonStatusType","ClampPosition","useIsTouch","filterFilesByMimeType","getFileAsArrayBuffer","selectFiles","isTobitEmployee","getUsableHeight","uploadFile","ComboBoxSize","Skeleton","SkeletonAnimationType","Masonry"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './components/badge/Badge.types';\nexport type {\n ColorSchemeContextProps,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport { DropdownDirection, type DropdownCoordinates } from './types/dropdown';\nexport { useIsMeasuredClone } from './hooks/element';\nexport { useCombinedRefs } from './hooks/ref';\nexport { default as Filter, type FilterRightIcon } from './components/filter/Filter';\nexport {\n type SortItem,\n type SearchConfig,\n type SortConfig,\n type CheckboxConfig,\n type FilterButtonConfig,\n type FilterRef,\n} from './types/filter';\nexport { default as AnimatedNumber } from './components/animated-number/AnimatedNumber';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport { default as DropdownBodyWrapper } from './components/dropdown-body-wrapper/DropdownBodyWrapper';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as HighlightSlider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu.types';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport {\n default as FileInput,\n type FileInputRef,\n STREAMINGSERVICE_FILE_TYPES,\n TSIMG_FILE_TYPES,\n} from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as GroupedImage } from './components/grouped-image/GroupedImage';\nexport { default as Icon, type IconProps } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n type ListItemRef,\n type ListItemSize,\n} from './components/list/list-item/ListItem';\nexport {\n type ListItemMarkedForwardRefComponent,\n type ListItemMarkedComponent,\n type ListItemMetaProps,\n LIST_ITEM_MARKER,\n withListItemMarker,\n withListItemMarkerForwardRef,\n} from './components/list/list-item/ListItem.utils';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as MultiActionButton } from './components/multi-action-button/MultiActionButton';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport type { PopupProps } from './components/popup/Popup.types';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingContextMenu } from './components/sharing-context-menu/SharingContextMenu';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as SharingButton } from './components/sharing-button/SharingButton';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport type { Tag } from './types/tagInput';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport type { TagInputRef } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/element';\nexport type { BrowserName } from './types/chayns';\nexport { ContentCardType } from './types/contentCard';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport {\n type MultiActionButtonAction,\n type MultiActionButtonActionEvent,\n type MultiActionButtonActionStatus,\n MultiActionButtonHeight,\n type MultiActionButtonProps,\n type MultiActionButtonSecondaryContextMenu,\n MultiActionButtonStatusType,\n} from './components/multi-action-button/MultiActionButton.types';\nexport { ClampPosition } from './types/truncation';\nexport { useIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';\nexport { ComboBoxSize } from './components/combobox/ComboBox.types';\nexport type {\n IComboBoxItem as ComboBoxItem,\n ComboBoxTextStyles,\n IComboBoxItems as ComboBoxItems,\n ComboBoxRef,\n} from './components/combobox/ComboBox.types';\nexport { default as Skeleton } from './components/skeleton';\nexport { SkeletonAnimationType } from './components/skeleton/types';\nexport { default as Masonry } from './components/masonry/Masonry';\n"],"mappings":"AAAA;;AAEA,SAASA,OAAO,IAAIC,SAAS,QAAQ,kCAAkC;AACvE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,2DAA2D;AACvG,SAASF,OAAO,IAAIG,cAAc,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SAASC,YAAY,QAAQ,sCAAsC;AAOnE,SAAS9F,OAAO,IAAI+F,QAAQ,QAAQ,uBAAuB;AAC3D,SAASC,qBAAqB,QAAQ,6BAA6B;AACnE,SAAShG,OAAO,IAAIiG,OAAO,QAAQ,8BAA8B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","names":["hasDuplicate","items","newItem","comparator","some","item","filterDuplicateFile","files","newFile","a","b","name","size","filterDuplicateFileUrls","getHumanSize","bytes","FILE_SIZE_UNITS","unitIndex","Math","round","toString","replace","isValidFileType","types","file","allowedTypesArray","split","map","type","trim","fileType","endsWith","baseType","slice","startsWith","MIME_TYPE_MAPPING","getIconByMimeType","mimeType","matchedType","Object","keys","find"],"sources":["../../../src/utils/file.ts"],"sourcesContent":["import { UploadedFile } from '../components/file-select/FileSelect';\n\nexport const hasDuplicate = <T>(\n items: T[],\n newItem: T,\n comparator: (a: T, b: T) => boolean,\n): boolean => items.some((item) => comparator(item, newItem));\n\ninterface FilerDuplicateFileOptions {\n files: File[];\n newFile: File;\n}\n\nexport const filterDuplicateFile = ({ files, newFile }: FilerDuplicateFileOptions) =>\n hasDuplicate(files, newFile, (a, b) => a.name === b.name && a.size === b.size);\n\ninterface FilterDuplicateFileUrlsOptions {\n files: UploadedFile[];\n newFile: UploadedFile;\n}\n\nexport const filterDuplicateFileUrls = ({ files, newFile }: FilterDuplicateFileUrlsOptions) =>\n hasDuplicate(files, newFile, (a, b) => a === b);\n\nexport const getHumanSize = (bytes: number): string => {\n const FILE_SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n let size = bytes || 0;\n let unitIndex = 0;\n\n while (size >= 1024) {\n size /= 1024;\n unitIndex += 1;\n }\n\n size = Math.round(size * 10) / 10;\n\n return `${size.toString().replace('.', ',')} ${FILE_SIZE_UNITS[unitIndex] ?? ''}`;\n};\n\ninterface IsValidFileTypeOptions {\n file: File;\n types: string;\n}\n\nexport const isValidFileType = ({ types, file }: IsValidFileTypeOptions) => {\n const allowedTypesArray = types.split(',').map((type) => type.trim());\n const fileType = file.type;\n\n return allowedTypesArray.some((type) => {\n if (type.endsWith('/*')) {\n const baseType = type.slice(0, -2); // remove '/*'\n return fileType.startsWith(baseType);\n }\n return fileType === type;\n });\n};\n\nexport const MIME_TYPE_MAPPING: Record<string, string> = {\n // Haupttypen\n 'application/pdf': 'fa fa-file-pdf',\n 'application/zip': 'fa fa-file-archive',\n 'application/msword': 'fa fa-file-word',\n 'application/vnd.ms-excel': 'fa fa-file-excel',\n // Typen mit Wildcards\n 'application/vnd.openxmlformats-officedocument.': 'fa fa-file-word',\n 'application/x-': 'fa fa-file-archive',\n // Addiere nur spezifische Fälle\n 'text/pdf': 'fa fa-file-pdf',\n};\n\nexport const getIconByMimeType = (mimeType?: string): string => {\n const matchedType = Object.keys(MIME_TYPE_MAPPING).find((type) => mimeType?.startsWith(type));\n return MIME_TYPE_MAPPING[matchedType!] || 'fa fa-file';\n};\n"],"mappings":"AAEA,OAAO,MAAMA,YAAY,GAAGA,CACxBC,KAAU,EACVC,OAAU,EACVC,UAAmC,KACzBF,KAAK,CAACG,IAAI,CAAEC,IAAI,IAAKF,UAAU,CAACE,IAAI,EAAEH,OAAO,CAAC,CAAC;AAO7D,OAAO,MAAMI,mBAAmB,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAmC,CAAC,KAC7ER,YAAY,CAACO,KAAK,EAAEC,OAAO,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACE,IAAI,KAAKD,CAAC,CAACC,IAAI,IAAIF,CAAC,CAACG,IAAI,KAAKF,CAAC,CAACE,IAAI,CAAC;AAOlF,OAAO,MAAMC,uBAAuB,GAAGA,CAAC;EAAEN,KAAK;EAAEC;AAAwC,CAAC,KACtFR,YAAY,CAACO,KAAK,EAAEC,OAAO,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,KAAKC,CAAC,CAAC;AAEnD,OAAO,MA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AAoB,EAAE,iBAAiB;EACvC,0BAA0B,EAAE,kBAAkB;EAC9C;EACA,gDAAgD,EAAE,iBAAiB;EACnE,gBAAgB,EAAE,oBAAoB;EACtC;EACA,UAAU,EAAE;AAChB,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAIC,QAAiB,IAAa;EAC5D,MAAMC,WAAW,GAAGC,MAAM,CAACC,IAAI,CAACL,iBAAiB,CAAC,CAACM,IAAI,CAAEb,IAAI,IAAKS,QAAQ,EAAEH,UAAU,CAACN,IAAI,CAAC,CAAC;EAC7F,OAAOO,iBAAiB,CAACG,WAAW,CAAE,IAAI,YAAY;AAC1D,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"file.js","names":["hasDuplicate","items","newItem","comparator","some","item","filterDuplicateFile","files","newFile","a","b","name","size","filterDuplicateFileUrls","getHumanSize","bytes","FILE_SIZE_UNITS","unitIndex","Math","round","toString","replace","isValidFileType","types","file","allowedTypesArray","split","map","type","trim","fileType","endsWith","baseType","slice","startsWith","MIME_TYPE_MAPPING","getIconByMimeType","mimeType","matchedType","Object","keys","find"],"sources":["../../../src/utils/file.ts"],"sourcesContent":["import type { UploadedFile } from '../components/file-select/FileSelect';\n\nexport const hasDuplicate = <T>(\n items: T[],\n newItem: T,\n comparator: (a: T, b: T) => boolean,\n): boolean => items.some((item) => comparator(item, newItem));\n\ninterface FilerDuplicateFileOptions {\n files: File[];\n newFile: File;\n}\n\nexport const filterDuplicateFile = ({ files, newFile }: FilerDuplicateFileOptions) =>\n hasDuplicate(files, newFile, (a, b) => a.name === b.name && a.size === b.size);\n\ninterface FilterDuplicateFileUrlsOptions {\n files: UploadedFile[];\n newFile: UploadedFile;\n}\n\nexport const filterDuplicateFileUrls = ({ files, newFile }: FilterDuplicateFileUrlsOptions) =>\n hasDuplicate(files, newFile, (a, b) => a === b);\n\nexport const getHumanSize = (bytes: number): string => {\n const FILE_SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n let size = bytes || 0;\n let unitIndex = 0;\n\n while (size >= 1024) {\n size /= 1024;\n unitIndex += 1;\n }\n\n size = Math.round(size * 10) / 10;\n\n return `${size.toString().replace('.', ',')} ${FILE_SIZE_UNITS[unitIndex] ?? ''}`;\n};\n\ninterface IsValidFileTypeOptions {\n file: File;\n types: string;\n}\n\nexport const isValidFileType = ({ types, file }: IsValidFileTypeOptions) => {\n const allowedTypesArray = types.split(',').map((type) => type.trim());\n const fileType = file.type;\n\n return allowedTypesArray.some((type) => {\n if (type.endsWith('/*')) {\n const baseType = type.slice(0, -2); // remove '/*'\n return fileType.startsWith(baseType);\n }\n return fileType === type;\n });\n};\n\nexport const MIME_TYPE_MAPPING: Record<string, string> = {\n // Haupttypen\n 'application/pdf': 'fa fa-file-pdf',\n 'application/zip': 'fa fa-file-archive',\n 'application/msword': 'fa fa-file-word',\n 'application/vnd.ms-excel': 'fa fa-file-excel',\n // Typen mit Wildcards\n 'application/vnd.openxmlformats-officedocument.': 'fa fa-file-word',\n 'application/x-': 'fa fa-file-archive',\n // Addiere nur spezifische Fälle\n 'text/pdf': 'fa fa-file-pdf',\n};\n\nexport const getIconByMimeType = (mimeType?: string): string => {\n const matchedType = Object.keys(MIME_TYPE_MAPPING).find((type) => mimeType?.startsWith(type));\n return MIME_TYPE_MAPPING[matchedType!] || 'fa fa-file';\n};\n"],"mappings":"AAEA,OAAO,MAAMA,YAAY,GAAGA,CACxBC,KAAU,EACVC,OAAU,EACVC,UAAmC,KACzBF,KAAK,CAACG,IAAI,CAAEC,IAAI,IAAKF,UAAU,CAACE,IAAI,EAAEH,OAAO,CAAC,CAAC;AAO7D,OAAO,MAAMI,mBAAmB,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAmC,CAAC,KAC7ER,YAAY,CAACO,KAAK,EAAEC,OAAO,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACE,IAAI,KAAKD,CAAC,CAACC,IAAI,IAAIF,CAAC,CAACG,IAAI,KAAKF,C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AAOH,QAAQ,CAACI,UAAU,CAACF,QAAQ,CAAC;IACxC;IACA,OAAOF,QAAQ,KAAKF,IAAI;EAC5B,CAAC,CAAC;AACN,CAAC;AAED,OAAO,MAAMO,iBAAyC,GAAG;EACrD;EACA,iBAAiB,EAAE,gBAAgB;EACnC,iBAAiB,EAAE,oBAAoB;EACvC,oBAAoB,EAAE,iBAAiB;EACvC,0BAA0B,EAAE,kBAAkB;EAC9C;EACA,gDAAgD,EAAE,iBAAiB;EACnE,gBAAgB,EAAE,oBAAoB;EACtC;EACA,UAAU,EAAE;AAChB,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAIC,QAAiB,IAAa;EAC5D,MAAMC,WAAW,GAAGC,MAAM,CAACC,IAAI,CAACL,iBAAiB,CAAC,CAACM,IAAI,CAAEb,IAAI,IAAKS,QAAQ,EAAEH,UAAU,CAACN,IAAI,CAAC,CAAC;EAC7F,OAAOO,iBAAiB,CAACG,WAAW,CAAE,IAAI,YAAY;AAC1D,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
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, currentColor 70%, transparent);
|
|
9
|
+
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
|
|
10
|
+
border-radius: 3px;
|
|
11
|
+
outline-offset: 1px;
|
|
12
|
+
color: white;
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Circular focus ring variant for round controls (e.g. RadioButton).
|
|
17
|
+
*/
|
|
18
|
+
export const keyboardFocusHighlightingCircleRingCss = css`
|
|
19
|
+
outline: solid 2px color-mix(in srgb, currentColor 70%, transparent);
|
|
20
|
+
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
outline-offset: 1px;
|
|
23
|
+
color: white;
|
|
24
|
+
`;
|
|
25
|
+
//# sourceMappingURL=keyboardFocusHighlighting.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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, currentColor 70%, transparent);\n box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);\n border-radius: 3px;\n outline-offset: 1px;\n color: white;\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, currentColor 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;AACA,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAME,sCAAsC,GAAGF,GAAG;AACzD;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -135,6 +135,11 @@ export type AccordionProps = {
|
|
|
135
135
|
* Whether the accordion should be indexed.
|
|
136
136
|
*/
|
|
137
137
|
shouldIndex?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Enables keyboard-only focus highlighting. The highlighting is only visible while the
|
|
140
|
+
* user navigates with the keyboard and is reset on mouse movement or click.
|
|
141
|
+
*/
|
|
142
|
+
shouldEnableKeyboardHighlighting?: boolean;
|
|
138
143
|
};
|
|
139
144
|
declare const Accordion: FC<AccordionProps>;
|
|
140
145
|
export default Accordion;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const StyledMotionAccordion: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
2
|
-
ref?:
|
|
3
|
-
}, "theme" | "$isWrapped" | "$isOpen" | "$isParentWrapped" | "$shouldForceBackground" | "$shouldHideBackground" | "$shouldShowLines" | "$shouldHideBottomLine" | "$bottomBorderColor"> & {
|
|
2
|
+
ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
3
|
+
}, "theme" | "$shouldShowKeyboardHighlighting" | "$isWrapped" | "$isOpen" | "$isParentWrapped" | "$shouldForceBackground" | "$shouldHideBackground" | "$shouldShowLines" | "$shouldHideBottomLine" | "$bottomBorderColor" | "$shouldEnableKeyboardHighlighting"> & {
|
|
4
4
|
$isOpen: boolean;
|
|
5
5
|
$isParentWrapped?: boolean;
|
|
6
6
|
$isWrapped?: boolean;
|
|
@@ -9,11 +9,13 @@ export declare const StyledMotionAccordion: import("styled-components/dist/types
|
|
|
9
9
|
$shouldShowLines?: boolean;
|
|
10
10
|
$shouldHideBottomLine: boolean;
|
|
11
11
|
$bottomBorderColor?: string;
|
|
12
|
+
$shouldEnableKeyboardHighlighting?: boolean;
|
|
13
|
+
$shouldShowKeyboardHighlighting?: boolean;
|
|
12
14
|
} & {
|
|
13
15
|
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
14
16
|
}, never> & Partial<Pick<import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
-
ref?:
|
|
16
|
-
}, "theme" | "$isWrapped" | "$isOpen" | "$isParentWrapped" | "$shouldForceBackground" | "$shouldHideBackground" | "$shouldShowLines" | "$shouldHideBottomLine" | "$bottomBorderColor"> & {
|
|
17
|
+
ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
18
|
+
}, "theme" | "$shouldShowKeyboardHighlighting" | "$isWrapped" | "$isOpen" | "$isParentWrapped" | "$shouldForceBackground" | "$shouldHideBackground" | "$shouldShowLines" | "$shouldHideBottomLine" | "$bottomBorderColor" | "$shouldEnableKeyboardHighlighting"> & {
|
|
17
19
|
$isOpen: boolean;
|
|
18
20
|
$isParentWrapped?: boolean;
|
|
19
21
|
$isWrapped?: boolean;
|
|
@@ -22,6 +24,8 @@ export declare const StyledMotionAccordion: import("styled-components/dist/types
|
|
|
22
24
|
$shouldShowLines?: boolean;
|
|
23
25
|
$shouldHideBottomLine: boolean;
|
|
24
26
|
$bottomBorderColor?: string;
|
|
27
|
+
$shouldEnableKeyboardHighlighting?: boolean;
|
|
28
|
+
$shouldShowKeyboardHighlighting?: boolean;
|
|
25
29
|
} & {
|
|
26
30
|
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
27
31
|
}, never>>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof React.Component<any, {}, any>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare const StyledMotionAccordionBody: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
2
|
-
ref?:
|
|
2
|
+
ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
3
3
|
}, "theme" | "$maxHeight"> & {
|
|
4
4
|
$maxHeight?: number;
|
|
5
5
|
} & {
|
|
6
6
|
theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
7
7
|
}, never> & Partial<Pick<import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
8
|
-
ref?:
|
|
8
|
+
ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
9
9
|
}, "theme" | "$maxHeight"> & {
|
|
10
10
|
$maxHeight?: number;
|
|
11
11
|
} & {
|
|
@@ -2,14 +2,19 @@ import React, { Dispatch, FC, ReactNode, SetStateAction } from 'react';
|
|
|
2
2
|
type IUpdateOpenAccordionUuid = (uuid: string, options?: {
|
|
3
3
|
shouldOnlyOpen?: boolean;
|
|
4
4
|
}) => void;
|
|
5
|
-
type
|
|
5
|
+
type IUpdateActiveAccordionUuid = (uuid?: string) => void;
|
|
6
|
+
type IRegisterAccordionUuid = (uuid: string) => void;
|
|
7
|
+
type IUnregisterAccordionUuid = (uuid: string) => void;
|
|
6
8
|
interface IAccordionGroupContext {
|
|
7
9
|
isWrapped?: boolean;
|
|
8
10
|
openAccordionUuid?: string;
|
|
9
11
|
setOpenAccordionUuid?: Dispatch<SetStateAction<string | undefined>>;
|
|
10
12
|
updateOpenAccordionUuid?: IUpdateOpenAccordionUuid;
|
|
11
13
|
accordionUuids?: string[];
|
|
12
|
-
|
|
14
|
+
registerAccordionUuid?: IRegisterAccordionUuid;
|
|
15
|
+
unregisterAccordionUuid?: IUnregisterAccordionUuid;
|
|
16
|
+
activeAccordionUuid?: string;
|
|
17
|
+
updateActiveAccordionUuid?: IUpdateActiveAccordionUuid;
|
|
13
18
|
accordionGroupUuid?: string;
|
|
14
19
|
}
|
|
15
20
|
export declare const AccordionGroupContext: React.Context<IAccordionGroupContext>;
|
|
@@ -19,6 +19,7 @@ export type AccordionHeadProps = {
|
|
|
19
19
|
titleInputProps?: InputProps;
|
|
20
20
|
titleColor?: CSSProperties['color'];
|
|
21
21
|
shouldSkipAnimation?: boolean;
|
|
22
|
+
shouldEnableKeyboardHighlighting?: boolean;
|
|
22
23
|
};
|
|
23
24
|
declare const AccordionHead: FC<AccordionHeadProps>;
|
|
24
25
|
export default AccordionHead;
|