@umami/react-zen 0.249.0 → 0.251.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 +448 -322
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +448 -322
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/styles.css +202 -172
- package/styles.full.css +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { Accordion as Accordion$1 } from '@base-ui/react/accordion';
|
|
2
3
|
import * as lucide_react_star from 'lucide-react';
|
|
3
4
|
import { forwardRef, createContext, isValidElement, cloneElement, Children, useState, useRef, useCallback, useEffect, useContext, useId, useMemo, Fragment as Fragment$1, createElement, useLayoutEffect } from 'react';
|
|
@@ -98,7 +99,7 @@ var paddingMap = {
|
|
|
98
99
|
"72": "p-72",
|
|
99
100
|
"80": "p-80",
|
|
100
101
|
"96": "p-96",
|
|
101
|
-
true: "px-[var(--padding-x-default)] py-[var(--padding-y-default)]"
|
|
102
|
+
true: "px-[var(--zen-padding-x-default)] py-[var(--zen-padding-y-default)]"
|
|
102
103
|
};
|
|
103
104
|
var pxMap = {
|
|
104
105
|
"0": "px-0",
|
|
@@ -136,7 +137,7 @@ var pxMap = {
|
|
|
136
137
|
"72": "px-72",
|
|
137
138
|
"80": "px-80",
|
|
138
139
|
"96": "px-96",
|
|
139
|
-
true: "px-[var(--padding-x-default)]"
|
|
140
|
+
true: "px-[var(--zen-padding-x-default)]"
|
|
140
141
|
};
|
|
141
142
|
var pyMap = {
|
|
142
143
|
"0": "py-0",
|
|
@@ -174,7 +175,7 @@ var pyMap = {
|
|
|
174
175
|
"72": "py-72",
|
|
175
176
|
"80": "py-80",
|
|
176
177
|
"96": "py-96",
|
|
177
|
-
true: "py-[var(--padding-y-default)]"
|
|
178
|
+
true: "py-[var(--zen-padding-y-default)]"
|
|
178
179
|
};
|
|
179
180
|
var ptMap = {
|
|
180
181
|
"0": "pt-0",
|
|
@@ -325,6 +326,7 @@ var plMap = {
|
|
|
325
326
|
"96": "pl-96"
|
|
326
327
|
};
|
|
327
328
|
var marginMap = {
|
|
329
|
+
auto: "m-auto",
|
|
328
330
|
"0": "m-0",
|
|
329
331
|
px: "m-px",
|
|
330
332
|
"0.5": "m-0.5",
|
|
@@ -383,6 +385,7 @@ var marginMap = {
|
|
|
383
385
|
"-24": "-m-24"
|
|
384
386
|
};
|
|
385
387
|
var mxMap = {
|
|
388
|
+
auto: "mx-auto",
|
|
386
389
|
"0": "mx-0",
|
|
387
390
|
px: "mx-px",
|
|
388
391
|
"0.5": "mx-0.5",
|
|
@@ -420,6 +423,7 @@ var mxMap = {
|
|
|
420
423
|
"-4": "-mx-4"
|
|
421
424
|
};
|
|
422
425
|
var myMap = {
|
|
426
|
+
auto: "my-auto",
|
|
423
427
|
"0": "my-0",
|
|
424
428
|
px: "my-px",
|
|
425
429
|
"0.5": "my-0.5",
|
|
@@ -457,6 +461,7 @@ var myMap = {
|
|
|
457
461
|
"-4": "-my-4"
|
|
458
462
|
};
|
|
459
463
|
var mtMap = {
|
|
464
|
+
auto: "mt-auto",
|
|
460
465
|
"0": "mt-0",
|
|
461
466
|
px: "mt-px",
|
|
462
467
|
"0.5": "mt-0.5",
|
|
@@ -494,6 +499,7 @@ var mtMap = {
|
|
|
494
499
|
"-4": "-mt-4"
|
|
495
500
|
};
|
|
496
501
|
var mrMap = {
|
|
502
|
+
auto: "mr-auto",
|
|
497
503
|
"0": "mr-0",
|
|
498
504
|
px: "mr-px",
|
|
499
505
|
"0.5": "mr-0.5",
|
|
@@ -531,6 +537,7 @@ var mrMap = {
|
|
|
531
537
|
"-4": "-mr-4"
|
|
532
538
|
};
|
|
533
539
|
var mbMap = {
|
|
540
|
+
auto: "mb-auto",
|
|
534
541
|
"0": "mb-0",
|
|
535
542
|
px: "mb-px",
|
|
536
543
|
"0.5": "mb-0.5",
|
|
@@ -568,6 +575,7 @@ var mbMap = {
|
|
|
568
575
|
"-4": "-mb-4"
|
|
569
576
|
};
|
|
570
577
|
var mlMap = {
|
|
578
|
+
auto: "ml-auto",
|
|
571
579
|
"0": "ml-0",
|
|
572
580
|
px: "ml-px",
|
|
573
581
|
"0.5": "ml-0.5",
|
|
@@ -640,7 +648,7 @@ var gapMap = {
|
|
|
640
648
|
"72": "gap-72",
|
|
641
649
|
"80": "gap-80",
|
|
642
650
|
"96": "gap-96",
|
|
643
|
-
true: "gap-[var(--gap-default)]"
|
|
651
|
+
true: "gap-[var(--zen-gap-default)]"
|
|
644
652
|
};
|
|
645
653
|
var gapXMap = {
|
|
646
654
|
"0": "gap-x-0",
|
|
@@ -667,7 +675,7 @@ var gapXMap = {
|
|
|
667
675
|
"24": "gap-x-24",
|
|
668
676
|
"28": "gap-x-28",
|
|
669
677
|
"32": "gap-x-32",
|
|
670
|
-
true: "gap-x-[var(--gap-default)]"
|
|
678
|
+
true: "gap-x-[var(--zen-gap-default)]"
|
|
671
679
|
};
|
|
672
680
|
var gapYMap = {
|
|
673
681
|
"0": "gap-y-0",
|
|
@@ -694,7 +702,7 @@ var gapYMap = {
|
|
|
694
702
|
"24": "gap-y-24",
|
|
695
703
|
"28": "gap-y-28",
|
|
696
704
|
"32": "gap-y-32",
|
|
697
|
-
true: "gap-y-[var(--gap-default)]"
|
|
705
|
+
true: "gap-y-[var(--zen-gap-default)]"
|
|
698
706
|
};
|
|
699
707
|
var spaceXMap = {
|
|
700
708
|
"0": "space-x-0",
|
|
@@ -771,33 +779,33 @@ var spaceYMap = {
|
|
|
771
779
|
"96": "space-y-96"
|
|
772
780
|
};
|
|
773
781
|
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"
|
|
782
|
+
xs: "text-[length:var(--zen-font-size-xs)]/[var(--zen-line-height-xs)]",
|
|
783
|
+
sm: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
784
|
+
base: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
785
|
+
lg: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)]",
|
|
786
|
+
xl: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)]",
|
|
787
|
+
"2xl": "text-[length:var(--zen-font-size-2xl)]/[var(--zen-line-height-2xl)]",
|
|
788
|
+
"3xl": "text-[length:var(--zen-font-size-3xl)]/[var(--zen-line-height-3xl)]",
|
|
789
|
+
"4xl": "text-[length:var(--zen-font-size-4xl)]/[var(--zen-line-height-4xl)]",
|
|
790
|
+
"5xl": "text-[length:var(--zen-font-size-5xl)]/[var(--zen-line-height-5xl)]",
|
|
791
|
+
"6xl": "text-[length:var(--zen-font-size-6xl)]/[var(--zen-line-height-6xl)]",
|
|
792
|
+
"7xl": "text-[length:var(--zen-font-size-7xl)]/[var(--zen-line-height-7xl)]",
|
|
793
|
+
"8xl": "text-[length:var(--zen-font-size-8xl)]/[var(--zen-line-height-8xl)]",
|
|
794
|
+
"9xl": "text-[length:var(--zen-font-size-9xl)]/[var(--zen-line-height-9xl)]"
|
|
787
795
|
};
|
|
788
796
|
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"
|
|
797
|
+
sm: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
798
|
+
base: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
799
|
+
lg: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)]",
|
|
800
|
+
xl: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)]",
|
|
801
|
+
"2xl": "text-[length:var(--zen-font-size-2xl)]/[var(--zen-line-height-2xl)]",
|
|
802
|
+
"3xl": "text-[length:var(--zen-font-size-3xl)]/[var(--zen-line-height-3xl)]",
|
|
803
|
+
"4xl": "text-[length:var(--zen-font-size-4xl)]/[var(--zen-line-height-4xl)]",
|
|
804
|
+
"5xl": "text-[length:var(--zen-font-size-5xl)]/[var(--zen-line-height-5xl)]",
|
|
805
|
+
"6xl": "text-[length:var(--zen-font-size-6xl)]/[var(--zen-line-height-6xl)]",
|
|
806
|
+
"7xl": "text-[length:var(--zen-font-size-7xl)]/[var(--zen-line-height-7xl)]",
|
|
807
|
+
"8xl": "text-[length:var(--zen-font-size-8xl)]/[var(--zen-line-height-8xl)]",
|
|
808
|
+
"9xl": "text-[length:var(--zen-font-size-9xl)]/[var(--zen-line-height-9xl)]"
|
|
801
809
|
};
|
|
802
810
|
var fontWeightMap = {
|
|
803
811
|
thin: "font-thin",
|
|
@@ -819,7 +827,7 @@ var borderRadiusMap = {
|
|
|
819
827
|
"2xl": "rounded-2xl",
|
|
820
828
|
"3xl": "rounded-3xl",
|
|
821
829
|
full: "rounded-full",
|
|
822
|
-
true: "rounded-[var(--radius-default)]"
|
|
830
|
+
true: "rounded-[var(--zen-radius-default)]"
|
|
823
831
|
};
|
|
824
832
|
var borderWidthMap = {
|
|
825
833
|
sm: "border",
|
|
@@ -835,7 +843,7 @@ var shadowMap = {
|
|
|
835
843
|
xl: "shadow-xl",
|
|
836
844
|
"2xl": "shadow-2xl",
|
|
837
845
|
inner: "shadow-inner",
|
|
838
|
-
true: "shadow-[var(--shadow-default)]"
|
|
846
|
+
true: "shadow-[var(--zen-shadow-default)]"
|
|
839
847
|
};
|
|
840
848
|
var semanticColorMap = {
|
|
841
849
|
primary: { text: "text-foreground-primary", bg: "bg-primary" },
|
|
@@ -1347,9 +1355,9 @@ function mapBorderColor(value) {
|
|
|
1347
1355
|
return "";
|
|
1348
1356
|
}
|
|
1349
1357
|
var semanticCssColorValues = {
|
|
1350
|
-
primary: "var(--text-primary)",
|
|
1351
|
-
muted: "var(--text-muted)",
|
|
1352
|
-
disabled: "var(--text-disabled)"
|
|
1358
|
+
primary: "var(--zen-text-primary)",
|
|
1359
|
+
muted: "var(--zen-text-muted)",
|
|
1360
|
+
disabled: "var(--zen-text-disabled)"
|
|
1353
1361
|
};
|
|
1354
1362
|
var tailwindColorHex = {
|
|
1355
1363
|
gray: {
|
|
@@ -2200,7 +2208,10 @@ function Accordion({
|
|
|
2200
2208
|
value: expandedKeys ? Array.from(expandedKeys) : void 0,
|
|
2201
2209
|
defaultValue: defaultExpandedKeys ? Array.from(defaultExpandedKeys) : void 0,
|
|
2202
2210
|
onValueChange: (value) => onExpandedChange?.(new Set(value)),
|
|
2203
|
-
className: cn(
|
|
2211
|
+
className: cn(
|
|
2212
|
+
"flex flex-col items-start w-full gap-2 text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
2213
|
+
className
|
|
2214
|
+
),
|
|
2204
2215
|
children
|
|
2205
2216
|
}
|
|
2206
2217
|
);
|
|
@@ -2222,7 +2233,7 @@ function AccordionItem({
|
|
|
2222
2233
|
disabled: isDisabled,
|
|
2223
2234
|
className: cn("w-full cursor-pointer group", className),
|
|
2224
2235
|
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: [
|
|
2236
|
+
/* @__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
2237
|
/* @__PURE__ */ jsx(Text, { children: trigger }),
|
|
2227
2238
|
/* @__PURE__ */ jsx(Icon, { className: "transition-transform duration-200 group-data-[open]:rotate-90", size: "sm", children: /* @__PURE__ */ jsx(icons_exports.ChevronRight, {}) })
|
|
2228
2239
|
] }) }),
|
|
@@ -2278,11 +2289,11 @@ var button = tv({
|
|
|
2278
2289
|
]
|
|
2279
2290
|
},
|
|
2280
2291
|
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"
|
|
2292
|
+
xs: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)] py-1 px-2",
|
|
2293
|
+
sm: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] py-1.5 px-2.5",
|
|
2294
|
+
md: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] py-2 px-3",
|
|
2295
|
+
lg: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)] py-2.5 px-4",
|
|
2296
|
+
xl: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)] py-3 px-5"
|
|
2286
2297
|
}
|
|
2287
2298
|
},
|
|
2288
2299
|
defaultVariants: {
|
|
@@ -2293,7 +2304,7 @@ var button = tv({
|
|
|
2293
2304
|
var inputField = tv({
|
|
2294
2305
|
base: [
|
|
2295
2306
|
"relative flex items-center",
|
|
2296
|
-
"text-base rounded border border-edge bg-surface-base shadow-sm",
|
|
2307
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] rounded border border-edge bg-surface-base shadow-sm",
|
|
2297
2308
|
"leading-6 text-foreground-primary transition-colors",
|
|
2298
2309
|
"focus-within:border-edge-strong",
|
|
2299
2310
|
"has-[input:read-only]:bg-surface-raised has-[textarea:read-only]:bg-surface-raised",
|
|
@@ -2312,7 +2323,7 @@ var inputField = tv({
|
|
|
2312
2323
|
tv({
|
|
2313
2324
|
base: [
|
|
2314
2325
|
"flex items-center justify-between",
|
|
2315
|
-
"gap-3 text-base py-2 px-3 min-w-[120px]",
|
|
2326
|
+
"gap-3 text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] py-2 px-3 min-w-[120px]",
|
|
2316
2327
|
"cursor-pointer outline-none rounded",
|
|
2317
2328
|
"text-foreground-primary",
|
|
2318
2329
|
"hovered:bg-interactive",
|
|
@@ -2349,13 +2360,15 @@ tv({
|
|
|
2349
2360
|
}
|
|
2350
2361
|
});
|
|
2351
2362
|
var tooltip = tv({
|
|
2352
|
-
base: [
|
|
2363
|
+
base: [
|
|
2364
|
+
"bg-surface-inverted text-surface-base text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] px-2 py-1 rounded"
|
|
2365
|
+
]
|
|
2353
2366
|
});
|
|
2354
2367
|
var checkbox = tv({
|
|
2355
2368
|
slots: {
|
|
2356
2369
|
root: [
|
|
2357
2370
|
"group flex items-center gap-3",
|
|
2358
|
-
"text-base cursor-pointer",
|
|
2371
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] cursor-pointer",
|
|
2359
2372
|
"disabled:text-foreground-disabled disabled:cursor-default"
|
|
2360
2373
|
],
|
|
2361
2374
|
box: [
|
|
@@ -2379,7 +2392,7 @@ var switchVariant = tv({
|
|
|
2379
2392
|
slots: {
|
|
2380
2393
|
root: [
|
|
2381
2394
|
"group flex items-center gap-3",
|
|
2382
|
-
"text-base cursor-pointer",
|
|
2395
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] cursor-pointer",
|
|
2383
2396
|
"disabled:opacity-50 disabled:cursor-default"
|
|
2384
2397
|
],
|
|
2385
2398
|
track: [
|
|
@@ -2402,7 +2415,7 @@ tv({
|
|
|
2402
2415
|
root: "flex flex-col",
|
|
2403
2416
|
list: ["flex gap-1 border-b border-edge-muted"],
|
|
2404
2417
|
tab: [
|
|
2405
|
-
"px-4 py-2 text-base font-medium cursor-pointer",
|
|
2418
|
+
"px-4 py-2 text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-medium cursor-pointer",
|
|
2406
2419
|
"text-foreground-muted outline-none",
|
|
2407
2420
|
"border-b-2 border-transparent -mb-px",
|
|
2408
2421
|
"hovered:text-foreground-primary",
|
|
@@ -2417,14 +2430,14 @@ tv({
|
|
|
2417
2430
|
base: "text-foreground-primary",
|
|
2418
2431
|
variants: {
|
|
2419
2432
|
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"
|
|
2433
|
+
xs: "text-[length:var(--zen-font-size-xs)]/[var(--zen-line-height-xs)]",
|
|
2434
|
+
sm: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
2435
|
+
base: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
2436
|
+
lg: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)]",
|
|
2437
|
+
xl: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)]",
|
|
2438
|
+
"2xl": "text-[length:var(--zen-font-size-2xl)]/[var(--zen-line-height-2xl)]",
|
|
2439
|
+
"3xl": "text-[length:var(--zen-font-size-3xl)]/[var(--zen-line-height-3xl)]",
|
|
2440
|
+
"4xl": "text-[length:var(--zen-font-size-4xl)]/[var(--zen-line-height-4xl)]"
|
|
2428
2441
|
},
|
|
2429
2442
|
color: {
|
|
2430
2443
|
default: "",
|
|
@@ -2451,15 +2464,15 @@ tv({
|
|
|
2451
2464
|
base: "font-semibold text-foreground-primary",
|
|
2452
2465
|
variants: {
|
|
2453
2466
|
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"
|
|
2467
|
+
sm: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
2468
|
+
base: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
2469
|
+
lg: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)]",
|
|
2470
|
+
xl: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)]",
|
|
2471
|
+
"2xl": "text-[length:var(--zen-font-size-2xl)]/[var(--zen-line-height-2xl)]",
|
|
2472
|
+
"3xl": "text-[length:var(--zen-font-size-3xl)]/[var(--zen-line-height-3xl)]",
|
|
2473
|
+
"4xl": "text-[length:var(--zen-font-size-4xl)]/[var(--zen-line-height-4xl)]",
|
|
2474
|
+
"5xl": "text-[length:var(--zen-font-size-5xl)]/[var(--zen-line-height-5xl)]",
|
|
2475
|
+
"6xl": "text-[length:var(--zen-font-size-6xl)]/[var(--zen-line-height-6xl)]"
|
|
2463
2476
|
}
|
|
2464
2477
|
},
|
|
2465
2478
|
defaultVariants: {
|
|
@@ -2468,7 +2481,7 @@ tv({
|
|
|
2468
2481
|
});
|
|
2469
2482
|
var alert = tv({
|
|
2470
2483
|
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",
|
|
2484
|
+
"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
2485
|
"has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3",
|
|
2473
2486
|
"[&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current"
|
|
2474
2487
|
],
|
|
@@ -2501,7 +2514,7 @@ tv({
|
|
|
2501
2514
|
base: "inline-flex items-center gap-2",
|
|
2502
2515
|
slots: {
|
|
2503
2516
|
dot: "w-2 h-2 rounded-full",
|
|
2504
|
-
label: "text-base"
|
|
2517
|
+
label: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]"
|
|
2505
2518
|
},
|
|
2506
2519
|
variants: {
|
|
2507
2520
|
color: {
|
|
@@ -2521,7 +2534,7 @@ var toast = tv({
|
|
|
2521
2534
|
"flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg",
|
|
2522
2535
|
"bg-surface-overlay",
|
|
2523
2536
|
"border border-edge-muted",
|
|
2524
|
-
"text-base"
|
|
2537
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]"
|
|
2525
2538
|
],
|
|
2526
2539
|
variants: {
|
|
2527
2540
|
variant: {
|
|
@@ -2570,8 +2583,8 @@ var badge = tv({
|
|
|
2570
2583
|
rose: "bg-rose-50 text-rose-900 dark:bg-rose-500/20 dark:text-rose-100"
|
|
2571
2584
|
},
|
|
2572
2585
|
size: {
|
|
2573
|
-
sm: "text-xs px-2 py-0.5",
|
|
2574
|
-
md: "text-sm px-2.5 py-0.5"
|
|
2586
|
+
sm: "text-[length:var(--zen-font-size-xs)]/[var(--zen-line-height-xs)] px-2 py-0.5",
|
|
2587
|
+
md: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)] px-2.5 py-0.5"
|
|
2575
2588
|
}
|
|
2576
2589
|
},
|
|
2577
2590
|
defaultVariants: {
|
|
@@ -2593,11 +2606,26 @@ var avatar = tv({
|
|
|
2593
2606
|
},
|
|
2594
2607
|
variants: {
|
|
2595
2608
|
size: {
|
|
2596
|
-
xs: {
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2609
|
+
xs: {
|
|
2610
|
+
root: "size-6",
|
|
2611
|
+
fallback: "text-[length:var(--zen-font-size-xs)]/[var(--zen-line-height-xs)]"
|
|
2612
|
+
},
|
|
2613
|
+
sm: {
|
|
2614
|
+
root: "size-8",
|
|
2615
|
+
fallback: "text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]"
|
|
2616
|
+
},
|
|
2617
|
+
md: {
|
|
2618
|
+
root: "size-10",
|
|
2619
|
+
fallback: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]"
|
|
2620
|
+
},
|
|
2621
|
+
lg: {
|
|
2622
|
+
root: "size-12",
|
|
2623
|
+
fallback: "text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)]"
|
|
2624
|
+
},
|
|
2625
|
+
xl: {
|
|
2626
|
+
root: "size-16",
|
|
2627
|
+
fallback: "text-[length:var(--zen-font-size-xl)]/[var(--zen-line-height-xl)]"
|
|
2628
|
+
}
|
|
2601
2629
|
}
|
|
2602
2630
|
},
|
|
2603
2631
|
defaultVariants: {
|
|
@@ -2607,7 +2635,7 @@ var avatar = tv({
|
|
|
2607
2635
|
var tag = tv({
|
|
2608
2636
|
slots: {
|
|
2609
2637
|
base: [
|
|
2610
|
-
"inline-flex items-center gap-1 px-2 py-0.5 rounded text-sm",
|
|
2638
|
+
"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
2639
|
"cursor-default outline-none",
|
|
2612
2640
|
"focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-1"
|
|
2613
2641
|
],
|
|
@@ -2668,7 +2696,7 @@ var AlertDescription = forwardRef(
|
|
|
2668
2696
|
ref,
|
|
2669
2697
|
"data-slot": "alert-description",
|
|
2670
2698
|
className: cn(
|
|
2671
|
-
"col-start-2 grid justify-items-start gap-1 text-base text-foreground-muted [&_p]:leading-relaxed",
|
|
2699
|
+
"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
2700
|
className
|
|
2673
2701
|
)
|
|
2674
2702
|
}
|
|
@@ -2678,7 +2706,10 @@ AlertDescription.displayName = "AlertDescription";
|
|
|
2678
2706
|
function Button({
|
|
2679
2707
|
variant,
|
|
2680
2708
|
size = "md",
|
|
2681
|
-
render,
|
|
2709
|
+
render: renderProp,
|
|
2710
|
+
href,
|
|
2711
|
+
target,
|
|
2712
|
+
rel,
|
|
2682
2713
|
preventFocusOnPress: _preventFocusOnPress = true,
|
|
2683
2714
|
nativeButton,
|
|
2684
2715
|
isDisabled,
|
|
@@ -2690,6 +2721,14 @@ function Button({
|
|
|
2690
2721
|
...props
|
|
2691
2722
|
}) {
|
|
2692
2723
|
const buttonClassName = button({ variant, size, className });
|
|
2724
|
+
const render = renderProp ?? (href ? /* @__PURE__ */ jsx(
|
|
2725
|
+
"a",
|
|
2726
|
+
{
|
|
2727
|
+
href,
|
|
2728
|
+
target,
|
|
2729
|
+
rel: rel ?? (target === "_blank" ? "noreferrer" : void 0)
|
|
2730
|
+
}
|
|
2731
|
+
) : void 0);
|
|
2693
2732
|
const isNativeButton = nativeButton ?? (render === void 0 || isValidElement(render) && render.type === "button");
|
|
2694
2733
|
const handleClick = (event) => {
|
|
2695
2734
|
onClick?.(event);
|
|
@@ -3214,7 +3253,7 @@ function Breadcrumb({ children, className, isDisabled, ...props }) {
|
|
|
3214
3253
|
...props,
|
|
3215
3254
|
"aria-disabled": isDisabled || void 0,
|
|
3216
3255
|
className: cn(
|
|
3217
|
-
"flex items-center text-base gap-3 list-none",
|
|
3256
|
+
"flex items-center text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] gap-3 list-none",
|
|
3218
3257
|
"[&_a]:text-foreground-muted [&_a]:no-underline [&_a]:font-normal",
|
|
3219
3258
|
"[&_a:hover]:text-foreground-primary",
|
|
3220
3259
|
"last:[&>span]:hidden",
|
|
@@ -3271,7 +3310,7 @@ function ButtonGroup({ className, orientation = "horizontal", ...props }) {
|
|
|
3271
3310
|
}
|
|
3272
3311
|
function ButtonGroupText({ className, render, children, ...props }) {
|
|
3273
3312
|
const classes = cn(
|
|
3274
|
-
"flex items-center gap-2 rounded border border-edge bg-surface-raised px-4 text-sm font-medium shadow-sm",
|
|
3313
|
+
"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
3314
|
"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
|
|
3276
3315
|
className
|
|
3277
3316
|
);
|
|
@@ -3335,7 +3374,18 @@ function Calendar({
|
|
|
3335
3374
|
onChange?.(date);
|
|
3336
3375
|
}
|
|
3337
3376
|
},
|
|
3338
|
-
className: cn(
|
|
3377
|
+
className: cn(
|
|
3378
|
+
"w-fit max-w-full text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
3379
|
+
// The month grid is a real <table>; host prose styles (docs sites,
|
|
3380
|
+
// CMS themes) often style table/th/td with borders, padding, and
|
|
3381
|
+
// width. Reset them at matching specificity so zen styles hold.
|
|
3382
|
+
"[&_table]:m-0 [&_table]:w-auto [&_table]:border-0 [&_table]:text-[length:inherit]",
|
|
3383
|
+
"[&_th]:border-0 [&_th]:p-0 [&_th]:text-center [&_th]:align-middle",
|
|
3384
|
+
"[&_td]:border-0 [&_td]:p-0 [&_td]:text-center [&_td]:align-middle",
|
|
3385
|
+
"[&_th:first-child]:pl-0 [&_th:last-child]:pr-0",
|
|
3386
|
+
"[&_td:first-child]:pl-0 [&_td:last-child]:pr-0",
|
|
3387
|
+
className
|
|
3388
|
+
),
|
|
3339
3389
|
classNames: {
|
|
3340
3390
|
months: "relative",
|
|
3341
3391
|
month: "space-y-4",
|
|
@@ -3349,7 +3399,7 @@ function Calendar({
|
|
|
3349
3399
|
week: "flex mt-1",
|
|
3350
3400
|
day: "size-12 text-center",
|
|
3351
3401
|
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",
|
|
3402
|
+
selected: "[&>button]:text-primary-foreground [&>button]:bg-primary [&>button:hover]:bg-primary",
|
|
3353
3403
|
outside: "invisible",
|
|
3354
3404
|
disabled: "text-foreground-disabled pointer-events-none opacity-50",
|
|
3355
3405
|
today: "[&>button]:font-bold"
|
|
@@ -3618,7 +3668,7 @@ function CollapsibleTrigger({ className, children, ...props }) {
|
|
|
3618
3668
|
{
|
|
3619
3669
|
...props,
|
|
3620
3670
|
className: cn(
|
|
3621
|
-
"flex items-center gap-2 cursor-pointer outline-none text-base",
|
|
3671
|
+
"flex items-center gap-2 cursor-pointer outline-none text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
3622
3672
|
"focus-visible:ring-2 focus-visible:ring-focus-ring rounded",
|
|
3623
3673
|
"disabled:text-foreground-disabled disabled:cursor-default",
|
|
3624
3674
|
className
|
|
@@ -3769,23 +3819,27 @@ function List({
|
|
|
3769
3819
|
if (parent.kind === "combobox") {
|
|
3770
3820
|
return /* @__PURE__ */ jsx(Combobox.List, { ...props, id: fieldId, className: classes, style, children });
|
|
3771
3821
|
}
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3822
|
+
const listbox = /* @__PURE__ */ jsx(ListContext.Provider, { value: { kind: "native", selected, toggle }, children: /* @__PURE__ */ jsx(
|
|
3823
|
+
"div",
|
|
3824
|
+
{
|
|
3825
|
+
id: fieldId,
|
|
3826
|
+
role: "listbox",
|
|
3827
|
+
"aria-multiselectable": selectionMode === "multiple" || void 0,
|
|
3828
|
+
...props,
|
|
3829
|
+
className: classes,
|
|
3830
|
+
style: { ...style, ...getHighlightColor(highlightColor) },
|
|
3831
|
+
children: children || renderEmptyState?.({})
|
|
3832
|
+
}
|
|
3833
|
+
) });
|
|
3834
|
+
if (label) {
|
|
3835
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
3836
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: fieldId, children: label }),
|
|
3837
|
+
listbox
|
|
3838
|
+
] });
|
|
3839
|
+
}
|
|
3840
|
+
return listbox;
|
|
3787
3841
|
}
|
|
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";
|
|
3842
|
+
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
3843
|
function ListItem({
|
|
3790
3844
|
id,
|
|
3791
3845
|
value,
|
|
@@ -3867,18 +3921,18 @@ function ListSection({ title, className, children, ...props }) {
|
|
|
3867
3921
|
const { kind } = useContext(ListContext);
|
|
3868
3922
|
if (kind === "select") {
|
|
3869
3923
|
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 }),
|
|
3924
|
+
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
3925
|
children
|
|
3872
3926
|
] });
|
|
3873
3927
|
}
|
|
3874
3928
|
if (kind === "combobox") {
|
|
3875
3929
|
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 }),
|
|
3930
|
+
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
3931
|
children
|
|
3878
3932
|
] });
|
|
3879
3933
|
}
|
|
3880
3934
|
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 }),
|
|
3935
|
+
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
3936
|
children
|
|
3883
3937
|
] });
|
|
3884
3938
|
}
|
|
@@ -3928,7 +3982,7 @@ var InputGroupAddon = forwardRef(
|
|
|
3928
3982
|
"data-slot": "input-group-addon",
|
|
3929
3983
|
"data-align": align,
|
|
3930
3984
|
className: cn(
|
|
3931
|
-
"flex h-auto shrink-0 cursor-text items-center justify-center gap-2 py-2 text-sm text-foreground-muted",
|
|
3985
|
+
"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
3986
|
"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
3933
3987
|
addonClasses[align],
|
|
3934
3988
|
className
|
|
@@ -3940,8 +3994,8 @@ var InputGroupAddon = forwardRef(
|
|
|
3940
3994
|
);
|
|
3941
3995
|
InputGroupAddon.displayName = "InputGroupAddon";
|
|
3942
3996
|
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",
|
|
3997
|
+
xs: "h-6 gap-1 rounded px-1.5 py-0 text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
3998
|
+
sm: "h-8 gap-2 rounded px-2 py-0 text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]",
|
|
3945
3999
|
"icon-xs": "size-6 rounded p-0",
|
|
3946
4000
|
"icon-sm": "size-8 rounded p-0"
|
|
3947
4001
|
};
|
|
@@ -3973,7 +4027,7 @@ var InputGroupText = forwardRef(
|
|
|
3973
4027
|
ref,
|
|
3974
4028
|
"data-slot": "input-group-text",
|
|
3975
4029
|
className: cn(
|
|
3976
|
-
"flex items-center gap-2 text-sm text-foreground-muted [&_svg]:pointer-events-none [&_svg]:size-4",
|
|
4030
|
+
"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
4031
|
className
|
|
3978
4032
|
)
|
|
3979
4033
|
}
|
|
@@ -3988,7 +4042,7 @@ var InputGroupInput = forwardRef(
|
|
|
3988
4042
|
ref,
|
|
3989
4043
|
"data-slot": "input-group-control",
|
|
3990
4044
|
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",
|
|
4045
|
+
"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
4046
|
className
|
|
3993
4047
|
)
|
|
3994
4048
|
}
|
|
@@ -4002,7 +4056,7 @@ var InputGroupTextarea = forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
4002
4056
|
ref,
|
|
4003
4057
|
"data-slot": "input-group-control",
|
|
4004
4058
|
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",
|
|
4059
|
+
"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
4060
|
className
|
|
4007
4061
|
)
|
|
4008
4062
|
}
|
|
@@ -4109,7 +4163,7 @@ function ComboBox({
|
|
|
4109
4163
|
disabled: isDisabled,
|
|
4110
4164
|
onValueChange: onChange,
|
|
4111
4165
|
children: /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
4112
|
-
label && /* @__PURE__ */ jsx(Combobox.Label, { className: "text-base font-semibold", children: label }),
|
|
4166
|
+
label && /* @__PURE__ */ jsx(Combobox.Label, { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-semibold", children: label }),
|
|
4113
4167
|
/* @__PURE__ */ jsxs(Combobox.InputGroup, { render: /* @__PURE__ */ jsx(InputGroup, {}), children: [
|
|
4114
4168
|
/* @__PURE__ */ jsx(Combobox.Input, { placeholder, render: /* @__PURE__ */ jsx(InputGroupInput, {}) }),
|
|
4115
4169
|
/* @__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 +4183,7 @@ function ComboBox({
|
|
|
4129
4183
|
}
|
|
4130
4184
|
return item.element ?? /* @__PURE__ */ jsx(ListItem, { value: item.value, children: item.label }, item.value);
|
|
4131
4185
|
} }) }) }) }),
|
|
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." }) }) })
|
|
4186
|
+
/* @__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
4187
|
] })
|
|
4134
4188
|
}
|
|
4135
4189
|
) })
|
|
@@ -4185,7 +4239,7 @@ function CommandInput({ className, ...props }) {
|
|
|
4185
4239
|
{
|
|
4186
4240
|
...props,
|
|
4187
4241
|
className: cn(
|
|
4188
|
-
"flex h-11 w-full bg-transparent text-base outline-none",
|
|
4242
|
+
"flex h-11 w-full bg-transparent text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] outline-none",
|
|
4189
4243
|
"placeholder:text-foreground-muted",
|
|
4190
4244
|
"disabled:cursor-not-allowed disabled:text-foreground-disabled",
|
|
4191
4245
|
className
|
|
@@ -4202,7 +4256,10 @@ function CommandEmpty({ className, ...props }) {
|
|
|
4202
4256
|
Command$1.Empty,
|
|
4203
4257
|
{
|
|
4204
4258
|
...props,
|
|
4205
|
-
className: cn(
|
|
4259
|
+
className: cn(
|
|
4260
|
+
"py-6 text-center text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] text-foreground-muted",
|
|
4261
|
+
className
|
|
4262
|
+
)
|
|
4206
4263
|
}
|
|
4207
4264
|
);
|
|
4208
4265
|
}
|
|
@@ -4214,7 +4271,7 @@ function CommandGroup({ className, ...props }) {
|
|
|
4214
4271
|
className: cn(
|
|
4215
4272
|
"overflow-hidden [&:not(:last-child)]:mb-2",
|
|
4216
4273
|
"[&_[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",
|
|
4274
|
+
"[&_[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
4275
|
className
|
|
4219
4276
|
)
|
|
4220
4277
|
}
|
|
@@ -4227,7 +4284,7 @@ function CommandItem({ icon, isDisabled, className, children, ...props }) {
|
|
|
4227
4284
|
...props,
|
|
4228
4285
|
disabled: isDisabled,
|
|
4229
4286
|
className: cn(
|
|
4230
|
-
"flex items-center gap-3 px-2 py-1.5 rounded cursor-pointer outline-none text-base",
|
|
4287
|
+
"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
4288
|
"data-[selected=true]:bg-interactive",
|
|
4232
4289
|
"data-[disabled=true]:text-foreground-disabled data-[disabled=true]:cursor-default",
|
|
4233
4290
|
className
|
|
@@ -4324,6 +4381,7 @@ function TextField({
|
|
|
4324
4381
|
...props
|
|
4325
4382
|
}) {
|
|
4326
4383
|
const [inputValue, setInputValue] = useState(defaultValue ?? value ?? "");
|
|
4384
|
+
const wasControlled = useRef(value !== void 0);
|
|
4327
4385
|
const handleChange = (event) => {
|
|
4328
4386
|
const nextValue = event.target.value;
|
|
4329
4387
|
setInputValue(nextValue);
|
|
@@ -4331,68 +4389,75 @@ function TextField({
|
|
|
4331
4389
|
};
|
|
4332
4390
|
useEffect(() => {
|
|
4333
4391
|
if (value !== void 0) {
|
|
4392
|
+
wasControlled.current = true;
|
|
4334
4393
|
setInputValue(value);
|
|
4394
|
+
} else if (wasControlled.current) {
|
|
4395
|
+
setInputValue(defaultValue ?? "");
|
|
4335
4396
|
}
|
|
4336
|
-
}, [value]);
|
|
4397
|
+
}, [value, defaultValue]);
|
|
4337
4398
|
const inputClasses = cn(resize && resizeClasses[resize]);
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4399
|
+
const input = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
4400
|
+
InputGroup,
|
|
4401
|
+
{
|
|
4402
|
+
variant: variant === "quiet" ? "quiet" : "default",
|
|
4403
|
+
className: cn(
|
|
4404
|
+
isReadOnly && "focus-within:border-edge",
|
|
4405
|
+
isDisabled && "text-foreground-disabled",
|
|
4406
|
+
variant === "quiet" && "text-[length:inherit]",
|
|
4407
|
+
className
|
|
4408
|
+
),
|
|
4409
|
+
children: [
|
|
4410
|
+
asTextArea ? /* @__PURE__ */ jsx(
|
|
4411
|
+
InputGroupTextarea,
|
|
4412
|
+
{
|
|
4413
|
+
...props,
|
|
4414
|
+
placeholder,
|
|
4415
|
+
value: inputValue,
|
|
4416
|
+
readOnly: isReadOnly,
|
|
4417
|
+
disabled: isDisabled,
|
|
4418
|
+
className: inputClasses,
|
|
4419
|
+
onChange: handleChange
|
|
4420
|
+
}
|
|
4421
|
+
) : /* @__PURE__ */ jsx(
|
|
4422
|
+
InputGroupInput,
|
|
4423
|
+
{
|
|
4424
|
+
...props,
|
|
4425
|
+
placeholder,
|
|
4426
|
+
value: inputValue,
|
|
4427
|
+
readOnly: isReadOnly,
|
|
4428
|
+
disabled: isDisabled,
|
|
4429
|
+
className: inputClasses,
|
|
4430
|
+
onChange: handleChange
|
|
4431
|
+
}
|
|
4349
4432
|
),
|
|
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
|
-
] });
|
|
4433
|
+
allowCopy && /* @__PURE__ */ jsx(
|
|
4434
|
+
InputGroupAddon,
|
|
4435
|
+
{
|
|
4436
|
+
align: asTextArea ? "block-start" : "inline-end",
|
|
4437
|
+
className: cn(asTextArea && "justify-end pb-0"),
|
|
4438
|
+
children: /* @__PURE__ */ jsx(
|
|
4439
|
+
CopyButton,
|
|
4440
|
+
{
|
|
4441
|
+
value: String(inputValue),
|
|
4442
|
+
"aria-disabled": !inputValue,
|
|
4443
|
+
className: cn(
|
|
4444
|
+
"text-foreground-muted hover:text-foreground-primary",
|
|
4445
|
+
!inputValue && "text-foreground-disabled"
|
|
4446
|
+
)
|
|
4447
|
+
}
|
|
4448
|
+
)
|
|
4449
|
+
}
|
|
4450
|
+
)
|
|
4451
|
+
]
|
|
4452
|
+
}
|
|
4453
|
+
) });
|
|
4454
|
+
if (label) {
|
|
4455
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
4456
|
+
/* @__PURE__ */ jsx(Label, { children: label }),
|
|
4457
|
+
input
|
|
4458
|
+
] });
|
|
4459
|
+
}
|
|
4460
|
+
return input;
|
|
4396
4461
|
}
|
|
4397
4462
|
function ConfirmationDialog({
|
|
4398
4463
|
value,
|
|
@@ -4419,7 +4484,7 @@ function ConfirmationDialog({
|
|
|
4419
4484
|
paddingY: "2",
|
|
4420
4485
|
marginY: "2",
|
|
4421
4486
|
borderRadius: "md",
|
|
4422
|
-
className: "font-mono text-base bg-surface-sunken",
|
|
4487
|
+
className: "font-mono text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] bg-surface-sunken",
|
|
4423
4488
|
children: value
|
|
4424
4489
|
}
|
|
4425
4490
|
),
|
|
@@ -4688,7 +4753,17 @@ function Table({
|
|
|
4688
4753
|
}),
|
|
4689
4754
|
[registerRow, rowKeys, selectedKeys, selectionMode, setAllSelected, setRowSelected]
|
|
4690
4755
|
);
|
|
4691
|
-
return /* @__PURE__ */ jsx(TableSelectionContext.Provider, { value: selection, children: /* @__PURE__ */ jsx(
|
|
4756
|
+
return /* @__PURE__ */ jsx(TableSelectionContext.Provider, { value: selection, children: /* @__PURE__ */ jsx(
|
|
4757
|
+
"table",
|
|
4758
|
+
{
|
|
4759
|
+
...props,
|
|
4760
|
+
className: cn(
|
|
4761
|
+
"grid text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] w-full relative",
|
|
4762
|
+
className
|
|
4763
|
+
),
|
|
4764
|
+
children
|
|
4765
|
+
}
|
|
4766
|
+
) });
|
|
4692
4767
|
}
|
|
4693
4768
|
function TableHeader({ children, className, style, ...props }) {
|
|
4694
4769
|
const cols = style?.gridTemplateColumns || gridTemplateColumns;
|
|
@@ -4823,34 +4898,55 @@ function DataTable({
|
|
|
4823
4898
|
return /* @__PURE__ */ jsx(DataCard, { data: items }, `${row.id}-${index}`);
|
|
4824
4899
|
}) });
|
|
4825
4900
|
}
|
|
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 }) => {
|
|
4901
|
+
return /* @__PURE__ */ jsxs(
|
|
4902
|
+
Table,
|
|
4903
|
+
{
|
|
4904
|
+
...props,
|
|
4905
|
+
className: cn(
|
|
4906
|
+
"relative text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
4907
|
+
className
|
|
4908
|
+
),
|
|
4909
|
+
children: [
|
|
4910
|
+
/* @__PURE__ */ jsx(TableHeader, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, label, as, hidden, width, ...columnProps }) => {
|
|
4837
4911
|
if (hidden) {
|
|
4838
4912
|
return null;
|
|
4839
4913
|
}
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4914
|
+
return /* @__PURE__ */ createElement(TableColumn, { ...columnProps, key: id, id }, label);
|
|
4915
|
+
}) }),
|
|
4916
|
+
/* @__PURE__ */ jsx(TableBody, { children: rows.map((row, index) => {
|
|
4917
|
+
return (
|
|
4918
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: row data may not have unique ids
|
|
4919
|
+
/* @__PURE__ */ jsx(TableRow, { id: String(row.id), style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(
|
|
4920
|
+
({
|
|
4921
|
+
id,
|
|
4922
|
+
label: _label,
|
|
4923
|
+
width: _width,
|
|
4924
|
+
as,
|
|
4925
|
+
hidden,
|
|
4926
|
+
className: className2,
|
|
4927
|
+
children: children2,
|
|
4928
|
+
...cellProps
|
|
4929
|
+
}) => {
|
|
4930
|
+
if (hidden) {
|
|
4931
|
+
return null;
|
|
4932
|
+
}
|
|
4933
|
+
const value = typeof children2 === "function" ? children2(row, index) : children2 || row[id];
|
|
4934
|
+
return /* @__PURE__ */ createElement(
|
|
4935
|
+
TableCell,
|
|
4936
|
+
{
|
|
4937
|
+
...cellProps,
|
|
4938
|
+
key: id,
|
|
4939
|
+
className: cn("items-center", className2)
|
|
4940
|
+
},
|
|
4941
|
+
as ? createElement(as, {}, value) : value
|
|
4942
|
+
);
|
|
4943
|
+
}
|
|
4944
|
+
) }, index)
|
|
4849
4945
|
);
|
|
4850
|
-
}) }
|
|
4851
|
-
|
|
4852
|
-
}
|
|
4853
|
-
|
|
4946
|
+
}) })
|
|
4947
|
+
]
|
|
4948
|
+
}
|
|
4949
|
+
);
|
|
4854
4950
|
}
|
|
4855
4951
|
function DataColumn(_props) {
|
|
4856
4952
|
return null;
|
|
@@ -5003,7 +5099,10 @@ var EmptyTitle = forwardRef(
|
|
|
5003
5099
|
...props,
|
|
5004
5100
|
ref,
|
|
5005
5101
|
"data-slot": "empty-title",
|
|
5006
|
-
className: cn(
|
|
5102
|
+
className: cn(
|
|
5103
|
+
"text-[length:var(--zen-font-size-lg)]/[var(--zen-line-height-lg)] font-medium tracking-tight",
|
|
5104
|
+
className
|
|
5105
|
+
)
|
|
5007
5106
|
}
|
|
5008
5107
|
)
|
|
5009
5108
|
);
|
|
@@ -5015,7 +5114,7 @@ var EmptyDescription = forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5015
5114
|
ref,
|
|
5016
5115
|
"data-slot": "empty-description",
|
|
5017
5116
|
className: cn(
|
|
5018
|
-
"text-foreground-muted [&>a:hover]:text-foreground-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
|
|
5117
|
+
"text-foreground-muted [&>a:hover]:text-foreground-primary text-[length:var(--zen-font-size-sm)]/relaxed [&>a]:underline [&>a]:underline-offset-4",
|
|
5019
5118
|
className
|
|
5020
5119
|
)
|
|
5021
5120
|
}
|
|
@@ -5029,7 +5128,7 @@ var EmptyContent = forwardRef(
|
|
|
5029
5128
|
ref,
|
|
5030
5129
|
"data-slot": "empty-content",
|
|
5031
5130
|
className: cn(
|
|
5032
|
-
"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",
|
|
5131
|
+
"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
5132
|
className
|
|
5034
5133
|
)
|
|
5035
5134
|
}
|
|
@@ -5164,7 +5263,10 @@ function Form({
|
|
|
5164
5263
|
{
|
|
5165
5264
|
...props,
|
|
5166
5265
|
autoComplete,
|
|
5167
|
-
className: cn(
|
|
5266
|
+
className: cn(
|
|
5267
|
+
"flex flex-col relative text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] gap-3",
|
|
5268
|
+
className
|
|
5269
|
+
),
|
|
5168
5270
|
onSubmit: onSubmit ? handleSubmit(onSubmit) : void 0,
|
|
5169
5271
|
onKeyDown,
|
|
5170
5272
|
children: typeof children === "function" ? children(formValues) : children
|
|
@@ -5238,12 +5340,7 @@ function FormFieldArray({
|
|
|
5238
5340
|
children({ ...context, ...fieldProps })
|
|
5239
5341
|
] });
|
|
5240
5342
|
}
|
|
5241
|
-
function FormResetButton({
|
|
5242
|
-
values = {},
|
|
5243
|
-
children,
|
|
5244
|
-
onPress,
|
|
5245
|
-
...props
|
|
5246
|
-
}) {
|
|
5343
|
+
function FormResetButton({ values, children, onPress, ...props }) {
|
|
5247
5344
|
const { reset } = useFormContext();
|
|
5248
5345
|
const handleReset = (e) => {
|
|
5249
5346
|
reset(values);
|
|
@@ -5687,7 +5784,7 @@ function Kbd({ className, children, ...props }) {
|
|
|
5687
5784
|
...props,
|
|
5688
5785
|
className: cn(
|
|
5689
5786
|
"inline-flex items-center justify-center gap-1",
|
|
5690
|
-
"text-sm font-mono text-foreground-primary",
|
|
5787
|
+
"text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)] font-mono text-foreground-primary",
|
|
5691
5788
|
"px-1.5 py-0.5 rounded border border-edge bg-surface-raised shadow-sm",
|
|
5692
5789
|
className
|
|
5693
5790
|
),
|
|
@@ -5811,7 +5908,7 @@ function MenuItem({
|
|
|
5811
5908
|
}
|
|
5812
5909
|
};
|
|
5813
5910
|
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",
|
|
5911
|
+
"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
5912
|
"hover:bg-interactive focus:bg-interactive data-[highlighted]:bg-interactive",
|
|
5816
5913
|
"data-[disabled]:text-foreground-disabled",
|
|
5817
5914
|
"data-[selected]:font-semibold",
|
|
@@ -5902,7 +5999,7 @@ function MenuSection({
|
|
|
5902
5999
|
const groupStyle = style;
|
|
5903
6000
|
const body = maxHeight ? /* @__PURE__ */ jsx(ScrollArea, { maxHeight, children }) : children;
|
|
5904
6001
|
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 })),
|
|
6002
|
+
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
6003
|
body
|
|
5907
6004
|
] });
|
|
5908
6005
|
if (primitiveKind === "context-menu") {
|
|
@@ -5989,7 +6086,7 @@ function Meter({
|
|
|
5989
6086
|
var NavbarContext = createContext({ showArrow: true });
|
|
5990
6087
|
var triggerClassName = cn(
|
|
5991
6088
|
"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",
|
|
6089
|
+
"text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] font-medium text-foreground-primary bg-transparent border-0",
|
|
5993
6090
|
"hover:bg-interactive data-[popup-open]:bg-interactive",
|
|
5994
6091
|
"outline-none [&:focus-visible]:outline-2 [&:focus-visible]:outline-offset-1 [&:focus-visible]:outline-focus-ring"
|
|
5995
6092
|
);
|
|
@@ -6127,7 +6224,7 @@ function NumberField({
|
|
|
6127
6224
|
NumberField$1.Input,
|
|
6128
6225
|
{
|
|
6129
6226
|
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"
|
|
6227
|
+
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
6228
|
}
|
|
6132
6229
|
),
|
|
6133
6230
|
/* @__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 +6264,7 @@ function OTPField({
|
|
|
6167
6264
|
OTPField$1.Input,
|
|
6168
6265
|
{
|
|
6169
6266
|
className: cn(
|
|
6170
|
-
"size-10 text-center text-base rounded border border-edge bg-surface-base shadow-sm",
|
|
6267
|
+
"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
6268
|
"text-foreground-primary outline-none transition-colors",
|
|
6172
6269
|
"focus:border-edge-strong focus:ring-2 focus:ring-focus-ring focus:ring-offset-1 focus:ring-offset-surface-base",
|
|
6173
6270
|
"data-[filled]:border-edge-strong",
|
|
@@ -6367,31 +6464,35 @@ function PasswordField({
|
|
|
6367
6464
|
...props
|
|
6368
6465
|
}) {
|
|
6369
6466
|
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
|
-
] })
|
|
6467
|
+
const input = /* @__PURE__ */ jsxs(InputGroup, { className, children: [
|
|
6468
|
+
/* @__PURE__ */ jsx(
|
|
6469
|
+
InputGroupInput,
|
|
6470
|
+
{
|
|
6471
|
+
"aria-label": "Password",
|
|
6472
|
+
...props,
|
|
6473
|
+
type: show ? "text" : "password",
|
|
6474
|
+
disabled: isDisabled,
|
|
6475
|
+
readOnly: isReadOnly
|
|
6476
|
+
}
|
|
6477
|
+
),
|
|
6478
|
+
/* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx(
|
|
6479
|
+
InputGroupButton,
|
|
6480
|
+
{
|
|
6481
|
+
size: "icon-xs",
|
|
6482
|
+
isDisabled,
|
|
6483
|
+
"aria-label": show ? "Hide password" : "Show password",
|
|
6484
|
+
onClick: () => setShow((state) => !state),
|
|
6485
|
+
children: /* @__PURE__ */ jsx(Icon, { children: show ? /* @__PURE__ */ jsx(EyeSlash_default, {}) : /* @__PURE__ */ jsx(Eye_default, {}) })
|
|
6486
|
+
}
|
|
6487
|
+
) })
|
|
6394
6488
|
] });
|
|
6489
|
+
if (label) {
|
|
6490
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
6491
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: props.id, children: label }),
|
|
6492
|
+
input
|
|
6493
|
+
] });
|
|
6494
|
+
}
|
|
6495
|
+
return input;
|
|
6395
6496
|
}
|
|
6396
6497
|
function ProgressBar({ className, showPercentage, ...props }) {
|
|
6397
6498
|
return /* @__PURE__ */ jsxs(Progress.Root, { ...props, className: cn("flex items-center gap-3 w-full", className), children: [
|
|
@@ -6443,7 +6544,7 @@ function ProgressCircle({
|
|
|
6443
6544
|
]
|
|
6444
6545
|
}
|
|
6445
6546
|
),
|
|
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" })
|
|
6547
|
+
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
6548
|
]
|
|
6448
6549
|
}
|
|
6449
6550
|
);
|
|
@@ -6483,7 +6584,7 @@ function Radio({ children, className, isDisabled, ...props }) {
|
|
|
6483
6584
|
...props,
|
|
6484
6585
|
disabled: isDisabled,
|
|
6485
6586
|
className: cn(
|
|
6486
|
-
"radio group flex items-center gap-3 cursor-pointer text-base",
|
|
6587
|
+
"radio group flex items-center gap-3 cursor-pointer text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)]",
|
|
6487
6588
|
"before:content-[''] before:block before:w-5 before:h-5 before:box-border before:rounded-full",
|
|
6488
6589
|
"before:border before:border-edge-strong before:bg-surface-base before:transition-all before:duration-200",
|
|
6489
6590
|
"data-[checked]:before:border-[6px] data-[checked]:before:border-primary",
|
|
@@ -6551,6 +6652,7 @@ function SearchField({
|
|
|
6551
6652
|
...props
|
|
6552
6653
|
}) {
|
|
6553
6654
|
const [search, setSearch] = useState(String(value ?? defaultValue));
|
|
6655
|
+
const wasControlled = useRef(value !== void 0);
|
|
6554
6656
|
const searchValue = useDebounce(search, delay);
|
|
6555
6657
|
const handleChange = (nextValue) => {
|
|
6556
6658
|
setSearch(nextValue);
|
|
@@ -6561,49 +6663,56 @@ function SearchField({
|
|
|
6561
6663
|
};
|
|
6562
6664
|
useEffect(() => {
|
|
6563
6665
|
if (value !== void 0) {
|
|
6666
|
+
wasControlled.current = true;
|
|
6564
6667
|
setSearch(String(value));
|
|
6668
|
+
} else if (wasControlled.current) {
|
|
6669
|
+
setSearch(String(defaultValue));
|
|
6565
6670
|
}
|
|
6566
|
-
}, [value]);
|
|
6671
|
+
}, [value, defaultValue]);
|
|
6567
6672
|
useEffect(() => {
|
|
6568
6673
|
if (delay > 0) {
|
|
6569
6674
|
onSearch?.(searchValue);
|
|
6570
6675
|
}
|
|
6571
6676
|
}, [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
|
-
}
|
|
6677
|
+
const input = /* @__PURE__ */ jsxs(InputGroup, { role: "search", className, children: [
|
|
6678
|
+
/* @__PURE__ */ jsx(
|
|
6679
|
+
InputGroupInput,
|
|
6680
|
+
{
|
|
6681
|
+
"aria-label": "Search",
|
|
6682
|
+
...props,
|
|
6683
|
+
type: "search",
|
|
6684
|
+
placeholder,
|
|
6685
|
+
value: search,
|
|
6686
|
+
className: "[&::-webkit-search-cancel-button]:hidden",
|
|
6687
|
+
onChange: (event) => handleChange(event.target.value),
|
|
6688
|
+
onKeyDown: (event) => {
|
|
6689
|
+
props.onKeyDown?.(event);
|
|
6690
|
+
if (event.key === "Enter") {
|
|
6691
|
+
onSearch?.(search);
|
|
6590
6692
|
}
|
|
6591
6693
|
}
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
}
|
|
6604
|
-
|
|
6605
|
-
|
|
6694
|
+
}
|
|
6695
|
+
),
|
|
6696
|
+
/* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-start", children: /* @__PURE__ */ jsx(Icon, { color: "muted", children: /* @__PURE__ */ jsx(icons_exports.Search, {}) }) }),
|
|
6697
|
+
search && /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx(
|
|
6698
|
+
InputGroupButton,
|
|
6699
|
+
{
|
|
6700
|
+
size: "icon-xs",
|
|
6701
|
+
isDisabled: props.disabled,
|
|
6702
|
+
"aria-label": "Clear search",
|
|
6703
|
+
className: "text-foreground-muted",
|
|
6704
|
+
onClick: () => handleChange(""),
|
|
6705
|
+
children: /* @__PURE__ */ jsx(Icon, { size: "sm", children: /* @__PURE__ */ jsx(icons_exports.X, {}) })
|
|
6706
|
+
}
|
|
6707
|
+
) })
|
|
6606
6708
|
] });
|
|
6709
|
+
if (label) {
|
|
6710
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
6711
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: props.id, children: label }),
|
|
6712
|
+
input
|
|
6713
|
+
] });
|
|
6714
|
+
}
|
|
6715
|
+
return input;
|
|
6607
6716
|
}
|
|
6608
6717
|
function getSelectItemLabel(children, selectedValue) {
|
|
6609
6718
|
let label;
|
|
@@ -6736,7 +6845,7 @@ function Select({
|
|
|
6736
6845
|
}
|
|
6737
6846
|
),
|
|
6738
6847
|
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" }),
|
|
6848
|
+
!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
6849
|
/* @__PURE__ */ jsx(ListPrimitiveProvider, { kind: "select", children: /* @__PURE__ */ jsx(
|
|
6741
6850
|
ScrollArea,
|
|
6742
6851
|
{
|
|
@@ -6889,7 +6998,7 @@ function Slider({
|
|
|
6889
6998
|
children: [
|
|
6890
6999
|
/* @__PURE__ */ jsxs(Row, { justifyContent: "space-between", alignItems: "center", children: [
|
|
6891
7000
|
label && /* @__PURE__ */ jsx(Label, { id: labelId, children: label }),
|
|
6892
|
-
showValue && /* @__PURE__ */ jsx(Slider$1.Value, { className: "text-base tabular-nums" })
|
|
7001
|
+
showValue && /* @__PURE__ */ jsx(Slider$1.Value, { className: "text-[length:var(--zen-font-size-base)]/[var(--zen-line-height-base)] tabular-nums" })
|
|
6893
7002
|
] }),
|
|
6894
7003
|
/* @__PURE__ */ jsxs(Slider$1.Control, { className: "relative h-5 w-full touch-none", children: [
|
|
6895
7004
|
/* @__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 +7037,19 @@ function StatusDot({ color, variant }) {
|
|
|
6928
7037
|
}
|
|
6929
7038
|
function StatusLight(props) {
|
|
6930
7039
|
const { color, variant = "inactive", children, className, ...domProps } = props;
|
|
6931
|
-
return /* @__PURE__ */ jsxs(
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
7040
|
+
return /* @__PURE__ */ jsxs(
|
|
7041
|
+
Row,
|
|
7042
|
+
{
|
|
7043
|
+
...domProps,
|
|
7044
|
+
alignItems: "center",
|
|
7045
|
+
gap: "2",
|
|
7046
|
+
className: cn("text-[length:var(--zen-font-size-sm)]/[var(--zen-line-height-sm)]", className),
|
|
7047
|
+
children: [
|
|
7048
|
+
/* @__PURE__ */ jsx(StatusDot, { color, variant }),
|
|
7049
|
+
children
|
|
7050
|
+
]
|
|
7051
|
+
}
|
|
7052
|
+
);
|
|
6935
7053
|
}
|
|
6936
7054
|
function Switch({
|
|
6937
7055
|
label,
|
|
@@ -6948,7 +7066,7 @@ function Switch({
|
|
|
6948
7066
|
const checked = isSelected ?? (typeof value === "boolean" ? value : void 0);
|
|
6949
7067
|
const styles = switchVariant();
|
|
6950
7068
|
const fieldId = useFieldId(id);
|
|
6951
|
-
return /* @__PURE__ */ jsxs(Column, { children: [
|
|
7069
|
+
return /* @__PURE__ */ jsxs(Column, { gap: "1", children: [
|
|
6952
7070
|
label && /* @__PURE__ */ jsx(Label, { htmlFor: fieldId, children: label }),
|
|
6953
7071
|
/* @__PURE__ */ jsxs(
|
|
6954
7072
|
Switch$1.Root,
|
|
@@ -7013,7 +7131,7 @@ function Tab({ id, value, isDisabled, href, children, className, ...props }) {
|
|
|
7013
7131
|
render: href ? /* @__PURE__ */ jsx("a", { href }) : void 0,
|
|
7014
7132
|
nativeButton: !href,
|
|
7015
7133
|
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",
|
|
7134
|
+
"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
7135
|
"hover:text-foreground-primary",
|
|
7018
7136
|
"data-[active]:text-foreground-primary data-[active]:border-b-primary",
|
|
7019
7137
|
"data-[disabled]:text-foreground-disabled data-[disabled]:cursor-default",
|
|
@@ -7224,27 +7342,31 @@ function Toggle({
|
|
|
7224
7342
|
...props
|
|
7225
7343
|
}) {
|
|
7226
7344
|
const labelId = useId();
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7345
|
+
const toggle = /* @__PURE__ */ jsx(
|
|
7346
|
+
Toggle$1,
|
|
7347
|
+
{
|
|
7348
|
+
...props,
|
|
7349
|
+
"aria-labelledby": label ? labelId : props["aria-labelledby"],
|
|
7350
|
+
pressed: isSelected,
|
|
7351
|
+
defaultPressed: defaultSelected,
|
|
7352
|
+
disabled: isDisabled,
|
|
7353
|
+
onPressedChange: onChange,
|
|
7354
|
+
className: cn(
|
|
7355
|
+
"flex items-center justify-center whitespace-nowrap gap-3 font-medium bg-interactive border border-transparent rounded p-2 relative cursor-pointer",
|
|
7356
|
+
"hover:bg-interactive-hover",
|
|
7357
|
+
"data-[pressed]:text-primary-foreground data-[pressed]:bg-primary",
|
|
7358
|
+
className
|
|
7359
|
+
),
|
|
7360
|
+
children
|
|
7361
|
+
}
|
|
7362
|
+
);
|
|
7363
|
+
if (label) {
|
|
7364
|
+
return /* @__PURE__ */ jsxs("div", { className: "inline-flex flex-col gap-1", children: [
|
|
7365
|
+
/* @__PURE__ */ jsx(Label, { id: labelId, children: label }),
|
|
7366
|
+
toggle
|
|
7367
|
+
] });
|
|
7368
|
+
}
|
|
7369
|
+
return toggle;
|
|
7248
7370
|
}
|
|
7249
7371
|
var ToggleGroupVariantContext = createContext(void 0);
|
|
7250
7372
|
function ToggleGroup({
|
|
@@ -7266,25 +7388,29 @@ function ToggleGroup({
|
|
|
7266
7388
|
onSelectionChange?.(new Set(keys));
|
|
7267
7389
|
onChange?.(keys);
|
|
7268
7390
|
};
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
className
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7391
|
+
const group = /* @__PURE__ */ jsx(ToggleGroupVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsx(
|
|
7392
|
+
ToggleGroup$1,
|
|
7393
|
+
{
|
|
7394
|
+
...props,
|
|
7395
|
+
"aria-labelledby": label ? labelId : props["aria-labelledby"],
|
|
7396
|
+
value: value || (selectedKeys ? Array.from(selectedKeys) : void 0),
|
|
7397
|
+
defaultValue: defaultValue || (defaultSelectedKeys ? Array.from(defaultSelectedKeys) : void 0),
|
|
7398
|
+
multiple: selectionMode === "multiple",
|
|
7399
|
+
onValueChange: handleChange,
|
|
7400
|
+
className: cn(
|
|
7401
|
+
"inline-flex bg-surface-base shadow-sm border border-edge rounded overflow-hidden",
|
|
7402
|
+
className
|
|
7403
|
+
),
|
|
7404
|
+
children
|
|
7405
|
+
}
|
|
7406
|
+
) });
|
|
7407
|
+
if (label) {
|
|
7408
|
+
return /* @__PURE__ */ jsxs("div", { className: "inline-flex flex-col gap-1", children: [
|
|
7409
|
+
/* @__PURE__ */ jsx(Label, { id: labelId, children: label }),
|
|
7410
|
+
group
|
|
7411
|
+
] });
|
|
7412
|
+
}
|
|
7413
|
+
return group;
|
|
7288
7414
|
}
|
|
7289
7415
|
function ToggleGroupItem({
|
|
7290
7416
|
id,
|