@mantine/emoji 0.0.0-stage → 9.8.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 (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -2
  3. package/cjs/adapters/emoji-mart-adapter.cjs +30 -0
  4. package/cjs/adapters/emoji-mart-adapter.cjs.map +1 -0
  5. package/cjs/adapters/emojibase-adapter.cjs +76 -0
  6. package/cjs/adapters/emojibase-adapter.cjs.map +1 -0
  7. package/cjs/categories.cjs +52 -0
  8. package/cjs/categories.cjs.map +1 -0
  9. package/cjs/components/EmojiPicker/EmojiButton.cjs +24 -0
  10. package/cjs/components/EmojiPicker/EmojiButton.cjs.map +1 -0
  11. package/cjs/components/EmojiPicker/EmojiPicker.cjs +289 -0
  12. package/cjs/components/EmojiPicker/EmojiPicker.cjs.map +1 -0
  13. package/cjs/components/EmojiPicker/EmojiPicker.context.cjs +7 -0
  14. package/cjs/components/EmojiPicker/EmojiPicker.context.cjs.map +1 -0
  15. package/cjs/components/EmojiPicker/EmojiPicker.module.cjs +22 -0
  16. package/cjs/components/EmojiPicker/EmojiPicker.module.cjs.map +1 -0
  17. package/cjs/components/EmojiPicker/EmojiPickerCategoryNav.cjs +38 -0
  18. package/cjs/components/EmojiPicker/EmojiPickerCategoryNav.cjs.map +1 -0
  19. package/cjs/components/EmojiPicker/EmojiPickerGrid.cjs +131 -0
  20. package/cjs/components/EmojiPicker/EmojiPickerGrid.cjs.map +1 -0
  21. package/cjs/components/EmojiPicker/EmojiPickerPreview.cjs +24 -0
  22. package/cjs/components/EmojiPicker/EmojiPickerPreview.cjs.map +1 -0
  23. package/cjs/components/EmojiPicker/EmojiPickerSearch.cjs +57 -0
  24. package/cjs/components/EmojiPicker/EmojiPickerSearch.cjs.map +1 -0
  25. package/cjs/components/EmojiPicker/EmojiPickerSkinTone.cjs +63 -0
  26. package/cjs/components/EmojiPicker/EmojiPickerSkinTone.cjs.map +1 -0
  27. package/cjs/components/EmojiPickerInput/EmojiPickerInput.cjs +190 -0
  28. package/cjs/components/EmojiPickerInput/EmojiPickerInput.cjs.map +1 -0
  29. package/cjs/components/EmojiPickerInput/EmojiPickerInput.module.cjs +11 -0
  30. package/cjs/components/EmojiPickerInput/EmojiPickerInput.module.cjs.map +1 -0
  31. package/cjs/components/EmojiPickerPopover/EmojiPickerPopover.cjs +59 -0
  32. package/cjs/components/EmojiPickerPopover/EmojiPickerPopover.cjs.map +1 -0
  33. package/cjs/components/EmojiPickerPopover/EmojiPickerPopover.module.cjs +6 -0
  34. package/cjs/components/EmojiPickerPopover/EmojiPickerPopover.module.cjs.map +1 -0
  35. package/cjs/hooks/use-emoji-grid-navigation.cjs +70 -0
  36. package/cjs/hooks/use-emoji-grid-navigation.cjs.map +1 -0
  37. package/cjs/hooks/use-emoji-search.cjs +21 -0
  38. package/cjs/hooks/use-emoji-search.cjs.map +1 -0
  39. package/cjs/index.cjs +22 -0
  40. package/cjs/types.cjs +20 -0
  41. package/cjs/types.cjs.map +1 -0
  42. package/cjs/utils/emoji-grid-utils.cjs +57 -0
  43. package/cjs/utils/emoji-grid-utils.cjs.map +1 -0
  44. package/cjs/utils/flatten-emoji-data.cjs +33 -0
  45. package/cjs/utils/flatten-emoji-data.cjs.map +1 -0
  46. package/cjs/utils/is-emoji-supported.cjs +64 -0
  47. package/cjs/utils/is-emoji-supported.cjs.map +1 -0
  48. package/cjs/utils/search-emojis.cjs +21 -0
  49. package/cjs/utils/search-emojis.cjs.map +1 -0
  50. package/esm/adapters/emoji-mart-adapter.mjs +30 -0
  51. package/esm/adapters/emoji-mart-adapter.mjs.map +1 -0
  52. package/esm/adapters/emojibase-adapter.mjs +76 -0
  53. package/esm/adapters/emojibase-adapter.mjs.map +1 -0
  54. package/esm/categories.mjs +47 -0
  55. package/esm/categories.mjs.map +1 -0
  56. package/esm/components/EmojiPicker/EmojiButton.mjs +24 -0
  57. package/esm/components/EmojiPicker/EmojiButton.mjs.map +1 -0
  58. package/esm/components/EmojiPicker/EmojiPicker.context.mjs +7 -0
  59. package/esm/components/EmojiPicker/EmojiPicker.context.mjs.map +1 -0
  60. package/esm/components/EmojiPicker/EmojiPicker.mjs +289 -0
  61. package/esm/components/EmojiPicker/EmojiPicker.mjs.map +1 -0
  62. package/esm/components/EmojiPicker/EmojiPicker.module.mjs +22 -0
  63. package/esm/components/EmojiPicker/EmojiPicker.module.mjs.map +1 -0
  64. package/esm/components/EmojiPicker/EmojiPickerCategoryNav.mjs +38 -0
  65. package/esm/components/EmojiPicker/EmojiPickerCategoryNav.mjs.map +1 -0
  66. package/esm/components/EmojiPicker/EmojiPickerGrid.mjs +131 -0
  67. package/esm/components/EmojiPicker/EmojiPickerGrid.mjs.map +1 -0
  68. package/esm/components/EmojiPicker/EmojiPickerPreview.mjs +24 -0
  69. package/esm/components/EmojiPicker/EmojiPickerPreview.mjs.map +1 -0
  70. package/esm/components/EmojiPicker/EmojiPickerSearch.mjs +57 -0
  71. package/esm/components/EmojiPicker/EmojiPickerSearch.mjs.map +1 -0
  72. package/esm/components/EmojiPicker/EmojiPickerSkinTone.mjs +63 -0
  73. package/esm/components/EmojiPicker/EmojiPickerSkinTone.mjs.map +1 -0
  74. package/esm/components/EmojiPickerInput/EmojiPickerInput.mjs +190 -0
  75. package/esm/components/EmojiPickerInput/EmojiPickerInput.mjs.map +1 -0
  76. package/esm/components/EmojiPickerInput/EmojiPickerInput.module.mjs +11 -0
  77. package/esm/components/EmojiPickerInput/EmojiPickerInput.module.mjs.map +1 -0
  78. package/esm/components/EmojiPickerPopover/EmojiPickerPopover.mjs +59 -0
  79. package/esm/components/EmojiPickerPopover/EmojiPickerPopover.mjs.map +1 -0
  80. package/esm/components/EmojiPickerPopover/EmojiPickerPopover.module.mjs +6 -0
  81. package/esm/components/EmojiPickerPopover/EmojiPickerPopover.module.mjs.map +1 -0
  82. package/esm/hooks/use-emoji-grid-navigation.mjs +70 -0
  83. package/esm/hooks/use-emoji-grid-navigation.mjs.map +1 -0
  84. package/esm/hooks/use-emoji-search.mjs +21 -0
  85. package/esm/hooks/use-emoji-search.mjs.map +1 -0
  86. package/esm/index.mjs +11 -0
  87. package/esm/types.mjs +20 -0
  88. package/esm/types.mjs.map +1 -0
  89. package/esm/utils/emoji-grid-utils.mjs +54 -0
  90. package/esm/utils/emoji-grid-utils.mjs.map +1 -0
  91. package/esm/utils/flatten-emoji-data.mjs +33 -0
  92. package/esm/utils/flatten-emoji-data.mjs.map +1 -0
  93. package/esm/utils/is-emoji-supported.mjs +63 -0
  94. package/esm/utils/is-emoji-supported.mjs.map +1 -0
  95. package/esm/utils/search-emojis.mjs +21 -0
  96. package/esm/utils/search-emojis.mjs.map +1 -0
  97. package/lib/adapters/emoji-mart-adapter.d.ts +23 -0
  98. package/lib/adapters/emojibase-adapter.d.ts +25 -0
  99. package/lib/adapters/index.d.ts +2 -0
  100. package/lib/categories.d.ts +7 -0
  101. package/lib/components/EmojiPicker/EmojiButton.d.ts +10 -0
  102. package/lib/components/EmojiPicker/EmojiPicker.context.d.ts +9 -0
  103. package/lib/components/EmojiPicker/EmojiPicker.d.ts +64 -0
  104. package/lib/components/EmojiPicker/EmojiPickerCategoryNav.d.ts +10 -0
  105. package/lib/components/EmojiPicker/EmojiPickerGrid.d.ts +23 -0
  106. package/lib/components/EmojiPicker/EmojiPickerPreview.d.ts +9 -0
  107. package/lib/components/EmojiPicker/EmojiPickerSearch.d.ts +14 -0
  108. package/lib/components/EmojiPicker/EmojiPickerSkinTone.d.ts +6 -0
  109. package/lib/components/EmojiPicker/index.d.ts +2 -0
  110. package/lib/components/EmojiPickerInput/EmojiPickerInput.d.ts +54 -0
  111. package/lib/components/EmojiPickerInput/index.d.ts +2 -0
  112. package/lib/components/EmojiPickerPopover/EmojiPickerPopover.d.ts +24 -0
  113. package/lib/components/EmojiPickerPopover/index.d.ts +2 -0
  114. package/lib/hooks/index.d.ts +2 -0
  115. package/lib/hooks/use-emoji-grid-navigation.d.ts +18 -0
  116. package/lib/hooks/use-emoji-search.d.ts +14 -0
  117. package/lib/index.d.mts +10 -0
  118. package/lib/index.d.ts +10 -0
  119. package/lib/types.d.ts +41 -0
  120. package/lib/utils/emoji-grid-utils.d.ts +17 -0
  121. package/lib/utils/flatten-emoji-data.d.ts +2 -0
  122. package/lib/utils/index.d.ts +5 -0
  123. package/lib/utils/is-emoji-supported.d.ts +4 -0
  124. package/lib/utils/search-emojis.d.ts +2 -0
  125. package/package.json +54 -4
  126. package/styles.css +228 -0
  127. package/styles.layer.css +229 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Vitaly Rtishchev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,21 @@
1
- # Temporary Holding Version
1
+ # @mantine/emoji
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm](https://img.shields.io/npm/dm/@mantine/emoji)](https://www.npmjs.com/package/@mantine/emoji)
4
+
5
+ Emoji picker components for Mantine
6
+
7
+ [View documentation](https://mantine.dev/)
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ # With yarn
13
+ yarn add @mantine/emoji
14
+
15
+ # With npm
16
+ npm install @mantine/emoji
17
+ ```
18
+
19
+ ## License
20
+
21
+ MIT
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ const require_categories = require("../categories.cjs");
3
+ // packages/@mantine/emoji/src/adapters/emoji-mart-adapter.ts
4
+ function emojiMartAdapter(input) {
5
+ const data = input;
6
+ const emojis = {};
7
+ for (const [id, emojiMartEmoji] of Object.entries(data.emojis)) {
8
+ const defaultSkin = emojiMartEmoji.skins[0];
9
+ const skinVariants = emojiMartEmoji.skins.length === 6 ? emojiMartEmoji.skins.slice(1).map((s) => s.native) : void 0;
10
+ emojis[id] = {
11
+ id,
12
+ name: emojiMartEmoji.name,
13
+ keywords: emojiMartEmoji.keywords,
14
+ emoji: defaultSkin.native,
15
+ skins: skinVariants,
16
+ version: emojiMartEmoji.version
17
+ };
18
+ }
19
+ return {
20
+ categories: data.categories.map((cat) => ({
21
+ id: cat.id,
22
+ label: require_categories.getCanonicalCategoryLabel(cat.id) || cat.id,
23
+ emojis: cat.emojis
24
+ })),
25
+ emojis
26
+ };
27
+ }
28
+ exports.emojiMartAdapter = emojiMartAdapter;
29
+
30
+ //# sourceMappingURL=emoji-mart-adapter.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emoji-mart-adapter.cjs","names":["getCanonicalCategoryLabel"],"sources":["../../src/adapters/emoji-mart-adapter.ts"],"sourcesContent":["import { getCanonicalCategoryLabel } from '../categories';\nimport type { EmojiPickerCategory, EmojiPickerData, EmojiPickerEmoji } from '../types';\n\ninterface EmojiMartSkin {\n unified: string;\n native: string;\n}\n\ninterface EmojiMartEmoji {\n id: string;\n name: string;\n keywords: string[];\n skins: EmojiMartSkin[];\n version: number;\n}\n\ninterface EmojiMartCategory {\n id: string;\n emojis: string[];\n}\n\ninterface EmojiMartData {\n categories: EmojiMartCategory[];\n emojis: Record<string, EmojiMartEmoji>;\n}\n\nexport function emojiMartAdapter(data: EmojiMartData): EmojiPickerData;\nexport function emojiMartAdapter(data: object): EmojiPickerData;\nexport function emojiMartAdapter(input: object): EmojiPickerData {\n const data = input as EmojiMartData;\n const emojis: Record<string, EmojiPickerEmoji> = {};\n\n for (const [id, emojiMartEmoji] of Object.entries(data.emojis)) {\n const defaultSkin = emojiMartEmoji.skins[0];\n const skinVariants =\n emojiMartEmoji.skins.length === 6\n ? emojiMartEmoji.skins.slice(1).map((s) => s.native)\n : undefined;\n\n emojis[id] = {\n id,\n name: emojiMartEmoji.name,\n keywords: emojiMartEmoji.keywords,\n emoji: defaultSkin.native,\n skins: skinVariants,\n version: emojiMartEmoji.version,\n };\n }\n\n const categories: EmojiPickerCategory[] = data.categories.map((cat) => ({\n id: cat.id,\n label: getCanonicalCategoryLabel(cat.id) || cat.id,\n emojis: cat.emojis,\n }));\n\n return { categories, emojis };\n}\n"],"mappings":";;;AA4BA,SAAgB,iBAAiB,OAAgC;CAC/D,MAAM,OAAO;CACb,MAAM,SAA2C,CAAC;CAElD,KAAK,MAAM,CAAC,IAAI,mBAAmB,OAAO,QAAQ,KAAK,MAAM,GAAG;EAC9D,MAAM,cAAc,eAAe,MAAM;EACzC,MAAM,eACJ,eAAe,MAAM,WAAW,IAC5B,eAAe,MAAM,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,MAAM,IACjD,KAAA;EAEN,OAAO,MAAM;GACX;GACA,MAAM,eAAe;GACrB,UAAU,eAAe;GACzB,OAAO,YAAY;GACnB,OAAO;GACP,SAAS,eAAe;EAC1B;CACF;CAQA,OAAO;EAAE,YANiC,KAAK,WAAW,KAAK,SAAS;GACtE,IAAI,IAAI;GACR,OAAOA,mBAAAA,0BAA0B,IAAI,EAAE,KAAK,IAAI;GAChD,QAAQ,IAAI;EACd,EAEkB;EAAG;CAAO;AAC9B"}
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ const require_categories = require("../categories.cjs");
3
+ // packages/@mantine/emoji/src/adapters/emojibase-adapter.ts
4
+ const GROUP_TO_CANONICAL = {
5
+ 0: "people",
6
+ 1: "people",
7
+ 3: "nature",
8
+ 4: "foods",
9
+ 5: "places",
10
+ 6: "activity",
11
+ 7: "objects",
12
+ 8: "symbols",
13
+ 9: "flags"
14
+ };
15
+ const CATEGORY_ORDER = require_categories.CANONICAL_CATEGORY_IDS.filter((id) => id !== "frequent");
16
+ function getUniformTone(tone) {
17
+ if (typeof tone === "number") return tone;
18
+ if (Array.isArray(tone) && tone.length > 0 && tone.every((t) => t === tone[0])) return tone[0];
19
+ return null;
20
+ }
21
+ function getSkinVariants(skins) {
22
+ if (!skins || skins.length === 0) return;
23
+ const byTone = /* @__PURE__ */ new Map();
24
+ for (const skin of skins) {
25
+ const tone = getUniformTone(skin.tone);
26
+ if (tone !== null && !byTone.has(tone)) byTone.set(tone, skin.emoji);
27
+ }
28
+ const variants = [
29
+ 1,
30
+ 2,
31
+ 3,
32
+ 4,
33
+ 5
34
+ ].map((tone) => byTone.get(tone));
35
+ return variants.every((variant) => variant !== void 0) ? variants : void 0;
36
+ }
37
+ function emojibaseAdapter(data, messages) {
38
+ const emojis = {};
39
+ const categoryEmojis = /* @__PURE__ */ new Map();
40
+ const groupLabels = /* @__PURE__ */ new Map();
41
+ for (const group of messages.groups) groupLabels.set(group.order, group.message);
42
+ for (const emojibaseEmoji of data) {
43
+ if (emojibaseEmoji.group === void 0) continue;
44
+ const canonicalId = GROUP_TO_CANONICAL[emojibaseEmoji.group];
45
+ if (!canonicalId) continue;
46
+ const id = emojibaseEmoji.hexcode;
47
+ emojis[id] = {
48
+ id,
49
+ name: emojibaseEmoji.label,
50
+ keywords: emojibaseEmoji.tags || [],
51
+ emoji: emojibaseEmoji.emoji,
52
+ skins: getSkinVariants(emojibaseEmoji.skins),
53
+ version: emojibaseEmoji.version
54
+ };
55
+ if (!categoryEmojis.has(canonicalId)) categoryEmojis.set(canonicalId, []);
56
+ categoryEmojis.get(canonicalId).push(emojibaseEmoji);
57
+ }
58
+ const categories = [];
59
+ for (const canonicalId of CATEGORY_ORDER) {
60
+ const items = categoryEmojis.get(canonicalId);
61
+ if (!items) continue;
62
+ items.sort((a, b) => (a.order ?? Number.MAX_SAFE_INTEGER) - (b.order ?? Number.MAX_SAFE_INTEGER));
63
+ categories.push({
64
+ id: canonicalId,
65
+ label: require_categories.CANONICAL_CATEGORY_LABELS[canonicalId] || groupLabels.get(items[0].group) || canonicalId,
66
+ emojis: items.map((item) => item.hexcode)
67
+ });
68
+ }
69
+ return {
70
+ categories,
71
+ emojis
72
+ };
73
+ }
74
+ exports.emojibaseAdapter = emojibaseAdapter;
75
+
76
+ //# sourceMappingURL=emojibase-adapter.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emojibase-adapter.cjs","names":["CANONICAL_CATEGORY_IDS","CANONICAL_CATEGORY_LABELS"],"sources":["../../src/adapters/emojibase-adapter.ts"],"sourcesContent":["import {\n CANONICAL_CATEGORY_IDS,\n CANONICAL_CATEGORY_LABELS,\n type CanonicalCategoryId,\n} from '../categories';\nimport type { EmojiPickerCategory, EmojiPickerData, EmojiPickerEmoji } from '../types';\n\ninterface EmojibaseSkin {\n emoji: string;\n tone?: number | number[];\n}\n\ninterface EmojibaseEmoji {\n label: string;\n hexcode: string;\n emoji: string;\n tags?: string[];\n group?: number;\n order?: number;\n version: number;\n skins?: EmojibaseSkin[];\n}\n\ninterface EmojibaseGroupMessage {\n key: string;\n message: string;\n order: number;\n}\n\ninterface EmojibaseMessages {\n groups: EmojibaseGroupMessage[];\n}\n\nconst GROUP_TO_CANONICAL: Record<number, Exclude<CanonicalCategoryId, 'frequent'>> = {\n 0: 'people',\n 1: 'people',\n 3: 'nature',\n 4: 'foods',\n 5: 'places',\n 6: 'activity',\n 7: 'objects',\n 8: 'symbols',\n 9: 'flags',\n};\n\nconst CATEGORY_ORDER = CANONICAL_CATEGORY_IDS.filter(\n (id): id is Exclude<CanonicalCategoryId, 'frequent'> => id !== 'frequent'\n);\n\nfunction getUniformTone(tone: EmojibaseSkin['tone']) {\n if (typeof tone === 'number') {\n return tone;\n }\n\n if (Array.isArray(tone) && tone.length > 0 && tone.every((t) => t === tone[0])) {\n return tone[0];\n }\n\n return null;\n}\n\nfunction getSkinVariants(skins: EmojibaseSkin[] | undefined) {\n if (!skins || skins.length === 0) {\n return undefined;\n }\n\n const byTone = new Map<number, string>();\n for (const skin of skins) {\n const tone = getUniformTone(skin.tone);\n if (tone !== null && !byTone.has(tone)) {\n byTone.set(tone, skin.emoji);\n }\n }\n\n const variants = [1, 2, 3, 4, 5].map((tone) => byTone.get(tone));\n return variants.every((variant) => variant !== undefined) ? (variants as string[]) : undefined;\n}\n\nexport function emojibaseAdapter(\n data: EmojibaseEmoji[],\n messages: EmojibaseMessages\n): EmojiPickerData {\n const emojis: Record<string, EmojiPickerEmoji> = {};\n const categoryEmojis = new Map<string, EmojibaseEmoji[]>();\n\n const groupLabels = new Map<number, string>();\n for (const group of messages.groups) {\n groupLabels.set(group.order, group.message);\n }\n\n for (const emojibaseEmoji of data) {\n if (emojibaseEmoji.group === undefined) {\n continue;\n }\n\n const canonicalId = GROUP_TO_CANONICAL[emojibaseEmoji.group];\n if (!canonicalId) {\n continue;\n }\n\n const id = emojibaseEmoji.hexcode;\n emojis[id] = {\n id,\n name: emojibaseEmoji.label,\n keywords: emojibaseEmoji.tags || [],\n emoji: emojibaseEmoji.emoji,\n skins: getSkinVariants(emojibaseEmoji.skins),\n version: emojibaseEmoji.version,\n };\n\n if (!categoryEmojis.has(canonicalId)) {\n categoryEmojis.set(canonicalId, []);\n }\n categoryEmojis.get(canonicalId)!.push(emojibaseEmoji);\n }\n\n const categories: EmojiPickerCategory[] = [];\n for (const canonicalId of CATEGORY_ORDER) {\n const items = categoryEmojis.get(canonicalId);\n if (!items) {\n continue;\n }\n\n items.sort(\n (a, b) => (a.order ?? Number.MAX_SAFE_INTEGER) - (b.order ?? Number.MAX_SAFE_INTEGER)\n );\n categories.push({\n id: canonicalId,\n label:\n CANONICAL_CATEGORY_LABELS[canonicalId] || groupLabels.get(items[0].group!) || canonicalId,\n emojis: items.map((item) => item.hexcode),\n });\n }\n\n return { categories, emojis };\n}\n"],"mappings":";;;AAiCA,MAAM,qBAA+E;CACnF,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL;AAEA,MAAM,iBAAiBA,mBAAAA,uBAAuB,QAC3C,OAAuD,OAAO,UACjE;AAEA,SAAS,eAAe,MAA6B;CACnD,IAAI,OAAO,SAAS,UAClB,OAAO;CAGT,IAAI,MAAM,QAAQ,IAAI,KAAK,KAAK,SAAS,KAAK,KAAK,OAAO,MAAM,MAAM,KAAK,EAAE,GAC3E,OAAO,KAAK;CAGd,OAAO;AACT;AAEA,SAAS,gBAAgB,OAAoC;CAC3D,IAAI,CAAC,SAAS,MAAM,WAAW,GAC7B;CAGF,MAAM,yBAAS,IAAI,IAAoB;CACvC,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,OAAO,eAAe,KAAK,IAAI;EACrC,IAAI,SAAS,QAAQ,CAAC,OAAO,IAAI,IAAI,GACnC,OAAO,IAAI,MAAM,KAAK,KAAK;CAE/B;CAEA,MAAM,WAAW;EAAC;EAAG;EAAG;EAAG;EAAG;CAAC,CAAC,CAAC,KAAK,SAAS,OAAO,IAAI,IAAI,CAAC;CAC/D,OAAO,SAAS,OAAO,YAAY,YAAY,KAAA,CAAS,IAAK,WAAwB,KAAA;AACvF;AAEA,SAAgB,iBACd,MACA,UACiB;CACjB,MAAM,SAA2C,CAAC;CAClD,MAAM,iCAAiB,IAAI,IAA8B;CAEzD,MAAM,8BAAc,IAAI,IAAoB;CAC5C,KAAK,MAAM,SAAS,SAAS,QAC3B,YAAY,IAAI,MAAM,OAAO,MAAM,OAAO;CAG5C,KAAK,MAAM,kBAAkB,MAAM;EACjC,IAAI,eAAe,UAAU,KAAA,GAC3B;EAGF,MAAM,cAAc,mBAAmB,eAAe;EACtD,IAAI,CAAC,aACH;EAGF,MAAM,KAAK,eAAe;EAC1B,OAAO,MAAM;GACX;GACA,MAAM,eAAe;GACrB,UAAU,eAAe,QAAQ,CAAC;GAClC,OAAO,eAAe;GACtB,OAAO,gBAAgB,eAAe,KAAK;GAC3C,SAAS,eAAe;EAC1B;EAEA,IAAI,CAAC,eAAe,IAAI,WAAW,GACjC,eAAe,IAAI,aAAa,CAAC,CAAC;EAEpC,eAAe,IAAI,WAAW,CAAC,CAAE,KAAK,cAAc;CACtD;CAEA,MAAM,aAAoC,CAAC;CAC3C,KAAK,MAAM,eAAe,gBAAgB;EACxC,MAAM,QAAQ,eAAe,IAAI,WAAW;EAC5C,IAAI,CAAC,OACH;EAGF,MAAM,MACH,GAAG,OAAO,EAAE,SAAS,OAAO,qBAAqB,EAAE,SAAS,OAAO,iBACtE;EACA,WAAW,KAAK;GACd,IAAI;GACJ,OACEC,mBAAAA,0BAA0B,gBAAgB,YAAY,IAAI,MAAM,EAAE,CAAC,KAAM,KAAK;GAChF,QAAQ,MAAM,KAAK,SAAS,KAAK,OAAO;EAC1C,CAAC;CACH;CAEA,OAAO;EAAE;EAAY;CAAO;AAC9B"}
@@ -0,0 +1,52 @@
1
+ "use client";
2
+ // packages/@mantine/emoji/src/categories.ts
3
+ const CANONICAL_CATEGORY_IDS = [
4
+ "frequent",
5
+ "people",
6
+ "nature",
7
+ "foods",
8
+ "activity",
9
+ "places",
10
+ "objects",
11
+ "symbols",
12
+ "flags"
13
+ ];
14
+ const CANONICAL_CATEGORY_LABELS = {
15
+ frequent: "Frequently Used",
16
+ people: "Smileys & People",
17
+ nature: "Animals & Nature",
18
+ foods: "Food & Drink",
19
+ activity: "Activity",
20
+ places: "Travel & Places",
21
+ objects: "Objects",
22
+ symbols: "Symbols",
23
+ flags: "Flags"
24
+ };
25
+ const CANONICAL_CATEGORY_ICONS = {
26
+ frequent: "🕐",
27
+ people: "😀",
28
+ nature: "🐻",
29
+ foods: "🍔",
30
+ activity: "⚽",
31
+ places: "🚗",
32
+ objects: "💡",
33
+ symbols: "♻️",
34
+ flags: "🏳️"
35
+ };
36
+ function isCanonicalCategoryId(id) {
37
+ return CANONICAL_CATEGORY_IDS.includes(id);
38
+ }
39
+ function getCanonicalCategoryLabel(id) {
40
+ return isCanonicalCategoryId(id) ? CANONICAL_CATEGORY_LABELS[id] : void 0;
41
+ }
42
+ function getCanonicalCategoryIcon(id) {
43
+ return isCanonicalCategoryId(id) ? CANONICAL_CATEGORY_ICONS[id] : void 0;
44
+ }
45
+ exports.CANONICAL_CATEGORY_ICONS = CANONICAL_CATEGORY_ICONS;
46
+ exports.CANONICAL_CATEGORY_IDS = CANONICAL_CATEGORY_IDS;
47
+ exports.CANONICAL_CATEGORY_LABELS = CANONICAL_CATEGORY_LABELS;
48
+ exports.getCanonicalCategoryIcon = getCanonicalCategoryIcon;
49
+ exports.getCanonicalCategoryLabel = getCanonicalCategoryLabel;
50
+ exports.isCanonicalCategoryId = isCanonicalCategoryId;
51
+
52
+ //# sourceMappingURL=categories.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categories.cjs","names":[],"sources":["../src/categories.ts"],"sourcesContent":["export const CANONICAL_CATEGORY_IDS = [\n 'frequent',\n 'people',\n 'nature',\n 'foods',\n 'activity',\n 'places',\n 'objects',\n 'symbols',\n 'flags',\n] as const;\n\nexport type CanonicalCategoryId = (typeof CANONICAL_CATEGORY_IDS)[number];\n\nexport const CANONICAL_CATEGORY_LABELS: Record<CanonicalCategoryId, string> = {\n frequent: 'Frequently Used',\n people: 'Smileys & People',\n nature: 'Animals & Nature',\n foods: 'Food & Drink',\n activity: 'Activity',\n places: 'Travel & Places',\n objects: 'Objects',\n symbols: 'Symbols',\n flags: 'Flags',\n};\n\nexport const CANONICAL_CATEGORY_ICONS: Record<CanonicalCategoryId, string> = {\n frequent: '🕐',\n people: '😀',\n nature: '🐻',\n foods: '🍔',\n activity: '⚽',\n places: '🚗',\n objects: '💡',\n symbols: '♻️',\n flags: '🏳️',\n};\n\nexport function isCanonicalCategoryId(id: string): id is CanonicalCategoryId {\n return (CANONICAL_CATEGORY_IDS as readonly string[]).includes(id);\n}\n\nexport function getCanonicalCategoryLabel(id: string) {\n return isCanonicalCategoryId(id) ? CANONICAL_CATEGORY_LABELS[id] : undefined;\n}\n\nexport function getCanonicalCategoryIcon(id: string) {\n return isCanonicalCategoryId(id) ? CANONICAL_CATEGORY_ICONS[id] : undefined;\n}\n"],"mappings":";;AAAA,MAAa,yBAAyB;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAa,4BAAiE;CAC5E,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,UAAU;CACV,QAAQ;CACR,SAAS;CACT,SAAS;CACT,OAAO;AACT;AAEA,MAAa,2BAAgE;CAC3E,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,UAAU;CACV,QAAQ;CACR,SAAS;CACT,SAAS;CACT,OAAO;AACT;AAEA,SAAgB,sBAAsB,IAAuC;CAC3E,OAAQ,uBAA6C,SAAS,EAAE;AAClE;AAEA,SAAgB,0BAA0B,IAAY;CACpD,OAAO,sBAAsB,EAAE,IAAI,0BAA0B,MAAM,KAAA;AACrE;AAEA,SAAgB,yBAAyB,IAAY;CACnD,OAAO,sBAAsB,EAAE,IAAI,yBAAyB,MAAM,KAAA;AACpE"}
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ const require_emoji_grid_utils = require("../../utils/emoji-grid-utils.cjs");
3
+ const require_EmojiPicker_context = require("./EmojiPicker.context.cjs");
4
+ let react = require("react");
5
+ let _mantine_core = require("@mantine/core");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ // packages/@mantine/emoji/src/components/EmojiPicker/EmojiButton.tsx
8
+ const EmojiButton = (0, react.memo)(function EmojiButton({ emoji, skinTone, emojiIndex, focused, id }) {
9
+ const ctx = require_EmojiPicker_context.useEmojiPickerContext();
10
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.UnstyledButton, {
11
+ ...ctx.getStyles("emoji"),
12
+ role: "gridcell",
13
+ "aria-label": emoji.name,
14
+ title: emoji.name,
15
+ id,
16
+ tabIndex: -1,
17
+ "data-focused": focused || void 0,
18
+ "data-emoji-index": emojiIndex,
19
+ children: require_emoji_grid_utils.applySkinTone(emoji, skinTone).emoji
20
+ });
21
+ });
22
+ exports.EmojiButton = EmojiButton;
23
+
24
+ //# sourceMappingURL=EmojiButton.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiButton.cjs","names":["memo","useEmojiPickerContext","UnstyledButton","applySkinTone"],"sources":["../../../src/components/EmojiPicker/EmojiButton.tsx"],"sourcesContent":["import { memo } from 'react';\nimport { UnstyledButton } from '@mantine/core';\nimport type { EmojiPickerEmoji } from '../../types';\nimport { applySkinTone } from '../../utils';\nimport { useEmojiPickerContext } from './EmojiPicker.context';\n\ninterface EmojiButtonProps {\n emoji: EmojiPickerEmoji;\n skinTone: number;\n emojiIndex: number;\n focused: boolean;\n id: string;\n}\n\nexport const EmojiButton = memo(function EmojiButton({\n emoji,\n skinTone,\n emojiIndex,\n focused,\n id,\n}: EmojiButtonProps) {\n const ctx = useEmojiPickerContext();\n\n return (\n <UnstyledButton\n {...ctx.getStyles('emoji')}\n role=\"gridcell\"\n aria-label={emoji.name}\n title={emoji.name}\n id={id}\n tabIndex={-1}\n data-focused={focused || undefined}\n data-emoji-index={emojiIndex}\n >\n {applySkinTone(emoji, skinTone).emoji}\n </UnstyledButton>\n );\n});\n"],"mappings":";;;;;;;AAcA,MAAa,eAAA,GAAcA,MAAAA,KAAAA,CAAK,SAAS,YAAY,EACnD,OACA,UACA,YACA,SACA,MACmB;CACnB,MAAM,MAAMC,4BAAAA,sBAAsB;CAElC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,gBAAD;EACE,GAAI,IAAI,UAAU,OAAO;EACzB,MAAK;EACL,cAAY,MAAM;EAClB,OAAO,MAAM;EACT;EACJ,UAAU;EACV,gBAAc,WAAW,KAAA;EACzB,oBAAkB;EAEjBC,UAAAA,yBAAAA,cAAc,OAAO,QAAQ,CAAC,CAAC;CAClB,CAAA;AAEpB,CAAC"}
@@ -0,0 +1,289 @@
1
+ "use client";
2
+ const require_types = require("../../types.cjs");
3
+ const require_flatten_emoji_data = require("../../utils/flatten-emoji-data.cjs");
4
+ const require_is_emoji_supported = require("../../utils/is-emoji-supported.cjs");
5
+ const require_emoji_grid_utils = require("../../utils/emoji-grid-utils.cjs");
6
+ const require_use_emoji_grid_navigation = require("../../hooks/use-emoji-grid-navigation.cjs");
7
+ const require_use_emoji_search = require("../../hooks/use-emoji-search.cjs");
8
+ const require_EmojiPicker_context = require("./EmojiPicker.context.cjs");
9
+ const require_EmojiPickerCategoryNav = require("./EmojiPickerCategoryNav.cjs");
10
+ const require_EmojiPickerGrid = require("./EmojiPickerGrid.cjs");
11
+ const require_EmojiPickerPreview = require("./EmojiPickerPreview.cjs");
12
+ const require_EmojiPickerSearch = require("./EmojiPickerSearch.cjs");
13
+ const require_EmojiPickerSkinTone = require("./EmojiPickerSkinTone.cjs");
14
+ const require_EmojiPicker_module = require("./EmojiPicker.module.cjs");
15
+ let react = require("react");
16
+ let _mantine_core = require("@mantine/core");
17
+ let _mantine_hooks = require("@mantine/hooks");
18
+ let react_jsx_runtime = require("react/jsx-runtime");
19
+ // packages/@mantine/emoji/src/components/EmojiPicker/EmojiPicker.tsx
20
+ const defaultProps = {
21
+ columns: 9,
22
+ withSearch: true,
23
+ withCategoryNav: true,
24
+ withPreview: true,
25
+ withSkinToneSelector: true,
26
+ withUnsupportedDetection: false,
27
+ autoFocus: false,
28
+ size: "sm"
29
+ };
30
+ const EMOJI_SIZES = {
31
+ xs: {
32
+ emojiSize: 28,
33
+ emojiFz: (0, _mantine_core.rem)(16),
34
+ previewPy: (0, _mantine_core.rem)(4),
35
+ skinToneSize: (0, _mantine_core.rem)(20),
36
+ skinToneFz: (0, _mantine_core.rem)(13)
37
+ },
38
+ sm: {
39
+ emojiSize: 32,
40
+ emojiFz: (0, _mantine_core.rem)(18),
41
+ previewPy: (0, _mantine_core.rem)(5),
42
+ skinToneSize: (0, _mantine_core.rem)(22),
43
+ skinToneFz: (0, _mantine_core.rem)(14)
44
+ },
45
+ md: {
46
+ emojiSize: 36,
47
+ emojiFz: (0, _mantine_core.rem)(22),
48
+ previewPy: (0, _mantine_core.rem)(7),
49
+ skinToneSize: (0, _mantine_core.rem)(24),
50
+ skinToneFz: (0, _mantine_core.rem)(16)
51
+ },
52
+ lg: {
53
+ emojiSize: 42,
54
+ emojiFz: (0, _mantine_core.rem)(26),
55
+ previewPy: (0, _mantine_core.rem)(8),
56
+ skinToneSize: (0, _mantine_core.rem)(28),
57
+ skinToneFz: (0, _mantine_core.rem)(18)
58
+ },
59
+ xl: {
60
+ emojiSize: 48,
61
+ emojiFz: (0, _mantine_core.rem)(30),
62
+ previewPy: (0, _mantine_core.rem)(10),
63
+ skinToneSize: (0, _mantine_core.rem)(32),
64
+ skinToneFz: (0, _mantine_core.rem)(20)
65
+ }
66
+ };
67
+ const EMOJI_FONT_SIZE_RATIO = .6;
68
+ function getSizeValues(size) {
69
+ return EMOJI_SIZES[size || "sm"] || EMOJI_SIZES.sm;
70
+ }
71
+ const varsResolver = (0, _mantine_core.createVarsResolver)((_, { columns, emojiSize, size }) => {
72
+ const sizeValues = getSizeValues(size);
73
+ return { root: {
74
+ "--ep-columns": columns?.toString() ?? "9",
75
+ "--ep-emoji-size": emojiSize ? (0, _mantine_core.rem)(emojiSize) : (0, _mantine_core.rem)(sizeValues.emojiSize),
76
+ "--ep-emoji-fz": emojiSize ? (0, _mantine_core.rem)(Math.round(emojiSize * EMOJI_FONT_SIZE_RATIO)) : sizeValues.emojiFz,
77
+ "--ep-preview-py": sizeValues.previewPy,
78
+ "--ep-skin-tone-size": sizeValues.skinToneSize,
79
+ "--ep-skin-tone-fz": sizeValues.skinToneFz
80
+ } };
81
+ });
82
+ const EmojiPicker = (0, _mantine_core.factory)((_props) => {
83
+ const props = (0, _mantine_core.useProps)("EmojiPicker", defaultProps, _props);
84
+ const { classNames, className, style, styles, unstyled, vars, data, onEmojiSelect, columns, emojiSize, withSearch, withCategoryNav, withPreview, withSkinToneSelector, skinTone: skinToneProp, defaultSkinTone, onSkinToneChange, searchValue, onSearchChange, searchPlaceholder, emptySearchContent, withUnsupportedDetection, autoFocus, scrollAreaProps, categoryLabels, labels: labelsProp, size, searchInputProps, ...others } = props;
85
+ const getStyles = (0, _mantine_core.useStyles)({
86
+ name: "EmojiPicker",
87
+ classes: require_EmojiPicker_module.default,
88
+ props,
89
+ classNames,
90
+ styles,
91
+ unstyled,
92
+ vars,
93
+ varsResolver,
94
+ stable: true
95
+ });
96
+ const [skinTone, setSkinTone] = (0, _mantine_hooks.useUncontrolled)({
97
+ value: skinToneProp,
98
+ defaultValue: defaultSkinTone ?? 0,
99
+ onChange: onSkinToneChange
100
+ });
101
+ const cols = Math.max(columns ?? 9, 1);
102
+ const baseId = (0, react.useId)();
103
+ const idPrefix = `${baseId}-emoji`;
104
+ const gridId = `${baseId}-grid`;
105
+ const [activeDescendant, setActiveDescendant] = (0, react.useState)(void 0);
106
+ const filteredData = (0, react.useMemo)(() => {
107
+ if (!withUnsupportedDetection) return data;
108
+ return {
109
+ emojis: data.emojis,
110
+ categories: data.categories.map((cat) => ({
111
+ ...cat,
112
+ emojis: require_is_emoji_supported.filterSupportedEmojis(data.emojis, cat.emojis)
113
+ }))
114
+ };
115
+ }, [data, withUnsupportedDetection]);
116
+ const { query, setQuery, results, isSearching } = require_use_emoji_search.useEmojiSearch({
117
+ data: filteredData,
118
+ searchValue,
119
+ onSearchChange
120
+ });
121
+ const searchInputRef = (0, react.useRef)(null);
122
+ const scrollToItemRef = (0, react.useRef)(null);
123
+ const mergedLabels = (0, react.useMemo)(() => ({
124
+ ...require_types.DEFAULT_LABELS,
125
+ ...labelsProp
126
+ }), [labelsProp]);
127
+ const ctxValue = (0, react.useMemo)(() => ({
128
+ getStyles,
129
+ labels: mergedLabels,
130
+ size
131
+ }), [
132
+ getStyles,
133
+ mergedLabels,
134
+ size
135
+ ]);
136
+ const categoryItems = (0, react.useMemo)(() => require_flatten_emoji_data.flattenEmojiData(filteredData, cols, categoryLabels), [
137
+ filteredData,
138
+ cols,
139
+ categoryLabels
140
+ ]);
141
+ const searchItems = (0, react.useMemo)(() => require_flatten_emoji_data.flattenEmojiData({
142
+ emojis: filteredData.emojis,
143
+ categories: [{
144
+ id: "search",
145
+ label: mergedLabels.searchResults,
146
+ emojis: results.map((emoji) => emoji.id)
147
+ }]
148
+ }, cols), [
149
+ filteredData.emojis,
150
+ cols,
151
+ results,
152
+ mergedLabels.searchResults
153
+ ]);
154
+ const flattenedItems = isSearching ? searchItems : categoryItems;
155
+ const navCategories = (0, react.useMemo)(() => categoryItems.reduce((acc, item) => {
156
+ if (item.type === "header") acc.push({
157
+ id: item.categoryId,
158
+ label: item.label
159
+ });
160
+ return acc;
161
+ }, []), [categoryItems]);
162
+ const scrollToItem = (0, react.useCallback)((itemIndex) => {
163
+ scrollToItemRef.current?.(itemIndex, "auto");
164
+ }, []);
165
+ const handleEmojiSelect = (0, react.useCallback)((emoji) => {
166
+ onEmojiSelect?.(emoji);
167
+ }, [onEmojiSelect]);
168
+ const { model, activeIndex, activeEmoji, keyboardActive, handleKeyDown, setPointerIndex, setAnchorIndex } = require_use_emoji_grid_navigation.useEmojiGridNavigation({
169
+ items: flattenedItems,
170
+ resetKey: query,
171
+ skinTone,
172
+ onEmojiSelect: handleEmojiSelect,
173
+ scrollToItem
174
+ });
175
+ const handleGridKeyDown = (0, react.useCallback)((event) => {
176
+ if (event.key === "Escape") {
177
+ const focusStayedInGrid = event.currentTarget.contains(document.activeElement);
178
+ if (withSearch && focusStayedInGrid && searchInputRef.current) {
179
+ event.preventDefault();
180
+ searchInputRef.current.focus();
181
+ }
182
+ return;
183
+ }
184
+ handleKeyDown(event);
185
+ }, [handleKeyDown, withSearch]);
186
+ const handleSearchKeyDown = (0, react.useCallback)((event) => {
187
+ if (event.nativeEvent.isComposing) return;
188
+ if (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === "Enter") handleKeyDown(event);
189
+ }, [handleKeyDown]);
190
+ const handleEmojiClick = (0, react.useCallback)((index) => {
191
+ const emoji = model.emojis[index];
192
+ if (emoji) {
193
+ setPointerIndex(index);
194
+ handleEmojiSelect(require_emoji_grid_utils.applySkinTone(emoji, skinTone));
195
+ }
196
+ }, [
197
+ model,
198
+ setPointerIndex,
199
+ handleEmojiSelect,
200
+ skinTone
201
+ ]);
202
+ const scrollToCategory = (0, react.useCallback)((categoryId) => {
203
+ const itemIndex = flattenedItems.findIndex((item) => item.type === "header" && item.categoryId === categoryId);
204
+ if (itemIndex !== -1) {
205
+ setAnchorIndex(model.itemOffsets[itemIndex]);
206
+ scrollToItemRef.current?.(itemIndex, "start");
207
+ }
208
+ }, [
209
+ flattenedItems,
210
+ model,
211
+ setAnchorIndex
212
+ ]);
213
+ const pendingCategoryRef = (0, react.useRef)(null);
214
+ const handleCategoryClick = (0, react.useCallback)((categoryId) => {
215
+ if (isSearching) {
216
+ pendingCategoryRef.current = categoryId;
217
+ setQuery("");
218
+ return;
219
+ }
220
+ scrollToCategory(categoryId);
221
+ }, [
222
+ isSearching,
223
+ setQuery,
224
+ scrollToCategory
225
+ ]);
226
+ (0, react.useEffect)(() => {
227
+ if (!isSearching && pendingCategoryRef.current !== null) {
228
+ const categoryId = pendingCategoryRef.current;
229
+ pendingCategoryRef.current = null;
230
+ scrollToCategory(categoryId);
231
+ }
232
+ }, [isSearching, scrollToCategory]);
233
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_EmojiPicker_context.EmojiPickerProvider, {
234
+ value: ctxValue,
235
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Box, {
236
+ ...getStyles("root"),
237
+ ...others,
238
+ children: [
239
+ withSearch && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_EmojiPickerSearch.EmojiPickerSearch, {
240
+ query,
241
+ onQueryChange: setQuery,
242
+ placeholder: searchPlaceholder,
243
+ autoFocus,
244
+ inputRef: searchInputRef,
245
+ onKeyDown: handleSearchKeyDown,
246
+ controls: flattenedItems.length > 0 ? gridId : void 0,
247
+ activeDescendant,
248
+ searchInputProps
249
+ }),
250
+ withCategoryNav && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_EmojiPickerCategoryNav.EmojiPickerCategoryNav, {
251
+ categories: navCategories,
252
+ onCategoryClick: handleCategoryClick
253
+ }),
254
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_EmojiPickerGrid.EmojiPickerGrid, {
255
+ items: flattenedItems,
256
+ itemOffsets: model.itemOffsets,
257
+ columns: cols,
258
+ skinTone,
259
+ focusedIndex: keyboardActive ? activeIndex : -1,
260
+ focusedItemIndex: keyboardActive ? require_emoji_grid_utils.getEmojiItemIndex(model, activeIndex) : -1,
261
+ idPrefix,
262
+ gridId,
263
+ onActiveDescendantChange: setActiveDescendant,
264
+ emojiSize: emojiSize ?? getSizeValues(size).emojiSize,
265
+ emptyContent: emptySearchContent || mergedLabels.noResults,
266
+ onKeyDown: handleGridKeyDown,
267
+ onPointerIndex: setPointerIndex,
268
+ onEmojiClick: handleEmojiClick,
269
+ scrollToItemRef,
270
+ scrollAreaProps
271
+ }),
272
+ (withPreview || withSkinToneSelector) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_EmojiPickerPreview.EmojiPickerPreview, {
273
+ emoji: activeEmoji,
274
+ skinTone,
275
+ withPreview: !!withPreview,
276
+ children: withSkinToneSelector && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_EmojiPickerSkinTone.EmojiPickerSkinTone, {
277
+ skinTone,
278
+ onSkinToneChange: setSkinTone
279
+ })
280
+ })
281
+ ]
282
+ })
283
+ });
284
+ });
285
+ EmojiPicker.classes = require_EmojiPicker_module.default;
286
+ EmojiPicker.displayName = "@mantine/emoji/EmojiPicker";
287
+ exports.EmojiPicker = EmojiPicker;
288
+
289
+ //# sourceMappingURL=EmojiPicker.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiPicker.cjs","names":["rem","createVarsResolver","factory","useProps","useStyles","useUncontrolled","useId","useState","useMemo","filterSupportedEmojis","useEmojiSearch","useRef","DEFAULT_LABELS","flattenEmojiData","useCallback","useEmojiGridNavigation","applySkinTone","EmojiPickerProvider","Box","EmojiPickerSearch","EmojiPickerCategoryNav","EmojiPickerGrid","getEmojiItemIndex","EmojiPickerPreview","EmojiPickerSkinTone","classes"],"sources":["../../../src/components/EmojiPicker/EmojiPicker.tsx"],"sourcesContent":["import { useCallback, useEffect, useId, useMemo, useRef, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n InputProps,\n MantineSize,\n rem,\n ScrollAreaProps,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { useEmojiGridNavigation } from '../../hooks/use-emoji-grid-navigation';\nimport { useEmojiSearch } from '../../hooks/use-emoji-search';\nimport {\n DEFAULT_LABELS,\n EmojiPickerData,\n EmojiPickerEmoji,\n EmojiPickerLabels,\n FlattenedRowItem,\n} from '../../types';\nimport {\n applySkinTone,\n filterSupportedEmojis,\n flattenEmojiData,\n getEmojiItemIndex,\n} from '../../utils';\nimport { EmojiPickerProvider } from './EmojiPicker.context';\nimport { EmojiPickerCategoryNav, EmojiPickerNavCategory } from './EmojiPickerCategoryNav';\nimport { EmojiPickerGrid, EmojiPickerScrollToItem } from './EmojiPickerGrid';\nimport { EmojiPickerPreview } from './EmojiPickerPreview';\nimport { EmojiPickerSearch } from './EmojiPickerSearch';\nimport { EmojiPickerSkinTone } from './EmojiPickerSkinTone';\nimport classes from './EmojiPicker.module.css';\n\nexport type EmojiPickerStylesNames =\n | 'root'\n | 'search'\n | 'searchInput'\n | 'categoryNav'\n | 'categoryNavButton'\n | 'content'\n | 'empty'\n | 'categoryLabel'\n | 'grid'\n | 'emoji'\n | 'preview'\n | 'previewEmoji'\n | 'previewName'\n | 'skinToneSelector'\n | 'skinToneDropdown'\n | 'skinToneButton';\n\nexport type EmojiPickerCssVariables = {\n root:\n | '--ep-columns'\n | '--ep-emoji-size'\n | '--ep-emoji-fz'\n | '--ep-preview-py'\n | '--ep-skin-tone-size'\n | '--ep-skin-tone-fz';\n};\n\nexport interface EmojiPickerProps\n extends BoxProps, StylesApiProps<EmojiPickerFactory>, ElementProps<'div'> {\n /** Emoji data object, use `emojiMartAdapter` or `emojibaseAdapter` to convert data */\n data: EmojiPickerData;\n\n /** Called when an emoji is selected */\n onEmojiSelect?: (emoji: EmojiPickerEmoji) => void;\n\n /** Number of emoji columns @default 9 */\n columns?: number;\n\n /** Custom emoji button size in px, overrides size-based value */\n emojiSize?: number;\n\n /** Determines whether the search input is displayed @default true */\n withSearch?: boolean;\n\n /** Determines whether the category navigation bar is displayed @default true */\n withCategoryNav?: boolean;\n\n /** Determines whether the emoji preview area is displayed @default true */\n withPreview?: boolean;\n\n /** Determines whether the skin tone selector is displayed @default true */\n withSkinToneSelector?: boolean;\n\n /** Controlled skin tone value (0–5) */\n skinTone?: number;\n\n /** Default skin tone value for uncontrolled state @default 0 */\n defaultSkinTone?: number;\n\n /** Called when skin tone changes */\n onSkinToneChange?: (skinTone: number) => void;\n\n /** Controlled search input value */\n searchValue?: string;\n\n /** Called when search value changes */\n onSearchChange?: (value: string) => void;\n\n /** Search input placeholder */\n searchPlaceholder?: string;\n\n /** Content displayed when search yields no results */\n emptySearchContent?: React.ReactNode;\n\n /** Determines whether unsupported emojis are filtered out @default false */\n withUnsupportedDetection?: boolean;\n\n /** Determines whether the search input is focused on mount @default false */\n autoFocus?: boolean;\n\n /** Props passed to the internal `ScrollArea` component */\n scrollAreaProps?: ScrollAreaProps;\n\n /** Override category labels by category id */\n categoryLabels?: Record<string, string>;\n\n /** Override UI labels (search placeholder, no results text, etc.) */\n labels?: EmojiPickerLabels;\n\n /** Controls size of all inner elements @default 'sm' */\n size?: MantineSize;\n\n /** Props passed to the search `Input` component */\n searchInputProps?: InputProps;\n}\n\nexport type EmojiPickerFactory = Factory<{\n props: EmojiPickerProps;\n ref: HTMLDivElement;\n stylesNames: EmojiPickerStylesNames;\n vars: EmojiPickerCssVariables;\n}>;\n\nconst defaultProps = {\n columns: 9,\n withSearch: true,\n withCategoryNav: true,\n withPreview: true,\n withSkinToneSelector: true,\n withUnsupportedDetection: false,\n autoFocus: false,\n size: 'sm',\n} satisfies Partial<EmojiPickerProps>;\n\nconst EMOJI_SIZES: Record<\n string,\n {\n emojiSize: number;\n emojiFz: string;\n previewPy: string;\n skinToneSize: string;\n skinToneFz: string;\n }\n> = {\n xs: {\n emojiSize: 28,\n emojiFz: rem(16),\n previewPy: rem(4),\n skinToneSize: rem(20),\n skinToneFz: rem(13),\n },\n sm: {\n emojiSize: 32,\n emojiFz: rem(18),\n previewPy: rem(5),\n skinToneSize: rem(22),\n skinToneFz: rem(14),\n },\n md: {\n emojiSize: 36,\n emojiFz: rem(22),\n previewPy: rem(7),\n skinToneSize: rem(24),\n skinToneFz: rem(16),\n },\n lg: {\n emojiSize: 42,\n emojiFz: rem(26),\n previewPy: rem(8),\n skinToneSize: rem(28),\n skinToneFz: rem(18),\n },\n xl: {\n emojiSize: 48,\n emojiFz: rem(30),\n previewPy: rem(10),\n skinToneSize: rem(32),\n skinToneFz: rem(20),\n },\n};\n\nconst EMOJI_FONT_SIZE_RATIO = 0.6;\n\nfunction getSizeValues(size: MantineSize | undefined) {\n return EMOJI_SIZES[size || 'sm'] || EMOJI_SIZES.sm;\n}\n\nconst varsResolver = createVarsResolver<EmojiPickerFactory>((_, { columns, emojiSize, size }) => {\n const sizeValues = getSizeValues(size);\n return {\n root: {\n '--ep-columns': columns?.toString() ?? '9',\n '--ep-emoji-size': emojiSize ? rem(emojiSize) : rem(sizeValues.emojiSize),\n '--ep-emoji-fz': emojiSize\n ? rem(Math.round(emojiSize * EMOJI_FONT_SIZE_RATIO))\n : sizeValues.emojiFz,\n '--ep-preview-py': sizeValues.previewPy,\n '--ep-skin-tone-size': sizeValues.skinToneSize,\n '--ep-skin-tone-fz': sizeValues.skinToneFz,\n },\n };\n});\n\nexport const EmojiPicker = factory<EmojiPickerFactory>((_props) => {\n const props = useProps('EmojiPicker', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n data,\n onEmojiSelect,\n columns,\n emojiSize,\n withSearch,\n withCategoryNav,\n withPreview,\n withSkinToneSelector,\n skinTone: skinToneProp,\n defaultSkinTone,\n onSkinToneChange,\n searchValue,\n onSearchChange,\n searchPlaceholder,\n emptySearchContent,\n withUnsupportedDetection,\n autoFocus,\n scrollAreaProps,\n categoryLabels,\n labels: labelsProp,\n size,\n searchInputProps,\n ...others\n } = props;\n\n const getStyles = useStyles<EmojiPickerFactory>({\n name: 'EmojiPicker',\n classes,\n props,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n stable: true,\n });\n\n const [skinTone, setSkinTone] = useUncontrolled({\n value: skinToneProp,\n defaultValue: defaultSkinTone ?? 0,\n onChange: onSkinToneChange,\n });\n\n const cols = Math.max(columns ?? 9, 1);\n const baseId = useId();\n const idPrefix = `${baseId}-emoji`;\n const gridId = `${baseId}-grid`;\n const [activeDescendant, setActiveDescendant] = useState<string | undefined>(undefined);\n\n const filteredData = useMemo(() => {\n if (!withUnsupportedDetection) {\n return data;\n }\n return {\n emojis: data.emojis,\n categories: data.categories.map((cat) => ({\n ...cat,\n emojis: filterSupportedEmojis(data.emojis, cat.emojis),\n })),\n };\n }, [data, withUnsupportedDetection]);\n\n const { query, setQuery, results, isSearching } = useEmojiSearch({\n data: filteredData,\n searchValue,\n onSearchChange,\n });\n\n const searchInputRef = useRef<HTMLInputElement>(null);\n const scrollToItemRef = useRef<EmojiPickerScrollToItem | null>(null);\n\n const mergedLabels: Required<EmojiPickerLabels> = useMemo(\n () => ({ ...DEFAULT_LABELS, ...labelsProp }),\n [labelsProp]\n );\n\n const ctxValue = useMemo(\n () => ({ getStyles, labels: mergedLabels, size }),\n [getStyles, mergedLabels, size]\n );\n\n const categoryItems = useMemo<FlattenedRowItem[]>(\n () => flattenEmojiData(filteredData, cols, categoryLabels),\n [filteredData, cols, categoryLabels]\n );\n\n const searchItems = useMemo<FlattenedRowItem[]>(\n () =>\n flattenEmojiData(\n {\n emojis: filteredData.emojis,\n categories: [\n {\n id: 'search',\n label: mergedLabels.searchResults,\n emojis: results.map((emoji) => emoji.id),\n },\n ],\n },\n cols\n ),\n [filteredData.emojis, cols, results, mergedLabels.searchResults]\n );\n\n const flattenedItems = isSearching ? searchItems : categoryItems;\n\n const navCategories = useMemo(\n () =>\n categoryItems.reduce<EmojiPickerNavCategory[]>((acc, item) => {\n if (item.type === 'header') {\n acc.push({ id: item.categoryId, label: item.label });\n }\n return acc;\n }, []),\n [categoryItems]\n );\n\n const scrollToItem = useCallback((itemIndex: number) => {\n scrollToItemRef.current?.(itemIndex, 'auto');\n }, []);\n\n const handleEmojiSelect = useCallback(\n (emoji: EmojiPickerEmoji) => {\n onEmojiSelect?.(emoji);\n },\n [onEmojiSelect]\n );\n\n const {\n model,\n activeIndex,\n activeEmoji,\n keyboardActive,\n handleKeyDown,\n setPointerIndex,\n setAnchorIndex,\n } = useEmojiGridNavigation({\n items: flattenedItems,\n resetKey: query,\n skinTone,\n onEmojiSelect: handleEmojiSelect,\n scrollToItem,\n });\n\n const handleGridKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n const focusStayedInGrid = event.currentTarget.contains(document.activeElement);\n if (withSearch && focusStayedInGrid && searchInputRef.current) {\n event.preventDefault();\n searchInputRef.current.focus();\n }\n return;\n }\n handleKeyDown(event);\n },\n [handleKeyDown, withSearch]\n );\n\n const handleSearchKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.nativeEvent.isComposing) {\n return;\n }\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp' || event.key === 'Enter') {\n handleKeyDown(event);\n }\n },\n [handleKeyDown]\n );\n\n const handleEmojiClick = useCallback(\n (index: number) => {\n const emoji = model.emojis[index];\n if (emoji) {\n setPointerIndex(index);\n handleEmojiSelect(applySkinTone(emoji, skinTone));\n }\n },\n [model, setPointerIndex, handleEmojiSelect, skinTone]\n );\n\n const scrollToCategory = useCallback(\n (categoryId: string) => {\n const itemIndex = flattenedItems.findIndex(\n (item) => item.type === 'header' && item.categoryId === categoryId\n );\n if (itemIndex !== -1) {\n setAnchorIndex(model.itemOffsets[itemIndex]);\n scrollToItemRef.current?.(itemIndex, 'start');\n }\n },\n [flattenedItems, model, setAnchorIndex]\n );\n\n const pendingCategoryRef = useRef<string | null>(null);\n\n const handleCategoryClick = useCallback(\n (categoryId: string) => {\n if (isSearching) {\n pendingCategoryRef.current = categoryId;\n setQuery('');\n return;\n }\n scrollToCategory(categoryId);\n },\n [isSearching, setQuery, scrollToCategory]\n );\n\n useEffect(() => {\n if (!isSearching && pendingCategoryRef.current !== null) {\n const categoryId = pendingCategoryRef.current;\n pendingCategoryRef.current = null;\n scrollToCategory(categoryId);\n }\n }, [isSearching, scrollToCategory]);\n\n return (\n <EmojiPickerProvider value={ctxValue}>\n <Box {...getStyles('root')} {...others}>\n {withSearch && (\n <EmojiPickerSearch\n query={query}\n onQueryChange={setQuery}\n placeholder={searchPlaceholder}\n autoFocus={autoFocus}\n inputRef={searchInputRef}\n onKeyDown={handleSearchKeyDown}\n controls={flattenedItems.length > 0 ? gridId : undefined}\n activeDescendant={activeDescendant}\n searchInputProps={searchInputProps}\n />\n )}\n\n {withCategoryNav && (\n <EmojiPickerCategoryNav\n categories={navCategories}\n onCategoryClick={handleCategoryClick}\n />\n )}\n\n <EmojiPickerGrid\n items={flattenedItems}\n itemOffsets={model.itemOffsets}\n columns={cols}\n skinTone={skinTone}\n focusedIndex={keyboardActive ? activeIndex : -1}\n focusedItemIndex={keyboardActive ? getEmojiItemIndex(model, activeIndex) : -1}\n idPrefix={idPrefix}\n gridId={gridId}\n onActiveDescendantChange={setActiveDescendant}\n emojiSize={emojiSize ?? getSizeValues(size).emojiSize}\n emptyContent={emptySearchContent || mergedLabels.noResults}\n onKeyDown={handleGridKeyDown}\n onPointerIndex={setPointerIndex}\n onEmojiClick={handleEmojiClick}\n scrollToItemRef={scrollToItemRef}\n scrollAreaProps={scrollAreaProps}\n />\n\n {(withPreview || withSkinToneSelector) && (\n <EmojiPickerPreview emoji={activeEmoji} skinTone={skinTone} withPreview={!!withPreview}>\n {withSkinToneSelector && (\n <EmojiPickerSkinTone skinTone={skinTone} onSkinToneChange={setSkinTone} />\n )}\n </EmojiPickerPreview>\n )}\n </Box>\n </EmojiPickerProvider>\n );\n});\n\nEmojiPicker.classes = classes;\nEmojiPicker.displayName = '@mantine/emoji/EmojiPicker';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgJA,MAAM,eAAe;CACnB,SAAS;CACT,YAAY;CACZ,iBAAiB;CACjB,aAAa;CACb,sBAAsB;CACtB,0BAA0B;CAC1B,WAAW;CACX,MAAM;AACR;AAEA,MAAM,cASF;CACF,IAAI;EACF,WAAW;EACX,UAAA,GAASA,cAAAA,IAAAA,CAAI,EAAE;EACf,YAAA,GAAWA,cAAAA,IAAAA,CAAI,CAAC;EAChB,eAAA,GAAcA,cAAAA,IAAAA,CAAI,EAAE;EACpB,aAAA,GAAYA,cAAAA,IAAAA,CAAI,EAAE;CACpB;CACA,IAAI;EACF,WAAW;EACX,UAAA,GAASA,cAAAA,IAAAA,CAAI,EAAE;EACf,YAAA,GAAWA,cAAAA,IAAAA,CAAI,CAAC;EAChB,eAAA,GAAcA,cAAAA,IAAAA,CAAI,EAAE;EACpB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Ac"}
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ // packages/@mantine/emoji/src/components/EmojiPicker/EmojiPicker.context.ts
3
+ const [EmojiPickerProvider, useEmojiPickerContext] = (0, require("@mantine/core").createSafeContext)("EmojiPicker components must be used within EmojiPicker");
4
+ exports.EmojiPickerProvider = EmojiPickerProvider;
5
+ exports.useEmojiPickerContext = useEmojiPickerContext;
6
+
7
+ //# sourceMappingURL=EmojiPicker.context.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiPicker.context.cjs","names":["createSafeContext"],"sources":["../../../src/components/EmojiPicker/EmojiPicker.context.ts"],"sourcesContent":["import { createSafeContext, type GetStylesApi, type MantineSize } from '@mantine/core';\nimport type { EmojiPickerLabels } from '../../types';\nimport type { EmojiPickerFactory } from './EmojiPicker';\n\nexport interface EmojiPickerContextValue {\n getStyles: GetStylesApi<EmojiPickerFactory>;\n labels: Required<EmojiPickerLabels>;\n size: MantineSize | undefined;\n}\n\nexport const [EmojiPickerProvider, useEmojiPickerContext] =\n createSafeContext<EmojiPickerContextValue>(\n 'EmojiPicker components must be used within EmojiPicker'\n );\n"],"mappings":";;AAUA,MAAa,CAAC,qBAAqB,0BAAA,G,uBACjCA,CAAAA,CAAAA,kBAAAA,CACE,wDACF"}
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ // packages/@mantine/emoji/src/components/EmojiPicker/EmojiPicker.module.css
3
+ var EmojiPicker_module_default = {
4
+ "root": "m_873e66bb",
5
+ "search": "m_b2613941",
6
+ "categoryNav": "m_d6a2ef4c",
7
+ "categoryNavButton": "m_f214599e",
8
+ "content": "m_5d2ad400",
9
+ "empty": "m_5fd65a94",
10
+ "categoryLabel": "m_b987dedd",
11
+ "grid": "m_8739711f",
12
+ "emoji": "m_5fd6558d",
13
+ "preview": "m_117c834f",
14
+ "previewEmoji": "m_91abc637",
15
+ "previewName": "m_2e01327a",
16
+ "skinToneDropdown": "m_16864e19",
17
+ "skinToneSelector": "m_774cfde7",
18
+ "skinToneButton": "m_daf4133a"
19
+ };
20
+ exports.default = EmojiPicker_module_default;
21
+
22
+ //# sourceMappingURL=EmojiPicker.module.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiPicker.module.cjs","names":[],"sources":["../../../src/components/EmojiPicker/EmojiPicker.module.css"],"sourcesContent":[".root {\n --ep-columns: 9;\n --ep-emoji-size: 32px;\n --ep-emoji-fz: 18px;\n --ep-preview-py: 5px;\n --ep-skin-tone-size: 22px;\n --ep-skin-tone-fz: 14px;\n\n display: flex;\n flex-direction: column;\n width: calc(var(--ep-columns) * var(--ep-emoji-size) + var(--mantine-spacing-xs) * 2 + 2px);\n border: 1px solid var(--mantine-color-default-border);\n border-radius: var(--mantine-radius-default);\n background-color: var(--mantine-color-body);\n}\n\n.search {\n padding: var(--mantine-spacing-xs);\n padding-bottom: 0;\n}\n\n.categoryNav {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n padding: 4px var(--mantine-spacing-xs);\n border-bottom: 1px solid var(--mantine-color-default-border);\n}\n\n.categoryNavButton {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1 1 calc(var(--ep-emoji-fz) + 4px);\n max-width: var(--ep-emoji-size);\n height: var(--ep-emoji-size);\n font-size: var(--ep-emoji-fz);\n border-radius: var(--mantine-radius-sm);\n cursor: pointer;\n\n @mixin hover {\n background-color: var(--mantine-color-default-hover);\n }\n}\n\n.content {\n padding: 0 var(--mantine-spacing-xs);\n\n & [role='grid']:focus-visible {\n outline: 2px solid var(--mantine-primary-color-filled);\n outline-offset: -2px;\n }\n}\n\n.empty {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--mantine-spacing-xs);\n text-align: center;\n}\n\n.categoryLabel {\n display: flex;\n align-items: center;\n font-size: var(--mantine-font-size-xs);\n font-weight: 600;\n color: var(--mantine-color-dimmed);\n padding: var(--mantine-spacing-xs) 0;\n background-color: var(--mantine-color-body);\n}\n\n.grid {\n display: grid;\n grid-template-columns: repeat(var(--ep-columns), var(--ep-emoji-size));\n}\n\n.emoji {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--ep-emoji-size);\n height: var(--ep-emoji-size);\n font-size: var(--ep-emoji-fz);\n border-radius: var(--mantine-radius-sm);\n cursor: pointer;\n line-height: 1;\n padding: 0;\n border: none;\n background: none;\n\n &:focus,\n &:focus-visible {\n outline: none;\n background: none;\n }\n\n &[data-focused] {\n background-color: var(--mantine-color-default-hover);\n outline: 2px solid var(--mantine-primary-color-filled);\n outline-offset: -2px;\n }\n\n @mixin hover {\n background-color: var(--mantine-color-default-hover);\n }\n}\n\n:global(.mantine-focus-auto).emoji:focus-visible {\n outline: none;\n}\n\n.preview {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--mantine-spacing-xs);\n padding: var(--ep-preview-py) var(--mantine-spacing-xs);\n border-top: 1px solid var(--mantine-color-default-border);\n}\n\n.previewEmoji {\n font-size: var(--ep-emoji-fz);\n line-height: 1;\n flex-shrink: 0;\n}\n\n.previewName {\n font-size: var(--mantine-font-size-sm);\n color: var(--mantine-color-dimmed);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n flex: 1;\n}\n\n.skinToneDropdown {\n padding: 4px;\n}\n\n.skinToneSelector {\n display: flex;\n gap: 2px;\n}\n\n.skinToneButton {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--ep-skin-tone-size);\n height: var(--ep-skin-tone-size);\n font-size: var(--ep-skin-tone-fz);\n border-radius: var(--mantine-radius-sm);\n cursor: pointer;\n line-height: 1;\n\n @mixin hover {\n background-color: var(--mantine-color-default-hover);\n }\n}\n\n.skinToneSelector .skinToneButton[data-active] {\n background-color: var(--mantine-color-default-hover);\n}\n"],"mappings":""}