emoji-picker-react 4.22.2 → 5.0.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/README.md +335 -49
- package/dist/DomUtils/categoryNameFromDom.d.ts +1 -1
- package/dist/DomUtils/classNames.d.ts +24 -23
- package/dist/DomUtils/detectEmojyPartiallyBelowFold.d.ts +2 -2
- package/dist/DomUtils/elementPositionInRow.d.ts +5 -5
- package/dist/DomUtils/eventBelongsToPicker.d.ts +2 -0
- package/dist/DomUtils/focusElement.d.ts +5 -5
- package/dist/DomUtils/getActiveElement.d.ts +2 -2
- package/dist/DomUtils/isJsdom.d.ts +1 -0
- package/dist/DomUtils/isRtl.d.ts +1 -0
- package/dist/DomUtils/keyboardNavigation.d.ts +7 -8
- package/dist/DomUtils/scrollTo.d.ts +4 -5
- package/dist/DomUtils/selectors.d.ts +31 -35
- package/dist/EmojiPickerReact.d.ts +5 -5
- package/dist/Stylesheet/DedupedStyle.d.ts +13 -0
- package/dist/Stylesheet/stylesheet.d.ts +40 -37
- package/dist/components/ErrorBoundary.d.ts +15 -15
- package/dist/components/Layout/Absolute.d.ts +8 -8
- package/dist/components/Layout/Flex.d.ts +13 -13
- package/dist/components/Layout/Relative.d.ts +8 -8
- package/dist/components/Layout/Space.d.ts +7 -7
- package/dist/components/Reactions/BtnPlus.d.ts +2 -2
- package/dist/components/Reactions/DEFAULT_REACTIONS.d.ts +1 -1
- package/dist/components/Reactions/Reactions.d.ts +3 -2
- package/dist/components/atoms/Button.d.ts +11 -6
- package/dist/components/body/EmojiCategory.d.ts +13 -12
- package/dist/components/body/EmojiList.d.ts +7 -4
- package/dist/components/body/EmojiVariationPicker.d.ts +2 -2
- package/dist/components/body/MeasureEmoji.d.ts +2 -2
- package/dist/components/body/listComponents.d.ts +47 -0
- package/dist/components/context/ElementRefContext.d.ts +18 -16
- package/dist/components/context/PickerConfigContext.d.ts +14 -9
- package/dist/components/context/PickerContext.d.ts +57 -25
- package/dist/components/context/PickerDataContext.d.ts +23 -17
- package/dist/components/emoji/BaseEmojiProps.d.ts +14 -13
- package/dist/components/emoji/ClickableEmojiButton.d.ts +23 -15
- package/dist/components/emoji/Emoji.d.ts +18 -15
- package/dist/components/emoji/EmojiImg.d.ts +11 -11
- package/dist/components/emoji/ExportedEmoji.d.ts +11 -11
- package/dist/components/emoji/NativeEmoji.d.ts +6 -6
- package/dist/components/emoji/ViewOnlyEmoji.d.ts +3 -3
- package/dist/components/emoji/emojiStyles.d.ts +6 -1
- package/dist/components/footer/Preview.d.ts +7 -7
- package/dist/components/header/Header.d.ts +2 -2
- package/dist/components/header/Search/BtnClearSearch.d.ts +2 -2
- package/dist/components/header/Search/IcnSearch.d.ts +2 -2
- package/dist/components/header/Search/Search.d.ts +11 -3
- package/dist/components/header/SkinTonePicker/BtnSkinToneVariation.d.ts +12 -12
- package/dist/components/header/SkinTonePicker/SkinTonePicker.d.ts +11 -11
- package/dist/components/icons/svgIcons.d.ts +4 -0
- package/dist/components/main/PickerMainBehaviors.d.ts +4 -0
- package/dist/components/main/defaultAppearance.d.ts +12 -0
- package/dist/components/main/labelHeight.d.ts +1 -0
- package/dist/components/navigation/CategoryButton.d.ts +12 -12
- package/dist/components/navigation/CategoryNavIcon.d.ts +4 -4
- package/dist/components/navigation/CategoryNavigation.d.ts +19 -2
- package/dist/config/categoryConfig.d.ts +34 -34
- package/dist/config/cdnUrls.d.ts +2 -2
- package/dist/config/compareConfig.d.ts +10 -2
- package/dist/config/config.d.ts +166 -64
- package/dist/config/customEmojiConfig.d.ts +14 -14
- package/dist/config/defaultPickerConfiguration.d.ts +10 -0
- package/dist/config/mutableConfig.d.ts +32 -10
- package/dist/config/useConfig.d.ts +48 -36
- package/dist/data/defaultEmojiData.d.ts +9 -0
- package/dist/data/defaultEmojiData.js +40 -0
- package/dist/data/emojis-bn.d.mts +39 -0
- package/dist/data/emojis-bn.d.ts +38 -2
- package/dist/data/emojis-bn.js +25 -2
- package/dist/data/emojis-bn.mjs +2 -0
- package/dist/data/emojis-da.d.mts +39 -0
- package/dist/data/emojis-da.d.ts +38 -2
- package/dist/data/emojis-da.js +25 -2
- package/dist/data/emojis-da.mjs +2 -0
- package/dist/data/emojis-de.d.mts +39 -0
- package/dist/data/emojis-de.d.ts +38 -2
- package/dist/data/emojis-de.js +25 -2
- package/dist/data/emojis-de.mjs +2 -0
- package/dist/data/emojis-en-gb.d.mts +39 -0
- package/dist/data/emojis-en-gb.d.ts +38 -2
- package/dist/data/emojis-en-gb.js +25 -2
- package/dist/data/emojis-en-gb.mjs +2 -0
- package/dist/data/emojis-en.d.mts +39 -0
- package/dist/data/emojis-en.d.ts +38 -2
- package/dist/data/emojis-en.js +25 -2
- package/dist/data/emojis-en.mjs +2 -0
- package/dist/data/emojis-es-mx.d.mts +39 -0
- package/dist/data/emojis-es-mx.d.ts +38 -2
- package/dist/data/emojis-es-mx.js +25 -2
- package/dist/data/emojis-es-mx.mjs +2 -0
- package/dist/data/emojis-es.d.mts +39 -0
- package/dist/data/emojis-es.d.ts +38 -2
- package/dist/data/emojis-es.js +25 -2
- package/dist/data/emojis-es.mjs +2 -0
- package/dist/data/emojis-et.d.mts +39 -0
- package/dist/data/emojis-et.d.ts +38 -2
- package/dist/data/emojis-et.js +25 -2
- package/dist/data/emojis-et.mjs +2 -0
- package/dist/data/emojis-fi.d.mts +39 -0
- package/dist/data/emojis-fi.d.ts +38 -2
- package/dist/data/emojis-fi.js +25 -2
- package/dist/data/emojis-fi.mjs +2 -0
- package/dist/data/emojis-fr.d.mts +39 -0
- package/dist/data/emojis-fr.d.ts +38 -2
- package/dist/data/emojis-fr.js +25 -2
- package/dist/data/emojis-fr.mjs +2 -0
- package/dist/data/emojis-hi.d.mts +39 -0
- package/dist/data/emojis-hi.d.ts +38 -2
- package/dist/data/emojis-hi.js +25 -2
- package/dist/data/emojis-hi.mjs +2 -0
- package/dist/data/emojis-hu.d.mts +39 -0
- package/dist/data/emojis-hu.d.ts +38 -2
- package/dist/data/emojis-hu.js +25 -2
- package/dist/data/emojis-hu.mjs +2 -0
- package/dist/data/emojis-it.d.mts +39 -0
- package/dist/data/emojis-it.d.ts +38 -2
- package/dist/data/emojis-it.js +25 -2
- package/dist/data/emojis-it.mjs +2 -0
- package/dist/data/emojis-ja.d.mts +39 -0
- package/dist/data/emojis-ja.d.ts +38 -2
- package/dist/data/emojis-ja.js +25 -2
- package/dist/data/emojis-ja.mjs +2 -0
- package/dist/data/emojis-ko.d.mts +39 -0
- package/dist/data/emojis-ko.d.ts +38 -2
- package/dist/data/emojis-ko.js +25 -2
- package/dist/data/emojis-ko.mjs +2 -0
- package/dist/data/emojis-lt.d.mts +39 -0
- package/dist/data/emojis-lt.d.ts +38 -2
- package/dist/data/emojis-lt.js +25 -2
- package/dist/data/emojis-lt.mjs +2 -0
- package/dist/data/emojis-ms.d.mts +39 -0
- package/dist/data/emojis-ms.d.ts +38 -2
- package/dist/data/emojis-ms.js +25 -2
- package/dist/data/emojis-ms.mjs +2 -0
- package/dist/data/emojis-nb.d.mts +39 -0
- package/dist/data/emojis-nb.d.ts +38 -2
- package/dist/data/emojis-nb.js +25 -2
- package/dist/data/emojis-nb.mjs +2 -0
- package/dist/data/emojis-nl.d.mts +39 -0
- package/dist/data/emojis-nl.d.ts +38 -2
- package/dist/data/emojis-nl.js +25 -2
- package/dist/data/emojis-nl.mjs +2 -0
- package/dist/data/emojis-pl.d.mts +39 -0
- package/dist/data/emojis-pl.d.ts +38 -2
- package/dist/data/emojis-pl.js +25 -2
- package/dist/data/emojis-pl.mjs +2 -0
- package/dist/data/emojis-pt.d.mts +39 -0
- package/dist/data/emojis-pt.d.ts +38 -2
- package/dist/data/emojis-pt.js +25 -2
- package/dist/data/emojis-pt.mjs +2 -0
- package/dist/data/emojis-ru.d.mts +39 -0
- package/dist/data/emojis-ru.d.ts +38 -2
- package/dist/data/emojis-ru.js +25 -2
- package/dist/data/emojis-ru.mjs +2 -0
- package/dist/data/emojis-sv.d.mts +39 -0
- package/dist/data/emojis-sv.d.ts +38 -2
- package/dist/data/emojis-sv.js +25 -2
- package/dist/data/emojis-sv.mjs +2 -0
- package/dist/data/emojis-th.d.mts +39 -0
- package/dist/data/emojis-th.d.ts +38 -2
- package/dist/data/emojis-th.js +25 -2
- package/dist/data/emojis-th.mjs +2 -0
- package/dist/data/emojis-uk.d.mts +39 -0
- package/dist/data/emojis-uk.d.ts +38 -2
- package/dist/data/emojis-uk.js +25 -2
- package/dist/data/emojis-uk.mjs +2 -0
- package/dist/data/emojis-vi.d.mts +39 -0
- package/dist/data/emojis-vi.d.ts +38 -2
- package/dist/data/emojis-vi.js +25 -2
- package/dist/data/emojis-vi.mjs +2 -0
- package/dist/data/emojis-zh-hant.d.mts +39 -0
- package/dist/data/emojis-zh-hant.d.ts +38 -2
- package/dist/data/emojis-zh-hant.js +25 -2
- package/dist/data/emojis-zh-hant.mjs +2 -0
- package/dist/data/emojis-zh.d.mts +39 -0
- package/dist/data/emojis-zh.d.ts +38 -2
- package/dist/data/emojis-zh.js +25 -2
- package/dist/data/emojis-zh.mjs +2 -0
- package/dist/data/index.js +1 -0
- package/dist/data/registerDefaultEmojiData.d.ts +1 -0
- package/dist/data/registerDefaultEmojiData.js +3 -0
- package/dist/data-core/pickerData.d.ts +12 -0
- package/dist/data-core/prepare.d.ts +23 -0
- package/dist/data-core/search.d.ts +13 -0
- package/dist/data-core/types.d.ts +23 -0
- package/dist/data.d.mts +72 -0
- package/dist/data.d.ts +72 -0
- package/dist/dataUtils/DataTypes.d.ts +23 -19
- package/dist/dataUtils/emojiSelectors.d.ts +15 -16
- package/dist/dataUtils/emojiUtils.d.ts +1 -12
- package/dist/dataUtils/nativeEmojiSequenceSupport.d.ts +10 -0
- package/dist/dataUtils/nativeEmojiSupport.d.ts +40 -0
- package/dist/dataUtils/parseNativeEmoji.d.ts +1 -1
- package/dist/dataUtils/suggested.d.ts +11 -11
- package/dist/dataUtils/suggestedEmojis.d.ts +7 -0
- package/dist/esm/chunks/chunk-46BUDQLE.mjs +228 -0
- package/dist/esm/chunks/chunk-7ZGTUZFB.mjs +16 -0
- package/dist/esm/chunks/chunk-FQIJ4HBW.mjs +25 -0
- package/dist/esm/chunks/chunk-KQPOIRSC.mjs +9305 -0
- package/dist/esm/chunks/chunk-LO4TPPLH.mjs +43 -0
- package/dist/esm/chunks/emojis-6L3GRBAP.mjs +9 -0
- package/dist/esm/data.mjs +18 -0
- package/dist/esm/index.mjs +389 -0
- package/dist/esm/primitives/index.mjs +67 -0
- package/dist/hooks/preloadEmoji.d.ts +9 -9
- package/dist/hooks/useActiveCategoryScrollDetection.d.ts +11 -11
- package/dist/hooks/useCategoryHeight.d.ts +6 -5
- package/dist/hooks/useCloseAllOpenToggles.d.ts +2 -2
- package/dist/hooks/useDataIdentityStabilityWarning.d.ts +13 -0
- package/dist/hooks/useDebouncedState.d.ts +1 -1
- package/dist/hooks/useDisallowMouseMove.d.ts +4 -4
- package/dist/hooks/useDisallowedEmojis.d.ts +2 -3
- package/dist/hooks/useEmojiPreviewEvents.d.ts +3 -3
- package/dist/hooks/useEmojiVirtualization.d.ts +21 -17
- package/dist/hooks/useFilter.d.ts +10 -16
- package/dist/hooks/useFocus.d.ts +3 -3
- package/dist/hooks/useInitialLoad.d.ts +2 -2
- package/dist/hooks/useIsEmojiHidden.d.ts +8 -8
- package/dist/hooks/useIsMounted.d.ts +1 -1
- package/dist/hooks/useIsSearchMode.d.ts +1 -1
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
- package/dist/hooks/useKeyboardNavigation.d.ts +3 -1
- package/dist/hooks/useMouseDownHandlers.d.ts +8 -4
- package/dist/hooks/useOnFocus.d.ts +1 -1
- package/dist/hooks/useOnScroll.d.ts +2 -2
- package/dist/hooks/useReactionsFocus.d.ts +1 -0
- package/dist/hooks/useRegisterRegion.d.ts +24 -0
- package/dist/hooks/useResolvedEmojiData.d.ts +37 -0
- package/dist/hooks/useScrollCategoryIntoView.d.ts +1 -1
- package/dist/hooks/useSearchController.d.ts +17 -0
- package/dist/hooks/useSearchResults.d.ts +8 -0
- package/dist/hooks/useSetVariationPicker.d.ts +2 -2
- package/dist/hooks/useShouldHideCustomEmojis.d.ts +1 -1
- package/dist/hooks/useShouldShowSkinTonePicker.d.ts +4 -4
- package/dist/index.d.mts +376 -0
- package/dist/index.d.ts +376 -9
- package/dist/index.js +2 -8
- package/dist/primitives/CategoryNav.d.ts +4 -0
- package/dist/primitives/Empty.d.ts +6 -0
- package/dist/primitives/List.d.ts +4 -0
- package/dist/primitives/LoadError.d.ts +8 -0
- package/dist/primitives/Loading.d.ts +4 -0
- package/dist/primitives/Panel.d.ts +3 -0
- package/dist/primitives/Preview.d.ts +3 -0
- package/dist/primitives/Reactions.d.ts +2 -0
- package/dist/primitives/Root.d.ts +26 -0
- package/dist/primitives/Search.d.ts +5 -0
- package/dist/primitives/SearchInput.d.ts +3 -0
- package/dist/primitives/SkinTone.d.ts +4 -0
- package/dist/primitives/Viewport.d.ts +19 -0
- package/dist/primitives/appearance.d.ts +3 -0
- package/dist/primitives/components.d.ts +27 -0
- package/dist/primitives/hooks.d.ts +48 -0
- package/dist/primitives/index.d.mts +561 -0
- package/dist/primitives/index.d.ts +561 -0
- package/dist/primitives/index.js +2 -0
- package/dist/primitives/nativeProps.d.ts +15 -0
- package/dist/primitives/scope.d.ts +13 -0
- package/dist/primitives/structuralStyles.d.ts +16 -0
- package/dist/primitives/tokens.d.ts +18 -0
- package/dist/primitives/types.d.ts +85 -0
- package/dist/state/activeEmojiStore.d.ts +7 -0
- package/dist/state/navigationRegistry.d.ts +61 -0
- package/dist/state/regionTraversal.d.ts +20 -0
- package/dist/typeRefinements/typeRefinements.d.ts +6 -6
- package/dist/types/exposedTypes.d.ts +16 -6
- package/dist/types/exposedTypes.js +5 -0
- package/dist/virtualization/virtualizationHelpers.d.ts +20 -18
- package/llms-full.txt +3680 -0
- package/llms.txt +66 -476
- package/package.json +204 -66
- package/src/DomUtils/categoryNameFromDom.ts +1 -1
- package/src/DomUtils/classNames.ts +1 -0
- package/src/DomUtils/elementPositionInRow.ts +26 -4
- package/src/DomUtils/eventBelongsToPicker.ts +17 -0
- package/src/DomUtils/getActiveElement.ts +7 -1
- package/src/DomUtils/isJsdom.ts +12 -0
- package/src/DomUtils/isRtl.ts +5 -0
- package/src/DomUtils/keyboardNavigation.ts +105 -149
- package/src/DomUtils/scrollTo.ts +18 -16
- package/src/DomUtils/selectors.ts +20 -111
- package/src/EmojiPickerReact.tsx +155 -48
- package/src/Stylesheet/DedupedStyle.tsx +80 -0
- package/src/Stylesheet/stylesheet.tsx +128 -59
- package/src/components/Layout/Flex.tsx +12 -11
- package/src/components/Reactions/BtnPlus.tsx +61 -51
- package/src/components/Reactions/Reactions.tsx +113 -55
- package/src/components/atoms/Button.tsx +18 -15
- package/src/components/body/EmojiCategory.tsx +77 -40
- package/src/components/body/EmojiList.tsx +55 -23
- package/src/components/body/EmojiVariationPicker.tsx +113 -66
- package/src/components/body/MeasureEmoji.tsx +9 -2
- package/src/components/body/listComponents.tsx +79 -0
- package/src/components/context/ElementRefContext.tsx +46 -35
- package/src/components/context/PickerConfigContext.tsx +55 -40
- package/src/components/context/PickerContext.tsx +567 -92
- package/src/components/context/PickerDataContext.tsx +110 -99
- package/src/components/emoji/BaseEmojiProps.ts +5 -4
- package/src/components/emoji/ClickableEmojiButton.tsx +148 -63
- package/src/components/emoji/Emoji.tsx +24 -2
- package/src/components/emoji/EmojiImg.tsx +13 -12
- package/src/components/emoji/ExportedEmoji.tsx +5 -4
- package/src/components/emoji/NativeEmoji.tsx +19 -16
- package/src/components/emoji/ViewOnlyEmoji.tsx +55 -30
- package/src/components/emoji/emojiStyles.ts +12 -11
- package/src/components/footer/Preview.tsx +86 -91
- package/src/components/header/Header.tsx +21 -6
- package/src/components/header/Search/BtnClearSearch.tsx +69 -55
- package/src/components/header/Search/IcnSearch.tsx +21 -21
- package/src/components/header/Search/Search.tsx +77 -137
- package/src/components/header/SkinTonePicker/BtnSkinToneVariation.tsx +99 -62
- package/src/components/header/SkinTonePicker/SkinTonePicker.tsx +84 -46
- package/src/components/icons/svgIcons.ts +17 -0
- package/src/components/main/PickerMainBehaviors.tsx +163 -0
- package/src/components/main/defaultAppearance.tsx +188 -0
- package/src/components/main/labelHeight.ts +5 -0
- package/src/components/navigation/CategoryButton.tsx +83 -57
- package/src/components/navigation/CategoryNavIcon.tsx +73 -194
- package/src/components/navigation/CategoryNavigation.tsx +118 -46
- package/src/config/categoryConfig.ts +7 -3
- package/src/config/cdnUrls.ts +11 -21
- package/src/config/compareConfig.ts +128 -30
- package/src/config/config.ts +228 -24
- package/src/config/defaultPickerConfiguration.ts +7 -0
- package/src/config/mutableConfig.ts +44 -20
- package/src/config/useConfig.ts +130 -37
- package/src/data/defaultEmojiData.ts +49 -0
- package/src/data/registerDefaultEmojiData.ts +8 -0
- package/src/data-core/pickerData.ts +173 -0
- package/src/data-core/prepare.ts +178 -0
- package/src/data-core/search.ts +122 -0
- package/src/data-core/types.ts +36 -0
- package/src/data.ts +10 -0
- package/src/dataUtils/DataTypes.ts +4 -0
- package/src/dataUtils/emojiSelectors.ts +58 -63
- package/src/dataUtils/emojiUtils.ts +17 -74
- package/src/dataUtils/nativeEmojiSequenceSupport.ts +116 -0
- package/src/dataUtils/nativeEmojiSupport.ts +160 -0
- package/src/dataUtils/suggested.ts +8 -4
- package/src/dataUtils/suggestedEmojis.ts +92 -0
- package/src/env.d.ts +4 -0
- package/src/hooks/preloadEmoji.ts +3 -3
- package/src/hooks/useActiveCategoryScrollDetection.ts +10 -1
- package/src/hooks/useCategoryHeight.ts +82 -8
- package/src/hooks/useDataIdentityStabilityWarning.ts +86 -0
- package/src/hooks/useDebouncedState.ts +13 -1
- package/src/hooks/useDisallowedEmojis.ts +26 -42
- package/src/hooks/useEmojiPreviewEvents.ts +43 -10
- package/src/hooks/useEmojiVirtualization.tsx +38 -4
- package/src/hooks/useFilter.ts +85 -127
- package/src/hooks/useFocus.ts +14 -24
- package/src/hooks/useIsEmojiHidden.ts +10 -6
- package/src/hooks/useKeyboardNavigation.ts +322 -429
- package/src/hooks/useMouseDownHandlers.ts +91 -16
- package/src/hooks/useOnFocus.ts +12 -3
- package/src/hooks/useOnScroll.ts +18 -2
- package/src/hooks/useReactionsFocus.ts +118 -0
- package/src/hooks/useRegisterRegion.ts +92 -0
- package/src/hooks/useResolvedEmojiData.ts +200 -0
- package/src/hooks/useScrollCategoryIntoView.ts +74 -12
- package/src/hooks/useSearchController.ts +369 -0
- package/src/hooks/useSearchResults.ts +51 -0
- package/src/hooks/useSetVariationPicker.ts +4 -1
- package/src/index.tsx +67 -5
- package/src/primitives/CategoryNav.tsx +40 -0
- package/src/primitives/Empty.tsx +68 -0
- package/src/primitives/List.tsx +61 -0
- package/src/primitives/LoadError.tsx +38 -0
- package/src/primitives/Loading.tsx +60 -0
- package/src/primitives/Panel.tsx +47 -0
- package/src/primitives/Preview.tsx +38 -0
- package/src/primitives/Reactions.tsx +2 -0
- package/src/primitives/Root.tsx +398 -0
- package/src/primitives/Search.tsx +41 -0
- package/src/primitives/SearchInput.tsx +110 -0
- package/src/primitives/SkinTone.tsx +76 -0
- package/src/primitives/Viewport.tsx +204 -0
- package/src/primitives/appearance.tsx +7 -0
- package/src/primitives/components.tsx +30 -0
- package/src/primitives/hooks.ts +165 -0
- package/src/primitives/index.ts +94 -0
- package/src/primitives/nativeProps.ts +90 -0
- package/src/primitives/scope.tsx +109 -0
- package/src/primitives/structuralStyles.tsx +133 -0
- package/src/primitives/tokens.ts +149 -0
- package/src/primitives/types.ts +192 -0
- package/src/state/activeEmojiStore.ts +39 -0
- package/src/state/navigationRegistry.ts +209 -0
- package/src/state/regionTraversal.ts +116 -0
- package/src/svg.d.ts +2 -2
- package/src/types/exposedTypes.ts +28 -1
- package/src/virtualization/virtualizationHelpers.ts +20 -6
- package/dist/components/body/Body.d.ts +0 -2
- package/dist/components/main/PickerMain.d.ts +0 -7
- package/dist/dataUtils/alphaNumericEmojiIndex.d.ts +0 -5
- package/dist/emoji-picker-react.cjs.development.js +0 -31413
- package/dist/emoji-picker-react.cjs.development.js.map +0 -1
- package/dist/emoji-picker-react.cjs.production.min.js +0 -2
- package/dist/emoji-picker-react.cjs.production.min.js.map +0 -1
- package/dist/emoji-picker-react.esm.js +0 -31411
- package/dist/emoji-picker-react.esm.js.map +0 -1
- package/dist/hooks/useHideEmojisByUniocode.d.ts +0 -1
- package/src/components/body/Body.tsx +0 -43
- package/src/components/main/PickerMain.tsx +0 -249
- package/src/dataUtils/alphaNumericEmojiIndex.ts +0 -21
package/src/EmojiPickerReact.tsx
CHANGED
|
@@ -1,75 +1,182 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import { PickerStyleTag } from './Stylesheet/stylesheet';
|
|
4
|
-
import { Reactions } from './components/Reactions/Reactions';
|
|
5
|
-
import { Body } from './components/body/Body';
|
|
6
|
-
import { ElementRefContextProvider } from './components/context/ElementRefContext';
|
|
7
|
-
import { PickerConfigProvider } from './components/context/PickerConfigContext';
|
|
8
|
-
import { useReactionsModeState } from './components/context/PickerContext';
|
|
9
|
-
import { PickerDataProvider } from './components/context/PickerDataContext';
|
|
10
|
-
import { Preview } from './components/footer/Preview';
|
|
11
3
|
import { Header } from './components/header/Header';
|
|
12
|
-
import
|
|
4
|
+
import {
|
|
5
|
+
defaultRootClassName,
|
|
6
|
+
defaultRootStyle,
|
|
7
|
+
} from './components/main/defaultAppearance';
|
|
13
8
|
import { compareConfig } from './config/compareConfig';
|
|
14
|
-
import {
|
|
9
|
+
import { resolveSkinTonePickerLocation } from './config/config';
|
|
10
|
+
import { DefaultPickerConfiguration } from './config/defaultPickerConfiguration';
|
|
11
|
+
import {
|
|
12
|
+
validColumns,
|
|
13
|
+
usePreviewConfig,
|
|
14
|
+
useSkinTonesDisabledConfig,
|
|
15
|
+
} from './config/useConfig';
|
|
16
|
+
import { useIsSkinToneInPreview } from './hooks/useShouldShowSkinTonePicker';
|
|
17
|
+
import {
|
|
18
|
+
Empty,
|
|
19
|
+
List,
|
|
20
|
+
Loading,
|
|
21
|
+
LoadError,
|
|
22
|
+
Preview,
|
|
23
|
+
SkinTone,
|
|
24
|
+
Panel,
|
|
25
|
+
Reactions,
|
|
26
|
+
Root,
|
|
27
|
+
Viewport,
|
|
28
|
+
} from './primitives';
|
|
29
|
+
import { isPickerBehaviorProp } from './primitives/Root';
|
|
30
|
+
import type { RootBehaviorProps, RootProps } from './primitives/types';
|
|
31
|
+
import { SkinTonePickerLocation } from './types/exposedTypes';
|
|
15
32
|
|
|
16
33
|
import { PickerProps } from './index';
|
|
17
34
|
|
|
35
|
+
// Canonical default composition: the
|
|
36
|
+
// default picker is assembled from the same exported primitive modules
|
|
37
|
+
// advanced consumers use. Private wrappers provide appearance/layout only;
|
|
38
|
+
// all behavior lives in the shared primitives below.
|
|
18
39
|
function EmojiPicker(props: PickerProps) {
|
|
40
|
+
const rootInput = props as PickerProps & {
|
|
41
|
+
colorScheme?: PickerProps['theme'];
|
|
42
|
+
unstyled?: boolean;
|
|
43
|
+
components?: RootProps['components'];
|
|
44
|
+
};
|
|
45
|
+
const {
|
|
46
|
+
theme: legacyTheme,
|
|
47
|
+
colorScheme,
|
|
48
|
+
width,
|
|
49
|
+
height,
|
|
50
|
+
className,
|
|
51
|
+
style,
|
|
52
|
+
unstyled,
|
|
53
|
+
components,
|
|
54
|
+
open,
|
|
55
|
+
searchDisabled = false,
|
|
56
|
+
skinTonesDisabled = false,
|
|
57
|
+
skinTonePickerLocation = SkinTonePickerLocation.SEARCH,
|
|
58
|
+
previewConfig,
|
|
59
|
+
...rest
|
|
60
|
+
} = rootInput;
|
|
61
|
+
const theme = colorScheme ?? legacyTheme;
|
|
62
|
+
const showPreview = previewConfig?.showPreview ?? true;
|
|
63
|
+
const resolvedLocation = resolveSkinTonePickerLocation(
|
|
64
|
+
skinTonePickerLocation,
|
|
65
|
+
searchDisabled,
|
|
66
|
+
showPreview,
|
|
67
|
+
);
|
|
68
|
+
const defaultConfiguration = {
|
|
69
|
+
searchDisabled,
|
|
70
|
+
skinTonesDisabled,
|
|
71
|
+
skinTonePickerLocation: resolvedLocation,
|
|
72
|
+
previewConfig,
|
|
73
|
+
// Closed, as in v4, keeps the picker's state (skin tone, search,
|
|
74
|
+
// reactions mode) and renders nothing.
|
|
75
|
+
open: open !== false,
|
|
76
|
+
};
|
|
77
|
+
const { behaviorProps, unknownProps } = pickBehaviorProps(rest);
|
|
78
|
+
useUnknownPropsWarning(unknownProps);
|
|
79
|
+
|
|
19
80
|
return (
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
81
|
+
<DefaultPickerConfiguration.Provider value={defaultConfiguration}>
|
|
82
|
+
<Root
|
|
83
|
+
appearance={unstyled ? 'none' : 'default'}
|
|
84
|
+
components={components}
|
|
85
|
+
{...(behaviorProps as RootBehaviorProps)}
|
|
86
|
+
className={defaultRootClassName(theme, className, unstyled)}
|
|
87
|
+
style={defaultRootStyle({
|
|
88
|
+
width,
|
|
89
|
+
height,
|
|
90
|
+
style,
|
|
91
|
+
columns: validColumns(props.columns),
|
|
92
|
+
})}
|
|
93
|
+
>
|
|
94
|
+
<Reactions />
|
|
95
|
+
<Panel>{CONTENT}</Panel>
|
|
96
|
+
</Root>
|
|
97
|
+
</DefaultPickerConfiguration.Provider>
|
|
28
98
|
);
|
|
29
99
|
}
|
|
30
100
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
101
|
+
const NATIVE_ATTRIBUTES: ReadonlySet<string> = new Set([
|
|
102
|
+
'id',
|
|
103
|
+
'title',
|
|
104
|
+
'lang',
|
|
105
|
+
'dir',
|
|
106
|
+
]);
|
|
34
107
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
108
|
+
function isNativeAttribute(key: string): boolean {
|
|
109
|
+
return (
|
|
110
|
+
NATIVE_ATTRIBUTES.has(key) ||
|
|
111
|
+
key.startsWith('aria-') ||
|
|
112
|
+
key.startsWith('data-')
|
|
113
|
+
);
|
|
114
|
+
}
|
|
42
115
|
|
|
43
|
-
|
|
44
|
-
|
|
116
|
+
// Picker props and plain identifying attributes (id, aria-*, data-*) reach
|
|
117
|
+
// Root; anything else is dropped, as in v4. Forwarding every prop would
|
|
118
|
+
// leak removed v3/v4 props such as `pickerStyle` onto the aside as invalid
|
|
119
|
+
// attributes, or turn stray handlers live.
|
|
120
|
+
function pickBehaviorProps(props: object): {
|
|
121
|
+
behaviorProps: Record<string, unknown>;
|
|
122
|
+
unknownProps: string;
|
|
123
|
+
} {
|
|
124
|
+
const behaviorProps: Record<string, unknown> = {};
|
|
125
|
+
const unknown: string[] = [];
|
|
126
|
+
const values = props as Record<string, unknown>;
|
|
127
|
+
for (const key of Object.keys(values)) {
|
|
128
|
+
if (isPickerBehaviorProp(key) || isNativeAttribute(key)) {
|
|
129
|
+
behaviorProps[key] = values[key];
|
|
130
|
+
} else {
|
|
131
|
+
unknown.push(key);
|
|
45
132
|
}
|
|
46
|
-
}, [renderAll, allowExpandReactions, reactionsDefaultOpen]);
|
|
47
|
-
|
|
48
|
-
if (!isOpen) {
|
|
49
|
-
return null;
|
|
50
133
|
}
|
|
134
|
+
return { behaviorProps, unknownProps: unknown.join(', ') };
|
|
135
|
+
}
|
|
51
136
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
137
|
+
const useUnknownPropsWarning: (unknownProps: string) => void =
|
|
138
|
+
process.env.NODE_ENV === 'production'
|
|
139
|
+
? () => undefined
|
|
140
|
+
: useDevUnknownPropsWarning;
|
|
141
|
+
|
|
142
|
+
function useDevUnknownPropsWarning(unknownProps: string) {
|
|
143
|
+
React.useEffect(() => {
|
|
144
|
+
if (unknownProps) {
|
|
145
|
+
// eslint-disable-next-line no-console
|
|
146
|
+
console.warn(
|
|
147
|
+
`[emoji-picker-react] Ignoring unknown prop(s): ${unknownProps}. ` +
|
|
148
|
+
'See docs/v5/MIGRATION.md for removed props.',
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
}, [unknownProps]);
|
|
58
152
|
}
|
|
59
153
|
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
154
|
+
function ContentControl() {
|
|
155
|
+
const showPreview = usePreviewConfig().showPreview;
|
|
156
|
+
const skinTonesDisabled = useSkinTonesDisabledConfig();
|
|
157
|
+
const toneInPreview = useIsSkinToneInPreview();
|
|
64
158
|
|
|
65
159
|
return (
|
|
66
160
|
<>
|
|
67
161
|
<Header />
|
|
68
|
-
<
|
|
69
|
-
|
|
162
|
+
<Viewport>
|
|
163
|
+
<List />
|
|
164
|
+
<Empty />
|
|
165
|
+
<Loading />
|
|
166
|
+
<LoadError />
|
|
167
|
+
</Viewport>
|
|
168
|
+
{showPreview && (
|
|
169
|
+
<Preview>
|
|
170
|
+
{!skinTonesDisabled && toneInPreview && (
|
|
171
|
+
<SkinTone orientation="vertical" />
|
|
172
|
+
)}
|
|
173
|
+
</Preview>
|
|
174
|
+
)}
|
|
70
175
|
</>
|
|
71
176
|
);
|
|
72
177
|
}
|
|
73
178
|
|
|
74
|
-
//
|
|
75
|
-
|
|
179
|
+
// One immutable composition element; state still belongs to each mounted Root.
|
|
180
|
+
const CONTENT = /* @__PURE__ */ React.createElement(ContentControl);
|
|
181
|
+
|
|
182
|
+
export default /* @__PURE__ */ React.memo(EmojiPicker, compareConfig);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useIsomorphicLayoutEffect } from '../hooks/useIsomorphicLayoutEffect';
|
|
4
|
+
|
|
5
|
+
type Claim = { update: () => void; detached: () => boolean };
|
|
6
|
+
|
|
7
|
+
// Root node (a document or shadow root) → nonce and CSS text → mounted
|
|
8
|
+
// claims, in mount order. The first claim renders the style element; the
|
|
9
|
+
// rest render nothing. A page with a picker per message otherwise repeats
|
|
10
|
+
// the full library sheet once per picker.
|
|
11
|
+
const claimsByRoot = new WeakMap<Node, Record<string, Claim[]>>();
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Renders `css` once per document or shadow root. Every instance renders
|
|
15
|
+
* the element during SSR and its first client render, so hydration matches
|
|
16
|
+
* the server markup; duplicates drop right after the first paint.
|
|
17
|
+
* When the owner unmounts, the next instance renders the element in the
|
|
18
|
+
* same commit. A different nonce or layer gets its own element: a style
|
|
19
|
+
* allowed by one nonce must not stand in for another under CSP.
|
|
20
|
+
*/
|
|
21
|
+
export function DedupedStyle({ css, nonce }: { css: string; nonce?: string }) {
|
|
22
|
+
const styleRef = React.useRef<HTMLStyleElement>(null);
|
|
23
|
+
const rootRef = React.useRef<Node | undefined>(undefined);
|
|
24
|
+
const [owner, setOwner] = React.useState(true);
|
|
25
|
+
|
|
26
|
+
const syncRef = React.useRef<(() => void) | undefined>(undefined);
|
|
27
|
+
|
|
28
|
+
// Register in the commit that mounts the element, so ownership is known
|
|
29
|
+
// before any later picker mounts. A sibling's ownership changes only on
|
|
30
|
+
// unmount (below) and after paint: a state update during layout effects
|
|
31
|
+
// would flush every pending passive effect into the mount, delaying the
|
|
32
|
+
// first paint of the whole picker.
|
|
33
|
+
useIsomorphicLayoutEffect(() => {
|
|
34
|
+
const style = styleRef.current;
|
|
35
|
+
const root = (rootRef.current =
|
|
36
|
+
rootRef.current || (style ? style.getRootNode() : undefined));
|
|
37
|
+
if (!root) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const byKey = claimsByRoot.get(root) || {};
|
|
41
|
+
claimsByRoot.set(root, byKey);
|
|
42
|
+
const key = nonce + css;
|
|
43
|
+
const claims = (byKey[key] = byKey[key] || []);
|
|
44
|
+
const claim: Claim = {
|
|
45
|
+
update: () => setOwner(claims[0] === claim),
|
|
46
|
+
detached: () => !!styleRef.current && !styleRef.current.isConnected,
|
|
47
|
+
};
|
|
48
|
+
// An owner whose element left the document without unmounting (its
|
|
49
|
+
// container was removed by hand) cannot style anything: it yields.
|
|
50
|
+
const sync = (syncRef.current = () => {
|
|
51
|
+
claims.sort((a, b) => +a.detached() - +b.detached());
|
|
52
|
+
claims.forEach((each) => each.update());
|
|
53
|
+
});
|
|
54
|
+
claims.push(claim);
|
|
55
|
+
|
|
56
|
+
return () => {
|
|
57
|
+
syncRef.current = undefined;
|
|
58
|
+
claims.splice(claims.indexOf(claim), 1);
|
|
59
|
+
// The next picker takes over in this same commit: no unstyled frame.
|
|
60
|
+
if (claims.length) {
|
|
61
|
+
sync();
|
|
62
|
+
} else {
|
|
63
|
+
delete byKey[key];
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}, [css, nonce]);
|
|
67
|
+
|
|
68
|
+
React.useEffect(() => {
|
|
69
|
+
if (syncRef.current) syncRef.current();
|
|
70
|
+
}, [css, nonce]);
|
|
71
|
+
|
|
72
|
+
return owner ? (
|
|
73
|
+
<style
|
|
74
|
+
ref={styleRef}
|
|
75
|
+
nonce={nonce}
|
|
76
|
+
suppressHydrationWarning
|
|
77
|
+
dangerouslySetInnerHTML={{ __html: css }}
|
|
78
|
+
/>
|
|
79
|
+
) : null;
|
|
80
|
+
}
|
|
@@ -2,8 +2,55 @@ import * as React from 'react';
|
|
|
2
2
|
import { Styles, createSheet } from 'shipstyles';
|
|
3
3
|
|
|
4
4
|
import { ClassNames } from '../DomUtils/classNames';
|
|
5
|
+
import { isJsdom } from '../DomUtils/isJsdom';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
import { DedupedStyle } from './DedupedStyle';
|
|
8
|
+
|
|
9
|
+
// No DOM root: allocating this sheet has no observable effect when its
|
|
10
|
+
// consumers are unused. Keep component style construction in annotated,
|
|
11
|
+
// argument-free factories so bundlers can drop an unused part together
|
|
12
|
+
// with its styles/icons (including darkMode argument construction).
|
|
13
|
+
// A rendered part references its style handles and retains its factory.
|
|
14
|
+
// Default emoji-data registration is intentionally NOT marked pure.
|
|
15
|
+
export const stylesheet = /* @__PURE__ */ createSheet('epr', null);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Library CSS is unlayered by default, like v4: library classes win over
|
|
19
|
+
* ordinary element/universal resets (`* { padding: 0 }`, `input { … }`),
|
|
20
|
+
* which unlayered app CSS would otherwise apply over a layered library.
|
|
21
|
+
*
|
|
22
|
+
* Design-token declarations (`--epr-*`) are emitted at zero specificity
|
|
23
|
+
* (`:where(…)`), so any consumer selector — one class, any load order —
|
|
24
|
+
* overrides them.
|
|
25
|
+
*
|
|
26
|
+
* `cssLayer` opts into a named cascade layer for layered frameworks
|
|
27
|
+
* (Tailwind v4 utilities cannot beat unlayered CSS): declare it first,
|
|
28
|
+
* e.g. `@layer epr, theme, base, components, utilities;`.
|
|
29
|
+
*/
|
|
30
|
+
const TOKEN_RULE = /^([^{}@][^{}]*?)\s*\{((?:\s*--[\w-]+\s*:[^;{}]*;?)+)\s*\}$/;
|
|
31
|
+
const CSS_LAYER_NAME =
|
|
32
|
+
/^(?:[a-zA-Z_]|-[a-zA-Z_-])[a-zA-Z0-9_-]*(?:\.(?:[a-zA-Z_]|-[a-zA-Z_-])[a-zA-Z0-9_-]*)*$/;
|
|
33
|
+
|
|
34
|
+
export function finalizeCss(css: string, cssLayer?: string): string {
|
|
35
|
+
if (!css) {
|
|
36
|
+
return css;
|
|
37
|
+
}
|
|
38
|
+
// jsdom supports neither @layer nor :where reliably; keep plain CSS
|
|
39
|
+
// there so jsdom suites keep computed styles.
|
|
40
|
+
if (isJsdom()) {
|
|
41
|
+
return css;
|
|
42
|
+
}
|
|
43
|
+
const out = css
|
|
44
|
+
.split('\n')
|
|
45
|
+
.map((line) => {
|
|
46
|
+
const match = TOKEN_RULE.exec(line.trim());
|
|
47
|
+
return match ? `:where(${match[1]}) {${match[2]}}` : line;
|
|
48
|
+
})
|
|
49
|
+
.join('\n');
|
|
50
|
+
return cssLayer && CSS_LAYER_NAME.test(cssLayer)
|
|
51
|
+
? `@layer ${cssLayer}{${out}}`
|
|
52
|
+
: out;
|
|
53
|
+
}
|
|
7
54
|
|
|
8
55
|
const hidden = {
|
|
9
56
|
display: 'none',
|
|
@@ -13,76 +60,98 @@ const hidden = {
|
|
|
13
60
|
overflow: 'hidden',
|
|
14
61
|
};
|
|
15
62
|
|
|
16
|
-
export const commonStyles =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
63
|
+
export const commonStyles = /* @__PURE__ */ (() =>
|
|
64
|
+
stylesheet.create({
|
|
65
|
+
hidden: {
|
|
66
|
+
'.': ClassNames.hidden,
|
|
67
|
+
...hidden,
|
|
68
|
+
},
|
|
69
|
+
}))();
|
|
22
70
|
|
|
23
|
-
export const PickerStyleTag = React.memo(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
71
|
+
export const PickerStyleTag = /* @__PURE__ */ React.memo(
|
|
72
|
+
function PickerStyleTag({
|
|
73
|
+
nonce,
|
|
74
|
+
cssLayer,
|
|
75
|
+
}: {
|
|
76
|
+
nonce?: string;
|
|
77
|
+
cssLayer?: string;
|
|
78
|
+
}) {
|
|
79
|
+
return (
|
|
80
|
+
<DedupedStyle
|
|
81
|
+
nonce={nonce}
|
|
82
|
+
css={finalizeCss(stylesheet.getStyle(), cssLayer)}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
},
|
|
86
|
+
);
|
|
36
87
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
88
|
+
// Behavioral state selectors are scoped to the structural root class that
|
|
89
|
+
// every Root carries (default picker and bare primitives alike). Scoping
|
|
90
|
+
// them to the default appearance's classes (epr-main / EmojiPickerReact)
|
|
91
|
+
// left bare compositions with an always-visible clear button, no active
|
|
92
|
+
// category tab state, and search-hidden items that never hid.
|
|
93
|
+
export const commonInteractionStyles = /* @__PURE__ */ (() =>
|
|
94
|
+
stylesheet.create({
|
|
95
|
+
'.epr-structural-root': {
|
|
96
|
+
':has(input:not(:placeholder-shown))': {
|
|
97
|
+
categoryBtn: {
|
|
98
|
+
':hover': {
|
|
99
|
+
opacity: '1',
|
|
100
|
+
color: 'var(--epr-category-icon-active-color, #3371B7)',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
hiddenOnSearch: {
|
|
104
|
+
'.': ClassNames.hiddenOnSearch,
|
|
105
|
+
...hidden,
|
|
44
106
|
},
|
|
45
107
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
...hidden,
|
|
108
|
+
':has(input:placeholder-shown)': {
|
|
109
|
+
visibleOnSearchOnly: hidden,
|
|
49
110
|
},
|
|
50
111
|
},
|
|
51
|
-
':has(input:placeholder-shown)': {
|
|
52
|
-
visibleOnSearchOnly: hidden,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
hiddenOnReactions: {
|
|
56
|
-
transition: 'all 0.5s ease-in-out',
|
|
57
|
-
},
|
|
58
|
-
'.epr-reactions': {
|
|
59
112
|
hiddenOnReactions: {
|
|
60
|
-
|
|
61
|
-
width: '0px',
|
|
62
|
-
opacity: '0',
|
|
63
|
-
pointerEvents: 'none',
|
|
64
|
-
overflow: 'hidden',
|
|
113
|
+
transition: 'all 0.5s ease-in-out',
|
|
65
114
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
opacity: '
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'&.epr-active': {
|
|
74
|
-
opacity: '1',
|
|
75
|
-
color: 'var(--epr-category-icon-active-color, #3371B7)',
|
|
115
|
+
'.epr-reactions': {
|
|
116
|
+
hiddenOnReactions: {
|
|
117
|
+
height: '0px',
|
|
118
|
+
width: '0px',
|
|
119
|
+
opacity: '0',
|
|
120
|
+
pointerEvents: 'none',
|
|
121
|
+
overflow: 'hidden',
|
|
76
122
|
},
|
|
77
123
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
124
|
+
'.epr-structural-root:not(.epr-search-active)': {
|
|
125
|
+
categoryBtn: {
|
|
126
|
+
':hover': {
|
|
127
|
+
opacity: '1',
|
|
128
|
+
color: 'var(--epr-category-icon-active-color, #3371B7)',
|
|
129
|
+
},
|
|
130
|
+
'&.epr-active': {
|
|
131
|
+
opacity: '1',
|
|
132
|
+
color: 'var(--epr-category-icon-active-color, #3371B7)',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
visibleOnSearchOnly: {
|
|
136
|
+
'.': 'epr-visible-on-search-only',
|
|
137
|
+
...hidden,
|
|
138
|
+
},
|
|
81
139
|
},
|
|
82
|
-
}
|
|
83
|
-
});
|
|
140
|
+
}))();
|
|
84
141
|
|
|
85
|
-
|
|
142
|
+
// Explicit return type: the inferred shape references shipstyles'
|
|
143
|
+
// private PostConditionStyles, which declaration emit cannot name
|
|
144
|
+
// (TS4058). Spelling it with the exported Styles type keeps entry
|
|
145
|
+
// declaration emit clean.
|
|
146
|
+
export function darkMode(
|
|
147
|
+
key: string,
|
|
148
|
+
value: Styles,
|
|
149
|
+
): {
|
|
150
|
+
'.epr-dark-theme': { [styleKey: string]: Styles };
|
|
151
|
+
'.epr-auto-theme': {
|
|
152
|
+
[styleKey: string]: { '@media (prefers-color-scheme: dark)': Styles };
|
|
153
|
+
};
|
|
154
|
+
} {
|
|
86
155
|
return {
|
|
87
156
|
'.epr-dark-theme': {
|
|
88
157
|
[key]: value,
|
|
@@ -31,14 +31,15 @@ export default function Flex({
|
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const styles =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
34
|
+
const styles = /* @__PURE__ */ (() =>
|
|
35
|
+
stylesheet.create({
|
|
36
|
+
flex: {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
},
|
|
39
|
+
[FlexDirection.ROW]: {
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
},
|
|
42
|
+
[FlexDirection.COLUMN]: {
|
|
43
|
+
flexDirection: 'column',
|
|
44
|
+
},
|
|
45
|
+
}))();
|
|
@@ -2,65 +2,75 @@ import * as React from 'react';
|
|
|
2
2
|
import { cx } from 'shipstyles';
|
|
3
3
|
|
|
4
4
|
import { darkMode, stylesheet } from '../../Stylesheet/stylesheet';
|
|
5
|
+
import { useLabels } from '../../config/useConfig';
|
|
6
|
+
import { useDefaultAppearance } from '../../primitives/appearance';
|
|
7
|
+
import { usePickerComponents } from '../../primitives/components';
|
|
5
8
|
import { Button } from '../atoms/Button';
|
|
6
9
|
import { useReactionsModeState } from '../context/PickerContext';
|
|
7
|
-
|
|
8
|
-
import Plus from './svg/plus.svg';
|
|
10
|
+
import { PLUS_ICON as Plus } from '../icons/svgIcons';
|
|
9
11
|
|
|
10
12
|
export function BtnPlus() {
|
|
11
13
|
const [, setReactionsMode] = useReactionsModeState();
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
const labels = useLabels();
|
|
15
|
+
const appearance = useDefaultAppearance();
|
|
16
|
+
const { ExpandButton: Custom } = usePickerComponents();
|
|
17
|
+
const props = {
|
|
18
|
+
type: 'button' as const,
|
|
19
|
+
'aria-label': labels.expandReactions,
|
|
20
|
+
title: labels.expandReactions,
|
|
21
|
+
tabIndex: 0,
|
|
22
|
+
className: cx(appearance && !Custom && styles.plusSign),
|
|
23
|
+
'data-epr-part': 'expand-reactions',
|
|
24
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
25
|
+
if (!event.defaultPrevented) setReactionsMode(false);
|
|
26
|
+
},
|
|
27
|
+
children: appearance && !Custom ? undefined : '+',
|
|
28
|
+
};
|
|
29
|
+
return Custom ? <Custom {...props} /> : <Button {...props} />;
|
|
21
30
|
}
|
|
22
31
|
|
|
23
|
-
const styles =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
content: '',
|
|
39
|
-
minWidth: '20px',
|
|
40
|
-
minHeight: '20px',
|
|
41
|
-
backgroundImage: `url(${Plus})`,
|
|
42
|
-
backgroundColor: 'transparent',
|
|
43
|
-
backgroundRepeat: 'no-repeat',
|
|
44
|
-
backgroundSize: '20px',
|
|
45
|
-
backgroundPositionY: '0',
|
|
46
|
-
},
|
|
47
|
-
':hover': {
|
|
48
|
-
color: 'var(--epr-highlight-color)',
|
|
49
|
-
backgroundColor: 'var(--epr-hover-bg-color-reduced-opacity)',
|
|
32
|
+
const styles = /* @__PURE__ */ (() =>
|
|
33
|
+
stylesheet.create({
|
|
34
|
+
plusSign: {
|
|
35
|
+
fontSize: '20px',
|
|
36
|
+
padding: '17px',
|
|
37
|
+
color: 'var(--epr-text-color)',
|
|
38
|
+
borderRadius: '50%',
|
|
39
|
+
textAlign: 'center',
|
|
40
|
+
lineHeight: '100%',
|
|
41
|
+
width: '20px',
|
|
42
|
+
height: '20px',
|
|
43
|
+
display: 'flex',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
transition: 'background-color 0.2s ease-in-out',
|
|
50
47
|
':after': {
|
|
51
|
-
|
|
48
|
+
content: '',
|
|
49
|
+
minWidth: '20px',
|
|
50
|
+
minHeight: '20px',
|
|
51
|
+
backgroundImage: `url("${Plus}")`,
|
|
52
|
+
backgroundColor: 'transparent',
|
|
53
|
+
backgroundRepeat: 'no-repeat',
|
|
54
|
+
backgroundSize: '20px',
|
|
55
|
+
backgroundPositionY: '0',
|
|
52
56
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
':hover': {
|
|
58
|
+
color: 'var(--epr-highlight-color)',
|
|
59
|
+
backgroundColor: 'var(--epr-hover-bg-color-reduced-opacity)',
|
|
60
|
+
':after': {
|
|
61
|
+
backgroundPositionY: '-20px',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
':focus': {
|
|
65
|
+
color: 'var(--epr-highlight-color)',
|
|
66
|
+
backgroundColor: 'var(--epr-hover-bg-color-reduced-opacity)',
|
|
67
|
+
':after': {
|
|
68
|
+
backgroundPositionY: '-40px',
|
|
69
|
+
},
|
|
59
70
|
},
|
|
60
71
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
})
|
|
66
|
-
});
|
|
72
|
+
...darkMode('plusSign', {
|
|
73
|
+
':after': { backgroundPositionY: '-40px' },
|
|
74
|
+
':hover:after': { backgroundPositionY: '-60px' },
|
|
75
|
+
}),
|
|
76
|
+
}))();
|