visits-style 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/index.d.ts +17 -0
- package/dist/components/Dialog/DialogHeader.d.ts +7 -0
- package/dist/components/Dialog/index.d.ts +50 -0
- package/dist/components/Popover/index.d.ts +58 -0
- package/dist/components/Portal/index.d.ts +7 -0
- package/dist/components/Sheet/index.d.ts +33 -0
- package/dist/components/Toast/ToastFloat.d.ts +11 -0
- package/dist/components/Toast/ToastItem.d.ts +2 -0
- package/dist/components/Toast/index.d.ts +3 -0
- package/dist/components/Toast/observer.d.ts +28 -0
- package/dist/components/Toast/types.d.ts +62 -0
- package/dist/components/Tooltip/index.d.ts +43 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/elements/Base.d.ts +14 -0
- package/dist/elements/Button/ButtonGroup.d.ts +2 -0
- package/dist/elements/Button/index.d.ts +9 -0
- package/dist/elements/Divider/index.d.ts +6 -0
- package/dist/elements/Progress/index.d.ts +11 -0
- package/dist/elements/Skeleton/index.d.ts +4 -0
- package/dist/elements/Spinner/index.d.ts +7 -0
- package/dist/elements/index.d.ts +7 -0
- package/dist/forms/Checkbox/index.d.ts +13 -0
- package/dist/forms/Field/FormField.d.ts +16 -0
- package/dist/forms/Field/FormLabel.d.ts +2 -0
- package/dist/forms/Field/InputField.d.ts +7 -0
- package/dist/forms/Input/index.d.ts +8 -0
- package/dist/forms/Radio/RadioGroup.d.ts +14 -0
- package/dist/forms/Radio/index.d.ts +10 -0
- package/dist/forms/Select/index.d.ts +49 -0
- package/dist/forms/Select/native.d.ts +11 -0
- package/dist/forms/Switch/index.d.ts +8 -0
- package/dist/forms/Textarea/index.d.ts +8 -0
- package/dist/forms/index.d.ts +9 -0
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +4 -476
- package/dist/index.es.js +985 -1016
- package/dist/utils/isClient.d.ts +2 -0
- package/dist/utils/merge.d.ts +4 -0
- package/dist/utils/stopPropagation.d.ts +2 -0
- package/package.json +6 -6
package/dist/index.es.js
CHANGED
|
@@ -1,1019 +1,988 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { twMerge as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { createPortal as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
},
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
we(p, { enabled: l })
|
|
591
|
-
]), { isMounted: b, styles: h } = X(p, {
|
|
592
|
-
duration: s,
|
|
593
|
-
initial: { opacity: 0, transform: "scale(0.8)" }
|
|
594
|
-
});
|
|
595
|
-
ie(c, () => ({
|
|
596
|
-
floating: v.floating,
|
|
597
|
-
reference: v.reference,
|
|
598
|
-
open: () => g(!0),
|
|
599
|
-
close: () => g(!1)
|
|
600
|
-
})), L(() => {
|
|
601
|
-
u && g(!1);
|
|
602
|
-
}, [u]);
|
|
603
|
-
const y = typeof e == "string" ? /* @__PURE__ */ i("span", { children: e }) : e;
|
|
604
|
-
return /* @__PURE__ */ N(ne, { children: [
|
|
605
|
-
W(z.only(y), {
|
|
606
|
-
ref: v.setReference,
|
|
607
|
-
...a()
|
|
608
|
-
}),
|
|
609
|
-
/* @__PURE__ */ i(H, { disabled: u || !b, children: /* @__PURE__ */ i("div", { role: "tooltip", className: "z-9999", ref: v.setFloating, ...x({ style: C }), children: /* @__PURE__ */ i(de, { className: n, style: h, children: r }) }) })
|
|
610
|
-
] });
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import { twMerge as t } from "tailwind-merge";
|
|
3
|
+
import { Children as n, cloneElement as r, createContext as i, createElement as a, forwardRef as o, startTransition as s, useCallback as c, useContext as l, useEffect as u, useImperativeHandle as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
4
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
5
|
+
import { FloatingOverlay as y, autoUpdate as b, flip as x, offset as S, shift as C, useClick as w, useClientPoint as T, useDismiss as E, useFloating as D, useHover as O, useId as k, useInteractions as A, useTransitionStyles as j } from "@floating-ui/react";
|
|
6
|
+
import { createPortal as M } from "react-dom";
|
|
7
|
+
//#region src/utils/merge.ts
|
|
8
|
+
var N = e;
|
|
9
|
+
function P(e, n) {
|
|
10
|
+
return n ? t(e, n) : e;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/elements/Base.tsx
|
|
14
|
+
function F({ as: e, classList: t = [], className: n, override: r, ...i }) {
|
|
15
|
+
let o = p(() => r ? n : P(N(t), n), [
|
|
16
|
+
t,
|
|
17
|
+
n,
|
|
18
|
+
r
|
|
19
|
+
]);
|
|
20
|
+
return a(e || "div", {
|
|
21
|
+
className: o,
|
|
22
|
+
...i
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/forms/Field/FormLabel.tsx
|
|
27
|
+
function I(e) {
|
|
28
|
+
return /* @__PURE__ */ _(F, {
|
|
29
|
+
as: "label",
|
|
30
|
+
classList: ["leading-none peer-disabled:opacity-70"],
|
|
31
|
+
...e
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/forms/Field/FormField.tsx
|
|
36
|
+
function L({ label: e, children: t, required: n, htmlFor: r, error: i, help: a, helpBefore: o, innerClass: s, ...c }) {
|
|
37
|
+
let l = p(() => N("font-medium", n ? "after:content-[\"*\"] after:text-danger after:text-sm after:pl-0.5" : ""), [n]);
|
|
38
|
+
return /* @__PURE__ */ v(F, {
|
|
39
|
+
classList: "flex flex-col space-y-2",
|
|
40
|
+
...c,
|
|
41
|
+
children: [
|
|
42
|
+
e ? /* @__PURE__ */ _(I, {
|
|
43
|
+
className: l,
|
|
44
|
+
htmlFor: r,
|
|
45
|
+
children: e
|
|
46
|
+
}) : null,
|
|
47
|
+
a && o ? /* @__PURE__ */ _("p", {
|
|
48
|
+
className: "text-xs text-muted pb-2",
|
|
49
|
+
children: a
|
|
50
|
+
}) : null,
|
|
51
|
+
/* @__PURE__ */ _("div", {
|
|
52
|
+
className: s,
|
|
53
|
+
children: R(t, !!i)
|
|
54
|
+
}),
|
|
55
|
+
a && !o && !i ? /* @__PURE__ */ _("p", {
|
|
56
|
+
className: "text-xs text-muted",
|
|
57
|
+
children: a
|
|
58
|
+
}) : null,
|
|
59
|
+
i ? /* @__PURE__ */ _("p", {
|
|
60
|
+
className: "text-xs text-danger",
|
|
61
|
+
children: i
|
|
62
|
+
}) : null
|
|
63
|
+
]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function R(e, t) {
|
|
67
|
+
let i = n.count(e);
|
|
68
|
+
if (!i) return null;
|
|
69
|
+
if (i === 1) return r(e, { error: t });
|
|
70
|
+
let a = n.toArray(e);
|
|
71
|
+
return a[0] = r(a[0], { error: t }), a;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/forms/Field/InputField.tsx
|
|
75
|
+
function z({ error: e, ...t }) {
|
|
76
|
+
return /* @__PURE__ */ _(F, {
|
|
77
|
+
as: "fieldset",
|
|
78
|
+
classList: [
|
|
79
|
+
"flex rounded-md border bg-background px-3 py-2 w-full [&_input]:placeholder:text-muted",
|
|
80
|
+
"[&_input]:disabled:opacity-50 [&_input]:focus-visible:outline-none",
|
|
81
|
+
e ? "border-danger hover:border-danger-fore" : "border-input"
|
|
82
|
+
],
|
|
83
|
+
...t
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/forms/Input/index.tsx
|
|
88
|
+
function B({ type: e, error: t, ...n }) {
|
|
89
|
+
return /* @__PURE__ */ _(F, {
|
|
90
|
+
as: "input",
|
|
91
|
+
type: e,
|
|
92
|
+
classList: [
|
|
93
|
+
"flex rounded-md border bg-background px-3 py-2 w-full placeholder:text-muted",
|
|
94
|
+
"disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2",
|
|
95
|
+
t ? "border-danger hover:border-danger-fore focus-visible:ring-danger" : "border-input not-disabled:hover:border-input-fore focus-visible:ring-ring",
|
|
96
|
+
e === "file" ? "file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground" : null
|
|
97
|
+
],
|
|
98
|
+
...n
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/forms/Textarea/index.tsx
|
|
103
|
+
function V({ error: e, ...t }) {
|
|
104
|
+
return /* @__PURE__ */ _(F, {
|
|
105
|
+
as: "textarea",
|
|
106
|
+
classList: [
|
|
107
|
+
"flex rounded-md border bg-background px-3 py-2 w-full",
|
|
108
|
+
"disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
|
|
109
|
+
e ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore"
|
|
110
|
+
],
|
|
111
|
+
...t
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/forms/Checkbox/index.tsx
|
|
116
|
+
function ee() {
|
|
117
|
+
return /* @__PURE__ */ _("svg", {
|
|
118
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
119
|
+
width: "30",
|
|
120
|
+
height: "30",
|
|
121
|
+
viewBox: "0 0 30 30",
|
|
122
|
+
children: /* @__PURE__ */ _("rect", {
|
|
123
|
+
width: "20",
|
|
124
|
+
height: "3",
|
|
125
|
+
y: "13.5",
|
|
126
|
+
x: "4.5",
|
|
127
|
+
fill: "currentColor",
|
|
128
|
+
stroke: "none",
|
|
129
|
+
rx: "2"
|
|
130
|
+
})
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function H({ checked: e, indeterminate: t, id: n, name: r, onChange: i, value: a, checkIcon: o, error: s, ...c }) {
|
|
134
|
+
let l = () => {
|
|
135
|
+
c.disabled || i?.(!e);
|
|
136
|
+
};
|
|
137
|
+
return /* @__PURE__ */ v(F, {
|
|
138
|
+
as: "button",
|
|
139
|
+
type: "button",
|
|
140
|
+
role: "checkbox",
|
|
141
|
+
id: n || r,
|
|
142
|
+
classList: [
|
|
143
|
+
"inline-flex justify-center items-center border w-4.5 h-4.5 rounded",
|
|
144
|
+
"cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
|
|
145
|
+
{
|
|
146
|
+
"border-danger hover:border-danger-fore": s,
|
|
147
|
+
"bg-primary text-inverted disabled:text-text disabled:bg-input disabled:border-input": !s && e,
|
|
148
|
+
"border-input not-disabled:hover:border-input-fore": !s && !e
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
onClick: l,
|
|
152
|
+
"aria-checked": e,
|
|
153
|
+
...c,
|
|
154
|
+
children: [
|
|
155
|
+
e ? o : null,
|
|
156
|
+
t && !e ? /* @__PURE__ */ _(ee, {}) : null,
|
|
157
|
+
/* @__PURE__ */ _("input", {
|
|
158
|
+
type: "checkbox",
|
|
159
|
+
"aria-hidden": "true",
|
|
160
|
+
name: r,
|
|
161
|
+
checked: e,
|
|
162
|
+
value: a,
|
|
163
|
+
onChange: l,
|
|
164
|
+
disabled: c.disabled,
|
|
165
|
+
style: {
|
|
166
|
+
position: "absolute",
|
|
167
|
+
pointerEvents: "none",
|
|
168
|
+
top: 0,
|
|
169
|
+
left: 0,
|
|
170
|
+
width: 1,
|
|
171
|
+
height: 1,
|
|
172
|
+
opacity: 0
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
]
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/hooks/useIsomorphicLayoutEffect.ts
|
|
180
|
+
var U = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? f : u;
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/components/Portal/index.tsx
|
|
183
|
+
function W({ children: e, container: t, disabled: n }) {
|
|
184
|
+
let [r, i] = h(null);
|
|
185
|
+
return U(() => {
|
|
186
|
+
if (!t) {
|
|
187
|
+
let e = document.getElementById("visits-style-portals");
|
|
188
|
+
return e || (e = document.createElement("div"), e.id = "visits-style-portals", document.body.appendChild(e)), i(e);
|
|
189
|
+
}
|
|
190
|
+
i(t);
|
|
191
|
+
}, [t]), n || !r ? null : M(e, r);
|
|
192
|
+
}
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/utils/stopPropagation.ts
|
|
195
|
+
function G(e) {
|
|
196
|
+
e && (e.stopPropagation(), e.preventDefault());
|
|
197
|
+
}
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/components/Popover/index.tsx
|
|
200
|
+
var te = {
|
|
201
|
+
open: 150,
|
|
202
|
+
close: 75
|
|
203
|
+
};
|
|
204
|
+
function K({ ref: e, position: t, label: i, children: a, disabled: o, offset: s = {
|
|
205
|
+
x: 0,
|
|
206
|
+
y: 6
|
|
207
|
+
}, onOpen: l, onClose: f, onManualClose: p, timeout: T = te, override: E, zIndex: O = 9996, role: M, ...N }) {
|
|
208
|
+
let [P, F] = h(!1), I = k(), L = m(l), R = m(f), { refs: z, floatingStyles: B, context: V } = D({
|
|
209
|
+
nodeId: I,
|
|
210
|
+
placement: t,
|
|
211
|
+
middleware: [
|
|
212
|
+
C(),
|
|
213
|
+
x({ fallbackAxisSideDirection: "end" }),
|
|
214
|
+
S({
|
|
215
|
+
mainAxis: s.y,
|
|
216
|
+
crossAxis: s.x
|
|
217
|
+
})
|
|
218
|
+
],
|
|
219
|
+
open: P,
|
|
220
|
+
onOpenChange: (e) => {
|
|
221
|
+
e ? L.current?.(z.reference.current, z.floating.current) : R.current?.(z.reference.current, z.floating.current), F(e);
|
|
222
|
+
},
|
|
223
|
+
whileElementsMounted: b
|
|
224
|
+
}), { isMounted: ee, styles: H } = j(V, {
|
|
225
|
+
duration: T,
|
|
226
|
+
initial({ side: e }) {
|
|
227
|
+
let t = "";
|
|
228
|
+
return t = e === "top" ? "translateY(5%) scale(0.95)" : e === "bottom" ? "translateY(-5%) scale(0.95)" : e === "left" ? "translateX(5%) scale(0.95)" : "translateX(-5%) scale(0.95)", {
|
|
229
|
+
opacity: 0,
|
|
230
|
+
transform: t
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
}), U = c((e) => {
|
|
234
|
+
if (G(e), p) return p();
|
|
235
|
+
F(!1), R.current?.(z.reference.current, z.floating.current);
|
|
236
|
+
}, [p]);
|
|
237
|
+
u(() => {
|
|
238
|
+
if (o && P) return F(!1);
|
|
239
|
+
}, [o, P]), d(e, () => ({
|
|
240
|
+
open: () => {
|
|
241
|
+
F(!0), L.current?.(z.reference.current, z.floating.current);
|
|
242
|
+
},
|
|
243
|
+
close: () => {
|
|
244
|
+
F(!1), R.current?.(z.reference.current, z.floating.current);
|
|
245
|
+
}
|
|
246
|
+
}), []);
|
|
247
|
+
let { getFloatingProps: K, getReferenceProps: q } = A([w(V, { enabled: !o })]);
|
|
248
|
+
return L.current = l, R.current = f, /* @__PURE__ */ v(g, { children: [r(n.only(i), q({
|
|
249
|
+
ref: z.setReference,
|
|
250
|
+
tabIndex: 0,
|
|
251
|
+
role: "button",
|
|
252
|
+
"aria-expanded": P,
|
|
253
|
+
disabled: o,
|
|
254
|
+
onClick: G
|
|
255
|
+
})), /* @__PURE__ */ _(W, {
|
|
256
|
+
disabled: o || !ee,
|
|
257
|
+
children: /* @__PURE__ */ _(y, {
|
|
258
|
+
"data-testid": "vs-popover-shadow",
|
|
259
|
+
onClick: U,
|
|
260
|
+
style: { zIndex: O },
|
|
261
|
+
autoFocus: !0,
|
|
262
|
+
children: /* @__PURE__ */ _("div", {
|
|
263
|
+
role: M || "region",
|
|
264
|
+
ref: z.setFloating,
|
|
265
|
+
style: B,
|
|
266
|
+
children: /* @__PURE__ */ _(ne, {
|
|
267
|
+
override: E,
|
|
268
|
+
styles: H,
|
|
269
|
+
...K({
|
|
270
|
+
...N,
|
|
271
|
+
onClick: G
|
|
272
|
+
}),
|
|
273
|
+
children: a
|
|
274
|
+
})
|
|
275
|
+
})
|
|
276
|
+
})
|
|
277
|
+
})] });
|
|
278
|
+
}
|
|
279
|
+
function ne({ override: e, styles: t, style: n = {}, ...r }) {
|
|
280
|
+
return /* @__PURE__ */ _(F, {
|
|
281
|
+
classList: ["z-20 w-auto h-auto outline-none transition-transform ease-in-out", e ? null : "border border-accent rounded-md shadow-lg p-1 bg-background"],
|
|
282
|
+
style: {
|
|
283
|
+
...t,
|
|
284
|
+
...n
|
|
285
|
+
},
|
|
286
|
+
...r
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region src/forms/Select/index.tsx
|
|
291
|
+
function q({ className: e, placeholder: t = "", options: n = [], error: r, disabled: i, value: a, maxHeight: o = 408, arrowIcon: s, closeIcon: l, checkIcon: u, onChange: d, onClear: f, renderItem: g, sectionLabelStyle: y, buttonAreaStyle: b, clearLabelText: x, optionStyle: S, ...C }) {
|
|
292
|
+
let w = m(null), [T, E] = h(0), D = p(() => Array.isArray(a), []), O = c((e) => {
|
|
293
|
+
d?.(e), D || w.current?.close();
|
|
294
|
+
}, [d, D]), k = c((e) => Array.isArray(a) ? a.indexOf(e) > -1 : a === e, [a]), A = p(() => {
|
|
295
|
+
let e = {}, t = n.filter((e) => typeof e != "string");
|
|
296
|
+
for (let n = 0, r = t.length; n < r; n += 1) {
|
|
297
|
+
let r = t[n];
|
|
298
|
+
e[`${r.value}`] = r.label;
|
|
299
|
+
}
|
|
300
|
+
return e;
|
|
301
|
+
}, [n]), j = p(() => {
|
|
302
|
+
if (!a) return t;
|
|
303
|
+
if (Array.isArray(a)) {
|
|
304
|
+
if (!a.length) return t;
|
|
305
|
+
let e = [...a].sort(), n = [];
|
|
306
|
+
for (let t = 0, r = e.length; t < r; t += 1) n[t] = A[`${e[t]}`] || "";
|
|
307
|
+
return n.filter(Boolean).join(",") || t;
|
|
308
|
+
}
|
|
309
|
+
return A[`${a}`] || t;
|
|
310
|
+
}, [
|
|
311
|
+
t,
|
|
312
|
+
a,
|
|
313
|
+
A
|
|
314
|
+
]), M = p(() => a == null ? !0 : Array.isArray(a) ? !a.length : !1, [a]), N = c((e, t) => g ? typeof e == "string" ? g(e, {
|
|
315
|
+
index: t,
|
|
316
|
+
selected: !1,
|
|
317
|
+
onChange: () => {}
|
|
318
|
+
}) : g(e, {
|
|
319
|
+
index: t,
|
|
320
|
+
selected: k(e.value),
|
|
321
|
+
onChange: () => O(e.value)
|
|
322
|
+
}) : typeof e == "string" ? /* @__PURE__ */ _(F, {
|
|
323
|
+
as: "h5",
|
|
324
|
+
classList: ["font-normal py-1 px-2 text-muted"],
|
|
325
|
+
className: y,
|
|
326
|
+
children: e
|
|
327
|
+
}, `optionheader-${t}`) : /* @__PURE__ */ _(re, {
|
|
328
|
+
selected: k(e.value),
|
|
329
|
+
onChange: O,
|
|
330
|
+
checkIcon: u,
|
|
331
|
+
className: S,
|
|
332
|
+
...e
|
|
333
|
+
}, e.label), [
|
|
334
|
+
g,
|
|
335
|
+
O,
|
|
336
|
+
k,
|
|
337
|
+
y,
|
|
338
|
+
S,
|
|
339
|
+
u
|
|
340
|
+
]);
|
|
341
|
+
return /* @__PURE__ */ _(K, {
|
|
342
|
+
label: /* @__PURE__ */ v(F, {
|
|
343
|
+
as: "button",
|
|
344
|
+
type: "button",
|
|
345
|
+
classList: [
|
|
346
|
+
"flex items-center justify-between rounded-md border bg-background px-3 py-2 w-full overflow-hidden cursor-pointer",
|
|
347
|
+
"disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
|
|
348
|
+
r ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore"
|
|
349
|
+
],
|
|
350
|
+
className: e,
|
|
351
|
+
disabled: i,
|
|
352
|
+
...C,
|
|
353
|
+
children: [/* @__PURE__ */ _(F, {
|
|
354
|
+
as: "span",
|
|
355
|
+
classList: ["overflow-hidden text-ellipsis whitespace-nowrap", M ? "text-muted" : "text-text"],
|
|
356
|
+
children: j
|
|
357
|
+
}), /* @__PURE__ */ v(F, {
|
|
358
|
+
classList: "relative flex items-center space-x-2",
|
|
359
|
+
className: b,
|
|
360
|
+
children: [f && !M ? /* @__PURE__ */ _("div", {
|
|
361
|
+
tabIndex: -1,
|
|
362
|
+
role: "button",
|
|
363
|
+
className: "size-6 p-1.5 rounded hover:bg-accent cursor-pointer",
|
|
364
|
+
"aria-label": x,
|
|
365
|
+
onKeyDown: (e) => {
|
|
366
|
+
(e.key === "Enter" || e.key === "Space") && f();
|
|
367
|
+
},
|
|
368
|
+
onClick: (e) => {
|
|
369
|
+
e.stopPropagation(), f();
|
|
370
|
+
},
|
|
371
|
+
children: l
|
|
372
|
+
}) : null, s]
|
|
373
|
+
})]
|
|
374
|
+
}),
|
|
375
|
+
ref: w,
|
|
376
|
+
onOpen: (e) => E(e?.getBoundingClientRect().width || 0),
|
|
377
|
+
disabled: i,
|
|
378
|
+
children: /* @__PURE__ */ _("ul", {
|
|
379
|
+
className: "overflow-y-auto flex flex-col",
|
|
380
|
+
role: "listbox",
|
|
381
|
+
style: {
|
|
382
|
+
minWidth: T,
|
|
383
|
+
maxWidth: "calc(100vw - 3rem)",
|
|
384
|
+
maxHeight: o
|
|
385
|
+
},
|
|
386
|
+
children: n.map(N)
|
|
387
|
+
})
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
function re({ className: e, value: t, label: n, selected: r, checkIcon: i, onChange: a }) {
|
|
391
|
+
return /* @__PURE__ */ v(F, {
|
|
392
|
+
as: "button",
|
|
393
|
+
type: "button",
|
|
394
|
+
role: "option",
|
|
395
|
+
classList: "flex items-center w-full hover:bg-accent rounded p-1 cursor-pointer",
|
|
396
|
+
className: e,
|
|
397
|
+
"aria-selected": r,
|
|
398
|
+
onClick: () => a?.(t),
|
|
399
|
+
children: [r && i ? i : /* @__PURE__ */ _("div", { className: "w-5 h-1 mr-1" }), n]
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region src/forms/Radio/index.tsx
|
|
404
|
+
function ie({ checked: e, className: t, id: n, name: r, onChange: i, value: a, error: o, ...s }) {
|
|
405
|
+
let c = () => {
|
|
406
|
+
s.disabled || i?.(!e);
|
|
407
|
+
};
|
|
408
|
+
return /* @__PURE__ */ v(F, {
|
|
409
|
+
as: "button",
|
|
410
|
+
type: "button",
|
|
411
|
+
role: "radio",
|
|
412
|
+
id: n || r,
|
|
413
|
+
classList: [
|
|
414
|
+
"relative inline-flex justify-center items-center border w-4.5 h-4.5 rounded-full",
|
|
415
|
+
"cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed not-disabled:hover:border-input-fore",
|
|
416
|
+
o ? "border-danger" : "border-input",
|
|
417
|
+
e ? "[&_i]:bg-primary disabled:[&_i]:bg-text disabled:border-input" : ""
|
|
418
|
+
],
|
|
419
|
+
className: t,
|
|
420
|
+
onClick: c,
|
|
421
|
+
"aria-checked": e,
|
|
422
|
+
...s,
|
|
423
|
+
children: [/* @__PURE__ */ _("i", {
|
|
424
|
+
className: "block w-2.5 h-2.5 rounded-full transition-transform",
|
|
425
|
+
style: {
|
|
426
|
+
transform: e ? "" : "scale(0.8)",
|
|
427
|
+
opacity: +!!e
|
|
428
|
+
}
|
|
429
|
+
}), /* @__PURE__ */ _("input", {
|
|
430
|
+
type: "radio",
|
|
431
|
+
"aria-hidden": "true",
|
|
432
|
+
name: r,
|
|
433
|
+
checked: e,
|
|
434
|
+
value: a,
|
|
435
|
+
onChange: c,
|
|
436
|
+
disabled: s.disabled,
|
|
437
|
+
style: {
|
|
438
|
+
position: "absolute",
|
|
439
|
+
pointerEvents: "none",
|
|
440
|
+
top: 0,
|
|
441
|
+
left: 0,
|
|
442
|
+
width: 1,
|
|
443
|
+
height: 1,
|
|
444
|
+
opacity: 0
|
|
445
|
+
}
|
|
446
|
+
})]
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region src/forms/Switch/index.tsx
|
|
451
|
+
function ae({ checked: e, onChange: t, value: n, id: r, name: i, error: a, ref: o, ...s }) {
|
|
452
|
+
let c = () => {
|
|
453
|
+
s.disabled || t?.(!e);
|
|
454
|
+
};
|
|
455
|
+
return /* @__PURE__ */ v(F, {
|
|
456
|
+
as: "button",
|
|
457
|
+
type: "button",
|
|
458
|
+
role: "switch",
|
|
459
|
+
id: r || i,
|
|
460
|
+
classList: [
|
|
461
|
+
"inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
|
|
462
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",
|
|
463
|
+
"w-11",
|
|
464
|
+
e ? "bg-primary disabled:bg-text" : "bg-input"
|
|
465
|
+
],
|
|
466
|
+
onClick: c,
|
|
467
|
+
"aria-checked": e,
|
|
468
|
+
"aria-invalid": a,
|
|
469
|
+
...s,
|
|
470
|
+
children: [/* @__PURE__ */ _("span", {
|
|
471
|
+
className: "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
472
|
+
style: { transform: e ? "translateX(100%)" : "" }
|
|
473
|
+
}), /* @__PURE__ */ _("input", {
|
|
474
|
+
ref: o,
|
|
475
|
+
type: "checkbox",
|
|
476
|
+
"aria-hidden": "true",
|
|
477
|
+
name: i,
|
|
478
|
+
checked: e,
|
|
479
|
+
value: n,
|
|
480
|
+
onChange: c,
|
|
481
|
+
disabled: s.disabled,
|
|
482
|
+
style: {
|
|
483
|
+
position: "absolute",
|
|
484
|
+
pointerEvents: "none",
|
|
485
|
+
top: 0,
|
|
486
|
+
left: 0,
|
|
487
|
+
width: 1,
|
|
488
|
+
height: 1,
|
|
489
|
+
opacity: 0
|
|
490
|
+
}
|
|
491
|
+
})]
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/components/Accordion/index.tsx
|
|
496
|
+
function oe({ header: e, show: t, children: n, timeout: r = 300, ...i }) {
|
|
497
|
+
let a = m(null), o = m(0), s = m(0), c = m(!0);
|
|
498
|
+
return u(() => {
|
|
499
|
+
s.current = r;
|
|
500
|
+
}, [r]), U(() => {
|
|
501
|
+
if (!a.current) return;
|
|
502
|
+
if (a.current.style.overflow = "hidden", a.current.style.opacity = "1", c.current) {
|
|
503
|
+
c.current = !1, a.current.style.height = t ? "auto" : "0px", t ? window.requestAnimationFrame(() => {
|
|
504
|
+
a.current && (o.current = a.current.offsetHeight);
|
|
505
|
+
}) : (window.requestAnimationFrame(() => {
|
|
506
|
+
a.current && (a.current.style.height = "auto", o.current = a.current.offsetHeight, a.current.style.height = "0px");
|
|
507
|
+
}), a.current.style.opacity = "0");
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
t || (a.current.style.height = `${o.current}px`);
|
|
511
|
+
let e = [];
|
|
512
|
+
e[0] = window.requestAnimationFrame(() => {
|
|
513
|
+
e[1] = window.requestAnimationFrame(() => {
|
|
514
|
+
a.current && (a.current.style.height = `${t ? o.current : 0}px`, a.current.style.opacity = t ? "1" : "0");
|
|
515
|
+
});
|
|
516
|
+
});
|
|
517
|
+
let n, r = () => {
|
|
518
|
+
a.current && (t ? (a.current.style.height = "auto", a.current.style.overflow = "", a.current.style.opacity = "", window.requestAnimationFrame(() => {
|
|
519
|
+
a.current && (o.current = a.current.offsetHeight);
|
|
520
|
+
})) : a.current.style.height = "0px");
|
|
521
|
+
};
|
|
522
|
+
return s.current === 0 ? r() : n = window.setTimeout(r, s.current), () => {
|
|
523
|
+
e.forEach(window.cancelAnimationFrame), n && window.clearTimeout(n);
|
|
524
|
+
};
|
|
525
|
+
}, [t]), /* @__PURE__ */ v("div", {
|
|
526
|
+
...i,
|
|
527
|
+
children: [e, /* @__PURE__ */ _("div", {
|
|
528
|
+
className: "transition-all ease-in-out overflow-hidden",
|
|
529
|
+
role: "region",
|
|
530
|
+
"aria-hidden": !t,
|
|
531
|
+
ref: a,
|
|
532
|
+
style: { transitionDuration: `${r}ms` },
|
|
533
|
+
children: n
|
|
534
|
+
})]
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
//#endregion
|
|
538
|
+
//#region src/components/Tooltip/index.tsx
|
|
539
|
+
var J = o(({ children: e, position: t = "bottom", label: i, className: a, timeout: o = 150, offset: s = {
|
|
540
|
+
x: 0,
|
|
541
|
+
y: 6
|
|
542
|
+
}, clientPoint: c = !1, disabled: l }, f) => {
|
|
543
|
+
let [p, m] = h(!1), y = k(), { refs: w, floatingStyles: E, context: M } = D({
|
|
544
|
+
nodeId: y,
|
|
545
|
+
open: p,
|
|
546
|
+
placement: t,
|
|
547
|
+
middleware: [
|
|
548
|
+
C(),
|
|
549
|
+
x(),
|
|
550
|
+
S({
|
|
551
|
+
mainAxis: s.y,
|
|
552
|
+
crossAxis: s.x
|
|
553
|
+
})
|
|
554
|
+
],
|
|
555
|
+
whileElementsMounted: l ? void 0 : b,
|
|
556
|
+
onOpenChange: m
|
|
557
|
+
}), { getReferenceProps: N, getFloatingProps: P } = A([O(M, { enabled: !l }), T(M, { enabled: c })]), { isMounted: F, styles: I } = j(M, {
|
|
558
|
+
duration: o,
|
|
559
|
+
initial: {
|
|
560
|
+
opacity: 0,
|
|
561
|
+
transform: "scale(0.8)"
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
d(f, () => ({
|
|
565
|
+
floating: w.floating,
|
|
566
|
+
reference: w.reference,
|
|
567
|
+
open: () => m(!0),
|
|
568
|
+
close: () => m(!1)
|
|
569
|
+
})), u(() => {
|
|
570
|
+
l && m(!1);
|
|
571
|
+
}, [l]);
|
|
572
|
+
let L = typeof e == "string" ? /* @__PURE__ */ _("span", { children: e }) : e;
|
|
573
|
+
return /* @__PURE__ */ v(g, { children: [r(n.only(L), {
|
|
574
|
+
ref: w.setReference,
|
|
575
|
+
...N()
|
|
576
|
+
}), /* @__PURE__ */ _(W, {
|
|
577
|
+
disabled: l || !F,
|
|
578
|
+
children: /* @__PURE__ */ _("div", {
|
|
579
|
+
role: "tooltip",
|
|
580
|
+
className: "z-9999",
|
|
581
|
+
ref: w.setFloating,
|
|
582
|
+
...P({ style: E }),
|
|
583
|
+
children: /* @__PURE__ */ _(Y, {
|
|
584
|
+
className: a,
|
|
585
|
+
style: I,
|
|
586
|
+
children: i
|
|
587
|
+
})
|
|
588
|
+
})
|
|
589
|
+
})] });
|
|
611
590
|
});
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
t ? null : "border border-accent rounded shadow-md px-3 py-1 bg-background"
|
|
621
|
-
), e), [e, t]);
|
|
622
|
-
return /* @__PURE__ */ i("div", { ref: n, className: s, ...r });
|
|
591
|
+
J.displayName = "Tooltip";
|
|
592
|
+
var Y = o(({ className: e, custom: t, ...n }, r) => {
|
|
593
|
+
let i = p(() => P(N("relative w-auto h-auto outline-none transition-transform ease-in-out whitespace-pre", t ? null : "border border-accent rounded shadow-md px-3 py-1 bg-background"), e), [e, t]);
|
|
594
|
+
return /* @__PURE__ */ _("div", {
|
|
595
|
+
ref: r,
|
|
596
|
+
className: i,
|
|
597
|
+
...n
|
|
598
|
+
});
|
|
623
599
|
});
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
e === "loading" ? /* @__PURE__ */ i($e, { size: 20 }) : null
|
|
806
|
-
] }) : null,
|
|
807
|
-
/* @__PURE__ */ N("div", { className: "space-y-2", children: [
|
|
808
|
-
/* @__PURE__ */ i("p", { className: "font-medium leading-none", children: t }),
|
|
809
|
-
r ? /* @__PURE__ */ i("p", { children: r }) : null
|
|
810
|
-
] })
|
|
811
|
-
] });
|
|
812
|
-
}
|
|
813
|
-
function te() {
|
|
814
|
-
}
|
|
815
|
-
class Oe {
|
|
816
|
-
/** システムで1つしか存在しない前提とする */
|
|
817
|
-
notify = te;
|
|
818
|
-
lastId = 0;
|
|
819
|
-
/** internal use only */
|
|
820
|
-
subscribe = (t) => (this.notify = t, () => {
|
|
821
|
-
this.notify = te;
|
|
822
|
-
});
|
|
823
|
-
add = (t, r = {}) => {
|
|
824
|
-
this.lastId += 1;
|
|
825
|
-
const n = `${this.lastId}`;
|
|
826
|
-
return this.notify({ id: n, type: "add", config: { id: n, label: t, ...r } }), n;
|
|
827
|
-
};
|
|
828
|
-
/** 表示中のtoastを修正します。promiseのロード状態を表示することなどに使います */
|
|
829
|
-
update = (t, r) => {
|
|
830
|
-
this.notify({ id: t, type: "update", config: r });
|
|
831
|
-
};
|
|
832
|
-
remove = (t) => {
|
|
833
|
-
this.notify({ id: t, type: "remove" });
|
|
834
|
-
};
|
|
835
|
-
clear = () => {
|
|
836
|
-
this.lastId = 0;
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
const fe = new Oe();
|
|
840
|
-
function _e({
|
|
841
|
-
id: e,
|
|
842
|
-
type: t,
|
|
843
|
-
index: r,
|
|
844
|
-
duration: n = 5e3,
|
|
845
|
-
className: s,
|
|
846
|
-
children: o,
|
|
847
|
-
inverted: l,
|
|
848
|
-
timeout: u = 250,
|
|
849
|
-
max: c = 3
|
|
850
|
-
}) {
|
|
851
|
-
const d = F(!1), [g, m] = E(!1), { context: v, refs: C } = _({ open: g, onOpenChange: m, nodeId: e }), { isMounted: p, styles: a } = X(v, {
|
|
852
|
-
duration: u,
|
|
853
|
-
initial: { opacity: 0, transform: `translateY(${l ? "" : "-"}50%)` }
|
|
854
|
-
});
|
|
855
|
-
oe(() => {
|
|
856
|
-
m(r <= c);
|
|
857
|
-
}, [r, c]), L(() => {
|
|
858
|
-
d.current !== p && (p || fe.remove(e), d.current = p);
|
|
859
|
-
}, [p, e]), L(() => {
|
|
860
|
-
if (!n) return;
|
|
861
|
-
const h = window.setTimeout(() => m(!1), n);
|
|
862
|
-
return () => window.clearTimeout(h);
|
|
863
|
-
}, [n, e]);
|
|
864
|
-
const x = B(() => {
|
|
865
|
-
t !== "loading" && m(!1);
|
|
866
|
-
}, [t]), b = k(() => U(
|
|
867
|
-
"relative flex w-fit transition-transform ease-in-out cursor-pointer",
|
|
868
|
-
s
|
|
869
|
-
), [s]);
|
|
870
|
-
return p ? /* @__PURE__ */ i(
|
|
871
|
-
"li",
|
|
872
|
-
{
|
|
873
|
-
role: "log",
|
|
874
|
-
tabIndex: -1,
|
|
875
|
-
ref: C.setFloating,
|
|
876
|
-
className: b,
|
|
877
|
-
style: a,
|
|
878
|
-
onClick: x,
|
|
879
|
-
children: o
|
|
880
|
-
}
|
|
881
|
-
) : null;
|
|
882
|
-
}
|
|
883
|
-
const pe = me({});
|
|
884
|
-
function Xe() {
|
|
885
|
-
return he(pe);
|
|
886
|
-
}
|
|
887
|
-
function st({
|
|
888
|
-
className: e,
|
|
889
|
-
margin: t = 16,
|
|
890
|
-
position: r = "top-left",
|
|
891
|
-
max: n,
|
|
892
|
-
ListItem: s = je,
|
|
893
|
-
icons: o
|
|
894
|
-
}) {
|
|
895
|
-
const l = k(() => {
|
|
896
|
-
const a = { position: "fixed" };
|
|
897
|
-
return r.indexOf("top") > -1 ? a.top = t : r.indexOf("bottom") > -1 && (a.bottom = t), r.indexOf("left") > -1 ? (a.left = t, a.alignItems = "flex-start") : r.indexOf("right") > -1 ? (a.right = t, a.alignItems = "flex-end") : (a.left = "50%", a.alignItems = "center", a.transform = "translateX(-50%)"), a;
|
|
898
|
-
}, [t, r]), u = k(() => U(
|
|
899
|
-
"flex flex-col z-40 overflow-hidden",
|
|
900
|
-
e
|
|
901
|
-
), [e]), c = k(() => r?.startsWith("bottom") || !1, [r]), d = F(/* @__PURE__ */ new Map()), [g, m] = E([]), v = E(0)[1];
|
|
902
|
-
V(() => fe.subscribe((a) => {
|
|
903
|
-
ge(() => {
|
|
904
|
-
if (a.type === "add")
|
|
905
|
-
d.current.set(a.id, a.config), m((x) => [...x, a.id]);
|
|
906
|
-
else if (a.type === "remove") {
|
|
907
|
-
if (!d.current.delete(a.id)) return;
|
|
908
|
-
m((b) => {
|
|
909
|
-
const h = new Set(b);
|
|
910
|
-
return h.has(a.id) ? (h.delete(a.id), Array.from(h)) : b;
|
|
911
|
-
});
|
|
912
|
-
} else if (a.type === "update") {
|
|
913
|
-
const x = d.current.get(a.id);
|
|
914
|
-
if (!x) return;
|
|
915
|
-
d.current.set(a.id, { ...x, ...a.config }), v((b) => b + 1);
|
|
916
|
-
}
|
|
917
|
-
});
|
|
918
|
-
}), []);
|
|
919
|
-
const C = k(() => ({ icons: o }), [o]), p = g.length;
|
|
920
|
-
return /* @__PURE__ */ i(H, { children: /* @__PURE__ */ i("ol", { className: u, style: l, "aria-live": "polite", children: /* @__PURE__ */ i(pe.Provider, { value: C, children: g.map((a, x) => {
|
|
921
|
-
const b = d.current.get(a);
|
|
922
|
-
if (!b) return null;
|
|
923
|
-
const { className: h, duration: y, ...R } = b;
|
|
924
|
-
return /* @__PURE__ */ i(
|
|
925
|
-
_e,
|
|
926
|
-
{
|
|
927
|
-
id: a,
|
|
928
|
-
index: p - x,
|
|
929
|
-
className: h,
|
|
930
|
-
duration: y,
|
|
931
|
-
inverted: c,
|
|
932
|
-
max: n,
|
|
933
|
-
children: re(s, R)
|
|
934
|
-
},
|
|
935
|
-
a
|
|
936
|
-
);
|
|
937
|
-
}) }) }) });
|
|
938
|
-
}
|
|
939
|
-
function lt(e) {
|
|
940
|
-
return /* @__PURE__ */ i(w, { classList: "inline-block animate-pulse rounded-md bg-accent", ...e });
|
|
941
|
-
}
|
|
942
|
-
function at(e) {
|
|
943
|
-
return /* @__PURE__ */ i(
|
|
944
|
-
w,
|
|
945
|
-
{
|
|
946
|
-
role: "group",
|
|
947
|
-
classList: [
|
|
948
|
-
"flex items-center justify-center",
|
|
949
|
-
"[&_button]:rounded-none **:first:rounded-bl **:first:rounded-tl **:last:rounded-br **:last:rounded-tr",
|
|
950
|
-
"**:first:border-r-0 **:last:border-l-0"
|
|
951
|
-
],
|
|
952
|
-
...e
|
|
953
|
-
}
|
|
954
|
-
);
|
|
955
|
-
}
|
|
956
|
-
function ut({ value: e, max: t, ...r }) {
|
|
957
|
-
const n = k(() => e ? Math.min(100, Math.round(e / t * 100)) : 0, [e, t]);
|
|
958
|
-
return /* @__PURE__ */ i(
|
|
959
|
-
w,
|
|
960
|
-
{
|
|
961
|
-
role: "progressbar",
|
|
962
|
-
classList: "relative overflow-hidden rounded-full bg-primary",
|
|
963
|
-
"aria-valuemax": t,
|
|
964
|
-
"aria-valuemin": 0,
|
|
965
|
-
...r,
|
|
966
|
-
children: /* @__PURE__ */ i(
|
|
967
|
-
w,
|
|
968
|
-
{
|
|
969
|
-
className: "h-full w-full flex-1 bg-input transition-all origin-right",
|
|
970
|
-
style: { transform: `translateX(${n}%)` }
|
|
971
|
-
}
|
|
972
|
-
)
|
|
973
|
-
}
|
|
974
|
-
);
|
|
975
|
-
}
|
|
976
|
-
function ct({ orientation: e = "horizontal", ...t }) {
|
|
977
|
-
return /* @__PURE__ */ i(
|
|
978
|
-
w,
|
|
979
|
-
{
|
|
980
|
-
as: "hr",
|
|
981
|
-
role: "none",
|
|
982
|
-
classList: [
|
|
983
|
-
"border-0 p-0 shrink-0 bg-input",
|
|
984
|
-
e === "horizontal" ? "h-px w-full" : "w-px h-full"
|
|
985
|
-
],
|
|
986
|
-
...t
|
|
987
|
-
}
|
|
988
|
-
);
|
|
989
|
-
}
|
|
990
|
-
export {
|
|
991
|
-
nt as Accordion,
|
|
992
|
-
w as Base,
|
|
993
|
-
rt as Button,
|
|
994
|
-
at as ButtonGroup,
|
|
995
|
-
Qe as Checkbox,
|
|
996
|
-
ot as Dialog,
|
|
997
|
-
ct as Divider,
|
|
998
|
-
Ke as FormField,
|
|
999
|
-
ke as FormLabel,
|
|
1000
|
-
Ue as Input,
|
|
1001
|
-
Ge as InputField,
|
|
1002
|
-
Te as Popover,
|
|
1003
|
-
H as Portal,
|
|
1004
|
-
ut as Progress,
|
|
1005
|
-
et as Radio,
|
|
1006
|
-
Ve as Select,
|
|
1007
|
-
it as Sheet,
|
|
1008
|
-
lt as Skeleton,
|
|
1009
|
-
$e as Spinner,
|
|
1010
|
-
tt as Switch,
|
|
1011
|
-
Je as Textarea,
|
|
1012
|
-
st as Toast,
|
|
1013
|
-
je as ToastItem,
|
|
1014
|
-
Re as Tooltip,
|
|
1015
|
-
M as cn,
|
|
1016
|
-
O as merge,
|
|
1017
|
-
fe as toast,
|
|
1018
|
-
Pe as varientButton
|
|
600
|
+
Y.displayName = "TooltipContent";
|
|
601
|
+
//#endregion
|
|
602
|
+
//#region src/elements/Button/index.tsx
|
|
603
|
+
function X({ variant: e, size: t }) {
|
|
604
|
+
return N("inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-auto", {
|
|
605
|
+
"bg-primary text-inverted hover:bg-primary-fore": !e || e === "primary",
|
|
606
|
+
"bg-info text-inverted hover:bg-info-fore": e === "info",
|
|
607
|
+
"bg-warn text-inverted hover:bg-warn-fore": e === "warn",
|
|
608
|
+
"bg-danger text-inverted hover:bg-danger-fore": e === "danger",
|
|
609
|
+
"hover:bg-accent": e === "ghost",
|
|
610
|
+
"hover:underline": e === "link",
|
|
611
|
+
"border border-input hover:bg-accent": e === "outline"
|
|
612
|
+
}, {
|
|
613
|
+
"px-2 py-1": !t,
|
|
614
|
+
"p-1.5": t === "icon"
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
function se({ size: e, variant: t, className: n, ...r }) {
|
|
618
|
+
let i = p(() => P(X({
|
|
619
|
+
size: e,
|
|
620
|
+
variant: t
|
|
621
|
+
}), n), [
|
|
622
|
+
e,
|
|
623
|
+
t,
|
|
624
|
+
n
|
|
625
|
+
]);
|
|
626
|
+
return /* @__PURE__ */ _("button", {
|
|
627
|
+
className: i,
|
|
628
|
+
type: "button",
|
|
629
|
+
...r
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
//#endregion
|
|
633
|
+
//#region src/components/Dialog/index.tsx
|
|
634
|
+
var ce = {
|
|
635
|
+
open: 150,
|
|
636
|
+
close: 75
|
|
637
|
+
};
|
|
638
|
+
function le({ open: e, children: t, timeout: n = ce, padding: r = "0.85rem", verticalAlign: i = "center", closeOnOverlay: a, closeOnEsc: o, onExited: s, className: l, onOpenChange: d, size: f, ...h }) {
|
|
639
|
+
let g = m(s), v = m(!1), b = k(), { refs: x, context: S } = D({
|
|
640
|
+
open: e,
|
|
641
|
+
onOpenChange: d,
|
|
642
|
+
nodeId: b
|
|
643
|
+
}), { getFloatingProps: C } = A([E(S, {
|
|
644
|
+
enabled: o,
|
|
645
|
+
escapeKey: o,
|
|
646
|
+
outsidePress: !1
|
|
647
|
+
})]), { isMounted: w, styles: T } = j(S, {
|
|
648
|
+
duration: n,
|
|
649
|
+
initial: {
|
|
650
|
+
opacity: 0,
|
|
651
|
+
transform: "scale(0.8)"
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
u(() => {
|
|
655
|
+
v.current !== w && (v.current = w, !w && g.current?.());
|
|
656
|
+
}, [w]);
|
|
657
|
+
let O = c(() => {
|
|
658
|
+
a && d?.(!1);
|
|
659
|
+
}, [d, a]);
|
|
660
|
+
g.current = s;
|
|
661
|
+
let M = p(() => N("grid bg-backdrop z-40 justify-items-center transition ease-in-out", {
|
|
662
|
+
"place-items-start items-start": i === "start",
|
|
663
|
+
"place-items-end": i === "end",
|
|
664
|
+
"place-items-center": i === "center" || !i
|
|
665
|
+
}), [i]);
|
|
666
|
+
return /* @__PURE__ */ _(W, {
|
|
667
|
+
disabled: !w,
|
|
668
|
+
children: /* @__PURE__ */ _(y, {
|
|
669
|
+
className: M,
|
|
670
|
+
"data-testid": "vs-dialog-overlay",
|
|
671
|
+
onClick: O,
|
|
672
|
+
style: {
|
|
673
|
+
padding: r,
|
|
674
|
+
opacity: T.opacity
|
|
675
|
+
},
|
|
676
|
+
lockScroll: !0,
|
|
677
|
+
children: /* @__PURE__ */ _(ue, {
|
|
678
|
+
ref: x.setFloating,
|
|
679
|
+
className: l,
|
|
680
|
+
role: "dialog",
|
|
681
|
+
size: f,
|
|
682
|
+
onClick: G,
|
|
683
|
+
...C({
|
|
684
|
+
...h,
|
|
685
|
+
style: T
|
|
686
|
+
}),
|
|
687
|
+
children: t
|
|
688
|
+
})
|
|
689
|
+
})
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
function ue({ size: e, ...t }) {
|
|
693
|
+
return /* @__PURE__ */ _(F, {
|
|
694
|
+
classList: [e ? "flex flex-col bg-background shadow-lg p-5 rounded" : null, {
|
|
695
|
+
"w-full max-w-dialog-sm": e === "small",
|
|
696
|
+
"w-full max-w-dialog-md": e === "medium",
|
|
697
|
+
"w-full max-w-dialog-lg": e === "large"
|
|
698
|
+
}],
|
|
699
|
+
...t
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
//#endregion
|
|
703
|
+
//#region src/elements/Skeleton/index.tsx
|
|
704
|
+
function de(e) {
|
|
705
|
+
return /* @__PURE__ */ _(F, {
|
|
706
|
+
classList: "inline-block animate-pulse rounded-md bg-accent",
|
|
707
|
+
...e
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
//#endregion
|
|
711
|
+
//#region src/elements/Button/ButtonGroup.tsx
|
|
712
|
+
function fe(e) {
|
|
713
|
+
return /* @__PURE__ */ _(F, {
|
|
714
|
+
role: "group",
|
|
715
|
+
classList: [
|
|
716
|
+
"flex items-center justify-center",
|
|
717
|
+
"[&_button]:rounded-none **:first:rounded-bl **:first:rounded-tl **:last:rounded-br **:last:rounded-tr",
|
|
718
|
+
"**:first:border-r-0 **:last:border-l-0"
|
|
719
|
+
],
|
|
720
|
+
...e
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
//#endregion
|
|
724
|
+
//#region src/elements/Spinner/index.tsx
|
|
725
|
+
function Z({ size: e = 20, label: t = "Loading...", ...n }) {
|
|
726
|
+
return /* @__PURE__ */ v("div", {
|
|
727
|
+
role: "status",
|
|
728
|
+
...n,
|
|
729
|
+
children: [/* @__PURE__ */ v("svg", {
|
|
730
|
+
"aria-hidden": "true",
|
|
731
|
+
className: "text-accent animate-spin fill-primary",
|
|
732
|
+
width: e,
|
|
733
|
+
height: e,
|
|
734
|
+
viewBox: "0 0 100 101",
|
|
735
|
+
fill: "none",
|
|
736
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
737
|
+
children: [/* @__PURE__ */ _("path", {
|
|
738
|
+
d: "M100 50.6a50 50 0 1 1-100 0 50 50 0 0 1 100 0Zm-91 0a41 41 0 1 0 82 0 41 41 0 0 0-82 0Z",
|
|
739
|
+
fill: "currentColor"
|
|
740
|
+
}), /* @__PURE__ */ _("path", {
|
|
741
|
+
d: "M94 39a4.2 4.2 0 0 0 3-5.4A50 50 0 0 0 41.7 1.3c-2.4.4-3.9 2.9-3.2 5.3a5 5 0 0 0 5.6 3.5A41 41 0 0 1 88 36 5 5 0 0 0 94 39Z",
|
|
742
|
+
fill: "currentFill"
|
|
743
|
+
})]
|
|
744
|
+
}), /* @__PURE__ */ _("span", {
|
|
745
|
+
className: "sr-only",
|
|
746
|
+
children: t
|
|
747
|
+
})]
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
//#endregion
|
|
751
|
+
//#region src/elements/Progress/index.tsx
|
|
752
|
+
function pe({ value: e, max: t, ...n }) {
|
|
753
|
+
let r = p(() => e ? Math.min(100, Math.round(e / t * 100)) : 0, [e, t]);
|
|
754
|
+
return /* @__PURE__ */ _(F, {
|
|
755
|
+
role: "progressbar",
|
|
756
|
+
classList: "relative overflow-hidden rounded-full bg-primary",
|
|
757
|
+
"aria-valuemax": t,
|
|
758
|
+
"aria-valuemin": 0,
|
|
759
|
+
...n,
|
|
760
|
+
children: /* @__PURE__ */ _(F, {
|
|
761
|
+
className: "h-full w-full flex-1 bg-input transition-all origin-right",
|
|
762
|
+
style: { transform: `translateX(${r}%)` }
|
|
763
|
+
})
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
//#endregion
|
|
767
|
+
//#region src/elements/Divider/index.tsx
|
|
768
|
+
function me({ orientation: e = "horizontal", ...t }) {
|
|
769
|
+
return /* @__PURE__ */ _(F, {
|
|
770
|
+
as: "hr",
|
|
771
|
+
role: "none",
|
|
772
|
+
classList: ["border-0 p-0 shrink-0 bg-input", e === "horizontal" ? "h-px w-full" : "w-px h-full"],
|
|
773
|
+
...t
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
//#endregion
|
|
777
|
+
//#region src/components/Sheet/index.tsx
|
|
778
|
+
var he = {
|
|
779
|
+
open: 250,
|
|
780
|
+
close: 150
|
|
1019
781
|
};
|
|
782
|
+
function ge({ open: e, timeout: t = he, onOpenChange: n, position: r = "right", overlay: i, onExited: a, onOpen: o, ...s }) {
|
|
783
|
+
let c = k(), l = m(!1), d = m(o), f = m(a), { refs: p, context: h } = D({
|
|
784
|
+
open: e,
|
|
785
|
+
onOpenChange: n,
|
|
786
|
+
nodeId: c
|
|
787
|
+
}), { isMounted: g, styles: b } = j(h, {
|
|
788
|
+
duration: t,
|
|
789
|
+
initial() {
|
|
790
|
+
let e = "translateX(75%)";
|
|
791
|
+
return r === "left" ? e = "translateX(-75%)" : r === "top" ? e = "translateY(-75%)" : r === "bottom" && (e = "translateY(75%)"), {
|
|
792
|
+
opacity: 0,
|
|
793
|
+
transform: e
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
});
|
|
797
|
+
return u(() => {
|
|
798
|
+
if (l.current !== g) {
|
|
799
|
+
if (l.current = g, g) {
|
|
800
|
+
d.current?.();
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
803
|
+
f.current?.();
|
|
804
|
+
}
|
|
805
|
+
}, [g]), f.current = a, d.current = o, /* @__PURE__ */ v(W, {
|
|
806
|
+
disabled: !g,
|
|
807
|
+
children: [i ? /* @__PURE__ */ _(y, {
|
|
808
|
+
className: "bg-backdrop",
|
|
809
|
+
style: { opacity: b.opacity },
|
|
810
|
+
onClick: () => n?.(!1)
|
|
811
|
+
}) : null, /* @__PURE__ */ _(F, {
|
|
812
|
+
ref: p.setFloating,
|
|
813
|
+
role: "dialog",
|
|
814
|
+
classList: ["fixed transition-transform z-30", {
|
|
815
|
+
"top-0 right-0 h-full max-h-screen": r === "right",
|
|
816
|
+
"top-0 left-0 h-full max-h-screen": r === "left",
|
|
817
|
+
"top-0 left-0 right-0 w-full max-w-screen": r === "top",
|
|
818
|
+
"bottom-0 left-0 right-0 w-full max-w-screen": r === "bottom"
|
|
819
|
+
}],
|
|
820
|
+
style: b,
|
|
821
|
+
children: /* @__PURE__ */ _(_e, { ...s })
|
|
822
|
+
})]
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
function _e(e) {
|
|
826
|
+
return /* @__PURE__ */ _(F, {
|
|
827
|
+
classList: "relative bg-background min-w-full min-h-full border border-input shadow-lg",
|
|
828
|
+
...e
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
//#endregion
|
|
832
|
+
//#region src/components/Toast/ToastItem.tsx
|
|
833
|
+
function Q({ type: e, label: t, message: n }) {
|
|
834
|
+
let { icons: r } = xe();
|
|
835
|
+
return /* @__PURE__ */ v("div", {
|
|
836
|
+
className: "flex items-center px-4 py-3 w-80 text-sm bg-background border border-input rounded-lg shadow-md m-2",
|
|
837
|
+
children: [e ? /* @__PURE__ */ v("figure", {
|
|
838
|
+
className: "mr-2",
|
|
839
|
+
children: [
|
|
840
|
+
e === "success" && r?.success ? r.success : null,
|
|
841
|
+
e === "info" && r?.info ? r.info : null,
|
|
842
|
+
e === "error" && r?.error ? r.error : null,
|
|
843
|
+
e === "warn" && r?.warn ? r.warn : null,
|
|
844
|
+
e === "loading" ? /* @__PURE__ */ _(Z, { size: 20 }) : null
|
|
845
|
+
]
|
|
846
|
+
}) : null, /* @__PURE__ */ v("div", {
|
|
847
|
+
className: "space-y-2",
|
|
848
|
+
children: [/* @__PURE__ */ _("p", {
|
|
849
|
+
className: "font-medium leading-none",
|
|
850
|
+
children: t
|
|
851
|
+
}), n ? /* @__PURE__ */ _("p", { children: n }) : null]
|
|
852
|
+
})]
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
//#endregion
|
|
856
|
+
//#region src/components/Toast/observer.ts
|
|
857
|
+
function ve() {}
|
|
858
|
+
var $ = new class {
|
|
859
|
+
notify = ve;
|
|
860
|
+
lastId = 0;
|
|
861
|
+
subscribe = (e) => (this.notify = e, () => {
|
|
862
|
+
this.notify = ve;
|
|
863
|
+
});
|
|
864
|
+
add = (e, t = {}) => {
|
|
865
|
+
this.lastId += 1;
|
|
866
|
+
let n = `${this.lastId}`;
|
|
867
|
+
return this.notify({
|
|
868
|
+
id: n,
|
|
869
|
+
type: "add",
|
|
870
|
+
config: {
|
|
871
|
+
id: n,
|
|
872
|
+
label: e,
|
|
873
|
+
...t
|
|
874
|
+
}
|
|
875
|
+
}), n;
|
|
876
|
+
};
|
|
877
|
+
update = (e, t) => {
|
|
878
|
+
this.notify({
|
|
879
|
+
id: e,
|
|
880
|
+
type: "update",
|
|
881
|
+
config: t
|
|
882
|
+
});
|
|
883
|
+
};
|
|
884
|
+
remove = (e) => {
|
|
885
|
+
this.notify({
|
|
886
|
+
id: e,
|
|
887
|
+
type: "remove"
|
|
888
|
+
});
|
|
889
|
+
};
|
|
890
|
+
clear = () => {
|
|
891
|
+
this.lastId = 0;
|
|
892
|
+
};
|
|
893
|
+
}();
|
|
894
|
+
//#endregion
|
|
895
|
+
//#region src/components/Toast/ToastFloat.tsx
|
|
896
|
+
function ye({ id: t, type: n, index: r, duration: i = 5e3, className: a, children: o, inverted: s, timeout: l = 250, max: d = 3 }) {
|
|
897
|
+
let g = m(!1), [v, y] = h(!1), { context: b, refs: x } = D({
|
|
898
|
+
open: v,
|
|
899
|
+
onOpenChange: y,
|
|
900
|
+
nodeId: t
|
|
901
|
+
}), { isMounted: S, styles: C } = j(b, {
|
|
902
|
+
duration: l,
|
|
903
|
+
initial: {
|
|
904
|
+
opacity: 0,
|
|
905
|
+
transform: `translateY(${s ? "" : "-"}50%)`
|
|
906
|
+
}
|
|
907
|
+
});
|
|
908
|
+
f(() => {
|
|
909
|
+
y(r <= d);
|
|
910
|
+
}, [r, d]), u(() => {
|
|
911
|
+
g.current !== S && (S || $.remove(t), g.current = S);
|
|
912
|
+
}, [S, t]), u(() => {
|
|
913
|
+
if (!i) return;
|
|
914
|
+
let e = window.setTimeout(() => y(!1), i);
|
|
915
|
+
return () => window.clearTimeout(e);
|
|
916
|
+
}, [i, t]);
|
|
917
|
+
let w = c(() => {
|
|
918
|
+
n !== "loading" && y(!1);
|
|
919
|
+
}, [n]), T = p(() => e("relative flex w-fit transition-transform ease-in-out cursor-pointer", a), [a]);
|
|
920
|
+
return S ? /* @__PURE__ */ _("li", {
|
|
921
|
+
role: "log",
|
|
922
|
+
tabIndex: -1,
|
|
923
|
+
ref: x.setFloating,
|
|
924
|
+
className: T,
|
|
925
|
+
style: C,
|
|
926
|
+
onClick: w,
|
|
927
|
+
children: o
|
|
928
|
+
}) : null;
|
|
929
|
+
}
|
|
930
|
+
//#endregion
|
|
931
|
+
//#region src/components/Toast/index.tsx
|
|
932
|
+
var be = i({});
|
|
933
|
+
function xe() {
|
|
934
|
+
return l(be);
|
|
935
|
+
}
|
|
936
|
+
function Se({ className: t, offset: n = {}, position: r = "top-left", max: i, ListItem: o = Q, icons: c }) {
|
|
937
|
+
let l = p(() => {
|
|
938
|
+
let e = {
|
|
939
|
+
position: "fixed",
|
|
940
|
+
...n
|
|
941
|
+
};
|
|
942
|
+
return Object.keys(n).length || (r.indexOf("top") > -1 ? e.top = "16px" : r.indexOf("bottom") > -1 && (e.bottom = "16px"), r.indexOf("left") > -1 ? e.left = "16px" : r.indexOf("right") > -1 && (e.right = "16px")), r.indexOf("left") > -1 ? e.alignItems = "flex-start" : r.indexOf("right") > -1 ? e.alignItems = "flex-end" : (e.left = "50%", e.alignItems = "center", e.transform = "translateX(-50%)"), e;
|
|
943
|
+
}, [n, r]), u = p(() => e("flex flex-col z-40 overflow-hidden", t), [t]), d = p(() => r?.startsWith("bottom") || !1, [r]), f = m(/* @__PURE__ */ new Map()), [g, v] = h([]), y = h(0)[1];
|
|
944
|
+
U(() => $.subscribe((e) => {
|
|
945
|
+
s(() => {
|
|
946
|
+
if (e.type === "add") f.current.set(e.id, e.config), v((t) => [...t, e.id]);
|
|
947
|
+
else if (e.type === "remove") {
|
|
948
|
+
if (!f.current.delete(e.id)) return;
|
|
949
|
+
v((t) => {
|
|
950
|
+
let n = new Set(t);
|
|
951
|
+
return n.has(e.id) ? (n.delete(e.id), Array.from(n)) : t;
|
|
952
|
+
});
|
|
953
|
+
} else if (e.type === "update") {
|
|
954
|
+
let t = f.current.get(e.id);
|
|
955
|
+
if (!t) return;
|
|
956
|
+
f.current.set(e.id, {
|
|
957
|
+
...t,
|
|
958
|
+
...e.config
|
|
959
|
+
}), y((e) => e + 1);
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
}), []);
|
|
963
|
+
let b = p(() => ({ icons: c }), [c]), x = g.length;
|
|
964
|
+
return /* @__PURE__ */ _(W, { children: /* @__PURE__ */ _("ol", {
|
|
965
|
+
className: u,
|
|
966
|
+
style: l,
|
|
967
|
+
"aria-live": "polite",
|
|
968
|
+
children: /* @__PURE__ */ _(be.Provider, {
|
|
969
|
+
value: b,
|
|
970
|
+
children: g.map((e, t) => {
|
|
971
|
+
let n = f.current.get(e);
|
|
972
|
+
if (!n) return null;
|
|
973
|
+
let { className: r, duration: s, ...c } = n;
|
|
974
|
+
return /* @__PURE__ */ _(ye, {
|
|
975
|
+
id: e,
|
|
976
|
+
index: x - t,
|
|
977
|
+
className: r,
|
|
978
|
+
duration: s,
|
|
979
|
+
inverted: d,
|
|
980
|
+
max: i,
|
|
981
|
+
children: a(o, c)
|
|
982
|
+
}, e);
|
|
983
|
+
})
|
|
984
|
+
})
|
|
985
|
+
}) });
|
|
986
|
+
}
|
|
987
|
+
//#endregion
|
|
988
|
+
export { oe as Accordion, F as Base, se as Button, fe as ButtonGroup, H as Checkbox, le as Dialog, me as Divider, L as FormField, I as FormLabel, B as Input, z as InputField, K as Popover, W as Portal, pe as Progress, ie as Radio, q as Select, ge as Sheet, de as Skeleton, Z as Spinner, ae as Switch, V as Textarea, Se as Toast, Q as ToastItem, J as Tooltip, N as cn, P as merge, $ as toast, X as varientButton };
|