panelize 0.0.0-stage → 0.1.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.
@@ -0,0 +1,3011 @@
1
+ "use client";
2
+ import { Children as e, createContext as t, isValidElement as n, useContext as r, useEffect as i, useId as a, useLayoutEffect as o, useMemo as s, useRef as c, useState as l } from "react";
3
+ import { css as u, styled as d } from "styled-components";
4
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
5
+ import { createPortal as h } from "react-dom";
6
+ //#region src/theme/types.ts
7
+ var g = [
8
+ "muted",
9
+ "base",
10
+ "highlighted"
11
+ ], _ = [
12
+ "base",
13
+ "muted",
14
+ "highlighted"
15
+ ], v = ["dark", "light"], y = [
16
+ "primary",
17
+ "secondary",
18
+ "accent"
19
+ ], b = [
20
+ "danger",
21
+ "warning",
22
+ "success",
23
+ "info"
24
+ ], x = [
25
+ "base",
26
+ "hover",
27
+ "active"
28
+ ], S = [
29
+ "none",
30
+ "extraSmall",
31
+ "small",
32
+ "base",
33
+ "large",
34
+ "extraLarge"
35
+ ], C = [
36
+ "start",
37
+ "end",
38
+ "center",
39
+ "stretch",
40
+ "baseline",
41
+ "space-between",
42
+ "space-around",
43
+ "space-evenly"
44
+ ], w = [
45
+ "vertical",
46
+ "horizontal",
47
+ "both"
48
+ ], T = [
49
+ "sm",
50
+ "md",
51
+ "lg"
52
+ ], E = [
53
+ "extraSmall",
54
+ "small",
55
+ "base",
56
+ "large",
57
+ "extraLarge"
58
+ ], D = [
59
+ "thin",
60
+ "base",
61
+ "bold",
62
+ "heavy"
63
+ ], O = [
64
+ "base",
65
+ "display",
66
+ "mono"
67
+ ], k = [
68
+ 1,
69
+ 2,
70
+ 3,
71
+ 4,
72
+ 5,
73
+ 6
74
+ ], A = {
75
+ none: "0rem",
76
+ extraSmall: "0.25rem",
77
+ small: "0.5rem",
78
+ base: "1rem",
79
+ large: "1.5rem",
80
+ extraLarge: "2rem"
81
+ };
82
+ function j(e) {
83
+ return S.includes(e);
84
+ }
85
+ function M(e, t, n) {
86
+ let r = e ?? t;
87
+ return Object.hasOwn(n, r) ? n[r] : r;
88
+ }
89
+ function N(e, t, n, r) {
90
+ return e === void 0 ? t === void 0 ? n : j(t) ? r[t] : t : j(e) ? r[e] : e;
91
+ }
92
+ function P(e, t, n) {
93
+ let r = M(e.padding, t.padding, n), i = M(e.margin, t.margin, n);
94
+ return {
95
+ paddingTop: N(e.paddingTop, e.paddingY, r, n),
96
+ paddingRight: N(e.paddingRight, e.paddingX, r, n),
97
+ paddingBottom: N(e.paddingBottom, e.paddingY, r, n),
98
+ paddingLeft: N(e.paddingLeft, e.paddingX, r, n),
99
+ marginTop: N(e.marginTop, e.marginY, i, n),
100
+ marginRight: N(e.marginRight, e.marginX, i, n),
101
+ marginBottom: N(e.marginBottom, e.marginY, i, n),
102
+ marginLeft: N(e.marginLeft, e.marginX, i, n)
103
+ };
104
+ }
105
+ function F(e) {
106
+ let { padding: t, margin: n, paddingX: r, paddingY: i, paddingTop: a, paddingRight: o, paddingBottom: s, paddingLeft: c, marginX: l, marginY: u, marginTop: d, marginRight: f, marginBottom: p, marginLeft: m, minWidth: h, maxWidth: g, minHeight: _, maxHeight: v, width: y, height: b, ...x } = e;
107
+ return {
108
+ spacing: {
109
+ padding: t,
110
+ margin: n,
111
+ paddingX: r,
112
+ paddingY: i,
113
+ paddingTop: a,
114
+ paddingRight: o,
115
+ paddingBottom: s,
116
+ paddingLeft: c,
117
+ marginX: l,
118
+ marginY: u,
119
+ marginTop: d,
120
+ marginRight: f,
121
+ marginBottom: p,
122
+ marginLeft: m
123
+ },
124
+ size: {
125
+ minWidth: h,
126
+ maxWidth: g,
127
+ minHeight: _,
128
+ maxHeight: v,
129
+ width: y,
130
+ height: b
131
+ },
132
+ rest: x
133
+ };
134
+ }
135
+ function ee(e, t) {
136
+ return {
137
+ minWidth: e.minWidth === void 0 ? void 0 : M(e.minWidth, "none", t),
138
+ maxWidth: e.maxWidth === void 0 ? void 0 : M(e.maxWidth, "none", t),
139
+ minHeight: e.minHeight === void 0 ? void 0 : M(e.minHeight, "none", t),
140
+ maxHeight: e.maxHeight === void 0 ? void 0 : M(e.maxHeight, "none", t)
141
+ };
142
+ }
143
+ function I(e, t, n) {
144
+ return {
145
+ ...ee(e, t),
146
+ width: e.width === void 0 && n?.width === void 0 ? void 0 : M(e.width, n?.width ?? "auto", t),
147
+ height: e.height === void 0 && n?.height === void 0 ? void 0 : M(e.height, n?.height ?? "auto", t)
148
+ };
149
+ }
150
+ function L(e, t) {
151
+ let n = e.width ?? (t ? "100%" : void 0), r = e.height ?? (t ? "100%" : void 0);
152
+ return u`
153
+ box-sizing: border-box;
154
+ ${n === void 0 ? "" : u`
155
+ width: ${n};
156
+ `}
157
+ ${r === void 0 ? "" : u`
158
+ height: ${r};
159
+ `}
160
+ ${te(e)}
161
+ `;
162
+ }
163
+ function te(e) {
164
+ return u`
165
+ ${e.minWidth === void 0 ? "" : u`
166
+ min-width: ${e.minWidth};
167
+ `}
168
+ ${e.maxWidth === void 0 ? "" : u`
169
+ max-width: ${e.maxWidth};
170
+ `}
171
+ ${e.minHeight === void 0 ? "" : u`
172
+ min-height: ${e.minHeight};
173
+ `}
174
+ ${e.maxHeight === void 0 ? "" : u`
175
+ max-height: ${e.maxHeight};
176
+ `}
177
+ `;
178
+ }
179
+ function R(e) {
180
+ return u`
181
+ padding-top: ${e.paddingTop};
182
+ padding-right: ${e.paddingRight};
183
+ padding-bottom: ${e.paddingBottom};
184
+ padding-left: ${e.paddingLeft};
185
+ margin-top: ${e.marginTop};
186
+ margin-right: ${e.marginRight};
187
+ margin-bottom: ${e.marginBottom};
188
+ margin-left: ${e.marginLeft};
189
+ `;
190
+ }
191
+ //#endregion
192
+ //#region src/theme/borders.ts
193
+ var ne = {
194
+ none: "0",
195
+ extraSmall: "1px",
196
+ small: "2px",
197
+ base: "4px",
198
+ large: "8px",
199
+ extraLarge: "12px"
200
+ }, re = {
201
+ none: "0",
202
+ extraSmall: "0.125rem",
203
+ small: "0.25rem",
204
+ base: "0.5rem",
205
+ large: "0.75rem",
206
+ extraLarge: "1rem"
207
+ };
208
+ function ie(e) {
209
+ return typeof e == "object" && !!e;
210
+ }
211
+ function ae(e, t, n, r) {
212
+ return e === void 0 ? t === void 0 ? n : M(t, n, r) : M(e, n, r);
213
+ }
214
+ function oe(e, t, n) {
215
+ let r = M(e.borderWidth, t, n);
216
+ return [
217
+ ae(e.borderTop, e.borderY, r, n),
218
+ ae(e.borderRight, e.borderX, r, n),
219
+ ae(e.borderBottom, e.borderY, r, n),
220
+ ae(e.borderLeft, e.borderX, r, n)
221
+ ].join(" ");
222
+ }
223
+ function z(e, t, n, r, i, a = "base") {
224
+ if (e !== void 0) {
225
+ if (g.includes(e)) {
226
+ let r = n[e];
227
+ return t === "background" ? r.background : t === "text" ? r.text.base : r.border;
228
+ }
229
+ return y.includes(e) ? r[e][a] : b.includes(e) ? i[e][a] : e;
230
+ }
231
+ }
232
+ function se(e, t, n, r, i, a) {
233
+ if (e !== void 0) {
234
+ if (ie(e)) {
235
+ let o = e[n];
236
+ return o === void 0 ? void 0 : z(o, t, r, i, a, n);
237
+ }
238
+ return z(e, t, r, i, a, "base");
239
+ }
240
+ }
241
+ function ce(e, t, n, r, i) {
242
+ return z(e, "border", n, r, i) ?? n[t].border;
243
+ }
244
+ //#endregion
245
+ //#region src/theme/breakpoints.ts
246
+ var le = {
247
+ sm: "40rem",
248
+ md: "48rem",
249
+ lg: "64rem"
250
+ };
251
+ function ue(e) {
252
+ return T.includes(e);
253
+ }
254
+ function de(e, t) {
255
+ if (e !== void 0) return ue(e) ? t[e] : e;
256
+ }
257
+ function fe(e, t = 1) {
258
+ let n = Number.isFinite(t) && t >= 1 ? Math.floor(t) : 1, r = `repeat(${n}, minmax(0, 1fr))`;
259
+ return u`
260
+ container-type: inline-size;
261
+ @container (max-width: ${e}) {
262
+ grid-template-columns: ${r};
263
+ justify-items: stretch;
264
+ align-items: stretch;
265
+ ${n === 1 ? u`
266
+ & > * {
267
+ grid-column: auto / span 1;
268
+ }
269
+ ` : ""}
270
+ }
271
+ `;
272
+ }
273
+ function pe(e, t = "start") {
274
+ return u`
275
+ container-type: inline-size;
276
+ @container (max-width: ${e}) {
277
+ flex-direction: column;
278
+ flex-wrap: nowrap;
279
+ align-items: stretch;
280
+ justify-content: ${t};
281
+ & > * {
282
+ width: auto;
283
+ max-width: 100%;
284
+ }
285
+ }
286
+ `;
287
+ }
288
+ //#endregion
289
+ //#region src/theme/flex.ts
290
+ function me(e, t) {
291
+ return u`
292
+ justify-items: ${e};
293
+ align-items: ${t};
294
+ `;
295
+ }
296
+ function he(e, t) {
297
+ if (e || t) return u`
298
+ ${e ? u`
299
+ justify-self: ${e};
300
+ ` : ""}
301
+ ${t ? u`
302
+ align-self: ${t};
303
+ ` : ""}
304
+ `;
305
+ }
306
+ function B(e) {
307
+ return e ? {
308
+ alignX: "stretch",
309
+ alignY: "start"
310
+ } : {
311
+ alignX: "start",
312
+ alignY: "stretch"
313
+ };
314
+ }
315
+ function V(e, t, n) {
316
+ let r = e ? n : t, i = e ? t : n;
317
+ if (r || i) return u`
318
+ ${r ? u`
319
+ justify-content: ${r};
320
+ ` : ""}
321
+ ${i ? u`
322
+ align-items: ${i};
323
+ ` : ""}
324
+ `;
325
+ }
326
+ function ge(e, t) {
327
+ return e ?? t;
328
+ }
329
+ function _e(e, t) {
330
+ if (e) return u`
331
+ flex: 1 1 0%;
332
+ min-width: 0;
333
+ min-height: 0;
334
+ `;
335
+ if (t) return u`
336
+ flex-shrink: 0;
337
+ `;
338
+ }
339
+ function ve(e) {
340
+ return e ?? "start";
341
+ }
342
+ //#endregion
343
+ //#region src/theme/overflow.ts
344
+ function H(e) {
345
+ if (!e) return;
346
+ let t = e === "vertical" || e === "both", n = e === "horizontal" || e === "both";
347
+ return u`
348
+ overflow-x: ${n ? "auto" : "hidden"};
349
+ overflow-y: ${t ? "auto" : "hidden"};
350
+ ${t ? u`
351
+ min-height: 0;
352
+ ` : ""}
353
+ ${n ? u`
354
+ min-width: 0;
355
+ ` : ""}
356
+ `;
357
+ }
358
+ //#endregion
359
+ //#region src/theme/track.tsx
360
+ var U = t(void 0);
361
+ function W({ kind: e, children: t }) {
362
+ return /* @__PURE__ */ p(U.Provider, {
363
+ value: e,
364
+ children: t
365
+ });
366
+ }
367
+ function ye() {
368
+ return r(U);
369
+ }
370
+ function G(e, t, n) {
371
+ if (e === "column") return t ? u`
372
+ align-self: ${t};
373
+ ` : void 0;
374
+ if (e === "row") return n ? u`
375
+ align-self: ${n};
376
+ ` : void 0;
377
+ if (t || n) return u`
378
+ ${t ? u`
379
+ justify-self: ${t};
380
+ ` : ""}
381
+ ${n ? u`
382
+ align-self: ${n};
383
+ ` : ""}
384
+ `;
385
+ }
386
+ //#endregion
387
+ //#region src/theme/color.ts
388
+ var K = [
389
+ "extraDark",
390
+ "dark",
391
+ "base",
392
+ "light",
393
+ "extraLight"
394
+ ], be = [
395
+ 0,
396
+ 1,
397
+ 2,
398
+ 3,
399
+ 4,
400
+ 5,
401
+ 6
402
+ ], q = [
403
+ "#000000",
404
+ "#292929",
405
+ "#4e4e4e",
406
+ "#777777",
407
+ "#a2a2a2",
408
+ "#d0d0d0",
409
+ "#ffffff"
410
+ ], J = {
411
+ black: q[0],
412
+ white: q[6],
413
+ gray: {
414
+ 0: q[0],
415
+ 1: q[1],
416
+ 2: q[2],
417
+ 3: q[3],
418
+ 4: q[4],
419
+ 5: q[5],
420
+ 6: q[6],
421
+ extraDark: q[1],
422
+ dark: q[2],
423
+ base: q[3],
424
+ light: q[4],
425
+ extraLight: q[5]
426
+ }
427
+ };
428
+ //#endregion
429
+ //#region src/theme/brand.ts
430
+ function xe(e) {
431
+ let t = e.trim(), n = /^#([\da-fA-F])([\da-fA-F])([\da-fA-F])$/.exec(t);
432
+ if (n) return [
433
+ Number.parseInt(n[1] + n[1], 16),
434
+ Number.parseInt(n[2] + n[2], 16),
435
+ Number.parseInt(n[3] + n[3], 16)
436
+ ];
437
+ let r = /^#([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})$/.exec(t);
438
+ return r ? [
439
+ Number.parseInt(r[1], 16),
440
+ Number.parseInt(r[2], 16),
441
+ Number.parseInt(r[3], 16)
442
+ ] : null;
443
+ }
444
+ function Se(e, t, n) {
445
+ return `#${[
446
+ e,
447
+ t,
448
+ n
449
+ ].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
450
+ }
451
+ function Ce(e, t, n) {
452
+ return Math.round(e + (t - e) * n);
453
+ }
454
+ function Y(e, t, n) {
455
+ let r = xe(e);
456
+ return r ? Se(Ce(r[0], t, n), Ce(r[1], t, n), Ce(r[2], t, n)) : null;
457
+ }
458
+ function X(e) {
459
+ return {
460
+ base: e,
461
+ hover: Y(e, 255, .25) ?? e,
462
+ active: Y(e, 0, .055) ?? e
463
+ };
464
+ }
465
+ //#endregion
466
+ //#region src/theme/font.ts
467
+ var we = {
468
+ extraSmall: "0.75rem",
469
+ small: "0.875rem",
470
+ base: "1rem",
471
+ large: "1.25rem",
472
+ extraLarge: "1.5rem"
473
+ }, Te = {
474
+ thin: "100",
475
+ base: "400",
476
+ bold: "700",
477
+ heavy: "800"
478
+ }, Ee = {
479
+ base: "\"Open Sans\", sans-serif",
480
+ display: "Montserrat, sans-serif",
481
+ mono: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace"
482
+ }, De = 1.2, Oe = {
483
+ padding: "none",
484
+ margin: "none"
485
+ }, ke = {
486
+ ...Oe,
487
+ borderWidth: "none",
488
+ borderRadius: "none"
489
+ }, Ae = {
490
+ ...ke,
491
+ height: "auto"
492
+ }, je = {
493
+ ...ke,
494
+ width: "auto"
495
+ }, Me = {
496
+ ...Oe,
497
+ gap: "none",
498
+ alignX: "stretch",
499
+ alignY: "start"
500
+ }, Ne = {
501
+ ...Oe,
502
+ gap: "none",
503
+ alignX: "start",
504
+ alignY: "stretch"
505
+ }, Pe = {
506
+ ...Oe,
507
+ gap: "none",
508
+ alignX: "stretch",
509
+ alignY: "stretch"
510
+ }, Fe = {
511
+ muted: {
512
+ background: "#222222",
513
+ text: {
514
+ base: J.gray.extraLight,
515
+ muted: J.gray.base,
516
+ highlighted: J.white
517
+ },
518
+ border: J.gray.dark
519
+ },
520
+ base: {
521
+ background: "#333333",
522
+ text: {
523
+ base: J.gray.extraLight,
524
+ muted: J.gray.light,
525
+ highlighted: J.white
526
+ },
527
+ border: J.gray.base
528
+ },
529
+ highlighted: {
530
+ background: J.gray.dark,
531
+ text: {
532
+ base: J.white,
533
+ muted: J.gray.light,
534
+ highlighted: J.white
535
+ },
536
+ border: J.gray.base
537
+ }
538
+ }, Z = {
539
+ mode: "dark",
540
+ colorSchemes: {
541
+ dark: Fe,
542
+ light: {
543
+ muted: {
544
+ background: "#f2f2f2",
545
+ text: {
546
+ base: "#222222",
547
+ muted: J.gray.base,
548
+ highlighted: J.black
549
+ },
550
+ border: J.gray.light
551
+ },
552
+ base: {
553
+ background: "#f7f7f7",
554
+ text: {
555
+ base: "#333333",
556
+ muted: J.gray.base,
557
+ highlighted: J.black
558
+ },
559
+ border: J.gray.base
560
+ },
561
+ highlighted: {
562
+ background: J.white,
563
+ text: {
564
+ base: J.gray.dark,
565
+ muted: J.gray.base,
566
+ highlighted: J.black
567
+ },
568
+ border: J.gray.base
569
+ }
570
+ }
571
+ },
572
+ colors: Fe,
573
+ brand: {
574
+ primary: X("#ff9f2e"),
575
+ secondary: X("#ff9f2e"),
576
+ accent: X("#ff9f2e")
577
+ },
578
+ status: {
579
+ danger: X("#f2555a"),
580
+ warning: X("#ffd60a"),
581
+ success: X("#4ade80"),
582
+ info: X("#38bdf8")
583
+ },
584
+ space: A,
585
+ borderWidths: ne,
586
+ radii: re,
587
+ breakpoints: { ...le },
588
+ fontSizes: we,
589
+ fontWeights: Te,
590
+ fontFamilies: Ee,
591
+ lineHeight: De,
592
+ defaults: {
593
+ panel: { ...ke },
594
+ panels: {
595
+ ...Oe,
596
+ gap: "none"
597
+ },
598
+ rows: { ...Me },
599
+ row: { ...Ae },
600
+ cols: { ...Ne },
601
+ col: { ...je },
602
+ grid: { ...Pe },
603
+ cell: { ...ke },
604
+ div: { ...ke },
605
+ text: {
606
+ size: "base",
607
+ weight: "base"
608
+ },
609
+ heading: {
610
+ size: {
611
+ 1: "2rem",
612
+ 2: "1.5rem",
613
+ 3: "1.17rem",
614
+ 4: "1rem",
615
+ 5: "0.83rem",
616
+ 6: "0.67rem"
617
+ },
618
+ weight: "bold",
619
+ family: "display"
620
+ },
621
+ textLink: {
622
+ color: "primary",
623
+ hover: "primary",
624
+ hoverUnderline: !1
625
+ },
626
+ button: {
627
+ color: "primary",
628
+ size: "small",
629
+ weight: "bold",
630
+ ink: J.black,
631
+ hover: { color: J.black },
632
+ paddingX: "base",
633
+ paddingY: "small",
634
+ gap: "extraSmall",
635
+ borderWidth: "extraSmall",
636
+ borderRadius: "base"
637
+ },
638
+ chip: {
639
+ color: "primary",
640
+ size: "extraSmall",
641
+ weight: "bold",
642
+ tint: "12%",
643
+ paddingX: "base",
644
+ paddingY: "extraSmall",
645
+ gap: "extraSmall",
646
+ borderRadius: "999px",
647
+ uppercase: !0
648
+ },
649
+ input: {
650
+ color: "primary",
651
+ size: "small",
652
+ weight: "base",
653
+ paddingX: "base",
654
+ paddingY: "small",
655
+ borderWidth: "extraSmall",
656
+ borderRadius: "base"
657
+ },
658
+ textarea: {
659
+ color: "primary",
660
+ size: "small",
661
+ weight: "base",
662
+ paddingX: "base",
663
+ paddingY: "small",
664
+ borderWidth: "extraSmall",
665
+ borderRadius: "base",
666
+ resize: !1,
667
+ rows: 3
668
+ },
669
+ select: {
670
+ color: "primary",
671
+ size: "small",
672
+ weight: "base",
673
+ paddingX: "base",
674
+ paddingY: "small",
675
+ borderWidth: "extraSmall",
676
+ borderRadius: "base",
677
+ listMaxHeight: "16rem",
678
+ listOffset: "extraSmall",
679
+ optionPaddingX: "base",
680
+ optionPaddingY: "extraSmall",
681
+ listZIndex: 1100,
682
+ listShadow: "0 8px 24px rgb(0 0 0 / 35%)"
683
+ },
684
+ switch: {
685
+ color: "primary",
686
+ size: "base",
687
+ ink: J.white,
688
+ widthFactor: 2,
689
+ insetFactor: .2,
690
+ borderRadius: "999px"
691
+ },
692
+ checkbox: {
693
+ color: "primary",
694
+ size: "base",
695
+ ink: J.black,
696
+ borderWidth: "extraSmall",
697
+ borderRadius: "small"
698
+ },
699
+ radio: {
700
+ color: "primary",
701
+ size: "base",
702
+ borderWidth: "extraSmall",
703
+ borderRadius: "999px",
704
+ insetFactor: .22
705
+ }
706
+ }
707
+ };
708
+ function Ie(e, t, n) {
709
+ let r = { ...t };
710
+ if (!n) return r;
711
+ for (let t of e) {
712
+ let e = n[t];
713
+ e !== void 0 && (r[t] = e);
714
+ }
715
+ return r;
716
+ }
717
+ function Le(e, t) {
718
+ return Ie(S, e, t);
719
+ }
720
+ function Re(e, t) {
721
+ return Ie(T, e, t);
722
+ }
723
+ function ze(e, t) {
724
+ return {
725
+ padding: t?.padding ?? e.padding,
726
+ margin: t?.margin ?? e.margin
727
+ };
728
+ }
729
+ function Be(e, t) {
730
+ return {
731
+ ...ze(e, t),
732
+ borderWidth: t?.borderWidth ?? e.borderWidth,
733
+ borderRadius: t?.borderRadius ?? e.borderRadius
734
+ };
735
+ }
736
+ function Ve(e, t) {
737
+ return {
738
+ ...Be(e, t),
739
+ height: t?.height ?? e.height
740
+ };
741
+ }
742
+ function He(e, t) {
743
+ return {
744
+ ...Be(e, t),
745
+ width: t?.width ?? e.width
746
+ };
747
+ }
748
+ function Ue(e, t) {
749
+ return {
750
+ ...ze(e, t),
751
+ gap: t?.gap ?? e.gap
752
+ };
753
+ }
754
+ function We(e, t) {
755
+ return {
756
+ size: t?.size ?? e.size,
757
+ weight: t?.weight ?? e.weight
758
+ };
759
+ }
760
+ function Ge(e, t) {
761
+ let n = { ...e.size };
762
+ for (let e of k) {
763
+ let r = t?.size?.[e];
764
+ r !== void 0 && (n[e] = r);
765
+ }
766
+ return {
767
+ size: n,
768
+ weight: t?.weight ?? e.weight,
769
+ family: t?.family ?? e.family
770
+ };
771
+ }
772
+ function Ke(e, t) {
773
+ return {
774
+ color: t?.color ?? e.color,
775
+ hover: t?.hover ?? e.hover,
776
+ hoverUnderline: t?.hoverUnderline ?? e.hoverUnderline
777
+ };
778
+ }
779
+ function qe(e, t) {
780
+ return {
781
+ color: t?.color ?? e.color,
782
+ size: t?.size ?? e.size,
783
+ weight: t?.weight ?? e.weight,
784
+ tint: t?.tint ?? e.tint,
785
+ paddingX: t?.paddingX ?? e.paddingX,
786
+ paddingY: t?.paddingY ?? e.paddingY,
787
+ gap: t?.gap ?? e.gap,
788
+ borderRadius: t?.borderRadius ?? e.borderRadius,
789
+ uppercase: t?.uppercase ?? e.uppercase
790
+ };
791
+ }
792
+ function Je(e, t) {
793
+ return {
794
+ color: t?.color ?? e.color,
795
+ size: t?.size ?? e.size,
796
+ weight: t?.weight ?? e.weight,
797
+ paddingX: t?.paddingX ?? e.paddingX,
798
+ paddingY: t?.paddingY ?? e.paddingY,
799
+ borderWidth: t?.borderWidth ?? e.borderWidth,
800
+ borderRadius: t?.borderRadius ?? e.borderRadius
801
+ };
802
+ }
803
+ function Ye(e, t) {
804
+ return {
805
+ ...Je(e, t),
806
+ resize: t?.resize ?? e.resize,
807
+ rows: t?.rows ?? e.rows
808
+ };
809
+ }
810
+ function Xe(e, t) {
811
+ return {
812
+ ...Je(e, t),
813
+ listMaxHeight: t?.listMaxHeight ?? e.listMaxHeight,
814
+ listOffset: t?.listOffset ?? e.listOffset,
815
+ optionPaddingX: t?.optionPaddingX ?? e.optionPaddingX,
816
+ optionPaddingY: t?.optionPaddingY ?? e.optionPaddingY,
817
+ listZIndex: t?.listZIndex ?? e.listZIndex,
818
+ listShadow: t?.listShadow ?? e.listShadow
819
+ };
820
+ }
821
+ function Ze(e, t) {
822
+ return {
823
+ color: t?.color ?? e.color,
824
+ size: t?.size ?? e.size,
825
+ ink: t?.ink ?? e.ink,
826
+ widthFactor: t?.widthFactor ?? e.widthFactor,
827
+ insetFactor: t?.insetFactor ?? e.insetFactor,
828
+ borderRadius: t?.borderRadius ?? e.borderRadius
829
+ };
830
+ }
831
+ function Qe(e, t) {
832
+ return {
833
+ color: t?.color ?? e.color,
834
+ size: t?.size ?? e.size,
835
+ ink: t?.ink ?? e.ink,
836
+ borderWidth: t?.borderWidth ?? e.borderWidth,
837
+ borderRadius: t?.borderRadius ?? e.borderRadius
838
+ };
839
+ }
840
+ function $e(e, t) {
841
+ return {
842
+ color: t?.color ?? e.color,
843
+ size: t?.size ?? e.size,
844
+ borderWidth: t?.borderWidth ?? e.borderWidth,
845
+ borderRadius: t?.borderRadius ?? e.borderRadius,
846
+ insetFactor: t?.insetFactor ?? e.insetFactor
847
+ };
848
+ }
849
+ function et(e, t) {
850
+ return {
851
+ color: t?.color ?? e.color,
852
+ size: t?.size ?? e.size,
853
+ weight: t?.weight ?? e.weight,
854
+ ink: t?.ink ?? e.ink,
855
+ hover: {
856
+ color: t?.hover?.color ?? e.hover.color,
857
+ background: t?.hover?.background ?? e.hover.background
858
+ },
859
+ paddingX: t?.paddingX ?? e.paddingX,
860
+ paddingY: t?.paddingY ?? e.paddingY,
861
+ gap: t?.gap ?? e.gap,
862
+ borderWidth: t?.borderWidth ?? e.borderWidth,
863
+ borderRadius: t?.borderRadius ?? e.borderRadius
864
+ };
865
+ }
866
+ function tt(e, t) {
867
+ if (t === void 0) return { ...e };
868
+ if (typeof t == "string") return X(t);
869
+ let n = t.base ?? e.base, r = X(n);
870
+ return {
871
+ base: n,
872
+ hover: t.hover ?? (t.base === void 0 ? e.hover : r.hover),
873
+ active: t.active ?? (t.base === void 0 ? e.active : r.active)
874
+ };
875
+ }
876
+ function nt(e, t) {
877
+ return {
878
+ danger: tt(e.danger, t?.danger),
879
+ warning: tt(e.warning, t?.warning),
880
+ success: tt(e.success, t?.success),
881
+ info: tt(e.info, t?.info)
882
+ };
883
+ }
884
+ function rt(e, t) {
885
+ let n = tt(e.primary, t?.primary), r = t?.primary !== void 0;
886
+ return {
887
+ primary: n,
888
+ secondary: tt(r ? n : e.secondary, t?.secondary),
889
+ accent: tt(r ? n : e.accent, t?.accent)
890
+ };
891
+ }
892
+ function it(e, t) {
893
+ return {
894
+ ...ze(e, t),
895
+ gap: t?.gap ?? e.gap,
896
+ alignX: t?.alignX ?? e.alignX,
897
+ alignY: t?.alignY ?? e.alignY
898
+ };
899
+ }
900
+ function at(e, t) {
901
+ return Ie(_, e, t);
902
+ }
903
+ function ot(e, t) {
904
+ return {
905
+ background: t?.background ?? e.background,
906
+ border: t?.border ?? e.border,
907
+ text: at(e.text, t?.text)
908
+ };
909
+ }
910
+ function st(e, t) {
911
+ let n = { ...e };
912
+ for (let r of g) n[r] = ot(e[r], t?.[r]);
913
+ let r = t?.app;
914
+ return r?.background || r?.text ? n.app = {
915
+ ...e.app,
916
+ ...r
917
+ } : e.app && (n.app = { ...e.app }), n;
918
+ }
919
+ function ct(e, t) {
920
+ return {
921
+ ...e,
922
+ mode: t,
923
+ colors: e.colorSchemes[t]
924
+ };
925
+ }
926
+ function lt(e) {
927
+ let t = {
928
+ dark: st(Z.colorSchemes.dark, e?.colors?.dark),
929
+ light: st(Z.colorSchemes.light, e?.colors?.light)
930
+ }, n = Je(Z.defaults.input, e?.defaults?.input);
931
+ return {
932
+ mode: "dark",
933
+ colorSchemes: t,
934
+ colors: t.dark,
935
+ brand: rt(Z.brand, e?.brand),
936
+ status: nt(Z.status, e?.status),
937
+ space: Le(Z.space, e?.space),
938
+ borderWidths: Le(Z.borderWidths, e?.borderWidths),
939
+ radii: Le(Z.radii, e?.radii),
940
+ breakpoints: Re(Z.breakpoints, e?.breakpoints),
941
+ fontSizes: Ie(E, Z.fontSizes, e?.fontSizes),
942
+ fontWeights: Ie(D, Z.fontWeights, e?.fontWeights),
943
+ fontFamilies: Ie(O, Z.fontFamilies, e?.fontFamilies),
944
+ lineHeight: e?.lineHeight ?? Z.lineHeight,
945
+ defaults: {
946
+ panel: Be(Z.defaults.panel, e?.defaults?.panel),
947
+ panels: Ue(Z.defaults.panels, e?.defaults?.panels),
948
+ rows: it(Z.defaults.rows, e?.defaults?.rows),
949
+ row: Ve(Z.defaults.row, e?.defaults?.row),
950
+ cols: it(Z.defaults.cols, e?.defaults?.cols),
951
+ col: He(Z.defaults.col, e?.defaults?.col),
952
+ grid: it(Z.defaults.grid, e?.defaults?.grid),
953
+ cell: Be(Z.defaults.cell, e?.defaults?.cell),
954
+ div: Be(Z.defaults.div, e?.defaults?.div),
955
+ text: We(Z.defaults.text, e?.defaults?.text),
956
+ heading: Ge(Z.defaults.heading, e?.defaults?.heading),
957
+ textLink: Ke(Z.defaults.textLink, e?.defaults?.textLink),
958
+ button: et(Z.defaults.button, e?.defaults?.button),
959
+ chip: qe(Z.defaults.chip, e?.defaults?.chip),
960
+ input: n,
961
+ textarea: Ye({
962
+ ...n,
963
+ resize: Z.defaults.textarea.resize,
964
+ rows: Z.defaults.textarea.rows
965
+ }, e?.defaults?.textarea),
966
+ select: Xe({
967
+ ...n,
968
+ listMaxHeight: Z.defaults.select.listMaxHeight,
969
+ listOffset: Z.defaults.select.listOffset,
970
+ optionPaddingX: Z.defaults.select.optionPaddingX,
971
+ optionPaddingY: Z.defaults.select.optionPaddingY,
972
+ listZIndex: Z.defaults.select.listZIndex,
973
+ listShadow: Z.defaults.select.listShadow
974
+ }, e?.defaults?.select),
975
+ switch: Ze(Z.defaults.switch, e?.defaults?.switch),
976
+ checkbox: Qe(Z.defaults.checkbox, e?.defaults?.checkbox),
977
+ radio: $e(Z.defaults.radio, e?.defaults?.radio)
978
+ }
979
+ };
980
+ }
981
+ //#endregion
982
+ //#region src/theme/PanelizeProvider.tsx
983
+ function ut(e) {
984
+ return !!e && "colorSchemes" in e && e.colorSchemes?.dark?.muted != null && e.colorSchemes?.light?.muted != null;
985
+ }
986
+ var dt = {
987
+ background: "--panelize-app-bg",
988
+ text: "--panelize-app-text"
989
+ }, ft = t(Z), pt = d.div`
990
+ position: relative;
991
+ min-height: 100%;
992
+ height: 100%;
993
+ color-scheme: ${({ $colorScheme: e }) => e};
994
+ ${({ $background: e }) => e ? u`
995
+ ${dt.background}: ${e};
996
+ background: var(${dt.background});
997
+ ` : ""}
998
+ ${({ $text: e }) => e ? u`
999
+ ${dt.text}: ${e};
1000
+ color: var(${dt.text});
1001
+ ` : ""}
1002
+ `;
1003
+ function mt({ theme: e, mode: t = "dark", children: n }) {
1004
+ let r = s(() => ut(e) ? e : lt(e), [e]), i = s(() => ct(r, t), [r, t]), a = i.colors.app;
1005
+ return /* @__PURE__ */ p(ft.Provider, {
1006
+ value: i,
1007
+ children: /* @__PURE__ */ p(pt, {
1008
+ $colorScheme: t,
1009
+ $background: a?.background,
1010
+ $text: a?.text,
1011
+ children: n
1012
+ })
1013
+ });
1014
+ }
1015
+ function Q() {
1016
+ return r(ft);
1017
+ }
1018
+ //#endregion
1019
+ //#region src/components/layout/Panel.tsx
1020
+ var $ = {
1021
+ background: "--panelize-bg",
1022
+ text: "--panelize-text",
1023
+ textMuted: "--panelize-text-muted",
1024
+ textHighlighted: "--panelize-text-highlighted",
1025
+ border: "--panelize-border"
1026
+ }, ht = d.div`
1027
+ position: relative;
1028
+ ${({ $edges: e }) => R(e)}
1029
+ ${({ $size: e, $fill: t }) => L(e, t)}
1030
+ border-width: ${({ $borderWidth: e }) => e};
1031
+ border-style: solid;
1032
+ border-radius: ${({ $borderRadius: e }) => e};
1033
+ background: var(${$.background});
1034
+ color: var(${$.text});
1035
+ border-color: var(${$.border});
1036
+ ${({ $colors: e, $borderColor: t }) => u`
1037
+ ${$.background}: ${e.background};
1038
+ ${$.text}: ${e.text.base};
1039
+ ${$.textMuted}: ${e.text.muted};
1040
+ ${$.textHighlighted}: ${e.text.highlighted};
1041
+ ${$.border}: ${t};
1042
+ `}
1043
+ ${({ $flex: e }) => _e(e, !0)}
1044
+ ${({ $scroll: e }) => H(e)}
1045
+ ${({ $trackKind: e, $alignX: t, $alignY: n }) => G(e, t, n)}
1046
+ ${({ $customCss: e }) => e ?? ""}
1047
+ `;
1048
+ function gt(e) {
1049
+ let { spacing: t, size: n, rest: r } = F(e), { flex: i, fill: a, alignX: o, alignY: s, variant: c = "base", css: l, borderWidth: u, borderX: d, borderY: f, borderTop: m, borderRight: h, borderBottom: g, borderLeft: _, borderRadius: v, borderColor: y, scroll: b, ...x } = r, { colors: S, space: C, borderWidths: w, radii: T, defaults: E, brand: D, status: O } = Q(), k = ye();
1050
+ return /* @__PURE__ */ p(ht, {
1051
+ $flex: i,
1052
+ $fill: a,
1053
+ $colors: S[c],
1054
+ $edges: P(t, E.panel, C),
1055
+ $size: I(n, C),
1056
+ $borderWidth: oe({
1057
+ borderWidth: u,
1058
+ borderX: d,
1059
+ borderY: f,
1060
+ borderTop: m,
1061
+ borderRight: h,
1062
+ borderBottom: g,
1063
+ borderLeft: _
1064
+ }, E.panel.borderWidth, w),
1065
+ $borderRadius: M(v, E.panel.borderRadius, T),
1066
+ $borderColor: ce(y, c, S, D, O),
1067
+ $scroll: b,
1068
+ $alignX: o,
1069
+ $alignY: s,
1070
+ $trackKind: k,
1071
+ $customCss: l,
1072
+ ...x
1073
+ });
1074
+ }
1075
+ //#endregion
1076
+ //#region src/components/text/color.ts
1077
+ function _t(e) {
1078
+ return !!e && y.includes(e);
1079
+ }
1080
+ function vt(e) {
1081
+ return !!e && b.includes(e);
1082
+ }
1083
+ function yt(e) {
1084
+ return _t(e) || vt(e);
1085
+ }
1086
+ function bt(e, t, n) {
1087
+ return _t(e) ? t[e] : vt(e) ? n[e] : {
1088
+ base: e,
1089
+ hover: e,
1090
+ active: e
1091
+ };
1092
+ }
1093
+ function xt(e, t, n) {
1094
+ return bt(e, t, n).base;
1095
+ }
1096
+ function St(e, t, n, r, i) {
1097
+ return e !== void 0 && yt(e) ? bt(e, r, i).base : e || (t ? `var(${$.textHighlighted})` : n ? `var(${$.textMuted})` : `var(${$.text})`);
1098
+ }
1099
+ function Ct(e, t, n, r) {
1100
+ let i = e !== void 0 && yt(e) ? bt(e, n, r) : void 0;
1101
+ if (t === "inherit") {
1102
+ let e = `var(${$.text})`;
1103
+ return {
1104
+ hover: e,
1105
+ active: i?.active ?? e
1106
+ };
1107
+ }
1108
+ if (yt(t)) {
1109
+ let i = bt(t, n, r);
1110
+ return {
1111
+ hover: e === t ? i.hover : i.base,
1112
+ active: i.active
1113
+ };
1114
+ }
1115
+ return {
1116
+ hover: t,
1117
+ active: i?.active ?? t
1118
+ };
1119
+ }
1120
+ //#endregion
1121
+ //#region src/components/buttons/Button.tsx
1122
+ var wt = d.button`
1123
+ appearance: none;
1124
+ display: ${({ $fill: e }) => e ? "flex" : "inline-flex"};
1125
+ align-items: center;
1126
+ justify-content: center;
1127
+ gap: ${({ $gap: e }) => e};
1128
+ ${({ $fill: e }) => e ? u`
1129
+ width: 100%;
1130
+ height: 100%;
1131
+ ` : ""}
1132
+ margin: 0;
1133
+ box-sizing: border-box;
1134
+ cursor: pointer;
1135
+ font-family: ${({ $family: e }) => e};
1136
+ font-size: ${({ $size: e }) => e};
1137
+ font-weight: ${({ $weight: e }) => e};
1138
+ line-height: ${({ $lineHeight: e }) => e};
1139
+ padding: ${({ $paddingY: e, $paddingX: t }) => `${e} ${t}`};
1140
+ border-width: ${({ $borderWidth: e }) => e};
1141
+ border-style: solid;
1142
+ border-radius: ${({ $borderRadius: e }) => e};
1143
+ border-color: ${({ $restBorder: e }) => e};
1144
+ background: ${({ $restBg: e }) => e};
1145
+ color: ${({ $restFg: e }) => e};
1146
+ &:focus-visible {
1147
+ outline: 2px solid currentColor;
1148
+ outline-offset: 2px;
1149
+ }
1150
+ &:hover:not(:disabled) {
1151
+ background: ${({ $hoverBg: e }) => e};
1152
+ color: ${({ $hoverFg: e }) => e};
1153
+ border-color: ${({ $hoverBorder: e }) => e};
1154
+ }
1155
+ &:active:not(:disabled) {
1156
+ background: ${({ $activeBg: e }) => e};
1157
+ color: ${({ $activeFg: e }) => e};
1158
+ border-color: ${({ $activeBorder: e }) => e};
1159
+ }
1160
+ &:disabled {
1161
+ cursor: not-allowed;
1162
+ opacity: 0.45;
1163
+ }
1164
+ ${({ $italic: e }) => e ? u`
1165
+ font-style: italic;
1166
+ ` : ""}
1167
+ ${({ $uppercase: e }) => e ? u`
1168
+ text-transform: uppercase;
1169
+ ` : ""}
1170
+ ${({ $customCss: e }) => e ?? ""}
1171
+ `;
1172
+ function Tt(e, t, n, r) {
1173
+ return yt(e) ? bt(e, t, n)[r] : e;
1174
+ }
1175
+ function Et(e, t, n) {
1176
+ return t !== void 0 && !yt(t) ? t : e[n];
1177
+ }
1178
+ function Dt(e) {
1179
+ let { color: t, outline: n, size: r, weight: i, family: a, italic: o, uppercase: s, fill: c, label: l, css: u, padding: d, paddingX: f, paddingY: m, borderWidth: h, borderRadius: g, background: _, ink: v, type: y = "button", children: b, ...x } = e, { fontSizes: S, fontWeights: C, fontFamilies: w, lineHeight: T, space: E, borderWidths: D, radii: O, defaults: k, brand: A, status: j, colors: N } = Q(), P = bt(t ?? k.button.color, A, j), F = !n, ee = k.button.hover, I = Tt(ee.color, A, j, "base"), L = (e, t, n) => se(e, t, n, N, A, j), te = (e) => {
1180
+ let t = L(_, "background", e);
1181
+ return t === void 0 ? F ? e === "base" ? P.base : Et(P, ee.background, e) : "transparent" : t;
1182
+ }, R = (e) => {
1183
+ let t = L(v, "text", e);
1184
+ return t === void 0 ? F ? e === "base" ? k.button.ink : I : P[e] : t;
1185
+ }, ne = te("base"), re = te("hover"), ie = te("active"), ae = R("base"), oe = R("hover"), z = R("active"), ce = F ? ne : P.base, le = F ? re : P.hover, ue = F ? ie : P.active;
1186
+ return /* @__PURE__ */ p(wt, {
1187
+ type: y,
1188
+ $family: w[a ?? "base"],
1189
+ $size: M(r, k.button.size, S),
1190
+ $weight: M(i, k.button.weight, C),
1191
+ $lineHeight: T,
1192
+ $paddingX: M(f ?? d, k.button.paddingX, E),
1193
+ $paddingY: M(m ?? d, k.button.paddingY, E),
1194
+ $gap: M(void 0, k.button.gap, E),
1195
+ $borderWidth: M(h, k.button.borderWidth, D),
1196
+ $borderRadius: M(g, k.button.borderRadius, O),
1197
+ $restBg: ne,
1198
+ $restFg: ae,
1199
+ $restBorder: ce,
1200
+ $hoverBg: re,
1201
+ $hoverFg: oe,
1202
+ $hoverBorder: le,
1203
+ $activeBg: ie,
1204
+ $activeFg: z,
1205
+ $activeBorder: ue,
1206
+ $italic: o,
1207
+ $uppercase: s,
1208
+ $fill: c,
1209
+ $customCss: u,
1210
+ ...x,
1211
+ children: b ?? l
1212
+ });
1213
+ }
1214
+ //#endregion
1215
+ //#region src/components/chips/Chip.tsx
1216
+ var Ot = d.span`
1217
+ display: inline-flex;
1218
+ align-items: center;
1219
+ justify-content: center;
1220
+ gap: ${({ $gap: e }) => e};
1221
+ margin: 0;
1222
+ box-sizing: border-box;
1223
+ white-space: nowrap;
1224
+ font-family: ${({ $family: e }) => e};
1225
+ font-size: ${({ $size: e }) => e};
1226
+ font-weight: ${({ $weight: e }) => e};
1227
+ line-height: ${({ $lineHeight: e }) => e};
1228
+ padding: ${({ $paddingY: e, $paddingX: t }) => `${e} ${t}`};
1229
+ border-width: ${({ $borderWidth: e }) => e};
1230
+ border-style: solid;
1231
+ border-color: ${({ $borderColor: e }) => e};
1232
+ border-radius: ${({ $borderRadius: e }) => e};
1233
+ background: ${({ $bg: e }) => e};
1234
+ color: ${({ $fg: e }) => e};
1235
+ ${({ $uppercase: e }) => e ? "text-transform: uppercase;" : ""}
1236
+ ${({ $customCss: e }) => e ?? ""}
1237
+ `;
1238
+ function kt(e) {
1239
+ let { color: t, size: n, weight: r, family: i, uppercase: a, label: o, css: s, padding: c, paddingX: l, paddingY: u, borderWidth: d, borderRadius: f, background: m, ink: h, borderColor: g, children: _, ...v } = e, { fontSizes: y, fontWeights: b, fontFamilies: x, lineHeight: S, space: C, borderWidths: w, radii: T, defaults: E, brand: D, status: O, colors: k } = Q(), A = E.chip, j = bt(t ?? A.color, D, O).base, N = `color-mix(in srgb, ${j} ${A.tint}, var(${$.background}, transparent))`, P = z(m, "background", k, D, O) ?? N, F = z(h, "text", k, D, O) ?? j, ee = z(g, "border", k, D, O) ?? j;
1240
+ return /* @__PURE__ */ p(Ot, {
1241
+ $family: x[i ?? "base"],
1242
+ $size: M(n, A.size, y),
1243
+ $weight: M(r, A.weight, b),
1244
+ $lineHeight: S,
1245
+ $paddingX: M(l ?? c, A.paddingX, C),
1246
+ $paddingY: M(u ?? c, A.paddingY, C),
1247
+ $gap: M(void 0, A.gap, C),
1248
+ $borderWidth: M(d, "none", w),
1249
+ $borderRadius: M(f, A.borderRadius, T),
1250
+ $borderColor: ee,
1251
+ $bg: P,
1252
+ $fg: F,
1253
+ $uppercase: a ?? A.uppercase,
1254
+ $customCss: s,
1255
+ ...v,
1256
+ children: _ ?? o
1257
+ });
1258
+ }
1259
+ //#endregion
1260
+ //#region src/components/forms/Checkbox.tsx
1261
+ function At(e, t) {
1262
+ typeof e == "function" ? e(t) : e && (e.current = t);
1263
+ }
1264
+ var jt = d.input`
1265
+ appearance: none;
1266
+ margin: 0;
1267
+ flex-shrink: 0;
1268
+ box-sizing: border-box;
1269
+ position: relative;
1270
+ display: inline-block;
1271
+ vertical-align: middle;
1272
+ color: inherit;
1273
+ width: ${({ $width: e }) => e};
1274
+ height: ${({ $height: e }) => e};
1275
+ font-size: ${({ $size: e }) => e};
1276
+ padding: 0;
1277
+ border: ${({ $borderWidth: e }) => e} solid ${({ $borderColor: e }) => e};
1278
+ border-radius: ${({ $radius: e }) => e};
1279
+ background: ${({ $off: e }) => e};
1280
+ cursor: pointer;
1281
+ transition:
1282
+ background 120ms ease,
1283
+ border-color 120ms ease,
1284
+ box-shadow 120ms ease;
1285
+ &::after {
1286
+ content: '';
1287
+ position: absolute;
1288
+ box-sizing: border-box;
1289
+ pointer-events: none;
1290
+ opacity: 0;
1291
+ }
1292
+ &:hover:not(:disabled):not(:checked):not(:indeterminate) {
1293
+ border-color: ${({ $hoverBorder: e }) => e};
1294
+ }
1295
+ &:active:not(:disabled):not(:checked):not(:indeterminate) {
1296
+ border-color: ${({ $activeBorder: e }) => e};
1297
+ }
1298
+ &:checked,
1299
+ &:indeterminate {
1300
+ background: ${({ $on: e }) => e};
1301
+ border-color: ${({ $on: e }) => e};
1302
+ }
1303
+ &:is(:checked, :indeterminate):hover:not(:disabled) {
1304
+ background: ${({ $hoverOn: e }) => e};
1305
+ border-color: ${({ $hoverOn: e }) => e};
1306
+ }
1307
+ &:is(:checked, :indeterminate):active:not(:disabled) {
1308
+ background: ${({ $activeOn: e }) => e};
1309
+ border-color: ${({ $activeOn: e }) => e};
1310
+ }
1311
+ &:checked:not(:indeterminate)::after {
1312
+ opacity: ${({ $hideCheckIcon: e }) => +!e};
1313
+ left: 50%;
1314
+ top: 42%;
1315
+ width: 0.3em;
1316
+ height: 0.52em;
1317
+ border: solid ${({ $ink: e }) => e};
1318
+ border-width: 0 0.17em 0.17em 0;
1319
+ transform: translate(-50%, -50%) rotate(45deg);
1320
+ }
1321
+ &:indeterminate::after {
1322
+ opacity: 1;
1323
+ left: 50%;
1324
+ top: 50%;
1325
+ width: 50%;
1326
+ height: 0.17em;
1327
+ border: none;
1328
+ border-radius: 999px;
1329
+ background: ${({ $ink: e }) => e};
1330
+ transform: translate(-50%, -50%);
1331
+ }
1332
+ &:focus-visible {
1333
+ outline: none;
1334
+ box-shadow: 0 0 0 2px color-mix(in srgb, ${({ $on: e }) => e} 18%, transparent);
1335
+ }
1336
+ &:disabled {
1337
+ cursor: not-allowed;
1338
+ }
1339
+ &:disabled:is(:checked, :indeterminate) {
1340
+ opacity: 0.45;
1341
+ }
1342
+ @media (prefers-reduced-motion: reduce) {
1343
+ transition: none;
1344
+ }
1345
+ ${({ $customCss: e }) => e ?? ""}
1346
+ `;
1347
+ function Mt(e) {
1348
+ let { color: t, size: n, css: r, background: i, ink: a, borderColor: o, borderWidth: s, borderRadius: c, width: l, height: u, indeterminate: d = !1, hideCheckIcon: f = !1, ref: m, ...h } = e, { space: g, radii: _, fontSizes: v, borderWidths: y, defaults: b, brand: x, status: S, colors: C } = Q(), w = b.checkbox, T = bt(t ?? w.color, x, S), E = z(i, "background", C, x, S) ?? "transparent", D = se(a, "text", "base", C, x, S) ?? w.ink, O = z(o, "border", C, x, S) ?? "currentColor", k = M(n, w.size, v), A = k, j = l === void 0 ? A : M(l, k, g), N = u === void 0 ? A : M(u, k, g);
1349
+ return /* @__PURE__ */ p(jt, {
1350
+ $width: j,
1351
+ $height: N,
1352
+ $size: k,
1353
+ $radius: M(c, w.borderRadius, _),
1354
+ $borderWidth: M(s, w.borderWidth, y),
1355
+ $borderColor: O,
1356
+ $hoverBorder: O,
1357
+ $activeBorder: O,
1358
+ $off: E,
1359
+ $on: T.base,
1360
+ $hoverOn: T.hover,
1361
+ $activeOn: T.active,
1362
+ $ink: D,
1363
+ $hideCheckIcon: f,
1364
+ $customCss: r,
1365
+ ...h,
1366
+ ref: (e) => {
1367
+ e && (e.indeterminate = d), At(m, e);
1368
+ },
1369
+ type: "checkbox"
1370
+ });
1371
+ }
1372
+ Mt.displayName = "Checkbox";
1373
+ //#endregion
1374
+ //#region src/components/forms/field.ts
1375
+ var Nt = u`
1376
+ appearance: none;
1377
+ margin: 0;
1378
+ box-sizing: border-box;
1379
+ min-width: 0;
1380
+ ${({ $fill: e }) => e ? u`
1381
+ display: block;
1382
+ width: 100%;
1383
+ height: 100%;
1384
+ ` : ""}
1385
+ font-family: ${({ $family: e }) => e};
1386
+ font-size: ${({ $size: e }) => e};
1387
+ font-weight: ${({ $weight: e }) => e};
1388
+ line-height: ${({ $lineHeight: e }) => e};
1389
+ padding: ${({ $paddingY: e, $paddingX: t }) => `${e} ${t}`};
1390
+ border-width: ${({ $borderWidth: e }) => e};
1391
+ border-style: solid;
1392
+ border-radius: ${({ $borderRadius: e }) => e};
1393
+ border-color: ${({ $borderColor: e }) => e};
1394
+ background: ${({ $bg: e }) => e};
1395
+ color: ${({ $ink: e }) => e};
1396
+ caret-color: ${({ $focus: e }) => e};
1397
+ &::placeholder {
1398
+ color: var(${$.textMuted});
1399
+ opacity: 1;
1400
+ }
1401
+ ${({ $focus: e, $invalid: t }) => u`
1402
+ &:focus {
1403
+ outline: none;
1404
+ border-color: ${e};
1405
+ box-shadow: 0 0 0 2px color-mix(in srgb, ${e} 18%, transparent);
1406
+ }
1407
+ &:user-invalid,
1408
+ &[aria-invalid='true'] {
1409
+ border-color: ${t};
1410
+ box-shadow: 0 0 0 2px color-mix(in srgb, ${t} 18%, transparent);
1411
+ caret-color: ${t};
1412
+ }
1413
+ &:user-invalid:focus,
1414
+ &[aria-invalid='true']:focus {
1415
+ border-color: ${t};
1416
+ box-shadow: 0 0 0 2px color-mix(in srgb, ${t} 18%, transparent);
1417
+ caret-color: ${t};
1418
+ }
1419
+ `}
1420
+ &:disabled {
1421
+ cursor: not-allowed;
1422
+ opacity: 0.45;
1423
+ }
1424
+ &:is(input, textarea):read-only {
1425
+ opacity: 0.45;
1426
+ }
1427
+ ${({ $italic: e }) => e ? u`
1428
+ font-style: italic;
1429
+ ` : ""}
1430
+ ${({ $uppercase: e }) => e ? u`
1431
+ text-transform: uppercase;
1432
+ ` : ""}
1433
+ `, Pt = d.input`
1434
+ ${Nt}
1435
+ ${({ $customCss: e }) => e ?? ""}
1436
+ `;
1437
+ function Ft(e) {
1438
+ let { color: t, size: n, weight: r, family: i, italic: a, uppercase: o, fill: s, css: c, padding: l, paddingX: u, paddingY: d, borderWidth: f, borderRadius: m, background: h, ink: g, borderColor: _, type: v = "text", ...y } = e, { fontSizes: b, fontWeights: x, fontFamilies: S, lineHeight: C, space: w, borderWidths: T, radii: E, defaults: D, brand: O, status: k, colors: A } = Q(), j = D.input;
1439
+ return /* @__PURE__ */ p(Pt, {
1440
+ type: v,
1441
+ $family: S[i ?? "base"],
1442
+ $size: M(n, j.size, b),
1443
+ $weight: M(r, j.weight, x),
1444
+ $lineHeight: C,
1445
+ $paddingX: M(u ?? l, j.paddingX, w),
1446
+ $paddingY: M(d ?? l, j.paddingY, w),
1447
+ $borderWidth: M(f, j.borderWidth, T),
1448
+ $borderRadius: M(m, j.borderRadius, E),
1449
+ $bg: z(h, "background", A, O, k) ?? `var(${$.background})`,
1450
+ $ink: z(g, "text", A, O, k) ?? `var(${$.text})`,
1451
+ $borderColor: z(_, "border", A, O, k) ?? `var(${$.border})`,
1452
+ $focus: xt(t ?? j.color, O, k),
1453
+ $invalid: k.danger.base,
1454
+ $italic: a,
1455
+ $uppercase: o,
1456
+ $fill: s,
1457
+ $customCss: c,
1458
+ ...y
1459
+ });
1460
+ }
1461
+ //#endregion
1462
+ //#region src/components/text/typography.ts
1463
+ var It = t(null);
1464
+ function Lt() {
1465
+ return r(It);
1466
+ }
1467
+ var Rt = u`
1468
+ margin: 0;
1469
+ padding: 0;
1470
+ font-family: ${({ $family: e }) => e};
1471
+ font-size: ${({ $size: e }) => e};
1472
+ color: ${({ $color: e }) => e};
1473
+ font-weight: ${({ $weight: e }) => e};
1474
+ line-height: ${({ $lineHeight: e }) => e};
1475
+ ${({ $italic: e }) => e ? u`
1476
+ font-style: italic;
1477
+ ` : ""}
1478
+ ${({ $underlined: e }) => e ? u`
1479
+ text-decoration: underline;
1480
+ ` : ""}
1481
+ ${({ $uppercase: e }) => e ? u`
1482
+ text-transform: uppercase;
1483
+ ` : ""}
1484
+ `, zt = ":is(button, input, select, textarea)", Bt = d.label`
1485
+ display: inline-block;
1486
+ cursor: ${({ $clickable: e }) => e ? "pointer" : "default"};
1487
+ ${Rt}
1488
+ line-height: 1;
1489
+ text-box: trim-both cap alphabetic;
1490
+ &[for],
1491
+ &:has(${zt}) {
1492
+ cursor: pointer;
1493
+ }
1494
+ &:has(${zt}:disabled) {
1495
+ cursor: not-allowed;
1496
+ }
1497
+ &:has(${zt}) {
1498
+ text-box: unset;
1499
+ }
1500
+ ${({ $customCss: e }) => e ?? ""}
1501
+ `;
1502
+ function Vt(e) {
1503
+ let { size: t, color: n, muted: r, highlighted: i, weight: a, family: o, italic: s, underlined: c, uppercase: l, label: u, css: d, children: f, onClick: m, ...h } = e, { fontSizes: g, fontWeights: _, fontFamilies: v, defaults: y, brand: b, status: x } = Q(), S = v[o ?? "base"], C = M(t, y.text.size, g), w = M(a, y.text.weight, _);
1504
+ return /* @__PURE__ */ p(It.Provider, {
1505
+ value: {
1506
+ family: S,
1507
+ size: C,
1508
+ weight: w,
1509
+ lineHeight: 1
1510
+ },
1511
+ children: /* @__PURE__ */ p(Bt, {
1512
+ $family: S,
1513
+ $size: C,
1514
+ $color: St(n, i, r, b, x),
1515
+ $weight: w,
1516
+ $lineHeight: 1,
1517
+ $italic: s,
1518
+ $underlined: c,
1519
+ $uppercase: l,
1520
+ $clickable: typeof m == "function",
1521
+ $customCss: d,
1522
+ onClick: m,
1523
+ ...h,
1524
+ children: f ?? u
1525
+ })
1526
+ });
1527
+ }
1528
+ Vt.displayName = "Label";
1529
+ //#endregion
1530
+ //#region src/components/forms/NumberInput.tsx
1531
+ function Ht(e) {
1532
+ e.preventDefault(), e.currentTarget.blur();
1533
+ }
1534
+ function Ut(e) {
1535
+ let { onWheel: t, ...n } = e;
1536
+ return /* @__PURE__ */ p(Ft, {
1537
+ ...n,
1538
+ type: "number",
1539
+ onWheel: (e) => {
1540
+ Ht(e), t?.(e);
1541
+ }
1542
+ });
1543
+ }
1544
+ Ut.displayName = "NumberInput";
1545
+ //#endregion
1546
+ //#region src/components/forms/Radio.tsx
1547
+ var Wt = d.input`
1548
+ appearance: none;
1549
+ margin: 0;
1550
+ flex-shrink: 0;
1551
+ box-sizing: border-box;
1552
+ position: relative;
1553
+ display: inline-block;
1554
+ vertical-align: middle;
1555
+ color: inherit;
1556
+ width: ${({ $width: e }) => e};
1557
+ height: ${({ $height: e }) => e};
1558
+ font-size: ${({ $size: e }) => e};
1559
+ padding: 0;
1560
+ border: ${({ $borderWidth: e }) => e} solid ${({ $borderColor: e }) => e};
1561
+ border-radius: ${({ $radius: e }) => e};
1562
+ background: ${({ $off: e }) => e};
1563
+ cursor: pointer;
1564
+ transition:
1565
+ background 120ms ease,
1566
+ border-color 120ms ease,
1567
+ box-shadow 120ms ease;
1568
+ &::after {
1569
+ content: '';
1570
+ position: absolute;
1571
+ box-sizing: border-box;
1572
+ pointer-events: none;
1573
+ opacity: 0;
1574
+ left: 50%;
1575
+ top: 50%;
1576
+ width: calc(100% - 2 * ${({ $inset: e }) => e});
1577
+ height: calc(100% - 2 * ${({ $inset: e }) => e});
1578
+ border-radius: min(${({ $radius: e }) => e}, 50%);
1579
+ background: ${({ $dot: e }) => e};
1580
+ transform: translate(-50%, -50%);
1581
+ transition: background 120ms ease;
1582
+ }
1583
+ &:hover:not(:disabled):not(:checked) {
1584
+ border-color: ${({ $hoverBorder: e }) => e};
1585
+ }
1586
+ &:active:not(:disabled):not(:checked) {
1587
+ border-color: ${({ $activeBorder: e }) => e};
1588
+ }
1589
+ &:checked {
1590
+ border-color: ${({ $on: e }) => e};
1591
+ }
1592
+ &:checked::after {
1593
+ opacity: 1;
1594
+ }
1595
+ &:checked:hover:not(:disabled) {
1596
+ border-color: ${({ $hoverOn: e }) => e};
1597
+ }
1598
+ &:checked:hover:not(:disabled)::after {
1599
+ background: ${({ $hoverDot: e }) => e};
1600
+ }
1601
+ &:checked:active:not(:disabled) {
1602
+ border-color: ${({ $activeOn: e }) => e};
1603
+ }
1604
+ &:checked:active:not(:disabled)::after {
1605
+ background: ${({ $activeDot: e }) => e};
1606
+ }
1607
+ &:focus-visible {
1608
+ outline: none;
1609
+ box-shadow: 0 0 0 2px color-mix(in srgb, ${({ $on: e }) => e} 18%, transparent);
1610
+ }
1611
+ &:disabled {
1612
+ cursor: not-allowed;
1613
+ }
1614
+ &:disabled:checked {
1615
+ opacity: 0.45;
1616
+ }
1617
+ @media (prefers-reduced-motion: reduce) {
1618
+ transition: none;
1619
+ &::after {
1620
+ transition: none;
1621
+ }
1622
+ }
1623
+ ${({ $customCss: e }) => e ?? ""}
1624
+ `;
1625
+ function Gt(e) {
1626
+ let { color: t, size: n, css: r, background: i, ink: a, borderColor: o, borderWidth: s, borderRadius: c, width: l, height: u, ...d } = e, { space: f, radii: m, fontSizes: h, borderWidths: g, defaults: _, brand: v, status: y, colors: b } = Q(), x = _.radio, S = bt(t ?? x.color, v, y), C = z(i, "background", b, v, y) ?? "transparent", w = se(a, "text", "base", b, v, y), T = se(a, "text", "hover", b, v, y), E = se(a, "text", "active", b, v, y), D = z(o, "border", b, v, y) ?? "currentColor", O = M(n, x.size, h), k = O, A = l === void 0 ? k : M(l, O, f), j = u === void 0 ? k : M(u, O, f), N = M(c, x.borderRadius, m);
1627
+ return /* @__PURE__ */ p(Wt, {
1628
+ $width: A,
1629
+ $height: j,
1630
+ $size: O,
1631
+ $radius: N,
1632
+ $borderWidth: M(s, x.borderWidth, g),
1633
+ $borderColor: D,
1634
+ $hoverBorder: D,
1635
+ $activeBorder: D,
1636
+ $off: C,
1637
+ $on: S.base,
1638
+ $hoverOn: S.hover,
1639
+ $activeOn: S.active,
1640
+ $dot: w ?? S.base,
1641
+ $hoverDot: T ?? w ?? S.hover,
1642
+ $activeDot: E ?? w ?? S.active,
1643
+ $inset: `calc(${O} * ${x.insetFactor})`,
1644
+ $customCss: r,
1645
+ ...d,
1646
+ type: "radio"
1647
+ });
1648
+ }
1649
+ Gt.displayName = "Radio";
1650
+ //#endregion
1651
+ //#region src/components/forms/selects/listbox.ts
1652
+ function Kt(e) {
1653
+ return null;
1654
+ }
1655
+ Kt.displayName = "Option";
1656
+ function qt(e) {
1657
+ return e.label === void 0 ? typeof e.children == "string" ? e.children : e.value : e.label;
1658
+ }
1659
+ function Jt(e) {
1660
+ return n(e) && e.type === Kt;
1661
+ }
1662
+ function Yt(t, n) {
1663
+ let r = /* @__PURE__ */ new Map();
1664
+ for (let e of t ?? []) r.set(e.value, {
1665
+ value: e.value,
1666
+ label: e.label,
1667
+ disabled: e.disabled
1668
+ });
1669
+ return e.forEach(n, (e) => {
1670
+ if (!Jt(e)) return;
1671
+ let { value: t, disabled: n } = e.props;
1672
+ r.set(t, {
1673
+ value: t,
1674
+ label: qt(e.props),
1675
+ disabled: n
1676
+ });
1677
+ }), [...r.values()];
1678
+ }
1679
+ function Xt(e, t, n, r) {
1680
+ return !t || r || e.some((e) => e.value === "") ? e : [{
1681
+ value: "",
1682
+ label: typeof t == "string" ? t : n ?? ""
1683
+ }, ...e];
1684
+ }
1685
+ function Zt(e, t, n) {
1686
+ if (!n || t === "") return e;
1687
+ let r = e.findIndex((e) => e.value === t);
1688
+ if (r <= 0) return e;
1689
+ let i = e.slice(), [a] = i.splice(r, 1);
1690
+ return a && i.unshift(a), i;
1691
+ }
1692
+ function Qt(e, t, n) {
1693
+ if (!n || t.length === 0) return e;
1694
+ let r = new Set(t), i = [], a = [];
1695
+ for (let t of e) r.has(t.value) ? i.push(t) : a.push(t);
1696
+ return [...i, ...a];
1697
+ }
1698
+ function $t(e) {
1699
+ return e.findIndex((e) => !e.disabled);
1700
+ }
1701
+ function en(e) {
1702
+ for (let t = e.length - 1; t >= 0; --t) if (!e[t]?.disabled) return t;
1703
+ return -1;
1704
+ }
1705
+ function tn(e, t, n) {
1706
+ if (e.length === 0) return -1;
1707
+ let r = t;
1708
+ for (let t = 0; t < e.length; t += 1) if (r = (r + n + e.length) % e.length, !e[r]?.disabled) return r;
1709
+ return t;
1710
+ }
1711
+ function nn(e, t, n) {
1712
+ let r = t.toLowerCase(), i = n < 0 ? 0 : n, a = [...e.slice(i), ...e.slice(0, i)].find((e) => !e.disabled && e.label.toLowerCase().startsWith(r));
1713
+ return a ? e.indexOf(a) : -1;
1714
+ }
1715
+ function rn(e) {
1716
+ let t = getComputedStyle(e), n = {};
1717
+ for (let e of Object.values($)) n[e] = t.getPropertyValue(e).trim();
1718
+ return n;
1719
+ }
1720
+ function an(e, t = 16) {
1721
+ let n = Number.parseFloat(e);
1722
+ if (!Number.isFinite(n)) return 256;
1723
+ if (e.endsWith("rem")) {
1724
+ let e = Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
1725
+ return n * (Number.isFinite(e) ? e : 16);
1726
+ }
1727
+ return e.endsWith("em") ? n * t : n;
1728
+ }
1729
+ function on(e, t, n, r) {
1730
+ let i = e.getBoundingClientRect(), a = Number.parseFloat(getComputedStyle(e).fontSize), o = Number.isFinite(a) ? a : 16, s = an(t, o), c = an(M(void 0, n, r), o), l = window.innerHeight - i.bottom - c, u = i.top - c, d = l < Math.min(s, 120) && u > l, f = Math.max(8, Math.min(s, d ? u : l));
1731
+ return {
1732
+ vars: rn(e),
1733
+ box: {
1734
+ top: d ? i.top - f - c : i.bottom + c,
1735
+ left: i.left,
1736
+ width: i.width,
1737
+ maxHeight: f
1738
+ }
1739
+ };
1740
+ }
1741
+ function sn({ items: e, open: t, onOpenChange: n, activeOnOpen: r, listMaxHeight: a, listOffset: s, space: u }) {
1742
+ let d = t !== void 0, [f, p] = l(!1), m = d ? t : f, [h, g] = l(-1), [_, v] = l(null), [y, b] = l({}), x = c(null), S = c(null), C = c(null), w = c({
1743
+ buffer: "",
1744
+ timer: 0
1745
+ }), T = c(void 0), E = (t) => {
1746
+ g(t), T.current = t >= 0 ? e[t]?.value : void 0;
1747
+ }, D = (e, t) => {
1748
+ E(e ? t ?? r : -1), d || p(e), n?.(e);
1749
+ }, O = (e) => {
1750
+ e >= 0 && E(e);
1751
+ }, k = () => {
1752
+ let e = x.current;
1753
+ if (!e) return;
1754
+ let t = on(e, a, s, u);
1755
+ b(t.vars), v(t.box);
1756
+ };
1757
+ return i(() => {
1758
+ let e = w.current;
1759
+ return () => window.clearTimeout(e.timer);
1760
+ }, []), o(() => {
1761
+ if (!m) return;
1762
+ let t = T.current;
1763
+ if (t === void 0) return;
1764
+ let n = e.findIndex((e) => e.value === t);
1765
+ n >= 0 && n !== h && g(n);
1766
+ }, [
1767
+ e,
1768
+ m,
1769
+ h
1770
+ ]), o(() => {
1771
+ if (!m) return;
1772
+ k();
1773
+ let e = () => k();
1774
+ return window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
1775
+ window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
1776
+ };
1777
+ }, [
1778
+ m,
1779
+ a,
1780
+ s,
1781
+ u
1782
+ ]), o(() => {
1783
+ if (!m) return;
1784
+ let e = C.current?.querySelector("[data-active=\"true\"]");
1785
+ e instanceof HTMLElement && e.scrollIntoView?.({ block: "nearest" });
1786
+ }, [m, h]), i(() => {
1787
+ if (!m) return;
1788
+ let e = (e) => {
1789
+ let t = e.target;
1790
+ t instanceof Node && (S.current?.contains(t) || C.current?.contains(t) || (D(!1), x.current?.blur()));
1791
+ };
1792
+ return document.addEventListener("mousedown", e), () => {
1793
+ document.removeEventListener("mousedown", e);
1794
+ };
1795
+ }, [
1796
+ m,
1797
+ d,
1798
+ n,
1799
+ e,
1800
+ r
1801
+ ]), {
1802
+ isOpen: m,
1803
+ activeIndex: h,
1804
+ box: _,
1805
+ listVars: y,
1806
+ triggerRef: x,
1807
+ wrapRef: S,
1808
+ listRef: C,
1809
+ typeRef: w,
1810
+ setOpen: D,
1811
+ moveActive: O,
1812
+ placeList: k
1813
+ };
1814
+ }
1815
+ function cn(e, t) {
1816
+ if (e.defaultPrevented || t.disabled) return;
1817
+ let n = e.key, { isOpen: r, items: i, activeIndex: a, showClear: o, readOnly: s, typeRef: c, placeList: l, setOpen: u, moveActive: d, openHighlightDown: f, openHighlightUp: p, onCommit: m, onClear: h, onClosedTypeahead: g, closedTypeaheadFrom: _ } = t;
1818
+ if (!r && (n === "ArrowDown" || n === "ArrowUp" || n === "Enter" || n === " ")) e.preventDefault(), l(), n === "ArrowUp" ? u(!0, p) : u(!0, f);
1819
+ else if (!r) {
1820
+ if ((n === "Backspace" || n === "Delete") && o) {
1821
+ e.preventDefault(), h();
1822
+ return;
1823
+ }
1824
+ if (n.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && !s) {
1825
+ let e = nn(i, n, _ + 1);
1826
+ e >= 0 && i[e] && g(i[e]);
1827
+ }
1828
+ } else if (n === "Escape") e.preventDefault(), u(!1);
1829
+ else if (n === "ArrowDown") e.preventDefault(), d(tn(i, a, 1));
1830
+ else if (n === "ArrowUp") e.preventDefault(), d(tn(i, a, -1));
1831
+ else if (n === "Home") e.preventDefault(), d($t(i));
1832
+ else if (n === "End") e.preventDefault(), d(en(i));
1833
+ else if (n === "Enter" || n === " ") {
1834
+ e.preventDefault();
1835
+ let t = i[a];
1836
+ t && !t.disabled && m(t);
1837
+ } else if (n.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) {
1838
+ e.preventDefault(), window.clearTimeout(c.current.timer), c.current.buffer += n, c.current.timer = window.setTimeout(() => {
1839
+ c.current.buffer = "";
1840
+ }, 400);
1841
+ let t = nn(i, c.current.buffer, a);
1842
+ t >= 0 && d(t);
1843
+ }
1844
+ }
1845
+ //#endregion
1846
+ //#region src/components/forms/selects/listboxChrome.ts
1847
+ var ln = d.span`
1848
+ position: relative;
1849
+ display: ${({ $fill: e }) => e ? "block" : "inline-block"};
1850
+ ${({ $fill: e }) => e ? u`
1851
+ width: 100%;
1852
+ ` : ""}
1853
+ min-width: 0;
1854
+ vertical-align: top;
1855
+ `, un = d.button`
1856
+ position: absolute;
1857
+ z-index: 1;
1858
+ top: 50%;
1859
+ inset-inline-end: ${({ $end: e }) => e};
1860
+ box-sizing: border-box;
1861
+ width: 1.375rem;
1862
+ height: 1.375rem;
1863
+ margin: 0;
1864
+ padding: 0.1875rem;
1865
+ transform: translateY(-50%);
1866
+ border: 0;
1867
+ border-radius: 50%;
1868
+ background: transparent;
1869
+ background-clip: content-box;
1870
+ cursor: pointer;
1871
+ &::before,
1872
+ &::after {
1873
+ content: '';
1874
+ position: absolute;
1875
+ top: 50%;
1876
+ left: 50%;
1877
+ width: 0.58em;
1878
+ height: 0.12em;
1879
+ background: ${({ $ink: e }) => e};
1880
+ }
1881
+ &::before {
1882
+ transform: translate(-50%, -50%) rotate(45deg);
1883
+ }
1884
+ &::after {
1885
+ transform: translate(-50%, -50%) rotate(-45deg);
1886
+ }
1887
+ &:hover {
1888
+ background: color-mix(
1889
+ in srgb,
1890
+ var(${$.textHighlighted}) 16%,
1891
+ var(${$.background})
1892
+ );
1893
+ background-clip: content-box;
1894
+ &::before,
1895
+ &::after {
1896
+ background: ${({ $hoverInk: e }) => e};
1897
+ }
1898
+ }
1899
+ &:disabled {
1900
+ cursor: not-allowed;
1901
+ opacity: 0.45;
1902
+ }
1903
+ `, dn = d.span`
1904
+ min-width: 0;
1905
+ flex: 1 1 auto;
1906
+ overflow: hidden;
1907
+ text-overflow: ellipsis;
1908
+ white-space: nowrap;
1909
+ color: ${({ $ink: e }) => e};
1910
+ -webkit-text-fill-color: ${({ $ink: e }) => e};
1911
+ `, fn = d.button`
1912
+ ${Nt}
1913
+ position: relative;
1914
+ display: ${({ $fill: e }) => e ? "flex" : "inline-flex"};
1915
+ align-items: center;
1916
+ justify-content: flex-start;
1917
+ text-align: left;
1918
+ cursor: pointer;
1919
+ color: ${({ $ink: e }) => e};
1920
+ -webkit-text-fill-color: ${({ $ink: e }) => e};
1921
+ border: ${({ $borderWidth: e, $borderColor: t }) => `${e} solid ${t}`};
1922
+ background-color: ${({ $bg: e }) => e};
1923
+ padding-inline-end: calc(
1924
+ ${({ $paddingX: e, $clearable: t }) => t ? `${e} + 2.15em` : `${e} + 1.15em`}
1925
+ );
1926
+ ${({ $focus: e, $invalid: t }) => u`
1927
+ &:focus,
1928
+ &[aria-expanded='true'] {
1929
+ outline: none;
1930
+ border-color: ${e};
1931
+ box-shadow: 0 0 0 2px color-mix(in srgb, ${e} 18%, transparent);
1932
+ }
1933
+ &[aria-invalid='true'],
1934
+ &[aria-invalid='true']:focus,
1935
+ &[aria-invalid='true'][aria-expanded='true'] {
1936
+ border-color: ${t};
1937
+ box-shadow: 0 0 0 2px color-mix(in srgb, ${t} 18%, transparent);
1938
+ }
1939
+ `}
1940
+ &::after {
1941
+ content: '';
1942
+ position: absolute;
1943
+ inset-inline-end: ${({ $paddingX: e }) => e};
1944
+ top: 50%;
1945
+ width: 0.4em;
1946
+ height: 0.4em;
1947
+ box-sizing: border-box;
1948
+ border-right: 0.12em solid ${({ $muted: e }) => e};
1949
+ border-bottom: 0.12em solid ${({ $muted: e }) => e};
1950
+ transform: ${({ $open: e }) => e ? "translateY(calc(-50% + 0.06em)) rotate(-135deg)" : "translateY(calc(-50% - 0.06em)) rotate(45deg)"};
1951
+ pointer-events: none;
1952
+ }
1953
+ &:disabled {
1954
+ cursor: not-allowed;
1955
+ }
1956
+ ${({ $customCss: e }) => e ?? ""}
1957
+ `, pn = d.ul`
1958
+ box-sizing: border-box;
1959
+ position: fixed;
1960
+ z-index: ${({ $zIndex: e }) => e};
1961
+ top: ${({ $top: e }) => `${e}px`};
1962
+ left: ${({ $left: e }) => `${e}px`};
1963
+ width: ${({ $width: e }) => `${e}px`};
1964
+ max-height: ${({ $maxHeight: e }) => `${e}px`};
1965
+ margin: 0;
1966
+ padding: 0.25rem 0;
1967
+ overflow: auto;
1968
+ list-style: none;
1969
+ font-family: ${({ $family: e }) => e};
1970
+ font-size: ${({ $size: e }) => e};
1971
+ font-weight: ${({ $weight: e }) => e};
1972
+ line-height: ${({ $lineHeight: e }) => e};
1973
+ color: ${({ $ink: e }) => e};
1974
+ -webkit-text-fill-color: ${({ $ink: e }) => e};
1975
+ border: ${({ $borderWidth: e }) => e} solid ${({ $borderColor: e }) => e};
1976
+ border-radius: ${({ $radius: e }) => e};
1977
+ background: ${({ $bg: e }) => e};
1978
+ box-shadow: ${({ $shadow: e }) => e};
1979
+ `, mn = d.li`
1980
+ display: flex;
1981
+ align-items: center;
1982
+ justify-content: flex-start;
1983
+ gap: 0.5em;
1984
+ padding: ${({ $padY: e, $padX: t }) => `${e} ${t}`};
1985
+ cursor: ${({ $disabled: e }) => e ? "not-allowed" : "pointer"};
1986
+ opacity: ${({ $disabled: e }) => e ? .45 : 1};
1987
+ color: ${({ $selected: e, $chroma: t, $ink: n }) => e ? t : n};
1988
+ -webkit-text-fill-color: ${({ $selected: e, $chroma: t, $ink: n }) => e ? t : n};
1989
+ background: ${({ $active: e, $disabled: t }) => e && !t ? `color-mix(in srgb, var(${$.textHighlighted}) 18%, var(${$.background}))` : "transparent"};
1990
+ `, hn = d.span`
1991
+ display: flex;
1992
+ flex-shrink: 0;
1993
+ pointer-events: none;
1994
+ `;
1995
+ function gn(e) {
1996
+ let { ref: t, color: n, size: r, weight: i, family: o, italic: s, uppercase: c, fill: u, css: d, padding: g, paddingX: _, paddingY: v, borderWidth: y, borderRadius: b, background: x, ink: S, borderColor: C, value: w, defaultValue: T, onChange: E, open: D, onOpenChange: O, options: k, placeholder: A, name: j, required: N, clearable: P, selectedAtTop: F, children: ee, disabled: I, readOnly: L, id: te, onKeyDown: R, onClick: ne, onBlur: re, ...ie } = e, { fontSizes: ae, fontWeights: oe, fontFamilies: se, lineHeight: ce, space: le, borderWidths: ue, radii: de, defaults: fe, brand: pe, status: me, colors: he } = Q(), B = fe.select, V = w !== void 0, [ge, _e] = l(() => T ?? []), ve = V ? w ?? [] : ge, H = new Set(ve), U = Qt(Yt(k, ee), ve, !!F), W = U.findIndex((e) => H.has(e.value)), ye = W >= 0 ? W : $t(U), { isOpen: G, activeIndex: K, box: be, listVars: q, triggerRef: J, wrapRef: xe, listRef: Se, typeRef: Ce, setOpen: Y, moveActive: X, placeList: we } = sn({
1997
+ items: U,
1998
+ open: D,
1999
+ onOpenChange: O,
2000
+ activeOnOpen: ye,
2001
+ listMaxHeight: B.listMaxHeight,
2002
+ listOffset: B.listOffset,
2003
+ space: le
2004
+ }), Te = a(), Ee = (e) => {
2005
+ J.current = e, typeof t == "function" ? t(e) : t && (t.current = e);
2006
+ }, De = xt(n ?? B.color, pe, me), Oe = me.danger.base, ke = M(r, B.size, ae), Ae = M(_ ?? g, B.paddingX, le), je = M(v ?? g, B.paddingY, le), Me = M(b, B.borderRadius, de), Ne = M(y, B.borderWidth, ue), Pe = z(x, "background", he, pe, me) ?? `var(${$.background})`, Fe = z(S, "text", he, pe, me) ?? `var(${$.textHighlighted})`, Z = z(C, "border", he, pe, me) ?? `var(${$.border})`, Ie = ve.length === 0, Le = !!P && !N && !Ie && !I && !L, Re = `var(${$.textMuted})`, ze = Ie ? Re : Fe, Be = Ie ? A ?? "" : `${ve.length} selected`, Ve = M(void 0, B.optionPaddingX, le), He = M(void 0, B.optionPaddingY, le), Ue = M(i, B.weight, oe), We = se[o ?? "base"], Ge = n ?? B.color, Ke = (e) => {
2007
+ V || _e(e), E?.(e);
2008
+ }, qe = (e) => {
2009
+ if (!L) {
2010
+ if (H.has(e)) {
2011
+ if (N && ve.length <= 1) return;
2012
+ Ke(ve.filter((t) => t !== e));
2013
+ } else Ke([...ve, e]);
2014
+ }
2015
+ }, Je = (e) => {
2016
+ L || N || Ie || (Ke([]), Y(!1), e && J.current?.blur());
2017
+ }, Ye = (e) => {
2018
+ R?.(e), cn(e, {
2019
+ disabled: I,
2020
+ readOnly: L,
2021
+ isOpen: G,
2022
+ items: U,
2023
+ activeIndex: K,
2024
+ showClear: Le,
2025
+ typeRef: Ce,
2026
+ placeList: we,
2027
+ setOpen: Y,
2028
+ moveActive: X,
2029
+ openHighlightDown: ye,
2030
+ openHighlightUp: W >= 0 ? W : en(U),
2031
+ closedTypeaheadFrom: W,
2032
+ onCommit: (e) => qe(e.value),
2033
+ onClear: () => Je(!1),
2034
+ onClosedTypeahead: (e) => {
2035
+ let t = U.findIndex((t) => t.value === e.value);
2036
+ we(), Y(!0, t >= 0 ? t : void 0);
2037
+ }
2038
+ });
2039
+ }, Xe = G && K >= 0 && U[K] ? `${Te}-${U[K].value}` : void 0;
2040
+ return /* @__PURE__ */ m(f, { children: [
2041
+ j === void 0 ? null : Ie ? /* @__PURE__ */ p("input", {
2042
+ type: "hidden",
2043
+ name: j,
2044
+ value: "",
2045
+ required: N || void 0,
2046
+ disabled: I || void 0
2047
+ }) : ve.map((e) => /* @__PURE__ */ p("input", {
2048
+ type: "hidden",
2049
+ name: j,
2050
+ value: e,
2051
+ disabled: I || void 0
2052
+ }, e)),
2053
+ /* @__PURE__ */ m(ln, {
2054
+ ref: xe,
2055
+ $fill: u,
2056
+ children: [/* @__PURE__ */ p(fn, {
2057
+ ...ie,
2058
+ ref: Ee,
2059
+ id: te,
2060
+ type: "button",
2061
+ disabled: I,
2062
+ role: "combobox",
2063
+ "aria-haspopup": "listbox",
2064
+ "aria-autocomplete": "none",
2065
+ "aria-expanded": G,
2066
+ "aria-controls": G ? Te : void 0,
2067
+ "aria-activedescendant": Xe,
2068
+ "aria-required": N || void 0,
2069
+ "aria-readonly": L || void 0,
2070
+ $family: We,
2071
+ $size: ke,
2072
+ $weight: Ue,
2073
+ $lineHeight: ce,
2074
+ $paddingX: Ae,
2075
+ $paddingY: je,
2076
+ $borderWidth: Ne,
2077
+ $borderRadius: Me,
2078
+ $bg: Pe,
2079
+ $ink: Fe,
2080
+ $muted: Re,
2081
+ $borderColor: Z,
2082
+ $focus: De,
2083
+ $invalid: Oe,
2084
+ $italic: s,
2085
+ $uppercase: c,
2086
+ $fill: u,
2087
+ $open: G,
2088
+ $clearable: Le,
2089
+ $customCss: d,
2090
+ onKeyDown: Ye,
2091
+ onBlur: (e) => {
2092
+ if (re?.(e), e.defaultPrevented) return;
2093
+ let t = e.relatedTarget;
2094
+ t instanceof Node && (xe.current?.contains(t) || Se.current?.contains(t)) || G && Y(!1);
2095
+ },
2096
+ onClick: (e) => {
2097
+ ne?.(e), !(e.defaultPrevented || I) && (G ? (Y(!1), J.current?.blur()) : (we(), Y(!0)));
2098
+ },
2099
+ children: /* @__PURE__ */ p(dn, {
2100
+ $ink: ze,
2101
+ children: Be
2102
+ })
2103
+ }), Le ? /* @__PURE__ */ p(un, {
2104
+ type: "button",
2105
+ tabIndex: -1,
2106
+ "aria-label": "Clear",
2107
+ $end: `calc(${Ae} + 0.95em)`,
2108
+ $ink: Re,
2109
+ $hoverInk: Fe,
2110
+ onMouseDown: (e) => e.preventDefault(),
2111
+ onClick: (e) => {
2112
+ e.stopPropagation(), Je(!0);
2113
+ }
2114
+ }) : null]
2115
+ }),
2116
+ G && be && typeof document < "u" ? h(/* @__PURE__ */ p(pn, {
2117
+ ref: Se,
2118
+ id: Te,
2119
+ role: "listbox",
2120
+ "aria-multiselectable": !0,
2121
+ "aria-labelledby": te || void 0,
2122
+ style: q,
2123
+ $top: be.top,
2124
+ $left: be.left,
2125
+ $width: be.width,
2126
+ $maxHeight: be.maxHeight,
2127
+ $zIndex: B.listZIndex,
2128
+ $shadow: B.listShadow,
2129
+ $radius: Me,
2130
+ $borderWidth: Ne,
2131
+ $borderColor: Z,
2132
+ $bg: Pe,
2133
+ $ink: Fe,
2134
+ $size: ke,
2135
+ $weight: Ue,
2136
+ $family: We,
2137
+ $lineHeight: ce,
2138
+ children: U.map((e, t) => {
2139
+ let n = H.has(e.value);
2140
+ return /* @__PURE__ */ m(mn, {
2141
+ id: `${Te}-${e.value}`,
2142
+ role: "option",
2143
+ "aria-selected": n,
2144
+ "aria-disabled": e.disabled || void 0,
2145
+ "data-active": t === K ? "true" : void 0,
2146
+ $padX: Ve,
2147
+ $padY: He,
2148
+ $chroma: De,
2149
+ $ink: Fe,
2150
+ $selected: n,
2151
+ $active: t === K,
2152
+ $disabled: !!e.disabled,
2153
+ onMouseEnter: () => {
2154
+ e.disabled || X(t);
2155
+ },
2156
+ onMouseDown: (e) => e.preventDefault(),
2157
+ onClick: () => {
2158
+ e.disabled || (X(t), qe(e.value));
2159
+ },
2160
+ children: [/* @__PURE__ */ p(hn, {
2161
+ "aria-hidden": !0,
2162
+ children: /* @__PURE__ */ p(Mt, {
2163
+ tabIndex: -1,
2164
+ checked: n,
2165
+ disabled: e.disabled,
2166
+ color: Ge,
2167
+ size: r ?? B.size,
2168
+ onChange: () => void 0
2169
+ })
2170
+ }), e.label]
2171
+ }, e.value);
2172
+ })
2173
+ }), document.body) : null
2174
+ ] });
2175
+ }
2176
+ gn.displayName = "MultiSelect";
2177
+ //#endregion
2178
+ //#region src/components/forms/selects/Select.tsx
2179
+ var _n = d.li`
2180
+ position: relative;
2181
+ display: flex;
2182
+ align-items: center;
2183
+ justify-content: space-between;
2184
+ gap: 0.75em;
2185
+ padding: ${({ $padY: e, $padX: t }) => `${e} ${t}`};
2186
+ cursor: ${({ $disabled: e }) => e ? "not-allowed" : "pointer"};
2187
+ opacity: ${({ $disabled: e }) => e ? .45 : 1};
2188
+ color: ${({ $selected: e, $chroma: t, $ink: n }) => e ? t : n};
2189
+ -webkit-text-fill-color: ${({ $selected: e, $chroma: t, $ink: n }) => e ? t : n};
2190
+ background: ${({ $active: e, $disabled: t }) => e && !t ? `color-mix(in srgb, var(${$.textHighlighted}) 18%, var(${$.background}))` : "transparent"};
2191
+ ${({ $selected: e, $chroma: t }) => e ? `
2192
+ &::after {
2193
+ content: '';
2194
+ flex-shrink: 0;
2195
+ width: 0.28em;
2196
+ height: 0.48em;
2197
+ box-sizing: border-box;
2198
+ border: solid ${t};
2199
+ border-width: 0 0.14em 0.14em 0;
2200
+ transform: translateY(-12%) rotate(45deg);
2201
+ }
2202
+ ` : ""}
2203
+ `;
2204
+ function vn(e) {
2205
+ let { ref: t, color: n, size: r, weight: i, family: o, italic: s, uppercase: c, fill: u, css: d, padding: g, paddingX: _, paddingY: v, borderWidth: y, borderRadius: b, background: x, ink: S, borderColor: C, value: w, defaultValue: T, onChange: E, open: D, onOpenChange: O, options: k, placeholder: A, name: j, required: N, clearable: P, selectedAtTop: F, emptyOption: ee, children: I, disabled: L, readOnly: te, id: R, onKeyDown: ne, onClick: re, onBlur: ie, ...ae } = e, { fontSizes: oe, fontWeights: se, fontFamilies: ce, lineHeight: le, space: ue, borderWidths: de, radii: fe, defaults: pe, brand: me, status: he, colors: B } = Q(), V = pe.select, ge = w !== void 0, [_e, ve] = l(T ?? ""), H = ge ? w ?? "" : _e, U = Xt(Zt(Yt(k, I), H, !!F), ee, A, N), W = U.findIndex((e) => e.value === H), ye = W >= 0 ? W : $t(U), { isOpen: G, activeIndex: K, box: be, listVars: q, triggerRef: J, wrapRef: xe, listRef: Se, typeRef: Ce, setOpen: Y, moveActive: X, placeList: we } = sn({
2206
+ items: U,
2207
+ open: D,
2208
+ onOpenChange: O,
2209
+ activeOnOpen: ye,
2210
+ listMaxHeight: V.listMaxHeight,
2211
+ listOffset: V.listOffset,
2212
+ space: ue
2213
+ }), Te = a(), Ee = (e) => {
2214
+ J.current = e, typeof t == "function" ? t(e) : t && (t.current = e);
2215
+ }, De = xt(n ?? V.color, me, he), Oe = he.danger.base, ke = M(r, V.size, oe), Ae = M(_ ?? g, V.paddingX, ue), je = M(v ?? g, V.paddingY, ue), Me = M(b, V.borderRadius, fe), Ne = M(y, V.borderWidth, de), Pe = z(x, "background", B, me, he) ?? `var(${$.background})`, Fe = z(S, "text", B, me, he) ?? `var(${$.textHighlighted})`, Z = z(C, "border", B, me, he) ?? `var(${$.border})`, Ie = U.find((e) => e.value === H), Le = H === "", Re = !!P && !N && !Le && !L && !te, ze = `var(${$.textMuted})`, Be = Le ? ze : Fe, Ve = Le ? Ie?.label || A || "" : Ie?.label ?? H, He = M(void 0, V.optionPaddingX, ue), Ue = M(void 0, V.optionPaddingY, ue), We = M(i, V.weight, se), Ge = ce[o ?? "base"], Ke = (e) => {
2216
+ ge || ve(e), E?.(e);
2217
+ }, qe = (e, t) => {
2218
+ te ? G && (Y(!1), t && J.current?.blur()) : !N && H === e ? (Ke(""), Y(!1), t && J.current?.blur()) : (Ke(e), Y(!1), t && J.current?.blur());
2219
+ }, Je = (e) => {
2220
+ te || N || Le || (Ke(""), Y(!1), e && J.current?.blur());
2221
+ }, Ye = (e) => {
2222
+ ne?.(e), cn(e, {
2223
+ disabled: L,
2224
+ readOnly: te,
2225
+ isOpen: G,
2226
+ items: U,
2227
+ activeIndex: K,
2228
+ showClear: Re,
2229
+ typeRef: Ce,
2230
+ placeList: we,
2231
+ setOpen: Y,
2232
+ moveActive: X,
2233
+ openHighlightDown: ye,
2234
+ openHighlightUp: W >= 0 ? W : en(U),
2235
+ closedTypeaheadFrom: W,
2236
+ onCommit: (e) => qe(e.value, !1),
2237
+ onClear: () => Je(!1),
2238
+ onClosedTypeahead: (e) => qe(e.value, !1)
2239
+ });
2240
+ }, Xe = G && K >= 0 && U[K] ? `${Te}-${U[K].value}` : void 0;
2241
+ return /* @__PURE__ */ m(f, { children: [
2242
+ j === void 0 ? null : /* @__PURE__ */ p("input", {
2243
+ type: "hidden",
2244
+ name: j,
2245
+ value: H,
2246
+ required: N || void 0,
2247
+ disabled: L || void 0
2248
+ }),
2249
+ /* @__PURE__ */ m(ln, {
2250
+ ref: xe,
2251
+ $fill: u,
2252
+ children: [/* @__PURE__ */ p(fn, {
2253
+ ...ae,
2254
+ ref: Ee,
2255
+ id: R,
2256
+ type: "button",
2257
+ disabled: L,
2258
+ role: "combobox",
2259
+ "aria-haspopup": "listbox",
2260
+ "aria-autocomplete": "none",
2261
+ "aria-expanded": G,
2262
+ "aria-controls": G ? Te : void 0,
2263
+ "aria-activedescendant": Xe,
2264
+ "aria-required": N || void 0,
2265
+ "aria-readonly": te || void 0,
2266
+ $family: Ge,
2267
+ $size: ke,
2268
+ $weight: We,
2269
+ $lineHeight: le,
2270
+ $paddingX: Ae,
2271
+ $paddingY: je,
2272
+ $borderWidth: Ne,
2273
+ $borderRadius: Me,
2274
+ $bg: Pe,
2275
+ $ink: Fe,
2276
+ $muted: ze,
2277
+ $borderColor: Z,
2278
+ $focus: De,
2279
+ $invalid: Oe,
2280
+ $italic: s,
2281
+ $uppercase: c,
2282
+ $fill: u,
2283
+ $open: G,
2284
+ $clearable: Re,
2285
+ $customCss: d,
2286
+ onKeyDown: Ye,
2287
+ onBlur: (e) => {
2288
+ if (ie?.(e), e.defaultPrevented) return;
2289
+ let t = e.relatedTarget;
2290
+ t instanceof Node && (xe.current?.contains(t) || Se.current?.contains(t)) || G && Y(!1);
2291
+ },
2292
+ onClick: (e) => {
2293
+ re?.(e), !(e.defaultPrevented || L) && (G ? (Y(!1), J.current?.blur()) : (we(), Y(!0)));
2294
+ },
2295
+ children: /* @__PURE__ */ p(dn, {
2296
+ $ink: Be,
2297
+ children: Ve
2298
+ })
2299
+ }), Re ? /* @__PURE__ */ p(un, {
2300
+ type: "button",
2301
+ tabIndex: -1,
2302
+ "aria-label": "Clear",
2303
+ $end: `calc(${Ae} + 0.95em)`,
2304
+ $ink: ze,
2305
+ $hoverInk: Fe,
2306
+ onMouseDown: (e) => e.preventDefault(),
2307
+ onClick: (e) => {
2308
+ e.stopPropagation(), Je(!0);
2309
+ }
2310
+ }) : null]
2311
+ }),
2312
+ G && be && typeof document < "u" ? h(/* @__PURE__ */ p(pn, {
2313
+ ref: Se,
2314
+ id: Te,
2315
+ role: "listbox",
2316
+ "aria-labelledby": R || void 0,
2317
+ style: q,
2318
+ $top: be.top,
2319
+ $left: be.left,
2320
+ $width: be.width,
2321
+ $maxHeight: be.maxHeight,
2322
+ $zIndex: V.listZIndex,
2323
+ $shadow: V.listShadow,
2324
+ $radius: Me,
2325
+ $borderWidth: Ne,
2326
+ $borderColor: Z,
2327
+ $bg: Pe,
2328
+ $ink: Fe,
2329
+ $size: ke,
2330
+ $weight: We,
2331
+ $family: Ge,
2332
+ $lineHeight: le,
2333
+ children: U.map((e, t) => /* @__PURE__ */ p(_n, {
2334
+ id: `${Te}-${e.value}`,
2335
+ role: "option",
2336
+ "aria-selected": e.value === H,
2337
+ "aria-disabled": e.disabled || void 0,
2338
+ "data-active": t === K ? "true" : void 0,
2339
+ $padX: He,
2340
+ $padY: Ue,
2341
+ $chroma: De,
2342
+ $ink: Fe,
2343
+ $selected: e.value === H,
2344
+ $active: t === K,
2345
+ $disabled: !!e.disabled,
2346
+ onMouseEnter: () => {
2347
+ e.disabled || X(t);
2348
+ },
2349
+ onMouseDown: (e) => e.preventDefault(),
2350
+ onClick: () => {
2351
+ e.disabled || qe(e.value, !0);
2352
+ },
2353
+ children: e.label
2354
+ }, e.value))
2355
+ }), document.body) : null
2356
+ ] });
2357
+ }
2358
+ vn.displayName = "Select";
2359
+ //#endregion
2360
+ //#region src/components/forms/Switch.tsx
2361
+ var yn = d.input`
2362
+ appearance: none;
2363
+ margin: 0;
2364
+ flex-shrink: 0;
2365
+ box-sizing: border-box;
2366
+ position: relative;
2367
+ display: inline-block;
2368
+ vertical-align: middle;
2369
+ width: ${({ $width: e }) => e};
2370
+ height: ${({ $height: e }) => e};
2371
+ font-size: ${({ $size: e }) => e};
2372
+ padding: 0;
2373
+ border: none;
2374
+ border-radius: ${({ $radius: e }) => e};
2375
+ background: ${({ $off: e }) => e};
2376
+ cursor: pointer;
2377
+ transition:
2378
+ background 120ms ease,
2379
+ box-shadow 120ms ease;
2380
+ &::before {
2381
+ content: '';
2382
+ position: absolute;
2383
+ top: 50%;
2384
+ left: ${({ $inset: e }) => e};
2385
+ width: ${({ $thumb: e }) => e};
2386
+ height: ${({ $thumb: e }) => e};
2387
+ margin-top: calc(${({ $thumb: e }) => e} / -2);
2388
+ border-radius: min(${({ $radius: e }) => e}, 50%);
2389
+ background: ${({ $ink: e }) => e};
2390
+ box-shadow: 0 1px 2px rgb(0 0 0 / 35%);
2391
+ transition: left 120ms ease;
2392
+ }
2393
+ &:checked {
2394
+ background: ${({ $on: e }) => e};
2395
+ }
2396
+ &:checked:hover:not(:disabled) {
2397
+ background: ${({ $hoverOn: e }) => e};
2398
+ }
2399
+ &:checked:active:not(:disabled) {
2400
+ background: ${({ $activeOn: e }) => e};
2401
+ }
2402
+ &:checked::before {
2403
+ left: calc(100% - ${({ $inset: e, $thumb: t }) => `${e} - ${t}`});
2404
+ }
2405
+ &:focus-visible {
2406
+ outline: none;
2407
+ box-shadow: 0 0 0 2px color-mix(in srgb, ${({ $on: e }) => e} 18%, transparent);
2408
+ }
2409
+ &:disabled {
2410
+ cursor: not-allowed;
2411
+ opacity: 0.45;
2412
+ }
2413
+ @media (prefers-reduced-motion: reduce) {
2414
+ transition: none;
2415
+ &::before {
2416
+ transition: none;
2417
+ }
2418
+ }
2419
+ ${({ $customCss: e }) => e ?? ""}
2420
+ `;
2421
+ function bn(e) {
2422
+ let { color: t, size: n, css: r, background: i, ink: a, width: o, height: s, borderRadius: c, ...l } = e, { space: u, radii: d, fontSizes: f, defaults: m, brand: h, status: g, colors: _, lineHeight: v } = Q(), y = m.switch, b = bt(t ?? y.color, h, g), x = z(i, "background", _, h, g) ?? `color-mix(in srgb, var(${$.text}) 28%, var(${$.background}))`, S = z(a, "text", _, h, g) ?? y.ink, C = M(n, y.size, f), w = s === void 0 ? `calc(${C} * ${v})` : M(s, C, u), T = o === void 0 ? `calc(${C} * ${y.widthFactor})` : M(o, C, u), E = `calc(${C} * ${y.insetFactor})`, D = `calc(${w} - 2 * ${E})`;
2423
+ return /* @__PURE__ */ p(yn, {
2424
+ $width: T,
2425
+ $height: w,
2426
+ $size: C,
2427
+ $thumb: D,
2428
+ $inset: E,
2429
+ $radius: M(c, y.borderRadius, d),
2430
+ $off: x,
2431
+ $on: b.base,
2432
+ $hoverOn: b.hover,
2433
+ $activeOn: b.active,
2434
+ $ink: S,
2435
+ $customCss: r,
2436
+ ...l,
2437
+ type: "checkbox",
2438
+ role: "switch"
2439
+ });
2440
+ }
2441
+ bn.displayName = "Switch";
2442
+ //#endregion
2443
+ //#region src/components/forms/Textarea.tsx
2444
+ var xn = d.textarea`
2445
+ ${Nt}
2446
+ vertical-align: top;
2447
+ overflow: auto;
2448
+ resize: ${({ $resize: e }) => e ? "vertical" : "none"};
2449
+ &:disabled {
2450
+ resize: none;
2451
+ }
2452
+ ${({ $customCss: e }) => e ?? ""}
2453
+ `;
2454
+ function Sn(e) {
2455
+ let { color: t, size: n, weight: r, family: i, italic: a, uppercase: o, fill: s, resize: c, css: l, padding: u, paddingX: d, paddingY: f, borderWidth: m, borderRadius: h, background: g, ink: _, borderColor: v, rows: y, ...b } = e, { fontSizes: x, fontWeights: S, fontFamilies: C, lineHeight: w, space: T, borderWidths: E, radii: D, defaults: O, brand: k, status: A, colors: j } = Q(), N = O.textarea;
2456
+ return /* @__PURE__ */ p(xn, {
2457
+ rows: y ?? N.rows,
2458
+ $family: C[i ?? "base"],
2459
+ $size: M(n, N.size, x),
2460
+ $weight: M(r, N.weight, S),
2461
+ $lineHeight: w,
2462
+ $paddingX: M(d ?? u, N.paddingX, T),
2463
+ $paddingY: M(f ?? u, N.paddingY, T),
2464
+ $borderWidth: M(m, N.borderWidth, E),
2465
+ $borderRadius: M(h, N.borderRadius, D),
2466
+ $bg: z(g, "background", j, k, A) ?? `var(${$.background})`,
2467
+ $ink: z(_, "text", j, k, A) ?? `var(${$.text})`,
2468
+ $borderColor: z(v, "border", j, k, A) ?? `var(${$.border})`,
2469
+ $focus: xt(t ?? N.color, k, A),
2470
+ $invalid: A.danger.base,
2471
+ $resize: c ?? N.resize,
2472
+ $italic: a,
2473
+ $uppercase: o,
2474
+ $fill: s,
2475
+ $customCss: l,
2476
+ ...b
2477
+ });
2478
+ }
2479
+ //#endregion
2480
+ //#region src/components/layout/Cell.tsx
2481
+ function Cn(e, t) {
2482
+ if (t === void 0 || !Number.isFinite(t) || t < 1 || Math.floor(t) === 1) return;
2483
+ let n = Math.floor(t);
2484
+ return e === "column" ? u`
2485
+ grid-column: span ${n};
2486
+ ` : u`
2487
+ grid-row: span ${n};
2488
+ `;
2489
+ }
2490
+ var wn = d.div`
2491
+ position: relative;
2492
+ min-width: 0;
2493
+ min-height: 0;
2494
+ ${({ $edges: e }) => R(e)}
2495
+ ${({ $size: e }) => te(e)}
2496
+ border-width: ${({ $borderWidth: e }) => e};
2497
+ border-style: solid;
2498
+ border-radius: ${({ $borderRadius: e }) => e};
2499
+ border-color: ${({ $borderColor: e }) => e};
2500
+ ${({ $spanX: e }) => Cn("column", e)}
2501
+ ${({ $spanY: e }) => Cn("row", e)}
2502
+ ${({ $alignX: e, $alignY: t }) => he(e, t)}
2503
+ ${({ $customCss: e }) => e ?? ""}
2504
+ `;
2505
+ function Tn(e) {
2506
+ let { spacing: t, size: n, rest: r } = F(e), { spanX: i, spanY: a, alignX: o, alignY: s, css: c, borderWidth: l, borderX: u, borderY: d, borderTop: f, borderRight: m, borderBottom: h, borderLeft: g, borderRadius: _, borderColor: v, ...y } = r, { colors: b, space: x, borderWidths: S, radii: C, defaults: w, brand: T, status: E } = Q();
2507
+ return /* @__PURE__ */ p(wn, {
2508
+ $spanX: i,
2509
+ $spanY: a,
2510
+ $alignX: o,
2511
+ $alignY: s,
2512
+ $edges: P(t, w.cell, x),
2513
+ $size: ee(n, x),
2514
+ $borderWidth: oe({
2515
+ borderWidth: l,
2516
+ borderX: u,
2517
+ borderY: d,
2518
+ borderTop: f,
2519
+ borderRight: m,
2520
+ borderBottom: h,
2521
+ borderLeft: g
2522
+ }, w.cell.borderWidth, S),
2523
+ $borderRadius: M(_, w.cell.borderRadius, C),
2524
+ $borderColor: ce(v, "base", b, T, E),
2525
+ $customCss: c,
2526
+ ...y
2527
+ });
2528
+ }
2529
+ //#endregion
2530
+ //#region src/components/layout/Col.tsx
2531
+ var En = d.div`
2532
+ position: relative;
2533
+ ${({ $edges: e }) => R(e)}
2534
+ ${({ $size: e, $fill: t }) => L(e, t)}
2535
+ border-width: ${({ $borderWidth: e }) => e};
2536
+ border-style: solid;
2537
+ border-radius: ${({ $borderRadius: e }) => e};
2538
+ border-color: ${({ $borderColor: e }) => e};
2539
+ ${({ $flex: e }) => _e(e, !0)}
2540
+ ${({ $trackKind: e, $alignX: t, $alignY: n }) => G(e, t, n)}
2541
+ ${({ $customCss: e }) => e ?? ""}
2542
+ `;
2543
+ function Dn(e) {
2544
+ let { spacing: t, size: n, rest: r } = F(e), { flex: i, fill: a, alignX: o, alignY: s, css: c, borderWidth: l, borderX: u, borderY: d, borderTop: f, borderRight: m, borderBottom: h, borderLeft: g, borderRadius: _, borderColor: v, ...y } = r, { colors: b, space: x, borderWidths: S, radii: C, defaults: w, brand: T, status: E } = Q(), D = ye();
2545
+ return /* @__PURE__ */ p(En, {
2546
+ $flex: i,
2547
+ $fill: a,
2548
+ $edges: P(t, w.col, x),
2549
+ $size: I(n, x, { width: w.col.width }),
2550
+ $borderWidth: oe({
2551
+ borderWidth: l,
2552
+ borderX: u,
2553
+ borderY: d,
2554
+ borderTop: f,
2555
+ borderRight: m,
2556
+ borderBottom: h,
2557
+ borderLeft: g
2558
+ }, w.col.borderWidth, S),
2559
+ $borderRadius: M(_, w.col.borderRadius, C),
2560
+ $borderColor: ce(v, "base", b, T, E),
2561
+ $alignX: o,
2562
+ $alignY: s,
2563
+ $trackKind: D,
2564
+ $customCss: c,
2565
+ ...y
2566
+ });
2567
+ }
2568
+ //#endregion
2569
+ //#region src/components/layout/Cols.tsx
2570
+ var On = d.div`
2571
+ display: flex;
2572
+ flex-direction: row;
2573
+ position: relative;
2574
+ flex-wrap: ${({ $wrap: e }) => e ? "wrap" : "nowrap"};
2575
+ gap: ${({ $gap: e }) => e};
2576
+ ${({ $alignX: e, $alignY: t }) => V(!1, e, t)}
2577
+ ${({ $edges: e }) => R(e)}
2578
+ ${({ $size: e, $fill: t }) => L(e, t)}
2579
+ border-width: ${({ $borderWidth: e }) => e};
2580
+ border-style: solid;
2581
+ border-radius: ${({ $borderRadius: e }) => e};
2582
+ border-color: ${({ $borderColor: e }) => e};
2583
+ ${({ $flex: e }) => _e(e)}
2584
+ ${({ $stackMax: e, $stackedJustify: t }) => e ? pe(e, t) : ""}
2585
+ ${({ $customCss: e }) => e ?? ""}
2586
+ `;
2587
+ function kn(e) {
2588
+ let { spacing: t, size: n, rest: r } = F(e), { flex: i, fill: a, gap: o, alignX: s, alignY: c, wrap: l, stack: u, css: d, borderWidth: f, borderX: m, borderY: h, borderTop: g, borderRight: _, borderBottom: v, borderLeft: y, borderRadius: b, borderColor: x, ...S } = r, { space: C, breakpoints: w, defaults: T, colors: E, borderWidths: D, radii: O, brand: k, status: A } = Q();
2589
+ return /* @__PURE__ */ p(W, {
2590
+ kind: "row",
2591
+ children: /* @__PURE__ */ p(On, {
2592
+ $flex: i,
2593
+ $fill: a,
2594
+ $gap: M(o, T.cols.gap, C),
2595
+ $alignX: ge(s, T.cols.alignX),
2596
+ $alignY: ge(c, T.cols.alignY),
2597
+ $wrap: l,
2598
+ $stackMax: de(u, w),
2599
+ $stackedJustify: ve(c),
2600
+ $edges: P(t, T.cols, C),
2601
+ $size: I(n, C),
2602
+ $borderWidth: oe({
2603
+ borderWidth: f,
2604
+ borderX: m,
2605
+ borderY: h,
2606
+ borderTop: g,
2607
+ borderRight: _,
2608
+ borderBottom: v,
2609
+ borderLeft: y
2610
+ }, "none", D),
2611
+ $borderRadius: M(b, "none", O),
2612
+ $borderColor: ce(x, "base", E, k, A),
2613
+ $customCss: d,
2614
+ ...S
2615
+ })
2616
+ });
2617
+ }
2618
+ //#endregion
2619
+ //#region src/components/layout/Div.tsx
2620
+ var An = d.div`
2621
+ position: relative;
2622
+ ${({ $edges: e }) => R(e)}
2623
+ ${({ $size: e, $fill: t }) => L(e, t)}
2624
+ border-width: ${({ $borderWidth: e }) => e};
2625
+ border-style: solid;
2626
+ border-radius: ${({ $borderRadius: e }) => e};
2627
+ border-color: ${({ $borderColor: e }) => e};
2628
+ ${({ $flex: e }) => _e(e, !0)}
2629
+ ${({ $trackKind: e, $alignX: t, $alignY: n }) => G(e, t, n)}
2630
+ ${({ $customCss: e }) => e ?? ""}
2631
+ `;
2632
+ function jn(e) {
2633
+ let { spacing: t, size: n, rest: r } = F(e), { flex: i, fill: a, alignX: o, alignY: s, css: c, borderWidth: l, borderX: u, borderY: d, borderTop: f, borderRight: m, borderBottom: h, borderLeft: g, borderRadius: _, borderColor: v, ...y } = r, { colors: b, space: x, borderWidths: S, radii: C, defaults: w, brand: T, status: E } = Q(), D = ye();
2634
+ return /* @__PURE__ */ p(An, {
2635
+ $flex: i,
2636
+ $fill: a,
2637
+ $edges: P(t, w.div, x),
2638
+ $size: I(n, x),
2639
+ $borderWidth: oe({
2640
+ borderWidth: l,
2641
+ borderX: u,
2642
+ borderY: d,
2643
+ borderTop: f,
2644
+ borderRight: m,
2645
+ borderBottom: h,
2646
+ borderLeft: g
2647
+ }, w.div.borderWidth, S),
2648
+ $borderRadius: M(_, w.div.borderRadius, C),
2649
+ $borderColor: v === void 0 ? `var(${$.border})` : ce(v, "base", b, T, E),
2650
+ $alignX: o,
2651
+ $alignY: s,
2652
+ $trackKind: D,
2653
+ $customCss: c,
2654
+ ...y
2655
+ });
2656
+ }
2657
+ //#endregion
2658
+ //#region src/components/layout/Grid.tsx
2659
+ function Mn(e) {
2660
+ if (!(e === void 0 || !Number.isFinite(e) || e < 1)) return `repeat(${Math.floor(e)}, minmax(0, 1fr))`;
2661
+ }
2662
+ var Nn = d.div`
2663
+ display: grid;
2664
+ position: relative;
2665
+ gap: ${({ $gap: e }) => e};
2666
+ ${({ $columns: e }) => e ? u`
2667
+ grid-template-columns: ${e};
2668
+ ` : ""}
2669
+ ${({ $rows: e }) => e ? u`
2670
+ grid-template-rows: ${e};
2671
+ ` : ""}
2672
+ ${({ $alignX: e, $alignY: t }) => me(e, t)}
2673
+ ${({ $edges: e }) => R(e)}
2674
+ ${({ $size: e, $fill: t }) => L(e, t)}
2675
+ border-width: ${({ $borderWidth: e }) => e};
2676
+ border-style: solid;
2677
+ border-radius: ${({ $borderRadius: e }) => e};
2678
+ border-color: ${({ $borderColor: e }) => e};
2679
+ ${({ $flex: e }) => _e(e)}
2680
+ ${({ $stackMax: e, $stackCols: t }) => e ? fe(e, t) : ""}
2681
+ ${({ $customCss: e }) => e ?? ""}
2682
+ `;
2683
+ function Pn(e) {
2684
+ let { spacing: t, size: n, rest: r } = F(e), { flex: i, fill: a, gap: o, alignX: s, alignY: c, numCols: l, numRows: u, stack: d, stackCols: f, css: m, borderWidth: h, borderX: g, borderY: _, borderTop: v, borderRight: y, borderBottom: b, borderLeft: x, borderRadius: S, borderColor: C, ...w } = r, { space: T, breakpoints: E, defaults: D, colors: O, borderWidths: k, radii: A, brand: j, status: N } = Q();
2685
+ return /* @__PURE__ */ p(W, {
2686
+ kind: "grid",
2687
+ children: /* @__PURE__ */ p(Nn, {
2688
+ $flex: i,
2689
+ $fill: a,
2690
+ $gap: M(o, D.grid.gap, T),
2691
+ $columns: Mn(l),
2692
+ $rows: Mn(u),
2693
+ $alignX: ge(s, D.grid.alignX),
2694
+ $alignY: ge(c, D.grid.alignY),
2695
+ $stackMax: de(d, E),
2696
+ $stackCols: f !== void 0 && Number.isFinite(f) && f >= 1 ? Math.floor(f) : 1,
2697
+ $edges: P(t, D.grid, T),
2698
+ $size: I(n, T),
2699
+ $borderWidth: oe({
2700
+ borderWidth: h,
2701
+ borderX: g,
2702
+ borderY: _,
2703
+ borderTop: v,
2704
+ borderRight: y,
2705
+ borderBottom: b,
2706
+ borderLeft: x
2707
+ }, "none", k),
2708
+ $borderRadius: M(S, "none", A),
2709
+ $borderColor: ce(C, "base", O, j, N),
2710
+ $customCss: m,
2711
+ ...w
2712
+ })
2713
+ });
2714
+ }
2715
+ //#endregion
2716
+ //#region src/components/layout/Panels.tsx
2717
+ function Fn(e, t, n) {
2718
+ if (!t || n) return L(e, t);
2719
+ let r = e.width === void 0, i = e.height === void 0;
2720
+ return u`
2721
+ ${i ? u`
2722
+ top: 0;
2723
+ bottom: 0;
2724
+ ` : ""}
2725
+ ${r ? u`
2726
+ left: 0;
2727
+ right: 0;
2728
+ ` : ""}
2729
+ ${L(e, !1)}
2730
+ `;
2731
+ }
2732
+ var In = d.div`
2733
+ display: flex;
2734
+ flex-direction: ${({ $horizontal: e }) => e ? "row" : "column"};
2735
+ position: ${({ $relative: e }) => e ? "relative" : "absolute"};
2736
+ gap: ${({ $gap: e }) => e};
2737
+ ${({ $edges: e }) => R(e)}
2738
+ ${({ $size: e, $fill: t, $relative: n }) => Fn(e, t, n)}
2739
+ border-width: ${({ $borderWidth: e }) => e};
2740
+ border-style: solid;
2741
+ border-radius: ${({ $borderRadius: e }) => e};
2742
+ border-color: ${({ $borderColor: e }) => e};
2743
+ ${({ $flex: e }) => _e(e)}
2744
+ ${({ $horizontal: e, $alignX: t, $alignY: n }) => V(!e, t, n)}
2745
+ ${({ $stackMax: e, $stackedJustify: t }) => e ? pe(e, t) : ""}
2746
+ ${({ $scroll: e }) => H(e)}
2747
+ ${({ $customCss: e }) => e ?? ""}
2748
+ `;
2749
+ function Ln(e) {
2750
+ let { spacing: t, size: n, rest: r } = F(e), { horizontal: i, flex: a, fill: o, relative: s, stack: c, scroll: l, alignX: u, alignY: d, gap: f, css: m, borderWidth: h, borderX: g, borderY: _, borderTop: v, borderRight: y, borderBottom: b, borderLeft: x, borderRadius: S, borderColor: C, ...w } = r, { space: T, breakpoints: E, defaults: D, colors: O, borderWidths: k, radii: A, brand: j, status: N } = Q(), ee = B(!i);
2751
+ return /* @__PURE__ */ p(W, {
2752
+ kind: i ? "row" : "column",
2753
+ children: /* @__PURE__ */ p(In, {
2754
+ $horizontal: i,
2755
+ $flex: a,
2756
+ $fill: o,
2757
+ $relative: s,
2758
+ $gap: M(f, D.panels.gap, T),
2759
+ $stackMax: i ? de(c, E) : void 0,
2760
+ $stackedJustify: ve(d),
2761
+ $scroll: l,
2762
+ $alignX: ge(u, ee.alignX),
2763
+ $alignY: ge(d, ee.alignY),
2764
+ $edges: P(t, D.panels, T),
2765
+ $size: I(n, T),
2766
+ $borderWidth: oe({
2767
+ borderWidth: h,
2768
+ borderX: g,
2769
+ borderY: _,
2770
+ borderTop: v,
2771
+ borderRight: y,
2772
+ borderBottom: b,
2773
+ borderLeft: x
2774
+ }, "none", k),
2775
+ $borderRadius: M(S, "none", A),
2776
+ $borderColor: ce(C, "base", O, j, N),
2777
+ $customCss: m,
2778
+ ...w
2779
+ })
2780
+ });
2781
+ }
2782
+ //#endregion
2783
+ //#region src/components/layout/Row.tsx
2784
+ var Rn = d.div`
2785
+ position: relative;
2786
+ ${({ $edges: e }) => R(e)}
2787
+ ${({ $size: e, $fill: t }) => L(e, t)}
2788
+ border-width: ${({ $borderWidth: e }) => e};
2789
+ border-style: solid;
2790
+ border-radius: ${({ $borderRadius: e }) => e};
2791
+ border-color: ${({ $borderColor: e }) => e};
2792
+ ${({ $flex: e }) => _e(e, !0)}
2793
+ ${({ $trackKind: e, $alignX: t, $alignY: n }) => G(e, t, n)}
2794
+ ${({ $customCss: e }) => e ?? ""}
2795
+ `;
2796
+ function zn(e) {
2797
+ let { spacing: t, size: n, rest: r } = F(e), { flex: i, fill: a, alignX: o, alignY: s, css: c, borderWidth: l, borderX: u, borderY: d, borderTop: f, borderRight: m, borderBottom: h, borderLeft: g, borderRadius: _, borderColor: v, ...y } = r, { colors: b, space: x, borderWidths: S, radii: C, defaults: w, brand: T, status: E } = Q(), D = ye();
2798
+ return /* @__PURE__ */ p(Rn, {
2799
+ $flex: i,
2800
+ $fill: a,
2801
+ $edges: P(t, w.row, x),
2802
+ $size: I(n, x, { height: w.row.height }),
2803
+ $borderWidth: oe({
2804
+ borderWidth: l,
2805
+ borderX: u,
2806
+ borderY: d,
2807
+ borderTop: f,
2808
+ borderRight: m,
2809
+ borderBottom: h,
2810
+ borderLeft: g
2811
+ }, w.row.borderWidth, S),
2812
+ $borderRadius: M(_, w.row.borderRadius, C),
2813
+ $borderColor: ce(v, "base", b, T, E),
2814
+ $alignX: o,
2815
+ $alignY: s,
2816
+ $trackKind: D,
2817
+ $customCss: c,
2818
+ ...y
2819
+ });
2820
+ }
2821
+ //#endregion
2822
+ //#region src/components/layout/Rows.tsx
2823
+ var Bn = d.div`
2824
+ display: flex;
2825
+ flex-direction: column;
2826
+ position: relative;
2827
+ flex-wrap: ${({ $wrap: e }) => e ? "wrap" : "nowrap"};
2828
+ gap: ${({ $gap: e }) => e};
2829
+ ${({ $alignX: e, $alignY: t }) => V(!0, e, t)}
2830
+ ${({ $edges: e }) => R(e)}
2831
+ ${({ $size: e, $fill: t }) => L(e, t)}
2832
+ border-width: ${({ $borderWidth: e }) => e};
2833
+ border-style: solid;
2834
+ border-radius: ${({ $borderRadius: e }) => e};
2835
+ border-color: ${({ $borderColor: e }) => e};
2836
+ ${({ $flex: e }) => _e(e)}
2837
+ ${({ $customCss: e }) => e ?? ""}
2838
+ `;
2839
+ function Vn(e) {
2840
+ let { spacing: t, size: n, rest: r } = F(e), { flex: i, fill: a, gap: o, alignX: s, alignY: c, wrap: l, css: u, borderWidth: d, borderX: f, borderY: m, borderTop: h, borderRight: g, borderBottom: _, borderLeft: v, borderRadius: y, borderColor: b, ...x } = r, { space: S, defaults: C, colors: w, borderWidths: T, radii: E, brand: D, status: O } = Q();
2841
+ return /* @__PURE__ */ p(W, {
2842
+ kind: "column",
2843
+ children: /* @__PURE__ */ p(Bn, {
2844
+ $flex: i,
2845
+ $fill: a,
2846
+ $gap: M(o, C.rows.gap, S),
2847
+ $alignX: ge(s, C.rows.alignX),
2848
+ $alignY: ge(c, C.rows.alignY),
2849
+ $wrap: l,
2850
+ $edges: P(t, C.rows, S),
2851
+ $size: I(n, S),
2852
+ $borderWidth: oe({
2853
+ borderWidth: d,
2854
+ borderX: f,
2855
+ borderY: m,
2856
+ borderTop: h,
2857
+ borderRight: g,
2858
+ borderBottom: _,
2859
+ borderLeft: v
2860
+ }, "none", T),
2861
+ $borderRadius: M(y, "none", E),
2862
+ $borderColor: ce(b, "base", w, D, O),
2863
+ $customCss: u,
2864
+ ...x
2865
+ })
2866
+ });
2867
+ }
2868
+ //#endregion
2869
+ //#region src/components/text/Heading.tsx
2870
+ var Hn = {
2871
+ 1: "h1",
2872
+ 2: "h2",
2873
+ 3: "h3",
2874
+ 4: "h4",
2875
+ 5: "h5",
2876
+ 6: "h6"
2877
+ }, Un = d.h1`
2878
+ ${Rt}
2879
+ line-height: 1;
2880
+ text-box: trim-both cap alphabetic;
2881
+ ${({ $customCss: e }) => e ?? ""}
2882
+ `;
2883
+ function Wn(e) {
2884
+ let { level: t, size: n, color: r, muted: i, highlighted: a, weight: o, family: s, italic: c, underlined: l, uppercase: u, css: d, ...f } = e, { fontSizes: m, fontWeights: h, fontFamilies: g, defaults: _, brand: v, status: y } = Q(), b = g[s ?? _.heading.family], x = _.heading.size[t], S = n === void 0 ? x : M(n, x, m), C = M(o, _.heading.weight, h);
2885
+ return /* @__PURE__ */ p(It.Provider, {
2886
+ value: {
2887
+ family: b,
2888
+ size: S,
2889
+ weight: C,
2890
+ lineHeight: 1
2891
+ },
2892
+ children: /* @__PURE__ */ p(Un, {
2893
+ as: Hn[t],
2894
+ $family: b,
2895
+ $size: S,
2896
+ $color: St(r, a, i, v, y),
2897
+ $weight: C,
2898
+ $lineHeight: 1,
2899
+ $italic: c,
2900
+ $underlined: l,
2901
+ $uppercase: u,
2902
+ $customCss: d,
2903
+ ...f
2904
+ })
2905
+ });
2906
+ }
2907
+ //#endregion
2908
+ //#region src/components/text/Span.tsx
2909
+ var Gn = d.span`
2910
+ ${Rt}
2911
+ ${({ $customCss: e }) => e ?? ""}
2912
+ `;
2913
+ function Kn(e) {
2914
+ let { size: t, color: n, muted: r, highlighted: i, weight: a, family: o, italic: s, underlined: c, uppercase: l, css: u, ...d } = e, { fontSizes: f, fontWeights: m, fontFamilies: h, lineHeight: g, defaults: _, brand: v, status: y } = Q(), b = Lt(), x = o === void 0 ? b?.family ?? h.base : h[o], S = t === void 0 ? b?.size ?? M(void 0, _.text.size, f) : M(t, _.text.size, f), C = a === void 0 ? b?.weight ?? M(void 0, _.text.weight, m) : M(a, _.text.weight, m), w = b?.lineHeight ?? g, T = n !== void 0 || i || r ? St(n, i, r, v, y) : "inherit";
2915
+ return /* @__PURE__ */ p(It.Provider, {
2916
+ value: {
2917
+ family: x,
2918
+ size: S,
2919
+ weight: C,
2920
+ lineHeight: w
2921
+ },
2922
+ children: /* @__PURE__ */ p(Gn, {
2923
+ $family: x,
2924
+ $size: S,
2925
+ $color: T,
2926
+ $weight: C,
2927
+ $lineHeight: w,
2928
+ $italic: s,
2929
+ $underlined: c,
2930
+ $uppercase: l,
2931
+ $customCss: u,
2932
+ ...d
2933
+ })
2934
+ });
2935
+ }
2936
+ //#endregion
2937
+ //#region src/components/text/Text.tsx
2938
+ var qn = d.p`
2939
+ ${Rt}
2940
+ ${({ $customCss: e }) => e ?? ""}
2941
+ `;
2942
+ function Jn(e) {
2943
+ let { size: t, color: n, muted: r, highlighted: i, weight: a, family: o, italic: s, underlined: c, uppercase: l, css: u, ...d } = e, { fontSizes: f, fontWeights: m, fontFamilies: h, lineHeight: g, defaults: _, brand: v, status: y } = Q(), b = h[o ?? "base"], x = M(t, _.text.size, f), S = M(a, _.text.weight, m);
2944
+ return /* @__PURE__ */ p(It.Provider, {
2945
+ value: {
2946
+ family: b,
2947
+ size: x,
2948
+ weight: S,
2949
+ lineHeight: g
2950
+ },
2951
+ children: /* @__PURE__ */ p(qn, {
2952
+ $family: b,
2953
+ $size: x,
2954
+ $color: St(n, i, r, v, y),
2955
+ $weight: S,
2956
+ $lineHeight: g,
2957
+ $italic: s,
2958
+ $underlined: c,
2959
+ $uppercase: l,
2960
+ $customCss: u,
2961
+ ...d
2962
+ })
2963
+ });
2964
+ }
2965
+ //#endregion
2966
+ //#region src/components/text/TextLink.tsx
2967
+ var Yn = u`
2968
+ text-decoration: underline;
2969
+ `, Xn = d.a`
2970
+ padding: 0;
2971
+ border: 0;
2972
+ background: none;
2973
+ cursor: pointer;
2974
+ text-decoration: none;
2975
+ ${Rt}
2976
+ &:focus-visible {
2977
+ outline: 2px solid currentColor;
2978
+ outline-offset: 2px;
2979
+ }
2980
+ &:hover {
2981
+ color: ${({ $hover: e }) => e};
2982
+ ${({ $hoverUnderline: e, $underlined: t }) => e || t ? Yn : ""}
2983
+ }
2984
+ &:active {
2985
+ color: ${({ $active: e }) => e};
2986
+ ${({ $hoverUnderline: e, $underlined: t }) => e || t ? Yn : ""}
2987
+ }
2988
+ ${({ $customCss: e }) => e ?? ""}
2989
+ `;
2990
+ function Zn(e) {
2991
+ let { size: t, color: n, muted: r, highlighted: i, weight: a, family: o, italic: s, underlined: c, uppercase: l, css: u, ...d } = e, { fontSizes: f, fontWeights: m, fontFamilies: h, lineHeight: g, defaults: _, brand: v, status: y } = Q(), b = Lt(), x = n ?? (r || i ? void 0 : _.textLink.color), { hover: S, active: C } = Ct(x, _.textLink.hover === "inherit" ? "inherit" : yt(n) ? n : _.textLink.hover, v, y), w = o === void 0 ? b?.family ?? h.base : h[o], T = t === void 0 ? b?.size ?? M(void 0, _.text.size, f) : M(t, _.text.size, f), E = a === void 0 ? b?.weight ?? M(void 0, _.text.weight, m) : M(a, _.text.weight, m);
2992
+ return /* @__PURE__ */ p(Xn, {
2993
+ $family: w,
2994
+ $size: T,
2995
+ $color: St(x, i, r, v, y),
2996
+ $hover: S,
2997
+ $active: C,
2998
+ $weight: E,
2999
+ $lineHeight: b?.lineHeight ?? g,
3000
+ $italic: s,
3001
+ $underlined: c,
3002
+ $hoverUnderline: _.textLink.hoverUnderline,
3003
+ $uppercase: l,
3004
+ $customCss: u,
3005
+ ...d
3006
+ });
3007
+ }
3008
+ //#endregion
3009
+ export { Dt as Button, Tn as Cell, Mt as Checkbox, kt as Chip, Dn as Col, kn as Cols, jn as Div, Pn as Grid, Wn as Heading, Ft as Input, Vt as Label, gn as MultiSelect, Ut as NumberInput, Kt as Option, gt as Panel, mt as PanelizeProvider, Ln as Panels, Gt as Radio, zn as Row, Vn as Rows, vn as Select, Kn as Span, bn as Switch, Jn as Text, Zn as TextLink, Sn as Textarea, C as alignValues, dt as appCssVars, x as brandStateTokens, y as brandTokens, T as breakpointTokens, v as colorSchemeTokens, lt as createPanelizeTheme, ne as defaultBorderWidths, le as defaultBreakpoints, Ee as defaultFontFamilies, we as defaultFontSizes, Te as defaultFontWeights, De as defaultLineHeight, re as defaultRadii, A as defaultSpace, Z as defaultTheme, O as fontFamilyTokens, E as fontSizeTokens, D as fontWeightTokens, be as grayRampTokens, K as grayTokens, k as headingLevels, J as palette, $ as panelCssVars, _ as panelTextRoles, g as panelVariants, w as scrollValues, S as spaceTokens, b as statusTokens, Q as usePanelizeTheme };
3010
+
3011
+ //# sourceMappingURL=panelize.es.js.map