@loykin/designkit 0.0.1-dev.2 → 0.0.1-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -8
- package/dist/index.cjs +261 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -2
- package/dist/index.d.ts +61 -2
- package/dist/index.js +261 -18
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2 -77
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
React page template library. Provides ready-to-use page layouts for admin and dashboard applications.
|
|
4
4
|
|
|
5
|
+
For AI-assisted implementation in consuming applications, see the
|
|
6
|
+
[DesignKit Consumer Agent Guide](docs/consumer-guide.md).
|
|
7
|
+
|
|
5
8
|
## Installation
|
|
6
9
|
|
|
7
10
|
```bash
|
|
@@ -17,14 +20,7 @@ Import the styles in your global CSS:
|
|
|
17
20
|
@import "@loykin/designkit/styles";
|
|
18
21
|
```
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
your Tailwind scan sources:
|
|
22
|
-
|
|
23
|
-
```css
|
|
24
|
-
@source "@loykin/designkit";
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
You can also import the stylesheet from your app entry, as shown below.
|
|
23
|
+
The styles file includes pre-built Tailwind utility classes — no `@source` configuration required. You can also import the stylesheet from your app entry, as shown below.
|
|
28
24
|
|
|
29
25
|
## Quick Start
|
|
30
26
|
|
|
@@ -138,6 +134,16 @@ Groups content within a tab or section. The `layout` prop controls the visual st
|
|
|
138
134
|
| `inline` | Table-style rows (detail view) |
|
|
139
135
|
| `split` | Left list + right detail |
|
|
140
136
|
|
|
137
|
+
| Prop | Type | Description |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| `layout` | `GroupLayout` | Visual structure — see table above |
|
|
140
|
+
| `variant` | `'card' \| 'plain' \| 'bordered'` | Wrapper style (defaults per layout) |
|
|
141
|
+
| `title` | `ReactNode` | Group heading |
|
|
142
|
+
| `description` | `ReactNode` | Subtitle below the heading |
|
|
143
|
+
| `actions` | `ReactNode` | Action slot next to the heading |
|
|
144
|
+
| `danger` | `boolean` | Renders title in destructive color |
|
|
145
|
+
| `className` | `string` | Class applied to the group root element |
|
|
146
|
+
|
|
141
147
|
```tsx
|
|
142
148
|
<DataBodyTemplate.Tab id="settings" label="Settings">
|
|
143
149
|
<DataBodyTemplate.Group layout="horizontal" title="Identity" description="Basic information">
|
|
@@ -300,6 +306,44 @@ Panel card component. Wrap your panel viewer in `DashboardPanel` for consistent
|
|
|
300
306
|
|
|
301
307
|
---
|
|
302
308
|
|
|
309
|
+
### WorkbenchBodyTemplate
|
|
310
|
+
|
|
311
|
+
Resizable editor/workbench shell for products like panel editors, SQL editors, log explorers, and data workspaces. The template owns the pane chrome and resize handles; the app owns editor, preview, inspector, schema, and result content.
|
|
312
|
+
|
|
313
|
+
```tsx
|
|
314
|
+
import { WorkbenchBodyTemplate, PageTopBar, Button } from '@loykin/designkit'
|
|
315
|
+
|
|
316
|
+
export function SqlEditorPage() {
|
|
317
|
+
return (
|
|
318
|
+
<WorkbenchBodyTemplate
|
|
319
|
+
topBar={<PageTopBar left="Data / Query editor" />}
|
|
320
|
+
title="SQL editor"
|
|
321
|
+
headerRight={<Button variant="outline" size="sm">Run</Button>}
|
|
322
|
+
leftPane={<SchemaBrowser />}
|
|
323
|
+
mainPane={<SqlEditor />}
|
|
324
|
+
bottomPane={<ResultsGrid />}
|
|
325
|
+
resizable
|
|
326
|
+
/>
|
|
327
|
+
)
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
**WorkbenchBodyTemplate props:**
|
|
332
|
+
|
|
333
|
+
| Prop | Type | Description |
|
|
334
|
+
|---|---|---|
|
|
335
|
+
| `topBar` | `ReactNode` | Top bar above the workbench |
|
|
336
|
+
| `title` / `description` | `ReactNode` | Header copy above the panes |
|
|
337
|
+
| `headerRight` / `actions` | `ReactNode` | Header action slots |
|
|
338
|
+
| `leftPane` / `rightPane` | `ReactNode` | Optional side panes |
|
|
339
|
+
| `mainPane` | `ReactNode` | Primary editor or preview area |
|
|
340
|
+
| `bottomPane` | `ReactNode` | Optional result, query, or logs pane |
|
|
341
|
+
| `resizable` | `boolean` | Enables pane drag handles |
|
|
342
|
+
| `leftPaneCollapsed` / `rightPaneCollapsed` / `bottomPaneCollapsed` | `boolean` | Hides optional panes while preserving the template layout model |
|
|
343
|
+
| `leftPaneWidth` / `rightPaneWidth` / `bottomPaneHeight` | `number` | Initial pane sizes in pixels |
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
303
347
|
### FormWizardBodyTemplate
|
|
304
348
|
|
|
305
349
|
Multi-step input wizard. Wraps each step's `content` in a `<form>` element automatically.
|
|
@@ -467,6 +511,20 @@ Or via `theme` prop:
|
|
|
467
511
|
|
|
468
512
|
---
|
|
469
513
|
|
|
514
|
+
## Using with gridkit
|
|
515
|
+
|
|
516
|
+
If your app also uses `@loykin/gridkit`, import its styles **after** designkit:
|
|
517
|
+
|
|
518
|
+
```css
|
|
519
|
+
@import "tailwindcss";
|
|
520
|
+
@import "@loykin/designkit/styles";
|
|
521
|
+
@import "@loykin/gridkit/styles"; /* must come last — uses @layer gridkit */
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
gridkit registers a named `@layer gridkit`. Importing it before `tailwindcss` or `designkit/styles` causes layer ordering conflicts where utility overrides resolve incorrectly.
|
|
525
|
+
|
|
526
|
+
---
|
|
527
|
+
|
|
470
528
|
## Playground
|
|
471
529
|
|
|
472
530
|
Interactive development tool to preview templates and generate code.
|
package/dist/index.cjs
CHANGED
|
@@ -133,7 +133,11 @@ function AvatarGroupCount({ className, ...props }) {
|
|
|
133
133
|
);
|
|
134
134
|
}
|
|
135
135
|
var badgeVariants = classVarianceAuthority.cva(
|
|
136
|
-
|
|
136
|
+
// transition-all is replaced with an explicit list to prevent width animation
|
|
137
|
+
// on font swap (e.g. font-display:swap triggering a layout recalc). Inside
|
|
138
|
+
// overflow:clip containers like DataGrid cells, an animated width change makes
|
|
139
|
+
// the pill appear to grow from a clipped state. Color transitions are preserved.
|
|
140
|
+
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,opacity] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
137
141
|
{
|
|
138
142
|
variants: {
|
|
139
143
|
variant: {
|
|
@@ -2216,6 +2220,194 @@ function DashboardBodyTemplate({
|
|
|
2216
2220
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1 min-h-0 overflow-auto px-[calc(var(--dk-page-padding-x)-0.5rem)] pt-0 pb-(--dk-page-padding-y)", contentClassName), children })
|
|
2217
2221
|
] });
|
|
2218
2222
|
}
|
|
2223
|
+
function clamp(value, min, max) {
|
|
2224
|
+
return Math.min(Math.max(value, min), max);
|
|
2225
|
+
}
|
|
2226
|
+
function ResizeHandle({
|
|
2227
|
+
axis,
|
|
2228
|
+
onPointerDown,
|
|
2229
|
+
className
|
|
2230
|
+
}) {
|
|
2231
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2232
|
+
"div",
|
|
2233
|
+
{
|
|
2234
|
+
role: "separator",
|
|
2235
|
+
"aria-orientation": axis === "x" ? "vertical" : "horizontal",
|
|
2236
|
+
className: cn(
|
|
2237
|
+
"group/resize relative z-10 shrink-0 touch-none bg-transparent",
|
|
2238
|
+
axis === "x" ? "-mx-1 w-2 cursor-col-resize" : "-my-1 h-2 cursor-row-resize",
|
|
2239
|
+
className
|
|
2240
|
+
),
|
|
2241
|
+
onPointerDown,
|
|
2242
|
+
children: [
|
|
2243
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2244
|
+
"div",
|
|
2245
|
+
{
|
|
2246
|
+
className: cn(
|
|
2247
|
+
"absolute bg-border transition-colors group-hover/resize:bg-muted-foreground/40",
|
|
2248
|
+
axis === "x" ? "left-1/2 top-0 h-full w-px -translate-x-1/2" : "left-0 top-1/2 h-px w-full -translate-y-1/2"
|
|
2249
|
+
)
|
|
2250
|
+
}
|
|
2251
|
+
),
|
|
2252
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2253
|
+
"div",
|
|
2254
|
+
{
|
|
2255
|
+
className: cn(
|
|
2256
|
+
"absolute rounded-full bg-muted-foreground/35 opacity-0 transition-opacity group-hover/resize:opacity-100",
|
|
2257
|
+
axis === "x" ? "left-1/2 top-1/2 h-10 w-1 -translate-x-1/2 -translate-y-1/2" : "left-1/2 top-1/2 h-1 w-10 -translate-x-1/2 -translate-y-1/2"
|
|
2258
|
+
)
|
|
2259
|
+
}
|
|
2260
|
+
)
|
|
2261
|
+
]
|
|
2262
|
+
}
|
|
2263
|
+
);
|
|
2264
|
+
}
|
|
2265
|
+
function WorkbenchBodyTemplate({
|
|
2266
|
+
theme,
|
|
2267
|
+
className,
|
|
2268
|
+
contentClassName,
|
|
2269
|
+
title,
|
|
2270
|
+
description,
|
|
2271
|
+
topBar,
|
|
2272
|
+
headerRight,
|
|
2273
|
+
toolbar,
|
|
2274
|
+
actions,
|
|
2275
|
+
leftPane,
|
|
2276
|
+
mainPane,
|
|
2277
|
+
rightPane,
|
|
2278
|
+
bottomPane,
|
|
2279
|
+
children,
|
|
2280
|
+
resizable = true,
|
|
2281
|
+
leftPaneCollapsed,
|
|
2282
|
+
rightPaneCollapsed,
|
|
2283
|
+
bottomPaneCollapsed,
|
|
2284
|
+
leftPaneWidth = 260,
|
|
2285
|
+
rightPaneWidth = 320,
|
|
2286
|
+
bottomPaneHeight = 240,
|
|
2287
|
+
minLeftPaneWidth = 180,
|
|
2288
|
+
maxLeftPaneWidth = 440,
|
|
2289
|
+
minRightPaneWidth = 240,
|
|
2290
|
+
maxRightPaneWidth = 520,
|
|
2291
|
+
minBottomPaneHeight = 120,
|
|
2292
|
+
maxBottomPaneHeight = 420,
|
|
2293
|
+
leftPaneClassName,
|
|
2294
|
+
mainPaneClassName,
|
|
2295
|
+
rightPaneClassName,
|
|
2296
|
+
bottomPaneClassName
|
|
2297
|
+
}) {
|
|
2298
|
+
const [leftWidth, setLeftWidth] = React2.useState(leftPaneWidth);
|
|
2299
|
+
const [rightWidth, setRightWidth] = React2.useState(rightPaneWidth);
|
|
2300
|
+
const [bottomHeight, setBottomHeight] = React2.useState(bottomPaneHeight);
|
|
2301
|
+
const startResize = React2.useCallback((event, axis, applyDelta) => {
|
|
2302
|
+
if (!resizable) return;
|
|
2303
|
+
const start = axis === "x" ? event.clientX : event.clientY;
|
|
2304
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
2305
|
+
const previousCursor = document.body.style.cursor;
|
|
2306
|
+
const previousUserSelect = document.body.style.userSelect;
|
|
2307
|
+
document.body.style.cursor = axis === "x" ? "col-resize" : "row-resize";
|
|
2308
|
+
document.body.style.userSelect = "none";
|
|
2309
|
+
const onPointerMove = (moveEvent) => {
|
|
2310
|
+
applyDelta((axis === "x" ? moveEvent.clientX : moveEvent.clientY) - start);
|
|
2311
|
+
};
|
|
2312
|
+
const onPointerUp = () => {
|
|
2313
|
+
document.body.style.cursor = previousCursor;
|
|
2314
|
+
document.body.style.userSelect = previousUserSelect;
|
|
2315
|
+
window.removeEventListener("pointermove", onPointerMove);
|
|
2316
|
+
window.removeEventListener("pointerup", onPointerUp);
|
|
2317
|
+
};
|
|
2318
|
+
window.addEventListener("pointermove", onPointerMove);
|
|
2319
|
+
window.addEventListener("pointerup", onPointerUp, { once: true });
|
|
2320
|
+
}, [resizable]);
|
|
2321
|
+
const headerRightContent = headerRight ?? toolbar;
|
|
2322
|
+
const showHeader = title || description || headerRightContent || actions;
|
|
2323
|
+
const showLeftPane = leftPane && !leftPaneCollapsed;
|
|
2324
|
+
const showRightPane = rightPane && !rightPaneCollapsed;
|
|
2325
|
+
const showBottomPane = bottomPane && !bottomPaneCollapsed;
|
|
2326
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DataPage, { className: cn("layout-workbench", className), style: theme, children: [
|
|
2327
|
+
topBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: topBar }),
|
|
2328
|
+
showHeader && /* @__PURE__ */ jsxRuntime.jsx("header", { className: "shrink-0 border-b px-(--dk-page-padding-x) py-[calc(var(--dk-page-padding-y)*0.75)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-[var(--dk-toolbar-height)] items-center justify-between gap-3", children: [
|
|
2329
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
2330
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "truncate text-sm font-semibold", children: title }),
|
|
2331
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: description })
|
|
2332
|
+
] }),
|
|
2333
|
+
(headerRightContent || actions) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
2334
|
+
headerRightContent,
|
|
2335
|
+
actions
|
|
2336
|
+
] })
|
|
2337
|
+
] }) }),
|
|
2338
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex min-h-0 flex-1 overflow-hidden", contentClassName), children: [
|
|
2339
|
+
showLeftPane && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2340
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2341
|
+
"aside",
|
|
2342
|
+
{
|
|
2343
|
+
className: cn("min-h-0 shrink-0 overflow-hidden border-r bg-card/45", leftPaneClassName),
|
|
2344
|
+
style: { width: leftWidth },
|
|
2345
|
+
children: leftPane
|
|
2346
|
+
}
|
|
2347
|
+
),
|
|
2348
|
+
resizable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2349
|
+
ResizeHandle,
|
|
2350
|
+
{
|
|
2351
|
+
axis: "x",
|
|
2352
|
+
onPointerDown: (event) => {
|
|
2353
|
+
const start = leftWidth;
|
|
2354
|
+
startResize(event, "x", (delta) => {
|
|
2355
|
+
setLeftWidth(clamp(start + delta, minLeftPaneWidth, maxLeftPaneWidth));
|
|
2356
|
+
});
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
)
|
|
2360
|
+
] }),
|
|
2361
|
+
/* @__PURE__ */ jsxRuntime.jsxs("main", { className: cn("flex min-w-0 flex-1 flex-col overflow-hidden", mainPaneClassName), children: [
|
|
2362
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-hidden", children: mainPane ?? children }),
|
|
2363
|
+
showBottomPane && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2364
|
+
resizable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2365
|
+
ResizeHandle,
|
|
2366
|
+
{
|
|
2367
|
+
axis: "y",
|
|
2368
|
+
onPointerDown: (event) => {
|
|
2369
|
+
const start = bottomHeight;
|
|
2370
|
+
startResize(event, "y", (delta) => {
|
|
2371
|
+
setBottomHeight(clamp(start - delta, minBottomPaneHeight, maxBottomPaneHeight));
|
|
2372
|
+
});
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
),
|
|
2376
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2377
|
+
"section",
|
|
2378
|
+
{
|
|
2379
|
+
className: cn("min-h-0 shrink-0 overflow-hidden border-t bg-card/40", bottomPaneClassName),
|
|
2380
|
+
style: { height: bottomHeight },
|
|
2381
|
+
children: bottomPane
|
|
2382
|
+
}
|
|
2383
|
+
)
|
|
2384
|
+
] })
|
|
2385
|
+
] }),
|
|
2386
|
+
showRightPane && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2387
|
+
resizable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2388
|
+
ResizeHandle,
|
|
2389
|
+
{
|
|
2390
|
+
axis: "x",
|
|
2391
|
+
onPointerDown: (event) => {
|
|
2392
|
+
const start = rightWidth;
|
|
2393
|
+
startResize(event, "x", (delta) => {
|
|
2394
|
+
setRightWidth(clamp(start - delta, minRightPaneWidth, maxRightPaneWidth));
|
|
2395
|
+
});
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
),
|
|
2399
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2400
|
+
"aside",
|
|
2401
|
+
{
|
|
2402
|
+
className: cn("min-h-0 shrink-0 overflow-hidden border-l bg-card/45", rightPaneClassName),
|
|
2403
|
+
style: { width: rightWidth },
|
|
2404
|
+
children: rightPane
|
|
2405
|
+
}
|
|
2406
|
+
)
|
|
2407
|
+
] })
|
|
2408
|
+
] })
|
|
2409
|
+
] });
|
|
2410
|
+
}
|
|
2219
2411
|
function DataBodyTab(_props) {
|
|
2220
2412
|
return null;
|
|
2221
2413
|
}
|
|
@@ -2288,12 +2480,13 @@ function renderGroupProps(props) {
|
|
|
2288
2480
|
description,
|
|
2289
2481
|
actions,
|
|
2290
2482
|
danger,
|
|
2483
|
+
className,
|
|
2291
2484
|
children
|
|
2292
2485
|
} = props;
|
|
2293
2486
|
const variant = variantProp ?? layoutDefaultVariant[layout];
|
|
2294
2487
|
if (layout === "split") {
|
|
2295
2488
|
const panes = React2.Children.toArray(children);
|
|
2296
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-(--dk-panel-gap)", children: [
|
|
2489
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("py-(--dk-panel-gap)", className), children: [
|
|
2297
2490
|
(title || description || actions) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3 flex items-start justify-between", children: [
|
|
2298
2491
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2299
2492
|
title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
|
|
@@ -2305,7 +2498,7 @@ function renderGroupProps(props) {
|
|
|
2305
2498
|
] });
|
|
2306
2499
|
}
|
|
2307
2500
|
if (layout === "horizontal") {
|
|
2308
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-[calc(var(--dk-panel-gap)*2)] py-(--dk-panel-gap)", children: [
|
|
2501
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("grid grid-cols-3 gap-[calc(var(--dk-panel-gap)*2)] py-(--dk-panel-gap)", className), children: [
|
|
2309
2502
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2310
2503
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-sm font-medium", danger && "text-destructive"), children: title }),
|
|
2311
2504
|
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: description }),
|
|
@@ -2315,7 +2508,7 @@ function renderGroupProps(props) {
|
|
|
2315
2508
|
] });
|
|
2316
2509
|
}
|
|
2317
2510
|
if (layout === "inline") {
|
|
2318
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-(--dk-panel-gap)", children: [
|
|
2511
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("py-(--dk-panel-gap)", className), children: [
|
|
2319
2512
|
(title || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-start justify-between", children: [
|
|
2320
2513
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2321
2514
|
title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
|
|
@@ -2326,7 +2519,7 @@ function renderGroupProps(props) {
|
|
|
2326
2519
|
/* @__PURE__ */ jsxRuntime.jsx(GroupWrapper, { layout, variant, children })
|
|
2327
2520
|
] });
|
|
2328
2521
|
}
|
|
2329
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-(--dk-panel-gap)", children: [
|
|
2522
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("py-(--dk-panel-gap)", className), children: [
|
|
2330
2523
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between", children: [
|
|
2331
2524
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2332
2525
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
|
|
@@ -2562,8 +2755,8 @@ function BrowseBodyTemplate({
|
|
|
2562
2755
|
{
|
|
2563
2756
|
className: cn(
|
|
2564
2757
|
"min-w-0 flex-1 overflow-hidden px-(--dk-page-padding-x) py-(--dk-page-padding-y)",
|
|
2565
|
-
"[&_.
|
|
2566
|
-
"[&_.
|
|
2758
|
+
"[&_.gridkit-shell]:h-full [&_.gridkit-table-stack]:flex-1 [&_.gridkit-table-stack]:min-h-0",
|
|
2759
|
+
"[&_.gridkit-frame]:flex-1 [&_.gridkit-frame]:min-h-0 [&_.gridkit-frame]:overflow-auto",
|
|
2567
2760
|
contentClassName
|
|
2568
2761
|
),
|
|
2569
2762
|
children
|
|
@@ -2772,6 +2965,52 @@ var DetailBodyTemplate = Object.assign(DetailBodyTemplateRoot, {
|
|
|
2772
2965
|
Tab: DetailBodyTab,
|
|
2773
2966
|
Section: DetailBodySection
|
|
2774
2967
|
});
|
|
2968
|
+
function ListDetailBodyTemplate({
|
|
2969
|
+
theme,
|
|
2970
|
+
className,
|
|
2971
|
+
topBar,
|
|
2972
|
+
list,
|
|
2973
|
+
detail,
|
|
2974
|
+
emptyDetail,
|
|
2975
|
+
listWidth = 320,
|
|
2976
|
+
listClassName,
|
|
2977
|
+
detailClassName
|
|
2978
|
+
}) {
|
|
2979
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2980
|
+
DataPage,
|
|
2981
|
+
{
|
|
2982
|
+
className: cn("layout-list-detail", className),
|
|
2983
|
+
style: { "--ld-list-width": `${listWidth}px`, ...theme },
|
|
2984
|
+
children: [
|
|
2985
|
+
topBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: topBar }),
|
|
2986
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
|
|
2987
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2988
|
+
"aside",
|
|
2989
|
+
{
|
|
2990
|
+
className: cn(
|
|
2991
|
+
"min-h-0 shrink-0 overflow-hidden border-r",
|
|
2992
|
+
detail ? "hidden lg:flex lg:w-[var(--ld-list-width)] lg:flex-col" : "flex w-full flex-col lg:w-[var(--ld-list-width)]",
|
|
2993
|
+
listClassName
|
|
2994
|
+
),
|
|
2995
|
+
children: list
|
|
2996
|
+
}
|
|
2997
|
+
),
|
|
2998
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2999
|
+
"main",
|
|
3000
|
+
{
|
|
3001
|
+
className: cn(
|
|
3002
|
+
"min-h-0 min-w-0 flex-1 overflow-auto",
|
|
3003
|
+
!detail && "hidden lg:block",
|
|
3004
|
+
detailClassName
|
|
3005
|
+
),
|
|
3006
|
+
children: detail ?? emptyDetail
|
|
3007
|
+
}
|
|
3008
|
+
)
|
|
3009
|
+
] })
|
|
3010
|
+
]
|
|
3011
|
+
}
|
|
3012
|
+
);
|
|
3013
|
+
}
|
|
2775
3014
|
function FormWizardBodyTemplate({
|
|
2776
3015
|
theme,
|
|
2777
3016
|
title,
|
|
@@ -3423,7 +3662,7 @@ function buildTokenMap({
|
|
|
3423
3662
|
const c = (factor) => (primaryChroma * factor).toFixed(4);
|
|
3424
3663
|
return {
|
|
3425
3664
|
"--dk-radius": `${radius}rem`,
|
|
3426
|
-
"--
|
|
3665
|
+
"--gridkit-radius": `${radius}rem`,
|
|
3427
3666
|
"--radius": `${radius}rem`,
|
|
3428
3667
|
"--radius-sm": `${(radius * 0.6).toFixed(4)}rem`,
|
|
3429
3668
|
"--radius-md": `${(radius * 0.8).toFixed(4)}rem`,
|
|
@@ -3434,9 +3673,9 @@ function buildTokenMap({
|
|
|
3434
3673
|
"--dk-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
|
|
3435
3674
|
"--dk-primary-foreground": "oklch(0.985 0 0)",
|
|
3436
3675
|
"--dk-ring": `oklch(0.50 ${primaryChroma} ${primaryHue})`,
|
|
3437
|
-
"--
|
|
3438
|
-
"--
|
|
3439
|
-
"--
|
|
3676
|
+
"--gridkit-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
|
|
3677
|
+
"--gridkit-primary-foreground": "oklch(0.985 0 0)",
|
|
3678
|
+
"--gridkit-ring": `oklch(0.50 ${primaryChroma} ${primaryHue})`,
|
|
3440
3679
|
"--primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
|
|
3441
3680
|
"--primary-foreground": "oklch(0.985 0 0)",
|
|
3442
3681
|
"--color-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
|
|
@@ -3459,8 +3698,8 @@ function buildTokenMap({
|
|
|
3459
3698
|
"--dk-border": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
|
|
3460
3699
|
"--dk-input": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
|
|
3461
3700
|
"--dk-muted": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
|
|
3462
|
-
"--
|
|
3463
|
-
"--
|
|
3701
|
+
"--gridkit-border": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
|
|
3702
|
+
"--gridkit-muted": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
|
|
3464
3703
|
"--dk-font-scale": fontScale,
|
|
3465
3704
|
"--dk-line-height": lineHeight,
|
|
3466
3705
|
"--dk-density": densityValues.density,
|
|
@@ -3505,8 +3744,8 @@ function buildDarkTonalTokens(primaryHue, primaryChroma) {
|
|
|
3505
3744
|
"--dk-border": `oklch(0.32 ${c(0.06)} ${primaryHue})`,
|
|
3506
3745
|
"--dk-input": `oklch(0.35 ${c(0.06)} ${primaryHue})`,
|
|
3507
3746
|
"--dk-muted": `oklch(0.269 ${c(0.03)} ${primaryHue})`,
|
|
3508
|
-
"--
|
|
3509
|
-
"--
|
|
3747
|
+
"--gridkit-border": `oklch(0.32 ${c(0.06)} ${primaryHue})`,
|
|
3748
|
+
"--gridkit-muted": `oklch(0.269 ${c(0.03)} ${primaryHue})`
|
|
3510
3749
|
};
|
|
3511
3750
|
}
|
|
3512
3751
|
function tokenMapToCss(tokens) {
|
|
@@ -3559,7 +3798,7 @@ ${tokenMapToCss(tokens)}
|
|
|
3559
3798
|
}, [g.density]);
|
|
3560
3799
|
}
|
|
3561
3800
|
function buildTemplateTheme(g, ov = {}) {
|
|
3562
|
-
|
|
3801
|
+
const tokens = buildTokenMap({
|
|
3563
3802
|
radius: ov.radius ?? g.radius,
|
|
3564
3803
|
primaryHue: g.primaryHue,
|
|
3565
3804
|
primaryChroma: ov.primaryChroma ?? g.primaryChroma,
|
|
@@ -3570,6 +3809,10 @@ function buildTemplateTheme(g, ov = {}) {
|
|
|
3570
3809
|
fontScale: g.fontScale ?? 1,
|
|
3571
3810
|
lineHeight: g.lineHeight ?? 1
|
|
3572
3811
|
});
|
|
3812
|
+
if (g.darkMode) {
|
|
3813
|
+
Object.assign(tokens, buildDarkTonalTokens(g.primaryHue, ov.primaryChroma ?? g.primaryChroma));
|
|
3814
|
+
}
|
|
3815
|
+
return tokens;
|
|
3573
3816
|
}
|
|
3574
3817
|
|
|
3575
3818
|
exports.Avatar = Avatar;
|
|
@@ -3614,6 +3857,7 @@ exports.EmptyState = EmptyState;
|
|
|
3614
3857
|
exports.FormWizardBodyTemplate = FormWizardBodyTemplate;
|
|
3615
3858
|
exports.Input = Input;
|
|
3616
3859
|
exports.Label = Label;
|
|
3860
|
+
exports.ListDetailBodyTemplate = ListDetailBodyTemplate;
|
|
3617
3861
|
exports.LoginBodyTemplate = LoginBodyTemplate;
|
|
3618
3862
|
exports.NavigationMenu = NavigationMenu;
|
|
3619
3863
|
exports.NavigationMenuContent = NavigationMenuContent;
|
|
@@ -3695,6 +3939,7 @@ exports.TooltipContent = TooltipContent;
|
|
|
3695
3939
|
exports.TooltipProvider = TooltipProvider;
|
|
3696
3940
|
exports.TooltipTrigger = TooltipTrigger;
|
|
3697
3941
|
exports.TypographyBodyTemplate = TypographyBodyTemplate;
|
|
3942
|
+
exports.WorkbenchBodyTemplate = WorkbenchBodyTemplate;
|
|
3698
3943
|
exports.badgeVariants = badgeVariants;
|
|
3699
3944
|
exports.buildTemplateTheme = buildTemplateTheme;
|
|
3700
3945
|
exports.buildTopBar = buildTopBar;
|