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
|
@@ -1,165 +1,105 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { cx } from 'shipstyles';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from '../../../config/useConfig';
|
|
10
|
-
import { useCloseAllOpenToggles } from '../../../hooks/useCloseAllOpenToggles';
|
|
11
|
-
import { useFilter } from '../../../hooks/useFilter';
|
|
12
|
-
import { useIsSkinToneInSearch } from '../../../hooks/useShouldShowSkinTonePicker';
|
|
4
|
+
import { stylesheet } from '../../../Stylesheet/stylesheet';
|
|
5
|
+
import { SearchInput } from '../../../primitives/SearchInput';
|
|
6
|
+
import { useDefaultAppearance } from '../../../primitives/appearance';
|
|
7
|
+
import { filterPrimitiveProps } from '../../../primitives/nativeProps';
|
|
8
|
+
import type { SearchProps } from '../../../primitives/types';
|
|
13
9
|
import Flex from '../../Layout/Flex';
|
|
14
10
|
import Relative from '../../Layout/Relative';
|
|
15
|
-
import { useSearchInputRef } from '../../context/ElementRefContext';
|
|
16
|
-
import { SkinTonePicker } from '../SkinTonePicker/SkinTonePicker';
|
|
17
11
|
|
|
18
12
|
import { BtnClearSearch } from './BtnClearSearch';
|
|
19
13
|
import { IcnSearch } from './IcnSearch';
|
|
20
|
-
import SVGTimes from './svg/times.svg';
|
|
21
|
-
|
|
22
|
-
export function SearchContainer() {
|
|
23
|
-
const searchDisabled = useSearchDisabledConfig();
|
|
24
|
-
|
|
25
|
-
const isSkinToneInSearch = useIsSkinToneInSearch();
|
|
26
|
-
|
|
27
|
-
if (searchDisabled) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
14
|
|
|
15
|
+
export function SearchContainer({
|
|
16
|
+
children,
|
|
17
|
+
inputProps,
|
|
18
|
+
inputRef,
|
|
19
|
+
}: {
|
|
20
|
+
inputProps?: SearchProps['inputProps'];
|
|
21
|
+
inputRef?: SearchProps['inputRef'];
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
} = {}) {
|
|
31
24
|
return (
|
|
32
25
|
<Flex className={cx(styles.overlay)}>
|
|
33
|
-
<Search />
|
|
26
|
+
<Search inputProps={inputProps} inputRef={inputRef} />
|
|
34
27
|
|
|
35
|
-
{
|
|
28
|
+
{children}
|
|
36
29
|
</Flex>
|
|
37
30
|
);
|
|
38
31
|
}
|
|
39
32
|
|
|
40
|
-
export function Search(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
export function Search({
|
|
34
|
+
inputProps,
|
|
35
|
+
inputRef,
|
|
36
|
+
}: {
|
|
37
|
+
inputProps?: SearchProps['inputProps'];
|
|
38
|
+
inputRef?: SearchProps['inputRef'];
|
|
39
|
+
} = {}) {
|
|
40
|
+
const appearance = useDefaultAppearance();
|
|
41
|
+
// The managed region and the standalone native-input primitive share
|
|
42
|
+
// the same controller, registration and accessible announcements.
|
|
43
|
+
const safe = filterPrimitiveProps(
|
|
44
|
+
(inputProps ?? {}) as Record<string, unknown>,
|
|
45
|
+
[
|
|
46
|
+
'type',
|
|
47
|
+
'value',
|
|
48
|
+
'defaultValue',
|
|
49
|
+
'onChange',
|
|
50
|
+
'autoFocus',
|
|
51
|
+
'placeholder',
|
|
52
|
+
'aria-controls',
|
|
53
|
+
],
|
|
54
|
+
);
|
|
55
|
+
const { className, ...rest } = safe;
|
|
50
56
|
return (
|
|
51
57
|
<Relative className={cx(styles.searchContainer)}>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
placeholder={placeholder}
|
|
61
|
-
onChange={(event) => {
|
|
62
|
-
onChange(event?.target?.value ?? value);
|
|
63
|
-
}}
|
|
64
|
-
ref={SearchInputRef}
|
|
58
|
+
<SearchInput
|
|
59
|
+
{...rest}
|
|
60
|
+
className={cx(
|
|
61
|
+
styles.inputGeometry,
|
|
62
|
+
appearance && styles.search,
|
|
63
|
+
className as string | undefined,
|
|
64
|
+
)}
|
|
65
|
+
ref={inputRef}
|
|
65
66
|
/>
|
|
66
|
-
{
|
|
67
|
-
<div
|
|
68
|
-
role="status"
|
|
69
|
-
className={cx('epr-status-search-results', styles.visuallyHidden)}
|
|
70
|
-
aria-live="polite"
|
|
71
|
-
id="epr-search-id"
|
|
72
|
-
aria-atomic="true"
|
|
73
|
-
>
|
|
74
|
-
{statusSearchResults}
|
|
75
|
-
</div>
|
|
76
|
-
) : null}
|
|
77
|
-
<IcnSearch />
|
|
67
|
+
{appearance && <IcnSearch />}
|
|
78
68
|
<BtnClearSearch />
|
|
79
69
|
</Relative>
|
|
80
70
|
);
|
|
81
71
|
}
|
|
82
72
|
|
|
83
|
-
const styles =
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
searchContainer: {
|
|
89
|
-
'.': 'epr-search-container',
|
|
90
|
-
flex: '1',
|
|
91
|
-
display: 'block',
|
|
92
|
-
minWidth: '0',
|
|
93
|
-
},
|
|
94
|
-
visuallyHidden: {
|
|
95
|
-
clip: 'rect(0 0 0 0)',
|
|
96
|
-
clipPath: 'inset(50%)',
|
|
97
|
-
height: '1px',
|
|
98
|
-
overflow: 'hidden',
|
|
99
|
-
position: 'absolute',
|
|
100
|
-
whiteSpace: 'nowrap',
|
|
101
|
-
width: '1px',
|
|
102
|
-
},
|
|
103
|
-
search: {
|
|
104
|
-
outline: 'none',
|
|
105
|
-
transition: 'all 0.2s ease-in-out',
|
|
106
|
-
color: 'var(--epr-search-input-text-color)',
|
|
107
|
-
borderRadius: 'var(--epr-search-input-border-radius)',
|
|
108
|
-
padding: 'var(--epr-search-input-padding)',
|
|
109
|
-
height: 'var(--epr-search-input-height)',
|
|
110
|
-
backgroundColor: 'var(--epr-search-input-bg-color)',
|
|
111
|
-
border: '1px solid var(--epr-search-border-color)',
|
|
112
|
-
width: '100%',
|
|
113
|
-
':focus': {
|
|
114
|
-
backgroundColor: 'var(--epr-search-input-bg-color-active)',
|
|
115
|
-
border: '1px solid var(--epr-search-border-color-active)',
|
|
116
|
-
},
|
|
117
|
-
'::placeholder': {
|
|
118
|
-
color: 'var(--epr-search-input-placeholder-color)',
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
btnClearSearch: {
|
|
123
|
-
'.': 'epr-btn-clear-search',
|
|
124
|
-
position: 'absolute',
|
|
125
|
-
right: 'var(--epr-search-bar-inner-padding)',
|
|
126
|
-
height: '30px',
|
|
127
|
-
width: '30px',
|
|
128
|
-
display: 'flex',
|
|
129
|
-
alignItems: 'center',
|
|
130
|
-
justifyContent: 'center',
|
|
131
|
-
top: '50%',
|
|
132
|
-
transform: 'translateY(-50%)',
|
|
133
|
-
padding: '0',
|
|
134
|
-
borderRadius: '50%',
|
|
135
|
-
':hover': {
|
|
136
|
-
background: 'var(--epr-hover-bg-color)',
|
|
137
|
-
},
|
|
138
|
-
':focus': {
|
|
139
|
-
background: 'var(--epr-hover-bg-color)',
|
|
73
|
+
const styles = /* @__PURE__ */ (() =>
|
|
74
|
+
stylesheet.create({
|
|
75
|
+
overlay: {
|
|
76
|
+
padding: 'var(--epr-header-padding)',
|
|
77
|
+
zIndex: 'var(--epr-header-overlay-z-index)',
|
|
140
78
|
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
backgroundSize: '20px',
|
|
147
|
-
height: '20px',
|
|
148
|
-
width: '20px',
|
|
149
|
-
backgroundImage: `url(${SVGTimes})`,
|
|
150
|
-
':hover': {
|
|
151
|
-
backgroundPositionY: '-20px',
|
|
79
|
+
searchContainer: {
|
|
80
|
+
'.': 'epr-search-container',
|
|
81
|
+
flex: '1',
|
|
82
|
+
display: 'block',
|
|
83
|
+
minWidth: '0',
|
|
152
84
|
},
|
|
153
|
-
|
|
154
|
-
|
|
85
|
+
inputGeometry: {
|
|
86
|
+
padding: 'var(--epr-search-input-padding)',
|
|
87
|
+
height: 'var(--epr-search-input-height)',
|
|
88
|
+
width: '100%',
|
|
155
89
|
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
90
|
+
search: {
|
|
91
|
+
outline: 'none',
|
|
92
|
+
transition: 'all 0.2s ease-in-out',
|
|
93
|
+
color: 'var(--epr-search-input-text-color)',
|
|
94
|
+
borderRadius: 'var(--epr-search-input-border-radius)',
|
|
95
|
+
backgroundColor: 'var(--epr-search-input-bg-color)',
|
|
96
|
+
border: '1px solid var(--epr-search-border-color)',
|
|
97
|
+
':focus': {
|
|
98
|
+
backgroundColor: 'var(--epr-search-input-bg-color-active)',
|
|
99
|
+
border: '1px solid var(--epr-search-border-color-active)',
|
|
100
|
+
},
|
|
101
|
+
'::placeholder': {
|
|
102
|
+
color: 'var(--epr-search-input-placeholder-color)',
|
|
103
|
+
},
|
|
163
104
|
},
|
|
164
|
-
})
|
|
165
|
-
});
|
|
105
|
+
}))();
|
|
@@ -2,7 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { cx } from 'shipstyles';
|
|
3
3
|
|
|
4
4
|
import { stylesheet } from '../../../Stylesheet/stylesheet';
|
|
5
|
-
import {
|
|
5
|
+
import { PickerLabels } from '../../../config/config';
|
|
6
|
+
import { useLabels } from '../../../config/useConfig';
|
|
7
|
+
import { useDefaultAppearance } from '../../../primitives/appearance';
|
|
8
|
+
import { usePickerComponents } from '../../../primitives/components';
|
|
6
9
|
import { SkinTones } from '../../../types/exposedTypes';
|
|
7
10
|
import { Button } from '../../atoms/Button';
|
|
8
11
|
|
|
@@ -15,7 +18,6 @@ type Props = {
|
|
|
15
18
|
tabIndex?: number;
|
|
16
19
|
};
|
|
17
20
|
|
|
18
|
-
// eslint-disable-next-line complexity
|
|
19
21
|
export function BtnSkinToneVariation({
|
|
20
22
|
isOpen,
|
|
21
23
|
onClick,
|
|
@@ -24,70 +26,105 @@ export function BtnSkinToneVariation({
|
|
|
24
26
|
style,
|
|
25
27
|
tabIndex,
|
|
26
28
|
}: Props) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
const labels = useLabels();
|
|
30
|
+
const appearance = useDefaultAppearance();
|
|
31
|
+
const { SkinToneButton: Custom } = usePickerComponents();
|
|
32
|
+
const decorated = appearance && !Custom;
|
|
33
|
+
const glyph =
|
|
34
|
+
'✋' +
|
|
35
|
+
(skinToneVariation === SkinTones.NEUTRAL
|
|
36
|
+
? ''
|
|
37
|
+
: String.fromCodePoint(parseInt(skinToneVariation, 16)));
|
|
38
|
+
const props = {
|
|
39
|
+
type: 'button' as const,
|
|
40
|
+
style,
|
|
41
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
42
|
+
if (!event.defaultPrevented) onClick();
|
|
43
|
+
},
|
|
44
|
+
tabIndex,
|
|
45
|
+
className: cx(
|
|
46
|
+
`epr-tone-${skinToneVariation}`,
|
|
47
|
+
styles.geometry,
|
|
48
|
+
decorated && styles.tone,
|
|
49
|
+
!isOpen && styles.closedTone,
|
|
50
|
+
isActive && styles.active,
|
|
51
|
+
),
|
|
52
|
+
'aria-pressed': isActive,
|
|
53
|
+
'aria-label': labels[SKIN_TONE_LABEL_KEYS[skinToneVariation]],
|
|
54
|
+
'data-epr-part': 'skin-tone-button',
|
|
55
|
+
'data-epr-active': isActive ? '' : undefined,
|
|
56
|
+
'data-epr-open': isOpen ? '' : undefined,
|
|
57
|
+
children: decorated ? undefined : glyph,
|
|
58
|
+
};
|
|
59
|
+
return Custom ? (
|
|
60
|
+
<Custom
|
|
61
|
+
{...props}
|
|
62
|
+
tone={{ skinTone: skinToneVariation, isActive, isOpen }}
|
|
63
|
+
/>
|
|
64
|
+
) : (
|
|
65
|
+
<Button {...props} />
|
|
41
66
|
);
|
|
42
67
|
}
|
|
43
68
|
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
right: '0',
|
|
63
|
-
transition: 'transform 0.3s ease-in-out, opacity 0.35s ease-in-out',
|
|
64
|
-
zIndex: '0',
|
|
65
|
-
border: '1px solid var(--epr-skin-tone-outer-border-color)',
|
|
66
|
-
boxShadow: 'inset 0px 0px 0 1px var(--epr-skin-tone-inner-border-color)',
|
|
67
|
-
':hover': {
|
|
68
|
-
boxShadow:
|
|
69
|
-
'0 0 0 3px var(--epr-active-skin-hover-color), inset 0px 0px 0 1px var(--epr-skin-tone-inner-border-color)',
|
|
70
|
-
},
|
|
71
|
-
':focus': {
|
|
72
|
-
boxShadow: '0 0 0 3px var(--epr-focus-bg-color)',
|
|
73
|
-
},
|
|
74
|
-
'&.epr-tone-neutral': {
|
|
75
|
-
backgroundColor: '#ffd225',
|
|
76
|
-
},
|
|
77
|
-
'&.epr-tone-1f3fb': {
|
|
78
|
-
backgroundColor: '#ffdfbd',
|
|
79
|
-
},
|
|
80
|
-
'&.epr-tone-1f3fc': {
|
|
81
|
-
backgroundColor: '#e9c197',
|
|
69
|
+
const SKIN_TONE_LABEL_KEYS: Record<SkinTones, keyof PickerLabels> = {
|
|
70
|
+
[SkinTones.NEUTRAL]: 'skinToneNeutral',
|
|
71
|
+
[SkinTones.LIGHT]: 'skinToneLight',
|
|
72
|
+
[SkinTones.MEDIUM_LIGHT]: 'skinToneMediumLight',
|
|
73
|
+
[SkinTones.MEDIUM]: 'skinToneMedium',
|
|
74
|
+
[SkinTones.MEDIUM_DARK]: 'skinToneMediumDark',
|
|
75
|
+
[SkinTones.DARK]: 'skinToneDark',
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const styles = /* @__PURE__ */ (() =>
|
|
79
|
+
stylesheet.create({
|
|
80
|
+
geometry: {
|
|
81
|
+
width: 'var(--epr-skin-tone-size)',
|
|
82
|
+
height: 'var(--epr-skin-tone-size)',
|
|
83
|
+
display: 'block',
|
|
84
|
+
position: 'absolute',
|
|
85
|
+
insetInlineEnd: '0',
|
|
86
|
+
zIndex: '0',
|
|
82
87
|
},
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
closedTone: {
|
|
89
|
+
opacity: '0',
|
|
90
|
+
zIndex: '0',
|
|
85
91
|
},
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
active: {
|
|
93
|
+
'.': 'epr-active',
|
|
94
|
+
zIndex: '1',
|
|
95
|
+
opacity: '1',
|
|
88
96
|
},
|
|
89
|
-
|
|
90
|
-
|
|
97
|
+
tone: {
|
|
98
|
+
'.': 'epr-tone',
|
|
99
|
+
cursor: 'pointer',
|
|
100
|
+
borderRadius: '4px',
|
|
101
|
+
transition: 'transform 0.3s ease-in-out, opacity 0.35s ease-in-out',
|
|
102
|
+
border: '1px solid var(--epr-skin-tone-outer-border-color)',
|
|
103
|
+
boxShadow: 'inset 0px 0px 0 1px var(--epr-skin-tone-inner-border-color)',
|
|
104
|
+
':hover': {
|
|
105
|
+
boxShadow:
|
|
106
|
+
'0 0 0 3px var(--epr-active-skin-hover-color), inset 0px 0px 0 1px var(--epr-skin-tone-inner-border-color)',
|
|
107
|
+
},
|
|
108
|
+
':focus': {
|
|
109
|
+
boxShadow: '0 0 0 3px var(--epr-focus-bg-color)',
|
|
110
|
+
},
|
|
111
|
+
'&.epr-tone-neutral': {
|
|
112
|
+
backgroundColor: '#ffd225',
|
|
113
|
+
},
|
|
114
|
+
'&.epr-tone-1f3fb': {
|
|
115
|
+
backgroundColor: '#ffdfbd',
|
|
116
|
+
},
|
|
117
|
+
'&.epr-tone-1f3fc': {
|
|
118
|
+
backgroundColor: '#e9c197',
|
|
119
|
+
},
|
|
120
|
+
'&.epr-tone-1f3fd': {
|
|
121
|
+
backgroundColor: '#c88e62',
|
|
122
|
+
},
|
|
123
|
+
'&.epr-tone-1f3fe': {
|
|
124
|
+
backgroundColor: '#a86637',
|
|
125
|
+
},
|
|
126
|
+
'&.epr-tone-1f3ff': {
|
|
127
|
+
backgroundColor: '#60463a',
|
|
128
|
+
},
|
|
91
129
|
},
|
|
92
|
-
}
|
|
93
|
-
});
|
|
130
|
+
}))();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* eslint-disable complexity */
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { cx } from 'shipstyles';
|
|
4
3
|
|
|
5
4
|
import { ClassNames } from '../../../DomUtils/classNames';
|
|
5
|
+
import { isRtl } from '../../../DomUtils/isRtl';
|
|
6
6
|
import { stylesheet } from '../../../Stylesheet/stylesheet';
|
|
7
7
|
import {
|
|
8
8
|
useOnSkinToneChangeConfig,
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
import skinToneVariations from '../../../data/skinToneVariations';
|
|
12
12
|
import { useCloseAllOpenToggles } from '../../../hooks/useCloseAllOpenToggles';
|
|
13
13
|
import { useFocusSearchInput } from '../../../hooks/useFocus';
|
|
14
|
+
import { useRegisterRegion } from '../../../hooks/useRegisterRegion';
|
|
15
|
+
import { useDefaultAppearance } from '../../../primitives/appearance';
|
|
14
16
|
import Absolute from '../../Layout/Absolute';
|
|
15
17
|
import Relative from '../../Layout/Relative';
|
|
16
18
|
import { useSkinTonePickerRef } from '../../context/ElementRefContext';
|
|
@@ -28,6 +30,10 @@ type Props = {
|
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
export function SkinTonePickerMenu() {
|
|
33
|
+
const SkinTonePickerRef = useSkinTonePickerRef();
|
|
34
|
+
// Preview-located skin-tone control is its own focus region; the
|
|
35
|
+
// search-located fan stays covered by local Search behavior.
|
|
36
|
+
useRegisterRegion('preview-skin-tone', SkinTonePickerRef);
|
|
31
37
|
return (
|
|
32
38
|
<Relative style={{ height: ITEM_SIZE }}>
|
|
33
39
|
<Absolute style={{ bottom: 0, right: 0 }}>
|
|
@@ -40,6 +46,7 @@ export function SkinTonePickerMenu() {
|
|
|
40
46
|
export function SkinTonePicker({
|
|
41
47
|
direction = SkinTonePickerDirection.HORIZONTAL,
|
|
42
48
|
}: Props) {
|
|
49
|
+
const appearance = useDefaultAppearance();
|
|
43
50
|
const SkinTonePickerRef = useSkinTonePickerRef();
|
|
44
51
|
const isDisabled = useSkinTonesDisabledConfig();
|
|
45
52
|
const [isOpen, setIsOpen] = useSkinToneFanOpenState();
|
|
@@ -57,22 +64,31 @@ export function SkinTonePicker({
|
|
|
57
64
|
const expandedSize = isOpen ? fullWidth : ITEM_SIZE + 'px';
|
|
58
65
|
|
|
59
66
|
const vertical = direction === SkinTonePickerDirection.VERTICAL;
|
|
67
|
+
// The fan opens toward the inline start: leftward, or rightward under
|
|
68
|
+
// dir="rtl". The control is mounted before it can open, so the ref is set.
|
|
69
|
+
const inlineSign =
|
|
70
|
+
isOpen && !vertical && isRtl(SkinTonePickerRef.current) ? 1 : -1;
|
|
60
71
|
|
|
61
72
|
return (
|
|
62
73
|
<Relative
|
|
63
|
-
className={
|
|
64
|
-
styles.skinTones,
|
|
65
|
-
vertical && styles.vertical,
|
|
66
|
-
isOpen && styles.open,
|
|
67
|
-
vertical && isOpen && styles.verticalShadow,
|
|
68
|
-
)}
|
|
74
|
+
className={skinToneClassName(appearance, vertical, isOpen)}
|
|
69
75
|
style={
|
|
70
76
|
vertical
|
|
71
77
|
? { flexBasis: expandedSize, height: expandedSize }
|
|
72
|
-
|
|
78
|
+
// SkinTone wraps this flex item in a layout host. An explicit
|
|
79
|
+
// width lets that host reserve the fan's full horizontal span,
|
|
80
|
+
// so a neighboring Search input shrinks instead of overlapping.
|
|
81
|
+
: { flexBasis: expandedSize, width: expandedSize }
|
|
73
82
|
}
|
|
74
83
|
>
|
|
75
|
-
<div
|
|
84
|
+
<div
|
|
85
|
+
className={cx(styles.select)}
|
|
86
|
+
ref={SkinTonePickerRef}
|
|
87
|
+
data-epr-part="skin-tone"
|
|
88
|
+
// Read by the keyboard handler: arrow keys follow the fan axis
|
|
89
|
+
// wherever the control is placed.
|
|
90
|
+
data-epr-direction={vertical ? 'vertical' : 'horizontal'}
|
|
91
|
+
>
|
|
76
92
|
{skinToneVariations.map((skinToneVariation, i) => {
|
|
77
93
|
const active = skinToneVariation === activeSkinTone;
|
|
78
94
|
|
|
@@ -91,8 +107,8 @@ export function SkinTonePicker({
|
|
|
91
107
|
transform: cx(
|
|
92
108
|
vertical
|
|
93
109
|
? `translateY(-${i * (isOpen ? ITEM_SIZE : 0)}px)`
|
|
94
|
-
: `translateX(
|
|
95
|
-
isOpen && active && 'scale(1.3)',
|
|
110
|
+
: `translateX(${inlineSign * i * (isOpen ? ITEM_SIZE : 0)}px)`,
|
|
111
|
+
appearance && isOpen && active && 'scale(1.3)',
|
|
96
112
|
),
|
|
97
113
|
}}
|
|
98
114
|
isActive={active}
|
|
@@ -114,45 +130,67 @@ export function SkinTonePicker({
|
|
|
114
130
|
);
|
|
115
131
|
}
|
|
116
132
|
|
|
133
|
+
function skinToneClassName(
|
|
134
|
+
appearance: boolean,
|
|
135
|
+
vertical: boolean,
|
|
136
|
+
open: boolean,
|
|
137
|
+
) {
|
|
138
|
+
return cx(
|
|
139
|
+
styles.geometry,
|
|
140
|
+
appearance && styles.skinTones,
|
|
141
|
+
vertical && styles.verticalGeometry,
|
|
142
|
+
appearance && vertical && styles.vertical,
|
|
143
|
+
appearance && open && styles.open,
|
|
144
|
+
appearance && vertical && open && styles.verticalShadow,
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
117
148
|
export enum SkinTonePickerDirection {
|
|
118
149
|
VERTICAL = ClassNames.vertical,
|
|
119
150
|
HORIZONTAL = ClassNames.horizontal,
|
|
120
151
|
}
|
|
121
152
|
|
|
122
|
-
const styles =
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
153
|
+
const styles = /* @__PURE__ */ (() =>
|
|
154
|
+
stylesheet.create({
|
|
155
|
+
geometry: {
|
|
156
|
+
'--': { '--epr-skin-tone-size': '15px' },
|
|
157
|
+
display: 'flex',
|
|
158
|
+
alignItems: 'center',
|
|
159
|
+
justifyContent: 'flex-end',
|
|
160
|
+
padding: '10px 0',
|
|
161
|
+
},
|
|
162
|
+
verticalGeometry: {
|
|
163
|
+
padding: '9px',
|
|
164
|
+
alignItems: 'flex-end',
|
|
165
|
+
flexDirection: 'column',
|
|
166
|
+
},
|
|
167
|
+
skinTones: {
|
|
168
|
+
'.': 'epr-skin-tones',
|
|
169
|
+
transition: 'all 0.3s ease-in-out',
|
|
170
|
+
padding: '10px 0',
|
|
171
|
+
},
|
|
172
|
+
vertical: {
|
|
173
|
+
padding: '9px',
|
|
174
|
+
alignItems: 'flex-end',
|
|
175
|
+
flexDirection: 'column',
|
|
176
|
+
borderRadius: '6px',
|
|
177
|
+
border: '1px solid var(--epr-bg-color)',
|
|
178
|
+
},
|
|
179
|
+
verticalShadow: {
|
|
180
|
+
boxShadow: '0px 0 7px var(--epr-picker-border-color)',
|
|
181
|
+
},
|
|
182
|
+
open: {
|
|
183
|
+
// @ts-ignore - backdropFilter is not recognized.
|
|
184
|
+
backdropFilter: 'blur(5px)',
|
|
185
|
+
background: 'var(--epr-skin-tone-picker-menu-color)',
|
|
186
|
+
'.epr-active': {
|
|
187
|
+
border: '1px solid var(--epr-active-skin-tone-indicator-border-color)',
|
|
188
|
+
},
|
|
127
189
|
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
vertical: {
|
|
135
|
-
padding: '9px',
|
|
136
|
-
alignItems: 'flex-end',
|
|
137
|
-
flexDirection: 'column',
|
|
138
|
-
borderRadius: '6px',
|
|
139
|
-
border: '1px solid var(--epr-bg-color)',
|
|
140
|
-
},
|
|
141
|
-
verticalShadow: {
|
|
142
|
-
boxShadow: '0px 0 7px var(--epr-picker-border-color)',
|
|
143
|
-
},
|
|
144
|
-
open: {
|
|
145
|
-
// @ts-ignore - backdropFilter is not recognized.
|
|
146
|
-
backdropFilter: 'blur(5px)',
|
|
147
|
-
background: 'var(--epr-skin-tone-picker-menu-color)',
|
|
148
|
-
'.epr-active': {
|
|
149
|
-
border: '1px solid var(--epr-active-skin-tone-indicator-border-color)',
|
|
190
|
+
select: {
|
|
191
|
+
'.': 'epr-skin-tone-select',
|
|
192
|
+
position: 'relative',
|
|
193
|
+
width: 'var(--epr-skin-tone-size)',
|
|
194
|
+
height: 'var(--epr-skin-tone-size)',
|
|
150
195
|
},
|
|
151
|
-
}
|
|
152
|
-
select: {
|
|
153
|
-
'.': 'epr-skin-tone-select',
|
|
154
|
-
position: 'relative',
|
|
155
|
-
width: 'var(--epr-skin-tone-size)',
|
|
156
|
-
height: 'var(--epr-skin-tone-size)',
|
|
157
|
-
},
|
|
158
|
-
});
|
|
196
|
+
}))();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Generated by scripts/buildIcons.ts — do not edit.
|
|
2
|
+
|
|
3
|
+
// Reactions/svg/plus.svg
|
|
4
|
+
export const PLUS_ICON =
|
|
5
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20px' height='80px' viewBox='0 0 20 80'%3E%3Cpath fill='%23868686' d='M5.7,10.4c0,.1,.1,.3,.2,.4C6,10.9,6.1,11,6.3,11h3.4v3.4c0,.1,.1,.3,.2,.4c.1,.1,.2,.2,.4,.2c.3,0,.5-.2,.5-.5v-3.4h3.4c.3,0,.5-.2,.5-.5s-.2-.5-.5-.5h-3.4V6.7c0-.3-.2-.5-.5-.5C9.8,6,9.6,6.2,9.6,6.5v3.4H6.2C5.9,9.9,5.7,10.1,5.7,10.4L5.7,10.4z'/%3E%3Cpath fill='%233371B7' d='M5.7,30.4c0,.1,.1,.3,.2,.4S6.1,31,6.3,31h3.4v3.4c0,.1,.1,.3,.2,.4c.1,.1,.2,.2,.4,.2c.3,0,.5-.2,.5-.5v-3.4h3.4c.3,0,.5-.2,.5-.5s-.2-.5-.5-.5h-3.4v-3.4c0-.3-.2-.5-.5-.5s-.5,.2-.5,.5v3.4H6.2C5.9,29.9,5.7,30.1,5.7,30.4L5.7,30.4z'/%3E%3Cpath fill='%23C0C0BF' d='M5.7,50.4c0,.1,.1,.3,.2,.4C6,50.9,6.1,51,6.3,51h3.4v3.4c0,.1,.1,.3,.2,.4c.1,.1,.2,.2,.4,.2c.3,0,.5-.2,.5-.5v-3.4h3.4c.3,0,.5-.2,.5-.5s-.2-.5-.5-.5h-3.4v-3.4c0-.3-.2-.5-.5-.5s-.5,.2-.5,.5v3.4H6.2C5.9,49.9,5.7,50.1,5.7,50.4L5.7,50.4z'/%3E%3Cpath fill='%236AA9DD' d='M5.7,70.4c0,.1,.1,.3,.2,.4S6.1,71,6.3,71h3.4v3.4c0,.1,.1,.3,.2,.4c.1,.1,.2,.2,.4,.2c.3,0,.5-.2,.5-.5v-3.4h3.4c.3,0,.5-.2,.5-.5s-.2-.5-.5-.5h-3.4v-3.4c0-.3-.2-.5-.5-.5s-.5,.2-.5,.5v3.4H6.4C5.9,69.9,5.7,70.1,5.7,70.4L5.7,70.4z'/%3E%3C/svg%3E";
|
|
6
|
+
|
|
7
|
+
// body/svg/triangle.svg
|
|
8
|
+
export const TRIANGLE_ICON =
|
|
9
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50px' height='15px' viewBox='0 0 50 15'%3E%3Cg%3E%3Cpath fill='%23FFFFFF' stroke='%23E8E7E7' stroke-miterlimit='10' d='M1.86-.43l9.83,11.53c.59,.69,1.56,.69,2.14,0l9.83-11.53'/%3E%3Cpath fill='%23010202' stroke='%23151617' stroke-miterlimit='10' d='M26.86-.43l9.83,11.53c.59,.69,1.56,.69,2.14,0l9.83-11.53'/%3E%3C/g%3E%3C/svg%3E";
|
|
10
|
+
|
|
11
|
+
// header/Search/svg/magnifier.svg
|
|
12
|
+
export const MAGNIFIER_ICON =
|
|
13
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20px' height='40px' viewBox='0 0 20 40'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' fill='%23868686' d='M12,8.81c0,2.08-1.68,3.76-3.76,3.76c-2.08,0-3.76-1.68-3.76-3.76c0-2.08,1.68-3.76,3.76-3.76C10.32,5.05,12,6.73,12,8.81zM11.23,12.72c-.83,.64-1.87,1.01-2.99,1.01c-2.72,0-4.92-2.2-4.92-4.92c0-2.72,2.2-4.92,4.92-4.92c2.72,0,4.92,2.2,4.92,4.92c0,1.13-.38,2.16-1.01,2.99l3.94,3.93c.25,.25,.25,.66,0,.92c-.25,.25-.66,.25-.92,0L11.23,12.72z'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' fill='%23C0C0BF' d='M12,28.81c0,2.08-1.68,3.76-3.76,3.76c-2.08,0-3.76-1.68-3.76-3.76c0-2.08,1.68-3.76,3.76-3.76C10.32,25.05,12,26.73,12,28.81zM11.23,32.72c-.83,.64-1.87,1.01-2.99,1.01c-2.72,0-4.92-2.2-4.92-4.92c0-2.72,2.2-4.92,4.92-4.92c2.72,0,4.92,2.2,4.92,4.92c0,1.13-.38,2.16-1.01,2.99l3.94,3.93c.25,.25,.25,.66,0,.92c-.25,.25-.66,.25-.92,0L11.23,32.72z'/%3E%3C/svg%3E";
|
|
14
|
+
|
|
15
|
+
// header/Search/svg/times.svg
|
|
16
|
+
export const TIMES_ICON =
|
|
17
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20px' height='80px' viewBox='0 0 20 80'%3E%3Cpath fill='%23868686' d='M6.98,13.59c.1,.1,.24,.15,.37,.15s.27-.05,.37-.15l2.42-2.42l2.43,2.43c.1,.1,.24,.15,.37,.15c.14,0,.27-.05,.37-.15c.21-.21,.21-.54,0-.75l-2.43-2.43L13.32,8c.21-.21,.21-.54,0-.75c-.21-.21-.54-.21-.75,0l-2.42,2.42L7.74,7.27c-.21-.21-.54-.21-.75,0c-.21,.21-.21,.54,0,.75l2.41,2.41l-2.42,2.42C6.77,13.05,6.77,13.39,6.98,13.59L6.98,13.59z'/%3E%3Cpath fill='%23868686' d='M10.15,18.43c4.41,0,8-3.59,8-8c0-4.41-3.59-8-8-8c-4.41,0-8,3.59-8,8C2.15,14.84,5.74,18.43,10.15,18.43zM10.15,3.49c3.83,0,6.94,3.11,6.94,6.94c0,3.83-3.11,6.94-6.94,6.94c-3.83,0-6.94-3.11-6.94-6.94C3.21,6.6,6.33,3.49,10.15,3.49L10.15,3.49z'/%3E%3Cpath fill='%233371B7' d='M6.98,33.59c.1,.1,.24,.15,.37,.15s.27-.05,.37-.15l2.42-2.42l2.43,2.43c.1,.1,.24,.15,.37,.15c.14,0,.27-.05,.37-.15c.21-.21,.21-.54,0-.75l-2.43-2.43L13.32,28c.21-.21,.21-.54,0-.75c-.21-.21-.54-.21-.75,0l-2.42,2.42l-2.41-2.41c-.21-.21-.54-.21-.75,0c-.21,.21-.21,.54,0,.75l2.41,2.41l-2.42,2.42C6.77,33.05,6.77,33.39,6.98,33.59L6.98,33.59z'/%3E%3Cpath fill='%233371B7' d='M10.15,38.43c4.41,0,8-3.59,8-8c0-4.41-3.59-8-8-8c-4.41,0-8,3.59-8,8C2.15,34.84,5.74,38.43,10.15,38.43zM10.15,23.49c3.83,0,6.94,3.11,6.94,6.94c0,3.83-3.11,6.94-6.94,6.94c-3.83,0-6.94-3.11-6.94-6.94C3.21,26.6,6.33,23.49,10.15,23.49L10.15,23.49z'/%3E%3Cpath fill='%23C0C0BF' d='M6.98,53.59c.1,.1,.24,.15,.37,.15s.27-.05,.37-.15l2.42-2.42l2.43,2.43c.1,.1,.24,.15,.37,.15c.14,0,.27-.05,.37-.15c.21-.21,.21-.54,0-.75l-2.43-2.43L13.32,48c.21-.21,.21-.54,0-.75c-.21-.21-.54-.21-.75,0l-2.42,2.42l-2.41-2.41c-.21-.21-.54-.21-.75,0c-.21,.21-.21,.54,0,.75l2.41,2.41l-2.42,2.42C6.77,53.05,6.77,53.39,6.98,53.59L6.98,53.59z'/%3E%3Cpath fill='%23C0C0BF' d='M10.15,58.43c4.41,0,8-3.59,8-8c0-4.41-3.59-8-8-8c-4.41,0-8,3.59-8,8C2.15,54.84,5.74,58.43,10.15,58.43zM10.15,43.49c3.83,0,6.94,3.11,6.94,6.94c0,3.83-3.11,6.94-6.94,6.94c-3.83,0-6.94-3.11-6.94-6.94C3.21,46.6,6.33,43.49,10.15,43.49L10.15,43.49z'/%3E%3Cpath fill='%236AA9DD' d='M6.98,73.59c.1,.1,.24,.15,.37,.15s.27-.05,.37-.15l2.42-2.42l2.43,2.43c.1,.1,.24,.15,.37,.15c.14,0,.27-.05,.37-.15c.21-.21,.21-.54,0-.75l-2.43-2.43L13.32,68c.21-.21,.21-.54,0-.75c-.21-.21-.54-.21-.75,0l-2.42,2.42l-2.41-2.41c-.21-.21-.54-.21-.75,0c-.21,.21-.21,.54,0,.75l2.41,2.41l-2.42,2.42C6.77,73.05,6.77,73.39,6.98,73.59L6.98,73.59z'/%3E%3Cpath fill='%236AA9DD' d='M10.15,78.43c4.41,0,8-3.59,8-8c0-4.41-3.59-8-8-8c-4.41,0-8,3.59-8,8C2.15,74.84,5.74,78.43,10.15,78.43zM10.15,63.49c3.83,0,6.94,3.11,6.94,6.94c0,3.83-3.11,6.94-6.94,6.94c-3.83,0-6.94-3.11-6.94-6.94C3.21,66.6,6.33,63.49,10.15,63.49L10.15,63.49z'/%3E%3C/svg%3E";
|