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.
Files changed (405) hide show
  1. package/README.md +335 -49
  2. package/dist/DomUtils/categoryNameFromDom.d.ts +1 -1
  3. package/dist/DomUtils/classNames.d.ts +24 -23
  4. package/dist/DomUtils/detectEmojyPartiallyBelowFold.d.ts +2 -2
  5. package/dist/DomUtils/elementPositionInRow.d.ts +5 -5
  6. package/dist/DomUtils/eventBelongsToPicker.d.ts +2 -0
  7. package/dist/DomUtils/focusElement.d.ts +5 -5
  8. package/dist/DomUtils/getActiveElement.d.ts +2 -2
  9. package/dist/DomUtils/isJsdom.d.ts +1 -0
  10. package/dist/DomUtils/isRtl.d.ts +1 -0
  11. package/dist/DomUtils/keyboardNavigation.d.ts +7 -8
  12. package/dist/DomUtils/scrollTo.d.ts +4 -5
  13. package/dist/DomUtils/selectors.d.ts +31 -35
  14. package/dist/EmojiPickerReact.d.ts +5 -5
  15. package/dist/Stylesheet/DedupedStyle.d.ts +13 -0
  16. package/dist/Stylesheet/stylesheet.d.ts +40 -37
  17. package/dist/components/ErrorBoundary.d.ts +15 -15
  18. package/dist/components/Layout/Absolute.d.ts +8 -8
  19. package/dist/components/Layout/Flex.d.ts +13 -13
  20. package/dist/components/Layout/Relative.d.ts +8 -8
  21. package/dist/components/Layout/Space.d.ts +7 -7
  22. package/dist/components/Reactions/BtnPlus.d.ts +2 -2
  23. package/dist/components/Reactions/DEFAULT_REACTIONS.d.ts +1 -1
  24. package/dist/components/Reactions/Reactions.d.ts +3 -2
  25. package/dist/components/atoms/Button.d.ts +11 -6
  26. package/dist/components/body/EmojiCategory.d.ts +13 -12
  27. package/dist/components/body/EmojiList.d.ts +7 -4
  28. package/dist/components/body/EmojiVariationPicker.d.ts +2 -2
  29. package/dist/components/body/MeasureEmoji.d.ts +2 -2
  30. package/dist/components/body/listComponents.d.ts +47 -0
  31. package/dist/components/context/ElementRefContext.d.ts +18 -16
  32. package/dist/components/context/PickerConfigContext.d.ts +14 -9
  33. package/dist/components/context/PickerContext.d.ts +57 -25
  34. package/dist/components/context/PickerDataContext.d.ts +23 -17
  35. package/dist/components/emoji/BaseEmojiProps.d.ts +14 -13
  36. package/dist/components/emoji/ClickableEmojiButton.d.ts +23 -15
  37. package/dist/components/emoji/Emoji.d.ts +18 -15
  38. package/dist/components/emoji/EmojiImg.d.ts +11 -11
  39. package/dist/components/emoji/ExportedEmoji.d.ts +11 -11
  40. package/dist/components/emoji/NativeEmoji.d.ts +6 -6
  41. package/dist/components/emoji/ViewOnlyEmoji.d.ts +3 -3
  42. package/dist/components/emoji/emojiStyles.d.ts +6 -1
  43. package/dist/components/footer/Preview.d.ts +7 -7
  44. package/dist/components/header/Header.d.ts +2 -2
  45. package/dist/components/header/Search/BtnClearSearch.d.ts +2 -2
  46. package/dist/components/header/Search/IcnSearch.d.ts +2 -2
  47. package/dist/components/header/Search/Search.d.ts +11 -3
  48. package/dist/components/header/SkinTonePicker/BtnSkinToneVariation.d.ts +12 -12
  49. package/dist/components/header/SkinTonePicker/SkinTonePicker.d.ts +11 -11
  50. package/dist/components/icons/svgIcons.d.ts +4 -0
  51. package/dist/components/main/PickerMainBehaviors.d.ts +4 -0
  52. package/dist/components/main/defaultAppearance.d.ts +12 -0
  53. package/dist/components/main/labelHeight.d.ts +1 -0
  54. package/dist/components/navigation/CategoryButton.d.ts +12 -12
  55. package/dist/components/navigation/CategoryNavIcon.d.ts +4 -4
  56. package/dist/components/navigation/CategoryNavigation.d.ts +19 -2
  57. package/dist/config/categoryConfig.d.ts +34 -34
  58. package/dist/config/cdnUrls.d.ts +2 -2
  59. package/dist/config/compareConfig.d.ts +10 -2
  60. package/dist/config/config.d.ts +166 -64
  61. package/dist/config/customEmojiConfig.d.ts +14 -14
  62. package/dist/config/defaultPickerConfiguration.d.ts +10 -0
  63. package/dist/config/mutableConfig.d.ts +32 -10
  64. package/dist/config/useConfig.d.ts +48 -36
  65. package/dist/data/defaultEmojiData.d.ts +9 -0
  66. package/dist/data/defaultEmojiData.js +40 -0
  67. package/dist/data/emojis-bn.d.mts +39 -0
  68. package/dist/data/emojis-bn.d.ts +38 -2
  69. package/dist/data/emojis-bn.js +25 -2
  70. package/dist/data/emojis-bn.mjs +2 -0
  71. package/dist/data/emojis-da.d.mts +39 -0
  72. package/dist/data/emojis-da.d.ts +38 -2
  73. package/dist/data/emojis-da.js +25 -2
  74. package/dist/data/emojis-da.mjs +2 -0
  75. package/dist/data/emojis-de.d.mts +39 -0
  76. package/dist/data/emojis-de.d.ts +38 -2
  77. package/dist/data/emojis-de.js +25 -2
  78. package/dist/data/emojis-de.mjs +2 -0
  79. package/dist/data/emojis-en-gb.d.mts +39 -0
  80. package/dist/data/emojis-en-gb.d.ts +38 -2
  81. package/dist/data/emojis-en-gb.js +25 -2
  82. package/dist/data/emojis-en-gb.mjs +2 -0
  83. package/dist/data/emojis-en.d.mts +39 -0
  84. package/dist/data/emojis-en.d.ts +38 -2
  85. package/dist/data/emojis-en.js +25 -2
  86. package/dist/data/emojis-en.mjs +2 -0
  87. package/dist/data/emojis-es-mx.d.mts +39 -0
  88. package/dist/data/emojis-es-mx.d.ts +38 -2
  89. package/dist/data/emojis-es-mx.js +25 -2
  90. package/dist/data/emojis-es-mx.mjs +2 -0
  91. package/dist/data/emojis-es.d.mts +39 -0
  92. package/dist/data/emojis-es.d.ts +38 -2
  93. package/dist/data/emojis-es.js +25 -2
  94. package/dist/data/emojis-es.mjs +2 -0
  95. package/dist/data/emojis-et.d.mts +39 -0
  96. package/dist/data/emojis-et.d.ts +38 -2
  97. package/dist/data/emojis-et.js +25 -2
  98. package/dist/data/emojis-et.mjs +2 -0
  99. package/dist/data/emojis-fi.d.mts +39 -0
  100. package/dist/data/emojis-fi.d.ts +38 -2
  101. package/dist/data/emojis-fi.js +25 -2
  102. package/dist/data/emojis-fi.mjs +2 -0
  103. package/dist/data/emojis-fr.d.mts +39 -0
  104. package/dist/data/emojis-fr.d.ts +38 -2
  105. package/dist/data/emojis-fr.js +25 -2
  106. package/dist/data/emojis-fr.mjs +2 -0
  107. package/dist/data/emojis-hi.d.mts +39 -0
  108. package/dist/data/emojis-hi.d.ts +38 -2
  109. package/dist/data/emojis-hi.js +25 -2
  110. package/dist/data/emojis-hi.mjs +2 -0
  111. package/dist/data/emojis-hu.d.mts +39 -0
  112. package/dist/data/emojis-hu.d.ts +38 -2
  113. package/dist/data/emojis-hu.js +25 -2
  114. package/dist/data/emojis-hu.mjs +2 -0
  115. package/dist/data/emojis-it.d.mts +39 -0
  116. package/dist/data/emojis-it.d.ts +38 -2
  117. package/dist/data/emojis-it.js +25 -2
  118. package/dist/data/emojis-it.mjs +2 -0
  119. package/dist/data/emojis-ja.d.mts +39 -0
  120. package/dist/data/emojis-ja.d.ts +38 -2
  121. package/dist/data/emojis-ja.js +25 -2
  122. package/dist/data/emojis-ja.mjs +2 -0
  123. package/dist/data/emojis-ko.d.mts +39 -0
  124. package/dist/data/emojis-ko.d.ts +38 -2
  125. package/dist/data/emojis-ko.js +25 -2
  126. package/dist/data/emojis-ko.mjs +2 -0
  127. package/dist/data/emojis-lt.d.mts +39 -0
  128. package/dist/data/emojis-lt.d.ts +38 -2
  129. package/dist/data/emojis-lt.js +25 -2
  130. package/dist/data/emojis-lt.mjs +2 -0
  131. package/dist/data/emojis-ms.d.mts +39 -0
  132. package/dist/data/emojis-ms.d.ts +38 -2
  133. package/dist/data/emojis-ms.js +25 -2
  134. package/dist/data/emojis-ms.mjs +2 -0
  135. package/dist/data/emojis-nb.d.mts +39 -0
  136. package/dist/data/emojis-nb.d.ts +38 -2
  137. package/dist/data/emojis-nb.js +25 -2
  138. package/dist/data/emojis-nb.mjs +2 -0
  139. package/dist/data/emojis-nl.d.mts +39 -0
  140. package/dist/data/emojis-nl.d.ts +38 -2
  141. package/dist/data/emojis-nl.js +25 -2
  142. package/dist/data/emojis-nl.mjs +2 -0
  143. package/dist/data/emojis-pl.d.mts +39 -0
  144. package/dist/data/emojis-pl.d.ts +38 -2
  145. package/dist/data/emojis-pl.js +25 -2
  146. package/dist/data/emojis-pl.mjs +2 -0
  147. package/dist/data/emojis-pt.d.mts +39 -0
  148. package/dist/data/emojis-pt.d.ts +38 -2
  149. package/dist/data/emojis-pt.js +25 -2
  150. package/dist/data/emojis-pt.mjs +2 -0
  151. package/dist/data/emojis-ru.d.mts +39 -0
  152. package/dist/data/emojis-ru.d.ts +38 -2
  153. package/dist/data/emojis-ru.js +25 -2
  154. package/dist/data/emojis-ru.mjs +2 -0
  155. package/dist/data/emojis-sv.d.mts +39 -0
  156. package/dist/data/emojis-sv.d.ts +38 -2
  157. package/dist/data/emojis-sv.js +25 -2
  158. package/dist/data/emojis-sv.mjs +2 -0
  159. package/dist/data/emojis-th.d.mts +39 -0
  160. package/dist/data/emojis-th.d.ts +38 -2
  161. package/dist/data/emojis-th.js +25 -2
  162. package/dist/data/emojis-th.mjs +2 -0
  163. package/dist/data/emojis-uk.d.mts +39 -0
  164. package/dist/data/emojis-uk.d.ts +38 -2
  165. package/dist/data/emojis-uk.js +25 -2
  166. package/dist/data/emojis-uk.mjs +2 -0
  167. package/dist/data/emojis-vi.d.mts +39 -0
  168. package/dist/data/emojis-vi.d.ts +38 -2
  169. package/dist/data/emojis-vi.js +25 -2
  170. package/dist/data/emojis-vi.mjs +2 -0
  171. package/dist/data/emojis-zh-hant.d.mts +39 -0
  172. package/dist/data/emojis-zh-hant.d.ts +38 -2
  173. package/dist/data/emojis-zh-hant.js +25 -2
  174. package/dist/data/emojis-zh-hant.mjs +2 -0
  175. package/dist/data/emojis-zh.d.mts +39 -0
  176. package/dist/data/emojis-zh.d.ts +38 -2
  177. package/dist/data/emojis-zh.js +25 -2
  178. package/dist/data/emojis-zh.mjs +2 -0
  179. package/dist/data/index.js +1 -0
  180. package/dist/data/registerDefaultEmojiData.d.ts +1 -0
  181. package/dist/data/registerDefaultEmojiData.js +3 -0
  182. package/dist/data-core/pickerData.d.ts +12 -0
  183. package/dist/data-core/prepare.d.ts +23 -0
  184. package/dist/data-core/search.d.ts +13 -0
  185. package/dist/data-core/types.d.ts +23 -0
  186. package/dist/data.d.mts +72 -0
  187. package/dist/data.d.ts +72 -0
  188. package/dist/dataUtils/DataTypes.d.ts +23 -19
  189. package/dist/dataUtils/emojiSelectors.d.ts +15 -16
  190. package/dist/dataUtils/emojiUtils.d.ts +1 -12
  191. package/dist/dataUtils/nativeEmojiSequenceSupport.d.ts +10 -0
  192. package/dist/dataUtils/nativeEmojiSupport.d.ts +40 -0
  193. package/dist/dataUtils/parseNativeEmoji.d.ts +1 -1
  194. package/dist/dataUtils/suggested.d.ts +11 -11
  195. package/dist/dataUtils/suggestedEmojis.d.ts +7 -0
  196. package/dist/esm/chunks/chunk-46BUDQLE.mjs +228 -0
  197. package/dist/esm/chunks/chunk-7ZGTUZFB.mjs +16 -0
  198. package/dist/esm/chunks/chunk-FQIJ4HBW.mjs +25 -0
  199. package/dist/esm/chunks/chunk-KQPOIRSC.mjs +9305 -0
  200. package/dist/esm/chunks/chunk-LO4TPPLH.mjs +43 -0
  201. package/dist/esm/chunks/emojis-6L3GRBAP.mjs +9 -0
  202. package/dist/esm/data.mjs +18 -0
  203. package/dist/esm/index.mjs +389 -0
  204. package/dist/esm/primitives/index.mjs +67 -0
  205. package/dist/hooks/preloadEmoji.d.ts +9 -9
  206. package/dist/hooks/useActiveCategoryScrollDetection.d.ts +11 -11
  207. package/dist/hooks/useCategoryHeight.d.ts +6 -5
  208. package/dist/hooks/useCloseAllOpenToggles.d.ts +2 -2
  209. package/dist/hooks/useDataIdentityStabilityWarning.d.ts +13 -0
  210. package/dist/hooks/useDebouncedState.d.ts +1 -1
  211. package/dist/hooks/useDisallowMouseMove.d.ts +4 -4
  212. package/dist/hooks/useDisallowedEmojis.d.ts +2 -3
  213. package/dist/hooks/useEmojiPreviewEvents.d.ts +3 -3
  214. package/dist/hooks/useEmojiVirtualization.d.ts +21 -17
  215. package/dist/hooks/useFilter.d.ts +10 -16
  216. package/dist/hooks/useFocus.d.ts +3 -3
  217. package/dist/hooks/useInitialLoad.d.ts +2 -2
  218. package/dist/hooks/useIsEmojiHidden.d.ts +8 -8
  219. package/dist/hooks/useIsMounted.d.ts +1 -1
  220. package/dist/hooks/useIsSearchMode.d.ts +1 -1
  221. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
  222. package/dist/hooks/useKeyboardNavigation.d.ts +3 -1
  223. package/dist/hooks/useMouseDownHandlers.d.ts +8 -4
  224. package/dist/hooks/useOnFocus.d.ts +1 -1
  225. package/dist/hooks/useOnScroll.d.ts +2 -2
  226. package/dist/hooks/useReactionsFocus.d.ts +1 -0
  227. package/dist/hooks/useRegisterRegion.d.ts +24 -0
  228. package/dist/hooks/useResolvedEmojiData.d.ts +37 -0
  229. package/dist/hooks/useScrollCategoryIntoView.d.ts +1 -1
  230. package/dist/hooks/useSearchController.d.ts +17 -0
  231. package/dist/hooks/useSearchResults.d.ts +8 -0
  232. package/dist/hooks/useSetVariationPicker.d.ts +2 -2
  233. package/dist/hooks/useShouldHideCustomEmojis.d.ts +1 -1
  234. package/dist/hooks/useShouldShowSkinTonePicker.d.ts +4 -4
  235. package/dist/index.d.mts +376 -0
  236. package/dist/index.d.ts +376 -9
  237. package/dist/index.js +2 -8
  238. package/dist/primitives/CategoryNav.d.ts +4 -0
  239. package/dist/primitives/Empty.d.ts +6 -0
  240. package/dist/primitives/List.d.ts +4 -0
  241. package/dist/primitives/LoadError.d.ts +8 -0
  242. package/dist/primitives/Loading.d.ts +4 -0
  243. package/dist/primitives/Panel.d.ts +3 -0
  244. package/dist/primitives/Preview.d.ts +3 -0
  245. package/dist/primitives/Reactions.d.ts +2 -0
  246. package/dist/primitives/Root.d.ts +26 -0
  247. package/dist/primitives/Search.d.ts +5 -0
  248. package/dist/primitives/SearchInput.d.ts +3 -0
  249. package/dist/primitives/SkinTone.d.ts +4 -0
  250. package/dist/primitives/Viewport.d.ts +19 -0
  251. package/dist/primitives/appearance.d.ts +3 -0
  252. package/dist/primitives/components.d.ts +27 -0
  253. package/dist/primitives/hooks.d.ts +48 -0
  254. package/dist/primitives/index.d.mts +561 -0
  255. package/dist/primitives/index.d.ts +561 -0
  256. package/dist/primitives/index.js +2 -0
  257. package/dist/primitives/nativeProps.d.ts +15 -0
  258. package/dist/primitives/scope.d.ts +13 -0
  259. package/dist/primitives/structuralStyles.d.ts +16 -0
  260. package/dist/primitives/tokens.d.ts +18 -0
  261. package/dist/primitives/types.d.ts +85 -0
  262. package/dist/state/activeEmojiStore.d.ts +7 -0
  263. package/dist/state/navigationRegistry.d.ts +61 -0
  264. package/dist/state/regionTraversal.d.ts +20 -0
  265. package/dist/typeRefinements/typeRefinements.d.ts +6 -6
  266. package/dist/types/exposedTypes.d.ts +16 -6
  267. package/dist/types/exposedTypes.js +5 -0
  268. package/dist/virtualization/virtualizationHelpers.d.ts +20 -18
  269. package/llms-full.txt +3680 -0
  270. package/llms.txt +66 -476
  271. package/package.json +204 -66
  272. package/src/DomUtils/categoryNameFromDom.ts +1 -1
  273. package/src/DomUtils/classNames.ts +1 -0
  274. package/src/DomUtils/elementPositionInRow.ts +26 -4
  275. package/src/DomUtils/eventBelongsToPicker.ts +17 -0
  276. package/src/DomUtils/getActiveElement.ts +7 -1
  277. package/src/DomUtils/isJsdom.ts +12 -0
  278. package/src/DomUtils/isRtl.ts +5 -0
  279. package/src/DomUtils/keyboardNavigation.ts +105 -149
  280. package/src/DomUtils/scrollTo.ts +18 -16
  281. package/src/DomUtils/selectors.ts +20 -111
  282. package/src/EmojiPickerReact.tsx +155 -48
  283. package/src/Stylesheet/DedupedStyle.tsx +80 -0
  284. package/src/Stylesheet/stylesheet.tsx +128 -59
  285. package/src/components/Layout/Flex.tsx +12 -11
  286. package/src/components/Reactions/BtnPlus.tsx +61 -51
  287. package/src/components/Reactions/Reactions.tsx +113 -55
  288. package/src/components/atoms/Button.tsx +18 -15
  289. package/src/components/body/EmojiCategory.tsx +77 -40
  290. package/src/components/body/EmojiList.tsx +55 -23
  291. package/src/components/body/EmojiVariationPicker.tsx +113 -66
  292. package/src/components/body/MeasureEmoji.tsx +9 -2
  293. package/src/components/body/listComponents.tsx +79 -0
  294. package/src/components/context/ElementRefContext.tsx +46 -35
  295. package/src/components/context/PickerConfigContext.tsx +55 -40
  296. package/src/components/context/PickerContext.tsx +567 -92
  297. package/src/components/context/PickerDataContext.tsx +110 -99
  298. package/src/components/emoji/BaseEmojiProps.ts +5 -4
  299. package/src/components/emoji/ClickableEmojiButton.tsx +148 -63
  300. package/src/components/emoji/Emoji.tsx +24 -2
  301. package/src/components/emoji/EmojiImg.tsx +13 -12
  302. package/src/components/emoji/ExportedEmoji.tsx +5 -4
  303. package/src/components/emoji/NativeEmoji.tsx +19 -16
  304. package/src/components/emoji/ViewOnlyEmoji.tsx +55 -30
  305. package/src/components/emoji/emojiStyles.ts +12 -11
  306. package/src/components/footer/Preview.tsx +86 -91
  307. package/src/components/header/Header.tsx +21 -6
  308. package/src/components/header/Search/BtnClearSearch.tsx +69 -55
  309. package/src/components/header/Search/IcnSearch.tsx +21 -21
  310. package/src/components/header/Search/Search.tsx +77 -137
  311. package/src/components/header/SkinTonePicker/BtnSkinToneVariation.tsx +99 -62
  312. package/src/components/header/SkinTonePicker/SkinTonePicker.tsx +84 -46
  313. package/src/components/icons/svgIcons.ts +17 -0
  314. package/src/components/main/PickerMainBehaviors.tsx +163 -0
  315. package/src/components/main/defaultAppearance.tsx +188 -0
  316. package/src/components/main/labelHeight.ts +5 -0
  317. package/src/components/navigation/CategoryButton.tsx +83 -57
  318. package/src/components/navigation/CategoryNavIcon.tsx +73 -194
  319. package/src/components/navigation/CategoryNavigation.tsx +118 -46
  320. package/src/config/categoryConfig.ts +7 -3
  321. package/src/config/cdnUrls.ts +11 -21
  322. package/src/config/compareConfig.ts +128 -30
  323. package/src/config/config.ts +228 -24
  324. package/src/config/defaultPickerConfiguration.ts +7 -0
  325. package/src/config/mutableConfig.ts +44 -20
  326. package/src/config/useConfig.ts +130 -37
  327. package/src/data/defaultEmojiData.ts +49 -0
  328. package/src/data/registerDefaultEmojiData.ts +8 -0
  329. package/src/data-core/pickerData.ts +173 -0
  330. package/src/data-core/prepare.ts +178 -0
  331. package/src/data-core/search.ts +122 -0
  332. package/src/data-core/types.ts +36 -0
  333. package/src/data.ts +10 -0
  334. package/src/dataUtils/DataTypes.ts +4 -0
  335. package/src/dataUtils/emojiSelectors.ts +58 -63
  336. package/src/dataUtils/emojiUtils.ts +17 -74
  337. package/src/dataUtils/nativeEmojiSequenceSupport.ts +116 -0
  338. package/src/dataUtils/nativeEmojiSupport.ts +160 -0
  339. package/src/dataUtils/suggested.ts +8 -4
  340. package/src/dataUtils/suggestedEmojis.ts +92 -0
  341. package/src/env.d.ts +4 -0
  342. package/src/hooks/preloadEmoji.ts +3 -3
  343. package/src/hooks/useActiveCategoryScrollDetection.ts +10 -1
  344. package/src/hooks/useCategoryHeight.ts +82 -8
  345. package/src/hooks/useDataIdentityStabilityWarning.ts +86 -0
  346. package/src/hooks/useDebouncedState.ts +13 -1
  347. package/src/hooks/useDisallowedEmojis.ts +26 -42
  348. package/src/hooks/useEmojiPreviewEvents.ts +43 -10
  349. package/src/hooks/useEmojiVirtualization.tsx +38 -4
  350. package/src/hooks/useFilter.ts +85 -127
  351. package/src/hooks/useFocus.ts +14 -24
  352. package/src/hooks/useIsEmojiHidden.ts +10 -6
  353. package/src/hooks/useKeyboardNavigation.ts +322 -429
  354. package/src/hooks/useMouseDownHandlers.ts +91 -16
  355. package/src/hooks/useOnFocus.ts +12 -3
  356. package/src/hooks/useOnScroll.ts +18 -2
  357. package/src/hooks/useReactionsFocus.ts +118 -0
  358. package/src/hooks/useRegisterRegion.ts +92 -0
  359. package/src/hooks/useResolvedEmojiData.ts +200 -0
  360. package/src/hooks/useScrollCategoryIntoView.ts +74 -12
  361. package/src/hooks/useSearchController.ts +369 -0
  362. package/src/hooks/useSearchResults.ts +51 -0
  363. package/src/hooks/useSetVariationPicker.ts +4 -1
  364. package/src/index.tsx +67 -5
  365. package/src/primitives/CategoryNav.tsx +40 -0
  366. package/src/primitives/Empty.tsx +68 -0
  367. package/src/primitives/List.tsx +61 -0
  368. package/src/primitives/LoadError.tsx +38 -0
  369. package/src/primitives/Loading.tsx +60 -0
  370. package/src/primitives/Panel.tsx +47 -0
  371. package/src/primitives/Preview.tsx +38 -0
  372. package/src/primitives/Reactions.tsx +2 -0
  373. package/src/primitives/Root.tsx +398 -0
  374. package/src/primitives/Search.tsx +41 -0
  375. package/src/primitives/SearchInput.tsx +110 -0
  376. package/src/primitives/SkinTone.tsx +76 -0
  377. package/src/primitives/Viewport.tsx +204 -0
  378. package/src/primitives/appearance.tsx +7 -0
  379. package/src/primitives/components.tsx +30 -0
  380. package/src/primitives/hooks.ts +165 -0
  381. package/src/primitives/index.ts +94 -0
  382. package/src/primitives/nativeProps.ts +90 -0
  383. package/src/primitives/scope.tsx +109 -0
  384. package/src/primitives/structuralStyles.tsx +133 -0
  385. package/src/primitives/tokens.ts +149 -0
  386. package/src/primitives/types.ts +192 -0
  387. package/src/state/activeEmojiStore.ts +39 -0
  388. package/src/state/navigationRegistry.ts +209 -0
  389. package/src/state/regionTraversal.ts +116 -0
  390. package/src/svg.d.ts +2 -2
  391. package/src/types/exposedTypes.ts +28 -1
  392. package/src/virtualization/virtualizationHelpers.ts +20 -6
  393. package/dist/components/body/Body.d.ts +0 -2
  394. package/dist/components/main/PickerMain.d.ts +0 -7
  395. package/dist/dataUtils/alphaNumericEmojiIndex.d.ts +0 -5
  396. package/dist/emoji-picker-react.cjs.development.js +0 -31413
  397. package/dist/emoji-picker-react.cjs.development.js.map +0 -1
  398. package/dist/emoji-picker-react.cjs.production.min.js +0 -2
  399. package/dist/emoji-picker-react.cjs.production.min.js.map +0 -1
  400. package/dist/emoji-picker-react.esm.js +0 -31411
  401. package/dist/emoji-picker-react.esm.js.map +0 -1
  402. package/dist/hooks/useHideEmojisByUniocode.d.ts +0 -1
  403. package/src/components/body/Body.tsx +0 -43
  404. package/src/components/main/PickerMain.tsx +0 -249
  405. package/src/dataUtils/alphaNumericEmojiIndex.ts +0 -21
@@ -18,277 +18,153 @@ const COLUMNS: Record<string, number> = {
18
18
  custom: 9,
19
19
  };
20
20
 
21
- const SHAPES: Record<number, React.ReactNode> = {
21
+ // Shared paint for filled shapes.
22
+ const THIN_FILL = {
23
+ fill: 'currentColor',
24
+ strokeWidth: '0.1',
25
+ strokeMiterlimit: '10',
26
+ } as const;
27
+ const SOLID = { fill: 'currentColor', stroke: 'none' } as const;
28
+ const ROUND = { strokeLinecap: 'round' } as const;
29
+
30
+ // Pure: compositions without CategoryNav must be able to drop the icons,
31
+ // and spreading shared paint into JSX would otherwise count as a side
32
+ // effect.
33
+ const SHAPES: Record<number, React.ReactNode> = /* @__PURE__ */ (() => ({
22
34
  0: (
23
35
  <>
24
36
  <path
25
- fill="currentColor"
26
- stroke="currentColor"
27
- strokeWidth="0.1"
28
- strokeMiterlimit="10"
29
- d="M12.8,9.5c0.6,0,1.1-0.5,1.1-1.2
30
- c0-0.6-0.5-1.1-1.1-1.1c-0.6,0-1.2,0.5-1.2,1.1S12.2,9.5,12.8,9.5z M12.8,7.9c0.2,0,0.4,0.2,0.4,0.4c0,0.2-0.2,0.4-0.4,0.4
31
- c-0.2,0-0.4-0.2-0.4-0.4C12.4,8.1,12.6,7.9,12.8,7.9z"
37
+ {...THIN_FILL}
38
+ d="M12.8,9.5c.6,0,1.1-.5,1.1-1.2c0-.6-.5-1.1-1.1-1.1c-.6,0-1.2,.5-1.2,1.1S12.2,9.5,12.8,9.5zM12.8,7.9c.2,0,.4,.2,.4,.4c0,.2-.2,.4-.4,.4c-.2,0-.4-.2-.4-.4C12.4,8.1,12.6,7.9,12.8,7.9z"
32
39
  />
33
40
  <path
34
- fill="currentColor"
35
- stroke="currentColor"
36
- strokeWidth="0.1"
37
- strokeMiterlimit="10"
38
- d="M7.2,9.5c0.6,0,1.2-0.5,1.2-1.2
39
- c0-0.6-0.5-1.1-1.2-1.1c-0.6,0-1.1,0.5-1.1,1.1S6.6,9.5,7.2,9.5z M7.2,7.9c0.2,0,0.4,0.2,0.4,0.4c0,0.2-0.2,0.4-0.4,0.4
40
- C7,8.7,6.8,8.5,6.8,8.3C6.8,8.1,7,7.9,7.2,7.9z"
41
+ {...THIN_FILL}
42
+ d="M7.2,9.5c.6,0,1.2-.5,1.2-1.2c0-.6-.5-1.1-1.2-1.1c-.6,0-1.1,.5-1.1,1.1S6.6,9.5,7.2,9.5zM7.2,7.9c.2,0,.4,.2,.4,.4c0,.2-.2,.4-.4,.4C7,8.7,6.8,8.5,6.8,8.3C6.8,8.1,7,7.9,7.2,7.9z"
41
43
  />
42
44
  <path
43
- fill="currentColor"
44
- stroke="currentColor"
45
- strokeWidth="0.1"
46
- strokeMiterlimit="10"
47
- d="M14.6,11.2c-0.1-0.1-0.2-0.2-0.3-0.2H5.7
48
- c-0.1,0-0.2,0.1-0.3,0.2c-0.1,0.1-0.1,0.2,0,0.4c0.7,2,2.5,3.3,4.6,3.3s3.9-1.3,4.6-3.3C14.7,11.4,14.7,11.3,14.6,11.2z M10,14.1
49
- c-1.6,0-3-0.9-3.7-2.2h7.3C13,13.2,11.6,14.1,10,14.1z"
45
+ {...THIN_FILL}
46
+ d="M14.6,11.2c-.1-.1-.2-.2-.3-.2H5.7c-.1,0-.2,.1-.3,.2c-.1,.1-.1,.2,0,.4c.7,2,2.5,3.3,4.6,3.3s3.9-1.3,4.6-3.3C14.7,11.4,14.7,11.3,14.6,11.2zM10,14.1c-1.6,0-3-.9-3.7-2.2h7.3C13,13.2,11.6,14.1,10,14.1z"
50
47
  />
51
48
  <path
52
- fill="currentColor"
53
- stroke="currentColor"
54
- strokeWidth="0.1"
55
- strokeMiterlimit="10"
56
- d="M10,3c-3.8,0-7,3.1-7,7s3.1,7,7,7s7-3.1,7-7
57
- S13.8,3,10,3z M10,16.2c-3.4,0-6.2-2.8-6.2-6.2S6.6,3.8,10,3.8s6.2,2.8,6.2,6.2S13.4,16.2,10,16.2z"
49
+ {...THIN_FILL}
50
+ d="M10,3c-3.8,0-7,3.1-7,7s3.1,7,7,7s7-3.1,7-7S13.8,3,10,3zM10,16.2c-3.4,0-6.2-2.8-6.2-6.2S6.6,3.8,10,3.8s6.2,2.8,6.2,6.2S13.4,16.2,10,16.2z"
58
51
  />
59
52
  </>
60
53
  ),
61
54
  1: (
62
55
  <>
63
- <path
64
- fill="none"
65
- stroke="currentColor"
66
- d="M24.2,11V3.5c0.1,0.1,0.8,0.9,2.8,3.1c2.5-1.7,5.6-0.7,6.9,0l2.4-3.1v7.1
67
- c0,1.2-0.1,2.5-0.9,3.4c-1,1.2-2.7,2.5-5.3,2.5c-2.9,0-4.5-1.5-5.3-2.9C24.2,12.9,24.2,11.9,24.2,11z"
68
- />
69
- <path
70
- fill="none"
71
- stroke="currentColor"
72
- strokeLinecap="round"
73
- d="M21.2,10l5.4,1.2"
74
- />
75
- <path
76
- fill="none"
77
- stroke="currentColor"
78
- strokeLinecap="round"
79
- d="M21.2,14.1l5.4-1.2"
80
- />
81
- <path
82
- fill="none"
83
- stroke="currentColor"
84
- strokeLinecap="round"
85
- d="M38.8,10l-5.4,1.2"
86
- />
87
- <path
88
- fill="none"
89
- stroke="currentColor"
90
- strokeLinecap="round"
91
- d="M38.8,14.1l-5.4-1.2"
92
- />
56
+ <path d="M24.2,11V3.5c.1,.1,.8,.9,2.8,3.1c2.5-1.7,5.6-.7,6.9,0l2.4-3.1v7.1c0,1.2-.1,2.5-.9,3.4c-1,1.2-2.7,2.5-5.3,2.5c-2.9,0-4.5-1.5-5.3-2.9C24.2,12.9,24.2,11.9,24.2,11z" />
57
+ <path {...ROUND} d="M21.2,10l5.4,1.2" />
58
+ <path {...ROUND} d="M21.2,14.1l5.4-1.2" />
59
+ <path {...ROUND} d="M38.8,10l-5.4,1.2" />
60
+ <path {...ROUND} d="M38.8,14.1l-5.4-1.2" />
93
61
  <path
94
62
  fillRule="evenodd"
95
63
  clipRule="evenodd"
96
64
  fill="currentColor"
97
- d="M29.5,12.4L29,11.7c-0.2-0.3,0-0.6,0.3-0.6h1.4
98
- c0.3,0,0.5,0.4,0.3,0.6l-0.7,1l0,0c-0.7,1.2-2.6,1.1-3.1-0.3l-0.1-0.2c-0.1-0.2,0-0.4,0.2-0.5s0.4,0,0.5,0.2l0.1,0.2
99
- C28.3,12.7,29.1,12.9,29.5,12.4z"
100
- />
101
- <path
102
- fill="none"
103
- stroke="currentColor"
104
- strokeLinecap="round"
105
- d="M32.4,12.1l-0.1,0.2c-0.4,1-1.8,1.1-2.3,0.2"
65
+ stroke="none"
66
+ d="M29.5,12.4L29,11.7c-.2-.3,0-.6,.3-.6h1.4c.3,0,.5,.4,.3,.6l-.7,1l0,0c-.7,1.2-2.6,1.1-3.1-.3l-.1-.2c-.1-.2,0-.4,.2-.5s.4,0,.5,.2l.1,.2C28.3,12.7,29.1,12.9,29.5,12.4z"
106
67
  />
107
- <ellipse fill="currentColor" cx="27.6" cy="9.7" rx="0.7" ry="0.7" />
108
- <ellipse fill="currentColor" cx="32.4" cy="9.7" rx="0.7" ry="0.7" />
68
+ <path {...ROUND} d="M32.4,12.1l-.1,.2c-.4,1-1.8,1.1-2.3,.2" />
69
+ <circle {...SOLID} cx="27.6" cy="9.7" r="0.7" />
70
+ <circle {...SOLID} cx="32.4" cy="9.7" r="0.7" />
109
71
  </>
110
72
  ),
111
73
  2: (
112
74
  <>
75
+ <path d="M48.1,3.5h3.7c2.5,0,4.5,2,4.5,4.5c0,.5-.4,.9-.9,.9H44.5c-.5,0-.9-.4-.9-.9C43.6,5.5,45.6,3.5,48.1,3.5z" />
113
76
  <path
114
- fill="none"
115
- stroke="currentColor"
116
- d="M48.1,3.5h3.7c2.5,0,4.5,2,4.5,4.5c0,0.5-0.4,0.9-0.9,0.9H44.5c-0.5,0-0.9-0.4-0.9-0.9
117
- C43.6,5.5,45.6,3.5,48.1,3.5z"
77
+ {...ROUND}
78
+ d="M43.5,8.7c-.2,.1-.5,1.2,0,1.5c1.4,.9,8.5,.8,11.3,.6c.8-.1,1.6-.4,1.7-1.2c0-.3-.1-.6-.6-.9"
118
79
  />
119
80
  <path
120
- fill="none"
121
- stroke="currentColor"
122
- strokeLinecap="round"
123
- d="M43.5,8.7c-0.2,0.1-0.5,1.2,0,1.5c1.4,0.9,8.5,0.8,11.3,0.6
124
- c0.8-0.1,1.6-0.4,1.7-1.2c0-0.3-0.1-0.6-0.6-0.9"
81
+ {...ROUND}
82
+ d="M43.5,10.6L43.3,11c-.2,.5,.2,1,.7,.9c.3-.1,.5,.1,.7,.3l.1,.2c.3,.5,1,.6,1.5,.2l0,0c.3-.2,.7-.3,1-.2l.8,.3c.4,.1,.8,.1,1.2,0l.5-.2c.4-.2,.9-.2,1.3,0l.5,.2c.4,.2,.8,.1,1.2-.1l.2-.1c.3-.2,.8-.1,1.1,.1l.2,.2c.3,.3,.8,.2,1-.2l.1-.2c.1-.2,0-.3,.2-.4c.5,0,1.2-.3,1.1-.7l-.4-1.1"
125
83
  />
126
84
  <path
127
- fill="none"
128
- stroke="currentColor"
129
- strokeLinecap="round"
130
- d="M43.5,10.6L43.3,11c-0.2,0.5,0.2,1,0.7,0.9
131
- c0.3-0.1,0.5,0.1,0.7,0.3l0.1,0.2c0.3,0.5,1,0.6,1.5,0.2l0,0c0.3-0.2,0.7-0.3,1-0.2l0.8,0.3c0.4,0.1,0.8,0.1,1.2,0l0.5-0.2
132
- c0.4-0.2,0.9-0.2,1.3,0l0.5,0.2c0.4,0.2,0.8,0.1,1.2-0.1l0.2-0.1c0.3-0.2,0.8-0.1,1.1,0.1l0.2,0.2c0.3,0.3,0.8,0.2,1-0.2l0.1-0.2
133
- c0.1-0.2,0-0.3,0.2-0.4c0.5,0,1.2-0.3,1.1-0.7l-0.4-1.1"
85
+ {...ROUND}
86
+ d="M43.5,12.1c-.1,.2-.3,.8,0,1.1c.3,.4,3,1.1,6.4,1.1c2.2,0,4.6-.3,6-.6c.5-.1,.9-.4,.8-.9c0-.2-.2-.5-.4-.7"
134
87
  />
135
88
  <path
136
- fill="none"
137
- stroke="currentColor"
138
- strokeLinecap="round"
139
- d="M43.5,12.1c-0.1,0.2-0.3,0.8,0,1.1c0.3,0.4,3,1.1,6.4,1.1
140
- c2.2,0,4.6-0.3,6-0.6c0.5-0.1,0.9-0.4,0.8-0.9c0-0.2-0.2-0.5-0.4-0.7"
89
+ {...ROUND}
90
+ d="M43.5,13.3c0,.5,.6,2.4,1.3,2.6c1.8,.8,5.7,.7,8.1,.5c1.3-.1,2.5-.7,3.2-1.8c.3-.5,.5-1,.5-1.4"
141
91
  />
142
- <path
143
- fill="none"
144
- stroke="currentColor"
145
- strokeLinecap="round"
146
- d="M43.5,13.3c0,0.5,0.6,2.4,1.3,2.6c1.8,0.8,5.7,0.7,8.1,0.5
147
- c1.3-0.1,2.5-0.7,3.2-1.8c0.3-0.5,0.5-1,0.5-1.4"
148
- />
149
- <ellipse fill="currentColor" cx="51.6" cy="6.5" rx="0.3" ry="0.4" />
150
- <ellipse fill="currentColor" cx="53" cy="4.9" rx="0.3" ry="0.4" />
151
- <ellipse fill="currentColor" cx="53" cy="7.2" rx="0.3" ry="0.4" />
152
- <ellipse fill="currentColor" cx="54.3" cy="6.5" rx="0.3" ry="0.4" />
153
- <ellipse fill="currentColor" cx="50.9" cy="4.9" rx="0.3" ry="0.4" />
92
+ <ellipse {...SOLID} cx="51.6" cy="6.5" rx="0.3" ry="0.4" />
93
+ <ellipse {...SOLID} cx="53" cy="4.9" rx="0.3" ry="0.4" />
94
+ <ellipse {...SOLID} cx="53" cy="7.2" rx="0.3" ry="0.4" />
95
+ <ellipse {...SOLID} cx="54.3" cy="6.5" rx="0.3" ry="0.4" />
96
+ <ellipse {...SOLID} cx="50.9" cy="4.9" rx="0.3" ry="0.4" />
154
97
  </>
155
98
  ),
156
99
  3: (
157
100
  <>
158
- <path
159
- fill="none"
160
- stroke="currentColor"
161
- d="M64.1,13.4l2.3,0c0.2,0,0.4,0.2,0.4,0.4v2.1c0,0.2-0.2,0.4-0.4,0.4h-2.3
162
- c-0.2,0-0.4-0.2-0.4-0.4v-2.1C63.7,13.6,63.8,13.4,64.1,13.4z"
163
- />
164
- <path
165
- fill="none"
166
- stroke="currentColor"
167
- d="M73.5,13.4h2.4c0.2,0,0.4,0.2,0.4,0.4v2.1c0,0.2-0.2,0.4-0.4,0.4h-2.4
168
- c-0.2,0-0.4-0.2-0.4-0.4l0-2.1C73.1,13.6,73.3,13.4,73.5,13.4z"
169
- />
101
+ <path d="M64.1,13.4l2.3,0c.2,0,.4,.2,.4,.4v2.1c0,.2-.2,.4-.4,.4h-2.3c-.2,0-.4-.2-.4-.4v-2.1C63.7,13.6,63.8,13.4,64.1,13.4z" />
102
+ <path d="M73.5,13.4h2.4c.2,0,.4,.2,.4,.4v2.1c0,.2-.2,.4-.4,.4h-2.4c-.2,0-.4-.2-.4-.4l0-2.1C73.1,13.6,73.3,13.4,73.5,13.4z" />
170
103
  <path fill="none" stroke="currentColor" d="M63.7,8.4h12.6v5H63.7V8.4z" />
171
- <path
172
- fill="none"
173
- stroke="currentColor"
174
- d="M65.5,3.6h8.9c1,0,1.9,0.8,1.9,1.9v3.1H63.7V5.5C63.7,4.4,64.5,3.6,65.5,3.6z"
175
- />
176
- <ellipse fill="currentColor" cx="66.2" cy="10.9" rx="0.9" ry="0.9" />
177
- <ellipse fill="currentColor" cx="73.8" cy="10.9" rx="0.9" ry="0.9" />
104
+ <path d="M65.5,3.6h8.9c1,0,1.9,.8,1.9,1.9v3.1H63.7V5.5C63.7,4.4,64.5,3.6,65.5,3.6z" />
105
+ <circle {...SOLID} cx="66.2" cy="10.9" r="0.9" />
106
+ <circle {...SOLID} cx="73.8" cy="10.9" r="0.9" />
178
107
  </>
179
108
  ),
180
109
  4: (
181
110
  <>
182
- <path
183
- fill="none"
184
- stroke="currentColor"
185
- d="M96.4,10c0,3.6-2.9,6.5-6.4,6.5s-6.4-2.9-6.4-6.5s2.9-6.5,6.4-6.5S96.4,6.4,96.4,10z"
186
- />
187
- <path
188
- fill="none"
189
- stroke="currentColor"
190
- d="M96.3,8.6c0,0,0,0.1,0,0.1c-0.9,0.1-2.9,0.1-4.6-1.2c-1.1-0.8-2-1.7-2.6-2.5
191
- c-0.3-0.4-0.6-0.8-0.7-1.1c-0.1-0.1-0.1-0.2-0.1-0.2c0.5-0.1,1.2-0.2,2-0.2c1.2,0,2.5,0.3,3.5,1.1c1,0.8,1.7,1.8,2.1,2.8
192
- C96.1,7.9,96.2,8.3,96.3,8.6z"
193
- />
194
- <path
195
- fill="none"
196
- stroke="currentColor"
197
- d="M84,12.1c0,0,0-0.1,0-0.1c0.9-0.2,2.9-0.4,4.7,0.6c1.1,0.6,1.9,1.5,2.4,2.3
198
- c0.4,0.5,0.6,1,0.7,1.3c-0.4,0.1-1,0.2-1.7,0.3c-1,0-2.1-0.1-3.2-0.8c-1.1-0.6-1.9-1.6-2.4-2.5C84.2,12.8,84.1,12.4,84,12.1z"
199
- />
111
+ <path d="M96.4,10c0,3.6-2.9,6.5-6.4,6.5s-6.4-2.9-6.4-6.5s2.9-6.5,6.4-6.5S96.4,6.4,96.4,10z" />
112
+ <path d="M96.3,8.6c0,0,0,.1,0,.1c-.9,.1-2.9,.1-4.6-1.2c-1.1-.8-2-1.7-2.6-2.5c-.3-.4-.6-.8-.7-1.1c-.1-.1-.1-.2-.1-.2c.5-.1,1.2-.2,2-.2c1.2,0,2.5,.3,3.5,1.1c1,.8,1.7,1.8,2.1,2.8C96.1,7.9,96.2,8.3,96.3,8.6z" />
113
+ <path d="M84,12.1c0,0,0-.1,0-.1c.9-.2,2.9-.4,4.7,.6c1.1,.6,1.9,1.5,2.4,2.3c.4,.5,.6,1,.7,1.3c-.4,.1-1,.2-1.7,.3c-1,0-2.1-.1-3.2-.8c-1.1-.6-1.9-1.6-2.4-2.5C84.2,12.8,84.1,12.4,84,12.1z" />
200
114
  </>
201
115
  ),
202
116
  5: (
203
117
  <>
204
118
  <path
205
- fill="none"
206
- stroke="currentColor"
207
- strokeLinecap="round"
208
- d="M116.3,6.8l-1.4,2L114.1,8l-0.6-0.7l0,0.9l-0.1,8.2h-6.8l-0.1-8.2
209
- l0-0.9L105.9,8l-0.8,0.8l-1.4-2l2.6-2.9c0.1-0.1,0.2-0.1,0.3-0.1h1.3l0.4,0.7c0.7,1.3,2.6,1.3,3.3-0.1l0.3-0.6h1.2
210
- c0.1,0,0.2,0,0.3,0.1l0.3-0.3l-0.3,0.3L116.3,6.8z"
211
- />
212
- <path
213
- fill="none"
214
- stroke="currentColor"
215
- d="M110.1,7.7h2v0.9c0,0.4-0.4,0.7-1,0.7c-0.6,0-1-0.3-1-0.7L110.1,7.7L110.1,7.7z"
119
+ {...ROUND}
120
+ d="M116.3,6.8l-1.4,2L114.1,8l-.6-.7l0,.9l-.1,8.2h-6.8l-.1-8.2l0-.9L105.9,8l-.8,.8l-1.4-2l2.6-2.9c.1-.1,.2-.1,.3-.1h1.3l.4,.7c.7,1.3,2.6,1.3,3.3-.1l.3-.6h1.2c.1,0,.2,0,.3,.1l.3-.3l-.3,.3L116.3,6.8z"
216
121
  />
122
+ <path d="M110.1,7.7h2v.9c0,.4-.4,.7-1,.7c-.6,0-1-.3-1-.7L110.1,7.7L110.1,7.7z" />
217
123
  </>
218
124
  ),
219
125
  6: (
220
126
  <>
221
- <path
222
- fill="none"
223
- stroke="currentColor"
224
- d="M126.8,14.3c0,1.2-1,2.2-2.2,2.2s-2.2-1-2.2-2.2s1-2.2,2.2-2.2S126.8,13.1,126.8,14.3z"
225
- />
226
- <path
227
- fill="none"
228
- stroke="currentColor"
229
- d="M137.6,14.3c0,1.2-1,2.2-2.2,2.2c-1.2,0-2.2-1-2.2-2.2s1-2.2,2.2-2.2
230
- C136.6,12.1,137.6,13.1,137.6,14.3z"
231
- />
127
+ <path d="M126.8,14.3c0,1.2-1,2.2-2.2,2.2s-2.2-1-2.2-2.2s1-2.2,2.2-2.2S126.8,13.1,126.8,14.3z" />
128
+ <path d="M137.6,14.3c0,1.2-1,2.2-2.2,2.2c-1.2,0-2.2-1-2.2-2.2s1-2.2,2.2-2.2C136.6,12.1,137.6,13.1,137.6,14.3z" />
232
129
  <path fill="none" stroke="currentColor" d="M126.8,4.4v9.9" />
233
130
  <path fill="none" stroke="currentColor" d="M137.7,4.4v9.9" />
234
- <path
235
- fill="none"
236
- stroke="currentColor"
237
- d="M126.8,3.5h10.8v2.7h-10.8C126.8,6.2,126.8,3.5,126.8,3.5z"
238
- />
131
+ <path d="M126.8,3.5h10.8v2.7h-10.8C126.8,6.2,126.8,3.5,126.8,3.5z" />
239
132
  </>
240
133
  ),
241
134
  7: (
242
135
  <>
243
136
  <path
244
137
  fill="currentColor"
245
- stroke="currentColor"
246
138
  strokeWidth="0.25"
247
139
  strokeMiterlimit="10"
248
- d="M156,4.3c-0.2-0.1-0.4-0.1-0.5,0
249
- c0,0-0.2,0.1-0.9,0.1c-0.7,0-2.4-0.1-3.8-0.6c-0.8-0.3-1.7-0.5-2.5-0.5c-0.2,0-0.4,0-0.5,0c-1.3,0-2.5,0.3-3.6,1
250
- c-0.2,0.1-0.2,0.2-0.2,0.4v11.6c0,0.3,0.1,0.5,0.3,0.5c0.6,0,0.5-0.4,0.5-0.6v-5.7c0.7-0.3,3.2-1.1,5.8-0.1c1.6,0.6,3.5,0.7,4.3,0.7
251
- c0.8,0,1.3-0.3,1.3-0.3c0.2-0.1,0.3-0.2,0.3-0.4V4.7C156.2,4.5,156.1,4.4,156,4.3z M155.6,10.2c-0.1,0-0.7,0.1-1,0.1
252
- c-0.7,0-2.4-0.1-3.8-0.6c-2.5-1-5-0.5-6.2-0.1V4.7c0.9-0.5,2.2-0.7,3.2-0.7c0.1,0,0.3,0,0.4,0c0.7,0,1.5,0.2,2.2,0.4
253
- c1.6,0.6,3.5,0.7,4.3,0.7c0.2,0,0.8,0,1-0.1V10.2z"
140
+ d="M156,4.3c-.2-.1-.4-.1-.5,0c0,0-.2,.1-.9,.1c-.7,0-2.4-.1-3.8-.6c-.8-.3-1.7-.5-2.5-.5c-.2,0-.4,0-.5,0c-1.3,0-2.5,.3-3.6,1c-.2,.1-.2,.2-.2,.4v11.6c0,.3,.1,.5,.3,.5c.6,0,.5-.4,.5-.6v-5.7c.7-.3,3.2-1.1,5.8-.1c1.6,.6,3.5,.7,4.3,.7c.8,0,1.3-.3,1.3-.3c.2-.1,.3-.2,.3-.4V4.7C156.2,4.5,156.1,4.4,156,4.3zM155.6,10.2c-.1,0-.7,.1-1,.1c-.7,0-2.4-.1-3.8-.6c-2.5-1-5-.5-6.2-.1V4.7c.9-.5,2.2-.7,3.2-.7c.1,0,.3,0,.4,0c.7,0,1.5,.2,2.2,.4c1.6,.6,3.5,.7,4.3,.7c.2,0,.8,0,1-.1V10.2z"
254
141
  />
255
142
  </>
256
143
  ),
257
144
  8: (
258
145
  <>
259
146
  <path
260
- fill="currentColor"
261
- d="M170.8,3.1L170.8,3.1c-0.3,0-0.5,0-0.8,0c-2.1,0-4,1-5.3,2.5l-0.1,0l-0.1-0.1l-1-1.2l-0.3,3.4l3.4,0.3
262
- l-1.1-1.3l-0.1-0.1l0.1-0.1c1.1-1.4,3-2.3,5-2.1l0,0c3.2,0.3,5.5,3.1,5.2,6.3c-0.3,3-3.1,5.3-6.1,5.1c-3.1-0.2-5.4-2.9-5.3-6
263
- L163,9.5c-0.2,3.8,2.6,7.1,6.3,7.4c3.9,0.4,7.3-2.6,7.6-6.5C177.2,6.8,174.4,3.5,170.8,3.1z"
147
+ {...SOLID}
148
+ d="M170.8,3.1L170.8,3.1c-.3,0-.5,0-.8,0c-2.1,0-4,1-5.3,2.5l-.1,0l-.1-.1l-1-1.2l-.3,3.4l3.4,.3l-1.1-1.3l-.1-.1l.1-.1c1.1-1.4,3-2.3,5-2.1l0,0c3.2,.3,5.5,3.1,5.2,6.3c-.3,3-3.1,5.3-6.1,5.1c-3.1-.2-5.4-2.9-5.3-6L163,9.5c-.2,3.8,2.6,7.1,6.3,7.4c3.9,.4,7.3-2.6,7.6-6.5C177.2,6.8,174.4,3.5,170.8,3.1z"
264
149
  />
265
150
  <path
266
- fill="currentColor"
267
- d="M170.3,7.4c0-0.3-0.3-0.6-0.6-0.6S169,7.1,169,7.4v3.2c0,0.2,0.1,0.3,0.2,0.4c0.1,0.1,0.3,0.2,0.4,0.2
268
- h2.4c0.4,0,0.6-0.3,0.6-0.6s-0.3-0.6-0.6-0.6h-1.6h-0.2V9.8L170.3,7.4L170.3,7.4z"
151
+ {...SOLID}
152
+ d="M170.3,7.4c0-.3-.3-.6-.6-.6S169,7.1,169,7.4v3.2c0,.2,.1,.3,.2,.4c.1,.1,.3,.2,.4,.2h2.4c.4,0,.6-.3,.6-.6s-.3-.6-.6-.6h-1.6h-.2V9.8L170.3,7.4L170.3,7.4z"
269
153
  />
270
154
  </>
271
155
  ),
272
156
  9: (
273
157
  <>
158
+ <path d="M186.2,3.4h7.7c1.5,0,2.7,1.2,2.7,2.7v7.7c0,1.5-1.2,2.7-2.7,2.7h-7.7c-1.5,0-2.7-1.2-2.7-2.7V6.1C183.4,4.6,184.7,3.4,186.2,3.4z" />
159
+ <circle {...SOLID} cx="186" cy="8.9" r="0.7" />
160
+ <circle {...SOLID} cx="194" cy="6.7" r="0.7" />
274
161
  <path
275
- fill="none"
276
- stroke="currentColor"
277
- d="M186.2,3.4h7.7c1.5,0,2.7,1.2,2.7,2.7v7.7c0,1.5-1.2,2.7-2.7,2.7h-7.7
278
- c-1.5,0-2.7-1.2-2.7-2.7V6.1C183.4,4.6,184.7,3.4,186.2,3.4z"
279
- />
280
- <ellipse fill="currentColor" cx="186" cy="8.9" rx="0.7" ry="0.7" />
281
- <ellipse fill="currentColor" cx="194" cy="6.7" rx="0.7" ry="0.7" />
282
- <path
283
- fill="none"
284
- stroke="currentColor"
285
- strokeLinecap="round"
286
- d="M186,13.3l0.4-0.3c0.4-0.3,1-0.3,1.5-0.1l1,0.4
287
- c0.5,0.2,1,0.2,1.5-0.1l0.8-0.5c0.4-0.3,1-0.3,1.5-0.1l1.8,0.8"
162
+ {...ROUND}
163
+ d="M186,13.3l.4-.3c.4-.3,1-.3,1.5-.1l1,.4c.5,.2,1,.2,1.5-.1l.8-.5c.4-.3,1-.3,1.5-.1l1.8,.8"
288
164
  />
289
165
  </>
290
166
  ),
291
- };
167
+ }))();
292
168
 
293
169
  export function CategoryNavIcon({ category }: { category: string }) {
294
170
  const column = COLUMNS[category] ?? 0;
@@ -297,6 +173,9 @@ export function CategoryNavIcon({ category }: { category: string }) {
297
173
  viewBox={`${column * 20} 0 20 20`}
298
174
  width="100%"
299
175
  height="100%"
176
+ // Shared paint, inherited by every shape; filled shapes override.
177
+ fill="none"
178
+ stroke="currentColor"
300
179
  // Absolutely positioned over the button's padding box, matching the
301
180
  // geometry of the former background-image sprite. Percentage sizes
302
181
  // alone would resolve against the smaller content box (the button
@@ -9,42 +9,77 @@ import {
9
9
  customGroupFromCategoryConfig,
10
10
  } from '../../config/categoryConfig';
11
11
  import {
12
+ useLabels,
12
13
  useCategoriesConfig,
13
14
  useCategoryIconsConfig,
14
15
  } from '../../config/useConfig';
15
- import { useActiveCategoryScrollDetection } from '../../hooks/useActiveCategoryScrollDetection';
16
16
  import useIsSearchMode from '../../hooks/useIsSearchMode';
17
+ import { useRegisterRegion } from '../../hooks/useRegisterRegion';
17
18
  import { useScrollCategoryIntoView } from '../../hooks/useScrollCategoryIntoView';
18
19
  import { useShouldHideCustomEmojis } from '../../hooks/useShouldHideCustomEmojis';
20
+ import { useDefaultAppearance } from '../../primitives/appearance';
19
21
  import { isCustomCategory } from '../../typeRefinements/typeRefinements';
20
22
  import { Categories } from '../../types/exposedTypes';
21
23
  import { useCategoryNavigationRef } from '../context/ElementRefContext';
22
- import { useVisibleCategoriesState } from '../context/PickerContext';
23
24
  import { usePickerDataContext } from '../context/PickerDataContext';
24
25
 
25
26
  import { CategoryButton } from './CategoryButton';
26
27
 
27
- export function CategoryNavigation() {
28
+ // Active category state lives with the scroll container (Viewport), which
29
+ // owns section observation. The tablist only highlights and scrolls.
30
+ // Keeping observation in the tablist would stop section tracking whenever
31
+ // the bar unmounts (single tab) or is omitted from a composition.
32
+ const ActiveCategoryContext = /* @__PURE__ */ React.createContext<{
33
+ activeCategory: string | null;
34
+ setActiveCategory: (category: string | null) => void;
35
+ }>({
36
+ activeCategory: null,
37
+ setActiveCategory: () => {},
38
+ });
39
+
40
+ export function ActiveCategoryProvider({
41
+ children,
42
+ }: {
43
+ children: React.ReactNode;
44
+ }) {
28
45
  const [activeCategory, setActiveCategory] = useState<string | null>(null);
29
- const [, setVisibleCategories] = useVisibleCategoriesState();
46
+ const value = React.useMemo(
47
+ () => ({ activeCategory, setActiveCategory }),
48
+ [activeCategory],
49
+ );
50
+ return (
51
+ <ActiveCategoryContext.Provider value={value}>
52
+ {children}
53
+ </ActiveCategoryContext.Provider>
54
+ );
55
+ }
56
+
57
+ export function useActiveCategory() {
58
+ return React.useContext(ActiveCategoryContext);
59
+ }
60
+
61
+ /**
62
+ * Scroll a section to the top and highlight its tab. The highlight is set
63
+ * explicitly: trailing sections too short to reach the viewport top would
64
+ * otherwise leave an earlier section active.
65
+ */
66
+ export function useJumpToCategory(): (categoryId: string) => void {
67
+ const { setActiveCategory } = useActiveCategory();
30
68
  const scrollCategoryIntoView = useScrollCategoryIntoView();
31
- const isSearchMode = useIsSearchMode();
69
+ return (categoryId) => {
70
+ scrollCategoryIntoView(categoryId);
71
+ setTimeout(() => {
72
+ setActiveCategory(categoryId);
73
+ }, 10);
74
+ };
75
+ }
32
76
 
77
+ export function useVisibleCategoryConfigs() {
33
78
  const categoriesConfig = useCategoriesConfig();
34
- const categoryIcons = useCategoryIconsConfig();
35
- const CategoryNavigationRef = useCategoryNavigationRef();
36
79
  const hideCustomCategory = useShouldHideCustomEmojis();
37
80
  const { customGroups, emojiData } = usePickerDataContext();
38
81
 
39
- // The observer re-subscribes when the merged categories reference
40
- // changes (sections added/removed); the reference is stable otherwise.
41
- useActiveCategoryScrollDetection({
42
- setActiveCategory,
43
- setVisibleCategories,
44
- categories: categoriesConfig,
45
- });
46
-
47
- const visibleCategories = categoriesConfig.filter(categoryConfig => {
82
+ return categoriesConfig.filter((categoryConfig) => {
48
83
  if (isCustomCategory(categoryConfig) && hideCustomCategory) {
49
84
  return false;
50
85
  }
@@ -58,6 +93,31 @@ export function CategoryNavigation() {
58
93
  }
59
94
  return true;
60
95
  });
96
+ }
97
+
98
+ export type NavOrientation = 'horizontal' | 'vertical';
99
+
100
+ export function CategoryNavigation({
101
+ orientation = 'horizontal',
102
+ }: {
103
+ orientation?: NavOrientation;
104
+ } = {}) {
105
+ const appearance = useDefaultAppearance();
106
+ const { activeCategory } = useActiveCategory();
107
+ const jumpToCategory = useJumpToCategory();
108
+ const isSearchMode = useIsSearchMode();
109
+
110
+ const categoryIcons = useCategoryIconsConfig();
111
+ const CategoryNavigationRef = useCategoryNavigationRef();
112
+ const labels = useLabels();
113
+
114
+ const visibleCategories = useVisibleCategoryConfigs();
115
+
116
+ // Registered before the single-tab early return so the tab bar leaves
117
+ // the navigation graph when it unmounts.
118
+ useRegisterRegion('categories', CategoryNavigationRef, [
119
+ visibleCategories.length,
120
+ ]);
61
121
 
62
122
  // A single tab navigates nowhere — hide the bar to reclaim its space.
63
123
  // https://github.com/ealush/emoji-picker-react/issues/396
@@ -67,13 +127,18 @@ export function CategoryNavigation() {
67
127
 
68
128
  return (
69
129
  <div
70
- className={cx(styles.nav)}
130
+ className={cx(
131
+ styles.nav,
132
+ appearance && styles.appearance,
133
+ orientation === 'vertical' && styles.vertical,
134
+ )}
71
135
  role="tablist"
72
- aria-label="Category navigation"
73
- id="epr-category-nav-id"
136
+ aria-label={labels.categoryNavigation}
137
+ // Read by the keyboard handler: arrow keys follow the tab axis.
138
+ aria-orientation={orientation}
74
139
  ref={CategoryNavigationRef}
75
140
  >
76
- {visibleCategories.map(categoryConfig => {
141
+ {visibleCategories.map((categoryConfig) => {
77
142
  const category = categoryFromCategoryConfig(categoryConfig);
78
143
  const categoryId = categoryIdFromCategoryConfig(categoryConfig);
79
144
  const isActiveCategory = categoryId === activeCategory;
@@ -88,12 +153,7 @@ export function CategoryNavigation() {
88
153
  allowNavigation={allowNavigation}
89
154
  categoryConfig={categoryConfig}
90
155
  customIcon={categoryIcons[category as Categories]}
91
- onClick={() => {
92
- scrollCategoryIntoView(categoryId);
93
- setTimeout(() => {
94
- setActiveCategory(categoryId);
95
- }, 10);
96
- }}
156
+ onClick={() => jumpToCategory(categoryId)}
97
157
  />
98
158
  );
99
159
  })}
@@ -101,26 +161,38 @@ export function CategoryNavigation() {
101
161
  );
102
162
  }
103
163
 
104
- const styles = stylesheet.create({
105
- nav: {
106
- '.': 'epr-category-nav',
107
- display: 'flex',
108
- flexDirection: 'row',
109
- justifyContent: 'space-around',
110
- padding: 'var(--epr-header-padding)',
111
- },
112
- '.epr-search-active': {
164
+ const styles = /* @__PURE__ */ (() =>
165
+ stylesheet.create({
113
166
  nav: {
114
- opacity: '0.3',
115
- cursor: 'default',
116
- pointerEvents: 'none',
167
+ '.': 'epr-category-nav',
168
+ display: 'flex',
169
+ flexDirection: 'row',
170
+ justifyContent: 'space-around',
171
+ padding: 'var(--epr-header-padding)',
117
172
  },
118
- },
119
- '.epr-main:has(input:not(:placeholder-shown))': {
120
- nav: {
121
- opacity: '0.3',
122
- cursor: 'default',
123
- pointerEvents: 'none',
173
+ vertical: {
174
+ '.': 'epr-category-nav-vertical',
175
+ flexDirection: 'column',
176
+ justifyContent: 'flex-start',
177
+ alignItems: 'center',
178
+ gap: 'var(--epr-horizontal-padding)',
179
+ padding: 'var(--epr-horizontal-padding) 0',
124
180
  },
125
- },
126
- });
181
+ appearance: { '.': 'epr-category-nav-appearance' },
182
+ '.epr-search-active': {
183
+ nav: { pointerEvents: 'none' },
184
+ appearance: {
185
+ opacity: '0.3',
186
+ cursor: 'default',
187
+ pointerEvents: 'none',
188
+ },
189
+ },
190
+ '.epr-structural-root:has(input:not(:placeholder-shown))': {
191
+ nav: { pointerEvents: 'none' },
192
+ appearance: {
193
+ opacity: '0.3',
194
+ cursor: 'default',
195
+ pointerEvents: 'none',
196
+ },
197
+ },
198
+ }))();
@@ -3,6 +3,7 @@ import {
3
3
  CategoryConfig,
4
4
  EmojiData,
5
5
  SuggestionMode,
6
+ SuggestionModeValue,
6
7
  } from '../types/exposedTypes';
7
8
 
8
9
  import { CustomEmoji } from './customEmojiConfig';
@@ -232,13 +233,16 @@ export function mergeCategoriesConfig(
232
233
  }
233
234
  }
234
235
 
236
+ // A fresh object every time: the module-level defaults are shared by every
237
+ // picker in the page, so merging into them would make one picker's
238
+ // localized or "Recently Used" names leak into the next.
235
239
  function getBaseConfigByCategory(
236
240
  category: Categories,
237
241
  modifier: CategoryConfig = {} as CategoryConfig,
238
- ) {
239
- return Object.assign(configByCategory[category], modifier);
242
+ ): CategoryConfig {
243
+ return { ...configByCategory[category], ...modifier };
240
244
  }
241
245
 
242
246
  type CategoryConfigModifiers = {
243
- suggestionMode?: SuggestionMode;
247
+ suggestionMode?: SuggestionModeValue;
244
248
  };
@@ -1,24 +1,14 @@
1
- import { EmojiStyle } from '../types/exposedTypes';
1
+ import { EmojiStyle, EmojiStyleValue } from '../types/exposedTypes';
2
2
 
3
- const CDN_URL_APPLE =
4
- 'https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/';
5
- const CDN_URL_FACEBOOK =
6
- 'https://cdn.jsdelivr.net/npm/emoji-datasource-facebook/img/facebook/64/';
7
- const CDN_URL_TWITTER =
8
- 'https://cdn.jsdelivr.net/npm/emoji-datasource-twitter/img/twitter/64/';
9
- const CDN_URL_GOOGLE =
10
- 'https://cdn.jsdelivr.net/npm/emoji-datasource-google/img/google/64/';
3
+ const CDN_SETS: ReadonlyArray<string> = [
4
+ EmojiStyle.TWITTER,
5
+ EmojiStyle.GOOGLE,
6
+ EmojiStyle.FACEBOOK,
7
+ ];
11
8
 
12
- export function cdnUrl(emojiStyle: EmojiStyle): string {
13
- switch (emojiStyle) {
14
- case EmojiStyle.TWITTER:
15
- return CDN_URL_TWITTER;
16
- case EmojiStyle.GOOGLE:
17
- return CDN_URL_GOOGLE;
18
- case EmojiStyle.FACEBOOK:
19
- return CDN_URL_FACEBOOK;
20
- case EmojiStyle.APPLE:
21
- default:
22
- return CDN_URL_APPLE;
23
- }
9
+ // emoji-datasource publishes one package per image set; native and
10
+ // unknown styles use Apple's.
11
+ export function cdnUrl(emojiStyle: EmojiStyleValue): string {
12
+ const set = CDN_SETS.includes(emojiStyle) ? emojiStyle : EmojiStyle.APPLE;
13
+ return `https://cdn.jsdelivr.net/npm/emoji-datasource-${set}/img/${set}/64/`;
24
14
  }