@umami/react-zen 0.232.0 → 0.234.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/README.md +3 -3
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +71 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +71 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/styles.css +12 -30
- package/styles.full.css +1 -1
- package/tailwind.preset.ts +5 -11
package/dist/index.mjs
CHANGED
|
@@ -63,7 +63,7 @@ var button = tv({
|
|
|
63
63
|
"pressed:bg-interactive-pressed"
|
|
64
64
|
],
|
|
65
65
|
primary: [
|
|
66
|
-
"bg-
|
|
66
|
+
"bg-primary text-primary-foreground",
|
|
67
67
|
"hover:opacity-90",
|
|
68
68
|
"pressed:opacity-80",
|
|
69
69
|
"disabled:opacity-50"
|
|
@@ -194,7 +194,7 @@ tv({
|
|
|
194
194
|
});
|
|
195
195
|
var tooltip = tv({
|
|
196
196
|
base: [
|
|
197
|
-
"bg-surface-inverted text-foreground
|
|
197
|
+
"bg-surface-inverted text-primary-foreground text-base px-2 py-1 rounded",
|
|
198
198
|
"entering:animate-popover-in",
|
|
199
199
|
"exiting:animate-popover-out"
|
|
200
200
|
]
|
|
@@ -210,7 +210,7 @@ var checkbox = tv({
|
|
|
210
210
|
"flex items-center justify-center",
|
|
211
211
|
"w-5 h-5 rounded border border-edge bg-surface-base",
|
|
212
212
|
"shadow-sm transition-colors",
|
|
213
|
-
"group-selected:bg-
|
|
213
|
+
"group-selected:bg-primary group-selected:border-primary group-selected:text-primary-foreground",
|
|
214
214
|
"group-indeterminate:bg-surface-base group-indeterminate:text-foreground-primary",
|
|
215
215
|
"group-disabled:bg-surface-disabled",
|
|
216
216
|
"group-focus-visible:ring-2 group-focus-visible:ring-focus-ring group-focus-visible:ring-offset-1"
|
|
@@ -232,9 +232,9 @@ var switchVariant = tv({
|
|
|
232
232
|
],
|
|
233
233
|
track: [
|
|
234
234
|
"flex items-center w-10 h-6 px-1 rounded-full",
|
|
235
|
-
"bg-
|
|
235
|
+
"bg-interactive",
|
|
236
236
|
"transition-colors",
|
|
237
|
-
"group-selected:bg-
|
|
237
|
+
"group-selected:bg-primary",
|
|
238
238
|
"group-focus-visible:ring-2 group-focus-visible:ring-focus-ring group-focus-visible:ring-offset-1"
|
|
239
239
|
],
|
|
240
240
|
thumb: [
|
|
@@ -251,10 +251,10 @@ tv({
|
|
|
251
251
|
list: ["flex gap-1 border-b border-edge-muted"],
|
|
252
252
|
tab: [
|
|
253
253
|
"px-4 py-2 text-base font-medium cursor-pointer",
|
|
254
|
-
"text-foreground-
|
|
254
|
+
"text-foreground-muted outline-none",
|
|
255
255
|
"border-b-2 border-transparent -mb-px",
|
|
256
256
|
"hovered:text-foreground-primary",
|
|
257
|
-
"selected:text-foreground-primary selected:border-
|
|
257
|
+
"selected:text-foreground-primary selected:border-primary",
|
|
258
258
|
"disabled:text-foreground-disabled disabled:cursor-default",
|
|
259
259
|
"focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2"
|
|
260
260
|
],
|
|
@@ -1087,10 +1087,9 @@ var shadowMap = {
|
|
|
1087
1087
|
true: "shadow-[var(--shadow-default)]"
|
|
1088
1088
|
};
|
|
1089
1089
|
var semanticColorMap = {
|
|
1090
|
-
primary: { text: "text-foreground-primary", bg: "bg-
|
|
1091
|
-
secondary: { text: "text-foreground-secondary", bg: "bg-surface-raised" },
|
|
1090
|
+
primary: { text: "text-foreground-primary", bg: "bg-primary" },
|
|
1092
1091
|
muted: { text: "text-foreground-muted", bg: "bg-surface-raised" },
|
|
1093
|
-
inverted: { text: "text-foreground
|
|
1092
|
+
inverted: { text: "text-primary-foreground", bg: "bg-surface-inverted" },
|
|
1094
1093
|
disabled: { text: "text-foreground-disabled", bg: "bg-surface-disabled" },
|
|
1095
1094
|
transparent: { text: "text-transparent", bg: "bg-transparent" },
|
|
1096
1095
|
true: { text: "text-foreground-primary", bg: "bg-interactive" },
|
|
@@ -1422,8 +1421,7 @@ var borderMap = {
|
|
|
1422
1421
|
var semanticBorderColorMap = {
|
|
1423
1422
|
true: "border-edge",
|
|
1424
1423
|
transparent: "border-transparent",
|
|
1425
|
-
primary: "border-
|
|
1426
|
-
inverted: "border-edge-inverted",
|
|
1424
|
+
primary: "border-primary",
|
|
1427
1425
|
muted: "border-edge-muted",
|
|
1428
1426
|
strong: "border-edge-strong",
|
|
1429
1427
|
disabled: "border-edge-muted"
|
|
@@ -2263,6 +2261,37 @@ function isMinHeightPreset(value) {
|
|
|
2263
2261
|
function isMaxHeightPreset(value) {
|
|
2264
2262
|
return value in maxHeightMap;
|
|
2265
2263
|
}
|
|
2264
|
+
function addStatePrefix(prefix, className) {
|
|
2265
|
+
if (!className) return "";
|
|
2266
|
+
return className.split(" ").filter(Boolean).map((cls) => `${prefix}:${cls}`).join(" ");
|
|
2267
|
+
}
|
|
2268
|
+
function mapStateStyles(prefix, styles) {
|
|
2269
|
+
if (!styles) return "";
|
|
2270
|
+
const classes = [];
|
|
2271
|
+
if (styles.color !== void 0) {
|
|
2272
|
+
const colorClass = mapTextColor(
|
|
2273
|
+
typeof styles.color === "boolean" ? "true" : String(styles.color)
|
|
2274
|
+
);
|
|
2275
|
+
if (colorClass) classes.push(addStatePrefix(prefix, colorClass));
|
|
2276
|
+
}
|
|
2277
|
+
if (styles.backgroundColor !== void 0) {
|
|
2278
|
+
const bgClass = mapBackgroundColor(
|
|
2279
|
+
typeof styles.backgroundColor === "boolean" ? "true" : String(styles.backgroundColor)
|
|
2280
|
+
);
|
|
2281
|
+
if (bgClass) classes.push(addStatePrefix(prefix, bgClass));
|
|
2282
|
+
}
|
|
2283
|
+
if (styles.borderColor !== void 0) {
|
|
2284
|
+
const borderClass = mapBorderColor(
|
|
2285
|
+
typeof styles.borderColor === "boolean" ? "true" : String(styles.borderColor)
|
|
2286
|
+
);
|
|
2287
|
+
if (borderClass) classes.push(addStatePrefix(prefix, borderClass));
|
|
2288
|
+
}
|
|
2289
|
+
if (styles.opacity !== void 0) {
|
|
2290
|
+
const opacityClass = mapOpacity(styles.opacity);
|
|
2291
|
+
if (opacityClass) classes.push(addStatePrefix(prefix, opacityClass));
|
|
2292
|
+
}
|
|
2293
|
+
return classes.join(" ");
|
|
2294
|
+
}
|
|
2266
2295
|
var sizeMap = {
|
|
2267
2296
|
xs: "w-3 h-3",
|
|
2268
2297
|
sm: "w-4 h-4",
|
|
@@ -2478,6 +2507,9 @@ var Box = forwardRef(function Box2({
|
|
|
2478
2507
|
order,
|
|
2479
2508
|
zIndex,
|
|
2480
2509
|
theme,
|
|
2510
|
+
hover,
|
|
2511
|
+
focus,
|
|
2512
|
+
active,
|
|
2481
2513
|
as = "div",
|
|
2482
2514
|
render,
|
|
2483
2515
|
className,
|
|
@@ -2532,6 +2564,9 @@ var Box = forwardRef(function Box2({
|
|
|
2532
2564
|
mapPointerEvents(pointerEvents),
|
|
2533
2565
|
mapAlignSelf(alignSelf),
|
|
2534
2566
|
theme && `${theme}-theme`,
|
|
2567
|
+
mapStateStyles("hover", hover),
|
|
2568
|
+
mapStateStyles("focus", focus),
|
|
2569
|
+
mapStateStyles("active", active),
|
|
2535
2570
|
className
|
|
2536
2571
|
);
|
|
2537
2572
|
const widthStyle = getSizingStyle(width, isWidthPreset);
|
|
@@ -2738,15 +2773,7 @@ function AlertDialog({
|
|
|
2738
2773
|
} });
|
|
2739
2774
|
}
|
|
2740
2775
|
function Blockquote({ className, children, ...props }) {
|
|
2741
|
-
return /* @__PURE__ */ jsx(
|
|
2742
|
-
Text,
|
|
2743
|
-
{
|
|
2744
|
-
...props,
|
|
2745
|
-
as: "blockquote",
|
|
2746
|
-
className: cn("border-l-2 border-edge-inverted pl-5", className),
|
|
2747
|
-
children
|
|
2748
|
-
}
|
|
2749
|
-
);
|
|
2776
|
+
return /* @__PURE__ */ jsx(Text, { ...props, as: "blockquote", className: cn("border-l-2 border-primary pl-5", className), children });
|
|
2750
2777
|
}
|
|
2751
2778
|
function Breadcrumbs({ children, className, ...props }) {
|
|
2752
2779
|
return /* @__PURE__ */ jsx(Breadcrumbs$1, { ...props, className: cn("flex items-center gap-3", className), children });
|
|
@@ -2813,7 +2840,7 @@ function Calendar({
|
|
|
2813
2840
|
"hover:bg-interactive",
|
|
2814
2841
|
"data-[outside-month]:hidden",
|
|
2815
2842
|
"data-[focus-visible]:outline-2 data-[focus-visible]:outline-focus-ring data-[focus-visible]:outline-offset-2",
|
|
2816
|
-
"data-[selected]:text-
|
|
2843
|
+
"data-[selected]:text-primary-foreground data-[selected]:bg-primary",
|
|
2817
2844
|
"data-[disabled]:text-foreground-disabled"
|
|
2818
2845
|
),
|
|
2819
2846
|
date
|
|
@@ -3443,7 +3470,7 @@ function TableCell({ children, className, align, ...props }) {
|
|
|
3443
3470
|
className: cn(
|
|
3444
3471
|
"flex p-2 flex-1 first:pl-0 last:pr-0",
|
|
3445
3472
|
"[&_a]:font-medium [&_a]:underline [&_a]:decoration-edge [&_a]:underline-offset-4",
|
|
3446
|
-
"[&_a:hover]:decoration-
|
|
3473
|
+
"[&_a:hover]:decoration-primary",
|
|
3447
3474
|
align && alignClasses2[align],
|
|
3448
3475
|
className
|
|
3449
3476
|
),
|
|
@@ -3730,13 +3757,13 @@ function Spinner(props) {
|
|
|
3730
3757
|
...domProps,
|
|
3731
3758
|
className: cn("relative inline-flex justify-center items-center", sizeMap3[size], className),
|
|
3732
3759
|
children: /* @__PURE__ */ jsxs("svg", { viewBox: "25 25 50 50", className: "zen-spinner-svg w-full h-full", children: [
|
|
3733
|
-
!quiet && /* @__PURE__ */ jsx("circle", { className: "zen-spinner-track stroke-
|
|
3760
|
+
!quiet && /* @__PURE__ */ jsx("circle", { className: "zen-spinner-track stroke-interactive", cx: "50", cy: "50", r: "20" }),
|
|
3734
3761
|
/* @__PURE__ */ jsx(
|
|
3735
3762
|
"circle",
|
|
3736
3763
|
{
|
|
3737
3764
|
className: cn(
|
|
3738
3765
|
"zen-spinner-fill",
|
|
3739
|
-
isDisabled ? "stroke-content-disabled" : "stroke-
|
|
3766
|
+
isDisabled ? "stroke-content-disabled" : "stroke-primary"
|
|
3740
3767
|
),
|
|
3741
3768
|
cx: "50",
|
|
3742
3769
|
cy: "50",
|
|
@@ -4461,7 +4488,16 @@ function PasswordField({ label, className, ...props }) {
|
|
|
4461
4488
|
] });
|
|
4462
4489
|
}
|
|
4463
4490
|
function Track({ children }) {
|
|
4464
|
-
return /* @__PURE__ */ jsx(
|
|
4491
|
+
return /* @__PURE__ */ jsx(
|
|
4492
|
+
Box,
|
|
4493
|
+
{
|
|
4494
|
+
position: "relative",
|
|
4495
|
+
borderRadius: "full",
|
|
4496
|
+
overflow: "hidden",
|
|
4497
|
+
className: "w-full h-2 bg-interactive",
|
|
4498
|
+
children
|
|
4499
|
+
}
|
|
4500
|
+
);
|
|
4465
4501
|
}
|
|
4466
4502
|
function Fill({ percentage }) {
|
|
4467
4503
|
return /* @__PURE__ */ jsx(
|
|
@@ -4472,7 +4508,7 @@ function Fill({ percentage }) {
|
|
|
4472
4508
|
bottom: "0",
|
|
4473
4509
|
left: "0",
|
|
4474
4510
|
borderRadius: "full",
|
|
4475
|
-
className: "bg-
|
|
4511
|
+
className: "bg-primary transition-all",
|
|
4476
4512
|
style: { width: `${percentage}%` }
|
|
4477
4513
|
}
|
|
4478
4514
|
);
|
|
@@ -4498,11 +4534,11 @@ function ProgressCircle({ className, showPercentage, ...props }) {
|
|
|
4498
4534
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4499
4535
|
className: "fill-none stroke-[8px] -rotate-90 w-24 h-24",
|
|
4500
4536
|
children: [
|
|
4501
|
-
/* @__PURE__ */ jsx("circle", { className: "stroke-
|
|
4537
|
+
/* @__PURE__ */ jsx("circle", { className: "stroke-interactive", cx: "50", cy: "50", r: "45" }),
|
|
4502
4538
|
/* @__PURE__ */ jsx(
|
|
4503
4539
|
"circle",
|
|
4504
4540
|
{
|
|
4505
|
-
className: "stroke-
|
|
4541
|
+
className: "stroke-primary",
|
|
4506
4542
|
cx: "50",
|
|
4507
4543
|
cy: "50",
|
|
4508
4544
|
r: "45",
|
|
@@ -4541,7 +4577,7 @@ function Radio({ children, className, ...props }) {
|
|
|
4541
4577
|
"radio group flex items-center gap-3 cursor-pointer text-base",
|
|
4542
4578
|
"before:content-[''] before:block before:w-5 before:h-5 before:box-border before:rounded-full",
|
|
4543
4579
|
"before:border before:border-edge-strong before:bg-surface-base before:transition-all before:duration-200",
|
|
4544
|
-
"data-[selected]:before:border-[6px] data-[selected]:before:border-
|
|
4580
|
+
"data-[selected]:before:border-[6px] data-[selected]:before:border-primary",
|
|
4545
4581
|
"data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",
|
|
4546
4582
|
className
|
|
4547
4583
|
),
|
|
@@ -4785,7 +4821,7 @@ function SidebarItem({
|
|
|
4785
4821
|
}
|
|
4786
4822
|
function Fill2({ percentage }) {
|
|
4787
4823
|
const width = `calc(10px + ${percentage}% - ${percentage * 0.2}px)`;
|
|
4788
|
-
return /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 rounded-full bg-
|
|
4824
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 rounded-full bg-primary", style: { width } });
|
|
4789
4825
|
}
|
|
4790
4826
|
function Thumb({ percentage }) {
|
|
4791
4827
|
const left = `calc(${percentage}% - ${percentage * 0.2}px)`;
|
|
@@ -4793,7 +4829,7 @@ function Thumb({ percentage }) {
|
|
|
4793
4829
|
SliderThumb,
|
|
4794
4830
|
{
|
|
4795
4831
|
className: cn(
|
|
4796
|
-
"absolute w-5 h-5 rounded-full bg-surface-base border-2 border-
|
|
4832
|
+
"absolute w-5 h-5 rounded-full bg-surface-base border-2 border-primary shadow",
|
|
4797
4833
|
"focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2"
|
|
4798
4834
|
),
|
|
4799
4835
|
style: { top: "50%", left, transform: "translateY(-50%)" }
|
|
@@ -4809,7 +4845,7 @@ function Slider({ className, showValue = true, label, ...props }) {
|
|
|
4809
4845
|
/* @__PURE__ */ jsx(SliderTrack, { className: "relative h-5 w-full", children: ({ state }) => {
|
|
4810
4846
|
const percentage = state.getThumbPercent(0) * 100;
|
|
4811
4847
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4812
|
-
/* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 top-1/2 -translate-y-1/2 h-
|
|
4848
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 top-1/2 -translate-y-1/2 h-2 rounded-full bg-interactive overflow-hidden", children: /* @__PURE__ */ jsx(Fill2, { percentage }) }),
|
|
4813
4849
|
/* @__PURE__ */ jsx(Thumb, { percentage })
|
|
4814
4850
|
] });
|
|
4815
4851
|
} })
|
|
@@ -4876,7 +4912,7 @@ function Tab({ children, className, ...props }) {
|
|
|
4876
4912
|
className: cn(
|
|
4877
4913
|
"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",
|
|
4878
4914
|
"data-[hovered]:text-foreground-primary",
|
|
4879
|
-
"data-[selected]:text-foreground-primary data-[selected]:border-b-
|
|
4915
|
+
"data-[selected]:text-foreground-primary data-[selected]:border-b-primary",
|
|
4880
4916
|
"data-[disabled]:text-foreground-disabled data-[disabled]:cursor-default",
|
|
4881
4917
|
className
|
|
4882
4918
|
),
|
|
@@ -5042,7 +5078,7 @@ function Toggle({ label, children, className, ...props }) {
|
|
|
5042
5078
|
"flex items-center justify-center whitespace-nowrap gap-3 font-medium bg-interactive border border-transparent rounded p-2 relative cursor-pointer",
|
|
5043
5079
|
"hover:bg-interactive-hover",
|
|
5044
5080
|
"pressed:bg-interactive-pressed",
|
|
5045
|
-
"data-[selected]:text-
|
|
5081
|
+
"data-[selected]:text-primary-foreground data-[selected]:bg-primary",
|
|
5046
5082
|
className
|
|
5047
5083
|
),
|
|
5048
5084
|
children
|