@umami/react-zen 0.220.0 → 0.221.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 +213 -163
- package/dist/index.mjs +141 -91
- package/package.json +1 -1
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.6.0_react@19.2.3/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.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports) {
|
|
37
|
-
var
|
|
38
|
-
var React5 =
|
|
37
|
+
var import_react205 = __toESM(require("react"));
|
|
38
|
+
var React5 = import_react205.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.6.0_react@19.2.3/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.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
|
|
90
|
-
var
|
|
90
|
+
var import_react205 = __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_react205.default, objectIs = "function" === typeof Object.is ? Object.is : is2, useState18 = React5.useState, useEffect13 = React5.useEffect, useLayoutEffect3 = React5.useLayoutEffect, useDebugValue = React5.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
145
145
|
exports.useSyncExternalStore = void 0 !== React5.useSyncExternalStore ? React5.useSyncExternalStore : shim;
|
|
146
146
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
147
147
|
})();
|
|
@@ -32643,10 +32643,55 @@ function Container({
|
|
|
32643
32643
|
}
|
|
32644
32644
|
|
|
32645
32645
|
// src/components/DataCard.tsx
|
|
32646
|
-
var
|
|
32646
|
+
var import_react169 = require("react");
|
|
32647
32647
|
|
|
32648
32648
|
// src/components/Grid.tsx
|
|
32649
|
+
var import_react168 = require("react");
|
|
32649
32650
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
32651
|
+
var PRESET_VALUES = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "none", "subgrid"];
|
|
32652
|
+
var BREAKPOINT_QUERIES = {
|
|
32653
|
+
base: "",
|
|
32654
|
+
sm: "@media (min-width: 640px)",
|
|
32655
|
+
md: "@media (min-width: 768px)",
|
|
32656
|
+
lg: "@media (min-width: 1024px)",
|
|
32657
|
+
xl: "@media (min-width: 1280px)",
|
|
32658
|
+
"2xl": "@media (min-width: 1536px)"
|
|
32659
|
+
};
|
|
32660
|
+
function isPresetValue(value) {
|
|
32661
|
+
return PRESET_VALUES.includes(value);
|
|
32662
|
+
}
|
|
32663
|
+
function isResponsiveObject(value) {
|
|
32664
|
+
return value !== void 0 && typeof value !== "string" && typeof value === "object";
|
|
32665
|
+
}
|
|
32666
|
+
function hasCustomResponsiveValues(value) {
|
|
32667
|
+
if (!isResponsiveObject(value)) return false;
|
|
32668
|
+
return Object.values(value).some((v) => typeof v === "string" && !isPresetValue(v));
|
|
32669
|
+
}
|
|
32670
|
+
function generateResponsiveStyles(id, columns, rows) {
|
|
32671
|
+
const styles = [];
|
|
32672
|
+
const breakpoints2 = ["base", "sm", "md", "lg", "xl", "2xl"];
|
|
32673
|
+
for (const bp of breakpoints2) {
|
|
32674
|
+
const rules = [];
|
|
32675
|
+
if (isResponsiveObject(columns)) {
|
|
32676
|
+
const colValue = columns[bp];
|
|
32677
|
+
if (colValue && !isPresetValue(colValue)) {
|
|
32678
|
+
rules.push(`grid-template-columns: ${colValue}`);
|
|
32679
|
+
}
|
|
32680
|
+
}
|
|
32681
|
+
if (isResponsiveObject(rows)) {
|
|
32682
|
+
const rowValue = rows[bp];
|
|
32683
|
+
if (rowValue && !isPresetValue(rowValue)) {
|
|
32684
|
+
rules.push(`grid-template-rows: ${rowValue}`);
|
|
32685
|
+
}
|
|
32686
|
+
}
|
|
32687
|
+
if (rules.length > 0) {
|
|
32688
|
+
const query = BREAKPOINT_QUERIES[bp];
|
|
32689
|
+
const ruleBlock = `.${id} { ${rules.join("; ")}; }`;
|
|
32690
|
+
styles.push(query ? `${query} { ${ruleBlock} }` : ruleBlock);
|
|
32691
|
+
}
|
|
32692
|
+
}
|
|
32693
|
+
return styles.join(" ");
|
|
32694
|
+
}
|
|
32650
32695
|
function Grid({
|
|
32651
32696
|
display = "grid",
|
|
32652
32697
|
justifyContent,
|
|
@@ -32665,12 +32710,13 @@ function Grid({
|
|
|
32665
32710
|
children,
|
|
32666
32711
|
...props
|
|
32667
32712
|
}) {
|
|
32668
|
-
const
|
|
32669
|
-
|
|
32670
|
-
);
|
|
32671
|
-
const isCustomRows = typeof rows === "string" && !
|
|
32672
|
-
|
|
32673
|
-
);
|
|
32713
|
+
const reactId = (0, import_react168.useId)();
|
|
32714
|
+
const id = `zen-grid-${reactId.replace(/:/g, "")}`;
|
|
32715
|
+
const isCustomColumns = typeof columns === "string" && !isPresetValue(columns);
|
|
32716
|
+
const isCustomRows = typeof rows === "string" && !isPresetValue(rows);
|
|
32717
|
+
const hasResponsiveCustomColumns = hasCustomResponsiveValues(columns);
|
|
32718
|
+
const hasResponsiveCustomRows = hasCustomResponsiveValues(rows);
|
|
32719
|
+
const needsStyleTag = hasResponsiveCustomColumns || hasResponsiveCustomRows;
|
|
32674
32720
|
const classes = cn(
|
|
32675
32721
|
mapDisplay(display),
|
|
32676
32722
|
mapJustifyContent(justifyContent),
|
|
@@ -32681,8 +32727,9 @@ function Grid({
|
|
|
32681
32727
|
mapGap(gapX, "x"),
|
|
32682
32728
|
mapGap(gapY, "y"),
|
|
32683
32729
|
mapGridAutoFlow(autoFlow),
|
|
32684
|
-
!isCustomColumns && mapGridColumns(columns),
|
|
32685
|
-
!isCustomRows && mapGridRows(rows),
|
|
32730
|
+
!isCustomColumns && !hasResponsiveCustomColumns && mapGridColumns(columns),
|
|
32731
|
+
!isCustomRows && !hasResponsiveCustomRows && mapGridRows(rows),
|
|
32732
|
+
needsStyleTag && id,
|
|
32686
32733
|
className
|
|
32687
32734
|
);
|
|
32688
32735
|
const inlineStyles = {
|
|
@@ -32692,7 +32739,10 @@ function Grid({
|
|
|
32692
32739
|
...areas && { gridTemplateAreas: areas }
|
|
32693
32740
|
};
|
|
32694
32741
|
const hasInlineStyles = isCustomColumns || isCustomRows || areas || style && Object.keys(style).length > 0;
|
|
32695
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.
|
|
32742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
32743
|
+
needsStyleTag && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("style", { children: generateResponsiveStyles(id, columns, rows) }),
|
|
32744
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box, { ...props, className: classes, style: hasInlineStyles ? inlineStyles : void 0, children })
|
|
32745
|
+
] });
|
|
32696
32746
|
}
|
|
32697
32747
|
|
|
32698
32748
|
// src/lib/utils.ts
|
|
@@ -32723,7 +32773,7 @@ function DataCard({ data = [], labelWidth = "auto", ...props }) {
|
|
|
32723
32773
|
padding: "6",
|
|
32724
32774
|
...props,
|
|
32725
32775
|
children: rows.map((row, index) => {
|
|
32726
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
32776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react169.Fragment, { children: [
|
|
32727
32777
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Row, { paddingY: "3", border: "bottom", borderColor: "muted", paddingRight: "6", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { weight: "bold", children: row?.label }) }),
|
|
32728
32778
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Row, { paddingY: "3", border: "bottom", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { children: row?.value }) })
|
|
32729
32779
|
] }, index);
|
|
@@ -32733,7 +32783,7 @@ function DataCard({ data = [], labelWidth = "auto", ...props }) {
|
|
|
32733
32783
|
}
|
|
32734
32784
|
|
|
32735
32785
|
// src/components/DataTable.tsx
|
|
32736
|
-
var
|
|
32786
|
+
var import_react170 = require("react");
|
|
32737
32787
|
|
|
32738
32788
|
// src/components/Table.tsx
|
|
32739
32789
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
@@ -32817,7 +32867,7 @@ function TableCell({ children, className, align, ...props }) {
|
|
|
32817
32867
|
|
|
32818
32868
|
// src/components/DataTable.tsx
|
|
32819
32869
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
32820
|
-
var
|
|
32870
|
+
var import_react171 = require("react");
|
|
32821
32871
|
function DataTable({
|
|
32822
32872
|
data = [],
|
|
32823
32873
|
displayMode = "table",
|
|
@@ -32827,7 +32877,7 @@ function DataTable({
|
|
|
32827
32877
|
}) {
|
|
32828
32878
|
const rows = mapIdProperty(data);
|
|
32829
32879
|
const widths = [];
|
|
32830
|
-
const columns =
|
|
32880
|
+
const columns = import_react170.Children.map(children, (child) => {
|
|
32831
32881
|
if (child) {
|
|
32832
32882
|
widths.push(child?.props?.width || "1fr");
|
|
32833
32883
|
return { ...child?.props };
|
|
@@ -32849,7 +32899,7 @@ function DataTable({
|
|
|
32849
32899
|
if (hidden) {
|
|
32850
32900
|
return null;
|
|
32851
32901
|
}
|
|
32852
|
-
return /* @__PURE__ */ (0,
|
|
32902
|
+
return /* @__PURE__ */ (0, import_react171.createElement)(TableColumn, { ...columnProps, key: id, id }, label);
|
|
32853
32903
|
}) }),
|
|
32854
32904
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableBody, { children: rows.map((row, index) => {
|
|
32855
32905
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
|
|
@@ -32857,14 +32907,14 @@ function DataTable({
|
|
|
32857
32907
|
return null;
|
|
32858
32908
|
}
|
|
32859
32909
|
const value = typeof children2 === "function" ? children2(row, index) : children2 || row[id];
|
|
32860
|
-
return /* @__PURE__ */ (0,
|
|
32910
|
+
return /* @__PURE__ */ (0, import_react171.createElement)(
|
|
32861
32911
|
TableCell,
|
|
32862
32912
|
{
|
|
32863
32913
|
...cellProps,
|
|
32864
32914
|
key: id,
|
|
32865
32915
|
className: cn("items-center", className2)
|
|
32866
32916
|
},
|
|
32867
|
-
as ? (0,
|
|
32917
|
+
as ? (0, import_react170.createElement)(as, {}, value) : value
|
|
32868
32918
|
);
|
|
32869
32919
|
}) }, index);
|
|
32870
32920
|
}) })
|
|
@@ -32898,7 +32948,7 @@ function Dots({ size = "md", className, color: _color, ...props }) {
|
|
|
32898
32948
|
}
|
|
32899
32949
|
|
|
32900
32950
|
// src/components/FloatingTooltip.tsx
|
|
32901
|
-
var
|
|
32951
|
+
var import_react172 = require("react");
|
|
32902
32952
|
|
|
32903
32953
|
// src/components/Tooltip.tsx
|
|
32904
32954
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
@@ -32928,8 +32978,8 @@ function TooltipBubble({ children, className, color: _color, ...props }) {
|
|
|
32928
32978
|
// src/components/FloatingTooltip.tsx
|
|
32929
32979
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
32930
32980
|
function FloatingTooltip({ className, style, children, ...props }) {
|
|
32931
|
-
const [position, setPosition] = (0,
|
|
32932
|
-
(0,
|
|
32981
|
+
const [position, setPosition] = (0, import_react172.useState)({ x: -1e3, y: -1e3 });
|
|
32982
|
+
(0, import_react172.useEffect)(() => {
|
|
32933
32983
|
const handler = (e) => {
|
|
32934
32984
|
setPosition({ x: e.clientX, y: e.clientY });
|
|
32935
32985
|
};
|
|
@@ -32950,10 +33000,10 @@ function FloatingTooltip({ className, style, children, ...props }) {
|
|
|
32950
33000
|
}
|
|
32951
33001
|
|
|
32952
33002
|
// src/components/forms/Form.tsx
|
|
32953
|
-
var
|
|
33003
|
+
var import_react174 = require("react");
|
|
32954
33004
|
|
|
32955
33005
|
// node_modules/.pnpm/react-hook-form@7.68.0_react@19.2.3/node_modules/react-hook-form/dist/index.esm.mjs
|
|
32956
|
-
var
|
|
33006
|
+
var import_react173 = __toESM(require("react"), 1);
|
|
32957
33007
|
var isCheckBoxInput = (element) => element.type === "checkbox";
|
|
32958
33008
|
var isDateObject = (value) => value instanceof Date;
|
|
32959
33009
|
var isNullOrUndefined = (value) => value == null;
|
|
@@ -33041,12 +33091,12 @@ var INPUT_VALIDATION_RULES = {
|
|
|
33041
33091
|
required: "required",
|
|
33042
33092
|
validate: "validate"
|
|
33043
33093
|
};
|
|
33044
|
-
var HookFormContext =
|
|
33094
|
+
var HookFormContext = import_react173.default.createContext(null);
|
|
33045
33095
|
HookFormContext.displayName = "HookFormContext";
|
|
33046
|
-
var useFormContext = () =>
|
|
33096
|
+
var useFormContext = () => import_react173.default.useContext(HookFormContext);
|
|
33047
33097
|
var FormProvider = (props) => {
|
|
33048
33098
|
const { children, ...data } = props;
|
|
33049
|
-
return
|
|
33099
|
+
return import_react173.default.createElement(HookFormContext.Provider, { value: data }, children);
|
|
33050
33100
|
};
|
|
33051
33101
|
var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {
|
|
33052
33102
|
const result = {
|
|
@@ -33066,12 +33116,12 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
|
|
|
33066
33116
|
}
|
|
33067
33117
|
return result;
|
|
33068
33118
|
};
|
|
33069
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
33119
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react173.default.useLayoutEffect : import_react173.default.useEffect;
|
|
33070
33120
|
function useFormState(props) {
|
|
33071
33121
|
const methods = useFormContext();
|
|
33072
33122
|
const { control = methods.control, disabled, name, exact } = props || {};
|
|
33073
|
-
const [formState, updateFormState] =
|
|
33074
|
-
const _localProxyFormState =
|
|
33123
|
+
const [formState, updateFormState] = import_react173.default.useState(control._formState);
|
|
33124
|
+
const _localProxyFormState = import_react173.default.useRef({
|
|
33075
33125
|
isDirty: false,
|
|
33076
33126
|
isLoading: false,
|
|
33077
33127
|
dirtyFields: false,
|
|
@@ -33092,10 +33142,10 @@ function useFormState(props) {
|
|
|
33092
33142
|
});
|
|
33093
33143
|
}
|
|
33094
33144
|
}), [name, disabled, exact]);
|
|
33095
|
-
|
|
33145
|
+
import_react173.default.useEffect(() => {
|
|
33096
33146
|
_localProxyFormState.current.isValid && control._setValid(true);
|
|
33097
33147
|
}, [control]);
|
|
33098
|
-
return
|
|
33148
|
+
return import_react173.default.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);
|
|
33099
33149
|
}
|
|
33100
33150
|
var isString = (value) => typeof value === "string";
|
|
33101
33151
|
var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {
|
|
@@ -33144,21 +33194,21 @@ function deepEqual(object1, object2, _internal_visited = /* @__PURE__ */ new Wea
|
|
|
33144
33194
|
function useWatch(props) {
|
|
33145
33195
|
const methods = useFormContext();
|
|
33146
33196
|
const { control = methods.control, name, defaultValue, disabled, exact, compute } = props || {};
|
|
33147
|
-
const _defaultValue =
|
|
33148
|
-
const _compute =
|
|
33149
|
-
const _computeFormValues =
|
|
33150
|
-
const _prevControl =
|
|
33151
|
-
const _prevName =
|
|
33197
|
+
const _defaultValue = import_react173.default.useRef(defaultValue);
|
|
33198
|
+
const _compute = import_react173.default.useRef(compute);
|
|
33199
|
+
const _computeFormValues = import_react173.default.useRef(void 0);
|
|
33200
|
+
const _prevControl = import_react173.default.useRef(control);
|
|
33201
|
+
const _prevName = import_react173.default.useRef(name);
|
|
33152
33202
|
_compute.current = compute;
|
|
33153
|
-
const [value, updateValue] =
|
|
33203
|
+
const [value, updateValue] = import_react173.default.useState(() => {
|
|
33154
33204
|
const defaultValue2 = control._getWatch(name, _defaultValue.current);
|
|
33155
33205
|
return _compute.current ? _compute.current(defaultValue2) : defaultValue2;
|
|
33156
33206
|
});
|
|
33157
|
-
const getCurrentOutput =
|
|
33207
|
+
const getCurrentOutput = import_react173.default.useCallback((values) => {
|
|
33158
33208
|
const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
|
|
33159
33209
|
return _compute.current ? _compute.current(formValues) : formValues;
|
|
33160
33210
|
}, [control._formValues, control._names, name]);
|
|
33161
|
-
const refreshValue =
|
|
33211
|
+
const refreshValue = import_react173.default.useCallback((values) => {
|
|
33162
33212
|
if (!disabled) {
|
|
33163
33213
|
const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
|
|
33164
33214
|
if (_compute.current) {
|
|
@@ -33189,10 +33239,10 @@ function useWatch(props) {
|
|
|
33189
33239
|
}
|
|
33190
33240
|
});
|
|
33191
33241
|
}, [control, exact, name, refreshValue]);
|
|
33192
|
-
|
|
33242
|
+
import_react173.default.useEffect(() => control._removeUnmounted());
|
|
33193
33243
|
const controlChanged = _prevControl.current !== control;
|
|
33194
33244
|
const prevName = _prevName.current;
|
|
33195
|
-
const computedOutput =
|
|
33245
|
+
const computedOutput = import_react173.default.useMemo(() => {
|
|
33196
33246
|
if (disabled) {
|
|
33197
33247
|
return null;
|
|
33198
33248
|
}
|
|
@@ -33206,7 +33256,7 @@ function useController(props) {
|
|
|
33206
33256
|
const methods = useFormContext();
|
|
33207
33257
|
const { name, disabled, control = methods.control, shouldUnregister, defaultValue, exact = true } = props;
|
|
33208
33258
|
const isArrayField = isNameInFieldArray(control._names.array, name);
|
|
33209
|
-
const defaultValueMemo =
|
|
33259
|
+
const defaultValueMemo = import_react173.default.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
|
|
33210
33260
|
const value = useWatch({
|
|
33211
33261
|
control,
|
|
33212
33262
|
name,
|
|
@@ -33218,15 +33268,15 @@ function useController(props) {
|
|
|
33218
33268
|
name,
|
|
33219
33269
|
exact
|
|
33220
33270
|
});
|
|
33221
|
-
const _props =
|
|
33222
|
-
const _previousNameRef =
|
|
33223
|
-
const _registerProps =
|
|
33271
|
+
const _props = import_react173.default.useRef(props);
|
|
33272
|
+
const _previousNameRef = import_react173.default.useRef(void 0);
|
|
33273
|
+
const _registerProps = import_react173.default.useRef(control.register(name, {
|
|
33224
33274
|
...props.rules,
|
|
33225
33275
|
value,
|
|
33226
33276
|
...isBoolean(props.disabled) ? { disabled: props.disabled } : {}
|
|
33227
33277
|
}));
|
|
33228
33278
|
_props.current = props;
|
|
33229
|
-
const fieldState =
|
|
33279
|
+
const fieldState = import_react173.default.useMemo(() => Object.defineProperties({}, {
|
|
33230
33280
|
invalid: {
|
|
33231
33281
|
enumerable: true,
|
|
33232
33282
|
get: () => !!get(formState.errors, name)
|
|
@@ -33248,21 +33298,21 @@ function useController(props) {
|
|
|
33248
33298
|
get: () => get(formState.errors, name)
|
|
33249
33299
|
}
|
|
33250
33300
|
}), [formState, name]);
|
|
33251
|
-
const onChange =
|
|
33301
|
+
const onChange = import_react173.default.useCallback((event) => _registerProps.current.onChange({
|
|
33252
33302
|
target: {
|
|
33253
33303
|
value: getEventValue(event),
|
|
33254
33304
|
name
|
|
33255
33305
|
},
|
|
33256
33306
|
type: EVENTS.CHANGE
|
|
33257
33307
|
}), [name]);
|
|
33258
|
-
const onBlur =
|
|
33308
|
+
const onBlur = import_react173.default.useCallback(() => _registerProps.current.onBlur({
|
|
33259
33309
|
target: {
|
|
33260
33310
|
value: get(control._formValues, name),
|
|
33261
33311
|
name
|
|
33262
33312
|
},
|
|
33263
33313
|
type: EVENTS.BLUR
|
|
33264
33314
|
}), [name, control._formValues]);
|
|
33265
|
-
const ref =
|
|
33315
|
+
const ref = import_react173.default.useCallback((elm) => {
|
|
33266
33316
|
const field2 = get(control._fields, name);
|
|
33267
33317
|
if (field2 && elm) {
|
|
33268
33318
|
field2._f.ref = {
|
|
@@ -33273,7 +33323,7 @@ function useController(props) {
|
|
|
33273
33323
|
};
|
|
33274
33324
|
}
|
|
33275
33325
|
}, [control._fields, name]);
|
|
33276
|
-
const field =
|
|
33326
|
+
const field = import_react173.default.useMemo(() => ({
|
|
33277
33327
|
name,
|
|
33278
33328
|
value,
|
|
33279
33329
|
...isBoolean(disabled) || formState.disabled ? { disabled: formState.disabled || disabled } : {},
|
|
@@ -33281,7 +33331,7 @@ function useController(props) {
|
|
|
33281
33331
|
onBlur,
|
|
33282
33332
|
ref
|
|
33283
33333
|
}), [name, disabled, formState.disabled, onChange, onBlur, ref, value]);
|
|
33284
|
-
|
|
33334
|
+
import_react173.default.useEffect(() => {
|
|
33285
33335
|
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
|
33286
33336
|
const previousName = _previousNameRef.current;
|
|
33287
33337
|
if (previousName && previousName !== name && !isArrayField) {
|
|
@@ -33311,13 +33361,13 @@ function useController(props) {
|
|
|
33311
33361
|
(isArrayField ? _shouldUnregisterField && !control._state.action : _shouldUnregisterField) ? control.unregister(name) : updateMounted(name, false);
|
|
33312
33362
|
};
|
|
33313
33363
|
}, [name, control, isArrayField, shouldUnregister]);
|
|
33314
|
-
|
|
33364
|
+
import_react173.default.useEffect(() => {
|
|
33315
33365
|
control._setDisabledField({
|
|
33316
33366
|
disabled,
|
|
33317
33367
|
name
|
|
33318
33368
|
});
|
|
33319
33369
|
}, [disabled, name, control]);
|
|
33320
|
-
return
|
|
33370
|
+
return import_react173.default.useMemo(() => ({
|
|
33321
33371
|
field,
|
|
33322
33372
|
formState,
|
|
33323
33373
|
fieldState
|
|
@@ -34699,11 +34749,11 @@ var updateAt = (fieldValues, index, value) => {
|
|
|
34699
34749
|
function useFieldArray(props) {
|
|
34700
34750
|
const methods = useFormContext();
|
|
34701
34751
|
const { control = methods.control, name, keyName = "id", shouldUnregister, rules } = props;
|
|
34702
|
-
const [fields, setFields] =
|
|
34703
|
-
const ids =
|
|
34704
|
-
const _actioned =
|
|
34752
|
+
const [fields, setFields] = import_react173.default.useState(control._getFieldArray(name));
|
|
34753
|
+
const ids = import_react173.default.useRef(control._getFieldArray(name).map(generateId));
|
|
34754
|
+
const _actioned = import_react173.default.useRef(false);
|
|
34705
34755
|
control._names.array.add(name);
|
|
34706
|
-
|
|
34756
|
+
import_react173.default.useMemo(() => rules && fields.length >= 0 && control.register(name, rules), [control, name, fields.length, rules]);
|
|
34707
34757
|
useIsomorphicLayoutEffect(() => control._subjects.array.subscribe({
|
|
34708
34758
|
next: ({ values, name: fieldArrayName }) => {
|
|
34709
34759
|
if (fieldArrayName === name || !fieldArrayName) {
|
|
@@ -34715,7 +34765,7 @@ function useFieldArray(props) {
|
|
|
34715
34765
|
}
|
|
34716
34766
|
}
|
|
34717
34767
|
}).unsubscribe, [control, name]);
|
|
34718
|
-
const updateValues =
|
|
34768
|
+
const updateValues = import_react173.default.useCallback((updatedFieldArrayValues) => {
|
|
34719
34769
|
_actioned.current = true;
|
|
34720
34770
|
control._setFieldArray(name, updatedFieldArrayValues);
|
|
34721
34771
|
}, [control, name]);
|
|
@@ -34803,7 +34853,7 @@ function useFieldArray(props) {
|
|
|
34803
34853
|
setFields([...updatedFieldArrayValues]);
|
|
34804
34854
|
control._setFieldArray(name, [...updatedFieldArrayValues], (data) => data, {}, true, false);
|
|
34805
34855
|
};
|
|
34806
|
-
|
|
34856
|
+
import_react173.default.useEffect(() => {
|
|
34807
34857
|
control._state.action = false;
|
|
34808
34858
|
isWatched(name, control._names) && control._subjects.state.next({
|
|
34809
34859
|
...control._formState
|
|
@@ -34844,7 +34894,7 @@ function useFieldArray(props) {
|
|
|
34844
34894
|
control._setValid();
|
|
34845
34895
|
_actioned.current = false;
|
|
34846
34896
|
}, [fields, name, control]);
|
|
34847
|
-
|
|
34897
|
+
import_react173.default.useEffect(() => {
|
|
34848
34898
|
!get(control._formValues, name) && control._setFieldArray(name);
|
|
34849
34899
|
return () => {
|
|
34850
34900
|
const updateMounted = (name2, value) => {
|
|
@@ -34857,24 +34907,24 @@ function useFieldArray(props) {
|
|
|
34857
34907
|
};
|
|
34858
34908
|
}, [name, control, keyName, shouldUnregister]);
|
|
34859
34909
|
return {
|
|
34860
|
-
swap:
|
|
34861
|
-
move:
|
|
34862
|
-
prepend:
|
|
34863
|
-
append:
|
|
34864
|
-
remove:
|
|
34865
|
-
insert:
|
|
34866
|
-
update:
|
|
34867
|
-
replace:
|
|
34868
|
-
fields:
|
|
34910
|
+
swap: import_react173.default.useCallback(swap, [updateValues, name, control]),
|
|
34911
|
+
move: import_react173.default.useCallback(move, [updateValues, name, control]),
|
|
34912
|
+
prepend: import_react173.default.useCallback(prepend, [updateValues, name, control]),
|
|
34913
|
+
append: import_react173.default.useCallback(append, [updateValues, name, control]),
|
|
34914
|
+
remove: import_react173.default.useCallback(remove, [updateValues, name, control]),
|
|
34915
|
+
insert: import_react173.default.useCallback(insert$1, [updateValues, name, control]),
|
|
34916
|
+
update: import_react173.default.useCallback(update3, [updateValues, name, control]),
|
|
34917
|
+
replace: import_react173.default.useCallback(replace, [updateValues, name, control]),
|
|
34918
|
+
fields: import_react173.default.useMemo(() => fields.map((field, index) => ({
|
|
34869
34919
|
...field,
|
|
34870
34920
|
[keyName]: ids.current[index] || generateId()
|
|
34871
34921
|
})), [fields, keyName])
|
|
34872
34922
|
};
|
|
34873
34923
|
}
|
|
34874
34924
|
function useForm(props = {}) {
|
|
34875
|
-
const _formControl =
|
|
34876
|
-
const _values =
|
|
34877
|
-
const [formState, updateFormState] =
|
|
34925
|
+
const _formControl = import_react173.default.useRef(void 0);
|
|
34926
|
+
const _values = import_react173.default.useRef(void 0);
|
|
34927
|
+
const [formState, updateFormState] = import_react173.default.useState({
|
|
34878
34928
|
isDirty: false,
|
|
34879
34929
|
isValidating: false,
|
|
34880
34930
|
isLoading: isFunction(props.defaultValues),
|
|
@@ -34923,8 +34973,8 @@ function useForm(props = {}) {
|
|
|
34923
34973
|
control._formState.isReady = true;
|
|
34924
34974
|
return sub;
|
|
34925
34975
|
}, [control]);
|
|
34926
|
-
|
|
34927
|
-
|
|
34976
|
+
import_react173.default.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
|
|
34977
|
+
import_react173.default.useEffect(() => {
|
|
34928
34978
|
if (props.mode) {
|
|
34929
34979
|
control._options.mode = props.mode;
|
|
34930
34980
|
}
|
|
@@ -34932,18 +34982,18 @@ function useForm(props = {}) {
|
|
|
34932
34982
|
control._options.reValidateMode = props.reValidateMode;
|
|
34933
34983
|
}
|
|
34934
34984
|
}, [control, props.mode, props.reValidateMode]);
|
|
34935
|
-
|
|
34985
|
+
import_react173.default.useEffect(() => {
|
|
34936
34986
|
if (props.errors) {
|
|
34937
34987
|
control._setErrors(props.errors);
|
|
34938
34988
|
control._focusError();
|
|
34939
34989
|
}
|
|
34940
34990
|
}, [control, props.errors]);
|
|
34941
|
-
|
|
34991
|
+
import_react173.default.useEffect(() => {
|
|
34942
34992
|
props.shouldUnregister && control._subjects.state.next({
|
|
34943
34993
|
values: control._getWatch()
|
|
34944
34994
|
});
|
|
34945
34995
|
}, [control, props.shouldUnregister]);
|
|
34946
|
-
|
|
34996
|
+
import_react173.default.useEffect(() => {
|
|
34947
34997
|
if (control._proxyFormState.isDirty) {
|
|
34948
34998
|
const isDirty = control._getDirty();
|
|
34949
34999
|
if (isDirty !== formState.isDirty) {
|
|
@@ -34953,7 +35003,7 @@ function useForm(props = {}) {
|
|
|
34953
35003
|
}
|
|
34954
35004
|
}
|
|
34955
35005
|
}, [control, formState.isDirty]);
|
|
34956
|
-
|
|
35006
|
+
import_react173.default.useEffect(() => {
|
|
34957
35007
|
var _a;
|
|
34958
35008
|
if (props.values && !deepEqual(props.values, _values.current)) {
|
|
34959
35009
|
control._reset(props.values, {
|
|
@@ -34969,7 +35019,7 @@ function useForm(props = {}) {
|
|
|
34969
35019
|
control._resetDefaultValues();
|
|
34970
35020
|
}
|
|
34971
35021
|
}, [control, props.values]);
|
|
34972
|
-
|
|
35022
|
+
import_react173.default.useEffect(() => {
|
|
34973
35023
|
if (!control._state.mount) {
|
|
34974
35024
|
control._setValid();
|
|
34975
35025
|
control._state.mount = true;
|
|
@@ -35031,10 +35081,10 @@ function Form({
|
|
|
35031
35081
|
});
|
|
35032
35082
|
const { handleSubmit } = formValues;
|
|
35033
35083
|
const onKeyDown = !onSubmit || preventSubmit ? (e) => e.key === "Enter" && e.preventDefault() : void 0;
|
|
35034
|
-
(0,
|
|
35084
|
+
(0, import_react174.useEffect)(() => {
|
|
35035
35085
|
formValues.reset(values);
|
|
35036
35086
|
}, [formValues, values]);
|
|
35037
|
-
(0,
|
|
35087
|
+
(0, import_react174.useEffect)(() => {
|
|
35038
35088
|
if (formValues.formState.isSubmitted) {
|
|
35039
35089
|
formValues.reset(void 0, { keepDirty: true, keepValues: true });
|
|
35040
35090
|
}
|
|
@@ -35075,7 +35125,7 @@ function FormController({ children, ...props }) {
|
|
|
35075
35125
|
}
|
|
35076
35126
|
|
|
35077
35127
|
// src/components/forms/FormField.tsx
|
|
35078
|
-
var
|
|
35128
|
+
var import_react175 = require("react");
|
|
35079
35129
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
35080
35130
|
function FormField({
|
|
35081
35131
|
id,
|
|
@@ -35095,13 +35145,13 @@ function FormField({
|
|
|
35095
35145
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Column, { ...props, gap: "1", className, children: [
|
|
35096
35146
|
label && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Label2, { htmlFor: fieldId, children: label }),
|
|
35097
35147
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormController, { name, control, rules, children: ({ field }) => {
|
|
35098
|
-
return
|
|
35148
|
+
return import_react175.Children.map(
|
|
35099
35149
|
typeof children === "function" ? children({ context, field }) : children,
|
|
35100
35150
|
(child) => {
|
|
35101
35151
|
if (!child) {
|
|
35102
35152
|
return null;
|
|
35103
35153
|
}
|
|
35104
|
-
return (0,
|
|
35154
|
+
return (0, import_react175.cloneElement)(child, { ...field, id: fieldId });
|
|
35105
35155
|
}
|
|
35106
35156
|
);
|
|
35107
35157
|
} }),
|
|
@@ -35226,7 +35276,7 @@ function FormSubmitButton({
|
|
|
35226
35276
|
}
|
|
35227
35277
|
|
|
35228
35278
|
// src/components/HoverTrigger.tsx
|
|
35229
|
-
var
|
|
35279
|
+
var import_react176 = require("react");
|
|
35230
35280
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
35231
35281
|
var CLOSE_DELAY = 500;
|
|
35232
35282
|
function HoverTrigger({
|
|
@@ -35237,12 +35287,12 @@ function HoverTrigger({
|
|
|
35237
35287
|
children
|
|
35238
35288
|
}) {
|
|
35239
35289
|
const [triggerElement, popupElement] = children;
|
|
35240
|
-
const triggerRef = (0,
|
|
35241
|
-
const [open, setOpen] = (0,
|
|
35242
|
-
const isOverMenu = (0,
|
|
35243
|
-
const isOverButton = (0,
|
|
35244
|
-
const timeout = (0,
|
|
35245
|
-
(0,
|
|
35290
|
+
const triggerRef = (0, import_react176.useRef)(null);
|
|
35291
|
+
const [open, setOpen] = (0, import_react176.useState)(isOpen);
|
|
35292
|
+
const isOverMenu = (0, import_react176.useRef)(false);
|
|
35293
|
+
const isOverButton = (0, import_react176.useRef)(false);
|
|
35294
|
+
const timeout = (0, import_react176.useRef)(null);
|
|
35295
|
+
(0, import_react176.useEffect)(() => {
|
|
35246
35296
|
if (isOpen !== open) {
|
|
35247
35297
|
setOpen(isOpen);
|
|
35248
35298
|
}
|
|
@@ -35285,7 +35335,7 @@ function HoverTrigger({
|
|
|
35285
35335
|
}
|
|
35286
35336
|
|
|
35287
35337
|
// src/components/hooks/useBreakpoint.ts
|
|
35288
|
-
var
|
|
35338
|
+
var import_react177 = require("react");
|
|
35289
35339
|
var breakpoints = {
|
|
35290
35340
|
sm: 640,
|
|
35291
35341
|
md: 768,
|
|
@@ -35295,8 +35345,8 @@ var breakpoints = {
|
|
|
35295
35345
|
};
|
|
35296
35346
|
var DEBOUNCE_DELAY_MS = 150;
|
|
35297
35347
|
function useBreakpoint() {
|
|
35298
|
-
const [breakpoint, setBreakpoint] = (0,
|
|
35299
|
-
const calculateBreakpoint = (0,
|
|
35348
|
+
const [breakpoint, setBreakpoint] = (0, import_react177.useState)(null);
|
|
35349
|
+
const calculateBreakpoint = (0, import_react177.useCallback)(() => {
|
|
35300
35350
|
if (typeof window === "undefined") {
|
|
35301
35351
|
return;
|
|
35302
35352
|
}
|
|
@@ -35309,7 +35359,7 @@ function useBreakpoint() {
|
|
|
35309
35359
|
}
|
|
35310
35360
|
setBreakpoint(currentBreakpoint);
|
|
35311
35361
|
}, []);
|
|
35312
|
-
(0,
|
|
35362
|
+
(0, import_react177.useEffect)(() => {
|
|
35313
35363
|
calculateBreakpoint();
|
|
35314
35364
|
const debouncedResize = debounce(calculateBreakpoint, DEBOUNCE_DELAY_MS);
|
|
35315
35365
|
window.addEventListener("resize", debouncedResize);
|
|
@@ -35321,10 +35371,10 @@ function useBreakpoint() {
|
|
|
35321
35371
|
}
|
|
35322
35372
|
|
|
35323
35373
|
// src/components/hooks/useDebounce.ts
|
|
35324
|
-
var
|
|
35374
|
+
var import_react178 = require("react");
|
|
35325
35375
|
function useDebounce(value, delay) {
|
|
35326
|
-
const [debouncedValue, setValue] = (0,
|
|
35327
|
-
(0,
|
|
35376
|
+
const [debouncedValue, setValue] = (0, import_react178.useState)(value);
|
|
35377
|
+
(0, import_react178.useEffect)(() => {
|
|
35328
35378
|
const timer = setTimeout(() => {
|
|
35329
35379
|
setValue(value);
|
|
35330
35380
|
}, delay);
|
|
@@ -35336,7 +35386,7 @@ function useDebounce(value, delay) {
|
|
|
35336
35386
|
}
|
|
35337
35387
|
|
|
35338
35388
|
// src/components/hooks/useTheme.ts
|
|
35339
|
-
var
|
|
35389
|
+
var import_react180 = require("react");
|
|
35340
35390
|
|
|
35341
35391
|
// node_modules/.pnpm/zustand@5.0.9_@types+react@_78841bed54d06c8a621d90b050fefecd/node_modules/zustand/esm/vanilla.mjs
|
|
35342
35392
|
var createStoreImpl = (createState2) => {
|
|
@@ -35363,15 +35413,15 @@ var createStoreImpl = (createState2) => {
|
|
|
35363
35413
|
var createStore = ((createState2) => createState2 ? createStoreImpl(createState2) : createStoreImpl);
|
|
35364
35414
|
|
|
35365
35415
|
// node_modules/.pnpm/zustand@5.0.9_@types+react@_78841bed54d06c8a621d90b050fefecd/node_modules/zustand/esm/react.mjs
|
|
35366
|
-
var
|
|
35416
|
+
var import_react179 = __toESM(require("react"), 1);
|
|
35367
35417
|
var identity = (arg) => arg;
|
|
35368
35418
|
function useStore(api, selector = identity) {
|
|
35369
|
-
const slice =
|
|
35419
|
+
const slice = import_react179.default.useSyncExternalStore(
|
|
35370
35420
|
api.subscribe,
|
|
35371
|
-
|
|
35372
|
-
|
|
35421
|
+
import_react179.default.useCallback(() => selector(api.getState()), [api, selector]),
|
|
35422
|
+
import_react179.default.useCallback(() => selector(api.getInitialState()), [api, selector])
|
|
35373
35423
|
);
|
|
35374
|
-
|
|
35424
|
+
import_react179.default.useDebugValue(slice);
|
|
35375
35425
|
return slice;
|
|
35376
35426
|
}
|
|
35377
35427
|
var createImpl = (createState2) => {
|
|
@@ -35436,10 +35486,10 @@ var useTheme = create((set2, get2) => ({
|
|
|
35436
35486
|
function useInitTheme(preferred, colorScheme) {
|
|
35437
35487
|
const initTheme = useTheme((s) => s.initTheme);
|
|
35438
35488
|
const syncTheme = useTheme((s) => s.syncTheme);
|
|
35439
|
-
(0,
|
|
35489
|
+
(0, import_react180.useLayoutEffect)(() => {
|
|
35440
35490
|
initTheme(preferred, colorScheme);
|
|
35441
35491
|
}, [preferred, colorScheme, initTheme]);
|
|
35442
|
-
(0,
|
|
35492
|
+
(0, import_react180.useEffect)(() => {
|
|
35443
35493
|
if (typeof window === "undefined") return;
|
|
35444
35494
|
const observer = new MutationObserver((mutations) => {
|
|
35445
35495
|
for (const mutation of mutations) {
|
|
@@ -35454,10 +35504,10 @@ function useInitTheme(preferred, colorScheme) {
|
|
|
35454
35504
|
}
|
|
35455
35505
|
|
|
35456
35506
|
// src/components/hooks/useToast.ts
|
|
35457
|
-
var
|
|
35507
|
+
var import_react197 = require("react");
|
|
35458
35508
|
|
|
35459
35509
|
// src/components/toast/ToastProvider.tsx
|
|
35460
|
-
var
|
|
35510
|
+
var import_react196 = require("react");
|
|
35461
35511
|
|
|
35462
35512
|
// node_modules/.pnpm/@react-spring+rafz@9.7.5/node_modules/@react-spring/rafz/dist/react-spring_rafz.modern.mjs
|
|
35463
35513
|
var updateQueue = makeQueue();
|
|
@@ -35618,7 +35668,6 @@ function eachSafely(values, each2) {
|
|
|
35618
35668
|
}
|
|
35619
35669
|
|
|
35620
35670
|
// node_modules/.pnpm/@react-spring+shared@9.7.5_react@19.2.3/node_modules/@react-spring/shared/dist/react-spring_shared.modern.mjs
|
|
35621
|
-
var import_react180 = require("react");
|
|
35622
35671
|
var import_react181 = require("react");
|
|
35623
35672
|
var import_react182 = require("react");
|
|
35624
35673
|
var import_react183 = require("react");
|
|
@@ -35626,6 +35675,7 @@ var import_react184 = require("react");
|
|
|
35626
35675
|
var import_react185 = require("react");
|
|
35627
35676
|
var import_react186 = require("react");
|
|
35628
35677
|
var import_react187 = require("react");
|
|
35678
|
+
var import_react188 = require("react");
|
|
35629
35679
|
var __defProp2 = Object.defineProperty;
|
|
35630
35680
|
var __export2 = (target, all) => {
|
|
35631
35681
|
for (var name in all)
|
|
@@ -36385,9 +36435,9 @@ function isAnimatedString(value) {
|
|
|
36385
36435
|
return is.str(value) && (value[0] == "#" || /\d/.test(value) || // Do not identify a CSS variable as an AnimatedString if its SSR
|
|
36386
36436
|
!isSSR() && cssVariableRegex.test(value) || value in (colors || {}));
|
|
36387
36437
|
}
|
|
36388
|
-
var useIsomorphicLayoutEffect2 = isSSR() ?
|
|
36438
|
+
var useIsomorphicLayoutEffect2 = isSSR() ? import_react184.useEffect : import_react184.useLayoutEffect;
|
|
36389
36439
|
var useIsMounted = () => {
|
|
36390
|
-
const isMounted = (0,
|
|
36440
|
+
const isMounted = (0, import_react183.useRef)(false);
|
|
36391
36441
|
useIsomorphicLayoutEffect2(() => {
|
|
36392
36442
|
isMounted.current = true;
|
|
36393
36443
|
return () => {
|
|
@@ -36397,7 +36447,7 @@ var useIsMounted = () => {
|
|
|
36397
36447
|
return isMounted;
|
|
36398
36448
|
};
|
|
36399
36449
|
function useForceUpdate() {
|
|
36400
|
-
const update3 = (0,
|
|
36450
|
+
const update3 = (0, import_react182.useState)()[1];
|
|
36401
36451
|
const isMounted = useIsMounted();
|
|
36402
36452
|
return () => {
|
|
36403
36453
|
if (isMounted.current) {
|
|
@@ -36406,13 +36456,13 @@ function useForceUpdate() {
|
|
|
36406
36456
|
};
|
|
36407
36457
|
}
|
|
36408
36458
|
function useMemoOne(getResult, inputs) {
|
|
36409
|
-
const [initial] = (0,
|
|
36459
|
+
const [initial] = (0, import_react185.useState)(
|
|
36410
36460
|
() => ({
|
|
36411
36461
|
inputs,
|
|
36412
36462
|
result: getResult()
|
|
36413
36463
|
})
|
|
36414
36464
|
);
|
|
36415
|
-
const committed = (0,
|
|
36465
|
+
const committed = (0, import_react185.useRef)();
|
|
36416
36466
|
const prevCache = committed.current;
|
|
36417
36467
|
let cache = prevCache;
|
|
36418
36468
|
if (cache) {
|
|
@@ -36428,7 +36478,7 @@ function useMemoOne(getResult, inputs) {
|
|
|
36428
36478
|
} else {
|
|
36429
36479
|
cache = initial;
|
|
36430
36480
|
}
|
|
36431
|
-
(0,
|
|
36481
|
+
(0, import_react185.useEffect)(() => {
|
|
36432
36482
|
committed.current = cache;
|
|
36433
36483
|
if (prevCache == initial) {
|
|
36434
36484
|
initial.inputs = initial.result = void 0;
|
|
@@ -36447,22 +36497,22 @@ function areInputsEqual(next, prev) {
|
|
|
36447
36497
|
}
|
|
36448
36498
|
return true;
|
|
36449
36499
|
}
|
|
36450
|
-
var useOnce = (effect) => (0,
|
|
36500
|
+
var useOnce = (effect) => (0, import_react186.useEffect)(effect, emptyDeps);
|
|
36451
36501
|
var emptyDeps = [];
|
|
36452
36502
|
function usePrev(value) {
|
|
36453
|
-
const prevRef = (0,
|
|
36454
|
-
(0,
|
|
36503
|
+
const prevRef = (0, import_react187.useRef)();
|
|
36504
|
+
(0, import_react187.useEffect)(() => {
|
|
36455
36505
|
prevRef.current = value;
|
|
36456
36506
|
});
|
|
36457
36507
|
return prevRef.current;
|
|
36458
36508
|
}
|
|
36459
36509
|
|
|
36460
36510
|
// node_modules/.pnpm/@react-spring+core@9.7.5_react@19.2.3/node_modules/@react-spring/core/dist/react-spring_core.modern.mjs
|
|
36461
|
-
var
|
|
36511
|
+
var import_react190 = require("react");
|
|
36462
36512
|
|
|
36463
36513
|
// node_modules/.pnpm/@react-spring+animated@9.7.5_react@19.2.3/node_modules/@react-spring/animated/dist/react-spring_animated.modern.mjs
|
|
36464
36514
|
var React3 = __toESM(require("react"), 1);
|
|
36465
|
-
var
|
|
36515
|
+
var import_react189 = require("react");
|
|
36466
36516
|
var $node = Symbol.for("Animated:node");
|
|
36467
36517
|
var isAnimated = (value) => !!value && value[$node] === value;
|
|
36468
36518
|
var getAnimated = (owner) => owner && owner[$node];
|
|
@@ -36649,10 +36699,10 @@ var withAnimated = (Component, host2) => {
|
|
|
36649
36699
|
// re-rendered on every animation frame.
|
|
36650
36700
|
!is.fun(Component) || Component.prototype && Component.prototype.isReactComponent
|
|
36651
36701
|
);
|
|
36652
|
-
return (0,
|
|
36653
|
-
const instanceRef = (0,
|
|
36702
|
+
return (0, import_react189.forwardRef)((givenProps, givenRef) => {
|
|
36703
|
+
const instanceRef = (0, import_react189.useRef)(null);
|
|
36654
36704
|
const ref = hasInstance && // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
36655
|
-
(0,
|
|
36705
|
+
(0, import_react189.useCallback)(
|
|
36656
36706
|
(value) => {
|
|
36657
36707
|
instanceRef.current = updateRef(givenRef, value);
|
|
36658
36708
|
},
|
|
@@ -36671,7 +36721,7 @@ var withAnimated = (Component, host2) => {
|
|
|
36671
36721
|
}
|
|
36672
36722
|
};
|
|
36673
36723
|
const observer = new PropsObserver(callback, deps);
|
|
36674
|
-
const observerRef = (0,
|
|
36724
|
+
const observerRef = (0, import_react189.useRef)();
|
|
36675
36725
|
useIsomorphicLayoutEffect2(() => {
|
|
36676
36726
|
observerRef.current = observer;
|
|
36677
36727
|
each(deps, (dep) => addFluidObserver(dep, observer));
|
|
@@ -36685,7 +36735,7 @@ var withAnimated = (Component, host2) => {
|
|
|
36685
36735
|
}
|
|
36686
36736
|
};
|
|
36687
36737
|
});
|
|
36688
|
-
(0,
|
|
36738
|
+
(0, import_react189.useEffect)(callback, []);
|
|
36689
36739
|
useOnce(() => () => {
|
|
36690
36740
|
const observer2 = observerRef.current;
|
|
36691
36741
|
each(observer2.deps, (dep) => removeFluidObserver(dep, observer2));
|
|
@@ -36761,11 +36811,11 @@ var getDisplayName = (arg) => is.str(arg) ? arg : arg && is.str(arg.displayName)
|
|
|
36761
36811
|
|
|
36762
36812
|
// node_modules/.pnpm/@react-spring+core@9.7.5_react@19.2.3/node_modules/@react-spring/core/dist/react-spring_core.modern.mjs
|
|
36763
36813
|
var React4 = __toESM(require("react"), 1);
|
|
36764
|
-
var import_react190 = require("react");
|
|
36765
36814
|
var import_react191 = require("react");
|
|
36766
|
-
var React22 = __toESM(require("react"), 1);
|
|
36767
36815
|
var import_react192 = require("react");
|
|
36816
|
+
var React22 = __toESM(require("react"), 1);
|
|
36768
36817
|
var import_react193 = require("react");
|
|
36818
|
+
var import_react194 = require("react");
|
|
36769
36819
|
function callProp(value, ...args) {
|
|
36770
36820
|
return is.fun(value) ? value(...args) : value;
|
|
36771
36821
|
}
|
|
@@ -38224,7 +38274,7 @@ var SpringContext = ({
|
|
|
38224
38274
|
children,
|
|
38225
38275
|
...props
|
|
38226
38276
|
}) => {
|
|
38227
|
-
const inherited = (0,
|
|
38277
|
+
const inherited = (0, import_react191.useContext)(ctx);
|
|
38228
38278
|
const pause = props.pause || !!inherited.pause, immediate = props.immediate || !!inherited.immediate;
|
|
38229
38279
|
props = useMemoOne(() => ({ pause, immediate }), [pause, immediate]);
|
|
38230
38280
|
const { Provider } = ctx;
|
|
@@ -38323,13 +38373,13 @@ function useTransition(data, props, deps) {
|
|
|
38323
38373
|
ref: propsRef,
|
|
38324
38374
|
config: propsConfig
|
|
38325
38375
|
} = propsFn ? propsFn() : props;
|
|
38326
|
-
const ref = (0,
|
|
38376
|
+
const ref = (0, import_react193.useMemo)(
|
|
38327
38377
|
() => propsFn || arguments.length == 3 ? SpringRef() : void 0,
|
|
38328
38378
|
[]
|
|
38329
38379
|
);
|
|
38330
38380
|
const items = toArray(data);
|
|
38331
38381
|
const transitions = [];
|
|
38332
|
-
const usedTransitions = (0,
|
|
38382
|
+
const usedTransitions = (0, import_react193.useRef)(null);
|
|
38333
38383
|
const prevTransitions = reset ? null : usedTransitions.current;
|
|
38334
38384
|
useIsomorphicLayoutEffect2(() => {
|
|
38335
38385
|
usedTransitions.current = transitions;
|
|
@@ -38400,8 +38450,8 @@ function useTransition(data, props, deps) {
|
|
|
38400
38450
|
const forceUpdate = useForceUpdate();
|
|
38401
38451
|
const defaultProps = getDefaultProps(props);
|
|
38402
38452
|
const changes = /* @__PURE__ */ new Map();
|
|
38403
|
-
const exitingTransitions = (0,
|
|
38404
|
-
const forceChange = (0,
|
|
38453
|
+
const exitingTransitions = (0, import_react193.useRef)(/* @__PURE__ */ new Map());
|
|
38454
|
+
const forceChange = (0, import_react193.useRef)(false);
|
|
38405
38455
|
each(transitions, (t, i) => {
|
|
38406
38456
|
const key = t.key;
|
|
38407
38457
|
const prevPhase = t.phase;
|
|
@@ -38491,7 +38541,7 @@ function useTransition(data, props, deps) {
|
|
|
38491
38541
|
changes.set(t, { phase, springs, payload });
|
|
38492
38542
|
}
|
|
38493
38543
|
});
|
|
38494
|
-
const context = (0,
|
|
38544
|
+
const context = (0, import_react193.useContext)(SpringContext);
|
|
38495
38545
|
const prevContext = usePrev(context);
|
|
38496
38546
|
const hasContext = context !== prevContext && hasProps(context);
|
|
38497
38547
|
useIsomorphicLayoutEffect2(() => {
|
|
@@ -39033,7 +39083,7 @@ var host = createHost(primitives, {
|
|
|
39033
39083
|
var animated = host.animated;
|
|
39034
39084
|
|
|
39035
39085
|
// src/components/toast/Toaster.tsx
|
|
39036
|
-
var
|
|
39086
|
+
var import_react195 = require("react");
|
|
39037
39087
|
|
|
39038
39088
|
// src/components/toast/Toast.tsx
|
|
39039
39089
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
@@ -39089,7 +39139,7 @@ var positionClasses = {
|
|
|
39089
39139
|
var AnimatedBox = animated(Box);
|
|
39090
39140
|
function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
39091
39141
|
const { toasts } = useToast();
|
|
39092
|
-
const [hovered, setHovered] = (0,
|
|
39142
|
+
const [hovered, setHovered] = (0, import_react195.useState)(false);
|
|
39093
39143
|
const transitions = useTransition(toasts, {
|
|
39094
39144
|
from: {
|
|
39095
39145
|
opacity: 0,
|
|
@@ -39102,7 +39152,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
39102
39152
|
},
|
|
39103
39153
|
config: { duration: 100 }
|
|
39104
39154
|
});
|
|
39105
|
-
(0,
|
|
39155
|
+
(0, import_react195.useEffect)(() => {
|
|
39106
39156
|
if (duration) {
|
|
39107
39157
|
const timeout = setInterval(() => {
|
|
39108
39158
|
if (hovered || !toasts.length) return;
|
|
@@ -39135,7 +39185,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
39135
39185
|
|
|
39136
39186
|
// src/components/toast/ToastProvider.tsx
|
|
39137
39187
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
39138
|
-
var ToastContext = (0,
|
|
39188
|
+
var ToastContext = (0, import_react196.createContext)({});
|
|
39139
39189
|
function ToastProvider({ children, ...props }) {
|
|
39140
39190
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(ToastContext.Provider, { value: props, children: [
|
|
39141
39191
|
children,
|
|
@@ -39166,7 +39216,7 @@ function displayToast(message, { duration = TOAST_DURATION, ...options } = {}) {
|
|
|
39166
39216
|
}
|
|
39167
39217
|
function useToast() {
|
|
39168
39218
|
const { toasts } = store();
|
|
39169
|
-
const config2 = (0,
|
|
39219
|
+
const config2 = (0, import_react197.useContext)(ToastContext);
|
|
39170
39220
|
const toast2 = (message, options) => {
|
|
39171
39221
|
displayToast(message, { ...options, ...config2 });
|
|
39172
39222
|
};
|
|
@@ -39363,11 +39413,11 @@ function Modal2({
|
|
|
39363
39413
|
}
|
|
39364
39414
|
|
|
39365
39415
|
// src/components/Navbar.tsx
|
|
39366
|
-
var
|
|
39416
|
+
var import_react198 = require("react");
|
|
39367
39417
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
39368
|
-
var NavbarContext = (0,
|
|
39418
|
+
var NavbarContext = (0, import_react198.createContext)(void 0);
|
|
39369
39419
|
var useNavigationContext = () => {
|
|
39370
|
-
const context = (0,
|
|
39420
|
+
const context = (0, import_react198.useContext)(NavbarContext);
|
|
39371
39421
|
if (!context) {
|
|
39372
39422
|
throw new Error("useNavigationContext must be used within a Navbar");
|
|
39373
39423
|
}
|
|
@@ -39380,7 +39430,7 @@ function Navbar({
|
|
|
39380
39430
|
color: _color,
|
|
39381
39431
|
...props
|
|
39382
39432
|
}) {
|
|
39383
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
39433
|
+
const [activeMenu, setActiveMenu] = (0, import_react198.useState)("");
|
|
39384
39434
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NavbarContext.Provider, { value: { activeMenu, setActiveMenu }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Row, { ...props, alignItems: "center", gap: "1", className, children }) });
|
|
39385
39435
|
}
|
|
39386
39436
|
function NavbarItem({
|
|
@@ -39428,9 +39478,9 @@ function NavbarItem({
|
|
|
39428
39478
|
}
|
|
39429
39479
|
|
|
39430
39480
|
// src/components/NavMenu.tsx
|
|
39431
|
-
var
|
|
39481
|
+
var import_react199 = require("react");
|
|
39432
39482
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
39433
|
-
var NavMenuContext = (0,
|
|
39483
|
+
var NavMenuContext = (0, import_react199.createContext)(null);
|
|
39434
39484
|
function NavMenu({ muteItems, onItemClick, className, children, ...props }) {
|
|
39435
39485
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NavMenuContext.Provider, { value: { onItemClick }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Column, { ...props, color: muteItems ? "muted" : void 0, className, children }) });
|
|
39436
39486
|
}
|
|
@@ -39442,7 +39492,7 @@ function NavMenuGroup({
|
|
|
39442
39492
|
children,
|
|
39443
39493
|
...props
|
|
39444
39494
|
}) {
|
|
39445
|
-
const [minimized, setMinimized] = (0,
|
|
39495
|
+
const [minimized, setMinimized] = (0, import_react199.useState)(!!isMinimized);
|
|
39446
39496
|
const handleClick = () => {
|
|
39447
39497
|
if (allowMinimize) {
|
|
39448
39498
|
setMinimized((state2) => !state2);
|
|
@@ -39478,7 +39528,7 @@ function NavMenuGroup({
|
|
|
39478
39528
|
);
|
|
39479
39529
|
}
|
|
39480
39530
|
function NavMenuItem({ isSelected, className, children, ...props }) {
|
|
39481
|
-
const { onItemClick } = (0,
|
|
39531
|
+
const { onItemClick } = (0, import_react199.useContext)(NavMenuContext);
|
|
39482
39532
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
39483
39533
|
Row,
|
|
39484
39534
|
{
|
|
@@ -39499,7 +39549,7 @@ function NavMenuItem({ isSelected, className, children, ...props }) {
|
|
|
39499
39549
|
}
|
|
39500
39550
|
|
|
39501
39551
|
// src/components/PasswordField.tsx
|
|
39502
|
-
var
|
|
39552
|
+
var import_react200 = require("react");
|
|
39503
39553
|
|
|
39504
39554
|
// src/components/svg/EyeSlash.tsx
|
|
39505
39555
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
@@ -39570,7 +39620,7 @@ var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
|
39570
39620
|
// src/components/PasswordField.tsx
|
|
39571
39621
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
39572
39622
|
function PasswordField({ label, className, ...props }) {
|
|
39573
|
-
const [show, setShow] = (0,
|
|
39623
|
+
const [show, setShow] = (0, import_react200.useState)(false);
|
|
39574
39624
|
const type = show ? "text" : "password";
|
|
39575
39625
|
const handleShowPassword = () => setShow((state2) => !state2);
|
|
39576
39626
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
@@ -39695,7 +39745,7 @@ function Radio2({ children, className, ...props }) {
|
|
|
39695
39745
|
}
|
|
39696
39746
|
|
|
39697
39747
|
// src/components/SearchField.tsx
|
|
39698
|
-
var
|
|
39748
|
+
var import_react201 = require("react");
|
|
39699
39749
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
39700
39750
|
function SearchField2({
|
|
39701
39751
|
label,
|
|
@@ -39708,7 +39758,7 @@ function SearchField2({
|
|
|
39708
39758
|
className,
|
|
39709
39759
|
...props
|
|
39710
39760
|
}) {
|
|
39711
|
-
const [search, setSearch] = (0,
|
|
39761
|
+
const [search, setSearch] = (0, import_react201.useState)(defaultValue);
|
|
39712
39762
|
const searchValue = useDebounce(search, delay);
|
|
39713
39763
|
const handleChange = (value2) => {
|
|
39714
39764
|
setSearch(value2);
|
|
@@ -39722,7 +39772,7 @@ function SearchField2({
|
|
|
39722
39772
|
onSearch?.("");
|
|
39723
39773
|
onChange?.("");
|
|
39724
39774
|
};
|
|
39725
|
-
(0,
|
|
39775
|
+
(0, import_react201.useEffect)(() => {
|
|
39726
39776
|
if (delay > 0) {
|
|
39727
39777
|
onSearch?.(searchValue);
|
|
39728
39778
|
}
|
|
@@ -39763,7 +39813,7 @@ function SearchField2({
|
|
|
39763
39813
|
}
|
|
39764
39814
|
|
|
39765
39815
|
// src/components/Select.tsx
|
|
39766
|
-
var
|
|
39816
|
+
var import_react202 = require("react");
|
|
39767
39817
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
39768
39818
|
function Select2({
|
|
39769
39819
|
items = [],
|
|
@@ -39785,7 +39835,7 @@ function Select2({
|
|
|
39785
39835
|
children,
|
|
39786
39836
|
...props
|
|
39787
39837
|
}) {
|
|
39788
|
-
const [search, setSearch] = (0,
|
|
39838
|
+
const [search, setSearch] = (0, import_react202.useState)("");
|
|
39789
39839
|
const handleChange = (e) => {
|
|
39790
39840
|
onChange?.(e);
|
|
39791
39841
|
};
|
|
@@ -39858,9 +39908,9 @@ function Select2({
|
|
|
39858
39908
|
}
|
|
39859
39909
|
|
|
39860
39910
|
// src/components/Sidebar.tsx
|
|
39861
|
-
var
|
|
39911
|
+
var import_react203 = require("react");
|
|
39862
39912
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
39863
|
-
var SidebarContext = (0,
|
|
39913
|
+
var SidebarContext = (0, import_react203.createContext)(null);
|
|
39864
39914
|
function Sidebar({ isCollapsed, muteItems, className, children, ...props }) {
|
|
39865
39915
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SidebarContext.Provider, { value: { isCollapsed }, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
39866
39916
|
Column,
|
|
@@ -39909,7 +39959,7 @@ function SidebarItem({
|
|
|
39909
39959
|
children,
|
|
39910
39960
|
...props
|
|
39911
39961
|
}) {
|
|
39912
|
-
const { isCollapsed } = (0,
|
|
39962
|
+
const { isCollapsed } = (0, import_react203.useContext)(SidebarContext);
|
|
39913
39963
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)($4e3b923658d69c60$export$8c610744efcf8a1d, { delay: 0, closeDelay: 0, isDisabled: !isCollapsed, children: [
|
|
39914
39964
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)($f645667febf57a63$export$35a3bebf7ef2d934, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
39915
39965
|
Row,
|
|
@@ -40054,7 +40104,7 @@ function TabPanel2({ children, className, ...props }) {
|
|
|
40054
40104
|
}
|
|
40055
40105
|
|
|
40056
40106
|
// src/components/ThemeButton.tsx
|
|
40057
|
-
var
|
|
40107
|
+
var import_react204 = require("react");
|
|
40058
40108
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
40059
40109
|
function getElement(target) {
|
|
40060
40110
|
return "current" in target ? target.current : target;
|
|
@@ -40075,10 +40125,10 @@ function ThemeButton({
|
|
|
40075
40125
|
...props
|
|
40076
40126
|
}) {
|
|
40077
40127
|
const globalTheme = useTheme();
|
|
40078
|
-
const [localTheme, setLocalTheme] = (0,
|
|
40079
|
-
const initializedRef = (0,
|
|
40128
|
+
const [localTheme, setLocalTheme] = (0, import_react204.useState)(null);
|
|
40129
|
+
const initializedRef = (0, import_react204.useRef)(false);
|
|
40080
40130
|
const isLocal = !!target;
|
|
40081
|
-
(0,
|
|
40131
|
+
(0, import_react204.useEffect)(() => {
|
|
40082
40132
|
if (isLocal && target && !initializedRef.current) {
|
|
40083
40133
|
const element = getElement(target);
|
|
40084
40134
|
if (element) {
|