@particle-academy/react-fancy 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -0
- package/dist/index.cjs +2738 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +393 -0
- package/dist/index.d.ts +393 -0
- package/dist/index.js +2713 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +37 -0
- package/dist/styles.css.map +1 -0
- package/dist/styles.d.cts +2 -0
- package/dist/styles.d.ts +2 -0
- package/package.json +64 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2713 @@
|
|
|
1
|
+
import { forwardRef, useId, useRef, useEffect, createContext, useState, useCallback, useMemo, Children, useContext } from 'react';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/components/Action/Action.tsx
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/data/emoji-data.ts
|
|
12
|
+
var CATEGORY_DATA = [
|
|
13
|
+
{
|
|
14
|
+
category: "smileys",
|
|
15
|
+
icon: "\u{1F600}",
|
|
16
|
+
label: "Smileys",
|
|
17
|
+
emojis: [
|
|
18
|
+
{ char: "\u{1F600}", name: "grinning face" },
|
|
19
|
+
{ char: "\u{1F603}", name: "grinning face with big eyes" },
|
|
20
|
+
{ char: "\u{1F604}", name: "grinning face with smiling eyes" },
|
|
21
|
+
{ char: "\u{1F601}", name: "beaming face with smiling eyes" },
|
|
22
|
+
{ char: "\u{1F606}", name: "grinning squinting face" },
|
|
23
|
+
{ char: "\u{1F605}", name: "grinning face with sweat" },
|
|
24
|
+
{ char: "\u{1F923}", name: "rolling on the floor laughing" },
|
|
25
|
+
{ char: "\u{1F602}", name: "face with tears of joy" },
|
|
26
|
+
{ char: "\u{1F642}", name: "slightly smiling face" },
|
|
27
|
+
{ char: "\u{1F643}", name: "upside-down face" },
|
|
28
|
+
{ char: "\u{1F609}", name: "winking face" },
|
|
29
|
+
{ char: "\u{1F60A}", name: "smiling face with smiling eyes" },
|
|
30
|
+
{ char: "\u{1F607}", name: "smiling face with halo" },
|
|
31
|
+
{ char: "\u{1F970}", name: "smiling face with hearts" },
|
|
32
|
+
{ char: "\u{1F60D}", name: "smiling face with heart-eyes" },
|
|
33
|
+
{ char: "\u{1F929}", name: "star-struck" },
|
|
34
|
+
{ char: "\u{1F618}", name: "face blowing a kiss" },
|
|
35
|
+
{ char: "\u{1F617}", name: "kissing face" },
|
|
36
|
+
{ char: "\u{1F61A}", name: "kissing face with closed eyes" },
|
|
37
|
+
{ char: "\u{1F619}", name: "kissing face with smiling eyes" },
|
|
38
|
+
{ char: "\u{1F972}", name: "smiling face with tear" },
|
|
39
|
+
{ char: "\u{1F60B}", name: "face savoring food" },
|
|
40
|
+
{ char: "\u{1F61B}", name: "face with tongue" },
|
|
41
|
+
{ char: "\u{1F61C}", name: "winking face with tongue" },
|
|
42
|
+
{ char: "\u{1F92A}", name: "zany face" },
|
|
43
|
+
{ char: "\u{1F61D}", name: "squinting face with tongue" },
|
|
44
|
+
{ char: "\u{1F911}", name: "money-mouth face" },
|
|
45
|
+
{ char: "\u{1F917}", name: "hugging face" },
|
|
46
|
+
{ char: "\u{1F92D}", name: "face with hand over mouth" },
|
|
47
|
+
{ char: "\u{1F92B}", name: "shushing face" },
|
|
48
|
+
{ char: "\u{1F914}", name: "thinking face" },
|
|
49
|
+
{ char: "\u{1F910}", name: "zipper-mouth face" },
|
|
50
|
+
{ char: "\u{1F928}", name: "face with raised eyebrow" },
|
|
51
|
+
{ char: "\u{1F610}", name: "neutral face" },
|
|
52
|
+
{ char: "\u{1F611}", name: "expressionless face" },
|
|
53
|
+
{ char: "\u{1F636}", name: "face without mouth" },
|
|
54
|
+
{ char: "\u{1F60F}", name: "smirking face" },
|
|
55
|
+
{ char: "\u{1F612}", name: "unamused face" },
|
|
56
|
+
{ char: "\u{1F644}", name: "face with rolling eyes" },
|
|
57
|
+
{ char: "\u{1F62C}", name: "grimacing face" },
|
|
58
|
+
{ char: "\u{1F925}", name: "lying face" },
|
|
59
|
+
{ char: "\u{1F60C}", name: "relieved face" },
|
|
60
|
+
{ char: "\u{1F614}", name: "pensive face" },
|
|
61
|
+
{ char: "\u{1F62A}", name: "sleepy face" },
|
|
62
|
+
{ char: "\u{1F924}", name: "drooling face" },
|
|
63
|
+
{ char: "\u{1F634}", name: "sleeping face" },
|
|
64
|
+
{ char: "\u{1F637}", name: "face with medical mask" },
|
|
65
|
+
{ char: "\u{1F912}", name: "face with thermometer" },
|
|
66
|
+
{ char: "\u{1F915}", name: "face with head-bandage" },
|
|
67
|
+
{ char: "\u{1F922}", name: "nauseated face" },
|
|
68
|
+
{ char: "\u{1F92E}", name: "face vomiting" },
|
|
69
|
+
{ char: "\u{1F927}", name: "sneezing face" },
|
|
70
|
+
{ char: "\u{1F975}", name: "hot face" },
|
|
71
|
+
{ char: "\u{1F976}", name: "cold face" },
|
|
72
|
+
{ char: "\u{1F974}", name: "woozy face" },
|
|
73
|
+
{ char: "\u{1F635}", name: "dizzy face" },
|
|
74
|
+
{ char: "\u{1F92F}", name: "exploding head" },
|
|
75
|
+
{ char: "\u{1F920}", name: "cowboy hat face" },
|
|
76
|
+
{ char: "\u{1F973}", name: "partying face" },
|
|
77
|
+
{ char: "\u{1F978}", name: "disguised face" },
|
|
78
|
+
{ char: "\u{1F60E}", name: "smiling face with sunglasses" },
|
|
79
|
+
{ char: "\u{1F913}", name: "nerd face" },
|
|
80
|
+
{ char: "\u{1F9D0}", name: "face with monocle" },
|
|
81
|
+
{ char: "\u{1F615}", name: "confused face" },
|
|
82
|
+
{ char: "\u{1F61F}", name: "worried face" },
|
|
83
|
+
{ char: "\u{1F641}", name: "slightly frowning face" },
|
|
84
|
+
{ char: "\u{1F62E}", name: "face with open mouth" },
|
|
85
|
+
{ char: "\u{1F62F}", name: "hushed face" },
|
|
86
|
+
{ char: "\u{1F632}", name: "astonished face" },
|
|
87
|
+
{ char: "\u{1F633}", name: "flushed face" },
|
|
88
|
+
{ char: "\u{1F97A}", name: "pleading face" },
|
|
89
|
+
{ char: "\u{1F626}", name: "frowning face with open mouth" },
|
|
90
|
+
{ char: "\u{1F627}", name: "anguished face" },
|
|
91
|
+
{ char: "\u{1F628}", name: "fearful face" },
|
|
92
|
+
{ char: "\u{1F630}", name: "anxious face with sweat" },
|
|
93
|
+
{ char: "\u{1F625}", name: "sad but relieved face" },
|
|
94
|
+
{ char: "\u{1F622}", name: "crying face" },
|
|
95
|
+
{ char: "\u{1F62D}", name: "loudly crying face" },
|
|
96
|
+
{ char: "\u{1F631}", name: "face screaming in fear" },
|
|
97
|
+
{ char: "\u{1F616}", name: "confounded face" },
|
|
98
|
+
{ char: "\u{1F623}", name: "persevering face" },
|
|
99
|
+
{ char: "\u{1F61E}", name: "disappointed face" },
|
|
100
|
+
{ char: "\u{1F613}", name: "downcast face with sweat" },
|
|
101
|
+
{ char: "\u{1F629}", name: "weary face" },
|
|
102
|
+
{ char: "\u{1F62B}", name: "tired face" },
|
|
103
|
+
{ char: "\u{1F971}", name: "yawning face" },
|
|
104
|
+
{ char: "\u{1F624}", name: "face with steam from nose" },
|
|
105
|
+
{ char: "\u{1F621}", name: "pouting face" },
|
|
106
|
+
{ char: "\u{1F620}", name: "angry face" },
|
|
107
|
+
{ char: "\u{1F92C}", name: "face with symbols on mouth" },
|
|
108
|
+
{ char: "\u{1F608}", name: "smiling face with horns" },
|
|
109
|
+
{ char: "\u{1F47F}", name: "angry face with horns" },
|
|
110
|
+
{ char: "\u{1F480}", name: "skull" },
|
|
111
|
+
{ char: "\u{1F4A9}", name: "pile of poo" },
|
|
112
|
+
{ char: "\u{1F921}", name: "clown face" },
|
|
113
|
+
{ char: "\u{1F479}", name: "ogre" },
|
|
114
|
+
{ char: "\u{1F47A}", name: "goblin" },
|
|
115
|
+
{ char: "\u{1F47B}", name: "ghost" },
|
|
116
|
+
{ char: "\u{1F47D}", name: "alien" },
|
|
117
|
+
{ char: "\u{1F47E}", name: "alien monster" },
|
|
118
|
+
{ char: "\u{1F916}", name: "robot" }
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
category: "people",
|
|
123
|
+
icon: "\u{1F44B}",
|
|
124
|
+
label: "People",
|
|
125
|
+
emojis: [
|
|
126
|
+
{ char: "\u{1F44B}", name: "waving hand" },
|
|
127
|
+
{ char: "\u{1F91A}", name: "raised back of hand" },
|
|
128
|
+
{ char: "\u{1F590}", name: "hand with fingers splayed" },
|
|
129
|
+
{ char: "\u270B", name: "raised hand" },
|
|
130
|
+
{ char: "\u{1F596}", name: "vulcan salute" },
|
|
131
|
+
{ char: "\u{1F44C}", name: "ok hand" },
|
|
132
|
+
{ char: "\u{1F90C}", name: "pinched fingers" },
|
|
133
|
+
{ char: "\u{1F90F}", name: "pinching hand" },
|
|
134
|
+
{ char: "\u270C\uFE0F", name: "victory hand" },
|
|
135
|
+
{ char: "\u{1F91E}", name: "crossed fingers" },
|
|
136
|
+
{ char: "\u{1F91F}", name: "love-you gesture" },
|
|
137
|
+
{ char: "\u{1F918}", name: "sign of the horns" },
|
|
138
|
+
{ char: "\u{1F919}", name: "call me hand" },
|
|
139
|
+
{ char: "\u{1F448}", name: "backhand index pointing left" },
|
|
140
|
+
{ char: "\u{1F449}", name: "backhand index pointing right" },
|
|
141
|
+
{ char: "\u{1F446}", name: "backhand index pointing up" },
|
|
142
|
+
{ char: "\u{1F447}", name: "backhand index pointing down" },
|
|
143
|
+
{ char: "\u261D\uFE0F", name: "index pointing up" },
|
|
144
|
+
{ char: "\u{1F44D}", name: "thumbs up" },
|
|
145
|
+
{ char: "\u{1F44E}", name: "thumbs down" },
|
|
146
|
+
{ char: "\u270A", name: "raised fist" },
|
|
147
|
+
{ char: "\u{1F44A}", name: "oncoming fist" },
|
|
148
|
+
{ char: "\u{1F91B}", name: "left-facing fist" },
|
|
149
|
+
{ char: "\u{1F91C}", name: "right-facing fist" },
|
|
150
|
+
{ char: "\u{1F44F}", name: "clapping hands" },
|
|
151
|
+
{ char: "\u{1F64C}", name: "raising hands" },
|
|
152
|
+
{ char: "\u{1F450}", name: "open hands" },
|
|
153
|
+
{ char: "\u{1F932}", name: "palms up together" },
|
|
154
|
+
{ char: "\u{1F91D}", name: "handshake" },
|
|
155
|
+
{ char: "\u{1F64F}", name: "folded hands" },
|
|
156
|
+
{ char: "\u270D\uFE0F", name: "writing hand" },
|
|
157
|
+
{ char: "\u{1F485}", name: "nail polish" },
|
|
158
|
+
{ char: "\u{1F933}", name: "selfie" },
|
|
159
|
+
{ char: "\u{1F4AA}", name: "flexed biceps" },
|
|
160
|
+
{ char: "\u{1F476}", name: "baby" },
|
|
161
|
+
{ char: "\u{1F467}", name: "girl" },
|
|
162
|
+
{ char: "\u{1F9D2}", name: "child" },
|
|
163
|
+
{ char: "\u{1F466}", name: "boy" },
|
|
164
|
+
{ char: "\u{1F469}", name: "woman" },
|
|
165
|
+
{ char: "\u{1F9D1}", name: "person" },
|
|
166
|
+
{ char: "\u{1F468}", name: "man" },
|
|
167
|
+
{ char: "\u{1F475}", name: "old woman" },
|
|
168
|
+
{ char: "\u{1F9D3}", name: "older person" },
|
|
169
|
+
{ char: "\u{1F474}", name: "old man" },
|
|
170
|
+
{ char: "\u{1F46E}", name: "police officer" },
|
|
171
|
+
{ char: "\u{1F477}", name: "construction worker" },
|
|
172
|
+
{ char: "\u{1F482}", name: "guard" },
|
|
173
|
+
{ char: "\u{1F575}\uFE0F", name: "detective" },
|
|
174
|
+
{ char: "\u{1F469}\u200D\u2695\uFE0F", name: "woman health worker" },
|
|
175
|
+
{ char: "\u{1F468}\u200D\u2695\uFE0F", name: "man health worker" },
|
|
176
|
+
{ char: "\u{1F469}\u200D\u{1F393}", name: "woman student" },
|
|
177
|
+
{ char: "\u{1F468}\u200D\u{1F393}", name: "man student" },
|
|
178
|
+
{ char: "\u{1F469}\u200D\u{1F4BB}", name: "woman technologist" },
|
|
179
|
+
{ char: "\u{1F468}\u200D\u{1F4BB}", name: "man technologist" },
|
|
180
|
+
{ char: "\u{1F9D9}", name: "mage" },
|
|
181
|
+
{ char: "\u{1F9DA}", name: "fairy" },
|
|
182
|
+
{ char: "\u{1F9DB}", name: "vampire" },
|
|
183
|
+
{ char: "\u{1F9DC}", name: "merperson" },
|
|
184
|
+
{ char: "\u{1F9DD}", name: "elf" },
|
|
185
|
+
{ char: "\u{1F9DE}", name: "genie" },
|
|
186
|
+
{ char: "\u{1F9DF}", name: "zombie" },
|
|
187
|
+
{ char: "\u{1F486}", name: "person getting massage" },
|
|
188
|
+
{ char: "\u{1F487}", name: "person getting haircut" },
|
|
189
|
+
{ char: "\u{1F6B6}", name: "person walking" },
|
|
190
|
+
{ char: "\u{1F9CD}", name: "person standing" },
|
|
191
|
+
{ char: "\u{1F9CE}", name: "person kneeling" },
|
|
192
|
+
{ char: "\u{1F3C3}", name: "person running" },
|
|
193
|
+
{ char: "\u{1F483}", name: "woman dancing" },
|
|
194
|
+
{ char: "\u{1F57A}", name: "man dancing" },
|
|
195
|
+
{ char: "\u{1F46B}", name: "woman and man holding hands" },
|
|
196
|
+
{ char: "\u{1F46D}", name: "women holding hands" },
|
|
197
|
+
{ char: "\u{1F46C}", name: "men holding hands" },
|
|
198
|
+
{ char: "\u{1F48F}", name: "kiss" },
|
|
199
|
+
{ char: "\u{1F491}", name: "couple with heart" },
|
|
200
|
+
{ char: "\u{1F46A}", name: "family" }
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
category: "animals",
|
|
205
|
+
icon: "\u{1F431}",
|
|
206
|
+
label: "Animals",
|
|
207
|
+
emojis: [
|
|
208
|
+
{ char: "\u{1F436}", name: "dog face" },
|
|
209
|
+
{ char: "\u{1F431}", name: "cat face" },
|
|
210
|
+
{ char: "\u{1F42D}", name: "mouse face" },
|
|
211
|
+
{ char: "\u{1F439}", name: "hamster" },
|
|
212
|
+
{ char: "\u{1F430}", name: "rabbit face" },
|
|
213
|
+
{ char: "\u{1F98A}", name: "fox" },
|
|
214
|
+
{ char: "\u{1F43B}", name: "bear" },
|
|
215
|
+
{ char: "\u{1F43C}", name: "panda" },
|
|
216
|
+
{ char: "\u{1F428}", name: "koala" },
|
|
217
|
+
{ char: "\u{1F42F}", name: "tiger face" },
|
|
218
|
+
{ char: "\u{1F981}", name: "lion" },
|
|
219
|
+
{ char: "\u{1F42E}", name: "cow face" },
|
|
220
|
+
{ char: "\u{1F437}", name: "pig face" },
|
|
221
|
+
{ char: "\u{1F438}", name: "frog" },
|
|
222
|
+
{ char: "\u{1F435}", name: "monkey face" },
|
|
223
|
+
{ char: "\u{1F648}", name: "see-no-evil monkey" },
|
|
224
|
+
{ char: "\u{1F649}", name: "hear-no-evil monkey" },
|
|
225
|
+
{ char: "\u{1F64A}", name: "speak-no-evil monkey" },
|
|
226
|
+
{ char: "\u{1F412}", name: "monkey" },
|
|
227
|
+
{ char: "\u{1F414}", name: "chicken" },
|
|
228
|
+
{ char: "\u{1F427}", name: "penguin" },
|
|
229
|
+
{ char: "\u{1F426}", name: "bird" },
|
|
230
|
+
{ char: "\u{1F424}", name: "baby chick" },
|
|
231
|
+
{ char: "\u{1F986}", name: "duck" },
|
|
232
|
+
{ char: "\u{1F985}", name: "eagle" },
|
|
233
|
+
{ char: "\u{1F989}", name: "owl" },
|
|
234
|
+
{ char: "\u{1F987}", name: "bat" },
|
|
235
|
+
{ char: "\u{1F43A}", name: "wolf" },
|
|
236
|
+
{ char: "\u{1F417}", name: "boar" },
|
|
237
|
+
{ char: "\u{1F434}", name: "horse face" },
|
|
238
|
+
{ char: "\u{1F984}", name: "unicorn" },
|
|
239
|
+
{ char: "\u{1F41D}", name: "honeybee" },
|
|
240
|
+
{ char: "\u{1F41B}", name: "bug" },
|
|
241
|
+
{ char: "\u{1F98B}", name: "butterfly" },
|
|
242
|
+
{ char: "\u{1F40C}", name: "snail" },
|
|
243
|
+
{ char: "\u{1F41E}", name: "lady beetle" },
|
|
244
|
+
{ char: "\u{1F41C}", name: "ant" },
|
|
245
|
+
{ char: "\u{1F99F}", name: "mosquito" },
|
|
246
|
+
{ char: "\u{1F422}", name: "turtle" },
|
|
247
|
+
{ char: "\u{1F40D}", name: "snake" },
|
|
248
|
+
{ char: "\u{1F98E}", name: "lizard" },
|
|
249
|
+
{ char: "\u{1F419}", name: "octopus" },
|
|
250
|
+
{ char: "\u{1F991}", name: "squid" },
|
|
251
|
+
{ char: "\u{1F990}", name: "shrimp" },
|
|
252
|
+
{ char: "\u{1F980}", name: "crab" },
|
|
253
|
+
{ char: "\u{1F421}", name: "blowfish" },
|
|
254
|
+
{ char: "\u{1F420}", name: "tropical fish" },
|
|
255
|
+
{ char: "\u{1F41F}", name: "fish" },
|
|
256
|
+
{ char: "\u{1F42C}", name: "dolphin" },
|
|
257
|
+
{ char: "\u{1F433}", name: "spouting whale" },
|
|
258
|
+
{ char: "\u{1F40B}", name: "whale" },
|
|
259
|
+
{ char: "\u{1F988}", name: "shark" },
|
|
260
|
+
{ char: "\u{1F40A}", name: "crocodile" },
|
|
261
|
+
{ char: "\u{1F405}", name: "tiger" },
|
|
262
|
+
{ char: "\u{1F406}", name: "leopard" },
|
|
263
|
+
{ char: "\u{1F993}", name: "zebra" },
|
|
264
|
+
{ char: "\u{1F98D}", name: "gorilla" },
|
|
265
|
+
{ char: "\u{1F9A7}", name: "orangutan" },
|
|
266
|
+
{ char: "\u{1F418}", name: "elephant" },
|
|
267
|
+
{ char: "\u{1F99B}", name: "hippopotamus" },
|
|
268
|
+
{ char: "\u{1F98F}", name: "rhinoceros" },
|
|
269
|
+
{ char: "\u{1F42A}", name: "camel" },
|
|
270
|
+
{ char: "\u{1F42B}", name: "two-hump camel" },
|
|
271
|
+
{ char: "\u{1F992}", name: "giraffe" },
|
|
272
|
+
{ char: "\u{1F998}", name: "kangaroo" },
|
|
273
|
+
{ char: "\u{1F403}", name: "water buffalo" },
|
|
274
|
+
{ char: "\u{1F402}", name: "ox" },
|
|
275
|
+
{ char: "\u{1F404}", name: "cow" },
|
|
276
|
+
{ char: "\u{1F40E}", name: "horse" },
|
|
277
|
+
{ char: "\u{1F416}", name: "pig" },
|
|
278
|
+
{ char: "\u{1F40F}", name: "ram" },
|
|
279
|
+
{ char: "\u{1F411}", name: "ewe" },
|
|
280
|
+
{ char: "\u{1F999}", name: "llama" },
|
|
281
|
+
{ char: "\u{1F410}", name: "goat" },
|
|
282
|
+
{ char: "\u{1F98C}", name: "deer" },
|
|
283
|
+
{ char: "\u{1F415}", name: "dog" },
|
|
284
|
+
{ char: "\u{1F429}", name: "poodle" },
|
|
285
|
+
{ char: "\u{1F9AE}", name: "guide dog" },
|
|
286
|
+
{ char: "\u{1F408}", name: "cat" },
|
|
287
|
+
{ char: "\u{1F413}", name: "rooster" },
|
|
288
|
+
{ char: "\u{1F983}", name: "turkey" },
|
|
289
|
+
{ char: "\u{1F99A}", name: "peacock" },
|
|
290
|
+
{ char: "\u{1F99C}", name: "parrot" },
|
|
291
|
+
{ char: "\u{1F9A2}", name: "swan" },
|
|
292
|
+
{ char: "\u{1F9A9}", name: "flamingo" },
|
|
293
|
+
{ char: "\u{1F407}", name: "rabbit" },
|
|
294
|
+
{ char: "\u{1F99D}", name: "raccoon" },
|
|
295
|
+
{ char: "\u{1F9A8}", name: "skunk" },
|
|
296
|
+
{ char: "\u{1F9A1}", name: "badger" },
|
|
297
|
+
{ char: "\u{1F9AB}", name: "beaver" },
|
|
298
|
+
{ char: "\u{1F9A6}", name: "otter" },
|
|
299
|
+
{ char: "\u{1F9A5}", name: "sloth" }
|
|
300
|
+
]
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
category: "food",
|
|
304
|
+
icon: "\u{1F354}",
|
|
305
|
+
label: "Food",
|
|
306
|
+
emojis: [
|
|
307
|
+
{ char: "\u{1F34F}", name: "green apple" },
|
|
308
|
+
{ char: "\u{1F34E}", name: "red apple" },
|
|
309
|
+
{ char: "\u{1F350}", name: "pear" },
|
|
310
|
+
{ char: "\u{1F34A}", name: "tangerine" },
|
|
311
|
+
{ char: "\u{1F34B}", name: "lemon" },
|
|
312
|
+
{ char: "\u{1F34C}", name: "banana" },
|
|
313
|
+
{ char: "\u{1F349}", name: "watermelon" },
|
|
314
|
+
{ char: "\u{1F347}", name: "grapes" },
|
|
315
|
+
{ char: "\u{1F353}", name: "strawberry" },
|
|
316
|
+
{ char: "\u{1FAD0}", name: "blueberries" },
|
|
317
|
+
{ char: "\u{1F348}", name: "melon" },
|
|
318
|
+
{ char: "\u{1F352}", name: "cherries" },
|
|
319
|
+
{ char: "\u{1F351}", name: "peach" },
|
|
320
|
+
{ char: "\u{1F96D}", name: "mango" },
|
|
321
|
+
{ char: "\u{1F34D}", name: "pineapple" },
|
|
322
|
+
{ char: "\u{1F965}", name: "coconut" },
|
|
323
|
+
{ char: "\u{1F95D}", name: "kiwi fruit" },
|
|
324
|
+
{ char: "\u{1F345}", name: "tomato" },
|
|
325
|
+
{ char: "\u{1F346}", name: "eggplant" },
|
|
326
|
+
{ char: "\u{1F951}", name: "avocado" },
|
|
327
|
+
{ char: "\u{1F966}", name: "broccoli" },
|
|
328
|
+
{ char: "\u{1F96C}", name: "leafy green" },
|
|
329
|
+
{ char: "\u{1F952}", name: "cucumber" },
|
|
330
|
+
{ char: "\u{1F336}\uFE0F", name: "hot pepper" },
|
|
331
|
+
{ char: "\u{1FAD1}", name: "bell pepper" },
|
|
332
|
+
{ char: "\u{1F33D}", name: "ear of corn" },
|
|
333
|
+
{ char: "\u{1F955}", name: "carrot" },
|
|
334
|
+
{ char: "\u{1F9C4}", name: "garlic" },
|
|
335
|
+
{ char: "\u{1F9C5}", name: "onion" },
|
|
336
|
+
{ char: "\u{1F954}", name: "potato" },
|
|
337
|
+
{ char: "\u{1F360}", name: "roasted sweet potato" },
|
|
338
|
+
{ char: "\u{1F950}", name: "croissant" },
|
|
339
|
+
{ char: "\u{1F96F}", name: "bagel" },
|
|
340
|
+
{ char: "\u{1F35E}", name: "bread" },
|
|
341
|
+
{ char: "\u{1F956}", name: "baguette bread" },
|
|
342
|
+
{ char: "\u{1F968}", name: "pretzel" },
|
|
343
|
+
{ char: "\u{1F9C0}", name: "cheese wedge" },
|
|
344
|
+
{ char: "\u{1F95A}", name: "egg" },
|
|
345
|
+
{ char: "\u{1F373}", name: "cooking" },
|
|
346
|
+
{ char: "\u{1F9C8}", name: "butter" },
|
|
347
|
+
{ char: "\u{1F95E}", name: "pancakes" },
|
|
348
|
+
{ char: "\u{1F9C7}", name: "waffle" },
|
|
349
|
+
{ char: "\u{1F953}", name: "bacon" },
|
|
350
|
+
{ char: "\u{1F969}", name: "cut of meat" },
|
|
351
|
+
{ char: "\u{1F357}", name: "poultry leg" },
|
|
352
|
+
{ char: "\u{1F356}", name: "meat on bone" },
|
|
353
|
+
{ char: "\u{1F32D}", name: "hot dog" },
|
|
354
|
+
{ char: "\u{1F354}", name: "hamburger" },
|
|
355
|
+
{ char: "\u{1F35F}", name: "french fries" },
|
|
356
|
+
{ char: "\u{1F355}", name: "pizza" },
|
|
357
|
+
{ char: "\u{1F96A}", name: "sandwich" },
|
|
358
|
+
{ char: "\u{1F959}", name: "stuffed flatbread" },
|
|
359
|
+
{ char: "\u{1F9C6}", name: "falafel" },
|
|
360
|
+
{ char: "\u{1F32E}", name: "taco" },
|
|
361
|
+
{ char: "\u{1F32F}", name: "burrito" },
|
|
362
|
+
{ char: "\u{1F957}", name: "green salad" },
|
|
363
|
+
{ char: "\u{1F958}", name: "shallow pan of food" },
|
|
364
|
+
{ char: "\u{1F35D}", name: "spaghetti" },
|
|
365
|
+
{ char: "\u{1F35C}", name: "steaming bowl" },
|
|
366
|
+
{ char: "\u{1F372}", name: "pot of food" },
|
|
367
|
+
{ char: "\u{1F35B}", name: "curry rice" },
|
|
368
|
+
{ char: "\u{1F363}", name: "sushi" },
|
|
369
|
+
{ char: "\u{1F371}", name: "bento box" },
|
|
370
|
+
{ char: "\u{1F95F}", name: "dumpling" },
|
|
371
|
+
{ char: "\u{1F364}", name: "fried shrimp" },
|
|
372
|
+
{ char: "\u{1F359}", name: "rice ball" },
|
|
373
|
+
{ char: "\u{1F35A}", name: "cooked rice" },
|
|
374
|
+
{ char: "\u{1F358}", name: "rice cracker" },
|
|
375
|
+
{ char: "\u{1F365}", name: "fish cake with swirl" },
|
|
376
|
+
{ char: "\u{1F96E}", name: "moon cake" },
|
|
377
|
+
{ char: "\u{1F362}", name: "oden" },
|
|
378
|
+
{ char: "\u{1F361}", name: "dango" },
|
|
379
|
+
{ char: "\u{1F367}", name: "shaved ice" },
|
|
380
|
+
{ char: "\u{1F368}", name: "ice cream" },
|
|
381
|
+
{ char: "\u{1F366}", name: "soft ice cream" },
|
|
382
|
+
{ char: "\u{1F967}", name: "pie" },
|
|
383
|
+
{ char: "\u{1F9C1}", name: "cupcake" },
|
|
384
|
+
{ char: "\u{1F370}", name: "shortcake" },
|
|
385
|
+
{ char: "\u{1F382}", name: "birthday cake" },
|
|
386
|
+
{ char: "\u{1F36E}", name: "custard" },
|
|
387
|
+
{ char: "\u{1F36D}", name: "lollipop" },
|
|
388
|
+
{ char: "\u{1F36C}", name: "candy" },
|
|
389
|
+
{ char: "\u{1F36B}", name: "chocolate bar" },
|
|
390
|
+
{ char: "\u{1F37F}", name: "popcorn" },
|
|
391
|
+
{ char: "\u{1F369}", name: "doughnut" },
|
|
392
|
+
{ char: "\u{1F36A}", name: "cookie" },
|
|
393
|
+
{ char: "\u{1F330}", name: "chestnut" },
|
|
394
|
+
{ char: "\u{1F95C}", name: "peanuts" },
|
|
395
|
+
{ char: "\u{1F36F}", name: "honey pot" },
|
|
396
|
+
{ char: "\u2615", name: "hot beverage" },
|
|
397
|
+
{ char: "\u{1F375}", name: "teacup without handle" },
|
|
398
|
+
{ char: "\u{1F9C3}", name: "beverage box" },
|
|
399
|
+
{ char: "\u{1F964}", name: "cup with straw" },
|
|
400
|
+
{ char: "\u{1F9CB}", name: "bubble tea" },
|
|
401
|
+
{ char: "\u{1F376}", name: "sake" },
|
|
402
|
+
{ char: "\u{1F37A}", name: "beer mug" },
|
|
403
|
+
{ char: "\u{1F37B}", name: "clinking beer mugs" },
|
|
404
|
+
{ char: "\u{1F942}", name: "clinking glasses" },
|
|
405
|
+
{ char: "\u{1F377}", name: "wine glass" },
|
|
406
|
+
{ char: "\u{1F943}", name: "tumbler glass" },
|
|
407
|
+
{ char: "\u{1F378}", name: "cocktail glass" },
|
|
408
|
+
{ char: "\u{1F379}", name: "tropical drink" },
|
|
409
|
+
{ char: "\u{1F9CA}", name: "ice" }
|
|
410
|
+
]
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
category: "activities",
|
|
414
|
+
icon: "\u26BD",
|
|
415
|
+
label: "Activities",
|
|
416
|
+
emojis: [
|
|
417
|
+
{ char: "\u26BD", name: "soccer ball" },
|
|
418
|
+
{ char: "\u{1F3C0}", name: "basketball" },
|
|
419
|
+
{ char: "\u{1F3C8}", name: "american football" },
|
|
420
|
+
{ char: "\u26BE", name: "baseball" },
|
|
421
|
+
{ char: "\u{1F94E}", name: "softball" },
|
|
422
|
+
{ char: "\u{1F3BE}", name: "tennis" },
|
|
423
|
+
{ char: "\u{1F3D0}", name: "volleyball" },
|
|
424
|
+
{ char: "\u{1F3C9}", name: "rugby football" },
|
|
425
|
+
{ char: "\u{1F94F}", name: "flying disc" },
|
|
426
|
+
{ char: "\u{1F3B1}", name: "pool 8 ball" },
|
|
427
|
+
{ char: "\u{1FA80}", name: "yo-yo" },
|
|
428
|
+
{ char: "\u{1F3D3}", name: "ping pong" },
|
|
429
|
+
{ char: "\u{1F3F8}", name: "badminton" },
|
|
430
|
+
{ char: "\u{1F3D2}", name: "ice hockey" },
|
|
431
|
+
{ char: "\u{1F3D1}", name: "field hockey" },
|
|
432
|
+
{ char: "\u{1F94D}", name: "lacrosse" },
|
|
433
|
+
{ char: "\u{1F3CF}", name: "cricket game" },
|
|
434
|
+
{ char: "\u{1FA83}", name: "boomerang" },
|
|
435
|
+
{ char: "\u{1F945}", name: "goal net" },
|
|
436
|
+
{ char: "\u26F3", name: "flag in hole" },
|
|
437
|
+
{ char: "\u{1FA81}", name: "kite" },
|
|
438
|
+
{ char: "\u{1F3F9}", name: "bow and arrow" },
|
|
439
|
+
{ char: "\u{1F3A3}", name: "fishing pole" },
|
|
440
|
+
{ char: "\u{1F93F}", name: "diving mask" },
|
|
441
|
+
{ char: "\u{1F94A}", name: "boxing glove" },
|
|
442
|
+
{ char: "\u{1F94B}", name: "martial arts uniform" },
|
|
443
|
+
{ char: "\u{1F3BD}", name: "running shirt" },
|
|
444
|
+
{ char: "\u{1F6F9}", name: "skateboard" },
|
|
445
|
+
{ char: "\u{1F6FC}", name: "roller skate" },
|
|
446
|
+
{ char: "\u{1F6F7}", name: "sled" },
|
|
447
|
+
{ char: "\u26F8\uFE0F", name: "ice skate" },
|
|
448
|
+
{ char: "\u{1F94C}", name: "curling stone" },
|
|
449
|
+
{ char: "\u{1F3BF}", name: "skis" },
|
|
450
|
+
{ char: "\u26F7\uFE0F", name: "skier" },
|
|
451
|
+
{ char: "\u{1F3C2}", name: "snowboarder" },
|
|
452
|
+
{ char: "\u{1F3CB}\uFE0F", name: "person lifting weights" },
|
|
453
|
+
{ char: "\u{1F93C}", name: "people wrestling" },
|
|
454
|
+
{ char: "\u{1F938}", name: "person cartwheeling" },
|
|
455
|
+
{ char: "\u{1F93A}", name: "person fencing" },
|
|
456
|
+
{ char: "\u26F9\uFE0F", name: "person bouncing ball" },
|
|
457
|
+
{ char: "\u{1F93E}", name: "person playing handball" },
|
|
458
|
+
{ char: "\u{1F3CC}\uFE0F", name: "person golfing" },
|
|
459
|
+
{ char: "\u{1F3C7}", name: "horse racing" },
|
|
460
|
+
{ char: "\u{1F9D8}", name: "person in lotus position" },
|
|
461
|
+
{ char: "\u{1F3C4}", name: "person surfing" },
|
|
462
|
+
{ char: "\u{1F3CA}", name: "person swimming" },
|
|
463
|
+
{ char: "\u{1F93D}", name: "person playing water polo" },
|
|
464
|
+
{ char: "\u{1F6A3}", name: "person rowing boat" },
|
|
465
|
+
{ char: "\u{1F9D7}", name: "person climbing" },
|
|
466
|
+
{ char: "\u{1F6B4}", name: "person biking" },
|
|
467
|
+
{ char: "\u{1F6B5}", name: "person mountain biking" },
|
|
468
|
+
{ char: "\u{1F3AA}", name: "circus tent" },
|
|
469
|
+
{ char: "\u{1F3AD}", name: "performing arts" },
|
|
470
|
+
{ char: "\u{1F3A8}", name: "artist palette" },
|
|
471
|
+
{ char: "\u{1F3AC}", name: "clapper board" },
|
|
472
|
+
{ char: "\u{1F3A4}", name: "microphone" },
|
|
473
|
+
{ char: "\u{1F3A7}", name: "headphone" },
|
|
474
|
+
{ char: "\u{1F3BC}", name: "musical score" },
|
|
475
|
+
{ char: "\u{1F3B9}", name: "musical keyboard" },
|
|
476
|
+
{ char: "\u{1F941}", name: "drum" },
|
|
477
|
+
{ char: "\u{1F3B7}", name: "saxophone" },
|
|
478
|
+
{ char: "\u{1F3BA}", name: "trumpet" },
|
|
479
|
+
{ char: "\u{1F3B8}", name: "guitar" },
|
|
480
|
+
{ char: "\u{1FA95}", name: "banjo" },
|
|
481
|
+
{ char: "\u{1F3BB}", name: "violin" },
|
|
482
|
+
{ char: "\u{1F3B2}", name: "game die" },
|
|
483
|
+
{ char: "\u265F\uFE0F", name: "chess pawn" },
|
|
484
|
+
{ char: "\u{1F3AF}", name: "direct hit" },
|
|
485
|
+
{ char: "\u{1F3B3}", name: "bowling" },
|
|
486
|
+
{ char: "\u{1F3AE}", name: "video game" },
|
|
487
|
+
{ char: "\u{1F3B0}", name: "slot machine" },
|
|
488
|
+
{ char: "\u{1F9E9}", name: "puzzle piece" },
|
|
489
|
+
{ char: "\u{1F3C6}", name: "trophy" },
|
|
490
|
+
{ char: "\u{1F3C5}", name: "sports medal" },
|
|
491
|
+
{ char: "\u{1F947}", name: "first place medal" },
|
|
492
|
+
{ char: "\u{1F948}", name: "second place medal" },
|
|
493
|
+
{ char: "\u{1F949}", name: "third place medal" }
|
|
494
|
+
]
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
category: "travel",
|
|
498
|
+
icon: "\u{1F697}",
|
|
499
|
+
label: "Travel",
|
|
500
|
+
emojis: [
|
|
501
|
+
{ char: "\u{1F697}", name: "automobile" },
|
|
502
|
+
{ char: "\u{1F695}", name: "taxi" },
|
|
503
|
+
{ char: "\u{1F699}", name: "sport utility vehicle" },
|
|
504
|
+
{ char: "\u{1F68C}", name: "bus" },
|
|
505
|
+
{ char: "\u{1F68E}", name: "trolleybus" },
|
|
506
|
+
{ char: "\u{1F3CE}\uFE0F", name: "racing car" },
|
|
507
|
+
{ char: "\u{1F693}", name: "police car" },
|
|
508
|
+
{ char: "\u{1F691}", name: "ambulance" },
|
|
509
|
+
{ char: "\u{1F692}", name: "fire engine" },
|
|
510
|
+
{ char: "\u{1F690}", name: "minibus" },
|
|
511
|
+
{ char: "\u{1F6FB}", name: "pickup truck" },
|
|
512
|
+
{ char: "\u{1F69A}", name: "delivery truck" },
|
|
513
|
+
{ char: "\u{1F69B}", name: "articulated lorry" },
|
|
514
|
+
{ char: "\u{1F69C}", name: "tractor" },
|
|
515
|
+
{ char: "\u{1F3CD}\uFE0F", name: "motorcycle" },
|
|
516
|
+
{ char: "\u{1F6F5}", name: "motor scooter" },
|
|
517
|
+
{ char: "\u{1F6B2}", name: "bicycle" },
|
|
518
|
+
{ char: "\u{1F6F4}", name: "kick scooter" },
|
|
519
|
+
{ char: "\u{1F6A8}", name: "police car light" },
|
|
520
|
+
{ char: "\u{1F694}", name: "oncoming police car" },
|
|
521
|
+
{ char: "\u{1F68D}", name: "oncoming bus" },
|
|
522
|
+
{ char: "\u{1F698}", name: "oncoming automobile" },
|
|
523
|
+
{ char: "\u{1F696}", name: "oncoming taxi" },
|
|
524
|
+
{ char: "\u{1F683}", name: "railway car" },
|
|
525
|
+
{ char: "\u{1F68B}", name: "tram car" },
|
|
526
|
+
{ char: "\u{1F69E}", name: "mountain railway" },
|
|
527
|
+
{ char: "\u{1F69D}", name: "monorail" },
|
|
528
|
+
{ char: "\u{1F684}", name: "high-speed train" },
|
|
529
|
+
{ char: "\u{1F685}", name: "bullet train" },
|
|
530
|
+
{ char: "\u{1F688}", name: "light rail" },
|
|
531
|
+
{ char: "\u{1F682}", name: "locomotive" },
|
|
532
|
+
{ char: "\u{1F686}", name: "train" },
|
|
533
|
+
{ char: "\u{1F687}", name: "metro" },
|
|
534
|
+
{ char: "\u{1F68A}", name: "tram" },
|
|
535
|
+
{ char: "\u{1F689}", name: "station" },
|
|
536
|
+
{ char: "\u2708\uFE0F", name: "airplane" },
|
|
537
|
+
{ char: "\u{1F6EB}", name: "airplane departure" },
|
|
538
|
+
{ char: "\u{1F6EC}", name: "airplane arrival" },
|
|
539
|
+
{ char: "\u{1F6E9}\uFE0F", name: "small airplane" },
|
|
540
|
+
{ char: "\u{1F680}", name: "rocket" },
|
|
541
|
+
{ char: "\u{1F6F8}", name: "flying saucer" },
|
|
542
|
+
{ char: "\u{1F681}", name: "helicopter" },
|
|
543
|
+
{ char: "\u{1F6F6}", name: "canoe" },
|
|
544
|
+
{ char: "\u26F5", name: "sailboat" },
|
|
545
|
+
{ char: "\u{1F6A4}", name: "speedboat" },
|
|
546
|
+
{ char: "\u{1F6E5}\uFE0F", name: "motor boat" },
|
|
547
|
+
{ char: "\u{1F6F3}\uFE0F", name: "passenger ship" },
|
|
548
|
+
{ char: "\u26F4\uFE0F", name: "ferry" },
|
|
549
|
+
{ char: "\u{1F6A2}", name: "ship" },
|
|
550
|
+
{ char: "\u2693", name: "anchor" },
|
|
551
|
+
{ char: "\u26FD", name: "fuel pump" },
|
|
552
|
+
{ char: "\u{1F6A7}", name: "construction" },
|
|
553
|
+
{ char: "\u{1F6A6}", name: "vertical traffic light" },
|
|
554
|
+
{ char: "\u{1F6A5}", name: "horizontal traffic light" },
|
|
555
|
+
{ char: "\u{1F68F}", name: "bus stop" },
|
|
556
|
+
{ char: "\u{1F5FA}\uFE0F", name: "world map" },
|
|
557
|
+
{ char: "\u{1F5FF}", name: "moai" },
|
|
558
|
+
{ char: "\u{1F5FD}", name: "Statue of Liberty" },
|
|
559
|
+
{ char: "\u{1F5FC}", name: "Tokyo tower" },
|
|
560
|
+
{ char: "\u{1F3F0}", name: "castle" },
|
|
561
|
+
{ char: "\u{1F3EF}", name: "Japanese castle" },
|
|
562
|
+
{ char: "\u{1F3DF}\uFE0F", name: "stadium" },
|
|
563
|
+
{ char: "\u{1F3A1}", name: "ferris wheel" },
|
|
564
|
+
{ char: "\u{1F3A2}", name: "roller coaster" },
|
|
565
|
+
{ char: "\u{1F3A0}", name: "carousel horse" },
|
|
566
|
+
{ char: "\u26F2", name: "fountain" },
|
|
567
|
+
{ char: "\u26F1\uFE0F", name: "umbrella on ground" },
|
|
568
|
+
{ char: "\u{1F3D6}\uFE0F", name: "beach with umbrella" },
|
|
569
|
+
{ char: "\u{1F3DD}\uFE0F", name: "desert island" },
|
|
570
|
+
{ char: "\u{1F3DC}\uFE0F", name: "desert" },
|
|
571
|
+
{ char: "\u{1F30B}", name: "volcano" },
|
|
572
|
+
{ char: "\u26F0\uFE0F", name: "mountain" },
|
|
573
|
+
{ char: "\u{1F3D4}\uFE0F", name: "snow-capped mountain" },
|
|
574
|
+
{ char: "\u{1F5FB}", name: "mount fuji" },
|
|
575
|
+
{ char: "\u{1F3D5}\uFE0F", name: "camping" },
|
|
576
|
+
{ char: "\u26FA", name: "tent" },
|
|
577
|
+
{ char: "\u{1F3E0}", name: "house" },
|
|
578
|
+
{ char: "\u{1F3E1}", name: "house with garden" },
|
|
579
|
+
{ char: "\u{1F3E2}", name: "office building" },
|
|
580
|
+
{ char: "\u{1F3E3}", name: "Japanese post office" },
|
|
581
|
+
{ char: "\u{1F3E4}", name: "post office" },
|
|
582
|
+
{ char: "\u{1F3E5}", name: "hospital" },
|
|
583
|
+
{ char: "\u{1F3E6}", name: "bank" },
|
|
584
|
+
{ char: "\u{1F3E8}", name: "hotel" },
|
|
585
|
+
{ char: "\u{1F3E9}", name: "love hotel" },
|
|
586
|
+
{ char: "\u{1F3EA}", name: "convenience store" },
|
|
587
|
+
{ char: "\u{1F3EB}", name: "school" },
|
|
588
|
+
{ char: "\u{1F3EC}", name: "department store" },
|
|
589
|
+
{ char: "\u{1F3ED}", name: "factory" },
|
|
590
|
+
{ char: "\u{1F3D7}\uFE0F", name: "building construction" },
|
|
591
|
+
{ char: "\u{1F9F1}", name: "brick" },
|
|
592
|
+
{ char: "\u{1F305}", name: "sunrise" },
|
|
593
|
+
{ char: "\u{1F304}", name: "sunrise over mountains" },
|
|
594
|
+
{ char: "\u{1F320}", name: "shooting star" },
|
|
595
|
+
{ char: "\u{1F387}", name: "sparkler" },
|
|
596
|
+
{ char: "\u{1F386}", name: "fireworks" },
|
|
597
|
+
{ char: "\u{1F307}", name: "sunset" },
|
|
598
|
+
{ char: "\u{1F306}", name: "cityscape at dusk" },
|
|
599
|
+
{ char: "\u{1F3D9}\uFE0F", name: "cityscape" },
|
|
600
|
+
{ char: "\u{1F303}", name: "night with stars" },
|
|
601
|
+
{ char: "\u{1F30C}", name: "milky way" },
|
|
602
|
+
{ char: "\u{1F309}", name: "bridge at night" },
|
|
603
|
+
{ char: "\u{1F301}", name: "foggy" }
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
category: "symbols",
|
|
608
|
+
icon: "\u2764\uFE0F",
|
|
609
|
+
label: "Symbols",
|
|
610
|
+
emojis: [
|
|
611
|
+
{ char: "\u2764\uFE0F", name: "red heart" },
|
|
612
|
+
{ char: "\u{1F9E1}", name: "orange heart" },
|
|
613
|
+
{ char: "\u{1F49B}", name: "yellow heart" },
|
|
614
|
+
{ char: "\u{1F49A}", name: "green heart" },
|
|
615
|
+
{ char: "\u{1F499}", name: "blue heart" },
|
|
616
|
+
{ char: "\u{1F49C}", name: "purple heart" },
|
|
617
|
+
{ char: "\u{1F5A4}", name: "black heart" },
|
|
618
|
+
{ char: "\u{1F90D}", name: "white heart" },
|
|
619
|
+
{ char: "\u{1F90E}", name: "brown heart" },
|
|
620
|
+
{ char: "\u{1F494}", name: "broken heart" },
|
|
621
|
+
{ char: "\u2763\uFE0F", name: "heart exclamation" },
|
|
622
|
+
{ char: "\u{1F495}", name: "two hearts" },
|
|
623
|
+
{ char: "\u{1F49E}", name: "revolving hearts" },
|
|
624
|
+
{ char: "\u{1F493}", name: "beating heart" },
|
|
625
|
+
{ char: "\u{1F497}", name: "growing heart" },
|
|
626
|
+
{ char: "\u{1F496}", name: "sparkling heart" },
|
|
627
|
+
{ char: "\u{1F498}", name: "heart with arrow" },
|
|
628
|
+
{ char: "\u{1F49D}", name: "heart with ribbon" },
|
|
629
|
+
{ char: "\u{1F49F}", name: "heart decoration" },
|
|
630
|
+
{ char: "\u{1F4B0}", name: "money bag" },
|
|
631
|
+
{ char: "\u{1F4B1}", name: "currency exchange" },
|
|
632
|
+
{ char: "\u{1F4B2}", name: "heavy dollar sign" },
|
|
633
|
+
{ char: "\u{1F4B3}", name: "credit card" },
|
|
634
|
+
{ char: "\u{1F4B4}", name: "yen banknote" },
|
|
635
|
+
{ char: "\u{1F4B5}", name: "dollar banknote" },
|
|
636
|
+
{ char: "\u{1F4B6}", name: "euro banknote" },
|
|
637
|
+
{ char: "\u{1F4B7}", name: "pound banknote" },
|
|
638
|
+
{ char: "\u{1F4B8}", name: "money with wings" },
|
|
639
|
+
{ char: "\u{1F4B9}", name: "chart increasing with yen" },
|
|
640
|
+
{ char: "\u262E\uFE0F", name: "peace symbol" },
|
|
641
|
+
{ char: "\u271D\uFE0F", name: "latin cross" },
|
|
642
|
+
{ char: "\u262A\uFE0F", name: "star and crescent" },
|
|
643
|
+
{ char: "\u{1F549}\uFE0F", name: "om" },
|
|
644
|
+
{ char: "\u2638\uFE0F", name: "wheel of dharma" },
|
|
645
|
+
{ char: "\u2721\uFE0F", name: "star of david" },
|
|
646
|
+
{ char: "\u{1F52F}", name: "dotted six-pointed star" },
|
|
647
|
+
{ char: "\u{1F54E}", name: "menorah" },
|
|
648
|
+
{ char: "\u262F\uFE0F", name: "yin yang" },
|
|
649
|
+
{ char: "\u2626\uFE0F", name: "orthodox cross" },
|
|
650
|
+
{ char: "\u{1F6D0}", name: "place of worship" },
|
|
651
|
+
{ char: "\u26EA", name: "church" },
|
|
652
|
+
{ char: "\u{1F54B}", name: "kaaba" },
|
|
653
|
+
{ char: "\u{1F54C}", name: "mosque" },
|
|
654
|
+
{ char: "\u{1F54D}", name: "synagogue" },
|
|
655
|
+
{ char: "\u{1F6D5}", name: "hindu temple" },
|
|
656
|
+
{ char: "\u{1F4FF}", name: "prayer beads" },
|
|
657
|
+
{ char: "\u26CE", name: "ophiuchus" },
|
|
658
|
+
{ char: "\u2648", name: "aries" },
|
|
659
|
+
{ char: "\u2649", name: "taurus" },
|
|
660
|
+
{ char: "\u264A", name: "gemini" },
|
|
661
|
+
{ char: "\u264B", name: "cancer" },
|
|
662
|
+
{ char: "\u264C", name: "leo" },
|
|
663
|
+
{ char: "\u264D", name: "virgo" },
|
|
664
|
+
{ char: "\u264E", name: "libra" },
|
|
665
|
+
{ char: "\u264F", name: "scorpio" },
|
|
666
|
+
{ char: "\u2650", name: "sagittarius" },
|
|
667
|
+
{ char: "\u2651", name: "capricorn" },
|
|
668
|
+
{ char: "\u2652", name: "aquarius" },
|
|
669
|
+
{ char: "\u2653", name: "pisces" },
|
|
670
|
+
{ char: "\u{1F51F}", name: "keycap ten" },
|
|
671
|
+
{ char: "\u{1F520}", name: "input latin uppercase" },
|
|
672
|
+
{ char: "\u{1F521}", name: "input latin lowercase" },
|
|
673
|
+
{ char: "\u{1F522}", name: "input numbers" },
|
|
674
|
+
{ char: "\u{1F523}", name: "input symbols" },
|
|
675
|
+
{ char: "\u{1F524}", name: "input latin letters" },
|
|
676
|
+
{ char: "\u{1F194}", name: "id button" },
|
|
677
|
+
{ char: "\u{1F19A}", name: "vs button" },
|
|
678
|
+
{ char: "\u{1F170}\uFE0F", name: "A button" },
|
|
679
|
+
{ char: "\u{1F171}\uFE0F", name: "B button" },
|
|
680
|
+
{ char: "\u{1F18E}", name: "AB button" },
|
|
681
|
+
{ char: "\u{1F191}", name: "CL button" },
|
|
682
|
+
{ char: "\u{1F17E}\uFE0F", name: "O button" },
|
|
683
|
+
{ char: "\u{1F198}", name: "SOS button" },
|
|
684
|
+
{ char: "\u269B\uFE0F", name: "atom symbol" },
|
|
685
|
+
{ char: "\u2622\uFE0F", name: "radioactive" },
|
|
686
|
+
{ char: "\u2623\uFE0F", name: "biohazard" },
|
|
687
|
+
{ char: "\u26A0\uFE0F", name: "warning" },
|
|
688
|
+
{ char: "\u{1F51E}", name: "no one under eighteen" },
|
|
689
|
+
{ char: "\u{1F4F5}", name: "no mobile phones" },
|
|
690
|
+
{ char: "\u{1F6AB}", name: "prohibited" },
|
|
691
|
+
{ char: "\u26D4", name: "no entry" },
|
|
692
|
+
{ char: "\u{1F6D1}", name: "stop sign" },
|
|
693
|
+
{ char: "\u{1F6B7}", name: "no pedestrians" },
|
|
694
|
+
{ char: "\u{1F6AF}", name: "no littering" },
|
|
695
|
+
{ char: "\u{1F6B3}", name: "no bicycles" },
|
|
696
|
+
{ char: "\u{1F6B1}", name: "non-potable water" },
|
|
697
|
+
{ char: "\u{1F4AF}", name: "hundred points" },
|
|
698
|
+
{ char: "\u{1F4A2}", name: "anger symbol" },
|
|
699
|
+
{ char: "\u{1F4A5}", name: "collision" },
|
|
700
|
+
{ char: "\u{1F4A6}", name: "sweat droplets" },
|
|
701
|
+
{ char: "\u{1F4A8}", name: "dashing away" },
|
|
702
|
+
{ char: "\u{1F4A0}", name: "diamond with a dot" },
|
|
703
|
+
{ char: "\u{1F4AE}", name: "white flower" },
|
|
704
|
+
{ char: "\u2668\uFE0F", name: "hot springs" },
|
|
705
|
+
{ char: "\u{1F525}", name: "fire" },
|
|
706
|
+
{ char: "\u2728", name: "sparkles" },
|
|
707
|
+
{ char: "\u2B50", name: "star" },
|
|
708
|
+
{ char: "\u{1F31F}", name: "glowing star" },
|
|
709
|
+
{ char: "\u2734\uFE0F", name: "eight-pointed star" },
|
|
710
|
+
{ char: "\u{1F514}", name: "bell" },
|
|
711
|
+
{ char: "\u{1F515}", name: "bell with slash" },
|
|
712
|
+
{ char: "\u{1F3B5}", name: "musical note" },
|
|
713
|
+
{ char: "\u{1F3B6}", name: "musical notes" },
|
|
714
|
+
{ char: "\u{1F4F4}", name: "mobile phone off" },
|
|
715
|
+
{ char: "\u{1F4F3}", name: "vibration mode" },
|
|
716
|
+
{ char: "\u2705", name: "check mark button" },
|
|
717
|
+
{ char: "\u2611\uFE0F", name: "check box with check" },
|
|
718
|
+
{ char: "\u2714\uFE0F", name: "check mark" },
|
|
719
|
+
{ char: "\u274C", name: "cross mark" },
|
|
720
|
+
{ char: "\u274E", name: "cross mark button" },
|
|
721
|
+
{ char: "\u2B55", name: "hollow red circle" },
|
|
722
|
+
{ char: "\u{1F503}", name: "clockwise vertical arrows" },
|
|
723
|
+
{ char: "\u{1F504}", name: "counterclockwise arrows button" },
|
|
724
|
+
{ char: "\u{1F519}", name: "back arrow" },
|
|
725
|
+
{ char: "\u{1F51A}", name: "end arrow" },
|
|
726
|
+
{ char: "\u{1F51B}", name: "on arrow" },
|
|
727
|
+
{ char: "\u{1F51C}", name: "soon arrow" },
|
|
728
|
+
{ char: "\u{1F51D}", name: "top arrow" },
|
|
729
|
+
{ char: "\u2B06\uFE0F", name: "up arrow" },
|
|
730
|
+
{ char: "\u2B07\uFE0F", name: "down arrow" },
|
|
731
|
+
{ char: "\u2B05\uFE0F", name: "left arrow" },
|
|
732
|
+
{ char: "\u27A1\uFE0F", name: "right arrow" },
|
|
733
|
+
{ char: "\u2197\uFE0F", name: "up-right arrow" },
|
|
734
|
+
{ char: "\u2198\uFE0F", name: "down-right arrow" },
|
|
735
|
+
{ char: "\u2199\uFE0F", name: "down-left arrow" },
|
|
736
|
+
{ char: "\u2196\uFE0F", name: "up-left arrow" },
|
|
737
|
+
{ char: "\u2195\uFE0F", name: "up-down arrow" },
|
|
738
|
+
{ char: "\u2194\uFE0F", name: "left-right arrow" },
|
|
739
|
+
{ char: "\u{1F534}", name: "red circle" },
|
|
740
|
+
{ char: "\u{1F7E0}", name: "orange circle" },
|
|
741
|
+
{ char: "\u{1F7E1}", name: "yellow circle" },
|
|
742
|
+
{ char: "\u{1F7E2}", name: "green circle" },
|
|
743
|
+
{ char: "\u{1F535}", name: "blue circle" },
|
|
744
|
+
{ char: "\u{1F7E3}", name: "purple circle" },
|
|
745
|
+
{ char: "\u{1F7E4}", name: "brown circle" },
|
|
746
|
+
{ char: "\u26AB", name: "black circle" },
|
|
747
|
+
{ char: "\u26AA", name: "white circle" },
|
|
748
|
+
{ char: "\u{1F518}", name: "radio button" },
|
|
749
|
+
{ char: "\u{1F7E5}", name: "red square" },
|
|
750
|
+
{ char: "\u{1F7E7}", name: "orange square" },
|
|
751
|
+
{ char: "\u{1F7E8}", name: "yellow square" },
|
|
752
|
+
{ char: "\u{1F7E9}", name: "green square" },
|
|
753
|
+
{ char: "\u{1F7E6}", name: "blue square" },
|
|
754
|
+
{ char: "\u{1F7EA}", name: "purple square" },
|
|
755
|
+
{ char: "\u{1F7EB}", name: "brown square" },
|
|
756
|
+
{ char: "\u2B1B", name: "black large square" },
|
|
757
|
+
{ char: "\u2B1C", name: "white large square" },
|
|
758
|
+
{ char: "\u25FC\uFE0F", name: "black medium square" },
|
|
759
|
+
{ char: "\u25FB\uFE0F", name: "white medium square" },
|
|
760
|
+
{ char: "\u25FE", name: "black medium-small square" },
|
|
761
|
+
{ char: "\u25FD", name: "white medium-small square" },
|
|
762
|
+
{ char: "\u25AA\uFE0F", name: "black small square" },
|
|
763
|
+
{ char: "\u25AB\uFE0F", name: "white small square" },
|
|
764
|
+
{ char: "\u{1F536}", name: "large orange diamond" },
|
|
765
|
+
{ char: "\u{1F537}", name: "large blue diamond" },
|
|
766
|
+
{ char: "\u{1F538}", name: "small orange diamond" },
|
|
767
|
+
{ char: "\u{1F539}", name: "small blue diamond" },
|
|
768
|
+
{ char: "\u{1F53A}", name: "red triangle pointed up" },
|
|
769
|
+
{ char: "\u{1F53B}", name: "red triangle pointed down" },
|
|
770
|
+
{ char: "\u{1F532}", name: "black square button" },
|
|
771
|
+
{ char: "\u{1F533}", name: "white square button" },
|
|
772
|
+
{ char: "\u{1F236}", name: "Japanese not free of charge button" },
|
|
773
|
+
{ char: "\u{1F21A}", name: "Japanese free of charge button" },
|
|
774
|
+
{ char: "\u{1F238}", name: "Japanese application button" },
|
|
775
|
+
{ char: "\u{1F23A}", name: "Japanese open for business button" },
|
|
776
|
+
{ char: "\u{1F237}\uFE0F", name: "Japanese monthly amount button" },
|
|
777
|
+
{ char: "\u{1F251}", name: "Japanese acceptable button" },
|
|
778
|
+
{ char: "\u{1F250}", name: "Japanese bargain button" },
|
|
779
|
+
{ char: "\u3299\uFE0F", name: "Japanese secret button" },
|
|
780
|
+
{ char: "\u3297\uFE0F", name: "Japanese congratulations button" },
|
|
781
|
+
{ char: "\u{1F234}", name: "Japanese passing grade button" },
|
|
782
|
+
{ char: "\u{1F235}", name: "Japanese no vacancy button" },
|
|
783
|
+
{ char: "\u{1F239}", name: "Japanese discount button" },
|
|
784
|
+
{ char: "\u{1F232}", name: "Japanese prohibited button" },
|
|
785
|
+
{ char: "\u{1F4DB}", name: "name badge" },
|
|
786
|
+
{ char: "\u{1F530}", name: "Japanese symbol for beginner" },
|
|
787
|
+
{ char: "\u{1F531}", name: "trident emblem" },
|
|
788
|
+
{ char: "\u269C\uFE0F", name: "fleur-de-lis" },
|
|
789
|
+
{ char: "\u{1F9FF}", name: "nazar amulet" },
|
|
790
|
+
{ char: "\u267E\uFE0F", name: "infinity" },
|
|
791
|
+
{ char: "\xA9\uFE0F", name: "copyright" },
|
|
792
|
+
{ char: "\xAE\uFE0F", name: "registered" },
|
|
793
|
+
{ char: "\u2122\uFE0F", name: "trade mark" }
|
|
794
|
+
]
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
category: "flags",
|
|
798
|
+
icon: "\u{1F3F3}\uFE0F",
|
|
799
|
+
label: "Flags",
|
|
800
|
+
emojis: [
|
|
801
|
+
{ char: "\u{1F3F3}\uFE0F", name: "white flag" },
|
|
802
|
+
{ char: "\u{1F3F4}", name: "black flag" },
|
|
803
|
+
{ char: "\u{1F3C1}", name: "chequered flag" },
|
|
804
|
+
{ char: "\u{1F6A9}", name: "triangular flag" },
|
|
805
|
+
{ char: "\u{1F3F3}\uFE0F\u200D\u{1F308}", name: "rainbow flag" },
|
|
806
|
+
{ char: "\u{1F3F3}\uFE0F\u200D\u26A7\uFE0F", name: "transgender flag" },
|
|
807
|
+
{ char: "\u{1F1FA}\u{1F1F8}", name: "United States" },
|
|
808
|
+
{ char: "\u{1F1EC}\u{1F1E7}", name: "United Kingdom" },
|
|
809
|
+
{ char: "\u{1F1E8}\u{1F1E6}", name: "Canada" },
|
|
810
|
+
{ char: "\u{1F1E6}\u{1F1FA}", name: "Australia" },
|
|
811
|
+
{ char: "\u{1F1E9}\u{1F1EA}", name: "Germany" },
|
|
812
|
+
{ char: "\u{1F1EB}\u{1F1F7}", name: "France" },
|
|
813
|
+
{ char: "\u{1F1EE}\u{1F1F9}", name: "Italy" },
|
|
814
|
+
{ char: "\u{1F1EA}\u{1F1F8}", name: "Spain" },
|
|
815
|
+
{ char: "\u{1F1EF}\u{1F1F5}", name: "Japan" },
|
|
816
|
+
{ char: "\u{1F1F0}\u{1F1F7}", name: "South Korea" },
|
|
817
|
+
{ char: "\u{1F1E8}\u{1F1F3}", name: "China" },
|
|
818
|
+
{ char: "\u{1F1EE}\u{1F1F3}", name: "India" },
|
|
819
|
+
{ char: "\u{1F1E7}\u{1F1F7}", name: "Brazil" },
|
|
820
|
+
{ char: "\u{1F1F2}\u{1F1FD}", name: "Mexico" },
|
|
821
|
+
{ char: "\u{1F1F7}\u{1F1FA}", name: "Russia" },
|
|
822
|
+
{ char: "\u{1F1FF}\u{1F1E6}", name: "South Africa" },
|
|
823
|
+
{ char: "\u{1F1F3}\u{1F1F1}", name: "Netherlands" },
|
|
824
|
+
{ char: "\u{1F1E7}\u{1F1EA}", name: "Belgium" },
|
|
825
|
+
{ char: "\u{1F1E8}\u{1F1ED}", name: "Switzerland" },
|
|
826
|
+
{ char: "\u{1F1E6}\u{1F1F9}", name: "Austria" },
|
|
827
|
+
{ char: "\u{1F1F8}\u{1F1EA}", name: "Sweden" },
|
|
828
|
+
{ char: "\u{1F1F3}\u{1F1F4}", name: "Norway" },
|
|
829
|
+
{ char: "\u{1F1E9}\u{1F1F0}", name: "Denmark" },
|
|
830
|
+
{ char: "\u{1F1EB}\u{1F1EE}", name: "Finland" },
|
|
831
|
+
{ char: "\u{1F1F5}\u{1F1F1}", name: "Poland" },
|
|
832
|
+
{ char: "\u{1F1FA}\u{1F1E6}", name: "Ukraine" },
|
|
833
|
+
{ char: "\u{1F1F9}\u{1F1F7}", name: "Turkey" },
|
|
834
|
+
{ char: "\u{1F1EC}\u{1F1F7}", name: "Greece" },
|
|
835
|
+
{ char: "\u{1F1F5}\u{1F1F9}", name: "Portugal" },
|
|
836
|
+
{ char: "\u{1F1EE}\u{1F1EA}", name: "Ireland" },
|
|
837
|
+
{ char: "\u{1F1F3}\u{1F1FF}", name: "New Zealand" },
|
|
838
|
+
{ char: "\u{1F1F8}\u{1F1EC}", name: "Singapore" },
|
|
839
|
+
{ char: "\u{1F1ED}\u{1F1F0}", name: "Hong Kong" },
|
|
840
|
+
{ char: "\u{1F1F9}\u{1F1FC}", name: "Taiwan" },
|
|
841
|
+
{ char: "\u{1F1F9}\u{1F1ED}", name: "Thailand" },
|
|
842
|
+
{ char: "\u{1F1FB}\u{1F1F3}", name: "Vietnam" },
|
|
843
|
+
{ char: "\u{1F1EE}\u{1F1E9}", name: "Indonesia" },
|
|
844
|
+
{ char: "\u{1F1F5}\u{1F1ED}", name: "Philippines" },
|
|
845
|
+
{ char: "\u{1F1F2}\u{1F1FE}", name: "Malaysia" },
|
|
846
|
+
{ char: "\u{1F1E6}\u{1F1F7}", name: "Argentina" },
|
|
847
|
+
{ char: "\u{1F1E8}\u{1F1F4}", name: "Colombia" },
|
|
848
|
+
{ char: "\u{1F1E8}\u{1F1F1}", name: "Chile" },
|
|
849
|
+
{ char: "\u{1F1F5}\u{1F1EA}", name: "Peru" },
|
|
850
|
+
{ char: "\u{1F1EA}\u{1F1EC}", name: "Egypt" },
|
|
851
|
+
{ char: "\u{1F1F8}\u{1F1E6}", name: "Saudi Arabia" },
|
|
852
|
+
{ char: "\u{1F1E6}\u{1F1EA}", name: "United Arab Emirates" },
|
|
853
|
+
{ char: "\u{1F1EE}\u{1F1F1}", name: "Israel" }
|
|
854
|
+
]
|
|
855
|
+
}
|
|
856
|
+
];
|
|
857
|
+
var EMOJI_DATA = CATEGORY_DATA.map((cat) => ({
|
|
858
|
+
category: cat.category,
|
|
859
|
+
icon: cat.icon,
|
|
860
|
+
label: cat.label,
|
|
861
|
+
emojis: cat.emojis.map((e) => e.char)
|
|
862
|
+
}));
|
|
863
|
+
var EMOJI_ENTRIES = CATEGORY_DATA.flatMap(
|
|
864
|
+
(cat) => cat.emojis.map((e) => ({
|
|
865
|
+
char: e.char,
|
|
866
|
+
name: e.name,
|
|
867
|
+
category: cat.category
|
|
868
|
+
}))
|
|
869
|
+
);
|
|
870
|
+
|
|
871
|
+
// src/data/emoji-utils.ts
|
|
872
|
+
function resolve(name) {
|
|
873
|
+
const lower = name.toLowerCase();
|
|
874
|
+
const entry = EMOJI_ENTRIES.find((e) => e.name === lower);
|
|
875
|
+
return entry?.char;
|
|
876
|
+
}
|
|
877
|
+
function search(query) {
|
|
878
|
+
const lower = query.toLowerCase();
|
|
879
|
+
return EMOJI_ENTRIES.filter((e) => e.name.includes(lower)).map((e) => e.char);
|
|
880
|
+
}
|
|
881
|
+
function find(char) {
|
|
882
|
+
return EMOJI_ENTRIES.find((e) => e.char === char);
|
|
883
|
+
}
|
|
884
|
+
var colorClasses = {
|
|
885
|
+
blue: "bg-blue-500 text-white border border-blue-600 hover:bg-blue-600 dark:bg-blue-600 dark:border-blue-500 dark:hover:bg-blue-500",
|
|
886
|
+
emerald: "bg-emerald-500 text-white border border-emerald-600 hover:bg-emerald-600 dark:bg-emerald-600 dark:border-emerald-500 dark:hover:bg-emerald-500",
|
|
887
|
+
amber: "bg-amber-500 text-white border border-amber-600 hover:bg-amber-600 dark:bg-amber-600 dark:border-amber-500 dark:hover:bg-amber-500",
|
|
888
|
+
red: "bg-red-500 text-white border border-red-600 hover:bg-red-600 dark:bg-red-600 dark:border-red-500 dark:hover:bg-red-500",
|
|
889
|
+
violet: "bg-violet-500 text-white border border-violet-600 hover:bg-violet-600 dark:bg-violet-600 dark:border-violet-500 dark:hover:bg-violet-500",
|
|
890
|
+
indigo: "bg-indigo-500 text-white border border-indigo-600 hover:bg-indigo-600 dark:bg-indigo-600 dark:border-indigo-500 dark:hover:bg-indigo-500",
|
|
891
|
+
sky: "bg-sky-500 text-white border border-sky-600 hover:bg-sky-600 dark:bg-sky-600 dark:border-sky-500 dark:hover:bg-sky-500",
|
|
892
|
+
rose: "bg-rose-500 text-white border border-rose-600 hover:bg-rose-600 dark:bg-rose-600 dark:border-rose-500 dark:hover:bg-rose-500",
|
|
893
|
+
orange: "bg-orange-500 text-white border border-orange-600 hover:bg-orange-600 dark:bg-orange-600 dark:border-orange-500 dark:hover:bg-orange-500",
|
|
894
|
+
zinc: "bg-zinc-500 text-white border border-zinc-600 hover:bg-zinc-600 dark:bg-zinc-600 dark:border-zinc-500 dark:hover:bg-zinc-500"
|
|
895
|
+
};
|
|
896
|
+
var defaultClasses = "bg-white text-zinc-700 border border-zinc-200 hover:bg-zinc-50 hover:border-zinc-300 dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-700 dark:hover:bg-zinc-700";
|
|
897
|
+
var activeClasses = "bg-blue-500 text-white border border-blue-600 hover:bg-blue-600 dark:bg-blue-600 dark:border-blue-500 dark:hover:bg-blue-500";
|
|
898
|
+
var checkedClasses = "bg-emerald-500 text-white border border-emerald-600 hover:bg-emerald-600 dark:bg-emerald-600 dark:border-emerald-500 dark:hover:bg-emerald-500";
|
|
899
|
+
var warnClasses = "bg-amber-50 text-amber-700 border border-amber-200 hover:bg-amber-100 dark:bg-amber-900/30 dark:text-amber-300 dark:border-amber-700 dark:hover:bg-amber-900/50";
|
|
900
|
+
var horizontalSize = {
|
|
901
|
+
xs: "px-2 py-1 text-xs",
|
|
902
|
+
sm: "px-2 py-1 text-xs",
|
|
903
|
+
md: "px-3 py-1.5 text-sm",
|
|
904
|
+
lg: "px-4 py-2.5 text-base",
|
|
905
|
+
xl: "px-5 py-3 text-lg"
|
|
906
|
+
};
|
|
907
|
+
var verticalSize = {
|
|
908
|
+
xs: "px-2 pt-5 pb-5 text-xs",
|
|
909
|
+
sm: "px-2 pt-5 pb-5 text-xs",
|
|
910
|
+
md: "px-3 pt-6 pb-6 text-sm",
|
|
911
|
+
lg: "px-4 pt-8 pb-8 text-base",
|
|
912
|
+
xl: "px-5 pt-9 pb-9 text-lg"
|
|
913
|
+
};
|
|
914
|
+
var circleSize = {
|
|
915
|
+
xs: "w-7 h-7 text-xs",
|
|
916
|
+
sm: "w-8 h-8 text-xs",
|
|
917
|
+
md: "w-10 h-10 text-sm",
|
|
918
|
+
lg: "w-12 h-12 text-base",
|
|
919
|
+
xl: "w-14 h-14 text-lg"
|
|
920
|
+
};
|
|
921
|
+
var iconSize = {
|
|
922
|
+
xs: "w-3 h-3",
|
|
923
|
+
sm: "w-3 h-3",
|
|
924
|
+
md: "w-4 h-4",
|
|
925
|
+
lg: "w-5 h-5",
|
|
926
|
+
xl: "w-6 h-6"
|
|
927
|
+
};
|
|
928
|
+
var avatarSize = {
|
|
929
|
+
xs: "w-4 h-4",
|
|
930
|
+
sm: "w-4 h-4",
|
|
931
|
+
md: "w-5 h-5",
|
|
932
|
+
lg: "w-6 h-6",
|
|
933
|
+
xl: "w-7 h-7"
|
|
934
|
+
};
|
|
935
|
+
var alertIconSize = {
|
|
936
|
+
xs: "w-2 h-2",
|
|
937
|
+
sm: "w-2.5 h-2.5",
|
|
938
|
+
md: "w-3 h-3",
|
|
939
|
+
lg: "w-4 h-4",
|
|
940
|
+
xl: "w-4 h-4"
|
|
941
|
+
};
|
|
942
|
+
var badgeSize = {
|
|
943
|
+
xs: "text-[10px] px-1 min-w-[14px] h-3.5",
|
|
944
|
+
sm: "text-[10px] px-1.5 min-w-[16px] h-4",
|
|
945
|
+
md: "text-[11px] px-1.5 min-w-[18px] h-[18px]",
|
|
946
|
+
lg: "text-xs px-2 min-w-[22px] h-5",
|
|
947
|
+
xl: "text-xs px-2 min-w-[24px] h-5"
|
|
948
|
+
};
|
|
949
|
+
var verticalGap = {
|
|
950
|
+
xs: "gap-1",
|
|
951
|
+
sm: "gap-1",
|
|
952
|
+
md: "gap-1.5",
|
|
953
|
+
lg: "gap-2",
|
|
954
|
+
xl: "gap-2"
|
|
955
|
+
};
|
|
956
|
+
function isColored(color, active, checked) {
|
|
957
|
+
return !!(color || active || checked);
|
|
958
|
+
}
|
|
959
|
+
function getColorClasses(color, active, checked, warn) {
|
|
960
|
+
if (color) return colorClasses[color];
|
|
961
|
+
if (checked) return checkedClasses;
|
|
962
|
+
if (active) return activeClasses;
|
|
963
|
+
if (warn) return warnClasses;
|
|
964
|
+
return defaultClasses;
|
|
965
|
+
}
|
|
966
|
+
function getIconColorClasses(color, active, checked, warn) {
|
|
967
|
+
if (color || active || checked) return "text-white";
|
|
968
|
+
if (warn) return "text-amber-600 dark:text-amber-400";
|
|
969
|
+
return "text-zinc-500 dark:text-zinc-400";
|
|
970
|
+
}
|
|
971
|
+
function getBadgeClasses(color, active, checked, warn) {
|
|
972
|
+
if (isColored(color, active, checked)) return "bg-white/20 text-white";
|
|
973
|
+
if (warn) return "bg-amber-200 text-amber-800 dark:bg-amber-800 dark:text-amber-200";
|
|
974
|
+
return "bg-zinc-200 text-zinc-700 dark:bg-zinc-600 dark:text-zinc-200";
|
|
975
|
+
}
|
|
976
|
+
var DEFAULT_SORT = "eiab";
|
|
977
|
+
function parseSortOrder(sort) {
|
|
978
|
+
const chars = (sort ?? DEFAULT_SORT).split("");
|
|
979
|
+
const valid = [];
|
|
980
|
+
const seen = /* @__PURE__ */ new Set();
|
|
981
|
+
for (const c of chars) {
|
|
982
|
+
if ("eiab".includes(c) && !seen.has(c)) {
|
|
983
|
+
valid.push(c);
|
|
984
|
+
seen.add(c);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
for (const c of DEFAULT_SORT.split("")) {
|
|
988
|
+
if (!seen.has(c)) valid.push(c);
|
|
989
|
+
}
|
|
990
|
+
return valid;
|
|
991
|
+
}
|
|
992
|
+
var Action = forwardRef(
|
|
993
|
+
({
|
|
994
|
+
children,
|
|
995
|
+
className,
|
|
996
|
+
variant = "default",
|
|
997
|
+
color,
|
|
998
|
+
size = "md",
|
|
999
|
+
active,
|
|
1000
|
+
checked,
|
|
1001
|
+
warn,
|
|
1002
|
+
alert: alertProp,
|
|
1003
|
+
icon,
|
|
1004
|
+
iconTrailing,
|
|
1005
|
+
iconPlace = "left",
|
|
1006
|
+
alertIcon,
|
|
1007
|
+
alertIconTrailing,
|
|
1008
|
+
emoji,
|
|
1009
|
+
emojiTrailing,
|
|
1010
|
+
avatar,
|
|
1011
|
+
avatarTrailing,
|
|
1012
|
+
badge,
|
|
1013
|
+
badgeTrailing,
|
|
1014
|
+
sort,
|
|
1015
|
+
loading = false,
|
|
1016
|
+
disabled,
|
|
1017
|
+
href,
|
|
1018
|
+
...props
|
|
1019
|
+
}, ref) => {
|
|
1020
|
+
const isCircle = variant === "circle";
|
|
1021
|
+
const isVertical = iconPlace === "top" || iconPlace === "bottom";
|
|
1022
|
+
const isReversed = iconPlace === "right";
|
|
1023
|
+
const sizeClass = isCircle ? circleSize[size] : isVertical ? verticalSize[size] : horizontalSize[size];
|
|
1024
|
+
const iconColorCls = getIconColorClasses(color, active, checked, warn);
|
|
1025
|
+
const buildElement = (key, trailing) => {
|
|
1026
|
+
switch (key) {
|
|
1027
|
+
case "e": {
|
|
1028
|
+
const slug = trailing ? emojiTrailing : emoji;
|
|
1029
|
+
if (!slug) return null;
|
|
1030
|
+
const char = resolve(slug);
|
|
1031
|
+
if (!char) return null;
|
|
1032
|
+
return /* @__PURE__ */ jsx("span", { "data-action-emoji": true, children: char }, `emoji-${trailing ? "t" : "l"}`);
|
|
1033
|
+
}
|
|
1034
|
+
case "i": {
|
|
1035
|
+
if (loading && !trailing) {
|
|
1036
|
+
return /* @__PURE__ */ jsx(
|
|
1037
|
+
"span",
|
|
1038
|
+
{
|
|
1039
|
+
className: cn("animate-spin border-2 border-current border-t-transparent rounded-full", iconSize[size])
|
|
1040
|
+
},
|
|
1041
|
+
"spinner"
|
|
1042
|
+
);
|
|
1043
|
+
}
|
|
1044
|
+
const iconNode = trailing ? iconTrailing : icon;
|
|
1045
|
+
if (!iconNode) return null;
|
|
1046
|
+
if (isVertical) {
|
|
1047
|
+
const posClass = iconPlace === "top" ? "top-1.5" : "bottom-1.5";
|
|
1048
|
+
return /* @__PURE__ */ jsx(
|
|
1049
|
+
"span",
|
|
1050
|
+
{
|
|
1051
|
+
className: cn(
|
|
1052
|
+
"absolute left-1/2 -translate-x-1/2",
|
|
1053
|
+
posClass,
|
|
1054
|
+
iconColorCls
|
|
1055
|
+
),
|
|
1056
|
+
children: iconNode
|
|
1057
|
+
},
|
|
1058
|
+
`icon-${trailing ? "t" : "l"}`
|
|
1059
|
+
);
|
|
1060
|
+
}
|
|
1061
|
+
return /* @__PURE__ */ jsx(
|
|
1062
|
+
"span",
|
|
1063
|
+
{
|
|
1064
|
+
className: cn("flex-shrink-0", iconColorCls),
|
|
1065
|
+
children: iconNode
|
|
1066
|
+
},
|
|
1067
|
+
`icon-${trailing ? "t" : "l"}`
|
|
1068
|
+
);
|
|
1069
|
+
}
|
|
1070
|
+
case "a": {
|
|
1071
|
+
if (!avatar) return null;
|
|
1072
|
+
const isTrailing = avatarTrailing ?? trailing;
|
|
1073
|
+
if (isTrailing !== trailing) return null;
|
|
1074
|
+
return /* @__PURE__ */ jsx(
|
|
1075
|
+
"img",
|
|
1076
|
+
{
|
|
1077
|
+
src: avatar,
|
|
1078
|
+
alt: "",
|
|
1079
|
+
className: cn(avatarSize[size], "rounded-full object-cover flex-shrink-0"),
|
|
1080
|
+
"data-action-avatar": true
|
|
1081
|
+
},
|
|
1082
|
+
"avatar"
|
|
1083
|
+
);
|
|
1084
|
+
}
|
|
1085
|
+
case "b": {
|
|
1086
|
+
if (!badge) return null;
|
|
1087
|
+
const isTrailing = badgeTrailing ?? trailing;
|
|
1088
|
+
if (isTrailing !== trailing) return null;
|
|
1089
|
+
return /* @__PURE__ */ jsx(
|
|
1090
|
+
"span",
|
|
1091
|
+
{
|
|
1092
|
+
className: cn(
|
|
1093
|
+
"inline-flex items-center justify-center font-medium rounded-full",
|
|
1094
|
+
badgeSize[size],
|
|
1095
|
+
getBadgeClasses(color, active, checked, warn)
|
|
1096
|
+
),
|
|
1097
|
+
"data-action-badge": true,
|
|
1098
|
+
children: badge
|
|
1099
|
+
},
|
|
1100
|
+
"badge"
|
|
1101
|
+
);
|
|
1102
|
+
}
|
|
1103
|
+
default:
|
|
1104
|
+
return null;
|
|
1105
|
+
}
|
|
1106
|
+
};
|
|
1107
|
+
const renderAlertIcon = (trailing) => {
|
|
1108
|
+
if (!alertIcon) return null;
|
|
1109
|
+
const isTrailing = alertIconTrailing ?? false;
|
|
1110
|
+
if (isTrailing !== trailing) return null;
|
|
1111
|
+
return /* @__PURE__ */ jsxs(
|
|
1112
|
+
"span",
|
|
1113
|
+
{
|
|
1114
|
+
className: "relative inline-flex flex-shrink-0",
|
|
1115
|
+
"data-action-alert": true,
|
|
1116
|
+
children: [
|
|
1117
|
+
/* @__PURE__ */ jsx("span", { className: cn(alertIconSize[size], "text-red-500 dark:text-red-400 animate-pulse"), children: alertIcon }),
|
|
1118
|
+
/* @__PURE__ */ jsx(
|
|
1119
|
+
"span",
|
|
1120
|
+
{
|
|
1121
|
+
className: cn(
|
|
1122
|
+
alertIconSize[size],
|
|
1123
|
+
"absolute inset-0 text-red-400 dark:text-red-300 animate-ping opacity-75"
|
|
1124
|
+
),
|
|
1125
|
+
children: alertIcon
|
|
1126
|
+
}
|
|
1127
|
+
)
|
|
1128
|
+
]
|
|
1129
|
+
},
|
|
1130
|
+
"alert-icon"
|
|
1131
|
+
);
|
|
1132
|
+
};
|
|
1133
|
+
const sortOrder = parseSortOrder(sort);
|
|
1134
|
+
const leadingElements = [];
|
|
1135
|
+
const trailingElements = [];
|
|
1136
|
+
for (const key of sortOrder) {
|
|
1137
|
+
const leading = buildElement(key, false);
|
|
1138
|
+
if (leading) leadingElements.push(leading);
|
|
1139
|
+
const trailing = buildElement(key, true);
|
|
1140
|
+
if (trailing) trailingElements.push(trailing);
|
|
1141
|
+
}
|
|
1142
|
+
const leadingAlert = renderAlertIcon(false);
|
|
1143
|
+
if (leadingAlert) leadingElements.push(leadingAlert);
|
|
1144
|
+
const trailingAlert = renderAlertIcon(true);
|
|
1145
|
+
if (trailingAlert) trailingElements.push(trailingAlert);
|
|
1146
|
+
const classes = cn(
|
|
1147
|
+
"inline-flex items-center justify-center font-medium transition-all duration-200",
|
|
1148
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-1",
|
|
1149
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1150
|
+
isCircle ? "rounded-full" : "rounded-lg",
|
|
1151
|
+
sizeClass,
|
|
1152
|
+
getColorClasses(color, active, checked, warn),
|
|
1153
|
+
!isCircle && !isVertical && "gap-2",
|
|
1154
|
+
!isCircle && isVertical && cn("relative", verticalGap[size]),
|
|
1155
|
+
isReversed && !isVertical && "flex-row-reverse",
|
|
1156
|
+
alertProp && "animate-pulse",
|
|
1157
|
+
className
|
|
1158
|
+
);
|
|
1159
|
+
const content = isCircle ? /* @__PURE__ */ jsx(Fragment, { children: loading ? /* @__PURE__ */ jsx(
|
|
1160
|
+
"span",
|
|
1161
|
+
{
|
|
1162
|
+
className: cn(
|
|
1163
|
+
"animate-spin border-2 border-current border-t-transparent rounded-full",
|
|
1164
|
+
iconSize[size]
|
|
1165
|
+
)
|
|
1166
|
+
}
|
|
1167
|
+
) : icon ?? children }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1168
|
+
leadingElements,
|
|
1169
|
+
children != null && /* @__PURE__ */ jsx("span", { children }),
|
|
1170
|
+
trailingElements
|
|
1171
|
+
] });
|
|
1172
|
+
if (href && !disabled) {
|
|
1173
|
+
return /* @__PURE__ */ jsx("a", { href, className: classes, children: content });
|
|
1174
|
+
}
|
|
1175
|
+
return /* @__PURE__ */ jsx(
|
|
1176
|
+
"button",
|
|
1177
|
+
{
|
|
1178
|
+
ref,
|
|
1179
|
+
className: classes,
|
|
1180
|
+
disabled: disabled || loading,
|
|
1181
|
+
...props,
|
|
1182
|
+
children: content
|
|
1183
|
+
}
|
|
1184
|
+
);
|
|
1185
|
+
}
|
|
1186
|
+
);
|
|
1187
|
+
Action.displayName = "Action";
|
|
1188
|
+
|
|
1189
|
+
// src/components/inputs/inputs.utils.ts
|
|
1190
|
+
var inputSizeClasses = {
|
|
1191
|
+
xs: "px-2 py-1 text-xs rounded",
|
|
1192
|
+
sm: "px-2.5 py-1.5 text-sm rounded-md",
|
|
1193
|
+
md: "px-3 py-2 text-sm rounded-lg",
|
|
1194
|
+
lg: "px-4 py-2.5 text-base rounded-lg",
|
|
1195
|
+
xl: "px-5 py-3 text-lg rounded-xl"
|
|
1196
|
+
};
|
|
1197
|
+
var labelSizeClasses = {
|
|
1198
|
+
xs: "text-xs",
|
|
1199
|
+
sm: "text-xs",
|
|
1200
|
+
md: "text-sm",
|
|
1201
|
+
lg: "text-sm",
|
|
1202
|
+
xl: "text-base"
|
|
1203
|
+
};
|
|
1204
|
+
function dirtyClasses(dirty) {
|
|
1205
|
+
return dirty ? "border-l-[3px] border-l-amber-400" : "";
|
|
1206
|
+
}
|
|
1207
|
+
function dirtyRingClasses(dirty) {
|
|
1208
|
+
return dirty ? "ring-2 ring-amber-400/50" : "";
|
|
1209
|
+
}
|
|
1210
|
+
function errorClasses(error) {
|
|
1211
|
+
return error ? "border-red-500 focus:ring-red-500" : "";
|
|
1212
|
+
}
|
|
1213
|
+
var inputBaseClasses = "border border-zinc-300 bg-white text-zinc-900 placeholder:text-zinc-400 focus:outline-none focus:ring-2 focus:ring-blue-500/40 focus:border-blue-500 disabled:opacity-50 disabled:cursor-not-allowed dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500";
|
|
1214
|
+
function resolveOption(option) {
|
|
1215
|
+
if (typeof option === "string") {
|
|
1216
|
+
return { value: option, label: option };
|
|
1217
|
+
}
|
|
1218
|
+
return option;
|
|
1219
|
+
}
|
|
1220
|
+
function Field({
|
|
1221
|
+
label,
|
|
1222
|
+
description,
|
|
1223
|
+
error,
|
|
1224
|
+
required,
|
|
1225
|
+
htmlFor,
|
|
1226
|
+
size = "md",
|
|
1227
|
+
children,
|
|
1228
|
+
className
|
|
1229
|
+
}) {
|
|
1230
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1.5", className), children: [
|
|
1231
|
+
label && /* @__PURE__ */ jsxs(
|
|
1232
|
+
"label",
|
|
1233
|
+
{
|
|
1234
|
+
htmlFor,
|
|
1235
|
+
className: cn(
|
|
1236
|
+
"font-medium text-zinc-700 dark:text-zinc-300",
|
|
1237
|
+
labelSizeClasses[size]
|
|
1238
|
+
),
|
|
1239
|
+
children: [
|
|
1240
|
+
label,
|
|
1241
|
+
required && /* @__PURE__ */ jsx("span", { className: "ml-0.5 text-red-500", children: "*" })
|
|
1242
|
+
]
|
|
1243
|
+
}
|
|
1244
|
+
),
|
|
1245
|
+
children,
|
|
1246
|
+
description && !error && /* @__PURE__ */ jsx("p", { className: "text-xs text-zinc-500 dark:text-zinc-400", children: description }),
|
|
1247
|
+
error && /* @__PURE__ */ jsx("p", { className: "text-xs text-red-500", children: error })
|
|
1248
|
+
] });
|
|
1249
|
+
}
|
|
1250
|
+
var Input = forwardRef(
|
|
1251
|
+
({
|
|
1252
|
+
type = "text",
|
|
1253
|
+
size = "md",
|
|
1254
|
+
dirty,
|
|
1255
|
+
error,
|
|
1256
|
+
label,
|
|
1257
|
+
description,
|
|
1258
|
+
required,
|
|
1259
|
+
disabled,
|
|
1260
|
+
className,
|
|
1261
|
+
id,
|
|
1262
|
+
leading,
|
|
1263
|
+
trailing,
|
|
1264
|
+
onValueChange,
|
|
1265
|
+
onChange,
|
|
1266
|
+
...props
|
|
1267
|
+
}, ref) => {
|
|
1268
|
+
const autoId = useId();
|
|
1269
|
+
const inputId = id ?? autoId;
|
|
1270
|
+
const input = /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
|
|
1271
|
+
leading && /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-3 text-zinc-400 dark:text-zinc-500", children: leading }),
|
|
1272
|
+
/* @__PURE__ */ jsx(
|
|
1273
|
+
"input",
|
|
1274
|
+
{
|
|
1275
|
+
ref,
|
|
1276
|
+
id: inputId,
|
|
1277
|
+
type,
|
|
1278
|
+
disabled,
|
|
1279
|
+
required,
|
|
1280
|
+
className: cn(
|
|
1281
|
+
inputBaseClasses,
|
|
1282
|
+
inputSizeClasses[size],
|
|
1283
|
+
dirtyClasses(dirty),
|
|
1284
|
+
errorClasses(error),
|
|
1285
|
+
"w-full",
|
|
1286
|
+
leading && "pl-9",
|
|
1287
|
+
trailing && "pr-9",
|
|
1288
|
+
className
|
|
1289
|
+
),
|
|
1290
|
+
onChange: (e) => {
|
|
1291
|
+
onChange?.(e);
|
|
1292
|
+
onValueChange?.(e.target.value);
|
|
1293
|
+
},
|
|
1294
|
+
...props
|
|
1295
|
+
}
|
|
1296
|
+
),
|
|
1297
|
+
trailing && /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-3 text-zinc-400 dark:text-zinc-500", children: trailing })
|
|
1298
|
+
] });
|
|
1299
|
+
if (label || error || description) {
|
|
1300
|
+
return /* @__PURE__ */ jsx(
|
|
1301
|
+
Field,
|
|
1302
|
+
{
|
|
1303
|
+
label,
|
|
1304
|
+
description,
|
|
1305
|
+
error,
|
|
1306
|
+
required,
|
|
1307
|
+
htmlFor: inputId,
|
|
1308
|
+
size,
|
|
1309
|
+
children: input
|
|
1310
|
+
}
|
|
1311
|
+
);
|
|
1312
|
+
}
|
|
1313
|
+
return input;
|
|
1314
|
+
}
|
|
1315
|
+
);
|
|
1316
|
+
Input.displayName = "Input";
|
|
1317
|
+
var Textarea = forwardRef(
|
|
1318
|
+
({
|
|
1319
|
+
size = "md",
|
|
1320
|
+
dirty,
|
|
1321
|
+
error,
|
|
1322
|
+
label,
|
|
1323
|
+
description,
|
|
1324
|
+
required,
|
|
1325
|
+
disabled,
|
|
1326
|
+
className,
|
|
1327
|
+
id,
|
|
1328
|
+
autoResize,
|
|
1329
|
+
minRows = 3,
|
|
1330
|
+
maxRows,
|
|
1331
|
+
onValueChange,
|
|
1332
|
+
onChange,
|
|
1333
|
+
value,
|
|
1334
|
+
defaultValue,
|
|
1335
|
+
...props
|
|
1336
|
+
}, ref) => {
|
|
1337
|
+
const autoId = useId();
|
|
1338
|
+
const textareaId = id ?? autoId;
|
|
1339
|
+
const internalRef = useRef(null);
|
|
1340
|
+
useEffect(() => {
|
|
1341
|
+
const el = internalRef.current;
|
|
1342
|
+
if (!autoResize || !el) return;
|
|
1343
|
+
el.style.height = "auto";
|
|
1344
|
+
const lineHeight = parseInt(getComputedStyle(el).lineHeight) || 20;
|
|
1345
|
+
const minHeight = minRows * lineHeight;
|
|
1346
|
+
const maxHeight = maxRows ? maxRows * lineHeight : Infinity;
|
|
1347
|
+
el.style.height = `${Math.min(Math.max(el.scrollHeight, minHeight), maxHeight)}px`;
|
|
1348
|
+
}, [autoResize, minRows, maxRows, value, defaultValue]);
|
|
1349
|
+
const textarea = /* @__PURE__ */ jsx(
|
|
1350
|
+
"textarea",
|
|
1351
|
+
{
|
|
1352
|
+
ref: (node) => {
|
|
1353
|
+
internalRef.current = node;
|
|
1354
|
+
if (typeof ref === "function") {
|
|
1355
|
+
ref(node);
|
|
1356
|
+
} else if (ref) {
|
|
1357
|
+
ref.current = node;
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1360
|
+
id: textareaId,
|
|
1361
|
+
disabled,
|
|
1362
|
+
required,
|
|
1363
|
+
rows: autoResize ? minRows : minRows,
|
|
1364
|
+
value,
|
|
1365
|
+
defaultValue,
|
|
1366
|
+
className: cn(
|
|
1367
|
+
inputBaseClasses,
|
|
1368
|
+
inputSizeClasses[size],
|
|
1369
|
+
dirtyClasses(dirty),
|
|
1370
|
+
errorClasses(error),
|
|
1371
|
+
"w-full resize-y",
|
|
1372
|
+
autoResize && "resize-none overflow-hidden",
|
|
1373
|
+
className
|
|
1374
|
+
),
|
|
1375
|
+
onChange: (e) => {
|
|
1376
|
+
onChange?.(e);
|
|
1377
|
+
onValueChange?.(e.target.value);
|
|
1378
|
+
},
|
|
1379
|
+
...props
|
|
1380
|
+
}
|
|
1381
|
+
);
|
|
1382
|
+
if (label || error || description) {
|
|
1383
|
+
return /* @__PURE__ */ jsx(
|
|
1384
|
+
Field,
|
|
1385
|
+
{
|
|
1386
|
+
label,
|
|
1387
|
+
description,
|
|
1388
|
+
error,
|
|
1389
|
+
required,
|
|
1390
|
+
htmlFor: textareaId,
|
|
1391
|
+
size,
|
|
1392
|
+
children: textarea
|
|
1393
|
+
}
|
|
1394
|
+
);
|
|
1395
|
+
}
|
|
1396
|
+
return textarea;
|
|
1397
|
+
}
|
|
1398
|
+
);
|
|
1399
|
+
Textarea.displayName = "Textarea";
|
|
1400
|
+
function isOptionGroup(item) {
|
|
1401
|
+
return typeof item === "object" && "options" in item;
|
|
1402
|
+
}
|
|
1403
|
+
function renderOption(option, index) {
|
|
1404
|
+
const resolved = resolveOption(option);
|
|
1405
|
+
return /* @__PURE__ */ jsx(
|
|
1406
|
+
"option",
|
|
1407
|
+
{
|
|
1408
|
+
value: resolved.value,
|
|
1409
|
+
disabled: resolved.disabled,
|
|
1410
|
+
children: resolved.label
|
|
1411
|
+
},
|
|
1412
|
+
`${resolved.value}-${index}`
|
|
1413
|
+
);
|
|
1414
|
+
}
|
|
1415
|
+
var Select = forwardRef(
|
|
1416
|
+
({
|
|
1417
|
+
size = "md",
|
|
1418
|
+
dirty,
|
|
1419
|
+
error,
|
|
1420
|
+
label,
|
|
1421
|
+
description,
|
|
1422
|
+
required,
|
|
1423
|
+
disabled,
|
|
1424
|
+
className,
|
|
1425
|
+
id,
|
|
1426
|
+
list,
|
|
1427
|
+
placeholder,
|
|
1428
|
+
onValueChange,
|
|
1429
|
+
onChange,
|
|
1430
|
+
...props
|
|
1431
|
+
}, ref) => {
|
|
1432
|
+
const autoId = useId();
|
|
1433
|
+
const selectId = id ?? autoId;
|
|
1434
|
+
const select = /* @__PURE__ */ jsxs(
|
|
1435
|
+
"select",
|
|
1436
|
+
{
|
|
1437
|
+
ref,
|
|
1438
|
+
id: selectId,
|
|
1439
|
+
disabled,
|
|
1440
|
+
required,
|
|
1441
|
+
className: cn(
|
|
1442
|
+
inputBaseClasses,
|
|
1443
|
+
inputSizeClasses[size],
|
|
1444
|
+
dirtyClasses(dirty),
|
|
1445
|
+
errorClasses(error),
|
|
1446
|
+
"w-full appearance-none bg-no-repeat bg-[length:16px] bg-[right_8px_center]",
|
|
1447
|
+
"bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22%236b7280%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M5.23%207.21a.75.75%200%20011.06.02L10%2011.168l3.71-3.938a.75.75%200%20111.08%201.04l-4.25%204.5a.75.75%200%2001-1.08%200l-4.25-4.5a.75.75%200%2001.02-1.06z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E')]",
|
|
1448
|
+
"pr-8",
|
|
1449
|
+
className
|
|
1450
|
+
),
|
|
1451
|
+
onChange: (e) => {
|
|
1452
|
+
onChange?.(e);
|
|
1453
|
+
onValueChange?.(e.target.value);
|
|
1454
|
+
},
|
|
1455
|
+
...props,
|
|
1456
|
+
children: [
|
|
1457
|
+
placeholder && /* @__PURE__ */ jsx("option", { value: "", disabled: true, children: placeholder }),
|
|
1458
|
+
list.map(
|
|
1459
|
+
(item, index) => isOptionGroup(item) ? /* @__PURE__ */ jsx("optgroup", { label: item.label, children: item.options.map(
|
|
1460
|
+
(opt, optIndex) => renderOption(opt, optIndex)
|
|
1461
|
+
) }, `group-${index}`) : renderOption(item, index)
|
|
1462
|
+
)
|
|
1463
|
+
]
|
|
1464
|
+
}
|
|
1465
|
+
);
|
|
1466
|
+
if (label || error || description) {
|
|
1467
|
+
return /* @__PURE__ */ jsx(
|
|
1468
|
+
Field,
|
|
1469
|
+
{
|
|
1470
|
+
label,
|
|
1471
|
+
description,
|
|
1472
|
+
error,
|
|
1473
|
+
required,
|
|
1474
|
+
htmlFor: selectId,
|
|
1475
|
+
size,
|
|
1476
|
+
children: select
|
|
1477
|
+
}
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
return select;
|
|
1481
|
+
}
|
|
1482
|
+
);
|
|
1483
|
+
Select.displayName = "Select";
|
|
1484
|
+
function useControllableState(controlledValue, defaultValue, onChange) {
|
|
1485
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
1486
|
+
const isControlled = controlledValue !== void 0;
|
|
1487
|
+
const value = isControlled ? controlledValue : uncontrolledValue;
|
|
1488
|
+
const onChangeRef = useRef(onChange);
|
|
1489
|
+
onChangeRef.current = onChange;
|
|
1490
|
+
const setValue = useCallback(
|
|
1491
|
+
(next) => {
|
|
1492
|
+
const nextValue = typeof next === "function" ? next(value) : next;
|
|
1493
|
+
if (!isControlled) {
|
|
1494
|
+
setUncontrolledValue(nextValue);
|
|
1495
|
+
}
|
|
1496
|
+
onChangeRef.current?.(nextValue);
|
|
1497
|
+
},
|
|
1498
|
+
[isControlled, value]
|
|
1499
|
+
);
|
|
1500
|
+
return [value, setValue];
|
|
1501
|
+
}
|
|
1502
|
+
var Checkbox = forwardRef(
|
|
1503
|
+
({
|
|
1504
|
+
size = "md",
|
|
1505
|
+
dirty,
|
|
1506
|
+
error,
|
|
1507
|
+
label,
|
|
1508
|
+
description,
|
|
1509
|
+
required,
|
|
1510
|
+
disabled,
|
|
1511
|
+
className,
|
|
1512
|
+
id,
|
|
1513
|
+
name,
|
|
1514
|
+
checked: controlledChecked,
|
|
1515
|
+
defaultChecked = false,
|
|
1516
|
+
onCheckedChange,
|
|
1517
|
+
indeterminate
|
|
1518
|
+
}, ref) => {
|
|
1519
|
+
const autoId = useId();
|
|
1520
|
+
const checkboxId = id ?? autoId;
|
|
1521
|
+
const internalRef = useRef(null);
|
|
1522
|
+
const [checked, setChecked] = useControllableState(
|
|
1523
|
+
controlledChecked,
|
|
1524
|
+
defaultChecked,
|
|
1525
|
+
onCheckedChange
|
|
1526
|
+
);
|
|
1527
|
+
useEffect(() => {
|
|
1528
|
+
const el = internalRef.current;
|
|
1529
|
+
if (el) {
|
|
1530
|
+
el.indeterminate = indeterminate ?? false;
|
|
1531
|
+
}
|
|
1532
|
+
}, [indeterminate]);
|
|
1533
|
+
const sizeClasses = {
|
|
1534
|
+
xs: "h-3.5 w-3.5",
|
|
1535
|
+
sm: "h-4 w-4",
|
|
1536
|
+
md: "h-[18px] w-[18px]",
|
|
1537
|
+
lg: "h-5 w-5",
|
|
1538
|
+
xl: "h-6 w-6"
|
|
1539
|
+
}[size];
|
|
1540
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-start gap-2", className), children: [
|
|
1541
|
+
/* @__PURE__ */ jsx("div", { className: "relative flex items-center", children: /* @__PURE__ */ jsx(
|
|
1542
|
+
"input",
|
|
1543
|
+
{
|
|
1544
|
+
ref: (node) => {
|
|
1545
|
+
internalRef.current = node;
|
|
1546
|
+
if (typeof ref === "function") {
|
|
1547
|
+
ref(node);
|
|
1548
|
+
} else if (ref) {
|
|
1549
|
+
ref.current = node;
|
|
1550
|
+
}
|
|
1551
|
+
},
|
|
1552
|
+
id: checkboxId,
|
|
1553
|
+
type: "checkbox",
|
|
1554
|
+
name,
|
|
1555
|
+
disabled,
|
|
1556
|
+
required,
|
|
1557
|
+
checked,
|
|
1558
|
+
onChange: (e) => setChecked(e.target.checked),
|
|
1559
|
+
className: cn(
|
|
1560
|
+
sizeClasses,
|
|
1561
|
+
"cursor-pointer rounded border border-zinc-300 bg-white text-blue-600 focus:ring-2 focus:ring-blue-500/40 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-600 dark:bg-zinc-800",
|
|
1562
|
+
dirtyRingClasses(dirty),
|
|
1563
|
+
error && "border-red-500"
|
|
1564
|
+
)
|
|
1565
|
+
}
|
|
1566
|
+
) }),
|
|
1567
|
+
(label || description) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
1568
|
+
label && /* @__PURE__ */ jsxs(
|
|
1569
|
+
"label",
|
|
1570
|
+
{
|
|
1571
|
+
htmlFor: checkboxId,
|
|
1572
|
+
className: cn(
|
|
1573
|
+
"cursor-pointer text-sm text-zinc-700 dark:text-zinc-300",
|
|
1574
|
+
disabled && "cursor-not-allowed opacity-50"
|
|
1575
|
+
),
|
|
1576
|
+
children: [
|
|
1577
|
+
label,
|
|
1578
|
+
required && /* @__PURE__ */ jsx("span", { className: "ml-0.5 text-red-500", children: "*" })
|
|
1579
|
+
]
|
|
1580
|
+
}
|
|
1581
|
+
),
|
|
1582
|
+
description && /* @__PURE__ */ jsx("span", { className: "text-xs text-zinc-500 dark:text-zinc-400", children: description }),
|
|
1583
|
+
error && /* @__PURE__ */ jsx("span", { className: "text-xs text-red-500", children: error })
|
|
1584
|
+
] })
|
|
1585
|
+
] });
|
|
1586
|
+
}
|
|
1587
|
+
);
|
|
1588
|
+
Checkbox.displayName = "Checkbox";
|
|
1589
|
+
function CheckboxGroup({
|
|
1590
|
+
size = "md",
|
|
1591
|
+
dirty,
|
|
1592
|
+
error,
|
|
1593
|
+
label,
|
|
1594
|
+
description,
|
|
1595
|
+
required,
|
|
1596
|
+
disabled,
|
|
1597
|
+
className,
|
|
1598
|
+
name,
|
|
1599
|
+
list,
|
|
1600
|
+
value: controlledValue,
|
|
1601
|
+
defaultValue = [],
|
|
1602
|
+
onValueChange,
|
|
1603
|
+
orientation = "vertical"
|
|
1604
|
+
}) {
|
|
1605
|
+
const groupId = useId();
|
|
1606
|
+
const [value, setValue] = useControllableState(
|
|
1607
|
+
controlledValue,
|
|
1608
|
+
defaultValue,
|
|
1609
|
+
onValueChange
|
|
1610
|
+
);
|
|
1611
|
+
const handleToggle = (optionValue) => {
|
|
1612
|
+
const next = value.includes(optionValue) ? value.filter((v) => v !== optionValue) : [...value, optionValue];
|
|
1613
|
+
setValue(next);
|
|
1614
|
+
};
|
|
1615
|
+
const sizeClasses = {
|
|
1616
|
+
xs: "h-3.5 w-3.5",
|
|
1617
|
+
sm: "h-4 w-4",
|
|
1618
|
+
md: "h-[18px] w-[18px]",
|
|
1619
|
+
lg: "h-5 w-5",
|
|
1620
|
+
xl: "h-6 w-6"
|
|
1621
|
+
}[size];
|
|
1622
|
+
const content = /* @__PURE__ */ jsx(
|
|
1623
|
+
"div",
|
|
1624
|
+
{
|
|
1625
|
+
className: cn(
|
|
1626
|
+
"flex gap-3",
|
|
1627
|
+
orientation === "vertical" ? "flex-col" : "flex-row flex-wrap",
|
|
1628
|
+
className
|
|
1629
|
+
),
|
|
1630
|
+
children: list.map((option, index) => {
|
|
1631
|
+
const resolved = resolveOption(option);
|
|
1632
|
+
const optionId = `${groupId}-${index}`;
|
|
1633
|
+
const isChecked = value.includes(resolved.value);
|
|
1634
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
|
|
1635
|
+
/* @__PURE__ */ jsx(
|
|
1636
|
+
"input",
|
|
1637
|
+
{
|
|
1638
|
+
id: optionId,
|
|
1639
|
+
type: "checkbox",
|
|
1640
|
+
name,
|
|
1641
|
+
value: String(resolved.value),
|
|
1642
|
+
checked: isChecked,
|
|
1643
|
+
disabled: disabled || resolved.disabled,
|
|
1644
|
+
onChange: () => handleToggle(resolved.value),
|
|
1645
|
+
className: cn(
|
|
1646
|
+
sizeClasses,
|
|
1647
|
+
"cursor-pointer rounded border border-zinc-300 bg-white text-blue-600 focus:ring-2 focus:ring-blue-500/40 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-600 dark:bg-zinc-800",
|
|
1648
|
+
dirtyRingClasses(dirty),
|
|
1649
|
+
error && "border-red-500"
|
|
1650
|
+
)
|
|
1651
|
+
}
|
|
1652
|
+
),
|
|
1653
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
1654
|
+
/* @__PURE__ */ jsx(
|
|
1655
|
+
"label",
|
|
1656
|
+
{
|
|
1657
|
+
htmlFor: optionId,
|
|
1658
|
+
className: cn(
|
|
1659
|
+
"cursor-pointer text-sm text-zinc-700 dark:text-zinc-300",
|
|
1660
|
+
(disabled || resolved.disabled) && "cursor-not-allowed opacity-50"
|
|
1661
|
+
),
|
|
1662
|
+
children: resolved.label
|
|
1663
|
+
}
|
|
1664
|
+
),
|
|
1665
|
+
resolved.description && /* @__PURE__ */ jsx("span", { className: "text-xs text-zinc-500 dark:text-zinc-400", children: resolved.description })
|
|
1666
|
+
] })
|
|
1667
|
+
] }, optionId);
|
|
1668
|
+
})
|
|
1669
|
+
}
|
|
1670
|
+
);
|
|
1671
|
+
if (label || error || description) {
|
|
1672
|
+
return /* @__PURE__ */ jsx(
|
|
1673
|
+
Field,
|
|
1674
|
+
{
|
|
1675
|
+
label,
|
|
1676
|
+
description,
|
|
1677
|
+
error,
|
|
1678
|
+
required,
|
|
1679
|
+
size,
|
|
1680
|
+
children: content
|
|
1681
|
+
}
|
|
1682
|
+
);
|
|
1683
|
+
}
|
|
1684
|
+
return content;
|
|
1685
|
+
}
|
|
1686
|
+
CheckboxGroup.displayName = "CheckboxGroup";
|
|
1687
|
+
function RadioGroup({
|
|
1688
|
+
size = "md",
|
|
1689
|
+
dirty,
|
|
1690
|
+
error,
|
|
1691
|
+
label,
|
|
1692
|
+
description,
|
|
1693
|
+
required,
|
|
1694
|
+
disabled,
|
|
1695
|
+
className,
|
|
1696
|
+
name,
|
|
1697
|
+
list,
|
|
1698
|
+
value: controlledValue,
|
|
1699
|
+
defaultValue,
|
|
1700
|
+
onValueChange,
|
|
1701
|
+
orientation = "vertical"
|
|
1702
|
+
}) {
|
|
1703
|
+
const groupId = useId();
|
|
1704
|
+
const radioName = name ?? groupId;
|
|
1705
|
+
const [value, setValue] = useControllableState(
|
|
1706
|
+
controlledValue,
|
|
1707
|
+
defaultValue,
|
|
1708
|
+
onValueChange
|
|
1709
|
+
);
|
|
1710
|
+
const sizeClasses = {
|
|
1711
|
+
xs: "h-3.5 w-3.5",
|
|
1712
|
+
sm: "h-4 w-4",
|
|
1713
|
+
md: "h-[18px] w-[18px]",
|
|
1714
|
+
lg: "h-5 w-5",
|
|
1715
|
+
xl: "h-6 w-6"
|
|
1716
|
+
}[size];
|
|
1717
|
+
const content = /* @__PURE__ */ jsx(
|
|
1718
|
+
"div",
|
|
1719
|
+
{
|
|
1720
|
+
role: "radiogroup",
|
|
1721
|
+
className: cn(
|
|
1722
|
+
"flex gap-3",
|
|
1723
|
+
orientation === "vertical" ? "flex-col" : "flex-row flex-wrap",
|
|
1724
|
+
className
|
|
1725
|
+
),
|
|
1726
|
+
children: list.map((option, index) => {
|
|
1727
|
+
const resolved = resolveOption(option);
|
|
1728
|
+
const optionId = `${groupId}-${index}`;
|
|
1729
|
+
const isSelected = value === resolved.value;
|
|
1730
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
|
|
1731
|
+
/* @__PURE__ */ jsx(
|
|
1732
|
+
"input",
|
|
1733
|
+
{
|
|
1734
|
+
id: optionId,
|
|
1735
|
+
type: "radio",
|
|
1736
|
+
name: radioName,
|
|
1737
|
+
value: String(resolved.value),
|
|
1738
|
+
checked: isSelected,
|
|
1739
|
+
disabled: disabled || resolved.disabled,
|
|
1740
|
+
onChange: () => setValue(resolved.value),
|
|
1741
|
+
className: cn(
|
|
1742
|
+
sizeClasses,
|
|
1743
|
+
"cursor-pointer border border-zinc-300 bg-white text-blue-600 focus:ring-2 focus:ring-blue-500/40 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-600 dark:bg-zinc-800",
|
|
1744
|
+
dirtyRingClasses(dirty),
|
|
1745
|
+
error && "border-red-500"
|
|
1746
|
+
)
|
|
1747
|
+
}
|
|
1748
|
+
),
|
|
1749
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
1750
|
+
/* @__PURE__ */ jsx(
|
|
1751
|
+
"label",
|
|
1752
|
+
{
|
|
1753
|
+
htmlFor: optionId,
|
|
1754
|
+
className: cn(
|
|
1755
|
+
"cursor-pointer text-sm text-zinc-700 dark:text-zinc-300",
|
|
1756
|
+
(disabled || resolved.disabled) && "cursor-not-allowed opacity-50"
|
|
1757
|
+
),
|
|
1758
|
+
children: resolved.label
|
|
1759
|
+
}
|
|
1760
|
+
),
|
|
1761
|
+
resolved.description && /* @__PURE__ */ jsx("span", { className: "text-xs text-zinc-500 dark:text-zinc-400", children: resolved.description })
|
|
1762
|
+
] })
|
|
1763
|
+
] }, optionId);
|
|
1764
|
+
})
|
|
1765
|
+
}
|
|
1766
|
+
);
|
|
1767
|
+
if (label || error || description) {
|
|
1768
|
+
return /* @__PURE__ */ jsx(
|
|
1769
|
+
Field,
|
|
1770
|
+
{
|
|
1771
|
+
label,
|
|
1772
|
+
description,
|
|
1773
|
+
error,
|
|
1774
|
+
required,
|
|
1775
|
+
size,
|
|
1776
|
+
children: content
|
|
1777
|
+
}
|
|
1778
|
+
);
|
|
1779
|
+
}
|
|
1780
|
+
return content;
|
|
1781
|
+
}
|
|
1782
|
+
RadioGroup.displayName = "RadioGroup";
|
|
1783
|
+
var trackColorMap = {
|
|
1784
|
+
zinc: "bg-zinc-500",
|
|
1785
|
+
red: "bg-red-500",
|
|
1786
|
+
orange: "bg-orange-500",
|
|
1787
|
+
amber: "bg-amber-500",
|
|
1788
|
+
yellow: "bg-yellow-500",
|
|
1789
|
+
lime: "bg-lime-500",
|
|
1790
|
+
green: "bg-green-500",
|
|
1791
|
+
emerald: "bg-emerald-500",
|
|
1792
|
+
teal: "bg-teal-500",
|
|
1793
|
+
cyan: "bg-cyan-500",
|
|
1794
|
+
sky: "bg-sky-500",
|
|
1795
|
+
blue: "bg-blue-500",
|
|
1796
|
+
indigo: "bg-indigo-500",
|
|
1797
|
+
violet: "bg-violet-500",
|
|
1798
|
+
purple: "bg-purple-500",
|
|
1799
|
+
fuchsia: "bg-fuchsia-500",
|
|
1800
|
+
pink: "bg-pink-500",
|
|
1801
|
+
rose: "bg-rose-500"
|
|
1802
|
+
};
|
|
1803
|
+
var Switch = forwardRef(
|
|
1804
|
+
({
|
|
1805
|
+
size = "md",
|
|
1806
|
+
dirty,
|
|
1807
|
+
error,
|
|
1808
|
+
label,
|
|
1809
|
+
description,
|
|
1810
|
+
required,
|
|
1811
|
+
disabled,
|
|
1812
|
+
className,
|
|
1813
|
+
id,
|
|
1814
|
+
name,
|
|
1815
|
+
checked: controlledChecked,
|
|
1816
|
+
defaultChecked = false,
|
|
1817
|
+
onCheckedChange,
|
|
1818
|
+
color = "blue"
|
|
1819
|
+
}, ref) => {
|
|
1820
|
+
const autoId = useId();
|
|
1821
|
+
const switchId = id ?? autoId;
|
|
1822
|
+
const [checked, setChecked] = useControllableState(
|
|
1823
|
+
controlledChecked,
|
|
1824
|
+
defaultChecked,
|
|
1825
|
+
onCheckedChange
|
|
1826
|
+
);
|
|
1827
|
+
const trackSizes = {
|
|
1828
|
+
xs: "h-4 w-7",
|
|
1829
|
+
sm: "h-5 w-9",
|
|
1830
|
+
md: "h-6 w-11",
|
|
1831
|
+
lg: "h-7 w-[52px]",
|
|
1832
|
+
xl: "h-8 w-[60px]"
|
|
1833
|
+
}[size];
|
|
1834
|
+
const knobSizes = {
|
|
1835
|
+
xs: "h-3 w-3",
|
|
1836
|
+
sm: "h-4 w-4",
|
|
1837
|
+
md: "h-5 w-5",
|
|
1838
|
+
lg: "h-6 w-6",
|
|
1839
|
+
xl: "h-7 w-7"
|
|
1840
|
+
}[size];
|
|
1841
|
+
const translateOn = {
|
|
1842
|
+
xs: "translate-x-3",
|
|
1843
|
+
sm: "translate-x-4",
|
|
1844
|
+
md: "translate-x-5",
|
|
1845
|
+
lg: "translate-x-6",
|
|
1846
|
+
xl: "translate-x-7"
|
|
1847
|
+
}[size];
|
|
1848
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-start gap-2", className), children: [
|
|
1849
|
+
/* @__PURE__ */ jsx(
|
|
1850
|
+
"button",
|
|
1851
|
+
{
|
|
1852
|
+
ref,
|
|
1853
|
+
id: switchId,
|
|
1854
|
+
type: "button",
|
|
1855
|
+
role: "switch",
|
|
1856
|
+
"aria-checked": checked,
|
|
1857
|
+
disabled,
|
|
1858
|
+
onClick: () => setChecked(!checked),
|
|
1859
|
+
className: cn(
|
|
1860
|
+
"relative inline-flex shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/40 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1861
|
+
trackSizes,
|
|
1862
|
+
checked ? trackColorMap[color] : "bg-zinc-200 dark:bg-zinc-700",
|
|
1863
|
+
dirtyRingClasses(dirty),
|
|
1864
|
+
error && "ring-2 ring-red-500/50"
|
|
1865
|
+
),
|
|
1866
|
+
children: /* @__PURE__ */ jsx(
|
|
1867
|
+
"span",
|
|
1868
|
+
{
|
|
1869
|
+
className: cn(
|
|
1870
|
+
"pointer-events-none inline-block rounded-full bg-white shadow-sm transition-transform",
|
|
1871
|
+
knobSizes,
|
|
1872
|
+
checked ? translateOn : "translate-x-0"
|
|
1873
|
+
)
|
|
1874
|
+
}
|
|
1875
|
+
)
|
|
1876
|
+
}
|
|
1877
|
+
),
|
|
1878
|
+
name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: checked ? "1" : "0" }),
|
|
1879
|
+
(label || description) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
1880
|
+
label && /* @__PURE__ */ jsxs(
|
|
1881
|
+
"label",
|
|
1882
|
+
{
|
|
1883
|
+
htmlFor: switchId,
|
|
1884
|
+
className: cn(
|
|
1885
|
+
"cursor-pointer text-sm text-zinc-700 dark:text-zinc-300",
|
|
1886
|
+
disabled && "cursor-not-allowed opacity-50"
|
|
1887
|
+
),
|
|
1888
|
+
children: [
|
|
1889
|
+
label,
|
|
1890
|
+
required && /* @__PURE__ */ jsx("span", { className: "ml-0.5 text-red-500", children: "*" })
|
|
1891
|
+
]
|
|
1892
|
+
}
|
|
1893
|
+
),
|
|
1894
|
+
description && /* @__PURE__ */ jsx("span", { className: "text-xs text-zinc-500 dark:text-zinc-400", children: description }),
|
|
1895
|
+
error && /* @__PURE__ */ jsx("span", { className: "text-xs text-red-500", children: error })
|
|
1896
|
+
] })
|
|
1897
|
+
] });
|
|
1898
|
+
}
|
|
1899
|
+
);
|
|
1900
|
+
Switch.displayName = "Switch";
|
|
1901
|
+
var Slider = forwardRef(
|
|
1902
|
+
(props, ref) => {
|
|
1903
|
+
const {
|
|
1904
|
+
size = "md",
|
|
1905
|
+
dirty,
|
|
1906
|
+
error,
|
|
1907
|
+
label,
|
|
1908
|
+
description,
|
|
1909
|
+
required,
|
|
1910
|
+
disabled,
|
|
1911
|
+
className,
|
|
1912
|
+
id,
|
|
1913
|
+
name,
|
|
1914
|
+
min = 0,
|
|
1915
|
+
max = 100,
|
|
1916
|
+
step = 1,
|
|
1917
|
+
showValue,
|
|
1918
|
+
marks
|
|
1919
|
+
} = props;
|
|
1920
|
+
const autoId = useId();
|
|
1921
|
+
const sliderId = id ?? autoId;
|
|
1922
|
+
if (props.range) {
|
|
1923
|
+
return /* @__PURE__ */ jsx(
|
|
1924
|
+
RangeSlider,
|
|
1925
|
+
{
|
|
1926
|
+
...props,
|
|
1927
|
+
id: sliderId,
|
|
1928
|
+
ref
|
|
1929
|
+
}
|
|
1930
|
+
);
|
|
1931
|
+
}
|
|
1932
|
+
return /* @__PURE__ */ jsx(
|
|
1933
|
+
SingleSlider,
|
|
1934
|
+
{
|
|
1935
|
+
...props,
|
|
1936
|
+
range: false,
|
|
1937
|
+
id: sliderId,
|
|
1938
|
+
ref
|
|
1939
|
+
}
|
|
1940
|
+
);
|
|
1941
|
+
}
|
|
1942
|
+
);
|
|
1943
|
+
Slider.displayName = "Slider";
|
|
1944
|
+
var SingleSlider = forwardRef(
|
|
1945
|
+
({
|
|
1946
|
+
size = "md",
|
|
1947
|
+
dirty,
|
|
1948
|
+
error,
|
|
1949
|
+
label,
|
|
1950
|
+
description,
|
|
1951
|
+
required,
|
|
1952
|
+
disabled,
|
|
1953
|
+
className,
|
|
1954
|
+
id,
|
|
1955
|
+
name,
|
|
1956
|
+
min = 0,
|
|
1957
|
+
max = 100,
|
|
1958
|
+
step = 1,
|
|
1959
|
+
showValue,
|
|
1960
|
+
marks,
|
|
1961
|
+
...rest
|
|
1962
|
+
}, ref) => {
|
|
1963
|
+
const singleProps = rest;
|
|
1964
|
+
const [value, setValue] = useControllableState(
|
|
1965
|
+
singleProps.value,
|
|
1966
|
+
singleProps.defaultValue ?? min,
|
|
1967
|
+
singleProps.onValueChange
|
|
1968
|
+
);
|
|
1969
|
+
const slider = /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
1970
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1971
|
+
/* @__PURE__ */ jsx(
|
|
1972
|
+
"input",
|
|
1973
|
+
{
|
|
1974
|
+
ref,
|
|
1975
|
+
id,
|
|
1976
|
+
type: "range",
|
|
1977
|
+
name,
|
|
1978
|
+
min,
|
|
1979
|
+
max,
|
|
1980
|
+
step,
|
|
1981
|
+
value,
|
|
1982
|
+
disabled,
|
|
1983
|
+
onChange: (e) => setValue(Number(e.target.value)),
|
|
1984
|
+
className: cn(
|
|
1985
|
+
"w-full cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1986
|
+
dirtyRingClasses(dirty),
|
|
1987
|
+
{
|
|
1988
|
+
xs: "h-1",
|
|
1989
|
+
sm: "h-1.5",
|
|
1990
|
+
md: "h-2",
|
|
1991
|
+
lg: "h-2.5",
|
|
1992
|
+
xl: "h-3"
|
|
1993
|
+
}[size]
|
|
1994
|
+
)
|
|
1995
|
+
}
|
|
1996
|
+
),
|
|
1997
|
+
showValue && /* @__PURE__ */ jsx("span", { className: "min-w-[3ch] text-right text-sm font-medium text-zinc-700 dark:text-zinc-300", children: value })
|
|
1998
|
+
] }),
|
|
1999
|
+
marks && marks.length > 0 && /* @__PURE__ */ jsx(SliderMarks, { marks, min, max })
|
|
2000
|
+
] });
|
|
2001
|
+
if (label || error || description) {
|
|
2002
|
+
return /* @__PURE__ */ jsx(Field, { label, description, error, required, htmlFor: id, size, children: slider });
|
|
2003
|
+
}
|
|
2004
|
+
return slider;
|
|
2005
|
+
}
|
|
2006
|
+
);
|
|
2007
|
+
SingleSlider.displayName = "SingleSlider";
|
|
2008
|
+
var RangeSlider = forwardRef(
|
|
2009
|
+
({
|
|
2010
|
+
size = "md",
|
|
2011
|
+
dirty,
|
|
2012
|
+
error,
|
|
2013
|
+
label,
|
|
2014
|
+
description,
|
|
2015
|
+
required,
|
|
2016
|
+
disabled,
|
|
2017
|
+
className,
|
|
2018
|
+
id,
|
|
2019
|
+
name,
|
|
2020
|
+
min = 0,
|
|
2021
|
+
max = 100,
|
|
2022
|
+
step = 1,
|
|
2023
|
+
showValue,
|
|
2024
|
+
marks,
|
|
2025
|
+
...rest
|
|
2026
|
+
}, ref) => {
|
|
2027
|
+
const rangeProps = rest;
|
|
2028
|
+
const [value, setValue] = useControllableState(
|
|
2029
|
+
rangeProps.value,
|
|
2030
|
+
rangeProps.defaultValue ?? [min, max],
|
|
2031
|
+
rangeProps.onValueChange
|
|
2032
|
+
);
|
|
2033
|
+
const handleMin = (n) => {
|
|
2034
|
+
setValue([Math.min(n, value[1]), value[1]]);
|
|
2035
|
+
};
|
|
2036
|
+
const handleMax = (n) => {
|
|
2037
|
+
setValue([value[0], Math.max(n, value[0])]);
|
|
2038
|
+
};
|
|
2039
|
+
const leftPercent = (value[0] - min) / (max - min) * 100;
|
|
2040
|
+
const rightPercent = (value[1] - min) / (max - min) * 100;
|
|
2041
|
+
const slider = /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
2042
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2043
|
+
/* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
2044
|
+
/* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute top-1/2 h-1.5 w-full -translate-y-1/2 rounded-full bg-zinc-200 dark:bg-zinc-700" }),
|
|
2045
|
+
/* @__PURE__ */ jsx(
|
|
2046
|
+
"div",
|
|
2047
|
+
{
|
|
2048
|
+
className: "pointer-events-none absolute top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-blue-500",
|
|
2049
|
+
style: { left: `${leftPercent}%`, width: `${rightPercent - leftPercent}%` }
|
|
2050
|
+
}
|
|
2051
|
+
),
|
|
2052
|
+
/* @__PURE__ */ jsx(
|
|
2053
|
+
"input",
|
|
2054
|
+
{
|
|
2055
|
+
ref,
|
|
2056
|
+
type: "range",
|
|
2057
|
+
min,
|
|
2058
|
+
max,
|
|
2059
|
+
step,
|
|
2060
|
+
value: value[0],
|
|
2061
|
+
disabled,
|
|
2062
|
+
onChange: (e) => handleMin(Number(e.target.value)),
|
|
2063
|
+
className: cn(
|
|
2064
|
+
"pointer-events-none absolute w-full cursor-pointer appearance-none bg-transparent [&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-blue-600 [&::-webkit-slider-thumb]:shadow",
|
|
2065
|
+
dirtyRingClasses(dirty)
|
|
2066
|
+
)
|
|
2067
|
+
}
|
|
2068
|
+
),
|
|
2069
|
+
/* @__PURE__ */ jsx(
|
|
2070
|
+
"input",
|
|
2071
|
+
{
|
|
2072
|
+
type: "range",
|
|
2073
|
+
min,
|
|
2074
|
+
max,
|
|
2075
|
+
step,
|
|
2076
|
+
value: value[1],
|
|
2077
|
+
disabled,
|
|
2078
|
+
onChange: (e) => handleMax(Number(e.target.value)),
|
|
2079
|
+
className: "pointer-events-none absolute w-full cursor-pointer appearance-none bg-transparent [&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-blue-600 [&::-webkit-slider-thumb]:shadow"
|
|
2080
|
+
}
|
|
2081
|
+
),
|
|
2082
|
+
/* @__PURE__ */ jsx("div", { className: "h-6" })
|
|
2083
|
+
] }),
|
|
2084
|
+
showValue && /* @__PURE__ */ jsxs("span", { className: "min-w-[6ch] whitespace-nowrap text-right text-sm font-medium text-zinc-700 dark:text-zinc-300", children: [
|
|
2085
|
+
value[0],
|
|
2086
|
+
"\u2013",
|
|
2087
|
+
value[1]
|
|
2088
|
+
] })
|
|
2089
|
+
] }),
|
|
2090
|
+
marks && marks.length > 0 && /* @__PURE__ */ jsx(SliderMarks, { marks, min, max })
|
|
2091
|
+
] });
|
|
2092
|
+
if (label || error || description) {
|
|
2093
|
+
return /* @__PURE__ */ jsx(Field, { label, description, error, required, htmlFor: id, size, children: slider });
|
|
2094
|
+
}
|
|
2095
|
+
return slider;
|
|
2096
|
+
}
|
|
2097
|
+
);
|
|
2098
|
+
RangeSlider.displayName = "RangeSlider";
|
|
2099
|
+
function SliderMarks({
|
|
2100
|
+
marks,
|
|
2101
|
+
min,
|
|
2102
|
+
max
|
|
2103
|
+
}) {
|
|
2104
|
+
return /* @__PURE__ */ jsx("div", { className: "relative h-5 w-full", children: marks.map((mark) => {
|
|
2105
|
+
const percent = (mark.value - min) / (max - min) * 100;
|
|
2106
|
+
return /* @__PURE__ */ jsx(
|
|
2107
|
+
"span",
|
|
2108
|
+
{
|
|
2109
|
+
className: "absolute -translate-x-1/2 text-xs text-zinc-500 dark:text-zinc-400",
|
|
2110
|
+
style: { left: `${percent}%` },
|
|
2111
|
+
children: mark.label ?? mark.value
|
|
2112
|
+
},
|
|
2113
|
+
mark.value
|
|
2114
|
+
);
|
|
2115
|
+
}) });
|
|
2116
|
+
}
|
|
2117
|
+
var DatePicker = forwardRef(
|
|
2118
|
+
(props, ref) => {
|
|
2119
|
+
const {
|
|
2120
|
+
size = "md",
|
|
2121
|
+
dirty,
|
|
2122
|
+
error,
|
|
2123
|
+
label,
|
|
2124
|
+
description,
|
|
2125
|
+
required,
|
|
2126
|
+
disabled,
|
|
2127
|
+
className,
|
|
2128
|
+
id,
|
|
2129
|
+
name,
|
|
2130
|
+
min,
|
|
2131
|
+
max,
|
|
2132
|
+
includeTime
|
|
2133
|
+
} = props;
|
|
2134
|
+
const autoId = useId();
|
|
2135
|
+
const pickerId = id ?? autoId;
|
|
2136
|
+
const inputType = includeTime ? "datetime-local" : "date";
|
|
2137
|
+
const inputClasses = cn(
|
|
2138
|
+
inputBaseClasses,
|
|
2139
|
+
inputSizeClasses[size],
|
|
2140
|
+
dirtyClasses(dirty),
|
|
2141
|
+
errorClasses(error),
|
|
2142
|
+
"w-full"
|
|
2143
|
+
);
|
|
2144
|
+
if (props.range) {
|
|
2145
|
+
return /* @__PURE__ */ jsx(
|
|
2146
|
+
RangeDatePicker,
|
|
2147
|
+
{
|
|
2148
|
+
...props,
|
|
2149
|
+
id: pickerId,
|
|
2150
|
+
inputType,
|
|
2151
|
+
inputClasses,
|
|
2152
|
+
ref
|
|
2153
|
+
}
|
|
2154
|
+
);
|
|
2155
|
+
}
|
|
2156
|
+
return /* @__PURE__ */ jsx(
|
|
2157
|
+
SingleDatePicker,
|
|
2158
|
+
{
|
|
2159
|
+
...props,
|
|
2160
|
+
range: false,
|
|
2161
|
+
id: pickerId,
|
|
2162
|
+
inputType,
|
|
2163
|
+
inputClasses,
|
|
2164
|
+
ref
|
|
2165
|
+
}
|
|
2166
|
+
);
|
|
2167
|
+
}
|
|
2168
|
+
);
|
|
2169
|
+
DatePicker.displayName = "DatePicker";
|
|
2170
|
+
var SingleDatePicker = forwardRef(
|
|
2171
|
+
({
|
|
2172
|
+
size = "md",
|
|
2173
|
+
error,
|
|
2174
|
+
label,
|
|
2175
|
+
description,
|
|
2176
|
+
required,
|
|
2177
|
+
disabled,
|
|
2178
|
+
className,
|
|
2179
|
+
id,
|
|
2180
|
+
name,
|
|
2181
|
+
min,
|
|
2182
|
+
max,
|
|
2183
|
+
inputType,
|
|
2184
|
+
inputClasses,
|
|
2185
|
+
...rest
|
|
2186
|
+
}, ref) => {
|
|
2187
|
+
const singleProps = rest;
|
|
2188
|
+
const [value, setValue] = useControllableState(
|
|
2189
|
+
singleProps.value,
|
|
2190
|
+
singleProps.defaultValue ?? "",
|
|
2191
|
+
singleProps.onValueChange
|
|
2192
|
+
);
|
|
2193
|
+
const input = /* @__PURE__ */ jsx(
|
|
2194
|
+
"input",
|
|
2195
|
+
{
|
|
2196
|
+
ref,
|
|
2197
|
+
id,
|
|
2198
|
+
type: inputType,
|
|
2199
|
+
name,
|
|
2200
|
+
min,
|
|
2201
|
+
max,
|
|
2202
|
+
value,
|
|
2203
|
+
disabled,
|
|
2204
|
+
required,
|
|
2205
|
+
onChange: (e) => setValue(e.target.value),
|
|
2206
|
+
className: cn(inputClasses, className)
|
|
2207
|
+
}
|
|
2208
|
+
);
|
|
2209
|
+
if (label || error || description) {
|
|
2210
|
+
return /* @__PURE__ */ jsx(
|
|
2211
|
+
Field,
|
|
2212
|
+
{
|
|
2213
|
+
label,
|
|
2214
|
+
description,
|
|
2215
|
+
error,
|
|
2216
|
+
required,
|
|
2217
|
+
htmlFor: id,
|
|
2218
|
+
size,
|
|
2219
|
+
children: input
|
|
2220
|
+
}
|
|
2221
|
+
);
|
|
2222
|
+
}
|
|
2223
|
+
return input;
|
|
2224
|
+
}
|
|
2225
|
+
);
|
|
2226
|
+
SingleDatePicker.displayName = "SingleDatePicker";
|
|
2227
|
+
var RangeDatePicker = forwardRef(
|
|
2228
|
+
({
|
|
2229
|
+
size = "md",
|
|
2230
|
+
error,
|
|
2231
|
+
label,
|
|
2232
|
+
description,
|
|
2233
|
+
required,
|
|
2234
|
+
disabled,
|
|
2235
|
+
className,
|
|
2236
|
+
id,
|
|
2237
|
+
name,
|
|
2238
|
+
min,
|
|
2239
|
+
max,
|
|
2240
|
+
inputType,
|
|
2241
|
+
inputClasses,
|
|
2242
|
+
...rest
|
|
2243
|
+
}, ref) => {
|
|
2244
|
+
const rangeProps = rest;
|
|
2245
|
+
const [value, setValue] = useControllableState(
|
|
2246
|
+
rangeProps.value,
|
|
2247
|
+
rangeProps.defaultValue ?? ["", ""],
|
|
2248
|
+
rangeProps.onValueChange
|
|
2249
|
+
);
|
|
2250
|
+
const input = /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
|
|
2251
|
+
/* @__PURE__ */ jsx(
|
|
2252
|
+
"input",
|
|
2253
|
+
{
|
|
2254
|
+
ref,
|
|
2255
|
+
id,
|
|
2256
|
+
type: inputType,
|
|
2257
|
+
name: name ? `${name}_start` : void 0,
|
|
2258
|
+
min,
|
|
2259
|
+
max: value[1] || max,
|
|
2260
|
+
value: value[0],
|
|
2261
|
+
disabled,
|
|
2262
|
+
required,
|
|
2263
|
+
onChange: (e) => setValue([e.target.value, value[1]]),
|
|
2264
|
+
className: inputClasses
|
|
2265
|
+
}
|
|
2266
|
+
),
|
|
2267
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-zinc-500 dark:text-zinc-400", children: "to" }),
|
|
2268
|
+
/* @__PURE__ */ jsx(
|
|
2269
|
+
"input",
|
|
2270
|
+
{
|
|
2271
|
+
type: inputType,
|
|
2272
|
+
name: name ? `${name}_end` : void 0,
|
|
2273
|
+
min: value[0] || min,
|
|
2274
|
+
max,
|
|
2275
|
+
value: value[1],
|
|
2276
|
+
disabled,
|
|
2277
|
+
onChange: (e) => setValue([value[0], e.target.value]),
|
|
2278
|
+
className: inputClasses
|
|
2279
|
+
}
|
|
2280
|
+
)
|
|
2281
|
+
] });
|
|
2282
|
+
if (label || error || description) {
|
|
2283
|
+
return /* @__PURE__ */ jsx(
|
|
2284
|
+
Field,
|
|
2285
|
+
{
|
|
2286
|
+
label,
|
|
2287
|
+
description,
|
|
2288
|
+
error,
|
|
2289
|
+
required,
|
|
2290
|
+
htmlFor: id,
|
|
2291
|
+
size,
|
|
2292
|
+
children: input
|
|
2293
|
+
}
|
|
2294
|
+
);
|
|
2295
|
+
}
|
|
2296
|
+
return input;
|
|
2297
|
+
}
|
|
2298
|
+
);
|
|
2299
|
+
RangeDatePicker.displayName = "RangeDatePicker";
|
|
2300
|
+
var CarouselContext = createContext(null);
|
|
2301
|
+
function useCarousel() {
|
|
2302
|
+
const ctx = useContext(CarouselContext);
|
|
2303
|
+
if (!ctx) {
|
|
2304
|
+
throw new Error("Carousel compound components must be used within <Carousel>");
|
|
2305
|
+
}
|
|
2306
|
+
return ctx;
|
|
2307
|
+
}
|
|
2308
|
+
function CarouselPanels({ children, className }) {
|
|
2309
|
+
const { activeIndex, registerSlides } = useCarousel();
|
|
2310
|
+
const slides = Children.toArray(children);
|
|
2311
|
+
useEffect(() => {
|
|
2312
|
+
registerSlides(slides.length);
|
|
2313
|
+
}, [slides.length, registerSlides]);
|
|
2314
|
+
return /* @__PURE__ */ jsx("div", { className: cn("relative overflow-hidden", className), children: slides[activeIndex] });
|
|
2315
|
+
}
|
|
2316
|
+
function CarouselSlide({ children, className }) {
|
|
2317
|
+
return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), children });
|
|
2318
|
+
}
|
|
2319
|
+
function CarouselControls({
|
|
2320
|
+
className,
|
|
2321
|
+
prevLabel = "\u2190",
|
|
2322
|
+
nextLabel = "\u2192"
|
|
2323
|
+
}) {
|
|
2324
|
+
const { prev, next, activeIndex, totalSlides } = useCarousel();
|
|
2325
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
|
|
2326
|
+
/* @__PURE__ */ jsx(
|
|
2327
|
+
"button",
|
|
2328
|
+
{
|
|
2329
|
+
type: "button",
|
|
2330
|
+
onClick: prev,
|
|
2331
|
+
disabled: activeIndex === 0,
|
|
2332
|
+
className: "rounded-lg border px-3 py-1 text-sm disabled:opacity-50 dark:border-zinc-600",
|
|
2333
|
+
children: prevLabel
|
|
2334
|
+
}
|
|
2335
|
+
),
|
|
2336
|
+
/* @__PURE__ */ jsx(
|
|
2337
|
+
"button",
|
|
2338
|
+
{
|
|
2339
|
+
type: "button",
|
|
2340
|
+
onClick: next,
|
|
2341
|
+
disabled: activeIndex === totalSlides - 1,
|
|
2342
|
+
className: "rounded-lg border px-3 py-1 text-sm disabled:opacity-50 dark:border-zinc-600",
|
|
2343
|
+
children: nextLabel
|
|
2344
|
+
}
|
|
2345
|
+
)
|
|
2346
|
+
] });
|
|
2347
|
+
}
|
|
2348
|
+
function CarouselSteps({ className }) {
|
|
2349
|
+
const { activeIndex, totalSlides, goTo } = useCarousel();
|
|
2350
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-1.5", className), children: Array.from({ length: totalSlides }, (_, i) => /* @__PURE__ */ jsx(
|
|
2351
|
+
"button",
|
|
2352
|
+
{
|
|
2353
|
+
type: "button",
|
|
2354
|
+
onClick: () => goTo(i),
|
|
2355
|
+
className: cn(
|
|
2356
|
+
"h-2 w-2 rounded-full transition-colors",
|
|
2357
|
+
i === activeIndex ? "bg-zinc-800 dark:bg-white" : "bg-zinc-300 dark:bg-zinc-600"
|
|
2358
|
+
),
|
|
2359
|
+
"aria-label": `Go to slide ${i + 1}`
|
|
2360
|
+
},
|
|
2361
|
+
i
|
|
2362
|
+
)) });
|
|
2363
|
+
}
|
|
2364
|
+
function CarouselRoot({
|
|
2365
|
+
children,
|
|
2366
|
+
defaultIndex = 0,
|
|
2367
|
+
className
|
|
2368
|
+
}) {
|
|
2369
|
+
const [activeIndex, setActiveIndex] = useState(defaultIndex);
|
|
2370
|
+
const [totalSlides, setTotalSlides] = useState(0);
|
|
2371
|
+
const registerSlides = useCallback((count) => {
|
|
2372
|
+
setTotalSlides(count);
|
|
2373
|
+
}, []);
|
|
2374
|
+
const next = useCallback(
|
|
2375
|
+
() => setActiveIndex((i) => Math.min(i + 1, totalSlides - 1)),
|
|
2376
|
+
[totalSlides]
|
|
2377
|
+
);
|
|
2378
|
+
const prev = useCallback(
|
|
2379
|
+
() => setActiveIndex((i) => Math.max(i - 1, 0)),
|
|
2380
|
+
[]
|
|
2381
|
+
);
|
|
2382
|
+
const goTo = useCallback((index) => setActiveIndex(index), []);
|
|
2383
|
+
const ctx = useMemo(
|
|
2384
|
+
() => ({ activeIndex, totalSlides, next, prev, goTo, registerSlides }),
|
|
2385
|
+
[activeIndex, totalSlides, next, prev, goTo, registerSlides]
|
|
2386
|
+
);
|
|
2387
|
+
return /* @__PURE__ */ jsx(CarouselContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx("div", { className: cn("relative", className), children }) });
|
|
2388
|
+
}
|
|
2389
|
+
var Carousel = Object.assign(CarouselRoot, {
|
|
2390
|
+
Panels: CarouselPanels,
|
|
2391
|
+
Slide: CarouselSlide,
|
|
2392
|
+
Controls: CarouselControls,
|
|
2393
|
+
Steps: CarouselSteps
|
|
2394
|
+
});
|
|
2395
|
+
var DEFAULT_COLORS = [
|
|
2396
|
+
"zinc",
|
|
2397
|
+
"red",
|
|
2398
|
+
"orange",
|
|
2399
|
+
"amber",
|
|
2400
|
+
"yellow",
|
|
2401
|
+
"lime",
|
|
2402
|
+
"green",
|
|
2403
|
+
"emerald",
|
|
2404
|
+
"teal",
|
|
2405
|
+
"cyan",
|
|
2406
|
+
"sky",
|
|
2407
|
+
"blue",
|
|
2408
|
+
"indigo",
|
|
2409
|
+
"violet",
|
|
2410
|
+
"purple",
|
|
2411
|
+
"fuchsia",
|
|
2412
|
+
"pink",
|
|
2413
|
+
"rose"
|
|
2414
|
+
];
|
|
2415
|
+
var COLOR_MAP = {
|
|
2416
|
+
zinc: "bg-zinc-500",
|
|
2417
|
+
red: "bg-red-500",
|
|
2418
|
+
orange: "bg-orange-500",
|
|
2419
|
+
amber: "bg-amber-500",
|
|
2420
|
+
yellow: "bg-yellow-500",
|
|
2421
|
+
lime: "bg-lime-500",
|
|
2422
|
+
green: "bg-green-500",
|
|
2423
|
+
emerald: "bg-emerald-500",
|
|
2424
|
+
teal: "bg-teal-500",
|
|
2425
|
+
cyan: "bg-cyan-500",
|
|
2426
|
+
sky: "bg-sky-500",
|
|
2427
|
+
blue: "bg-blue-500",
|
|
2428
|
+
indigo: "bg-indigo-500",
|
|
2429
|
+
violet: "bg-violet-500",
|
|
2430
|
+
purple: "bg-purple-500",
|
|
2431
|
+
fuchsia: "bg-fuchsia-500",
|
|
2432
|
+
pink: "bg-pink-500",
|
|
2433
|
+
rose: "bg-rose-500"
|
|
2434
|
+
};
|
|
2435
|
+
function ColorPicker({
|
|
2436
|
+
value,
|
|
2437
|
+
defaultValue = "blue",
|
|
2438
|
+
onChange,
|
|
2439
|
+
colors = DEFAULT_COLORS,
|
|
2440
|
+
size = "md",
|
|
2441
|
+
className
|
|
2442
|
+
}) {
|
|
2443
|
+
const [selected, setSelected] = useControllableState(
|
|
2444
|
+
value,
|
|
2445
|
+
defaultValue,
|
|
2446
|
+
onChange
|
|
2447
|
+
);
|
|
2448
|
+
const swatchSize = { sm: "h-6 w-6", md: "h-8 w-8", lg: "h-10 w-10" }[size];
|
|
2449
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-wrap gap-2", className), children: colors.map((color) => /* @__PURE__ */ jsx(
|
|
2450
|
+
"button",
|
|
2451
|
+
{
|
|
2452
|
+
type: "button",
|
|
2453
|
+
className: cn(
|
|
2454
|
+
swatchSize,
|
|
2455
|
+
"rounded-full transition-transform",
|
|
2456
|
+
COLOR_MAP[color],
|
|
2457
|
+
selected === color ? "ring-2 ring-offset-2 ring-current scale-110" : "hover:scale-110"
|
|
2458
|
+
),
|
|
2459
|
+
onClick: () => setSelected(color),
|
|
2460
|
+
"aria-label": color,
|
|
2461
|
+
"aria-pressed": selected === color
|
|
2462
|
+
},
|
|
2463
|
+
color
|
|
2464
|
+
)) });
|
|
2465
|
+
}
|
|
2466
|
+
function Emoji({ name, emoji, size = "md", className }) {
|
|
2467
|
+
const resolved = emoji ?? (name ? resolve(name) : void 0);
|
|
2468
|
+
if (!resolved) return null;
|
|
2469
|
+
const sizeClass = {
|
|
2470
|
+
sm: "text-base",
|
|
2471
|
+
md: "text-2xl",
|
|
2472
|
+
lg: "text-4xl",
|
|
2473
|
+
xl: "text-6xl"
|
|
2474
|
+
}[size];
|
|
2475
|
+
return /* @__PURE__ */ jsx(
|
|
2476
|
+
"span",
|
|
2477
|
+
{
|
|
2478
|
+
role: "img",
|
|
2479
|
+
"aria-label": name ?? resolved,
|
|
2480
|
+
className: cn("inline-block leading-none", sizeClass, className),
|
|
2481
|
+
children: resolved
|
|
2482
|
+
}
|
|
2483
|
+
);
|
|
2484
|
+
}
|
|
2485
|
+
function EmojiSelect({
|
|
2486
|
+
value,
|
|
2487
|
+
defaultValue,
|
|
2488
|
+
onChange,
|
|
2489
|
+
placeholder = "Search emojis...",
|
|
2490
|
+
className
|
|
2491
|
+
}) {
|
|
2492
|
+
const [selected, setSelected] = useControllableState(
|
|
2493
|
+
value,
|
|
2494
|
+
defaultValue ?? "",
|
|
2495
|
+
onChange
|
|
2496
|
+
);
|
|
2497
|
+
const [open, setOpen] = useState(false);
|
|
2498
|
+
const [query, setQuery] = useState("");
|
|
2499
|
+
const filtered = useMemo(() => {
|
|
2500
|
+
if (!query) return EMOJI_DATA;
|
|
2501
|
+
const results = search(query);
|
|
2502
|
+
return [{ category: "Results", emojis: results }];
|
|
2503
|
+
}, [query]);
|
|
2504
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative inline-block", className), children: [
|
|
2505
|
+
/* @__PURE__ */ jsx(
|
|
2506
|
+
"button",
|
|
2507
|
+
{
|
|
2508
|
+
type: "button",
|
|
2509
|
+
className: "flex items-center gap-2 rounded-lg border border-zinc-300 px-3 py-2 text-sm dark:border-zinc-600",
|
|
2510
|
+
onClick: () => setOpen(!open),
|
|
2511
|
+
children: selected ? /* @__PURE__ */ jsx("span", { className: "text-xl", children: selected }) : /* @__PURE__ */ jsx("span", { className: "text-zinc-400", children: "Pick emoji" })
|
|
2512
|
+
}
|
|
2513
|
+
),
|
|
2514
|
+
open && /* @__PURE__ */ jsxs("div", { className: "absolute z-50 mt-1 w-72 rounded-lg border border-zinc-200 bg-white p-2 shadow-lg dark:border-zinc-700 dark:bg-zinc-800 fancy-fade-in", children: [
|
|
2515
|
+
/* @__PURE__ */ jsx(
|
|
2516
|
+
"input",
|
|
2517
|
+
{
|
|
2518
|
+
type: "text",
|
|
2519
|
+
value: query,
|
|
2520
|
+
onChange: (e) => setQuery(e.target.value),
|
|
2521
|
+
placeholder,
|
|
2522
|
+
className: "mb-2 w-full rounded-md border border-zinc-200 px-2 py-1 text-sm dark:border-zinc-600 dark:bg-zinc-700",
|
|
2523
|
+
autoFocus: true
|
|
2524
|
+
}
|
|
2525
|
+
),
|
|
2526
|
+
/* @__PURE__ */ jsx("div", { className: "max-h-48 overflow-y-auto", children: filtered.map((group) => /* @__PURE__ */ jsxs("div", { children: [
|
|
2527
|
+
/* @__PURE__ */ jsx("div", { className: "px-1 py-1 text-xs font-semibold text-zinc-500 uppercase", children: group.category }),
|
|
2528
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap", children: group.emojis.map((emoji, i) => /* @__PURE__ */ jsx(
|
|
2529
|
+
"button",
|
|
2530
|
+
{
|
|
2531
|
+
type: "button",
|
|
2532
|
+
className: "p-1 text-xl hover:bg-zinc-100 rounded dark:hover:bg-zinc-700",
|
|
2533
|
+
onClick: () => {
|
|
2534
|
+
setSelected(emoji);
|
|
2535
|
+
setOpen(false);
|
|
2536
|
+
setQuery("");
|
|
2537
|
+
},
|
|
2538
|
+
children: emoji
|
|
2539
|
+
},
|
|
2540
|
+
`${emoji}-${i}`
|
|
2541
|
+
)) })
|
|
2542
|
+
] }, group.category)) })
|
|
2543
|
+
] })
|
|
2544
|
+
] });
|
|
2545
|
+
}
|
|
2546
|
+
var TableContext = createContext(null);
|
|
2547
|
+
function useTable() {
|
|
2548
|
+
const ctx = useContext(TableContext);
|
|
2549
|
+
if (!ctx) {
|
|
2550
|
+
throw new Error("Table compound components must be used within <Table>");
|
|
2551
|
+
}
|
|
2552
|
+
return ctx;
|
|
2553
|
+
}
|
|
2554
|
+
function TableHead({ children, className }) {
|
|
2555
|
+
return /* @__PURE__ */ jsx("thead", { className: cn("border-b border-zinc-200 dark:border-zinc-700", className), children });
|
|
2556
|
+
}
|
|
2557
|
+
function TableBody({ children, className }) {
|
|
2558
|
+
return /* @__PURE__ */ jsx("tbody", { className: cn("divide-y divide-zinc-100 dark:divide-zinc-800", className), children });
|
|
2559
|
+
}
|
|
2560
|
+
function TableRow({ children, className, onClick }) {
|
|
2561
|
+
return /* @__PURE__ */ jsx(
|
|
2562
|
+
"tr",
|
|
2563
|
+
{
|
|
2564
|
+
className: cn(
|
|
2565
|
+
"transition-colors hover:bg-zinc-50 dark:hover:bg-zinc-800/50",
|
|
2566
|
+
onClick && "cursor-pointer",
|
|
2567
|
+
className
|
|
2568
|
+
),
|
|
2569
|
+
onClick,
|
|
2570
|
+
children
|
|
2571
|
+
}
|
|
2572
|
+
);
|
|
2573
|
+
}
|
|
2574
|
+
function TableCell({ children, className, header }) {
|
|
2575
|
+
const Tag = header ? "th" : "td";
|
|
2576
|
+
return /* @__PURE__ */ jsx(
|
|
2577
|
+
Tag,
|
|
2578
|
+
{
|
|
2579
|
+
className: cn(
|
|
2580
|
+
"px-4 py-3 text-sm",
|
|
2581
|
+
header && "text-left font-medium text-zinc-500 dark:text-zinc-400",
|
|
2582
|
+
className
|
|
2583
|
+
),
|
|
2584
|
+
children
|
|
2585
|
+
}
|
|
2586
|
+
);
|
|
2587
|
+
}
|
|
2588
|
+
function TableColumn({ label, sortKey, className }) {
|
|
2589
|
+
const { sortKey: currentSort, sortDir, toggleSort } = useTable();
|
|
2590
|
+
const isSorted = sortKey && currentSort === sortKey;
|
|
2591
|
+
return /* @__PURE__ */ jsx(
|
|
2592
|
+
"th",
|
|
2593
|
+
{
|
|
2594
|
+
className: cn(
|
|
2595
|
+
"px-4 py-3 text-left text-sm font-medium text-zinc-500 dark:text-zinc-400",
|
|
2596
|
+
sortKey && "cursor-pointer select-none",
|
|
2597
|
+
className
|
|
2598
|
+
),
|
|
2599
|
+
onClick: sortKey ? () => toggleSort(sortKey) : void 0,
|
|
2600
|
+
children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1", children: [
|
|
2601
|
+
label,
|
|
2602
|
+
isSorted && /* @__PURE__ */ jsx("span", { className: "text-xs", children: sortDir === "asc" ? "\u25B2" : "\u25BC" })
|
|
2603
|
+
] })
|
|
2604
|
+
}
|
|
2605
|
+
);
|
|
2606
|
+
}
|
|
2607
|
+
function TablePagination({
|
|
2608
|
+
className,
|
|
2609
|
+
total,
|
|
2610
|
+
pageSize = 10
|
|
2611
|
+
}) {
|
|
2612
|
+
const { page, setPage } = useTable();
|
|
2613
|
+
const totalPages = Math.ceil(total / pageSize);
|
|
2614
|
+
if (totalPages <= 1) return null;
|
|
2615
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between px-4 py-3 text-sm", className), children: [
|
|
2616
|
+
/* @__PURE__ */ jsxs("span", { className: "text-zinc-500", children: [
|
|
2617
|
+
"Page ",
|
|
2618
|
+
page + 1,
|
|
2619
|
+
" of ",
|
|
2620
|
+
totalPages
|
|
2621
|
+
] }),
|
|
2622
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
|
|
2623
|
+
/* @__PURE__ */ jsx(
|
|
2624
|
+
"button",
|
|
2625
|
+
{
|
|
2626
|
+
type: "button",
|
|
2627
|
+
disabled: page === 0,
|
|
2628
|
+
onClick: () => setPage(page - 1),
|
|
2629
|
+
className: "rounded border px-2 py-1 disabled:opacity-50 dark:border-zinc-600",
|
|
2630
|
+
children: "Prev"
|
|
2631
|
+
}
|
|
2632
|
+
),
|
|
2633
|
+
/* @__PURE__ */ jsx(
|
|
2634
|
+
"button",
|
|
2635
|
+
{
|
|
2636
|
+
type: "button",
|
|
2637
|
+
disabled: page >= totalPages - 1,
|
|
2638
|
+
onClick: () => setPage(page + 1),
|
|
2639
|
+
className: "rounded border px-2 py-1 disabled:opacity-50 dark:border-zinc-600",
|
|
2640
|
+
children: "Next"
|
|
2641
|
+
}
|
|
2642
|
+
)
|
|
2643
|
+
] })
|
|
2644
|
+
] });
|
|
2645
|
+
}
|
|
2646
|
+
function TableSearch({
|
|
2647
|
+
className,
|
|
2648
|
+
placeholder = "Search..."
|
|
2649
|
+
}) {
|
|
2650
|
+
const { searchQuery, setSearchQuery } = useTable();
|
|
2651
|
+
return /* @__PURE__ */ jsx(
|
|
2652
|
+
"input",
|
|
2653
|
+
{
|
|
2654
|
+
type: "text",
|
|
2655
|
+
value: searchQuery,
|
|
2656
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
2657
|
+
placeholder,
|
|
2658
|
+
className: cn(
|
|
2659
|
+
"rounded-lg border border-zinc-200 px-3 py-2 text-sm dark:border-zinc-600 dark:bg-zinc-800",
|
|
2660
|
+
className
|
|
2661
|
+
)
|
|
2662
|
+
}
|
|
2663
|
+
);
|
|
2664
|
+
}
|
|
2665
|
+
function TableTray({ children, className }) {
|
|
2666
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-between px-4 py-3", className), children });
|
|
2667
|
+
}
|
|
2668
|
+
function TableRoot({ children, className }) {
|
|
2669
|
+
const [sortKey, setSortKey] = useState(null);
|
|
2670
|
+
const [sortDir, setSortDir] = useState("asc");
|
|
2671
|
+
const [page, setPage] = useState(0);
|
|
2672
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
2673
|
+
const toggleSort = useCallback(
|
|
2674
|
+
(key) => {
|
|
2675
|
+
if (sortKey === key) {
|
|
2676
|
+
setSortDir((d) => d === "asc" ? "desc" : "asc");
|
|
2677
|
+
} else {
|
|
2678
|
+
setSortKey(key);
|
|
2679
|
+
setSortDir("asc");
|
|
2680
|
+
}
|
|
2681
|
+
},
|
|
2682
|
+
[sortKey]
|
|
2683
|
+
);
|
|
2684
|
+
const ctx = useMemo(
|
|
2685
|
+
() => ({
|
|
2686
|
+
sortKey,
|
|
2687
|
+
sortDir,
|
|
2688
|
+
toggleSort,
|
|
2689
|
+
page,
|
|
2690
|
+
setPage,
|
|
2691
|
+
pageSize: 10,
|
|
2692
|
+
totalRows: 0,
|
|
2693
|
+
searchQuery,
|
|
2694
|
+
setSearchQuery
|
|
2695
|
+
}),
|
|
2696
|
+
[sortKey, sortDir, toggleSort, page, searchQuery]
|
|
2697
|
+
);
|
|
2698
|
+
return /* @__PURE__ */ jsx(TableContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx("div", { className: cn("overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-700", className), children }) });
|
|
2699
|
+
}
|
|
2700
|
+
var Table = Object.assign(TableRoot, {
|
|
2701
|
+
Head: TableHead,
|
|
2702
|
+
Body: TableBody,
|
|
2703
|
+
Row: TableRow,
|
|
2704
|
+
Cell: TableCell,
|
|
2705
|
+
Column: TableColumn,
|
|
2706
|
+
Pagination: TablePagination,
|
|
2707
|
+
Search: TableSearch,
|
|
2708
|
+
Tray: TableTray
|
|
2709
|
+
});
|
|
2710
|
+
|
|
2711
|
+
export { Action, Carousel, Checkbox, CheckboxGroup, ColorPicker, DatePicker, EMOJI_DATA, EMOJI_ENTRIES, Emoji, EmojiSelect, Field, Input, RadioGroup, Select, Slider, Switch, Table, Textarea, cn, find, resolve, search, useCarousel, useControllableState };
|
|
2712
|
+
//# sourceMappingURL=index.js.map
|
|
2713
|
+
//# sourceMappingURL=index.js.map
|