@loykin/designkit 0.0.1-dev.2 → 0.0.1-dev.4

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.js CHANGED
@@ -7,7 +7,7 @@ import { useRender } from '@base-ui/react/use-render';
7
7
  import { cva } from 'class-variance-authority';
8
8
  import { Button as Button$1 } from '@base-ui/react/button';
9
9
  import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
10
- import { GripHorizontal, CheckIcon, ChevronRightIcon, ChevronDownIcon, ChevronUpIcon, XIcon, PanelLeftIcon, SlidersHorizontal, Check } from 'lucide-react';
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, useEffect } from 'react';
20
+ import React2__default, { forwardRef, useMemo, Children, useState, Fragment, useCallback, useEffect } 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';
@@ -112,7 +112,11 @@ function AvatarGroupCount({ className, ...props }) {
112
112
  );
113
113
  }
114
114
  var badgeVariants = cva(
115
- "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!",
115
+ // transition-all is replaced with an explicit list to prevent width animation
116
+ // on font swap (e.g. font-display:swap triggering a layout recalc). Inside
117
+ // overflow:clip containers like DataGrid cells, an animated width change makes
118
+ // the pill appear to grow from a clipped state. Color transitions are preserved.
119
+ "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!",
116
120
  {
117
121
  variants: {
118
122
  variant: {
@@ -1731,6 +1735,9 @@ function SidebarMenuSubButton({
1731
1735
  }
1732
1736
  });
1733
1737
  }
1738
+ function useSidebarOptional() {
1739
+ return React2.useContext(SidebarContext);
1740
+ }
1734
1741
  function EmptyState({ icon: Icon, title, description, action, className }) {
1735
1742
  return /* @__PURE__ */ jsxs(
1736
1743
  "div",
@@ -1985,10 +1992,10 @@ function Header({ children, className }) {
1985
1992
  {
1986
1993
  "data-slot": "data-page-header",
1987
1994
  className: cn(
1988
- "shrink-0 px-[var(--dk-page-padding-x)] pt-[var(--dk-page-padding-y)]",
1995
+ "shrink-0 px-[var(--designkit-page-padding-x)] pt-[var(--designkit-page-padding-y)]",
1989
1996
  className
1990
1997
  ),
1991
- children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between gap-[var(--dk-panel-gap)]", children })
1998
+ children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center justify-between gap-[var(--designkit-panel-gap)]", children })
1992
1999
  }
1993
2000
  );
1994
2001
  }
@@ -2006,7 +2013,7 @@ function Actions({ children, className }) {
2006
2013
  "div",
2007
2014
  {
2008
2015
  "data-slot": "data-page-actions",
2009
- className: cn("flex shrink-0 items-center gap-[calc(var(--dk-panel-gap)*0.5)]", className),
2016
+ className: cn("flex shrink-0 items-center gap-[calc(var(--designkit-panel-gap)*0.5)]", className),
2010
2017
  children
2011
2018
  }
2012
2019
  );
@@ -2044,8 +2051,8 @@ function Content({ children, className, padding = "default" }) {
2044
2051
  "data-slot": "data-page-content",
2045
2052
  className: cn(
2046
2053
  "min-h-0 flex-1 overflow-auto",
2047
- padding === "default" && "px-[var(--dk-page-padding-x)] pb-[var(--dk-page-padding-y)] pt-[var(--dk-page-padding-y)]",
2048
- padding === "compact" && "p-[calc(var(--dk-page-padding-y)*0.875)]",
2054
+ padding === "default" && "px-[var(--designkit-page-padding-x)] pb-[var(--designkit-page-padding-y)] pt-[var(--designkit-page-padding-y)]",
2055
+ padding === "compact" && "p-[calc(var(--designkit-page-padding-y)*0.875)]",
2049
2056
  padding === "none" && "p-0",
2050
2057
  className
2051
2058
  ),
@@ -2082,7 +2089,7 @@ function GroupHeader({
2082
2089
  {
2083
2090
  "data-slot": "data-page-group-header",
2084
2091
  className: cn(
2085
- "flex items-start justify-between gap-4 px-0 pb-[calc(var(--dk-panel-gap)*0.75)]",
2092
+ "flex items-start justify-between gap-4 px-0 pb-[calc(var(--designkit-panel-gap)*0.75)]",
2086
2093
  className
2087
2094
  ),
2088
2095
  children: [
@@ -2103,7 +2110,7 @@ function GroupToolbar({ children, className }) {
2103
2110
  {
2104
2111
  "data-slot": "data-page-group-toolbar",
2105
2112
  className: cn(
2106
- "flex min-h-[var(--dk-toolbar-height)] items-center justify-between gap-[calc(var(--dk-panel-gap)*0.75)] pb-[calc(var(--dk-panel-gap)*0.75)]",
2113
+ "flex min-h-[var(--designkit-toolbar-height)] items-center justify-between gap-[calc(var(--designkit-panel-gap)*0.75)] pb-[calc(var(--designkit-panel-gap)*0.75)]",
2107
2114
  className
2108
2115
  ),
2109
2116
  children
@@ -2184,15 +2191,224 @@ function DashboardBodyTemplate({
2184
2191
  }) {
2185
2192
  return /* @__PURE__ */ jsxs(DataPage, { className: cn("layout-dashboard", className), style: theme, children: [
2186
2193
  topBar && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: topBar }),
2187
- (title || toolbar) && /* @__PURE__ */ jsx("header", { className: "shrink-0 border-b px-(--dk-page-padding-x) py-(--dk-page-padding-y)", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
2194
+ (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: [
2188
2195
  /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
2189
2196
  title && /* @__PURE__ */ jsx("h1", { className: "text-sm font-semibold truncate", children: title }),
2190
2197
  description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
2191
2198
  ] }),
2192
2199
  toolbar && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 shrink-0", children: toolbar })
2193
2200
  ] }) }),
2194
- variableBar && /* @__PURE__ */ jsx("div", { className: "shrink-0 flex flex-wrap items-center gap-2 px-(--dk-page-padding-x) py-1.5", children: variableBar }),
2195
- /* @__PURE__ */ 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 })
2201
+ variableBar && /* @__PURE__ */ jsx("div", { className: "shrink-0 flex flex-wrap items-center gap-2 px-(--designkit-page-padding-x) py-1.5", children: variableBar }),
2202
+ /* @__PURE__ */ jsx("div", { className: cn("flex-1 min-h-0 overflow-auto px-[calc(var(--designkit-page-padding-x)-0.5rem)] pt-0 pb-(--designkit-page-padding-y)", contentClassName), children })
2203
+ ] });
2204
+ }
2205
+ function clamp(value, min, max) {
2206
+ return Math.min(Math.max(value, min), max);
2207
+ }
2208
+ function ResizeHandle({
2209
+ axis,
2210
+ onPointerDown,
2211
+ className
2212
+ }) {
2213
+ return /* @__PURE__ */ jsxs(
2214
+ "div",
2215
+ {
2216
+ role: "separator",
2217
+ "aria-orientation": axis === "x" ? "vertical" : "horizontal",
2218
+ className: cn(
2219
+ "group/resize relative z-10 shrink-0 touch-none bg-transparent",
2220
+ axis === "x" ? "-mx-1 w-2 cursor-col-resize" : "-my-1 h-2 cursor-row-resize",
2221
+ className
2222
+ ),
2223
+ onPointerDown,
2224
+ children: [
2225
+ /* @__PURE__ */ jsx(
2226
+ "div",
2227
+ {
2228
+ className: cn(
2229
+ "absolute bg-border transition-colors group-hover/resize:bg-muted-foreground/40",
2230
+ 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"
2231
+ )
2232
+ }
2233
+ ),
2234
+ /* @__PURE__ */ jsx(
2235
+ "div",
2236
+ {
2237
+ className: cn(
2238
+ "absolute rounded-full bg-muted-foreground/35 opacity-0 transition-opacity group-hover/resize:opacity-100",
2239
+ 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"
2240
+ )
2241
+ }
2242
+ )
2243
+ ]
2244
+ }
2245
+ );
2246
+ }
2247
+ function WorkbenchBodyTemplate({
2248
+ theme,
2249
+ className,
2250
+ contentClassName,
2251
+ title,
2252
+ description,
2253
+ topBar,
2254
+ headerRight,
2255
+ toolbar,
2256
+ actions,
2257
+ leftPane,
2258
+ mainPane,
2259
+ rightPane,
2260
+ bottomPane,
2261
+ children,
2262
+ resizable = true,
2263
+ leftPaneCollapsed,
2264
+ rightPaneCollapsed,
2265
+ bottomPaneCollapsed,
2266
+ leftPaneWidth = 260,
2267
+ rightPaneWidth = 320,
2268
+ bottomPaneHeight = 240,
2269
+ minLeftPaneWidth = 180,
2270
+ maxLeftPaneWidth = 440,
2271
+ minRightPaneWidth = 240,
2272
+ maxRightPaneWidth = 520,
2273
+ minBottomPaneHeight = 120,
2274
+ maxBottomPaneHeight = 420,
2275
+ leftPaneClassName,
2276
+ mainPaneClassName,
2277
+ rightPaneClassName,
2278
+ bottomPaneClassName,
2279
+ leftPaneLabel = "Panel",
2280
+ rightPaneLabel = "Inspector"
2281
+ }) {
2282
+ const [leftWidth, setLeftWidth] = useState(leftPaneWidth);
2283
+ const [rightWidth, setRightWidth] = useState(rightPaneWidth);
2284
+ const [bottomHeight, setBottomHeight] = useState(bottomPaneHeight);
2285
+ const startResize = useCallback((event, axis, applyDelta) => {
2286
+ if (!resizable) return;
2287
+ const start = axis === "x" ? event.clientX : event.clientY;
2288
+ event.currentTarget.setPointerCapture(event.pointerId);
2289
+ const previousCursor = document.body.style.cursor;
2290
+ const previousUserSelect = document.body.style.userSelect;
2291
+ document.body.style.cursor = axis === "x" ? "col-resize" : "row-resize";
2292
+ document.body.style.userSelect = "none";
2293
+ const onPointerMove = (moveEvent) => {
2294
+ applyDelta((axis === "x" ? moveEvent.clientX : moveEvent.clientY) - start);
2295
+ };
2296
+ const onPointerUp = () => {
2297
+ document.body.style.cursor = previousCursor;
2298
+ document.body.style.userSelect = previousUserSelect;
2299
+ window.removeEventListener("pointermove", onPointerMove);
2300
+ window.removeEventListener("pointerup", onPointerUp);
2301
+ };
2302
+ window.addEventListener("pointermove", onPointerMove);
2303
+ window.addEventListener("pointerup", onPointerUp, { once: true });
2304
+ }, [resizable]);
2305
+ const headerRightContent = headerRight ?? toolbar;
2306
+ const showHeader = title || description || headerRightContent || actions;
2307
+ const showLeftPane = leftPane && !leftPaneCollapsed;
2308
+ const showRightPane = rightPane && !rightPaneCollapsed;
2309
+ const showBottomPane = bottomPane && !bottomPaneCollapsed;
2310
+ return /* @__PURE__ */ jsxs(DataPage, { className: cn("layout-workbench", className), style: theme, children: [
2311
+ topBar && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: topBar }),
2312
+ 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: [
2313
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
2314
+ title && /* @__PURE__ */ jsx("h1", { className: "truncate text-sm font-semibold", children: title }),
2315
+ description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: description })
2316
+ ] }),
2317
+ (headerRightContent || actions) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
2318
+ headerRightContent,
2319
+ actions
2320
+ ] })
2321
+ ] }) }),
2322
+ (showLeftPane || showRightPane) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5 border-b px-2 py-1.5 md:hidden", children: [
2323
+ showLeftPane && /* @__PURE__ */ jsxs(Sheet, { children: [
2324
+ /* @__PURE__ */ jsx(SheetTrigger, { render: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm" }), children: leftPaneLabel }),
2325
+ /* @__PURE__ */ jsxs(SheetContent, { side: "left", className: "flex flex-col gap-0 p-0", children: [
2326
+ /* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: leftPaneLabel }) }),
2327
+ /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: leftPane })
2328
+ ] })
2329
+ ] }),
2330
+ showRightPane && /* @__PURE__ */ jsxs(Sheet, { children: [
2331
+ /* @__PURE__ */ jsx(SheetTrigger, { render: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm" }), children: rightPaneLabel }),
2332
+ /* @__PURE__ */ jsxs(SheetContent, { side: "right", className: "flex flex-col gap-0 p-0", children: [
2333
+ /* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: rightPaneLabel }) }),
2334
+ /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: rightPane })
2335
+ ] })
2336
+ ] })
2337
+ ] }),
2338
+ /* @__PURE__ */ jsxs("div", { className: cn("flex min-h-0 flex-1 overflow-hidden", contentClassName), children: [
2339
+ showLeftPane && /* @__PURE__ */ jsxs(Fragment$1, { children: [
2340
+ /* @__PURE__ */ jsx(
2341
+ "aside",
2342
+ {
2343
+ className: cn("hidden min-h-0 shrink-0 overflow-hidden border-r bg-card/45 md:flex md:flex-col", leftPaneClassName),
2344
+ style: { width: leftWidth },
2345
+ children: leftPane
2346
+ }
2347
+ ),
2348
+ resizable && /* @__PURE__ */ jsx(
2349
+ ResizeHandle,
2350
+ {
2351
+ axis: "x",
2352
+ className: "hidden md:flex",
2353
+ onPointerDown: (event) => {
2354
+ const start = leftWidth;
2355
+ startResize(event, "x", (delta) => {
2356
+ setLeftWidth(clamp(start + delta, minLeftPaneWidth, maxLeftPaneWidth));
2357
+ });
2358
+ }
2359
+ }
2360
+ )
2361
+ ] }),
2362
+ /* @__PURE__ */ jsxs("main", { className: cn("flex min-w-0 flex-1 flex-col overflow-hidden", mainPaneClassName), children: [
2363
+ /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-hidden", children: mainPane ?? children }),
2364
+ showBottomPane && /* @__PURE__ */ jsxs(Fragment$1, { children: [
2365
+ resizable && /* @__PURE__ */ jsx(
2366
+ ResizeHandle,
2367
+ {
2368
+ axis: "y",
2369
+ className: "hidden md:flex",
2370
+ onPointerDown: (event) => {
2371
+ const start = bottomHeight;
2372
+ startResize(event, "y", (delta) => {
2373
+ setBottomHeight(clamp(start - delta, minBottomPaneHeight, maxBottomPaneHeight));
2374
+ });
2375
+ }
2376
+ }
2377
+ ),
2378
+ /* @__PURE__ */ jsx(
2379
+ "section",
2380
+ {
2381
+ className: cn("min-h-0 shrink-0 overflow-auto border-t bg-card/40 md:overflow-hidden", bottomPaneClassName),
2382
+ style: { height: bottomHeight },
2383
+ children: bottomPane
2384
+ }
2385
+ )
2386
+ ] })
2387
+ ] }),
2388
+ showRightPane && /* @__PURE__ */ jsxs(Fragment$1, { children: [
2389
+ resizable && /* @__PURE__ */ jsx(
2390
+ ResizeHandle,
2391
+ {
2392
+ axis: "x",
2393
+ className: "hidden md:flex",
2394
+ onPointerDown: (event) => {
2395
+ const start = rightWidth;
2396
+ startResize(event, "x", (delta) => {
2397
+ setRightWidth(clamp(start - delta, minRightPaneWidth, maxRightPaneWidth));
2398
+ });
2399
+ }
2400
+ }
2401
+ ),
2402
+ /* @__PURE__ */ jsx(
2403
+ "aside",
2404
+ {
2405
+ className: cn("hidden min-h-0 shrink-0 overflow-hidden border-l bg-card/45 md:flex md:flex-col", rightPaneClassName),
2406
+ style: { width: rightWidth },
2407
+ children: rightPane
2408
+ }
2409
+ )
2410
+ ] })
2411
+ ] })
2196
2412
  ] });
2197
2413
  }
2198
2414
  function DataBodyTab(_props) {
@@ -2241,13 +2457,13 @@ function GroupWrapper({
2241
2457
  children
2242
2458
  }) {
2243
2459
  if (variant === "card") {
2244
- return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, { className: "p-(--dk-panel-gap)", children }) });
2460
+ return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, { className: "p-(--designkit-panel-gap)", children }) });
2245
2461
  }
2246
2462
  if (variant === "bordered") {
2247
2463
  if (layout === "inline") {
2248
2464
  return /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-(--radius) border divide-y", children });
2249
2465
  }
2250
- return /* @__PURE__ */ jsx("div", { className: "rounded-(--radius) border p-(--dk-panel-gap)", children });
2466
+ return /* @__PURE__ */ jsx("div", { className: "rounded-(--radius) border p-(--designkit-panel-gap)", children });
2251
2467
  }
2252
2468
  return /* @__PURE__ */ jsx(Fragment$1, { children });
2253
2469
  }
@@ -2267,12 +2483,13 @@ function renderGroupProps(props) {
2267
2483
  description,
2268
2484
  actions,
2269
2485
  danger,
2486
+ className,
2270
2487
  children
2271
2488
  } = props;
2272
2489
  const variant = variantProp ?? layoutDefaultVariant[layout];
2273
2490
  if (layout === "split") {
2274
2491
  const panes = Children.toArray(children);
2275
- return /* @__PURE__ */ jsxs("div", { className: "py-(--dk-panel-gap)", children: [
2492
+ return /* @__PURE__ */ jsxs("div", { className: cn("py-(--designkit-panel-gap)", className), children: [
2276
2493
  (title || description || actions) && /* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-start justify-between", children: [
2277
2494
  /* @__PURE__ */ jsxs("div", { children: [
2278
2495
  title && /* @__PURE__ */ jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
@@ -2280,21 +2497,21 @@ function renderGroupProps(props) {
2280
2497
  ] }),
2281
2498
  actions && /* @__PURE__ */ jsx("div", { children: actions })
2282
2499
  ] }),
2283
- /* @__PURE__ */ jsx("div", { className: "grid min-h-104 gap-(--dk-panel-gap) lg:grid-cols-[20rem_minmax(0,1fr)]", children: panes.map((pane, i) => /* @__PURE__ */ jsx(GroupWrapper, { layout, variant, children: pane }, i)) })
2500
+ /* @__PURE__ */ jsx("div", { className: "grid min-h-104 gap-(--designkit-panel-gap) lg:grid-cols-[20rem_minmax(0,1fr)]", children: panes.map((pane, i) => /* @__PURE__ */ jsx(GroupWrapper, { layout, variant, children: pane }, i)) })
2284
2501
  ] });
2285
2502
  }
2286
2503
  if (layout === "horizontal") {
2287
- return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-[calc(var(--dk-panel-gap)*2)] py-(--dk-panel-gap)", children: [
2504
+ return /* @__PURE__ */ jsxs("div", { className: cn("grid grid-cols-1 gap-(--designkit-panel-gap) py-(--designkit-panel-gap) sm:grid-cols-3 sm:gap-[calc(var(--designkit-panel-gap)*2)]", className), children: [
2288
2505
  /* @__PURE__ */ jsxs("div", { children: [
2289
2506
  /* @__PURE__ */ jsx("p", { className: cn("text-sm font-medium", danger && "text-destructive"), children: title }),
2290
2507
  description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: description }),
2291
2508
  actions && /* @__PURE__ */ jsx("div", { className: "mt-2", children: actions })
2292
2509
  ] }),
2293
- /* @__PURE__ */ jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsx(GroupWrapper, { layout, variant, children }) })
2510
+ /* @__PURE__ */ jsx("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx(GroupWrapper, { layout, variant, children }) })
2294
2511
  ] });
2295
2512
  }
2296
2513
  if (layout === "inline") {
2297
- return /* @__PURE__ */ jsxs("div", { className: "py-(--dk-panel-gap)", children: [
2514
+ return /* @__PURE__ */ jsxs("div", { className: cn("py-(--designkit-panel-gap)", className), children: [
2298
2515
  (title || description) && /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-start justify-between", children: [
2299
2516
  /* @__PURE__ */ jsxs("div", { children: [
2300
2517
  title && /* @__PURE__ */ jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
@@ -2305,7 +2522,7 @@ function renderGroupProps(props) {
2305
2522
  /* @__PURE__ */ jsx(GroupWrapper, { layout, variant, children })
2306
2523
  ] });
2307
2524
  }
2308
- return /* @__PURE__ */ jsxs("div", { className: "py-(--dk-panel-gap)", children: [
2525
+ return /* @__PURE__ */ jsxs("div", { className: cn("py-(--designkit-panel-gap)", className), children: [
2309
2526
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
2310
2527
  /* @__PURE__ */ jsxs("div", { children: [
2311
2528
  /* @__PURE__ */ jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
@@ -2320,8 +2537,8 @@ function DataBodyField({ label, description, children }) {
2320
2537
  return /* @__PURE__ */ jsxs(
2321
2538
  "div",
2322
2539
  {
2323
- className: "grid items-start gap-x-4 px-4 py-3",
2324
- style: { gridTemplateColumns: "var(--dk-form-label-w, 11rem) 1fr" },
2540
+ className: "flex flex-col gap-y-1 px-4 py-3 sm:grid sm:items-start sm:gap-x-4 sm:gap-y-0",
2541
+ style: { gridTemplateColumns: "var(--designkit-form-label-w, 11rem) 1fr" },
2325
2542
  children: [
2326
2543
  /* @__PURE__ */ jsxs("div", { className: "pt-0.5", children: [
2327
2544
  /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: label }),
@@ -2336,8 +2553,8 @@ function DataBodyRow({ label, description, required, children }) {
2336
2553
  return /* @__PURE__ */ jsxs(
2337
2554
  "div",
2338
2555
  {
2339
- className: "grid items-start gap-x-4 px-4 py-3",
2340
- style: { gridTemplateColumns: "var(--dk-form-label-w, 11rem) 1fr" },
2556
+ className: "flex flex-col gap-y-1.5 px-4 py-3 sm:grid sm:items-start sm:gap-x-4 sm:gap-y-0",
2557
+ style: { gridTemplateColumns: "var(--designkit-form-label-w, 11rem) 1fr" },
2341
2558
  children: [
2342
2559
  /* @__PURE__ */ jsxs("div", { className: "pt-1", children: [
2343
2560
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
@@ -2397,7 +2614,7 @@ function Root2({
2397
2614
  /* @__PURE__ */ jsx(DataPage.TitleBlock, { title, description }),
2398
2615
  /* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
2399
2616
  ] }),
2400
- summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--dk-page-padding-x) py-(--dk-panel-gap)", children: summaryEl.props.children }),
2617
+ summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
2401
2618
  /* @__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 }) }) })
2402
2619
  ] });
2403
2620
  }
@@ -2409,8 +2626,8 @@ function Root2({
2409
2626
  /* @__PURE__ */ jsx(DataPage.TitleBlock, { title, description }),
2410
2627
  /* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
2411
2628
  ] }),
2412
- summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--dk-page-padding-x) py-(--dk-panel-gap)", children: summaryEl.props.children }),
2413
- /* @__PURE__ */ jsx(DataPage.Content, { className: contentClassName, children: /* @__PURE__ */ jsxs("div", { className: "grid gap-(--dk-panel-gap) lg:grid-cols-[16rem_minmax(0,1fr)]", children: [
2629
+ summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
2630
+ /* @__PURE__ */ jsx(DataPage.Content, { className: contentClassName, children: /* @__PURE__ */ jsxs("div", { className: "grid gap-(--designkit-panel-gap) lg:grid-cols-[16rem_minmax(0,1fr)]", children: [
2414
2631
  /* @__PURE__ */ jsx("nav", { className: "space-y-1", children: sections.map((section) => {
2415
2632
  const active = section.props.id === activeSection?.props.id;
2416
2633
  return /* @__PURE__ */ jsxs(
@@ -2432,7 +2649,7 @@ function Root2({
2432
2649
  section.props.id
2433
2650
  );
2434
2651
  }) }),
2435
- /* @__PURE__ */ jsx("div", { className: "min-w-0 space-y-(--dk-panel-gap)", children: renderGroups(activeSection?.props.children) })
2652
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 space-y-(--designkit-panel-gap)", children: renderGroups(activeSection?.props.children) })
2436
2653
  ] }) })
2437
2654
  ] });
2438
2655
  }
@@ -2443,7 +2660,7 @@ function Root2({
2443
2660
  /* @__PURE__ */ jsx(DataPage.TitleBlock, { title, description }),
2444
2661
  /* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
2445
2662
  ] }),
2446
- summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--dk-page-padding-x) py-(--dk-panel-gap)", children: summaryEl.props.children }),
2663
+ summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
2447
2664
  hasTabs && /* @__PURE__ */ jsx(DataPage.Tabs, { children: tabs.map((tab) => /* @__PURE__ */ jsx(
2448
2665
  DataPage.Tab,
2449
2666
  {
@@ -2508,7 +2725,7 @@ function BrowseBodyTemplate({
2508
2725
  /* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
2509
2726
  ] }),
2510
2727
  /* @__PURE__ */ jsxs(DataPage.Content, { padding: "none", className: "flex flex-col overflow-hidden", children: [
2511
- (toolbar || isNarrow) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b px-(--dk-page-padding-x) py-2", children: [
2728
+ (toolbar || isNarrow) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b px-(--designkit-page-padding-x) py-2", children: [
2512
2729
  isNarrow && /* @__PURE__ */ jsxs(Sheet, { children: [
2513
2730
  /* @__PURE__ */ jsxs(
2514
2731
  SheetTrigger,
@@ -2533,16 +2750,16 @@ function BrowseBodyTemplate({
2533
2750
  {
2534
2751
  className: "shrink-0 overflow-hidden border-r",
2535
2752
  style: { width: sidebarWidth },
2536
- children: /* @__PURE__ */ jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsx("div", { className: "px-(--dk-page-padding-x) py-(--dk-page-padding-y)", children: sidebar }) })
2753
+ children: /* @__PURE__ */ jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsx("div", { className: "px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: sidebar }) })
2537
2754
  }
2538
2755
  ),
2539
2756
  /* @__PURE__ */ jsx(
2540
2757
  "div",
2541
2758
  {
2542
2759
  className: cn(
2543
- "min-w-0 flex-1 overflow-hidden px-(--dk-page-padding-x) py-(--dk-page-padding-y)",
2544
- "[&_.dg-shell]:h-full [&_.dg-table-stack]:flex-1 [&_.dg-table-stack]:min-h-0",
2545
- "[&_.dg-card-container]:flex-1 [&_.dg-card-container]:min-h-0 [&_.dg-card-container]:overflow-auto",
2760
+ "min-w-0 flex-1 overflow-hidden px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)",
2761
+ "[&_.gridkit-shell]:h-full [&_.gridkit-table-stack]:flex-1 [&_.gridkit-table-stack]:min-h-0",
2762
+ "[&_.gridkit-frame]:flex-1 [&_.gridkit-frame]:min-h-0 [&_.gridkit-frame]:overflow-auto",
2546
2763
  contentClassName
2547
2764
  ),
2548
2765
  children
@@ -2593,8 +2810,8 @@ function DetailBodySection({
2593
2810
  {
2594
2811
  className: cn(
2595
2812
  "min-h-0",
2596
- surface === "card" && "rounded-(--radius) border bg-card p-(--dk-panel-gap) text-card-foreground shadow-sm",
2597
- surface === "bordered" && "rounded-(--radius) border p-(--dk-panel-gap)",
2813
+ surface === "card" && "rounded-(--radius) border bg-card p-(--designkit-panel-gap) text-card-foreground shadow-sm",
2814
+ surface === "bordered" && "rounded-(--radius) border p-(--designkit-panel-gap)",
2598
2815
  className
2599
2816
  ),
2600
2817
  children: [
@@ -2639,7 +2856,7 @@ function DetailBodyTemplateRoot({
2639
2856
  const hasTabs = tabs.length > 0;
2640
2857
  const [activeTab, setActiveTab] = useState(() => tabs[0]?.props.id ?? "");
2641
2858
  const selectedTab = tabs.find((tab) => tab.props.id === activeTab) ?? tabs[0];
2642
- const summarySlot = summary ? /* @__PURE__ */ jsx("div", { className: "min-h-0 rounded-(--radius) border bg-card p-(--dk-panel-gap) text-card-foreground", children: summary }) : null;
2859
+ 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;
2643
2860
  const mediaSlot = media ? /* @__PURE__ */ jsx("div", { className: cn("min-h-0 overflow-hidden rounded-(--radius) border bg-card", mediaClassName), children: media }) : null;
2644
2861
  const leadGridClass = variant === "media" ? "xl:grid-cols-[minmax(0,1.35fr)_minmax(18rem,0.65fr)]" : "xl:grid-cols-2";
2645
2862
  const defaultHeader = eyebrow || title || description || status || actions ? /* @__PURE__ */ jsx(
@@ -2652,7 +2869,7 @@ function DetailBodyTemplateRoot({
2652
2869
  actions
2653
2870
  }
2654
2871
  ) : null;
2655
- const defaultLead = media || summary ? /* @__PURE__ */ jsxs("div", { className: cn("grid gap-(--dk-panel-gap)", leadGridClass), children: [
2872
+ const defaultLead = media || summary ? /* @__PURE__ */ jsxs("div", { className: cn("grid gap-(--designkit-panel-gap)", leadGridClass), children: [
2656
2873
  mediaSlot,
2657
2874
  summarySlot
2658
2875
  ] }) : null;
@@ -2668,8 +2885,8 @@ function DetailBodyTemplateRoot({
2668
2885
  },
2669
2886
  tab.props.id
2670
2887
  )) }),
2671
- /* @__PURE__ */ jsx("div", { className: "pt-(--dk-panel-gap)", children: selectedTab?.props.children })
2672
- ] }) : /* @__PURE__ */ jsx("div", { className: "space-y-(--dk-panel-gap)", children: renderChildren(children) });
2888
+ /* @__PURE__ */ jsx("div", { className: "pt-(--designkit-panel-gap)", children: selectedTab?.props.children })
2889
+ ] }) : /* @__PURE__ */ jsx("div", { className: "space-y-(--designkit-panel-gap)", children: renderChildren(children) });
2673
2890
  const leadSlot = lead ?? defaultLead;
2674
2891
  const outsideAsideSlot = variant === "full" ? null : aside;
2675
2892
  const insideAsideSlot = variant === "full" ? aside : null;
@@ -2677,19 +2894,19 @@ function DetailBodyTemplateRoot({
2677
2894
  const hasFullLeadArea = Boolean(leadSlot || insideAsideSlot);
2678
2895
  const layout = {
2679
2896
  media: /* @__PURE__ */ jsxs(Fragment$1, { children: [
2680
- leadSlot && /* @__PURE__ */ jsx("div", { className: "mb-(--dk-panel-gap)", children: leadSlot }),
2897
+ leadSlot && /* @__PURE__ */ jsx("div", { className: "mb-(--designkit-panel-gap)", children: leadSlot }),
2681
2898
  body
2682
2899
  ] }),
2683
2900
  record: /* @__PURE__ */ jsxs(
2684
2901
  "div",
2685
2902
  {
2686
2903
  className: cn(
2687
- "grid gap-(--dk-panel-gap)",
2904
+ "grid gap-(--designkit-panel-gap)",
2688
2905
  hasRecordInspector && "xl:grid-cols-[minmax(28rem,1fr)_minmax(14rem,18rem)]"
2689
2906
  ),
2690
2907
  children: [
2691
2908
  /* @__PURE__ */ jsx("div", { className: "min-w-0", children: body }),
2692
- hasRecordInspector && /* @__PURE__ */ jsx("div", { className: "space-y-(--dk-panel-gap)", children: leadSlot })
2909
+ hasRecordInspector && /* @__PURE__ */ jsx("div", { className: "space-y-(--designkit-panel-gap)", children: leadSlot })
2693
2910
  ]
2694
2911
  }
2695
2912
  ),
@@ -2698,12 +2915,12 @@ function DetailBodyTemplateRoot({
2698
2915
  "div",
2699
2916
  {
2700
2917
  className: cn(
2701
- "mb-(--dk-panel-gap) grid gap-(--dk-panel-gap)",
2918
+ "mb-(--designkit-panel-gap) grid gap-(--designkit-panel-gap)",
2702
2919
  insideAsideSlot && "xl:grid-cols-[minmax(0,1fr)_minmax(18rem,24rem)]"
2703
2920
  ),
2704
2921
  children: [
2705
- leadSlot && /* @__PURE__ */ jsx("div", { className: "space-y-(--dk-panel-gap)", children: leadSlot }),
2706
- insideAsideSlot && /* @__PURE__ */ jsx("div", { className: cn("min-h-0 rounded-(--radius) border bg-card p-(--dk-panel-gap)", asideClassName), children: insideAsideSlot })
2922
+ leadSlot && /* @__PURE__ */ jsx("div", { className: "space-y-(--designkit-panel-gap)", children: leadSlot }),
2923
+ insideAsideSlot && /* @__PURE__ */ jsx("div", { className: cn("min-h-0 rounded-(--radius) border bg-card p-(--designkit-panel-gap)", asideClassName), children: insideAsideSlot })
2707
2924
  ]
2708
2925
  }
2709
2926
  ),
@@ -2725,7 +2942,7 @@ function DetailBodyTemplateRoot({
2725
2942
  "main",
2726
2943
  {
2727
2944
  className: cn(
2728
- "min-h-0 overflow-auto px-(--dk-page-padding-x) py-(--dk-page-padding-y)",
2945
+ "min-h-0 overflow-auto px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)",
2729
2946
  contentClassName
2730
2947
  ),
2731
2948
  children: layout[variant]
@@ -2735,7 +2952,7 @@ function DetailBodyTemplateRoot({
2735
2952
  "div",
2736
2953
  {
2737
2954
  className: cn(
2738
- "px-(--dk-page-padding-x) py-(--dk-page-padding-y)",
2955
+ "px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)",
2739
2956
  stickyAside && "lg:sticky lg:top-0"
2740
2957
  ),
2741
2958
  children: outsideAsideSlot
@@ -2751,6 +2968,102 @@ var DetailBodyTemplate = Object.assign(DetailBodyTemplateRoot, {
2751
2968
  Tab: DetailBodyTab,
2752
2969
  Section: DetailBodySection
2753
2970
  });
2971
+ function ListDetailBodyTemplate({
2972
+ theme,
2973
+ className,
2974
+ topBar,
2975
+ list,
2976
+ detail,
2977
+ emptyDetail,
2978
+ listWidth = 320,
2979
+ listClassName,
2980
+ detailClassName,
2981
+ onBack,
2982
+ backLabel = "Back"
2983
+ }) {
2984
+ return /* @__PURE__ */ jsxs(
2985
+ DataPage,
2986
+ {
2987
+ className: cn("layout-list-detail", className),
2988
+ style: { "--ld-list-width": `${listWidth}px`, ...theme },
2989
+ children: [
2990
+ topBar && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: topBar }),
2991
+ /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
2992
+ /* @__PURE__ */ jsx(
2993
+ "aside",
2994
+ {
2995
+ className: cn(
2996
+ "min-h-0 shrink-0 overflow-hidden border-r",
2997
+ detail ? "hidden lg:flex lg:w-[var(--ld-list-width)] lg:flex-col" : "flex w-full flex-col lg:w-[var(--ld-list-width)]",
2998
+ listClassName
2999
+ ),
3000
+ children: list
3001
+ }
3002
+ ),
3003
+ /* @__PURE__ */ jsxs(
3004
+ "main",
3005
+ {
3006
+ className: cn(
3007
+ "flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",
3008
+ !detail && "hidden lg:flex",
3009
+ detailClassName
3010
+ ),
3011
+ children: [
3012
+ 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: [
3013
+ /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
3014
+ backLabel
3015
+ ] }) }),
3016
+ /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-auto", children: detail ?? emptyDetail })
3017
+ ]
3018
+ }
3019
+ )
3020
+ ] })
3021
+ ]
3022
+ }
3023
+ );
3024
+ }
3025
+ function PanelTemplateSection({
3026
+ title,
3027
+ description,
3028
+ actions,
3029
+ className,
3030
+ children
3031
+ }) {
3032
+ return /* @__PURE__ */ jsxs("section", { className: cn("space-y-2.5", className), children: [
3033
+ (title || description || actions) && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
3034
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
3035
+ title && /* @__PURE__ */ jsx("p", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
3036
+ description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
3037
+ ] }),
3038
+ actions && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: actions })
3039
+ ] }),
3040
+ children
3041
+ ] });
3042
+ }
3043
+ function PanelTemplateRoot({
3044
+ title,
3045
+ eyebrow,
3046
+ actions,
3047
+ footer,
3048
+ children,
3049
+ className,
3050
+ bodyClassName
3051
+ }) {
3052
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex h-full flex-col overflow-hidden", className), children: [
3053
+ (title || eyebrow || actions) && /* @__PURE__ */ jsxs("div", { className: "shrink-0 px-4 py-3", children: [
3054
+ eyebrow && /* @__PURE__ */ jsx("p", { className: "mb-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground", children: eyebrow }),
3055
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
3056
+ title && /* @__PURE__ */ jsx("h2", { className: "min-w-0 flex-1 truncate text-sm font-semibold", children: title }),
3057
+ actions && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-1", children: actions })
3058
+ ] })
3059
+ ] }),
3060
+ /* @__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 }) }),
3061
+ footer && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-t px-4 py-3", children: footer })
3062
+ ] });
3063
+ }
3064
+ var PanelTemplate = Object.assign(PanelTemplateRoot, {
3065
+ Section: PanelTemplateSection
3066
+ });
2754
3067
  function FormWizardBodyTemplate({
2755
3068
  theme,
2756
3069
  title,
@@ -2772,7 +3085,7 @@ function FormWizardBodyTemplate({
2772
3085
  return /* @__PURE__ */ jsxs(DataPage, { className: "layout-form-wizard", style: theme, children: [
2773
3086
  topBar && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: topBar }),
2774
3087
  /* @__PURE__ */ jsx(DataPage.Header, { children: /* @__PURE__ */ jsx(DataPage.TitleBlock, { title }) }),
2775
- /* @__PURE__ */ jsx("div", { className: "shrink-0 px-(--dk-page-padding-x) pb-4", children: /* @__PURE__ */ jsx("div", { className: "flex items-center", children: steps.map((step, i) => /* @__PURE__ */ jsxs(Fragment, { children: [
3088
+ /* @__PURE__ */ jsx("div", { className: "shrink-0 px-(--designkit-page-padding-x) pb-4", children: /* @__PURE__ */ jsx("div", { className: "flex items-center", children: steps.map((step, i) => /* @__PURE__ */ jsxs(Fragment, { children: [
2776
3089
  i > 0 && /* @__PURE__ */ jsx(
2777
3090
  "div",
2778
3091
  {
@@ -2805,7 +3118,7 @@ function FormWizardBodyTemplate({
2805
3118
  )
2806
3119
  ] })
2807
3120
  ] }, step.key)) }) }),
2808
- /* @__PURE__ */ jsx(DataPage.Content, { children: current && (variant === "card" ? /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, { className: "p-(--dk-panel-gap)", children: /* @__PURE__ */ jsxs("form", { id: current.key, onSubmit: handleStepSubmit, children: [
3121
+ /* @__PURE__ */ jsx(DataPage.Content, { children: current && (variant === "card" ? /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, { className: "p-(--designkit-panel-gap)", children: /* @__PURE__ */ jsxs("form", { id: current.key, onSubmit: handleStepSubmit, children: [
2809
3122
  /* @__PURE__ */ jsxs("div", { className: "mb-5", children: [
2810
3123
  /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold", children: current.title }),
2811
3124
  current.description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: current.description })
@@ -2863,8 +3176,8 @@ function TypographyBodyTemplate({ theme, breadcrumb }) {
2863
3176
  description: "Global type scale preview for shell, template, and grid content"
2864
3177
  }
2865
3178
  ) }),
2866
- /* @__PURE__ */ jsxs(DataPage.Content, { className: "grid gap-[var(--dk-panel-gap)] lg:grid-cols-[1fr_22rem]", children: [
2867
- /* @__PURE__ */ jsxs("div", { className: "space-y-[var(--dk-panel-gap)]", children: [
3179
+ /* @__PURE__ */ jsxs(DataPage.Content, { className: "grid gap-[var(--designkit-panel-gap)] lg:grid-cols-[1fr_22rem]", children: [
3180
+ /* @__PURE__ */ jsxs("div", { className: "space-y-[var(--designkit-panel-gap)]", children: [
2868
3181
  /* @__PURE__ */ jsxs(Card, { className: "rounded-lg border border-border ring-0", children: [
2869
3182
  /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Type Scale" }) }),
2870
3183
  /* @__PURE__ */ jsx(CardContent, { className: "space-y-4", children: scaleRows.map((row) => /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[8rem_1fr] items-baseline gap-4", children: [
@@ -3055,7 +3368,7 @@ function ColorsBodyTemplate({ theme, breadcrumb }) {
3055
3368
  description: "Design token color palette and derivation rules for the active theme"
3056
3369
  }
3057
3370
  ) }),
3058
- /* @__PURE__ */ jsxs(DataPage.Content, { className: "space-y-[var(--dk-panel-gap)]", children: [
3371
+ /* @__PURE__ */ jsxs(DataPage.Content, { className: "space-y-[var(--designkit-panel-gap)]", children: [
3059
3372
  /* @__PURE__ */ jsxs(Card, { className: "rounded-lg border border-border ring-0", children: [
3060
3373
  /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Primary \u2014 controlled by hue & chroma" }) }),
3061
3374
  /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3", children: [
@@ -3342,26 +3655,36 @@ function buildTopBar(opts) {
3342
3655
  }
3343
3656
  );
3344
3657
  }
3658
+ function AutoSidebarTrigger() {
3659
+ const ctx = useSidebarOptional();
3660
+ if (!ctx?.isMobile) return null;
3661
+ return /* @__PURE__ */ jsx(SidebarTrigger, { className: "-ml-1 shrink-0" });
3662
+ }
3345
3663
  function PageTopBar({
3346
3664
  left,
3347
3665
  right,
3348
3666
  variant = "ghost",
3349
- height = "var(--dk-toolbar-height)",
3667
+ height = "var(--designkit-toolbar-height)",
3350
3668
  className,
3351
3669
  style,
3352
- children
3670
+ children,
3671
+ sidebarTrigger
3353
3672
  }) {
3673
+ const trigger = sidebarTrigger === false ? null : sidebarTrigger !== void 0 ? sidebarTrigger : /* @__PURE__ */ jsx(AutoSidebarTrigger, {});
3354
3674
  return /* @__PURE__ */ jsxs(
3355
3675
  "div",
3356
3676
  {
3357
3677
  className: cn(
3358
- "flex shrink-0 items-center justify-between gap-4 px-(--dk-page-padding-x)",
3678
+ "flex shrink-0 items-center justify-between gap-4 px-(--designkit-page-padding-x)",
3359
3679
  variant === "default" && "border-b",
3360
3680
  className
3361
3681
  ),
3362
3682
  style: { height, ...style },
3363
3683
  children: [
3364
- /* @__PURE__ */ jsx("div", { className: "flex min-w-0 items-center text-xs text-muted-foreground", children: normalizeBreadcrumb(left ?? children) }),
3684
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2 text-xs text-muted-foreground", children: [
3685
+ trigger,
3686
+ normalizeBreadcrumb(left ?? children)
3687
+ ] }),
3365
3688
  right && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: right })
3366
3689
  ]
3367
3690
  }
@@ -3401,8 +3724,7 @@ function buildTokenMap({
3401
3724
  }[density];
3402
3725
  const c = (factor) => (primaryChroma * factor).toFixed(4);
3403
3726
  return {
3404
- "--dk-radius": `${radius}rem`,
3405
- "--dg-radius": `${radius}rem`,
3727
+ "--designkit-radius": `${radius}rem`,
3406
3728
  "--radius": `${radius}rem`,
3407
3729
  "--radius-sm": `${(radius * 0.6).toFixed(4)}rem`,
3408
3730
  "--radius-md": `${(radius * 0.8).toFixed(4)}rem`,
@@ -3410,12 +3732,9 @@ function buildTokenMap({
3410
3732
  "--radius-xl": `${(radius * 1.4).toFixed(4)}rem`,
3411
3733
  "--radius-2xl": `${(radius * 1.8).toFixed(4)}rem`,
3412
3734
  // primary — fully controlled
3413
- "--dk-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
3414
- "--dk-primary-foreground": "oklch(0.985 0 0)",
3415
- "--dk-ring": `oklch(0.50 ${primaryChroma} ${primaryHue})`,
3416
- "--dg-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
3417
- "--dg-primary-foreground": "oklch(0.985 0 0)",
3418
- "--dg-ring": `oklch(0.50 ${primaryChroma} ${primaryHue})`,
3735
+ "--designkit-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
3736
+ "--designkit-primary-foreground": "oklch(0.985 0 0)",
3737
+ "--designkit-ring": `oklch(0.50 ${primaryChroma} ${primaryHue})`,
3419
3738
  "--primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
3420
3739
  "--primary-foreground": "oklch(0.985 0 0)",
3421
3740
  "--color-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
@@ -3435,37 +3754,35 @@ function buildTokenMap({
3435
3754
  "--color-muted": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
3436
3755
  "--color-secondary": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
3437
3756
  "--color-accent": `oklch(0.970 ${c(0.04)} ${primaryHue})`,
3438
- "--dk-border": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
3439
- "--dk-input": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
3440
- "--dk-muted": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
3441
- "--dg-border": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
3442
- "--dg-muted": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
3443
- "--dk-font-scale": fontScale,
3444
- "--dk-line-height": lineHeight,
3445
- "--dk-density": densityValues.density,
3446
- "--dk-page-padding-y": pagePaddingY ?? densityValues.pagePaddingY,
3447
- "--dk-panel-gap": panelGap ?? densityValues.panelGap,
3448
- "--dk-toolbar-height": toolbarHeight ?? densityValues.toolbarHeight,
3449
- "--dk-text-xs": `calc(0.75rem * ${fontScale})`,
3450
- "--dk-text-sm": `calc(0.875rem * ${fontScale})`,
3451
- "--dk-text-base": `calc(1rem * ${fontScale})`,
3452
- "--dk-text-lg": `calc(1.125rem * ${fontScale})`,
3453
- "--dk-text-xl": `calc(1.25rem * ${fontScale})`,
3454
- "--dk-leading-xs": `calc(1rem * ${lineHeight})`,
3455
- "--dk-leading-sm": `calc(1.25rem * ${lineHeight})`,
3456
- "--dk-leading-base": `calc(1.5rem * ${lineHeight})`,
3457
- "--dk-leading-lg": `calc(1.75rem * ${lineHeight})`,
3458
- "--dk-leading-xl": `calc(1.75rem * ${lineHeight})`,
3459
- "--text-xs": "var(--dk-text-xs)",
3460
- "--text-sm": "var(--dk-text-sm)",
3461
- "--text-base": "var(--dk-text-base)",
3462
- "--text-lg": "var(--dk-text-lg)",
3463
- "--text-xl": "var(--dk-text-xl)",
3464
- "--text-xs--line-height": "var(--dk-leading-xs)",
3465
- "--text-sm--line-height": "var(--dk-leading-sm)",
3466
- "--text-base--line-height": "var(--dk-leading-base)",
3467
- "--text-lg--line-height": "var(--dk-leading-lg)",
3468
- "--text-xl--line-height": "var(--dk-leading-xl)"
3757
+ "--designkit-border": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
3758
+ "--designkit-input": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
3759
+ "--designkit-muted": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
3760
+ "--designkit-font-scale": fontScale,
3761
+ "--designkit-line-height": lineHeight,
3762
+ "--designkit-density": densityValues.density,
3763
+ "--designkit-page-padding-y": pagePaddingY ?? densityValues.pagePaddingY,
3764
+ "--designkit-panel-gap": panelGap ?? densityValues.panelGap,
3765
+ "--designkit-toolbar-height": toolbarHeight ?? densityValues.toolbarHeight,
3766
+ "--designkit-text-xs": `calc(0.75rem * ${fontScale})`,
3767
+ "--designkit-text-sm": `calc(0.875rem * ${fontScale})`,
3768
+ "--designkit-text-base": `calc(1rem * ${fontScale})`,
3769
+ "--designkit-text-lg": `calc(1.125rem * ${fontScale})`,
3770
+ "--designkit-text-xl": `calc(1.25rem * ${fontScale})`,
3771
+ "--designkit-leading-xs": `calc(1rem * ${lineHeight})`,
3772
+ "--designkit-leading-sm": `calc(1.25rem * ${lineHeight})`,
3773
+ "--designkit-leading-base": `calc(1.5rem * ${lineHeight})`,
3774
+ "--designkit-leading-lg": `calc(1.75rem * ${lineHeight})`,
3775
+ "--designkit-leading-xl": `calc(1.75rem * ${lineHeight})`,
3776
+ "--text-xs": "var(--designkit-text-xs)",
3777
+ "--text-sm": "var(--designkit-text-sm)",
3778
+ "--text-base": "var(--designkit-text-base)",
3779
+ "--text-lg": "var(--designkit-text-lg)",
3780
+ "--text-xl": "var(--designkit-text-xl)",
3781
+ "--text-xs--line-height": "var(--designkit-leading-xs)",
3782
+ "--text-sm--line-height": "var(--designkit-leading-sm)",
3783
+ "--text-base--line-height": "var(--designkit-leading-base)",
3784
+ "--text-lg--line-height": "var(--designkit-leading-lg)",
3785
+ "--text-xl--line-height": "var(--designkit-leading-xl)"
3469
3786
  };
3470
3787
  }
3471
3788
  function buildDarkTonalTokens(primaryHue, primaryChroma) {
@@ -3481,11 +3798,9 @@ function buildDarkTonalTokens(primaryHue, primaryChroma) {
3481
3798
  "--color-muted": `oklch(0.269 ${c(0.03)} ${primaryHue})`,
3482
3799
  "--color-secondary": `oklch(0.269 ${c(0.02)} ${primaryHue})`,
3483
3800
  "--color-accent": `oklch(0.320 ${c(0.04)} ${primaryHue})`,
3484
- "--dk-border": `oklch(0.32 ${c(0.06)} ${primaryHue})`,
3485
- "--dk-input": `oklch(0.35 ${c(0.06)} ${primaryHue})`,
3486
- "--dk-muted": `oklch(0.269 ${c(0.03)} ${primaryHue})`,
3487
- "--dg-border": `oklch(0.32 ${c(0.06)} ${primaryHue})`,
3488
- "--dg-muted": `oklch(0.269 ${c(0.03)} ${primaryHue})`
3801
+ "--designkit-border": `oklch(0.32 ${c(0.06)} ${primaryHue})`,
3802
+ "--designkit-input": `oklch(0.35 ${c(0.06)} ${primaryHue})`,
3803
+ "--designkit-muted": `oklch(0.269 ${c(0.03)} ${primaryHue})`
3489
3804
  };
3490
3805
  }
3491
3806
  function tokenMapToCss(tokens) {
@@ -3531,14 +3846,14 @@ ${tokenMapToCss(tokens)}
3531
3846
  }, [g.darkMode]);
3532
3847
  useEffect(() => {
3533
3848
  if (g.density === "default") {
3534
- document.documentElement.removeAttribute("data-dk-density");
3849
+ document.documentElement.removeAttribute("data-designkit-density");
3535
3850
  return;
3536
3851
  }
3537
- document.documentElement.dataset.dkDensity = g.density;
3852
+ document.documentElement.dataset.designkitDensity = g.density;
3538
3853
  }, [g.density]);
3539
3854
  }
3540
3855
  function buildTemplateTheme(g, ov = {}) {
3541
- return buildTokenMap({
3856
+ const tokens = buildTokenMap({
3542
3857
  radius: ov.radius ?? g.radius,
3543
3858
  primaryHue: g.primaryHue,
3544
3859
  primaryChroma: ov.primaryChroma ?? g.primaryChroma,
@@ -3549,8 +3864,12 @@ function buildTemplateTheme(g, ov = {}) {
3549
3864
  fontScale: g.fontScale ?? 1,
3550
3865
  lineHeight: g.lineHeight ?? 1
3551
3866
  });
3867
+ if (g.darkMode) {
3868
+ Object.assign(tokens, buildDarkTonalTokens(g.primaryHue, ov.primaryChroma ?? g.primaryChroma));
3869
+ }
3870
+ return tokens;
3552
3871
  }
3553
3872
 
3554
- 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, LoginBodyTemplate, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, PageTopBar, 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, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useStyleInjector, useThemeStore };
3873
+ 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 };
3555
3874
  //# sourceMappingURL=index.js.map
3556
3875
  //# sourceMappingURL=index.js.map