@farmzone/fz-react-ui 1.2.5 → 1.2.6
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.cjs +224 -137
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +225 -138
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tw.css +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -380,9 +380,9 @@ function Button(props) {
|
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
// src/components/Checkbox/config/default.ts
|
|
383
|
-
var DEFAULT_CHECKED_CLASS = "border-0 bg-
|
|
384
|
-
var DEFAULT_UNCHECKED_CLASS = "border-neutral-300 bg-white hover:border-
|
|
385
|
-
var DEFAULT_DISABLED_CHECKED_CLASS = "border-0 bg-
|
|
383
|
+
var DEFAULT_CHECKED_CLASS = "border-0 bg-checkbox";
|
|
384
|
+
var DEFAULT_UNCHECKED_CLASS = "border-neutral-300 bg-white hover:border-checkbox active:border-checkbox focus-visible:border-checkbox";
|
|
385
|
+
var DEFAULT_DISABLED_CHECKED_CLASS = "border-0 bg-checkbox/40";
|
|
386
386
|
var DEFAULT_DISABLED_UNCHECKED_CLASS = "border-neutral-300 bg-black/10";
|
|
387
387
|
var DEFAULT_ICON_CLASS = "text-white";
|
|
388
388
|
function Checkbox(props) {
|
|
@@ -1552,8 +1552,9 @@ function getVisiblePageRange(currentPage, totalPages) {
|
|
|
1552
1552
|
return { start, end };
|
|
1553
1553
|
}
|
|
1554
1554
|
function Pagination(props) {
|
|
1555
|
-
const { page = 0, totalPages: rawTotalPages = 0, onPageChange } = props;
|
|
1555
|
+
const { page = 0, totalPages: rawTotalPages = 0, onPageChange, edgeButtonsMinPages } = props;
|
|
1556
1556
|
const totalPages = Math.max(1, rawTotalPages);
|
|
1557
|
+
const showEdgeButtons = edgeButtonsMinPages === void 0 || totalPages >= edgeButtonsMinPages;
|
|
1557
1558
|
const [displayPage, setDisplayPage] = React6.useState(page);
|
|
1558
1559
|
React6.useEffect(() => {
|
|
1559
1560
|
setDisplayPage(page);
|
|
@@ -1611,7 +1612,7 @@ function Pagination(props) {
|
|
|
1611
1612
|
}
|
|
1612
1613
|
);
|
|
1613
1614
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-1.5", children: [
|
|
1614
|
-
renderNavButton(
|
|
1615
|
+
showEdgeButtons && renderNavButton(
|
|
1615
1616
|
() => handlePageChange(0),
|
|
1616
1617
|
isFirstDisabled,
|
|
1617
1618
|
"\uCCAB \uD398\uC774\uC9C0",
|
|
@@ -1630,7 +1631,7 @@ function Pagination(props) {
|
|
|
1630
1631
|
"\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
1631
1632
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-4.5 h-4.5 text-[#000000]" })
|
|
1632
1633
|
),
|
|
1633
|
-
renderNavButton(
|
|
1634
|
+
showEdgeButtons && renderNavButton(
|
|
1634
1635
|
() => handlePageChange(totalPages - 1),
|
|
1635
1636
|
isLastDisabled,
|
|
1636
1637
|
"\uB9C8\uC9C0\uB9C9 \uD398\uC774\uC9C0",
|
|
@@ -8641,6 +8642,7 @@ function MultiTabBar(props) {
|
|
|
8641
8642
|
const [groupDropTargetKey, setGroupDropTargetKey] = React6.useState(null);
|
|
8642
8643
|
const [groupDropSide, setGroupDropSide] = React6.useState("before");
|
|
8643
8644
|
const [dragPos, setDragPos] = React6.useState(null);
|
|
8645
|
+
const [grab, setGrab] = React6.useState(null);
|
|
8644
8646
|
const dropTargetIdRef = React6.useRef(null);
|
|
8645
8647
|
const dropSideRef = React6.useRef("before");
|
|
8646
8648
|
const groupDropTargetKeyRef = React6.useRef(null);
|
|
@@ -8860,6 +8862,7 @@ function MultiTabBar(props) {
|
|
|
8860
8862
|
setDraggingGroupKey(null);
|
|
8861
8863
|
setGroupDropTargetKey(null);
|
|
8862
8864
|
setDragPos(null);
|
|
8865
|
+
setGrab(null);
|
|
8863
8866
|
requestAnimationFrame(() => {
|
|
8864
8867
|
suppressClickRef.current = false;
|
|
8865
8868
|
});
|
|
@@ -8871,11 +8874,17 @@ function MultiTabBar(props) {
|
|
|
8871
8874
|
window.removeEventListener("pointerup", onPointerUp);
|
|
8872
8875
|
};
|
|
8873
8876
|
}, [reorderEnabled]);
|
|
8877
|
+
const recordGrab = (e) => {
|
|
8878
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
8879
|
+
setGrab({ offsetX: e.clientX - rect.left, offsetY: e.clientY - rect.top, width: rect.width });
|
|
8880
|
+
};
|
|
8874
8881
|
const handlePointerDown = (e, tabId) => {
|
|
8875
8882
|
pointerStateRef.current = { kind: "tab", id: tabId, startX: e.clientX, startY: e.clientY, dragging: false };
|
|
8883
|
+
recordGrab(e);
|
|
8876
8884
|
};
|
|
8877
8885
|
const handleGroupPointerDown = (e, groupKey) => {
|
|
8878
8886
|
pointerStateRef.current = { kind: "group", id: groupKey, startX: e.clientX, startY: e.clientY, dragging: false };
|
|
8887
|
+
recordGrab(e);
|
|
8879
8888
|
};
|
|
8880
8889
|
const showPlus = !!onTabAdd;
|
|
8881
8890
|
const canClose = tabs.length > 1;
|
|
@@ -8884,12 +8893,32 @@ function MultiTabBar(props) {
|
|
|
8884
8893
|
const draggingColor = draggingCluster?.group ? groupColors.get(draggingCluster.group.key)?.border : primaryColor;
|
|
8885
8894
|
const draggingGroupCluster = draggingGroupKey ? clusters?.find((c) => c.group?.key === draggingGroupKey) : void 0;
|
|
8886
8895
|
const draggingGroupColor = draggingGroupKey ? groupColors.get(draggingGroupKey) : void 0;
|
|
8887
|
-
const
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8896
|
+
const ghostContent = draggingGroupKey && draggingGroupCluster?.group ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8897
|
+
"div",
|
|
8898
|
+
{
|
|
8899
|
+
className: `flex h-6.5 items-center gap-1 rounded-lg px-2.5 text-sm font-semibold whitespace-nowrap text-white`,
|
|
8900
|
+
style: { backgroundColor: (draggingGroupColor ?? TAB_PALETTE[0]).base },
|
|
8901
|
+
children: draggingGroupCluster.group.label
|
|
8902
|
+
}
|
|
8903
|
+
) : draggingTab ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8904
|
+
MultiTabPill,
|
|
8905
|
+
{
|
|
8906
|
+
tab: draggingTab,
|
|
8907
|
+
isActive: draggingTab.id === activeTabId,
|
|
8908
|
+
showClose: canClose,
|
|
8909
|
+
accentColor: draggingCluster?.group ? draggingColor : primaryColor,
|
|
8910
|
+
style: s,
|
|
8911
|
+
onClick: () => {
|
|
8912
|
+
},
|
|
8913
|
+
onClose: () => {
|
|
8914
|
+
},
|
|
8915
|
+
registerRef: () => {
|
|
8916
|
+
},
|
|
8917
|
+
icon: getTabIcon?.(draggingTab),
|
|
8918
|
+
menuItems: getTabMenuItems?.(draggingTab),
|
|
8919
|
+
groupColor: draggingCluster?.group ? draggingColor : void 0
|
|
8920
|
+
}
|
|
8921
|
+
) : null;
|
|
8893
8922
|
if (tabs.length === 0) return null;
|
|
8894
8923
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8895
8924
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-shrink-0 w-full overflow-hidden ${s.container}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-stretch", children: [
|
|
@@ -9071,20 +9100,14 @@ function MultiTabBar(props) {
|
|
|
9071
9100
|
}
|
|
9072
9101
|
)
|
|
9073
9102
|
] }) }),
|
|
9074
|
-
dragPos &&
|
|
9103
|
+
dragPos && grab && ghostContent ? reactDom.createPortal(
|
|
9075
9104
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9076
9105
|
"div",
|
|
9077
9106
|
{
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
backgroundColor: ghost.bg,
|
|
9083
|
-
borderColor: ghost.border,
|
|
9084
|
-
color: ghost.color,
|
|
9085
|
-
transform: "rotate(-2deg)"
|
|
9086
|
-
},
|
|
9087
|
-
children: ghost.label
|
|
9107
|
+
"aria-hidden": true,
|
|
9108
|
+
className: "pointer-events-none fixed z-50 flex cursor-grabbing shadow-lg",
|
|
9109
|
+
style: { left: dragPos.x - grab.offsetX, top: dragPos.y - grab.offsetY, width: grab.width },
|
|
9110
|
+
children: ghostContent
|
|
9088
9111
|
}
|
|
9089
9112
|
),
|
|
9090
9113
|
document.body
|
|
@@ -10110,6 +10133,12 @@ var ACCENT_APPLIERS = {
|
|
|
10110
10133
|
grandchildActive: textStyle
|
|
10111
10134
|
}
|
|
10112
10135
|
};
|
|
10136
|
+
function MenuIcon(props) {
|
|
10137
|
+
const { icon, className } = props;
|
|
10138
|
+
if (React6.isValidElement(icon)) return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-center", children: icon });
|
|
10139
|
+
const Icon2 = icon;
|
|
10140
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className });
|
|
10141
|
+
}
|
|
10113
10142
|
function Sidebar(props) {
|
|
10114
10143
|
const navigate = reactRouter.useNavigate();
|
|
10115
10144
|
const {
|
|
@@ -10129,6 +10158,8 @@ function Sidebar(props) {
|
|
|
10129
10158
|
const [overflowVisible, setOverflowVisible] = React6.useState(true);
|
|
10130
10159
|
const [expandedItems, setExpandedItems] = React6.useState(/* @__PURE__ */ new Set());
|
|
10131
10160
|
const [expandedSubItems, setExpandedSubItems] = React6.useState(/* @__PURE__ */ new Set());
|
|
10161
|
+
const [dragging, setDragging] = React6.useState(null);
|
|
10162
|
+
const [dropTarget, setDropTarget] = React6.useState(null);
|
|
10132
10163
|
const toggleCollapse = () => setIsCollapsed((prev) => !prev);
|
|
10133
10164
|
const isHeaderRenderProp = typeof header === "function";
|
|
10134
10165
|
const headerContent = isHeaderRenderProp ? header({ isCollapsed, toggleCollapse }) : header;
|
|
@@ -10187,6 +10218,26 @@ function Sidebar(props) {
|
|
|
10187
10218
|
return next;
|
|
10188
10219
|
});
|
|
10189
10220
|
};
|
|
10221
|
+
const resetDrag = () => {
|
|
10222
|
+
setDragging(null);
|
|
10223
|
+
setDropTarget(null);
|
|
10224
|
+
};
|
|
10225
|
+
const dropItem = (section, sectionIndex) => {
|
|
10226
|
+
const from = dragging;
|
|
10227
|
+
const target = dropTarget;
|
|
10228
|
+
resetDrag();
|
|
10229
|
+
if (!section.onReorder || !from || !target || from.section !== sectionIndex || target.section !== sectionIndex) {
|
|
10230
|
+
return;
|
|
10231
|
+
}
|
|
10232
|
+
const insertAt = target.side === "after" ? target.index + 1 : target.index;
|
|
10233
|
+
if (insertAt === from.index || insertAt === from.index + 1) return;
|
|
10234
|
+
const next = [...section.items];
|
|
10235
|
+
const [moved] = next.splice(from.index, 1);
|
|
10236
|
+
if (!moved) return;
|
|
10237
|
+
next.splice(insertAt > from.index ? insertAt - 1 : insertAt, 0, moved);
|
|
10238
|
+
section.onReorder(next);
|
|
10239
|
+
};
|
|
10240
|
+
const dropLineColor = variant === "inkstone" ? "var(--fz-ink)" : primaryColor ?? "#3b82f6";
|
|
10190
10241
|
const handleItemClick = (path) => {
|
|
10191
10242
|
if (path.includes("https")) {
|
|
10192
10243
|
window.open(path, "_blank", "noopener,noreferrer");
|
|
@@ -10229,140 +10280,176 @@ function Sidebar(props) {
|
|
|
10229
10280
|
className: `${variant === "inkstone" ? "space-y-4 px-2" : "space-y-6"} ${variant === "system-dark" || variant === "system-light" ? "px-1" : ""}`,
|
|
10230
10281
|
children: menuSections.map((section, sectionIndex) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10231
10282
|
section.title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.sectionTitle, children: section.title }),
|
|
10232
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: section.items.map((item) => {
|
|
10283
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: section.items.map((item, itemIndex) => {
|
|
10233
10284
|
const isActive = !item.children && pathname === item.path;
|
|
10234
|
-
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10285
|
+
const sortable = section.onReorder !== void 0;
|
|
10286
|
+
const isDraggingThis = dragging?.section === sectionIndex && dragging.index === itemIndex;
|
|
10287
|
+
const dropSide = dropTarget?.section === sectionIndex && dropTarget.index === itemIndex ? dropTarget.side : null;
|
|
10288
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10289
|
+
"div",
|
|
10290
|
+
{
|
|
10291
|
+
className: sortable ? `relative ${isDraggingThis ? "opacity-40" : ""}` : void 0,
|
|
10292
|
+
draggable: sortable || void 0,
|
|
10293
|
+
onDragStart: sortable ? (event) => {
|
|
10294
|
+
event.dataTransfer.effectAllowed = "move";
|
|
10295
|
+
setDragging({ section: sectionIndex, index: itemIndex });
|
|
10296
|
+
} : void 0,
|
|
10297
|
+
onDragOver: sortable ? (event) => {
|
|
10298
|
+
if (dragging?.section !== sectionIndex) return;
|
|
10299
|
+
event.preventDefault();
|
|
10300
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
10301
|
+
const side = event.clientY - rect.top < rect.height / 2 ? "before" : "after";
|
|
10302
|
+
if (dropSide !== side) {
|
|
10303
|
+
setDropTarget({ section: sectionIndex, index: itemIndex, side });
|
|
10304
|
+
}
|
|
10305
|
+
} : void 0,
|
|
10306
|
+
onDrop: sortable ? (event) => {
|
|
10307
|
+
event.preventDefault();
|
|
10308
|
+
dropItem(section, sectionIndex);
|
|
10309
|
+
} : void 0,
|
|
10310
|
+
onDragEnd: sortable ? resetDrag : void 0,
|
|
10311
|
+
children: [
|
|
10312
|
+
dropSide && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10313
|
+
"div",
|
|
10314
|
+
{
|
|
10315
|
+
className: `pointer-events-none absolute right-0 left-0 z-10 h-0.5 ${dropSide === "before" ? "-top-px" : "-bottom-px"}`,
|
|
10316
|
+
style: { backgroundColor: dropLineColor }
|
|
10243
10317
|
}
|
|
10244
|
-
|
|
10245
|
-
|
|
10318
|
+
),
|
|
10319
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10320
|
+
"button",
|
|
10321
|
+
{
|
|
10322
|
+
onClick: () => {
|
|
10323
|
+
if (item.children) {
|
|
10324
|
+
toggleExpand(item.label);
|
|
10325
|
+
} else if (item.path) {
|
|
10326
|
+
handleItemClick(item.path);
|
|
10327
|
+
}
|
|
10328
|
+
},
|
|
10329
|
+
className: `
|
|
10246
10330
|
w-full text-left flex items-center gap-2 px-3 ${s.itemPy} ${s.rounded} ${s.itemTextSize} ${s.itemFont} transition-colors cursor-pointer
|
|
10247
10331
|
${isActive ? s.itemActive : s.itemInactive}
|
|
10248
10332
|
`,
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
{
|
|
10260
|
-
className: `w-4 h-4 transition-transform ${expandedItems.has(item.label) ? "rotate-90" : ""}`,
|
|
10261
|
-
fill: "none",
|
|
10262
|
-
stroke: "currentColor",
|
|
10263
|
-
viewBox: "0 0 24 24",
|
|
10264
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
|
|
10265
|
-
}
|
|
10266
|
-
),
|
|
10267
|
-
item.path?.includes("https") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10268
|
-
"svg",
|
|
10269
|
-
{
|
|
10270
|
-
className: "w-4 h-4 flex-shrink-0 opacity-50",
|
|
10271
|
-
fill: "none",
|
|
10272
|
-
stroke: "currentColor",
|
|
10273
|
-
viewBox: "0 0 24 24",
|
|
10274
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10275
|
-
"path",
|
|
10333
|
+
style: {
|
|
10334
|
+
...isActive ? s.activeItemStyle : {},
|
|
10335
|
+
...isActive && primaryColor ? applier.itemActive(primaryColor) : {}
|
|
10336
|
+
},
|
|
10337
|
+
children: [
|
|
10338
|
+
/* @__PURE__ */ jsxRuntime.jsx(MenuIcon, { icon: item.icon, className: s.iconClass }),
|
|
10339
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `flex-1 ${variant === "inkstone" ? "min-w-0 truncate text-left" : ""}`, children: item.label }),
|
|
10340
|
+
item.badge !== void 0 && item.badge !== null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs font-medium opacity-60", children: item.badge }),
|
|
10341
|
+
item.children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10342
|
+
"svg",
|
|
10276
10343
|
{
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10344
|
+
className: `w-4 h-4 transition-transform ${expandedItems.has(item.label) ? "rotate-90" : ""}`,
|
|
10345
|
+
fill: "none",
|
|
10346
|
+
stroke: "currentColor",
|
|
10347
|
+
viewBox: "0 0 24 24",
|
|
10348
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
|
|
10349
|
+
}
|
|
10350
|
+
),
|
|
10351
|
+
item.path?.includes("https") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10352
|
+
"svg",
|
|
10353
|
+
{
|
|
10354
|
+
className: "w-4 h-4 flex-shrink-0 opacity-50",
|
|
10355
|
+
fill: "none",
|
|
10356
|
+
stroke: "currentColor",
|
|
10357
|
+
viewBox: "0 0 24 24",
|
|
10358
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10359
|
+
"path",
|
|
10360
|
+
{
|
|
10361
|
+
strokeLinecap: "round",
|
|
10362
|
+
strokeLinejoin: "round",
|
|
10363
|
+
strokeWidth: 2,
|
|
10364
|
+
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
10365
|
+
}
|
|
10366
|
+
)
|
|
10281
10367
|
}
|
|
10282
10368
|
)
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
onClick: () => toggleSubExpand(subKey),
|
|
10298
|
-
className: `
|
|
10369
|
+
]
|
|
10370
|
+
}
|
|
10371
|
+
),
|
|
10372
|
+
item.children && expandedItems.has(item.label) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `ml-5 mt-0.5 space-y-0.5 border-l ${s.childGroupBorder}`, children: item.children.map((child, childIndex) => {
|
|
10373
|
+
if (child.children && child.children.length > 0) {
|
|
10374
|
+
const subKey = `${item.label}::${child.label}`;
|
|
10375
|
+
const isSubExpanded = expandedSubItems.has(subKey);
|
|
10376
|
+
const isSubActive = child.children.some((gc) => gc.path === pathname);
|
|
10377
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10378
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10379
|
+
"button",
|
|
10380
|
+
{
|
|
10381
|
+
onClick: () => toggleSubExpand(subKey),
|
|
10382
|
+
className: `
|
|
10299
10383
|
w-full text-left flex items-center justify-between pl-4 pr-3 ${s.childPy} ${s.rounded} ${s.itemTextSize} transition-colors cursor-pointer
|
|
10300
10384
|
${isSubActive ? s.subItemActive : s.subItemInactive}
|
|
10301
10385
|
`,
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
{
|
|
10308
|
-
className: `w-3 h-3 transition-transform ${isSubExpanded ? "rotate-90" : ""}`,
|
|
10309
|
-
fill: "none",
|
|
10310
|
-
stroke: "currentColor",
|
|
10311
|
-
viewBox: "0 0 24 24",
|
|
10312
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10313
|
-
"path",
|
|
10386
|
+
style: isSubActive && primaryColor ? applier.subItemActive(primaryColor) : void 0,
|
|
10387
|
+
children: [
|
|
10388
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: child.label }),
|
|
10389
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10390
|
+
"svg",
|
|
10314
10391
|
{
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10392
|
+
className: `w-3 h-3 transition-transform ${isSubExpanded ? "rotate-90" : ""}`,
|
|
10393
|
+
fill: "none",
|
|
10394
|
+
stroke: "currentColor",
|
|
10395
|
+
viewBox: "0 0 24 24",
|
|
10396
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10397
|
+
"path",
|
|
10398
|
+
{
|
|
10399
|
+
strokeLinecap: "round",
|
|
10400
|
+
strokeLinejoin: "round",
|
|
10401
|
+
strokeWidth: 2,
|
|
10402
|
+
d: "M9 5l7 7-7 7"
|
|
10403
|
+
}
|
|
10404
|
+
)
|
|
10319
10405
|
}
|
|
10320
10406
|
)
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
onClick: () => handleItemClick(grandchild.path),
|
|
10332
|
-
className: `
|
|
10407
|
+
]
|
|
10408
|
+
}
|
|
10409
|
+
),
|
|
10410
|
+
isSubExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-3 mt-0.5 space-y-0.5 pl-2", children: child.children.map((grandchild) => {
|
|
10411
|
+
const isGrandchildActive = pathname === grandchild.path;
|
|
10412
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10413
|
+
"button",
|
|
10414
|
+
{
|
|
10415
|
+
onClick: () => handleItemClick(grandchild.path),
|
|
10416
|
+
className: `
|
|
10333
10417
|
w-full text-left px-3 ${s.grandchildPy} ${s.rounded} ${s.grandchildTextSize} transition-colors cursor-pointer
|
|
10334
10418
|
${isGrandchildActive ? s.grandchildActive : s.grandchildInactive}
|
|
10335
10419
|
`,
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10420
|
+
style: {
|
|
10421
|
+
...isGrandchildActive ? s.activeGrandchildStyle : {},
|
|
10422
|
+
...isGrandchildActive && primaryColor ? applier.grandchildActive(primaryColor) : {}
|
|
10423
|
+
},
|
|
10424
|
+
children: grandchild.label
|
|
10425
|
+
},
|
|
10426
|
+
grandchild.path
|
|
10427
|
+
);
|
|
10428
|
+
}) })
|
|
10429
|
+
] }, child.label);
|
|
10430
|
+
}
|
|
10431
|
+
const isChildActive = pathname === child.path;
|
|
10432
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10433
|
+
"button",
|
|
10434
|
+
{
|
|
10435
|
+
onClick: () => handleItemClick(child.path ?? ""),
|
|
10436
|
+
className: `
|
|
10353
10437
|
w-full text-left pl-4 pr-3 ${s.childPy} ${s.rounded} ${s.itemTextSize} transition-colors cursor-pointer
|
|
10354
10438
|
${isChildActive ? s.childActive : s.childInactive}
|
|
10355
10439
|
`,
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10440
|
+
style: {
|
|
10441
|
+
...isChildActive ? s.activeChildStyle : {},
|
|
10442
|
+
...isChildActive && primaryColor ? applier.childActive(primaryColor) : {}
|
|
10443
|
+
},
|
|
10444
|
+
children: child.label
|
|
10445
|
+
},
|
|
10446
|
+
childIndex
|
|
10447
|
+
);
|
|
10448
|
+
}) })
|
|
10449
|
+
]
|
|
10450
|
+
},
|
|
10451
|
+
item.id ?? item.label
|
|
10452
|
+
);
|
|
10366
10453
|
}) })
|
|
10367
10454
|
] }, section.title ?? sectionIndex))
|
|
10368
10455
|
}
|