@umami/react-zen 0.219.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 +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +291 -168
- package/dist/index.mjs +223 -100
- package/package.json +1 -1
- package/styles.css +61 -0
- package/styles.full.css +1 -1
package/dist/index.js
CHANGED
|
@@ -34,14 +34,14 @@ 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
|
}
|
|
42
42
|
var objectIs = "function" === typeof Object.is ? Object.is : is2;
|
|
43
43
|
var useState18 = React5.useState;
|
|
44
|
-
var
|
|
44
|
+
var useEffect13 = React5.useEffect;
|
|
45
45
|
var useLayoutEffect3 = React5.useLayoutEffect;
|
|
46
46
|
var useDebugValue = React5.useDebugValue;
|
|
47
47
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
@@ -54,7 +54,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
54
54
|
},
|
|
55
55
|
[subscribe, value, getSnapshot]
|
|
56
56
|
);
|
|
57
|
-
|
|
57
|
+
useEffect13(
|
|
58
58
|
function() {
|
|
59
59
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
60
60
|
return subscribe(function() {
|
|
@@ -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;
|
|
@@ -115,7 +115,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
115
115
|
},
|
|
116
116
|
[subscribe, value, getSnapshot]
|
|
117
117
|
);
|
|
118
|
-
|
|
118
|
+
useEffect13(
|
|
119
119
|
function() {
|
|
120
120
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
121
121
|
return subscribe(function() {
|
|
@@ -141,7 +141,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
141
141
|
return getSnapshot();
|
|
142
142
|
}
|
|
143
143
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
144
|
-
var React5 =
|
|
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
|
})();
|
|
@@ -31102,6 +31102,38 @@ var gridAutoFlowMap = {
|
|
|
31102
31102
|
"row-dense": "grid-flow-row-dense",
|
|
31103
31103
|
"column-dense": "grid-flow-col-dense"
|
|
31104
31104
|
};
|
|
31105
|
+
var gridColumnsMap = {
|
|
31106
|
+
"1": "grid-cols-1",
|
|
31107
|
+
"2": "grid-cols-2",
|
|
31108
|
+
"3": "grid-cols-3",
|
|
31109
|
+
"4": "grid-cols-4",
|
|
31110
|
+
"5": "grid-cols-5",
|
|
31111
|
+
"6": "grid-cols-6",
|
|
31112
|
+
"7": "grid-cols-7",
|
|
31113
|
+
"8": "grid-cols-8",
|
|
31114
|
+
"9": "grid-cols-9",
|
|
31115
|
+
"10": "grid-cols-10",
|
|
31116
|
+
"11": "grid-cols-11",
|
|
31117
|
+
"12": "grid-cols-12",
|
|
31118
|
+
none: "grid-cols-none",
|
|
31119
|
+
subgrid: "grid-cols-subgrid"
|
|
31120
|
+
};
|
|
31121
|
+
var gridRowsMap = {
|
|
31122
|
+
"1": "grid-rows-1",
|
|
31123
|
+
"2": "grid-rows-2",
|
|
31124
|
+
"3": "grid-rows-3",
|
|
31125
|
+
"4": "grid-rows-4",
|
|
31126
|
+
"5": "grid-rows-5",
|
|
31127
|
+
"6": "grid-rows-6",
|
|
31128
|
+
"7": "grid-rows-7",
|
|
31129
|
+
"8": "grid-rows-8",
|
|
31130
|
+
"9": "grid-rows-9",
|
|
31131
|
+
"10": "grid-rows-10",
|
|
31132
|
+
"11": "grid-rows-11",
|
|
31133
|
+
"12": "grid-rows-12",
|
|
31134
|
+
none: "grid-rows-none",
|
|
31135
|
+
subgrid: "grid-rows-subgrid"
|
|
31136
|
+
};
|
|
31105
31137
|
var borderMap = {
|
|
31106
31138
|
true: "border border-edge",
|
|
31107
31139
|
none: "border-0",
|
|
@@ -31259,6 +31291,12 @@ function mapTextIndent(value) {
|
|
|
31259
31291
|
function mapGridAutoFlow(value) {
|
|
31260
31292
|
return mapResponsive(value, (v) => gridAutoFlowMap[v]);
|
|
31261
31293
|
}
|
|
31294
|
+
function mapGridColumns(value) {
|
|
31295
|
+
return mapResponsive(value, (v) => gridColumnsMap[v]);
|
|
31296
|
+
}
|
|
31297
|
+
function mapGridRows(value) {
|
|
31298
|
+
return mapResponsive(value, (v) => gridRowsMap[v]);
|
|
31299
|
+
}
|
|
31262
31300
|
function mapBorder(value) {
|
|
31263
31301
|
return mapResponsive(value, (v) => borderMap[String(v)]);
|
|
31264
31302
|
}
|
|
@@ -32605,10 +32643,55 @@ function Container({
|
|
|
32605
32643
|
}
|
|
32606
32644
|
|
|
32607
32645
|
// src/components/DataCard.tsx
|
|
32608
|
-
var
|
|
32646
|
+
var import_react169 = require("react");
|
|
32609
32647
|
|
|
32610
32648
|
// src/components/Grid.tsx
|
|
32649
|
+
var import_react168 = require("react");
|
|
32611
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
|
+
}
|
|
32612
32695
|
function Grid({
|
|
32613
32696
|
display = "grid",
|
|
32614
32697
|
justifyContent,
|
|
@@ -32627,6 +32710,13 @@ function Grid({
|
|
|
32627
32710
|
children,
|
|
32628
32711
|
...props
|
|
32629
32712
|
}) {
|
|
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;
|
|
32630
32720
|
const classes = cn(
|
|
32631
32721
|
mapDisplay(display),
|
|
32632
32722
|
mapJustifyContent(justifyContent),
|
|
@@ -32637,16 +32727,22 @@ function Grid({
|
|
|
32637
32727
|
mapGap(gapX, "x"),
|
|
32638
32728
|
mapGap(gapY, "y"),
|
|
32639
32729
|
mapGridAutoFlow(autoFlow),
|
|
32730
|
+
!isCustomColumns && !hasResponsiveCustomColumns && mapGridColumns(columns),
|
|
32731
|
+
!isCustomRows && !hasResponsiveCustomRows && mapGridRows(rows),
|
|
32732
|
+
needsStyleTag && id,
|
|
32640
32733
|
className
|
|
32641
32734
|
);
|
|
32642
32735
|
const inlineStyles = {
|
|
32643
32736
|
...style,
|
|
32644
|
-
...
|
|
32645
|
-
...
|
|
32737
|
+
...isCustomColumns && { gridTemplateColumns: columns },
|
|
32738
|
+
...isCustomRows && { gridTemplateRows: rows },
|
|
32646
32739
|
...areas && { gridTemplateAreas: areas }
|
|
32647
32740
|
};
|
|
32648
|
-
const hasInlineStyles =
|
|
32649
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.
|
|
32741
|
+
const hasInlineStyles = isCustomColumns || isCustomRows || areas || style && Object.keys(style).length > 0;
|
|
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
|
+
] });
|
|
32650
32746
|
}
|
|
32651
32747
|
|
|
32652
32748
|
// src/lib/utils.ts
|
|
@@ -32677,7 +32773,7 @@ function DataCard({ data = [], labelWidth = "auto", ...props }) {
|
|
|
32677
32773
|
padding: "6",
|
|
32678
32774
|
...props,
|
|
32679
32775
|
children: rows.map((row, index) => {
|
|
32680
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
32776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react169.Fragment, { children: [
|
|
32681
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 }) }),
|
|
32682
32778
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Row, { paddingY: "3", border: "bottom", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { children: row?.value }) })
|
|
32683
32779
|
] }, index);
|
|
@@ -32687,7 +32783,7 @@ function DataCard({ data = [], labelWidth = "auto", ...props }) {
|
|
|
32687
32783
|
}
|
|
32688
32784
|
|
|
32689
32785
|
// src/components/DataTable.tsx
|
|
32690
|
-
var
|
|
32786
|
+
var import_react170 = require("react");
|
|
32691
32787
|
|
|
32692
32788
|
// src/components/Table.tsx
|
|
32693
32789
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
@@ -32771,7 +32867,7 @@ function TableCell({ children, className, align, ...props }) {
|
|
|
32771
32867
|
|
|
32772
32868
|
// src/components/DataTable.tsx
|
|
32773
32869
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
32774
|
-
var
|
|
32870
|
+
var import_react171 = require("react");
|
|
32775
32871
|
function DataTable({
|
|
32776
32872
|
data = [],
|
|
32777
32873
|
displayMode = "table",
|
|
@@ -32781,7 +32877,7 @@ function DataTable({
|
|
|
32781
32877
|
}) {
|
|
32782
32878
|
const rows = mapIdProperty(data);
|
|
32783
32879
|
const widths = [];
|
|
32784
|
-
const columns =
|
|
32880
|
+
const columns = import_react170.Children.map(children, (child) => {
|
|
32785
32881
|
if (child) {
|
|
32786
32882
|
widths.push(child?.props?.width || "1fr");
|
|
32787
32883
|
return { ...child?.props };
|
|
@@ -32803,7 +32899,7 @@ function DataTable({
|
|
|
32803
32899
|
if (hidden) {
|
|
32804
32900
|
return null;
|
|
32805
32901
|
}
|
|
32806
|
-
return /* @__PURE__ */ (0,
|
|
32902
|
+
return /* @__PURE__ */ (0, import_react171.createElement)(TableColumn, { ...columnProps, key: id, id }, label);
|
|
32807
32903
|
}) }),
|
|
32808
32904
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableBody, { children: rows.map((row, index) => {
|
|
32809
32905
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
|
|
@@ -32811,14 +32907,14 @@ function DataTable({
|
|
|
32811
32907
|
return null;
|
|
32812
32908
|
}
|
|
32813
32909
|
const value = typeof children2 === "function" ? children2(row, index) : children2 || row[id];
|
|
32814
|
-
return /* @__PURE__ */ (0,
|
|
32910
|
+
return /* @__PURE__ */ (0, import_react171.createElement)(
|
|
32815
32911
|
TableCell,
|
|
32816
32912
|
{
|
|
32817
32913
|
...cellProps,
|
|
32818
32914
|
key: id,
|
|
32819
32915
|
className: cn("items-center", className2)
|
|
32820
32916
|
},
|
|
32821
|
-
as ? (0,
|
|
32917
|
+
as ? (0, import_react170.createElement)(as, {}, value) : value
|
|
32822
32918
|
);
|
|
32823
32919
|
}) }, index);
|
|
32824
32920
|
}) })
|
|
@@ -32852,25 +32948,38 @@ function Dots({ size = "md", className, color: _color, ...props }) {
|
|
|
32852
32948
|
}
|
|
32853
32949
|
|
|
32854
32950
|
// src/components/FloatingTooltip.tsx
|
|
32855
|
-
var
|
|
32951
|
+
var import_react172 = require("react");
|
|
32856
32952
|
|
|
32857
32953
|
// src/components/Tooltip.tsx
|
|
32858
32954
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
32859
32955
|
function Tooltip2({ children, className, showArrow, ...props }) {
|
|
32860
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.
|
|
32861
|
-
|
|
32862
|
-
|
|
32863
|
-
|
|
32864
|
-
|
|
32865
|
-
|
|
32956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)($4e3b923658d69c60$export$28c660c63b792dea, { ...props, className: cn("group", tooltip(), className), children: [
|
|
32957
|
+
showArrow && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)($44f671af83e7d9e0$export$746d02f47f4d381, { className: "w-2 h-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
32958
|
+
"svg",
|
|
32959
|
+
{
|
|
32960
|
+
viewBox: "0 0 8 8",
|
|
32961
|
+
className: cn(
|
|
32962
|
+
"block fill-surface-inverted",
|
|
32963
|
+
"group-data-[placement=bottom]:rotate-180",
|
|
32964
|
+
"group-data-[placement=left]:-rotate-90",
|
|
32965
|
+
"group-data-[placement=right]:rotate-90"
|
|
32966
|
+
),
|
|
32967
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("path", { d: "M0 0 L4 4 L8 0" })
|
|
32968
|
+
}
|
|
32969
|
+
) }),
|
|
32970
|
+
children,
|
|
32971
|
+
"for"
|
|
32866
32972
|
] });
|
|
32867
32973
|
}
|
|
32974
|
+
function TooltipBubble({ children, className, color: _color, ...props }) {
|
|
32975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box, { ...props, className, children });
|
|
32976
|
+
}
|
|
32868
32977
|
|
|
32869
32978
|
// src/components/FloatingTooltip.tsx
|
|
32870
32979
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
32871
32980
|
function FloatingTooltip({ className, style, children, ...props }) {
|
|
32872
|
-
const [position, setPosition] = (0,
|
|
32873
|
-
(0,
|
|
32981
|
+
const [position, setPosition] = (0, import_react172.useState)({ x: -1e3, y: -1e3 });
|
|
32982
|
+
(0, import_react172.useEffect)(() => {
|
|
32874
32983
|
const handler = (e) => {
|
|
32875
32984
|
setPosition({ x: e.clientX, y: e.clientY });
|
|
32876
32985
|
};
|
|
@@ -32891,10 +33000,10 @@ function FloatingTooltip({ className, style, children, ...props }) {
|
|
|
32891
33000
|
}
|
|
32892
33001
|
|
|
32893
33002
|
// src/components/forms/Form.tsx
|
|
32894
|
-
var
|
|
33003
|
+
var import_react174 = require("react");
|
|
32895
33004
|
|
|
32896
33005
|
// node_modules/.pnpm/react-hook-form@7.68.0_react@19.2.3/node_modules/react-hook-form/dist/index.esm.mjs
|
|
32897
|
-
var
|
|
33006
|
+
var import_react173 = __toESM(require("react"), 1);
|
|
32898
33007
|
var isCheckBoxInput = (element) => element.type === "checkbox";
|
|
32899
33008
|
var isDateObject = (value) => value instanceof Date;
|
|
32900
33009
|
var isNullOrUndefined = (value) => value == null;
|
|
@@ -32982,12 +33091,12 @@ var INPUT_VALIDATION_RULES = {
|
|
|
32982
33091
|
required: "required",
|
|
32983
33092
|
validate: "validate"
|
|
32984
33093
|
};
|
|
32985
|
-
var HookFormContext =
|
|
33094
|
+
var HookFormContext = import_react173.default.createContext(null);
|
|
32986
33095
|
HookFormContext.displayName = "HookFormContext";
|
|
32987
|
-
var useFormContext = () =>
|
|
33096
|
+
var useFormContext = () => import_react173.default.useContext(HookFormContext);
|
|
32988
33097
|
var FormProvider = (props) => {
|
|
32989
33098
|
const { children, ...data } = props;
|
|
32990
|
-
return
|
|
33099
|
+
return import_react173.default.createElement(HookFormContext.Provider, { value: data }, children);
|
|
32991
33100
|
};
|
|
32992
33101
|
var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {
|
|
32993
33102
|
const result = {
|
|
@@ -33007,12 +33116,12 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
|
|
|
33007
33116
|
}
|
|
33008
33117
|
return result;
|
|
33009
33118
|
};
|
|
33010
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
33119
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react173.default.useLayoutEffect : import_react173.default.useEffect;
|
|
33011
33120
|
function useFormState(props) {
|
|
33012
33121
|
const methods = useFormContext();
|
|
33013
33122
|
const { control = methods.control, disabled, name, exact } = props || {};
|
|
33014
|
-
const [formState, updateFormState] =
|
|
33015
|
-
const _localProxyFormState =
|
|
33123
|
+
const [formState, updateFormState] = import_react173.default.useState(control._formState);
|
|
33124
|
+
const _localProxyFormState = import_react173.default.useRef({
|
|
33016
33125
|
isDirty: false,
|
|
33017
33126
|
isLoading: false,
|
|
33018
33127
|
dirtyFields: false,
|
|
@@ -33033,10 +33142,10 @@ function useFormState(props) {
|
|
|
33033
33142
|
});
|
|
33034
33143
|
}
|
|
33035
33144
|
}), [name, disabled, exact]);
|
|
33036
|
-
|
|
33145
|
+
import_react173.default.useEffect(() => {
|
|
33037
33146
|
_localProxyFormState.current.isValid && control._setValid(true);
|
|
33038
33147
|
}, [control]);
|
|
33039
|
-
return
|
|
33148
|
+
return import_react173.default.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);
|
|
33040
33149
|
}
|
|
33041
33150
|
var isString = (value) => typeof value === "string";
|
|
33042
33151
|
var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {
|
|
@@ -33085,21 +33194,21 @@ function deepEqual(object1, object2, _internal_visited = /* @__PURE__ */ new Wea
|
|
|
33085
33194
|
function useWatch(props) {
|
|
33086
33195
|
const methods = useFormContext();
|
|
33087
33196
|
const { control = methods.control, name, defaultValue, disabled, exact, compute } = props || {};
|
|
33088
|
-
const _defaultValue =
|
|
33089
|
-
const _compute =
|
|
33090
|
-
const _computeFormValues =
|
|
33091
|
-
const _prevControl =
|
|
33092
|
-
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);
|
|
33093
33202
|
_compute.current = compute;
|
|
33094
|
-
const [value, updateValue] =
|
|
33203
|
+
const [value, updateValue] = import_react173.default.useState(() => {
|
|
33095
33204
|
const defaultValue2 = control._getWatch(name, _defaultValue.current);
|
|
33096
33205
|
return _compute.current ? _compute.current(defaultValue2) : defaultValue2;
|
|
33097
33206
|
});
|
|
33098
|
-
const getCurrentOutput =
|
|
33207
|
+
const getCurrentOutput = import_react173.default.useCallback((values) => {
|
|
33099
33208
|
const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
|
|
33100
33209
|
return _compute.current ? _compute.current(formValues) : formValues;
|
|
33101
33210
|
}, [control._formValues, control._names, name]);
|
|
33102
|
-
const refreshValue =
|
|
33211
|
+
const refreshValue = import_react173.default.useCallback((values) => {
|
|
33103
33212
|
if (!disabled) {
|
|
33104
33213
|
const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
|
|
33105
33214
|
if (_compute.current) {
|
|
@@ -33130,10 +33239,10 @@ function useWatch(props) {
|
|
|
33130
33239
|
}
|
|
33131
33240
|
});
|
|
33132
33241
|
}, [control, exact, name, refreshValue]);
|
|
33133
|
-
|
|
33242
|
+
import_react173.default.useEffect(() => control._removeUnmounted());
|
|
33134
33243
|
const controlChanged = _prevControl.current !== control;
|
|
33135
33244
|
const prevName = _prevName.current;
|
|
33136
|
-
const computedOutput =
|
|
33245
|
+
const computedOutput = import_react173.default.useMemo(() => {
|
|
33137
33246
|
if (disabled) {
|
|
33138
33247
|
return null;
|
|
33139
33248
|
}
|
|
@@ -33147,7 +33256,7 @@ function useController(props) {
|
|
|
33147
33256
|
const methods = useFormContext();
|
|
33148
33257
|
const { name, disabled, control = methods.control, shouldUnregister, defaultValue, exact = true } = props;
|
|
33149
33258
|
const isArrayField = isNameInFieldArray(control._names.array, name);
|
|
33150
|
-
const defaultValueMemo =
|
|
33259
|
+
const defaultValueMemo = import_react173.default.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
|
|
33151
33260
|
const value = useWatch({
|
|
33152
33261
|
control,
|
|
33153
33262
|
name,
|
|
@@ -33159,15 +33268,15 @@ function useController(props) {
|
|
|
33159
33268
|
name,
|
|
33160
33269
|
exact
|
|
33161
33270
|
});
|
|
33162
|
-
const _props =
|
|
33163
|
-
const _previousNameRef =
|
|
33164
|
-
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, {
|
|
33165
33274
|
...props.rules,
|
|
33166
33275
|
value,
|
|
33167
33276
|
...isBoolean(props.disabled) ? { disabled: props.disabled } : {}
|
|
33168
33277
|
}));
|
|
33169
33278
|
_props.current = props;
|
|
33170
|
-
const fieldState =
|
|
33279
|
+
const fieldState = import_react173.default.useMemo(() => Object.defineProperties({}, {
|
|
33171
33280
|
invalid: {
|
|
33172
33281
|
enumerable: true,
|
|
33173
33282
|
get: () => !!get(formState.errors, name)
|
|
@@ -33189,21 +33298,21 @@ function useController(props) {
|
|
|
33189
33298
|
get: () => get(formState.errors, name)
|
|
33190
33299
|
}
|
|
33191
33300
|
}), [formState, name]);
|
|
33192
|
-
const onChange =
|
|
33301
|
+
const onChange = import_react173.default.useCallback((event) => _registerProps.current.onChange({
|
|
33193
33302
|
target: {
|
|
33194
33303
|
value: getEventValue(event),
|
|
33195
33304
|
name
|
|
33196
33305
|
},
|
|
33197
33306
|
type: EVENTS.CHANGE
|
|
33198
33307
|
}), [name]);
|
|
33199
|
-
const onBlur =
|
|
33308
|
+
const onBlur = import_react173.default.useCallback(() => _registerProps.current.onBlur({
|
|
33200
33309
|
target: {
|
|
33201
33310
|
value: get(control._formValues, name),
|
|
33202
33311
|
name
|
|
33203
33312
|
},
|
|
33204
33313
|
type: EVENTS.BLUR
|
|
33205
33314
|
}), [name, control._formValues]);
|
|
33206
|
-
const ref =
|
|
33315
|
+
const ref = import_react173.default.useCallback((elm) => {
|
|
33207
33316
|
const field2 = get(control._fields, name);
|
|
33208
33317
|
if (field2 && elm) {
|
|
33209
33318
|
field2._f.ref = {
|
|
@@ -33214,7 +33323,7 @@ function useController(props) {
|
|
|
33214
33323
|
};
|
|
33215
33324
|
}
|
|
33216
33325
|
}, [control._fields, name]);
|
|
33217
|
-
const field =
|
|
33326
|
+
const field = import_react173.default.useMemo(() => ({
|
|
33218
33327
|
name,
|
|
33219
33328
|
value,
|
|
33220
33329
|
...isBoolean(disabled) || formState.disabled ? { disabled: formState.disabled || disabled } : {},
|
|
@@ -33222,7 +33331,7 @@ function useController(props) {
|
|
|
33222
33331
|
onBlur,
|
|
33223
33332
|
ref
|
|
33224
33333
|
}), [name, disabled, formState.disabled, onChange, onBlur, ref, value]);
|
|
33225
|
-
|
|
33334
|
+
import_react173.default.useEffect(() => {
|
|
33226
33335
|
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
|
33227
33336
|
const previousName = _previousNameRef.current;
|
|
33228
33337
|
if (previousName && previousName !== name && !isArrayField) {
|
|
@@ -33252,13 +33361,13 @@ function useController(props) {
|
|
|
33252
33361
|
(isArrayField ? _shouldUnregisterField && !control._state.action : _shouldUnregisterField) ? control.unregister(name) : updateMounted(name, false);
|
|
33253
33362
|
};
|
|
33254
33363
|
}, [name, control, isArrayField, shouldUnregister]);
|
|
33255
|
-
|
|
33364
|
+
import_react173.default.useEffect(() => {
|
|
33256
33365
|
control._setDisabledField({
|
|
33257
33366
|
disabled,
|
|
33258
33367
|
name
|
|
33259
33368
|
});
|
|
33260
33369
|
}, [disabled, name, control]);
|
|
33261
|
-
return
|
|
33370
|
+
return import_react173.default.useMemo(() => ({
|
|
33262
33371
|
field,
|
|
33263
33372
|
formState,
|
|
33264
33373
|
fieldState
|
|
@@ -34640,11 +34749,11 @@ var updateAt = (fieldValues, index, value) => {
|
|
|
34640
34749
|
function useFieldArray(props) {
|
|
34641
34750
|
const methods = useFormContext();
|
|
34642
34751
|
const { control = methods.control, name, keyName = "id", shouldUnregister, rules } = props;
|
|
34643
|
-
const [fields, setFields] =
|
|
34644
|
-
const ids =
|
|
34645
|
-
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);
|
|
34646
34755
|
control._names.array.add(name);
|
|
34647
|
-
|
|
34756
|
+
import_react173.default.useMemo(() => rules && fields.length >= 0 && control.register(name, rules), [control, name, fields.length, rules]);
|
|
34648
34757
|
useIsomorphicLayoutEffect(() => control._subjects.array.subscribe({
|
|
34649
34758
|
next: ({ values, name: fieldArrayName }) => {
|
|
34650
34759
|
if (fieldArrayName === name || !fieldArrayName) {
|
|
@@ -34656,7 +34765,7 @@ function useFieldArray(props) {
|
|
|
34656
34765
|
}
|
|
34657
34766
|
}
|
|
34658
34767
|
}).unsubscribe, [control, name]);
|
|
34659
|
-
const updateValues =
|
|
34768
|
+
const updateValues = import_react173.default.useCallback((updatedFieldArrayValues) => {
|
|
34660
34769
|
_actioned.current = true;
|
|
34661
34770
|
control._setFieldArray(name, updatedFieldArrayValues);
|
|
34662
34771
|
}, [control, name]);
|
|
@@ -34744,7 +34853,7 @@ function useFieldArray(props) {
|
|
|
34744
34853
|
setFields([...updatedFieldArrayValues]);
|
|
34745
34854
|
control._setFieldArray(name, [...updatedFieldArrayValues], (data) => data, {}, true, false);
|
|
34746
34855
|
};
|
|
34747
|
-
|
|
34856
|
+
import_react173.default.useEffect(() => {
|
|
34748
34857
|
control._state.action = false;
|
|
34749
34858
|
isWatched(name, control._names) && control._subjects.state.next({
|
|
34750
34859
|
...control._formState
|
|
@@ -34785,7 +34894,7 @@ function useFieldArray(props) {
|
|
|
34785
34894
|
control._setValid();
|
|
34786
34895
|
_actioned.current = false;
|
|
34787
34896
|
}, [fields, name, control]);
|
|
34788
|
-
|
|
34897
|
+
import_react173.default.useEffect(() => {
|
|
34789
34898
|
!get(control._formValues, name) && control._setFieldArray(name);
|
|
34790
34899
|
return () => {
|
|
34791
34900
|
const updateMounted = (name2, value) => {
|
|
@@ -34798,24 +34907,24 @@ function useFieldArray(props) {
|
|
|
34798
34907
|
};
|
|
34799
34908
|
}, [name, control, keyName, shouldUnregister]);
|
|
34800
34909
|
return {
|
|
34801
|
-
swap:
|
|
34802
|
-
move:
|
|
34803
|
-
prepend:
|
|
34804
|
-
append:
|
|
34805
|
-
remove:
|
|
34806
|
-
insert:
|
|
34807
|
-
update:
|
|
34808
|
-
replace:
|
|
34809
|
-
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) => ({
|
|
34810
34919
|
...field,
|
|
34811
34920
|
[keyName]: ids.current[index] || generateId()
|
|
34812
34921
|
})), [fields, keyName])
|
|
34813
34922
|
};
|
|
34814
34923
|
}
|
|
34815
34924
|
function useForm(props = {}) {
|
|
34816
|
-
const _formControl =
|
|
34817
|
-
const _values =
|
|
34818
|
-
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({
|
|
34819
34928
|
isDirty: false,
|
|
34820
34929
|
isValidating: false,
|
|
34821
34930
|
isLoading: isFunction(props.defaultValues),
|
|
@@ -34864,8 +34973,8 @@ function useForm(props = {}) {
|
|
|
34864
34973
|
control._formState.isReady = true;
|
|
34865
34974
|
return sub;
|
|
34866
34975
|
}, [control]);
|
|
34867
|
-
|
|
34868
|
-
|
|
34976
|
+
import_react173.default.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
|
|
34977
|
+
import_react173.default.useEffect(() => {
|
|
34869
34978
|
if (props.mode) {
|
|
34870
34979
|
control._options.mode = props.mode;
|
|
34871
34980
|
}
|
|
@@ -34873,18 +34982,18 @@ function useForm(props = {}) {
|
|
|
34873
34982
|
control._options.reValidateMode = props.reValidateMode;
|
|
34874
34983
|
}
|
|
34875
34984
|
}, [control, props.mode, props.reValidateMode]);
|
|
34876
|
-
|
|
34985
|
+
import_react173.default.useEffect(() => {
|
|
34877
34986
|
if (props.errors) {
|
|
34878
34987
|
control._setErrors(props.errors);
|
|
34879
34988
|
control._focusError();
|
|
34880
34989
|
}
|
|
34881
34990
|
}, [control, props.errors]);
|
|
34882
|
-
|
|
34991
|
+
import_react173.default.useEffect(() => {
|
|
34883
34992
|
props.shouldUnregister && control._subjects.state.next({
|
|
34884
34993
|
values: control._getWatch()
|
|
34885
34994
|
});
|
|
34886
34995
|
}, [control, props.shouldUnregister]);
|
|
34887
|
-
|
|
34996
|
+
import_react173.default.useEffect(() => {
|
|
34888
34997
|
if (control._proxyFormState.isDirty) {
|
|
34889
34998
|
const isDirty = control._getDirty();
|
|
34890
34999
|
if (isDirty !== formState.isDirty) {
|
|
@@ -34894,7 +35003,7 @@ function useForm(props = {}) {
|
|
|
34894
35003
|
}
|
|
34895
35004
|
}
|
|
34896
35005
|
}, [control, formState.isDirty]);
|
|
34897
|
-
|
|
35006
|
+
import_react173.default.useEffect(() => {
|
|
34898
35007
|
var _a;
|
|
34899
35008
|
if (props.values && !deepEqual(props.values, _values.current)) {
|
|
34900
35009
|
control._reset(props.values, {
|
|
@@ -34910,7 +35019,7 @@ function useForm(props = {}) {
|
|
|
34910
35019
|
control._resetDefaultValues();
|
|
34911
35020
|
}
|
|
34912
35021
|
}, [control, props.values]);
|
|
34913
|
-
|
|
35022
|
+
import_react173.default.useEffect(() => {
|
|
34914
35023
|
if (!control._state.mount) {
|
|
34915
35024
|
control._setValid();
|
|
34916
35025
|
control._state.mount = true;
|
|
@@ -34972,10 +35081,10 @@ function Form({
|
|
|
34972
35081
|
});
|
|
34973
35082
|
const { handleSubmit } = formValues;
|
|
34974
35083
|
const onKeyDown = !onSubmit || preventSubmit ? (e) => e.key === "Enter" && e.preventDefault() : void 0;
|
|
34975
|
-
(0,
|
|
35084
|
+
(0, import_react174.useEffect)(() => {
|
|
34976
35085
|
formValues.reset(values);
|
|
34977
35086
|
}, [formValues, values]);
|
|
34978
|
-
(0,
|
|
35087
|
+
(0, import_react174.useEffect)(() => {
|
|
34979
35088
|
if (formValues.formState.isSubmitted) {
|
|
34980
35089
|
formValues.reset(void 0, { keepDirty: true, keepValues: true });
|
|
34981
35090
|
}
|
|
@@ -35016,7 +35125,7 @@ function FormController({ children, ...props }) {
|
|
|
35016
35125
|
}
|
|
35017
35126
|
|
|
35018
35127
|
// src/components/forms/FormField.tsx
|
|
35019
|
-
var
|
|
35128
|
+
var import_react175 = require("react");
|
|
35020
35129
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
35021
35130
|
function FormField({
|
|
35022
35131
|
id,
|
|
@@ -35036,13 +35145,13 @@ function FormField({
|
|
|
35036
35145
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Column, { ...props, gap: "1", className, children: [
|
|
35037
35146
|
label && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Label2, { htmlFor: fieldId, children: label }),
|
|
35038
35147
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormController, { name, control, rules, children: ({ field }) => {
|
|
35039
|
-
return
|
|
35148
|
+
return import_react175.Children.map(
|
|
35040
35149
|
typeof children === "function" ? children({ context, field }) : children,
|
|
35041
35150
|
(child) => {
|
|
35042
35151
|
if (!child) {
|
|
35043
35152
|
return null;
|
|
35044
35153
|
}
|
|
35045
|
-
return (0,
|
|
35154
|
+
return (0, import_react175.cloneElement)(child, { ...field, id: fieldId });
|
|
35046
35155
|
}
|
|
35047
35156
|
);
|
|
35048
35157
|
} }),
|
|
@@ -35167,7 +35276,7 @@ function FormSubmitButton({
|
|
|
35167
35276
|
}
|
|
35168
35277
|
|
|
35169
35278
|
// src/components/HoverTrigger.tsx
|
|
35170
|
-
var
|
|
35279
|
+
var import_react176 = require("react");
|
|
35171
35280
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
35172
35281
|
var CLOSE_DELAY = 500;
|
|
35173
35282
|
function HoverTrigger({
|
|
@@ -35178,12 +35287,12 @@ function HoverTrigger({
|
|
|
35178
35287
|
children
|
|
35179
35288
|
}) {
|
|
35180
35289
|
const [triggerElement, popupElement] = children;
|
|
35181
|
-
const triggerRef = (0,
|
|
35182
|
-
const [open, setOpen] = (0,
|
|
35183
|
-
const isOverMenu = (0,
|
|
35184
|
-
const isOverButton = (0,
|
|
35185
|
-
const timeout = (0,
|
|
35186
|
-
(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)(() => {
|
|
35187
35296
|
if (isOpen !== open) {
|
|
35188
35297
|
setOpen(isOpen);
|
|
35189
35298
|
}
|
|
@@ -35226,7 +35335,7 @@ function HoverTrigger({
|
|
|
35226
35335
|
}
|
|
35227
35336
|
|
|
35228
35337
|
// src/components/hooks/useBreakpoint.ts
|
|
35229
|
-
var
|
|
35338
|
+
var import_react177 = require("react");
|
|
35230
35339
|
var breakpoints = {
|
|
35231
35340
|
sm: 640,
|
|
35232
35341
|
md: 768,
|
|
@@ -35236,8 +35345,8 @@ var breakpoints = {
|
|
|
35236
35345
|
};
|
|
35237
35346
|
var DEBOUNCE_DELAY_MS = 150;
|
|
35238
35347
|
function useBreakpoint() {
|
|
35239
|
-
const [breakpoint, setBreakpoint] = (0,
|
|
35240
|
-
const calculateBreakpoint = (0,
|
|
35348
|
+
const [breakpoint, setBreakpoint] = (0, import_react177.useState)(null);
|
|
35349
|
+
const calculateBreakpoint = (0, import_react177.useCallback)(() => {
|
|
35241
35350
|
if (typeof window === "undefined") {
|
|
35242
35351
|
return;
|
|
35243
35352
|
}
|
|
@@ -35250,7 +35359,7 @@ function useBreakpoint() {
|
|
|
35250
35359
|
}
|
|
35251
35360
|
setBreakpoint(currentBreakpoint);
|
|
35252
35361
|
}, []);
|
|
35253
|
-
(0,
|
|
35362
|
+
(0, import_react177.useEffect)(() => {
|
|
35254
35363
|
calculateBreakpoint();
|
|
35255
35364
|
const debouncedResize = debounce(calculateBreakpoint, DEBOUNCE_DELAY_MS);
|
|
35256
35365
|
window.addEventListener("resize", debouncedResize);
|
|
@@ -35262,10 +35371,10 @@ function useBreakpoint() {
|
|
|
35262
35371
|
}
|
|
35263
35372
|
|
|
35264
35373
|
// src/components/hooks/useDebounce.ts
|
|
35265
|
-
var
|
|
35374
|
+
var import_react178 = require("react");
|
|
35266
35375
|
function useDebounce(value, delay) {
|
|
35267
|
-
const [debouncedValue, setValue] = (0,
|
|
35268
|
-
(0,
|
|
35376
|
+
const [debouncedValue, setValue] = (0, import_react178.useState)(value);
|
|
35377
|
+
(0, import_react178.useEffect)(() => {
|
|
35269
35378
|
const timer = setTimeout(() => {
|
|
35270
35379
|
setValue(value);
|
|
35271
35380
|
}, delay);
|
|
@@ -35277,7 +35386,7 @@ function useDebounce(value, delay) {
|
|
|
35277
35386
|
}
|
|
35278
35387
|
|
|
35279
35388
|
// src/components/hooks/useTheme.ts
|
|
35280
|
-
var
|
|
35389
|
+
var import_react180 = require("react");
|
|
35281
35390
|
|
|
35282
35391
|
// node_modules/.pnpm/zustand@5.0.9_@types+react@_78841bed54d06c8a621d90b050fefecd/node_modules/zustand/esm/vanilla.mjs
|
|
35283
35392
|
var createStoreImpl = (createState2) => {
|
|
@@ -35304,15 +35413,15 @@ var createStoreImpl = (createState2) => {
|
|
|
35304
35413
|
var createStore = ((createState2) => createState2 ? createStoreImpl(createState2) : createStoreImpl);
|
|
35305
35414
|
|
|
35306
35415
|
// node_modules/.pnpm/zustand@5.0.9_@types+react@_78841bed54d06c8a621d90b050fefecd/node_modules/zustand/esm/react.mjs
|
|
35307
|
-
var
|
|
35416
|
+
var import_react179 = __toESM(require("react"), 1);
|
|
35308
35417
|
var identity = (arg) => arg;
|
|
35309
35418
|
function useStore(api, selector = identity) {
|
|
35310
|
-
const slice =
|
|
35419
|
+
const slice = import_react179.default.useSyncExternalStore(
|
|
35311
35420
|
api.subscribe,
|
|
35312
|
-
|
|
35313
|
-
|
|
35421
|
+
import_react179.default.useCallback(() => selector(api.getState()), [api, selector]),
|
|
35422
|
+
import_react179.default.useCallback(() => selector(api.getInitialState()), [api, selector])
|
|
35314
35423
|
);
|
|
35315
|
-
|
|
35424
|
+
import_react179.default.useDebugValue(slice);
|
|
35316
35425
|
return slice;
|
|
35317
35426
|
}
|
|
35318
35427
|
var createImpl = (createState2) => {
|
|
@@ -35377,10 +35486,10 @@ var useTheme = create((set2, get2) => ({
|
|
|
35377
35486
|
function useInitTheme(preferred, colorScheme) {
|
|
35378
35487
|
const initTheme = useTheme((s) => s.initTheme);
|
|
35379
35488
|
const syncTheme = useTheme((s) => s.syncTheme);
|
|
35380
|
-
(0,
|
|
35489
|
+
(0, import_react180.useLayoutEffect)(() => {
|
|
35381
35490
|
initTheme(preferred, colorScheme);
|
|
35382
35491
|
}, [preferred, colorScheme, initTheme]);
|
|
35383
|
-
(0,
|
|
35492
|
+
(0, import_react180.useEffect)(() => {
|
|
35384
35493
|
if (typeof window === "undefined") return;
|
|
35385
35494
|
const observer = new MutationObserver((mutations) => {
|
|
35386
35495
|
for (const mutation of mutations) {
|
|
@@ -35395,10 +35504,10 @@ function useInitTheme(preferred, colorScheme) {
|
|
|
35395
35504
|
}
|
|
35396
35505
|
|
|
35397
35506
|
// src/components/hooks/useToast.ts
|
|
35398
|
-
var
|
|
35507
|
+
var import_react197 = require("react");
|
|
35399
35508
|
|
|
35400
35509
|
// src/components/toast/ToastProvider.tsx
|
|
35401
|
-
var
|
|
35510
|
+
var import_react196 = require("react");
|
|
35402
35511
|
|
|
35403
35512
|
// node_modules/.pnpm/@react-spring+rafz@9.7.5/node_modules/@react-spring/rafz/dist/react-spring_rafz.modern.mjs
|
|
35404
35513
|
var updateQueue = makeQueue();
|
|
@@ -35559,7 +35668,6 @@ function eachSafely(values, each2) {
|
|
|
35559
35668
|
}
|
|
35560
35669
|
|
|
35561
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
|
|
35562
|
-
var import_react180 = require("react");
|
|
35563
35671
|
var import_react181 = require("react");
|
|
35564
35672
|
var import_react182 = require("react");
|
|
35565
35673
|
var import_react183 = require("react");
|
|
@@ -35567,6 +35675,7 @@ var import_react184 = require("react");
|
|
|
35567
35675
|
var import_react185 = require("react");
|
|
35568
35676
|
var import_react186 = require("react");
|
|
35569
35677
|
var import_react187 = require("react");
|
|
35678
|
+
var import_react188 = require("react");
|
|
35570
35679
|
var __defProp2 = Object.defineProperty;
|
|
35571
35680
|
var __export2 = (target, all) => {
|
|
35572
35681
|
for (var name in all)
|
|
@@ -36326,9 +36435,9 @@ function isAnimatedString(value) {
|
|
|
36326
36435
|
return is.str(value) && (value[0] == "#" || /\d/.test(value) || // Do not identify a CSS variable as an AnimatedString if its SSR
|
|
36327
36436
|
!isSSR() && cssVariableRegex.test(value) || value in (colors || {}));
|
|
36328
36437
|
}
|
|
36329
|
-
var useIsomorphicLayoutEffect2 = isSSR() ?
|
|
36438
|
+
var useIsomorphicLayoutEffect2 = isSSR() ? import_react184.useEffect : import_react184.useLayoutEffect;
|
|
36330
36439
|
var useIsMounted = () => {
|
|
36331
|
-
const isMounted = (0,
|
|
36440
|
+
const isMounted = (0, import_react183.useRef)(false);
|
|
36332
36441
|
useIsomorphicLayoutEffect2(() => {
|
|
36333
36442
|
isMounted.current = true;
|
|
36334
36443
|
return () => {
|
|
@@ -36338,7 +36447,7 @@ var useIsMounted = () => {
|
|
|
36338
36447
|
return isMounted;
|
|
36339
36448
|
};
|
|
36340
36449
|
function useForceUpdate() {
|
|
36341
|
-
const update3 = (0,
|
|
36450
|
+
const update3 = (0, import_react182.useState)()[1];
|
|
36342
36451
|
const isMounted = useIsMounted();
|
|
36343
36452
|
return () => {
|
|
36344
36453
|
if (isMounted.current) {
|
|
@@ -36347,13 +36456,13 @@ function useForceUpdate() {
|
|
|
36347
36456
|
};
|
|
36348
36457
|
}
|
|
36349
36458
|
function useMemoOne(getResult, inputs) {
|
|
36350
|
-
const [initial] = (0,
|
|
36459
|
+
const [initial] = (0, import_react185.useState)(
|
|
36351
36460
|
() => ({
|
|
36352
36461
|
inputs,
|
|
36353
36462
|
result: getResult()
|
|
36354
36463
|
})
|
|
36355
36464
|
);
|
|
36356
|
-
const committed = (0,
|
|
36465
|
+
const committed = (0, import_react185.useRef)();
|
|
36357
36466
|
const prevCache = committed.current;
|
|
36358
36467
|
let cache = prevCache;
|
|
36359
36468
|
if (cache) {
|
|
@@ -36369,7 +36478,7 @@ function useMemoOne(getResult, inputs) {
|
|
|
36369
36478
|
} else {
|
|
36370
36479
|
cache = initial;
|
|
36371
36480
|
}
|
|
36372
|
-
(0,
|
|
36481
|
+
(0, import_react185.useEffect)(() => {
|
|
36373
36482
|
committed.current = cache;
|
|
36374
36483
|
if (prevCache == initial) {
|
|
36375
36484
|
initial.inputs = initial.result = void 0;
|
|
@@ -36388,22 +36497,22 @@ function areInputsEqual(next, prev) {
|
|
|
36388
36497
|
}
|
|
36389
36498
|
return true;
|
|
36390
36499
|
}
|
|
36391
|
-
var useOnce = (effect) => (0,
|
|
36500
|
+
var useOnce = (effect) => (0, import_react186.useEffect)(effect, emptyDeps);
|
|
36392
36501
|
var emptyDeps = [];
|
|
36393
36502
|
function usePrev(value) {
|
|
36394
|
-
const prevRef = (0,
|
|
36395
|
-
(0,
|
|
36503
|
+
const prevRef = (0, import_react187.useRef)();
|
|
36504
|
+
(0, import_react187.useEffect)(() => {
|
|
36396
36505
|
prevRef.current = value;
|
|
36397
36506
|
});
|
|
36398
36507
|
return prevRef.current;
|
|
36399
36508
|
}
|
|
36400
36509
|
|
|
36401
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
|
|
36402
|
-
var
|
|
36511
|
+
var import_react190 = require("react");
|
|
36403
36512
|
|
|
36404
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
|
|
36405
36514
|
var React3 = __toESM(require("react"), 1);
|
|
36406
|
-
var
|
|
36515
|
+
var import_react189 = require("react");
|
|
36407
36516
|
var $node = Symbol.for("Animated:node");
|
|
36408
36517
|
var isAnimated = (value) => !!value && value[$node] === value;
|
|
36409
36518
|
var getAnimated = (owner) => owner && owner[$node];
|
|
@@ -36590,10 +36699,10 @@ var withAnimated = (Component, host2) => {
|
|
|
36590
36699
|
// re-rendered on every animation frame.
|
|
36591
36700
|
!is.fun(Component) || Component.prototype && Component.prototype.isReactComponent
|
|
36592
36701
|
);
|
|
36593
|
-
return (0,
|
|
36594
|
-
const instanceRef = (0,
|
|
36702
|
+
return (0, import_react189.forwardRef)((givenProps, givenRef) => {
|
|
36703
|
+
const instanceRef = (0, import_react189.useRef)(null);
|
|
36595
36704
|
const ref = hasInstance && // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
36596
|
-
(0,
|
|
36705
|
+
(0, import_react189.useCallback)(
|
|
36597
36706
|
(value) => {
|
|
36598
36707
|
instanceRef.current = updateRef(givenRef, value);
|
|
36599
36708
|
},
|
|
@@ -36612,7 +36721,7 @@ var withAnimated = (Component, host2) => {
|
|
|
36612
36721
|
}
|
|
36613
36722
|
};
|
|
36614
36723
|
const observer = new PropsObserver(callback, deps);
|
|
36615
|
-
const observerRef = (0,
|
|
36724
|
+
const observerRef = (0, import_react189.useRef)();
|
|
36616
36725
|
useIsomorphicLayoutEffect2(() => {
|
|
36617
36726
|
observerRef.current = observer;
|
|
36618
36727
|
each(deps, (dep) => addFluidObserver(dep, observer));
|
|
@@ -36626,7 +36735,7 @@ var withAnimated = (Component, host2) => {
|
|
|
36626
36735
|
}
|
|
36627
36736
|
};
|
|
36628
36737
|
});
|
|
36629
|
-
(0,
|
|
36738
|
+
(0, import_react189.useEffect)(callback, []);
|
|
36630
36739
|
useOnce(() => () => {
|
|
36631
36740
|
const observer2 = observerRef.current;
|
|
36632
36741
|
each(observer2.deps, (dep) => removeFluidObserver(dep, observer2));
|
|
@@ -36702,11 +36811,11 @@ var getDisplayName = (arg) => is.str(arg) ? arg : arg && is.str(arg.displayName)
|
|
|
36702
36811
|
|
|
36703
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
|
|
36704
36813
|
var React4 = __toESM(require("react"), 1);
|
|
36705
|
-
var import_react190 = require("react");
|
|
36706
36814
|
var import_react191 = require("react");
|
|
36707
|
-
var React22 = __toESM(require("react"), 1);
|
|
36708
36815
|
var import_react192 = require("react");
|
|
36816
|
+
var React22 = __toESM(require("react"), 1);
|
|
36709
36817
|
var import_react193 = require("react");
|
|
36818
|
+
var import_react194 = require("react");
|
|
36710
36819
|
function callProp(value, ...args) {
|
|
36711
36820
|
return is.fun(value) ? value(...args) : value;
|
|
36712
36821
|
}
|
|
@@ -38165,7 +38274,7 @@ var SpringContext = ({
|
|
|
38165
38274
|
children,
|
|
38166
38275
|
...props
|
|
38167
38276
|
}) => {
|
|
38168
|
-
const inherited = (0,
|
|
38277
|
+
const inherited = (0, import_react191.useContext)(ctx);
|
|
38169
38278
|
const pause = props.pause || !!inherited.pause, immediate = props.immediate || !!inherited.immediate;
|
|
38170
38279
|
props = useMemoOne(() => ({ pause, immediate }), [pause, immediate]);
|
|
38171
38280
|
const { Provider } = ctx;
|
|
@@ -38264,13 +38373,13 @@ function useTransition(data, props, deps) {
|
|
|
38264
38373
|
ref: propsRef,
|
|
38265
38374
|
config: propsConfig
|
|
38266
38375
|
} = propsFn ? propsFn() : props;
|
|
38267
|
-
const ref = (0,
|
|
38376
|
+
const ref = (0, import_react193.useMemo)(
|
|
38268
38377
|
() => propsFn || arguments.length == 3 ? SpringRef() : void 0,
|
|
38269
38378
|
[]
|
|
38270
38379
|
);
|
|
38271
38380
|
const items = toArray(data);
|
|
38272
38381
|
const transitions = [];
|
|
38273
|
-
const usedTransitions = (0,
|
|
38382
|
+
const usedTransitions = (0, import_react193.useRef)(null);
|
|
38274
38383
|
const prevTransitions = reset ? null : usedTransitions.current;
|
|
38275
38384
|
useIsomorphicLayoutEffect2(() => {
|
|
38276
38385
|
usedTransitions.current = transitions;
|
|
@@ -38341,8 +38450,8 @@ function useTransition(data, props, deps) {
|
|
|
38341
38450
|
const forceUpdate = useForceUpdate();
|
|
38342
38451
|
const defaultProps = getDefaultProps(props);
|
|
38343
38452
|
const changes = /* @__PURE__ */ new Map();
|
|
38344
|
-
const exitingTransitions = (0,
|
|
38345
|
-
const forceChange = (0,
|
|
38453
|
+
const exitingTransitions = (0, import_react193.useRef)(/* @__PURE__ */ new Map());
|
|
38454
|
+
const forceChange = (0, import_react193.useRef)(false);
|
|
38346
38455
|
each(transitions, (t, i) => {
|
|
38347
38456
|
const key = t.key;
|
|
38348
38457
|
const prevPhase = t.phase;
|
|
@@ -38432,7 +38541,7 @@ function useTransition(data, props, deps) {
|
|
|
38432
38541
|
changes.set(t, { phase, springs, payload });
|
|
38433
38542
|
}
|
|
38434
38543
|
});
|
|
38435
|
-
const context = (0,
|
|
38544
|
+
const context = (0, import_react193.useContext)(SpringContext);
|
|
38436
38545
|
const prevContext = usePrev(context);
|
|
38437
38546
|
const hasContext = context !== prevContext && hasProps(context);
|
|
38438
38547
|
useIsomorphicLayoutEffect2(() => {
|
|
@@ -38974,7 +39083,7 @@ var host = createHost(primitives, {
|
|
|
38974
39083
|
var animated = host.animated;
|
|
38975
39084
|
|
|
38976
39085
|
// src/components/toast/Toaster.tsx
|
|
38977
|
-
var
|
|
39086
|
+
var import_react195 = require("react");
|
|
38978
39087
|
|
|
38979
39088
|
// src/components/toast/Toast.tsx
|
|
38980
39089
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
@@ -39030,7 +39139,7 @@ var positionClasses = {
|
|
|
39030
39139
|
var AnimatedBox = animated(Box);
|
|
39031
39140
|
function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
39032
39141
|
const { toasts } = useToast();
|
|
39033
|
-
const [hovered, setHovered] = (0,
|
|
39142
|
+
const [hovered, setHovered] = (0, import_react195.useState)(false);
|
|
39034
39143
|
const transitions = useTransition(toasts, {
|
|
39035
39144
|
from: {
|
|
39036
39145
|
opacity: 0,
|
|
@@ -39043,7 +39152,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
39043
39152
|
},
|
|
39044
39153
|
config: { duration: 100 }
|
|
39045
39154
|
});
|
|
39046
|
-
(0,
|
|
39155
|
+
(0, import_react195.useEffect)(() => {
|
|
39047
39156
|
if (duration) {
|
|
39048
39157
|
const timeout = setInterval(() => {
|
|
39049
39158
|
if (hovered || !toasts.length) return;
|
|
@@ -39076,7 +39185,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
39076
39185
|
|
|
39077
39186
|
// src/components/toast/ToastProvider.tsx
|
|
39078
39187
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
39079
|
-
var ToastContext = (0,
|
|
39188
|
+
var ToastContext = (0, import_react196.createContext)({});
|
|
39080
39189
|
function ToastProvider({ children, ...props }) {
|
|
39081
39190
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(ToastContext.Provider, { value: props, children: [
|
|
39082
39191
|
children,
|
|
@@ -39107,7 +39216,7 @@ function displayToast(message, { duration = TOAST_DURATION, ...options } = {}) {
|
|
|
39107
39216
|
}
|
|
39108
39217
|
function useToast() {
|
|
39109
39218
|
const { toasts } = store();
|
|
39110
|
-
const config2 = (0,
|
|
39219
|
+
const config2 = (0, import_react197.useContext)(ToastContext);
|
|
39111
39220
|
const toast2 = (message, options) => {
|
|
39112
39221
|
displayToast(message, { ...options, ...config2 });
|
|
39113
39222
|
};
|
|
@@ -39304,11 +39413,11 @@ function Modal2({
|
|
|
39304
39413
|
}
|
|
39305
39414
|
|
|
39306
39415
|
// src/components/Navbar.tsx
|
|
39307
|
-
var
|
|
39416
|
+
var import_react198 = require("react");
|
|
39308
39417
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
39309
|
-
var NavbarContext = (0,
|
|
39418
|
+
var NavbarContext = (0, import_react198.createContext)(void 0);
|
|
39310
39419
|
var useNavigationContext = () => {
|
|
39311
|
-
const context = (0,
|
|
39420
|
+
const context = (0, import_react198.useContext)(NavbarContext);
|
|
39312
39421
|
if (!context) {
|
|
39313
39422
|
throw new Error("useNavigationContext must be used within a Navbar");
|
|
39314
39423
|
}
|
|
@@ -39321,7 +39430,7 @@ function Navbar({
|
|
|
39321
39430
|
color: _color,
|
|
39322
39431
|
...props
|
|
39323
39432
|
}) {
|
|
39324
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
39433
|
+
const [activeMenu, setActiveMenu] = (0, import_react198.useState)("");
|
|
39325
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 }) });
|
|
39326
39435
|
}
|
|
39327
39436
|
function NavbarItem({
|
|
@@ -39369,9 +39478,9 @@ function NavbarItem({
|
|
|
39369
39478
|
}
|
|
39370
39479
|
|
|
39371
39480
|
// src/components/NavMenu.tsx
|
|
39372
|
-
var
|
|
39481
|
+
var import_react199 = require("react");
|
|
39373
39482
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
39374
|
-
var NavMenuContext = (0,
|
|
39483
|
+
var NavMenuContext = (0, import_react199.createContext)(null);
|
|
39375
39484
|
function NavMenu({ muteItems, onItemClick, className, children, ...props }) {
|
|
39376
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 }) });
|
|
39377
39486
|
}
|
|
@@ -39383,7 +39492,7 @@ function NavMenuGroup({
|
|
|
39383
39492
|
children,
|
|
39384
39493
|
...props
|
|
39385
39494
|
}) {
|
|
39386
|
-
const [minimized, setMinimized] = (0,
|
|
39495
|
+
const [minimized, setMinimized] = (0, import_react199.useState)(!!isMinimized);
|
|
39387
39496
|
const handleClick = () => {
|
|
39388
39497
|
if (allowMinimize) {
|
|
39389
39498
|
setMinimized((state2) => !state2);
|
|
@@ -39419,7 +39528,7 @@ function NavMenuGroup({
|
|
|
39419
39528
|
);
|
|
39420
39529
|
}
|
|
39421
39530
|
function NavMenuItem({ isSelected, className, children, ...props }) {
|
|
39422
|
-
const { onItemClick } = (0,
|
|
39531
|
+
const { onItemClick } = (0, import_react199.useContext)(NavMenuContext);
|
|
39423
39532
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
39424
39533
|
Row,
|
|
39425
39534
|
{
|
|
@@ -39440,7 +39549,7 @@ function NavMenuItem({ isSelected, className, children, ...props }) {
|
|
|
39440
39549
|
}
|
|
39441
39550
|
|
|
39442
39551
|
// src/components/PasswordField.tsx
|
|
39443
|
-
var
|
|
39552
|
+
var import_react200 = require("react");
|
|
39444
39553
|
|
|
39445
39554
|
// src/components/svg/EyeSlash.tsx
|
|
39446
39555
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
@@ -39511,7 +39620,7 @@ var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
|
39511
39620
|
// src/components/PasswordField.tsx
|
|
39512
39621
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
39513
39622
|
function PasswordField({ label, className, ...props }) {
|
|
39514
|
-
const [show, setShow] = (0,
|
|
39623
|
+
const [show, setShow] = (0, import_react200.useState)(false);
|
|
39515
39624
|
const type = show ? "text" : "password";
|
|
39516
39625
|
const handleShowPassword = () => setShow((state2) => !state2);
|
|
39517
39626
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
@@ -39636,7 +39745,7 @@ function Radio2({ children, className, ...props }) {
|
|
|
39636
39745
|
}
|
|
39637
39746
|
|
|
39638
39747
|
// src/components/SearchField.tsx
|
|
39639
|
-
var
|
|
39748
|
+
var import_react201 = require("react");
|
|
39640
39749
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
39641
39750
|
function SearchField2({
|
|
39642
39751
|
label,
|
|
@@ -39649,7 +39758,7 @@ function SearchField2({
|
|
|
39649
39758
|
className,
|
|
39650
39759
|
...props
|
|
39651
39760
|
}) {
|
|
39652
|
-
const [search, setSearch] = (0,
|
|
39761
|
+
const [search, setSearch] = (0, import_react201.useState)(defaultValue);
|
|
39653
39762
|
const searchValue = useDebounce(search, delay);
|
|
39654
39763
|
const handleChange = (value2) => {
|
|
39655
39764
|
setSearch(value2);
|
|
@@ -39663,7 +39772,7 @@ function SearchField2({
|
|
|
39663
39772
|
onSearch?.("");
|
|
39664
39773
|
onChange?.("");
|
|
39665
39774
|
};
|
|
39666
|
-
(0,
|
|
39775
|
+
(0, import_react201.useEffect)(() => {
|
|
39667
39776
|
if (delay > 0) {
|
|
39668
39777
|
onSearch?.(searchValue);
|
|
39669
39778
|
}
|
|
@@ -39704,7 +39813,7 @@ function SearchField2({
|
|
|
39704
39813
|
}
|
|
39705
39814
|
|
|
39706
39815
|
// src/components/Select.tsx
|
|
39707
|
-
var
|
|
39816
|
+
var import_react202 = require("react");
|
|
39708
39817
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
39709
39818
|
function Select2({
|
|
39710
39819
|
items = [],
|
|
@@ -39726,7 +39835,7 @@ function Select2({
|
|
|
39726
39835
|
children,
|
|
39727
39836
|
...props
|
|
39728
39837
|
}) {
|
|
39729
|
-
const [search, setSearch] = (0,
|
|
39838
|
+
const [search, setSearch] = (0, import_react202.useState)("");
|
|
39730
39839
|
const handleChange = (e) => {
|
|
39731
39840
|
onChange?.(e);
|
|
39732
39841
|
};
|
|
@@ -39799,9 +39908,9 @@ function Select2({
|
|
|
39799
39908
|
}
|
|
39800
39909
|
|
|
39801
39910
|
// src/components/Sidebar.tsx
|
|
39802
|
-
var
|
|
39911
|
+
var import_react203 = require("react");
|
|
39803
39912
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
39804
|
-
var SidebarContext = (0,
|
|
39913
|
+
var SidebarContext = (0, import_react203.createContext)(null);
|
|
39805
39914
|
function Sidebar({ isCollapsed, muteItems, className, children, ...props }) {
|
|
39806
39915
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SidebarContext.Provider, { value: { isCollapsed }, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
39807
39916
|
Column,
|
|
@@ -39850,7 +39959,7 @@ function SidebarItem({
|
|
|
39850
39959
|
children,
|
|
39851
39960
|
...props
|
|
39852
39961
|
}) {
|
|
39853
|
-
const { isCollapsed } = (0,
|
|
39962
|
+
const { isCollapsed } = (0, import_react203.useContext)(SidebarContext);
|
|
39854
39963
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)($4e3b923658d69c60$export$8c610744efcf8a1d, { delay: 0, closeDelay: 0, isDisabled: !isCollapsed, children: [
|
|
39855
39964
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)($f645667febf57a63$export$35a3bebf7ef2d934, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
39856
39965
|
Row,
|
|
@@ -39995,8 +40104,11 @@ function TabPanel2({ children, className, ...props }) {
|
|
|
39995
40104
|
}
|
|
39996
40105
|
|
|
39997
40106
|
// src/components/ThemeButton.tsx
|
|
39998
|
-
var
|
|
40107
|
+
var import_react204 = require("react");
|
|
39999
40108
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
40109
|
+
function getElement(target) {
|
|
40110
|
+
return "current" in target ? target.current : target;
|
|
40111
|
+
}
|
|
40000
40112
|
function applyTheme2(element, theme) {
|
|
40001
40113
|
element.setAttribute("data-theme", theme);
|
|
40002
40114
|
if (theme === "dark") {
|
|
@@ -40013,9 +40125,20 @@ function ThemeButton({
|
|
|
40013
40125
|
...props
|
|
40014
40126
|
}) {
|
|
40015
40127
|
const globalTheme = useTheme();
|
|
40016
|
-
const [localTheme, setLocalTheme] = (0,
|
|
40128
|
+
const [localTheme, setLocalTheme] = (0, import_react204.useState)(null);
|
|
40129
|
+
const initializedRef = (0, import_react204.useRef)(false);
|
|
40017
40130
|
const isLocal = !!target;
|
|
40018
|
-
|
|
40131
|
+
(0, import_react204.useEffect)(() => {
|
|
40132
|
+
if (isLocal && target && !initializedRef.current) {
|
|
40133
|
+
const element = getElement(target);
|
|
40134
|
+
if (element) {
|
|
40135
|
+
initializedRef.current = true;
|
|
40136
|
+
setLocalTheme(globalTheme.theme);
|
|
40137
|
+
applyTheme2(element, globalTheme.theme);
|
|
40138
|
+
}
|
|
40139
|
+
}
|
|
40140
|
+
}, [isLocal, target, globalTheme.theme]);
|
|
40141
|
+
const theme = isLocal ? localTheme ?? globalTheme.theme : globalTheme.theme;
|
|
40019
40142
|
const transitions = useTransition(theme, {
|
|
40020
40143
|
initial: { opacity: 1 },
|
|
40021
40144
|
from: {
|
|
@@ -40030,8 +40153,8 @@ function ThemeButton({
|
|
|
40030
40153
|
});
|
|
40031
40154
|
function handleClick(e) {
|
|
40032
40155
|
const newTheme = theme === "light" ? "dark" : "light";
|
|
40033
|
-
if (isLocal) {
|
|
40034
|
-
const element =
|
|
40156
|
+
if (isLocal && target) {
|
|
40157
|
+
const element = getElement(target);
|
|
40035
40158
|
if (element) {
|
|
40036
40159
|
applyTheme2(element, newTheme);
|
|
40037
40160
|
setLocalTheme(newTheme);
|