emoji-picker-react 4.22.3 → 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 +331 -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 -480
- package/package.json +180 -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
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type EmojiClickData = {
|
|
4
|
+
activeSkinTone: SkinTones;
|
|
5
|
+
unified: string;
|
|
6
|
+
unifiedWithoutSkinTone: string;
|
|
7
|
+
emoji: string;
|
|
8
|
+
names: string[];
|
|
9
|
+
imageUrl: string;
|
|
10
|
+
getImageUrl: (emojiStyle?: EmojiStyleValue) => string;
|
|
11
|
+
isCustom: boolean;
|
|
12
|
+
};
|
|
13
|
+
type CategoryConfig = {
|
|
14
|
+
category: Categories;
|
|
15
|
+
name: string;
|
|
16
|
+
icon?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Selects a `CustomEmoji` group for `Categories.CUSTOM` entries. Each
|
|
19
|
+
* grouped entry renders its own section and nav tab; ungrouped entries
|
|
20
|
+
* share the classic customs bucket.
|
|
21
|
+
*/
|
|
22
|
+
group?: string;
|
|
23
|
+
};
|
|
24
|
+
type CategoryIcons = Partial<Record<Categories, React.ReactNode>>;
|
|
25
|
+
type EmojiData = {
|
|
26
|
+
categories: Partial<Record<Categories, CategoryConfig>>;
|
|
27
|
+
emojis: Record<string, DataEmoji[]>;
|
|
28
|
+
};
|
|
29
|
+
interface DataEmoji {
|
|
30
|
+
n: string[];
|
|
31
|
+
u: string;
|
|
32
|
+
v?: string[];
|
|
33
|
+
a: string;
|
|
34
|
+
}
|
|
35
|
+
declare enum SuggestionMode {
|
|
36
|
+
RECENT = "recent",
|
|
37
|
+
FREQUENT = "frequent"
|
|
38
|
+
}
|
|
39
|
+
type SuggestionModeValue = SuggestionMode | 'recent' | 'frequent';
|
|
40
|
+
declare enum EmojiStyle {
|
|
41
|
+
NATIVE = "native",
|
|
42
|
+
APPLE = "apple",
|
|
43
|
+
TWITTER = "twitter",
|
|
44
|
+
GOOGLE = "google",
|
|
45
|
+
FACEBOOK = "facebook"
|
|
46
|
+
}
|
|
47
|
+
type EmojiStyleValue = EmojiStyle | 'native' | 'apple' | 'twitter' | 'google' | 'facebook';
|
|
48
|
+
declare enum Theme {
|
|
49
|
+
DARK = "dark",
|
|
50
|
+
LIGHT = "light",
|
|
51
|
+
AUTO = "auto"
|
|
52
|
+
}
|
|
53
|
+
type ThemeValue = Theme | 'dark' | 'light' | 'auto';
|
|
54
|
+
declare enum SkinTones {
|
|
55
|
+
NEUTRAL = "neutral",
|
|
56
|
+
LIGHT = "1f3fb",
|
|
57
|
+
MEDIUM_LIGHT = "1f3fc",
|
|
58
|
+
MEDIUM = "1f3fd",
|
|
59
|
+
MEDIUM_DARK = "1f3fe",
|
|
60
|
+
DARK = "1f3ff"
|
|
61
|
+
}
|
|
62
|
+
/** A skin tone as the enum or its literal value (`'neutral'`, `'1f3fb'`, …). */
|
|
63
|
+
type SkinTonesValue = SkinTones | 'neutral' | '1f3fb' | '1f3fc' | '1f3fd' | '1f3fe' | '1f3ff';
|
|
64
|
+
declare enum Categories {
|
|
65
|
+
SUGGESTED = "suggested",
|
|
66
|
+
CUSTOM = "custom",
|
|
67
|
+
SMILEYS_PEOPLE = "smileys_people",
|
|
68
|
+
ANIMALS_NATURE = "animals_nature",
|
|
69
|
+
FOOD_DRINK = "food_drink",
|
|
70
|
+
TRAVEL_PLACES = "travel_places",
|
|
71
|
+
ACTIVITIES = "activities",
|
|
72
|
+
OBJECTS = "objects",
|
|
73
|
+
SYMBOLS = "symbols",
|
|
74
|
+
FLAGS = "flags"
|
|
75
|
+
}
|
|
76
|
+
declare enum SkinTonePickerLocation {
|
|
77
|
+
SEARCH = "SEARCH",
|
|
78
|
+
PREVIEW = "PREVIEW",
|
|
79
|
+
/**
|
|
80
|
+
* No built-in placement: render the `SkinTone` primitive wherever you
|
|
81
|
+
* want it, or drive the tone through `skinTone` / `useSkinTone()`.
|
|
82
|
+
*/
|
|
83
|
+
NONE = "NONE"
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare enum EmojiProperties {
|
|
87
|
+
name = "n",
|
|
88
|
+
unified = "u",
|
|
89
|
+
variations = "v",
|
|
90
|
+
added_in = "a",
|
|
91
|
+
imgUrl = "imgUrl"
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The emoji a custom `Emoji` cell renders. */
|
|
95
|
+
type ListEmoji = {
|
|
96
|
+
/** True while hovered or keyboard-focused. */
|
|
97
|
+
isActive: boolean;
|
|
98
|
+
/** Unified code including the active skin tone, e.g. `1f44d-1f3fd`. */
|
|
99
|
+
unified: string;
|
|
100
|
+
names: string[];
|
|
101
|
+
/** Native emoji text (custom emojis: their id). */
|
|
102
|
+
emoji: string;
|
|
103
|
+
isCustom: boolean;
|
|
104
|
+
/** Active image style URL, or undefined for standard native emojis. */
|
|
105
|
+
imageUrl?: string;
|
|
106
|
+
/** Whether a long press opens skin tone variations. */
|
|
107
|
+
hasVariations: boolean;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Props for a custom emoji cell. Spread everything except `emoji` onto a
|
|
111
|
+
* `<button>`: the library-owned attributes (type, class, position style,
|
|
112
|
+
* tabIndex, aria-label, data-epr-*) carry selection, keyboard navigation,
|
|
113
|
+
* virtualization and accessibility. `children` is the default glyph/image;
|
|
114
|
+
* render it or your own content.
|
|
115
|
+
*/
|
|
116
|
+
type EmojiRenderProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
117
|
+
emoji: ListEmoji;
|
|
118
|
+
children: React.ReactNode;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Props for a custom category header. Spread everything except `category`
|
|
122
|
+
* onto the header element; it stays sticky and measured.
|
|
123
|
+
*/
|
|
124
|
+
type CategoryHeaderRenderProps = React.HTMLAttributes<HTMLElement> & {
|
|
125
|
+
category: {
|
|
126
|
+
id: string;
|
|
127
|
+
name: string;
|
|
128
|
+
};
|
|
129
|
+
children: React.ReactNode;
|
|
130
|
+
};
|
|
131
|
+
type ListComponents = {
|
|
132
|
+
Emoji?: React.ComponentType<EmojiRenderProps>;
|
|
133
|
+
CategoryHeader?: React.ComponentType<CategoryHeaderRenderProps>;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/** Spread the managed props onto one native button. Render children or your own content. */
|
|
137
|
+
type CategoryButtonRenderProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
138
|
+
category: {
|
|
139
|
+
id: string;
|
|
140
|
+
name: string;
|
|
141
|
+
isActive: boolean;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
type SkinToneButtonRenderProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
145
|
+
tone: {
|
|
146
|
+
skinTone: SkinTones;
|
|
147
|
+
isActive: boolean;
|
|
148
|
+
isOpen: boolean;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
type PickerComponents = ListComponents & {
|
|
152
|
+
CategoryButton?: React.ComponentType<CategoryButtonRenderProps>;
|
|
153
|
+
SkinToneButton?: React.ComponentType<SkinToneButtonRenderProps>;
|
|
154
|
+
ExpandButton?: React.ComponentType<React.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
155
|
+
ClearButton?: React.ComponentType<React.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
type CustomEmoji = {
|
|
159
|
+
names: string[];
|
|
160
|
+
[EmojiProperties.imgUrl]: string;
|
|
161
|
+
id: string;
|
|
162
|
+
/**
|
|
163
|
+
* Optional group name. Customs sharing a group render as their own
|
|
164
|
+
* category section; ungrouped customs keep the single shared bucket.
|
|
165
|
+
* Reference the group from a `{ category: Categories.CUSTOM, group }`
|
|
166
|
+
* entry in the `categories` prop to place and name the section.
|
|
167
|
+
* https://github.com/ealush/emoji-picker-react/issues/510
|
|
168
|
+
*/
|
|
169
|
+
group?: string;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
type GetEmojiUrl = (unified: string, style: EmojiStyleValue) => string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Asynchronous dataset source, e.g.
|
|
176
|
+
* `() => import('emoji-picker-react/data/emojis-fr')`.
|
|
177
|
+
* Hoist it (module scope or useCallback): a new function identity loads
|
|
178
|
+
* again.
|
|
179
|
+
*/
|
|
180
|
+
type EmojiDataLoaderOptions = {
|
|
181
|
+
signal?: AbortSignal;
|
|
182
|
+
};
|
|
183
|
+
type EmojiDataLoader = (options: EmojiDataLoaderOptions) => Promise<EmojiData | {
|
|
184
|
+
default: EmojiData;
|
|
185
|
+
}>;
|
|
186
|
+
type EmojiDataInput = EmojiData | EmojiDataLoader;
|
|
187
|
+
type EmojiDataState = {
|
|
188
|
+
loading: boolean;
|
|
189
|
+
error: Error | null;
|
|
190
|
+
retry: () => void;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
type CategoriesConfig = CategoryConfig[];
|
|
194
|
+
type UserCategoryConfig = Array<Categories | CategoryConfig>;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Every user-facing string the picker renders or announces. All keys are
|
|
198
|
+
* optional on the `labels` prop; anything omitted keeps its English
|
|
199
|
+
* default. Category names come from `categories` / localized `emojiData`,
|
|
200
|
+
* and the preview caption from `previewConfig.defaultCaption`.
|
|
201
|
+
*/
|
|
202
|
+
type PickerLabels = {
|
|
203
|
+
searchPlaceholder: string;
|
|
204
|
+
/** Accessible name of the search input. */
|
|
205
|
+
searchLabel: string;
|
|
206
|
+
searchClear: string;
|
|
207
|
+
/** Live-region announcement and visible empty state. */
|
|
208
|
+
searchResultsNone: string;
|
|
209
|
+
searchResultsOne: string;
|
|
210
|
+
/** `%n` is replaced with the result count. */
|
|
211
|
+
searchResultsMany: string;
|
|
212
|
+
categoryNavigation: string;
|
|
213
|
+
reactions: string;
|
|
214
|
+
expandReactions: string;
|
|
215
|
+
/** Shown by the Loading part while the dataset loads. */
|
|
216
|
+
loading: string;
|
|
217
|
+
loadingError: string;
|
|
218
|
+
retryLoading: string;
|
|
219
|
+
skinToneNeutral: string;
|
|
220
|
+
skinToneLight: string;
|
|
221
|
+
skinToneMediumLight: string;
|
|
222
|
+
skinToneMedium: string;
|
|
223
|
+
skinToneMediumDark: string;
|
|
224
|
+
skinToneDark: string;
|
|
225
|
+
};
|
|
226
|
+
type PickerConfigInternal = {
|
|
227
|
+
emojiVersion: string | null;
|
|
228
|
+
searchPlaceHolder: string;
|
|
229
|
+
searchPlaceholder: string;
|
|
230
|
+
searchClearButtonLabel: string;
|
|
231
|
+
defaultSkinTone: SkinTonesValue;
|
|
232
|
+
skinTonesDisabled: boolean;
|
|
233
|
+
autoFocusSearch: boolean;
|
|
234
|
+
emojiStyle: EmojiStyleValue;
|
|
235
|
+
categories: CategoriesConfig;
|
|
236
|
+
theme: ThemeValue;
|
|
237
|
+
suggestedEmojisMode: SuggestionModeValue;
|
|
238
|
+
lazyLoadEmojis: boolean;
|
|
239
|
+
previewConfig: PreviewConfig;
|
|
240
|
+
className: string;
|
|
241
|
+
height: PickerDimensions;
|
|
242
|
+
width: PickerDimensions;
|
|
243
|
+
style: React.CSSProperties;
|
|
244
|
+
getEmojiUrl: GetEmojiUrl;
|
|
245
|
+
searchDisabled: boolean;
|
|
246
|
+
skinTonePickerLocation: SkinTonePickerLocation;
|
|
247
|
+
unicodeToHide: Set<string>;
|
|
248
|
+
customEmojis: CustomEmoji[];
|
|
249
|
+
reactionsDefaultOpen: boolean;
|
|
250
|
+
reactions: string[];
|
|
251
|
+
open: boolean;
|
|
252
|
+
allowExpandReactions: boolean;
|
|
253
|
+
hiddenEmojis: string[];
|
|
254
|
+
emojiData?: EmojiData;
|
|
255
|
+
categoryIcons: CategoryIcons;
|
|
256
|
+
nonce?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Controlled search value (raw user text). When present, it is the
|
|
259
|
+
* accepted visible source of truth; user edits emit `onSearchChange`
|
|
260
|
+
* proposals instead of committing locally.
|
|
261
|
+
*/
|
|
262
|
+
searchValue?: string;
|
|
263
|
+
/** Uncontrolled initial search value, read once per mounted lifetime. */
|
|
264
|
+
defaultSearchValue?: string;
|
|
265
|
+
/** Emitted synchronously with each committed (uncontrolled) or proposed (controlled) user edit. */
|
|
266
|
+
onSearchChange?: (value: string) => void;
|
|
267
|
+
/** Accessible label for the search input. Defaults to English. */
|
|
268
|
+
searchLabel?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Caller-defined Suggested category contents/order (unified or custom
|
|
271
|
+
* IDs). While present, `suggestedEmojisMode` is ignored for contents.
|
|
272
|
+
*/
|
|
273
|
+
suggestedEmojis?: string[];
|
|
274
|
+
/** Observes compact-reactions vs full-picker transitions. */
|
|
275
|
+
onReactionsModeChange?: (reactionsOpen: boolean) => void;
|
|
276
|
+
/**
|
|
277
|
+
* Localized user-facing strings. Takes precedence over the individual
|
|
278
|
+
* `searchPlaceholder` / `searchLabel` / `searchClearButtonLabel` props.
|
|
279
|
+
*/
|
|
280
|
+
labels?: Partial<PickerLabels>;
|
|
281
|
+
/**
|
|
282
|
+
* Controlled active skin tone. Pair with `onSkinToneChange`; while
|
|
283
|
+
* present, `defaultSkinTone` is ignored.
|
|
284
|
+
*/
|
|
285
|
+
skinTone?: SkinTonesValue;
|
|
286
|
+
/**
|
|
287
|
+
* Emit the picker's CSS inside this cascade layer (e.g. "epr"), for
|
|
288
|
+
* layered CSS frameworks such as Tailwind v4 whose utilities cannot
|
|
289
|
+
* beat unlayered CSS. Declare the layer first in your CSS:
|
|
290
|
+
* `@layer epr, theme, base, components, utilities;`. Default: unlayered.
|
|
291
|
+
*/
|
|
292
|
+
cssLayer?: string;
|
|
293
|
+
/**
|
|
294
|
+
* Emojis per row. The picker then sizes its width to fit those columns
|
|
295
|
+
* unless you set a width; a narrower container shows fewer columns.
|
|
296
|
+
* Default: as many as the width fits.
|
|
297
|
+
*/
|
|
298
|
+
columns?: number;
|
|
299
|
+
};
|
|
300
|
+
type PreviewConfig = {
|
|
301
|
+
defaultEmoji: string;
|
|
302
|
+
defaultCaption: string;
|
|
303
|
+
showPreview: boolean;
|
|
304
|
+
};
|
|
305
|
+
type ConfigExternal = {
|
|
306
|
+
previewConfig: Partial<PreviewConfig>;
|
|
307
|
+
onEmojiClick: MouseDownEvent;
|
|
308
|
+
onReactionClick: MouseDownEvent;
|
|
309
|
+
onSkinToneChange: OnSkinToneChange;
|
|
310
|
+
/**
|
|
311
|
+
* User-supplied allowlist/order/merge input. Bare `Categories` members
|
|
312
|
+
* are accepted alongside full configs (as in v4 usage and this repo's
|
|
313
|
+
* own tests); the merged internal representation stays `CategoriesConfig`.
|
|
314
|
+
*/
|
|
315
|
+
categories: UserCategoryConfig;
|
|
316
|
+
/**
|
|
317
|
+
* Dataset: an object (synchronous, SSR-safe), or a loader such as
|
|
318
|
+
* `() => import('emoji-picker-react/data/emojis-fr')` to code-split it.
|
|
319
|
+
* Omitted: the bundled English dataset.
|
|
320
|
+
*/
|
|
321
|
+
emojiData: EmojiDataInput;
|
|
322
|
+
} & Omit<PickerConfigInternal, 'previewConfig' | 'unicodeToHide' | 'categories' | 'emojiData'>;
|
|
323
|
+
type PickerConfig = Partial<ConfigExternal>;
|
|
324
|
+
type PickerDimensions = string | number;
|
|
325
|
+
type MouseDownEvent = (emoji: EmojiClickData, event: MouseEvent, api?: OnEmojiClickApi) => void;
|
|
326
|
+
type OnSkinToneChange = (skinTone: SkinTones) => void;
|
|
327
|
+
/** The `onEmojiClick` / `onReactionClick` callback signature. */
|
|
328
|
+
type EmojiClickHandler = MouseDownEvent;
|
|
329
|
+
/** The `onSkinToneChange` callback signature. */
|
|
330
|
+
type SkinToneChangeHandler = OnSkinToneChange;
|
|
331
|
+
/** Third argument of `onEmojiClick` / `onReactionClick`. */
|
|
332
|
+
type OnEmojiClickApi = {
|
|
333
|
+
/** Return to the compact reactions bar (no-op when reactions are off). */
|
|
334
|
+
collapseToReactions: () => void;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Appearance props owned by the default <EmojiPicker /> wrapper, plus the
|
|
339
|
+
* two that Root already accepts as native `aside` attributes. This list is
|
|
340
|
+
* short and stable; the behavior set is long and grows.
|
|
341
|
+
*/
|
|
342
|
+
type PickerAppearanceProps = 'theme' | 'colorScheme' | 'width' | 'height' | 'className' | 'style' | 'unstyled';
|
|
343
|
+
/** Presence and placement belong to the caller's JSX, not Root switches. */
|
|
344
|
+
type PickerCompositionProps = 'open' | 'searchDisabled' | 'skinTonesDisabled' | 'skinTonePickerLocation';
|
|
345
|
+
type RootBehaviorProps = Omit<PickerConfig, PickerAppearanceProps | PickerCompositionProps | 'previewConfig'> & {
|
|
346
|
+
previewConfig?: Omit<NonNullable<PickerConfig['previewConfig']>, 'showPreview'>;
|
|
347
|
+
};
|
|
348
|
+
type RootProps = Omit<React.HTMLAttributes<HTMLElement>, keyof RootBehaviorProps | 'children' | 'role' | 'dangerouslySetInnerHTML'> & RootBehaviorProps & {
|
|
349
|
+
children: React.ReactNode;
|
|
350
|
+
/** Built-in leaf appearance. Bare compositions default to 'none'. */
|
|
351
|
+
appearance?: 'none' | 'default';
|
|
352
|
+
/** Shared replacements for grid, variation, reaction and navigation controls. */
|
|
353
|
+
components?: PickerComponents;
|
|
354
|
+
/**
|
|
355
|
+
* Opt-in color scheme: applies the default light/dark color tokens as
|
|
356
|
+
* CSS variables on Root (no border, background or typography).
|
|
357
|
+
* Omit it to style a fully unbranded picker yourself. (Not `theme`:
|
|
358
|
+
* CSS-in-JS libraries reserve that prop on components they wrap.)
|
|
359
|
+
*/
|
|
360
|
+
colorScheme?: ThemeValue;
|
|
361
|
+
};
|
|
362
|
+
/**
|
|
363
|
+
* Children are trailing controls, e.g. <SkinTone />; nothing is inserted
|
|
364
|
+
* automatically.
|
|
365
|
+
*/
|
|
366
|
+
type SearchProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'role' | 'dangerouslySetInnerHTML'> & {
|
|
367
|
+
/** Native attributes for the managed input; Root owns its value. */
|
|
368
|
+
inputProps?: Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue' | 'onChange' | 'autoFocus' | 'placeholder' | 'aria-controls' | 'role' | 'children' | 'dangerouslySetInnerHTML'>;
|
|
369
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
370
|
+
};
|
|
371
|
+
type SearchInputElement = 'input' | React.ComponentType<any>;
|
|
372
|
+
type ManagedInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue' | 'role' | 'aria-controls' | 'children' | 'dangerouslySetInnerHTML'>;
|
|
373
|
+
type ReservedInputProps = 'type' | 'value' | 'defaultValue' | 'role' | 'aria-controls' | 'children' | 'dangerouslySetInnerHTML' | 'as';
|
|
374
|
+
type InputBehaviorHandlers = 'onChange' | 'onFocus' | 'onCompositionStart' | 'onCompositionEnd';
|
|
375
|
+
/** Native input props plus the selected design-system input's own props. */
|
|
376
|
+
type SearchInputProps<T extends SearchInputElement = 'input'> = Omit<ManagedInputProps, keyof React.ComponentPropsWithoutRef<T>> & Pick<ManagedInputProps, InputBehaviorHandlers> & Omit<React.ComponentPropsWithoutRef<T>, ReservedInputProps | InputBehaviorHandlers> & {
|
|
377
|
+
/** Must forward its ref and supplied props to an actual input element. */
|
|
378
|
+
as?: T;
|
|
379
|
+
};
|
|
380
|
+
type SearchInputComponent = <T extends SearchInputElement = 'input'>(props: SearchInputProps<T> & React.RefAttributes<HTMLInputElement>) => React.ReactElement | null;
|
|
381
|
+
type CategoryNavProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
|
|
382
|
+
/**
|
|
383
|
+
* Tab axis. `vertical` stacks the tabs (e.g. a side rail) and switches
|
|
384
|
+
* keyboard navigation to Up/Down between tabs and Left/Right to leave,
|
|
385
|
+
* announced through aria-orientation. Default: 'horizontal'.
|
|
386
|
+
*/
|
|
387
|
+
orientation?: 'horizontal' | 'vertical';
|
|
388
|
+
};
|
|
389
|
+
type PreviewProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'role' | 'dangerouslySetInnerHTML'>;
|
|
390
|
+
type ListProps = Omit<React.HTMLAttributes<HTMLUListElement>, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
|
|
391
|
+
/**
|
|
392
|
+
* Custom markup for emoji cells and category headers. Each receives the
|
|
393
|
+
* library-owned props to spread onto its element (see EmojiRenderProps /
|
|
394
|
+
* CategoryHeaderRenderProps).
|
|
395
|
+
*/
|
|
396
|
+
components?: ListComponents;
|
|
397
|
+
};
|
|
398
|
+
type EmptyProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
|
|
399
|
+
children?: React.ReactNode | ((state: {
|
|
400
|
+
search: string;
|
|
401
|
+
}) => React.ReactNode);
|
|
402
|
+
};
|
|
403
|
+
type SkinToneProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
|
|
404
|
+
/** Axis the tones fan out along. Default: 'horizontal'. */
|
|
405
|
+
orientation?: 'horizontal' | 'vertical';
|
|
406
|
+
};
|
|
407
|
+
type LoadingProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
|
|
408
|
+
children?: React.ReactNode;
|
|
409
|
+
};
|
|
410
|
+
type LoadErrorProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
|
|
411
|
+
children?: React.ReactNode | ((state: {
|
|
412
|
+
error: Error;
|
|
413
|
+
retry: () => void;
|
|
414
|
+
}) => React.ReactNode);
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
declare const Root: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "children" | "categories" | "nonce" | "dangerouslySetInnerHTML" | "columns" | "cssLayer" | "skinTone" | "previewConfig" | "emojiData" | "emojiVersion" | "searchPlaceHolder" | "searchPlaceholder" | "searchClearButtonLabel" | "defaultSkinTone" | "autoFocusSearch" | "emojiStyle" | "suggestedEmojisMode" | "lazyLoadEmojis" | "getEmojiUrl" | "customEmojis" | "reactionsDefaultOpen" | "reactions" | "allowExpandReactions" | "hiddenEmojis" | "categoryIcons" | "searchValue" | "defaultSearchValue" | "onSearchChange" | "searchLabel" | "suggestedEmojis" | "onReactionsModeChange" | "labels" | "onEmojiClick" | "onReactionClick" | "onSkinToneChange" | "role"> & Omit<Partial<{
|
|
418
|
+
previewConfig: Partial<PreviewConfig>;
|
|
419
|
+
onEmojiClick: MouseDownEvent;
|
|
420
|
+
onReactionClick: MouseDownEvent;
|
|
421
|
+
onSkinToneChange: OnSkinToneChange;
|
|
422
|
+
categories: UserCategoryConfig;
|
|
423
|
+
emojiData: EmojiDataInput;
|
|
424
|
+
} & Omit<PickerConfigInternal, "categories" | "previewConfig" | "unicodeToHide" | "emojiData">>, "previewConfig" | PickerAppearanceProps | PickerCompositionProps> & {
|
|
425
|
+
previewConfig?: Omit<NonNullable<PickerConfig["previewConfig"]>, "showPreview">;
|
|
426
|
+
} & {
|
|
427
|
+
children: React.ReactNode;
|
|
428
|
+
appearance?: "none" | "default";
|
|
429
|
+
components?: PickerComponents;
|
|
430
|
+
colorScheme?: ThemeValue;
|
|
431
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
432
|
+
|
|
433
|
+
type PanelProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'role' | 'hidden' | 'inert' | 'dangerouslySetInnerHTML'>;
|
|
434
|
+
declare const Panel: React.NamedExoticComponent<PanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
435
|
+
|
|
436
|
+
type ReactionsProps = Omit<React.HTMLAttributes<HTMLUListElement>, 'role' | 'children' | 'dangerouslySetInnerHTML'>;
|
|
437
|
+
declare const Reactions: React.NamedExoticComponent<ReactionsProps & React.RefAttributes<HTMLUListElement>>;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Geometry tokens: sizes, spacing and stacking that measurement,
|
|
441
|
+
* virtualization and layout depend on. Every Root applies these
|
|
442
|
+
* (structural stylesheet), so a bare composition is functional without
|
|
443
|
+
* any appearance tokens. Consumers may override them; measurement reads
|
|
444
|
+
* the resulting DOM.
|
|
445
|
+
*/
|
|
446
|
+
declare const structuralPickerTokens: Record<string, string>;
|
|
447
|
+
/** Light color tokens (the v4 default palette). */
|
|
448
|
+
declare const lightPickerTokens: Record<string, string>;
|
|
449
|
+
/**
|
|
450
|
+
* Dark color overrides layered on top of the light tokens. Direct values:
|
|
451
|
+
* the default picker keeps its private `--epr-dark-*` indirection for v4
|
|
452
|
+
* compatibility, primitives do not need it.
|
|
453
|
+
*/
|
|
454
|
+
declare const darkPickerTokens: Record<string, string>;
|
|
455
|
+
/** Full light preset: geometry plus light colors (v4 defaults). */
|
|
456
|
+
declare const defaultPickerTokens: Record<string, string>;
|
|
457
|
+
|
|
458
|
+
declare const Empty: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "dangerouslySetInnerHTML" | "role"> & {
|
|
459
|
+
children?: React.ReactNode | ((state: {
|
|
460
|
+
search: string;
|
|
461
|
+
}) => React.ReactNode);
|
|
462
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
463
|
+
|
|
464
|
+
declare const Loading: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "dangerouslySetInnerHTML" | "role"> & {
|
|
465
|
+
children?: React.ReactNode;
|
|
466
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
467
|
+
|
|
468
|
+
/** Recoverable dataset failure; custom children receive error and retry. */
|
|
469
|
+
declare const LoadError: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "dangerouslySetInnerHTML" | "role"> & {
|
|
470
|
+
children?: React.ReactNode | ((state: {
|
|
471
|
+
error: Error;
|
|
472
|
+
retry: () => void;
|
|
473
|
+
}) => React.ReactNode);
|
|
474
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* The emoji currently hovered or keyboard-focused in the grid, in the same
|
|
478
|
+
* shape `onEmojiClick` receives, or null. Use it to build a custom preview.
|
|
479
|
+
*/
|
|
480
|
+
declare function useActiveEmoji(): EmojiClickData | null;
|
|
481
|
+
/**
|
|
482
|
+
* The active skin tone and a setter that behaves exactly like choosing a
|
|
483
|
+
* tone in the built-in control: it updates the grid and calls
|
|
484
|
+
* `onSkinToneChange` (when `skinTone` is controlled, only the callback
|
|
485
|
+
* fires and the parent decides).
|
|
486
|
+
*/
|
|
487
|
+
declare function useSkinTone(): [SkinTones, (skinTone: SkinTones) => void];
|
|
488
|
+
type SearchState = {
|
|
489
|
+
/** Accepted raw search text (controlled value or last committed edit). */
|
|
490
|
+
search: string;
|
|
491
|
+
/**
|
|
492
|
+
* Emojis the list shows for the applied search, or null while no search
|
|
493
|
+
* is applied. Debounced like the list itself.
|
|
494
|
+
*/
|
|
495
|
+
resultCount: number | null;
|
|
496
|
+
};
|
|
497
|
+
/** Read-only search state, e.g. for a custom status line or empty state. */
|
|
498
|
+
declare function useSearchState(): SearchState;
|
|
499
|
+
/** Dataset loading, recoverable failure and retry for this Root. */
|
|
500
|
+
declare function useEmojiDataState(): EmojiDataState;
|
|
501
|
+
/** Propose/commit raw text. Clear also restores focus to a mounted SearchInput. */
|
|
502
|
+
declare function useSearchActions(): {
|
|
503
|
+
setValue: (value: string) => void;
|
|
504
|
+
clear: () => void;
|
|
505
|
+
};
|
|
506
|
+
/** Public section identities and the same deferred jump used by CategoryNav. */
|
|
507
|
+
declare function useCategoryNavigation(): {
|
|
508
|
+
categories: {
|
|
509
|
+
id: string;
|
|
510
|
+
name: string;
|
|
511
|
+
}[];
|
|
512
|
+
activeCategory: string | null;
|
|
513
|
+
jumpToCategory: (categoryId: string) => void;
|
|
514
|
+
};
|
|
515
|
+
/** Expansion respects allowExpandReactions; collapse activates the reactions bar. */
|
|
516
|
+
declare function usePickerMode(): {
|
|
517
|
+
reactionsOpen: boolean;
|
|
518
|
+
canExpand: boolean;
|
|
519
|
+
expand: () => void;
|
|
520
|
+
collapse: () => void;
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
declare const SkinTone: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "dangerouslySetInnerHTML" | "role"> & {
|
|
524
|
+
orientation?: "horizontal" | "vertical";
|
|
525
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
526
|
+
|
|
527
|
+
declare const Search: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "dangerouslySetInnerHTML" | "role"> & {
|
|
528
|
+
inputProps?: Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "autoFocus" | "placeholder" | "aria-controls" | "role" | "children" | "dangerouslySetInnerHTML">;
|
|
529
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
530
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
531
|
+
|
|
532
|
+
/** Native input, or a ref-forwarding design-system input. Root owns its value. */
|
|
533
|
+
declare const SearchInput: SearchInputComponent;
|
|
534
|
+
|
|
535
|
+
declare const CategoryNav: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "dangerouslySetInnerHTML" | "role"> & {
|
|
536
|
+
orientation?: "horizontal" | "vertical";
|
|
537
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
538
|
+
|
|
539
|
+
type ViewportProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
|
|
540
|
+
/**
|
|
541
|
+
* The scrolled content: one `<List>` (it may be wrapped, e.g. by a
|
|
542
|
+
* styling library), optionally with `<Empty>` and `<Loading>`.
|
|
543
|
+
*/
|
|
544
|
+
children: React.ReactNode;
|
|
545
|
+
};
|
|
546
|
+
declare const Viewport: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "dangerouslySetInnerHTML" | "role"> & {
|
|
547
|
+
/**
|
|
548
|
+
* The scrolled content: one `<List>` (it may be wrapped, e.g. by a
|
|
549
|
+
* styling library), optionally with `<Empty>` and `<Loading>`.
|
|
550
|
+
*/
|
|
551
|
+
children: React.ReactNode;
|
|
552
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
553
|
+
|
|
554
|
+
declare const List: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLUListElement>, "children" | "dangerouslySetInnerHTML" | "role"> & {
|
|
555
|
+
components?: ListComponents;
|
|
556
|
+
} & React.RefAttributes<HTMLUListElement>>;
|
|
557
|
+
|
|
558
|
+
declare const Preview: React.ForwardRefExoticComponent<PreviewProps & React.RefAttributes<HTMLDivElement>>;
|
|
559
|
+
|
|
560
|
+
export { Categories, CategoryNav, EmojiStyle, Empty, List, LoadError, Loading, Panel, Preview, Reactions, Root, Search, SearchInput, SkinTone, SkinTonePickerLocation, SkinTones, SuggestionMode, Theme, Viewport, darkPickerTokens, defaultPickerTokens, lightPickerTokens, structuralPickerTokens, useActiveEmoji, useCategoryNavigation, useEmojiDataState, usePickerMode, useSearchActions, useSearchState, useSkinTone };
|
|
561
|
+
export type { CategoryButtonRenderProps, CategoryConfig, CategoryHeaderRenderProps, CategoryIcons, CategoryNavProps, CustomEmoji, EmojiClickData, EmojiClickHandler, EmojiData, EmojiDataInput, EmojiDataLoader, EmojiDataLoaderOptions, EmojiDataState, EmojiRenderProps, EmojiStyleValue, EmptyProps, ListComponents, ListEmoji, ListProps, LoadErrorProps, LoadingProps, OnEmojiClickApi, PanelProps, PickerAppearanceProps, PickerComponents, PickerCompositionProps, PickerLabels, PreviewConfig, PreviewProps, ReactionsProps, RootBehaviorProps, RootProps, SearchInputComponent, SearchInputElement, SearchInputProps, SearchProps, SearchState, SkinToneButtonRenderProps, SkinToneChangeHandler, SkinToneProps, SkinTonesValue, SuggestionModeValue, ThemeValue, ViewportProps };
|