@umami/react-zen 0.180.0 → 0.182.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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +119 -110
- package/dist/index.mjs +21 -12
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -261,7 +261,7 @@ interface AlertBannerProps {
|
|
|
261
261
|
title?: ReactNode;
|
|
262
262
|
description?: ReactNode;
|
|
263
263
|
icon?: ReactNode;
|
|
264
|
-
variant?: 'error';
|
|
264
|
+
variant?: 'error' | 'info';
|
|
265
265
|
align?: 'start' | 'center' | 'end';
|
|
266
266
|
allowClose?: boolean;
|
|
267
267
|
onClose?: () => void;
|
|
@@ -323,7 +323,7 @@ interface ListProps extends ListBoxProps<any> {
|
|
|
323
323
|
value?: string[];
|
|
324
324
|
onChange?: (value: string[]) => void;
|
|
325
325
|
}
|
|
326
|
-
declare function List({ items, idProperty, labelProperty, separatorProperty, highlightColor, showCheckmark, label, value, onChange, className, selectedKeys, defaultSelectedKeys, onSelectionChange, style, children, ...props }: ListProps): react.JSX.Element;
|
|
326
|
+
declare function List({ id, items, idProperty, labelProperty, separatorProperty, highlightColor, showCheckmark, label, value, onChange, className, selectedKeys, defaultSelectedKeys, onSelectionChange, style, children, ...props }: ListProps): react.JSX.Element;
|
|
327
327
|
interface ListItemProps extends ListBoxItemProps<any> {
|
|
328
328
|
showCheckmark?: boolean;
|
|
329
329
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -261,7 +261,7 @@ interface AlertBannerProps {
|
|
|
261
261
|
title?: ReactNode;
|
|
262
262
|
description?: ReactNode;
|
|
263
263
|
icon?: ReactNode;
|
|
264
|
-
variant?: 'error';
|
|
264
|
+
variant?: 'error' | 'info';
|
|
265
265
|
align?: 'start' | 'center' | 'end';
|
|
266
266
|
allowClose?: boolean;
|
|
267
267
|
onClose?: () => void;
|
|
@@ -323,7 +323,7 @@ interface ListProps extends ListBoxProps<any> {
|
|
|
323
323
|
value?: string[];
|
|
324
324
|
onChange?: (value: string[]) => void;
|
|
325
325
|
}
|
|
326
|
-
declare function List({ items, idProperty, labelProperty, separatorProperty, highlightColor, showCheckmark, label, value, onChange, className, selectedKeys, defaultSelectedKeys, onSelectionChange, style, children, ...props }: ListProps): react.JSX.Element;
|
|
326
|
+
declare function List({ id, items, idProperty, labelProperty, separatorProperty, highlightColor, showCheckmark, label, value, onChange, className, selectedKeys, defaultSelectedKeys, onSelectionChange, style, children, ...props }: ListProps): react.JSX.Element;
|
|
327
327
|
interface ListItemProps extends ListBoxItemProps<any> {
|
|
328
328
|
showCheckmark?: boolean;
|
|
329
329
|
}
|
package/dist/index.js
CHANGED
|
@@ -34,8 +34,8 @@ 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
|
}
|
|
@@ -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;
|
|
@@ -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, useEffect13 = React5.useEffect, useLayoutEffect2 = 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
|
})();
|
|
@@ -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
|
} }),
|
|
@@ -28704,7 +28710,7 @@ function FormSubmitButton({
|
|
|
28704
28710
|
...props
|
|
28705
28711
|
}) {
|
|
28706
28712
|
const {
|
|
28707
|
-
formState: { isDirty, isValid, isSubmitting,
|
|
28713
|
+
formState: { isDirty, isValid, isSubmitting, isLoading: formLoading }
|
|
28708
28714
|
} = useFormContext();
|
|
28709
28715
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
28710
28716
|
LoadingButton,
|
|
@@ -28712,8 +28718,8 @@ function FormSubmitButton({
|
|
|
28712
28718
|
...props,
|
|
28713
28719
|
type: "submit",
|
|
28714
28720
|
variant,
|
|
28715
|
-
isDisabled: isDisabled
|
|
28716
|
-
isLoading: isLoading
|
|
28721
|
+
isDisabled: isDisabled ?? (!isDirty || !isValid || isSubmitting),
|
|
28722
|
+
isLoading: isLoading ?? (formLoading || isSubmitting),
|
|
28717
28723
|
children
|
|
28718
28724
|
}
|
|
28719
28725
|
);
|
|
@@ -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) => {
|
|
@@ -32372,15 +32378,15 @@ var createStoreImpl = (createState) => {
|
|
|
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,7 +32510,7 @@ function useDebounce(value, delay) {
|
|
|
32504
32510
|
}
|
|
32505
32511
|
|
|
32506
32512
|
// src/components/hooks/useTheme.ts
|
|
32507
|
-
var
|
|
32513
|
+
var import_react181 = require("react");
|
|
32508
32514
|
function getDefaultTheme() {
|
|
32509
32515
|
return typeof window !== "undefined" ? window?.matchMedia("(prefers-color-scheme: dark)")?.matches ? "dark" : "light" : "light";
|
|
32510
32516
|
}
|
|
@@ -32518,7 +32524,7 @@ function setTheme(theme) {
|
|
|
32518
32524
|
}
|
|
32519
32525
|
function useTheme(defaultTheme) {
|
|
32520
32526
|
const { theme } = store2();
|
|
32521
|
-
(0,
|
|
32527
|
+
(0, import_react181.useEffect)(() => {
|
|
32522
32528
|
if (defaultTheme) {
|
|
32523
32529
|
setTheme(defaultTheme);
|
|
32524
32530
|
}
|
|
@@ -32527,7 +32533,7 @@ function useTheme(defaultTheme) {
|
|
|
32527
32533
|
}
|
|
32528
32534
|
|
|
32529
32535
|
// src/components/Accordion.tsx
|
|
32530
|
-
var
|
|
32536
|
+
var import_react182 = require("react");
|
|
32531
32537
|
var import_classnames14 = __toESM(require_classnames());
|
|
32532
32538
|
|
|
32533
32539
|
// src/components/Text.tsx
|
|
@@ -32601,7 +32607,7 @@ function AccordionItem({
|
|
|
32601
32607
|
...props
|
|
32602
32608
|
}) {
|
|
32603
32609
|
const [trigger, panel] = children;
|
|
32604
|
-
const [expanded, setExpanded] = (0,
|
|
32610
|
+
const [expanded, setExpanded] = (0, import_react182.useState)(defaultExpanded);
|
|
32605
32611
|
const handleExpandedChange = (isExpanded) => {
|
|
32606
32612
|
requestAnimationFrame(() => setExpanded(isExpanded));
|
|
32607
32613
|
};
|
|
@@ -32812,7 +32818,7 @@ function Checkbox2({ label, className, children, ...props }) {
|
|
|
32812
32818
|
var import_classnames22 = __toESM(require_classnames());
|
|
32813
32819
|
|
|
32814
32820
|
// src/components/List.tsx
|
|
32815
|
-
var
|
|
32821
|
+
var import_react183 = require("react");
|
|
32816
32822
|
var import_classnames20 = __toESM(require_classnames());
|
|
32817
32823
|
|
|
32818
32824
|
// src/lib/constants.ts
|
|
@@ -32862,7 +32868,8 @@ var List_default = { "list": "List_list__ZTRlN", "separator": "List_separator__O
|
|
|
32862
32868
|
// src/components/List.tsx
|
|
32863
32869
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
32864
32870
|
function List({
|
|
32865
|
-
|
|
32871
|
+
id,
|
|
32872
|
+
items = [],
|
|
32866
32873
|
idProperty = "id",
|
|
32867
32874
|
labelProperty = "label",
|
|
32868
32875
|
separatorProperty = "separatpr",
|
|
@@ -32885,11 +32892,13 @@ function List({
|
|
|
32885
32892
|
onChange?.([...keys].map(String));
|
|
32886
32893
|
}
|
|
32887
32894
|
};
|
|
32895
|
+
const fieldId = useFieldId(id);
|
|
32888
32896
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
32889
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Label2, { children: label }),
|
|
32897
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Label2, { htmlFor: fieldId, children: label }),
|
|
32890
32898
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
32891
32899
|
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
32892
32900
|
{
|
|
32901
|
+
id: fieldId,
|
|
32893
32902
|
"aria-label": "list",
|
|
32894
32903
|
...props,
|
|
32895
32904
|
selectedKeys: value || selectedKeys,
|
|
@@ -32899,12 +32908,12 @@ function List({
|
|
|
32899
32908
|
onSelectionChange: handleSelectionChange,
|
|
32900
32909
|
style: { ...style, ...getHighlightColor(highlightColor) },
|
|
32901
32910
|
children: children || items?.map((item) => {
|
|
32902
|
-
const
|
|
32911
|
+
const id2 = item[idProperty] || item.toString();
|
|
32903
32912
|
const label2 = item[labelProperty] || item.toString();
|
|
32904
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
32913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react183.Fragment, { children: [
|
|
32905
32914
|
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
|
-
] },
|
|
32915
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ListItem, { id: id2, className: List_default.item, children: label2 })
|
|
32916
|
+
] }, id2);
|
|
32908
32917
|
})
|
|
32909
32918
|
}
|
|
32910
32919
|
)
|
|
@@ -33021,15 +33030,15 @@ function Code({ asChild, children }) {
|
|
|
33021
33030
|
}
|
|
33022
33031
|
|
|
33023
33032
|
// src/components/ConfirmationDialog.tsx
|
|
33024
|
-
var
|
|
33033
|
+
var import_react186 = require("react");
|
|
33025
33034
|
var import_classnames25 = __toESM(require_classnames());
|
|
33026
33035
|
|
|
33027
33036
|
// src/components/TextField.tsx
|
|
33028
|
-
var
|
|
33037
|
+
var import_react185 = require("react");
|
|
33029
33038
|
var import_classnames24 = __toESM(require_classnames());
|
|
33030
33039
|
|
|
33031
33040
|
// src/components/CopyButton.tsx
|
|
33032
|
-
var
|
|
33041
|
+
var import_react184 = require("react");
|
|
33033
33042
|
var import_classnames23 = __toESM(require_classnames());
|
|
33034
33043
|
|
|
33035
33044
|
// css-modules:E:\dev\umami-react-zen\src\components\CopyButton.module.css
|
|
@@ -33039,8 +33048,8 @@ var CopyButton_default = { "icon": "CopyButton_icon__YTM2Y", "copy-button": "Cop
|
|
|
33039
33048
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
33040
33049
|
var TIMEOUT = 2e3;
|
|
33041
33050
|
function CopyButton({ value, timeout = TIMEOUT, className, children, ...props }) {
|
|
33042
|
-
const [copied, setCopied] = (0,
|
|
33043
|
-
const ref = (0,
|
|
33051
|
+
const [copied, setCopied] = (0, import_react184.useState)(false);
|
|
33052
|
+
const ref = (0, import_react184.useRef)(timeout);
|
|
33044
33053
|
const handleCopy = async () => {
|
|
33045
33054
|
if (value) {
|
|
33046
33055
|
await navigator.clipboard.writeText(value);
|
|
@@ -33072,13 +33081,13 @@ function TextField2({
|
|
|
33072
33081
|
children,
|
|
33073
33082
|
...props
|
|
33074
33083
|
}) {
|
|
33075
|
-
const [inputValue, setInputValue] = (0,
|
|
33084
|
+
const [inputValue, setInputValue] = (0, import_react185.useState)(defaultValue || value);
|
|
33076
33085
|
const Component = asTextArea ? $216918bed6669f72$export$f5c9f3c2c4054eec : $3985021b0ad6602f$export$f5b8910cec6cf069;
|
|
33077
33086
|
const handleChange = (value2) => {
|
|
33078
33087
|
setInputValue(value2);
|
|
33079
33088
|
return onChange?.(value2);
|
|
33080
33089
|
};
|
|
33081
|
-
(0,
|
|
33090
|
+
(0, import_react185.useEffect)(() => {
|
|
33082
33091
|
setInputValue(value);
|
|
33083
33092
|
}, [value]);
|
|
33084
33093
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
@@ -33121,7 +33130,7 @@ function ConfirmationDialog({
|
|
|
33121
33130
|
children,
|
|
33122
33131
|
...props
|
|
33123
33132
|
}) {
|
|
33124
|
-
const [canSave, setCanSave] = (0,
|
|
33133
|
+
const [canSave, setCanSave] = (0, import_react186.useState)(false);
|
|
33125
33134
|
const handleChange = (e) => {
|
|
33126
33135
|
setCanSave(e.target.value === value);
|
|
33127
33136
|
};
|
|
@@ -33178,7 +33187,7 @@ function Container({
|
|
|
33178
33187
|
|
|
33179
33188
|
// src/components/DataTable.tsx
|
|
33180
33189
|
var import_classnames28 = __toESM(require_classnames());
|
|
33181
|
-
var
|
|
33190
|
+
var import_react187 = require("react");
|
|
33182
33191
|
|
|
33183
33192
|
// src/components/Table.tsx
|
|
33184
33193
|
var import_classnames27 = __toESM(require_classnames());
|
|
@@ -33237,11 +33246,11 @@ var DataTable_default = { "datatable": "DataTable_datatable__MWRkN", "cell": "Da
|
|
|
33237
33246
|
|
|
33238
33247
|
// src/components/DataTable.tsx
|
|
33239
33248
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
33240
|
-
var
|
|
33249
|
+
var import_react188 = require("react");
|
|
33241
33250
|
function DataTable({ data = [], className, children, ...props }) {
|
|
33242
33251
|
const items = data.length && data?.[0]?.id === void 0 ? data.map((row, id) => ({ ...row, id })) : data;
|
|
33243
33252
|
const widths = [];
|
|
33244
|
-
const columns =
|
|
33253
|
+
const columns = import_react187.Children.map(children, (child) => {
|
|
33245
33254
|
if (child) {
|
|
33246
33255
|
widths.push(child?.props?.width || "1fr");
|
|
33247
33256
|
return { ...child?.props };
|
|
@@ -33254,7 +33263,7 @@ function DataTable({ data = [], className, children, ...props }) {
|
|
|
33254
33263
|
if (hidden) {
|
|
33255
33264
|
return null;
|
|
33256
33265
|
}
|
|
33257
|
-
return /* @__PURE__ */ (0,
|
|
33266
|
+
return /* @__PURE__ */ (0, import_react188.createElement)(TableColumn, { ...columnProps, key: id, id }, label);
|
|
33258
33267
|
}) }),
|
|
33259
33268
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableBody, { children: items.map((row, index) => {
|
|
33260
33269
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
|
|
@@ -33262,14 +33271,14 @@ function DataTable({ data = [], className, children, ...props }) {
|
|
|
33262
33271
|
return null;
|
|
33263
33272
|
}
|
|
33264
33273
|
const value = typeof children2 === "function" ? children2(row, index) : children2 || row[id];
|
|
33265
|
-
return /* @__PURE__ */ (0,
|
|
33274
|
+
return /* @__PURE__ */ (0, import_react188.createElement)(
|
|
33266
33275
|
TableCell,
|
|
33267
33276
|
{
|
|
33268
33277
|
...cellProps,
|
|
33269
33278
|
key: id,
|
|
33270
33279
|
className: (0, import_classnames28.default)(DataTable_default.cell, className2)
|
|
33271
33280
|
},
|
|
33272
|
-
as ? (0,
|
|
33281
|
+
as ? (0, import_react187.createElement)(as, {}, value) : value
|
|
33273
33282
|
);
|
|
33274
33283
|
}) }, index);
|
|
33275
33284
|
}) })
|
|
@@ -33296,7 +33305,7 @@ function Dots({ size = "md", className, ...props }) {
|
|
|
33296
33305
|
}
|
|
33297
33306
|
|
|
33298
33307
|
// src/components/FloatingTooltip.tsx
|
|
33299
|
-
var
|
|
33308
|
+
var import_react189 = require("react");
|
|
33300
33309
|
var import_classnames31 = __toESM(require_classnames());
|
|
33301
33310
|
|
|
33302
33311
|
// src/components/Tooltip.tsx
|
|
@@ -33323,8 +33332,8 @@ var FloatingTooltip_default = { "floating": "FloatingTooltip_floating__ZjM4N" };
|
|
|
33323
33332
|
// src/components/FloatingTooltip.tsx
|
|
33324
33333
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
33325
33334
|
function FloatingTooltip({ className, style, children, ...props }) {
|
|
33326
|
-
const [position, setPosition] = (0,
|
|
33327
|
-
(0,
|
|
33335
|
+
const [position, setPosition] = (0, import_react189.useState)({ x: -1e3, y: -1e3 });
|
|
33336
|
+
(0, import_react189.useEffect)(() => {
|
|
33328
33337
|
const handler = (e) => {
|
|
33329
33338
|
setPosition({ x: e.clientX, y: e.clientY });
|
|
33330
33339
|
};
|
|
@@ -33380,7 +33389,7 @@ function Heading2({
|
|
|
33380
33389
|
}
|
|
33381
33390
|
|
|
33382
33391
|
// src/components/HoverTrigger.tsx
|
|
33383
|
-
var
|
|
33392
|
+
var import_react190 = require("react");
|
|
33384
33393
|
|
|
33385
33394
|
// css-modules:E:\dev\umami-react-zen\src\components\HoverTrigger.module.css
|
|
33386
33395
|
var HoverTrigger_default = { "wrapper": "HoverTrigger_wrapper__NGFlN" };
|
|
@@ -33396,12 +33405,12 @@ function HoverTrigger({
|
|
|
33396
33405
|
children
|
|
33397
33406
|
}) {
|
|
33398
33407
|
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,
|
|
33408
|
+
const triggerRef = (0, import_react190.useRef)(null);
|
|
33409
|
+
const [open, setOpen] = (0, import_react190.useState)(isOpen);
|
|
33410
|
+
const isOverMenu = (0, import_react190.useRef)(false);
|
|
33411
|
+
const isOverButton = (0, import_react190.useRef)(false);
|
|
33412
|
+
const timeout = (0, import_react190.useRef)(null);
|
|
33413
|
+
(0, import_react190.useEffect)(() => {
|
|
33405
33414
|
if (isOpen !== open) {
|
|
33406
33415
|
setOpen(isOpen);
|
|
33407
33416
|
}
|
|
@@ -33491,7 +33500,7 @@ function Image({
|
|
|
33491
33500
|
}
|
|
33492
33501
|
|
|
33493
33502
|
// src/components/InlineEditField.tsx
|
|
33494
|
-
var
|
|
33503
|
+
var import_react191 = require("react");
|
|
33495
33504
|
var import_classnames34 = __toESM(require_classnames());
|
|
33496
33505
|
|
|
33497
33506
|
// css-modules:E:\dev\umami-react-zen\src\components\InlineEditField.module.css
|
|
@@ -33510,8 +33519,8 @@ function InlineEditField({
|
|
|
33510
33519
|
onCancel,
|
|
33511
33520
|
...props
|
|
33512
33521
|
}) {
|
|
33513
|
-
const [value, setValue] = (0,
|
|
33514
|
-
const [edit, setEdit] = (0,
|
|
33522
|
+
const [value, setValue] = (0, import_react191.useState)(defaultValue);
|
|
33523
|
+
const [edit, setEdit] = (0, import_react191.useState)(defaultEdit);
|
|
33515
33524
|
const handleEdit = () => setEdit(true);
|
|
33516
33525
|
const handleChange = (e) => {
|
|
33517
33526
|
const val = e.target.value;
|
|
@@ -33522,7 +33531,7 @@ function InlineEditField({
|
|
|
33522
33531
|
setEdit(false);
|
|
33523
33532
|
onCommit?.(value);
|
|
33524
33533
|
};
|
|
33525
|
-
const handleCancel = (0,
|
|
33534
|
+
const handleCancel = (0, import_react191.useCallback)(() => {
|
|
33526
33535
|
setEdit(false);
|
|
33527
33536
|
setValue(defaultValue);
|
|
33528
33537
|
onCancel?.();
|
|
@@ -33647,7 +33656,7 @@ function Modal2({
|
|
|
33647
33656
|
}
|
|
33648
33657
|
|
|
33649
33658
|
// src/components/Navbar.tsx
|
|
33650
|
-
var
|
|
33659
|
+
var import_react192 = require("react");
|
|
33651
33660
|
var import_classnames38 = __toESM(require_classnames());
|
|
33652
33661
|
|
|
33653
33662
|
// css-modules:E:\dev\umami-react-zen\src\components\Navbar.module.css
|
|
@@ -33655,16 +33664,16 @@ var Navbar_default = { "nav": "Navbar_nav__ZjEwM", "item": "Navbar_item__MWVhZ",
|
|
|
33655
33664
|
|
|
33656
33665
|
// src/components/Navbar.tsx
|
|
33657
33666
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
33658
|
-
var NavbarContext = (0,
|
|
33667
|
+
var NavbarContext = (0, import_react192.createContext)(void 0);
|
|
33659
33668
|
var useNavigationContext = () => {
|
|
33660
|
-
const context = (0,
|
|
33669
|
+
const context = (0, import_react192.useContext)(NavbarContext);
|
|
33661
33670
|
if (!context) {
|
|
33662
33671
|
throw new Error("useNavigationContext must be used within a Navbar");
|
|
33663
33672
|
}
|
|
33664
33673
|
return context;
|
|
33665
33674
|
};
|
|
33666
33675
|
function Navbar({ showArrow = true, className, children, ...props }) {
|
|
33667
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
33676
|
+
const [activeMenu, setActiveMenu] = (0, import_react192.useState)("");
|
|
33668
33677
|
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
33678
|
}
|
|
33670
33679
|
function NavbarItem({ label, children, className, ...props }) {
|
|
@@ -33682,7 +33691,7 @@ function NavbarItem({ label, children, className, ...props }) {
|
|
|
33682
33691
|
}
|
|
33683
33692
|
|
|
33684
33693
|
// src/components/NavMenu.tsx
|
|
33685
|
-
var
|
|
33694
|
+
var import_react193 = require("react");
|
|
33686
33695
|
var import_classnames39 = __toESM(require_classnames());
|
|
33687
33696
|
|
|
33688
33697
|
// css-modules:E:\dev\umami-react-zen\src\components\NavMenu.module.css
|
|
@@ -33690,7 +33699,7 @@ var NavMenu_default = { "navmenu": "NavMenu_navmenu__MzRmN", "item": "NavMenu_it
|
|
|
33690
33699
|
|
|
33691
33700
|
// src/components/NavMenu.tsx
|
|
33692
33701
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
33693
|
-
var NavMenuContext = (0,
|
|
33702
|
+
var NavMenuContext = (0, import_react193.createContext)(null);
|
|
33694
33703
|
function NavMenu({
|
|
33695
33704
|
itemBackgroundColor = "2",
|
|
33696
33705
|
muteItems = true,
|
|
@@ -33716,7 +33725,7 @@ function NavMenuGroup({
|
|
|
33716
33725
|
children,
|
|
33717
33726
|
...props
|
|
33718
33727
|
}) {
|
|
33719
|
-
const [minimized, setMinimized] = (0,
|
|
33728
|
+
const [minimized, setMinimized] = (0, import_react193.useState)(!!isMinimized);
|
|
33720
33729
|
const handleClick = () => {
|
|
33721
33730
|
if (allowMinimize) {
|
|
33722
33731
|
setMinimized((state) => !state);
|
|
@@ -33752,7 +33761,7 @@ function NavMenuGroup({
|
|
|
33752
33761
|
);
|
|
33753
33762
|
}
|
|
33754
33763
|
function NavMenuItem({ isSelected, className, children, ...props }) {
|
|
33755
|
-
const { itemBackgroundColor } = (0,
|
|
33764
|
+
const { itemBackgroundColor } = (0, import_react193.useContext)(NavMenuContext);
|
|
33756
33765
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
33757
33766
|
Row,
|
|
33758
33767
|
{
|
|
@@ -33766,11 +33775,11 @@ function NavMenuItem({ isSelected, className, children, ...props }) {
|
|
|
33766
33775
|
}
|
|
33767
33776
|
|
|
33768
33777
|
// src/components/PasswordField.tsx
|
|
33769
|
-
var
|
|
33778
|
+
var import_react194 = require("react");
|
|
33770
33779
|
var import_classnames40 = __toESM(require_classnames());
|
|
33771
33780
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
33772
33781
|
function PasswordField({ label, className, ...props }) {
|
|
33773
|
-
const [show, setShow] = (0,
|
|
33782
|
+
const [show, setShow] = (0, import_react194.useState)(false);
|
|
33774
33783
|
const type = show ? "text" : "password";
|
|
33775
33784
|
const handleShowPassword = () => setShow((state) => !state);
|
|
33776
33785
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
@@ -33877,7 +33886,7 @@ function Radio2({ children, className, ...props }) {
|
|
|
33877
33886
|
}
|
|
33878
33887
|
|
|
33879
33888
|
// src/components/SearchField.tsx
|
|
33880
|
-
var
|
|
33889
|
+
var import_react195 = require("react");
|
|
33881
33890
|
var import_classnames45 = __toESM(require_classnames());
|
|
33882
33891
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
33883
33892
|
function SearchField2({
|
|
@@ -33891,7 +33900,7 @@ function SearchField2({
|
|
|
33891
33900
|
className,
|
|
33892
33901
|
...props
|
|
33893
33902
|
}) {
|
|
33894
|
-
const [search, setSearch] = (0,
|
|
33903
|
+
const [search, setSearch] = (0, import_react195.useState)(defaultValue);
|
|
33895
33904
|
const searchValue = useDebounce(search, delay);
|
|
33896
33905
|
const handleChange = (value2) => {
|
|
33897
33906
|
setSearch(value2);
|
|
@@ -33905,7 +33914,7 @@ function SearchField2({
|
|
|
33905
33914
|
onSearch?.("");
|
|
33906
33915
|
onChange?.("");
|
|
33907
33916
|
};
|
|
33908
|
-
(0,
|
|
33917
|
+
(0, import_react195.useEffect)(() => {
|
|
33909
33918
|
if (delay > 0) {
|
|
33910
33919
|
onSearch?.(searchValue);
|
|
33911
33920
|
}
|
|
@@ -33930,7 +33939,7 @@ function SearchField2({
|
|
|
33930
33939
|
}
|
|
33931
33940
|
|
|
33932
33941
|
// src/components/Select.tsx
|
|
33933
|
-
var
|
|
33942
|
+
var import_react196 = require("react");
|
|
33934
33943
|
var import_classnames46 = __toESM(require_classnames());
|
|
33935
33944
|
|
|
33936
33945
|
// css-modules:E:\dev\umami-react-zen\src\components\Select.module.css
|
|
@@ -33958,7 +33967,7 @@ function Select2({
|
|
|
33958
33967
|
children,
|
|
33959
33968
|
...props
|
|
33960
33969
|
}) {
|
|
33961
|
-
const [search, setSearch] = (0,
|
|
33970
|
+
const [search, setSearch] = (0, import_react196.useState)("");
|
|
33962
33971
|
const handleChange = (e) => {
|
|
33963
33972
|
onSelectionChange?.(e);
|
|
33964
33973
|
onChange?.(e);
|
|
@@ -34023,7 +34032,7 @@ function Select2({
|
|
|
34023
34032
|
}
|
|
34024
34033
|
|
|
34025
34034
|
// src/components/Sidebar.tsx
|
|
34026
|
-
var
|
|
34035
|
+
var import_react197 = require("react");
|
|
34027
34036
|
var import_classnames47 = __toESM(require_classnames());
|
|
34028
34037
|
|
|
34029
34038
|
// css-modules:E:\dev\umami-react-zen\src\components\Sidebar.module.css
|
|
@@ -34031,7 +34040,7 @@ var Sidebar_default = { "sidebar": "Sidebar_sidebar__MDdkM", "header": "Sidebar_
|
|
|
34031
34040
|
|
|
34032
34041
|
// src/components/Sidebar.tsx
|
|
34033
34042
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
34034
|
-
var SidebarContext = (0,
|
|
34043
|
+
var SidebarContext = (0, import_react197.createContext)(null);
|
|
34035
34044
|
function Sidebar({
|
|
34036
34045
|
itemBackgroundColor = "2",
|
|
34037
34046
|
isCollapsed,
|
|
@@ -34088,7 +34097,7 @@ function SidebarItem({
|
|
|
34088
34097
|
children,
|
|
34089
34098
|
...props
|
|
34090
34099
|
}) {
|
|
34091
|
-
const { isCollapsed, itemBackgroundColor } = (0,
|
|
34100
|
+
const { isCollapsed, itemBackgroundColor } = (0, import_react197.useContext)(SidebarContext);
|
|
34092
34101
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)($4e3b923658d69c60$export$8c610744efcf8a1d, { delay: 0, closeDelay: 0, isDisabled: !isCollapsed, children: [
|
|
34093
34102
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)($f645667febf57a63$export$35a3bebf7ef2d934, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
34094
34103
|
Row,
|
package/dist/index.mjs
CHANGED
|
@@ -28407,9 +28407,16 @@ function FormController({ children, ...props }) {
|
|
|
28407
28407
|
}
|
|
28408
28408
|
|
|
28409
28409
|
// src/components/forms/FormField.tsx
|
|
28410
|
-
import { cloneElement as cloneElement2, Children
|
|
28410
|
+
import { cloneElement as cloneElement2, Children } from "react";
|
|
28411
28411
|
var import_classnames7 = __toESM(require_classnames());
|
|
28412
28412
|
|
|
28413
|
+
// src/components/hooks/useFieldId.ts
|
|
28414
|
+
import { useId } from "react";
|
|
28415
|
+
function useFieldId(id) {
|
|
28416
|
+
const generatedId = useId();
|
|
28417
|
+
return id ?? generatedId;
|
|
28418
|
+
}
|
|
28419
|
+
|
|
28413
28420
|
// css-modules:E:\dev\umami-react-zen\src\components\forms\FormField.module.css
|
|
28414
28421
|
var FormField_default = { "field": "FormField_field__YTM1N", "description": "FormField_description__ZjFiM", "error": "FormField_error__NWZhM" };
|
|
28415
28422
|
|
|
@@ -28437,12 +28444,11 @@ function FormField({
|
|
|
28437
28444
|
children,
|
|
28438
28445
|
...props
|
|
28439
28446
|
}) {
|
|
28440
|
-
const
|
|
28447
|
+
const fieldId = useFieldId(id);
|
|
28441
28448
|
const context = useFormContext();
|
|
28442
28449
|
const { control } = context;
|
|
28443
28450
|
const { invalid, error } = context.getFieldState(name);
|
|
28444
|
-
|
|
28445
|
-
return /* @__PURE__ */ jsxs6("div", { ...props, id, className: (0, import_classnames7.default)(FormField_default.input, className), children: [
|
|
28451
|
+
return /* @__PURE__ */ jsxs6("div", { ...props, className: (0, import_classnames7.default)(FormField_default.input, className), children: [
|
|
28446
28452
|
label && /* @__PURE__ */ jsx14(Label2, { htmlFor: fieldId, children: label }),
|
|
28447
28453
|
/* @__PURE__ */ jsx14(FormController, { name, control, rules, children: ({ field }) => {
|
|
28448
28454
|
return Children.map(
|
|
@@ -28585,7 +28591,7 @@ function FormSubmitButton({
|
|
|
28585
28591
|
...props
|
|
28586
28592
|
}) {
|
|
28587
28593
|
const {
|
|
28588
|
-
formState: { isDirty, isValid, isSubmitting,
|
|
28594
|
+
formState: { isDirty, isValid, isSubmitting, isLoading: formLoading }
|
|
28589
28595
|
} = useFormContext();
|
|
28590
28596
|
return /* @__PURE__ */ jsx20(
|
|
28591
28597
|
LoadingButton,
|
|
@@ -28593,8 +28599,8 @@ function FormSubmitButton({
|
|
|
28593
28599
|
...props,
|
|
28594
28600
|
type: "submit",
|
|
28595
28601
|
variant,
|
|
28596
|
-
isDisabled: isDisabled
|
|
28597
|
-
isLoading: isLoading
|
|
28602
|
+
isDisabled: isDisabled ?? (!isDirty || !isValid || isSubmitting),
|
|
28603
|
+
isLoading: isLoading ?? (formLoading || isSubmitting),
|
|
28598
28604
|
children
|
|
28599
28605
|
}
|
|
28600
28606
|
);
|
|
@@ -32743,7 +32749,8 @@ var List_default = { "list": "List_list__ZTRlN", "separator": "List_separator__O
|
|
|
32743
32749
|
// src/components/List.tsx
|
|
32744
32750
|
import { Fragment as Fragment5, jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
32745
32751
|
function List({
|
|
32746
|
-
|
|
32752
|
+
id,
|
|
32753
|
+
items = [],
|
|
32747
32754
|
idProperty = "id",
|
|
32748
32755
|
labelProperty = "label",
|
|
32749
32756
|
separatorProperty = "separatpr",
|
|
@@ -32766,11 +32773,13 @@ function List({
|
|
|
32766
32773
|
onChange?.([...keys].map(String));
|
|
32767
32774
|
}
|
|
32768
32775
|
};
|
|
32776
|
+
const fieldId = useFieldId(id);
|
|
32769
32777
|
return /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
32770
|
-
label && /* @__PURE__ */ jsx33(Label2, { children: label }),
|
|
32778
|
+
label && /* @__PURE__ */ jsx33(Label2, { htmlFor: fieldId, children: label }),
|
|
32771
32779
|
/* @__PURE__ */ jsx33(
|
|
32772
32780
|
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
32773
32781
|
{
|
|
32782
|
+
id: fieldId,
|
|
32774
32783
|
"aria-label": "list",
|
|
32775
32784
|
...props,
|
|
32776
32785
|
selectedKeys: value || selectedKeys,
|
|
@@ -32780,12 +32789,12 @@ function List({
|
|
|
32780
32789
|
onSelectionChange: handleSelectionChange,
|
|
32781
32790
|
style: { ...style, ...getHighlightColor(highlightColor) },
|
|
32782
32791
|
children: children || items?.map((item) => {
|
|
32783
|
-
const
|
|
32792
|
+
const id2 = item[idProperty] || item.toString();
|
|
32784
32793
|
const label2 = item[labelProperty] || item.toString();
|
|
32785
32794
|
return /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
32786
32795
|
item[separatorProperty] && /* @__PURE__ */ jsx33($431f98aba6844401$export$1ff3c3f08ae963c0, { className: List_default.separator }),
|
|
32787
|
-
/* @__PURE__ */ jsx33(ListItem, { id, className: List_default.item, children: label2 })
|
|
32788
|
-
] },
|
|
32796
|
+
/* @__PURE__ */ jsx33(ListItem, { id: id2, className: List_default.item, children: label2 })
|
|
32797
|
+
] }, id2);
|
|
32789
32798
|
})
|
|
32790
32799
|
}
|
|
32791
32800
|
)
|