@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.js
CHANGED
|
@@ -5,9 +5,9 @@ import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
|
5
5
|
import { mergeProps } from '@base-ui/react/merge-props';
|
|
6
6
|
import { useRender } from '@base-ui/react/use-render';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
|
+
import { GripHorizontal, ChevronRightIcon, MoreHorizontalIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon, XIcon, PanelLeftIcon, SlidersHorizontal, ChevronLeft, Check } from 'lucide-react';
|
|
8
9
|
import { Button as Button$1 } from '@base-ui/react/button';
|
|
9
10
|
import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
|
|
10
|
-
import { GripHorizontal, CheckIcon, ChevronRightIcon, ChevronDownIcon, ChevronUpIcon, XIcon, PanelLeftIcon, SlidersHorizontal, ChevronLeft, Check } from 'lucide-react';
|
|
11
11
|
import { Menu } from '@base-ui/react/menu';
|
|
12
12
|
import { Input as Input$1 } from '@base-ui/react/input';
|
|
13
13
|
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
@@ -17,7 +17,7 @@ import { Select as Select$1 } from '@base-ui/react/select';
|
|
|
17
17
|
import { Separator as Separator$1 } from '@base-ui/react/separator';
|
|
18
18
|
import { Dialog } from '@base-ui/react/dialog';
|
|
19
19
|
import * as React2 from 'react';
|
|
20
|
-
import React2__default, { forwardRef, useMemo, Children, useState, Fragment,
|
|
20
|
+
import React2__default, { forwardRef, useMemo, Children, useState, Fragment, useEffect, useCallback } from 'react';
|
|
21
21
|
import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
|
|
22
22
|
import { Slider as Slider$1 } from '@base-ui/react/slider';
|
|
23
23
|
import { Switch as Switch$1 } from '@base-ui/react/switch';
|
|
@@ -154,6 +154,89 @@ function Badge({
|
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
+
function Breadcrumb({ className, ...props }) {
|
|
158
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(className), ...props });
|
|
159
|
+
}
|
|
160
|
+
function BreadcrumbList({ className, ...props }) {
|
|
161
|
+
return /* @__PURE__ */ jsx(
|
|
162
|
+
"ol",
|
|
163
|
+
{
|
|
164
|
+
"data-slot": "breadcrumb-list",
|
|
165
|
+
className: cn(
|
|
166
|
+
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
|
|
167
|
+
className
|
|
168
|
+
),
|
|
169
|
+
...props
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
174
|
+
return /* @__PURE__ */ jsx(
|
|
175
|
+
"li",
|
|
176
|
+
{
|
|
177
|
+
"data-slot": "breadcrumb-item",
|
|
178
|
+
className: cn("inline-flex items-center gap-1", className),
|
|
179
|
+
...props
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function BreadcrumbLink({ className, render, ...props }) {
|
|
184
|
+
return useRender({
|
|
185
|
+
defaultTagName: "a",
|
|
186
|
+
props: mergeProps(
|
|
187
|
+
{
|
|
188
|
+
className: cn("transition-colors hover:text-foreground", className)
|
|
189
|
+
},
|
|
190
|
+
props
|
|
191
|
+
),
|
|
192
|
+
render,
|
|
193
|
+
state: {
|
|
194
|
+
slot: "breadcrumb-link"
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
199
|
+
return /* @__PURE__ */ jsx(
|
|
200
|
+
"span",
|
|
201
|
+
{
|
|
202
|
+
"data-slot": "breadcrumb-page",
|
|
203
|
+
role: "link",
|
|
204
|
+
"aria-disabled": "true",
|
|
205
|
+
"aria-current": "page",
|
|
206
|
+
className: cn("font-normal text-foreground", className),
|
|
207
|
+
...props
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
212
|
+
return /* @__PURE__ */ jsx(
|
|
213
|
+
"li",
|
|
214
|
+
{
|
|
215
|
+
"data-slot": "breadcrumb-separator",
|
|
216
|
+
role: "presentation",
|
|
217
|
+
"aria-hidden": "true",
|
|
218
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
219
|
+
...props,
|
|
220
|
+
children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
225
|
+
return /* @__PURE__ */ jsxs(
|
|
226
|
+
"span",
|
|
227
|
+
{
|
|
228
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
229
|
+
role: "presentation",
|
|
230
|
+
"aria-hidden": "true",
|
|
231
|
+
className: cn("flex size-5 items-center justify-center [&>svg]:size-4", className),
|
|
232
|
+
...props,
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ jsx(MoreHorizontalIcon, {}),
|
|
235
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More" })
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
}
|
|
157
240
|
var buttonVariants = cva(
|
|
158
241
|
"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",
|
|
159
242
|
{
|
|
@@ -1999,7 +2082,13 @@ function Header({ children, className }) {
|
|
|
1999
2082
|
}
|
|
2000
2083
|
);
|
|
2001
2084
|
}
|
|
2002
|
-
function TitleBlock({
|
|
2085
|
+
function TitleBlock({
|
|
2086
|
+
title,
|
|
2087
|
+
description,
|
|
2088
|
+
breadcrumb,
|
|
2089
|
+
status,
|
|
2090
|
+
className
|
|
2091
|
+
}) {
|
|
2003
2092
|
if (!title && !description && !breadcrumb && !status) return null;
|
|
2004
2093
|
return /* @__PURE__ */ jsxs("div", { "data-slot": "data-page-title-block", className: cn("min-w-0 flex-1", className), children: [
|
|
2005
2094
|
breadcrumb && /* @__PURE__ */ jsx("div", { className: "mb-2 text-xs text-muted-foreground", children: breadcrumb }),
|
|
@@ -2026,7 +2115,14 @@ function Actions({ children, className }) {
|
|
|
2026
2115
|
}
|
|
2027
2116
|
function Tabs2({ children, className }) {
|
|
2028
2117
|
if (!children) return null;
|
|
2029
|
-
return /* @__PURE__ */ jsx(
|
|
2118
|
+
return /* @__PURE__ */ jsx(
|
|
2119
|
+
"div",
|
|
2120
|
+
{
|
|
2121
|
+
"data-slot": "data-page-tabs",
|
|
2122
|
+
className: cn("shrink-0 border-b border-border px-6", className),
|
|
2123
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0 overflow-x-auto", children })
|
|
2124
|
+
}
|
|
2125
|
+
);
|
|
2030
2126
|
}
|
|
2031
2127
|
function Tab({ active, count, children, onClick, disabled, className }) {
|
|
2032
2128
|
return /* @__PURE__ */ jsxs(
|
|
@@ -2074,8 +2170,8 @@ function Group({ children, className, surface = "none" }) {
|
|
|
2074
2170
|
"data-surface": surface,
|
|
2075
2171
|
className: cn(
|
|
2076
2172
|
"min-h-0",
|
|
2077
|
-
surface === "bordered" && "overflow-hidden rounded-[var(--radius)] border bg-background",
|
|
2078
|
-
surface === "card" && "overflow-hidden rounded-[var(--radius)] border bg-card text-card-foreground shadow-sm",
|
|
2173
|
+
surface === "bordered" && "overflow-hidden rounded-[var(--radius)] border border-border bg-background",
|
|
2174
|
+
surface === "card" && "overflow-hidden rounded-[var(--radius)] border border-border bg-card text-card-foreground shadow-sm",
|
|
2079
2175
|
className
|
|
2080
2176
|
),
|
|
2081
2177
|
children
|
|
@@ -2128,7 +2224,14 @@ function GroupBody({ children, className }) {
|
|
|
2128
2224
|
}
|
|
2129
2225
|
function Footer({ children, className }) {
|
|
2130
2226
|
if (!children) return null;
|
|
2131
|
-
return /* @__PURE__ */ jsx(
|
|
2227
|
+
return /* @__PURE__ */ jsx(
|
|
2228
|
+
"footer",
|
|
2229
|
+
{
|
|
2230
|
+
"data-slot": "data-page-footer",
|
|
2231
|
+
className: cn("shrink-0 border-t border-border px-6 py-3", className),
|
|
2232
|
+
children
|
|
2233
|
+
}
|
|
2234
|
+
);
|
|
2132
2235
|
}
|
|
2133
2236
|
var DataPage = Object.assign(Root, {
|
|
2134
2237
|
Header,
|
|
@@ -2162,7 +2265,7 @@ var DashboardPanel = forwardRef(
|
|
|
2162
2265
|
ref,
|
|
2163
2266
|
className: cn(
|
|
2164
2267
|
"group flex h-full flex-col overflow-hidden",
|
|
2165
|
-
transparent ? "" : "rounded-(--radius) border bg-card text-card-foreground",
|
|
2268
|
+
transparent ? "" : "rounded-(--radius) border border-border bg-card text-card-foreground",
|
|
2166
2269
|
editable && "ring-1 ring-border/60 ring-inset",
|
|
2167
2270
|
className
|
|
2168
2271
|
),
|
|
@@ -2199,7 +2302,7 @@ function DashboardBodyTemplate({
|
|
|
2199
2302
|
}) {
|
|
2200
2303
|
return /* @__PURE__ */ jsxs(DataPage, { className: cn("layout-dashboard", className), style: theme, children: [
|
|
2201
2304
|
topBar && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: topBar }),
|
|
2202
|
-
(title || toolbar) && /* @__PURE__ */ jsx("header", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
2305
|
+
(title || toolbar) && /* @__PURE__ */ jsx("header", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
2203
2306
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
2204
2307
|
title && /* @__PURE__ */ jsx("h1", { className: "text-sm font-semibold truncate", children: title }),
|
|
2205
2308
|
description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
|
|
@@ -2224,20 +2327,31 @@ function clamp(value, min, max) {
|
|
|
2224
2327
|
}
|
|
2225
2328
|
function ResizeHandle({
|
|
2226
2329
|
axis,
|
|
2330
|
+
label,
|
|
2331
|
+
min,
|
|
2332
|
+
max,
|
|
2333
|
+
value,
|
|
2227
2334
|
onPointerDown,
|
|
2335
|
+
onKeyDown,
|
|
2228
2336
|
className
|
|
2229
2337
|
}) {
|
|
2230
2338
|
return /* @__PURE__ */ jsxs(
|
|
2231
2339
|
"div",
|
|
2232
2340
|
{
|
|
2233
2341
|
role: "separator",
|
|
2342
|
+
tabIndex: 0,
|
|
2343
|
+
"aria-label": label,
|
|
2234
2344
|
"aria-orientation": axis === "x" ? "vertical" : "horizontal",
|
|
2345
|
+
"aria-valuemin": min,
|
|
2346
|
+
"aria-valuemax": max,
|
|
2347
|
+
"aria-valuenow": value,
|
|
2235
2348
|
className: cn(
|
|
2236
|
-
"group/resize relative z-10 shrink-0 touch-none bg-transparent",
|
|
2349
|
+
"group/resize relative z-10 shrink-0 touch-none bg-transparent outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
2237
2350
|
axis === "x" ? "-mx-1 w-2 cursor-col-resize" : "-my-1 h-2 cursor-row-resize",
|
|
2238
2351
|
className
|
|
2239
2352
|
),
|
|
2240
2353
|
onPointerDown,
|
|
2354
|
+
onKeyDown,
|
|
2241
2355
|
children: [
|
|
2242
2356
|
/* @__PURE__ */ jsx(
|
|
2243
2357
|
"div",
|
|
@@ -2290,6 +2404,7 @@ function WorkbenchBodyTemplate({
|
|
|
2290
2404
|
maxRightPaneWidth = 520,
|
|
2291
2405
|
minBottomPaneHeight = 120,
|
|
2292
2406
|
maxBottomPaneHeight = 420,
|
|
2407
|
+
onResize,
|
|
2293
2408
|
leftPaneClassName,
|
|
2294
2409
|
mainPaneClassName,
|
|
2295
2410
|
rightPaneClassName,
|
|
@@ -2300,6 +2415,79 @@ function WorkbenchBodyTemplate({
|
|
|
2300
2415
|
const [leftWidth, setLeftWidth] = useState(leftPaneWidth);
|
|
2301
2416
|
const [rightWidth, setRightWidth] = useState(rightPaneWidth);
|
|
2302
2417
|
const [bottomHeight, setBottomHeight] = useState(bottomPaneHeight);
|
|
2418
|
+
useEffect(() => {
|
|
2419
|
+
setLeftWidth(leftPaneWidth);
|
|
2420
|
+
}, [leftPaneWidth]);
|
|
2421
|
+
useEffect(() => {
|
|
2422
|
+
setRightWidth(rightPaneWidth);
|
|
2423
|
+
}, [rightPaneWidth]);
|
|
2424
|
+
useEffect(() => {
|
|
2425
|
+
setBottomHeight(bottomPaneHeight);
|
|
2426
|
+
}, [bottomPaneHeight]);
|
|
2427
|
+
const updateResizeState = useCallback(
|
|
2428
|
+
(patch) => {
|
|
2429
|
+
const next = {
|
|
2430
|
+
leftPaneWidth: leftWidth,
|
|
2431
|
+
rightPaneWidth: rightWidth,
|
|
2432
|
+
bottomPaneHeight: bottomHeight,
|
|
2433
|
+
...patch
|
|
2434
|
+
};
|
|
2435
|
+
if (patch.leftPaneWidth !== void 0) setLeftWidth(patch.leftPaneWidth);
|
|
2436
|
+
if (patch.rightPaneWidth !== void 0) setRightWidth(patch.rightPaneWidth);
|
|
2437
|
+
if (patch.bottomPaneHeight !== void 0) setBottomHeight(patch.bottomPaneHeight);
|
|
2438
|
+
onResize?.(next);
|
|
2439
|
+
},
|
|
2440
|
+
[bottomHeight, leftWidth, onResize, rightWidth]
|
|
2441
|
+
);
|
|
2442
|
+
const updateLeftWidth = useCallback(
|
|
2443
|
+
(next) => {
|
|
2444
|
+
updateResizeState({
|
|
2445
|
+
leftPaneWidth: clamp(next, minLeftPaneWidth, maxLeftPaneWidth)
|
|
2446
|
+
});
|
|
2447
|
+
},
|
|
2448
|
+
[maxLeftPaneWidth, minLeftPaneWidth, updateResizeState]
|
|
2449
|
+
);
|
|
2450
|
+
const updateRightWidth = useCallback(
|
|
2451
|
+
(next) => {
|
|
2452
|
+
updateResizeState({
|
|
2453
|
+
rightPaneWidth: clamp(next, minRightPaneWidth, maxRightPaneWidth)
|
|
2454
|
+
});
|
|
2455
|
+
},
|
|
2456
|
+
[maxRightPaneWidth, minRightPaneWidth, updateResizeState]
|
|
2457
|
+
);
|
|
2458
|
+
const updateBottomHeight = useCallback(
|
|
2459
|
+
(next) => {
|
|
2460
|
+
updateResizeState({
|
|
2461
|
+
bottomPaneHeight: clamp(next, minBottomPaneHeight, maxBottomPaneHeight)
|
|
2462
|
+
});
|
|
2463
|
+
},
|
|
2464
|
+
[maxBottomPaneHeight, minBottomPaneHeight, updateResizeState]
|
|
2465
|
+
);
|
|
2466
|
+
const handleResizeKey = useCallback(
|
|
2467
|
+
(event, options) => {
|
|
2468
|
+
const step = event.shiftKey ? 48 : 12;
|
|
2469
|
+
if (options.decreaseKeys.includes(event.key)) {
|
|
2470
|
+
event.preventDefault();
|
|
2471
|
+
options.update(options.value - step);
|
|
2472
|
+
return;
|
|
2473
|
+
}
|
|
2474
|
+
if (options.increaseKeys.includes(event.key)) {
|
|
2475
|
+
event.preventDefault();
|
|
2476
|
+
options.update(options.value + step);
|
|
2477
|
+
return;
|
|
2478
|
+
}
|
|
2479
|
+
if (event.key === "Home") {
|
|
2480
|
+
event.preventDefault();
|
|
2481
|
+
options.update(options.min);
|
|
2482
|
+
return;
|
|
2483
|
+
}
|
|
2484
|
+
if (event.key === "End") {
|
|
2485
|
+
event.preventDefault();
|
|
2486
|
+
options.update(options.max);
|
|
2487
|
+
}
|
|
2488
|
+
},
|
|
2489
|
+
[]
|
|
2490
|
+
);
|
|
2303
2491
|
const startResize = useCallback(
|
|
2304
2492
|
(event, axis, applyDelta) => {
|
|
2305
2493
|
if (!resizable) return;
|
|
@@ -2330,7 +2518,7 @@ function WorkbenchBodyTemplate({
|
|
|
2330
2518
|
const showBottomPane = bottomPane && !bottomPaneCollapsed;
|
|
2331
2519
|
return /* @__PURE__ */ jsxs(DataPage, { className: cn("layout-workbench", className), style: theme, children: [
|
|
2332
2520
|
topBar && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: topBar }),
|
|
2333
|
-
showHeader && /* @__PURE__ */ jsx("header", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-[calc(var(--designkit-page-padding-y)*0.75)]", children: /* @__PURE__ */ jsxs("div", { className: "flex min-h-[var(--designkit-toolbar-height)] items-center justify-between gap-3", children: [
|
|
2521
|
+
showHeader && /* @__PURE__ */ 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__ */ jsxs("div", { className: "flex min-h-[var(--designkit-toolbar-height)] items-center justify-between gap-3", children: [
|
|
2334
2522
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
2335
2523
|
(title || status) && /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2336
2524
|
title && /* @__PURE__ */ jsx("h1", { className: "min-w-0 truncate text-sm font-semibold", children: title }),
|
|
@@ -2343,18 +2531,18 @@ function WorkbenchBodyTemplate({
|
|
|
2343
2531
|
actions
|
|
2344
2532
|
] })
|
|
2345
2533
|
] }) }),
|
|
2346
|
-
(showLeftPane || showRightPane) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5 border-b px-2 py-1.5 md:hidden", children: [
|
|
2534
|
+
(showLeftPane || showRightPane) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5 border-b border-border px-2 py-1.5 md:hidden", children: [
|
|
2347
2535
|
showLeftPane && /* @__PURE__ */ jsxs(Sheet, { children: [
|
|
2348
2536
|
/* @__PURE__ */ jsx(SheetTrigger, { render: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm" }), children: leftPaneLabel }),
|
|
2349
2537
|
/* @__PURE__ */ jsxs(SheetContent, { side: "left", className: "flex flex-col gap-0 p-0", children: [
|
|
2350
|
-
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: leftPaneLabel }) }),
|
|
2538
|
+
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: leftPaneLabel }) }),
|
|
2351
2539
|
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: leftPane })
|
|
2352
2540
|
] })
|
|
2353
2541
|
] }),
|
|
2354
2542
|
showRightPane && /* @__PURE__ */ jsxs(Sheet, { children: [
|
|
2355
2543
|
/* @__PURE__ */ jsx(SheetTrigger, { render: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm" }), children: rightPaneLabel }),
|
|
2356
2544
|
/* @__PURE__ */ jsxs(SheetContent, { side: "right", className: "flex flex-col gap-0 p-0", children: [
|
|
2357
|
-
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: rightPaneLabel }) }),
|
|
2545
|
+
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: rightPaneLabel }) }),
|
|
2358
2546
|
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: rightPane })
|
|
2359
2547
|
] })
|
|
2360
2548
|
] })
|
|
@@ -2365,7 +2553,7 @@ function WorkbenchBodyTemplate({
|
|
|
2365
2553
|
"aside",
|
|
2366
2554
|
{
|
|
2367
2555
|
className: cn(
|
|
2368
|
-
"hidden min-h-0 shrink-0 overflow-hidden border-r bg-card/45 md:flex md:flex-col",
|
|
2556
|
+
"hidden min-h-0 shrink-0 overflow-hidden border-r border-border bg-card/45 md:flex md:flex-col",
|
|
2369
2557
|
leftPaneClassName
|
|
2370
2558
|
),
|
|
2371
2559
|
style: { width: leftWidth },
|
|
@@ -2376,13 +2564,25 @@ function WorkbenchBodyTemplate({
|
|
|
2376
2564
|
ResizeHandle,
|
|
2377
2565
|
{
|
|
2378
2566
|
axis: "x",
|
|
2567
|
+
label: "Resize left pane",
|
|
2568
|
+
min: minLeftPaneWidth,
|
|
2569
|
+
max: maxLeftPaneWidth,
|
|
2570
|
+
value: leftWidth,
|
|
2379
2571
|
className: "hidden md:flex",
|
|
2380
2572
|
onPointerDown: (event) => {
|
|
2381
2573
|
const start = leftWidth;
|
|
2382
2574
|
startResize(event, "x", (delta) => {
|
|
2383
|
-
|
|
2575
|
+
updateLeftWidth(start + delta);
|
|
2384
2576
|
});
|
|
2385
|
-
}
|
|
2577
|
+
},
|
|
2578
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2579
|
+
value: leftWidth,
|
|
2580
|
+
min: minLeftPaneWidth,
|
|
2581
|
+
max: maxLeftPaneWidth,
|
|
2582
|
+
decreaseKeys: ["ArrowLeft"],
|
|
2583
|
+
increaseKeys: ["ArrowRight"],
|
|
2584
|
+
update: updateLeftWidth
|
|
2585
|
+
})
|
|
2386
2586
|
}
|
|
2387
2587
|
)
|
|
2388
2588
|
] }),
|
|
@@ -2393,22 +2593,32 @@ function WorkbenchBodyTemplate({
|
|
|
2393
2593
|
ResizeHandle,
|
|
2394
2594
|
{
|
|
2395
2595
|
axis: "y",
|
|
2596
|
+
label: "Resize bottom pane",
|
|
2597
|
+
min: minBottomPaneHeight,
|
|
2598
|
+
max: maxBottomPaneHeight,
|
|
2599
|
+
value: bottomHeight,
|
|
2396
2600
|
className: "hidden md:flex",
|
|
2397
2601
|
onPointerDown: (event) => {
|
|
2398
2602
|
const start = bottomHeight;
|
|
2399
2603
|
startResize(event, "y", (delta) => {
|
|
2400
|
-
|
|
2401
|
-
clamp(start - delta, minBottomPaneHeight, maxBottomPaneHeight)
|
|
2402
|
-
);
|
|
2604
|
+
updateBottomHeight(start - delta);
|
|
2403
2605
|
});
|
|
2404
|
-
}
|
|
2606
|
+
},
|
|
2607
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2608
|
+
value: bottomHeight,
|
|
2609
|
+
min: minBottomPaneHeight,
|
|
2610
|
+
max: maxBottomPaneHeight,
|
|
2611
|
+
decreaseKeys: ["ArrowDown"],
|
|
2612
|
+
increaseKeys: ["ArrowUp"],
|
|
2613
|
+
update: updateBottomHeight
|
|
2614
|
+
})
|
|
2405
2615
|
}
|
|
2406
2616
|
),
|
|
2407
2617
|
/* @__PURE__ */ jsx(
|
|
2408
2618
|
"section",
|
|
2409
2619
|
{
|
|
2410
2620
|
className: cn(
|
|
2411
|
-
"min-h-0 shrink-0 overflow-auto border-t bg-card/40 md:overflow-hidden",
|
|
2621
|
+
"min-h-0 shrink-0 overflow-auto border-t border-border bg-card/40 md:overflow-hidden",
|
|
2412
2622
|
bottomPaneClassName
|
|
2413
2623
|
),
|
|
2414
2624
|
style: { height: bottomHeight },
|
|
@@ -2422,20 +2632,32 @@ function WorkbenchBodyTemplate({
|
|
|
2422
2632
|
ResizeHandle,
|
|
2423
2633
|
{
|
|
2424
2634
|
axis: "x",
|
|
2635
|
+
label: "Resize right pane",
|
|
2636
|
+
min: minRightPaneWidth,
|
|
2637
|
+
max: maxRightPaneWidth,
|
|
2638
|
+
value: rightWidth,
|
|
2425
2639
|
className: "hidden md:flex",
|
|
2426
2640
|
onPointerDown: (event) => {
|
|
2427
2641
|
const start = rightWidth;
|
|
2428
2642
|
startResize(event, "x", (delta) => {
|
|
2429
|
-
|
|
2643
|
+
updateRightWidth(start - delta);
|
|
2430
2644
|
});
|
|
2431
|
-
}
|
|
2645
|
+
},
|
|
2646
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2647
|
+
value: rightWidth,
|
|
2648
|
+
min: minRightPaneWidth,
|
|
2649
|
+
max: maxRightPaneWidth,
|
|
2650
|
+
decreaseKeys: ["ArrowRight"],
|
|
2651
|
+
increaseKeys: ["ArrowLeft"],
|
|
2652
|
+
update: updateRightWidth
|
|
2653
|
+
})
|
|
2432
2654
|
}
|
|
2433
2655
|
),
|
|
2434
2656
|
/* @__PURE__ */ jsx(
|
|
2435
2657
|
"aside",
|
|
2436
2658
|
{
|
|
2437
2659
|
className: cn(
|
|
2438
|
-
"hidden min-h-0 shrink-0 overflow-hidden border-l bg-card/45 md:flex md:flex-col",
|
|
2660
|
+
"hidden min-h-0 shrink-0 overflow-hidden border-l border-border bg-card/45 md:flex md:flex-col",
|
|
2439
2661
|
rightPaneClassName
|
|
2440
2662
|
),
|
|
2441
2663
|
style: { width: rightWidth },
|
|
@@ -2496,9 +2718,9 @@ function GroupWrapper({
|
|
|
2496
2718
|
}
|
|
2497
2719
|
if (variant === "bordered") {
|
|
2498
2720
|
if (layout === "inline") {
|
|
2499
|
-
return /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-(--radius) border divide-y", children });
|
|
2721
|
+
return /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-(--radius) border border-border divide-y", children });
|
|
2500
2722
|
}
|
|
2501
|
-
return /* @__PURE__ */ jsx("div", { className: "rounded-(--radius) border p-(--designkit-panel-gap)", children });
|
|
2723
|
+
return /* @__PURE__ */ jsx("div", { className: "rounded-(--radius) border border-border p-(--designkit-panel-gap)", children });
|
|
2502
2724
|
}
|
|
2503
2725
|
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
2504
2726
|
}
|
|
@@ -2659,7 +2881,7 @@ function Root2({
|
|
|
2659
2881
|
/* @__PURE__ */ jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2660
2882
|
/* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
|
|
2661
2883
|
] }),
|
|
2662
|
-
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2884
|
+
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2663
2885
|
/* @__PURE__ */ jsx(DataPage.Content, { className: contentClassName, children: /* @__PURE__ */ jsx(DataPage.Group, { className: "h-full", children: /* @__PURE__ */ jsx(DataPage.GroupBody, { className: cn("h-full", bodyEl.props.className), children: bodyEl.props.children }) }) })
|
|
2664
2886
|
] });
|
|
2665
2887
|
}
|
|
@@ -2671,7 +2893,7 @@ function Root2({
|
|
|
2671
2893
|
/* @__PURE__ */ jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2672
2894
|
/* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
|
|
2673
2895
|
] }),
|
|
2674
|
-
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2896
|
+
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2675
2897
|
/* @__PURE__ */ jsx(DataPage.Content, { className: contentClassName, children: /* @__PURE__ */ jsxs("div", { className: "grid gap-(--designkit-panel-gap) lg:grid-cols-[16rem_minmax(0,1fr)]", children: [
|
|
2676
2898
|
/* @__PURE__ */ jsx("nav", { className: "space-y-1", children: sections.map((section) => {
|
|
2677
2899
|
const active = section.props.id === activeSection?.props.id;
|
|
@@ -2705,7 +2927,7 @@ function Root2({
|
|
|
2705
2927
|
/* @__PURE__ */ jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2706
2928
|
/* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
|
|
2707
2929
|
] }),
|
|
2708
|
-
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2930
|
+
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2709
2931
|
hasTabs && /* @__PURE__ */ jsx(DataPage.Tabs, { children: tabs.map((tab) => /* @__PURE__ */ jsx(
|
|
2710
2932
|
DataPage.Tab,
|
|
2711
2933
|
{
|
|
@@ -2771,7 +2993,7 @@ function BrowseBodyTemplate({
|
|
|
2771
2993
|
/* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
|
|
2772
2994
|
] }),
|
|
2773
2995
|
/* @__PURE__ */ jsxs(DataPage.Content, { padding: "none", className: "flex flex-col overflow-hidden", children: [
|
|
2774
|
-
(toolbar || isNarrow) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b px-(--designkit-page-padding-x) py-2", children: [
|
|
2996
|
+
(toolbar || isNarrow) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-(--designkit-page-padding-x) py-2", children: [
|
|
2775
2997
|
isNarrow && /* @__PURE__ */ jsxs(Sheet, { children: [
|
|
2776
2998
|
/* @__PURE__ */ jsxs(
|
|
2777
2999
|
SheetTrigger,
|
|
@@ -2784,14 +3006,21 @@ function BrowseBodyTemplate({
|
|
|
2784
3006
|
}
|
|
2785
3007
|
),
|
|
2786
3008
|
/* @__PURE__ */ jsxs(SheetContent, { side: "left", className: "flex flex-col gap-0 p-0", children: [
|
|
2787
|
-
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: sidebarTitle }) }),
|
|
3009
|
+
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: sidebarTitle }) }),
|
|
2788
3010
|
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsx("div", { className: "p-4", children: sidebar }) })
|
|
2789
3011
|
] })
|
|
2790
3012
|
] }),
|
|
2791
3013
|
toolbar && /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: toolbar })
|
|
2792
3014
|
] }),
|
|
2793
3015
|
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
|
|
2794
|
-
!isNarrow && /* @__PURE__ */ jsx(
|
|
3016
|
+
!isNarrow && /* @__PURE__ */ jsx(
|
|
3017
|
+
"aside",
|
|
3018
|
+
{
|
|
3019
|
+
className: "shrink-0 overflow-hidden border-r border-border",
|
|
3020
|
+
style: { width: sidebarWidth },
|
|
3021
|
+
children: /* @__PURE__ */ jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsx("div", { className: "px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: sidebar }) })
|
|
3022
|
+
}
|
|
3023
|
+
),
|
|
2795
3024
|
/* @__PURE__ */ jsx(
|
|
2796
3025
|
"div",
|
|
2797
3026
|
{
|
|
@@ -2849,8 +3078,8 @@ function DetailBodySection({
|
|
|
2849
3078
|
{
|
|
2850
3079
|
className: cn(
|
|
2851
3080
|
"min-h-0",
|
|
2852
|
-
surface === "card" && "rounded-(--radius) border bg-card p-(--designkit-panel-gap) text-card-foreground shadow-sm",
|
|
2853
|
-
surface === "bordered" && "rounded-(--radius) border p-(--designkit-panel-gap)",
|
|
3081
|
+
surface === "card" && "rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap) text-card-foreground shadow-sm",
|
|
3082
|
+
surface === "bordered" && "rounded-(--radius) border border-border p-(--designkit-panel-gap)",
|
|
2854
3083
|
className
|
|
2855
3084
|
),
|
|
2856
3085
|
children: [
|
|
@@ -2895,11 +3124,14 @@ function DetailBodyTemplateRoot({
|
|
|
2895
3124
|
const hasTabs = tabs.length > 0;
|
|
2896
3125
|
const [activeTab, setActiveTab] = useState(() => tabs[0]?.props.id ?? "");
|
|
2897
3126
|
const selectedTab = tabs.find((tab) => tab.props.id === activeTab) ?? tabs[0];
|
|
2898
|
-
const summarySlot = summary ? /* @__PURE__ */ jsx("div", { className: "min-h-0 rounded-(--radius) border bg-card p-(--designkit-panel-gap) text-card-foreground", children: summary }) : null;
|
|
3127
|
+
const summarySlot = summary ? /* @__PURE__ */ jsx("div", { className: "min-h-0 rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap) text-card-foreground", children: summary }) : null;
|
|
2899
3128
|
const mediaSlot = media ? /* @__PURE__ */ jsx(
|
|
2900
3129
|
"div",
|
|
2901
3130
|
{
|
|
2902
|
-
className: cn(
|
|
3131
|
+
className: cn(
|
|
3132
|
+
"min-h-0 overflow-hidden rounded-(--radius) border border-border bg-card",
|
|
3133
|
+
mediaClassName
|
|
3134
|
+
),
|
|
2903
3135
|
children: media
|
|
2904
3136
|
}
|
|
2905
3137
|
) : null;
|
|
@@ -2969,7 +3201,7 @@ function DetailBodyTemplateRoot({
|
|
|
2969
3201
|
"div",
|
|
2970
3202
|
{
|
|
2971
3203
|
className: cn(
|
|
2972
|
-
"min-h-0 rounded-(--radius) border bg-card p-(--designkit-panel-gap)",
|
|
3204
|
+
"min-h-0 rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap)",
|
|
2973
3205
|
asideClassName
|
|
2974
3206
|
),
|
|
2975
3207
|
children: insideAsideSlot
|
|
@@ -3012,7 +3244,7 @@ function DetailBodyTemplateRoot({
|
|
|
3012
3244
|
"aside",
|
|
3013
3245
|
{
|
|
3014
3246
|
className: cn(
|
|
3015
|
-
"min-h-0 border-t bg-background lg:border-l lg:border-t-0",
|
|
3247
|
+
"min-h-0 border-t border-border bg-background lg:border-l lg:border-t-0",
|
|
3016
3248
|
asideClassName
|
|
3017
3249
|
),
|
|
3018
3250
|
children: /* @__PURE__ */ jsx(
|
|
@@ -3063,8 +3295,9 @@ function ListDetailBodyTemplate({
|
|
|
3063
3295
|
/* @__PURE__ */ jsx(
|
|
3064
3296
|
"aside",
|
|
3065
3297
|
{
|
|
3298
|
+
"data-slot": "list-detail-list",
|
|
3066
3299
|
className: cn(
|
|
3067
|
-
"min-h-0 shrink-0 overflow-hidden border-r",
|
|
3300
|
+
"min-h-0 shrink-0 overflow-hidden border-r border-border",
|
|
3068
3301
|
detail ? "hidden lg:flex lg:w-[var(--ld-list-width)] lg:flex-col" : "flex w-full flex-col lg:w-[var(--ld-list-width)]",
|
|
3069
3302
|
listClassName
|
|
3070
3303
|
),
|
|
@@ -3080,7 +3313,7 @@ function ListDetailBodyTemplate({
|
|
|
3080
3313
|
detailClassName
|
|
3081
3314
|
),
|
|
3082
3315
|
children: [
|
|
3083
|
-
detail && onBack && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center border-b px-3 py-2 lg:hidden", children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", className: "-ml-1 gap-1", onClick: onBack, children: [
|
|
3316
|
+
detail && onBack && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center border-b border-border px-3 py-2 lg:hidden", children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", className: "-ml-1 gap-1", onClick: onBack, children: [
|
|
3084
3317
|
/* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
|
|
3085
3318
|
backLabel
|
|
3086
3319
|
] }) }),
|
|
@@ -3133,7 +3366,7 @@ function PanelTemplateRoot({
|
|
|
3133
3366
|
] })
|
|
3134
3367
|
] }),
|
|
3135
3368
|
/* @__PURE__ */ jsx("div", { className: cn("min-h-0 flex-1 overflow-y-auto px-4 py-4", bodyClassName), children: /* @__PURE__ */ jsx("div", { className: "space-y-5", children }) }),
|
|
3136
|
-
footer && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-t px-4 py-3", children: footer })
|
|
3369
|
+
footer && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-t border-border px-4 py-3", children: footer })
|
|
3137
3370
|
] });
|
|
3138
3371
|
}
|
|
3139
3372
|
var PanelTemplate = Object.assign(PanelTemplateRoot, {
|
|
@@ -3273,7 +3506,7 @@ function TypographyBodyTemplate({ theme, breadcrumb }) {
|
|
|
3273
3506
|
/* @__PURE__ */ jsx("div", { className: "grid gap-2", children: ["API Gateway", "Billing Worker", "Notification Queue"].map((item, index) => /* @__PURE__ */ jsxs(
|
|
3274
3507
|
"div",
|
|
3275
3508
|
{
|
|
3276
|
-
className: "flex items-center justify-between rounded-lg border px-3 py-2",
|
|
3509
|
+
className: "flex items-center justify-between rounded-lg border border-border px-3 py-2",
|
|
3277
3510
|
children: [
|
|
3278
3511
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
3279
3512
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: item }),
|
|
@@ -3322,13 +3555,13 @@ var useThemeStore = create((set) => ({
|
|
|
3322
3555
|
},
|
|
3323
3556
|
overrides: {},
|
|
3324
3557
|
activeShell: "sidebar",
|
|
3325
|
-
activeTemplate: "
|
|
3558
|
+
activeTemplate: "databody",
|
|
3326
3559
|
setGlobal: (patch) => set((s) => ({ global: { ...s.global, ...patch } })),
|
|
3327
3560
|
setOverride: (id, patch) => set((s) => ({
|
|
3328
3561
|
overrides: { ...s.overrides, [id]: { ...s.overrides[id], ...patch } }
|
|
3329
3562
|
})),
|
|
3330
|
-
setShell: (
|
|
3331
|
-
setTemplate: (
|
|
3563
|
+
setShell: () => void 0,
|
|
3564
|
+
setTemplate: () => void 0
|
|
3332
3565
|
}));
|
|
3333
3566
|
var tonalTokenDefs = [
|
|
3334
3567
|
{
|
|
@@ -3394,7 +3627,7 @@ function ColorSwatch({
|
|
|
3394
3627
|
variable,
|
|
3395
3628
|
formula
|
|
3396
3629
|
}) {
|
|
3397
|
-
return /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border", children: [
|
|
3630
|
+
return /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border border-border", children: [
|
|
3398
3631
|
/* @__PURE__ */ jsx("div", { className: `${bg} flex h-14 items-center justify-center`, children: /* @__PURE__ */ jsx("span", { className: `${fg} text-sm font-semibold`, children: "Aa" }) }),
|
|
3399
3632
|
/* @__PURE__ */ jsxs("div", { className: "bg-card px-3 py-2 space-y-0.5", children: [
|
|
3400
3633
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium", children: name }),
|
|
@@ -3491,7 +3724,7 @@ function ColorsBodyTemplate({ theme, breadcrumb }) {
|
|
|
3491
3724
|
" \xB7 ",
|
|
3492
3725
|
"factor = 2\u20136% of primary chroma"
|
|
3493
3726
|
] }),
|
|
3494
|
-
/* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border divide-y text-xs font-mono", children: [
|
|
3727
|
+
/* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border border-border divide-y text-xs font-mono", children: [
|
|
3495
3728
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[7rem_1fr_1fr] bg-muted/50 px-3 py-1.5 text-muted-foreground", children: [
|
|
3496
3729
|
/* @__PURE__ */ jsx("span", { children: "token" }),
|
|
3497
3730
|
/* @__PURE__ */ jsx("span", { children: "light" }),
|
|
@@ -3503,7 +3736,7 @@ function ColorsBodyTemplate({ theme, breadcrumb }) {
|
|
|
3503
3736
|
className: "grid grid-cols-[7rem_1fr_1fr] items-center gap-x-3 px-3 py-2",
|
|
3504
3737
|
children: [
|
|
3505
3738
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3506
|
-
/* @__PURE__ */ jsx("div", { className: `${t.bg} h-5 w-5 shrink-0 rounded border` }),
|
|
3739
|
+
/* @__PURE__ */ jsx("div", { className: `${t.bg} h-5 w-5 shrink-0 rounded border border-border` }),
|
|
3507
3740
|
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: t.name })
|
|
3508
3741
|
] }),
|
|
3509
3742
|
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
@@ -3570,7 +3803,16 @@ function FormCard({
|
|
|
3570
3803
|
}) {
|
|
3571
3804
|
const widthCls = cardWidthClass[cardWidth];
|
|
3572
3805
|
if (card === "card") {
|
|
3573
|
-
return /* @__PURE__ */ jsx(
|
|
3806
|
+
return /* @__PURE__ */ jsx(
|
|
3807
|
+
"div",
|
|
3808
|
+
{
|
|
3809
|
+
className: cn(
|
|
3810
|
+
"w-full rounded-2xl border border-border bg-card px-8 py-10 shadow-lg",
|
|
3811
|
+
widthCls
|
|
3812
|
+
),
|
|
3813
|
+
children
|
|
3814
|
+
}
|
|
3815
|
+
);
|
|
3574
3816
|
}
|
|
3575
3817
|
return /* @__PURE__ */ jsx("div", { className: cn("w-full", widthCls), children });
|
|
3576
3818
|
}
|
|
@@ -3613,73 +3855,6 @@ function LoginBodyTemplate({
|
|
|
3613
3855
|
}
|
|
3614
3856
|
);
|
|
3615
3857
|
}
|
|
3616
|
-
function Breadcrumb({ className, ...props }) {
|
|
3617
|
-
return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(className), ...props });
|
|
3618
|
-
}
|
|
3619
|
-
function BreadcrumbList({ className, ...props }) {
|
|
3620
|
-
return /* @__PURE__ */ jsx(
|
|
3621
|
-
"ol",
|
|
3622
|
-
{
|
|
3623
|
-
"data-slot": "breadcrumb-list",
|
|
3624
|
-
className: cn(
|
|
3625
|
-
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
|
|
3626
|
-
className
|
|
3627
|
-
),
|
|
3628
|
-
...props
|
|
3629
|
-
}
|
|
3630
|
-
);
|
|
3631
|
-
}
|
|
3632
|
-
function BreadcrumbItem({ className, ...props }) {
|
|
3633
|
-
return /* @__PURE__ */ jsx(
|
|
3634
|
-
"li",
|
|
3635
|
-
{
|
|
3636
|
-
"data-slot": "breadcrumb-item",
|
|
3637
|
-
className: cn("inline-flex items-center gap-1", className),
|
|
3638
|
-
...props
|
|
3639
|
-
}
|
|
3640
|
-
);
|
|
3641
|
-
}
|
|
3642
|
-
function BreadcrumbLink({ className, render, ...props }) {
|
|
3643
|
-
return useRender({
|
|
3644
|
-
defaultTagName: "a",
|
|
3645
|
-
props: mergeProps(
|
|
3646
|
-
{
|
|
3647
|
-
className: cn("transition-colors hover:text-foreground", className)
|
|
3648
|
-
},
|
|
3649
|
-
props
|
|
3650
|
-
),
|
|
3651
|
-
render,
|
|
3652
|
-
state: {
|
|
3653
|
-
slot: "breadcrumb-link"
|
|
3654
|
-
}
|
|
3655
|
-
});
|
|
3656
|
-
}
|
|
3657
|
-
function BreadcrumbPage({ className, ...props }) {
|
|
3658
|
-
return /* @__PURE__ */ jsx(
|
|
3659
|
-
"span",
|
|
3660
|
-
{
|
|
3661
|
-
"data-slot": "breadcrumb-page",
|
|
3662
|
-
role: "link",
|
|
3663
|
-
"aria-disabled": "true",
|
|
3664
|
-
"aria-current": "page",
|
|
3665
|
-
className: cn("font-normal text-foreground", className),
|
|
3666
|
-
...props
|
|
3667
|
-
}
|
|
3668
|
-
);
|
|
3669
|
-
}
|
|
3670
|
-
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
3671
|
-
return /* @__PURE__ */ jsx(
|
|
3672
|
-
"li",
|
|
3673
|
-
{
|
|
3674
|
-
"data-slot": "breadcrumb-separator",
|
|
3675
|
-
role: "presentation",
|
|
3676
|
-
"aria-hidden": "true",
|
|
3677
|
-
className: cn("[&>svg]:size-3.5", className),
|
|
3678
|
-
...props,
|
|
3679
|
-
children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
3680
|
-
}
|
|
3681
|
-
);
|
|
3682
|
-
}
|
|
3683
3858
|
function PageBreadcrumb({ items }) {
|
|
3684
3859
|
return /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsx(BreadcrumbList, { className: "text-xs gap-1", children: items.map((item, i) => {
|
|
3685
3860
|
const isLast = i === items.length - 1;
|
|
@@ -3725,6 +3900,7 @@ function PageTopBar({
|
|
|
3725
3900
|
right,
|
|
3726
3901
|
variant = "ghost",
|
|
3727
3902
|
height = "var(--designkit-toolbar-height)",
|
|
3903
|
+
minHeight,
|
|
3728
3904
|
className,
|
|
3729
3905
|
style,
|
|
3730
3906
|
children,
|
|
@@ -3735,11 +3911,11 @@ function PageTopBar({
|
|
|
3735
3911
|
"div",
|
|
3736
3912
|
{
|
|
3737
3913
|
className: cn(
|
|
3738
|
-
"flex shrink-0 items-center justify-between gap-4 px-(--designkit-page-padding-x)",
|
|
3739
|
-
variant === "default" && "border-b",
|
|
3914
|
+
"flex shrink-0 items-center justify-between gap-4 overflow-visible px-(--designkit-page-padding-x)",
|
|
3915
|
+
variant === "default" && "border-b border-border",
|
|
3740
3916
|
className
|
|
3741
3917
|
),
|
|
3742
|
-
style: { height, ...style },
|
|
3918
|
+
style: { height, minHeight, ...style },
|
|
3743
3919
|
children: [
|
|
3744
3920
|
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2 text-xs text-muted-foreground", children: [
|
|
3745
3921
|
trigger,
|
|
@@ -3866,9 +4042,22 @@ function buildDarkTonalTokens(primaryHue, primaryChroma) {
|
|
|
3866
4042
|
function tokenMapToCss(tokens) {
|
|
3867
4043
|
return Object.entries(tokens).map(([key, value]) => ` ${key}: ${value};`).join("\n");
|
|
3868
4044
|
}
|
|
3869
|
-
function
|
|
4045
|
+
function getScopedTarget(scopeSelector) {
|
|
4046
|
+
if (scopeSelector === ":root") return document.documentElement;
|
|
4047
|
+
return document.querySelector(scopeSelector);
|
|
4048
|
+
}
|
|
4049
|
+
function getDarkSelector(scopeSelector) {
|
|
4050
|
+
if (scopeSelector === ":root") return ".dark";
|
|
4051
|
+
return `${scopeSelector}.dark, .dark ${scopeSelector}`;
|
|
4052
|
+
}
|
|
4053
|
+
function getLayoutSelector(scopeSelector, layoutClassName) {
|
|
4054
|
+
if (scopeSelector === ":root") return `.${layoutClassName}`;
|
|
4055
|
+
return `${scopeSelector}.${layoutClassName}, ${scopeSelector} .${layoutClassName}`;
|
|
4056
|
+
}
|
|
4057
|
+
function useStyleInjector(options = {}) {
|
|
3870
4058
|
const g = useThemeStore((s) => s.global);
|
|
3871
4059
|
const ov = useThemeStore((s) => s.overrides);
|
|
4060
|
+
const scopeSelector = options.scope?.trim() || ":root";
|
|
3872
4061
|
useEffect(() => {
|
|
3873
4062
|
let el = document.getElementById(STYLE_ID);
|
|
3874
4063
|
if (!el) {
|
|
@@ -3876,10 +4065,10 @@ function useStyleInjector() {
|
|
|
3876
4065
|
el.id = STYLE_ID;
|
|
3877
4066
|
document.head.appendChild(el);
|
|
3878
4067
|
}
|
|
3879
|
-
const rootBlock =
|
|
4068
|
+
const rootBlock = `${scopeSelector} {
|
|
3880
4069
|
${tokenMapToCss(buildTokenMap(g))}
|
|
3881
4070
|
}`;
|
|
3882
|
-
const darkTonalBlock =
|
|
4071
|
+
const darkTonalBlock = `${getDarkSelector(scopeSelector)} {
|
|
3883
4072
|
${tokenMapToCss(buildDarkTonalTokens(g.primaryHue, g.primaryChroma))}
|
|
3884
4073
|
}`;
|
|
3885
4074
|
const tmplBlocks = Object.entries(ov).map(([id, o]) => {
|
|
@@ -3895,22 +4084,27 @@ ${tokenMapToCss(buildDarkTonalTokens(g.primaryHue, g.primaryChroma))}
|
|
|
3895
4084
|
toolbarHeight: o.toolbarHeight
|
|
3896
4085
|
});
|
|
3897
4086
|
const layoutClassName = `layout-${id}`;
|
|
3898
|
-
return
|
|
4087
|
+
return `${getLayoutSelector(scopeSelector, layoutClassName)} {
|
|
3899
4088
|
${tokenMapToCss(tokens)}
|
|
3900
4089
|
}`;
|
|
3901
4090
|
}).filter(Boolean);
|
|
3902
|
-
|
|
3903
|
-
|
|
4091
|
+
const layerBody = [rootBlock, darkTonalBlock, ...tmplBlocks].join("\n\n");
|
|
4092
|
+
el.textContent = `@layer designkit {
|
|
4093
|
+
${layerBody}
|
|
4094
|
+
}`;
|
|
4095
|
+
}, [g, ov, scopeSelector]);
|
|
3904
4096
|
useEffect(() => {
|
|
3905
|
-
|
|
3906
|
-
}, [g.darkMode]);
|
|
4097
|
+
getScopedTarget(scopeSelector)?.classList.toggle("dark", g.darkMode);
|
|
4098
|
+
}, [g.darkMode, scopeSelector]);
|
|
3907
4099
|
useEffect(() => {
|
|
4100
|
+
const target = getScopedTarget(scopeSelector);
|
|
4101
|
+
if (!target) return;
|
|
3908
4102
|
if (g.density === "default") {
|
|
3909
|
-
|
|
4103
|
+
target.removeAttribute("data-designkit-density");
|
|
3910
4104
|
return;
|
|
3911
4105
|
}
|
|
3912
|
-
|
|
3913
|
-
}, [g.density]);
|
|
4106
|
+
target.dataset.designkitDensity = g.density;
|
|
4107
|
+
}, [g.density, scopeSelector]);
|
|
3914
4108
|
}
|
|
3915
4109
|
function buildTemplateTheme(g, ov = {}) {
|
|
3916
4110
|
const tokens = buildTokenMap({
|
|
@@ -3930,6 +4124,6 @@ function buildTemplateTheme(g, ov = {}) {
|
|
|
3930
4124
|
return tokens;
|
|
3931
4125
|
}
|
|
3932
4126
|
|
|
3933
|
-
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BrowseBodyTemplate, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, DashboardBodyTemplate, DashboardPanel, DataBodyTemplate, DataPage, DetailBodyTemplate, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FormWizardBodyTemplate, Input, Label, ListDetailBodyTemplate, LoginBodyTemplate, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, PageTopBar, PanelTemplate, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, WorkbenchBodyTemplate, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useSidebarOptional, useStyleInjector, useThemeStore };
|
|
4127
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BrowseBodyTemplate, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, DashboardBodyTemplate, DashboardPanel, DataBodyTemplate, DataPage, DetailBodyTemplate, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FormWizardBodyTemplate, Input, Label, ListDetailBodyTemplate, LoginBodyTemplate, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, PageTopBar, PanelTemplate, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, WorkbenchBodyTemplate, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useSidebarOptional, useStyleInjector, useThemeStore };
|
|
3934
4128
|
//# sourceMappingURL=index.js.map
|
|
3935
4129
|
//# sourceMappingURL=index.js.map
|