nish-ui 1.9.0 → 2.0.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 +218 -58
- package/dist/base-tailwind.css +1757 -0
- package/dist/base.css +1590 -1445
- package/dist/chart.d.ts +4 -1
- package/dist/chart.js +122 -49
- package/dist/elements-all.d.ts +8 -0
- package/dist/elements-all.js +178 -0
- package/dist/elements-charts.d.ts +71 -0
- package/dist/elements-charts.js +56 -57
- package/dist/elements-data.d.ts +71 -0
- package/dist/elements-data.js +5 -6
- package/dist/elements-forms.d.ts +71 -0
- package/dist/elements-forms.js +24 -25
- package/dist/elements.d.ts +71 -0
- package/dist/elements.js +4 -5
- package/dist/esm/chart-values.js +58 -0
- package/dist/esm/chart.js +10 -0
- package/dist/esm/cn.js +19 -0
- package/dist/esm/combobox-filter.js +13 -0
- package/dist/esm/components/accordion.js +166 -0
- package/dist/esm/components/app-shell.js +198 -0
- package/dist/esm/components/avatar-classes.js +28 -0
- package/dist/esm/components/avatar.js +113 -0
- package/dist/esm/components/breadcrumbs.js +154 -0
- package/dist/esm/components/canvas/follow-caption.js +32 -0
- package/dist/esm/components/canvas/follow.js +119 -0
- package/dist/esm/components/canvas/icons.js +70 -0
- package/dist/esm/components/canvas/index.js +10 -0
- package/dist/esm/components/canvas/layout.js +258 -0
- package/dist/esm/components/canvas/legend.js +93 -0
- package/dist/esm/components/canvas/minimap.js +127 -0
- package/dist/esm/components/canvas/node.js +87 -0
- package/dist/esm/components/canvas/route.js +262 -0
- package/dist/esm/components/canvas/system-canvas.js +837 -0
- package/dist/esm/components/canvas/types.js +10 -0
- package/dist/esm/components/canvas/view.js +47 -0
- package/dist/esm/components/chart-hooks.js +19 -0
- package/dist/esm/components/charts.js +467 -0
- package/dist/esm/components/client.js +24 -0
- package/dist/esm/components/combobox.js +343 -0
- package/dist/esm/components/command.js +403 -0
- package/dist/esm/components/data-classes.js +159 -0
- package/dist/esm/components/data.js +517 -0
- package/dist/esm/components/display-classes.js +130 -0
- package/dist/esm/components/display.js +755 -0
- package/dist/esm/components/error-boundary.js +64 -0
- package/dist/esm/components/feedback.js +136 -0
- package/dist/esm/components/file-dropzone.js +184 -0
- package/dist/esm/components/filters.js +108 -0
- package/dist/esm/components/flow.js +746 -0
- package/dist/esm/components/forms-classes.js +43 -0
- package/dist/esm/components/forms.js +581 -0
- package/dist/esm/components/hooks-classes.js +9 -0
- package/dist/esm/components/hooks.js +236 -0
- package/dist/esm/components/icons.js +96 -0
- package/dist/esm/components/inbox-classes.js +29 -0
- package/dist/esm/components/inbox.js +257 -0
- package/dist/esm/components/latest.js +13 -0
- package/dist/esm/components/layout-vars.js +96 -0
- package/dist/esm/components/layout.js +272 -0
- package/dist/esm/components/media.js +143 -0
- package/dist/esm/components/nav.js +614 -0
- package/dist/esm/components/overlay-classes.js +66 -0
- package/dist/esm/components/overlay.js +1461 -0
- package/dist/esm/components/pagination-classes.js +29 -0
- package/dist/esm/components/pagination.js +154 -0
- package/dist/esm/components/portal.js +16 -0
- package/dist/esm/components/primitives-classes.js +198 -0
- package/dist/esm/components/primitives.js +268 -0
- package/dist/esm/components/progress.js +77 -0
- package/dist/esm/components/provider.js +32 -0
- package/dist/esm/components/radio-group.js +186 -0
- package/dist/esm/components/resource-classes.js +133 -0
- package/dist/esm/components/resource.js +209 -0
- package/dist/esm/components/segmented.js +178 -0
- package/dist/esm/components/separator.js +38 -0
- package/dist/esm/components/service-tokens.js +221 -0
- package/dist/esm/components/settings.js +301 -0
- package/dist/esm/components/slider.js +262 -0
- package/dist/esm/components/split-classes.js +8 -0
- package/dist/esm/components/split.js +411 -0
- package/dist/esm/components/strings.js +119 -0
- package/dist/esm/components/table.js +144 -0
- package/dist/esm/components/tabs-classes.js +21 -0
- package/dist/esm/components/tabs.js +201 -0
- package/dist/esm/components/tag-input.js +257 -0
- package/dist/esm/components/theme-toggle.js +177 -0
- package/dist/esm/components/toast.js +361 -0
- package/dist/esm/components/url-state.js +118 -0
- package/dist/esm/components/visually-hidden.js +20 -0
- package/dist/esm/format.js +320 -0
- package/dist/esm/inbox-client.js +2 -0
- package/dist/esm/inbox-types.js +2 -0
- package/dist/esm/index.js +320 -0
- package/dist/esm/runtime.js +37 -0
- package/dist/esm/server/inbox/client.js +297 -0
- package/dist/esm/server/inbox/types.js +24 -0
- package/dist/esm/sparkline-path.js +59 -0
- package/dist/esm/split-layout.js +419 -0
- package/dist/esm/system-canvas.js +2 -0
- package/dist/esm/theme.js +804 -0
- package/dist/esm/tokens.mjs +425 -0
- package/dist/esm/url.js +20 -0
- package/dist/files.json +5 -1
- package/dist/fonts/LICENSE-Inter.txt +93 -0
- package/dist/format.d.ts +32 -18
- package/dist/format.js +227 -82
- package/dist/inbox-client.js +3 -1
- package/dist/index.d.ts +1686 -667
- package/dist/nish-components.css +4649 -4506
- package/dist/nish-components.min.css +1 -0
- package/dist/nish.css +1603 -1450
- package/dist/nish.min.css +1 -0
- package/dist/node/eslint.js +29 -14
- package/dist/node/th-check.js +29 -14
- package/dist/node/vite.d.ts +12 -0
- package/dist/node/vite.js +12 -2
- package/dist/server/hono.d.ts +15 -6
- package/dist/server/hono.js +30 -25
- package/dist/server/index.d.ts +3 -10
- package/dist/server/index.js +71 -38
- package/dist/{spa-DuVB5O7S.d.ts → spa-BLlMc0eI.d.ts} +38 -5
- package/dist/system-canvas-BLuWd69H.d.ts +183 -0
- package/dist/system-canvas.d.ts +2 -168
- package/dist/tailwind-core.css +114 -0
- package/dist/tailwind.css +3 -7
- package/dist/theme-init.js +23 -9
- package/dist/theme-init.sha256 +1 -0
- package/dist/theme.d.ts +243 -4
- package/dist/theme.global.js +356 -89
- package/dist/theme.js +337 -67
- package/dist/tokens.css +14 -6
- package/dist/tokens.dtcg.json +1513 -0
- package/dist/tokens.js +29 -14
- package/dist/tokens.json +512 -0
- package/package.json +51 -13
- package/dist/chart.js.map +0 -1
- package/dist/elements-charts.js.map +0 -1
- package/dist/elements-data.js.map +0 -1
- package/dist/elements-forms.js.map +0 -1
- package/dist/elements.js.map +0 -1
- package/dist/format.js.map +0 -1
- package/dist/inbox-client.js.map +0 -1
- package/dist/index.js +0 -10260
- package/dist/index.js.map +0 -1
- package/dist/server/hono.js.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/split-layout.js.map +0 -1
- package/dist/system-canvas.js +0 -2204
- package/dist/system-canvas.js.map +0 -1
- package/dist/theme.global.js.map +0 -1
- package/dist/theme.js.map +0 -1
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/split.tsx
|
|
4
|
+
import {
|
|
5
|
+
useCallback,
|
|
6
|
+
useEffect,
|
|
7
|
+
useId,
|
|
8
|
+
useRef,
|
|
9
|
+
useState
|
|
10
|
+
} from "react";
|
|
11
|
+
import { cn } from "../cn.js";
|
|
12
|
+
import { presetOptions } from "./split-classes.js";
|
|
13
|
+
import {
|
|
14
|
+
computeDividers,
|
|
15
|
+
computeRects,
|
|
16
|
+
resizeAt
|
|
17
|
+
} from "../split-layout.js";
|
|
18
|
+
import { isRtl, useIsoLayoutEffect } from "./client.js";
|
|
19
|
+
import { useMediaQuery } from "./hooks.js";
|
|
20
|
+
import { ScrollRow } from "./nav.js";
|
|
21
|
+
import { Tooltip } from "./overlay.js";
|
|
22
|
+
import { useNishStrings } from "./provider.js";
|
|
23
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
+
function nodeAt(node, path) {
|
|
25
|
+
let cur = node;
|
|
26
|
+
for (const i of path) {
|
|
27
|
+
if (!cur || cur.type !== "split") return null;
|
|
28
|
+
cur = cur.children[i] ?? null;
|
|
29
|
+
}
|
|
30
|
+
return cur;
|
|
31
|
+
}
|
|
32
|
+
function leafSlots(node) {
|
|
33
|
+
return node.type === "leaf" ? [node.slot] : node.children.flatMap(leafSlots);
|
|
34
|
+
}
|
|
35
|
+
function equalizeAt(node, path) {
|
|
36
|
+
if (node.type !== "split") return node;
|
|
37
|
+
if (path.length === 0) {
|
|
38
|
+
const n = node.children.length;
|
|
39
|
+
return { ...node, sizes: node.children.map(() => 1 / n) };
|
|
40
|
+
}
|
|
41
|
+
const [head, ...rest] = path;
|
|
42
|
+
return {
|
|
43
|
+
...node,
|
|
44
|
+
children: node.children.map((c, i) => i === head ? equalizeAt(c, rest) : c)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function SplitDividers({ layout, w, h, gap, onResize, onDragChange, minPane, barInset = 0, rtl = false, paneId }) {
|
|
48
|
+
const strings = useNishStrings();
|
|
49
|
+
const coarse = useMediaQuery("(pointer: coarse)");
|
|
50
|
+
const drag = useRef(null);
|
|
51
|
+
const hit = coarse ? 44 : 24;
|
|
52
|
+
const baseMin = minPane ?? { w: 160, h: 90 };
|
|
53
|
+
const onDragChangeRef = useRef(onDragChange);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
onDragChangeRef.current = onDragChange;
|
|
56
|
+
});
|
|
57
|
+
useEffect(
|
|
58
|
+
() => () => {
|
|
59
|
+
if (drag.current) {
|
|
60
|
+
drag.current = null;
|
|
61
|
+
onDragChangeRef.current?.(false);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
[]
|
|
65
|
+
);
|
|
66
|
+
const dividers = computeDividers(layout, w, h, gap);
|
|
67
|
+
const splitLength = (d) => {
|
|
68
|
+
const node = nodeAt(layout, d.path);
|
|
69
|
+
if (!node) return d.dir === "row" ? w : h;
|
|
70
|
+
const rects = computeRects(layout, w, h, gap);
|
|
71
|
+
const own = leafSlots(node).map((s) => rects[s]).filter((r) => !!r);
|
|
72
|
+
if (own.length === 0) return d.dir === "row" ? w : h;
|
|
73
|
+
if (d.dir === "row") return Math.max(...own.map((r) => r.x + r.w)) - Math.min(...own.map((r) => r.x));
|
|
74
|
+
return Math.max(...own.map((r) => r.y + r.h)) - Math.min(...own.map((r) => r.y));
|
|
75
|
+
};
|
|
76
|
+
const minFor = (d) => {
|
|
77
|
+
const node = nodeAt(layout, d.path);
|
|
78
|
+
const n = node && node.type === "split" ? Math.max(node.children.length, 1) : 1;
|
|
79
|
+
const len = splitLength(d);
|
|
80
|
+
const room = Math.max(0, len - gap * (n - 1));
|
|
81
|
+
const cap = room / n * 0.5;
|
|
82
|
+
return d.dir === "row" ? { w: Math.min(baseMin.w, cap), h: baseMin.h } : { w: baseMin.w, h: Math.min(baseMin.h, cap) };
|
|
83
|
+
};
|
|
84
|
+
const fraction = (d) => {
|
|
85
|
+
const node = nodeAt(layout, d.path);
|
|
86
|
+
return node && node.type === "split" ? node.sizes[d.index] ?? 0.5 : 0.5;
|
|
87
|
+
};
|
|
88
|
+
const down = (e) => {
|
|
89
|
+
if (e.button !== 0) return;
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
92
|
+
drag.current = { pointerId: e.pointerId, x: e.clientX, y: e.clientY, layout };
|
|
93
|
+
onDragChange?.(true);
|
|
94
|
+
};
|
|
95
|
+
const move = (e, d) => {
|
|
96
|
+
const start = drag.current;
|
|
97
|
+
if (!start || start.pointerId !== e.pointerId) return;
|
|
98
|
+
const delta = d.dir === "row" ? rtl ? start.x - e.clientX : e.clientX - start.x : e.clientY - start.y;
|
|
99
|
+
if (delta === 0) return;
|
|
100
|
+
onResize(resizeAt(start.layout, d.path, d.index, delta, w, h, gap, minFor(d)));
|
|
101
|
+
};
|
|
102
|
+
const up = (e) => {
|
|
103
|
+
const start = drag.current;
|
|
104
|
+
if (!start || start.pointerId !== e.pointerId) return;
|
|
105
|
+
drag.current = null;
|
|
106
|
+
if (e.currentTarget.hasPointerCapture(e.pointerId)) e.currentTarget.releasePointerCapture(e.pointerId);
|
|
107
|
+
onDragChange?.(false);
|
|
108
|
+
};
|
|
109
|
+
const reset = (d) => onResize(equalizeAt(layout, d.path));
|
|
110
|
+
const key = (e, d) => {
|
|
111
|
+
const horizontal = d.dir === "row";
|
|
112
|
+
const dec = horizontal ? rtl ? "ArrowRight" : "ArrowLeft" : "ArrowUp";
|
|
113
|
+
const inc = horizontal ? rtl ? "ArrowLeft" : "ArrowRight" : "ArrowDown";
|
|
114
|
+
if (e.key === dec || e.key === inc) {
|
|
115
|
+
e.preventDefault();
|
|
116
|
+
const step = (e.key === inc ? 1 : -1) * 0.02;
|
|
117
|
+
onResize(resizeAt(layout, d.path, d.index, step * splitLength(d), w, h, gap, minFor(d)));
|
|
118
|
+
} else if (e.key === "Home" || e.key === "End") {
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
const far = (e.key === "End" ? 1 : -1) * (w + h);
|
|
121
|
+
onResize(resizeAt(layout, d.path, d.index, far, w, h, gap, minFor(d)));
|
|
122
|
+
} else if (e.key === "Enter") {
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
reset(d);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const perDir = { row: dividers.filter((d) => d.dir === "row").length, col: dividers.filter((d) => d.dir === "col").length };
|
|
128
|
+
const seen = { row: 0, col: 0 };
|
|
129
|
+
const controls = (d) => {
|
|
130
|
+
if (!paneId) return void 0;
|
|
131
|
+
const node = nodeAt(layout, d.path);
|
|
132
|
+
if (!node || node.type !== "split") return void 0;
|
|
133
|
+
const sides = [node.children[d.index], node.children[d.index + 1]];
|
|
134
|
+
const ids = sides.flatMap((c) => c ? leafSlots(c) : []).map((slot) => paneId(slot));
|
|
135
|
+
const list = ids.filter((id) => !!id);
|
|
136
|
+
return list.length > 0 ? list.join(" ") : void 0;
|
|
137
|
+
};
|
|
138
|
+
return /* @__PURE__ */ jsx(Fragment, { children: dividers.map((d) => {
|
|
139
|
+
const vertical = d.dir === "row";
|
|
140
|
+
const pad = (hit - (vertical ? d.w : d.h)) / 2;
|
|
141
|
+
const x = rtl ? w - d.x - d.w : d.x;
|
|
142
|
+
const style = vertical ? { left: x - pad, top: d.y + barInset, width: d.w + pad * 2, height: Math.max(0, d.h - barInset) } : { left: x, top: d.y - (barInset > 0 ? pad * 2 : pad), width: d.w, height: d.h + pad * 2 };
|
|
143
|
+
const base = vertical ? strings.resizeColumns : strings.resizeRows;
|
|
144
|
+
const nth = ++seen[d.dir];
|
|
145
|
+
const pct = Math.round(fraction(d) * 100);
|
|
146
|
+
return /* @__PURE__ */ jsx(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
role: "separator",
|
|
150
|
+
"aria-orientation": vertical ? "vertical" : "horizontal",
|
|
151
|
+
"aria-label": perDir[d.dir] > 1 ? `${base} ${nth}` : base,
|
|
152
|
+
"aria-controls": controls(d),
|
|
153
|
+
"aria-valuenow": pct,
|
|
154
|
+
"aria-valuetext": `${pct}%`,
|
|
155
|
+
"aria-valuemin": 0,
|
|
156
|
+
"aria-valuemax": 100,
|
|
157
|
+
tabIndex: 0,
|
|
158
|
+
onPointerDown: down,
|
|
159
|
+
onPointerMove: (e) => move(e, d),
|
|
160
|
+
onPointerUp: up,
|
|
161
|
+
onPointerCancel: up,
|
|
162
|
+
onKeyDown: (e) => key(e, d),
|
|
163
|
+
onDoubleClick: () => reset(d),
|
|
164
|
+
style: { ...style, touchAction: "none" },
|
|
165
|
+
className: cn(
|
|
166
|
+
"group absolute z-20 flex items-center justify-center outline-none",
|
|
167
|
+
vertical ? "cursor-col-resize" : "cursor-row-resize"
|
|
168
|
+
),
|
|
169
|
+
children: /* @__PURE__ */ jsx(
|
|
170
|
+
"span",
|
|
171
|
+
{
|
|
172
|
+
className: cn(
|
|
173
|
+
"rounded-full bg-th-accent opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 group-active:opacity-100 forced-colors:bg-[Highlight]",
|
|
174
|
+
vertical ? "h-full w-1" : "h-1 w-full"
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
},
|
|
179
|
+
`${d.path.join(".")}:${d.index}`
|
|
180
|
+
);
|
|
181
|
+
}) });
|
|
182
|
+
}
|
|
183
|
+
function SplitStage({
|
|
184
|
+
layout,
|
|
185
|
+
items,
|
|
186
|
+
slots,
|
|
187
|
+
gap = 4,
|
|
188
|
+
resizable = false,
|
|
189
|
+
onLayoutChange,
|
|
190
|
+
renderPane,
|
|
191
|
+
onSize,
|
|
192
|
+
dragging = false,
|
|
193
|
+
animate = true,
|
|
194
|
+
minPane,
|
|
195
|
+
barInset,
|
|
196
|
+
children,
|
|
197
|
+
className,
|
|
198
|
+
ref: forwardedRef,
|
|
199
|
+
...rest
|
|
200
|
+
}) {
|
|
201
|
+
const ref = useRef(null);
|
|
202
|
+
const setRef = useCallback(
|
|
203
|
+
(node) => {
|
|
204
|
+
ref.current = node;
|
|
205
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
206
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
207
|
+
},
|
|
208
|
+
[forwardedRef]
|
|
209
|
+
);
|
|
210
|
+
const paneBase = useId();
|
|
211
|
+
const [size, setSize] = useState({ w: 0, h: 0 });
|
|
212
|
+
const [rtl, setRtl] = useState(false);
|
|
213
|
+
const [resizing, setResizing] = useState(false);
|
|
214
|
+
const reduced = useMediaQuery("(prefers-reduced-motion: reduce)");
|
|
215
|
+
const showDividers = resizable && !!layout && slots.length > 1;
|
|
216
|
+
if (!showDividers && resizing) setResizing(false);
|
|
217
|
+
const onSizeRef = useRef(onSize);
|
|
218
|
+
useEffect(() => {
|
|
219
|
+
onSizeRef.current = onSize;
|
|
220
|
+
});
|
|
221
|
+
useIsoLayoutEffect(() => {
|
|
222
|
+
const el = ref.current;
|
|
223
|
+
if (!el) return;
|
|
224
|
+
const measure = () => {
|
|
225
|
+
const w = Math.round(el.clientWidth);
|
|
226
|
+
const h = Math.round(el.clientHeight);
|
|
227
|
+
setSize((prev) => prev.w === w && prev.h === h ? prev : { w, h });
|
|
228
|
+
const mirrored = isRtl(el);
|
|
229
|
+
setRtl((prev) => prev === mirrored ? prev : mirrored);
|
|
230
|
+
};
|
|
231
|
+
measure();
|
|
232
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
233
|
+
const ro = new ResizeObserver(measure);
|
|
234
|
+
ro.observe(el);
|
|
235
|
+
return () => ro.disconnect();
|
|
236
|
+
}, []);
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
onSizeRef.current?.(size);
|
|
239
|
+
}, [size]);
|
|
240
|
+
const measured = size.w > 0 && size.h > 0;
|
|
241
|
+
const rects = layout && measured ? computeRects(layout, size.w, size.h, gap) : [];
|
|
242
|
+
const active = dragging || resizing;
|
|
243
|
+
const move = animate && !reduced && !active;
|
|
244
|
+
const transition = move ? "left 180ms ease-out, top 180ms ease-out, width 180ms ease-out, height 180ms ease-out" : "none";
|
|
245
|
+
return /* @__PURE__ */ jsxs("div", { ...rest, ref: setRef, className: cn("relative overflow-hidden", className), ...active ? { "data-dragging": "" } : {}, children: [
|
|
246
|
+
layout && // DOM order follows `items`, not slot order, so a swap never moves a node.
|
|
247
|
+
items.map((id) => {
|
|
248
|
+
const slot = slots.indexOf(id);
|
|
249
|
+
const rect = slot >= 0 ? rects[slot] : void 0;
|
|
250
|
+
if (!rect) return null;
|
|
251
|
+
return /* @__PURE__ */ jsx(
|
|
252
|
+
"div",
|
|
253
|
+
{
|
|
254
|
+
id: `${paneBase}-pane-${slot}`,
|
|
255
|
+
"data-split-pane": id,
|
|
256
|
+
style: {
|
|
257
|
+
position: "absolute",
|
|
258
|
+
left: rtl ? size.w - rect.x - rect.w : rect.x,
|
|
259
|
+
top: rect.y,
|
|
260
|
+
width: rect.w,
|
|
261
|
+
height: rect.h,
|
|
262
|
+
transition
|
|
263
|
+
},
|
|
264
|
+
children: renderPane(id, { rect, slot })
|
|
265
|
+
},
|
|
266
|
+
id
|
|
267
|
+
);
|
|
268
|
+
}),
|
|
269
|
+
showDividers && measured && layout && /* @__PURE__ */ jsx(
|
|
270
|
+
SplitDividers,
|
|
271
|
+
{
|
|
272
|
+
layout,
|
|
273
|
+
w: size.w,
|
|
274
|
+
h: size.h,
|
|
275
|
+
gap,
|
|
276
|
+
onResize: (next) => onLayoutChange?.(next),
|
|
277
|
+
onDragChange: setResizing,
|
|
278
|
+
rtl,
|
|
279
|
+
paneId: (slot) => slots[slot] !== void 0 && items.includes(slots[slot]) ? `${paneBase}-pane-${slot}` : void 0,
|
|
280
|
+
...minPane ? { minPane } : {},
|
|
281
|
+
...barInset ? { barInset } : {}
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
children
|
|
285
|
+
] });
|
|
286
|
+
}
|
|
287
|
+
function LayoutPresetIcon({ node, width = 56, height = 36, className, ref, ...rest }) {
|
|
288
|
+
const rects = computeRects(node, width - 4, height - 4, 2);
|
|
289
|
+
return /* @__PURE__ */ jsx(
|
|
290
|
+
"svg",
|
|
291
|
+
{
|
|
292
|
+
width,
|
|
293
|
+
height,
|
|
294
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
295
|
+
fill: "none",
|
|
296
|
+
"aria-hidden": "true",
|
|
297
|
+
focusable: "false",
|
|
298
|
+
...rest,
|
|
299
|
+
ref,
|
|
300
|
+
...className ? { className } : {},
|
|
301
|
+
children: rects.map((r, i) => /* @__PURE__ */ jsx(
|
|
302
|
+
"rect",
|
|
303
|
+
{
|
|
304
|
+
x: r.x + 2.5,
|
|
305
|
+
y: r.y + 2.5,
|
|
306
|
+
width: Math.max(r.w - 1, 1),
|
|
307
|
+
height: Math.max(r.h - 1, 1),
|
|
308
|
+
rx: 2,
|
|
309
|
+
fill: "currentColor",
|
|
310
|
+
fillOpacity: 0.14,
|
|
311
|
+
stroke: "currentColor",
|
|
312
|
+
strokeWidth: 1.5
|
|
313
|
+
},
|
|
314
|
+
i
|
|
315
|
+
))
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
function LayoutPresetPicker({
|
|
320
|
+
options,
|
|
321
|
+
value,
|
|
322
|
+
onChange,
|
|
323
|
+
actions,
|
|
324
|
+
note,
|
|
325
|
+
overlay = false,
|
|
326
|
+
className,
|
|
327
|
+
label: labelProp,
|
|
328
|
+
ref,
|
|
329
|
+
...rest
|
|
330
|
+
}) {
|
|
331
|
+
const strings = useNishStrings();
|
|
332
|
+
const label = labelProp ?? strings.layoutPresets;
|
|
333
|
+
const group = useRef(null);
|
|
334
|
+
const onKeyDown = (e) => {
|
|
335
|
+
const n = options.length;
|
|
336
|
+
if (n === 0) return;
|
|
337
|
+
let to = -1;
|
|
338
|
+
const cur = Math.max(0, options.findIndex((o) => o.id === value));
|
|
339
|
+
const rtl = isRtl(group.current);
|
|
340
|
+
const forward = rtl ? "ArrowLeft" : "ArrowRight";
|
|
341
|
+
const backward = rtl ? "ArrowRight" : "ArrowLeft";
|
|
342
|
+
if (e.key === forward || e.key === "ArrowDown") to = (cur + 1) % n;
|
|
343
|
+
else if (e.key === backward || e.key === "ArrowUp") to = (cur - 1 + n) % n;
|
|
344
|
+
else if (e.key === "Home") to = 0;
|
|
345
|
+
else if (e.key === "End") to = n - 1;
|
|
346
|
+
if (to < 0) return;
|
|
347
|
+
e.preventDefault();
|
|
348
|
+
const next = options[to];
|
|
349
|
+
if (!next) return;
|
|
350
|
+
onChange(next.id);
|
|
351
|
+
group.current?.querySelectorAll('[role="radio"]')[to]?.focus();
|
|
352
|
+
};
|
|
353
|
+
return /* @__PURE__ */ jsxs(
|
|
354
|
+
"div",
|
|
355
|
+
{
|
|
356
|
+
...rest,
|
|
357
|
+
ref,
|
|
358
|
+
className: cn(
|
|
359
|
+
"flex shrink-0 items-center gap-3 border-b border-th-line px-3 py-2",
|
|
360
|
+
overlay ? "bg-th-surface/85 shadow-lg backdrop-blur-md" : "bg-th-surface",
|
|
361
|
+
className
|
|
362
|
+
),
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx(ScrollRow, { label, children: /* @__PURE__ */ jsx(
|
|
365
|
+
"div",
|
|
366
|
+
{
|
|
367
|
+
ref: group,
|
|
368
|
+
role: "radiogroup",
|
|
369
|
+
"aria-label": label,
|
|
370
|
+
onKeyDown,
|
|
371
|
+
className: "flex items-start gap-1",
|
|
372
|
+
children: options.map((o, i) => {
|
|
373
|
+
const on = value === o.id;
|
|
374
|
+
const hasValue = options.some((x) => x.id === value);
|
|
375
|
+
return /* @__PURE__ */ jsx(Tooltip, { tip: o.hint, side: "bottom", focusable: false, children: /* @__PURE__ */ jsxs(
|
|
376
|
+
"button",
|
|
377
|
+
{
|
|
378
|
+
type: "button",
|
|
379
|
+
role: "radio",
|
|
380
|
+
"aria-checked": on,
|
|
381
|
+
tabIndex: on || !hasValue && i === 0 ? 0 : -1,
|
|
382
|
+
"aria-label": `${o.label}: ${o.hint}`,
|
|
383
|
+
"data-state": on ? "checked" : "unchecked",
|
|
384
|
+
onClick: () => onChange(o.id),
|
|
385
|
+
className: cn(
|
|
386
|
+
"flex min-h-11 shrink-0 flex-col items-center gap-0.5 rounded-lg border px-2 py-1 text-xs",
|
|
387
|
+
"focus-visible:outline-2 focus-visible:outline-th-accent",
|
|
388
|
+
on ? "border-th-accent bg-th-accent-soft text-th-hi forced-color-adjust-none forced-colors:border-[Highlight] forced-colors:bg-[Highlight] forced-colors:text-[HighlightText]" : "border-transparent text-th-hi3 hover:bg-th-elevated hover:text-th-hi2 forced-colors:border-[ButtonText]"
|
|
389
|
+
),
|
|
390
|
+
children: [
|
|
391
|
+
/* @__PURE__ */ jsx(LayoutPresetIcon, { node: o.node }),
|
|
392
|
+
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: o.label })
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
) }, o.id);
|
|
396
|
+
})
|
|
397
|
+
}
|
|
398
|
+
) }) }),
|
|
399
|
+
actions,
|
|
400
|
+
note ? /* @__PURE__ */ jsx("p", { className: "hidden shrink-0 text-xs text-th-hi3 lg:block", children: note }) : null
|
|
401
|
+
]
|
|
402
|
+
}
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
export {
|
|
406
|
+
LayoutPresetIcon,
|
|
407
|
+
LayoutPresetPicker,
|
|
408
|
+
SplitDividers,
|
|
409
|
+
SplitStage,
|
|
410
|
+
presetOptions
|
|
411
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// src/components/strings.ts
|
|
2
|
+
var DEFAULT_STRINGS = {
|
|
3
|
+
close: "Close",
|
|
4
|
+
cancel: "Cancel",
|
|
5
|
+
menu: "Menu",
|
|
6
|
+
back: "Back: ",
|
|
7
|
+
dismiss: "Dismiss",
|
|
8
|
+
moreCount: (count) => `${count} more`,
|
|
9
|
+
copy: "Copy",
|
|
10
|
+
copied: "Copied",
|
|
11
|
+
hubTitle: "Back to nish.software",
|
|
12
|
+
hubLabel: "\u2190 nish.software",
|
|
13
|
+
moreActions: "More actions",
|
|
14
|
+
more: "More",
|
|
15
|
+
legend: "Legend",
|
|
16
|
+
optional: "Optional",
|
|
17
|
+
search: "Search",
|
|
18
|
+
clearSearch: "Clear search",
|
|
19
|
+
remove: "Remove",
|
|
20
|
+
removeNamed: (name) => `Remove ${name}`,
|
|
21
|
+
noMatches: "No matches",
|
|
22
|
+
clear: "Clear",
|
|
23
|
+
searching: "Searching\u2026",
|
|
24
|
+
searchPlaceholder: "Search\u2026",
|
|
25
|
+
noResults: "No results",
|
|
26
|
+
results: "Results",
|
|
27
|
+
loading: "Loading",
|
|
28
|
+
failedToLoad: "Failed to load",
|
|
29
|
+
retry: "Retry",
|
|
30
|
+
actions: "Actions",
|
|
31
|
+
offline: "You're offline",
|
|
32
|
+
nothingHere: "Nothing here yet",
|
|
33
|
+
loadingNamed: (label) => `Loading ${label}`,
|
|
34
|
+
sortBy: "Sort by",
|
|
35
|
+
sortDefault: "Default",
|
|
36
|
+
noData: "No data",
|
|
37
|
+
noDataNamed: (label) => `${label}: no data`,
|
|
38
|
+
filters: "Filters",
|
|
39
|
+
clearFilters: "Clear filters",
|
|
40
|
+
done: "Done",
|
|
41
|
+
activeCount: (n) => `${n} active`,
|
|
42
|
+
newCount: (value) => `${value} new`,
|
|
43
|
+
sections: "Sections",
|
|
44
|
+
theme: "Theme",
|
|
45
|
+
sidebar: "Sidebar",
|
|
46
|
+
expandSidebar: "Expand sidebar",
|
|
47
|
+
collapseSidebar: "Collapse sidebar",
|
|
48
|
+
skipToContent: "Skip to content",
|
|
49
|
+
themeSystem: "System",
|
|
50
|
+
themeLight: "Light",
|
|
51
|
+
themeDark: "Dark",
|
|
52
|
+
themeToggleLabel: (current, next) => `Theme: ${current}. Switch to ${next}`,
|
|
53
|
+
themePreset: "Theme preset",
|
|
54
|
+
themePresetPlaceholder: "Preset\u2026",
|
|
55
|
+
errorStaleTitle: "A new version is available",
|
|
56
|
+
errorStaleBody: "Reload the page to get the latest version.",
|
|
57
|
+
errorTitle: "Something went wrong",
|
|
58
|
+
errorBody: "An unexpected error occurred.",
|
|
59
|
+
errorDetails: "Details",
|
|
60
|
+
errorTryAgain: "Try again",
|
|
61
|
+
errorReload: "Reload page",
|
|
62
|
+
saving: "Saving\u2026",
|
|
63
|
+
saved: "Saved",
|
|
64
|
+
saveFailed: "Could not save",
|
|
65
|
+
enterNumber: "Enter a number",
|
|
66
|
+
resizeColumns: "Resize columns",
|
|
67
|
+
resizeRows: "Resize rows",
|
|
68
|
+
layoutPresets: "Layout presets",
|
|
69
|
+
live: "Live",
|
|
70
|
+
offlineBadge: "Offline",
|
|
71
|
+
progress: "Progress",
|
|
72
|
+
workflow: "Workflow",
|
|
73
|
+
activity: "Activity",
|
|
74
|
+
other: "Other",
|
|
75
|
+
waiting: "Waiting",
|
|
76
|
+
noActivity: "No activity yet",
|
|
77
|
+
systemMap: "System map",
|
|
78
|
+
zoomOut: "Zoom out",
|
|
79
|
+
zoomIn: "Zoom in",
|
|
80
|
+
fitToScreen: "Fit to screen",
|
|
81
|
+
followActivity: "Follow activity",
|
|
82
|
+
canvasLines: "Lines",
|
|
83
|
+
serviceTokens: "Service tokens",
|
|
84
|
+
serviceTokensIntro: "Machine clients, like the nish MCP server, use these tokens to read this app. Revoking one stops it at once.",
|
|
85
|
+
loadingServiceTokens: "Loading service tokens",
|
|
86
|
+
tokenRevoke: "Revoke",
|
|
87
|
+
tokenRevoked: "Revoked",
|
|
88
|
+
tokenRevokedAt: (when) => `Revoked ${when}`,
|
|
89
|
+
tokenRevokeNamed: (name) => `Revoke ${name}`,
|
|
90
|
+
tokenRevokeTitle: (name) => `Revoke ${name}?`,
|
|
91
|
+
tokenRevokeFailed: "Could not revoke the token.",
|
|
92
|
+
inboxMarkHandled: "Mark handled",
|
|
93
|
+
inboxSnooze: "Snooze",
|
|
94
|
+
inboxActions: "Actions",
|
|
95
|
+
inboxViews: "Inbox views",
|
|
96
|
+
inboxOpen: "Open",
|
|
97
|
+
inboxSnoozed: "Snoozed",
|
|
98
|
+
inboxHandled: "Handled",
|
|
99
|
+
inboxFilterBySource: "Filter by source",
|
|
100
|
+
inboxHappened: (count) => `Happened ${count} times`,
|
|
101
|
+
previousPage: "Previous page",
|
|
102
|
+
nextPage: "Next page",
|
|
103
|
+
pageLabel: (n) => `Page ${n}`,
|
|
104
|
+
paginationLabel: "Pagination",
|
|
105
|
+
breadcrumbs: "Breadcrumbs",
|
|
106
|
+
removeTag: (tag) => `Remove ${tag}`,
|
|
107
|
+
dropzoneLabel: "Drop files here or browse",
|
|
108
|
+
browseFiles: "Browse files",
|
|
109
|
+
removeFile: (name) => `Remove ${name}`,
|
|
110
|
+
avatar: "Avatar",
|
|
111
|
+
avatarMore: (count) => `${count} more`,
|
|
112
|
+
sliderMin: "Minimum",
|
|
113
|
+
sliderMax: "Maximum",
|
|
114
|
+
accordion: "Accordion",
|
|
115
|
+
progressIndeterminate: "Loading"
|
|
116
|
+
};
|
|
117
|
+
export {
|
|
118
|
+
DEFAULT_STRINGS
|
|
119
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/table.tsx
|
|
4
|
+
import {
|
|
5
|
+
createContext,
|
|
6
|
+
useContext,
|
|
7
|
+
useEffect,
|
|
8
|
+
useMemo,
|
|
9
|
+
useRef,
|
|
10
|
+
useState
|
|
11
|
+
} from "react";
|
|
12
|
+
import { cn } from "../cn.js";
|
|
13
|
+
import { mergeRefs, tableClass, tableInternals } from "./data-classes.js";
|
|
14
|
+
import { useScrollEdges } from "./layout-vars.js";
|
|
15
|
+
import { tableClass as tableClass2 } from "./data-classes.js";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
var { ALIGN, STICKY_COL, WRAP, STICKY, TABLE, ZEBRA, TH, TD, PAD, TR, TR_INTERACTIVE } = tableInternals;
|
|
18
|
+
var ROW_TONE = tableClass.tone;
|
|
19
|
+
var TableCtx = /* @__PURE__ */ createContext({ dense: false });
|
|
20
|
+
function TableWrap({
|
|
21
|
+
minWidth,
|
|
22
|
+
maxHeight,
|
|
23
|
+
stickyHeader = false,
|
|
24
|
+
fade = true,
|
|
25
|
+
stickyFirstColumn = false,
|
|
26
|
+
label,
|
|
27
|
+
className,
|
|
28
|
+
style,
|
|
29
|
+
children,
|
|
30
|
+
ref: forwardedRef,
|
|
31
|
+
...rest
|
|
32
|
+
}) {
|
|
33
|
+
const ref = useRef(null);
|
|
34
|
+
const [overflows, setOverflows] = useState(false);
|
|
35
|
+
useScrollEdges(ref);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const el = ref.current;
|
|
38
|
+
if (!el) return;
|
|
39
|
+
const update = () => setOverflows(el.scrollWidth > el.clientWidth + 1 || el.scrollHeight > el.clientHeight + 1);
|
|
40
|
+
update();
|
|
41
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
42
|
+
const ro = new ResizeObserver(update);
|
|
43
|
+
ro.observe(el);
|
|
44
|
+
for (const c of Array.from(el.children)) ro.observe(c);
|
|
45
|
+
return () => ro.disconnect();
|
|
46
|
+
}, []);
|
|
47
|
+
const name = label ?? rest["aria-label"];
|
|
48
|
+
const css = {
|
|
49
|
+
// With a pinned first column the left fade would wash it out, so only the right edge fades.
|
|
50
|
+
...fade && stickyFirstColumn ? { "--nish-fade-start": "#000" } : null,
|
|
51
|
+
...style,
|
|
52
|
+
...maxHeight !== void 0 ? { maxHeight } : null,
|
|
53
|
+
...minWidth !== void 0 ? { "--nish-table-min": typeof minWidth === "number" ? `${minWidth}px` : minWidth } : null
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
ref: mergeRefs(ref, forwardedRef),
|
|
59
|
+
tabIndex: overflows ? 0 : void 0,
|
|
60
|
+
role: overflows && name ? "region" : void 0,
|
|
61
|
+
...rest,
|
|
62
|
+
"aria-label": name,
|
|
63
|
+
className: cn(
|
|
64
|
+
WRAP,
|
|
65
|
+
fade && "nish-scroll-fade",
|
|
66
|
+
minWidth !== void 0 && "[&>table]:min-w-[var(--nish-table-min)]",
|
|
67
|
+
stickyHeader && STICKY,
|
|
68
|
+
stickyFirstColumn && STICKY_COL,
|
|
69
|
+
className
|
|
70
|
+
),
|
|
71
|
+
style: css,
|
|
72
|
+
children
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function Table({ dense = false, zebra = false, className, ...rest }) {
|
|
77
|
+
const value = useMemo(() => ({ dense }), [dense]);
|
|
78
|
+
return /* @__PURE__ */ jsx(TableCtx.Provider, { value, children: /* @__PURE__ */ jsx("table", { className: cn(TABLE, zebra && ZEBRA, className), ...rest }) });
|
|
79
|
+
}
|
|
80
|
+
var SORT_LABEL = { asc: "ascending", desc: "descending" };
|
|
81
|
+
function Th({ align, numeric = false, sort, onSort, className, children, scope = "col", ...rest }) {
|
|
82
|
+
const { dense } = useContext(TableCtx);
|
|
83
|
+
const a = align ?? (numeric ? "right" : "left");
|
|
84
|
+
const sortable = onSort !== void 0 || sort !== void 0;
|
|
85
|
+
return /* @__PURE__ */ jsx(
|
|
86
|
+
"th",
|
|
87
|
+
{
|
|
88
|
+
scope,
|
|
89
|
+
"aria-sort": sortable ? sort ? SORT_LABEL[sort] : "none" : void 0,
|
|
90
|
+
className: cn(TH, dense ? PAD.dense : PAD.normal, ALIGN[a], numeric && "tabular-nums", className),
|
|
91
|
+
...rest,
|
|
92
|
+
children: onSort ? /* @__PURE__ */ jsxs(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
type: "button",
|
|
96
|
+
onClick: onSort,
|
|
97
|
+
className: cn(
|
|
98
|
+
"-mx-1 inline-flex items-center gap-1 rounded px-1 uppercase tracking-wider transition-colors hover:text-th-hi pointer-coarse:min-h-11 focus-visible:outline-2 focus-visible:outline-th-accent",
|
|
99
|
+
sort && "text-th-hi",
|
|
100
|
+
a === "right" && "flex-row-reverse"
|
|
101
|
+
),
|
|
102
|
+
children: [
|
|
103
|
+
children,
|
|
104
|
+
/* @__PURE__ */ jsx(SortMark, { sort: sort || false })
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
) : children
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
function SortMark({ sort }) {
|
|
112
|
+
return /* @__PURE__ */ jsxs("svg", { width: 10, height: 10, viewBox: "0 0 10 10", "aria-hidden": "true", focusable: "false", className: "shrink-0", children: [
|
|
113
|
+
/* @__PURE__ */ jsx("path", { d: "M2 4 5 1l3 3", fill: "none", stroke: "currentColor", strokeWidth: 1.5, opacity: sort === "asc" ? 1 : 0.35 }),
|
|
114
|
+
/* @__PURE__ */ jsx("path", { d: "M2 6l3 3 3-3", fill: "none", stroke: "currentColor", strokeWidth: 1.5, opacity: sort === "desc" ? 1 : 0.35 })
|
|
115
|
+
] });
|
|
116
|
+
}
|
|
117
|
+
function Td({ align, numeric = false, nowrap = false, className, ...rest }) {
|
|
118
|
+
const { dense } = useContext(TableCtx);
|
|
119
|
+
const a = align ?? (numeric ? "right" : "left");
|
|
120
|
+
return /* @__PURE__ */ jsx(
|
|
121
|
+
"td",
|
|
122
|
+
{
|
|
123
|
+
className: cn(TD, dense ? PAD.dense : PAD.normal, ALIGN[a], numeric && "whitespace-nowrap tabular-nums", nowrap && "whitespace-nowrap", className),
|
|
124
|
+
...rest
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
function Tr({ tone, interactive = false, muted = false, className, ...rest }) {
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
|
+
"tr",
|
|
131
|
+
{
|
|
132
|
+
className: cn(TR, interactive && TR_INTERACTIVE, muted && "text-th-hi3", tone && ROW_TONE[tone], className),
|
|
133
|
+
...rest
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
Table,
|
|
139
|
+
TableWrap,
|
|
140
|
+
Td,
|
|
141
|
+
Th,
|
|
142
|
+
Tr,
|
|
143
|
+
tableClass2 as tableClass
|
|
144
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/components/tabs-classes.ts
|
|
2
|
+
import { cn } from "../cn.js";
|
|
3
|
+
var TAB_TEXT = { xs: "text-2xs", sm: "text-xs", md: "text-sm" };
|
|
4
|
+
var UNDERLINE_H = { xs: "h-7", sm: "h-8", md: "h-10" };
|
|
5
|
+
var PILL_SIZE = { xs: "h-6 px-2", sm: "h-7 px-2.5", md: "h-8 px-3" };
|
|
6
|
+
function tabClass(o) {
|
|
7
|
+
const { active, variant = "underline", size = "md", block = false, className } = o;
|
|
8
|
+
return cn(
|
|
9
|
+
"relative inline-flex shrink-0 flex-col items-start justify-center whitespace-nowrap font-medium transition-colors duration-150",
|
|
10
|
+
"pointer-coarse:min-h-11 pointer-coarse:min-w-11 focus-visible:-outline-offset-2 disabled:cursor-not-allowed disabled:text-th-ghost",
|
|
11
|
+
TAB_TEXT[size],
|
|
12
|
+
variant === "underline" ? cn("border-b-2 px-0.5", UNDERLINE_H[size], active ? "border-th-accent text-th-hi" : "border-transparent text-th-hi3 hover:text-th-hi") : cn("rounded-lg", PILL_SIZE[size], active ? "bg-th-elevated text-th-hi" : "text-th-hi3 hover:bg-th-elevated/60 hover:text-th-hi"),
|
|
13
|
+
// Forced colors drop backgrounds and the accent border: mark the selected tab with a system color.
|
|
14
|
+
active && "forced-colors:border-[color:Highlight] forced-colors:text-[color:Highlight] forced-colors:underline",
|
|
15
|
+
block && "min-w-0 flex-1 items-center text-center",
|
|
16
|
+
className
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
tabClass
|
|
21
|
+
};
|