@umami/react-zen 0.181.0 → 0.183.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 +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +168 -145
- package/dist/index.mjs +81 -58
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,19 +34,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
// node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
|
|
35
35
|
var require_use_sync_external_store_shim_production = __commonJS({
|
|
36
36
|
"node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports) {
|
|
37
|
-
var
|
|
38
|
-
var React5 =
|
|
37
|
+
var import_react198 = __toESM(require("react"));
|
|
38
|
+
var React5 = import_react198.default;
|
|
39
39
|
function is2(x, y) {
|
|
40
40
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
41
41
|
}
|
|
42
42
|
var objectIs = "function" === typeof Object.is ? Object.is : is2;
|
|
43
43
|
var useState19 = React5.useState;
|
|
44
|
-
var
|
|
45
|
-
var
|
|
44
|
+
var useEffect12 = React5.useEffect;
|
|
45
|
+
var useLayoutEffect3 = React5.useLayoutEffect;
|
|
46
46
|
var useDebugValue = React5.useDebugValue;
|
|
47
47
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
48
48
|
var value = getSnapshot(), _useState = useState19({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
49
|
-
|
|
49
|
+
useLayoutEffect3(
|
|
50
50
|
function() {
|
|
51
51
|
inst.value = value;
|
|
52
52
|
inst.getSnapshot = 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
|
+
useEffect12(
|
|
58
58
|
function() {
|
|
59
59
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
60
60
|
return subscribe(function() {
|
|
@@ -87,7 +87,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
87
87
|
// node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
|
|
88
88
|
var require_use_sync_external_store_shim_development = __commonJS({
|
|
89
89
|
"node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
|
|
90
|
-
var
|
|
90
|
+
var import_react198 = __toESM(require("react"));
|
|
91
91
|
(function() {
|
|
92
92
|
function is2(x, y) {
|
|
93
93
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
@@ -107,7 +107,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
107
107
|
inst: { value, getSnapshot }
|
|
108
108
|
});
|
|
109
109
|
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
110
|
-
|
|
110
|
+
useLayoutEffect3(
|
|
111
111
|
function() {
|
|
112
112
|
inst.value = value;
|
|
113
113
|
inst.getSnapshot = getSnapshot;
|
|
@@ -115,7 +115,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
115
115
|
},
|
|
116
116
|
[subscribe, value, getSnapshot]
|
|
117
117
|
);
|
|
118
|
-
|
|
118
|
+
useEffect12(
|
|
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 =
|
|
144
|
+
var React5 = import_react198.default, objectIs = "function" === typeof Object.is ? Object.is : is2, useState19 = React5.useState, useEffect12 = 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
|
})();
|
|
@@ -1933,8 +1933,8 @@ function $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, context) {
|
|
|
1933
1933
|
mergedRef
|
|
1934
1934
|
];
|
|
1935
1935
|
}
|
|
1936
|
-
function $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(
|
|
1937
|
-
let [hasSlot, setHasSlot] = (0, import_react23.useState)(
|
|
1936
|
+
function $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(initialState2 = true) {
|
|
1937
|
+
let [hasSlot, setHasSlot] = (0, import_react23.useState)(initialState2);
|
|
1938
1938
|
let hasRun = (0, import_react23.useRef)(false);
|
|
1939
1939
|
let ref = (0, import_react23.useCallback)((el) => {
|
|
1940
1940
|
hasRun.current = true;
|
|
@@ -28526,9 +28526,16 @@ function FormController({ children, ...props }) {
|
|
|
28526
28526
|
}
|
|
28527
28527
|
|
|
28528
28528
|
// src/components/forms/FormField.tsx
|
|
28529
|
-
var
|
|
28529
|
+
var import_react161 = require("react");
|
|
28530
28530
|
var import_classnames7 = __toESM(require_classnames());
|
|
28531
28531
|
|
|
28532
|
+
// src/components/hooks/useFieldId.ts
|
|
28533
|
+
var import_react160 = require("react");
|
|
28534
|
+
function useFieldId(id) {
|
|
28535
|
+
const generatedId = (0, import_react160.useId)();
|
|
28536
|
+
return id ?? generatedId;
|
|
28537
|
+
}
|
|
28538
|
+
|
|
28532
28539
|
// css-modules:E:\dev\umami-react-zen\src\components\forms\FormField.module.css
|
|
28533
28540
|
var FormField_default = { "field": "FormField_field__YTM1N", "description": "FormField_description__ZjFiM", "error": "FormField_error__NWZhM" };
|
|
28534
28541
|
|
|
@@ -28556,21 +28563,20 @@ function FormField({
|
|
|
28556
28563
|
children,
|
|
28557
28564
|
...props
|
|
28558
28565
|
}) {
|
|
28559
|
-
const
|
|
28566
|
+
const fieldId = useFieldId(id);
|
|
28560
28567
|
const context = useFormContext();
|
|
28561
28568
|
const { control } = context;
|
|
28562
28569
|
const { invalid, error } = context.getFieldState(name);
|
|
28563
|
-
|
|
28564
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { ...props, id, className: (0, import_classnames7.default)(FormField_default.input, className), children: [
|
|
28570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { ...props, className: (0, import_classnames7.default)(FormField_default.input, className), children: [
|
|
28565
28571
|
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Label2, { htmlFor: fieldId, children: label }),
|
|
28566
28572
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormController, { name, control, rules, children: ({ field }) => {
|
|
28567
|
-
return
|
|
28573
|
+
return import_react161.Children.map(
|
|
28568
28574
|
typeof children === "function" ? children({ context, field }) : children,
|
|
28569
28575
|
(child) => {
|
|
28570
28576
|
if (!child) {
|
|
28571
28577
|
return null;
|
|
28572
28578
|
}
|
|
28573
|
-
return (0,
|
|
28579
|
+
return (0, import_react161.cloneElement)(child, { ...field, id: fieldId });
|
|
28574
28580
|
}
|
|
28575
28581
|
);
|
|
28576
28582
|
} }),
|
|
@@ -28929,7 +28935,6 @@ function eachSafely(values, each2) {
|
|
|
28929
28935
|
}
|
|
28930
28936
|
|
|
28931
28937
|
// node_modules/.pnpm/@react-spring+shared@9.7.5_react@19.1.1/node_modules/@react-spring/shared/dist/react-spring_shared.modern.mjs
|
|
28932
|
-
var import_react161 = require("react");
|
|
28933
28938
|
var import_react162 = require("react");
|
|
28934
28939
|
var import_react163 = require("react");
|
|
28935
28940
|
var import_react164 = require("react");
|
|
@@ -28937,6 +28942,7 @@ var import_react165 = require("react");
|
|
|
28937
28942
|
var import_react166 = require("react");
|
|
28938
28943
|
var import_react167 = require("react");
|
|
28939
28944
|
var import_react168 = require("react");
|
|
28945
|
+
var import_react169 = require("react");
|
|
28940
28946
|
var __defProp2 = Object.defineProperty;
|
|
28941
28947
|
var __export2 = (target, all) => {
|
|
28942
28948
|
for (var name in all)
|
|
@@ -29696,9 +29702,9 @@ function isAnimatedString(value) {
|
|
|
29696
29702
|
return is.str(value) && (value[0] == "#" || /\d/.test(value) || // Do not identify a CSS variable as an AnimatedString if its SSR
|
|
29697
29703
|
!isSSR() && cssVariableRegex.test(value) || value in (colors || {}));
|
|
29698
29704
|
}
|
|
29699
|
-
var useIsomorphicLayoutEffect2 = isSSR() ?
|
|
29705
|
+
var useIsomorphicLayoutEffect2 = isSSR() ? import_react165.useEffect : import_react165.useLayoutEffect;
|
|
29700
29706
|
var useIsMounted = () => {
|
|
29701
|
-
const isMounted = (0,
|
|
29707
|
+
const isMounted = (0, import_react164.useRef)(false);
|
|
29702
29708
|
useIsomorphicLayoutEffect2(() => {
|
|
29703
29709
|
isMounted.current = true;
|
|
29704
29710
|
return () => {
|
|
@@ -29708,7 +29714,7 @@ var useIsMounted = () => {
|
|
|
29708
29714
|
return isMounted;
|
|
29709
29715
|
};
|
|
29710
29716
|
function useForceUpdate() {
|
|
29711
|
-
const update3 = (0,
|
|
29717
|
+
const update3 = (0, import_react163.useState)()[1];
|
|
29712
29718
|
const isMounted = useIsMounted();
|
|
29713
29719
|
return () => {
|
|
29714
29720
|
if (isMounted.current) {
|
|
@@ -29717,13 +29723,13 @@ function useForceUpdate() {
|
|
|
29717
29723
|
};
|
|
29718
29724
|
}
|
|
29719
29725
|
function useMemoOne(getResult, inputs) {
|
|
29720
|
-
const [initial] = (0,
|
|
29726
|
+
const [initial] = (0, import_react166.useState)(
|
|
29721
29727
|
() => ({
|
|
29722
29728
|
inputs,
|
|
29723
29729
|
result: getResult()
|
|
29724
29730
|
})
|
|
29725
29731
|
);
|
|
29726
|
-
const committed = (0,
|
|
29732
|
+
const committed = (0, import_react166.useRef)();
|
|
29727
29733
|
const prevCache = committed.current;
|
|
29728
29734
|
let cache = prevCache;
|
|
29729
29735
|
if (cache) {
|
|
@@ -29739,7 +29745,7 @@ function useMemoOne(getResult, inputs) {
|
|
|
29739
29745
|
} else {
|
|
29740
29746
|
cache = initial;
|
|
29741
29747
|
}
|
|
29742
|
-
(0,
|
|
29748
|
+
(0, import_react166.useEffect)(() => {
|
|
29743
29749
|
committed.current = cache;
|
|
29744
29750
|
if (prevCache == initial) {
|
|
29745
29751
|
initial.inputs = initial.result = void 0;
|
|
@@ -29758,22 +29764,22 @@ function areInputsEqual(next, prev) {
|
|
|
29758
29764
|
}
|
|
29759
29765
|
return true;
|
|
29760
29766
|
}
|
|
29761
|
-
var useOnce = (effect) => (0,
|
|
29767
|
+
var useOnce = (effect) => (0, import_react167.useEffect)(effect, emptyDeps);
|
|
29762
29768
|
var emptyDeps = [];
|
|
29763
29769
|
function usePrev(value) {
|
|
29764
|
-
const prevRef = (0,
|
|
29765
|
-
(0,
|
|
29770
|
+
const prevRef = (0, import_react168.useRef)();
|
|
29771
|
+
(0, import_react168.useEffect)(() => {
|
|
29766
29772
|
prevRef.current = value;
|
|
29767
29773
|
});
|
|
29768
29774
|
return prevRef.current;
|
|
29769
29775
|
}
|
|
29770
29776
|
|
|
29771
29777
|
// node_modules/.pnpm/@react-spring+core@9.7.5_react@19.1.1/node_modules/@react-spring/core/dist/react-spring_core.modern.mjs
|
|
29772
|
-
var
|
|
29778
|
+
var import_react171 = require("react");
|
|
29773
29779
|
|
|
29774
29780
|
// node_modules/.pnpm/@react-spring+animated@9.7.5_react@19.1.1/node_modules/@react-spring/animated/dist/react-spring_animated.modern.mjs
|
|
29775
29781
|
var React2 = __toESM(require("react"), 1);
|
|
29776
|
-
var
|
|
29782
|
+
var import_react170 = require("react");
|
|
29777
29783
|
var $node = Symbol.for("Animated:node");
|
|
29778
29784
|
var isAnimated = (value) => !!value && value[$node] === value;
|
|
29779
29785
|
var getAnimated = (owner) => owner && owner[$node];
|
|
@@ -29960,10 +29966,10 @@ var withAnimated = (Component, host2) => {
|
|
|
29960
29966
|
// re-rendered on every animation frame.
|
|
29961
29967
|
!is.fun(Component) || Component.prototype && Component.prototype.isReactComponent
|
|
29962
29968
|
);
|
|
29963
|
-
return (0,
|
|
29964
|
-
const instanceRef = (0,
|
|
29969
|
+
return (0, import_react170.forwardRef)((givenProps, givenRef) => {
|
|
29970
|
+
const instanceRef = (0, import_react170.useRef)(null);
|
|
29965
29971
|
const ref = hasInstance && // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
29966
|
-
(0,
|
|
29972
|
+
(0, import_react170.useCallback)(
|
|
29967
29973
|
(value) => {
|
|
29968
29974
|
instanceRef.current = updateRef(givenRef, value);
|
|
29969
29975
|
},
|
|
@@ -29982,7 +29988,7 @@ var withAnimated = (Component, host2) => {
|
|
|
29982
29988
|
}
|
|
29983
29989
|
};
|
|
29984
29990
|
const observer = new PropsObserver(callback, deps);
|
|
29985
|
-
const observerRef = (0,
|
|
29991
|
+
const observerRef = (0, import_react170.useRef)();
|
|
29986
29992
|
useIsomorphicLayoutEffect2(() => {
|
|
29987
29993
|
observerRef.current = observer;
|
|
29988
29994
|
each(deps, (dep) => addFluidObserver(dep, observer));
|
|
@@ -29996,7 +30002,7 @@ var withAnimated = (Component, host2) => {
|
|
|
29996
30002
|
}
|
|
29997
30003
|
};
|
|
29998
30004
|
});
|
|
29999
|
-
(0,
|
|
30005
|
+
(0, import_react170.useEffect)(callback, []);
|
|
30000
30006
|
useOnce(() => () => {
|
|
30001
30007
|
const observer2 = observerRef.current;
|
|
30002
30008
|
each(observer2.deps, (dep) => removeFluidObserver(dep, observer2));
|
|
@@ -30072,11 +30078,11 @@ var getDisplayName = (arg) => is.str(arg) ? arg : arg && is.str(arg.displayName)
|
|
|
30072
30078
|
|
|
30073
30079
|
// node_modules/.pnpm/@react-spring+core@9.7.5_react@19.1.1/node_modules/@react-spring/core/dist/react-spring_core.modern.mjs
|
|
30074
30080
|
var React3 = __toESM(require("react"), 1);
|
|
30075
|
-
var import_react171 = require("react");
|
|
30076
30081
|
var import_react172 = require("react");
|
|
30077
|
-
var React22 = __toESM(require("react"), 1);
|
|
30078
30082
|
var import_react173 = require("react");
|
|
30083
|
+
var React22 = __toESM(require("react"), 1);
|
|
30079
30084
|
var import_react174 = require("react");
|
|
30085
|
+
var import_react175 = require("react");
|
|
30080
30086
|
function callProp(value, ...args) {
|
|
30081
30087
|
return is.fun(value) ? value(...args) : value;
|
|
30082
30088
|
}
|
|
@@ -31535,7 +31541,7 @@ var SpringContext = ({
|
|
|
31535
31541
|
children,
|
|
31536
31542
|
...props
|
|
31537
31543
|
}) => {
|
|
31538
|
-
const inherited = (0,
|
|
31544
|
+
const inherited = (0, import_react172.useContext)(ctx);
|
|
31539
31545
|
const pause = props.pause || !!inherited.pause, immediate = props.immediate || !!inherited.immediate;
|
|
31540
31546
|
props = useMemoOne(() => ({ pause, immediate }), [pause, immediate]);
|
|
31541
31547
|
const { Provider } = ctx;
|
|
@@ -31634,13 +31640,13 @@ function useTransition(data, props, deps) {
|
|
|
31634
31640
|
ref: propsRef,
|
|
31635
31641
|
config: propsConfig
|
|
31636
31642
|
} = propsFn ? propsFn() : props;
|
|
31637
|
-
const ref = (0,
|
|
31643
|
+
const ref = (0, import_react174.useMemo)(
|
|
31638
31644
|
() => propsFn || arguments.length == 3 ? SpringRef() : void 0,
|
|
31639
31645
|
[]
|
|
31640
31646
|
);
|
|
31641
31647
|
const items = toArray(data);
|
|
31642
31648
|
const transitions = [];
|
|
31643
|
-
const usedTransitions = (0,
|
|
31649
|
+
const usedTransitions = (0, import_react174.useRef)(null);
|
|
31644
31650
|
const prevTransitions = reset ? null : usedTransitions.current;
|
|
31645
31651
|
useIsomorphicLayoutEffect2(() => {
|
|
31646
31652
|
usedTransitions.current = transitions;
|
|
@@ -31711,8 +31717,8 @@ function useTransition(data, props, deps) {
|
|
|
31711
31717
|
const forceUpdate = useForceUpdate();
|
|
31712
31718
|
const defaultProps = getDefaultProps(props);
|
|
31713
31719
|
const changes = /* @__PURE__ */ new Map();
|
|
31714
|
-
const exitingTransitions = (0,
|
|
31715
|
-
const forceChange = (0,
|
|
31720
|
+
const exitingTransitions = (0, import_react174.useRef)(/* @__PURE__ */ new Map());
|
|
31721
|
+
const forceChange = (0, import_react174.useRef)(false);
|
|
31716
31722
|
each(transitions, (t, i) => {
|
|
31717
31723
|
const key = t.key;
|
|
31718
31724
|
const prevPhase = t.phase;
|
|
@@ -31802,7 +31808,7 @@ function useTransition(data, props, deps) {
|
|
|
31802
31808
|
changes.set(t, { phase, springs, payload });
|
|
31803
31809
|
}
|
|
31804
31810
|
});
|
|
31805
|
-
const context = (0,
|
|
31811
|
+
const context = (0, import_react174.useContext)(SpringContext);
|
|
31806
31812
|
const prevContext = usePrev(context);
|
|
31807
31813
|
const hasContext = context !== prevContext && hasProps(context);
|
|
31808
31814
|
useIsomorphicLayoutEffect2(() => {
|
|
@@ -32345,7 +32351,7 @@ var animated = host.animated;
|
|
|
32345
32351
|
|
|
32346
32352
|
// src/components/toast/Toaster.tsx
|
|
32347
32353
|
var import_classnames12 = __toESM(require_classnames());
|
|
32348
|
-
var
|
|
32354
|
+
var import_react179 = require("react");
|
|
32349
32355
|
|
|
32350
32356
|
// node_modules/.pnpm/zustand@5.0.8_@types+react@_2ab3c21ca4e7c2d11079300200c15eca/node_modules/zustand/esm/vanilla.mjs
|
|
32351
32357
|
var createStoreImpl = (createState) => {
|
|
@@ -32360,27 +32366,27 @@ var createStoreImpl = (createState) => {
|
|
|
32360
32366
|
}
|
|
32361
32367
|
};
|
|
32362
32368
|
const getState = () => state;
|
|
32363
|
-
const getInitialState = () =>
|
|
32369
|
+
const getInitialState = () => initialState2;
|
|
32364
32370
|
const subscribe = (listener) => {
|
|
32365
32371
|
listeners.add(listener);
|
|
32366
32372
|
return () => listeners.delete(listener);
|
|
32367
32373
|
};
|
|
32368
32374
|
const api = { setState, getState, getInitialState, subscribe };
|
|
32369
|
-
const
|
|
32375
|
+
const initialState2 = state = createState(setState, getState, api);
|
|
32370
32376
|
return api;
|
|
32371
32377
|
};
|
|
32372
32378
|
var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
|
|
32373
32379
|
|
|
32374
32380
|
// node_modules/.pnpm/zustand@5.0.8_@types+react@_2ab3c21ca4e7c2d11079300200c15eca/node_modules/zustand/esm/react.mjs
|
|
32375
|
-
var
|
|
32381
|
+
var import_react176 = __toESM(require("react"), 1);
|
|
32376
32382
|
var identity = (arg) => arg;
|
|
32377
32383
|
function useStore(api, selector = identity) {
|
|
32378
|
-
const slice =
|
|
32384
|
+
const slice = import_react176.default.useSyncExternalStore(
|
|
32379
32385
|
api.subscribe,
|
|
32380
|
-
|
|
32381
|
-
|
|
32386
|
+
import_react176.default.useCallback(() => selector(api.getState()), [api, selector]),
|
|
32387
|
+
import_react176.default.useCallback(() => selector(api.getInitialState()), [api, selector])
|
|
32382
32388
|
);
|
|
32383
|
-
|
|
32389
|
+
import_react176.default.useDebugValue(slice);
|
|
32384
32390
|
return slice;
|
|
32385
32391
|
}
|
|
32386
32392
|
var createImpl = (createState) => {
|
|
@@ -32392,12 +32398,12 @@ var createImpl = (createState) => {
|
|
|
32392
32398
|
var create = ((createState) => createState ? createImpl(createState) : createImpl);
|
|
32393
32399
|
|
|
32394
32400
|
// src/components/hooks/useToast.ts
|
|
32395
|
-
var
|
|
32401
|
+
var import_react178 = require("react");
|
|
32396
32402
|
|
|
32397
32403
|
// src/components/toast/ToastProvider.tsx
|
|
32398
|
-
var
|
|
32404
|
+
var import_react177 = require("react");
|
|
32399
32405
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
32400
|
-
var ToastContext = (0,
|
|
32406
|
+
var ToastContext = (0, import_react177.createContext)({});
|
|
32401
32407
|
function ToastProvider({ children, ...props }) {
|
|
32402
32408
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(ToastContext.Provider, { value: props, children: [
|
|
32403
32409
|
children,
|
|
@@ -32428,7 +32434,7 @@ function displayToast(message, { duration = TOAST_DURATION, ...options } = {}) {
|
|
|
32428
32434
|
}
|
|
32429
32435
|
function useToast() {
|
|
32430
32436
|
const { toasts } = store();
|
|
32431
|
-
const config2 = (0,
|
|
32437
|
+
const config2 = (0, import_react178.useContext)(ToastContext);
|
|
32432
32438
|
const toast = (message, options) => {
|
|
32433
32439
|
displayToast(message, { ...options, ...config2 });
|
|
32434
32440
|
};
|
|
@@ -32442,7 +32448,7 @@ var Toaster_default = { "toaster": "Toaster_toaster__OGJjM", "position-top": "To
|
|
|
32442
32448
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
32443
32449
|
function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
32444
32450
|
const { toasts } = useToast();
|
|
32445
|
-
const [hovered, setHovered] = (0,
|
|
32451
|
+
const [hovered, setHovered] = (0, import_react179.useState)(false);
|
|
32446
32452
|
const transitions = useTransition(toasts, {
|
|
32447
32453
|
from: {
|
|
32448
32454
|
opacity: 0,
|
|
@@ -32455,7 +32461,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
32455
32461
|
},
|
|
32456
32462
|
config: { duration: 100 }
|
|
32457
32463
|
});
|
|
32458
|
-
(0,
|
|
32464
|
+
(0, import_react179.useEffect)(() => {
|
|
32459
32465
|
if (duration) {
|
|
32460
32466
|
const timeout = setInterval(() => {
|
|
32461
32467
|
if (hovered || !toasts.length) return;
|
|
@@ -32489,10 +32495,10 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
32489
32495
|
}
|
|
32490
32496
|
|
|
32491
32497
|
// src/components/hooks/useDebounce.ts
|
|
32492
|
-
var
|
|
32498
|
+
var import_react180 = require("react");
|
|
32493
32499
|
function useDebounce(value, delay) {
|
|
32494
|
-
const [debouncedValue, setValue] = (0,
|
|
32495
|
-
(0,
|
|
32500
|
+
const [debouncedValue, setValue] = (0, import_react180.useState)(value);
|
|
32501
|
+
(0, import_react180.useEffect)(() => {
|
|
32496
32502
|
const timer = setTimeout(() => {
|
|
32497
32503
|
setValue(value);
|
|
32498
32504
|
}, delay);
|
|
@@ -32504,30 +32510,45 @@ function useDebounce(value, delay) {
|
|
|
32504
32510
|
}
|
|
32505
32511
|
|
|
32506
32512
|
// src/components/hooks/useTheme.ts
|
|
32507
|
-
var
|
|
32508
|
-
function
|
|
32509
|
-
|
|
32510
|
-
|
|
32511
|
-
|
|
32512
|
-
|
|
32513
|
-
|
|
32514
|
-
|
|
32515
|
-
|
|
32516
|
-
|
|
32517
|
-
|
|
32513
|
+
var import_react181 = require("react");
|
|
32514
|
+
function resolveTheme(preferred, colorScheme) {
|
|
32515
|
+
if (preferred) {
|
|
32516
|
+
return preferred;
|
|
32517
|
+
}
|
|
32518
|
+
if (colorScheme === "light" || colorScheme === "dark") {
|
|
32519
|
+
return colorScheme;
|
|
32520
|
+
}
|
|
32521
|
+
if (typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
32522
|
+
return "dark";
|
|
32523
|
+
}
|
|
32524
|
+
return "light";
|
|
32518
32525
|
}
|
|
32519
|
-
|
|
32520
|
-
|
|
32521
|
-
|
|
32522
|
-
|
|
32523
|
-
|
|
32526
|
+
var useTheme = create((set2, get2) => ({
|
|
32527
|
+
theme: "light",
|
|
32528
|
+
setTheme: (theme) => {
|
|
32529
|
+
set2({ theme });
|
|
32530
|
+
if (typeof window !== "undefined") {
|
|
32531
|
+
localStorage.setItem("zen.theme", theme);
|
|
32532
|
+
document.documentElement.setAttribute("data-theme", theme);
|
|
32524
32533
|
}
|
|
32525
|
-
},
|
|
32526
|
-
|
|
32534
|
+
},
|
|
32535
|
+
initTheme: (preferred, colorScheme) => {
|
|
32536
|
+
if (typeof window === "undefined") return;
|
|
32537
|
+
const stored = localStorage.getItem("zen.theme");
|
|
32538
|
+
const initial = resolveTheme(preferred || stored || void 0, colorScheme);
|
|
32539
|
+
set2({ theme: initial });
|
|
32540
|
+
document.documentElement.setAttribute("data-theme", initial);
|
|
32541
|
+
}
|
|
32542
|
+
}));
|
|
32543
|
+
function useInitTheme(preferred, colorScheme) {
|
|
32544
|
+
const initTheme = useTheme((s) => s.initTheme);
|
|
32545
|
+
(0, import_react181.useLayoutEffect)(() => {
|
|
32546
|
+
initTheme(preferred, colorScheme);
|
|
32547
|
+
}, [preferred, colorScheme, initTheme]);
|
|
32527
32548
|
}
|
|
32528
32549
|
|
|
32529
32550
|
// src/components/Accordion.tsx
|
|
32530
|
-
var
|
|
32551
|
+
var import_react182 = require("react");
|
|
32531
32552
|
var import_classnames14 = __toESM(require_classnames());
|
|
32532
32553
|
|
|
32533
32554
|
// src/components/Text.tsx
|
|
@@ -32601,7 +32622,7 @@ function AccordionItem({
|
|
|
32601
32622
|
...props
|
|
32602
32623
|
}) {
|
|
32603
32624
|
const [trigger, panel] = children;
|
|
32604
|
-
const [expanded, setExpanded] = (0,
|
|
32625
|
+
const [expanded, setExpanded] = (0, import_react182.useState)(defaultExpanded);
|
|
32605
32626
|
const handleExpandedChange = (isExpanded) => {
|
|
32606
32627
|
requestAnimationFrame(() => setExpanded(isExpanded));
|
|
32607
32628
|
};
|
|
@@ -32812,7 +32833,7 @@ function Checkbox2({ label, className, children, ...props }) {
|
|
|
32812
32833
|
var import_classnames22 = __toESM(require_classnames());
|
|
32813
32834
|
|
|
32814
32835
|
// src/components/List.tsx
|
|
32815
|
-
var
|
|
32836
|
+
var import_react183 = require("react");
|
|
32816
32837
|
var import_classnames20 = __toESM(require_classnames());
|
|
32817
32838
|
|
|
32818
32839
|
// src/lib/constants.ts
|
|
@@ -32862,7 +32883,8 @@ var List_default = { "list": "List_list__ZTRlN", "separator": "List_separator__O
|
|
|
32862
32883
|
// src/components/List.tsx
|
|
32863
32884
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
32864
32885
|
function List({
|
|
32865
|
-
|
|
32886
|
+
id,
|
|
32887
|
+
items = [],
|
|
32866
32888
|
idProperty = "id",
|
|
32867
32889
|
labelProperty = "label",
|
|
32868
32890
|
separatorProperty = "separatpr",
|
|
@@ -32885,11 +32907,13 @@ function List({
|
|
|
32885
32907
|
onChange?.([...keys].map(String));
|
|
32886
32908
|
}
|
|
32887
32909
|
};
|
|
32910
|
+
const fieldId = useFieldId(id);
|
|
32888
32911
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
32889
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Label2, { children: label }),
|
|
32912
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Label2, { htmlFor: fieldId, children: label }),
|
|
32890
32913
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
32891
32914
|
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
32892
32915
|
{
|
|
32916
|
+
id: fieldId,
|
|
32893
32917
|
"aria-label": "list",
|
|
32894
32918
|
...props,
|
|
32895
32919
|
selectedKeys: value || selectedKeys,
|
|
@@ -32899,12 +32923,12 @@ function List({
|
|
|
32899
32923
|
onSelectionChange: handleSelectionChange,
|
|
32900
32924
|
style: { ...style, ...getHighlightColor(highlightColor) },
|
|
32901
32925
|
children: children || items?.map((item) => {
|
|
32902
|
-
const
|
|
32926
|
+
const id2 = item[idProperty] || item.toString();
|
|
32903
32927
|
const label2 = item[labelProperty] || item.toString();
|
|
32904
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
32928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react183.Fragment, { children: [
|
|
32905
32929
|
item[separatorProperty] && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)($431f98aba6844401$export$1ff3c3f08ae963c0, { className: List_default.separator }),
|
|
32906
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ListItem, { id, className: List_default.item, children: label2 })
|
|
32907
|
-
] },
|
|
32930
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ListItem, { id: id2, className: List_default.item, children: label2 })
|
|
32931
|
+
] }, id2);
|
|
32908
32932
|
})
|
|
32909
32933
|
}
|
|
32910
32934
|
)
|
|
@@ -33021,15 +33045,15 @@ function Code({ asChild, children }) {
|
|
|
33021
33045
|
}
|
|
33022
33046
|
|
|
33023
33047
|
// src/components/ConfirmationDialog.tsx
|
|
33024
|
-
var
|
|
33048
|
+
var import_react186 = require("react");
|
|
33025
33049
|
var import_classnames25 = __toESM(require_classnames());
|
|
33026
33050
|
|
|
33027
33051
|
// src/components/TextField.tsx
|
|
33028
|
-
var
|
|
33052
|
+
var import_react185 = require("react");
|
|
33029
33053
|
var import_classnames24 = __toESM(require_classnames());
|
|
33030
33054
|
|
|
33031
33055
|
// src/components/CopyButton.tsx
|
|
33032
|
-
var
|
|
33056
|
+
var import_react184 = require("react");
|
|
33033
33057
|
var import_classnames23 = __toESM(require_classnames());
|
|
33034
33058
|
|
|
33035
33059
|
// css-modules:E:\dev\umami-react-zen\src\components\CopyButton.module.css
|
|
@@ -33039,8 +33063,8 @@ var CopyButton_default = { "icon": "CopyButton_icon__YTM2Y", "copy-button": "Cop
|
|
|
33039
33063
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
33040
33064
|
var TIMEOUT = 2e3;
|
|
33041
33065
|
function CopyButton({ value, timeout = TIMEOUT, className, children, ...props }) {
|
|
33042
|
-
const [copied, setCopied] = (0,
|
|
33043
|
-
const ref = (0,
|
|
33066
|
+
const [copied, setCopied] = (0, import_react184.useState)(false);
|
|
33067
|
+
const ref = (0, import_react184.useRef)(timeout);
|
|
33044
33068
|
const handleCopy = async () => {
|
|
33045
33069
|
if (value) {
|
|
33046
33070
|
await navigator.clipboard.writeText(value);
|
|
@@ -33072,13 +33096,13 @@ function TextField2({
|
|
|
33072
33096
|
children,
|
|
33073
33097
|
...props
|
|
33074
33098
|
}) {
|
|
33075
|
-
const [inputValue, setInputValue] = (0,
|
|
33099
|
+
const [inputValue, setInputValue] = (0, import_react185.useState)(defaultValue || value);
|
|
33076
33100
|
const Component = asTextArea ? $216918bed6669f72$export$f5c9f3c2c4054eec : $3985021b0ad6602f$export$f5b8910cec6cf069;
|
|
33077
33101
|
const handleChange = (value2) => {
|
|
33078
33102
|
setInputValue(value2);
|
|
33079
33103
|
return onChange?.(value2);
|
|
33080
33104
|
};
|
|
33081
|
-
(0,
|
|
33105
|
+
(0, import_react185.useEffect)(() => {
|
|
33082
33106
|
setInputValue(value);
|
|
33083
33107
|
}, [value]);
|
|
33084
33108
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
@@ -33121,7 +33145,7 @@ function ConfirmationDialog({
|
|
|
33121
33145
|
children,
|
|
33122
33146
|
...props
|
|
33123
33147
|
}) {
|
|
33124
|
-
const [canSave, setCanSave] = (0,
|
|
33148
|
+
const [canSave, setCanSave] = (0, import_react186.useState)(false);
|
|
33125
33149
|
const handleChange = (e) => {
|
|
33126
33150
|
setCanSave(e.target.value === value);
|
|
33127
33151
|
};
|
|
@@ -33178,7 +33202,7 @@ function Container({
|
|
|
33178
33202
|
|
|
33179
33203
|
// src/components/DataTable.tsx
|
|
33180
33204
|
var import_classnames28 = __toESM(require_classnames());
|
|
33181
|
-
var
|
|
33205
|
+
var import_react187 = require("react");
|
|
33182
33206
|
|
|
33183
33207
|
// src/components/Table.tsx
|
|
33184
33208
|
var import_classnames27 = __toESM(require_classnames());
|
|
@@ -33237,11 +33261,11 @@ var DataTable_default = { "datatable": "DataTable_datatable__MWRkN", "cell": "Da
|
|
|
33237
33261
|
|
|
33238
33262
|
// src/components/DataTable.tsx
|
|
33239
33263
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
33240
|
-
var
|
|
33264
|
+
var import_react188 = require("react");
|
|
33241
33265
|
function DataTable({ data = [], className, children, ...props }) {
|
|
33242
33266
|
const items = data.length && data?.[0]?.id === void 0 ? data.map((row, id) => ({ ...row, id })) : data;
|
|
33243
33267
|
const widths = [];
|
|
33244
|
-
const columns =
|
|
33268
|
+
const columns = import_react187.Children.map(children, (child) => {
|
|
33245
33269
|
if (child) {
|
|
33246
33270
|
widths.push(child?.props?.width || "1fr");
|
|
33247
33271
|
return { ...child?.props };
|
|
@@ -33254,7 +33278,7 @@ function DataTable({ data = [], className, children, ...props }) {
|
|
|
33254
33278
|
if (hidden) {
|
|
33255
33279
|
return null;
|
|
33256
33280
|
}
|
|
33257
|
-
return /* @__PURE__ */ (0,
|
|
33281
|
+
return /* @__PURE__ */ (0, import_react188.createElement)(TableColumn, { ...columnProps, key: id, id }, label);
|
|
33258
33282
|
}) }),
|
|
33259
33283
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableBody, { children: items.map((row, index) => {
|
|
33260
33284
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
|
|
@@ -33262,14 +33286,14 @@ function DataTable({ data = [], className, children, ...props }) {
|
|
|
33262
33286
|
return null;
|
|
33263
33287
|
}
|
|
33264
33288
|
const value = typeof children2 === "function" ? children2(row, index) : children2 || row[id];
|
|
33265
|
-
return /* @__PURE__ */ (0,
|
|
33289
|
+
return /* @__PURE__ */ (0, import_react188.createElement)(
|
|
33266
33290
|
TableCell,
|
|
33267
33291
|
{
|
|
33268
33292
|
...cellProps,
|
|
33269
33293
|
key: id,
|
|
33270
33294
|
className: (0, import_classnames28.default)(DataTable_default.cell, className2)
|
|
33271
33295
|
},
|
|
33272
|
-
as ? (0,
|
|
33296
|
+
as ? (0, import_react187.createElement)(as, {}, value) : value
|
|
33273
33297
|
);
|
|
33274
33298
|
}) }, index);
|
|
33275
33299
|
}) })
|
|
@@ -33296,7 +33320,7 @@ function Dots({ size = "md", className, ...props }) {
|
|
|
33296
33320
|
}
|
|
33297
33321
|
|
|
33298
33322
|
// src/components/FloatingTooltip.tsx
|
|
33299
|
-
var
|
|
33323
|
+
var import_react189 = require("react");
|
|
33300
33324
|
var import_classnames31 = __toESM(require_classnames());
|
|
33301
33325
|
|
|
33302
33326
|
// src/components/Tooltip.tsx
|
|
@@ -33323,8 +33347,8 @@ var FloatingTooltip_default = { "floating": "FloatingTooltip_floating__ZjM4N" };
|
|
|
33323
33347
|
// src/components/FloatingTooltip.tsx
|
|
33324
33348
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
33325
33349
|
function FloatingTooltip({ className, style, children, ...props }) {
|
|
33326
|
-
const [position, setPosition] = (0,
|
|
33327
|
-
(0,
|
|
33350
|
+
const [position, setPosition] = (0, import_react189.useState)({ x: -1e3, y: -1e3 });
|
|
33351
|
+
(0, import_react189.useEffect)(() => {
|
|
33328
33352
|
const handler = (e) => {
|
|
33329
33353
|
setPosition({ x: e.clientX, y: e.clientY });
|
|
33330
33354
|
};
|
|
@@ -33380,7 +33404,7 @@ function Heading2({
|
|
|
33380
33404
|
}
|
|
33381
33405
|
|
|
33382
33406
|
// src/components/HoverTrigger.tsx
|
|
33383
|
-
var
|
|
33407
|
+
var import_react190 = require("react");
|
|
33384
33408
|
|
|
33385
33409
|
// css-modules:E:\dev\umami-react-zen\src\components\HoverTrigger.module.css
|
|
33386
33410
|
var HoverTrigger_default = { "wrapper": "HoverTrigger_wrapper__NGFlN" };
|
|
@@ -33396,12 +33420,12 @@ function HoverTrigger({
|
|
|
33396
33420
|
children
|
|
33397
33421
|
}) {
|
|
33398
33422
|
const [triggerElement, popupElement] = children;
|
|
33399
|
-
const triggerRef = (0,
|
|
33400
|
-
const [open, setOpen] = (0,
|
|
33401
|
-
const isOverMenu = (0,
|
|
33402
|
-
const isOverButton = (0,
|
|
33403
|
-
const timeout = (0,
|
|
33404
|
-
(0,
|
|
33423
|
+
const triggerRef = (0, import_react190.useRef)(null);
|
|
33424
|
+
const [open, setOpen] = (0, import_react190.useState)(isOpen);
|
|
33425
|
+
const isOverMenu = (0, import_react190.useRef)(false);
|
|
33426
|
+
const isOverButton = (0, import_react190.useRef)(false);
|
|
33427
|
+
const timeout = (0, import_react190.useRef)(null);
|
|
33428
|
+
(0, import_react190.useEffect)(() => {
|
|
33405
33429
|
if (isOpen !== open) {
|
|
33406
33430
|
setOpen(isOpen);
|
|
33407
33431
|
}
|
|
@@ -33491,7 +33515,7 @@ function Image({
|
|
|
33491
33515
|
}
|
|
33492
33516
|
|
|
33493
33517
|
// src/components/InlineEditField.tsx
|
|
33494
|
-
var
|
|
33518
|
+
var import_react191 = require("react");
|
|
33495
33519
|
var import_classnames34 = __toESM(require_classnames());
|
|
33496
33520
|
|
|
33497
33521
|
// css-modules:E:\dev\umami-react-zen\src\components\InlineEditField.module.css
|
|
@@ -33510,8 +33534,8 @@ function InlineEditField({
|
|
|
33510
33534
|
onCancel,
|
|
33511
33535
|
...props
|
|
33512
33536
|
}) {
|
|
33513
|
-
const [value, setValue] = (0,
|
|
33514
|
-
const [edit, setEdit] = (0,
|
|
33537
|
+
const [value, setValue] = (0, import_react191.useState)(defaultValue);
|
|
33538
|
+
const [edit, setEdit] = (0, import_react191.useState)(defaultEdit);
|
|
33515
33539
|
const handleEdit = () => setEdit(true);
|
|
33516
33540
|
const handleChange = (e) => {
|
|
33517
33541
|
const val = e.target.value;
|
|
@@ -33522,7 +33546,7 @@ function InlineEditField({
|
|
|
33522
33546
|
setEdit(false);
|
|
33523
33547
|
onCommit?.(value);
|
|
33524
33548
|
};
|
|
33525
|
-
const handleCancel = (0,
|
|
33549
|
+
const handleCancel = (0, import_react191.useCallback)(() => {
|
|
33526
33550
|
setEdit(false);
|
|
33527
33551
|
setValue(defaultValue);
|
|
33528
33552
|
onCancel?.();
|
|
@@ -33647,7 +33671,7 @@ function Modal2({
|
|
|
33647
33671
|
}
|
|
33648
33672
|
|
|
33649
33673
|
// src/components/Navbar.tsx
|
|
33650
|
-
var
|
|
33674
|
+
var import_react192 = require("react");
|
|
33651
33675
|
var import_classnames38 = __toESM(require_classnames());
|
|
33652
33676
|
|
|
33653
33677
|
// css-modules:E:\dev\umami-react-zen\src\components\Navbar.module.css
|
|
@@ -33655,16 +33679,16 @@ var Navbar_default = { "nav": "Navbar_nav__ZjEwM", "item": "Navbar_item__MWVhZ",
|
|
|
33655
33679
|
|
|
33656
33680
|
// src/components/Navbar.tsx
|
|
33657
33681
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
33658
|
-
var NavbarContext = (0,
|
|
33682
|
+
var NavbarContext = (0, import_react192.createContext)(void 0);
|
|
33659
33683
|
var useNavigationContext = () => {
|
|
33660
|
-
const context = (0,
|
|
33684
|
+
const context = (0, import_react192.useContext)(NavbarContext);
|
|
33661
33685
|
if (!context) {
|
|
33662
33686
|
throw new Error("useNavigationContext must be used within a Navbar");
|
|
33663
33687
|
}
|
|
33664
33688
|
return context;
|
|
33665
33689
|
};
|
|
33666
33690
|
function Navbar({ showArrow = true, className, children, ...props }) {
|
|
33667
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
33691
|
+
const [activeMenu, setActiveMenu] = (0, import_react192.useState)("");
|
|
33668
33692
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(NavbarContext.Provider, { value: { activeMenu, setActiveMenu }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { ...props, className: (0, import_classnames38.default)(Navbar_default.nav, className), children }) });
|
|
33669
33693
|
}
|
|
33670
33694
|
function NavbarItem({ label, children, className, ...props }) {
|
|
@@ -33682,7 +33706,7 @@ function NavbarItem({ label, children, className, ...props }) {
|
|
|
33682
33706
|
}
|
|
33683
33707
|
|
|
33684
33708
|
// src/components/NavMenu.tsx
|
|
33685
|
-
var
|
|
33709
|
+
var import_react193 = require("react");
|
|
33686
33710
|
var import_classnames39 = __toESM(require_classnames());
|
|
33687
33711
|
|
|
33688
33712
|
// css-modules:E:\dev\umami-react-zen\src\components\NavMenu.module.css
|
|
@@ -33690,7 +33714,7 @@ var NavMenu_default = { "navmenu": "NavMenu_navmenu__MzRmN", "item": "NavMenu_it
|
|
|
33690
33714
|
|
|
33691
33715
|
// src/components/NavMenu.tsx
|
|
33692
33716
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
33693
|
-
var NavMenuContext = (0,
|
|
33717
|
+
var NavMenuContext = (0, import_react193.createContext)(null);
|
|
33694
33718
|
function NavMenu({
|
|
33695
33719
|
itemBackgroundColor = "2",
|
|
33696
33720
|
muteItems = true,
|
|
@@ -33716,7 +33740,7 @@ function NavMenuGroup({
|
|
|
33716
33740
|
children,
|
|
33717
33741
|
...props
|
|
33718
33742
|
}) {
|
|
33719
|
-
const [minimized, setMinimized] = (0,
|
|
33743
|
+
const [minimized, setMinimized] = (0, import_react193.useState)(!!isMinimized);
|
|
33720
33744
|
const handleClick = () => {
|
|
33721
33745
|
if (allowMinimize) {
|
|
33722
33746
|
setMinimized((state) => !state);
|
|
@@ -33752,7 +33776,7 @@ function NavMenuGroup({
|
|
|
33752
33776
|
);
|
|
33753
33777
|
}
|
|
33754
33778
|
function NavMenuItem({ isSelected, className, children, ...props }) {
|
|
33755
|
-
const { itemBackgroundColor } = (0,
|
|
33779
|
+
const { itemBackgroundColor } = (0, import_react193.useContext)(NavMenuContext);
|
|
33756
33780
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
33757
33781
|
Row,
|
|
33758
33782
|
{
|
|
@@ -33766,11 +33790,11 @@ function NavMenuItem({ isSelected, className, children, ...props }) {
|
|
|
33766
33790
|
}
|
|
33767
33791
|
|
|
33768
33792
|
// src/components/PasswordField.tsx
|
|
33769
|
-
var
|
|
33793
|
+
var import_react194 = require("react");
|
|
33770
33794
|
var import_classnames40 = __toESM(require_classnames());
|
|
33771
33795
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
33772
33796
|
function PasswordField({ label, className, ...props }) {
|
|
33773
|
-
const [show, setShow] = (0,
|
|
33797
|
+
const [show, setShow] = (0, import_react194.useState)(false);
|
|
33774
33798
|
const type = show ? "text" : "password";
|
|
33775
33799
|
const handleShowPassword = () => setShow((state) => !state);
|
|
33776
33800
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
@@ -33877,7 +33901,7 @@ function Radio2({ children, className, ...props }) {
|
|
|
33877
33901
|
}
|
|
33878
33902
|
|
|
33879
33903
|
// src/components/SearchField.tsx
|
|
33880
|
-
var
|
|
33904
|
+
var import_react195 = require("react");
|
|
33881
33905
|
var import_classnames45 = __toESM(require_classnames());
|
|
33882
33906
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
33883
33907
|
function SearchField2({
|
|
@@ -33891,7 +33915,7 @@ function SearchField2({
|
|
|
33891
33915
|
className,
|
|
33892
33916
|
...props
|
|
33893
33917
|
}) {
|
|
33894
|
-
const [search, setSearch] = (0,
|
|
33918
|
+
const [search, setSearch] = (0, import_react195.useState)(defaultValue);
|
|
33895
33919
|
const searchValue = useDebounce(search, delay);
|
|
33896
33920
|
const handleChange = (value2) => {
|
|
33897
33921
|
setSearch(value2);
|
|
@@ -33905,7 +33929,7 @@ function SearchField2({
|
|
|
33905
33929
|
onSearch?.("");
|
|
33906
33930
|
onChange?.("");
|
|
33907
33931
|
};
|
|
33908
|
-
(0,
|
|
33932
|
+
(0, import_react195.useEffect)(() => {
|
|
33909
33933
|
if (delay > 0) {
|
|
33910
33934
|
onSearch?.(searchValue);
|
|
33911
33935
|
}
|
|
@@ -33930,7 +33954,7 @@ function SearchField2({
|
|
|
33930
33954
|
}
|
|
33931
33955
|
|
|
33932
33956
|
// src/components/Select.tsx
|
|
33933
|
-
var
|
|
33957
|
+
var import_react196 = require("react");
|
|
33934
33958
|
var import_classnames46 = __toESM(require_classnames());
|
|
33935
33959
|
|
|
33936
33960
|
// css-modules:E:\dev\umami-react-zen\src\components\Select.module.css
|
|
@@ -33958,7 +33982,7 @@ function Select2({
|
|
|
33958
33982
|
children,
|
|
33959
33983
|
...props
|
|
33960
33984
|
}) {
|
|
33961
|
-
const [search, setSearch] = (0,
|
|
33985
|
+
const [search, setSearch] = (0, import_react196.useState)("");
|
|
33962
33986
|
const handleChange = (e) => {
|
|
33963
33987
|
onSelectionChange?.(e);
|
|
33964
33988
|
onChange?.(e);
|
|
@@ -34023,7 +34047,7 @@ function Select2({
|
|
|
34023
34047
|
}
|
|
34024
34048
|
|
|
34025
34049
|
// src/components/Sidebar.tsx
|
|
34026
|
-
var
|
|
34050
|
+
var import_react197 = require("react");
|
|
34027
34051
|
var import_classnames47 = __toESM(require_classnames());
|
|
34028
34052
|
|
|
34029
34053
|
// css-modules:E:\dev\umami-react-zen\src\components\Sidebar.module.css
|
|
@@ -34031,7 +34055,7 @@ var Sidebar_default = { "sidebar": "Sidebar_sidebar__MDdkM", "header": "Sidebar_
|
|
|
34031
34055
|
|
|
34032
34056
|
// src/components/Sidebar.tsx
|
|
34033
34057
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
34034
|
-
var SidebarContext = (0,
|
|
34058
|
+
var SidebarContext = (0, import_react197.createContext)(null);
|
|
34035
34059
|
function Sidebar({
|
|
34036
34060
|
itemBackgroundColor = "2",
|
|
34037
34061
|
isCollapsed,
|
|
@@ -34088,7 +34112,7 @@ function SidebarItem({
|
|
|
34088
34112
|
children,
|
|
34089
34113
|
...props
|
|
34090
34114
|
}) {
|
|
34091
|
-
const { isCollapsed, itemBackgroundColor } = (0,
|
|
34115
|
+
const { isCollapsed, itemBackgroundColor } = (0, import_react197.useContext)(SidebarContext);
|
|
34092
34116
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)($4e3b923658d69c60$export$8c610744efcf8a1d, { delay: 0, closeDelay: 0, isDisabled: !isCollapsed, children: [
|
|
34093
34117
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)($f645667febf57a63$export$35a3bebf7ef2d934, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
34094
34118
|
Row,
|
|
@@ -34206,14 +34230,8 @@ var ThemeButton_default = { "button": "ThemeButton_button__MDUzN" };
|
|
|
34206
34230
|
|
|
34207
34231
|
// src/components/ThemeButton.tsx
|
|
34208
34232
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
34209
|
-
function ThemeButton({
|
|
34210
|
-
|
|
34211
|
-
variant = "quiet",
|
|
34212
|
-
defaultTheme,
|
|
34213
|
-
onPress,
|
|
34214
|
-
...props
|
|
34215
|
-
}) {
|
|
34216
|
-
const { theme, setTheme: setTheme2 } = useTheme(defaultTheme);
|
|
34233
|
+
function ThemeButton({ className, variant = "quiet", onPress, ...props }) {
|
|
34234
|
+
const { theme, setTheme } = useTheme();
|
|
34217
34235
|
const transitions = useTransition(theme, {
|
|
34218
34236
|
initial: { opacity: 1 },
|
|
34219
34237
|
from: {
|
|
@@ -34227,7 +34245,7 @@ function ThemeButton({
|
|
|
34227
34245
|
}
|
|
34228
34246
|
});
|
|
34229
34247
|
function handleClick(e) {
|
|
34230
|
-
|
|
34248
|
+
setTheme(theme === "light" ? "dark" : "light");
|
|
34231
34249
|
onPress?.(e);
|
|
34232
34250
|
}
|
|
34233
34251
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
@@ -34320,11 +34338,16 @@ function ToggleGroupItem({ className, children, ...props }) {
|
|
|
34320
34338
|
|
|
34321
34339
|
// src/components/ZenProvider.tsx
|
|
34322
34340
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
34323
|
-
var
|
|
34341
|
+
var defaultToastConfig = {
|
|
34324
34342
|
duration: 3e3
|
|
34325
34343
|
};
|
|
34326
|
-
function ZenProvider({
|
|
34327
|
-
|
|
34344
|
+
function ZenProvider({
|
|
34345
|
+
children,
|
|
34346
|
+
theme,
|
|
34347
|
+
colorScheme,
|
|
34348
|
+
toast = defaultToastConfig
|
|
34349
|
+
}) {
|
|
34350
|
+
useInitTheme(theme, colorScheme);
|
|
34328
34351
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ToastProvider, { ...toast, children });
|
|
34329
34352
|
}
|
|
34330
34353
|
/*! Bundled license information:
|