@umami/react-zen 0.219.0 → 0.220.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 +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +91 -18
- package/dist/index.mjs +92 -19
- package/package.json +1 -1
- package/styles.css +61 -0
- package/styles.full.css +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -93,8 +93,8 @@ type FlexGrow = string | number;
|
|
|
93
93
|
type FlexShrink = string | number;
|
|
94
94
|
type GridDisplay = 'none' | 'grid' | 'inline-grid';
|
|
95
95
|
type GridAutoFlow = 'row' | 'column' | 'dense' | 'row-dense' | 'column-dense';
|
|
96
|
-
type
|
|
97
|
-
type
|
|
96
|
+
type GridColumns = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'none' | 'subgrid';
|
|
97
|
+
type GridRows = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'none' | 'subgrid';
|
|
98
98
|
type GridTemplateAreas = string;
|
|
99
99
|
type JustifyContent = 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'left' | 'right' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch';
|
|
100
100
|
type JustifyItems = 'stretch' | 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'left' | 'right' | 'baseline';
|
|
@@ -386,8 +386,8 @@ interface GridProps extends Omit<BoxProps, 'display'> {
|
|
|
386
386
|
gapX?: Responsive<Gap>;
|
|
387
387
|
gapY?: Responsive<Gap>;
|
|
388
388
|
autoFlow?: Responsive<GridAutoFlow>;
|
|
389
|
-
rows?:
|
|
390
|
-
columns?:
|
|
389
|
+
rows?: Responsive<GridRows> | string;
|
|
390
|
+
columns?: Responsive<GridColumns> | string;
|
|
391
391
|
areas?: GridTemplateAreas;
|
|
392
392
|
}
|
|
393
393
|
declare function Grid({ display, justifyContent, justifyItems, alignContent, alignItems, gap, gapX, gapY, autoFlow, rows, columns, areas, className, style, children, ...props }: GridProps): react_jsx_runtime.JSX.Element;
|
|
@@ -429,7 +429,7 @@ declare function Tooltip({ children, className, showArrow, ...props }: TooltipPr
|
|
|
429
429
|
interface TooltipBubbleProps extends HTMLAttributes<HTMLDivElement> {
|
|
430
430
|
showArrow?: boolean;
|
|
431
431
|
}
|
|
432
|
-
declare function TooltipBubble({
|
|
432
|
+
declare function TooltipBubble({ children, className, color: _color, ...props }: TooltipBubbleProps): react_jsx_runtime.JSX.Element;
|
|
433
433
|
|
|
434
434
|
interface FloatingTooltipProps extends TooltipBubbleProps {
|
|
435
435
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -93,8 +93,8 @@ type FlexGrow = string | number;
|
|
|
93
93
|
type FlexShrink = string | number;
|
|
94
94
|
type GridDisplay = 'none' | 'grid' | 'inline-grid';
|
|
95
95
|
type GridAutoFlow = 'row' | 'column' | 'dense' | 'row-dense' | 'column-dense';
|
|
96
|
-
type
|
|
97
|
-
type
|
|
96
|
+
type GridColumns = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'none' | 'subgrid';
|
|
97
|
+
type GridRows = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'none' | 'subgrid';
|
|
98
98
|
type GridTemplateAreas = string;
|
|
99
99
|
type JustifyContent = 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'left' | 'right' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch';
|
|
100
100
|
type JustifyItems = 'stretch' | 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'left' | 'right' | 'baseline';
|
|
@@ -386,8 +386,8 @@ interface GridProps extends Omit<BoxProps, 'display'> {
|
|
|
386
386
|
gapX?: Responsive<Gap>;
|
|
387
387
|
gapY?: Responsive<Gap>;
|
|
388
388
|
autoFlow?: Responsive<GridAutoFlow>;
|
|
389
|
-
rows?:
|
|
390
|
-
columns?:
|
|
389
|
+
rows?: Responsive<GridRows> | string;
|
|
390
|
+
columns?: Responsive<GridColumns> | string;
|
|
391
391
|
areas?: GridTemplateAreas;
|
|
392
392
|
}
|
|
393
393
|
declare function Grid({ display, justifyContent, justifyItems, alignContent, alignItems, gap, gapX, gapY, autoFlow, rows, columns, areas, className, style, children, ...props }: GridProps): react_jsx_runtime.JSX.Element;
|
|
@@ -429,7 +429,7 @@ declare function Tooltip({ children, className, showArrow, ...props }: TooltipPr
|
|
|
429
429
|
interface TooltipBubbleProps extends HTMLAttributes<HTMLDivElement> {
|
|
430
430
|
showArrow?: boolean;
|
|
431
431
|
}
|
|
432
|
-
declare function TooltipBubble({
|
|
432
|
+
declare function TooltipBubble({ children, className, color: _color, ...props }: TooltipBubbleProps): react_jsx_runtime.JSX.Element;
|
|
433
433
|
|
|
434
434
|
interface FloatingTooltipProps extends TooltipBubbleProps {
|
|
435
435
|
}
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
41
41
|
}
|
|
42
42
|
var objectIs = "function" === typeof Object.is ? Object.is : is2;
|
|
43
43
|
var useState18 = React5.useState;
|
|
44
|
-
var
|
|
44
|
+
var useEffect13 = React5.useEffect;
|
|
45
45
|
var useLayoutEffect3 = React5.useLayoutEffect;
|
|
46
46
|
var useDebugValue = React5.useDebugValue;
|
|
47
47
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
@@ -54,7 +54,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
54
54
|
},
|
|
55
55
|
[subscribe, value, getSnapshot]
|
|
56
56
|
);
|
|
57
|
-
|
|
57
|
+
useEffect13(
|
|
58
58
|
function() {
|
|
59
59
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
60
60
|
return subscribe(function() {
|
|
@@ -115,7 +115,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
115
115
|
},
|
|
116
116
|
[subscribe, value, getSnapshot]
|
|
117
117
|
);
|
|
118
|
-
|
|
118
|
+
useEffect13(
|
|
119
119
|
function() {
|
|
120
120
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
121
121
|
return subscribe(function() {
|
|
@@ -141,7 +141,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
141
141
|
return getSnapshot();
|
|
142
142
|
}
|
|
143
143
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
144
|
-
var React5 = import_react204.default, objectIs = "function" === typeof Object.is ? Object.is : is2, useState18 = React5.useState,
|
|
144
|
+
var React5 = import_react204.default, objectIs = "function" === typeof Object.is ? Object.is : is2, useState18 = React5.useState, useEffect13 = React5.useEffect, useLayoutEffect3 = React5.useLayoutEffect, useDebugValue = React5.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
145
145
|
exports.useSyncExternalStore = void 0 !== React5.useSyncExternalStore ? React5.useSyncExternalStore : shim;
|
|
146
146
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
147
147
|
})();
|
|
@@ -31102,6 +31102,38 @@ var gridAutoFlowMap = {
|
|
|
31102
31102
|
"row-dense": "grid-flow-row-dense",
|
|
31103
31103
|
"column-dense": "grid-flow-col-dense"
|
|
31104
31104
|
};
|
|
31105
|
+
var gridColumnsMap = {
|
|
31106
|
+
"1": "grid-cols-1",
|
|
31107
|
+
"2": "grid-cols-2",
|
|
31108
|
+
"3": "grid-cols-3",
|
|
31109
|
+
"4": "grid-cols-4",
|
|
31110
|
+
"5": "grid-cols-5",
|
|
31111
|
+
"6": "grid-cols-6",
|
|
31112
|
+
"7": "grid-cols-7",
|
|
31113
|
+
"8": "grid-cols-8",
|
|
31114
|
+
"9": "grid-cols-9",
|
|
31115
|
+
"10": "grid-cols-10",
|
|
31116
|
+
"11": "grid-cols-11",
|
|
31117
|
+
"12": "grid-cols-12",
|
|
31118
|
+
none: "grid-cols-none",
|
|
31119
|
+
subgrid: "grid-cols-subgrid"
|
|
31120
|
+
};
|
|
31121
|
+
var gridRowsMap = {
|
|
31122
|
+
"1": "grid-rows-1",
|
|
31123
|
+
"2": "grid-rows-2",
|
|
31124
|
+
"3": "grid-rows-3",
|
|
31125
|
+
"4": "grid-rows-4",
|
|
31126
|
+
"5": "grid-rows-5",
|
|
31127
|
+
"6": "grid-rows-6",
|
|
31128
|
+
"7": "grid-rows-7",
|
|
31129
|
+
"8": "grid-rows-8",
|
|
31130
|
+
"9": "grid-rows-9",
|
|
31131
|
+
"10": "grid-rows-10",
|
|
31132
|
+
"11": "grid-rows-11",
|
|
31133
|
+
"12": "grid-rows-12",
|
|
31134
|
+
none: "grid-rows-none",
|
|
31135
|
+
subgrid: "grid-rows-subgrid"
|
|
31136
|
+
};
|
|
31105
31137
|
var borderMap = {
|
|
31106
31138
|
true: "border border-edge",
|
|
31107
31139
|
none: "border-0",
|
|
@@ -31259,6 +31291,12 @@ function mapTextIndent(value) {
|
|
|
31259
31291
|
function mapGridAutoFlow(value) {
|
|
31260
31292
|
return mapResponsive(value, (v) => gridAutoFlowMap[v]);
|
|
31261
31293
|
}
|
|
31294
|
+
function mapGridColumns(value) {
|
|
31295
|
+
return mapResponsive(value, (v) => gridColumnsMap[v]);
|
|
31296
|
+
}
|
|
31297
|
+
function mapGridRows(value) {
|
|
31298
|
+
return mapResponsive(value, (v) => gridRowsMap[v]);
|
|
31299
|
+
}
|
|
31262
31300
|
function mapBorder(value) {
|
|
31263
31301
|
return mapResponsive(value, (v) => borderMap[String(v)]);
|
|
31264
31302
|
}
|
|
@@ -32627,6 +32665,12 @@ function Grid({
|
|
|
32627
32665
|
children,
|
|
32628
32666
|
...props
|
|
32629
32667
|
}) {
|
|
32668
|
+
const isCustomColumns = typeof columns === "string" && !["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "none", "subgrid"].includes(
|
|
32669
|
+
columns
|
|
32670
|
+
);
|
|
32671
|
+
const isCustomRows = typeof rows === "string" && !["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "none", "subgrid"].includes(
|
|
32672
|
+
rows
|
|
32673
|
+
);
|
|
32630
32674
|
const classes = cn(
|
|
32631
32675
|
mapDisplay(display),
|
|
32632
32676
|
mapJustifyContent(justifyContent),
|
|
@@ -32637,16 +32681,18 @@ function Grid({
|
|
|
32637
32681
|
mapGap(gapX, "x"),
|
|
32638
32682
|
mapGap(gapY, "y"),
|
|
32639
32683
|
mapGridAutoFlow(autoFlow),
|
|
32684
|
+
!isCustomColumns && mapGridColumns(columns),
|
|
32685
|
+
!isCustomRows && mapGridRows(rows),
|
|
32640
32686
|
className
|
|
32641
32687
|
);
|
|
32642
32688
|
const inlineStyles = {
|
|
32643
32689
|
...style,
|
|
32644
|
-
...
|
|
32645
|
-
...
|
|
32690
|
+
...isCustomColumns && { gridTemplateColumns: columns },
|
|
32691
|
+
...isCustomRows && { gridTemplateRows: rows },
|
|
32646
32692
|
...areas && { gridTemplateAreas: areas }
|
|
32647
32693
|
};
|
|
32648
|
-
const hasInlineStyles =
|
|
32649
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box, { ...props, className: classes, style: hasInlineStyles
|
|
32694
|
+
const hasInlineStyles = isCustomColumns || isCustomRows || areas || style && Object.keys(style).length > 0;
|
|
32695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box, { ...props, className: classes, style: hasInlineStyles ? inlineStyles : void 0, children });
|
|
32650
32696
|
}
|
|
32651
32697
|
|
|
32652
32698
|
// src/lib/utils.ts
|
|
@@ -32857,14 +32903,27 @@ var import_react171 = require("react");
|
|
|
32857
32903
|
// src/components/Tooltip.tsx
|
|
32858
32904
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
32859
32905
|
function Tooltip2({ children, className, showArrow, ...props }) {
|
|
32860
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.
|
|
32861
|
-
|
|
32862
|
-
|
|
32863
|
-
|
|
32864
|
-
|
|
32865
|
-
|
|
32906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)($4e3b923658d69c60$export$28c660c63b792dea, { ...props, className: cn("group", tooltip(), className), children: [
|
|
32907
|
+
showArrow && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)($44f671af83e7d9e0$export$746d02f47f4d381, { className: "w-2 h-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
32908
|
+
"svg",
|
|
32909
|
+
{
|
|
32910
|
+
viewBox: "0 0 8 8",
|
|
32911
|
+
className: cn(
|
|
32912
|
+
"block fill-surface-inverted",
|
|
32913
|
+
"group-data-[placement=bottom]:rotate-180",
|
|
32914
|
+
"group-data-[placement=left]:-rotate-90",
|
|
32915
|
+
"group-data-[placement=right]:rotate-90"
|
|
32916
|
+
),
|
|
32917
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("path", { d: "M0 0 L4 4 L8 0" })
|
|
32918
|
+
}
|
|
32919
|
+
) }),
|
|
32920
|
+
children,
|
|
32921
|
+
"for"
|
|
32866
32922
|
] });
|
|
32867
32923
|
}
|
|
32924
|
+
function TooltipBubble({ children, className, color: _color, ...props }) {
|
|
32925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box, { ...props, className, children });
|
|
32926
|
+
}
|
|
32868
32927
|
|
|
32869
32928
|
// src/components/FloatingTooltip.tsx
|
|
32870
32929
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
@@ -39997,6 +40056,9 @@ function TabPanel2({ children, className, ...props }) {
|
|
|
39997
40056
|
// src/components/ThemeButton.tsx
|
|
39998
40057
|
var import_react203 = require("react");
|
|
39999
40058
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
40059
|
+
function getElement(target) {
|
|
40060
|
+
return "current" in target ? target.current : target;
|
|
40061
|
+
}
|
|
40000
40062
|
function applyTheme2(element, theme) {
|
|
40001
40063
|
element.setAttribute("data-theme", theme);
|
|
40002
40064
|
if (theme === "dark") {
|
|
@@ -40013,9 +40075,20 @@ function ThemeButton({
|
|
|
40013
40075
|
...props
|
|
40014
40076
|
}) {
|
|
40015
40077
|
const globalTheme = useTheme();
|
|
40016
|
-
const [localTheme, setLocalTheme] = (0, import_react203.useState)(
|
|
40078
|
+
const [localTheme, setLocalTheme] = (0, import_react203.useState)(null);
|
|
40079
|
+
const initializedRef = (0, import_react203.useRef)(false);
|
|
40017
40080
|
const isLocal = !!target;
|
|
40018
|
-
|
|
40081
|
+
(0, import_react203.useEffect)(() => {
|
|
40082
|
+
if (isLocal && target && !initializedRef.current) {
|
|
40083
|
+
const element = getElement(target);
|
|
40084
|
+
if (element) {
|
|
40085
|
+
initializedRef.current = true;
|
|
40086
|
+
setLocalTheme(globalTheme.theme);
|
|
40087
|
+
applyTheme2(element, globalTheme.theme);
|
|
40088
|
+
}
|
|
40089
|
+
}
|
|
40090
|
+
}, [isLocal, target, globalTheme.theme]);
|
|
40091
|
+
const theme = isLocal ? localTheme ?? globalTheme.theme : globalTheme.theme;
|
|
40019
40092
|
const transitions = useTransition(theme, {
|
|
40020
40093
|
initial: { opacity: 1 },
|
|
40021
40094
|
from: {
|
|
@@ -40030,8 +40103,8 @@ function ThemeButton({
|
|
|
40030
40103
|
});
|
|
40031
40104
|
function handleClick(e) {
|
|
40032
40105
|
const newTheme = theme === "light" ? "dark" : "light";
|
|
40033
|
-
if (isLocal) {
|
|
40034
|
-
const element =
|
|
40106
|
+
if (isLocal && target) {
|
|
40107
|
+
const element = getElement(target);
|
|
40035
40108
|
if (element) {
|
|
40036
40109
|
applyTheme2(element, newTheme);
|
|
40037
40110
|
setLocalTheme(newTheme);
|
package/dist/index.mjs
CHANGED
|
@@ -35,7 +35,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
35
35
|
}
|
|
36
36
|
var objectIs = "function" === typeof Object.is ? Object.is : is2;
|
|
37
37
|
var useState18 = React5.useState;
|
|
38
|
-
var
|
|
38
|
+
var useEffect13 = React5.useEffect;
|
|
39
39
|
var useLayoutEffect3 = React5.useLayoutEffect;
|
|
40
40
|
var useDebugValue = React5.useDebugValue;
|
|
41
41
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
@@ -48,7 +48,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
48
48
|
},
|
|
49
49
|
[subscribe, value, getSnapshot]
|
|
50
50
|
);
|
|
51
|
-
|
|
51
|
+
useEffect13(
|
|
52
52
|
function() {
|
|
53
53
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
54
54
|
return subscribe(function() {
|
|
@@ -109,7 +109,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
109
109
|
},
|
|
110
110
|
[subscribe, value, getSnapshot]
|
|
111
111
|
);
|
|
112
|
-
|
|
112
|
+
useEffect13(
|
|
113
113
|
function() {
|
|
114
114
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
115
115
|
return subscribe(function() {
|
|
@@ -135,7 +135,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
135
135
|
return getSnapshot();
|
|
136
136
|
}
|
|
137
137
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
138
|
-
var React5 = __import_react2, objectIs = "function" === typeof Object.is ? Object.is : is2, useState18 = React5.useState,
|
|
138
|
+
var React5 = __import_react2, objectIs = "function" === typeof Object.is ? Object.is : is2, useState18 = React5.useState, useEffect13 = React5.useEffect, useLayoutEffect3 = React5.useLayoutEffect, useDebugValue = React5.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
139
139
|
exports.useSyncExternalStore = void 0 !== React5.useSyncExternalStore ? React5.useSyncExternalStore : shim;
|
|
140
140
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
141
141
|
})();
|
|
@@ -30978,6 +30978,38 @@ var gridAutoFlowMap = {
|
|
|
30978
30978
|
"row-dense": "grid-flow-row-dense",
|
|
30979
30979
|
"column-dense": "grid-flow-col-dense"
|
|
30980
30980
|
};
|
|
30981
|
+
var gridColumnsMap = {
|
|
30982
|
+
"1": "grid-cols-1",
|
|
30983
|
+
"2": "grid-cols-2",
|
|
30984
|
+
"3": "grid-cols-3",
|
|
30985
|
+
"4": "grid-cols-4",
|
|
30986
|
+
"5": "grid-cols-5",
|
|
30987
|
+
"6": "grid-cols-6",
|
|
30988
|
+
"7": "grid-cols-7",
|
|
30989
|
+
"8": "grid-cols-8",
|
|
30990
|
+
"9": "grid-cols-9",
|
|
30991
|
+
"10": "grid-cols-10",
|
|
30992
|
+
"11": "grid-cols-11",
|
|
30993
|
+
"12": "grid-cols-12",
|
|
30994
|
+
none: "grid-cols-none",
|
|
30995
|
+
subgrid: "grid-cols-subgrid"
|
|
30996
|
+
};
|
|
30997
|
+
var gridRowsMap = {
|
|
30998
|
+
"1": "grid-rows-1",
|
|
30999
|
+
"2": "grid-rows-2",
|
|
31000
|
+
"3": "grid-rows-3",
|
|
31001
|
+
"4": "grid-rows-4",
|
|
31002
|
+
"5": "grid-rows-5",
|
|
31003
|
+
"6": "grid-rows-6",
|
|
31004
|
+
"7": "grid-rows-7",
|
|
31005
|
+
"8": "grid-rows-8",
|
|
31006
|
+
"9": "grid-rows-9",
|
|
31007
|
+
"10": "grid-rows-10",
|
|
31008
|
+
"11": "grid-rows-11",
|
|
31009
|
+
"12": "grid-rows-12",
|
|
31010
|
+
none: "grid-rows-none",
|
|
31011
|
+
subgrid: "grid-rows-subgrid"
|
|
31012
|
+
};
|
|
30981
31013
|
var borderMap = {
|
|
30982
31014
|
true: "border border-edge",
|
|
30983
31015
|
none: "border-0",
|
|
@@ -31135,6 +31167,12 @@ function mapTextIndent(value) {
|
|
|
31135
31167
|
function mapGridAutoFlow(value) {
|
|
31136
31168
|
return mapResponsive(value, (v) => gridAutoFlowMap[v]);
|
|
31137
31169
|
}
|
|
31170
|
+
function mapGridColumns(value) {
|
|
31171
|
+
return mapResponsive(value, (v) => gridColumnsMap[v]);
|
|
31172
|
+
}
|
|
31173
|
+
function mapGridRows(value) {
|
|
31174
|
+
return mapResponsive(value, (v) => gridRowsMap[v]);
|
|
31175
|
+
}
|
|
31138
31176
|
function mapBorder(value) {
|
|
31139
31177
|
return mapResponsive(value, (v) => borderMap[String(v)]);
|
|
31140
31178
|
}
|
|
@@ -32505,6 +32543,12 @@ function Grid({
|
|
|
32505
32543
|
children,
|
|
32506
32544
|
...props
|
|
32507
32545
|
}) {
|
|
32546
|
+
const isCustomColumns = typeof columns === "string" && !["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "none", "subgrid"].includes(
|
|
32547
|
+
columns
|
|
32548
|
+
);
|
|
32549
|
+
const isCustomRows = typeof rows === "string" && !["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "none", "subgrid"].includes(
|
|
32550
|
+
rows
|
|
32551
|
+
);
|
|
32508
32552
|
const classes = cn(
|
|
32509
32553
|
mapDisplay(display),
|
|
32510
32554
|
mapJustifyContent(justifyContent),
|
|
@@ -32515,16 +32559,18 @@ function Grid({
|
|
|
32515
32559
|
mapGap(gapX, "x"),
|
|
32516
32560
|
mapGap(gapY, "y"),
|
|
32517
32561
|
mapGridAutoFlow(autoFlow),
|
|
32562
|
+
!isCustomColumns && mapGridColumns(columns),
|
|
32563
|
+
!isCustomRows && mapGridRows(rows),
|
|
32518
32564
|
className
|
|
32519
32565
|
);
|
|
32520
32566
|
const inlineStyles = {
|
|
32521
32567
|
...style,
|
|
32522
|
-
...
|
|
32523
|
-
...
|
|
32568
|
+
...isCustomColumns && { gridTemplateColumns: columns },
|
|
32569
|
+
...isCustomRows && { gridTemplateRows: rows },
|
|
32524
32570
|
...areas && { gridTemplateAreas: areas }
|
|
32525
32571
|
};
|
|
32526
|
-
const hasInlineStyles =
|
|
32527
|
-
return /* @__PURE__ */ jsx26(Box, { ...props, className: classes, style: hasInlineStyles
|
|
32572
|
+
const hasInlineStyles = isCustomColumns || isCustomRows || areas || style && Object.keys(style).length > 0;
|
|
32573
|
+
return /* @__PURE__ */ jsx26(Box, { ...props, className: classes, style: hasInlineStyles ? inlineStyles : void 0, children });
|
|
32528
32574
|
}
|
|
32529
32575
|
|
|
32530
32576
|
// src/lib/utils.ts
|
|
@@ -32738,14 +32784,27 @@ import { useEffect as useEffect2, useState as useState5 } from "react";
|
|
|
32738
32784
|
// src/components/Tooltip.tsx
|
|
32739
32785
|
import { jsx as jsx31, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
32740
32786
|
function Tooltip2({ children, className, showArrow, ...props }) {
|
|
32741
|
-
return /* @__PURE__ */
|
|
32742
|
-
|
|
32743
|
-
|
|
32744
|
-
|
|
32745
|
-
|
|
32746
|
-
|
|
32787
|
+
return /* @__PURE__ */ jsxs15($4e3b923658d69c60$export$28c660c63b792dea, { ...props, className: cn("group", tooltip(), className), children: [
|
|
32788
|
+
showArrow && /* @__PURE__ */ jsx31($44f671af83e7d9e0$export$746d02f47f4d381, { className: "w-2 h-2", children: /* @__PURE__ */ jsx31(
|
|
32789
|
+
"svg",
|
|
32790
|
+
{
|
|
32791
|
+
viewBox: "0 0 8 8",
|
|
32792
|
+
className: cn(
|
|
32793
|
+
"block fill-surface-inverted",
|
|
32794
|
+
"group-data-[placement=bottom]:rotate-180",
|
|
32795
|
+
"group-data-[placement=left]:-rotate-90",
|
|
32796
|
+
"group-data-[placement=right]:rotate-90"
|
|
32797
|
+
),
|
|
32798
|
+
children: /* @__PURE__ */ jsx31("path", { d: "M0 0 L4 4 L8 0" })
|
|
32799
|
+
}
|
|
32800
|
+
) }),
|
|
32801
|
+
children,
|
|
32802
|
+
"for"
|
|
32747
32803
|
] });
|
|
32748
32804
|
}
|
|
32805
|
+
function TooltipBubble({ children, className, color: _color, ...props }) {
|
|
32806
|
+
return /* @__PURE__ */ jsx31(Box, { ...props, className, children });
|
|
32807
|
+
}
|
|
32749
32808
|
|
|
32750
32809
|
// src/components/FloatingTooltip.tsx
|
|
32751
32810
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
@@ -39880,8 +39939,11 @@ function TabPanel2({ children, className, ...props }) {
|
|
|
39880
39939
|
}
|
|
39881
39940
|
|
|
39882
39941
|
// src/components/ThemeButton.tsx
|
|
39883
|
-
import { useState as useState17 } from "react";
|
|
39942
|
+
import { useEffect as useEffect12, useRef as useRef7, useState as useState17 } from "react";
|
|
39884
39943
|
import { jsx as jsx68, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
39944
|
+
function getElement(target) {
|
|
39945
|
+
return "current" in target ? target.current : target;
|
|
39946
|
+
}
|
|
39885
39947
|
function applyTheme2(element, theme) {
|
|
39886
39948
|
element.setAttribute("data-theme", theme);
|
|
39887
39949
|
if (theme === "dark") {
|
|
@@ -39898,9 +39960,20 @@ function ThemeButton({
|
|
|
39898
39960
|
...props
|
|
39899
39961
|
}) {
|
|
39900
39962
|
const globalTheme = useTheme();
|
|
39901
|
-
const [localTheme, setLocalTheme] = useState17(
|
|
39963
|
+
const [localTheme, setLocalTheme] = useState17(null);
|
|
39964
|
+
const initializedRef = useRef7(false);
|
|
39902
39965
|
const isLocal = !!target;
|
|
39903
|
-
|
|
39966
|
+
useEffect12(() => {
|
|
39967
|
+
if (isLocal && target && !initializedRef.current) {
|
|
39968
|
+
const element = getElement(target);
|
|
39969
|
+
if (element) {
|
|
39970
|
+
initializedRef.current = true;
|
|
39971
|
+
setLocalTheme(globalTheme.theme);
|
|
39972
|
+
applyTheme2(element, globalTheme.theme);
|
|
39973
|
+
}
|
|
39974
|
+
}
|
|
39975
|
+
}, [isLocal, target, globalTheme.theme]);
|
|
39976
|
+
const theme = isLocal ? localTheme ?? globalTheme.theme : globalTheme.theme;
|
|
39904
39977
|
const transitions = useTransition(theme, {
|
|
39905
39978
|
initial: { opacity: 1 },
|
|
39906
39979
|
from: {
|
|
@@ -39915,8 +39988,8 @@ function ThemeButton({
|
|
|
39915
39988
|
});
|
|
39916
39989
|
function handleClick(e) {
|
|
39917
39990
|
const newTheme = theme === "light" ? "dark" : "light";
|
|
39918
|
-
if (isLocal) {
|
|
39919
|
-
const element =
|
|
39991
|
+
if (isLocal && target) {
|
|
39992
|
+
const element = getElement(target);
|
|
39920
39993
|
if (element) {
|
|
39921
39994
|
applyTheme2(element, newTheme);
|
|
39922
39995
|
setLocalTheme(newTheme);
|
package/package.json
CHANGED
package/styles.css
CHANGED
|
@@ -68,6 +68,8 @@
|
|
|
68
68
|
|
|
69
69
|
[data-theme="dark"],
|
|
70
70
|
.dark {
|
|
71
|
+
color-scheme: dark;
|
|
72
|
+
|
|
71
73
|
/* === SURFACES === */
|
|
72
74
|
--surface-base: oklch(0.205 0 0); /* neutral-900 */
|
|
73
75
|
--surface-raised: oklch(0.269 0 0); /* neutral-800 */
|
|
@@ -119,6 +121,65 @@
|
|
|
119
121
|
--status-error-text: oklch(0.936 0.032 17.717); /* red-100 */
|
|
120
122
|
}
|
|
121
123
|
|
|
124
|
+
/* Light theme - for overriding dark parent (must come after dark) */
|
|
125
|
+
[data-theme="light"] {
|
|
126
|
+
color-scheme: light;
|
|
127
|
+
|
|
128
|
+
/* === SURFACES (backgrounds) === */
|
|
129
|
+
--surface-base: #ffffff;
|
|
130
|
+
--surface-raised: oklch(0.985 0 0); /* neutral-50 */
|
|
131
|
+
--surface-sunken: oklch(0.97 0 0); /* neutral-100 */
|
|
132
|
+
--surface-overlay: #ffffff;
|
|
133
|
+
--surface-inverted: oklch(0.205 0 0); /* neutral-900 */
|
|
134
|
+
--surface-disabled: oklch(0.985 0 0); /* neutral-50 */
|
|
135
|
+
|
|
136
|
+
/* === TEXT === */
|
|
137
|
+
--text-primary: oklch(0.205 0 0); /* neutral-900 */
|
|
138
|
+
--text-secondary: oklch(0.439 0 0); /* neutral-600 */
|
|
139
|
+
--text-muted: oklch(0.556 0 0); /* neutral-500 */
|
|
140
|
+
--text-disabled: oklch(0.708 0 0); /* neutral-400 */
|
|
141
|
+
--text-inverted: oklch(0.985 0 0); /* neutral-50 */
|
|
142
|
+
--text-on-primary: #ffffff;
|
|
143
|
+
|
|
144
|
+
/* === BORDERS === */
|
|
145
|
+
--border-default: oklch(0.87 0 0); /* neutral-300 */
|
|
146
|
+
--border-muted: oklch(0.922 0 0); /* neutral-200 */
|
|
147
|
+
--border-strong: oklch(0.708 0 0); /* neutral-400 */
|
|
148
|
+
--border-inverted: oklch(0.205 0 0); /* neutral-900 */
|
|
149
|
+
|
|
150
|
+
/* === INTERACTIVE STATES === */
|
|
151
|
+
--interactive-bg: oklch(0.97 0 0); /* neutral-100 */
|
|
152
|
+
--interactive-bg-hover: oklch(0.922 0 0); /* neutral-200 */
|
|
153
|
+
--interactive-bg-pressed: oklch(0.87 0 0); /* neutral-300 */
|
|
154
|
+
--interactive-bg-selected: oklch(0.205 0 0); /* neutral-900 */
|
|
155
|
+
--interactive-text-selected: #ffffff;
|
|
156
|
+
|
|
157
|
+
/* === FOCUS === */
|
|
158
|
+
--focus-ring: oklch(0.708 0 0); /* neutral-400 */
|
|
159
|
+
--focus-ring-offset: #ffffff;
|
|
160
|
+
|
|
161
|
+
/* === TRACKS (sliders, progress) === */
|
|
162
|
+
--track-bg: oklch(0.922 0 0); /* neutral-200 */
|
|
163
|
+
--track-fill: oklch(0.205 0 0); /* neutral-900 */
|
|
164
|
+
|
|
165
|
+
/* === STATUS COLORS === */
|
|
166
|
+
--status-info: oklch(0.623 0.214 259.815); /* blue-500 */
|
|
167
|
+
--status-info-bg: oklch(0.97 0.014 254.604); /* blue-50 */
|
|
168
|
+
--status-info-text: oklch(0.379 0.146 265.522); /* blue-900 */
|
|
169
|
+
|
|
170
|
+
--status-success: oklch(0.723 0.219 149.579); /* green-500 */
|
|
171
|
+
--status-success-bg: oklch(0.982 0.018 155.826); /* green-50 */
|
|
172
|
+
--status-success-text: oklch(0.393 0.095 152.535); /* green-900 */
|
|
173
|
+
|
|
174
|
+
--status-warning: oklch(0.795 0.184 86.047); /* yellow-500 */
|
|
175
|
+
--status-warning-bg: oklch(0.987 0.026 102.212); /* yellow-50 */
|
|
176
|
+
--status-warning-text: oklch(0.421 0.095 57.708); /* yellow-900 */
|
|
177
|
+
|
|
178
|
+
--status-error: oklch(0.637 0.237 25.331); /* red-500 */
|
|
179
|
+
--status-error-bg: oklch(0.971 0.013 17.38); /* red-50 */
|
|
180
|
+
--status-error-text: oklch(0.396 0.141 25.723); /* red-900 */
|
|
181
|
+
}
|
|
182
|
+
|
|
122
183
|
|
|
123
184
|
/* ./src/components/Dots.css */
|
|
124
185
|
.zen-dot {
|