@umami/react-zen 0.248.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 +461 -332
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +461 -332
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -1
- package/styles.css +196 -166
- 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
|
] }) }),
|
|
@@ -2243,7 +2253,8 @@ var button = tv({
|
|
|
2243
2253
|
default: [
|
|
2244
2254
|
"bg-interactive text-foreground-primary",
|
|
2245
2255
|
"hover:bg-interactive-hover",
|
|
2246
|
-
"pressed:bg-interactive-pressed"
|
|
2256
|
+
"pressed:bg-interactive-pressed",
|
|
2257
|
+
"disabled:text-foreground-disabled"
|
|
2247
2258
|
],
|
|
2248
2259
|
primary: [
|
|
2249
2260
|
"bg-primary text-primary-foreground",
|
|
@@ -2255,23 +2266,33 @@ var button = tv({
|
|
|
2255
2266
|
"bg-surface-base border-edge shadow-sm text-foreground-primary",
|
|
2256
2267
|
"hover:border-edge-strong",
|
|
2257
2268
|
"pressed:bg-surface-raised",
|
|
2258
|
-
"disabled:bg-surface-disabled"
|
|
2269
|
+
"disabled:bg-surface-disabled disabled:text-foreground-disabled"
|
|
2270
|
+
],
|
|
2271
|
+
quiet: [
|
|
2272
|
+
"bg-transparent",
|
|
2273
|
+
"hover:bg-interactive",
|
|
2274
|
+
"pressed:bg-interactive-hover",
|
|
2275
|
+
"disabled:text-foreground-disabled"
|
|
2259
2276
|
],
|
|
2260
|
-
quiet: ["bg-transparent", "hover:bg-interactive", "pressed:bg-interactive-hover"],
|
|
2261
2277
|
danger: [
|
|
2262
2278
|
"bg-status-error text-white",
|
|
2263
2279
|
"hover:opacity-90",
|
|
2264
2280
|
"pressed:opacity-80",
|
|
2265
2281
|
"disabled:opacity-50"
|
|
2266
2282
|
],
|
|
2267
|
-
zero: [
|
|
2283
|
+
zero: [
|
|
2284
|
+
"bg-transparent border-0",
|
|
2285
|
+
"hover:bg-transparent",
|
|
2286
|
+
"pressed:bg-transparent",
|
|
2287
|
+
"disabled:text-foreground-disabled"
|
|
2288
|
+
]
|
|
2268
2289
|
},
|
|
2269
2290
|
size: {
|
|
2270
|
-
xs: "text-sm py-1 px-2",
|
|
2271
|
-
sm: "text-base py-1.5 px-2.5",
|
|
2272
|
-
md: "text-base py-2 px-3",
|
|
2273
|
-
lg: "text-lg py-2.5 px-4",
|
|
2274
|
-
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"
|
|
2275
2296
|
}
|
|
2276
2297
|
},
|
|
2277
2298
|
defaultVariants: {
|
|
@@ -2282,7 +2303,7 @@ var button = tv({
|
|
|
2282
2303
|
var inputField = tv({
|
|
2283
2304
|
base: [
|
|
2284
2305
|
"relative flex items-center",
|
|
2285
|
-
"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",
|
|
2286
2307
|
"leading-6 text-foreground-primary transition-colors",
|
|
2287
2308
|
"focus-within:border-edge-strong",
|
|
2288
2309
|
"has-[input:read-only]:bg-surface-raised has-[textarea:read-only]:bg-surface-raised",
|
|
@@ -2301,7 +2322,7 @@ var inputField = tv({
|
|
|
2301
2322
|
tv({
|
|
2302
2323
|
base: [
|
|
2303
2324
|
"flex items-center justify-between",
|
|
2304
|
-
"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]",
|
|
2305
2326
|
"cursor-pointer outline-none rounded",
|
|
2306
2327
|
"text-foreground-primary",
|
|
2307
2328
|
"hovered:bg-interactive",
|
|
@@ -2338,13 +2359,15 @@ tv({
|
|
|
2338
2359
|
}
|
|
2339
2360
|
});
|
|
2340
2361
|
var tooltip = tv({
|
|
2341
|
-
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
|
+
]
|
|
2342
2365
|
});
|
|
2343
2366
|
var checkbox = tv({
|
|
2344
2367
|
slots: {
|
|
2345
2368
|
root: [
|
|
2346
2369
|
"group flex items-center gap-3",
|
|
2347
|
-
"text-base cursor-pointer",
|
|
2370
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] cursor-pointer",
|
|
2348
2371
|
"disabled:text-foreground-disabled disabled:cursor-default"
|
|
2349
2372
|
],
|
|
2350
2373
|
box: [
|
|
@@ -2368,7 +2391,7 @@ var switchVariant = tv({
|
|
|
2368
2391
|
slots: {
|
|
2369
2392
|
root: [
|
|
2370
2393
|
"group flex items-center gap-3",
|
|
2371
|
-
"text-base cursor-pointer",
|
|
2394
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] cursor-pointer",
|
|
2372
2395
|
"disabled:opacity-50 disabled:cursor-default"
|
|
2373
2396
|
],
|
|
2374
2397
|
track: [
|
|
@@ -2391,7 +2414,7 @@ tv({
|
|
|
2391
2414
|
root: "flex flex-col",
|
|
2392
2415
|
list: ["flex gap-1 border-b border-edge-muted"],
|
|
2393
2416
|
tab: [
|
|
2394
|
-
"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",
|
|
2395
2418
|
"text-foreground-muted outline-none",
|
|
2396
2419
|
"border-b-2 border-transparent -mb-px",
|
|
2397
2420
|
"hovered:text-foreground-primary",
|
|
@@ -2406,14 +2429,14 @@ tv({
|
|
|
2406
2429
|
base: "text-foreground-primary",
|
|
2407
2430
|
variants: {
|
|
2408
2431
|
size: {
|
|
2409
|
-
xs: "text-xs",
|
|
2410
|
-
sm: "text-sm",
|
|
2411
|
-
base: "text-base",
|
|
2412
|
-
lg: "text-lg",
|
|
2413
|
-
xl: "text-xl",
|
|
2414
|
-
"2xl": "text-2xl",
|
|
2415
|
-
"3xl": "text-3xl",
|
|
2416
|
-
"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)]"
|
|
2417
2440
|
},
|
|
2418
2441
|
color: {
|
|
2419
2442
|
default: "",
|
|
@@ -2440,15 +2463,15 @@ tv({
|
|
|
2440
2463
|
base: "font-semibold text-foreground-primary",
|
|
2441
2464
|
variants: {
|
|
2442
2465
|
size: {
|
|
2443
|
-
sm: "text-sm",
|
|
2444
|
-
base: "text-base",
|
|
2445
|
-
lg: "text-lg",
|
|
2446
|
-
xl: "text-xl",
|
|
2447
|
-
"2xl": "text-2xl",
|
|
2448
|
-
"3xl": "text-3xl",
|
|
2449
|
-
"4xl": "text-4xl",
|
|
2450
|
-
"5xl": "text-5xl",
|
|
2451
|
-
"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)]"
|
|
2452
2475
|
}
|
|
2453
2476
|
},
|
|
2454
2477
|
defaultVariants: {
|
|
@@ -2457,7 +2480,7 @@ tv({
|
|
|
2457
2480
|
});
|
|
2458
2481
|
var alert = tv({
|
|
2459
2482
|
base: [
|
|
2460
|
-
"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)]",
|
|
2461
2484
|
"has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3",
|
|
2462
2485
|
"[&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current"
|
|
2463
2486
|
],
|
|
@@ -2490,7 +2513,7 @@ tv({
|
|
|
2490
2513
|
base: "inline-flex items-center gap-2",
|
|
2491
2514
|
slots: {
|
|
2492
2515
|
dot: "w-2 h-2 rounded-full",
|
|
2493
|
-
label: "text-base"
|
|
2516
|
+
label: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]"
|
|
2494
2517
|
},
|
|
2495
2518
|
variants: {
|
|
2496
2519
|
color: {
|
|
@@ -2510,7 +2533,7 @@ var toast = tv({
|
|
|
2510
2533
|
"flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg",
|
|
2511
2534
|
"bg-surface-overlay",
|
|
2512
2535
|
"border border-edge-muted",
|
|
2513
|
-
"text-base"
|
|
2536
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]"
|
|
2514
2537
|
],
|
|
2515
2538
|
variants: {
|
|
2516
2539
|
variant: {
|
|
@@ -2559,8 +2582,8 @@ var badge = tv({
|
|
|
2559
2582
|
rose: "bg-rose-50 text-rose-900 dark:bg-rose-500/20 dark:text-rose-100"
|
|
2560
2583
|
},
|
|
2561
2584
|
size: {
|
|
2562
|
-
sm: "text-xs px-2 py-0.5",
|
|
2563
|
-
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"
|
|
2564
2587
|
}
|
|
2565
2588
|
},
|
|
2566
2589
|
defaultVariants: {
|
|
@@ -2582,11 +2605,26 @@ var avatar = tv({
|
|
|
2582
2605
|
},
|
|
2583
2606
|
variants: {
|
|
2584
2607
|
size: {
|
|
2585
|
-
xs: {
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
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
|
+
}
|
|
2590
2628
|
}
|
|
2591
2629
|
},
|
|
2592
2630
|
defaultVariants: {
|
|
@@ -2596,7 +2634,7 @@ var avatar = tv({
|
|
|
2596
2634
|
var tag = tv({
|
|
2597
2635
|
slots: {
|
|
2598
2636
|
base: [
|
|
2599
|
-
"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)]",
|
|
2600
2638
|
"cursor-default outline-none",
|
|
2601
2639
|
"focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-1"
|
|
2602
2640
|
],
|
|
@@ -2657,7 +2695,7 @@ var AlertDescription = forwardRef(
|
|
|
2657
2695
|
ref,
|
|
2658
2696
|
"data-slot": "alert-description",
|
|
2659
2697
|
className: cn(
|
|
2660
|
-
"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",
|
|
2661
2699
|
className
|
|
2662
2700
|
)
|
|
2663
2701
|
}
|
|
@@ -2667,8 +2705,12 @@ AlertDescription.displayName = "AlertDescription";
|
|
|
2667
2705
|
function Button({
|
|
2668
2706
|
variant,
|
|
2669
2707
|
size = "md",
|
|
2670
|
-
render,
|
|
2708
|
+
render: renderProp,
|
|
2709
|
+
href,
|
|
2710
|
+
target,
|
|
2711
|
+
rel,
|
|
2671
2712
|
preventFocusOnPress: _preventFocusOnPress = true,
|
|
2713
|
+
nativeButton,
|
|
2672
2714
|
isDisabled,
|
|
2673
2715
|
disabled,
|
|
2674
2716
|
onPress,
|
|
@@ -2678,6 +2720,15 @@ function Button({
|
|
|
2678
2720
|
...props
|
|
2679
2721
|
}) {
|
|
2680
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);
|
|
2731
|
+
const isNativeButton = nativeButton ?? (render === void 0 || isValidElement(render) && render.type === "button");
|
|
2681
2732
|
const handleClick = (event) => {
|
|
2682
2733
|
onClick?.(event);
|
|
2683
2734
|
if (!event.defaultPrevented) {
|
|
@@ -2690,6 +2741,7 @@ function Button({
|
|
|
2690
2741
|
...props,
|
|
2691
2742
|
"data-slot": "button",
|
|
2692
2743
|
render,
|
|
2744
|
+
nativeButton: isNativeButton,
|
|
2693
2745
|
disabled: isDisabled ?? disabled,
|
|
2694
2746
|
className: buttonClassName,
|
|
2695
2747
|
onClick: handleClick,
|
|
@@ -3200,8 +3252,8 @@ function Breadcrumb({ children, className, isDisabled, ...props }) {
|
|
|
3200
3252
|
...props,
|
|
3201
3253
|
"aria-disabled": isDisabled || void 0,
|
|
3202
3254
|
className: cn(
|
|
3203
|
-
"flex items-center text-base gap-3 list-none",
|
|
3204
|
-
"[&_a]:text-foreground-muted [&_a]:no-underline [&_a]:font-normal
|
|
3255
|
+
"flex items-center text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] gap-3 list-none",
|
|
3256
|
+
"[&_a]:text-foreground-muted [&_a]:no-underline [&_a]:font-normal",
|
|
3205
3257
|
"[&_a:hover]:text-foreground-primary",
|
|
3206
3258
|
"last:[&>span]:hidden",
|
|
3207
3259
|
className
|
|
@@ -3257,7 +3309,7 @@ function ButtonGroup({ className, orientation = "horizontal", ...props }) {
|
|
|
3257
3309
|
}
|
|
3258
3310
|
function ButtonGroupText({ className, render, children, ...props }) {
|
|
3259
3311
|
const classes = cn(
|
|
3260
|
-
"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",
|
|
3261
3313
|
"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
|
|
3262
3314
|
className
|
|
3263
3315
|
);
|
|
@@ -3321,7 +3373,18 @@ function Calendar({
|
|
|
3321
3373
|
onChange?.(date);
|
|
3322
3374
|
}
|
|
3323
3375
|
},
|
|
3324
|
-
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
|
+
),
|
|
3325
3388
|
classNames: {
|
|
3326
3389
|
months: "relative",
|
|
3327
3390
|
month: "space-y-4",
|
|
@@ -3335,7 +3398,7 @@ function Calendar({
|
|
|
3335
3398
|
week: "flex mt-1",
|
|
3336
3399
|
day: "size-12 text-center",
|
|
3337
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",
|
|
3338
|
-
selected: "[&>button]:text-primary-foreground [&>button]:bg-primary",
|
|
3401
|
+
selected: "[&>button]:text-primary-foreground [&>button]:bg-primary [&>button:hover]:bg-primary",
|
|
3339
3402
|
outside: "invisible",
|
|
3340
3403
|
disabled: "text-foreground-disabled pointer-events-none opacity-50",
|
|
3341
3404
|
today: "[&>button]:font-bold"
|
|
@@ -3604,7 +3667,7 @@ function CollapsibleTrigger({ className, children, ...props }) {
|
|
|
3604
3667
|
{
|
|
3605
3668
|
...props,
|
|
3606
3669
|
className: cn(
|
|
3607
|
-
"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)]",
|
|
3608
3671
|
"focus-visible:ring-2 focus-visible:ring-focus-ring rounded",
|
|
3609
3672
|
"disabled:text-foreground-disabled disabled:cursor-default",
|
|
3610
3673
|
className
|
|
@@ -3755,23 +3818,27 @@ function List({
|
|
|
3755
3818
|
if (parent.kind === "combobox") {
|
|
3756
3819
|
return /* @__PURE__ */ jsx(Combobox.List, { ...props, id: fieldId, className: classes, style, children });
|
|
3757
3820
|
}
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
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;
|
|
3773
3840
|
}
|
|
3774
|
-
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";
|
|
3775
3842
|
function ListItem({
|
|
3776
3843
|
id,
|
|
3777
3844
|
value,
|
|
@@ -3853,18 +3920,18 @@ function ListSection({ title, className, children, ...props }) {
|
|
|
3853
3920
|
const { kind } = useContext(ListContext);
|
|
3854
3921
|
if (kind === "select") {
|
|
3855
3922
|
return /* @__PURE__ */ jsxs(Select$1.Group, { ...props, className: cn("[&:not(:last-child)]:mb-4", className), children: [
|
|
3856
|
-
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 }),
|
|
3857
3924
|
children
|
|
3858
3925
|
] });
|
|
3859
3926
|
}
|
|
3860
3927
|
if (kind === "combobox") {
|
|
3861
3928
|
return /* @__PURE__ */ jsxs(Combobox.Group, { ...props, className: cn("[&:not(:last-child)]:mb-4", className), children: [
|
|
3862
|
-
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 }),
|
|
3863
3930
|
children
|
|
3864
3931
|
] });
|
|
3865
3932
|
}
|
|
3866
3933
|
return /* @__PURE__ */ jsxs("div", { ...props, role: "group", className: cn("[&:not(:last-child)]:mb-4", className), children: [
|
|
3867
|
-
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 }),
|
|
3868
3935
|
children
|
|
3869
3936
|
] });
|
|
3870
3937
|
}
|
|
@@ -3914,7 +3981,7 @@ var InputGroupAddon = forwardRef(
|
|
|
3914
3981
|
"data-slot": "input-group-addon",
|
|
3915
3982
|
"data-align": align,
|
|
3916
3983
|
className: cn(
|
|
3917
|
-
"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",
|
|
3918
3985
|
"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
3919
3986
|
addonClasses[align],
|
|
3920
3987
|
className
|
|
@@ -3926,8 +3993,8 @@ var InputGroupAddon = forwardRef(
|
|
|
3926
3993
|
);
|
|
3927
3994
|
InputGroupAddon.displayName = "InputGroupAddon";
|
|
3928
3995
|
var buttonSizeClasses = {
|
|
3929
|
-
xs: "h-6 gap-1 rounded px-1.5 py-0 text-sm",
|
|
3930
|
-
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)]",
|
|
3931
3998
|
"icon-xs": "size-6 rounded p-0",
|
|
3932
3999
|
"icon-sm": "size-8 rounded p-0"
|
|
3933
4000
|
};
|
|
@@ -3959,7 +4026,7 @@ var InputGroupText = forwardRef(
|
|
|
3959
4026
|
ref,
|
|
3960
4027
|
"data-slot": "input-group-text",
|
|
3961
4028
|
className: cn(
|
|
3962
|
-
"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",
|
|
3963
4030
|
className
|
|
3964
4031
|
)
|
|
3965
4032
|
}
|
|
@@ -3974,7 +4041,7 @@ var InputGroupInput = forwardRef(
|
|
|
3974
4041
|
ref,
|
|
3975
4042
|
"data-slot": "input-group-control",
|
|
3976
4043
|
className: cn(
|
|
3977
|
-
"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",
|
|
3978
4045
|
className
|
|
3979
4046
|
)
|
|
3980
4047
|
}
|
|
@@ -3988,7 +4055,7 @@ var InputGroupTextarea = forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
3988
4055
|
ref,
|
|
3989
4056
|
"data-slot": "input-group-control",
|
|
3990
4057
|
className: cn(
|
|
3991
|
-
"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",
|
|
3992
4059
|
className
|
|
3993
4060
|
)
|
|
3994
4061
|
}
|
|
@@ -4095,7 +4162,7 @@ function ComboBox({
|
|
|
4095
4162
|
disabled: isDisabled,
|
|
4096
4163
|
onValueChange: onChange,
|
|
4097
4164
|
children: /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
4098
|
-
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 }),
|
|
4099
4166
|
/* @__PURE__ */ jsxs(Combobox.InputGroup, { render: /* @__PURE__ */ jsx(InputGroup, {}), children: [
|
|
4100
4167
|
/* @__PURE__ */ jsx(Combobox.Input, { placeholder, render: /* @__PURE__ */ jsx(InputGroupInput, {}) }),
|
|
4101
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, {}) }) }) })
|
|
@@ -4115,7 +4182,7 @@ function ComboBox({
|
|
|
4115
4182
|
}
|
|
4116
4183
|
return item.element ?? /* @__PURE__ */ jsx(ListItem, { value: item.value, children: item.label }, item.value);
|
|
4117
4184
|
} }) }) }) }),
|
|
4118
|
-
/* @__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." }) }) })
|
|
4119
4186
|
] })
|
|
4120
4187
|
}
|
|
4121
4188
|
) })
|
|
@@ -4171,7 +4238,7 @@ function CommandInput({ className, ...props }) {
|
|
|
4171
4238
|
{
|
|
4172
4239
|
...props,
|
|
4173
4240
|
className: cn(
|
|
4174
|
-
"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",
|
|
4175
4242
|
"placeholder:text-foreground-muted",
|
|
4176
4243
|
"disabled:cursor-not-allowed disabled:text-foreground-disabled",
|
|
4177
4244
|
className
|
|
@@ -4188,7 +4255,10 @@ function CommandEmpty({ className, ...props }) {
|
|
|
4188
4255
|
Command$1.Empty,
|
|
4189
4256
|
{
|
|
4190
4257
|
...props,
|
|
4191
|
-
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
|
+
)
|
|
4192
4262
|
}
|
|
4193
4263
|
);
|
|
4194
4264
|
}
|
|
@@ -4200,7 +4270,7 @@ function CommandGroup({ className, ...props }) {
|
|
|
4200
4270
|
className: cn(
|
|
4201
4271
|
"overflow-hidden [&:not(:last-child)]:mb-2",
|
|
4202
4272
|
"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5",
|
|
4203
|
-
"[&_[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",
|
|
4204
4274
|
className
|
|
4205
4275
|
)
|
|
4206
4276
|
}
|
|
@@ -4213,7 +4283,7 @@ function CommandItem({ icon, isDisabled, className, children, ...props }) {
|
|
|
4213
4283
|
...props,
|
|
4214
4284
|
disabled: isDisabled,
|
|
4215
4285
|
className: cn(
|
|
4216
|
-
"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)]",
|
|
4217
4287
|
"data-[selected=true]:bg-interactive",
|
|
4218
4288
|
"data-[disabled=true]:text-foreground-disabled data-[disabled=true]:cursor-default",
|
|
4219
4289
|
className
|
|
@@ -4310,6 +4380,7 @@ function TextField({
|
|
|
4310
4380
|
...props
|
|
4311
4381
|
}) {
|
|
4312
4382
|
const [inputValue, setInputValue] = useState(defaultValue ?? value ?? "");
|
|
4383
|
+
const wasControlled = useRef(value !== void 0);
|
|
4313
4384
|
const handleChange = (event) => {
|
|
4314
4385
|
const nextValue = event.target.value;
|
|
4315
4386
|
setInputValue(nextValue);
|
|
@@ -4317,68 +4388,75 @@ function TextField({
|
|
|
4317
4388
|
};
|
|
4318
4389
|
useEffect(() => {
|
|
4319
4390
|
if (value !== void 0) {
|
|
4391
|
+
wasControlled.current = true;
|
|
4320
4392
|
setInputValue(value);
|
|
4393
|
+
} else if (wasControlled.current) {
|
|
4394
|
+
setInputValue(defaultValue ?? "");
|
|
4321
4395
|
}
|
|
4322
|
-
}, [value]);
|
|
4396
|
+
}, [value, defaultValue]);
|
|
4323
4397
|
const inputClasses = cn(resize && resizeClasses[resize]);
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
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
|
+
}
|
|
4335
4431
|
),
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
className: cn(asTextArea && "justify-end pb-0"),
|
|
4365
|
-
children: /* @__PURE__ */ jsx(
|
|
4366
|
-
CopyButton,
|
|
4367
|
-
{
|
|
4368
|
-
value: String(inputValue),
|
|
4369
|
-
"aria-disabled": !inputValue,
|
|
4370
|
-
className: cn(
|
|
4371
|
-
"text-foreground-muted hover:text-foreground-primary",
|
|
4372
|
-
!inputValue && "text-foreground-disabled"
|
|
4373
|
-
)
|
|
4374
|
-
}
|
|
4375
|
-
)
|
|
4376
|
-
}
|
|
4377
|
-
)
|
|
4378
|
-
]
|
|
4379
|
-
}
|
|
4380
|
-
)
|
|
4381
|
-
] });
|
|
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;
|
|
4382
4460
|
}
|
|
4383
4461
|
function ConfirmationDialog({
|
|
4384
4462
|
value,
|
|
@@ -4405,7 +4483,7 @@ function ConfirmationDialog({
|
|
|
4405
4483
|
paddingY: "2",
|
|
4406
4484
|
marginY: "2",
|
|
4407
4485
|
borderRadius: "md",
|
|
4408
|
-
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",
|
|
4409
4487
|
children: value
|
|
4410
4488
|
}
|
|
4411
4489
|
),
|
|
@@ -4674,7 +4752,17 @@ function Table({
|
|
|
4674
4752
|
}),
|
|
4675
4753
|
[registerRow, rowKeys, selectedKeys, selectionMode, setAllSelected, setRowSelected]
|
|
4676
4754
|
);
|
|
4677
|
-
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
|
+
) });
|
|
4678
4766
|
}
|
|
4679
4767
|
function TableHeader({ children, className, style, ...props }) {
|
|
4680
4768
|
const cols = style?.gridTemplateColumns || gridTemplateColumns;
|
|
@@ -4809,34 +4897,44 @@ function DataTable({
|
|
|
4809
4897
|
return /* @__PURE__ */ jsx(DataCard, { data: items }, `${row.id}-${index}`);
|
|
4810
4898
|
}) });
|
|
4811
4899
|
}
|
|
4812
|
-
return /* @__PURE__ */ jsxs(
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
/* @__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 }) => {
|
|
4823
4910
|
if (hidden) {
|
|
4824
4911
|
return null;
|
|
4825
4912
|
}
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
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)
|
|
4835
4933
|
);
|
|
4836
|
-
}) }
|
|
4837
|
-
|
|
4838
|
-
}
|
|
4839
|
-
|
|
4934
|
+
}) })
|
|
4935
|
+
]
|
|
4936
|
+
}
|
|
4937
|
+
);
|
|
4840
4938
|
}
|
|
4841
4939
|
function DataColumn(_props) {
|
|
4842
4940
|
return null;
|
|
@@ -4989,7 +5087,10 @@ var EmptyTitle = forwardRef(
|
|
|
4989
5087
|
...props,
|
|
4990
5088
|
ref,
|
|
4991
5089
|
"data-slot": "empty-title",
|
|
4992
|
-
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
|
+
)
|
|
4993
5094
|
}
|
|
4994
5095
|
)
|
|
4995
5096
|
);
|
|
@@ -5001,7 +5102,7 @@ var EmptyDescription = forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5001
5102
|
ref,
|
|
5002
5103
|
"data-slot": "empty-description",
|
|
5003
5104
|
className: cn(
|
|
5004
|
-
"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",
|
|
5005
5106
|
className
|
|
5006
5107
|
)
|
|
5007
5108
|
}
|
|
@@ -5015,7 +5116,7 @@ var EmptyContent = forwardRef(
|
|
|
5015
5116
|
ref,
|
|
5016
5117
|
"data-slot": "empty-content",
|
|
5017
5118
|
className: cn(
|
|
5018
|
-
"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",
|
|
5019
5120
|
className
|
|
5020
5121
|
)
|
|
5021
5122
|
}
|
|
@@ -5150,7 +5251,10 @@ function Form({
|
|
|
5150
5251
|
{
|
|
5151
5252
|
...props,
|
|
5152
5253
|
autoComplete,
|
|
5153
|
-
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
|
+
),
|
|
5154
5258
|
onSubmit: onSubmit ? handleSubmit(onSubmit) : void 0,
|
|
5155
5259
|
onKeyDown,
|
|
5156
5260
|
children: typeof children === "function" ? children(formValues) : children
|
|
@@ -5224,12 +5328,7 @@ function FormFieldArray({
|
|
|
5224
5328
|
children({ ...context, ...fieldProps })
|
|
5225
5329
|
] });
|
|
5226
5330
|
}
|
|
5227
|
-
function FormResetButton({
|
|
5228
|
-
values = {},
|
|
5229
|
-
children,
|
|
5230
|
-
onPress,
|
|
5231
|
-
...props
|
|
5232
|
-
}) {
|
|
5331
|
+
function FormResetButton({ values, children, onPress, ...props }) {
|
|
5233
5332
|
const { reset } = useFormContext();
|
|
5234
5333
|
const handleReset = (e) => {
|
|
5235
5334
|
reset(values);
|
|
@@ -5673,7 +5772,7 @@ function Kbd({ className, children, ...props }) {
|
|
|
5673
5772
|
...props,
|
|
5674
5773
|
className: cn(
|
|
5675
5774
|
"inline-flex items-center justify-center gap-1",
|
|
5676
|
-
"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",
|
|
5677
5776
|
"px-1.5 py-0.5 rounded border border-edge bg-surface-raised shadow-sm",
|
|
5678
5777
|
className
|
|
5679
5778
|
),
|
|
@@ -5762,7 +5861,8 @@ function Menu({
|
|
|
5762
5861
|
return /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(
|
|
5763
5862
|
Menu$1.Positioner,
|
|
5764
5863
|
{
|
|
5765
|
-
|
|
5864
|
+
sideOffset: 4,
|
|
5865
|
+
...inMenubar ? { align: "start" } : {},
|
|
5766
5866
|
className: "zen-layer-floating",
|
|
5767
5867
|
children: /* @__PURE__ */ jsx(Menu$1.Popup, { ...props, className: cn("zen-popover", popupClassName2), children: popupContent })
|
|
5768
5868
|
}
|
|
@@ -5796,7 +5896,7 @@ function MenuItem({
|
|
|
5796
5896
|
}
|
|
5797
5897
|
};
|
|
5798
5898
|
const itemClassName = cn(
|
|
5799
|
-
"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",
|
|
5800
5900
|
"hover:bg-interactive focus:bg-interactive data-[highlighted]:bg-interactive",
|
|
5801
5901
|
"data-[disabled]:text-foreground-disabled",
|
|
5802
5902
|
"data-[selected]:font-semibold",
|
|
@@ -5887,7 +5987,7 @@ function MenuSection({
|
|
|
5887
5987
|
const groupStyle = style;
|
|
5888
5988
|
const body = maxHeight ? /* @__PURE__ */ jsx(ScrollArea, { maxHeight, children }) : children;
|
|
5889
5989
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5890
|
-
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 })),
|
|
5891
5991
|
body
|
|
5892
5992
|
] });
|
|
5893
5993
|
if (primitiveKind === "context-menu") {
|
|
@@ -5926,10 +6026,7 @@ function Menubar({ isDisabled, className, children, ...props }) {
|
|
|
5926
6026
|
{
|
|
5927
6027
|
...props,
|
|
5928
6028
|
disabled: isDisabled,
|
|
5929
|
-
className: cn(
|
|
5930
|
-
"flex items-center gap-1 p-1 rounded-md border border-edge bg-surface-base shadow-sm w-fit",
|
|
5931
|
-
className
|
|
5932
|
-
),
|
|
6029
|
+
className: cn("flex items-center gap-1 w-fit", className),
|
|
5933
6030
|
children
|
|
5934
6031
|
}
|
|
5935
6032
|
);
|
|
@@ -5977,7 +6074,7 @@ function Meter({
|
|
|
5977
6074
|
var NavbarContext = createContext({ showArrow: true });
|
|
5978
6075
|
var triggerClassName = cn(
|
|
5979
6076
|
"flex items-center gap-1 select-none cursor-pointer rounded-md px-3 py-2",
|
|
5980
|
-
"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",
|
|
5981
6078
|
"hover:bg-interactive data-[popup-open]:bg-interactive",
|
|
5982
6079
|
"outline-none [&:focus-visible]:outline-2 [&:focus-visible]:outline-offset-1 [&:focus-visible]:outline-focus-ring"
|
|
5983
6080
|
);
|
|
@@ -6115,7 +6212,7 @@ function NumberField({
|
|
|
6115
6212
|
NumberField$1.Input,
|
|
6116
6213
|
{
|
|
6117
6214
|
placeholder,
|
|
6118
|
-
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"
|
|
6119
6216
|
}
|
|
6120
6217
|
),
|
|
6121
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, {}) }) })
|
|
@@ -6155,7 +6252,7 @@ function OTPField({
|
|
|
6155
6252
|
OTPField$1.Input,
|
|
6156
6253
|
{
|
|
6157
6254
|
className: cn(
|
|
6158
|
-
"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",
|
|
6159
6256
|
"text-foreground-primary outline-none transition-colors",
|
|
6160
6257
|
"focus:border-edge-strong focus:ring-2 focus:ring-focus-ring focus:ring-offset-1 focus:ring-offset-surface-base",
|
|
6161
6258
|
"data-[filled]:border-edge-strong",
|
|
@@ -6355,31 +6452,35 @@ function PasswordField({
|
|
|
6355
6452
|
...props
|
|
6356
6453
|
}) {
|
|
6357
6454
|
const [show, setShow] = useState(false);
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
}
|
|
6380
|
-
) })
|
|
6381
|
-
] })
|
|
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
|
+
) })
|
|
6382
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;
|
|
6383
6484
|
}
|
|
6384
6485
|
function ProgressBar({ className, showPercentage, ...props }) {
|
|
6385
6486
|
return /* @__PURE__ */ jsxs(Progress.Root, { ...props, className: cn("flex items-center gap-3 w-full", className), children: [
|
|
@@ -6431,7 +6532,7 @@ function ProgressCircle({
|
|
|
6431
6532
|
]
|
|
6432
6533
|
}
|
|
6433
6534
|
),
|
|
6434
|
-
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" })
|
|
6435
6536
|
]
|
|
6436
6537
|
}
|
|
6437
6538
|
);
|
|
@@ -6471,7 +6572,7 @@ function Radio({ children, className, isDisabled, ...props }) {
|
|
|
6471
6572
|
...props,
|
|
6472
6573
|
disabled: isDisabled,
|
|
6473
6574
|
className: cn(
|
|
6474
|
-
"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)]",
|
|
6475
6576
|
"before:content-[''] before:block before:w-5 before:h-5 before:box-border before:rounded-full",
|
|
6476
6577
|
"before:border before:border-edge-strong before:bg-surface-base before:transition-all before:duration-200",
|
|
6477
6578
|
"data-[checked]:before:border-[6px] data-[checked]:before:border-primary",
|
|
@@ -6539,6 +6640,7 @@ function SearchField({
|
|
|
6539
6640
|
...props
|
|
6540
6641
|
}) {
|
|
6541
6642
|
const [search, setSearch] = useState(String(value ?? defaultValue));
|
|
6643
|
+
const wasControlled = useRef(value !== void 0);
|
|
6542
6644
|
const searchValue = useDebounce(search, delay);
|
|
6543
6645
|
const handleChange = (nextValue) => {
|
|
6544
6646
|
setSearch(nextValue);
|
|
@@ -6549,49 +6651,56 @@ function SearchField({
|
|
|
6549
6651
|
};
|
|
6550
6652
|
useEffect(() => {
|
|
6551
6653
|
if (value !== void 0) {
|
|
6654
|
+
wasControlled.current = true;
|
|
6552
6655
|
setSearch(String(value));
|
|
6656
|
+
} else if (wasControlled.current) {
|
|
6657
|
+
setSearch(String(defaultValue));
|
|
6553
6658
|
}
|
|
6554
|
-
}, [value]);
|
|
6659
|
+
}, [value, defaultValue]);
|
|
6555
6660
|
useEffect(() => {
|
|
6556
6661
|
if (delay > 0) {
|
|
6557
6662
|
onSearch?.(searchValue);
|
|
6558
6663
|
}
|
|
6559
6664
|
}, [searchValue, delay, onSearch]);
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
if (event.key === "Enter") {
|
|
6576
|
-
onSearch?.(search);
|
|
6577
|
-
}
|
|
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);
|
|
6578
6680
|
}
|
|
6579
6681
|
}
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
}
|
|
6592
|
-
|
|
6593
|
-
|
|
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
|
+
) })
|
|
6594
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;
|
|
6595
6704
|
}
|
|
6596
6705
|
function getSelectItemLabel(children, selectedValue) {
|
|
6597
6706
|
let label;
|
|
@@ -6724,7 +6833,7 @@ function Select({
|
|
|
6724
6833
|
}
|
|
6725
6834
|
),
|
|
6726
6835
|
isLoading && /* @__PURE__ */ jsx(Loading, { className: "py-8", icon: "dots", placement: "center", size: "sm" }),
|
|
6727
|
-
!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" }),
|
|
6728
6837
|
/* @__PURE__ */ jsx(ListPrimitiveProvider, { kind: "select", children: /* @__PURE__ */ jsx(
|
|
6729
6838
|
ScrollArea,
|
|
6730
6839
|
{
|
|
@@ -6877,7 +6986,7 @@ function Slider({
|
|
|
6877
6986
|
children: [
|
|
6878
6987
|
/* @__PURE__ */ jsxs(Row, { justifyContent: "space-between", alignItems: "center", children: [
|
|
6879
6988
|
label && /* @__PURE__ */ jsx(Label, { id: labelId, children: label }),
|
|
6880
|
-
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" })
|
|
6881
6990
|
] }),
|
|
6882
6991
|
/* @__PURE__ */ jsxs(Slider$1.Control, { className: "relative h-5 w-full touch-none", children: [
|
|
6883
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" }) }),
|
|
@@ -6916,10 +7025,22 @@ function StatusDot({ color, variant }) {
|
|
|
6916
7025
|
}
|
|
6917
7026
|
function StatusLight(props) {
|
|
6918
7027
|
const { color, variant = "inactive", children, className, ...domProps } = props;
|
|
6919
|
-
return /* @__PURE__ */ jsxs(
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
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
|
+
);
|
|
6923
7044
|
}
|
|
6924
7045
|
function Switch({
|
|
6925
7046
|
label,
|
|
@@ -6936,7 +7057,7 @@ function Switch({
|
|
|
6936
7057
|
const checked = isSelected ?? (typeof value === "boolean" ? value : void 0);
|
|
6937
7058
|
const styles = switchVariant();
|
|
6938
7059
|
const fieldId = useFieldId(id);
|
|
6939
|
-
return /* @__PURE__ */ jsxs(Column, { children: [
|
|
7060
|
+
return /* @__PURE__ */ jsxs(Column, { gap: "1", children: [
|
|
6940
7061
|
label && /* @__PURE__ */ jsx(Label, { htmlFor: fieldId, children: label }),
|
|
6941
7062
|
/* @__PURE__ */ jsxs(
|
|
6942
7063
|
Switch$1.Root,
|
|
@@ -7001,7 +7122,7 @@ function Tab({ id, value, isDisabled, href, children, className, ...props }) {
|
|
|
7001
7122
|
render: href ? /* @__PURE__ */ jsx("a", { href }) : void 0,
|
|
7002
7123
|
nativeButton: !href,
|
|
7003
7124
|
className: cn(
|
|
7004
|
-
"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",
|
|
7005
7126
|
"hover:text-foreground-primary",
|
|
7006
7127
|
"data-[active]:text-foreground-primary data-[active]:border-b-primary",
|
|
7007
7128
|
"data-[disabled]:text-foreground-disabled data-[disabled]:cursor-default",
|
|
@@ -7212,27 +7333,31 @@ function Toggle({
|
|
|
7212
7333
|
...props
|
|
7213
7334
|
}) {
|
|
7214
7335
|
const labelId = useId();
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
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;
|
|
7236
7361
|
}
|
|
7237
7362
|
var ToggleGroupVariantContext = createContext(void 0);
|
|
7238
7363
|
function ToggleGroup({
|
|
@@ -7254,25 +7379,29 @@ function ToggleGroup({
|
|
|
7254
7379
|
onSelectionChange?.(new Set(keys));
|
|
7255
7380
|
onChange?.(keys);
|
|
7256
7381
|
};
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
className
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
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;
|
|
7276
7405
|
}
|
|
7277
7406
|
function ToggleGroupItem({
|
|
7278
7407
|
id,
|