emoji-picker-react 4.22.3 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/README.md +331 -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 -480
  271. package/package.json +180 -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
package/llms.txt CHANGED
@@ -1,489 +1,75 @@
1
- # emoji-picker-react — LLM context
1
+ # emoji-picker-react
2
2
 
3
- > This file is auto-generated by `npm run docs:llms`. Do not edit by hand.
4
- > Sources: README.md, PROPS.md, CUSTOMIZATION.md, INTERNATIONALIZATION.md, CSS_VARIABLES.md
3
+ > Emoji picker for React: batteries included with `<EmojiPicker />`, or BYOD (bring your own design, design language and design library) with `unstyled` and `emoji-picker-react/primitives`. Both paths share search, keyboard navigation, localization and virtualization. Use your existing Tailwind, shadcn/ui, CSS Modules, Emotion, styled-components, MUI or plain CSS design.
5
4
 
6
- <!-- source: README.md -->
5
+ Key facts:
7
6
 
8
- # Emoji Picker React
7
+ - Install: `npm install emoji-picker-react`. Minimal use: `import EmojiPicker from 'emoji-picker-react'; <EmojiPicker onEmojiClick={(e) => insert(e.emoji)} />`.
8
+ - Choose batteries included or BYOD for both "I just need an emoji picker" (the default component needs no styling) and "it must match our design system" (`unstyled` or primitives + the project's styling solution).
9
+ - Entry points: `emoji-picker-react` (the default picker, enums and types; registers the English dataset), `emoji-picker-react/primitives` (composable parts, hooks, tokens and the same enums; loads the dataset on demand), `emoji-picker-react/data` (search and lookup without React), `emoji-picker-react/data/emojis-<locale>` (28 datasets). The complete export list is below.
10
+ - Styling: `--epr-*` CSS variables (they always yield to consumer CSS), `[data-epr-part="…"]` selectors, `className`/`style`. Ordinary resets are handled by library classes; more specific rules and !important can still override structural geometry. With Tailwind v4 or other @layer setups pass `cssLayer="epr"` and declare `@layer epr, theme, base, components, utilities;` first.
11
+ - Use `colorScheme="light" | "dark" | "auto"` on Root, or prefer it over `theme` on EmojiPicker (CSS-in-JS wrappers reserve `theme`). Props accept string literals or enums.
12
+ - Accessibility: automated axe and keyboard/focus regression checks; grid semantics (emoji buttons are `role="gridcell"`); every UI string localizable through `labels`. Manual screen-reader verification has a separate release protocol.
13
+ - Works with React 16.8–19, SSR, React Server Components (client entries are marked "use client"), TypeScript.
14
+ - Composition owns presence and placement: Root renders exactly the parts you supply — omit Search, Preview, SkinTone, Panel or Reactions to omit that UI, and place SkinTone inside Search or Preview (or anywhere in Root). The default picker assembles the same parts from its legacy props. Use SearchInput as={Input} with an input-forwarding adapter. Root/EmojiPicker components replace Emoji, CategoryHeader, CategoryButton, SkinToneButton, ClearButton and ExpandButton; List components override grid slots. Use useSearchActions, useCategoryNavigation and usePickerMode for custom controls. Bare Root and unstyled remove all branded decoration; geometry and presence belong to your JSX. Do not invent asChild, onEmojiSelect or a renderer-independent UI engine.
15
+ - Read the installed package llms-full.txt first; it matches the installed version. The primitives entry, `unstyled`, `columns`, `components`, `labels` and loader `emojiData` exist from 5.0.0; a 4.x installation has only the v4 props.
16
+ - Do not override structural layout (viewport overflow, grid geometry); position the picker by wrapping it.
9
17
 
10
- The most popular fully customizable emoji picker for React.
18
+ Exports (generated from the entry sources):
11
19
 
12
- [![npm downloads](https://img.shields.io/npm/dm/emoji-picker-react.svg)](https://www.npmjs.com/package/emoji-picker-react)
20
+ - `emoji-picker-react`: default `EmojiPicker`; values `Categories`, `Emoji`, `emojiByUnified`, `EmojiStyle`, `SkinTonePickerLocation`, `SkinTones`, `SuggestionMode`, `Theme`; types `CategoryButtonRenderProps`, `CategoryConfig`, `CategoryHeaderRenderProps`, `CategoryIcons`, `CustomEmoji`, `EmojiClickData`, `EmojiClickHandler`, `EmojiData`, `EmojiDataInput`, `EmojiDataLoader`, `EmojiDataLoaderOptions`, `EmojiRenderProps`, `EmojiStyleValue`, `ListComponents`, `ListEmoji`, `OnEmojiClickApi`, `PickerComponents`, `PickerLabels`, `PickerProps`, `PreviewConfig`, `Props`, `SkinToneButtonRenderProps`, `SkinToneChangeHandler`, `SkinTonesValue`, `SuggestionModeValue`, `ThemeValue`.
21
+ - `emoji-picker-react/primitives`: values `Categories`, `CategoryNav`, `darkPickerTokens`, `defaultPickerTokens`, `EmojiStyle`, `Empty`, `lightPickerTokens`, `List`, `LoadError`, `Loading`, `Panel`, `Preview`, `Reactions`, `Root`, `Search`, `SearchInput`, `SkinTone`, `SkinTonePickerLocation`, `SkinTones`, `structuralPickerTokens`, `SuggestionMode`, `Theme`, `useActiveEmoji`, `useCategoryNavigation`, `useEmojiDataState`, `usePickerMode`, `useSearchActions`, `useSearchState`, `useSkinTone`, `Viewport`; types `CategoryButtonRenderProps`, `CategoryConfig`, `CategoryHeaderRenderProps`, `CategoryIcons`, `CategoryNavProps`, `CustomEmoji`, `EmojiClickData`, `EmojiClickHandler`, `EmojiData`, `EmojiDataInput`, `EmojiDataLoader`, `EmojiDataLoaderOptions`, `EmojiDataState`, `EmojiRenderProps`, `EmojiStyleValue`, `EmptyProps`, `ListComponents`, `ListEmoji`, `ListProps`, `LoadErrorProps`, `LoadingProps`, `OnEmojiClickApi`, `PanelProps`, `PickerAppearanceProps`, `PickerComponents`, `PickerCompositionProps`, `PickerLabels`, `PreviewConfig`, `PreviewProps`, `ReactionsProps`, `RootBehaviorProps`, `RootProps`, `SearchInputComponent`, `SearchInputElement`, `SearchInputProps`, `SearchProps`, `SearchState`, `SkinToneButtonRenderProps`, `SkinToneChangeHandler`, `SkinToneProps`, `SkinTonesValue`, `SuggestionModeValue`, `ThemeValue`, `ViewportProps`.
22
+ - `emoji-picker-react/data`: values `getEmojiByUnified`, `searchEmojis`; types `EmojiData`, `EmojiDataOptions`, `EmojiInfo`.
23
+ - `emoji-picker-react/data/emojis-<locale>`: default export, an `EmojiData` dataset (bn, da, de, en, en-gb, es, es-mx, et, fi, fr, hi, hu, it, ja, ko, lt, ms, nb, nl, pl, pt, ru, sv, th, uk, vi, zh, zh-hant).
13
24
 
14
- **[Live Demo](https://ealush.com/emoji-picker-react)** | **[Report a Bug](https://github.com/ealush/emoji-picker-react/issues)** | **[Sponsor](https://github.com/sponsors/ealush)**
15
-
16
- ![image](https://github.com/ealush/emoji-picker-react/assets/11255103/48901306-e7fd-49cd-8f1e-9b214083a61d)
17
-
18
- ![reactions](https://github.com/ealush/emoji-picker-react/assets/11255103/c28cc954-dc1d-4d82-91a8-64a74cf1d598)
19
-
20
- ## Features
21
-
22
- - Fully customizable through props and CSS variables
23
- - Light, dark, and auto themes
24
- - Reactions picker mode and custom click handlers
25
- - Dozens of built-in languages
26
- - Custom image-based emojis
27
- - Apple, Google, Facebook, Twitter, and native emoji styles
28
- - Responsive and mobile-friendly
29
- - SSR-safe
30
-
31
- ## Installation
32
-
33
- ```bash
34
- npm install emoji-picker-react
35
- ```
36
-
37
- ## Usage
38
-
39
- ```jsx
40
- import EmojiPicker from 'emoji-picker-react';
41
-
42
- function App() {
43
- return (
44
- <EmojiPicker onEmojiClick={(emojiData) => console.log(emojiData.emoji)} />
45
- );
46
- }
47
- ```
48
-
49
- `onEmojiClick` receives an `EmojiClickData` object (unified code, names, image URL, active skin tone) and the underlying mouse event.
50
-
51
- ## Configuration
52
-
53
- ```jsx
54
- <EmojiPicker
55
- theme="dark"
56
- emojiStyle="native"
57
- width={320}
58
- height={400}
59
- previewConfig={{ showPreview: false }}
60
- />
61
- ```
62
-
63
- See [PROPS.md](PROPS.md) for the complete props reference.
64
-
65
- ## Styling
66
-
67
- No stylesheet import needed. All styles are scoped via [ShipStyles](https://github.com/ealush/shipstyles) — generated class names are hashed, so the picker's CSS won't leak into or clash with your app's styles.
68
-
69
- Restyle the picker by overriding [CSS variables](CSS_VARIABLES.md) on `.EmojiPickerReact`:
70
-
71
- ```css
72
- .EmojiPickerReact {
73
- --epr-emoji-size: 32px;
74
- }
75
- ```
76
-
77
- ## Internationalization
78
-
79
- Pass imported locale data via the `emojiData` prop:
80
-
81
- ```jsx
82
- import EmojiPicker from 'emoji-picker-react';
83
- import es from 'emoji-picker-react/dist/data/emojis-es'; // Spanish
84
-
85
- function App() {
86
- return <EmojiPicker emojiData={es} />;
87
- }
88
- ```
89
-
90
- See [INTERNATIONALIZATION.md](INTERNATIONALIZATION.md) for the supported languages.
91
-
92
- ## Customization
93
-
94
- Custom emojis, custom category icons, preview configuration, and CSP nonces are covered in [CUSTOMIZATION.md](CUSTOMIZATION.md).
95
-
96
- ## Server-Side Rendering
97
-
98
- The picker renders on the server, with styles inlined into the server HTML — no setup needed. Since the picker is usually opened on demand rather than shown immediately, lazy-loading it is still recommended to keep the initial bundle small:
99
-
100
- ```javascript
101
- import dynamic from 'next/dynamic';
102
-
103
- const Picker = dynamic(() => import('emoji-picker-react'));
104
- ```
105
-
106
- ## Troubleshooting
107
-
108
- ### `global is not defined` (Vite, versions before 4.20)
109
-
110
- Since 4.20 the picker is SSR-safe and no longer references the Node-style
111
- `global`. If you see `global is not defined`, upgrade to the latest version.
112
- On older versions only, the workaround was adding this to your HTML:
113
-
114
- ```html
115
- <script>
116
- window.global = window;
117
- </script>
118
- ```
119
-
120
- ## Support Emoji Picker React
121
-
122
- Emoji Picker React is independently maintained. If your team relies on it, you can help fund ongoing maintenance and releases through [GitHub Sponsors](https://github.com/sponsors/ealush). Organizations can also support the project through [Tidelift](https://tidelift.com/subscription/pkg/npm-emoji-picker-react).
123
-
124
- ## More from the maintainer
125
-
126
- Building complex forms? Check out [**Vest**](https://vestjs.dev) — a validation framework for stateful, async, and dependent validation.
127
-
128
- ## Contributing
129
-
130
- Contributions are welcome — see the [Contributing Guide](https://github.com/ealush/emoji-picker-react/blob/master/CONTRIBUTING.md).
131
-
132
- Design inspiration by [Pavel Bolo](https://pavelbolo.com).
133
-
134
- <!-- source: PROPS.md -->
135
-
136
- # Props Reference
137
-
138
- Complete list of all props accepted by `EmojiPicker`. All props are optional.
139
-
140
- ## General Configuration
141
-
142
- | Prop | Type | Default | Description |
143
- | ----------------- | ------------ | ------------------ | -------------------------------------------------------------------------------------------- |
144
- | `open` | `boolean` | `true` | Controls the visibility of the picker. |
145
- | `theme` | `Theme` | `Theme.LIGHT` | The visual theme. Options: `'light'`, `'dark'`, `'auto'`. |
146
- | `emojiStyle` | `EmojiStyle` | `EmojiStyle.APPLE` | The emoji set to use. Options: `'apple'`, `'google'`, `'facebook'`, `'twitter'`, `'native'`. |
147
- | `emojiVersion` | `string` | `null` | Limit emojis to a specific unicode version (e.g., `"14.0"`). |
148
- | `lazyLoadEmojis` | `boolean` | `false` | If true, emoji images are loaded only when they scroll into view. |
149
- | `autoFocusSearch` | `boolean` | `true` | Focuses the search input automatically when the picker mounts. |
150
- | `emojiData` | `object` | `undefined` | Pass imported locale data here for internationalization. See [INTERNATIONALIZATION.md](INTERNATIONALIZATION.md). |
151
-
152
- ## Dimensions & Styling
153
-
154
- | Prop | Type | Default | Description |
155
- | ----------- | -------------------- | ------- | ----------------------------------------------------- |
156
- | `width` | `string \| number` | `350` | Picker width. Numbers are treated as pixels. |
157
- | `height` | `string \| number` | `450` | Picker height. Numbers are treated as pixels. |
158
- | `style` | `CSSProperties` | `{}` | Inline styles applied to the root element. |
159
- | `className` | `string` | `""` | CSS class applied to the root element. |
160
-
161
- Visual styling beyond size is done via [CSS variables](CSS_VARIABLES.md).
162
-
163
- ## Events & Interaction
164
-
165
- | Prop | Type | Description |
166
- | ------------------ | -------------------------------------------------------- | -------------------------------------------------------------------- |
167
- | `onEmojiClick` | `(emojiData: EmojiClickData, event: MouseEvent) => void` | Callback triggered when a user clicks an emoji. |
168
- | `onReactionClick` | `(emojiData: EmojiClickData, event: MouseEvent) => void` | Callback triggered when a user clicks a reaction (in reaction mode). |
169
- | `onSkinToneChange` | `(skinTone: SkinTones) => void` | Callback triggered when the user selects a new skin tone. |
170
-
171
- ## Search & Categories
172
-
173
- | Prop | Type | Default | Description |
174
- | ------------------------ | ------------------------ | ------------------------- | -------------------------------------------------------------------- |
175
- | `searchDisabled` | `boolean` | `false` | If true, the search bar is completely removed. |
176
- | `searchPlaceholder` | `string` | `"Search"` | Placeholder text for the search input. |
177
- | `searchClearButtonLabel` | `string` | `"Clear"` | Aria label for the search clear button. |
178
- | `categories` | `CategoryConfig[]` | _(All)_ | Array of category objects to customize order or visibility. |
179
- | `suggestedEmojisMode` | `SuggestionMode` | `SuggestionMode.FREQUENT` | Logic for "Suggested" category. Options: `'recent'`, `'frequent'`. |
180
- | `defaultSkinTone` | `SkinTones` | `SkinTones.NEUTRAL` | The initial skin tone. |
181
- | `skinTonesDisabled` | `boolean` | `false` | If true, users cannot change the skin tone. |
182
- | `skinTonePickerLocation` | `SkinTonePickerLocation` | `SEARCH` | Location of the skin tone trigger. Options: `'SEARCH'`, `'PREVIEW'`. |
183
-
184
- ## Customization & Advanced
185
-
186
- | Prop | Type | Default | Description |
187
- | --------------- | ------------------------------------------------ | ----------------------- | ------------------------------------------------------------------------ |
188
- | `customEmojis` | `CustomEmoji[]` | `[]` | Array of custom image-based emojis to inject. See [CUSTOMIZATION.md](CUSTOMIZATION.md). |
189
- | `hiddenEmojis` | `string[]` | `[]` | Array of unified IDs (e.g., `'1f921'`) to hide from the picker. |
190
- | `previewConfig` | `PreviewConfig` | `{ showPreview: true }` | Configuration for the bottom preview bar. See [CUSTOMIZATION.md](CUSTOMIZATION.md). |
191
- | `getEmojiUrl` | `(unified: string, style: EmojiStyle) => string` | - | Function to override the default CDN URL for emoji images. |
192
- | `categoryIcons` | `CategoryIcons` | `{}` | Map `Categories` enum values to custom React nodes for navigation icons. See [CUSTOMIZATION.md](CUSTOMIZATION.md). |
193
- | `nonce` | `string` | `undefined` | Content Security Policy (CSP) nonce for the inline style tag. See [CUSTOMIZATION.md](CUSTOMIZATION.md). |
194
-
195
- ## Reactions Picker Mode
196
-
197
- | Prop | Type | Default | Description |
198
- | ---------------------- | ---------- | --------------- | ------------------------------------------------------------------------ |
199
- | `reactionsDefaultOpen` | `boolean` | `false` | If true, mounts in "Reactions" mode (single row) instead of full picker. |
200
- | `reactions` | `string[]` | _(Default Set)_ | Array of unified IDs to display in the reactions bar. |
201
- | `allowExpandReactions` | `boolean` | `true` | If true, shows a `+` button to switch from reactions to full picker. |
202
-
203
- <!-- source: CUSTOMIZATION.md -->
204
-
205
- # Customization
206
-
207
- ## Custom Emojis
208
-
209
- Pass the `customEmojis` prop to inject image-based emojis. Each entry uses this structure:
210
-
211
- ```ts
212
- {
213
- id: string; // Unique ID
214
- names: string[]; // Search keywords
215
- imgUrl: string; // Image source
216
- group?: string; // Optional section; see grouping below
217
- }
218
- ```
219
-
220
- ```jsx
221
- <EmojiPicker
222
- customEmojis={[
223
- {
224
- id: 'panda',
225
- names: ['panda', 'bear'],
226
- imgUrl: 'https://example.com/panda.png',
227
- },
228
- ]}
229
- />
230
- ```
231
-
232
- ### Grouping custom emojis
233
-
234
- Give customs a `group` to render each group as its own named section.
235
- Reference the group from a `{ category: Categories.CUSTOM, group }`
236
- entry in `categories` to place it anywhere in the order, with its own
237
- `name` and `icon`. Customs without a group share the classic bucket.
238
- Groups missing from `categories` are appended as their own sections
239
- automatically (after the standard categories), so grouped emojis always
240
- render somewhere. Omit `CUSTOM` from `categories` entirely to hide all
241
- customs — explicit `categories` stay an allowlist:
242
-
243
- ### Updating groups at runtime
244
-
245
- `categories` and `customEmojis` are immutable inputs: replacing either
246
- array (even with a same-length array) rebuilds sections, tabs, search,
247
- and lookup. Mutating an array in place is not detected — always provide
248
- a new reference. Group strings are exact, case-sensitive identifiers.
249
-
250
- ```tsx
251
- import EmojiPicker, { Categories } from 'emoji-picker-react';
252
-
253
- <EmojiPicker
254
- customEmojis={[
255
- { id: 'panda', names: ['panda'], imgUrl: pandaPng, group: 'animals' },
256
- { id: 'ninja', names: ['ninja'], imgUrl: ninjaPng, group: 'people' },
257
- { id: 'orphan', names: ['orphan'], imgUrl: orphanPng },
258
- ]}
259
- categories={[
260
- Categories.SMILEYS_PEOPLE,
261
- { category: Categories.CUSTOM, group: 'animals', name: 'Animals' },
262
- { category: Categories.CUSTOM, group: 'people', name: 'People' },
263
- { category: Categories.CUSTOM, name: 'Misc' },
264
- ]}
265
- />;
266
- ```
267
-
268
- ## Preview Bar
269
-
270
- Control the footer preview area with `previewConfig`:
271
-
272
- ```ts
273
- {
274
- defaultEmoji: string; // Default: "1f60a"
275
- defaultCaption: string; // Default: "What's your mood?"
276
- showPreview: boolean; // Default: true
277
- }
278
- ```
279
-
280
- ## Custom Category Icons
281
-
282
- Customize the navigation icons using one of three methods.
283
-
284
- **Method 1: Recolor the default icons with CSS variables**
285
-
286
- The default icons follow two variables. Set them on the picker root via
287
- the `style` prop (the picker defines its own defaults on `.epr-main`, so
288
- values inherited from outer ancestors are shadowed):
25
+ Quick reference:
289
26
 
290
27
  ```tsx
291
- <EmojiPicker
292
- style={
293
- {
294
- '--epr-category-icon-active-color': '#e11d48',
295
- '--epr-category-icon-inactive-color': '#a8a29e',
296
- } as React.CSSProperties
297
- }
298
- />
299
- ```
300
-
301
- | Variable | Default |
302
- | :----------------------------------- | :---------------------------------- |
303
- | `--epr-category-icon-active-color` | `#3371B7` (`#6AA9DD` in dark theme) |
304
- | `--epr-category-icon-inactive-color` | `#868686` (`#C0C0BF` in dark theme) |
305
-
306
- **Method 2: The `categoryIcons` prop**
307
-
308
- Map `Categories` enum values to React nodes:
309
-
310
- ```tsx
311
- import EmojiPicker, { Categories } from 'emoji-picker-react';
312
-
313
- <EmojiPicker
314
- categoryIcons={{
315
- [Categories.SUGGESTED]: <img src="recent.png" alt="Recent" />,
316
- [Categories.SMILEYS_PEOPLE]: <MyCustomFaceIcon />,
317
- }}
318
- />;
319
- ```
320
-
321
- **Method 3: The `categories` configuration array**
322
-
323
- Define the icon directly within the category configuration object:
324
-
325
- ```tsx
326
- import EmojiPicker, { Categories } from 'emoji-picker-react';
327
-
328
- <EmojiPicker
329
- categories={[
330
- {
331
- category: Categories.SUGGESTED,
332
- name: 'Recently Used',
333
- icon: <img src="recent.png" alt="Recent" />,
334
- },
335
- {
336
- category: Categories.SMILEYS_PEOPLE,
337
- name: 'Smileys & People',
338
- icon: <MyCustomFaceIcon />,
339
- },
340
- ]}
341
- />;
342
- ```
343
-
344
- Note: if both methods are used for the same category, the icon from the `categories` configuration takes precedence over the `categoryIcons` prop. `categoryIcons[Categories.CUSTOM]` applies to every custom group tab that does not define its own `icon`.
345
-
346
- ## Content Security Policy (CSP)
347
-
348
- If your site has a CSP that blocks inline styles, pass a `nonce` to the `EmojiPicker` component. It is applied to the inline `<style>` tag:
349
-
350
- ```jsx
351
- <EmojiPicker nonce="your-nonce-value" />
352
- ```
353
-
354
- <!-- source: INTERNATIONALIZATION.md -->
355
-
356
- # Internationalization (i18n)
357
-
358
- Import the dictionary you need and pass it to the `emojiData` prop:
359
-
360
- ```javascript
28
+ // Batteries included: theme the built-in look with colorScheme and --epr-* variables.
361
29
  import EmojiPicker from 'emoji-picker-react';
362
- import es from 'emoji-picker-react/dist/data/emojis-es'; // Spanish
363
-
364
- function App() {
365
- return <EmojiPicker emojiData={es} />;
366
- }
367
- ```
368
-
369
- ## Supported Languages
370
-
371
- - `emojis-bn` (Bengali)
372
- - `emojis-da` (Danish)
373
- - `emojis-de` (German)
374
- - `emojis-en-gb` (English, GB)
375
- - `emojis-en` (English, US)
376
- - `emojis-es-mx` (Spanish, Mexico)
377
- - `emojis-es` (Spanish)
378
- - `emojis-et` (Estonian)
379
- - `emojis-fi` (Finnish)
380
- - `emojis-fr` (French)
381
- - `emojis-hi` (Hindi)
382
- - `emojis-hu` (Hungarian)
383
- - `emojis-it` (Italian)
384
- - `emojis-ja` (Japanese)
385
- - `emojis-ko` (Korean)
386
- - `emojis-lt` (Lithuanian)
387
- - `emojis-ms` (Malay)
388
- - `emojis-nb` (Norwegian Bokmal)
389
- - `emojis-nl` (Dutch)
390
- - `emojis-pl` (Polish)
391
- - `emojis-pt` (Portuguese)
392
- - `emojis-ru` (Russian)
393
- - `emojis-sv` (Swedish)
394
- - `emojis-th` (Thai)
395
- - `emojis-uk` (Ukrainian)
396
- - `emojis-vi` (Vietnamese)
397
- - `emojis-zh-hant` (Traditional Chinese)
398
- - `emojis-zh` (Simplified Chinese)
399
-
400
- <!-- source: CSS_VARIABLES.md -->
401
-
402
- # 🎨 CSS Variables
403
-
404
- You can customize specific parts of the picker by overriding these CSS variables. Target `.EmojiPickerReact` or `aside.EmojiPickerReact` to apply them.
405
-
406
- ```css
407
- .EmojiPickerReact {
408
- --epr-emoji-size: 32px;
409
- }
410
- ```
411
-
412
- or
413
-
414
- ```css
415
- aside.EmojiPickerReact {
416
- --epr-emoji-size: 32px;
417
- }
418
- ```
419
-
420
- ## 🎛️ General Variables
421
-
422
- | Variable | Description | Default |
423
- | :--------------------------- | :------------------------------------------------- | :-------- |
424
- | `--epr-emoji-size` | Size of the emojis. | `30px` |
425
- | `--epr-emoji-padding` | Padding around each emoji. | `5px` |
426
- | `--epr-emoji-gap` | **Deprecated**. Use `--epr-emoji-padding` instead. | - |
427
- | `--epr-bg-color` | Background color of the picker. | `#fff` |
428
- | `--epr-text-color` | Main text color. | `#858585` |
429
- | `--epr-picker-border-color` | Border color of the picker container. | `#e7e7e7` |
430
- | `--epr-picker-border-radius` | Border radius of the picker. | `8px` |
431
- | `--epr-horizontal-padding` | Horizontal padding for various elements. | `10px` |
432
- | `--epr-highlight-color` | Color for active states and highlights. | `#007aeb` |
433
- | `--epr-hover-bg-color` | Background color on hover. | `#e5f0fa` |
434
- | `--epr-focus-bg-color` | Background color on focus. | `#e0f0ff` |
435
-
436
- ## 🔎 Search Input
437
-
438
- | Variable | Description | Default |
439
- | :------------------------------------- | :-------------------------------------- | :--------------------------------- |
440
- | `--epr-search-input-bg-color` | Background color of the search input. | `#f6f6f6` |
441
- | `--epr-search-input-bg-color-active` | Background color when search is active. | `var(--epr-search-input-bg-color)` |
442
- | `--epr-search-input-text-color` | Text color in the search input. | `var(--epr-text-color)` |
443
- | `--epr-search-input-placeholder-color` | Placeholder text color. | `var(--epr-text-color)` |
444
- | `--epr-search-border-color` | Border color of the search input. | `var(--epr-search-input-bg-color)` |
445
- | `--epr-search-border-color-active` | Border color when search is active. | `var(--epr-highlight-color)` |
446
- | `--epr-search-input-border-radius` | Border radius of the search input. | `8px` |
447
- | `--epr-search-input-height` | Height of the search input. | `40px` |
448
- | `--epr-search-icon-color` | Color of the search icon. | - |
449
-
450
- ## 🏷️ Category Navigation
451
-
452
- | Variable | Description | Default |
453
- | :-------------------------------------- | :-------------------------------------------------------------- | :------------------ |
454
- | `--epr-category-navigation-button-size` | Size of category navigation buttons. | `30px` |
455
- | `--epr-category-icon-active-color` | Color of the active/hovered category icon (and focus ring). | `#3371B7` (`#6AA9DD` in dark theme) |
456
- | `--epr-category-icon-inactive-color` | Color of inactive category icons. | `#868686` (`#C0C0BF` in dark theme) |
457
-
458
- ## 📃 Category Labels
459
-
460
- | Variable | Description | Default |
461
- | :-------------------------------- | :--------------------------------------------- | :---------------------- |
462
- | `--epr-category-label-bg-color` | Background color of the sticky category label. | `#ffffffe6` |
463
- | `--epr-category-label-text-color` | Text color of the category label. | `var(--epr-text-color)` |
464
- | `--epr-category-label-height` | Height of the category label. | `40px` |
465
-
466
- ## 👁️ Preview Area
467
-
468
- | Variable | Description | Default |
469
- | :------------------------- | :------------------------------------- | :---------------------- |
470
- | `--epr-preview-height` | Height of the preview area. | `70px` |
471
- | `--epr-preview-text-size` | Font size of text in the preview area. | `14px` |
472
- | `--epr-preview-text-color` | Text color in the preview area. | `var(--epr-text-color)` |
473
-
474
- ## 🖐️ Skin Tone Picker
475
-
476
- | Variable | Description | Default |
477
- | :---------------------------------- | :--------------------------------------------- | :---------- |
478
- | `--epr-skin-tone-picker-menu-color` | Background color of the skin tone picker menu. | `#ffffff95` |
479
- | `--epr-skin-tone-size` | Size of skin tone circles. | `20px` |
480
-
481
- ## 🌑 Dark Mode
482
-
483
- | Variable | Description | Default |
484
- | :--------------------------------- | :------------------------------------ | :--------------------------- |
485
- | `--epr-dark-bg-color` | Background color in dark mode. | `#222222` |
486
- | `--epr-dark-picker-border-color` | Border color in dark mode. | `#151617` |
487
- | `--epr-dark-text-color` | Text color in dark mode. | `var(--epr-highlight-color)` |
488
- | `--epr-dark-search-input-bg-color` | Search input background in dark mode. | `#333333` |
489
- | `--epr-dark-hover-bg-color` | Hover background color in dark mode. | `#363636f6` |
30
+ <EmojiPicker colorScheme="auto" columns={8} className="my-picker" onEmojiClick={(e) => insert(e.emoji)} />
31
+
32
+ // Unstyled: same layout and behavior, your CSS on [data-epr-part] selectors (color variables do nothing here).
33
+ <EmojiPicker unstyled className="my-picker" />
34
+
35
+ // Composed: your layout, your components; Root keeps state, keyboard, ARIA and virtualization.
36
+ import * as Picker from 'emoji-picker-react/primitives';
37
+ <Picker.Root columns={8} style={{ height: 400 }} components={{ Emoji: MyCell }} onEmojiClick={(e) => insert(e.emoji)}>
38
+ <Picker.SearchInput as={MyInput} />
39
+ <Picker.CategoryNav />
40
+ <Picker.Viewport><Picker.List /><Picker.Empty /><Picker.Loading /><Picker.LoadError /></Picker.Viewport>
41
+ <Picker.Preview />
42
+ </Picker.Root>
43
+
44
+ // Data only (no React): search and lookup.
45
+ import { searchEmojis, getEmojiByUnified } from 'emoji-picker-react/data';
46
+ searchEmojis('party'); getEmojiByUnified('1f389'); // { emoji: '🎉', name: 'party popper', unified, names, … }
47
+ ```
48
+
49
+ ## Docs
50
+
51
+ - [Agent integration guide](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/docs/v5/AGENT_GUIDE.md): installed-version discovery, batteries included/BYOD, typed input/cell contracts, localization and verification
52
+ - [Copyable integration prompts](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/docs/v5/PROMPTS.md): setup, brand styling, design-library composition, recipe adoption and v4-to-v5 migration
53
+ - [README](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/README.md): overview, quick start, choosing a path, styling with any solution, common tasks
54
+ - [Props reference](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/PROPS.md): every prop of the default <EmojiPicker />
55
+ - [CSS variables](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/CSS_VARIABLES.md): every --epr-* design token
56
+ - [Customization](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/CUSTOMIZATION.md): custom emojis and groups, category icons, preview, CSP nonce
57
+ - [Internationalization](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/INTERNATIONALIZATION.md): locale datasets and labels
58
+ - [Adoption](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/docs/v5/ADOPTION.md): native input, loading recovery, registry installation and source downloads
59
+ - [v5 API](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/docs/v5/API.md): all v5 additions with examples
60
+ - [Primitives](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/docs/v5/PRIMITIVES.md): composable parts, hooks, custom cells, grammar
61
+ - [Styling](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/docs/v5/STYLING.md): tokens, parts, cascade, structural rules
62
+ - [Styling recipes by library](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/docs/v5/STYLING_RECIPES.md): theme, unstyled and composed snippets for plain CSS, CSS Modules, Tailwind, shadcn/ui, Emotion, styled-components and MUI
63
+ - [Data API](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/docs/v5/DATA_API.md): framework-free search and lookup
64
+ - [Migrating from v4](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/docs/v5/MIGRATION.md): what changed and how to upgrade
65
+ - [Website examples](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/website/README.md): typed customization, locale loading and composition
66
+
67
+ ## Examples
68
+
69
+ - [Design recipes](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/stories/recipes/README.md): 25 designs, each in seven styling stacks
70
+ - [Styling integrations](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/stories/integrations/README.md): shadcn/ui, Tailwind, Emotion, styled-components, CSS Modules, CSS, MUI
71
+ - [Example app](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/example/README.md): Vite + React 19 app running the batteries-included, unstyled, composed and data-API paths
72
+
73
+ ## Optional
74
+
75
+ - [llms-full.txt](https://raw.githubusercontent.com/ealush/emoji-picker-react/master/llms-full.txt): the complete documentation in one file