@loykin/designkit 0.0.1-dev.0 → 0.0.1-dev.1

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
@@ -23,7 +23,6 @@ var tooltip = require('@base-ui/react/tooltip');
23
23
  var slider = require('@base-ui/react/slider');
24
24
  var _switch = require('@base-ui/react/switch');
25
25
  var tabs = require('@base-ui/react/tabs');
26
- var gridkit = require('@loykin/gridkit');
27
26
  var zustand = require('zustand');
28
27
 
29
28
  function _interopNamespace(e) {
@@ -1987,517 +1986,6 @@ function TabsContent({ className, ...props }) {
1987
1986
  }
1988
1987
  );
1989
1988
  }
1990
-
1991
- // src/components/templates/definitions.ts
1992
- var topBarOptions = [
1993
- {
1994
- key: "topBarShow",
1995
- label: "Top Bar",
1996
- type: "select",
1997
- choices: [
1998
- { value: "show", label: "Show" },
1999
- { value: "hide", label: "Hide" }
2000
- ],
2001
- defaultValue: "show"
2002
- },
2003
- {
2004
- key: "topBarVariant",
2005
- label: "Border",
2006
- type: "select",
2007
- choices: [
2008
- { value: "ghost", label: "None" },
2009
- { value: "default", label: "Line" }
2010
- ],
2011
- defaultValue: "ghost"
2012
- },
2013
- {
2014
- key: "topBarBg",
2015
- label: "Background",
2016
- type: "select",
2017
- choices: [
2018
- { value: "transparent", label: "Default" },
2019
- { value: "muted", label: "Muted" },
2020
- { value: "card", label: "Card" }
2021
- ],
2022
- defaultValue: "transparent"
2023
- }
2024
- ];
2025
- var loginOptions = [
2026
- {
2027
- key: "loginLayout",
2028
- label: "Layout",
2029
- type: "select",
2030
- choices: [
2031
- { value: "centered", label: "Centered" },
2032
- { value: "split", label: "Split" }
2033
- ],
2034
- defaultValue: "centered"
2035
- },
2036
- {
2037
- key: "loginSide",
2038
- label: "Brand Side",
2039
- type: "select",
2040
- choices: [
2041
- { value: "left", label: "Left" },
2042
- { value: "right", label: "Right" }
2043
- ],
2044
- defaultValue: "left"
2045
- },
2046
- {
2047
- key: "loginCard",
2048
- label: "Card",
2049
- type: "select",
2050
- choices: [
2051
- { value: "card", label: "Card" },
2052
- { value: "plain", label: "None" }
2053
- ],
2054
- defaultValue: "card"
2055
- },
2056
- {
2057
- key: "loginBg",
2058
- label: "Background",
2059
- type: "select",
2060
- choices: [
2061
- { value: "default", label: "Muted" },
2062
- { value: "subtle", label: "Gradient" },
2063
- { value: "none", label: "None" }
2064
- ],
2065
- defaultValue: "default"
2066
- },
2067
- {
2068
- key: "loginCardWidth",
2069
- label: "Width",
2070
- type: "select",
2071
- choices: [
2072
- { value: "sm", label: "Narrow" },
2073
- { value: "md", label: "Medium" },
2074
- { value: "lg", label: "Wide" }
2075
- ],
2076
- defaultValue: "sm"
2077
- }
2078
- ];
2079
- var TEMPLATE_DEFINITIONS = [
2080
- // ── DataGridView (nested under DataBodyTemplate) ─────────────────────────────
2081
- {
2082
- id: "table",
2083
- label: "Standard",
2084
- navigationSubgroupLabel: "Table",
2085
- group: "Table",
2086
- navigationGroup: "DataBodyTemplate",
2087
- layoutClassName: "layout-table",
2088
- exportComponent: "DataGridView",
2089
- exportKind: "data-grid",
2090
- preset: { radius: 0.125 },
2091
- options: topBarOptions,
2092
- preview: {
2093
- variant: "standard",
2094
- breadcrumb: "Data / Table",
2095
- title: "Users"
2096
- }
2097
- },
2098
- {
2099
- id: "table-infinity",
2100
- label: "Infinite Scroll",
2101
- group: "Table",
2102
- navigationGroup: "DataBodyTemplate",
2103
- navigationParent: "table",
2104
- layoutClassName: "layout-table-infinity",
2105
- exportComponent: "DataGridView",
2106
- exportKind: "data-grid",
2107
- preset: { radius: 0.125 },
2108
- preview: {
2109
- variant: "infinity",
2110
- breadcrumb: "Data / Table / Infinite Scroll",
2111
- title: "Users",
2112
- description: "gridkit DataGridInfinity"
2113
- },
2114
- options: topBarOptions
2115
- },
2116
- {
2117
- id: "table-drag",
2118
- label: "Row Drag",
2119
- group: "Table",
2120
- navigationGroup: "DataBodyTemplate",
2121
- navigationParent: "table",
2122
- layoutClassName: "layout-table-drag",
2123
- exportComponent: "DataGridView",
2124
- exportKind: "data-grid",
2125
- preset: { radius: 0.125 },
2126
- preview: {
2127
- variant: "drag",
2128
- breadcrumb: "Data / Table / Row Drag",
2129
- title: "Services",
2130
- description: "gridkit DataGridDrag"
2131
- },
2132
- options: topBarOptions
2133
- },
2134
- {
2135
- id: "table-card",
2136
- label: "Card Grid",
2137
- navigationSubgroupLabel: "Card",
2138
- group: "Table",
2139
- navigationGroup: "DataBodyTemplate",
2140
- layoutClassName: "layout-table-card",
2141
- exportComponent: "DataGridView",
2142
- exportKind: "data-grid-card",
2143
- preset: { radius: 0.375 },
2144
- preview: {
2145
- variant: "card",
2146
- breadcrumb: "Data / Table / Card Grid",
2147
- title: "User Cards",
2148
- description: "gridkit DataGridCard"
2149
- },
2150
- options: topBarOptions
2151
- },
2152
- {
2153
- id: "table-card-list",
2154
- label: "Card List",
2155
- group: "Table",
2156
- navigationGroup: "DataBodyTemplate",
2157
- navigationParent: "table-card",
2158
- layoutClassName: "layout-table-card-list",
2159
- exportComponent: "DataGridView",
2160
- exportKind: "data-grid-card",
2161
- preset: { radius: 0.375 },
2162
- preview: {
2163
- variant: "card-list",
2164
- breadcrumb: "Data / Table / Card List",
2165
- title: "User Cards",
2166
- description: "gridkit DataGridCard list mode"
2167
- },
2168
- options: topBarOptions
2169
- },
2170
- // ── DataBodyTemplate ─────────────────────────────────────────────────────────
2171
- {
2172
- id: "databody",
2173
- label: "Standard",
2174
- navigationSubgroupLabel: "Data View",
2175
- group: "Pages",
2176
- navigationGroup: "DataBodyTemplate",
2177
- layoutClassName: "layout-databody",
2178
- exportComponent: "DataBodyTemplate",
2179
- exportKind: "databody",
2180
- preset: { radius: 0.375 },
2181
- options: topBarOptions
2182
- },
2183
- {
2184
- id: "databody-detail",
2185
- label: "Detail",
2186
- group: "Pages",
2187
- navigationGroup: "DataBodyTemplate",
2188
- navigationParent: "databody",
2189
- layoutClassName: "layout-databody-detail",
2190
- exportComponent: "DataBodyTemplate",
2191
- exportKind: "databody",
2192
- preset: { radius: 0.375 },
2193
- options: topBarOptions
2194
- },
2195
- {
2196
- id: "databody-split",
2197
- label: "Split",
2198
- group: "Pages",
2199
- navigationGroup: "DataBodyTemplate",
2200
- navigationParent: "databody",
2201
- layoutClassName: "layout-databody-split",
2202
- exportComponent: "DataBodyTemplate",
2203
- exportKind: "databody",
2204
- preset: { radius: 0.375 },
2205
- options: topBarOptions
2206
- },
2207
- {
2208
- id: "tabbed",
2209
- label: "Tabbed",
2210
- group: "Pages",
2211
- navigationGroup: "DataBodyTemplate",
2212
- navigationParent: "databody",
2213
- layoutClassName: "layout-tabbed",
2214
- exportComponent: "DataBodyTemplate",
2215
- exportKind: "databody",
2216
- preset: { radius: 0.375 },
2217
- options: topBarOptions
2218
- },
2219
- {
2220
- id: "form",
2221
- label: "Form Horizontal",
2222
- navigationLabel: "Horizontal",
2223
- navigationSubgroupLabel: "Form",
2224
- group: "Pages",
2225
- navigationGroup: "DataBodyTemplate",
2226
- layoutClassName: "layout-form",
2227
- exportComponent: "DataBodyTemplate",
2228
- exportKind: "databody",
2229
- preset: { radius: 0.5 },
2230
- options: topBarOptions
2231
- },
2232
- {
2233
- id: "form-stacked",
2234
- label: "Form Stacked",
2235
- navigationLabel: "Stacked",
2236
- group: "Pages",
2237
- navigationGroup: "DataBodyTemplate",
2238
- navigationParent: "form",
2239
- layoutClassName: "layout-form-stacked",
2240
- exportComponent: "DataBodyTemplate",
2241
- exportKind: "databody",
2242
- preset: { radius: 0.5 },
2243
- options: topBarOptions
2244
- },
2245
- {
2246
- id: "form-inline",
2247
- label: "Form Inline",
2248
- navigationLabel: "Inline",
2249
- group: "Pages",
2250
- navigationGroup: "DataBodyTemplate",
2251
- navigationParent: "form",
2252
- layoutClassName: "layout-form-inline",
2253
- exportComponent: "DataBodyTemplate",
2254
- exportKind: "databody",
2255
- preset: { radius: 0.25 },
2256
- options: topBarOptions
2257
- },
2258
- {
2259
- id: "sectioned",
2260
- label: "Sectioned",
2261
- group: "Pages",
2262
- navigationGroup: "DataBodyTemplate",
2263
- layoutClassName: "layout-sectioned",
2264
- exportComponent: "DataBodyTemplate",
2265
- exportKind: "body-template",
2266
- preset: { radius: 0.5 },
2267
- options: topBarOptions
2268
- },
2269
- // ── Common ───────────────────────────────────────────────────────────────────
2270
- {
2271
- id: "typography",
2272
- label: "Typography",
2273
- navigationSubgroupLabel: "Typography",
2274
- group: "Design",
2275
- navigationGroup: "Common",
2276
- layoutClassName: "layout-typography",
2277
- exportComponent: "TypographyBodyTemplate",
2278
- exportKind: "body-template",
2279
- preset: { radius: 0.375 }
2280
- },
2281
- {
2282
- id: "colors",
2283
- label: "Colors",
2284
- navigationSubgroupLabel: "Colors",
2285
- group: "Design",
2286
- navigationGroup: "Common",
2287
- layoutClassName: "layout-colors",
2288
- exportComponent: "ColorsBodyTemplate",
2289
- exportKind: "body-template",
2290
- preset: { radius: 0.375 }
2291
- },
2292
- // ── FormWizardBodyTemplate ────────────────────────────────────────────────────
2293
- {
2294
- id: "form-wizard",
2295
- label: "Wizard",
2296
- group: "Pages",
2297
- navigationGroup: "FormWizardBodyTemplate",
2298
- layoutClassName: "layout-form-wizard",
2299
- exportComponent: "FormWizardBodyTemplate",
2300
- exportKind: "body-template",
2301
- preset: { radius: 0.5 },
2302
- options: topBarOptions
2303
- },
2304
- // ── LoginBodyTemplate ─────────────────────────────────────────────────────────
2305
- {
2306
- id: "login",
2307
- label: "Sign In",
2308
- navigationSubgroupLabel: "Auth",
2309
- group: "Auth",
2310
- navigationGroup: "LoginBodyTemplate",
2311
- layoutClassName: "layout-login",
2312
- exportComponent: "LoginBodyTemplate",
2313
- exportKind: "login",
2314
- preset: { radius: 0.5 },
2315
- options: loginOptions
2316
- },
2317
- {
2318
- id: "login-forgot",
2319
- label: "Forgot Password",
2320
- navigationLabel: "Forgot",
2321
- group: "Auth",
2322
- navigationGroup: "LoginBodyTemplate",
2323
- navigationParent: "login",
2324
- layoutClassName: "layout-login",
2325
- exportComponent: "LoginBodyTemplate",
2326
- exportKind: "login",
2327
- preset: { radius: 0.5 },
2328
- options: loginOptions
2329
- },
2330
- {
2331
- id: "login-reset",
2332
- label: "Reset Password",
2333
- navigationLabel: "Reset",
2334
- group: "Auth",
2335
- navigationGroup: "LoginBodyTemplate",
2336
- navigationParent: "login",
2337
- layoutClassName: "layout-login",
2338
- exportComponent: "LoginBodyTemplate",
2339
- exportKind: "login",
2340
- preset: { radius: 0.5 },
2341
- options: loginOptions
2342
- },
2343
- {
2344
- id: "login-otp",
2345
- label: "OTP Verification",
2346
- navigationLabel: "OTP",
2347
- group: "Auth",
2348
- navigationGroup: "LoginBodyTemplate",
2349
- navigationParent: "login",
2350
- layoutClassName: "layout-login",
2351
- exportComponent: "LoginBodyTemplate",
2352
- exportKind: "login",
2353
- preset: { radius: 0.5 },
2354
- options: loginOptions
2355
- }
2356
- ];
2357
- function getTemplateDefinition(id) {
2358
- return TEMPLATE_DEFINITIONS.find((definition) => definition.id === id);
2359
- }
2360
- function createTemplateOverrides() {
2361
- return TEMPLATE_DEFINITIONS.reduce(
2362
- (acc, definition) => {
2363
- acc[definition.id] = { ...definition.preset };
2364
- return acc;
2365
- },
2366
- {}
2367
- );
2368
- }
2369
- function DataGridView({
2370
- data,
2371
- columns,
2372
- getRowId = (_row, index) => String(index),
2373
- variant = "standard",
2374
- tableHeight = "100%",
2375
- rowHeight = 36,
2376
- tableWidthMode = "fill-last",
2377
- enableSorting = true,
2378
- enableColumnFilters,
2379
- emptyMessage = "No rows found",
2380
- headerLeft: headerLeft3,
2381
- headerRight: headerRight3,
2382
- pagination,
2383
- footer,
2384
- infinity,
2385
- drag,
2386
- card
2387
- }) {
2388
- const [orderedData, setOrderedData] = React2.useState(data);
2389
- React2.useEffect(() => {
2390
- setOrderedData(data);
2391
- }, [data]);
2392
- const dragColumnSize = drag?.dragColumnSize ?? 28;
2393
- const dragColumns = React2.useMemo(
2394
- () => [
2395
- {
2396
- id: "drag",
2397
- size: dragColumnSize,
2398
- minSize: dragColumnSize,
2399
- maxSize: dragColumnSize,
2400
- enableResizing: false,
2401
- enableSorting: false,
2402
- header: () => null,
2403
- cell: () => /* @__PURE__ */ jsxRuntime.jsx(gridkit.DragHandleCell, {}),
2404
- meta: { align: "center" }
2405
- },
2406
- ...columns
2407
- ],
2408
- [columns, dragColumnSize]
2409
- );
2410
- const handleRowReorder = (rows) => {
2411
- setOrderedData(rows);
2412
- drag?.onRowReorder?.(rows);
2413
- };
2414
- if (variant === "infinity") {
2415
- return /* @__PURE__ */ jsxRuntime.jsx(
2416
- gridkit.DataGridInfinity,
2417
- {
2418
- data: infinity?.data ?? data,
2419
- columns,
2420
- getRowId,
2421
- tableHeight,
2422
- rowHeight,
2423
- enableSorting,
2424
- enableColumnFilters,
2425
- tableWidthMode,
2426
- headerLeft: headerLeft3,
2427
- headerRight: headerRight3,
2428
- hasNextPage: infinity?.hasNextPage ?? false,
2429
- isFetchingNextPage: infinity?.isFetchingNextPage ?? false,
2430
- fetchNextPage: infinity?.fetchNextPage ?? (() => void 0),
2431
- emptyMessage,
2432
- tableKey: infinity?.tableKey
2433
- }
2434
- );
2435
- }
2436
- if (variant === "drag") {
2437
- return /* @__PURE__ */ jsxRuntime.jsx(
2438
- gridkit.DataGridDrag,
2439
- {
2440
- data: orderedData,
2441
- columns: dragColumns,
2442
- getRowId,
2443
- onRowReorder: handleRowReorder,
2444
- tableHeight,
2445
- rowHeight,
2446
- columnSizing: { drag: dragColumnSize },
2447
- tableWidthMode,
2448
- headerLeft: headerLeft3,
2449
- headerRight: headerRight3,
2450
- emptyMessage,
2451
- classNames: {
2452
- cell: "[&[data-col-id=drag]]:px-1",
2453
- headerCell: "[&[data-col-id=drag]]:px-1"
2454
- }
2455
- }
2456
- );
2457
- }
2458
- if (variant === "card" || variant === "card-list") {
2459
- if (!card?.renderCard) {
2460
- throw new Error("DataGridView card variants require card.renderCard.");
2461
- }
2462
- return /* @__PURE__ */ jsxRuntime.jsx(
2463
- gridkit.DataGridCard,
2464
- {
2465
- data,
2466
- columns,
2467
- getRowId,
2468
- tableHeight,
2469
- rowHeight,
2470
- enableSorting,
2471
- enableColumnFilters,
2472
- tableWidthMode,
2473
- headerLeft: headerLeft3,
2474
- headerRight: headerRight3,
2475
- cardColumns: card?.cardColumns ?? (variant === "card-list" ? 1 : void 0),
2476
- minCardWidth: card?.minCardWidth ?? 220,
2477
- minColumns: card?.minColumns ?? (variant === "card-list" ? 1 : 2),
2478
- renderCard: card.renderCard
2479
- }
2480
- );
2481
- }
2482
- return /* @__PURE__ */ jsxRuntime.jsx(
2483
- gridkit.DataGrid,
2484
- {
2485
- data,
2486
- columns,
2487
- getRowId,
2488
- tableHeight,
2489
- rowHeight,
2490
- enableSorting,
2491
- enableColumnFilters,
2492
- tableWidthMode,
2493
- headerLeft: headerLeft3,
2494
- headerRight: headerRight3,
2495
- pagination: pagination === false ? void 0 : pagination,
2496
- footer,
2497
- emptyMessage
2498
- }
2499
- );
2500
- }
2501
1989
  function Root({ children, className, style }) {
2502
1990
  return /* @__PURE__ */ jsxRuntime.jsx(
2503
1991
  "div",
@@ -2941,454 +2429,36 @@ var DataBodyTemplate = Object.assign(Root2, {
2941
2429
  Row: DataBodyRow,
2942
2430
  Field: DataBodyField
2943
2431
  });
2944
- function Breadcrumb({ className, ...props }) {
2945
- return /* @__PURE__ */ jsxRuntime.jsx(
2946
- "nav",
2947
- {
2948
- "aria-label": "breadcrumb",
2949
- "data-slot": "breadcrumb",
2950
- className: cn(className),
2951
- ...props
2952
- }
2953
- );
2954
- }
2955
- function BreadcrumbList({ className, ...props }) {
2956
- return /* @__PURE__ */ jsxRuntime.jsx(
2957
- "ol",
2958
- {
2959
- "data-slot": "breadcrumb-list",
2960
- className: cn(
2961
- "flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
2962
- className
2963
- ),
2964
- ...props
2965
- }
2966
- );
2967
- }
2968
- function BreadcrumbItem({ className, ...props }) {
2969
- return /* @__PURE__ */ jsxRuntime.jsx(
2970
- "li",
2971
- {
2972
- "data-slot": "breadcrumb-item",
2973
- className: cn("inline-flex items-center gap-1", className),
2974
- ...props
2975
- }
2976
- );
2977
- }
2978
- function BreadcrumbLink({
2979
- className,
2980
- render,
2981
- ...props
2982
- }) {
2983
- return useRender.useRender({
2984
- defaultTagName: "a",
2985
- props: mergeProps.mergeProps(
2986
- {
2987
- className: cn("transition-colors hover:text-foreground", className)
2988
- },
2989
- props
2990
- ),
2991
- render,
2992
- state: {
2993
- slot: "breadcrumb-link"
2994
- }
2995
- });
2996
- }
2997
- function BreadcrumbPage({ className, ...props }) {
2998
- return /* @__PURE__ */ jsxRuntime.jsx(
2999
- "span",
3000
- {
3001
- "data-slot": "breadcrumb-page",
3002
- role: "link",
3003
- "aria-disabled": "true",
3004
- "aria-current": "page",
3005
- className: cn("font-normal text-foreground", className),
3006
- ...props
3007
- }
3008
- );
3009
- }
3010
- function BreadcrumbSeparator({
3011
- children,
3012
- className,
3013
- ...props
2432
+ function FormWizardBodyTemplate({
2433
+ theme,
2434
+ title,
2435
+ topBar,
2436
+ variant = "plain",
2437
+ steps,
2438
+ activeStep,
2439
+ onNext,
2440
+ onBack,
2441
+ onFinish
3014
2442
  }) {
3015
- return /* @__PURE__ */ jsxRuntime.jsx(
3016
- "li",
3017
- {
3018
- "data-slot": "breadcrumb-separator",
3019
- role: "presentation",
3020
- "aria-hidden": "true",
3021
- className: cn("[&>svg]:size-3.5", className),
3022
- ...props,
3023
- children: children ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, {})
3024
- }
3025
- );
3026
- }
3027
- function PageBreadcrumb({ items }) {
3028
- return /* @__PURE__ */ jsxRuntime.jsx(Breadcrumb, { children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbList, { className: "text-xs gap-1", children: items.map((item, i) => {
3029
- const isLast = i === items.length - 1;
3030
- const label = typeof item === "string" ? item : item.label;
3031
- const href = typeof item === "string" ? void 0 : item.href;
3032
- return /* @__PURE__ */ jsxRuntime.jsxs(React2__namespace.default.Fragment, { children: [
3033
- i > 0 && /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {}),
3034
- /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { children: isLast ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbPage, { className: "text-xs", children: label }) : href ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbLink, { href, className: "text-xs", children: label }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: label }) })
3035
- ] }, i);
3036
- }) }) });
3037
- }
3038
- function normalizeBreadcrumb(left) {
3039
- if (typeof left === "string") {
3040
- const items = left.split("/").map((s) => s.trim()).filter(Boolean);
3041
- return /* @__PURE__ */ jsxRuntime.jsx(PageBreadcrumb, { items });
2443
+ const current = steps[activeStep];
2444
+ const isLast = activeStep === steps.length - 1;
2445
+ function handleStepSubmit(e) {
2446
+ e.preventDefault();
2447
+ if (isLast) onFinish?.();
2448
+ else onNext?.();
3042
2449
  }
3043
- return left;
3044
- }
3045
- var bgClassMap = {
3046
- muted: "bg-muted",
3047
- card: "bg-card",
3048
- transparent: ""
3049
- };
3050
- function buildTopBar(opts) {
3051
- if (opts.topBarShow === "hide") return void 0;
3052
- return /* @__PURE__ */ jsxRuntime.jsx(
3053
- PageTopBar,
3054
- {
3055
- left: normalizeBreadcrumb(opts.left),
3056
- right: opts.right,
3057
- variant: opts.topBarVariant ?? "ghost",
3058
- className: bgClassMap[opts.topBarBg ?? "transparent"] ?? ""
3059
- }
3060
- );
3061
- }
3062
- function PageTopBar({
3063
- left,
3064
- right,
3065
- variant = "ghost",
3066
- height = "var(--dk-toolbar-height)",
3067
- className,
3068
- style,
3069
- children
3070
- }) {
3071
- return /* @__PURE__ */ jsxRuntime.jsxs(
3072
- "div",
3073
- {
3074
- className: cn(
3075
- "flex shrink-0 items-center justify-between gap-4 px-(--dk-page-padding-x)",
3076
- variant === "default" && "border-b",
3077
- className
3078
- ),
3079
- style: { height, ...style },
3080
- children: [
3081
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 items-center text-xs text-muted-foreground", children: normalizeBreadcrumb(left ?? children) }),
3082
- right && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: right })
3083
- ]
3084
- }
3085
- );
3086
- }
3087
- var users = [
3088
- {
3089
- id: "1",
3090
- name: "Sarah Kim",
3091
- email: "sarah@acme.com",
3092
- role: "Admin",
3093
- status: "active",
3094
- joined: "Jan 12, 2024"
3095
- },
3096
- {
3097
- id: "2",
3098
- name: "Marcus Lee",
3099
- email: "marcus@acme.com",
3100
- role: "Editor",
3101
- status: "active",
3102
- joined: "Feb 3, 2024"
3103
- },
3104
- {
3105
- id: "3",
3106
- name: "Ji-Yeon Park",
3107
- email: "jiyeon@acme.com",
3108
- role: "Viewer",
3109
- status: "inactive",
3110
- joined: "Mar 18, 2024"
3111
- },
3112
- {
3113
- id: "4",
3114
- name: "Alex Chen",
3115
- email: "alex@acme.com",
3116
- role: "Editor",
3117
- status: "pending",
3118
- joined: "Apr 7, 2024"
3119
- }
3120
- ];
3121
- var statusVariant = { active: "default", pending: "secondary", inactive: "outline" };
3122
- var userColumns = [
3123
- {
3124
- id: "name",
3125
- accessorKey: "name",
3126
- header: "Name",
3127
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: row.original.name })
3128
- },
3129
- {
3130
- id: "email",
3131
- accessorKey: "email",
3132
- header: "Email",
3133
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: row.original.email })
3134
- },
3135
- {
3136
- id: "role",
3137
- accessorKey: "role",
3138
- header: "Role",
3139
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-xs font-normal", children: row.original.role })
3140
- },
3141
- {
3142
- id: "status",
3143
- accessorKey: "status",
3144
- header: "Status",
3145
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant[row.original.status], className: "text-xs capitalize", children: row.original.status })
3146
- },
3147
- {
3148
- id: "joined",
3149
- accessorKey: "joined",
3150
- header: "Joined",
3151
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: row.original.joined })
3152
- }
3153
- ];
3154
- var headerLeft = (table) => /* @__PURE__ */ jsxRuntime.jsx(gridkit.GlobalSearch, { table, placeholder: "Search..." });
3155
- var headerRight = () => /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", className: "h-8 gap-1.5 text-xs", children: [
3156
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-3.5 w-3.5" }),
3157
- "Add User"
3158
- ] });
3159
- function UserTable() {
3160
- return /* @__PURE__ */ jsxRuntime.jsx(
3161
- gridkit.DataGrid,
3162
- {
3163
- data: users,
3164
- columns: userColumns,
3165
- getRowId: (row) => row.id,
3166
- tableHeight: 420,
3167
- rowHeight: 36,
3168
- enableSorting: true,
3169
- tableWidthMode: "fill-last",
3170
- headerLeft,
3171
- headerRight,
3172
- pagination: { pageSize: 10 },
3173
- footer: (table) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-9 items-center justify-between px-1 text-xs text-muted-foreground", children: [
3174
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
3175
- users.length,
3176
- " results"
3177
- ] }),
3178
- /* @__PURE__ */ jsxRuntime.jsx(gridkit.DataGridPaginationCompact, { table })
3179
- ] })
3180
- }
3181
- );
3182
- }
3183
- function UserCards() {
3184
- return /* @__PURE__ */ jsxRuntime.jsx(
3185
- gridkit.DataGridCard,
3186
- {
3187
- data: users,
3188
- columns: userColumns,
3189
- getRowId: (row) => row.id,
3190
- tableHeight: 420,
3191
- rowHeight: 36,
3192
- enableSorting: true,
3193
- tableWidthMode: "fill-last",
3194
- headerLeft,
3195
- headerRight,
3196
- minCardWidth: 220,
3197
- minColumns: 2,
3198
- renderCard: (row) => /* @__PURE__ */ jsxRuntime.jsx(Card, { size: "sm", className: "h-full rounded-lg border border-border shadow-sm ring-0", children: /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "py-3", children: [
3199
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
3200
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
3201
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-sm font-medium", children: row.original.name }),
3202
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-xs text-muted-foreground", children: row.original.email })
3203
- ] }),
3204
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant[row.original.status], className: "text-xs capitalize", children: row.original.status })
3205
- ] }),
3206
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 grid grid-cols-2 gap-3 text-xs", children: [
3207
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3208
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: "Role" }),
3209
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 font-medium", children: row.original.role })
3210
- ] }),
3211
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3212
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: "Joined" }),
3213
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 font-medium", children: row.original.joined })
3214
- ] })
3215
- ] })
3216
- ] }) })
3217
- }
3218
- );
3219
- }
3220
- var recentColumns = [
3221
- {
3222
- id: "name",
3223
- accessorKey: "name",
3224
- header: "Name",
3225
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: row.original.name })
3226
- },
3227
- {
3228
- id: "role",
3229
- accessorKey: "role",
3230
- header: "Role",
3231
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-xs font-normal", children: row.original.role })
3232
- },
3233
- {
3234
- id: "status",
3235
- accessorKey: "status",
3236
- header: "Status",
3237
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant[row.original.status], className: "text-xs capitalize", children: row.original.status })
3238
- },
3239
- {
3240
- id: "joined",
3241
- accessorKey: "joined",
3242
- header: "Joined",
3243
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: row.original.joined })
3244
- }
3245
- ];
3246
- function OverviewContent() {
3247
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3248
- /* @__PURE__ */ jsxRuntime.jsx(
3249
- DataBodyTemplate.Group,
3250
- {
3251
- layout: "horizontal",
3252
- title: "Workspace",
3253
- description: "Basic workspace information and plan details.",
3254
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
3255
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Workspace name", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: "Acme Corp" }) }),
3256
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Plan", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "secondary", className: "text-xs", children: "Pro" }) }),
3257
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Region", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "us-east-1" }) }),
3258
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "SSO", children: /* @__PURE__ */ jsxRuntime.jsx(Switch, { defaultChecked: true }) })
3259
- ] })
3260
- }
3261
- ),
3262
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Group, { layout: "stacked", title: "Members", description: "Recently added members.", children: /* @__PURE__ */ jsxRuntime.jsx(
3263
- gridkit.DataGrid,
3264
- {
3265
- data: users,
3266
- columns: recentColumns,
3267
- getRowId: (row) => row.id,
3268
- tableHeight: 220,
3269
- rowHeight: 36,
3270
- tableWidthMode: "fill-last",
3271
- headerRight: () => /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", className: "h-8 gap-1.5 text-xs", children: [
3272
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-3.5 w-3.5" }),
3273
- "Invite"
3274
- ] })
3275
- }
3276
- ) })
3277
- ] });
3278
- }
3279
- function CustomContent() {
3280
- return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: "rounded-lg border border-border ring-0", children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "grid gap-3 p-4 md:grid-cols-3", children: ["Header", "Tabs", "Content"].map((label) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border bg-muted/30 p-3", children: [
3281
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: label }),
3282
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "ReactNode slot" })
3283
- ] }, label)) }) });
3284
- }
3285
- function DataBodyTemplateDemo({ theme, topBarShow, topBarVariant, topBarBg }) {
3286
- return /* @__PURE__ */ jsxRuntime.jsxs(
3287
- DataBodyTemplate,
3288
- {
3289
- theme,
3290
- topBar: buildTopBar({ topBarShow, topBarVariant, topBarBg, left: "Design / Body Template" }),
3291
- title: "Body Template",
3292
- description: "Compound body shell with optional tabs and arbitrary content",
3293
- children: [
3294
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Tab, { id: "overview", label: "Overview", children: /* @__PURE__ */ jsxRuntime.jsx(OverviewContent, {}) }),
3295
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Tab, { id: "table", label: "Table", count: users.length, children: /* @__PURE__ */ jsxRuntime.jsx(UserTable, {}) }),
3296
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Tab, { id: "cards", label: "Cards", count: users.length, children: /* @__PURE__ */ jsxRuntime.jsx(UserCards, {}) }),
3297
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Tab, { id: "custom", label: "Custom", children: /* @__PURE__ */ jsxRuntime.jsx(CustomContent, {}) }),
3298
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Tab, { id: "empty", label: "Empty", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-4", children: [
3299
- /* @__PURE__ */ jsxRuntime.jsx(
3300
- EmptyState,
3301
- {
3302
- icon: lucideReact.Users,
3303
- title: "No users yet",
3304
- description: "Add your first user to get started.",
3305
- action: { label: "Add User", onClick: () => {
3306
- } }
3307
- }
3308
- ),
3309
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t" }),
3310
- /* @__PURE__ */ jsxRuntime.jsx(
3311
- EmptyState,
3312
- {
3313
- icon: lucideReact.Search,
3314
- title: "No results found",
3315
- description: "Try adjusting your search or filters.",
3316
- action: { label: "Clear filters", variant: "ghost", onClick: () => {
3317
- } }
3318
- }
3319
- ),
3320
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t" }),
3321
- /* @__PURE__ */ jsxRuntime.jsx(
3322
- EmptyState,
3323
- {
3324
- icon: lucideReact.RefreshCw,
3325
- title: "Something went wrong",
3326
- description: "Failed to load data. Please try again.",
3327
- action: { label: "Retry", onClick: () => {
3328
- } }
3329
- }
3330
- )
3331
- ] }) })
3332
- ]
3333
- }
3334
- );
3335
- }
3336
- function buildDataBodyTemplateCode({ themeProp, layoutClassName }) {
3337
- return [
3338
- `import { DataBodyTemplate } from '@loykin/designkit'`,
3339
- `import '@loykin/designkit/styles'`,
3340
- "",
3341
- `export function MyPage() {`,
3342
- ` return (`,
3343
- ` <DataBodyTemplate${themeProp}`,
3344
- ` className="${layoutClassName}"`,
3345
- ` title="Page Title"`,
3346
- ` >`,
3347
- ` <DataBodyTemplate.Tab id="table" label="Table">`,
3348
- ` {/* table content */}`,
3349
- ` </DataBodyTemplate.Tab>`,
3350
- ``,
3351
- ` <DataBodyTemplate.Tab id="split" label="Split">`,
3352
- ` <DataBodyTemplate.Group layout="split">`,
3353
- ` <aside>{/* list content */}</aside>`,
3354
- ` <section>{/* detail content */}</section>`,
3355
- ` </DataBodyTemplate.Group>`,
3356
- ` </DataBodyTemplate.Tab>`,
3357
- ` </DataBodyTemplate>`,
3358
- ` )`,
3359
- `}`
3360
- ].join("\n");
3361
- }
3362
- function FormWizardBodyTemplate({
3363
- theme,
3364
- title,
3365
- topBar,
3366
- variant = "plain",
3367
- steps: steps2,
3368
- activeStep,
3369
- onNext,
3370
- onBack,
3371
- onFinish
3372
- }) {
3373
- const current = steps2[activeStep];
3374
- const isLast = activeStep === steps2.length - 1;
3375
- function handleStepSubmit(e) {
3376
- e.preventDefault();
3377
- if (isLast) onFinish?.();
3378
- else onNext?.();
3379
- }
3380
- return /* @__PURE__ */ jsxRuntime.jsxs(DataPage, { className: "layout-form-wizard", style: theme, children: [
3381
- topBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: topBar }),
3382
- /* @__PURE__ */ jsxRuntime.jsx(DataPage.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(DataPage.TitleBlock, { title }) }),
3383
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 px-(--dk-page-padding-x) pb-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: steps2.map((step, i) => /* @__PURE__ */ jsxRuntime.jsxs(React2.Fragment, { children: [
3384
- i > 0 && /* @__PURE__ */ jsxRuntime.jsx(
3385
- "div",
3386
- {
3387
- className: cn(
3388
- "mx-3 h-px flex-1",
3389
- i <= activeStep ? "bg-primary/50" : "bg-border"
3390
- )
3391
- }
2450
+ return /* @__PURE__ */ jsxRuntime.jsxs(DataPage, { className: "layout-form-wizard", style: theme, children: [
2451
+ topBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: topBar }),
2452
+ /* @__PURE__ */ jsxRuntime.jsx(DataPage.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(DataPage.TitleBlock, { title }) }),
2453
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 px-(--dk-page-padding-x) pb-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: steps.map((step, i) => /* @__PURE__ */ jsxRuntime.jsxs(React2.Fragment, { children: [
2454
+ i > 0 && /* @__PURE__ */ jsxRuntime.jsx(
2455
+ "div",
2456
+ {
2457
+ className: cn(
2458
+ "mx-3 h-px flex-1",
2459
+ i <= activeStep ? "bg-primary/50" : "bg-border"
2460
+ )
2461
+ }
3392
2462
  ),
3393
2463
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
3394
2464
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3444,210 +2514,13 @@ function FormWizardBodyTemplate({
3444
2514
  "Step ",
3445
2515
  activeStep + 1,
3446
2516
  " of ",
3447
- steps2.length
2517
+ steps.length
3448
2518
  ] }),
3449
2519
  /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", form: current?.key, size: "sm", className: "h-8 text-xs", children: isLast ? "Finish" : "Continue" })
3450
2520
  ] })
3451
2521
  ] }) })
3452
2522
  ] });
3453
2523
  }
3454
- var steps = [
3455
- {
3456
- key: "account",
3457
- title: "Your Details",
3458
- description: "Create your account credentials.",
3459
- content: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
3460
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
3461
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
3462
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "wiz-first-name", className: "text-xs", children: "First Name" }),
3463
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "wiz-first-name", defaultValue: "Sarah", className: "h-8 text-sm" })
3464
- ] }),
3465
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
3466
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "wiz-last-name", className: "text-xs", children: "Last Name" }),
3467
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "wiz-last-name", defaultValue: "Kim", className: "h-8 text-sm" })
3468
- ] })
3469
- ] }),
3470
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
3471
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "wiz-email", className: "text-xs", children: "Work Email" }),
3472
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "wiz-email", type: "email", defaultValue: "sarah@acme.com", className: "h-8 text-sm" })
3473
- ] }),
3474
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
3475
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "wiz-password", className: "text-xs", children: "Password" }),
3476
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "wiz-password", type: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", className: "h-8 text-sm" }),
3477
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "At least 8 characters." })
3478
- ] }),
3479
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
3480
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "wiz-confirm-password", className: "text-xs", children: "Confirm Password" }),
3481
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "wiz-confirm-password", type: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", className: "h-8 text-sm" })
3482
- ] })
3483
- ] })
3484
- },
3485
- {
3486
- key: "role",
3487
- title: "Your Role",
3488
- description: "Tell us about yourself so we can tailor your experience.",
3489
- content: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
3490
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
3491
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "wiz-job-title", className: "text-xs", children: "Job Title" }),
3492
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "wiz-job-title", defaultValue: "Senior Frontend Engineer", className: "h-8 text-sm" })
3493
- ] }),
3494
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
3495
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "wiz-department", className: "text-xs", children: "Department" }),
3496
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { defaultValue: "engineering", children: [
3497
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "h-8 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
3498
- /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
3499
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "engineering", children: "Engineering" }),
3500
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "design", children: "Design" }),
3501
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "product", children: "Product" }),
3502
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "marketing", children: "Marketing" }),
3503
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "ops", children: "Operations" })
3504
- ] })
3505
- ] })
3506
- ] }),
3507
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
3508
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "wiz-team-size", className: "text-xs", children: "Team Size" }),
3509
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { defaultValue: "11-50", children: [
3510
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id: "wiz-team-size", className: "h-8 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
3511
- /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
3512
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "1-10", children: "1\u201310" }),
3513
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "11-50", children: "11\u201350" }),
3514
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "51-200", children: "51\u2013200" }),
3515
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "200+", children: "200+" })
3516
- ] })
3517
- ] })
3518
- ] })
3519
- ] })
3520
- },
3521
- {
3522
- key: "preferences",
3523
- title: "Preferences",
3524
- description: "Configure your defaults. You can change these anytime.",
3525
- content: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
3526
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
3527
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
3528
- /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-xs", children: "Timezone" }),
3529
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { defaultValue: "asia-seoul", children: [
3530
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "h-8 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
3531
- /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
3532
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "asia-seoul", children: "Asia / Seoul" }),
3533
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "us-eastern", children: "US / Eastern" }),
3534
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "us-pacific", children: "US / Pacific" }),
3535
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "europe-london", children: "Europe / London" })
3536
- ] })
3537
- ] })
3538
- ] }),
3539
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
3540
- /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-xs", children: "Date Format" }),
3541
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { defaultValue: "ymd", children: [
3542
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "h-8 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
3543
- /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
3544
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "ymd", children: "YYYY-MM-DD" }),
3545
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "mdy", children: "MM/DD/YYYY" }),
3546
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "dmy", children: "DD/MM/YYYY" })
3547
- ] })
3548
- ] })
3549
- ] })
3550
- ] }),
3551
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3 pt-1", children: [
3552
- { label: "Email notifications", desc: "Get notified of important activity.", on: true },
3553
- { label: "Weekly digest", desc: "A weekly summary email every Monday.", on: false },
3554
- { label: "Browser push", desc: "Real-time desktop notifications.", on: true }
3555
- ].map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
3556
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3557
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: item.label }),
3558
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: item.desc })
3559
- ] }),
3560
- /* @__PURE__ */ jsxRuntime.jsx(Switch, { defaultChecked: item.on })
3561
- ] }, item.label)) })
3562
- ] })
3563
- },
3564
- {
3565
- key: "review",
3566
- title: "Review & Confirm",
3567
- description: "Check your details before creating the account.",
3568
- content: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
3569
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border divide-y", children: [
3570
- { label: "Name", value: "Sarah Kim" },
3571
- { label: "Email", value: "sarah@acme.com" },
3572
- { label: "Department", value: "Engineering" },
3573
- { label: "Timezone", value: "Asia / Seoul" }
3574
- ].map((row) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-2.5", children: [
3575
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground w-28 shrink-0", children: row.label }),
3576
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium flex-1", children: row.value }),
3577
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-[10px] h-5", children: "Edit" })
3578
- ] }, row.label)) }),
3579
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2.5 pt-1", children: [
3580
- /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { id: "terms", className: "mt-0.5" }),
3581
- /* @__PURE__ */ jsxRuntime.jsxs(
3582
- Label,
3583
- {
3584
- htmlFor: "terms",
3585
- className: "text-xs text-muted-foreground leading-relaxed cursor-pointer",
3586
- children: [
3587
- "I agree to the",
3588
- " ",
3589
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground underline underline-offset-2", children: "Terms of Service" }),
3590
- " ",
3591
- "and ",
3592
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground underline underline-offset-2", children: "Privacy Policy" }),
3593
- "."
3594
- ]
3595
- }
3596
- )
3597
- ] })
3598
- ] })
3599
- }
3600
- ];
3601
- function FormWizardBodyTemplateDemo({
3602
- theme,
3603
- variant,
3604
- topBarShow,
3605
- topBarVariant,
3606
- topBarBg
3607
- }) {
3608
- const [activeStep, setActiveStep] = React2.useState(0);
3609
- return /* @__PURE__ */ jsxRuntime.jsx(
3610
- FormWizardBodyTemplate,
3611
- {
3612
- theme,
3613
- variant,
3614
- topBar: buildTopBar({ topBarShow, topBarVariant, topBarBg, left: "Pages / Form / Wizard" }),
3615
- title: "Create Account",
3616
- steps,
3617
- activeStep,
3618
- onNext: () => setActiveStep((s) => Math.min(s + 1, steps.length - 1)),
3619
- onBack: () => setActiveStep((s) => Math.max(s - 1, 0)),
3620
- onFinish: () => setActiveStep(0)
3621
- }
3622
- );
3623
- }
3624
- function buildFormWizardBodyTemplateCode({ themeProp }) {
3625
- return [
3626
- `import { useState } from 'react'`,
3627
- `import { FormWizardBodyTemplate, type FormWizardStep } from '@loykin/designkit'`,
3628
- `import '@loykin/designkit/styles'`,
3629
- "",
3630
- `const steps: FormWizardStep[] = [`,
3631
- ` { key: 'info', title: 'Basic Info', content: <div>{/* step 1 */}</div> },`,
3632
- ` { key: 'config', title: 'Configuration', content: <div>{/* step 2 */}</div> },`,
3633
- ` { key: 'review', title: 'Review', content: <div>{/* step 3 */}</div> },`,
3634
- `]`,
3635
- "",
3636
- `export function MyPage() {`,
3637
- ` const [step, setStep] = useState(0)`,
3638
- ` return (`,
3639
- ` <FormWizardBodyTemplate${themeProp}`,
3640
- ` title="Setup Wizard"`,
3641
- ` steps={steps}`,
3642
- ` activeStep={step}`,
3643
- ` onNext={() => setStep((s) => Math.min(s + 1, steps.length - 1))}`,
3644
- ` onBack={() => setStep((s) => Math.max(s - 1, 0))}`,
3645
- ` onFinish={() => { /* handle finish */ }}`,
3646
- ` />`,
3647
- ` )`,
3648
- `}`
3649
- ].join("\n");
3650
- }
3651
2524
  var scaleRows = [
3652
2525
  { label: "Page title", className: "text-xl font-semibold", sample: "Customer Operations" },
3653
2526
  { label: "Section title", className: "text-base font-medium", sample: "Service Health" },
@@ -3736,7 +2609,7 @@ var useThemeStore = zustand.create((set) => ({
3736
2609
  density: "default",
3737
2610
  darkMode: false
3738
2611
  },
3739
- overrides: createTemplateOverrides(),
2612
+ overrides: {},
3740
2613
  activeShell: "sidebar",
3741
2614
  activeTemplate: "table",
3742
2615
  setGlobal: (patch) => set((s) => ({ global: { ...s.global, ...patch } })),
@@ -4029,1490 +2902,149 @@ function LoginBodyTemplate({
4029
2902
  }
4030
2903
  );
4031
2904
  }
4032
- var demoData = [
4033
- {
4034
- id: "1",
4035
- name: "Sarah Kim",
4036
- email: "sarah@acme.com",
4037
- role: "Admin",
4038
- status: "active",
4039
- joined: "Jan 12, 2024"
4040
- },
4041
- {
4042
- id: "2",
4043
- name: "Marcus Lee",
4044
- email: "marcus@acme.com",
4045
- role: "Editor",
4046
- status: "active",
4047
- joined: "Feb 3, 2024"
4048
- },
4049
- {
4050
- id: "3",
4051
- name: "Ji-Yeon Park",
4052
- email: "jiyeon@acme.com",
4053
- role: "Viewer",
4054
- status: "inactive",
4055
- joined: "Mar 18, 2024"
4056
- },
4057
- {
4058
- id: "4",
4059
- name: "Alex Chen",
4060
- email: "alex@acme.com",
4061
- role: "Editor",
4062
- status: "active",
4063
- joined: "Apr 7, 2024"
4064
- },
4065
- {
4066
- id: "5",
4067
- name: "Dana White",
4068
- email: "dana@acme.com",
4069
- role: "Viewer",
4070
- status: "pending",
4071
- joined: "Apr 29, 2024"
4072
- },
4073
- {
4074
- id: "6",
4075
- name: "Leo Torres",
4076
- email: "leo@acme.com",
4077
- role: "Admin",
4078
- status: "inactive",
4079
- joined: "May 1, 2024"
4080
- },
4081
- {
4082
- id: "7",
4083
- name: "Mina Seo",
4084
- email: "mina@acme.com",
4085
- role: "Editor",
4086
- status: "active",
4087
- joined: "May 2, 2024"
4088
- },
4089
- {
4090
- id: "8",
4091
- name: "Ryan Patel",
4092
- email: "ryan@acme.com",
4093
- role: "Viewer",
4094
- status: "active",
4095
- joined: "May 15, 2024"
4096
- },
4097
- {
4098
- id: "9",
4099
- name: "Yuna Choi",
4100
- email: "yuna@acme.com",
4101
- role: "Editor",
4102
- status: "pending",
4103
- joined: "Jun 3, 2024"
4104
- },
4105
- {
4106
- id: "10",
4107
- name: "Tom Fischer",
4108
- email: "tom@acme.com",
4109
- role: "Viewer",
4110
- status: "active",
4111
- joined: "Jun 20, 2024"
4112
- }
4113
- ];
4114
- var demoInfiniteData = Array.from({ length: 120 }, (_, index) => {
4115
- const source = demoData[index % demoData.length];
4116
- const id = String(index + 1);
4117
- return {
4118
- ...source,
4119
- id,
4120
- name: `${source.name} ${id}`,
4121
- email: source.email.replace("@", `+${id}@`)
4122
- };
4123
- });
4124
- var statusVariant2 = { active: "default", pending: "secondary", inactive: "outline" };
4125
- var demoColumns = [
4126
- {
4127
- id: "name",
4128
- accessorKey: "name",
4129
- header: "Name",
4130
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: row.original.name })
4131
- },
4132
- {
4133
- id: "email",
4134
- accessorKey: "email",
4135
- header: "Email",
4136
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: row.original.email })
4137
- },
4138
- {
4139
- id: "role",
4140
- accessorKey: "role",
4141
- header: "Role",
4142
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-xs font-normal", children: row.original.role })
4143
- },
4144
- {
4145
- id: "status",
4146
- accessorKey: "status",
4147
- header: "Status",
4148
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant2[row.original.status], className: "text-xs capitalize", children: row.original.status })
4149
- },
4150
- {
4151
- id: "joined",
4152
- accessorKey: "joined",
4153
- header: "Joined",
4154
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: row.original.joined })
4155
- }
4156
- ];
4157
- var headerLeft2 = (table) => /* @__PURE__ */ jsxRuntime.jsx(gridkit.GlobalSearch, { table, placeholder: "Search..." });
4158
- var headerRight2 = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
4159
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", className: "h-8 gap-1.5 text-xs", children: [
4160
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-3.5 w-3.5" }),
4161
- "Export"
4162
- ] }),
4163
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", className: "h-8 gap-1.5 text-xs", children: [
4164
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-3.5 w-3.5" }),
4165
- "Add User"
4166
- ] })
4167
- ] });
4168
- function renderDemoCard(variant) {
4169
- return (row) => {
4170
- const user = row.original;
4171
- if (variant === "card-list") {
4172
- return /* @__PURE__ */ jsxRuntime.jsx(Card, { size: "sm", className: "rounded-lg border border-border shadow-sm ring-0", children: /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "flex items-center justify-between gap-4 py-2.5", children: [
4173
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
4174
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-sm font-medium", children: user.name }),
4175
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-xs text-muted-foreground", children: user.email })
4176
- ] }),
4177
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-4 text-xs", children: [
4178
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: user.role }),
4179
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant2[user.status], className: "text-xs capitalize", children: user.status }),
4180
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-20 text-right text-muted-foreground", children: user.joined })
4181
- ] })
4182
- ] }) });
4183
- }
4184
- return /* @__PURE__ */ jsxRuntime.jsx(Card, { size: "sm", className: "h-full rounded-lg border border-border shadow-sm ring-0", children: /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "py-3", children: [
4185
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
4186
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
4187
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-sm font-medium", children: user.name }),
4188
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-xs text-muted-foreground", children: user.email })
4189
- ] }),
4190
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant2[user.status], className: "text-xs capitalize", children: user.status })
4191
- ] }),
4192
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 grid grid-cols-2 gap-3 text-xs", children: [
4193
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4194
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: "Role" }),
4195
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 font-medium", children: user.role })
4196
- ] }),
4197
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4198
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: "Joined" }),
4199
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 font-medium", children: user.joined })
4200
- ] })
4201
- ] })
4202
- ] }) });
4203
- };
4204
- }
4205
- function getDefaultLayoutClassName(variant) {
4206
- return variant === "standard" ? "layout-table" : `layout-table-${variant}`;
4207
- }
4208
- function DataGridTemplateDemo({
4209
- theme,
4210
- variant = "standard",
4211
- layoutClassName = getDefaultLayoutClassName(variant),
4212
- topBar,
4213
- title = "Users",
4214
- description,
4215
- topBarShow,
4216
- topBarVariant,
4217
- topBarBg
4218
- }) {
4219
- const resolvedTopBar = topBarShow !== void 0 || topBarVariant !== void 0 || topBarBg !== void 0 ? buildTopBar({ topBarShow, topBarVariant, topBarBg, left: "Data / Table" }) : topBar ?? /* @__PURE__ */ jsxRuntime.jsx(PageTopBar, { left: "Data / Table" });
4220
- const [visibleCount, setVisibleCount] = React2.useState(40);
4221
- const [isFetching, setIsFetching] = React2.useState(false);
4222
- const visibleData = demoInfiniteData.slice(0, visibleCount);
4223
- const hasNextPage = visibleCount < demoInfiniteData.length;
4224
- React2.useEffect(() => {
4225
- setVisibleCount(40);
4226
- }, [variant]);
4227
- const fetchNextPage = () => {
4228
- if (isFetching || !hasNextPage) return;
4229
- setIsFetching(true);
4230
- window.setTimeout(() => {
4231
- setVisibleCount((count) => Math.min(count + 30, demoInfiniteData.length));
4232
- setIsFetching(false);
4233
- }, 250);
4234
- };
2905
+ function Breadcrumb({ className, ...props }) {
4235
2906
  return /* @__PURE__ */ jsxRuntime.jsx(
4236
- DataBodyTemplate,
4237
- {
4238
- theme: { "--dg-card-padding": "0px", ...theme },
4239
- className: layoutClassName,
4240
- topBar: resolvedTopBar,
4241
- title,
4242
- description,
4243
- contentClassName: variant === "infinity" ? "pb-0" : void 0,
4244
- children: /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Body, { className: "[&_.dg-shell]:h-full [&_.dg-table-wrapper]:min-h-0 [&_.dg-table-wrapper]:flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
4245
- DataGridView,
4246
- {
4247
- data: variant === "infinity" ? visibleData : demoData,
4248
- columns: demoColumns,
4249
- getRowId: (row) => row.id,
4250
- variant,
4251
- enableColumnFilters: variant === "infinity" || variant === "card" || variant === "card-list",
4252
- headerLeft: headerLeft2,
4253
- headerRight: headerRight2,
4254
- pagination: { pageSize: 10 },
4255
- footer: (table) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-9 items-center justify-between px-1 text-xs text-muted-foreground", children: [
4256
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
4257
- demoData.length,
4258
- " results"
4259
- ] }),
4260
- /* @__PURE__ */ jsxRuntime.jsx(gridkit.DataGridPaginationCompact, { table })
4261
- ] }),
4262
- infinity: {
4263
- data: visibleData,
4264
- hasNextPage,
4265
- isFetchingNextPage: isFetching,
4266
- fetchNextPage,
4267
- tableKey: "table-infinity-template"
4268
- },
4269
- card: { renderCard: renderDemoCard(variant) }
4270
- }
4271
- ) })
4272
- }
4273
- );
4274
- }
4275
- function buildDataGridTemplateCode({
4276
- definition,
4277
- themeProp,
4278
- layoutClassName
4279
- }) {
4280
- const variant = definition.preview?.variant;
4281
- const variantProp = variant && variant !== "standard" ? `
4282
- variant="${variant}"` : "";
4283
- const cN = "className";
4284
- const cardRenderCode = definition.exportKind === "data-grid-card" ? [
4285
- "",
4286
- `function renderCard(row: { original: User }) {`,
4287
- ` const user = row.original`,
4288
- ` return (`,
4289
- ` <div ${cN}="rounded-lg border bg-card p-3 text-card-foreground">`,
4290
- ` <p ${cN}="text-sm font-medium">{user.name}</p>`,
4291
- ` <p ${cN}="text-xs text-muted-foreground">{user.email}</p>`,
4292
- ` </div>`,
4293
- ` )`,
4294
- `}`
4295
- ].join("\n") : "";
4296
- const cardProp = definition.exportKind === "data-grid-card" ? `
4297
- card={{ renderCard }}` : "";
4298
- return [
4299
- `import { DataBodyTemplate, DataGridView, PageTopBar, type DataGridColumnDef } from '@loykin/designkit'`,
4300
- `import '@loykin/designkit/styles'`,
4301
- "",
4302
- `type User = Record<string, unknown> & { id: string; name: string; email: string }`,
4303
- ``,
4304
- `const data: User[] = []`,
4305
- `const columns: DataGridColumnDef<User>[] = [`,
4306
- ` { id: 'name', accessorKey: 'name', header: 'Name' },`,
4307
- ` { id: 'email', accessorKey: 'email', header: 'Email' },`,
4308
- `]`,
4309
- cardRenderCode,
4310
- "",
4311
- `export function MyPage() {`,
4312
- ` return (`,
4313
- ` <DataBodyTemplate${themeProp}`,
4314
- ` className="${layoutClassName}"`,
4315
- ` topBar={<PageTopBar left="Data / Users" />}`,
4316
- ` title="Users"`,
4317
- ` >`,
4318
- ` <DataBodyTemplate.Body>`,
4319
- ` <DataGridView${variantProp}`,
4320
- ` data={data}`,
4321
- ` columns={columns}`,
4322
- ` getRowId={(row) => row.id}${cardProp}`,
4323
- ` tableHeight={420}`,
4324
- ` />`,
4325
- ` </DataBodyTemplate.Body>`,
4326
- ` </DataBodyTemplate>`,
4327
- ` )`,
4328
- `}`
4329
- ].filter(Boolean).join("\n");
4330
- }
4331
- function DetailBodyTemplateDemo({ theme, topBarShow, topBarVariant, topBarBg }) {
4332
- return /* @__PURE__ */ jsxRuntime.jsxs(
4333
- DataBodyTemplate,
2907
+ "nav",
4334
2908
  {
4335
- theme,
4336
- topBar: buildTopBar({ topBarShow, topBarVariant, topBarBg, left: "Users / Sarah Kim" }),
4337
- title: "Sarah Kim",
4338
- description: "sarah@acme.com",
4339
- actions: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
4340
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "sm", className: "h-8 text-xs", children: "Delete" }),
4341
- /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", className: "h-8 text-xs", children: "Edit" })
4342
- ] }),
4343
- children: [
4344
- /* @__PURE__ */ jsxRuntime.jsxs(DataBodyTemplate.Group, { layout: "inline", title: "Identity", children: [
4345
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Field, { label: "Full name", children: "Sarah Kim" }),
4346
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Field, { label: "Email", children: "sarah@acme.com" }),
4347
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Field, { label: "Role", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-xs font-normal", children: "Admin" }) }),
4348
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Field, { label: "Status", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { className: "text-xs capitalize", children: "Active" }) }),
4349
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Field, { label: "Joined", children: "Jan 12, 2024" })
4350
- ] }),
4351
- /* @__PURE__ */ jsxRuntime.jsxs(DataBodyTemplate.Group, { layout: "inline", title: "Account", children: [
4352
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Field, { label: "Plan", children: "Business" }),
4353
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Field, { label: "Seats used", children: "12 / 20" }),
4354
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Field, { label: "Billing cycle", children: "Monthly" }),
4355
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Field, { label: "Next renewal", children: "Jun 1, 2025" })
4356
- ] }),
4357
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Group, { layout: "inline", title: "Danger zone", danger: true, children: /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Field, { label: "Deactivate account", children: /* @__PURE__ */ jsxRuntime.jsx(
4358
- Button,
4359
- {
4360
- variant: "ghost",
4361
- size: "sm",
4362
- className: "h-7 text-xs text-destructive hover:text-destructive",
4363
- children: "Deactivate"
4364
- }
4365
- ) }) })
4366
- ]
2909
+ "aria-label": "breadcrumb",
2910
+ "data-slot": "breadcrumb",
2911
+ className: cn(className),
2912
+ ...props
4367
2913
  }
4368
2914
  );
4369
2915
  }
4370
- function buildDetailBodyTemplateCode({ themeProp, layoutClassName }) {
4371
- return [
4372
- `import { DataBodyTemplate } from '@loykin/designkit'`,
4373
- `import '@loykin/designkit/styles'`,
4374
- "",
4375
- `export function MyPage() {`,
4376
- ` return (`,
4377
- ` <DataBodyTemplate${themeProp}`,
4378
- ` className="${layoutClassName}"`,
4379
- ` breadcrumb="Users / Detail"`,
4380
- ` title="Sarah Kim"`,
4381
- ` actions={<button>Edit</button>}`,
4382
- ` >`,
4383
- ` <DataBodyTemplate.Group layout="inline" title="Identity">`,
4384
- ` <DataBodyTemplate.Field label="Name">Sarah Kim</DataBodyTemplate.Field>`,
4385
- ` <DataBodyTemplate.Field label="Email">sarah@acme.com</DataBodyTemplate.Field>`,
4386
- ` </DataBodyTemplate.Group>`,
4387
- ` </DataBodyTemplate>`,
4388
- ` )`,
4389
- `}`
4390
- ].join("\n");
4391
- }
4392
- var users2 = [
4393
- { id: "1", name: "Sarah Kim", email: "sarah@acme.com", role: "Admin", status: "active" },
4394
- { id: "2", name: "Marcus Lee", email: "marcus@acme.com", role: "Editor", status: "active" },
4395
- { id: "3", name: "Ji-Yeon Park", email: "jiyeon@acme.com", role: "Viewer", status: "inactive" },
4396
- { id: "4", name: "Alex Chen", email: "alex@acme.com", role: "Editor", status: "pending" }
4397
- ];
4398
- var statusVariant3 = { active: "default", pending: "secondary", inactive: "outline" };
4399
- function SplitBodyTemplateDemo({ theme, topBarShow, topBarVariant, topBarBg }) {
4400
- const [active, setActive] = React2.useState(users2[0]);
2916
+ function BreadcrumbList({ className, ...props }) {
4401
2917
  return /* @__PURE__ */ jsxRuntime.jsx(
4402
- DataBodyTemplate,
4403
- {
4404
- theme,
4405
- topBar: buildTopBar({ topBarShow, topBarVariant, topBarBg, left: "Users" }),
4406
- title: "Users",
4407
- actions: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", className: "h-8 text-xs", children: "Add User" }),
4408
- children: /* @__PURE__ */ jsxRuntime.jsxs(DataBodyTemplate.Group, { layout: "split", children: [
4409
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5 p-2", children: users2.map((u) => /* @__PURE__ */ jsxRuntime.jsxs(
4410
- "button",
4411
- {
4412
- type: "button",
4413
- onClick: () => setActive(u),
4414
- className: [
4415
- "block w-full rounded-lg px-3 py-2 text-left transition-colors",
4416
- u.id === active.id ? "bg-accent text-accent-foreground" : "hover:bg-muted"
4417
- ].join(" "),
4418
- children: [
4419
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm font-medium", children: u.name }),
4420
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-muted-foreground", children: u.email })
4421
- ]
4422
- },
4423
- u.id
4424
- )) }),
4425
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 p-(--dk-panel-gap)", children: [
4426
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
4427
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4428
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-base font-semibold", children: active.name }),
4429
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: active.email })
4430
- ] }),
4431
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant3[active.status], className: "text-xs capitalize", children: active.status })
4432
- ] }),
4433
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [
4434
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border p-3", children: [
4435
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Role" }),
4436
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm font-medium", children: active.role })
4437
- ] }),
4438
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border p-3", children: [
4439
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Status" }),
4440
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm font-medium capitalize", children: active.status })
4441
- ] })
4442
- ] })
4443
- ] })
4444
- ] })
4445
- }
4446
- );
4447
- }
4448
- function buildSplitBodyTemplateCode({ themeProp, layoutClassName }) {
4449
- return [
4450
- `import { DataBodyTemplate } from '@loykin/designkit'`,
4451
- `import '@loykin/designkit/styles'`,
4452
- "",
4453
- `export function MyPage() {`,
4454
- ` return (`,
4455
- ` <DataBodyTemplate${themeProp}`,
4456
- ` className="${layoutClassName}"`,
4457
- ` title="Users"`,
4458
- ` >`,
4459
- ` <DataBodyTemplate.Group layout="split">`,
4460
- ` <aside>{/* list */}</aside>`,
4461
- ` <section>{/* detail */}</section>`,
4462
- ` </DataBodyTemplate.Group>`,
4463
- ` </DataBodyTemplate>`,
4464
- ` )`,
4465
- `}`
4466
- ].join("\n");
4467
- }
4468
- var issues = [
4469
- {
4470
- id: "INC-001",
4471
- title: "API gateway returning 502 on /auth endpoints",
4472
- status: "open",
4473
- priority: "critical",
4474
- assignee: "Sarah K.",
4475
- created: "2h ago"
4476
- },
4477
- {
4478
- id: "INC-002",
4479
- title: "Memory leak in data-processor worker threads",
4480
- status: "in-progress",
4481
- priority: "high",
4482
- assignee: "Marcus L.",
4483
- created: "5h ago"
4484
- },
4485
- {
4486
- id: "INC-003",
4487
- title: "Dashboard charts not rendering in Safari 17",
4488
- status: "open",
4489
- priority: "medium",
4490
- assignee: "Ji-Yeon P.",
4491
- created: "1d ago"
4492
- },
4493
- {
4494
- id: "INC-004",
4495
- title: "Slow query on users table (>3s)",
4496
- status: "resolved",
4497
- priority: "high",
4498
- assignee: "Alex C.",
4499
- created: "2d ago"
4500
- },
4501
- {
4502
- id: "INC-005",
4503
- title: "Email notifications not sent for new signups",
4504
- status: "in-progress",
4505
- priority: "medium",
4506
- assignee: "Dana W.",
4507
- created: "3d ago"
4508
- },
4509
- {
4510
- id: "INC-006",
4511
- title: "CORS error on POST /api/v2/upload from mobile",
4512
- status: "open",
4513
- priority: "high",
4514
- assignee: "Leo T.",
4515
- created: "4d ago"
4516
- },
4517
- {
4518
- id: "INC-007",
4519
- title: "Cron expression parsing failure on scheduler",
4520
- status: "closed",
4521
- priority: "low",
4522
- assignee: "Mina S.",
4523
- created: "1w ago"
4524
- }
4525
- ];
4526
- var statusIcon = {
4527
- open: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-3.5 w-3.5 text-destructive" }),
4528
- "in-progress": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "h-3.5 w-3.5 text-yellow-500" }),
4529
- resolved: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-3.5 w-3.5 text-primary" }),
4530
- closed: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircle, { className: "h-3.5 w-3.5 text-muted-foreground" })
4531
- };
4532
- var priorityVariant = {
4533
- critical: "destructive",
4534
- high: "default",
4535
- medium: "secondary",
4536
- low: "outline"
4537
- };
4538
- function IssueTable({ rows }) {
4539
- return /* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
4540
- /* @__PURE__ */ jsxRuntime.jsx(TableHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { children: [
4541
- /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-24", children: "ID" }),
4542
- /* @__PURE__ */ jsxRuntime.jsx(TableHead, { children: "Title" }),
4543
- /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-24", children: "Priority" }),
4544
- /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-28", children: "Assignee" }),
4545
- /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-24", children: "Created" }),
4546
- /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-16" })
4547
- ] }) }),
4548
- /* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: rows.map((issue) => /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { className: "cursor-pointer", children: [
4549
- /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "font-mono text-xs text-muted-foreground", children: issue.id }),
4550
- /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
4551
- statusIcon[issue.status],
4552
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: issue.title })
4553
- ] }) }),
4554
- /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: priorityVariant[issue.priority], className: "text-xs capitalize", children: issue.priority }) }),
4555
- /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "text-xs text-muted-foreground", children: issue.assignee }),
4556
- /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "text-xs text-muted-foreground", children: issue.created }),
4557
- /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", className: "h-7 text-xs", children: "View" }) })
4558
- ] }, issue.id)) })
4559
- ] });
4560
- }
4561
- var counts = {
4562
- open: issues.filter((i) => i.status === "open").length,
4563
- "in-progress": issues.filter((i) => i.status === "in-progress").length,
4564
- resolved: issues.filter((i) => i.status === "resolved").length,
4565
- closed: issues.filter((i) => i.status === "closed").length
4566
- };
4567
- function TabbedBodyTemplateDemo({ theme, topBarShow, topBarVariant, topBarBg }) {
4568
- return /* @__PURE__ */ jsxRuntime.jsxs(
4569
- DataBodyTemplate,
4570
- {
4571
- theme,
4572
- topBar: buildTopBar({ topBarShow, topBarVariant, topBarBg, left: "Pages / Tabbed" }),
4573
- title: "Incidents",
4574
- description: "Incident queue grouped by status",
4575
- toolbarLeft: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
4576
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
4577
- /* @__PURE__ */ jsxRuntime.jsx(Input, { placeholder: "Search\u2026", className: "pl-8 h-8 w-52 text-xs" })
4578
- ] }),
4579
- toolbarRight: /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", className: "h-8 gap-1.5 text-xs", children: [
4580
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-3.5 w-3.5" }),
4581
- "New Incident"
4582
- ] }),
4583
- children: [
4584
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Summary, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-4 gap-(--dk-panel-gap)", children: [
4585
- { label: "Open", count: counts.open, Icon: lucideReact.AlertCircle, cls: "text-destructive" },
4586
- {
4587
- label: "In Progress",
4588
- count: counts["in-progress"],
4589
- Icon: lucideReact.Clock,
4590
- cls: "text-yellow-500"
4591
- },
4592
- {
4593
- label: "Resolved",
4594
- count: counts.resolved,
4595
- Icon: lucideReact.CheckCircle2,
4596
- cls: "text-primary"
4597
- },
4598
- {
4599
- label: "Closed",
4600
- count: counts.closed,
4601
- Icon: lucideReact.XCircle,
4602
- cls: "text-muted-foreground"
4603
- }
4604
- ].map(({ label, count, Icon, cls }) => /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "flex items-center gap-[calc(var(--dk-panel-gap)*0.75)] p-[calc(var(--dk-panel-gap)*0.75)]", children: [
4605
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: `h-5 w-5 ${cls}` }),
4606
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4607
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xl font-bold tabular-nums", children: count }),
4608
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: label })
4609
- ] })
4610
- ] }) }, label)) }) }),
4611
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Tab, { id: "all", label: "All", count: issues.length, children: /* @__PURE__ */ jsxRuntime.jsx(IssueTable, { rows: issues }) }),
4612
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Tab, { id: "open", label: "Open", count: counts.open, children: /* @__PURE__ */ jsxRuntime.jsx(IssueTable, { rows: issues.filter((i) => i.status === "open") }) }),
4613
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Tab, { id: "in-progress", label: "In Progress", count: counts["in-progress"], children: /* @__PURE__ */ jsxRuntime.jsx(IssueTable, { rows: issues.filter((i) => i.status === "in-progress") }) }),
4614
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Tab, { id: "resolved", label: "Resolved", count: counts.resolved, children: /* @__PURE__ */ jsxRuntime.jsx(IssueTable, { rows: issues.filter((i) => i.status === "resolved") }) })
4615
- ]
4616
- }
4617
- );
4618
- }
4619
- function buildTabbedBodyTemplateCode({ themeProp, layoutClassName }) {
4620
- return [
4621
- `import { DataBodyTemplate } from '@loykin/designkit'`,
4622
- `import '@loykin/designkit/styles'`,
4623
- "",
4624
- `export function MyPage() {`,
4625
- ` return (`,
4626
- ` <DataBodyTemplate${themeProp}`,
4627
- ` className="${layoutClassName}"`,
4628
- ` title="Incidents"`,
4629
- ` >`,
4630
- ` <DataBodyTemplate.Summary>`,
4631
- ` {/* summary content */}`,
4632
- ` </DataBodyTemplate.Summary>`,
4633
- ``,
4634
- ` <DataBodyTemplate.Tab id="all" label="All">`,
4635
- ` {/* tab content */}`,
4636
- ` </DataBodyTemplate.Tab>`,
4637
- ` </DataBodyTemplate>`,
4638
- ` )`,
4639
- `}`
4640
- ].join("\n");
4641
- }
4642
- function FormBodyTemplateDemo({ theme, topBarShow, topBarVariant, topBarBg }) {
4643
- return /* @__PURE__ */ jsxRuntime.jsxs(
4644
- DataBodyTemplate,
4645
- {
4646
- theme,
4647
- topBar: buildTopBar({ topBarShow, topBarVariant, topBarBg, left: "Pages / Form" }),
4648
- title: "Account Settings",
4649
- description: "Manage your account preferences and security.",
4650
- children: [
4651
- /* @__PURE__ */ jsxRuntime.jsx(
4652
- DataBodyTemplate.Group,
4653
- {
4654
- layout: "horizontal",
4655
- title: "Profile",
4656
- description: "Your public-facing name and contact info.",
4657
- children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: (e) => e.preventDefault(), className: "space-y-4", children: [
4658
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4659
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4660
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "first-name", className: "text-xs", children: "First Name" }),
4661
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "first-name", defaultValue: "Sarah", className: "h-8 text-sm" })
4662
- ] }),
4663
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4664
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "last-name", className: "text-xs", children: "Last Name" }),
4665
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "last-name", defaultValue: "Kim", className: "h-8 text-sm" })
4666
- ] })
4667
- ] }),
4668
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4669
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "profile-email", className: "text-xs", children: "Email" }),
4670
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "profile-email", type: "email", defaultValue: "sarah@acme.com", className: "h-8 text-sm" })
4671
- ] }),
4672
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4673
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "profile-role", className: "text-xs", children: "Role" }),
4674
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { defaultValue: "admin", children: [
4675
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id: "profile-role", className: "h-8 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
4676
- /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
4677
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "admin", children: "Admin" }),
4678
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "editor", children: "Editor" }),
4679
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "viewer", children: "Viewer" })
4680
- ] })
4681
- ] })
4682
- ] }),
4683
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4684
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "profile-bio", className: "text-xs", children: "Bio" }),
4685
- /* @__PURE__ */ jsxRuntime.jsx(
4686
- "textarea",
4687
- {
4688
- id: "profile-bio",
4689
- className: "w-full h-20 rounded-(--radius) border border-input bg-background px-3 py-2 text-sm resize-none focus:outline-none focus:ring-2 focus:ring-ring",
4690
- defaultValue: "Frontend engineer focused on design systems."
4691
- }
4692
- )
4693
- ] }),
4694
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", size: "sm", className: "h-8 text-xs", children: "Save Profile" }) })
4695
- ] })
4696
- }
4697
- ),
4698
- /* @__PURE__ */ jsxRuntime.jsx(
4699
- DataBodyTemplate.Group,
4700
- {
4701
- layout: "horizontal",
4702
- title: "Notifications",
4703
- description: "Choose when and how you get notified.",
4704
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "divide-y", children: [
4705
- { label: "Comments on your posts", sub: "When someone replies to a thread", on: true },
4706
- { label: "Mentions", sub: "When someone @mentions you", on: true },
4707
- { label: "Weekly digest", sub: "A weekly summary of activity", on: false },
4708
- { label: "Security alerts", sub: "Login from new device", on: true },
4709
- { label: "Product updates", sub: "New features and improvements", on: false }
4710
- ].map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between py-3", children: [
4711
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4712
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: item.label }),
4713
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: item.sub })
4714
- ] }),
4715
- /* @__PURE__ */ jsxRuntime.jsx(Switch, { defaultChecked: item.on })
4716
- ] }, item.label)) })
4717
- }
4718
- ),
4719
- /* @__PURE__ */ jsxRuntime.jsx(
4720
- DataBodyTemplate.Group,
4721
- {
4722
- layout: "horizontal",
4723
- title: "Security",
4724
- description: "Password and authentication settings.",
4725
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
4726
- /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: (e) => e.preventDefault(), className: "space-y-4", children: [
4727
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4728
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "current-password", className: "text-xs", children: "Current Password" }),
4729
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "current-password", type: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", className: "h-8 text-sm" })
4730
- ] }),
4731
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4732
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4733
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "new-password", className: "text-xs", children: "New Password" }),
4734
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "new-password", type: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", className: "h-8 text-sm" })
4735
- ] }),
4736
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4737
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "confirm-password", className: "text-xs", children: "Confirm" }),
4738
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "confirm-password", type: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", className: "h-8 text-sm" })
4739
- ] })
4740
- ] }),
4741
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", size: "sm", className: "h-8 text-xs", children: "Update Password" }) })
4742
- ] }),
4743
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3 rounded-(--radius) border", children: [
4744
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4745
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: "Two-Factor Authentication" }),
4746
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Require OTP on every login" })
4747
- ] }),
4748
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
4749
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-xs", children: "Disabled" }),
4750
- /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", size: "sm", className: "h-8 text-xs", children: "Enable" })
4751
- ] })
4752
- ] })
4753
- ] })
4754
- }
4755
- ),
4756
- /* @__PURE__ */ jsxRuntime.jsx(
4757
- DataBodyTemplate.Group,
4758
- {
4759
- layout: "horizontal",
4760
- title: "Danger Zone",
4761
- description: "Irreversible actions. Proceed with caution.",
4762
- danger: true,
4763
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3 rounded-(--radius) border border-destructive/40 bg-destructive/5", children: [
4764
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4765
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: "Delete Account" }),
4766
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Permanently delete your account and all data." })
4767
- ] }),
4768
- /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "destructive", size: "sm", className: "h-8 text-xs", children: "Delete Account" })
4769
- ] })
4770
- }
4771
- )
4772
- ]
4773
- }
4774
- );
4775
- }
4776
- function buildFormBodyTemplateCode({ themeProp, layoutClassName }) {
4777
- return [
4778
- `import { DataBodyTemplate } from '@loykin/designkit'`,
4779
- `import '@loykin/designkit/styles'`,
4780
- "",
4781
- `export function MyPage() {`,
4782
- ` return (`,
4783
- ` <DataBodyTemplate${themeProp}`,
4784
- ` className="${layoutClassName}"`,
4785
- ` title="Account Settings"`,
4786
- ` >`,
4787
- ` <DataBodyTemplate.Group layout="horizontal" title="Profile">`,
4788
- ` <form onSubmit={handleSubmit}>`,
4789
- ` {/* form fields */}`,
4790
- ` <button type="submit">Save Profile</button>`,
4791
- ` </form>`,
4792
- ` </DataBodyTemplate.Group>`,
4793
- ` </DataBodyTemplate>`,
4794
- ` )`,
4795
- `}`
4796
- ].join("\n");
4797
- }
4798
- function FormStackedBodyTemplateDemo({ theme, topBarShow, topBarVariant, topBarBg }) {
4799
- return /* @__PURE__ */ jsxRuntime.jsxs(
4800
- DataBodyTemplate,
2918
+ "ol",
4801
2919
  {
4802
- theme,
4803
- topBar: buildTopBar({ topBarShow, topBarVariant, topBarBg, left: "Pages / Form / Stacked" }),
4804
- title: "Settings",
4805
- description: "Manage your account and preferences.",
4806
- children: [
4807
- /* @__PURE__ */ jsxRuntime.jsx(
4808
- DataBodyTemplate.Group,
4809
- {
4810
- layout: "stacked",
4811
- title: "Profile",
4812
- description: "How you appear to others on the platform.",
4813
- children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: (e) => e.preventDefault(), className: "space-y-3", children: [
4814
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4815
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "display-name", className: "text-xs", children: "Display Name" }),
4816
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "display-name", defaultValue: "Sarah Kim", className: "h-8 text-sm" })
4817
- ] }),
4818
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4819
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "stacked-email", className: "text-xs", children: "Email" }),
4820
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "stacked-email", type: "email", defaultValue: "sarah@acme.com", className: "h-8 text-sm", disabled: true }),
4821
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Contact support to change your email address." })
4822
- ] }),
4823
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4824
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "stacked-bio", className: "text-xs", children: "Bio" }),
4825
- /* @__PURE__ */ jsxRuntime.jsx(
4826
- "textarea",
4827
- {
4828
- id: "stacked-bio",
4829
- className: "w-full h-20 resize-none rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
4830
- defaultValue: "Frontend engineer focused on design systems."
4831
- }
4832
- )
4833
- ] }),
4834
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", size: "sm", className: "h-8 text-xs", children: "Save Profile" }) })
4835
- ] })
4836
- }
4837
- ),
4838
- /* @__PURE__ */ jsxRuntime.jsx(
4839
- DataBodyTemplate.Group,
4840
- {
4841
- layout: "stacked",
4842
- title: "Appearance",
4843
- description: "Customize how the interface looks for you.",
4844
- children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: (e) => e.preventDefault(), className: "space-y-3", children: [
4845
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4846
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "theme-select", className: "text-xs", children: "Theme" }),
4847
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { defaultValue: "system", children: [
4848
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id: "theme-select", className: "h-8 text-sm w-44", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
4849
- /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
4850
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "system", children: "System" }),
4851
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "light", children: "Light" }),
4852
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "dark", children: "Dark" })
4853
- ] })
4854
- ] })
4855
- ] }),
4856
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
4857
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "language-select", className: "text-xs", children: "Language" }),
4858
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { defaultValue: "en", children: [
4859
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id: "language-select", className: "h-8 text-sm w-44", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
4860
- /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
4861
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "en", children: "English" }),
4862
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "ko", children: "\uD55C\uAD6D\uC5B4" }),
4863
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "ja", children: "\u65E5\u672C\u8A9E" })
4864
- ] })
4865
- ] })
4866
- ] }),
4867
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
4868
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4869
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: "Compact mode" }),
4870
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Reduce spacing across the interface." })
4871
- ] }),
4872
- /* @__PURE__ */ jsxRuntime.jsx(Switch, {})
4873
- ] }),
4874
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", size: "sm", className: "h-8 text-xs", children: "Save Appearance" }) })
4875
- ] })
4876
- }
4877
- ),
4878
- /* @__PURE__ */ jsxRuntime.jsx(
4879
- DataBodyTemplate.Group,
4880
- {
4881
- layout: "stacked",
4882
- title: "Privacy & Data",
4883
- description: "Manage how your data is collected and used.",
4884
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: [
4885
- { label: "Usage analytics", desc: "Share anonymous usage data to improve the product.", on: true },
4886
- { label: "Crash reports", desc: "Automatically send crash logs to our team.", on: true },
4887
- { label: "Marketing emails", desc: "Receive updates on new features and promotions.", on: false }
4888
- ].map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
4889
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4890
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: item.label }),
4891
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: item.desc })
4892
- ] }),
4893
- /* @__PURE__ */ jsxRuntime.jsx(Switch, { defaultChecked: item.on })
4894
- ] }, item.label)) })
4895
- }
4896
- ),
4897
- /* @__PURE__ */ jsxRuntime.jsx(
4898
- DataBodyTemplate.Group,
4899
- {
4900
- layout: "stacked",
4901
- title: "Danger Zone",
4902
- description: "Irreversible actions. Proceed with caution.",
4903
- danger: true,
4904
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between rounded-[var(--radius)] border border-destructive/40 bg-destructive/5 px-4 py-3", children: [
4905
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4906
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: "Delete Account" }),
4907
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Permanently remove all your data." })
4908
- ] }),
4909
- /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "destructive", size: "sm", className: "ml-4 h-8 shrink-0 text-xs", children: "Delete" })
4910
- ] })
4911
- }
4912
- )
4913
- ]
2920
+ "data-slot": "breadcrumb-list",
2921
+ className: cn(
2922
+ "flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
2923
+ className
2924
+ ),
2925
+ ...props
4914
2926
  }
4915
2927
  );
4916
2928
  }
4917
- function buildFormStackedBodyTemplateCode({
4918
- themeProp,
4919
- layoutClassName
4920
- }) {
4921
- return [
4922
- `import { DataBodyTemplate } from '@loykin/designkit'`,
4923
- `import '@loykin/designkit/styles'`,
4924
- "",
4925
- `export function MyPage() {`,
4926
- ` return (`,
4927
- ` <DataBodyTemplate${themeProp}`,
4928
- ` className="${layoutClassName}"`,
4929
- ` title="Settings"`,
4930
- ` >`,
4931
- ` <DataBodyTemplate.Group layout="stacked" title="Profile">`,
4932
- ` <form onSubmit={handleSubmit}>`,
4933
- ` {/* form fields */}`,
4934
- ` <button type="submit">Save Profile</button>`,
4935
- ` </form>`,
4936
- ` </DataBodyTemplate.Group>`,
4937
- ` </DataBodyTemplate>`,
4938
- ` )`,
4939
- `}`
4940
- ].join("\n");
4941
- }
4942
- function FormInlineBodyTemplateDemo({ theme, topBarShow, topBarVariant, topBarBg }) {
2929
+ function BreadcrumbItem({ className, ...props }) {
4943
2930
  return /* @__PURE__ */ jsxRuntime.jsx(
4944
- DataBodyTemplate,
2931
+ "li",
4945
2932
  {
4946
- theme,
4947
- topBar: buildTopBar({ topBarShow, topBarVariant, topBarBg, left: "Pages / Form / Inline" }),
4948
- title: "Edit User",
4949
- description: "Update user profile and access settings.",
4950
- children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: (e) => e.preventDefault(), className: "contents", children: [
4951
- /* @__PURE__ */ jsxRuntime.jsxs(DataBodyTemplate.Group, { layout: "inline", title: "Identity", children: [
4952
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Full Name", required: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
4953
- /* @__PURE__ */ jsxRuntime.jsx(Input, { defaultValue: "Sarah", className: "h-8 text-sm", placeholder: "First" }),
4954
- /* @__PURE__ */ jsxRuntime.jsx(Input, { defaultValue: "Kim", className: "h-8 text-sm", placeholder: "Last" })
4955
- ] }) }),
4956
- /* @__PURE__ */ jsxRuntime.jsx(
4957
- DataBodyTemplate.Row,
4958
- {
4959
- label: "Email",
4960
- description: "Used for login and notifications.",
4961
- required: true,
4962
- children: /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "email", defaultValue: "sarah@acme.com", className: "h-8 text-sm" })
4963
- }
4964
- ),
4965
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Username", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
4966
- /* @__PURE__ */ jsxRuntime.jsx(Input, { defaultValue: "sarah.kim", className: "h-8 text-sm" }),
4967
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-[10px] h-6 shrink-0", children: "Available" })
4968
- ] }) }),
4969
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Phone", children: /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "tel", defaultValue: "+82 10-1234-5678", className: "h-8 text-sm" }) })
4970
- ] }),
4971
- /* @__PURE__ */ jsxRuntime.jsxs(DataBodyTemplate.Group, { layout: "inline", title: "Role & Access", children: [
4972
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Role", required: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Select, { defaultValue: "admin", children: [
4973
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "h-8 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
4974
- /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
4975
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "admin", children: "Admin" }),
4976
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "editor", children: "Editor" }),
4977
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "viewer", children: "Viewer" }),
4978
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "guest", children: "Guest" })
4979
- ] })
4980
- ] }) }),
4981
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Department", children: /* @__PURE__ */ jsxRuntime.jsxs(Select, { defaultValue: "engineering", children: [
4982
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "h-8 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
4983
- /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
4984
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "engineering", children: "Engineering" }),
4985
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "design", children: "Design" }),
4986
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "product", children: "Product" }),
4987
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "marketing", children: "Marketing" })
4988
- ] })
4989
- ] }) }),
4990
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Active", description: "Inactive users cannot sign in.", children: /* @__PURE__ */ jsxRuntime.jsx(Switch, { defaultChecked: true }) }),
4991
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Require 2FA", description: "Enforce two-factor authentication.", children: /* @__PURE__ */ jsxRuntime.jsx(Switch, {}) })
4992
- ] }),
4993
- /* @__PURE__ */ jsxRuntime.jsxs(DataBodyTemplate.Group, { layout: "inline", title: "Address", children: [
4994
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Country", children: /* @__PURE__ */ jsxRuntime.jsxs(Select, { defaultValue: "kr", children: [
4995
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "h-8 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
4996
- /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
4997
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "kr", children: "South Korea" }),
4998
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "us", children: "United States" }),
4999
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "jp", children: "Japan" }),
5000
- /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "gb", children: "United Kingdom" })
5001
- ] })
5002
- ] }) }),
5003
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "City", children: /* @__PURE__ */ jsxRuntime.jsx(Input, { defaultValue: "Seoul", className: "h-8 text-sm" }) }),
5004
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Row, { label: "Postal Code", children: /* @__PURE__ */ jsxRuntime.jsx(Input, { defaultValue: "04524", className: "h-8 text-sm w-36" }) })
5005
- ] }),
5006
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2 px-(--dk-page-padding-x) pb-(--dk-page-padding-y)", children: [
5007
- /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "reset", variant: "outline", size: "sm", className: "h-8 text-xs", children: "Cancel" }),
5008
- /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", size: "sm", className: "h-8 text-xs", children: "Save" })
5009
- ] })
5010
- ] })
2933
+ "data-slot": "breadcrumb-item",
2934
+ className: cn("inline-flex items-center gap-1", className),
2935
+ ...props
5011
2936
  }
5012
2937
  );
5013
2938
  }
5014
- function buildFormInlineBodyTemplateCode({
5015
- themeProp,
5016
- layoutClassName
2939
+ function BreadcrumbLink({
2940
+ className,
2941
+ render,
2942
+ ...props
5017
2943
  }) {
5018
- return [
5019
- `import { DataBodyTemplate } from '@loykin/designkit'`,
5020
- `import '@loykin/designkit/styles'`,
5021
- "",
5022
- `export function MyPage() {`,
5023
- ` return (`,
5024
- ` <DataBodyTemplate${themeProp}`,
5025
- ` className="${layoutClassName}"`,
5026
- ` title="Edit User"`,
5027
- ` >`,
5028
- ` <form onSubmit={handleSubmit} className="contents">`,
5029
- ` <DataBodyTemplate.Group layout="inline" title="Identity">`,
5030
- ` <DataBodyTemplate.Row label="Field" required>`,
5031
- ` {/* input */}`,
5032
- ` </DataBodyTemplate.Row>`,
5033
- ` </DataBodyTemplate.Group>`,
5034
- ` <div className="flex justify-end gap-2 px-(--dk-page-padding-x) pb-(--dk-page-padding-y)">`,
5035
- ` <button type="reset">Cancel</button>`,
5036
- ` <button type="submit">Save</button>`,
5037
- ` </div>`,
5038
- ` </form>`,
5039
- ` </DataBodyTemplate>`,
5040
- ` )`,
5041
- `}`
5042
- ].join("\n");
5043
- }
5044
- function SectionedBodyTemplateDemo({ theme, topBarShow, topBarVariant, topBarBg }) {
5045
- return /* @__PURE__ */ jsxRuntime.jsxs(
5046
- DataBodyTemplate,
5047
- {
5048
- theme,
5049
- topBar: buildTopBar({ topBarShow, topBarVariant, topBarBg, left: "Pages / Sectioned" }),
5050
- title: "Workspace Settings",
5051
- description: "Section navigation connected to body panels.",
5052
- children: [
5053
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Section, { id: "profile", label: "Profile", description: "Identity and contact", children: /* @__PURE__ */ jsxRuntime.jsx(
5054
- DataBodyTemplate.Group,
5055
- {
5056
- layout: "stacked",
5057
- title: "Profile",
5058
- description: "Public workspace details.",
5059
- children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: (e) => e.preventDefault(), className: "space-y-3", children: [
5060
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
5061
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "workspace-name", className: "text-xs", children: "Workspace Name" }),
5062
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "workspace-name", defaultValue: "Acme Corp", className: "h-8 text-sm" })
5063
- ] }),
5064
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5065
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5066
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: "Public profile" }),
5067
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Allow discovery in organization search." })
5068
- ] }),
5069
- /* @__PURE__ */ jsxRuntime.jsx(Switch, { defaultChecked: true })
5070
- ] }),
5071
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", size: "sm", className: "h-8 text-xs", children: "Save" }) })
5072
- ] })
5073
- }
5074
- ) }),
5075
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Section, { id: "security", label: "Security", description: "Password and access", children: /* @__PURE__ */ jsxRuntime.jsx(
5076
- DataBodyTemplate.Group,
5077
- {
5078
- layout: "stacked",
5079
- title: "Security",
5080
- description: "Password and authentication.",
5081
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5082
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: "Require two-factor authentication" }),
5083
- /* @__PURE__ */ jsxRuntime.jsx(Switch, {})
5084
- ] })
5085
- }
5086
- ) }),
5087
- /* @__PURE__ */ jsxRuntime.jsx(DataBodyTemplate.Section, { id: "billing", label: "Billing", description: "Plan and invoices", children: /* @__PURE__ */ jsxRuntime.jsx(
5088
- DataBodyTemplate.Group,
5089
- {
5090
- layout: "stacked",
5091
- title: "Billing",
5092
- description: "Plan and invoice settings.",
5093
- children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "sm", className: "h-8 text-xs", children: "Manage Plan" })
5094
- }
5095
- ) })
5096
- ]
2944
+ return useRender.useRender({
2945
+ defaultTagName: "a",
2946
+ props: mergeProps.mergeProps(
2947
+ {
2948
+ className: cn("transition-colors hover:text-foreground", className)
2949
+ },
2950
+ props
2951
+ ),
2952
+ render,
2953
+ state: {
2954
+ slot: "breadcrumb-link"
5097
2955
  }
5098
- );
2956
+ });
5099
2957
  }
5100
- function buildSectionedBodyTemplateCode({
5101
- themeProp,
5102
- layoutClassName
5103
- }) {
5104
- return [
5105
- `import { DataBodyTemplate } from '@loykin/designkit'`,
5106
- `import '@loykin/designkit/styles'`,
5107
- "",
5108
- `export function MyPage() {`,
5109
- ` return (`,
5110
- ` <DataBodyTemplate${themeProp}`,
5111
- ` className="${layoutClassName}"`,
5112
- ` title="Workspace Settings"`,
5113
- ` actions={<button type="button">Save</button>}`,
5114
- ` >`,
5115
- ` <DataBodyTemplate.Section id="profile" label="Profile" description="Identity and contact">`,
5116
- ` <DataBodyTemplate.Group layout="stacked" title="Profile">`,
5117
- ` {/* form fields */}`,
5118
- ` </DataBodyTemplate.Group>`,
5119
- ` </DataBodyTemplate.Section>`,
5120
- ``,
5121
- ` <DataBodyTemplate.Section id="security" label="Security" description="Password and access">`,
5122
- ` <DataBodyTemplate.Group layout="stacked" title="Security">`,
5123
- ` {/* security fields */}`,
5124
- ` </DataBodyTemplate.Group>`,
5125
- ` </DataBodyTemplate.Section>`,
5126
- ` </DataBodyTemplate>`,
5127
- ` )`,
5128
- `}`
5129
- ].join("\n");
5130
- }
5131
- function LoginBodyTemplateDemo({
5132
- theme,
5133
- loginLayout,
5134
- loginSide,
5135
- loginCard,
5136
- loginBg,
5137
- loginCardWidth
5138
- }) {
2958
+ function BreadcrumbPage({ className, ...props }) {
5139
2959
  return /* @__PURE__ */ jsxRuntime.jsx(
5140
- LoginBodyTemplate,
2960
+ "span",
5141
2961
  {
5142
- theme,
5143
- layout: loginLayout ?? "centered",
5144
- side: loginSide ?? "left",
5145
- card: loginCard ?? "card",
5146
- bg: loginBg ?? "default",
5147
- cardWidth: loginCardWidth ?? "sm",
5148
- children: /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "space-y-6", onSubmit: (e) => e.preventDefault(), children: [
5149
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
5150
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-semibold tracking-tight", children: "Sign in" }),
5151
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Enter your email and password to continue." })
5152
- ] }),
5153
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
5154
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
5155
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "email", className: "text-xs", children: "Email" }),
5156
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "email", type: "email", placeholder: "you@example.com", className: "h-9" })
5157
- ] }),
5158
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
5159
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5160
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "password", className: "text-xs", children: "Password" }),
5161
- /* @__PURE__ */ jsxRuntime.jsx("a", { href: "#", className: "text-xs text-muted-foreground hover:text-foreground transition-colors", children: "Forgot password?" })
5162
- ] }),
5163
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "password", type: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", className: "h-9" })
5164
- ] }),
5165
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
5166
- /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { id: "remember" }),
5167
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "remember", className: "text-xs font-normal text-muted-foreground cursor-pointer", children: "Remember me for 30 days" })
5168
- ] })
5169
- ] }),
5170
- /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", className: "w-full h-9", children: "Sign in" }),
5171
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-center text-xs text-muted-foreground", children: [
5172
- "Don't have an account?",
5173
- " ",
5174
- /* @__PURE__ */ jsxRuntime.jsx("a", { href: "#", className: "text-foreground hover:underline", children: "Sign up" })
5175
- ] })
5176
- ] })
2962
+ "data-slot": "breadcrumb-page",
2963
+ role: "link",
2964
+ "aria-disabled": "true",
2965
+ "aria-current": "page",
2966
+ className: cn("font-normal text-foreground", className),
2967
+ ...props
5177
2968
  }
5178
2969
  );
5179
2970
  }
5180
- function buildLoginBodyTemplateCode({ themeProp }) {
5181
- return [
5182
- `import { LoginBodyTemplate } from '@loykin/designkit'`,
5183
- `import '@loykin/designkit/styles'`,
5184
- "",
5185
- `export function LoginPage() {`,
5186
- ` return (`,
5187
- ` <LoginBodyTemplate${themeProp} layout="split">`,
5188
- ` <div className="space-y-6">`,
5189
- ` <div className="space-y-1.5">`,
5190
- ` <h1 className="text-2xl font-semibold">Sign in</h1>`,
5191
- ` <p className="text-sm text-muted-foreground">Enter your credentials.</p>`,
5192
- ` </div>`,
5193
- ` {/* form fields */}`,
5194
- ` <button type="submit" className="w-full">Sign in</button>`,
5195
- ` </div>`,
5196
- ` </LoginBodyTemplate>`,
5197
- ` )`,
5198
- `}`
5199
- ].join("\n");
5200
- }
5201
- function LoginForgotDemo({
5202
- theme,
5203
- loginLayout,
5204
- loginSide,
5205
- loginCard,
5206
- loginBg,
5207
- loginCardWidth
2971
+ function BreadcrumbSeparator({
2972
+ children,
2973
+ className,
2974
+ ...props
5208
2975
  }) {
5209
2976
  return /* @__PURE__ */ jsxRuntime.jsx(
5210
- LoginBodyTemplate,
2977
+ "li",
5211
2978
  {
5212
- theme,
5213
- layout: loginLayout ?? "centered",
5214
- side: loginSide ?? "left",
5215
- card: loginCard ?? "card",
5216
- bg: loginBg ?? "default",
5217
- cardWidth: loginCardWidth ?? "sm",
5218
- children: /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "space-y-6", onSubmit: (e) => e.preventDefault(), children: [
5219
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
5220
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-semibold tracking-tight", children: "Forgot password?" }),
5221
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Enter your email and we'll send you a reset link." })
5222
- ] }),
5223
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
5224
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "email", className: "text-xs", children: "Email" }),
5225
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "email", type: "email", placeholder: "you@example.com", className: "h-9" })
5226
- ] }) }),
5227
- /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", className: "w-full h-9", children: "Send reset link" }),
5228
- /* @__PURE__ */ jsxRuntime.jsxs(
5229
- "a",
5230
- {
5231
- href: "#",
5232
- className: "flex items-center justify-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",
5233
- children: [
5234
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { className: "h-3.5 w-3.5" }),
5235
- "Back to sign in"
5236
- ]
5237
- }
5238
- )
5239
- ] })
2979
+ "data-slot": "breadcrumb-separator",
2980
+ role: "presentation",
2981
+ "aria-hidden": "true",
2982
+ className: cn("[&>svg]:size-3.5", className),
2983
+ ...props,
2984
+ children: children ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, {})
5240
2985
  }
5241
2986
  );
5242
2987
  }
5243
- function buildLoginForgotCode({ themeProp }) {
5244
- return [
5245
- `import { LoginBodyTemplate } from '@loykin/designkit'`,
5246
- `import '@loykin/designkit/styles'`,
5247
- "",
5248
- `export function ForgotPasswordPage() {`,
5249
- ` return (`,
5250
- ` <LoginBodyTemplate${themeProp} layout="split">`,
5251
- ` <div className="space-y-6">`,
5252
- ` <div className="space-y-1.5">`,
5253
- ` <h1 className="text-2xl font-semibold">Forgot password?</h1>`,
5254
- ` <p className="text-sm text-muted-foreground">We'll send you a reset link.</p>`,
5255
- ` </div>`,
5256
- ` {/* email input */}`,
5257
- ` <button type="submit" className="w-full">Send reset link</button>`,
5258
- ` </div>`,
5259
- ` </LoginBodyTemplate>`,
5260
- ` )`,
5261
- `}`
5262
- ].join("\n");
5263
- }
5264
- function LoginResetDemo({
5265
- theme,
5266
- loginLayout,
5267
- loginSide,
5268
- loginCard,
5269
- loginBg,
5270
- loginCardWidth
5271
- }) {
2988
+ function PageBreadcrumb({ items }) {
2989
+ return /* @__PURE__ */ jsxRuntime.jsx(Breadcrumb, { children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbList, { className: "text-xs gap-1", children: items.map((item, i) => {
2990
+ const isLast = i === items.length - 1;
2991
+ const label = typeof item === "string" ? item : item.label;
2992
+ const href = typeof item === "string" ? void 0 : item.href;
2993
+ return /* @__PURE__ */ jsxRuntime.jsxs(React2__namespace.default.Fragment, { children: [
2994
+ i > 0 && /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {}),
2995
+ /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { children: isLast ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbPage, { className: "text-xs", children: label }) : href ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbLink, { href, className: "text-xs", children: label }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: label }) })
2996
+ ] }, i);
2997
+ }) }) });
2998
+ }
2999
+ function normalizeBreadcrumb(left) {
3000
+ if (typeof left === "string") {
3001
+ const items = left.split("/").map((s) => s.trim()).filter(Boolean);
3002
+ return /* @__PURE__ */ jsxRuntime.jsx(PageBreadcrumb, { items });
3003
+ }
3004
+ return left;
3005
+ }
3006
+ var bgClassMap = {
3007
+ muted: "bg-muted",
3008
+ card: "bg-card",
3009
+ transparent: ""
3010
+ };
3011
+ function buildTopBar(opts) {
3012
+ if (opts.topBarShow === "hide") return void 0;
5272
3013
  return /* @__PURE__ */ jsxRuntime.jsx(
5273
- LoginBodyTemplate,
3014
+ PageTopBar,
5274
3015
  {
5275
- theme,
5276
- layout: loginLayout ?? "centered",
5277
- side: loginSide ?? "left",
5278
- card: loginCard ?? "card",
5279
- bg: loginBg ?? "default",
5280
- cardWidth: loginCardWidth ?? "sm",
5281
- children: /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "space-y-6", onSubmit: (e) => e.preventDefault(), children: [
5282
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
5283
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-semibold tracking-tight", children: "Set new password" }),
5284
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Must be at least 8 characters." })
5285
- ] }),
5286
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
5287
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
5288
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "new-password", className: "text-xs", children: "New Password" }),
5289
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "new-password", type: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", className: "h-9" })
5290
- ] }),
5291
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
5292
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "confirm-password", className: "text-xs", children: "Confirm Password" }),
5293
- /* @__PURE__ */ jsxRuntime.jsx(Input, { id: "confirm-password", type: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", className: "h-9" })
5294
- ] }),
5295
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1.5 pt-1", children: ["At least 8 characters", "One uppercase letter", "One number"].map((rule) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
5296
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-3.5 w-3.5 shrink-0" }),
5297
- rule
5298
- ] }, rule)) })
5299
- ] }),
5300
- /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", className: "w-full h-9", children: "Update password" })
5301
- ] })
3016
+ left: normalizeBreadcrumb(opts.left),
3017
+ right: opts.right,
3018
+ variant: opts.topBarVariant ?? "ghost",
3019
+ className: bgClassMap[opts.topBarBg ?? "transparent"] ?? ""
5302
3020
  }
5303
3021
  );
5304
3022
  }
5305
- function buildLoginResetCode({ themeProp }) {
5306
- return [
5307
- `import { LoginBodyTemplate } from '@loykin/designkit'`,
5308
- `import '@loykin/designkit/styles'`,
5309
- "",
5310
- `export function ResetPasswordPage() {`,
5311
- ` return (`,
5312
- ` <LoginBodyTemplate${themeProp} layout="split">`,
5313
- ` <div className="space-y-6">`,
5314
- ` <h1 className="text-2xl font-semibold">Set new password</h1>`,
5315
- ` {/* password inputs */}`,
5316
- ` <button type="submit" className="w-full">Update password</button>`,
5317
- ` </div>`,
5318
- ` </LoginBodyTemplate>`,
5319
- ` )`,
5320
- `}`
5321
- ].join("\n");
5322
- }
5323
- function LoginOtpDemo({
5324
- theme,
5325
- loginLayout,
5326
- loginSide,
5327
- loginCard,
5328
- loginBg,
5329
- loginCardWidth
3023
+ function PageTopBar({
3024
+ left,
3025
+ right,
3026
+ variant = "ghost",
3027
+ height = "var(--dk-toolbar-height)",
3028
+ className,
3029
+ style,
3030
+ children
5330
3031
  }) {
5331
- return /* @__PURE__ */ jsxRuntime.jsx(
5332
- LoginBodyTemplate,
3032
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3033
+ "div",
5333
3034
  {
5334
- theme,
5335
- layout: loginLayout ?? "centered",
5336
- side: loginSide ?? "left",
5337
- card: loginCard ?? "card",
5338
- bg: loginBg ?? "default",
5339
- cardWidth: loginCardWidth ?? "sm",
5340
- children: /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "space-y-6", onSubmit: (e) => e.preventDefault(), children: [
5341
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
5342
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-semibold tracking-tight", children: "Check your email" }),
5343
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-muted-foreground", children: [
5344
- "We sent a 6-digit code to",
5345
- " ",
5346
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: "sarah@acme.com" })
5347
- ] })
5348
- ] }),
5349
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
5350
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-2", children: Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
5351
- Input,
5352
- {
5353
- maxLength: 1,
5354
- className: "h-11 w-full text-center text-lg font-semibold tabular-nums p-0",
5355
- defaultValue: i < 3 ? ["4", "8", "2"][i] : ""
5356
- },
5357
- i
5358
- )) }),
5359
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground text-center", children: [
5360
- "Didn't receive it?",
5361
- " ",
5362
- /* @__PURE__ */ jsxRuntime.jsx("a", { href: "#", className: "text-foreground hover:underline", children: "Resend code" }),
5363
- " ",
5364
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/60", children: "(59s)" })
5365
- ] })
5366
- ] }),
5367
- /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", className: "w-full h-9", children: "Verify" }),
5368
- /* @__PURE__ */ jsxRuntime.jsxs(
5369
- "a",
5370
- {
5371
- href: "#",
5372
- className: "flex items-center justify-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",
5373
- children: [
5374
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { className: "h-3.5 w-3.5" }),
5375
- "Back to sign in"
5376
- ]
5377
- }
5378
- )
5379
- ] })
3035
+ className: cn(
3036
+ "flex shrink-0 items-center justify-between gap-4 px-(--dk-page-padding-x)",
3037
+ variant === "default" && "border-b",
3038
+ className
3039
+ ),
3040
+ style: { height, ...style },
3041
+ children: [
3042
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 items-center text-xs text-muted-foreground", children: normalizeBreadcrumb(left ?? children) }),
3043
+ right && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: right })
3044
+ ]
5380
3045
  }
5381
3046
  );
5382
3047
  }
5383
- function buildLoginOtpCode({ themeProp }) {
5384
- return [
5385
- `import { LoginBodyTemplate } from '@loykin/designkit'`,
5386
- `import '@loykin/designkit/styles'`,
5387
- "",
5388
- `export function OtpVerificationPage() {`,
5389
- ` return (`,
5390
- ` <LoginBodyTemplate${themeProp} layout="split">`,
5391
- ` <div className="space-y-6">`,
5392
- ` <h1 className="text-2xl font-semibold">Check your email</h1>`,
5393
- ` {/* otp inputs */}`,
5394
- ` <button type="submit" className="w-full">Verify</button>`,
5395
- ` </div>`,
5396
- ` </LoginBodyTemplate>`,
5397
- ` )`,
5398
- `}`
5399
- ].join("\n");
5400
- }
5401
-
5402
- // src/components/templates/index.ts
5403
- function DataGridTemplatePreview(props) {
5404
- return React2.createElement(DataGridTemplateDemo, props);
5405
- }
5406
- function createDataGridPreview(id) {
5407
- const definition = TEMPLATE_DEFINITIONS.find((item) => item.id === id);
5408
- return function DataGridPreview({
5409
- theme,
5410
- topBarShow,
5411
- topBarVariant,
5412
- topBarBg
5413
- }) {
5414
- return React2.createElement(DataGridTemplatePreview, {
5415
- theme,
5416
- variant: definition?.preview?.variant ?? "standard",
5417
- layoutClassName: definition?.layoutClassName ?? `layout-${id}`,
5418
- title: definition?.preview?.title ?? "Users",
5419
- description: definition?.preview?.description,
5420
- topBarShow,
5421
- topBarVariant,
5422
- topBarBg
5423
- });
5424
- };
5425
- }
5426
- var previewComponents = {
5427
- table: createDataGridPreview("table"),
5428
- "table-infinity": createDataGridPreview("table-infinity"),
5429
- "table-drag": createDataGridPreview("table-drag"),
5430
- "table-card": createDataGridPreview("table-card"),
5431
- "table-card-list": createDataGridPreview("table-card-list"),
5432
- databody: DataBodyTemplateDemo,
5433
- "databody-detail": DetailBodyTemplateDemo,
5434
- "databody-split": SplitBodyTemplateDemo,
5435
- tabbed: TabbedBodyTemplateDemo,
5436
- form: FormBodyTemplateDemo,
5437
- "form-stacked": FormStackedBodyTemplateDemo,
5438
- "form-wizard": FormWizardBodyTemplateDemo,
5439
- "form-inline": FormInlineBodyTemplateDemo,
5440
- sectioned: SectionedBodyTemplateDemo,
5441
- typography: TypographyBodyTemplate,
5442
- colors: ColorsBodyTemplate,
5443
- login: LoginBodyTemplateDemo,
5444
- "login-forgot": LoginForgotDemo,
5445
- "login-reset": LoginResetDemo,
5446
- "login-otp": LoginOtpDemo
5447
- };
5448
- var codeBuilders = {
5449
- table: buildDataGridTemplateCode,
5450
- "table-infinity": buildDataGridTemplateCode,
5451
- "table-drag": buildDataGridTemplateCode,
5452
- "table-card": buildDataGridTemplateCode,
5453
- "table-card-list": buildDataGridTemplateCode,
5454
- databody: buildDataBodyTemplateCode,
5455
- "databody-detail": buildDetailBodyTemplateCode,
5456
- "databody-split": buildSplitBodyTemplateCode,
5457
- tabbed: buildTabbedBodyTemplateCode,
5458
- form: buildFormBodyTemplateCode,
5459
- "form-stacked": buildFormStackedBodyTemplateCode,
5460
- "form-wizard": buildFormWizardBodyTemplateCode,
5461
- login: buildLoginBodyTemplateCode,
5462
- "login-forgot": buildLoginForgotCode,
5463
- "login-reset": buildLoginResetCode,
5464
- "login-otp": buildLoginOtpCode,
5465
- "form-inline": buildFormInlineBodyTemplateCode,
5466
- sectioned: buildSectionedBodyTemplateCode
5467
- };
5468
- var TEMPLATES = TEMPLATE_DEFINITIONS.map((definition) => ({
5469
- id: definition.id,
5470
- label: definition.label,
5471
- group: definition.group,
5472
- component: previewComponents[definition.id],
5473
- buildCode: codeBuilders[definition.id]
5474
- }));
5475
- var iconById = {
5476
- table: lucideReact.Table2,
5477
- "table-card": lucideReact.Layers,
5478
- databody: lucideReact.LayoutDashboard,
5479
- sectioned: lucideReact.FileText,
5480
- form: lucideReact.FileText,
5481
- "form-wizard": lucideReact.FileText,
5482
- typography: lucideReact.Type,
5483
- colors: lucideReact.Palette,
5484
- login: lucideReact.KeyRound
5485
- };
5486
- var navigationGroupIcon = {
5487
- DataBodyTemplate: lucideReact.LayoutDashboard,
5488
- FormWizardBodyTemplate: lucideReact.Layers,
5489
- LoginBodyTemplate: lucideReact.KeyRound
5490
- };
5491
- var navigationLabelOrder = ["Common", "DataBodyTemplate", "FormWizardBodyTemplate", "LoginBodyTemplate"];
5492
- var TEMPLATE_NAVIGATION = navigationLabelOrder.map((groupId) => {
5493
- const definitions = TEMPLATE_DEFINITIONS.filter((d) => d.navigationGroup === groupId);
5494
- const parentDefinitions = definitions.filter((d) => !d.navigationParent);
5495
- const label = groupId;
5496
- return {
5497
- label,
5498
- items: parentDefinitions.map((definition) => {
5499
- const childDefs = definitions.filter((d) => d.navigationParent === definition.id);
5500
- const hasChildren = childDefs.length > 0;
5501
- return {
5502
- id: definition.id,
5503
- label: definition.navigationSubgroupLabel ?? definition.navigationLabel ?? definition.label,
5504
- icon: iconById[definition.id] ?? navigationGroupIcon[label],
5505
- children: hasChildren ? [
5506
- { id: definition.id, label: definition.navigationLabel ?? definition.label },
5507
- ...childDefs.map((child) => ({
5508
- id: child.id,
5509
- label: child.navigationLabel ?? child.label
5510
- }))
5511
- ] : []
5512
- };
5513
- })
5514
- };
5515
- }).filter((group) => group.items.length > 0);
5516
3048
  var STYLE_ID = "designkit-vars";
5517
3049
  function buildTokenMap({
5518
3050
  radius,
@@ -5665,7 +3197,7 @@ ${tokenMapToCss(buildDarkTonalTokens(g.primaryHue, g.primaryChroma))}
5665
3197
  panelGap: o.panelGap,
5666
3198
  toolbarHeight: o.toolbarHeight
5667
3199
  });
5668
- const layoutClassName = getTemplateDefinition(id)?.layoutClassName ?? `layout-${id}`;
3200
+ const layoutClassName = `layout-${id}`;
5669
3201
  return `.${layoutClassName} {
5670
3202
  ${tokenMapToCss(tokens)}
5671
3203
  }`;
@@ -5715,8 +3247,6 @@ exports.CardTitle = CardTitle;
5715
3247
  exports.Checkbox = Checkbox;
5716
3248
  exports.ColorsBodyTemplate = ColorsBodyTemplate;
5717
3249
  exports.DataBodyTemplate = DataBodyTemplate;
5718
- exports.DataBodyTemplateDemo = DataBodyTemplateDemo;
5719
- exports.DataGridView = DataGridView;
5720
3250
  exports.DataPage = DataPage;
5721
3251
  exports.DropdownMenu = DropdownMenu;
5722
3252
  exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
@@ -5735,7 +3265,6 @@ exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
5735
3265
  exports.DropdownMenuTrigger = DropdownMenuTrigger;
5736
3266
  exports.EmptyState = EmptyState;
5737
3267
  exports.FormWizardBodyTemplate = FormWizardBodyTemplate;
5738
- exports.FormWizardBodyTemplateDemo = FormWizardBodyTemplateDemo;
5739
3268
  exports.Input = Input;
5740
3269
  exports.Label = Label;
5741
3270
  exports.LoginBodyTemplate = LoginBodyTemplate;
@@ -5802,9 +3331,6 @@ exports.SidebarTrigger = SidebarTrigger;
5802
3331
  exports.Skeleton = Skeleton;
5803
3332
  exports.Slider = Slider;
5804
3333
  exports.Switch = Switch;
5805
- exports.TEMPLATES = TEMPLATES;
5806
- exports.TEMPLATE_DEFINITIONS = TEMPLATE_DEFINITIONS;
5807
- exports.TEMPLATE_NAVIGATION = TEMPLATE_NAVIGATION;
5808
3334
  exports.Table = Table;
5809
3335
  exports.TableBody = TableBody;
5810
3336
  exports.TableCaption = TableCaption;
@@ -5827,8 +3353,6 @@ exports.buildTemplateTheme = buildTemplateTheme;
5827
3353
  exports.buildTopBar = buildTopBar;
5828
3354
  exports.buttonVariants = buttonVariants;
5829
3355
  exports.cn = cn;
5830
- exports.createTemplateOverrides = createTemplateOverrides;
5831
- exports.getTemplateDefinition = getTemplateDefinition;
5832
3356
  exports.navigationMenuTriggerStyle = navigationMenuTriggerStyle;
5833
3357
  exports.tabsListVariants = tabsListVariants;
5834
3358
  exports.useIsMobile = useIsMobile;