@loykin/designkit 0.0.1-dev.1 → 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/dist/index.cjs CHANGED
@@ -133,7 +133,11 @@ function AvatarGroupCount({ className, ...props }) {
133
133
  );
134
134
  }
135
135
  var badgeVariants = classVarianceAuthority.cva(
136
- "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-all 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!",
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: {
@@ -2151,6 +2155,259 @@ var DataPage = Object.assign(Root, {
2151
2155
  GroupBody,
2152
2156
  Footer
2153
2157
  });
2158
+ var DashboardPanel = React2.forwardRef(function DashboardPanel2({
2159
+ title,
2160
+ description,
2161
+ loading,
2162
+ error,
2163
+ transparent,
2164
+ editable,
2165
+ className,
2166
+ style,
2167
+ children,
2168
+ headerRight
2169
+ }, ref) {
2170
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2171
+ "div",
2172
+ {
2173
+ ref,
2174
+ className: cn(
2175
+ "group flex h-full flex-col overflow-hidden",
2176
+ transparent ? "" : "rounded-(--radius) border bg-card text-card-foreground",
2177
+ editable && "ring-1 ring-border/60 ring-inset",
2178
+ className
2179
+ ),
2180
+ style,
2181
+ children: [
2182
+ (title || headerRight || editable) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2 pl-3 pr-1.5 py-2", children: [
2183
+ editable && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 cursor-grab active:cursor-grabbing select-none text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors -ml-1 px-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GripHorizontal, { className: "h-3.5 w-3.5" }) }),
2184
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
2185
+ title && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-xs font-medium text-card-foreground", children: title }),
2186
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-[11px] text-muted-foreground", children: description })
2187
+ ] }),
2188
+ headerRight && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity duration-150", children: headerRight })
2189
+ ] }),
2190
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 min-h-0 p-3", children: [
2191
+ loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-card/70 z-10", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }) }),
2192
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive", children: error }) }),
2193
+ !error && children
2194
+ ] })
2195
+ ]
2196
+ }
2197
+ );
2198
+ });
2199
+ function DashboardBodyTemplate({
2200
+ theme,
2201
+ className,
2202
+ title,
2203
+ description,
2204
+ topBar,
2205
+ toolbar,
2206
+ variableBar,
2207
+ children,
2208
+ contentClassName
2209
+ }) {
2210
+ return /* @__PURE__ */ jsxRuntime.jsxs(DataPage, { className: cn("layout-dashboard", className), style: theme, children: [
2211
+ topBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: topBar }),
2212
+ (title || toolbar) && /* @__PURE__ */ jsxRuntime.jsx("header", { className: "shrink-0 border-b px-(--dk-page-padding-x) py-(--dk-page-padding-y)", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
2213
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
2214
+ title && /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-sm font-semibold truncate", children: title }),
2215
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
2216
+ ] }),
2217
+ toolbar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 shrink-0", children: toolbar })
2218
+ ] }) }),
2219
+ variableBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 flex flex-wrap items-center gap-2 px-(--dk-page-padding-x) py-1.5", children: variableBar }),
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 })
2221
+ ] });
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
+ }
2154
2411
  function DataBodyTab(_props) {
2155
2412
  return null;
2156
2413
  }
@@ -2223,12 +2480,13 @@ function renderGroupProps(props) {
2223
2480
  description,
2224
2481
  actions,
2225
2482
  danger,
2483
+ className,
2226
2484
  children
2227
2485
  } = props;
2228
2486
  const variant = variantProp ?? layoutDefaultVariant[layout];
2229
2487
  if (layout === "split") {
2230
2488
  const panes = React2.Children.toArray(children);
2231
- 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: [
2232
2490
  (title || description || actions) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3 flex items-start justify-between", children: [
2233
2491
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2234
2492
  title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
@@ -2240,7 +2498,7 @@ function renderGroupProps(props) {
2240
2498
  ] });
2241
2499
  }
2242
2500
  if (layout === "horizontal") {
2243
- 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: [
2244
2502
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2245
2503
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-sm font-medium", danger && "text-destructive"), children: title }),
2246
2504
  description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: description }),
@@ -2250,7 +2508,7 @@ function renderGroupProps(props) {
2250
2508
  ] });
2251
2509
  }
2252
2510
  if (layout === "inline") {
2253
- 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: [
2254
2512
  (title || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-start justify-between", children: [
2255
2513
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2256
2514
  title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
@@ -2261,7 +2519,7 @@ function renderGroupProps(props) {
2261
2519
  /* @__PURE__ */ jsxRuntime.jsx(GroupWrapper, { layout, variant, children })
2262
2520
  ] });
2263
2521
  }
2264
- 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: [
2265
2523
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between", children: [
2266
2524
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2267
2525
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
@@ -2429,6 +2687,330 @@ var DataBodyTemplate = Object.assign(Root2, {
2429
2687
  Row: DataBodyRow,
2430
2688
  Field: DataBodyField
2431
2689
  });
2690
+ function useIsNarrow() {
2691
+ const [narrow, setNarrow] = React2.useState(false);
2692
+ React2.useEffect(() => {
2693
+ const mql = window.matchMedia("(max-width: 1023px)");
2694
+ setNarrow(mql.matches);
2695
+ const handler = (e) => setNarrow(e.matches);
2696
+ mql.addEventListener("change", handler);
2697
+ return () => mql.removeEventListener("change", handler);
2698
+ }, []);
2699
+ return narrow;
2700
+ }
2701
+ function BrowseBodyTemplate({
2702
+ theme,
2703
+ className,
2704
+ topBar,
2705
+ title,
2706
+ description,
2707
+ actions,
2708
+ sidebar,
2709
+ sidebarTitle = "Filters",
2710
+ sidebarWidth = "18rem",
2711
+ toolbar,
2712
+ footer,
2713
+ contentClassName,
2714
+ children
2715
+ }) {
2716
+ const isNarrow = useIsNarrow();
2717
+ const hasHeader = title || description || actions;
2718
+ return /* @__PURE__ */ jsxRuntime.jsxs(DataPage, { className: cn("layout-browse", className), style: theme, children: [
2719
+ topBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: topBar }),
2720
+ hasHeader && /* @__PURE__ */ jsxRuntime.jsxs(DataPage.Header, { children: [
2721
+ /* @__PURE__ */ jsxRuntime.jsx(DataPage.TitleBlock, { title, description }),
2722
+ /* @__PURE__ */ jsxRuntime.jsx(DataPage.Actions, { children: actions })
2723
+ ] }),
2724
+ /* @__PURE__ */ jsxRuntime.jsxs(DataPage.Content, { padding: "none", className: "flex flex-col overflow-hidden", children: [
2725
+ (toolbar || isNarrow) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b px-(--dk-page-padding-x) py-2", children: [
2726
+ isNarrow && /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
2727
+ /* @__PURE__ */ jsxRuntime.jsxs(
2728
+ SheetTrigger,
2729
+ {
2730
+ render: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "sm", className: "shrink-0 gap-1.5" }),
2731
+ children: [
2732
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SlidersHorizontal, { className: "h-3.5 w-3.5" }),
2733
+ sidebarTitle
2734
+ ]
2735
+ }
2736
+ ),
2737
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "left", className: "flex flex-col gap-0 p-0", children: [
2738
+ /* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: sidebarTitle }) }),
2739
+ /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: sidebar }) })
2740
+ ] })
2741
+ ] }),
2742
+ toolbar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: toolbar })
2743
+ ] }),
2744
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
2745
+ !isNarrow && /* @__PURE__ */ jsxRuntime.jsx(
2746
+ "aside",
2747
+ {
2748
+ className: "shrink-0 overflow-hidden border-r",
2749
+ style: { width: sidebarWidth },
2750
+ children: /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-(--dk-page-padding-x) py-(--dk-page-padding-y)", children: sidebar }) })
2751
+ }
2752
+ ),
2753
+ /* @__PURE__ */ jsxRuntime.jsx(
2754
+ "div",
2755
+ {
2756
+ className: cn(
2757
+ "min-w-0 flex-1 overflow-hidden px-(--dk-page-padding-x) py-(--dk-page-padding-y)",
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",
2760
+ contentClassName
2761
+ ),
2762
+ children
2763
+ }
2764
+ )
2765
+ ] })
2766
+ ] }),
2767
+ footer && /* @__PURE__ */ jsxRuntime.jsx(DataPage.Footer, { children: footer })
2768
+ ] });
2769
+ }
2770
+ function DetailBodyHeader({
2771
+ eyebrow,
2772
+ title,
2773
+ description,
2774
+ status,
2775
+ actions,
2776
+ compact,
2777
+ className
2778
+ }) {
2779
+ return /* @__PURE__ */ jsxRuntime.jsxs(DataPage.Header, { className, children: [
2780
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
2781
+ eyebrow && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: eyebrow }),
2782
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
2783
+ title && /* @__PURE__ */ jsxRuntime.jsx("h1", { className: cn("min-w-0 truncate font-semibold", compact ? "text-base" : "text-lg"), children: title }),
2784
+ status && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: status })
2785
+ ] }),
2786
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
2787
+ ] }),
2788
+ /* @__PURE__ */ jsxRuntime.jsx(DataPage.Actions, { children: actions })
2789
+ ] });
2790
+ }
2791
+ function DetailBodyTab(_props) {
2792
+ return null;
2793
+ }
2794
+ function isDetailBodyTab(node) {
2795
+ return Boolean(node && typeof node === "object" && "type" in node && node.type === DetailBodyTab);
2796
+ }
2797
+ function DetailBodySection({
2798
+ title,
2799
+ description,
2800
+ actions,
2801
+ surface = "plain",
2802
+ className,
2803
+ children
2804
+ }) {
2805
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2806
+ "section",
2807
+ {
2808
+ className: cn(
2809
+ "min-h-0",
2810
+ surface === "card" && "rounded-(--radius) border bg-card p-(--dk-panel-gap) text-card-foreground shadow-sm",
2811
+ surface === "bordered" && "rounded-(--radius) border p-(--dk-panel-gap)",
2812
+ className
2813
+ ),
2814
+ children: [
2815
+ (title || description || actions) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3 flex items-start justify-between gap-3", children: [
2816
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
2817
+ title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-sm font-semibold", children: title }),
2818
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
2819
+ ] }),
2820
+ actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: actions })
2821
+ ] }),
2822
+ children
2823
+ ]
2824
+ }
2825
+ );
2826
+ }
2827
+ function renderChildren(nodes) {
2828
+ return React2.Children.toArray(nodes).map((child, i) => /* @__PURE__ */ jsxRuntime.jsx(React2.Fragment, { children: child }, i));
2829
+ }
2830
+ function DetailBodyTemplateRoot({
2831
+ variant = "record",
2832
+ theme,
2833
+ className,
2834
+ topBar,
2835
+ header,
2836
+ lead,
2837
+ eyebrow,
2838
+ title,
2839
+ description,
2840
+ status,
2841
+ actions,
2842
+ media,
2843
+ aside,
2844
+ summary,
2845
+ stickyAside = true,
2846
+ contentClassName,
2847
+ mediaClassName,
2848
+ asideClassName,
2849
+ children
2850
+ }) {
2851
+ const childArray = React2.useMemo(() => React2.Children.toArray(children), [children]);
2852
+ const tabs = childArray.filter(isDetailBodyTab);
2853
+ const hasTabs = tabs.length > 0;
2854
+ const [activeTab, setActiveTab] = React2.useState(() => tabs[0]?.props.id ?? "");
2855
+ const selectedTab = tabs.find((tab) => tab.props.id === activeTab) ?? tabs[0];
2856
+ const summarySlot = summary ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 rounded-(--radius) border bg-card p-(--dk-panel-gap) text-card-foreground", children: summary }) : null;
2857
+ const mediaSlot = media ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("min-h-0 overflow-hidden rounded-(--radius) border bg-card", mediaClassName), children: media }) : null;
2858
+ const leadGridClass = variant === "media" ? "xl:grid-cols-[minmax(0,1.35fr)_minmax(18rem,0.65fr)]" : "xl:grid-cols-2";
2859
+ const defaultHeader = eyebrow || title || description || status || actions ? /* @__PURE__ */ jsxRuntime.jsx(
2860
+ DetailBodyHeader,
2861
+ {
2862
+ eyebrow,
2863
+ title,
2864
+ description,
2865
+ status,
2866
+ actions
2867
+ }
2868
+ ) : null;
2869
+ const defaultLead = media || summary ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("grid gap-(--dk-panel-gap)", leadGridClass), children: [
2870
+ mediaSlot,
2871
+ summarySlot
2872
+ ] }) : null;
2873
+ const body = hasTabs ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-0", children: [
2874
+ /* @__PURE__ */ jsxRuntime.jsx(DataPage.Tabs, { children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(
2875
+ DataPage.Tab,
2876
+ {
2877
+ active: (selectedTab?.props.id ?? "") === tab.props.id,
2878
+ count: tab.props.count,
2879
+ disabled: tab.props.disabled,
2880
+ onClick: () => setActiveTab(tab.props.id),
2881
+ children: tab.props.label
2882
+ },
2883
+ tab.props.id
2884
+ )) }),
2885
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-(--dk-panel-gap)", children: selectedTab?.props.children })
2886
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-(--dk-panel-gap)", children: renderChildren(children) });
2887
+ const leadSlot = lead ?? defaultLead;
2888
+ const outsideAsideSlot = variant === "full" ? null : aside;
2889
+ const insideAsideSlot = variant === "full" ? aside : null;
2890
+ const hasRecordInspector = Boolean(leadSlot);
2891
+ const hasFullLeadArea = Boolean(leadSlot || insideAsideSlot);
2892
+ const layout = {
2893
+ media: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2894
+ leadSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-(--dk-panel-gap)", children: leadSlot }),
2895
+ body
2896
+ ] }),
2897
+ record: /* @__PURE__ */ jsxRuntime.jsxs(
2898
+ "div",
2899
+ {
2900
+ className: cn(
2901
+ "grid gap-(--dk-panel-gap)",
2902
+ hasRecordInspector && "xl:grid-cols-[minmax(28rem,1fr)_minmax(14rem,18rem)]"
2903
+ ),
2904
+ children: [
2905
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: body }),
2906
+ hasRecordInspector && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-(--dk-panel-gap)", children: leadSlot })
2907
+ ]
2908
+ }
2909
+ ),
2910
+ full: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2911
+ hasFullLeadArea && /* @__PURE__ */ jsxRuntime.jsxs(
2912
+ "div",
2913
+ {
2914
+ className: cn(
2915
+ "mb-(--dk-panel-gap) grid gap-(--dk-panel-gap)",
2916
+ insideAsideSlot && "xl:grid-cols-[minmax(0,1fr)_minmax(18rem,24rem)]"
2917
+ ),
2918
+ children: [
2919
+ leadSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-(--dk-panel-gap)", children: leadSlot }),
2920
+ insideAsideSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("min-h-0 rounded-(--radius) border bg-card p-(--dk-panel-gap)", asideClassName), children: insideAsideSlot })
2921
+ ]
2922
+ }
2923
+ ),
2924
+ body
2925
+ ] })
2926
+ };
2927
+ return /* @__PURE__ */ jsxRuntime.jsxs(DataPage, { className: cn("layout-detail", className), style: theme, "data-detail-variant": variant, children: [
2928
+ topBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: topBar }),
2929
+ header ?? defaultHeader,
2930
+ /* @__PURE__ */ jsxRuntime.jsx(DataPage.Content, { padding: "none", className: "overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs(
2931
+ "div",
2932
+ {
2933
+ className: cn(
2934
+ "grid h-full min-h-0 grid-cols-1 overflow-hidden",
2935
+ outsideAsideSlot && "lg:grid-cols-[minmax(0,1fr)_minmax(18rem,24rem)]"
2936
+ ),
2937
+ children: [
2938
+ /* @__PURE__ */ jsxRuntime.jsx(
2939
+ "main",
2940
+ {
2941
+ className: cn(
2942
+ "min-h-0 overflow-auto px-(--dk-page-padding-x) py-(--dk-page-padding-y)",
2943
+ contentClassName
2944
+ ),
2945
+ children: layout[variant]
2946
+ }
2947
+ ),
2948
+ outsideAsideSlot && /* @__PURE__ */ jsxRuntime.jsx("aside", { className: cn("min-h-0 border-t bg-background lg:border-l lg:border-t-0", asideClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
2949
+ "div",
2950
+ {
2951
+ className: cn(
2952
+ "px-(--dk-page-padding-x) py-(--dk-page-padding-y)",
2953
+ stickyAside && "lg:sticky lg:top-0"
2954
+ ),
2955
+ children: outsideAsideSlot
2956
+ }
2957
+ ) })
2958
+ ]
2959
+ }
2960
+ ) })
2961
+ ] });
2962
+ }
2963
+ var DetailBodyTemplate = Object.assign(DetailBodyTemplateRoot, {
2964
+ Header: DetailBodyHeader,
2965
+ Tab: DetailBodyTab,
2966
+ Section: DetailBodySection
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
+ }
2432
3014
  function FormWizardBodyTemplate({
2433
3015
  theme,
2434
3016
  title,
@@ -3080,7 +3662,7 @@ function buildTokenMap({
3080
3662
  const c = (factor) => (primaryChroma * factor).toFixed(4);
3081
3663
  return {
3082
3664
  "--dk-radius": `${radius}rem`,
3083
- "--dg-radius": `${radius}rem`,
3665
+ "--gridkit-radius": `${radius}rem`,
3084
3666
  "--radius": `${radius}rem`,
3085
3667
  "--radius-sm": `${(radius * 0.6).toFixed(4)}rem`,
3086
3668
  "--radius-md": `${(radius * 0.8).toFixed(4)}rem`,
@@ -3091,9 +3673,9 @@ function buildTokenMap({
3091
3673
  "--dk-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
3092
3674
  "--dk-primary-foreground": "oklch(0.985 0 0)",
3093
3675
  "--dk-ring": `oklch(0.50 ${primaryChroma} ${primaryHue})`,
3094
- "--dg-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
3095
- "--dg-primary-foreground": "oklch(0.985 0 0)",
3096
- "--dg-ring": `oklch(0.50 ${primaryChroma} ${primaryHue})`,
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})`,
3097
3679
  "--primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
3098
3680
  "--primary-foreground": "oklch(0.985 0 0)",
3099
3681
  "--color-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
@@ -3116,8 +3698,8 @@ function buildTokenMap({
3116
3698
  "--dk-border": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
3117
3699
  "--dk-input": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
3118
3700
  "--dk-muted": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
3119
- "--dg-border": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
3120
- "--dg-muted": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
3701
+ "--gridkit-border": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
3702
+ "--gridkit-muted": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
3121
3703
  "--dk-font-scale": fontScale,
3122
3704
  "--dk-line-height": lineHeight,
3123
3705
  "--dk-density": densityValues.density,
@@ -3162,8 +3744,8 @@ function buildDarkTonalTokens(primaryHue, primaryChroma) {
3162
3744
  "--dk-border": `oklch(0.32 ${c(0.06)} ${primaryHue})`,
3163
3745
  "--dk-input": `oklch(0.35 ${c(0.06)} ${primaryHue})`,
3164
3746
  "--dk-muted": `oklch(0.269 ${c(0.03)} ${primaryHue})`,
3165
- "--dg-border": `oklch(0.32 ${c(0.06)} ${primaryHue})`,
3166
- "--dg-muted": `oklch(0.269 ${c(0.03)} ${primaryHue})`
3747
+ "--gridkit-border": `oklch(0.32 ${c(0.06)} ${primaryHue})`,
3748
+ "--gridkit-muted": `oklch(0.269 ${c(0.03)} ${primaryHue})`
3167
3749
  };
3168
3750
  }
3169
3751
  function tokenMapToCss(tokens) {
@@ -3216,7 +3798,7 @@ ${tokenMapToCss(tokens)}
3216
3798
  }, [g.density]);
3217
3799
  }
3218
3800
  function buildTemplateTheme(g, ov = {}) {
3219
- return buildTokenMap({
3801
+ const tokens = buildTokenMap({
3220
3802
  radius: ov.radius ?? g.radius,
3221
3803
  primaryHue: g.primaryHue,
3222
3804
  primaryChroma: ov.primaryChroma ?? g.primaryChroma,
@@ -3227,6 +3809,10 @@ function buildTemplateTheme(g, ov = {}) {
3227
3809
  fontScale: g.fontScale ?? 1,
3228
3810
  lineHeight: g.lineHeight ?? 1
3229
3811
  });
3812
+ if (g.darkMode) {
3813
+ Object.assign(tokens, buildDarkTonalTokens(g.primaryHue, ov.primaryChroma ?? g.primaryChroma));
3814
+ }
3815
+ return tokens;
3230
3816
  }
3231
3817
 
3232
3818
  exports.Avatar = Avatar;
@@ -3236,6 +3822,7 @@ exports.AvatarGroup = AvatarGroup;
3236
3822
  exports.AvatarGroupCount = AvatarGroupCount;
3237
3823
  exports.AvatarImage = AvatarImage;
3238
3824
  exports.Badge = Badge;
3825
+ exports.BrowseBodyTemplate = BrowseBodyTemplate;
3239
3826
  exports.Button = Button;
3240
3827
  exports.Card = Card;
3241
3828
  exports.CardAction = CardAction;
@@ -3246,8 +3833,11 @@ exports.CardHeader = CardHeader;
3246
3833
  exports.CardTitle = CardTitle;
3247
3834
  exports.Checkbox = Checkbox;
3248
3835
  exports.ColorsBodyTemplate = ColorsBodyTemplate;
3836
+ exports.DashboardBodyTemplate = DashboardBodyTemplate;
3837
+ exports.DashboardPanel = DashboardPanel;
3249
3838
  exports.DataBodyTemplate = DataBodyTemplate;
3250
3839
  exports.DataPage = DataPage;
3840
+ exports.DetailBodyTemplate = DetailBodyTemplate;
3251
3841
  exports.DropdownMenu = DropdownMenu;
3252
3842
  exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
3253
3843
  exports.DropdownMenuContent = DropdownMenuContent;
@@ -3267,6 +3857,7 @@ exports.EmptyState = EmptyState;
3267
3857
  exports.FormWizardBodyTemplate = FormWizardBodyTemplate;
3268
3858
  exports.Input = Input;
3269
3859
  exports.Label = Label;
3860
+ exports.ListDetailBodyTemplate = ListDetailBodyTemplate;
3270
3861
  exports.LoginBodyTemplate = LoginBodyTemplate;
3271
3862
  exports.NavigationMenu = NavigationMenu;
3272
3863
  exports.NavigationMenuContent = NavigationMenuContent;
@@ -3348,6 +3939,7 @@ exports.TooltipContent = TooltipContent;
3348
3939
  exports.TooltipProvider = TooltipProvider;
3349
3940
  exports.TooltipTrigger = TooltipTrigger;
3350
3941
  exports.TypographyBodyTemplate = TypographyBodyTemplate;
3942
+ exports.WorkbenchBodyTemplate = WorkbenchBodyTemplate;
3351
3943
  exports.badgeVariants = badgeVariants;
3352
3944
  exports.buildTemplateTheme = buildTemplateTheme;
3353
3945
  exports.buildTopBar = buildTopBar;