emoji-picker-react 4.22.3 → 5.0.1

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 (409) hide show
  1. package/README.md +331 -49
  2. package/dist/DomUtils/categoryNameFromDom.d.ts +1 -1
  3. package/dist/DomUtils/classNames.d.ts +23 -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 +15 -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/skinToneVariations.js +2 -2
  183. package/dist/data/skinToneVariations.ts +8 -7
  184. package/dist/data-core/pickerData.d.ts +12 -0
  185. package/dist/data-core/prepare.d.ts +23 -0
  186. package/dist/data-core/search.d.ts +13 -0
  187. package/dist/data-core/types.d.ts +23 -0
  188. package/dist/data.d.mts +72 -0
  189. package/dist/data.d.ts +72 -0
  190. package/dist/dataUtils/DataTypes.d.ts +23 -19
  191. package/dist/dataUtils/emojiSelectors.d.ts +15 -16
  192. package/dist/dataUtils/emojiUtils.d.ts +1 -12
  193. package/dist/dataUtils/nativeEmojiSequenceSupport.d.ts +10 -0
  194. package/dist/dataUtils/nativeEmojiSupport.d.ts +40 -0
  195. package/dist/dataUtils/parseNativeEmoji.d.ts +1 -1
  196. package/dist/dataUtils/suggested.d.ts +11 -11
  197. package/dist/dataUtils/suggestedEmojis.d.ts +7 -0
  198. package/dist/esm/chunks/chunk-7ZGTUZFB.mjs +8025 -0
  199. package/dist/esm/chunks/chunk-ACXAQEKG.mjs +149 -0
  200. package/dist/esm/chunks/chunk-F2KS7DCA.mjs +6735 -0
  201. package/dist/esm/chunks/chunk-L5W4PFRJ.mjs +14 -0
  202. package/dist/esm/chunks/chunk-LO4TPPLH.mjs +33 -0
  203. package/dist/esm/chunks/emojis-6L3GRBAP.mjs +7 -0
  204. package/dist/esm/data.mjs +11 -0
  205. package/dist/esm/index.mjs +279 -0
  206. package/dist/esm/primitives/index.mjs +8 -0
  207. package/dist/hooks/preloadEmoji.d.ts +5 -9
  208. package/dist/hooks/useActiveCategoryScrollDetection.d.ts +11 -11
  209. package/dist/hooks/useCategoryHeight.d.ts +7 -5
  210. package/dist/hooks/useCloseAllOpenToggles.d.ts +2 -2
  211. package/dist/hooks/useDataIdentityStabilityWarning.d.ts +13 -0
  212. package/dist/hooks/useDebouncedState.d.ts +1 -1
  213. package/dist/hooks/useDisallowMouseMove.d.ts +4 -4
  214. package/dist/hooks/useDisallowedEmojis.d.ts +2 -3
  215. package/dist/hooks/useEmojiPreviewEvents.d.ts +3 -3
  216. package/dist/hooks/useEmojiVirtualization.d.ts +22 -17
  217. package/dist/hooks/useFilter.d.ts +10 -16
  218. package/dist/hooks/useFocus.d.ts +3 -3
  219. package/dist/hooks/useInitialLoad.d.ts +2 -2
  220. package/dist/hooks/useIsEmojiHidden.d.ts +8 -8
  221. package/dist/hooks/useIsMounted.d.ts +1 -1
  222. package/dist/hooks/useIsSearchMode.d.ts +1 -1
  223. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
  224. package/dist/hooks/useKeyboardNavigation.d.ts +3 -1
  225. package/dist/hooks/useMouseDownHandlers.d.ts +8 -4
  226. package/dist/hooks/useOnFocus.d.ts +1 -1
  227. package/dist/hooks/useOnScroll.d.ts +2 -2
  228. package/dist/hooks/useReactionsFocus.d.ts +1 -0
  229. package/dist/hooks/useRegisterRegion.d.ts +24 -0
  230. package/dist/hooks/useResolvedEmojiData.d.ts +37 -0
  231. package/dist/hooks/useScrollCategoryIntoView.d.ts +1 -1
  232. package/dist/hooks/useSearchController.d.ts +17 -0
  233. package/dist/hooks/useSearchResults.d.ts +8 -0
  234. package/dist/hooks/useSetVariationPicker.d.ts +2 -2
  235. package/dist/hooks/useShouldHideCustomEmojis.d.ts +1 -1
  236. package/dist/hooks/useShouldShowSkinTonePicker.d.ts +4 -4
  237. package/dist/index.d.mts +376 -0
  238. package/dist/index.d.ts +376 -9
  239. package/dist/index.js +2 -8
  240. package/dist/primitives/CategoryNav.d.ts +4 -0
  241. package/dist/primitives/Empty.d.ts +6 -0
  242. package/dist/primitives/List.d.ts +4 -0
  243. package/dist/primitives/LoadError.d.ts +8 -0
  244. package/dist/primitives/Loading.d.ts +4 -0
  245. package/dist/primitives/Panel.d.ts +3 -0
  246. package/dist/primitives/Preview.d.ts +3 -0
  247. package/dist/primitives/Reactions.d.ts +2 -0
  248. package/dist/primitives/Root.d.ts +26 -0
  249. package/dist/primitives/Search.d.ts +5 -0
  250. package/dist/primitives/SearchInput.d.ts +3 -0
  251. package/dist/primitives/SkinTone.d.ts +4 -0
  252. package/dist/primitives/Viewport.d.ts +19 -0
  253. package/dist/primitives/appearance.d.ts +3 -0
  254. package/dist/primitives/components.d.ts +27 -0
  255. package/dist/primitives/hooks.d.ts +48 -0
  256. package/dist/primitives/index.d.mts +561 -0
  257. package/dist/primitives/index.d.ts +561 -0
  258. package/dist/primitives/index.js +2 -0
  259. package/dist/primitives/nativeProps.d.ts +15 -0
  260. package/dist/primitives/scope.d.ts +13 -0
  261. package/dist/primitives/structuralStyles.d.ts +16 -0
  262. package/dist/primitives/tokens.d.ts +18 -0
  263. package/dist/primitives/types.d.ts +85 -0
  264. package/dist/state/activeEmojiStore.d.ts +7 -0
  265. package/dist/state/navigationRegistry.d.ts +61 -0
  266. package/dist/state/regionTraversal.d.ts +20 -0
  267. package/dist/typeRefinements/typeRefinements.d.ts +6 -6
  268. package/dist/types/exposedTypes.d.ts +16 -6
  269. package/dist/types/exposedTypes.js +5 -0
  270. package/dist/virtualization/virtualizationHelpers.d.ts +22 -18
  271. package/llms-full.txt +3683 -0
  272. package/llms.txt +66 -480
  273. package/package.json +180 -66
  274. package/src/DomUtils/categoryNameFromDom.ts +1 -1
  275. package/src/DomUtils/classNames.ts +1 -4
  276. package/src/DomUtils/elementPositionInRow.ts +28 -6
  277. package/src/DomUtils/eventBelongsToPicker.ts +17 -0
  278. package/src/DomUtils/getActiveElement.ts +7 -1
  279. package/src/DomUtils/isJsdom.ts +12 -0
  280. package/src/DomUtils/isRtl.ts +5 -0
  281. package/src/DomUtils/keyboardNavigation.ts +164 -144
  282. package/src/DomUtils/scrollTo.ts +20 -18
  283. package/src/DomUtils/selectors.ts +30 -127
  284. package/src/EmojiPickerReact.tsx +155 -48
  285. package/src/Stylesheet/DedupedStyle.tsx +80 -0
  286. package/src/Stylesheet/stylesheet.tsx +128 -59
  287. package/src/components/Layout/Flex.tsx +12 -11
  288. package/src/components/Reactions/BtnPlus.tsx +61 -51
  289. package/src/components/Reactions/Reactions.tsx +113 -55
  290. package/src/components/atoms/Button.tsx +18 -15
  291. package/src/components/body/EmojiCategory.tsx +77 -40
  292. package/src/components/body/EmojiList.tsx +107 -44
  293. package/src/components/body/EmojiVariationPicker.tsx +113 -66
  294. package/src/components/body/MeasureEmoji.tsx +9 -2
  295. package/src/components/body/listComponents.tsx +79 -0
  296. package/src/components/context/ElementRefContext.tsx +46 -35
  297. package/src/components/context/PickerConfigContext.tsx +55 -40
  298. package/src/components/context/PickerContext.tsx +567 -92
  299. package/src/components/context/PickerDataContext.tsx +114 -99
  300. package/src/components/emoji/BaseEmojiProps.ts +5 -4
  301. package/src/components/emoji/ClickableEmojiButton.tsx +148 -63
  302. package/src/components/emoji/Emoji.tsx +24 -2
  303. package/src/components/emoji/EmojiImg.tsx +13 -12
  304. package/src/components/emoji/ExportedEmoji.tsx +5 -4
  305. package/src/components/emoji/NativeEmoji.tsx +19 -16
  306. package/src/components/emoji/ViewOnlyEmoji.tsx +55 -30
  307. package/src/components/emoji/emojiStyles.ts +12 -11
  308. package/src/components/footer/Preview.tsx +86 -91
  309. package/src/components/header/Header.tsx +21 -6
  310. package/src/components/header/Search/BtnClearSearch.tsx +69 -55
  311. package/src/components/header/Search/IcnSearch.tsx +21 -21
  312. package/src/components/header/Search/Search.tsx +79 -137
  313. package/src/components/header/SkinTonePicker/BtnSkinToneVariation.tsx +99 -62
  314. package/src/components/header/SkinTonePicker/SkinTonePicker.tsx +84 -46
  315. package/src/components/icons/svgIcons.ts +17 -0
  316. package/src/components/main/PickerMainBehaviors.tsx +163 -0
  317. package/src/components/main/defaultAppearance.tsx +189 -0
  318. package/src/components/main/labelHeight.ts +5 -0
  319. package/src/components/navigation/CategoryButton.tsx +83 -57
  320. package/src/components/navigation/CategoryNavIcon.tsx +73 -194
  321. package/src/components/navigation/CategoryNavigation.tsx +118 -46
  322. package/src/config/categoryConfig.ts +7 -3
  323. package/src/config/cdnUrls.ts +11 -21
  324. package/src/config/compareConfig.ts +128 -30
  325. package/src/config/config.ts +228 -24
  326. package/src/config/defaultPickerConfiguration.ts +7 -0
  327. package/src/config/mutableConfig.ts +44 -20
  328. package/src/config/useConfig.ts +130 -37
  329. package/src/data/defaultEmojiData.ts +49 -0
  330. package/src/data/registerDefaultEmojiData.ts +8 -0
  331. package/src/data/skinToneVariations.ts +8 -7
  332. package/src/data-core/pickerData.ts +171 -0
  333. package/src/data-core/prepare.ts +163 -0
  334. package/src/data-core/search.ts +122 -0
  335. package/src/data-core/types.ts +36 -0
  336. package/src/data.ts +10 -0
  337. package/src/dataUtils/DataTypes.ts +4 -0
  338. package/src/dataUtils/emojiSelectors.ts +59 -63
  339. package/src/dataUtils/emojiUtils.ts +17 -74
  340. package/src/dataUtils/nativeEmojiSequenceSupport.ts +116 -0
  341. package/src/dataUtils/nativeEmojiSupport.ts +160 -0
  342. package/src/dataUtils/parseNativeEmoji.ts +3 -4
  343. package/src/dataUtils/suggested.ts +8 -4
  344. package/src/dataUtils/suggestedEmojis.ts +92 -0
  345. package/src/env.d.ts +4 -0
  346. package/src/hooks/preloadEmoji.ts +2 -47
  347. package/src/hooks/useActiveCategoryScrollDetection.ts +28 -16
  348. package/src/hooks/useCategoryHeight.ts +116 -10
  349. package/src/hooks/useDataIdentityStabilityWarning.ts +86 -0
  350. package/src/hooks/useDebouncedState.ts +13 -1
  351. package/src/hooks/useDisallowedEmojis.ts +31 -42
  352. package/src/hooks/useEmojiPreviewEvents.ts +43 -10
  353. package/src/hooks/useEmojiVirtualization.tsx +112 -52
  354. package/src/hooks/useFilter.ts +92 -132
  355. package/src/hooks/useFocus.ts +14 -24
  356. package/src/hooks/useIsEmojiHidden.ts +22 -14
  357. package/src/hooks/useKeyboardNavigation.ts +412 -432
  358. package/src/hooks/useMouseDownHandlers.ts +91 -16
  359. package/src/hooks/useOnFocus.ts +12 -3
  360. package/src/hooks/useOnScroll.ts +18 -2
  361. package/src/hooks/useReactionsFocus.ts +118 -0
  362. package/src/hooks/useRegisterRegion.ts +92 -0
  363. package/src/hooks/useResolvedEmojiData.ts +200 -0
  364. package/src/hooks/useScrollCategoryIntoView.ts +74 -12
  365. package/src/hooks/useSearchController.ts +369 -0
  366. package/src/hooks/useSearchResults.ts +51 -0
  367. package/src/hooks/useSetVariationPicker.ts +4 -1
  368. package/src/index.tsx +67 -5
  369. package/src/primitives/CategoryNav.tsx +40 -0
  370. package/src/primitives/Empty.tsx +68 -0
  371. package/src/primitives/List.tsx +61 -0
  372. package/src/primitives/LoadError.tsx +38 -0
  373. package/src/primitives/Loading.tsx +60 -0
  374. package/src/primitives/Panel.tsx +47 -0
  375. package/src/primitives/Preview.tsx +38 -0
  376. package/src/primitives/Reactions.tsx +2 -0
  377. package/src/primitives/Root.tsx +398 -0
  378. package/src/primitives/Search.tsx +41 -0
  379. package/src/primitives/SearchInput.tsx +110 -0
  380. package/src/primitives/SkinTone.tsx +76 -0
  381. package/src/primitives/Viewport.tsx +204 -0
  382. package/src/primitives/appearance.tsx +7 -0
  383. package/src/primitives/components.tsx +30 -0
  384. package/src/primitives/hooks.ts +165 -0
  385. package/src/primitives/index.ts +94 -0
  386. package/src/primitives/nativeProps.ts +90 -0
  387. package/src/primitives/scope.tsx +109 -0
  388. package/src/primitives/structuralStyles.tsx +136 -0
  389. package/src/primitives/tokens.ts +150 -0
  390. package/src/primitives/types.ts +192 -0
  391. package/src/state/activeEmojiStore.ts +39 -0
  392. package/src/state/navigationRegistry.ts +209 -0
  393. package/src/state/regionTraversal.ts +116 -0
  394. package/src/svg.d.ts +2 -2
  395. package/src/types/exposedTypes.ts +28 -1
  396. package/src/virtualization/virtualizationHelpers.ts +29 -8
  397. package/dist/components/body/Body.d.ts +0 -2
  398. package/dist/components/main/PickerMain.d.ts +0 -7
  399. package/dist/dataUtils/alphaNumericEmojiIndex.d.ts +0 -5
  400. package/dist/emoji-picker-react.cjs.development.js +0 -31413
  401. package/dist/emoji-picker-react.cjs.development.js.map +0 -1
  402. package/dist/emoji-picker-react.cjs.production.min.js +0 -2
  403. package/dist/emoji-picker-react.cjs.production.min.js.map +0 -1
  404. package/dist/emoji-picker-react.esm.js +0 -31411
  405. package/dist/emoji-picker-react.esm.js.map +0 -1
  406. package/dist/hooks/useHideEmojisByUniocode.d.ts +0 -1
  407. package/src/components/body/Body.tsx +0 -43
  408. package/src/components/main/PickerMain.tsx +0 -249
  409. package/src/dataUtils/alphaNumericEmojiIndex.ts +0 -21
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
 
3
- import { EmojiStyle } from '../../types/exposedTypes';
3
+ import { resolveEmojiStyle } from '../../config/config';
4
+ import { EmojiStyleValue } from '../../types/exposedTypes';
4
5
 
5
6
  import { GetEmojiUrl } from './BaseEmojiProps';
6
7
  import { ViewOnlyEmoji } from './ViewOnlyEmoji';
@@ -8,13 +9,13 @@ import { ViewOnlyEmoji } from './ViewOnlyEmoji';
8
9
  export function ExportedEmoji({
9
10
  unified,
10
11
  size = 32,
11
- emojiStyle = EmojiStyle.APPLE,
12
+ emojiStyle,
12
13
  lazyLoad = false,
13
14
  getEmojiUrl,
14
15
  emojiUrl,
15
16
  }: {
16
17
  unified: string;
17
- emojiStyle?: EmojiStyle;
18
+ emojiStyle?: EmojiStyleValue;
18
19
  size?: number;
19
20
  lazyLoad?: boolean;
20
21
  getEmojiUrl?: GetEmojiUrl;
@@ -28,7 +29,7 @@ export function ExportedEmoji({
28
29
  <ViewOnlyEmoji
29
30
  unified={unified}
30
31
  size={size}
31
- emojiStyle={emojiStyle}
32
+ emojiStyle={resolveEmojiStyle(emojiStyle, emojiUrl || getEmojiUrl)}
32
33
  lazyLoad={lazyLoad}
33
34
  getEmojiUrl={emojiUrl ? () => emojiUrl : getEmojiUrl}
34
35
  />
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { cx } from 'shipstyles';
3
3
 
4
4
  import { stylesheet } from '../../Stylesheet/stylesheet';
5
+ import { DEFAULT_NATIVE_EMOJI_FONT } from '../../dataUtils/nativeEmojiSupport';
5
6
  import { parseNativeEmoji } from '../../dataUtils/parseNativeEmoji';
6
7
 
7
8
  import { emojiStyles } from './emojiStyles';
@@ -26,7 +27,7 @@ export function NativeEmoji({
26
27
  styles.nativeEmoji,
27
28
  className,
28
29
  )}
29
- data-unified={unified}
30
+ data-epr-unified={unified}
30
31
  style={style}
31
32
  >
32
33
  {parseNativeEmoji(unified)}
@@ -34,18 +35,20 @@ export function NativeEmoji({
34
35
  );
35
36
  }
36
37
 
37
- const styles = stylesheet.create({
38
- nativeEmoji: {
39
- '.': 'epr-emoji-native',
40
- fontFamily:
41
- '"Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "EmojiOne Color", "Android Emoji"!important',
42
- position: 'relative',
43
- lineHeight: '100%',
44
- fontSize: 'var(--epr-emoji-size)',
45
- textAlign: 'center',
46
- alignSelf: 'center',
47
- justifySelf: 'center',
48
- letterSpacing: '0',
49
- padding: 'var(--epr-emoji-padding)',
50
- },
51
- });
38
+ const styles = /* @__PURE__ */ (() =>
39
+ stylesheet.create({
40
+ nativeEmoji: {
41
+ '.': 'epr-emoji-native',
42
+ // Overridable (e.g. with a country-flag polyfill font); native support
43
+ // detection probes the same variable.
44
+ fontFamily: `var(--epr-emoji-font-family, ${DEFAULT_NATIVE_EMOJI_FONT})!important`,
45
+ position: 'relative',
46
+ lineHeight: '100%',
47
+ fontSize: 'var(--epr-emoji-size)',
48
+ textAlign: 'center',
49
+ alignSelf: 'center',
50
+ justifySelf: 'center',
51
+ letterSpacing: '0',
52
+ padding: 'var(--epr-emoji-padding)',
53
+ },
54
+ }))();
@@ -1,9 +1,19 @@
1
1
  import * as React from 'react';
2
2
 
3
- import { emojiName, emojiUrlByUnified } from '../../dataUtils/emojiUtils';
3
+ import { CustomEmoji } from '../../config/customEmojiConfig';
4
+ import { DataEmoji, EmojiProperties } from '../../dataUtils/DataTypes';
5
+ import {
6
+ addedIn,
7
+ emojiName,
8
+ emojiUrlByUnified,
9
+ } from '../../dataUtils/emojiUtils';
10
+ import { isNativeEmojiSupported } from '../../dataUtils/nativeEmojiSupport';
4
11
  import { isCustomEmoji } from '../../typeRefinements/typeRefinements';
5
12
  import { EmojiStyle } from '../../types/exposedTypes';
6
- import { useEmojisThatFailedToLoadState } from '../context/PickerContext';
13
+ import {
14
+ useEmojisThatFailedToLoadState,
15
+ useNativeEmojiSupport,
16
+ } from '../context/PickerContext';
7
17
  import { usePickerDataContext } from '../context/PickerDataContext';
8
18
 
9
19
  import { BaseEmojiProps } from './BaseEmojiProps';
@@ -21,10 +31,14 @@ export function ViewOnlyEmoji({
21
31
  }: BaseEmojiProps) {
22
32
  const [, setEmojisThatFailedToLoad] = useEmojisThatFailedToLoadState();
23
33
  const { emojiByUnified } = usePickerDataContext();
34
+ const nativeSupport = useNativeEmojiSupport();
24
35
 
25
36
  const style = {} as React.CSSProperties;
26
37
  if (size) {
27
- style.width = style.height = style.fontSize = `${size}px`;
38
+ style.width =
39
+ style.height =
40
+ style.fontSize =
41
+ typeof size === 'number' ? `${size}px` : size;
28
42
  }
29
43
 
30
44
  const emojiToRender = emoji ? emoji : emojiByUnified(unified);
@@ -33,39 +47,50 @@ export function ViewOnlyEmoji({
33
47
  return null;
34
48
  }
35
49
 
50
+ let imageUrl: string;
51
+ let imageName: string;
52
+ let imageStyle = emojiStyle;
36
53
  if (isCustomEmoji(emojiToRender)) {
37
- return (
38
- <EmojiImg
39
- style={style}
40
- emojiName={unified}
41
- emojiStyle={EmojiStyle.NATIVE}
42
- lazyLoad={lazyLoad}
43
- imgUrl={emojiToRender.imgUrl}
44
- onError={onError}
45
- className={className}
46
- />
47
- );
54
+ imageUrl = emojiToRender.imgUrl;
55
+ // Alternative text is the custom emoji's name, not its id.
56
+ imageName = customEmojiName(emojiToRender) || unified;
57
+ imageStyle = EmojiStyle.NATIVE;
58
+ } else if (emojiStyle === EmojiStyle.NATIVE) {
59
+ // Also covers managed preview/default glyphs outside the grid.
60
+ return isNativeEmojiSupported(
61
+ nativeSupport,
62
+ unified,
63
+ addedIn(emojiToRender),
64
+ ) ? (
65
+ <NativeEmoji unified={unified} style={style} className={className} />
66
+ ) : null;
67
+ } else {
68
+ imageUrl = getEmojiUrl(unified, emojiStyle);
69
+ imageName = emojiName(emojiToRender);
48
70
  }
49
71
 
50
72
  return (
51
- <>
52
- {emojiStyle === EmojiStyle.NATIVE ? (
53
- <NativeEmoji unified={unified} style={style} className={className} />
54
- ) : (
55
- <EmojiImg
56
- style={style}
57
- emojiName={emojiName(emojiToRender)}
58
- emojiStyle={emojiStyle}
59
- lazyLoad={lazyLoad}
60
- imgUrl={getEmojiUrl(unified, emojiStyle)}
61
- onError={onError}
62
- className={className}
63
- />
64
- )}
65
- </>
73
+ <EmojiImg
74
+ style={style}
75
+ emojiName={imageName}
76
+ emojiStyle={imageStyle}
77
+ lazyLoad={lazyLoad}
78
+ imgUrl={imageUrl}
79
+ onError={onError}
80
+ className={className}
81
+ />
66
82
  );
67
83
 
68
84
  function onError() {
69
- setEmojisThatFailedToLoad((prev) => new Set(prev).add(unified));
85
+ setEmojisThatFailedToLoad(unified);
70
86
  }
71
87
  }
88
+
89
+ // A custom emoji reaches the renderer either as the consumer's `CustomEmoji`
90
+ // (`names`) or as the dataset entry it was converted into (`n`).
91
+ function customEmojiName(emoji: CustomEmoji | DataEmoji): string {
92
+ return (
93
+ emojiName(emoji as DataEmoji) ||
94
+ emojiName({ [EmojiProperties.name]: (emoji as CustomEmoji).names })
95
+ );
96
+ }
@@ -1,14 +1,15 @@
1
1
  import { ClassNames } from '../../DomUtils/classNames';
2
2
  import { stylesheet } from '../../Stylesheet/stylesheet';
3
3
 
4
- export const emojiStyles = stylesheet.create({
5
- external: {
6
- '.': ClassNames.external,
7
- fontSize: '0',
8
- },
9
- common: {
10
- alignSelf: 'center',
11
- justifySelf: 'center',
12
- display: 'block',
13
- },
14
- });
4
+ export const emojiStyles = /* @__PURE__ */ (() =>
5
+ stylesheet.create({
6
+ external: {
7
+ '.': ClassNames.external,
8
+ fontSize: '0',
9
+ },
10
+ common: {
11
+ alignSelf: 'center',
12
+ justifySelf: 'center',
13
+ display: 'block',
14
+ },
15
+ }))();
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import { useState } from 'react';
3
2
  import { cx } from 'shipstyles';
4
3
 
5
4
  import {
@@ -12,128 +11,124 @@ import {
12
11
  usePreviewConfig,
13
12
  } from '../../config/useConfig';
14
13
  import { emojiName, emojiUnified } from '../../dataUtils/emojiUtils';
15
- import { useEmojiPreviewEvents } from '../../hooks/useEmojiPreviewEvents';
16
- import { useIsSkinToneInPreview } from '../../hooks/useShouldShowSkinTonePicker';
14
+ import { useDefaultAppearance } from '../../primitives/appearance';
17
15
  import Flex from '../Layout/Flex';
18
16
  import Space from '../Layout/Space';
19
17
  import {
18
+ ActiveEmojiState,
19
+ useActiveEmojiState,
20
20
  useEmojiVariationPickerState,
21
21
  useReactionsModeState,
22
22
  } from '../context/PickerContext';
23
23
  import { usePickerDataContext } from '../context/PickerDataContext';
24
24
  import { ViewOnlyEmoji } from '../emoji/ViewOnlyEmoji';
25
- import { SkinTonePickerMenu } from '../header/SkinTonePicker/SkinTonePicker';
26
25
 
27
- export function Preview() {
28
- const previewConfig = usePreviewConfig();
29
- const isSkinToneInPreview = useIsSkinToneInPreview();
26
+ export function Preview({ children }: { children?: React.ReactNode }) {
27
+ const appearance = useDefaultAppearance();
30
28
  const [reactionsOpen] = useReactionsModeState();
31
29
 
32
- if (!previewConfig.showPreview) {
33
- return null;
34
- }
35
-
36
30
  return (
37
31
  <Flex
38
32
  className={cx(
39
- styles.preview,
40
- commonInteractionStyles.hiddenOnReactions,
41
- reactionsOpen && styles.hideOnReactions,
33
+ styles.previewGeometry,
34
+ appearance && styles.preview,
35
+ appearance && commonInteractionStyles.hiddenOnReactions,
36
+ appearance && reactionsOpen && styles.hideOnReactions,
42
37
  )}
43
38
  >
44
39
  <PreviewBody />
45
40
  <Space />
46
- {isSkinToneInPreview ? <SkinTonePickerMenu /> : null}
41
+ {children}
47
42
  </Flex>
48
43
  );
49
44
  }
50
45
 
51
46
  export function PreviewBody() {
47
+ const appearance = useDefaultAppearance();
52
48
  const previewConfig = usePreviewConfig();
53
- const [previewEmoji, setPreviewEmoji] = useState<PreviewEmoji>(null);
49
+ const [previewEmoji] = useActiveEmojiState();
54
50
  const emojiStyle = useEmojiStyleConfig();
55
51
  const [variationPickerEmoji] = useEmojiVariationPickerState();
56
52
  const getEmojiUrl = useGetEmojiUrlConfig();
57
53
  const { emojiByUnified } = usePickerDataContext();
58
54
 
59
- useEmojiPreviewEvents(previewConfig.showPreview, setPreviewEmoji);
60
-
61
- const emoji = emojiByUnified(
62
- (previewEmoji?.unified ?? previewEmoji?.originalUnified) as
63
- | string
64
- | undefined,
65
- );
66
-
67
- const show = emoji != null && previewEmoji != null;
55
+ const emoji = previewEmoji
56
+ ? emojiByUnified(previewEmoji.unified || previewEmoji.originalUnified)
57
+ : undefined;
68
58
 
69
- return <PreviewContent />;
59
+ const show = emoji != null;
70
60
 
71
- function PreviewContent() {
72
- const defaultEmoji =
73
- variationPickerEmoji ?? emojiByUnified(previewConfig.defaultEmoji);
74
- if (!defaultEmoji) {
75
- return null;
76
- }
77
- const defaultText = variationPickerEmoji
78
- ? emojiName(variationPickerEmoji)
79
- : previewConfig.defaultCaption;
80
-
81
- return (
82
- <>
83
- <div>
84
- {show ? (
85
- <ViewOnlyEmoji
86
- unified={previewEmoji?.unified as string}
87
- emoji={emoji}
88
- emojiStyle={emojiStyle}
89
- size={45}
90
- getEmojiUrl={getEmojiUrl}
91
- className={cx(styles.emoji)}
92
- />
93
- ) : defaultEmoji ? (
94
- <ViewOnlyEmoji
95
- unified={emojiUnified(defaultEmoji)}
96
- emoji={defaultEmoji}
97
- emojiStyle={emojiStyle}
98
- size={45}
99
- getEmojiUrl={getEmojiUrl}
100
- className={cx(styles.emoji)}
101
- />
102
- ) : null}
103
- </div>
104
- <div className={cx(styles.label)}>
105
- {show ? emojiName(emoji) : defaultText}
106
- </div>
107
- </>
108
- );
61
+ // Rendered inline rather than as a nested component: a component defined
62
+ // inside render gets a new identity every render, which remounted the
63
+ // preview (and reloaded its image) on every hover.
64
+ const defaultEmoji =
65
+ variationPickerEmoji ?? emojiByUnified(previewConfig.defaultEmoji);
66
+ if (!defaultEmoji) {
67
+ return null;
109
68
  }
69
+ const defaultText = variationPickerEmoji
70
+ ? emojiName(variationPickerEmoji)
71
+ : previewConfig.defaultCaption;
72
+
73
+ return (
74
+ <>
75
+ <div>
76
+ {show ? (
77
+ <ViewOnlyEmoji
78
+ unified={previewEmoji?.unified as string}
79
+ emoji={emoji}
80
+ emojiStyle={emojiStyle}
81
+ size={PREVIEW_EMOJI_SIZE}
82
+ getEmojiUrl={getEmojiUrl}
83
+ className={cx(styles.emoji)}
84
+ />
85
+ ) : (
86
+ <ViewOnlyEmoji
87
+ unified={emojiUnified(defaultEmoji)}
88
+ emoji={defaultEmoji}
89
+ emojiStyle={emojiStyle}
90
+ size={PREVIEW_EMOJI_SIZE}
91
+ getEmojiUrl={getEmojiUrl}
92
+ className={cx(styles.emoji)}
93
+ />
94
+ )}
95
+ </div>
96
+ <div className={cx(styles.labelGeometry, appearance && styles.label)}>
97
+ {show ? emojiName(emoji) : defaultText}
98
+ </div>
99
+ </>
100
+ );
110
101
  }
111
102
 
112
- export type PreviewEmoji = null | {
113
- unified: string;
114
- originalUnified: string;
115
- };
103
+ export type PreviewEmoji = ActiveEmojiState;
104
+
105
+ // Tokenized so compact previews can shrink the emoji (default 45px).
106
+ const PREVIEW_EMOJI_SIZE = 'var(--epr-preview-emoji-size)';
116
107
 
117
- const styles = stylesheet.create({
118
- preview: {
119
- alignItems: 'center',
120
- borderTop: '1px solid var(--epr-preview-border-color)',
121
- height: 'var(--epr-preview-height)',
122
- padding: '0 var(--epr-horizontal-padding)',
123
- position: 'relative',
124
- zIndex: 'var(--epr-preview-z-index)',
125
- },
126
- label: {
127
- color: 'var(--epr-preview-text-color)',
128
- fontSize: 'var(--epr-preview-text-size)',
129
- padding: 'var(--epr-preview-text-padding)',
130
- textTransform: 'capitalize',
131
- },
132
- emoji: {
133
- padding: '0',
134
- },
135
- hideOnReactions: {
136
- opacity: '0',
137
- transition: 'opacity 0.5s ease-in-out',
138
- },
139
- });
108
+ const styles = /* @__PURE__ */ (() =>
109
+ stylesheet.create({
110
+ previewGeometry: {
111
+ alignItems: 'center',
112
+ height: 'var(--epr-preview-height)',
113
+ padding: '0 var(--epr-horizontal-padding)',
114
+ position: 'relative',
115
+ zIndex: 'var(--epr-preview-z-index)',
116
+ },
117
+ labelGeometry: { padding: 'var(--epr-preview-text-padding)' },
118
+ preview: {
119
+ borderTop: '1px solid var(--epr-preview-border-color)',
120
+ zIndex: 'var(--epr-preview-z-index)',
121
+ },
122
+ label: {
123
+ color: 'var(--epr-preview-text-color)',
124
+ fontSize: 'var(--epr-preview-text-size)',
125
+ textTransform: 'capitalize',
126
+ },
127
+ emoji: {
128
+ padding: '0',
129
+ },
130
+ hideOnReactions: {
131
+ opacity: '0',
132
+ transition: 'opacity 0.5s ease-in-out',
133
+ },
134
+ }))();
@@ -2,18 +2,33 @@ import * as React from 'react';
2
2
  import { cx } from 'shipstyles';
3
3
 
4
4
  import { commonInteractionStyles } from '../../Stylesheet/stylesheet';
5
+ import {
6
+ useSearchDisabledConfig,
7
+ useSkinTonesDisabledConfig,
8
+ } from '../../config/useConfig';
9
+ import { useIsSkinToneInSearch } from '../../hooks/useShouldShowSkinTonePicker';
10
+ import { CategoryNav, Search, SkinTone } from '../../primitives';
11
+ import { useDefaultAppearance } from '../../primitives/appearance';
5
12
  import Relative from '../Layout/Relative';
6
- import { CategoryNavigation } from '../navigation/CategoryNavigation';
7
-
8
- import { SearchContainer } from './Search/Search';
9
13
 
14
+ // Default header layout: private appearance/layout wrapper around the
15
+ // public Search and CategoryNav primitives.
10
16
  export function Header() {
17
+ const appearance = useDefaultAppearance();
18
+ const searchDisabled = useSearchDisabledConfig();
19
+ const skinTonesDisabled = useSkinTonesDisabledConfig();
20
+ const toneInSearch = useIsSkinToneInSearch();
11
21
  return (
12
22
  <Relative
13
- className={cx('epr-header', commonInteractionStyles.hiddenOnReactions)}
23
+ className={cx(
24
+ 'epr-header',
25
+ appearance && commonInteractionStyles.hiddenOnReactions,
26
+ )}
14
27
  >
15
- <SearchContainer />
16
- <CategoryNavigation />
28
+ {!searchDisabled && (
29
+ <Search>{!skinTonesDisabled && toneInSearch && <SkinTone />}</Search>
30
+ )}
31
+ <CategoryNav />
17
32
  </Relative>
18
33
  );
19
34
  }
@@ -7,28 +7,39 @@ import {
7
7
  stylesheet,
8
8
  } from '../../../Stylesheet/stylesheet';
9
9
  import { useSearchClearButtonLabelConfig } from '../../../config/useConfig';
10
- import { useClearSearch } from '../../../hooks/useFilter';
10
+ import { useClearSearchValue } from '../../../hooks/useSearchController';
11
+ import { useDefaultAppearance } from '../../../primitives/appearance';
12
+ import { usePickerComponents } from '../../../primitives/components';
11
13
  import { Button } from '../../atoms/Button';
12
-
13
- import SVGTimes from './svg/times.svg';
14
+ import { TIMES_ICON as SVGTimes } from '../../icons/svgIcons';
14
15
 
15
16
  export function BtnClearSearch() {
16
- const clearSearch = useClearSearch();
17
+ const clearSearch = useClearSearchValue();
17
18
  const searchClearButtonLabel = useSearchClearButtonLabelConfig();
18
19
 
19
- return (
20
- <Button
21
- className={cx(
22
- styles.btnClearSearch,
23
- commonInteractionStyles.visibleOnSearchOnly,
24
- )}
25
- onClick={clearSearch}
26
- aria-label={searchClearButtonLabel}
27
- title={searchClearButtonLabel}
28
- >
29
- <div className={cx(styles.icnClearnSearch)} />
30
- </Button>
31
- );
20
+ const appearance = useDefaultAppearance();
21
+ const { ClearButton: Custom } = usePickerComponents();
22
+ const props = {
23
+ type: 'button' as const,
24
+ className: cx(
25
+ styles.geometry,
26
+ appearance && !Custom && styles.btnClearSearch,
27
+ commonInteractionStyles.visibleOnSearchOnly,
28
+ ),
29
+ onClick: (event: React.MouseEvent<HTMLButtonElement>) => {
30
+ if (!event.defaultPrevented) clearSearch();
31
+ },
32
+ 'data-epr-part': 'search-clear',
33
+ 'aria-label': searchClearButtonLabel,
34
+ title: searchClearButtonLabel,
35
+ children:
36
+ appearance && !Custom ? (
37
+ <div className={cx(styles.icnClearnSearch)} />
38
+ ) : (
39
+ '×'
40
+ ),
41
+ };
42
+ return Custom ? <Custom {...props} /> : <Button {...props} />;
32
43
  }
33
44
 
34
45
  const HoverDark = {
@@ -39,44 +50,47 @@ const HoverDark = {
39
50
  },
40
51
  };
41
52
 
42
- const styles = stylesheet.create({
43
- btnClearSearch: {
44
- '.': 'epr-btn-clear-search',
45
- position: 'absolute',
46
- right: 'var(--epr-search-bar-inner-padding)',
47
- height: '30px',
48
- width: '30px',
49
- display: 'flex',
50
- alignItems: 'center',
51
- justifyContent: 'center',
52
- top: '50%',
53
- transform: 'translateY(-50%)',
54
- padding: '0',
55
- borderRadius: '50%',
56
- ':hover': {
57
- background: 'var(--epr-hover-bg-color)',
53
+ const styles = /* @__PURE__ */ (() =>
54
+ stylesheet.create({
55
+ geometry: {
56
+ position: 'absolute',
57
+ insetInlineEnd: 'var(--epr-search-bar-inner-padding)',
58
+ height: '30px',
59
+ width: '30px',
60
+ display: 'flex',
61
+ alignItems: 'center',
62
+ justifyContent: 'center',
63
+ top: '50%',
64
+ transform: 'translateY(-50%)',
65
+ padding: '0',
58
66
  },
59
- ':focus': {
60
- background: 'var(--epr-hover-bg-color)',
67
+ btnClearSearch: {
68
+ '.': 'epr-btn-clear-search',
69
+ borderRadius: '50%',
70
+ ':hover': {
71
+ background: 'var(--epr-hover-bg-color)',
72
+ },
73
+ ':focus': {
74
+ background: 'var(--epr-hover-bg-color)',
75
+ },
61
76
  },
62
- },
63
- icnClearnSearch: {
64
- '.': 'epr-icn-clear-search',
65
- backgroundColor: 'transparent',
66
- backgroundRepeat: 'no-repeat',
67
- backgroundSize: '20px',
68
- height: '20px',
69
- width: '20px',
70
- backgroundImage: `url(${SVGTimes})`,
71
- ':hover': {
72
- backgroundPositionY: '-20px',
77
+ icnClearnSearch: {
78
+ '.': 'epr-icn-clear-search',
79
+ backgroundColor: 'transparent',
80
+ backgroundRepeat: 'no-repeat',
81
+ backgroundSize: '20px',
82
+ height: '20px',
83
+ width: '20px',
84
+ backgroundImage: `url("${SVGTimes}")`,
85
+ ':hover': {
86
+ backgroundPositionY: '-20px',
87
+ },
88
+ ':focus': {
89
+ backgroundPositionY: '-20px',
90
+ },
73
91
  },
74
- ':focus': {
75
- backgroundPositionY: '-20px',
76
- },
77
- },
78
- ...darkMode('icnClearnSearch', {
79
- backgroundPositionY: '-40px',
80
- }),
81
- ...darkMode('btnClearSearch', HoverDark),
82
- });
92
+ ...darkMode('icnClearnSearch', {
93
+ backgroundPositionY: '-40px',
94
+ }),
95
+ ...darkMode('btnClearSearch', HoverDark),
96
+ }))();