@farmzone/fz-react-ui 1.2.0 → 1.2.1
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/README.md +27 -0
- package/dist/index.cjs +284 -198
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +284 -198
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -59,7 +59,12 @@ var buttonVariants = cva(
|
|
|
59
59
|
accent: "btn-grad text-white rounded-full",
|
|
60
60
|
metal: "btn-metal text-white min-w-22",
|
|
61
61
|
ghost: "p-1 h-auto rounded-sm bg-transparent text-sub-darkgray transition-colors hover:bg-gray-100",
|
|
62
|
-
link: "bg-transparent border-none text-main-blue underline-offset-4 hover:underline h-auto p-0"
|
|
62
|
+
link: "bg-transparent border-none text-main-blue underline-offset-4 hover:underline h-auto p-0",
|
|
63
|
+
// inkstone: 흑백 미니멀. 색은 --fz-ink-* 변수(styles/inkstone.css)에서 읽는다.
|
|
64
|
+
inkstone: "rounded-[2px] bg-[var(--fz-ink)] border border-[var(--fz-ink)] text-[var(--fz-ink-contrast)] hover:bg-[var(--fz-ink-hover)] hover:border-[var(--fz-ink-hover)] active:bg-[var(--fz-ink)]",
|
|
65
|
+
"inkstone-outline": "rounded-[2px] bg-[var(--fz-ink-surface)] border border-[var(--fz-ink-line-strong)] text-[var(--fz-ink-text)] hover:bg-[var(--fz-ink-soft)] active:bg-[var(--fz-ink-selected)]",
|
|
66
|
+
"inkstone-ghost": "rounded-[2px] bg-transparent border border-transparent text-[var(--fz-ink-text-secondary)] hover:bg-[var(--fz-ink-soft)] hover:text-[var(--fz-ink-text)] active:bg-[var(--fz-ink-selected)]",
|
|
67
|
+
"inkstone-danger": "rounded-[2px] bg-[var(--fz-ink-surface)] border border-[var(--fz-ink-danger)] text-[var(--fz-ink-danger)] hover:bg-[color-mix(in_srgb,var(--fz-ink-danger)_8%,var(--fz-ink-surface))]"
|
|
63
68
|
},
|
|
64
69
|
size: {
|
|
65
70
|
default: "h-8 px-4 font-semibold",
|
|
@@ -3781,6 +3786,15 @@ var VARIANT_CONFIG = {
|
|
|
3781
3786
|
titleColor: "text-slate-100",
|
|
3782
3787
|
descColor: "text-slate-400",
|
|
3783
3788
|
closeBtn: "text-slate-500 group-hover:text-slate-300"
|
|
3789
|
+
},
|
|
3790
|
+
// inkstone: 흰 바탕에 아래 테두리만. 아이콘은 회색 네모 칸 안의 먹색.
|
|
3791
|
+
inkstone: {
|
|
3792
|
+
container: "bg-[var(--fz-ink-surface)] border-[var(--fz-ink-line)]",
|
|
3793
|
+
iconBg: "bg-[var(--fz-ink-soft)] rounded-[2px]",
|
|
3794
|
+
iconColor: "text-[var(--fz-ink-text)]",
|
|
3795
|
+
titleColor: "text-[var(--fz-ink-text)]",
|
|
3796
|
+
descColor: "text-[var(--fz-ink-text-tertiary)]",
|
|
3797
|
+
closeBtn: "text-[var(--fz-ink-text-tertiary)] group-hover:text-[var(--fz-ink-text)]"
|
|
3784
3798
|
}
|
|
3785
3799
|
};
|
|
3786
3800
|
var SIZE_CONFIG = {
|
|
@@ -5020,7 +5034,8 @@ function Table(props) {
|
|
|
5020
5034
|
tooltipConfig = "overflow",
|
|
5021
5035
|
isDynamicHeight = true,
|
|
5022
5036
|
showHorizontalDivider = true,
|
|
5023
|
-
showVerticalDivider = true
|
|
5037
|
+
showVerticalDivider = true,
|
|
5038
|
+
variant = "default"
|
|
5024
5039
|
} = props;
|
|
5025
5040
|
const {
|
|
5026
5041
|
fixed = false,
|
|
@@ -5500,82 +5515,89 @@ function Table(props) {
|
|
|
5500
5515
|
const rest = baseRows.filter((row) => !effectiveRowOrder.includes(String(getRowKey(row.original, row.index))));
|
|
5501
5516
|
return [...ordered, ...rest];
|
|
5502
5517
|
}, [baseRows, effectiveRowOrder, getRowKey]);
|
|
5503
|
-
return /* @__PURE__ */ jsxs(
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
children: /* @__PURE__ */ jsxs(
|
|
5512
|
-
"table",
|
|
5518
|
+
return /* @__PURE__ */ jsxs(
|
|
5519
|
+
"div",
|
|
5520
|
+
{
|
|
5521
|
+
className: "bg-white rounded shadow-table border border-gray-200 overflow-hidden",
|
|
5522
|
+
"data-fz-table-variant": variant,
|
|
5523
|
+
children: [
|
|
5524
|
+
/* @__PURE__ */ jsx(
|
|
5525
|
+
"div",
|
|
5513
5526
|
{
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5527
|
+
id: "table-layout",
|
|
5528
|
+
ref: scrollRef,
|
|
5529
|
+
className: "relative w-full overflow-y-auto overflow-x-auto custom-view-scrollbar bg-white",
|
|
5530
|
+
style: { height: `${tableHeight}px` },
|
|
5531
|
+
children: /* @__PURE__ */ jsxs(
|
|
5532
|
+
"table",
|
|
5533
|
+
{
|
|
5534
|
+
className: `table-fixed border-spacing-0${tableMinWidth === void 0 ? " w-full" : ""}`,
|
|
5535
|
+
style: tableMinWidth !== void 0 ? { width: tableMinWidth, minWidth: tableMinWidth } : {
|
|
5536
|
+
minWidth: orderedColumns.reduce(
|
|
5537
|
+
(sum, col) => sum + (col.key === "__checkbox__" || col.width !== void 0 ? parseColPx(col) : 80),
|
|
5538
|
+
0
|
|
5539
|
+
)
|
|
5540
|
+
},
|
|
5541
|
+
children: [
|
|
5542
|
+
/* @__PURE__ */ jsx(
|
|
5543
|
+
TableHeader,
|
|
5544
|
+
{
|
|
5545
|
+
columns: orderedColumns,
|
|
5546
|
+
getAlignStyle,
|
|
5547
|
+
sortOption,
|
|
5548
|
+
onSortChange,
|
|
5549
|
+
onColumnDragStartCapture: handleColumnDragStartCapture,
|
|
5550
|
+
onColumnDragStart: handleColumnDragStart,
|
|
5551
|
+
onColumnDrop: handleColumnDrop,
|
|
5552
|
+
onColumnDragEnd: handleColumnDragEnd,
|
|
5553
|
+
onColumnDragOver: handleColumnDragOver,
|
|
5554
|
+
isColumnDraggable
|
|
5555
|
+
}
|
|
5556
|
+
),
|
|
5557
|
+
/* @__PURE__ */ jsx("tbody", { className: "w-full h-full", children: showSkeleton ? Array.from({ length: 3 }).map((_, rowIdx) => /* @__PURE__ */ jsxs("tr", { className: "hover:bg-gray-50", children: [
|
|
5558
|
+
leadingPinnedCols.map((col, idx) => /* @__PURE__ */ jsx(SkeletonTd, { col, showSquare: idx === 0 && !!checkboxInfo }, `leading-${idx}`)),
|
|
5559
|
+
leftColspan > 0 && /* @__PURE__ */ jsx("td", { colSpan: leftColspan, style: { padding: 0, border: "none" } }),
|
|
5560
|
+
virtualItems.map((vc) => /* @__PURE__ */ jsx(SkeletonTd, { col: groupCols[vc.index] }, `group-${vc.index}`)),
|
|
5561
|
+
rightColspan > 0 && /* @__PURE__ */ jsx("td", { colSpan: rightColspan, style: { padding: 0, border: "none" } }),
|
|
5562
|
+
trailingPinnedCols.map((col, idx) => /* @__PURE__ */ jsx(SkeletonTd, { col }, `trailing-${idx}`))
|
|
5563
|
+
] }, rowIdx)) : showEmpty ? /* @__PURE__ */ jsx(TableEmpty, { columnCount: allColumns.length }) : rows.map((row) => {
|
|
5564
|
+
const rowId = String(getRowKey(row.original, row.index));
|
|
5565
|
+
return /* @__PURE__ */ jsx(
|
|
5566
|
+
TableDataRow,
|
|
5567
|
+
{
|
|
5568
|
+
record: row.original,
|
|
5569
|
+
rowIdx: row.index,
|
|
5570
|
+
rowId,
|
|
5571
|
+
draggable: rowDraggable && !showSkeleton,
|
|
5572
|
+
onDragStart: handleRowDragStart,
|
|
5573
|
+
onDragOver: handleRowDragOver,
|
|
5574
|
+
onDrop: handleRowDrop,
|
|
5575
|
+
onDragEnd: handleRowDragEnd,
|
|
5576
|
+
leftColspan,
|
|
5577
|
+
rightColspan,
|
|
5578
|
+
renderLeadingPinnedCols,
|
|
5579
|
+
renderVisibleGroupCols,
|
|
5580
|
+
renderTrailingPinnedCols
|
|
5581
|
+
},
|
|
5582
|
+
row.id
|
|
5583
|
+
);
|
|
5584
|
+
}) })
|
|
5585
|
+
]
|
|
5586
|
+
}
|
|
5587
|
+
)
|
|
5566
5588
|
}
|
|
5567
|
-
)
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5589
|
+
),
|
|
5590
|
+
!showSkeleton && (paginationInfo || renderFooter?.renderLeft || renderFooter?.renderRight) && /* @__PURE__ */ jsx("div", { ref: footerRef, children: /* @__PURE__ */ jsx(
|
|
5591
|
+
TableFooter,
|
|
5592
|
+
{
|
|
5593
|
+
paginationInfo,
|
|
5594
|
+
renderLeft: renderFooter?.renderLeft,
|
|
5595
|
+
renderRight: renderFooter?.renderRight
|
|
5596
|
+
}
|
|
5597
|
+
) })
|
|
5598
|
+
]
|
|
5599
|
+
}
|
|
5600
|
+
);
|
|
5579
5601
|
}
|
|
5580
5602
|
var CarouselContext = React6.createContext(null);
|
|
5581
5603
|
function useCarousel() {
|
|
@@ -8315,6 +8337,26 @@ var VARIANT_STYLES = {
|
|
|
8315
8337
|
tabTextSize: "text-sm",
|
|
8316
8338
|
scrollPadding: "px-4 pt-2",
|
|
8317
8339
|
rounded: "rounded-t-none"
|
|
8340
|
+
},
|
|
8341
|
+
// inkstone: 흑백 미니멀. 선택된 탭만 먹(검정) 바탕에 흰 글자, 나머지는 흰 바탕 + 회색 테두리.
|
|
8342
|
+
inkstone: {
|
|
8343
|
+
container: "bg-[var(--fz-ink-canvas)]",
|
|
8344
|
+
activeTab: "bg-[var(--fz-ink)] border-[var(--fz-ink)] text-[var(--fz-ink-contrast)]",
|
|
8345
|
+
inactiveTab: "bg-[var(--fz-ink-surface)] border-[var(--fz-ink-line)] text-[var(--fz-ink-text-secondary)] hover:text-[var(--fz-ink-text)] hover:bg-[var(--fz-ink-soft)] hover:border-[var(--fz-ink-line-control)]",
|
|
8346
|
+
activeText: "font-bold text-[var(--fz-ink-contrast)]",
|
|
8347
|
+
inactiveText: "font-medium",
|
|
8348
|
+
indicator: "bg-transparent",
|
|
8349
|
+
closeBtn: "ml-auto rounded-[2px] opacity-60 hover:opacity-100 hover:bg-[color-mix(in_srgb,currentColor_18%,transparent)]",
|
|
8350
|
+
closeBtnWH: "w-4 h-4",
|
|
8351
|
+
closeBtnSize: 12,
|
|
8352
|
+
plusBtnArea: "bg-[var(--fz-ink-canvas)]",
|
|
8353
|
+
plusBtn: "text-[var(--fz-ink-text-tertiary)] hover:text-[var(--fz-ink-text)] hover:bg-[var(--fz-ink-soft)]",
|
|
8354
|
+
fadeOpacity: 0.12,
|
|
8355
|
+
tabHeight: "h-[30px]",
|
|
8356
|
+
tabPx: "px-3",
|
|
8357
|
+
tabTextSize: "text-xs",
|
|
8358
|
+
scrollPadding: "px-2 pt-2",
|
|
8359
|
+
rounded: "rounded-t-[2px]"
|
|
8318
8360
|
}
|
|
8319
8361
|
};
|
|
8320
8362
|
var PLUS_BTN_WIDTH = 36;
|
|
@@ -9907,6 +9949,34 @@ var VARIANT_STYLES2 = {
|
|
|
9907
9949
|
paddingLeft: "10px"
|
|
9908
9950
|
},
|
|
9909
9951
|
footerBorder: "border-t border-gray-200"
|
|
9952
|
+
},
|
|
9953
|
+
// inkstone: 흑백 미니멀. 현재 메뉴는 회색 바탕 + 굵은 글자로만 표시하고 색 띠를 두지 않는다.
|
|
9954
|
+
inkstone: {
|
|
9955
|
+
aside: "bg-[var(--fz-ink-canvas)]",
|
|
9956
|
+
sectionTitle: "text-[11px] font-medium text-[var(--fz-ink-text-tertiary)] mb-1 px-2",
|
|
9957
|
+
itemActive: "font-bold",
|
|
9958
|
+
itemInactive: "text-[var(--fz-ink-text)] hover:bg-[var(--fz-ink-soft)]",
|
|
9959
|
+
subItemActive: "text-[var(--fz-ink-text)] font-bold",
|
|
9960
|
+
subItemInactive: "text-[var(--fz-ink-text-secondary)] hover:bg-[var(--fz-ink-soft)] hover:text-[var(--fz-ink-text)]",
|
|
9961
|
+
childGroupBorder: "border-[var(--fz-ink-line)]",
|
|
9962
|
+
childActive: "font-bold",
|
|
9963
|
+
childInactive: "text-[var(--fz-ink-text-secondary)] hover:bg-[var(--fz-ink-soft)] hover:text-[var(--fz-ink-text)]",
|
|
9964
|
+
grandchildActive: "text-[var(--fz-ink-text)] font-bold",
|
|
9965
|
+
grandchildInactive: "text-[var(--fz-ink-text-tertiary)] hover:bg-[var(--fz-ink-soft)] hover:text-[var(--fz-ink-text)]",
|
|
9966
|
+
collapseBtn: "bg-transparent hover:bg-[var(--fz-ink-soft)]",
|
|
9967
|
+
collapseIcon: "#525252",
|
|
9968
|
+
rounded: "rounded-[2px]",
|
|
9969
|
+
itemPy: "py-2",
|
|
9970
|
+
childPy: "py-1.5",
|
|
9971
|
+
grandchildPy: "py-1",
|
|
9972
|
+
itemFont: "font-medium",
|
|
9973
|
+
itemTextSize: "text-[13px]",
|
|
9974
|
+
grandchildTextSize: "text-xs",
|
|
9975
|
+
iconClass: "w-4 h-4 flex-shrink-0",
|
|
9976
|
+
activeItemStyle: { color: "var(--fz-ink-text)", backgroundColor: "var(--fz-ink-soft)" },
|
|
9977
|
+
activeChildStyle: { color: "var(--fz-ink-text)", backgroundColor: "var(--fz-ink-soft)" },
|
|
9978
|
+
activeGrandchildStyle: { color: "var(--fz-ink-text)", backgroundColor: "var(--fz-ink-soft)" },
|
|
9979
|
+
footerBorder: "border-t border-[var(--fz-ink-line)]"
|
|
9910
9980
|
}
|
|
9911
9981
|
};
|
|
9912
9982
|
function tintedStyle(color) {
|
|
@@ -9975,6 +10045,13 @@ var ACCENT_APPLIERS = {
|
|
|
9975
10045
|
borderLeft: `2px solid ${c}`,
|
|
9976
10046
|
paddingLeft: "10px"
|
|
9977
10047
|
})
|
|
10048
|
+
},
|
|
10049
|
+
// inkstone keeps its flat grey highlight; a primaryColor only tints it, with no side bar.
|
|
10050
|
+
inkstone: {
|
|
10051
|
+
itemActive: tintedStyle,
|
|
10052
|
+
subItemActive: textStyle,
|
|
10053
|
+
childActive: tintedStyle,
|
|
10054
|
+
grandchildActive: textStyle
|
|
9978
10055
|
}
|
|
9979
10056
|
};
|
|
9980
10057
|
function Sidebar(props) {
|
|
@@ -9988,6 +10065,7 @@ function Sidebar(props) {
|
|
|
9988
10065
|
showCollapseButton = false,
|
|
9989
10066
|
collapseButtonPlacement = "right",
|
|
9990
10067
|
variant = "light",
|
|
10068
|
+
width,
|
|
9991
10069
|
primaryColor
|
|
9992
10070
|
} = props;
|
|
9993
10071
|
const { pathname } = useLocation();
|
|
@@ -10065,12 +10143,13 @@ function Sidebar(props) {
|
|
|
10065
10143
|
"aside",
|
|
10066
10144
|
{
|
|
10067
10145
|
className: `
|
|
10068
|
-
${isCollapsed ? "w-11 min-w-11" : "min-w-60 w-62"}
|
|
10146
|
+
${isCollapsed ? "w-11 min-w-11" : width === void 0 ? "min-w-60 w-62" : ""}
|
|
10069
10147
|
transition-[width,min-width] duration-300 ease-in-out
|
|
10070
10148
|
relative h-screen shrink-0 overflow-x-hidden flex flex-col
|
|
10071
10149
|
${s.aside}
|
|
10072
10150
|
${className ?? ""}
|
|
10073
10151
|
`,
|
|
10152
|
+
style: !isCollapsed && width !== void 0 ? { width, minWidth: width } : void 0,
|
|
10074
10153
|
children: [
|
|
10075
10154
|
showCollapseButton && !isHeaderRenderProp && /* @__PURE__ */ jsx(
|
|
10076
10155
|
"button",
|
|
@@ -10084,147 +10163,154 @@ function Sidebar(props) {
|
|
|
10084
10163
|
/* @__PURE__ */ jsx("div", { className: `flex-1 min-h-0 hide-scrollbar ${overflowVisible ? "overflow-y-auto" : "overflow-hidden"}`, children: /* @__PURE__ */ jsxs(
|
|
10085
10164
|
"div",
|
|
10086
10165
|
{
|
|
10087
|
-
className: `transition-opacity duration-200 ease-in-out ${isCollapsed ? "opacity-0 pointer-events-none select-none" : "opacity-100"} ${variant === "system-dark" || variant === "system-light" ? "pb-6" : "px-4 pb-6"}`,
|
|
10166
|
+
className: `transition-opacity duration-200 ease-in-out ${isCollapsed ? "opacity-0 pointer-events-none select-none" : "opacity-100"} ${variant === "system-dark" || variant === "system-light" || variant === "inkstone" ? "pb-6" : "px-4 pb-6"}`,
|
|
10088
10167
|
style: { transitionDelay: isCollapsed ? "0ms" : "150ms" },
|
|
10089
10168
|
children: [
|
|
10090
10169
|
!isHeaderRenderProp && headerContent,
|
|
10091
|
-
/* @__PURE__ */ jsx(
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
/* @__PURE__ */
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10170
|
+
/* @__PURE__ */ jsx(
|
|
10171
|
+
"nav",
|
|
10172
|
+
{
|
|
10173
|
+
className: `${variant === "inkstone" ? "space-y-4 px-2" : "space-y-6"} ${variant === "system-dark" || variant === "system-light" ? "px-1" : ""}`,
|
|
10174
|
+
children: menuSections.map((section, sectionIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
10175
|
+
section.title && /* @__PURE__ */ jsx("div", { className: s.sectionTitle, children: section.title }),
|
|
10176
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: section.items.map((item) => {
|
|
10177
|
+
const isActive = !item.children && pathname === item.path;
|
|
10178
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
10179
|
+
/* @__PURE__ */ jsxs(
|
|
10180
|
+
"button",
|
|
10181
|
+
{
|
|
10182
|
+
onClick: () => {
|
|
10183
|
+
if (item.children) {
|
|
10184
|
+
toggleExpand(item.label);
|
|
10185
|
+
} else if (item.path) {
|
|
10186
|
+
handleItemClick(item.path);
|
|
10187
|
+
}
|
|
10188
|
+
},
|
|
10189
|
+
className: `
|
|
10107
10190
|
w-full text-left flex items-center gap-2 px-3 ${s.itemPy} ${s.rounded} ${s.itemTextSize} ${s.itemFont} transition-colors cursor-pointer
|
|
10108
10191
|
${isActive ? s.itemActive : s.itemInactive}
|
|
10109
10192
|
`,
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
className: "w-4 h-4 flex-shrink-0 opacity-50",
|
|
10131
|
-
fill: "none",
|
|
10132
|
-
stroke: "currentColor",
|
|
10133
|
-
viewBox: "0 0 24 24",
|
|
10134
|
-
children: /* @__PURE__ */ jsx(
|
|
10135
|
-
"path",
|
|
10193
|
+
style: {
|
|
10194
|
+
...isActive ? s.activeItemStyle : {},
|
|
10195
|
+
...isActive && primaryColor ? applier.itemActive(primaryColor) : {}
|
|
10196
|
+
},
|
|
10197
|
+
children: [
|
|
10198
|
+
/* @__PURE__ */ jsx(item.icon, { className: s.iconClass }),
|
|
10199
|
+
/* @__PURE__ */ jsx("span", { className: `flex-1 ${variant === "inkstone" ? "min-w-0 truncate text-left" : ""}`, children: item.label }),
|
|
10200
|
+
item.badge !== void 0 && item.badge !== null && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs font-medium opacity-60", children: item.badge }),
|
|
10201
|
+
item.children && /* @__PURE__ */ jsx(
|
|
10202
|
+
"svg",
|
|
10203
|
+
{
|
|
10204
|
+
className: `w-4 h-4 transition-transform ${expandedItems.has(item.label) ? "rotate-90" : ""}`,
|
|
10205
|
+
fill: "none",
|
|
10206
|
+
stroke: "currentColor",
|
|
10207
|
+
viewBox: "0 0 24 24",
|
|
10208
|
+
children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
|
|
10209
|
+
}
|
|
10210
|
+
),
|
|
10211
|
+
item.path?.includes("https") && /* @__PURE__ */ jsx(
|
|
10212
|
+
"svg",
|
|
10136
10213
|
{
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10214
|
+
className: "w-4 h-4 flex-shrink-0 opacity-50",
|
|
10215
|
+
fill: "none",
|
|
10216
|
+
stroke: "currentColor",
|
|
10217
|
+
viewBox: "0 0 24 24",
|
|
10218
|
+
children: /* @__PURE__ */ jsx(
|
|
10219
|
+
"path",
|
|
10220
|
+
{
|
|
10221
|
+
strokeLinecap: "round",
|
|
10222
|
+
strokeLinejoin: "round",
|
|
10223
|
+
strokeWidth: 2,
|
|
10224
|
+
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
10225
|
+
}
|
|
10226
|
+
)
|
|
10141
10227
|
}
|
|
10142
10228
|
)
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
onClick: () => toggleSubExpand(subKey),
|
|
10158
|
-
className: `
|
|
10229
|
+
]
|
|
10230
|
+
}
|
|
10231
|
+
),
|
|
10232
|
+
item.children && expandedItems.has(item.label) && /* @__PURE__ */ jsx("div", { className: `ml-5 mt-0.5 space-y-0.5 border-l ${s.childGroupBorder}`, children: item.children.map((child, childIndex) => {
|
|
10233
|
+
if (child.children && child.children.length > 0) {
|
|
10234
|
+
const subKey = `${item.label}::${child.label}`;
|
|
10235
|
+
const isSubExpanded = expandedSubItems.has(subKey);
|
|
10236
|
+
const isSubActive = child.children.some((gc) => gc.path === pathname);
|
|
10237
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
10238
|
+
/* @__PURE__ */ jsxs(
|
|
10239
|
+
"button",
|
|
10240
|
+
{
|
|
10241
|
+
onClick: () => toggleSubExpand(subKey),
|
|
10242
|
+
className: `
|
|
10159
10243
|
w-full text-left flex items-center justify-between pl-4 pr-3 ${s.childPy} ${s.rounded} ${s.itemTextSize} transition-colors cursor-pointer
|
|
10160
10244
|
${isSubActive ? s.subItemActive : s.subItemInactive}
|
|
10161
10245
|
`,
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
{
|
|
10168
|
-
className: `w-3 h-3 transition-transform ${isSubExpanded ? "rotate-90" : ""}`,
|
|
10169
|
-
fill: "none",
|
|
10170
|
-
stroke: "currentColor",
|
|
10171
|
-
viewBox: "0 0 24 24",
|
|
10172
|
-
children: /* @__PURE__ */ jsx(
|
|
10173
|
-
"path",
|
|
10246
|
+
style: isSubActive && primaryColor ? applier.subItemActive(primaryColor) : void 0,
|
|
10247
|
+
children: [
|
|
10248
|
+
/* @__PURE__ */ jsx("span", { children: child.label }),
|
|
10249
|
+
/* @__PURE__ */ jsx(
|
|
10250
|
+
"svg",
|
|
10174
10251
|
{
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10252
|
+
className: `w-3 h-3 transition-transform ${isSubExpanded ? "rotate-90" : ""}`,
|
|
10253
|
+
fill: "none",
|
|
10254
|
+
stroke: "currentColor",
|
|
10255
|
+
viewBox: "0 0 24 24",
|
|
10256
|
+
children: /* @__PURE__ */ jsx(
|
|
10257
|
+
"path",
|
|
10258
|
+
{
|
|
10259
|
+
strokeLinecap: "round",
|
|
10260
|
+
strokeLinejoin: "round",
|
|
10261
|
+
strokeWidth: 2,
|
|
10262
|
+
d: "M9 5l7 7-7 7"
|
|
10263
|
+
}
|
|
10264
|
+
)
|
|
10179
10265
|
}
|
|
10180
10266
|
)
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
onClick: () => handleItemClick(grandchild.path),
|
|
10192
|
-
className: `
|
|
10267
|
+
]
|
|
10268
|
+
}
|
|
10269
|
+
),
|
|
10270
|
+
isSubExpanded && /* @__PURE__ */ jsx("div", { className: "ml-3 mt-0.5 space-y-0.5 pl-2", children: child.children.map((grandchild) => {
|
|
10271
|
+
const isGrandchildActive = pathname === grandchild.path;
|
|
10272
|
+
return /* @__PURE__ */ jsx(
|
|
10273
|
+
"button",
|
|
10274
|
+
{
|
|
10275
|
+
onClick: () => handleItemClick(grandchild.path),
|
|
10276
|
+
className: `
|
|
10193
10277
|
w-full text-left px-3 ${s.grandchildPy} ${s.rounded} ${s.grandchildTextSize} transition-colors cursor-pointer
|
|
10194
10278
|
${isGrandchildActive ? s.grandchildActive : s.grandchildInactive}
|
|
10195
10279
|
`,
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10280
|
+
style: {
|
|
10281
|
+
...isGrandchildActive ? s.activeGrandchildStyle : {},
|
|
10282
|
+
...isGrandchildActive && primaryColor ? applier.grandchildActive(primaryColor) : {}
|
|
10283
|
+
},
|
|
10284
|
+
children: grandchild.label
|
|
10285
|
+
},
|
|
10286
|
+
grandchild.path
|
|
10287
|
+
);
|
|
10288
|
+
}) })
|
|
10289
|
+
] }, child.label);
|
|
10290
|
+
}
|
|
10291
|
+
const isChildActive = pathname === child.path;
|
|
10292
|
+
return /* @__PURE__ */ jsx(
|
|
10293
|
+
"button",
|
|
10294
|
+
{
|
|
10295
|
+
onClick: () => handleItemClick(child.path ?? ""),
|
|
10296
|
+
className: `
|
|
10213
10297
|
w-full text-left pl-4 pr-3 ${s.childPy} ${s.rounded} ${s.itemTextSize} transition-colors cursor-pointer
|
|
10214
10298
|
${isChildActive ? s.childActive : s.childInactive}
|
|
10215
10299
|
`,
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10300
|
+
style: {
|
|
10301
|
+
...isChildActive ? s.activeChildStyle : {},
|
|
10302
|
+
...isChildActive && primaryColor ? applier.childActive(primaryColor) : {}
|
|
10303
|
+
},
|
|
10304
|
+
children: child.label
|
|
10305
|
+
},
|
|
10306
|
+
childIndex
|
|
10307
|
+
);
|
|
10308
|
+
}) })
|
|
10309
|
+
] }, item.label);
|
|
10224
10310
|
}) })
|
|
10225
|
-
] },
|
|
10226
|
-
}
|
|
10227
|
-
|
|
10311
|
+
] }, section.title ?? sectionIndex))
|
|
10312
|
+
}
|
|
10313
|
+
)
|
|
10228
10314
|
]
|
|
10229
10315
|
}
|
|
10230
10316
|
) }),
|
|
@@ -11217,7 +11303,7 @@ function RichEditorToolbar(props) {
|
|
|
11217
11303
|
"div",
|
|
11218
11304
|
{
|
|
11219
11305
|
className: cn(
|
|
11220
|
-
"flex flex-wrap items-center gap-0.5 p-2",
|
|
11306
|
+
"sticky top-0 z-10 flex flex-wrap items-center gap-0.5 p-2",
|
|
11221
11307
|
theme.toolbar.wrapper,
|
|
11222
11308
|
className
|
|
11223
11309
|
),
|
|
@@ -11849,7 +11935,7 @@ var RichEditor = forwardRef(function RichEditor2({
|
|
|
11849
11935
|
const editorBox = /* @__PURE__ */ jsxs(
|
|
11850
11936
|
"div",
|
|
11851
11937
|
{
|
|
11852
|
-
className: cn("overflow-
|
|
11938
|
+
className: cn("overflow-clip rounded-lg border border-gray-200 shadow-sm flex flex-col relative", className),
|
|
11853
11939
|
"data-rich-editor-theme": theme,
|
|
11854
11940
|
style: accentStyle,
|
|
11855
11941
|
children: [
|