@umami/react-zen 0.249.0 → 0.250.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +15 -9
- package/dist/index.d.ts +15 -9
- package/dist/index.js +439 -322
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +439 -322
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/styles.css +202 -172
- package/styles.full.css +1 -1
package/dist/index.mjs
CHANGED
|
@@ -98,7 +98,7 @@ var paddingMap = {
|
|
|
98
98
|
"72": "p-72",
|
|
99
99
|
"80": "p-80",
|
|
100
100
|
"96": "p-96",
|
|
101
|
-
true: "px-[var(--padding-x-default)] py-[var(--padding-y-default)]"
|
|
101
|
+
true: "px-[var(--zen-padding-x-default)] py-[var(--zen-padding-y-default)]"
|
|
102
102
|
};
|
|
103
103
|
var pxMap = {
|
|
104
104
|
"0": "px-0",
|
|
@@ -136,7 +136,7 @@ var pxMap = {
|
|
|
136
136
|
"72": "px-72",
|
|
137
137
|
"80": "px-80",
|
|
138
138
|
"96": "px-96",
|
|
139
|
-
true: "px-[var(--padding-x-default)]"
|
|
139
|
+
true: "px-[var(--zen-padding-x-default)]"
|
|
140
140
|
};
|
|
141
141
|
var pyMap = {
|
|
142
142
|
"0": "py-0",
|
|
@@ -174,7 +174,7 @@ var pyMap = {
|
|
|
174
174
|
"72": "py-72",
|
|
175
175
|
"80": "py-80",
|
|
176
176
|
"96": "py-96",
|
|
177
|
-
true: "py-[var(--padding-y-default)]"
|
|
177
|
+
true: "py-[var(--zen-padding-y-default)]"
|
|
178
178
|
};
|
|
179
179
|
var ptMap = {
|
|
180
180
|
"0": "pt-0",
|
|
@@ -325,6 +325,7 @@ var plMap = {
|
|
|
325
325
|
"96": "pl-96"
|
|
326
326
|
};
|
|
327
327
|
var marginMap = {
|
|
328
|
+
auto: "m-auto",
|
|
328
329
|
"0": "m-0",
|
|
329
330
|
px: "m-px",
|
|
330
331
|
"0.5": "m-0.5",
|
|
@@ -383,6 +384,7 @@ var marginMap = {
|
|
|
383
384
|
"-24": "-m-24"
|
|
384
385
|
};
|
|
385
386
|
var mxMap = {
|
|
387
|
+
auto: "mx-auto",
|
|
386
388
|
"0": "mx-0",
|
|
387
389
|
px: "mx-px",
|
|
388
390
|
"0.5": "mx-0.5",
|
|
@@ -420,6 +422,7 @@ var mxMap = {
|
|
|
420
422
|
"-4": "-mx-4"
|
|
421
423
|
};
|
|
422
424
|
var myMap = {
|
|
425
|
+
auto: "my-auto",
|
|
423
426
|
"0": "my-0",
|
|
424
427
|
px: "my-px",
|
|
425
428
|
"0.5": "my-0.5",
|
|
@@ -457,6 +460,7 @@ var myMap = {
|
|
|
457
460
|
"-4": "-my-4"
|
|
458
461
|
};
|
|
459
462
|
var mtMap = {
|
|
463
|
+
auto: "mt-auto",
|
|
460
464
|
"0": "mt-0",
|
|
461
465
|
px: "mt-px",
|
|
462
466
|
"0.5": "mt-0.5",
|
|
@@ -494,6 +498,7 @@ var mtMap = {
|
|
|
494
498
|
"-4": "-mt-4"
|
|
495
499
|
};
|
|
496
500
|
var mrMap = {
|
|
501
|
+
auto: "mr-auto",
|
|
497
502
|
"0": "mr-0",
|
|
498
503
|
px: "mr-px",
|
|
499
504
|
"0.5": "mr-0.5",
|
|
@@ -531,6 +536,7 @@ var mrMap = {
|
|
|
531
536
|
"-4": "-mr-4"
|
|
532
537
|
};
|
|
533
538
|
var mbMap = {
|
|
539
|
+
auto: "mb-auto",
|
|
534
540
|
"0": "mb-0",
|
|
535
541
|
px: "mb-px",
|
|
536
542
|
"0.5": "mb-0.5",
|
|
@@ -568,6 +574,7 @@ var mbMap = {
|
|
|
568
574
|
"-4": "-mb-4"
|
|
569
575
|
};
|
|
570
576
|
var mlMap = {
|
|
577
|
+
auto: "ml-auto",
|
|
571
578
|
"0": "ml-0",
|
|
572
579
|
px: "ml-px",
|
|
573
580
|
"0.5": "ml-0.5",
|
|
@@ -640,7 +647,7 @@ var gapMap = {
|
|
|
640
647
|
"72": "gap-72",
|
|
641
648
|
"80": "gap-80",
|
|
642
649
|
"96": "gap-96",
|
|
643
|
-
true: "gap-[var(--gap-default)]"
|
|
650
|
+
true: "gap-[var(--zen-gap-default)]"
|
|
644
651
|
};
|
|
645
652
|
var gapXMap = {
|
|
646
653
|
"0": "gap-x-0",
|
|
@@ -667,7 +674,7 @@ var gapXMap = {
|
|
|
667
674
|
"24": "gap-x-24",
|
|
668
675
|
"28": "gap-x-28",
|
|
669
676
|
"32": "gap-x-32",
|
|
670
|
-
true: "gap-x-[var(--gap-default)]"
|
|
677
|
+
true: "gap-x-[var(--zen-gap-default)]"
|
|
671
678
|
};
|
|
672
679
|
var gapYMap = {
|
|
673
680
|
"0": "gap-y-0",
|
|
@@ -694,7 +701,7 @@ var gapYMap = {
|
|
|
694
701
|
"24": "gap-y-24",
|
|
695
702
|
"28": "gap-y-28",
|
|
696
703
|
"32": "gap-y-32",
|
|
697
|
-
true: "gap-y-[var(--gap-default)]"
|
|
704
|
+
true: "gap-y-[var(--zen-gap-default)]"
|
|
698
705
|
};
|
|
699
706
|
var spaceXMap = {
|
|
700
707
|
"0": "space-x-0",
|
|
@@ -771,33 +778,33 @@ var spaceYMap = {
|
|
|
771
778
|
"96": "space-y-96"
|
|
772
779
|
};
|
|
773
780
|
var fontSizeMap = {
|
|
774
|
-
xs: "text-xs",
|
|
775
|
-
sm: "text-sm",
|
|
776
|
-
base: "text-base",
|
|
777
|
-
lg: "text-lg",
|
|
778
|
-
xl: "text-xl",
|
|
779
|
-
"2xl": "text-2xl",
|
|
780
|
-
"3xl": "text-3xl",
|
|
781
|
-
"4xl": "text-4xl",
|
|
782
|
-
"5xl": "text-5xl",
|
|
783
|
-
"6xl": "text-6xl",
|
|
784
|
-
"7xl": "text-7xl",
|
|
785
|
-
"8xl": "text-8xl",
|
|
786
|
-
"9xl": "text-9xl"
|
|
781
|
+
xs: "text-[length:var(--zen-font-size-xs)]/[var(--zen-line-height-xs)]",
|
|
782
|
+
sm: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
783
|
+
base: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
784
|
+
lg: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)]",
|
|
785
|
+
xl: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)]",
|
|
786
|
+
"2xl": "text-[length:var(--zen-font-size-2xl)]/[var(--zen-line-height-2xl)]",
|
|
787
|
+
"3xl": "text-[length:var(--zen-font-size-3xl)]/[var(--zen-line-height-3xl)]",
|
|
788
|
+
"4xl": "text-[length:var(--zen-font-size-4xl)]/[var(--zen-line-height-4xl)]",
|
|
789
|
+
"5xl": "text-[length:var(--zen-font-size-5xl)]/[var(--zen-line-height-5xl)]",
|
|
790
|
+
"6xl": "text-[length:var(--zen-font-size-6xl)]/[var(--zen-line-height-6xl)]",
|
|
791
|
+
"7xl": "text-[length:var(--zen-font-size-7xl)]/[var(--zen-line-height-7xl)]",
|
|
792
|
+
"8xl": "text-[length:var(--zen-font-size-8xl)]/[var(--zen-line-height-8xl)]",
|
|
793
|
+
"9xl": "text-[length:var(--zen-font-size-9xl)]/[var(--zen-line-height-9xl)]"
|
|
787
794
|
};
|
|
788
795
|
var headingSizeMap = {
|
|
789
|
-
sm: "text-sm",
|
|
790
|
-
base: "text-base",
|
|
791
|
-
lg: "text-lg",
|
|
792
|
-
xl: "text-xl",
|
|
793
|
-
"2xl": "text-2xl",
|
|
794
|
-
"3xl": "text-3xl",
|
|
795
|
-
"4xl": "text-4xl",
|
|
796
|
-
"5xl": "text-5xl",
|
|
797
|
-
"6xl": "text-6xl",
|
|
798
|
-
"7xl": "text-7xl",
|
|
799
|
-
"8xl": "text-8xl",
|
|
800
|
-
"9xl": "text-9xl"
|
|
796
|
+
sm: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
797
|
+
base: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
798
|
+
lg: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)]",
|
|
799
|
+
xl: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)]",
|
|
800
|
+
"2xl": "text-[length:var(--zen-font-size-2xl)]/[var(--zen-line-height-2xl)]",
|
|
801
|
+
"3xl": "text-[length:var(--zen-font-size-3xl)]/[var(--zen-line-height-3xl)]",
|
|
802
|
+
"4xl": "text-[length:var(--zen-font-size-4xl)]/[var(--zen-line-height-4xl)]",
|
|
803
|
+
"5xl": "text-[length:var(--zen-font-size-5xl)]/[var(--zen-line-height-5xl)]",
|
|
804
|
+
"6xl": "text-[length:var(--zen-font-size-6xl)]/[var(--zen-line-height-6xl)]",
|
|
805
|
+
"7xl": "text-[length:var(--zen-font-size-7xl)]/[var(--zen-line-height-7xl)]",
|
|
806
|
+
"8xl": "text-[length:var(--zen-font-size-8xl)]/[var(--zen-line-height-8xl)]",
|
|
807
|
+
"9xl": "text-[length:var(--zen-font-size-9xl)]/[var(--zen-line-height-9xl)]"
|
|
801
808
|
};
|
|
802
809
|
var fontWeightMap = {
|
|
803
810
|
thin: "font-thin",
|
|
@@ -819,7 +826,7 @@ var borderRadiusMap = {
|
|
|
819
826
|
"2xl": "rounded-2xl",
|
|
820
827
|
"3xl": "rounded-3xl",
|
|
821
828
|
full: "rounded-full",
|
|
822
|
-
true: "rounded-[var(--radius-default)]"
|
|
829
|
+
true: "rounded-[var(--zen-radius-default)]"
|
|
823
830
|
};
|
|
824
831
|
var borderWidthMap = {
|
|
825
832
|
sm: "border",
|
|
@@ -835,7 +842,7 @@ var shadowMap = {
|
|
|
835
842
|
xl: "shadow-xl",
|
|
836
843
|
"2xl": "shadow-2xl",
|
|
837
844
|
inner: "shadow-inner",
|
|
838
|
-
true: "shadow-[var(--shadow-default)]"
|
|
845
|
+
true: "shadow-[var(--zen-shadow-default)]"
|
|
839
846
|
};
|
|
840
847
|
var semanticColorMap = {
|
|
841
848
|
primary: { text: "text-foreground-primary", bg: "bg-primary" },
|
|
@@ -1347,9 +1354,9 @@ function mapBorderColor(value) {
|
|
|
1347
1354
|
return "";
|
|
1348
1355
|
}
|
|
1349
1356
|
var semanticCssColorValues = {
|
|
1350
|
-
primary: "var(--text-primary)",
|
|
1351
|
-
muted: "var(--text-muted)",
|
|
1352
|
-
disabled: "var(--text-disabled)"
|
|
1357
|
+
primary: "var(--zen-text-primary)",
|
|
1358
|
+
muted: "var(--zen-text-muted)",
|
|
1359
|
+
disabled: "var(--zen-text-disabled)"
|
|
1353
1360
|
};
|
|
1354
1361
|
var tailwindColorHex = {
|
|
1355
1362
|
gray: {
|
|
@@ -2200,7 +2207,10 @@ function Accordion({
|
|
|
2200
2207
|
value: expandedKeys ? Array.from(expandedKeys) : void 0,
|
|
2201
2208
|
defaultValue: defaultExpandedKeys ? Array.from(defaultExpandedKeys) : void 0,
|
|
2202
2209
|
onValueChange: (value) => onExpandedChange?.(new Set(value)),
|
|
2203
|
-
className: cn(
|
|
2210
|
+
className: cn(
|
|
2211
|
+
"flex flex-col items-start w-full gap-2 text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
2212
|
+
className
|
|
2213
|
+
),
|
|
2204
2214
|
children
|
|
2205
2215
|
}
|
|
2206
2216
|
);
|
|
@@ -2222,7 +2232,7 @@ function AccordionItem({
|
|
|
2222
2232
|
disabled: isDisabled,
|
|
2223
2233
|
className: cn("w-full cursor-pointer group", className),
|
|
2224
2234
|
children: [
|
|
2225
|
-
/* @__PURE__ */ jsx(Accordion$1.Header, { children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, { className: "w-full flex items-center justify-between font-bold py-2 px-0", children: [
|
|
2235
|
+
/* @__PURE__ */ jsx(Accordion$1.Header, { className: "m-0 text-[length:inherit]", children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, { className: "w-full flex items-center justify-between font-bold py-2 px-0", children: [
|
|
2226
2236
|
/* @__PURE__ */ jsx(Text, { children: trigger }),
|
|
2227
2237
|
/* @__PURE__ */ jsx(Icon, { className: "transition-transform duration-200 group-data-[open]:rotate-90", size: "sm", children: /* @__PURE__ */ jsx(icons_exports.ChevronRight, {}) })
|
|
2228
2238
|
] }) }),
|
|
@@ -2278,11 +2288,11 @@ var button = tv({
|
|
|
2278
2288
|
]
|
|
2279
2289
|
},
|
|
2280
2290
|
size: {
|
|
2281
|
-
xs: "text-sm py-1 px-2",
|
|
2282
|
-
sm: "text-base py-1.5 px-2.5",
|
|
2283
|
-
md: "text-base py-2 px-3",
|
|
2284
|
-
lg: "text-lg py-2.5 px-4",
|
|
2285
|
-
xl: "text-xl py-3 px-5"
|
|
2291
|
+
xs: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)] py-1 px-2",
|
|
2292
|
+
sm: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] py-1.5 px-2.5",
|
|
2293
|
+
md: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] py-2 px-3",
|
|
2294
|
+
lg: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)] py-2.5 px-4",
|
|
2295
|
+
xl: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)] py-3 px-5"
|
|
2286
2296
|
}
|
|
2287
2297
|
},
|
|
2288
2298
|
defaultVariants: {
|
|
@@ -2293,7 +2303,7 @@ var button = tv({
|
|
|
2293
2303
|
var inputField = tv({
|
|
2294
2304
|
base: [
|
|
2295
2305
|
"relative flex items-center",
|
|
2296
|
-
"text-base rounded border border-edge bg-surface-base shadow-sm",
|
|
2306
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] rounded border border-edge bg-surface-base shadow-sm",
|
|
2297
2307
|
"leading-6 text-foreground-primary transition-colors",
|
|
2298
2308
|
"focus-within:border-edge-strong",
|
|
2299
2309
|
"has-[input:read-only]:bg-surface-raised has-[textarea:read-only]:bg-surface-raised",
|
|
@@ -2312,7 +2322,7 @@ var inputField = tv({
|
|
|
2312
2322
|
tv({
|
|
2313
2323
|
base: [
|
|
2314
2324
|
"flex items-center justify-between",
|
|
2315
|
-
"gap-3 text-base py-2 px-3 min-w-[120px]",
|
|
2325
|
+
"gap-3 text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] py-2 px-3 min-w-[120px]",
|
|
2316
2326
|
"cursor-pointer outline-none rounded",
|
|
2317
2327
|
"text-foreground-primary",
|
|
2318
2328
|
"hovered:bg-interactive",
|
|
@@ -2349,13 +2359,15 @@ tv({
|
|
|
2349
2359
|
}
|
|
2350
2360
|
});
|
|
2351
2361
|
var tooltip = tv({
|
|
2352
|
-
base: [
|
|
2362
|
+
base: [
|
|
2363
|
+
"bg-surface-inverted text-surface-base text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] px-2 py-1 rounded"
|
|
2364
|
+
]
|
|
2353
2365
|
});
|
|
2354
2366
|
var checkbox = tv({
|
|
2355
2367
|
slots: {
|
|
2356
2368
|
root: [
|
|
2357
2369
|
"group flex items-center gap-3",
|
|
2358
|
-
"text-base cursor-pointer",
|
|
2370
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] cursor-pointer",
|
|
2359
2371
|
"disabled:text-foreground-disabled disabled:cursor-default"
|
|
2360
2372
|
],
|
|
2361
2373
|
box: [
|
|
@@ -2379,7 +2391,7 @@ var switchVariant = tv({
|
|
|
2379
2391
|
slots: {
|
|
2380
2392
|
root: [
|
|
2381
2393
|
"group flex items-center gap-3",
|
|
2382
|
-
"text-base cursor-pointer",
|
|
2394
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] cursor-pointer",
|
|
2383
2395
|
"disabled:opacity-50 disabled:cursor-default"
|
|
2384
2396
|
],
|
|
2385
2397
|
track: [
|
|
@@ -2402,7 +2414,7 @@ tv({
|
|
|
2402
2414
|
root: "flex flex-col",
|
|
2403
2415
|
list: ["flex gap-1 border-b border-edge-muted"],
|
|
2404
2416
|
tab: [
|
|
2405
|
-
"px-4 py-2 text-base font-medium cursor-pointer",
|
|
2417
|
+
"px-4 py-2 text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-medium cursor-pointer",
|
|
2406
2418
|
"text-foreground-muted outline-none",
|
|
2407
2419
|
"border-b-2 border-transparent -mb-px",
|
|
2408
2420
|
"hovered:text-foreground-primary",
|
|
@@ -2417,14 +2429,14 @@ tv({
|
|
|
2417
2429
|
base: "text-foreground-primary",
|
|
2418
2430
|
variants: {
|
|
2419
2431
|
size: {
|
|
2420
|
-
xs: "text-xs",
|
|
2421
|
-
sm: "text-sm",
|
|
2422
|
-
base: "text-base",
|
|
2423
|
-
lg: "text-lg",
|
|
2424
|
-
xl: "text-xl",
|
|
2425
|
-
"2xl": "text-2xl",
|
|
2426
|
-
"3xl": "text-3xl",
|
|
2427
|
-
"4xl": "text-4xl"
|
|
2432
|
+
xs: "text-[length:var(--zen-font-size-xs)]/[var(--zen-line-height-xs)]",
|
|
2433
|
+
sm: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
2434
|
+
base: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
2435
|
+
lg: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)]",
|
|
2436
|
+
xl: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)]",
|
|
2437
|
+
"2xl": "text-[length:var(--zen-font-size-2xl)]/[var(--zen-line-height-2xl)]",
|
|
2438
|
+
"3xl": "text-[length:var(--zen-font-size-3xl)]/[var(--zen-line-height-3xl)]",
|
|
2439
|
+
"4xl": "text-[length:var(--zen-font-size-4xl)]/[var(--zen-line-height-4xl)]"
|
|
2428
2440
|
},
|
|
2429
2441
|
color: {
|
|
2430
2442
|
default: "",
|
|
@@ -2451,15 +2463,15 @@ tv({
|
|
|
2451
2463
|
base: "font-semibold text-foreground-primary",
|
|
2452
2464
|
variants: {
|
|
2453
2465
|
size: {
|
|
2454
|
-
sm: "text-sm",
|
|
2455
|
-
base: "text-base",
|
|
2456
|
-
lg: "text-lg",
|
|
2457
|
-
xl: "text-xl",
|
|
2458
|
-
"2xl": "text-2xl",
|
|
2459
|
-
"3xl": "text-3xl",
|
|
2460
|
-
"4xl": "text-4xl",
|
|
2461
|
-
"5xl": "text-5xl",
|
|
2462
|
-
"6xl": "text-6xl"
|
|
2466
|
+
sm: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
2467
|
+
base: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
2468
|
+
lg: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)]",
|
|
2469
|
+
xl: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)]",
|
|
2470
|
+
"2xl": "text-[length:var(--zen-font-size-2xl)]/[var(--zen-line-height-2xl)]",
|
|
2471
|
+
"3xl": "text-[length:var(--zen-font-size-3xl)]/[var(--zen-line-height-3xl)]",
|
|
2472
|
+
"4xl": "text-[length:var(--zen-font-size-4xl)]/[var(--zen-line-height-4xl)]",
|
|
2473
|
+
"5xl": "text-[length:var(--zen-font-size-5xl)]/[var(--zen-line-height-5xl)]",
|
|
2474
|
+
"6xl": "text-[length:var(--zen-font-size-6xl)]/[var(--zen-line-height-6xl)]"
|
|
2463
2475
|
}
|
|
2464
2476
|
},
|
|
2465
2477
|
defaultVariants: {
|
|
@@ -2468,7 +2480,7 @@ tv({
|
|
|
2468
2480
|
});
|
|
2469
2481
|
var alert = tv({
|
|
2470
2482
|
base: [
|
|
2471
|
-
"relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border border-edge-muted px-4 py-3 text-base",
|
|
2483
|
+
"relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border border-edge-muted px-4 py-3 text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
2472
2484
|
"has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3",
|
|
2473
2485
|
"[&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current"
|
|
2474
2486
|
],
|
|
@@ -2501,7 +2513,7 @@ tv({
|
|
|
2501
2513
|
base: "inline-flex items-center gap-2",
|
|
2502
2514
|
slots: {
|
|
2503
2515
|
dot: "w-2 h-2 rounded-full",
|
|
2504
|
-
label: "text-base"
|
|
2516
|
+
label: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]"
|
|
2505
2517
|
},
|
|
2506
2518
|
variants: {
|
|
2507
2519
|
color: {
|
|
@@ -2521,7 +2533,7 @@ var toast = tv({
|
|
|
2521
2533
|
"flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg",
|
|
2522
2534
|
"bg-surface-overlay",
|
|
2523
2535
|
"border border-edge-muted",
|
|
2524
|
-
"text-base"
|
|
2536
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]"
|
|
2525
2537
|
],
|
|
2526
2538
|
variants: {
|
|
2527
2539
|
variant: {
|
|
@@ -2570,8 +2582,8 @@ var badge = tv({
|
|
|
2570
2582
|
rose: "bg-rose-50 text-rose-900 dark:bg-rose-500/20 dark:text-rose-100"
|
|
2571
2583
|
},
|
|
2572
2584
|
size: {
|
|
2573
|
-
sm: "text-xs px-2 py-0.5",
|
|
2574
|
-
md: "text-sm px-2.5 py-0.5"
|
|
2585
|
+
sm: "text-[length:var(--zen-font-size-xs)]/[var(--zen-line-height-xs)] px-2 py-0.5",
|
|
2586
|
+
md: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)] px-2.5 py-0.5"
|
|
2575
2587
|
}
|
|
2576
2588
|
},
|
|
2577
2589
|
defaultVariants: {
|
|
@@ -2593,11 +2605,26 @@ var avatar = tv({
|
|
|
2593
2605
|
},
|
|
2594
2606
|
variants: {
|
|
2595
2607
|
size: {
|
|
2596
|
-
xs: {
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2608
|
+
xs: {
|
|
2609
|
+
root: "size-6",
|
|
2610
|
+
fallback: "text-[length:var(--zen-font-size-xs)]/[var(--zen-line-height-xs)]"
|
|
2611
|
+
},
|
|
2612
|
+
sm: {
|
|
2613
|
+
root: "size-8",
|
|
2614
|
+
fallback: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]"
|
|
2615
|
+
},
|
|
2616
|
+
md: {
|
|
2617
|
+
root: "size-10",
|
|
2618
|
+
fallback: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]"
|
|
2619
|
+
},
|
|
2620
|
+
lg: {
|
|
2621
|
+
root: "size-12",
|
|
2622
|
+
fallback: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)]"
|
|
2623
|
+
},
|
|
2624
|
+
xl: {
|
|
2625
|
+
root: "size-16",
|
|
2626
|
+
fallback: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)]"
|
|
2627
|
+
}
|
|
2601
2628
|
}
|
|
2602
2629
|
},
|
|
2603
2630
|
defaultVariants: {
|
|
@@ -2607,7 +2634,7 @@ var avatar = tv({
|
|
|
2607
2634
|
var tag = tv({
|
|
2608
2635
|
slots: {
|
|
2609
2636
|
base: [
|
|
2610
|
-
"inline-flex items-center gap-1 px-2 py-0.5 rounded text-sm",
|
|
2637
|
+
"inline-flex items-center gap-1 px-2 py-0.5 rounded text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
2611
2638
|
"cursor-default outline-none",
|
|
2612
2639
|
"focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-1"
|
|
2613
2640
|
],
|
|
@@ -2668,7 +2695,7 @@ var AlertDescription = forwardRef(
|
|
|
2668
2695
|
ref,
|
|
2669
2696
|
"data-slot": "alert-description",
|
|
2670
2697
|
className: cn(
|
|
2671
|
-
"col-start-2 grid justify-items-start gap-1 text-base text-foreground-muted [&_p]:leading-relaxed",
|
|
2698
|
+
"col-start-2 grid justify-items-start gap-1 text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] text-foreground-muted [&_p]:leading-relaxed",
|
|
2672
2699
|
className
|
|
2673
2700
|
)
|
|
2674
2701
|
}
|
|
@@ -2678,7 +2705,10 @@ AlertDescription.displayName = "AlertDescription";
|
|
|
2678
2705
|
function Button({
|
|
2679
2706
|
variant,
|
|
2680
2707
|
size = "md",
|
|
2681
|
-
render,
|
|
2708
|
+
render: renderProp,
|
|
2709
|
+
href,
|
|
2710
|
+
target,
|
|
2711
|
+
rel,
|
|
2682
2712
|
preventFocusOnPress: _preventFocusOnPress = true,
|
|
2683
2713
|
nativeButton,
|
|
2684
2714
|
isDisabled,
|
|
@@ -2690,6 +2720,14 @@ function Button({
|
|
|
2690
2720
|
...props
|
|
2691
2721
|
}) {
|
|
2692
2722
|
const buttonClassName = button({ variant, size, className });
|
|
2723
|
+
const render = renderProp ?? (href ? /* @__PURE__ */ jsx(
|
|
2724
|
+
"a",
|
|
2725
|
+
{
|
|
2726
|
+
href,
|
|
2727
|
+
target,
|
|
2728
|
+
rel: rel ?? (target === "_blank" ? "noreferrer" : void 0)
|
|
2729
|
+
}
|
|
2730
|
+
) : void 0);
|
|
2693
2731
|
const isNativeButton = nativeButton ?? (render === void 0 || isValidElement(render) && render.type === "button");
|
|
2694
2732
|
const handleClick = (event) => {
|
|
2695
2733
|
onClick?.(event);
|
|
@@ -3214,7 +3252,7 @@ function Breadcrumb({ children, className, isDisabled, ...props }) {
|
|
|
3214
3252
|
...props,
|
|
3215
3253
|
"aria-disabled": isDisabled || void 0,
|
|
3216
3254
|
className: cn(
|
|
3217
|
-
"flex items-center text-base gap-3 list-none",
|
|
3255
|
+
"flex items-center text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] gap-3 list-none",
|
|
3218
3256
|
"[&_a]:text-foreground-muted [&_a]:no-underline [&_a]:font-normal",
|
|
3219
3257
|
"[&_a:hover]:text-foreground-primary",
|
|
3220
3258
|
"last:[&>span]:hidden",
|
|
@@ -3271,7 +3309,7 @@ function ButtonGroup({ className, orientation = "horizontal", ...props }) {
|
|
|
3271
3309
|
}
|
|
3272
3310
|
function ButtonGroupText({ className, render, children, ...props }) {
|
|
3273
3311
|
const classes = cn(
|
|
3274
|
-
"flex items-center gap-2 rounded border border-edge bg-surface-raised px-4 text-sm font-medium shadow-sm",
|
|
3312
|
+
"flex items-center gap-2 rounded border border-edge bg-surface-raised px-4 text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)] font-medium shadow-sm",
|
|
3275
3313
|
"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
|
|
3276
3314
|
className
|
|
3277
3315
|
);
|
|
@@ -3335,7 +3373,18 @@ function Calendar({
|
|
|
3335
3373
|
onChange?.(date);
|
|
3336
3374
|
}
|
|
3337
3375
|
},
|
|
3338
|
-
className: cn(
|
|
3376
|
+
className: cn(
|
|
3377
|
+
"w-fit max-w-full text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
3378
|
+
// The month grid is a real <table>; host prose styles (docs sites,
|
|
3379
|
+
// CMS themes) often style table/th/td with borders, padding, and
|
|
3380
|
+
// width. Reset them at matching specificity so zen styles hold.
|
|
3381
|
+
"[&_table]:m-0 [&_table]:w-auto [&_table]:border-0 [&_table]:text-[length:inherit]",
|
|
3382
|
+
"[&_th]:border-0 [&_th]:p-0 [&_th]:text-center [&_th]:align-middle",
|
|
3383
|
+
"[&_td]:border-0 [&_td]:p-0 [&_td]:text-center [&_td]:align-middle",
|
|
3384
|
+
"[&_th:first-child]:pl-0 [&_th:last-child]:pr-0",
|
|
3385
|
+
"[&_td:first-child]:pl-0 [&_td:last-child]:pr-0",
|
|
3386
|
+
className
|
|
3387
|
+
),
|
|
3339
3388
|
classNames: {
|
|
3340
3389
|
months: "relative",
|
|
3341
3390
|
month: "space-y-4",
|
|
@@ -3349,7 +3398,7 @@ function Calendar({
|
|
|
3349
3398
|
week: "flex mt-1",
|
|
3350
3399
|
day: "size-12 text-center",
|
|
3351
3400
|
day_button: "size-12 rounded cursor-pointer outline-none hover:bg-interactive focus-visible:outline-2 focus-visible:outline-focus-ring focus-visible:outline-offset-2",
|
|
3352
|
-
selected: "[&>button]:text-primary-foreground [&>button]:bg-primary",
|
|
3401
|
+
selected: "[&>button]:text-primary-foreground [&>button]:bg-primary [&>button:hover]:bg-primary",
|
|
3353
3402
|
outside: "invisible",
|
|
3354
3403
|
disabled: "text-foreground-disabled pointer-events-none opacity-50",
|
|
3355
3404
|
today: "[&>button]:font-bold"
|
|
@@ -3618,7 +3667,7 @@ function CollapsibleTrigger({ className, children, ...props }) {
|
|
|
3618
3667
|
{
|
|
3619
3668
|
...props,
|
|
3620
3669
|
className: cn(
|
|
3621
|
-
"flex items-center gap-2 cursor-pointer outline-none text-base",
|
|
3670
|
+
"flex items-center gap-2 cursor-pointer outline-none text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
3622
3671
|
"focus-visible:ring-2 focus-visible:ring-focus-ring rounded",
|
|
3623
3672
|
"disabled:text-foreground-disabled disabled:cursor-default",
|
|
3624
3673
|
className
|
|
@@ -3769,23 +3818,27 @@ function List({
|
|
|
3769
3818
|
if (parent.kind === "combobox") {
|
|
3770
3819
|
return /* @__PURE__ */ jsx(Combobox.List, { ...props, id: fieldId, className: classes, style, children });
|
|
3771
3820
|
}
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3821
|
+
const listbox = /* @__PURE__ */ jsx(ListContext.Provider, { value: { kind: "native", selected, toggle }, children: /* @__PURE__ */ jsx(
|
|
3822
|
+
"div",
|
|
3823
|
+
{
|
|
3824
|
+
id: fieldId,
|
|
3825
|
+
role: "listbox",
|
|
3826
|
+
"aria-multiselectable": selectionMode === "multiple" || void 0,
|
|
3827
|
+
...props,
|
|
3828
|
+
className: classes,
|
|
3829
|
+
style: { ...style, ...getHighlightColor(highlightColor) },
|
|
3830
|
+
children: children || renderEmptyState?.({})
|
|
3831
|
+
}
|
|
3832
|
+
) });
|
|
3833
|
+
if (label) {
|
|
3834
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
3835
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: fieldId, children: label }),
|
|
3836
|
+
listbox
|
|
3837
|
+
] });
|
|
3838
|
+
}
|
|
3839
|
+
return listbox;
|
|
3787
3840
|
}
|
|
3788
|
-
var itemClasses = "text-base flex items-center justify-between px-2 py-1.5 gap-3 min-w-[120px] cursor-pointer outline-none rounded hover:bg-interactive data-[highlighted]:bg-interactive data-[disabled]:text-foreground-disabled data-[selected]:font-semibold";
|
|
3841
|
+
var itemClasses = "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] flex items-center justify-between px-2 py-1.5 gap-3 min-w-[120px] cursor-pointer outline-none rounded hover:bg-interactive data-[highlighted]:bg-interactive data-[disabled]:text-foreground-disabled data-[selected]:font-semibold";
|
|
3789
3842
|
function ListItem({
|
|
3790
3843
|
id,
|
|
3791
3844
|
value,
|
|
@@ -3867,18 +3920,18 @@ function ListSection({ title, className, children, ...props }) {
|
|
|
3867
3920
|
const { kind } = useContext(ListContext);
|
|
3868
3921
|
if (kind === "select") {
|
|
3869
3922
|
return /* @__PURE__ */ jsxs(Select$1.Group, { ...props, className: cn("[&:not(:last-child)]:mb-4", className), children: [
|
|
3870
|
-
title && /* @__PURE__ */ jsx(Select$1.GroupLabel, { className: "text-base font-bold px-2 py-1.5", children: title }),
|
|
3923
|
+
title && /* @__PURE__ */ jsx(Select$1.GroupLabel, { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-bold px-2 py-1.5", children: title }),
|
|
3871
3924
|
children
|
|
3872
3925
|
] });
|
|
3873
3926
|
}
|
|
3874
3927
|
if (kind === "combobox") {
|
|
3875
3928
|
return /* @__PURE__ */ jsxs(Combobox.Group, { ...props, className: cn("[&:not(:last-child)]:mb-4", className), children: [
|
|
3876
|
-
title && /* @__PURE__ */ jsx(Combobox.GroupLabel, { className: "text-base font-bold px-2 py-1.5", children: title }),
|
|
3929
|
+
title && /* @__PURE__ */ jsx(Combobox.GroupLabel, { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-bold px-2 py-1.5", children: title }),
|
|
3877
3930
|
children
|
|
3878
3931
|
] });
|
|
3879
3932
|
}
|
|
3880
3933
|
return /* @__PURE__ */ jsxs("div", { ...props, role: "group", className: cn("[&:not(:last-child)]:mb-4", className), children: [
|
|
3881
|
-
title && /* @__PURE__ */ jsx("div", { className: "text-base font-bold px-2 py-1.5", children: title }),
|
|
3934
|
+
title && /* @__PURE__ */ jsx("div", { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-bold px-2 py-1.5", children: title }),
|
|
3882
3935
|
children
|
|
3883
3936
|
] });
|
|
3884
3937
|
}
|
|
@@ -3928,7 +3981,7 @@ var InputGroupAddon = forwardRef(
|
|
|
3928
3981
|
"data-slot": "input-group-addon",
|
|
3929
3982
|
"data-align": align,
|
|
3930
3983
|
className: cn(
|
|
3931
|
-
"flex h-auto shrink-0 cursor-text items-center justify-center gap-2 py-2 text-sm text-foreground-muted",
|
|
3984
|
+
"flex h-auto shrink-0 cursor-text items-center justify-center gap-2 py-2 text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)] text-foreground-muted",
|
|
3932
3985
|
"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
3933
3986
|
addonClasses[align],
|
|
3934
3987
|
className
|
|
@@ -3940,8 +3993,8 @@ var InputGroupAddon = forwardRef(
|
|
|
3940
3993
|
);
|
|
3941
3994
|
InputGroupAddon.displayName = "InputGroupAddon";
|
|
3942
3995
|
var buttonSizeClasses = {
|
|
3943
|
-
xs: "h-6 gap-1 rounded px-1.5 py-0 text-sm",
|
|
3944
|
-
sm: "h-8 gap-2 rounded px-2 py-0 text-sm",
|
|
3996
|
+
xs: "h-6 gap-1 rounded px-1.5 py-0 text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
3997
|
+
sm: "h-8 gap-2 rounded px-2 py-0 text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
3945
3998
|
"icon-xs": "size-6 rounded p-0",
|
|
3946
3999
|
"icon-sm": "size-8 rounded p-0"
|
|
3947
4000
|
};
|
|
@@ -3973,7 +4026,7 @@ var InputGroupText = forwardRef(
|
|
|
3973
4026
|
ref,
|
|
3974
4027
|
"data-slot": "input-group-text",
|
|
3975
4028
|
className: cn(
|
|
3976
|
-
"flex items-center gap-2 text-sm text-foreground-muted [&_svg]:pointer-events-none [&_svg]:size-4",
|
|
4029
|
+
"flex items-center gap-2 text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)] text-foreground-muted [&_svg]:pointer-events-none [&_svg]:size-4",
|
|
3977
4030
|
className
|
|
3978
4031
|
)
|
|
3979
4032
|
}
|
|
@@ -3988,7 +4041,7 @@ var InputGroupInput = forwardRef(
|
|
|
3988
4041
|
ref,
|
|
3989
4042
|
"data-slot": "input-group-control",
|
|
3990
4043
|
className: cn(
|
|
3991
|
-
"min-w-0 flex-1 bg-transparent px-3 py-2 text-base outline-none placeholder:text-foreground-muted disabled:cursor-not-allowed",
|
|
4044
|
+
"min-w-0 flex-1 bg-transparent px-3 py-2 text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] outline-none placeholder:text-foreground-muted disabled:cursor-not-allowed",
|
|
3992
4045
|
className
|
|
3993
4046
|
)
|
|
3994
4047
|
}
|
|
@@ -4002,7 +4055,7 @@ var InputGroupTextarea = forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
4002
4055
|
ref,
|
|
4003
4056
|
"data-slot": "input-group-control",
|
|
4004
4057
|
className: cn(
|
|
4005
|
-
"min-w-0 w-full flex-1 bg-transparent p-3 text-base outline-none placeholder:text-foreground-muted disabled:cursor-not-allowed",
|
|
4058
|
+
"min-w-0 w-full flex-1 bg-transparent p-3 text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] outline-none placeholder:text-foreground-muted disabled:cursor-not-allowed",
|
|
4006
4059
|
className
|
|
4007
4060
|
)
|
|
4008
4061
|
}
|
|
@@ -4109,7 +4162,7 @@ function ComboBox({
|
|
|
4109
4162
|
disabled: isDisabled,
|
|
4110
4163
|
onValueChange: onChange,
|
|
4111
4164
|
children: /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
4112
|
-
label && /* @__PURE__ */ jsx(Combobox.Label, { className: "text-base font-semibold", children: label }),
|
|
4165
|
+
label && /* @__PURE__ */ jsx(Combobox.Label, { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-semibold", children: label }),
|
|
4113
4166
|
/* @__PURE__ */ jsxs(Combobox.InputGroup, { render: /* @__PURE__ */ jsx(InputGroup, {}), children: [
|
|
4114
4167
|
/* @__PURE__ */ jsx(Combobox.Input, { placeholder, render: /* @__PURE__ */ jsx(InputGroupInput, {}) }),
|
|
4115
4168
|
/* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx(Combobox.Trigger, { className: "flex size-6 shrink-0 items-center justify-center rounded text-foreground-muted hover:bg-interactive hover:text-foreground-primary", children: /* @__PURE__ */ jsx(Icon, { rotate: 90, "aria-hidden": "true", size: "sm", children: /* @__PURE__ */ jsx(icons_exports.ChevronRight, {}) }) }) })
|
|
@@ -4129,7 +4182,7 @@ function ComboBox({
|
|
|
4129
4182
|
}
|
|
4130
4183
|
return item.element ?? /* @__PURE__ */ jsx(ListItem, { value: item.value, children: item.label }, item.value);
|
|
4131
4184
|
} }) }) }) }),
|
|
4132
|
-
/* @__PURE__ */ jsx(Combobox.Empty, { children: /* @__PURE__ */ jsx("div", { className: "flex min-h-16 items-center justify-center px-4 py-3 text-center", children: renderEmptyState ? renderEmptyState({}) : /* @__PURE__ */ jsx("span", { className: "text-base text-foreground-muted", children: "No items found." }) }) })
|
|
4185
|
+
/* @__PURE__ */ jsx(Combobox.Empty, { children: /* @__PURE__ */ jsx("div", { className: "flex min-h-16 items-center justify-center px-4 py-3 text-center", children: renderEmptyState ? renderEmptyState({}) : /* @__PURE__ */ jsx("span", { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] text-foreground-muted", children: "No items found." }) }) })
|
|
4133
4186
|
] })
|
|
4134
4187
|
}
|
|
4135
4188
|
) })
|
|
@@ -4185,7 +4238,7 @@ function CommandInput({ className, ...props }) {
|
|
|
4185
4238
|
{
|
|
4186
4239
|
...props,
|
|
4187
4240
|
className: cn(
|
|
4188
|
-
"flex h-11 w-full bg-transparent text-base outline-none",
|
|
4241
|
+
"flex h-11 w-full bg-transparent text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] outline-none",
|
|
4189
4242
|
"placeholder:text-foreground-muted",
|
|
4190
4243
|
"disabled:cursor-not-allowed disabled:text-foreground-disabled",
|
|
4191
4244
|
className
|
|
@@ -4202,7 +4255,10 @@ function CommandEmpty({ className, ...props }) {
|
|
|
4202
4255
|
Command$1.Empty,
|
|
4203
4256
|
{
|
|
4204
4257
|
...props,
|
|
4205
|
-
className: cn(
|
|
4258
|
+
className: cn(
|
|
4259
|
+
"py-6 text-center text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] text-foreground-muted",
|
|
4260
|
+
className
|
|
4261
|
+
)
|
|
4206
4262
|
}
|
|
4207
4263
|
);
|
|
4208
4264
|
}
|
|
@@ -4214,7 +4270,7 @@ function CommandGroup({ className, ...props }) {
|
|
|
4214
4270
|
className: cn(
|
|
4215
4271
|
"overflow-hidden [&:not(:last-child)]:mb-2",
|
|
4216
4272
|
"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5",
|
|
4217
|
-
"[&_[cmdk-group-heading]]:text-sm [&_[cmdk-group-heading]]:font-bold [&_[cmdk-group-heading]]:text-foreground-muted",
|
|
4273
|
+
"[&_[cmdk-group-heading]]:text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)] [&_[cmdk-group-heading]]:font-bold [&_[cmdk-group-heading]]:text-foreground-muted",
|
|
4218
4274
|
className
|
|
4219
4275
|
)
|
|
4220
4276
|
}
|
|
@@ -4227,7 +4283,7 @@ function CommandItem({ icon, isDisabled, className, children, ...props }) {
|
|
|
4227
4283
|
...props,
|
|
4228
4284
|
disabled: isDisabled,
|
|
4229
4285
|
className: cn(
|
|
4230
|
-
"flex items-center gap-3 px-2 py-1.5 rounded cursor-pointer outline-none text-base",
|
|
4286
|
+
"flex items-center gap-3 px-2 py-1.5 rounded cursor-pointer outline-none text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
4231
4287
|
"data-[selected=true]:bg-interactive",
|
|
4232
4288
|
"data-[disabled=true]:text-foreground-disabled data-[disabled=true]:cursor-default",
|
|
4233
4289
|
className
|
|
@@ -4324,6 +4380,7 @@ function TextField({
|
|
|
4324
4380
|
...props
|
|
4325
4381
|
}) {
|
|
4326
4382
|
const [inputValue, setInputValue] = useState(defaultValue ?? value ?? "");
|
|
4383
|
+
const wasControlled = useRef(value !== void 0);
|
|
4327
4384
|
const handleChange = (event) => {
|
|
4328
4385
|
const nextValue = event.target.value;
|
|
4329
4386
|
setInputValue(nextValue);
|
|
@@ -4331,68 +4388,75 @@ function TextField({
|
|
|
4331
4388
|
};
|
|
4332
4389
|
useEffect(() => {
|
|
4333
4390
|
if (value !== void 0) {
|
|
4391
|
+
wasControlled.current = true;
|
|
4334
4392
|
setInputValue(value);
|
|
4393
|
+
} else if (wasControlled.current) {
|
|
4394
|
+
setInputValue(defaultValue ?? "");
|
|
4335
4395
|
}
|
|
4336
|
-
}, [value]);
|
|
4396
|
+
}, [value, defaultValue]);
|
|
4337
4397
|
const inputClasses = cn(resize && resizeClasses[resize]);
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4398
|
+
const input = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
4399
|
+
InputGroup,
|
|
4400
|
+
{
|
|
4401
|
+
variant: variant === "quiet" ? "quiet" : "default",
|
|
4402
|
+
className: cn(
|
|
4403
|
+
isReadOnly && "focus-within:border-edge",
|
|
4404
|
+
isDisabled && "text-foreground-disabled",
|
|
4405
|
+
variant === "quiet" && "text-[length:inherit]",
|
|
4406
|
+
className
|
|
4407
|
+
),
|
|
4408
|
+
children: [
|
|
4409
|
+
asTextArea ? /* @__PURE__ */ jsx(
|
|
4410
|
+
InputGroupTextarea,
|
|
4411
|
+
{
|
|
4412
|
+
...props,
|
|
4413
|
+
placeholder,
|
|
4414
|
+
value: inputValue,
|
|
4415
|
+
readOnly: isReadOnly,
|
|
4416
|
+
disabled: isDisabled,
|
|
4417
|
+
className: inputClasses,
|
|
4418
|
+
onChange: handleChange
|
|
4419
|
+
}
|
|
4420
|
+
) : /* @__PURE__ */ jsx(
|
|
4421
|
+
InputGroupInput,
|
|
4422
|
+
{
|
|
4423
|
+
...props,
|
|
4424
|
+
placeholder,
|
|
4425
|
+
value: inputValue,
|
|
4426
|
+
readOnly: isReadOnly,
|
|
4427
|
+
disabled: isDisabled,
|
|
4428
|
+
className: inputClasses,
|
|
4429
|
+
onChange: handleChange
|
|
4430
|
+
}
|
|
4349
4431
|
),
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
className: cn(asTextArea && "justify-end pb-0"),
|
|
4379
|
-
children: /* @__PURE__ */ jsx(
|
|
4380
|
-
CopyButton,
|
|
4381
|
-
{
|
|
4382
|
-
value: String(inputValue),
|
|
4383
|
-
"aria-disabled": !inputValue,
|
|
4384
|
-
className: cn(
|
|
4385
|
-
"text-foreground-muted hover:text-foreground-primary",
|
|
4386
|
-
!inputValue && "text-foreground-disabled"
|
|
4387
|
-
)
|
|
4388
|
-
}
|
|
4389
|
-
)
|
|
4390
|
-
}
|
|
4391
|
-
)
|
|
4392
|
-
]
|
|
4393
|
-
}
|
|
4394
|
-
)
|
|
4395
|
-
] });
|
|
4432
|
+
allowCopy && /* @__PURE__ */ jsx(
|
|
4433
|
+
InputGroupAddon,
|
|
4434
|
+
{
|
|
4435
|
+
align: asTextArea ? "block-start" : "inline-end",
|
|
4436
|
+
className: cn(asTextArea && "justify-end pb-0"),
|
|
4437
|
+
children: /* @__PURE__ */ jsx(
|
|
4438
|
+
CopyButton,
|
|
4439
|
+
{
|
|
4440
|
+
value: String(inputValue),
|
|
4441
|
+
"aria-disabled": !inputValue,
|
|
4442
|
+
className: cn(
|
|
4443
|
+
"text-foreground-muted hover:text-foreground-primary",
|
|
4444
|
+
!inputValue && "text-foreground-disabled"
|
|
4445
|
+
)
|
|
4446
|
+
}
|
|
4447
|
+
)
|
|
4448
|
+
}
|
|
4449
|
+
)
|
|
4450
|
+
]
|
|
4451
|
+
}
|
|
4452
|
+
) });
|
|
4453
|
+
if (label) {
|
|
4454
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
4455
|
+
/* @__PURE__ */ jsx(Label, { children: label }),
|
|
4456
|
+
input
|
|
4457
|
+
] });
|
|
4458
|
+
}
|
|
4459
|
+
return input;
|
|
4396
4460
|
}
|
|
4397
4461
|
function ConfirmationDialog({
|
|
4398
4462
|
value,
|
|
@@ -4419,7 +4483,7 @@ function ConfirmationDialog({
|
|
|
4419
4483
|
paddingY: "2",
|
|
4420
4484
|
marginY: "2",
|
|
4421
4485
|
borderRadius: "md",
|
|
4422
|
-
className: "font-mono text-base bg-surface-sunken",
|
|
4486
|
+
className: "font-mono text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] bg-surface-sunken",
|
|
4423
4487
|
children: value
|
|
4424
4488
|
}
|
|
4425
4489
|
),
|
|
@@ -4688,7 +4752,17 @@ function Table({
|
|
|
4688
4752
|
}),
|
|
4689
4753
|
[registerRow, rowKeys, selectedKeys, selectionMode, setAllSelected, setRowSelected]
|
|
4690
4754
|
);
|
|
4691
|
-
return /* @__PURE__ */ jsx(TableSelectionContext.Provider, { value: selection, children: /* @__PURE__ */ jsx(
|
|
4755
|
+
return /* @__PURE__ */ jsx(TableSelectionContext.Provider, { value: selection, children: /* @__PURE__ */ jsx(
|
|
4756
|
+
"table",
|
|
4757
|
+
{
|
|
4758
|
+
...props,
|
|
4759
|
+
className: cn(
|
|
4760
|
+
"grid text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] w-full relative",
|
|
4761
|
+
className
|
|
4762
|
+
),
|
|
4763
|
+
children
|
|
4764
|
+
}
|
|
4765
|
+
) });
|
|
4692
4766
|
}
|
|
4693
4767
|
function TableHeader({ children, className, style, ...props }) {
|
|
4694
4768
|
const cols = style?.gridTemplateColumns || gridTemplateColumns;
|
|
@@ -4823,34 +4897,44 @@ function DataTable({
|
|
|
4823
4897
|
return /* @__PURE__ */ jsx(DataCard, { data: items }, `${row.id}-${index}`);
|
|
4824
4898
|
}) });
|
|
4825
4899
|
}
|
|
4826
|
-
return /* @__PURE__ */ jsxs(
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
/* @__PURE__ */ jsx(TableRow, { id: String(row.id), style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
|
|
4900
|
+
return /* @__PURE__ */ jsxs(
|
|
4901
|
+
Table,
|
|
4902
|
+
{
|
|
4903
|
+
...props,
|
|
4904
|
+
className: cn(
|
|
4905
|
+
"relative text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
4906
|
+
className
|
|
4907
|
+
),
|
|
4908
|
+
children: [
|
|
4909
|
+
/* @__PURE__ */ jsx(TableHeader, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, label, as, hidden, width, ...columnProps }) => {
|
|
4837
4910
|
if (hidden) {
|
|
4838
4911
|
return null;
|
|
4839
4912
|
}
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4913
|
+
return /* @__PURE__ */ createElement(TableColumn, { ...columnProps, key: id, id }, label);
|
|
4914
|
+
}) }),
|
|
4915
|
+
/* @__PURE__ */ jsx(TableBody, { children: rows.map((row, index) => {
|
|
4916
|
+
return (
|
|
4917
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: row data may not have unique ids
|
|
4918
|
+
/* @__PURE__ */ jsx(TableRow, { id: String(row.id), style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
|
|
4919
|
+
if (hidden) {
|
|
4920
|
+
return null;
|
|
4921
|
+
}
|
|
4922
|
+
const value = typeof children2 === "function" ? children2(row, index) : children2 || row[id];
|
|
4923
|
+
return /* @__PURE__ */ createElement(
|
|
4924
|
+
TableCell,
|
|
4925
|
+
{
|
|
4926
|
+
...cellProps,
|
|
4927
|
+
key: id,
|
|
4928
|
+
className: cn("items-center", className2)
|
|
4929
|
+
},
|
|
4930
|
+
as ? createElement(as, {}, value) : value
|
|
4931
|
+
);
|
|
4932
|
+
}) }, index)
|
|
4849
4933
|
);
|
|
4850
|
-
}) }
|
|
4851
|
-
|
|
4852
|
-
}
|
|
4853
|
-
|
|
4934
|
+
}) })
|
|
4935
|
+
]
|
|
4936
|
+
}
|
|
4937
|
+
);
|
|
4854
4938
|
}
|
|
4855
4939
|
function DataColumn(_props) {
|
|
4856
4940
|
return null;
|
|
@@ -5003,7 +5087,10 @@ var EmptyTitle = forwardRef(
|
|
|
5003
5087
|
...props,
|
|
5004
5088
|
ref,
|
|
5005
5089
|
"data-slot": "empty-title",
|
|
5006
|
-
className: cn(
|
|
5090
|
+
className: cn(
|
|
5091
|
+
"text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)] font-medium tracking-tight",
|
|
5092
|
+
className
|
|
5093
|
+
)
|
|
5007
5094
|
}
|
|
5008
5095
|
)
|
|
5009
5096
|
);
|
|
@@ -5015,7 +5102,7 @@ var EmptyDescription = forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5015
5102
|
ref,
|
|
5016
5103
|
"data-slot": "empty-description",
|
|
5017
5104
|
className: cn(
|
|
5018
|
-
"text-foreground-muted [&>a:hover]:text-foreground-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
|
|
5105
|
+
"text-foreground-muted [&>a:hover]:text-foreground-primary text-[length:var(--zen-font-size-sm)]/relaxed [&>a]:underline [&>a]:underline-offset-4",
|
|
5019
5106
|
className
|
|
5020
5107
|
)
|
|
5021
5108
|
}
|
|
@@ -5029,7 +5116,7 @@ var EmptyContent = forwardRef(
|
|
|
5029
5116
|
ref,
|
|
5030
5117
|
"data-slot": "empty-content",
|
|
5031
5118
|
className: cn(
|
|
5032
|
-
"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",
|
|
5119
|
+
"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)] text-balance",
|
|
5033
5120
|
className
|
|
5034
5121
|
)
|
|
5035
5122
|
}
|
|
@@ -5164,7 +5251,10 @@ function Form({
|
|
|
5164
5251
|
{
|
|
5165
5252
|
...props,
|
|
5166
5253
|
autoComplete,
|
|
5167
|
-
className: cn(
|
|
5254
|
+
className: cn(
|
|
5255
|
+
"flex flex-col relative text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] gap-3",
|
|
5256
|
+
className
|
|
5257
|
+
),
|
|
5168
5258
|
onSubmit: onSubmit ? handleSubmit(onSubmit) : void 0,
|
|
5169
5259
|
onKeyDown,
|
|
5170
5260
|
children: typeof children === "function" ? children(formValues) : children
|
|
@@ -5238,12 +5328,7 @@ function FormFieldArray({
|
|
|
5238
5328
|
children({ ...context, ...fieldProps })
|
|
5239
5329
|
] });
|
|
5240
5330
|
}
|
|
5241
|
-
function FormResetButton({
|
|
5242
|
-
values = {},
|
|
5243
|
-
children,
|
|
5244
|
-
onPress,
|
|
5245
|
-
...props
|
|
5246
|
-
}) {
|
|
5331
|
+
function FormResetButton({ values, children, onPress, ...props }) {
|
|
5247
5332
|
const { reset } = useFormContext();
|
|
5248
5333
|
const handleReset = (e) => {
|
|
5249
5334
|
reset(values);
|
|
@@ -5687,7 +5772,7 @@ function Kbd({ className, children, ...props }) {
|
|
|
5687
5772
|
...props,
|
|
5688
5773
|
className: cn(
|
|
5689
5774
|
"inline-flex items-center justify-center gap-1",
|
|
5690
|
-
"text-sm font-mono text-foreground-primary",
|
|
5775
|
+
"text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)] font-mono text-foreground-primary",
|
|
5691
5776
|
"px-1.5 py-0.5 rounded border border-edge bg-surface-raised shadow-sm",
|
|
5692
5777
|
className
|
|
5693
5778
|
),
|
|
@@ -5811,7 +5896,7 @@ function MenuItem({
|
|
|
5811
5896
|
}
|
|
5812
5897
|
};
|
|
5813
5898
|
const itemClassName = cn(
|
|
5814
|
-
"text-base flex items-center justify-between gap-3 px-2 py-1.5 rounded cursor-pointer outline-none w-full",
|
|
5899
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] flex items-center justify-between gap-3 px-2 py-1.5 rounded cursor-pointer outline-none w-full",
|
|
5815
5900
|
"hover:bg-interactive focus:bg-interactive data-[highlighted]:bg-interactive",
|
|
5816
5901
|
"data-[disabled]:text-foreground-disabled",
|
|
5817
5902
|
"data-[selected]:font-semibold",
|
|
@@ -5902,7 +5987,7 @@ function MenuSection({
|
|
|
5902
5987
|
const groupStyle = style;
|
|
5903
5988
|
const body = maxHeight ? /* @__PURE__ */ jsx(ScrollArea, { maxHeight, children }) : children;
|
|
5904
5989
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5905
|
-
title && (primitiveKind === "context-menu" ? /* @__PURE__ */ jsx(ContextMenu$1.GroupLabel, { className: "text-base font-bold px-2 py-1.5", children: title }) : primitiveKind === "menu" ? /* @__PURE__ */ jsx(Menu$1.GroupLabel, { className: "text-base font-bold px-2 py-1.5", children: title }) : /* @__PURE__ */ jsx("div", { className: "text-base font-bold px-2 py-1.5", children: title })),
|
|
5990
|
+
title && (primitiveKind === "context-menu" ? /* @__PURE__ */ jsx(ContextMenu$1.GroupLabel, { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-bold px-2 py-1.5", children: title }) : primitiveKind === "menu" ? /* @__PURE__ */ jsx(Menu$1.GroupLabel, { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-bold px-2 py-1.5", children: title }) : /* @__PURE__ */ jsx("div", { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-bold px-2 py-1.5", children: title })),
|
|
5906
5991
|
body
|
|
5907
5992
|
] });
|
|
5908
5993
|
if (primitiveKind === "context-menu") {
|
|
@@ -5989,7 +6074,7 @@ function Meter({
|
|
|
5989
6074
|
var NavbarContext = createContext({ showArrow: true });
|
|
5990
6075
|
var triggerClassName = cn(
|
|
5991
6076
|
"flex items-center gap-1 select-none cursor-pointer rounded-md px-3 py-2",
|
|
5992
|
-
"text-base font-medium text-foreground-primary bg-transparent border-0",
|
|
6077
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-medium text-foreground-primary bg-transparent border-0",
|
|
5993
6078
|
"hover:bg-interactive data-[popup-open]:bg-interactive",
|
|
5994
6079
|
"outline-none [&:focus-visible]:outline-2 [&:focus-visible]:outline-offset-1 [&:focus-visible]:outline-focus-ring"
|
|
5995
6080
|
);
|
|
@@ -6127,7 +6212,7 @@ function NumberField({
|
|
|
6127
6212
|
NumberField$1.Input,
|
|
6128
6213
|
{
|
|
6129
6214
|
placeholder,
|
|
6130
|
-
className: "w-full min-w-0 text-base text-center tabular-nums bg-transparent py-2 px-3 outline-none placeholder:text-foreground-muted"
|
|
6215
|
+
className: "w-full min-w-0 text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] text-center tabular-nums bg-transparent py-2 px-3 outline-none placeholder:text-foreground-muted"
|
|
6131
6216
|
}
|
|
6132
6217
|
),
|
|
6133
6218
|
/* @__PURE__ */ jsx(NumberField$1.Increment, { className: cn(stepperClasses, "border-l border-edge"), children: /* @__PURE__ */ jsx(Icon, { size: "sm", children: /* @__PURE__ */ jsx(icons_exports.Plus, {}) }) })
|
|
@@ -6167,7 +6252,7 @@ function OTPField({
|
|
|
6167
6252
|
OTPField$1.Input,
|
|
6168
6253
|
{
|
|
6169
6254
|
className: cn(
|
|
6170
|
-
"size-10 text-center text-base rounded border border-edge bg-surface-base shadow-sm",
|
|
6255
|
+
"size-10 text-center text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] rounded border border-edge bg-surface-base shadow-sm",
|
|
6171
6256
|
"text-foreground-primary outline-none transition-colors",
|
|
6172
6257
|
"focus:border-edge-strong focus:ring-2 focus:ring-focus-ring focus:ring-offset-1 focus:ring-offset-surface-base",
|
|
6173
6258
|
"data-[filled]:border-edge-strong",
|
|
@@ -6367,31 +6452,35 @@ function PasswordField({
|
|
|
6367
6452
|
...props
|
|
6368
6453
|
}) {
|
|
6369
6454
|
const [show, setShow] = useState(false);
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
}
|
|
6392
|
-
) })
|
|
6393
|
-
] })
|
|
6455
|
+
const input = /* @__PURE__ */ jsxs(InputGroup, { className, children: [
|
|
6456
|
+
/* @__PURE__ */ jsx(
|
|
6457
|
+
InputGroupInput,
|
|
6458
|
+
{
|
|
6459
|
+
"aria-label": "Password",
|
|
6460
|
+
...props,
|
|
6461
|
+
type: show ? "text" : "password",
|
|
6462
|
+
disabled: isDisabled,
|
|
6463
|
+
readOnly: isReadOnly
|
|
6464
|
+
}
|
|
6465
|
+
),
|
|
6466
|
+
/* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx(
|
|
6467
|
+
InputGroupButton,
|
|
6468
|
+
{
|
|
6469
|
+
size: "icon-xs",
|
|
6470
|
+
isDisabled,
|
|
6471
|
+
"aria-label": show ? "Hide password" : "Show password",
|
|
6472
|
+
onClick: () => setShow((state) => !state),
|
|
6473
|
+
children: /* @__PURE__ */ jsx(Icon, { children: show ? /* @__PURE__ */ jsx(EyeSlash_default, {}) : /* @__PURE__ */ jsx(Eye_default, {}) })
|
|
6474
|
+
}
|
|
6475
|
+
) })
|
|
6394
6476
|
] });
|
|
6477
|
+
if (label) {
|
|
6478
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
6479
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: props.id, children: label }),
|
|
6480
|
+
input
|
|
6481
|
+
] });
|
|
6482
|
+
}
|
|
6483
|
+
return input;
|
|
6395
6484
|
}
|
|
6396
6485
|
function ProgressBar({ className, showPercentage, ...props }) {
|
|
6397
6486
|
return /* @__PURE__ */ jsxs(Progress.Root, { ...props, className: cn("flex items-center gap-3 w-full", className), children: [
|
|
@@ -6443,7 +6532,7 @@ function ProgressCircle({
|
|
|
6443
6532
|
]
|
|
6444
6533
|
}
|
|
6445
6534
|
),
|
|
6446
|
-
showPercentage && /* @__PURE__ */ jsx(Progress.Value, { className: "text-base font-bold absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2" })
|
|
6535
|
+
showPercentage && /* @__PURE__ */ jsx(Progress.Value, { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-bold absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2" })
|
|
6447
6536
|
]
|
|
6448
6537
|
}
|
|
6449
6538
|
);
|
|
@@ -6483,7 +6572,7 @@ function Radio({ children, className, isDisabled, ...props }) {
|
|
|
6483
6572
|
...props,
|
|
6484
6573
|
disabled: isDisabled,
|
|
6485
6574
|
className: cn(
|
|
6486
|
-
"radio group flex items-center gap-3 cursor-pointer text-base",
|
|
6575
|
+
"radio group flex items-center gap-3 cursor-pointer text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
6487
6576
|
"before:content-[''] before:block before:w-5 before:h-5 before:box-border before:rounded-full",
|
|
6488
6577
|
"before:border before:border-edge-strong before:bg-surface-base before:transition-all before:duration-200",
|
|
6489
6578
|
"data-[checked]:before:border-[6px] data-[checked]:before:border-primary",
|
|
@@ -6551,6 +6640,7 @@ function SearchField({
|
|
|
6551
6640
|
...props
|
|
6552
6641
|
}) {
|
|
6553
6642
|
const [search, setSearch] = useState(String(value ?? defaultValue));
|
|
6643
|
+
const wasControlled = useRef(value !== void 0);
|
|
6554
6644
|
const searchValue = useDebounce(search, delay);
|
|
6555
6645
|
const handleChange = (nextValue) => {
|
|
6556
6646
|
setSearch(nextValue);
|
|
@@ -6561,49 +6651,56 @@ function SearchField({
|
|
|
6561
6651
|
};
|
|
6562
6652
|
useEffect(() => {
|
|
6563
6653
|
if (value !== void 0) {
|
|
6654
|
+
wasControlled.current = true;
|
|
6564
6655
|
setSearch(String(value));
|
|
6656
|
+
} else if (wasControlled.current) {
|
|
6657
|
+
setSearch(String(defaultValue));
|
|
6565
6658
|
}
|
|
6566
|
-
}, [value]);
|
|
6659
|
+
}, [value, defaultValue]);
|
|
6567
6660
|
useEffect(() => {
|
|
6568
6661
|
if (delay > 0) {
|
|
6569
6662
|
onSearch?.(searchValue);
|
|
6570
6663
|
}
|
|
6571
6664
|
}, [searchValue, delay, onSearch]);
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
if (event.key === "Enter") {
|
|
6588
|
-
onSearch?.(search);
|
|
6589
|
-
}
|
|
6665
|
+
const input = /* @__PURE__ */ jsxs(InputGroup, { role: "search", className, children: [
|
|
6666
|
+
/* @__PURE__ */ jsx(
|
|
6667
|
+
InputGroupInput,
|
|
6668
|
+
{
|
|
6669
|
+
"aria-label": "Search",
|
|
6670
|
+
...props,
|
|
6671
|
+
type: "search",
|
|
6672
|
+
placeholder,
|
|
6673
|
+
value: search,
|
|
6674
|
+
className: "[&::-webkit-search-cancel-button]:hidden",
|
|
6675
|
+
onChange: (event) => handleChange(event.target.value),
|
|
6676
|
+
onKeyDown: (event) => {
|
|
6677
|
+
props.onKeyDown?.(event);
|
|
6678
|
+
if (event.key === "Enter") {
|
|
6679
|
+
onSearch?.(search);
|
|
6590
6680
|
}
|
|
6591
6681
|
}
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
}
|
|
6604
|
-
|
|
6605
|
-
|
|
6682
|
+
}
|
|
6683
|
+
),
|
|
6684
|
+
/* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-start", children: /* @__PURE__ */ jsx(Icon, { color: "muted", children: /* @__PURE__ */ jsx(icons_exports.Search, {}) }) }),
|
|
6685
|
+
search && /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx(
|
|
6686
|
+
InputGroupButton,
|
|
6687
|
+
{
|
|
6688
|
+
size: "icon-xs",
|
|
6689
|
+
isDisabled: props.disabled,
|
|
6690
|
+
"aria-label": "Clear search",
|
|
6691
|
+
className: "text-foreground-muted",
|
|
6692
|
+
onClick: () => handleChange(""),
|
|
6693
|
+
children: /* @__PURE__ */ jsx(Icon, { size: "sm", children: /* @__PURE__ */ jsx(icons_exports.X, {}) })
|
|
6694
|
+
}
|
|
6695
|
+
) })
|
|
6606
6696
|
] });
|
|
6697
|
+
if (label) {
|
|
6698
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
6699
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: props.id, children: label }),
|
|
6700
|
+
input
|
|
6701
|
+
] });
|
|
6702
|
+
}
|
|
6703
|
+
return input;
|
|
6607
6704
|
}
|
|
6608
6705
|
function getSelectItemLabel(children, selectedValue) {
|
|
6609
6706
|
let label;
|
|
@@ -6736,7 +6833,7 @@ function Select({
|
|
|
6736
6833
|
}
|
|
6737
6834
|
),
|
|
6738
6835
|
isLoading && /* @__PURE__ */ jsx(Loading, { className: "py-8", icon: "dots", placement: "center", size: "sm" }),
|
|
6739
|
-
!isLoading && isEmpty && /* @__PURE__ */ jsx("div", { className: "px-2 py-8 text-center text-base text-foreground-muted", children: "No results found" }),
|
|
6836
|
+
!isLoading && isEmpty && /* @__PURE__ */ jsx("div", { className: "px-2 py-8 text-center text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] text-foreground-muted", children: "No results found" }),
|
|
6740
6837
|
/* @__PURE__ */ jsx(ListPrimitiveProvider, { kind: "select", children: /* @__PURE__ */ jsx(
|
|
6741
6838
|
ScrollArea,
|
|
6742
6839
|
{
|
|
@@ -6889,7 +6986,7 @@ function Slider({
|
|
|
6889
6986
|
children: [
|
|
6890
6987
|
/* @__PURE__ */ jsxs(Row, { justifyContent: "space-between", alignItems: "center", children: [
|
|
6891
6988
|
label && /* @__PURE__ */ jsx(Label, { id: labelId, children: label }),
|
|
6892
|
-
showValue && /* @__PURE__ */ jsx(Slider$1.Value, { className: "text-base tabular-nums" })
|
|
6989
|
+
showValue && /* @__PURE__ */ jsx(Slider$1.Value, { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] tabular-nums" })
|
|
6893
6990
|
] }),
|
|
6894
6991
|
/* @__PURE__ */ jsxs(Slider$1.Control, { className: "relative h-5 w-full touch-none", children: [
|
|
6895
6992
|
/* @__PURE__ */ jsx(Slider$1.Track, { className: "absolute inset-x-0 top-1/2 -translate-y-1/2 h-2 rounded-full bg-interactive overflow-hidden", children: /* @__PURE__ */ jsx(Slider$1.Indicator, { className: "h-full rounded-full bg-primary" }) }),
|
|
@@ -6928,10 +7025,22 @@ function StatusDot({ color, variant }) {
|
|
|
6928
7025
|
}
|
|
6929
7026
|
function StatusLight(props) {
|
|
6930
7027
|
const { color, variant = "inactive", children, className, ...domProps } = props;
|
|
6931
|
-
return /* @__PURE__ */ jsxs(
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
7028
|
+
return /* @__PURE__ */ jsxs(
|
|
7029
|
+
Row,
|
|
7030
|
+
{
|
|
7031
|
+
...domProps,
|
|
7032
|
+
alignItems: "center",
|
|
7033
|
+
gap: "2",
|
|
7034
|
+
className: cn(
|
|
7035
|
+
"text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
7036
|
+
className
|
|
7037
|
+
),
|
|
7038
|
+
children: [
|
|
7039
|
+
/* @__PURE__ */ jsx(StatusDot, { color, variant }),
|
|
7040
|
+
children
|
|
7041
|
+
]
|
|
7042
|
+
}
|
|
7043
|
+
);
|
|
6935
7044
|
}
|
|
6936
7045
|
function Switch({
|
|
6937
7046
|
label,
|
|
@@ -6948,7 +7057,7 @@ function Switch({
|
|
|
6948
7057
|
const checked = isSelected ?? (typeof value === "boolean" ? value : void 0);
|
|
6949
7058
|
const styles = switchVariant();
|
|
6950
7059
|
const fieldId = useFieldId(id);
|
|
6951
|
-
return /* @__PURE__ */ jsxs(Column, { children: [
|
|
7060
|
+
return /* @__PURE__ */ jsxs(Column, { gap: "1", children: [
|
|
6952
7061
|
label && /* @__PURE__ */ jsx(Label, { htmlFor: fieldId, children: label }),
|
|
6953
7062
|
/* @__PURE__ */ jsxs(
|
|
6954
7063
|
Switch$1.Root,
|
|
@@ -7013,7 +7122,7 @@ function Tab({ id, value, isDisabled, href, children, className, ...props }) {
|
|
|
7013
7122
|
render: href ? /* @__PURE__ */ jsx("a", { href }) : void 0,
|
|
7014
7123
|
nativeButton: !href,
|
|
7015
7124
|
className: cn(
|
|
7016
|
-
"tab flex items-center justify-center text-base text-foreground-muted py-2 border-b-2 border-transparent select-none -mb-[2px] cursor-pointer outline-none",
|
|
7125
|
+
"tab flex items-center justify-center text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] text-foreground-muted py-2 border-b-2 border-transparent select-none -mb-[2px] cursor-pointer outline-none",
|
|
7017
7126
|
"hover:text-foreground-primary",
|
|
7018
7127
|
"data-[active]:text-foreground-primary data-[active]:border-b-primary",
|
|
7019
7128
|
"data-[disabled]:text-foreground-disabled data-[disabled]:cursor-default",
|
|
@@ -7224,27 +7333,31 @@ function Toggle({
|
|
|
7224
7333
|
...props
|
|
7225
7334
|
}) {
|
|
7226
7335
|
const labelId = useId();
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7336
|
+
const toggle = /* @__PURE__ */ jsx(
|
|
7337
|
+
Toggle$1,
|
|
7338
|
+
{
|
|
7339
|
+
...props,
|
|
7340
|
+
"aria-labelledby": label ? labelId : props["aria-labelledby"],
|
|
7341
|
+
pressed: isSelected,
|
|
7342
|
+
defaultPressed: defaultSelected,
|
|
7343
|
+
disabled: isDisabled,
|
|
7344
|
+
onPressedChange: onChange,
|
|
7345
|
+
className: cn(
|
|
7346
|
+
"flex items-center justify-center whitespace-nowrap gap-3 font-medium bg-interactive border border-transparent rounded p-2 relative cursor-pointer",
|
|
7347
|
+
"hover:bg-interactive-hover",
|
|
7348
|
+
"data-[pressed]:text-primary-foreground data-[pressed]:bg-primary",
|
|
7349
|
+
className
|
|
7350
|
+
),
|
|
7351
|
+
children
|
|
7352
|
+
}
|
|
7353
|
+
);
|
|
7354
|
+
if (label) {
|
|
7355
|
+
return /* @__PURE__ */ jsxs("div", { className: "inline-flex flex-col gap-1", children: [
|
|
7356
|
+
/* @__PURE__ */ jsx(Label, { id: labelId, children: label }),
|
|
7357
|
+
toggle
|
|
7358
|
+
] });
|
|
7359
|
+
}
|
|
7360
|
+
return toggle;
|
|
7248
7361
|
}
|
|
7249
7362
|
var ToggleGroupVariantContext = createContext(void 0);
|
|
7250
7363
|
function ToggleGroup({
|
|
@@ -7266,25 +7379,29 @@ function ToggleGroup({
|
|
|
7266
7379
|
onSelectionChange?.(new Set(keys));
|
|
7267
7380
|
onChange?.(keys);
|
|
7268
7381
|
};
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
className
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7382
|
+
const group = /* @__PURE__ */ jsx(ToggleGroupVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsx(
|
|
7383
|
+
ToggleGroup$1,
|
|
7384
|
+
{
|
|
7385
|
+
...props,
|
|
7386
|
+
"aria-labelledby": label ? labelId : props["aria-labelledby"],
|
|
7387
|
+
value: value || (selectedKeys ? Array.from(selectedKeys) : void 0),
|
|
7388
|
+
defaultValue: defaultValue || (defaultSelectedKeys ? Array.from(defaultSelectedKeys) : void 0),
|
|
7389
|
+
multiple: selectionMode === "multiple",
|
|
7390
|
+
onValueChange: handleChange,
|
|
7391
|
+
className: cn(
|
|
7392
|
+
"inline-flex bg-surface-base shadow-sm border border-edge rounded overflow-hidden",
|
|
7393
|
+
className
|
|
7394
|
+
),
|
|
7395
|
+
children
|
|
7396
|
+
}
|
|
7397
|
+
) });
|
|
7398
|
+
if (label) {
|
|
7399
|
+
return /* @__PURE__ */ jsxs("div", { className: "inline-flex flex-col gap-1", children: [
|
|
7400
|
+
/* @__PURE__ */ jsx(Label, { id: labelId, children: label }),
|
|
7401
|
+
group
|
|
7402
|
+
] });
|
|
7403
|
+
}
|
|
7404
|
+
return group;
|
|
7288
7405
|
}
|
|
7289
7406
|
function ToggleGroupItem({
|
|
7290
7407
|
id,
|