@loykin/designkit 0.0.1-dev.5 → 0.0.1-dev.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/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/index.cjs +331 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +80 -37
- package/dist/index.d.ts +80 -37
- package/dist/index.js +326 -132
- package/dist/index.js.map +1 -1
- package/dist/styles.css +106 -55
- package/package.json +5 -4
package/dist/index.cjs
CHANGED
|
@@ -7,9 +7,9 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var mergeProps = require('@base-ui/react/merge-props');
|
|
8
8
|
var useRender = require('@base-ui/react/use-render');
|
|
9
9
|
var classVarianceAuthority = require('class-variance-authority');
|
|
10
|
+
var lucideReact = require('lucide-react');
|
|
10
11
|
var button = require('@base-ui/react/button');
|
|
11
12
|
var checkbox = require('@base-ui/react/checkbox');
|
|
12
|
-
var lucideReact = require('lucide-react');
|
|
13
13
|
var menu = require('@base-ui/react/menu');
|
|
14
14
|
var input = require('@base-ui/react/input');
|
|
15
15
|
var popover = require('@base-ui/react/popover');
|
|
@@ -175,6 +175,89 @@ function Badge({
|
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
+
function Breadcrumb({ className, ...props }) {
|
|
179
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(className), ...props });
|
|
180
|
+
}
|
|
181
|
+
function BreadcrumbList({ className, ...props }) {
|
|
182
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
183
|
+
"ol",
|
|
184
|
+
{
|
|
185
|
+
"data-slot": "breadcrumb-list",
|
|
186
|
+
className: cn(
|
|
187
|
+
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
|
|
188
|
+
className
|
|
189
|
+
),
|
|
190
|
+
...props
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
195
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
196
|
+
"li",
|
|
197
|
+
{
|
|
198
|
+
"data-slot": "breadcrumb-item",
|
|
199
|
+
className: cn("inline-flex items-center gap-1", className),
|
|
200
|
+
...props
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
function BreadcrumbLink({ className, render, ...props }) {
|
|
205
|
+
return useRender.useRender({
|
|
206
|
+
defaultTagName: "a",
|
|
207
|
+
props: mergeProps.mergeProps(
|
|
208
|
+
{
|
|
209
|
+
className: cn("transition-colors hover:text-foreground", className)
|
|
210
|
+
},
|
|
211
|
+
props
|
|
212
|
+
),
|
|
213
|
+
render,
|
|
214
|
+
state: {
|
|
215
|
+
slot: "breadcrumb-link"
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
220
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
221
|
+
"span",
|
|
222
|
+
{
|
|
223
|
+
"data-slot": "breadcrumb-page",
|
|
224
|
+
role: "link",
|
|
225
|
+
"aria-disabled": "true",
|
|
226
|
+
"aria-current": "page",
|
|
227
|
+
className: cn("font-normal text-foreground", className),
|
|
228
|
+
...props
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
233
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
234
|
+
"li",
|
|
235
|
+
{
|
|
236
|
+
"data-slot": "breadcrumb-separator",
|
|
237
|
+
role: "presentation",
|
|
238
|
+
"aria-hidden": "true",
|
|
239
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
240
|
+
...props,
|
|
241
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, {})
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
246
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
247
|
+
"span",
|
|
248
|
+
{
|
|
249
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
250
|
+
role: "presentation",
|
|
251
|
+
"aria-hidden": "true",
|
|
252
|
+
className: cn("flex size-5 items-center justify-center [&>svg]:size-4", className),
|
|
253
|
+
...props,
|
|
254
|
+
children: [
|
|
255
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontalIcon, {}),
|
|
256
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More" })
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
}
|
|
178
261
|
var buttonVariants = classVarianceAuthority.cva(
|
|
179
262
|
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
180
263
|
{
|
|
@@ -2020,7 +2103,13 @@ function Header({ children, className }) {
|
|
|
2020
2103
|
}
|
|
2021
2104
|
);
|
|
2022
2105
|
}
|
|
2023
|
-
function TitleBlock({
|
|
2106
|
+
function TitleBlock({
|
|
2107
|
+
title,
|
|
2108
|
+
description,
|
|
2109
|
+
breadcrumb,
|
|
2110
|
+
status,
|
|
2111
|
+
className
|
|
2112
|
+
}) {
|
|
2024
2113
|
if (!title && !description && !breadcrumb && !status) return null;
|
|
2025
2114
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "data-page-title-block", className: cn("min-w-0 flex-1", className), children: [
|
|
2026
2115
|
breadcrumb && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 text-xs text-muted-foreground", children: breadcrumb }),
|
|
@@ -2047,7 +2136,14 @@ function Actions({ children, className }) {
|
|
|
2047
2136
|
}
|
|
2048
2137
|
function Tabs2({ children, className }) {
|
|
2049
2138
|
if (!children) return null;
|
|
2050
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2139
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2140
|
+
"div",
|
|
2141
|
+
{
|
|
2142
|
+
"data-slot": "data-page-tabs",
|
|
2143
|
+
className: cn("shrink-0 border-b border-border px-6", className),
|
|
2144
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-0 overflow-x-auto", children })
|
|
2145
|
+
}
|
|
2146
|
+
);
|
|
2051
2147
|
}
|
|
2052
2148
|
function Tab({ active, count, children, onClick, disabled, className }) {
|
|
2053
2149
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2095,8 +2191,8 @@ function Group({ children, className, surface = "none" }) {
|
|
|
2095
2191
|
"data-surface": surface,
|
|
2096
2192
|
className: cn(
|
|
2097
2193
|
"min-h-0",
|
|
2098
|
-
surface === "bordered" && "overflow-hidden rounded-[var(--radius)] border bg-background",
|
|
2099
|
-
surface === "card" && "overflow-hidden rounded-[var(--radius)] border bg-card text-card-foreground shadow-sm",
|
|
2194
|
+
surface === "bordered" && "overflow-hidden rounded-[var(--radius)] border border-border bg-background",
|
|
2195
|
+
surface === "card" && "overflow-hidden rounded-[var(--radius)] border border-border bg-card text-card-foreground shadow-sm",
|
|
2100
2196
|
className
|
|
2101
2197
|
),
|
|
2102
2198
|
children
|
|
@@ -2149,7 +2245,14 @@ function GroupBody({ children, className }) {
|
|
|
2149
2245
|
}
|
|
2150
2246
|
function Footer({ children, className }) {
|
|
2151
2247
|
if (!children) return null;
|
|
2152
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2248
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2249
|
+
"footer",
|
|
2250
|
+
{
|
|
2251
|
+
"data-slot": "data-page-footer",
|
|
2252
|
+
className: cn("shrink-0 border-t border-border px-6 py-3", className),
|
|
2253
|
+
children
|
|
2254
|
+
}
|
|
2255
|
+
);
|
|
2153
2256
|
}
|
|
2154
2257
|
var DataPage = Object.assign(Root, {
|
|
2155
2258
|
Header,
|
|
@@ -2183,7 +2286,7 @@ var DashboardPanel = React2.forwardRef(
|
|
|
2183
2286
|
ref,
|
|
2184
2287
|
className: cn(
|
|
2185
2288
|
"group flex h-full flex-col overflow-hidden",
|
|
2186
|
-
transparent ? "" : "rounded-(--radius) border bg-card text-card-foreground",
|
|
2289
|
+
transparent ? "" : "rounded-(--radius) border border-border bg-card text-card-foreground",
|
|
2187
2290
|
editable && "ring-1 ring-border/60 ring-inset",
|
|
2188
2291
|
className
|
|
2189
2292
|
),
|
|
@@ -2220,7 +2323,7 @@ function DashboardBodyTemplate({
|
|
|
2220
2323
|
}) {
|
|
2221
2324
|
return /* @__PURE__ */ jsxRuntime.jsxs(DataPage, { className: cn("layout-dashboard", className), style: theme, children: [
|
|
2222
2325
|
topBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: topBar }),
|
|
2223
|
-
(title || toolbar) && /* @__PURE__ */ jsxRuntime.jsx("header", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
2326
|
+
(title || toolbar) && /* @__PURE__ */ jsxRuntime.jsx("header", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
2224
2327
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
2225
2328
|
title && /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-sm font-semibold truncate", children: title }),
|
|
2226
2329
|
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
|
|
@@ -2245,20 +2348,31 @@ function clamp(value, min, max) {
|
|
|
2245
2348
|
}
|
|
2246
2349
|
function ResizeHandle({
|
|
2247
2350
|
axis,
|
|
2351
|
+
label,
|
|
2352
|
+
min,
|
|
2353
|
+
max,
|
|
2354
|
+
value,
|
|
2248
2355
|
onPointerDown,
|
|
2356
|
+
onKeyDown,
|
|
2249
2357
|
className
|
|
2250
2358
|
}) {
|
|
2251
2359
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2252
2360
|
"div",
|
|
2253
2361
|
{
|
|
2254
2362
|
role: "separator",
|
|
2363
|
+
tabIndex: 0,
|
|
2364
|
+
"aria-label": label,
|
|
2255
2365
|
"aria-orientation": axis === "x" ? "vertical" : "horizontal",
|
|
2366
|
+
"aria-valuemin": min,
|
|
2367
|
+
"aria-valuemax": max,
|
|
2368
|
+
"aria-valuenow": value,
|
|
2256
2369
|
className: cn(
|
|
2257
|
-
"group/resize relative z-10 shrink-0 touch-none bg-transparent",
|
|
2370
|
+
"group/resize relative z-10 shrink-0 touch-none bg-transparent outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
2258
2371
|
axis === "x" ? "-mx-1 w-2 cursor-col-resize" : "-my-1 h-2 cursor-row-resize",
|
|
2259
2372
|
className
|
|
2260
2373
|
),
|
|
2261
2374
|
onPointerDown,
|
|
2375
|
+
onKeyDown,
|
|
2262
2376
|
children: [
|
|
2263
2377
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2264
2378
|
"div",
|
|
@@ -2311,6 +2425,7 @@ function WorkbenchBodyTemplate({
|
|
|
2311
2425
|
maxRightPaneWidth = 520,
|
|
2312
2426
|
minBottomPaneHeight = 120,
|
|
2313
2427
|
maxBottomPaneHeight = 420,
|
|
2428
|
+
onResize,
|
|
2314
2429
|
leftPaneClassName,
|
|
2315
2430
|
mainPaneClassName,
|
|
2316
2431
|
rightPaneClassName,
|
|
@@ -2321,6 +2436,79 @@ function WorkbenchBodyTemplate({
|
|
|
2321
2436
|
const [leftWidth, setLeftWidth] = React2.useState(leftPaneWidth);
|
|
2322
2437
|
const [rightWidth, setRightWidth] = React2.useState(rightPaneWidth);
|
|
2323
2438
|
const [bottomHeight, setBottomHeight] = React2.useState(bottomPaneHeight);
|
|
2439
|
+
React2.useEffect(() => {
|
|
2440
|
+
setLeftWidth(leftPaneWidth);
|
|
2441
|
+
}, [leftPaneWidth]);
|
|
2442
|
+
React2.useEffect(() => {
|
|
2443
|
+
setRightWidth(rightPaneWidth);
|
|
2444
|
+
}, [rightPaneWidth]);
|
|
2445
|
+
React2.useEffect(() => {
|
|
2446
|
+
setBottomHeight(bottomPaneHeight);
|
|
2447
|
+
}, [bottomPaneHeight]);
|
|
2448
|
+
const updateResizeState = React2.useCallback(
|
|
2449
|
+
(patch) => {
|
|
2450
|
+
const next = {
|
|
2451
|
+
leftPaneWidth: leftWidth,
|
|
2452
|
+
rightPaneWidth: rightWidth,
|
|
2453
|
+
bottomPaneHeight: bottomHeight,
|
|
2454
|
+
...patch
|
|
2455
|
+
};
|
|
2456
|
+
if (patch.leftPaneWidth !== void 0) setLeftWidth(patch.leftPaneWidth);
|
|
2457
|
+
if (patch.rightPaneWidth !== void 0) setRightWidth(patch.rightPaneWidth);
|
|
2458
|
+
if (patch.bottomPaneHeight !== void 0) setBottomHeight(patch.bottomPaneHeight);
|
|
2459
|
+
onResize?.(next);
|
|
2460
|
+
},
|
|
2461
|
+
[bottomHeight, leftWidth, onResize, rightWidth]
|
|
2462
|
+
);
|
|
2463
|
+
const updateLeftWidth = React2.useCallback(
|
|
2464
|
+
(next) => {
|
|
2465
|
+
updateResizeState({
|
|
2466
|
+
leftPaneWidth: clamp(next, minLeftPaneWidth, maxLeftPaneWidth)
|
|
2467
|
+
});
|
|
2468
|
+
},
|
|
2469
|
+
[maxLeftPaneWidth, minLeftPaneWidth, updateResizeState]
|
|
2470
|
+
);
|
|
2471
|
+
const updateRightWidth = React2.useCallback(
|
|
2472
|
+
(next) => {
|
|
2473
|
+
updateResizeState({
|
|
2474
|
+
rightPaneWidth: clamp(next, minRightPaneWidth, maxRightPaneWidth)
|
|
2475
|
+
});
|
|
2476
|
+
},
|
|
2477
|
+
[maxRightPaneWidth, minRightPaneWidth, updateResizeState]
|
|
2478
|
+
);
|
|
2479
|
+
const updateBottomHeight = React2.useCallback(
|
|
2480
|
+
(next) => {
|
|
2481
|
+
updateResizeState({
|
|
2482
|
+
bottomPaneHeight: clamp(next, minBottomPaneHeight, maxBottomPaneHeight)
|
|
2483
|
+
});
|
|
2484
|
+
},
|
|
2485
|
+
[maxBottomPaneHeight, minBottomPaneHeight, updateResizeState]
|
|
2486
|
+
);
|
|
2487
|
+
const handleResizeKey = React2.useCallback(
|
|
2488
|
+
(event, options) => {
|
|
2489
|
+
const step = event.shiftKey ? 48 : 12;
|
|
2490
|
+
if (options.decreaseKeys.includes(event.key)) {
|
|
2491
|
+
event.preventDefault();
|
|
2492
|
+
options.update(options.value - step);
|
|
2493
|
+
return;
|
|
2494
|
+
}
|
|
2495
|
+
if (options.increaseKeys.includes(event.key)) {
|
|
2496
|
+
event.preventDefault();
|
|
2497
|
+
options.update(options.value + step);
|
|
2498
|
+
return;
|
|
2499
|
+
}
|
|
2500
|
+
if (event.key === "Home") {
|
|
2501
|
+
event.preventDefault();
|
|
2502
|
+
options.update(options.min);
|
|
2503
|
+
return;
|
|
2504
|
+
}
|
|
2505
|
+
if (event.key === "End") {
|
|
2506
|
+
event.preventDefault();
|
|
2507
|
+
options.update(options.max);
|
|
2508
|
+
}
|
|
2509
|
+
},
|
|
2510
|
+
[]
|
|
2511
|
+
);
|
|
2324
2512
|
const startResize = React2.useCallback(
|
|
2325
2513
|
(event, axis, applyDelta) => {
|
|
2326
2514
|
if (!resizable) return;
|
|
@@ -2351,7 +2539,7 @@ function WorkbenchBodyTemplate({
|
|
|
2351
2539
|
const showBottomPane = bottomPane && !bottomPaneCollapsed;
|
|
2352
2540
|
return /* @__PURE__ */ jsxRuntime.jsxs(DataPage, { className: cn("layout-workbench", className), style: theme, children: [
|
|
2353
2541
|
topBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: topBar }),
|
|
2354
|
-
showHeader && /* @__PURE__ */ jsxRuntime.jsx("header", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-[calc(var(--designkit-page-padding-y)*0.75)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-[var(--designkit-toolbar-height)] items-center justify-between gap-3", children: [
|
|
2542
|
+
showHeader && /* @__PURE__ */ jsxRuntime.jsx("header", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-[calc(var(--designkit-page-padding-y)*0.75)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-[var(--designkit-toolbar-height)] items-center justify-between gap-3", children: [
|
|
2355
2543
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
2356
2544
|
(title || status) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2357
2545
|
title && /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "min-w-0 truncate text-sm font-semibold", children: title }),
|
|
@@ -2364,18 +2552,18 @@ function WorkbenchBodyTemplate({
|
|
|
2364
2552
|
actions
|
|
2365
2553
|
] })
|
|
2366
2554
|
] }) }),
|
|
2367
|
-
(showLeftPane || showRightPane) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1.5 border-b px-2 py-1.5 md:hidden", children: [
|
|
2555
|
+
(showLeftPane || showRightPane) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1.5 border-b border-border px-2 py-1.5 md:hidden", children: [
|
|
2368
2556
|
showLeftPane && /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
|
|
2369
2557
|
/* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { render: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "sm" }), children: leftPaneLabel }),
|
|
2370
2558
|
/* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "left", className: "flex flex-col gap-0 p-0", children: [
|
|
2371
|
-
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: leftPaneLabel }) }),
|
|
2559
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: leftPaneLabel }) }),
|
|
2372
2560
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "flex-1", children: leftPane })
|
|
2373
2561
|
] })
|
|
2374
2562
|
] }),
|
|
2375
2563
|
showRightPane && /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
|
|
2376
2564
|
/* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { render: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "sm" }), children: rightPaneLabel }),
|
|
2377
2565
|
/* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "flex flex-col gap-0 p-0", children: [
|
|
2378
|
-
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: rightPaneLabel }) }),
|
|
2566
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: rightPaneLabel }) }),
|
|
2379
2567
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "flex-1", children: rightPane })
|
|
2380
2568
|
] })
|
|
2381
2569
|
] })
|
|
@@ -2386,7 +2574,7 @@ function WorkbenchBodyTemplate({
|
|
|
2386
2574
|
"aside",
|
|
2387
2575
|
{
|
|
2388
2576
|
className: cn(
|
|
2389
|
-
"hidden min-h-0 shrink-0 overflow-hidden border-r bg-card/45 md:flex md:flex-col",
|
|
2577
|
+
"hidden min-h-0 shrink-0 overflow-hidden border-r border-border bg-card/45 md:flex md:flex-col",
|
|
2390
2578
|
leftPaneClassName
|
|
2391
2579
|
),
|
|
2392
2580
|
style: { width: leftWidth },
|
|
@@ -2397,13 +2585,25 @@ function WorkbenchBodyTemplate({
|
|
|
2397
2585
|
ResizeHandle,
|
|
2398
2586
|
{
|
|
2399
2587
|
axis: "x",
|
|
2588
|
+
label: "Resize left pane",
|
|
2589
|
+
min: minLeftPaneWidth,
|
|
2590
|
+
max: maxLeftPaneWidth,
|
|
2591
|
+
value: leftWidth,
|
|
2400
2592
|
className: "hidden md:flex",
|
|
2401
2593
|
onPointerDown: (event) => {
|
|
2402
2594
|
const start = leftWidth;
|
|
2403
2595
|
startResize(event, "x", (delta) => {
|
|
2404
|
-
|
|
2596
|
+
updateLeftWidth(start + delta);
|
|
2405
2597
|
});
|
|
2406
|
-
}
|
|
2598
|
+
},
|
|
2599
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2600
|
+
value: leftWidth,
|
|
2601
|
+
min: minLeftPaneWidth,
|
|
2602
|
+
max: maxLeftPaneWidth,
|
|
2603
|
+
decreaseKeys: ["ArrowLeft"],
|
|
2604
|
+
increaseKeys: ["ArrowRight"],
|
|
2605
|
+
update: updateLeftWidth
|
|
2606
|
+
})
|
|
2407
2607
|
}
|
|
2408
2608
|
)
|
|
2409
2609
|
] }),
|
|
@@ -2414,22 +2614,32 @@ function WorkbenchBodyTemplate({
|
|
|
2414
2614
|
ResizeHandle,
|
|
2415
2615
|
{
|
|
2416
2616
|
axis: "y",
|
|
2617
|
+
label: "Resize bottom pane",
|
|
2618
|
+
min: minBottomPaneHeight,
|
|
2619
|
+
max: maxBottomPaneHeight,
|
|
2620
|
+
value: bottomHeight,
|
|
2417
2621
|
className: "hidden md:flex",
|
|
2418
2622
|
onPointerDown: (event) => {
|
|
2419
2623
|
const start = bottomHeight;
|
|
2420
2624
|
startResize(event, "y", (delta) => {
|
|
2421
|
-
|
|
2422
|
-
clamp(start - delta, minBottomPaneHeight, maxBottomPaneHeight)
|
|
2423
|
-
);
|
|
2625
|
+
updateBottomHeight(start - delta);
|
|
2424
2626
|
});
|
|
2425
|
-
}
|
|
2627
|
+
},
|
|
2628
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2629
|
+
value: bottomHeight,
|
|
2630
|
+
min: minBottomPaneHeight,
|
|
2631
|
+
max: maxBottomPaneHeight,
|
|
2632
|
+
decreaseKeys: ["ArrowDown"],
|
|
2633
|
+
increaseKeys: ["ArrowUp"],
|
|
2634
|
+
update: updateBottomHeight
|
|
2635
|
+
})
|
|
2426
2636
|
}
|
|
2427
2637
|
),
|
|
2428
2638
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2429
2639
|
"section",
|
|
2430
2640
|
{
|
|
2431
2641
|
className: cn(
|
|
2432
|
-
"min-h-0 shrink-0 overflow-auto border-t bg-card/40 md:overflow-hidden",
|
|
2642
|
+
"min-h-0 shrink-0 overflow-auto border-t border-border bg-card/40 md:overflow-hidden",
|
|
2433
2643
|
bottomPaneClassName
|
|
2434
2644
|
),
|
|
2435
2645
|
style: { height: bottomHeight },
|
|
@@ -2443,20 +2653,32 @@ function WorkbenchBodyTemplate({
|
|
|
2443
2653
|
ResizeHandle,
|
|
2444
2654
|
{
|
|
2445
2655
|
axis: "x",
|
|
2656
|
+
label: "Resize right pane",
|
|
2657
|
+
min: minRightPaneWidth,
|
|
2658
|
+
max: maxRightPaneWidth,
|
|
2659
|
+
value: rightWidth,
|
|
2446
2660
|
className: "hidden md:flex",
|
|
2447
2661
|
onPointerDown: (event) => {
|
|
2448
2662
|
const start = rightWidth;
|
|
2449
2663
|
startResize(event, "x", (delta) => {
|
|
2450
|
-
|
|
2664
|
+
updateRightWidth(start - delta);
|
|
2451
2665
|
});
|
|
2452
|
-
}
|
|
2666
|
+
},
|
|
2667
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2668
|
+
value: rightWidth,
|
|
2669
|
+
min: minRightPaneWidth,
|
|
2670
|
+
max: maxRightPaneWidth,
|
|
2671
|
+
decreaseKeys: ["ArrowRight"],
|
|
2672
|
+
increaseKeys: ["ArrowLeft"],
|
|
2673
|
+
update: updateRightWidth
|
|
2674
|
+
})
|
|
2453
2675
|
}
|
|
2454
2676
|
),
|
|
2455
2677
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2456
2678
|
"aside",
|
|
2457
2679
|
{
|
|
2458
2680
|
className: cn(
|
|
2459
|
-
"hidden min-h-0 shrink-0 overflow-hidden border-l bg-card/45 md:flex md:flex-col",
|
|
2681
|
+
"hidden min-h-0 shrink-0 overflow-hidden border-l border-border bg-card/45 md:flex md:flex-col",
|
|
2460
2682
|
rightPaneClassName
|
|
2461
2683
|
),
|
|
2462
2684
|
style: { width: rightWidth },
|
|
@@ -2517,9 +2739,9 @@ function GroupWrapper({
|
|
|
2517
2739
|
}
|
|
2518
2740
|
if (variant === "bordered") {
|
|
2519
2741
|
if (layout === "inline") {
|
|
2520
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden rounded-(--radius) border divide-y", children });
|
|
2742
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden rounded-(--radius) border border-border divide-y", children });
|
|
2521
2743
|
}
|
|
2522
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-(--radius) border p-(--designkit-panel-gap)", children });
|
|
2744
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-(--radius) border border-border p-(--designkit-panel-gap)", children });
|
|
2523
2745
|
}
|
|
2524
2746
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
2525
2747
|
}
|
|
@@ -2680,7 +2902,7 @@ function Root2({
|
|
|
2680
2902
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2681
2903
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Actions, { children: actions })
|
|
2682
2904
|
] }),
|
|
2683
|
-
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2905
|
+
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2684
2906
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Content, { className: contentClassName, children: /* @__PURE__ */ jsxRuntime.jsx(DataPage.Group, { className: "h-full", children: /* @__PURE__ */ jsxRuntime.jsx(DataPage.GroupBody, { className: cn("h-full", bodyEl.props.className), children: bodyEl.props.children }) }) })
|
|
2685
2907
|
] });
|
|
2686
2908
|
}
|
|
@@ -2692,7 +2914,7 @@ function Root2({
|
|
|
2692
2914
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2693
2915
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Actions, { children: actions })
|
|
2694
2916
|
] }),
|
|
2695
|
-
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2917
|
+
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2696
2918
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Content, { className: contentClassName, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-(--designkit-panel-gap) lg:grid-cols-[16rem_minmax(0,1fr)]", children: [
|
|
2697
2919
|
/* @__PURE__ */ jsxRuntime.jsx("nav", { className: "space-y-1", children: sections.map((section) => {
|
|
2698
2920
|
const active = section.props.id === activeSection?.props.id;
|
|
@@ -2726,7 +2948,7 @@ function Root2({
|
|
|
2726
2948
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2727
2949
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Actions, { children: actions })
|
|
2728
2950
|
] }),
|
|
2729
|
-
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2951
|
+
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2730
2952
|
hasTabs && /* @__PURE__ */ jsxRuntime.jsx(DataPage.Tabs, { children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2731
2953
|
DataPage.Tab,
|
|
2732
2954
|
{
|
|
@@ -2792,7 +3014,7 @@ function BrowseBodyTemplate({
|
|
|
2792
3014
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Actions, { children: actions })
|
|
2793
3015
|
] }),
|
|
2794
3016
|
/* @__PURE__ */ jsxRuntime.jsxs(DataPage.Content, { padding: "none", className: "flex flex-col overflow-hidden", children: [
|
|
2795
|
-
(toolbar || isNarrow) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b px-(--designkit-page-padding-x) py-2", children: [
|
|
3017
|
+
(toolbar || isNarrow) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-(--designkit-page-padding-x) py-2", children: [
|
|
2796
3018
|
isNarrow && /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
|
|
2797
3019
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2798
3020
|
SheetTrigger,
|
|
@@ -2805,14 +3027,21 @@ function BrowseBodyTemplate({
|
|
|
2805
3027
|
}
|
|
2806
3028
|
),
|
|
2807
3029
|
/* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "left", className: "flex flex-col gap-0 p-0", children: [
|
|
2808
|
-
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: sidebarTitle }) }),
|
|
3030
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: sidebarTitle }) }),
|
|
2809
3031
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: sidebar }) })
|
|
2810
3032
|
] })
|
|
2811
3033
|
] }),
|
|
2812
3034
|
toolbar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: toolbar })
|
|
2813
3035
|
] }),
|
|
2814
3036
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
|
|
2815
|
-
!isNarrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3037
|
+
!isNarrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3038
|
+
"aside",
|
|
3039
|
+
{
|
|
3040
|
+
className: "shrink-0 overflow-hidden border-r border-border",
|
|
3041
|
+
style: { width: sidebarWidth },
|
|
3042
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: sidebar }) })
|
|
3043
|
+
}
|
|
3044
|
+
),
|
|
2816
3045
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2817
3046
|
"div",
|
|
2818
3047
|
{
|
|
@@ -2870,8 +3099,8 @@ function DetailBodySection({
|
|
|
2870
3099
|
{
|
|
2871
3100
|
className: cn(
|
|
2872
3101
|
"min-h-0",
|
|
2873
|
-
surface === "card" && "rounded-(--radius) border bg-card p-(--designkit-panel-gap) text-card-foreground shadow-sm",
|
|
2874
|
-
surface === "bordered" && "rounded-(--radius) border p-(--designkit-panel-gap)",
|
|
3102
|
+
surface === "card" && "rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap) text-card-foreground shadow-sm",
|
|
3103
|
+
surface === "bordered" && "rounded-(--radius) border border-border p-(--designkit-panel-gap)",
|
|
2875
3104
|
className
|
|
2876
3105
|
),
|
|
2877
3106
|
children: [
|
|
@@ -2916,11 +3145,14 @@ function DetailBodyTemplateRoot({
|
|
|
2916
3145
|
const hasTabs = tabs.length > 0;
|
|
2917
3146
|
const [activeTab, setActiveTab] = React2.useState(() => tabs[0]?.props.id ?? "");
|
|
2918
3147
|
const selectedTab = tabs.find((tab) => tab.props.id === activeTab) ?? tabs[0];
|
|
2919
|
-
const summarySlot = summary ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 rounded-(--radius) border bg-card p-(--designkit-panel-gap) text-card-foreground", children: summary }) : null;
|
|
3148
|
+
const summarySlot = summary ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap) text-card-foreground", children: summary }) : null;
|
|
2920
3149
|
const mediaSlot = media ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2921
3150
|
"div",
|
|
2922
3151
|
{
|
|
2923
|
-
className: cn(
|
|
3152
|
+
className: cn(
|
|
3153
|
+
"min-h-0 overflow-hidden rounded-(--radius) border border-border bg-card",
|
|
3154
|
+
mediaClassName
|
|
3155
|
+
),
|
|
2924
3156
|
children: media
|
|
2925
3157
|
}
|
|
2926
3158
|
) : null;
|
|
@@ -2990,7 +3222,7 @@ function DetailBodyTemplateRoot({
|
|
|
2990
3222
|
"div",
|
|
2991
3223
|
{
|
|
2992
3224
|
className: cn(
|
|
2993
|
-
"min-h-0 rounded-(--radius) border bg-card p-(--designkit-panel-gap)",
|
|
3225
|
+
"min-h-0 rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap)",
|
|
2994
3226
|
asideClassName
|
|
2995
3227
|
),
|
|
2996
3228
|
children: insideAsideSlot
|
|
@@ -3033,7 +3265,7 @@ function DetailBodyTemplateRoot({
|
|
|
3033
3265
|
"aside",
|
|
3034
3266
|
{
|
|
3035
3267
|
className: cn(
|
|
3036
|
-
"min-h-0 border-t bg-background lg:border-l lg:border-t-0",
|
|
3268
|
+
"min-h-0 border-t border-border bg-background lg:border-l lg:border-t-0",
|
|
3037
3269
|
asideClassName
|
|
3038
3270
|
),
|
|
3039
3271
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3084,8 +3316,9 @@ function ListDetailBodyTemplate({
|
|
|
3084
3316
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3085
3317
|
"aside",
|
|
3086
3318
|
{
|
|
3319
|
+
"data-slot": "list-detail-list",
|
|
3087
3320
|
className: cn(
|
|
3088
|
-
"min-h-0 shrink-0 overflow-hidden border-r",
|
|
3321
|
+
"min-h-0 shrink-0 overflow-hidden border-r border-border",
|
|
3089
3322
|
detail ? "hidden lg:flex lg:w-[var(--ld-list-width)] lg:flex-col" : "flex w-full flex-col lg:w-[var(--ld-list-width)]",
|
|
3090
3323
|
listClassName
|
|
3091
3324
|
),
|
|
@@ -3101,7 +3334,7 @@ function ListDetailBodyTemplate({
|
|
|
3101
3334
|
detailClassName
|
|
3102
3335
|
),
|
|
3103
3336
|
children: [
|
|
3104
|
-
detail && onBack && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center border-b px-3 py-2 lg:hidden", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", className: "-ml-1 gap-1", onClick: onBack, children: [
|
|
3337
|
+
detail && onBack && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center border-b border-border px-3 py-2 lg:hidden", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", className: "-ml-1 gap-1", onClick: onBack, children: [
|
|
3105
3338
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" }),
|
|
3106
3339
|
backLabel
|
|
3107
3340
|
] }) }),
|
|
@@ -3154,7 +3387,7 @@ function PanelTemplateRoot({
|
|
|
3154
3387
|
] })
|
|
3155
3388
|
] }),
|
|
3156
3389
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("min-h-0 flex-1 overflow-y-auto px-4 py-4", bodyClassName), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-5", children }) }),
|
|
3157
|
-
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-t px-4 py-3", children: footer })
|
|
3390
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-t border-border px-4 py-3", children: footer })
|
|
3158
3391
|
] });
|
|
3159
3392
|
}
|
|
3160
3393
|
var PanelTemplate = Object.assign(PanelTemplateRoot, {
|
|
@@ -3294,7 +3527,7 @@ function TypographyBodyTemplate({ theme, breadcrumb }) {
|
|
|
3294
3527
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-2", children: ["API Gateway", "Billing Worker", "Notification Queue"].map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3295
3528
|
"div",
|
|
3296
3529
|
{
|
|
3297
|
-
className: "flex items-center justify-between rounded-lg border px-3 py-2",
|
|
3530
|
+
className: "flex items-center justify-between rounded-lg border border-border px-3 py-2",
|
|
3298
3531
|
children: [
|
|
3299
3532
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3300
3533
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: item }),
|
|
@@ -3343,13 +3576,13 @@ var useThemeStore = zustand.create((set) => ({
|
|
|
3343
3576
|
},
|
|
3344
3577
|
overrides: {},
|
|
3345
3578
|
activeShell: "sidebar",
|
|
3346
|
-
activeTemplate: "
|
|
3579
|
+
activeTemplate: "databody",
|
|
3347
3580
|
setGlobal: (patch) => set((s) => ({ global: { ...s.global, ...patch } })),
|
|
3348
3581
|
setOverride: (id, patch) => set((s) => ({
|
|
3349
3582
|
overrides: { ...s.overrides, [id]: { ...s.overrides[id], ...patch } }
|
|
3350
3583
|
})),
|
|
3351
|
-
setShell: (
|
|
3352
|
-
setTemplate: (
|
|
3584
|
+
setShell: () => void 0,
|
|
3585
|
+
setTemplate: () => void 0
|
|
3353
3586
|
}));
|
|
3354
3587
|
var tonalTokenDefs = [
|
|
3355
3588
|
{
|
|
@@ -3415,7 +3648,7 @@ function ColorSwatch({
|
|
|
3415
3648
|
variable,
|
|
3416
3649
|
formula
|
|
3417
3650
|
}) {
|
|
3418
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border", children: [
|
|
3651
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border border-border", children: [
|
|
3419
3652
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${bg} flex h-14 items-center justify-center`, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: `${fg} text-sm font-semibold`, children: "Aa" }) }),
|
|
3420
3653
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-card px-3 py-2 space-y-0.5", children: [
|
|
3421
3654
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium", children: name }),
|
|
@@ -3512,7 +3745,7 @@ function ColorsBodyTemplate({ theme, breadcrumb }) {
|
|
|
3512
3745
|
" \xB7 ",
|
|
3513
3746
|
"factor = 2\u20136% of primary chroma"
|
|
3514
3747
|
] }),
|
|
3515
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border divide-y text-xs font-mono", children: [
|
|
3748
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border border-border divide-y text-xs font-mono", children: [
|
|
3516
3749
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[7rem_1fr_1fr] bg-muted/50 px-3 py-1.5 text-muted-foreground", children: [
|
|
3517
3750
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "token" }),
|
|
3518
3751
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "light" }),
|
|
@@ -3524,7 +3757,7 @@ function ColorsBodyTemplate({ theme, breadcrumb }) {
|
|
|
3524
3757
|
className: "grid grid-cols-[7rem_1fr_1fr] items-center gap-x-3 px-3 py-2",
|
|
3525
3758
|
children: [
|
|
3526
3759
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3527
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${t.bg} h-5 w-5 shrink-0 rounded border` }),
|
|
3760
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${t.bg} h-5 w-5 shrink-0 rounded border border-border` }),
|
|
3528
3761
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: t.name })
|
|
3529
3762
|
] }),
|
|
3530
3763
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
|
|
@@ -3591,7 +3824,16 @@ function FormCard({
|
|
|
3591
3824
|
}) {
|
|
3592
3825
|
const widthCls = cardWidthClass[cardWidth];
|
|
3593
3826
|
if (card === "card") {
|
|
3594
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3827
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3828
|
+
"div",
|
|
3829
|
+
{
|
|
3830
|
+
className: cn(
|
|
3831
|
+
"w-full rounded-2xl border border-border bg-card px-8 py-10 shadow-lg",
|
|
3832
|
+
widthCls
|
|
3833
|
+
),
|
|
3834
|
+
children
|
|
3835
|
+
}
|
|
3836
|
+
);
|
|
3595
3837
|
}
|
|
3596
3838
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", widthCls), children });
|
|
3597
3839
|
}
|
|
@@ -3634,73 +3876,6 @@ function LoginBodyTemplate({
|
|
|
3634
3876
|
}
|
|
3635
3877
|
);
|
|
3636
3878
|
}
|
|
3637
|
-
function Breadcrumb({ className, ...props }) {
|
|
3638
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(className), ...props });
|
|
3639
|
-
}
|
|
3640
|
-
function BreadcrumbList({ className, ...props }) {
|
|
3641
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3642
|
-
"ol",
|
|
3643
|
-
{
|
|
3644
|
-
"data-slot": "breadcrumb-list",
|
|
3645
|
-
className: cn(
|
|
3646
|
-
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
|
|
3647
|
-
className
|
|
3648
|
-
),
|
|
3649
|
-
...props
|
|
3650
|
-
}
|
|
3651
|
-
);
|
|
3652
|
-
}
|
|
3653
|
-
function BreadcrumbItem({ className, ...props }) {
|
|
3654
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3655
|
-
"li",
|
|
3656
|
-
{
|
|
3657
|
-
"data-slot": "breadcrumb-item",
|
|
3658
|
-
className: cn("inline-flex items-center gap-1", className),
|
|
3659
|
-
...props
|
|
3660
|
-
}
|
|
3661
|
-
);
|
|
3662
|
-
}
|
|
3663
|
-
function BreadcrumbLink({ className, render, ...props }) {
|
|
3664
|
-
return useRender.useRender({
|
|
3665
|
-
defaultTagName: "a",
|
|
3666
|
-
props: mergeProps.mergeProps(
|
|
3667
|
-
{
|
|
3668
|
-
className: cn("transition-colors hover:text-foreground", className)
|
|
3669
|
-
},
|
|
3670
|
-
props
|
|
3671
|
-
),
|
|
3672
|
-
render,
|
|
3673
|
-
state: {
|
|
3674
|
-
slot: "breadcrumb-link"
|
|
3675
|
-
}
|
|
3676
|
-
});
|
|
3677
|
-
}
|
|
3678
|
-
function BreadcrumbPage({ className, ...props }) {
|
|
3679
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3680
|
-
"span",
|
|
3681
|
-
{
|
|
3682
|
-
"data-slot": "breadcrumb-page",
|
|
3683
|
-
role: "link",
|
|
3684
|
-
"aria-disabled": "true",
|
|
3685
|
-
"aria-current": "page",
|
|
3686
|
-
className: cn("font-normal text-foreground", className),
|
|
3687
|
-
...props
|
|
3688
|
-
}
|
|
3689
|
-
);
|
|
3690
|
-
}
|
|
3691
|
-
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
3692
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3693
|
-
"li",
|
|
3694
|
-
{
|
|
3695
|
-
"data-slot": "breadcrumb-separator",
|
|
3696
|
-
role: "presentation",
|
|
3697
|
-
"aria-hidden": "true",
|
|
3698
|
-
className: cn("[&>svg]:size-3.5", className),
|
|
3699
|
-
...props,
|
|
3700
|
-
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, {})
|
|
3701
|
-
}
|
|
3702
|
-
);
|
|
3703
|
-
}
|
|
3704
3879
|
function PageBreadcrumb({ items }) {
|
|
3705
3880
|
return /* @__PURE__ */ jsxRuntime.jsx(Breadcrumb, { children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbList, { className: "text-xs gap-1", children: items.map((item, i) => {
|
|
3706
3881
|
const isLast = i === items.length - 1;
|
|
@@ -3746,6 +3921,7 @@ function PageTopBar({
|
|
|
3746
3921
|
right,
|
|
3747
3922
|
variant = "ghost",
|
|
3748
3923
|
height = "var(--designkit-toolbar-height)",
|
|
3924
|
+
minHeight,
|
|
3749
3925
|
className,
|
|
3750
3926
|
style,
|
|
3751
3927
|
children,
|
|
@@ -3756,11 +3932,11 @@ function PageTopBar({
|
|
|
3756
3932
|
"div",
|
|
3757
3933
|
{
|
|
3758
3934
|
className: cn(
|
|
3759
|
-
"flex shrink-0 items-center justify-between gap-4 px-(--designkit-page-padding-x)",
|
|
3760
|
-
variant === "default" && "border-b",
|
|
3935
|
+
"flex shrink-0 items-center justify-between gap-4 overflow-visible px-(--designkit-page-padding-x)",
|
|
3936
|
+
variant === "default" && "border-b border-border",
|
|
3761
3937
|
className
|
|
3762
3938
|
),
|
|
3763
|
-
style: { height, ...style },
|
|
3939
|
+
style: { height, minHeight, ...style },
|
|
3764
3940
|
children: [
|
|
3765
3941
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2 text-xs text-muted-foreground", children: [
|
|
3766
3942
|
trigger,
|
|
@@ -3887,9 +4063,22 @@ function buildDarkTonalTokens(primaryHue, primaryChroma) {
|
|
|
3887
4063
|
function tokenMapToCss(tokens) {
|
|
3888
4064
|
return Object.entries(tokens).map(([key, value]) => ` ${key}: ${value};`).join("\n");
|
|
3889
4065
|
}
|
|
3890
|
-
function
|
|
4066
|
+
function getScopedTarget(scopeSelector) {
|
|
4067
|
+
if (scopeSelector === ":root") return document.documentElement;
|
|
4068
|
+
return document.querySelector(scopeSelector);
|
|
4069
|
+
}
|
|
4070
|
+
function getDarkSelector(scopeSelector) {
|
|
4071
|
+
if (scopeSelector === ":root") return ".dark";
|
|
4072
|
+
return `${scopeSelector}.dark, .dark ${scopeSelector}`;
|
|
4073
|
+
}
|
|
4074
|
+
function getLayoutSelector(scopeSelector, layoutClassName) {
|
|
4075
|
+
if (scopeSelector === ":root") return `.${layoutClassName}`;
|
|
4076
|
+
return `${scopeSelector}.${layoutClassName}, ${scopeSelector} .${layoutClassName}`;
|
|
4077
|
+
}
|
|
4078
|
+
function useStyleInjector(options = {}) {
|
|
3891
4079
|
const g = useThemeStore((s) => s.global);
|
|
3892
4080
|
const ov = useThemeStore((s) => s.overrides);
|
|
4081
|
+
const scopeSelector = options.scope?.trim() || ":root";
|
|
3893
4082
|
React2.useEffect(() => {
|
|
3894
4083
|
let el = document.getElementById(STYLE_ID);
|
|
3895
4084
|
if (!el) {
|
|
@@ -3897,10 +4086,10 @@ function useStyleInjector() {
|
|
|
3897
4086
|
el.id = STYLE_ID;
|
|
3898
4087
|
document.head.appendChild(el);
|
|
3899
4088
|
}
|
|
3900
|
-
const rootBlock =
|
|
4089
|
+
const rootBlock = `${scopeSelector} {
|
|
3901
4090
|
${tokenMapToCss(buildTokenMap(g))}
|
|
3902
4091
|
}`;
|
|
3903
|
-
const darkTonalBlock =
|
|
4092
|
+
const darkTonalBlock = `${getDarkSelector(scopeSelector)} {
|
|
3904
4093
|
${tokenMapToCss(buildDarkTonalTokens(g.primaryHue, g.primaryChroma))}
|
|
3905
4094
|
}`;
|
|
3906
4095
|
const tmplBlocks = Object.entries(ov).map(([id, o]) => {
|
|
@@ -3916,22 +4105,27 @@ ${tokenMapToCss(buildDarkTonalTokens(g.primaryHue, g.primaryChroma))}
|
|
|
3916
4105
|
toolbarHeight: o.toolbarHeight
|
|
3917
4106
|
});
|
|
3918
4107
|
const layoutClassName = `layout-${id}`;
|
|
3919
|
-
return
|
|
4108
|
+
return `${getLayoutSelector(scopeSelector, layoutClassName)} {
|
|
3920
4109
|
${tokenMapToCss(tokens)}
|
|
3921
4110
|
}`;
|
|
3922
4111
|
}).filter(Boolean);
|
|
3923
|
-
|
|
3924
|
-
|
|
4112
|
+
const layerBody = [rootBlock, darkTonalBlock, ...tmplBlocks].join("\n\n");
|
|
4113
|
+
el.textContent = `@layer designkit {
|
|
4114
|
+
${layerBody}
|
|
4115
|
+
}`;
|
|
4116
|
+
}, [g, ov, scopeSelector]);
|
|
3925
4117
|
React2.useEffect(() => {
|
|
3926
|
-
|
|
3927
|
-
}, [g.darkMode]);
|
|
4118
|
+
getScopedTarget(scopeSelector)?.classList.toggle("dark", g.darkMode);
|
|
4119
|
+
}, [g.darkMode, scopeSelector]);
|
|
3928
4120
|
React2.useEffect(() => {
|
|
4121
|
+
const target = getScopedTarget(scopeSelector);
|
|
4122
|
+
if (!target) return;
|
|
3929
4123
|
if (g.density === "default") {
|
|
3930
|
-
|
|
4124
|
+
target.removeAttribute("data-designkit-density");
|
|
3931
4125
|
return;
|
|
3932
4126
|
}
|
|
3933
|
-
|
|
3934
|
-
}, [g.density]);
|
|
4127
|
+
target.dataset.designkitDensity = g.density;
|
|
4128
|
+
}, [g.density, scopeSelector]);
|
|
3935
4129
|
}
|
|
3936
4130
|
function buildTemplateTheme(g, ov = {}) {
|
|
3937
4131
|
const tokens = buildTokenMap({
|
|
@@ -3958,6 +4152,13 @@ exports.AvatarGroup = AvatarGroup;
|
|
|
3958
4152
|
exports.AvatarGroupCount = AvatarGroupCount;
|
|
3959
4153
|
exports.AvatarImage = AvatarImage;
|
|
3960
4154
|
exports.Badge = Badge;
|
|
4155
|
+
exports.Breadcrumb = Breadcrumb;
|
|
4156
|
+
exports.BreadcrumbEllipsis = BreadcrumbEllipsis;
|
|
4157
|
+
exports.BreadcrumbItem = BreadcrumbItem;
|
|
4158
|
+
exports.BreadcrumbLink = BreadcrumbLink;
|
|
4159
|
+
exports.BreadcrumbList = BreadcrumbList;
|
|
4160
|
+
exports.BreadcrumbPage = BreadcrumbPage;
|
|
4161
|
+
exports.BreadcrumbSeparator = BreadcrumbSeparator;
|
|
3961
4162
|
exports.BrowseBodyTemplate = BrowseBodyTemplate;
|
|
3962
4163
|
exports.Button = Button;
|
|
3963
4164
|
exports.Card = Card;
|