@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/README.md
CHANGED
|
@@ -53,6 +53,33 @@ import "@farmzone/fz-react-ui/styles";
|
|
|
53
53
|
|
|
54
54
|
`tw.css`는 fz-react-ui의 컴파일된 JS를 `@source`로 스캔하고, 라이브러리 전용 색상 토큰(`--color-main-red` 등)을 `@theme`으로 노출합니다. 컨슈머 프로젝트도 Tailwind v4를 쓰고 있어야 합니다.
|
|
55
55
|
|
|
56
|
+
## inkstone 테마
|
|
57
|
+
|
|
58
|
+
흑백 미니멀 테마입니다. 흰 바탕, 회색 단계, 검정(먹) 한 가지로 위계를 만들고 색은 데이터에만 씁니다.
|
|
59
|
+
|
|
60
|
+
**variant 로 쓰기** — variant prop 이 있는 컴포넌트는 `inkstone` 계열을 직접 받습니다.
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
<Button variant="inkstone">저장</Button>
|
|
64
|
+
<Button variant="inkstone-outline">취소</Button>
|
|
65
|
+
<Button variant="inkstone-ghost">필터 초기화</Button>
|
|
66
|
+
<Button variant="inkstone-danger">삭제</Button>
|
|
67
|
+
|
|
68
|
+
<Sidebar variant="inkstone" menuSections={menuSections} />
|
|
69
|
+
<MultiTab variant="inkstone" tabs={tabs} activeTabId={activeTabId} onTabClick={onTabClick} onTabClose={onTabClose} />
|
|
70
|
+
<ModalIconHeader variant="inkstone" type="edit" title="프로젝트 수정" onClose={onClose} />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**범위로 쓰기** — variant prop 이 없는 나머지 컴포넌트(Input, Select, Tab, Table, Checkbox, Modal 등)는
|
|
74
|
+
조상 요소에 `data-fz-theme="inkstone"` 을 주면 그 안에서 inkstone 톤으로 바뀝니다. Select · Popover ·
|
|
75
|
+
Modal · Tooltip 처럼 body 로 포털되는 요소까지 적용하려면 `<html>` 에 둡니다.
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<html data-fz-theme="inkstone">
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
색은 `styles/inkstone.css` 의 `--fz-ink-*` 변수에서 읽습니다. 어두운 화면에서는 앱이 이 변수를 덮어쓰면 됩니다.
|
|
82
|
+
|
|
56
83
|
## 사용 예시
|
|
57
84
|
|
|
58
85
|
```tsx
|
package/dist/index.cjs
CHANGED
|
@@ -96,7 +96,12 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
96
96
|
accent: "btn-grad text-white rounded-full",
|
|
97
97
|
metal: "btn-metal text-white min-w-22",
|
|
98
98
|
ghost: "p-1 h-auto rounded-sm bg-transparent text-sub-darkgray transition-colors hover:bg-gray-100",
|
|
99
|
-
link: "bg-transparent border-none text-main-blue underline-offset-4 hover:underline h-auto p-0"
|
|
99
|
+
link: "bg-transparent border-none text-main-blue underline-offset-4 hover:underline h-auto p-0",
|
|
100
|
+
// inkstone: 흑백 미니멀. 색은 --fz-ink-* 변수(styles/inkstone.css)에서 읽는다.
|
|
101
|
+
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)]",
|
|
102
|
+
"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)]",
|
|
103
|
+
"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)]",
|
|
104
|
+
"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))]"
|
|
100
105
|
},
|
|
101
106
|
size: {
|
|
102
107
|
default: "h-8 px-4 font-semibold",
|
|
@@ -3818,6 +3823,15 @@ var VARIANT_CONFIG = {
|
|
|
3818
3823
|
titleColor: "text-slate-100",
|
|
3819
3824
|
descColor: "text-slate-400",
|
|
3820
3825
|
closeBtn: "text-slate-500 group-hover:text-slate-300"
|
|
3826
|
+
},
|
|
3827
|
+
// inkstone: 흰 바탕에 아래 테두리만. 아이콘은 회색 네모 칸 안의 먹색.
|
|
3828
|
+
inkstone: {
|
|
3829
|
+
container: "bg-[var(--fz-ink-surface)] border-[var(--fz-ink-line)]",
|
|
3830
|
+
iconBg: "bg-[var(--fz-ink-soft)] rounded-[2px]",
|
|
3831
|
+
iconColor: "text-[var(--fz-ink-text)]",
|
|
3832
|
+
titleColor: "text-[var(--fz-ink-text)]",
|
|
3833
|
+
descColor: "text-[var(--fz-ink-text-tertiary)]",
|
|
3834
|
+
closeBtn: "text-[var(--fz-ink-text-tertiary)] group-hover:text-[var(--fz-ink-text)]"
|
|
3821
3835
|
}
|
|
3822
3836
|
};
|
|
3823
3837
|
var SIZE_CONFIG = {
|
|
@@ -5057,7 +5071,8 @@ function Table(props) {
|
|
|
5057
5071
|
tooltipConfig = "overflow",
|
|
5058
5072
|
isDynamicHeight = true,
|
|
5059
5073
|
showHorizontalDivider = true,
|
|
5060
|
-
showVerticalDivider = true
|
|
5074
|
+
showVerticalDivider = true,
|
|
5075
|
+
variant = "default"
|
|
5061
5076
|
} = props;
|
|
5062
5077
|
const {
|
|
5063
5078
|
fixed = false,
|
|
@@ -5537,82 +5552,89 @@ function Table(props) {
|
|
|
5537
5552
|
const rest = baseRows.filter((row) => !effectiveRowOrder.includes(String(getRowKey(row.original, row.index))));
|
|
5538
5553
|
return [...ordered, ...rest];
|
|
5539
5554
|
}, [baseRows, effectiveRowOrder, getRowKey]);
|
|
5540
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5549
|
-
"table",
|
|
5555
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5556
|
+
"div",
|
|
5557
|
+
{
|
|
5558
|
+
className: "bg-white rounded shadow-table border border-gray-200 overflow-hidden",
|
|
5559
|
+
"data-fz-table-variant": variant,
|
|
5560
|
+
children: [
|
|
5561
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5562
|
+
"div",
|
|
5550
5563
|
{
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5564
|
+
id: "table-layout",
|
|
5565
|
+
ref: scrollRef,
|
|
5566
|
+
className: "relative w-full overflow-y-auto overflow-x-auto custom-view-scrollbar bg-white",
|
|
5567
|
+
style: { height: `${tableHeight}px` },
|
|
5568
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5569
|
+
"table",
|
|
5570
|
+
{
|
|
5571
|
+
className: `table-fixed border-spacing-0${tableMinWidth === void 0 ? " w-full" : ""}`,
|
|
5572
|
+
style: tableMinWidth !== void 0 ? { width: tableMinWidth, minWidth: tableMinWidth } : {
|
|
5573
|
+
minWidth: orderedColumns.reduce(
|
|
5574
|
+
(sum, col) => sum + (col.key === "__checkbox__" || col.width !== void 0 ? parseColPx(col) : 80),
|
|
5575
|
+
0
|
|
5576
|
+
)
|
|
5577
|
+
},
|
|
5578
|
+
children: [
|
|
5579
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5580
|
+
TableHeader,
|
|
5581
|
+
{
|
|
5582
|
+
columns: orderedColumns,
|
|
5583
|
+
getAlignStyle,
|
|
5584
|
+
sortOption,
|
|
5585
|
+
onSortChange,
|
|
5586
|
+
onColumnDragStartCapture: handleColumnDragStartCapture,
|
|
5587
|
+
onColumnDragStart: handleColumnDragStart,
|
|
5588
|
+
onColumnDrop: handleColumnDrop,
|
|
5589
|
+
onColumnDragEnd: handleColumnDragEnd,
|
|
5590
|
+
onColumnDragOver: handleColumnDragOver,
|
|
5591
|
+
isColumnDraggable
|
|
5592
|
+
}
|
|
5593
|
+
),
|
|
5594
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "w-full h-full", children: showSkeleton ? Array.from({ length: 3 }).map((_, rowIdx) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "hover:bg-gray-50", children: [
|
|
5595
|
+
leadingPinnedCols.map((col, idx) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonTd, { col, showSquare: idx === 0 && !!checkboxInfo }, `leading-${idx}`)),
|
|
5596
|
+
leftColspan > 0 && /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: leftColspan, style: { padding: 0, border: "none" } }),
|
|
5597
|
+
virtualItems.map((vc) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonTd, { col: groupCols[vc.index] }, `group-${vc.index}`)),
|
|
5598
|
+
rightColspan > 0 && /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: rightColspan, style: { padding: 0, border: "none" } }),
|
|
5599
|
+
trailingPinnedCols.map((col, idx) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonTd, { col }, `trailing-${idx}`))
|
|
5600
|
+
] }, rowIdx)) : showEmpty ? /* @__PURE__ */ jsxRuntime.jsx(TableEmpty, { columnCount: allColumns.length }) : rows.map((row) => {
|
|
5601
|
+
const rowId = String(getRowKey(row.original, row.index));
|
|
5602
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5603
|
+
TableDataRow,
|
|
5604
|
+
{
|
|
5605
|
+
record: row.original,
|
|
5606
|
+
rowIdx: row.index,
|
|
5607
|
+
rowId,
|
|
5608
|
+
draggable: rowDraggable && !showSkeleton,
|
|
5609
|
+
onDragStart: handleRowDragStart,
|
|
5610
|
+
onDragOver: handleRowDragOver,
|
|
5611
|
+
onDrop: handleRowDrop,
|
|
5612
|
+
onDragEnd: handleRowDragEnd,
|
|
5613
|
+
leftColspan,
|
|
5614
|
+
rightColspan,
|
|
5615
|
+
renderLeadingPinnedCols,
|
|
5616
|
+
renderVisibleGroupCols,
|
|
5617
|
+
renderTrailingPinnedCols
|
|
5618
|
+
},
|
|
5619
|
+
row.id
|
|
5620
|
+
);
|
|
5621
|
+
}) })
|
|
5622
|
+
]
|
|
5623
|
+
}
|
|
5624
|
+
)
|
|
5603
5625
|
}
|
|
5604
|
-
)
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5626
|
+
),
|
|
5627
|
+
!showSkeleton && (paginationInfo || renderFooter?.renderLeft || renderFooter?.renderRight) && /* @__PURE__ */ jsxRuntime.jsx("div", { ref: footerRef, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5628
|
+
TableFooter,
|
|
5629
|
+
{
|
|
5630
|
+
paginationInfo,
|
|
5631
|
+
renderLeft: renderFooter?.renderLeft,
|
|
5632
|
+
renderRight: renderFooter?.renderRight
|
|
5633
|
+
}
|
|
5634
|
+
) })
|
|
5635
|
+
]
|
|
5636
|
+
}
|
|
5637
|
+
);
|
|
5616
5638
|
}
|
|
5617
5639
|
var CarouselContext = React6__namespace.createContext(null);
|
|
5618
5640
|
function useCarousel() {
|
|
@@ -8352,6 +8374,26 @@ var VARIANT_STYLES = {
|
|
|
8352
8374
|
tabTextSize: "text-sm",
|
|
8353
8375
|
scrollPadding: "px-4 pt-2",
|
|
8354
8376
|
rounded: "rounded-t-none"
|
|
8377
|
+
},
|
|
8378
|
+
// inkstone: 흑백 미니멀. 선택된 탭만 먹(검정) 바탕에 흰 글자, 나머지는 흰 바탕 + 회색 테두리.
|
|
8379
|
+
inkstone: {
|
|
8380
|
+
container: "bg-[var(--fz-ink-canvas)]",
|
|
8381
|
+
activeTab: "bg-[var(--fz-ink)] border-[var(--fz-ink)] text-[var(--fz-ink-contrast)]",
|
|
8382
|
+
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)]",
|
|
8383
|
+
activeText: "font-bold text-[var(--fz-ink-contrast)]",
|
|
8384
|
+
inactiveText: "font-medium",
|
|
8385
|
+
indicator: "bg-transparent",
|
|
8386
|
+
closeBtn: "ml-auto rounded-[2px] opacity-60 hover:opacity-100 hover:bg-[color-mix(in_srgb,currentColor_18%,transparent)]",
|
|
8387
|
+
closeBtnWH: "w-4 h-4",
|
|
8388
|
+
closeBtnSize: 12,
|
|
8389
|
+
plusBtnArea: "bg-[var(--fz-ink-canvas)]",
|
|
8390
|
+
plusBtn: "text-[var(--fz-ink-text-tertiary)] hover:text-[var(--fz-ink-text)] hover:bg-[var(--fz-ink-soft)]",
|
|
8391
|
+
fadeOpacity: 0.12,
|
|
8392
|
+
tabHeight: "h-[30px]",
|
|
8393
|
+
tabPx: "px-3",
|
|
8394
|
+
tabTextSize: "text-xs",
|
|
8395
|
+
scrollPadding: "px-2 pt-2",
|
|
8396
|
+
rounded: "rounded-t-[2px]"
|
|
8355
8397
|
}
|
|
8356
8398
|
};
|
|
8357
8399
|
var PLUS_BTN_WIDTH = 36;
|
|
@@ -9944,6 +9986,34 @@ var VARIANT_STYLES2 = {
|
|
|
9944
9986
|
paddingLeft: "10px"
|
|
9945
9987
|
},
|
|
9946
9988
|
footerBorder: "border-t border-gray-200"
|
|
9989
|
+
},
|
|
9990
|
+
// inkstone: 흑백 미니멀. 현재 메뉴는 회색 바탕 + 굵은 글자로만 표시하고 색 띠를 두지 않는다.
|
|
9991
|
+
inkstone: {
|
|
9992
|
+
aside: "bg-[var(--fz-ink-canvas)]",
|
|
9993
|
+
sectionTitle: "text-[11px] font-medium text-[var(--fz-ink-text-tertiary)] mb-1 px-2",
|
|
9994
|
+
itemActive: "font-bold",
|
|
9995
|
+
itemInactive: "text-[var(--fz-ink-text)] hover:bg-[var(--fz-ink-soft)]",
|
|
9996
|
+
subItemActive: "text-[var(--fz-ink-text)] font-bold",
|
|
9997
|
+
subItemInactive: "text-[var(--fz-ink-text-secondary)] hover:bg-[var(--fz-ink-soft)] hover:text-[var(--fz-ink-text)]",
|
|
9998
|
+
childGroupBorder: "border-[var(--fz-ink-line)]",
|
|
9999
|
+
childActive: "font-bold",
|
|
10000
|
+
childInactive: "text-[var(--fz-ink-text-secondary)] hover:bg-[var(--fz-ink-soft)] hover:text-[var(--fz-ink-text)]",
|
|
10001
|
+
grandchildActive: "text-[var(--fz-ink-text)] font-bold",
|
|
10002
|
+
grandchildInactive: "text-[var(--fz-ink-text-tertiary)] hover:bg-[var(--fz-ink-soft)] hover:text-[var(--fz-ink-text)]",
|
|
10003
|
+
collapseBtn: "bg-transparent hover:bg-[var(--fz-ink-soft)]",
|
|
10004
|
+
collapseIcon: "#525252",
|
|
10005
|
+
rounded: "rounded-[2px]",
|
|
10006
|
+
itemPy: "py-2",
|
|
10007
|
+
childPy: "py-1.5",
|
|
10008
|
+
grandchildPy: "py-1",
|
|
10009
|
+
itemFont: "font-medium",
|
|
10010
|
+
itemTextSize: "text-[13px]",
|
|
10011
|
+
grandchildTextSize: "text-xs",
|
|
10012
|
+
iconClass: "w-4 h-4 flex-shrink-0",
|
|
10013
|
+
activeItemStyle: { color: "var(--fz-ink-text)", backgroundColor: "var(--fz-ink-soft)" },
|
|
10014
|
+
activeChildStyle: { color: "var(--fz-ink-text)", backgroundColor: "var(--fz-ink-soft)" },
|
|
10015
|
+
activeGrandchildStyle: { color: "var(--fz-ink-text)", backgroundColor: "var(--fz-ink-soft)" },
|
|
10016
|
+
footerBorder: "border-t border-[var(--fz-ink-line)]"
|
|
9947
10017
|
}
|
|
9948
10018
|
};
|
|
9949
10019
|
function tintedStyle(color) {
|
|
@@ -10012,6 +10082,13 @@ var ACCENT_APPLIERS = {
|
|
|
10012
10082
|
borderLeft: `2px solid ${c}`,
|
|
10013
10083
|
paddingLeft: "10px"
|
|
10014
10084
|
})
|
|
10085
|
+
},
|
|
10086
|
+
// inkstone keeps its flat grey highlight; a primaryColor only tints it, with no side bar.
|
|
10087
|
+
inkstone: {
|
|
10088
|
+
itemActive: tintedStyle,
|
|
10089
|
+
subItemActive: textStyle,
|
|
10090
|
+
childActive: tintedStyle,
|
|
10091
|
+
grandchildActive: textStyle
|
|
10015
10092
|
}
|
|
10016
10093
|
};
|
|
10017
10094
|
function Sidebar(props) {
|
|
@@ -10025,6 +10102,7 @@ function Sidebar(props) {
|
|
|
10025
10102
|
showCollapseButton = false,
|
|
10026
10103
|
collapseButtonPlacement = "right",
|
|
10027
10104
|
variant = "light",
|
|
10105
|
+
width,
|
|
10028
10106
|
primaryColor
|
|
10029
10107
|
} = props;
|
|
10030
10108
|
const { pathname } = reactRouter.useLocation();
|
|
@@ -10102,12 +10180,13 @@ function Sidebar(props) {
|
|
|
10102
10180
|
"aside",
|
|
10103
10181
|
{
|
|
10104
10182
|
className: `
|
|
10105
|
-
${isCollapsed ? "w-11 min-w-11" : "min-w-60 w-62"}
|
|
10183
|
+
${isCollapsed ? "w-11 min-w-11" : width === void 0 ? "min-w-60 w-62" : ""}
|
|
10106
10184
|
transition-[width,min-width] duration-300 ease-in-out
|
|
10107
10185
|
relative h-screen shrink-0 overflow-x-hidden flex flex-col
|
|
10108
10186
|
${s.aside}
|
|
10109
10187
|
${className ?? ""}
|
|
10110
10188
|
`,
|
|
10189
|
+
style: !isCollapsed && width !== void 0 ? { width, minWidth: width } : void 0,
|
|
10111
10190
|
children: [
|
|
10112
10191
|
showCollapseButton && !isHeaderRenderProp && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10113
10192
|
"button",
|
|
@@ -10121,147 +10200,154 @@ function Sidebar(props) {
|
|
|
10121
10200
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-1 min-h-0 hide-scrollbar ${overflowVisible ? "overflow-y-auto" : "overflow-hidden"}`, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10122
10201
|
"div",
|
|
10123
10202
|
{
|
|
10124
|
-
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"}`,
|
|
10203
|
+
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"}`,
|
|
10125
10204
|
style: { transitionDelay: isCollapsed ? "0ms" : "150ms" },
|
|
10126
10205
|
children: [
|
|
10127
10206
|
!isHeaderRenderProp && headerContent,
|
|
10128
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
|
|
10207
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10208
|
+
"nav",
|
|
10209
|
+
{
|
|
10210
|
+
className: `${variant === "inkstone" ? "space-y-4 px-2" : "space-y-6"} ${variant === "system-dark" || variant === "system-light" ? "px-1" : ""}`,
|
|
10211
|
+
children: menuSections.map((section, sectionIndex) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10212
|
+
section.title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.sectionTitle, children: section.title }),
|
|
10213
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: section.items.map((item) => {
|
|
10214
|
+
const isActive = !item.children && pathname === item.path;
|
|
10215
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10216
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10217
|
+
"button",
|
|
10218
|
+
{
|
|
10219
|
+
onClick: () => {
|
|
10220
|
+
if (item.children) {
|
|
10221
|
+
toggleExpand(item.label);
|
|
10222
|
+
} else if (item.path) {
|
|
10223
|
+
handleItemClick(item.path);
|
|
10224
|
+
}
|
|
10225
|
+
},
|
|
10226
|
+
className: `
|
|
10144
10227
|
w-full text-left flex items-center gap-2 px-3 ${s.itemPy} ${s.rounded} ${s.itemTextSize} ${s.itemFont} transition-colors cursor-pointer
|
|
10145
10228
|
${isActive ? s.itemActive : s.itemInactive}
|
|
10146
10229
|
`,
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
className: "w-4 h-4 flex-shrink-0 opacity-50",
|
|
10168
|
-
fill: "none",
|
|
10169
|
-
stroke: "currentColor",
|
|
10170
|
-
viewBox: "0 0 24 24",
|
|
10171
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10172
|
-
"path",
|
|
10230
|
+
style: {
|
|
10231
|
+
...isActive ? s.activeItemStyle : {},
|
|
10232
|
+
...isActive && primaryColor ? applier.itemActive(primaryColor) : {}
|
|
10233
|
+
},
|
|
10234
|
+
children: [
|
|
10235
|
+
/* @__PURE__ */ jsxRuntime.jsx(item.icon, { className: s.iconClass }),
|
|
10236
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `flex-1 ${variant === "inkstone" ? "min-w-0 truncate text-left" : ""}`, children: item.label }),
|
|
10237
|
+
item.badge !== void 0 && item.badge !== null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs font-medium opacity-60", children: item.badge }),
|
|
10238
|
+
item.children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10239
|
+
"svg",
|
|
10240
|
+
{
|
|
10241
|
+
className: `w-4 h-4 transition-transform ${expandedItems.has(item.label) ? "rotate-90" : ""}`,
|
|
10242
|
+
fill: "none",
|
|
10243
|
+
stroke: "currentColor",
|
|
10244
|
+
viewBox: "0 0 24 24",
|
|
10245
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
|
|
10246
|
+
}
|
|
10247
|
+
),
|
|
10248
|
+
item.path?.includes("https") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10249
|
+
"svg",
|
|
10173
10250
|
{
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10251
|
+
className: "w-4 h-4 flex-shrink-0 opacity-50",
|
|
10252
|
+
fill: "none",
|
|
10253
|
+
stroke: "currentColor",
|
|
10254
|
+
viewBox: "0 0 24 24",
|
|
10255
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10256
|
+
"path",
|
|
10257
|
+
{
|
|
10258
|
+
strokeLinecap: "round",
|
|
10259
|
+
strokeLinejoin: "round",
|
|
10260
|
+
strokeWidth: 2,
|
|
10261
|
+
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
10262
|
+
}
|
|
10263
|
+
)
|
|
10178
10264
|
}
|
|
10179
10265
|
)
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
onClick: () => toggleSubExpand(subKey),
|
|
10195
|
-
className: `
|
|
10266
|
+
]
|
|
10267
|
+
}
|
|
10268
|
+
),
|
|
10269
|
+
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) => {
|
|
10270
|
+
if (child.children && child.children.length > 0) {
|
|
10271
|
+
const subKey = `${item.label}::${child.label}`;
|
|
10272
|
+
const isSubExpanded = expandedSubItems.has(subKey);
|
|
10273
|
+
const isSubActive = child.children.some((gc) => gc.path === pathname);
|
|
10274
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10275
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10276
|
+
"button",
|
|
10277
|
+
{
|
|
10278
|
+
onClick: () => toggleSubExpand(subKey),
|
|
10279
|
+
className: `
|
|
10196
10280
|
w-full text-left flex items-center justify-between pl-4 pr-3 ${s.childPy} ${s.rounded} ${s.itemTextSize} transition-colors cursor-pointer
|
|
10197
10281
|
${isSubActive ? s.subItemActive : s.subItemInactive}
|
|
10198
10282
|
`,
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
{
|
|
10205
|
-
className: `w-3 h-3 transition-transform ${isSubExpanded ? "rotate-90" : ""}`,
|
|
10206
|
-
fill: "none",
|
|
10207
|
-
stroke: "currentColor",
|
|
10208
|
-
viewBox: "0 0 24 24",
|
|
10209
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10210
|
-
"path",
|
|
10283
|
+
style: isSubActive && primaryColor ? applier.subItemActive(primaryColor) : void 0,
|
|
10284
|
+
children: [
|
|
10285
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: child.label }),
|
|
10286
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10287
|
+
"svg",
|
|
10211
10288
|
{
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10289
|
+
className: `w-3 h-3 transition-transform ${isSubExpanded ? "rotate-90" : ""}`,
|
|
10290
|
+
fill: "none",
|
|
10291
|
+
stroke: "currentColor",
|
|
10292
|
+
viewBox: "0 0 24 24",
|
|
10293
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10294
|
+
"path",
|
|
10295
|
+
{
|
|
10296
|
+
strokeLinecap: "round",
|
|
10297
|
+
strokeLinejoin: "round",
|
|
10298
|
+
strokeWidth: 2,
|
|
10299
|
+
d: "M9 5l7 7-7 7"
|
|
10300
|
+
}
|
|
10301
|
+
)
|
|
10216
10302
|
}
|
|
10217
10303
|
)
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
onClick: () => handleItemClick(grandchild.path),
|
|
10229
|
-
className: `
|
|
10304
|
+
]
|
|
10305
|
+
}
|
|
10306
|
+
),
|
|
10307
|
+
isSubExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-3 mt-0.5 space-y-0.5 pl-2", children: child.children.map((grandchild) => {
|
|
10308
|
+
const isGrandchildActive = pathname === grandchild.path;
|
|
10309
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10310
|
+
"button",
|
|
10311
|
+
{
|
|
10312
|
+
onClick: () => handleItemClick(grandchild.path),
|
|
10313
|
+
className: `
|
|
10230
10314
|
w-full text-left px-3 ${s.grandchildPy} ${s.rounded} ${s.grandchildTextSize} transition-colors cursor-pointer
|
|
10231
10315
|
${isGrandchildActive ? s.grandchildActive : s.grandchildInactive}
|
|
10232
10316
|
`,
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10317
|
+
style: {
|
|
10318
|
+
...isGrandchildActive ? s.activeGrandchildStyle : {},
|
|
10319
|
+
...isGrandchildActive && primaryColor ? applier.grandchildActive(primaryColor) : {}
|
|
10320
|
+
},
|
|
10321
|
+
children: grandchild.label
|
|
10322
|
+
},
|
|
10323
|
+
grandchild.path
|
|
10324
|
+
);
|
|
10325
|
+
}) })
|
|
10326
|
+
] }, child.label);
|
|
10327
|
+
}
|
|
10328
|
+
const isChildActive = pathname === child.path;
|
|
10329
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10330
|
+
"button",
|
|
10331
|
+
{
|
|
10332
|
+
onClick: () => handleItemClick(child.path ?? ""),
|
|
10333
|
+
className: `
|
|
10250
10334
|
w-full text-left pl-4 pr-3 ${s.childPy} ${s.rounded} ${s.itemTextSize} transition-colors cursor-pointer
|
|
10251
10335
|
${isChildActive ? s.childActive : s.childInactive}
|
|
10252
10336
|
`,
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10337
|
+
style: {
|
|
10338
|
+
...isChildActive ? s.activeChildStyle : {},
|
|
10339
|
+
...isChildActive && primaryColor ? applier.childActive(primaryColor) : {}
|
|
10340
|
+
},
|
|
10341
|
+
children: child.label
|
|
10342
|
+
},
|
|
10343
|
+
childIndex
|
|
10344
|
+
);
|
|
10345
|
+
}) })
|
|
10346
|
+
] }, item.label);
|
|
10261
10347
|
}) })
|
|
10262
|
-
] },
|
|
10263
|
-
}
|
|
10264
|
-
|
|
10348
|
+
] }, section.title ?? sectionIndex))
|
|
10349
|
+
}
|
|
10350
|
+
)
|
|
10265
10351
|
]
|
|
10266
10352
|
}
|
|
10267
10353
|
) }),
|
|
@@ -11254,7 +11340,7 @@ function RichEditorToolbar(props) {
|
|
|
11254
11340
|
"div",
|
|
11255
11341
|
{
|
|
11256
11342
|
className: cn(
|
|
11257
|
-
"flex flex-wrap items-center gap-0.5 p-2",
|
|
11343
|
+
"sticky top-0 z-10 flex flex-wrap items-center gap-0.5 p-2",
|
|
11258
11344
|
theme.toolbar.wrapper,
|
|
11259
11345
|
className
|
|
11260
11346
|
),
|
|
@@ -11886,7 +11972,7 @@ var RichEditor = React6.forwardRef(function RichEditor2({
|
|
|
11886
11972
|
const editorBox = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11887
11973
|
"div",
|
|
11888
11974
|
{
|
|
11889
|
-
className: cn("overflow-
|
|
11975
|
+
className: cn("overflow-clip rounded-lg border border-gray-200 shadow-sm flex flex-col relative", className),
|
|
11890
11976
|
"data-rich-editor-theme": theme,
|
|
11891
11977
|
style: accentStyle,
|
|
11892
11978
|
children: [
|