@loykin/designkit 0.0.1-dev.5 → 0.0.1-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/index.cjs +484 -179
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +217 -188
- package/dist/index.d.ts +217 -188
- package/dist/index.js +468 -181
- package/dist/index.js.map +1 -1
- package/dist/styles.css +106 -55
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AlertDialog as AlertDialog$1 } from '@base-ui/react/alert-dialog';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { Button as Button$1 } from '@base-ui/react/button';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
4
6
|
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
7
|
+
import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
|
|
5
8
|
import { mergeProps } from '@base-ui/react/merge-props';
|
|
6
9
|
import { useRender } from '@base-ui/react/use-render';
|
|
7
|
-
import {
|
|
8
|
-
import { Button as Button$1 } from '@base-ui/react/button';
|
|
10
|
+
import { GripHorizontal, ChevronRightIcon, MoreHorizontalIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon, XIcon, PanelLeftIcon, SlidersHorizontal, ChevronLeft, Check } from 'lucide-react';
|
|
9
11
|
import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
|
|
10
|
-
import { GripHorizontal, CheckIcon, ChevronRightIcon, ChevronDownIcon, ChevronUpIcon, XIcon, PanelLeftIcon, SlidersHorizontal, ChevronLeft, Check } from 'lucide-react';
|
|
11
12
|
import { Menu } from '@base-ui/react/menu';
|
|
12
13
|
import { Input as Input$1 } from '@base-ui/react/input';
|
|
13
14
|
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
@@ -17,17 +18,150 @@ import { Select as Select$1 } from '@base-ui/react/select';
|
|
|
17
18
|
import { Separator as Separator$1 } from '@base-ui/react/separator';
|
|
18
19
|
import { Dialog } from '@base-ui/react/dialog';
|
|
19
20
|
import * as React2 from 'react';
|
|
20
|
-
import React2__default, { forwardRef, useMemo, Children, useState, Fragment, useCallback
|
|
21
|
+
import React2__default, { createContext, forwardRef, useContext, useEffect, useMemo, Children, useState, Fragment, useCallback } from 'react';
|
|
21
22
|
import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
|
|
22
23
|
import { Slider as Slider$1 } from '@base-ui/react/slider';
|
|
23
24
|
import { Switch as Switch$1 } from '@base-ui/react/switch';
|
|
24
25
|
import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
|
|
25
26
|
import { create } from 'zustand';
|
|
26
27
|
|
|
27
|
-
// src/components/ui/
|
|
28
|
+
// src/components/ui/alert-dialog.tsx
|
|
28
29
|
function cn(...inputs) {
|
|
29
30
|
return twMerge(clsx(inputs));
|
|
30
31
|
}
|
|
32
|
+
var buttonVariants = cva(
|
|
33
|
+
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
34
|
+
{
|
|
35
|
+
variants: {
|
|
36
|
+
variant: {
|
|
37
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
38
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
39
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
40
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
41
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
42
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
43
|
+
},
|
|
44
|
+
size: {
|
|
45
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
46
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
47
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
48
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
49
|
+
icon: "size-8",
|
|
50
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
51
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
52
|
+
"icon-lg": "size-9"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
variant: "default",
|
|
57
|
+
size: "default"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
function Button({
|
|
62
|
+
className,
|
|
63
|
+
variant = "default",
|
|
64
|
+
size = "default",
|
|
65
|
+
...props
|
|
66
|
+
}) {
|
|
67
|
+
return /* @__PURE__ */ jsx(
|
|
68
|
+
Button$1,
|
|
69
|
+
{
|
|
70
|
+
"data-slot": "button",
|
|
71
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
72
|
+
...props
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function AlertDialog({ ...props }) {
|
|
77
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Root, { "data-slot": "alert-dialog", ...props });
|
|
78
|
+
}
|
|
79
|
+
function AlertDialogTrigger({ ...props }) {
|
|
80
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
|
|
81
|
+
}
|
|
82
|
+
function AlertDialogPortal({ ...props }) {
|
|
83
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
84
|
+
}
|
|
85
|
+
function AlertDialogOverlay({ className, ...props }) {
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
AlertDialog$1.Backdrop,
|
|
88
|
+
{
|
|
89
|
+
"data-slot": "alert-dialog-overlay",
|
|
90
|
+
className: cn(
|
|
91
|
+
"fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",
|
|
92
|
+
className
|
|
93
|
+
),
|
|
94
|
+
...props
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function AlertDialogContent({ className, children, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
100
|
+
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
AlertDialog$1.Popup,
|
|
103
|
+
{
|
|
104
|
+
"data-slot": "alert-dialog-content",
|
|
105
|
+
className: cn(
|
|
106
|
+
"fixed top-1/2 left-1/2 z-50 flex w-full max-w-sm -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-lg border border-border bg-popover bg-clip-padding p-4 text-sm text-popover-foreground shadow-lg transition duration-150 ease-in-out data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0",
|
|
107
|
+
className
|
|
108
|
+
),
|
|
109
|
+
...props,
|
|
110
|
+
children
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
] });
|
|
114
|
+
}
|
|
115
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
116
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "alert-dialog-header", className: cn("flex flex-col gap-0.5", className), ...props });
|
|
117
|
+
}
|
|
118
|
+
function AlertDialogFooter({ className, ...props }) {
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
"data-slot": "alert-dialog-footer",
|
|
123
|
+
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
124
|
+
...props
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
function AlertDialogTitle({ className, ...props }) {
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
|
+
AlertDialog$1.Title,
|
|
131
|
+
{
|
|
132
|
+
"data-slot": "alert-dialog-title",
|
|
133
|
+
className: cn("font-heading text-base font-medium text-foreground", className),
|
|
134
|
+
...props
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
function AlertDialogDescription({ className, ...props }) {
|
|
139
|
+
return /* @__PURE__ */ jsx(
|
|
140
|
+
AlertDialog$1.Description,
|
|
141
|
+
{
|
|
142
|
+
"data-slot": "alert-dialog-description",
|
|
143
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
144
|
+
...props
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
function AlertDialogAction({
|
|
149
|
+
className,
|
|
150
|
+
variant = "default",
|
|
151
|
+
...props
|
|
152
|
+
}) {
|
|
153
|
+
return /* @__PURE__ */ jsx(Button, { "data-slot": "alert-dialog-action", variant, className, ...props });
|
|
154
|
+
}
|
|
155
|
+
function AlertDialogCancel({ className, ...props }) {
|
|
156
|
+
return /* @__PURE__ */ jsx(
|
|
157
|
+
AlertDialog$1.Close,
|
|
158
|
+
{
|
|
159
|
+
"data-slot": "alert-dialog-cancel",
|
|
160
|
+
render: /* @__PURE__ */ jsx(Button, { variant: "outline", className }),
|
|
161
|
+
...props
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
31
165
|
function Avatar({
|
|
32
166
|
className,
|
|
33
167
|
size = "default",
|
|
@@ -154,50 +288,89 @@ function Badge({
|
|
|
154
288
|
}
|
|
155
289
|
});
|
|
156
290
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
291
|
+
function Breadcrumb({ className, ...props }) {
|
|
292
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(className), ...props });
|
|
293
|
+
}
|
|
294
|
+
function BreadcrumbList({ className, ...props }) {
|
|
295
|
+
return /* @__PURE__ */ jsx(
|
|
296
|
+
"ol",
|
|
297
|
+
{
|
|
298
|
+
"data-slot": "breadcrumb-list",
|
|
299
|
+
className: cn(
|
|
300
|
+
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
|
|
301
|
+
className
|
|
302
|
+
),
|
|
303
|
+
...props
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
308
|
+
return /* @__PURE__ */ jsx(
|
|
309
|
+
"li",
|
|
310
|
+
{
|
|
311
|
+
"data-slot": "breadcrumb-item",
|
|
312
|
+
className: cn("inline-flex items-center gap-1", className),
|
|
313
|
+
...props
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
function BreadcrumbLink({ className, render, ...props }) {
|
|
318
|
+
return useRender({
|
|
319
|
+
defaultTagName: "a",
|
|
320
|
+
props: mergeProps(
|
|
321
|
+
{
|
|
322
|
+
className: cn("transition-colors hover:text-foreground", className)
|
|
168
323
|
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
icon: "size-8",
|
|
175
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
176
|
-
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
177
|
-
"icon-lg": "size-9"
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
defaultVariants: {
|
|
181
|
-
variant: "default",
|
|
182
|
-
size: "default"
|
|
324
|
+
props
|
|
325
|
+
),
|
|
326
|
+
render,
|
|
327
|
+
state: {
|
|
328
|
+
slot: "breadcrumb-link"
|
|
183
329
|
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function
|
|
187
|
-
className,
|
|
188
|
-
variant = "default",
|
|
189
|
-
size = "default",
|
|
190
|
-
...props
|
|
191
|
-
}) {
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
192
333
|
return /* @__PURE__ */ jsx(
|
|
193
|
-
|
|
334
|
+
"span",
|
|
194
335
|
{
|
|
195
|
-
"data-slot": "
|
|
196
|
-
|
|
336
|
+
"data-slot": "breadcrumb-page",
|
|
337
|
+
role: "link",
|
|
338
|
+
"aria-disabled": "true",
|
|
339
|
+
"aria-current": "page",
|
|
340
|
+
className: cn("font-normal text-foreground", className),
|
|
197
341
|
...props
|
|
198
342
|
}
|
|
199
343
|
);
|
|
200
344
|
}
|
|
345
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
346
|
+
return /* @__PURE__ */ jsx(
|
|
347
|
+
"li",
|
|
348
|
+
{
|
|
349
|
+
"data-slot": "breadcrumb-separator",
|
|
350
|
+
role: "presentation",
|
|
351
|
+
"aria-hidden": "true",
|
|
352
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
353
|
+
...props,
|
|
354
|
+
children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
359
|
+
return /* @__PURE__ */ jsxs(
|
|
360
|
+
"span",
|
|
361
|
+
{
|
|
362
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
363
|
+
role: "presentation",
|
|
364
|
+
"aria-hidden": "true",
|
|
365
|
+
className: cn("flex size-5 items-center justify-center [&>svg]:size-4", className),
|
|
366
|
+
...props,
|
|
367
|
+
children: [
|
|
368
|
+
/* @__PURE__ */ jsx(MoreHorizontalIcon, {}),
|
|
369
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More" })
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
);
|
|
373
|
+
}
|
|
201
374
|
function Card({
|
|
202
375
|
className,
|
|
203
376
|
size = "default",
|
|
@@ -1972,8 +2145,17 @@ function TabsContent({ className, ...props }) {
|
|
|
1972
2145
|
}
|
|
1973
2146
|
);
|
|
1974
2147
|
}
|
|
2148
|
+
var DataPageNestingContext = createContext(false);
|
|
1975
2149
|
function Root({ children, className, style }) {
|
|
1976
|
-
|
|
2150
|
+
const isNested = useContext(DataPageNestingContext);
|
|
2151
|
+
useEffect(() => {
|
|
2152
|
+
if (isNested) {
|
|
2153
|
+
console.error(
|
|
2154
|
+
"[DesignKit] Nested <DataPage> detected. Page-level templates (DataBodyTemplate, WorkbenchBodyTemplate, DashboardBodyTemplate, BrowseBodyTemplate, DetailBodyTemplate, \u2026) already render a DataPage \u2014 don't nest one page-level template inside another template's slot (leftPane, rightPane, bottomPane, mainPane, children, \u2026). Pick the one template that fits and compose inside it instead."
|
|
2155
|
+
);
|
|
2156
|
+
}
|
|
2157
|
+
}, [isNested]);
|
|
2158
|
+
return /* @__PURE__ */ jsx(DataPageNestingContext.Provider, { value: true, children: /* @__PURE__ */ jsx(
|
|
1977
2159
|
"div",
|
|
1978
2160
|
{
|
|
1979
2161
|
"data-slot": "data-page",
|
|
@@ -1984,7 +2166,7 @@ function Root({ children, className, style }) {
|
|
|
1984
2166
|
style,
|
|
1985
2167
|
children
|
|
1986
2168
|
}
|
|
1987
|
-
);
|
|
2169
|
+
) });
|
|
1988
2170
|
}
|
|
1989
2171
|
function Header({ children, className }) {
|
|
1990
2172
|
return /* @__PURE__ */ jsx(
|
|
@@ -1999,7 +2181,13 @@ function Header({ children, className }) {
|
|
|
1999
2181
|
}
|
|
2000
2182
|
);
|
|
2001
2183
|
}
|
|
2002
|
-
function TitleBlock({
|
|
2184
|
+
function TitleBlock({
|
|
2185
|
+
title,
|
|
2186
|
+
description,
|
|
2187
|
+
breadcrumb,
|
|
2188
|
+
status,
|
|
2189
|
+
className
|
|
2190
|
+
}) {
|
|
2003
2191
|
if (!title && !description && !breadcrumb && !status) return null;
|
|
2004
2192
|
return /* @__PURE__ */ jsxs("div", { "data-slot": "data-page-title-block", className: cn("min-w-0 flex-1", className), children: [
|
|
2005
2193
|
breadcrumb && /* @__PURE__ */ jsx("div", { className: "mb-2 text-xs text-muted-foreground", children: breadcrumb }),
|
|
@@ -2026,7 +2214,14 @@ function Actions({ children, className }) {
|
|
|
2026
2214
|
}
|
|
2027
2215
|
function Tabs2({ children, className }) {
|
|
2028
2216
|
if (!children) return null;
|
|
2029
|
-
return /* @__PURE__ */ jsx(
|
|
2217
|
+
return /* @__PURE__ */ jsx(
|
|
2218
|
+
"div",
|
|
2219
|
+
{
|
|
2220
|
+
"data-slot": "data-page-tabs",
|
|
2221
|
+
className: cn("shrink-0 border-b border-border px-6", className),
|
|
2222
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0 overflow-x-auto", children })
|
|
2223
|
+
}
|
|
2224
|
+
);
|
|
2030
2225
|
}
|
|
2031
2226
|
function Tab({ active, count, children, onClick, disabled, className }) {
|
|
2032
2227
|
return /* @__PURE__ */ jsxs(
|
|
@@ -2074,8 +2269,8 @@ function Group({ children, className, surface = "none" }) {
|
|
|
2074
2269
|
"data-surface": surface,
|
|
2075
2270
|
className: cn(
|
|
2076
2271
|
"min-h-0",
|
|
2077
|
-
surface === "bordered" && "overflow-hidden rounded-[var(--radius)] border bg-background",
|
|
2078
|
-
surface === "card" && "overflow-hidden rounded-[var(--radius)] border bg-card text-card-foreground shadow-sm",
|
|
2272
|
+
surface === "bordered" && "overflow-hidden rounded-[var(--radius)] border border-border bg-background",
|
|
2273
|
+
surface === "card" && "overflow-hidden rounded-[var(--radius)] border border-border bg-card text-card-foreground shadow-sm",
|
|
2079
2274
|
className
|
|
2080
2275
|
),
|
|
2081
2276
|
children
|
|
@@ -2128,7 +2323,14 @@ function GroupBody({ children, className }) {
|
|
|
2128
2323
|
}
|
|
2129
2324
|
function Footer({ children, className }) {
|
|
2130
2325
|
if (!children) return null;
|
|
2131
|
-
return /* @__PURE__ */ jsx(
|
|
2326
|
+
return /* @__PURE__ */ jsx(
|
|
2327
|
+
"footer",
|
|
2328
|
+
{
|
|
2329
|
+
"data-slot": "data-page-footer",
|
|
2330
|
+
className: cn("shrink-0 border-t border-border px-6 py-3", className),
|
|
2331
|
+
children
|
|
2332
|
+
}
|
|
2333
|
+
);
|
|
2132
2334
|
}
|
|
2133
2335
|
var DataPage = Object.assign(Root, {
|
|
2134
2336
|
Header,
|
|
@@ -2162,7 +2364,7 @@ var DashboardPanel = forwardRef(
|
|
|
2162
2364
|
ref,
|
|
2163
2365
|
className: cn(
|
|
2164
2366
|
"group flex h-full flex-col overflow-hidden",
|
|
2165
|
-
transparent ? "" : "rounded-(--radius) border bg-card text-card-foreground",
|
|
2367
|
+
transparent ? "" : "rounded-(--radius) border border-border bg-card text-card-foreground",
|
|
2166
2368
|
editable && "ring-1 ring-border/60 ring-inset",
|
|
2167
2369
|
className
|
|
2168
2370
|
),
|
|
@@ -2199,7 +2401,7 @@ function DashboardBodyTemplate({
|
|
|
2199
2401
|
}) {
|
|
2200
2402
|
return /* @__PURE__ */ jsxs(DataPage, { className: cn("layout-dashboard", className), style: theme, children: [
|
|
2201
2403
|
topBar && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: topBar }),
|
|
2202
|
-
(title || toolbar) && /* @__PURE__ */ jsx("header", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
2404
|
+
(title || toolbar) && /* @__PURE__ */ jsx("header", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
2203
2405
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
2204
2406
|
title && /* @__PURE__ */ jsx("h1", { className: "text-sm font-semibold truncate", children: title }),
|
|
2205
2407
|
description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
|
|
@@ -2224,20 +2426,31 @@ function clamp(value, min, max) {
|
|
|
2224
2426
|
}
|
|
2225
2427
|
function ResizeHandle({
|
|
2226
2428
|
axis,
|
|
2429
|
+
label,
|
|
2430
|
+
min,
|
|
2431
|
+
max,
|
|
2432
|
+
value,
|
|
2227
2433
|
onPointerDown,
|
|
2434
|
+
onKeyDown,
|
|
2228
2435
|
className
|
|
2229
2436
|
}) {
|
|
2230
2437
|
return /* @__PURE__ */ jsxs(
|
|
2231
2438
|
"div",
|
|
2232
2439
|
{
|
|
2233
2440
|
role: "separator",
|
|
2441
|
+
tabIndex: 0,
|
|
2442
|
+
"aria-label": label,
|
|
2234
2443
|
"aria-orientation": axis === "x" ? "vertical" : "horizontal",
|
|
2444
|
+
"aria-valuemin": min,
|
|
2445
|
+
"aria-valuemax": max,
|
|
2446
|
+
"aria-valuenow": value,
|
|
2235
2447
|
className: cn(
|
|
2236
|
-
"group/resize relative z-10 shrink-0 touch-none bg-transparent",
|
|
2448
|
+
"group/resize relative z-10 shrink-0 touch-none bg-transparent outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
2237
2449
|
axis === "x" ? "-mx-1 w-2 cursor-col-resize" : "-my-1 h-2 cursor-row-resize",
|
|
2238
2450
|
className
|
|
2239
2451
|
),
|
|
2240
2452
|
onPointerDown,
|
|
2453
|
+
onKeyDown,
|
|
2241
2454
|
children: [
|
|
2242
2455
|
/* @__PURE__ */ jsx(
|
|
2243
2456
|
"div",
|
|
@@ -2270,7 +2483,6 @@ function WorkbenchBodyTemplate({
|
|
|
2270
2483
|
status,
|
|
2271
2484
|
topBar,
|
|
2272
2485
|
headerRight,
|
|
2273
|
-
toolbar,
|
|
2274
2486
|
actions,
|
|
2275
2487
|
leftPane,
|
|
2276
2488
|
mainPane,
|
|
@@ -2290,6 +2502,7 @@ function WorkbenchBodyTemplate({
|
|
|
2290
2502
|
maxRightPaneWidth = 520,
|
|
2291
2503
|
minBottomPaneHeight = 120,
|
|
2292
2504
|
maxBottomPaneHeight = 420,
|
|
2505
|
+
onResize,
|
|
2293
2506
|
leftPaneClassName,
|
|
2294
2507
|
mainPaneClassName,
|
|
2295
2508
|
rightPaneClassName,
|
|
@@ -2300,6 +2513,79 @@ function WorkbenchBodyTemplate({
|
|
|
2300
2513
|
const [leftWidth, setLeftWidth] = useState(leftPaneWidth);
|
|
2301
2514
|
const [rightWidth, setRightWidth] = useState(rightPaneWidth);
|
|
2302
2515
|
const [bottomHeight, setBottomHeight] = useState(bottomPaneHeight);
|
|
2516
|
+
useEffect(() => {
|
|
2517
|
+
setLeftWidth(leftPaneWidth);
|
|
2518
|
+
}, [leftPaneWidth]);
|
|
2519
|
+
useEffect(() => {
|
|
2520
|
+
setRightWidth(rightPaneWidth);
|
|
2521
|
+
}, [rightPaneWidth]);
|
|
2522
|
+
useEffect(() => {
|
|
2523
|
+
setBottomHeight(bottomPaneHeight);
|
|
2524
|
+
}, [bottomPaneHeight]);
|
|
2525
|
+
const updateResizeState = useCallback(
|
|
2526
|
+
(patch) => {
|
|
2527
|
+
const next = {
|
|
2528
|
+
leftPaneWidth: leftWidth,
|
|
2529
|
+
rightPaneWidth: rightWidth,
|
|
2530
|
+
bottomPaneHeight: bottomHeight,
|
|
2531
|
+
...patch
|
|
2532
|
+
};
|
|
2533
|
+
if (patch.leftPaneWidth !== void 0) setLeftWidth(patch.leftPaneWidth);
|
|
2534
|
+
if (patch.rightPaneWidth !== void 0) setRightWidth(patch.rightPaneWidth);
|
|
2535
|
+
if (patch.bottomPaneHeight !== void 0) setBottomHeight(patch.bottomPaneHeight);
|
|
2536
|
+
onResize?.(next);
|
|
2537
|
+
},
|
|
2538
|
+
[bottomHeight, leftWidth, onResize, rightWidth]
|
|
2539
|
+
);
|
|
2540
|
+
const updateLeftWidth = useCallback(
|
|
2541
|
+
(next) => {
|
|
2542
|
+
updateResizeState({
|
|
2543
|
+
leftPaneWidth: clamp(next, minLeftPaneWidth, maxLeftPaneWidth)
|
|
2544
|
+
});
|
|
2545
|
+
},
|
|
2546
|
+
[maxLeftPaneWidth, minLeftPaneWidth, updateResizeState]
|
|
2547
|
+
);
|
|
2548
|
+
const updateRightWidth = useCallback(
|
|
2549
|
+
(next) => {
|
|
2550
|
+
updateResizeState({
|
|
2551
|
+
rightPaneWidth: clamp(next, minRightPaneWidth, maxRightPaneWidth)
|
|
2552
|
+
});
|
|
2553
|
+
},
|
|
2554
|
+
[maxRightPaneWidth, minRightPaneWidth, updateResizeState]
|
|
2555
|
+
);
|
|
2556
|
+
const updateBottomHeight = useCallback(
|
|
2557
|
+
(next) => {
|
|
2558
|
+
updateResizeState({
|
|
2559
|
+
bottomPaneHeight: clamp(next, minBottomPaneHeight, maxBottomPaneHeight)
|
|
2560
|
+
});
|
|
2561
|
+
},
|
|
2562
|
+
[maxBottomPaneHeight, minBottomPaneHeight, updateResizeState]
|
|
2563
|
+
);
|
|
2564
|
+
const handleResizeKey = useCallback(
|
|
2565
|
+
(event, options) => {
|
|
2566
|
+
const step = event.shiftKey ? 48 : 12;
|
|
2567
|
+
if (options.decreaseKeys.includes(event.key)) {
|
|
2568
|
+
event.preventDefault();
|
|
2569
|
+
options.update(options.value - step);
|
|
2570
|
+
return;
|
|
2571
|
+
}
|
|
2572
|
+
if (options.increaseKeys.includes(event.key)) {
|
|
2573
|
+
event.preventDefault();
|
|
2574
|
+
options.update(options.value + step);
|
|
2575
|
+
return;
|
|
2576
|
+
}
|
|
2577
|
+
if (event.key === "Home") {
|
|
2578
|
+
event.preventDefault();
|
|
2579
|
+
options.update(options.min);
|
|
2580
|
+
return;
|
|
2581
|
+
}
|
|
2582
|
+
if (event.key === "End") {
|
|
2583
|
+
event.preventDefault();
|
|
2584
|
+
options.update(options.max);
|
|
2585
|
+
}
|
|
2586
|
+
},
|
|
2587
|
+
[]
|
|
2588
|
+
);
|
|
2303
2589
|
const startResize = useCallback(
|
|
2304
2590
|
(event, axis, applyDelta) => {
|
|
2305
2591
|
if (!resizable) return;
|
|
@@ -2323,14 +2609,13 @@ function WorkbenchBodyTemplate({
|
|
|
2323
2609
|
},
|
|
2324
2610
|
[resizable]
|
|
2325
2611
|
);
|
|
2326
|
-
const
|
|
2327
|
-
const showHeader = title || description || status || headerRightContent || actions;
|
|
2612
|
+
const showHeader = title || description || status || headerRight || actions;
|
|
2328
2613
|
const showLeftPane = leftPane && !leftPaneCollapsed;
|
|
2329
2614
|
const showRightPane = rightPane && !rightPaneCollapsed;
|
|
2330
2615
|
const showBottomPane = bottomPane && !bottomPaneCollapsed;
|
|
2331
2616
|
return /* @__PURE__ */ jsxs(DataPage, { className: cn("layout-workbench", className), style: theme, children: [
|
|
2332
2617
|
topBar && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: topBar }),
|
|
2333
|
-
showHeader && /* @__PURE__ */ jsx("header", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-[calc(var(--designkit-page-padding-y)*0.75)]", children: /* @__PURE__ */ jsxs("div", { className: "flex min-h-[var(--designkit-toolbar-height)] items-center justify-between gap-3", children: [
|
|
2618
|
+
showHeader && /* @__PURE__ */ jsx("header", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-[calc(var(--designkit-page-padding-y)*0.75)]", children: /* @__PURE__ */ jsxs("div", { className: "flex min-h-[var(--designkit-toolbar-height)] items-center justify-between gap-3", children: [
|
|
2334
2619
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
2335
2620
|
(title || status) && /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2336
2621
|
title && /* @__PURE__ */ jsx("h1", { className: "min-w-0 truncate text-sm font-semibold", children: title }),
|
|
@@ -2338,23 +2623,23 @@ function WorkbenchBodyTemplate({
|
|
|
2338
2623
|
] }),
|
|
2339
2624
|
description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: description })
|
|
2340
2625
|
] }),
|
|
2341
|
-
(
|
|
2342
|
-
|
|
2626
|
+
(headerRight || actions) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
2627
|
+
headerRight,
|
|
2343
2628
|
actions
|
|
2344
2629
|
] })
|
|
2345
2630
|
] }) }),
|
|
2346
|
-
(showLeftPane || showRightPane) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5 border-b px-2 py-1.5 md:hidden", children: [
|
|
2631
|
+
(showLeftPane || showRightPane) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5 border-b border-border px-2 py-1.5 md:hidden", children: [
|
|
2347
2632
|
showLeftPane && /* @__PURE__ */ jsxs(Sheet, { children: [
|
|
2348
2633
|
/* @__PURE__ */ jsx(SheetTrigger, { render: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm" }), children: leftPaneLabel }),
|
|
2349
2634
|
/* @__PURE__ */ jsxs(SheetContent, { side: "left", className: "flex flex-col gap-0 p-0", children: [
|
|
2350
|
-
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: leftPaneLabel }) }),
|
|
2635
|
+
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: leftPaneLabel }) }),
|
|
2351
2636
|
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: leftPane })
|
|
2352
2637
|
] })
|
|
2353
2638
|
] }),
|
|
2354
2639
|
showRightPane && /* @__PURE__ */ jsxs(Sheet, { children: [
|
|
2355
2640
|
/* @__PURE__ */ jsx(SheetTrigger, { render: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm" }), children: rightPaneLabel }),
|
|
2356
2641
|
/* @__PURE__ */ jsxs(SheetContent, { side: "right", className: "flex flex-col gap-0 p-0", children: [
|
|
2357
|
-
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: rightPaneLabel }) }),
|
|
2642
|
+
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: rightPaneLabel }) }),
|
|
2358
2643
|
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: rightPane })
|
|
2359
2644
|
] })
|
|
2360
2645
|
] })
|
|
@@ -2365,7 +2650,7 @@ function WorkbenchBodyTemplate({
|
|
|
2365
2650
|
"aside",
|
|
2366
2651
|
{
|
|
2367
2652
|
className: cn(
|
|
2368
|
-
"hidden min-h-0 shrink-0 overflow-hidden border-r bg-card/45 md:flex md:flex-col",
|
|
2653
|
+
"hidden min-h-0 shrink-0 overflow-hidden border-r border-border bg-card/45 md:flex md:flex-col",
|
|
2369
2654
|
leftPaneClassName
|
|
2370
2655
|
),
|
|
2371
2656
|
style: { width: leftWidth },
|
|
@@ -2376,13 +2661,25 @@ function WorkbenchBodyTemplate({
|
|
|
2376
2661
|
ResizeHandle,
|
|
2377
2662
|
{
|
|
2378
2663
|
axis: "x",
|
|
2664
|
+
label: "Resize left pane",
|
|
2665
|
+
min: minLeftPaneWidth,
|
|
2666
|
+
max: maxLeftPaneWidth,
|
|
2667
|
+
value: leftWidth,
|
|
2379
2668
|
className: "hidden md:flex",
|
|
2380
2669
|
onPointerDown: (event) => {
|
|
2381
2670
|
const start = leftWidth;
|
|
2382
2671
|
startResize(event, "x", (delta) => {
|
|
2383
|
-
|
|
2672
|
+
updateLeftWidth(start + delta);
|
|
2384
2673
|
});
|
|
2385
|
-
}
|
|
2674
|
+
},
|
|
2675
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2676
|
+
value: leftWidth,
|
|
2677
|
+
min: minLeftPaneWidth,
|
|
2678
|
+
max: maxLeftPaneWidth,
|
|
2679
|
+
decreaseKeys: ["ArrowLeft"],
|
|
2680
|
+
increaseKeys: ["ArrowRight"],
|
|
2681
|
+
update: updateLeftWidth
|
|
2682
|
+
})
|
|
2386
2683
|
}
|
|
2387
2684
|
)
|
|
2388
2685
|
] }),
|
|
@@ -2393,22 +2690,32 @@ function WorkbenchBodyTemplate({
|
|
|
2393
2690
|
ResizeHandle,
|
|
2394
2691
|
{
|
|
2395
2692
|
axis: "y",
|
|
2693
|
+
label: "Resize bottom pane",
|
|
2694
|
+
min: minBottomPaneHeight,
|
|
2695
|
+
max: maxBottomPaneHeight,
|
|
2696
|
+
value: bottomHeight,
|
|
2396
2697
|
className: "hidden md:flex",
|
|
2397
2698
|
onPointerDown: (event) => {
|
|
2398
2699
|
const start = bottomHeight;
|
|
2399
2700
|
startResize(event, "y", (delta) => {
|
|
2400
|
-
|
|
2401
|
-
clamp(start - delta, minBottomPaneHeight, maxBottomPaneHeight)
|
|
2402
|
-
);
|
|
2701
|
+
updateBottomHeight(start - delta);
|
|
2403
2702
|
});
|
|
2404
|
-
}
|
|
2703
|
+
},
|
|
2704
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2705
|
+
value: bottomHeight,
|
|
2706
|
+
min: minBottomPaneHeight,
|
|
2707
|
+
max: maxBottomPaneHeight,
|
|
2708
|
+
decreaseKeys: ["ArrowDown"],
|
|
2709
|
+
increaseKeys: ["ArrowUp"],
|
|
2710
|
+
update: updateBottomHeight
|
|
2711
|
+
})
|
|
2405
2712
|
}
|
|
2406
2713
|
),
|
|
2407
2714
|
/* @__PURE__ */ jsx(
|
|
2408
2715
|
"section",
|
|
2409
2716
|
{
|
|
2410
2717
|
className: cn(
|
|
2411
|
-
"min-h-0 shrink-0 overflow-auto border-t bg-card/40 md:overflow-hidden",
|
|
2718
|
+
"min-h-0 shrink-0 overflow-auto border-t border-border bg-card/40 md:overflow-hidden",
|
|
2412
2719
|
bottomPaneClassName
|
|
2413
2720
|
),
|
|
2414
2721
|
style: { height: bottomHeight },
|
|
@@ -2422,20 +2729,32 @@ function WorkbenchBodyTemplate({
|
|
|
2422
2729
|
ResizeHandle,
|
|
2423
2730
|
{
|
|
2424
2731
|
axis: "x",
|
|
2732
|
+
label: "Resize right pane",
|
|
2733
|
+
min: minRightPaneWidth,
|
|
2734
|
+
max: maxRightPaneWidth,
|
|
2735
|
+
value: rightWidth,
|
|
2425
2736
|
className: "hidden md:flex",
|
|
2426
2737
|
onPointerDown: (event) => {
|
|
2427
2738
|
const start = rightWidth;
|
|
2428
2739
|
startResize(event, "x", (delta) => {
|
|
2429
|
-
|
|
2740
|
+
updateRightWidth(start - delta);
|
|
2430
2741
|
});
|
|
2431
|
-
}
|
|
2742
|
+
},
|
|
2743
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2744
|
+
value: rightWidth,
|
|
2745
|
+
min: minRightPaneWidth,
|
|
2746
|
+
max: maxRightPaneWidth,
|
|
2747
|
+
decreaseKeys: ["ArrowRight"],
|
|
2748
|
+
increaseKeys: ["ArrowLeft"],
|
|
2749
|
+
update: updateRightWidth
|
|
2750
|
+
})
|
|
2432
2751
|
}
|
|
2433
2752
|
),
|
|
2434
2753
|
/* @__PURE__ */ jsx(
|
|
2435
2754
|
"aside",
|
|
2436
2755
|
{
|
|
2437
2756
|
className: cn(
|
|
2438
|
-
"hidden min-h-0 shrink-0 overflow-hidden border-l bg-card/45 md:flex md:flex-col",
|
|
2757
|
+
"hidden min-h-0 shrink-0 overflow-hidden border-l border-border bg-card/45 md:flex md:flex-col",
|
|
2439
2758
|
rightPaneClassName
|
|
2440
2759
|
),
|
|
2441
2760
|
style: { width: rightWidth },
|
|
@@ -2496,9 +2815,9 @@ function GroupWrapper({
|
|
|
2496
2815
|
}
|
|
2497
2816
|
if (variant === "bordered") {
|
|
2498
2817
|
if (layout === "inline") {
|
|
2499
|
-
return /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-(--radius) border divide-y", children });
|
|
2818
|
+
return /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-(--radius) border border-border divide-y divide-border", children });
|
|
2500
2819
|
}
|
|
2501
|
-
return /* @__PURE__ */ jsx("div", { className: "rounded-(--radius) border p-(--designkit-panel-gap)", children });
|
|
2820
|
+
return /* @__PURE__ */ jsx("div", { className: "rounded-(--radius) border border-border p-(--designkit-panel-gap)", children });
|
|
2502
2821
|
}
|
|
2503
2822
|
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
2504
2823
|
}
|
|
@@ -2659,7 +2978,7 @@ function Root2({
|
|
|
2659
2978
|
/* @__PURE__ */ jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2660
2979
|
/* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
|
|
2661
2980
|
] }),
|
|
2662
|
-
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2981
|
+
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2663
2982
|
/* @__PURE__ */ jsx(DataPage.Content, { className: contentClassName, children: /* @__PURE__ */ jsx(DataPage.Group, { className: "h-full", children: /* @__PURE__ */ jsx(DataPage.GroupBody, { className: cn("h-full", bodyEl.props.className), children: bodyEl.props.children }) }) })
|
|
2664
2983
|
] });
|
|
2665
2984
|
}
|
|
@@ -2671,7 +2990,7 @@ function Root2({
|
|
|
2671
2990
|
/* @__PURE__ */ jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2672
2991
|
/* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
|
|
2673
2992
|
] }),
|
|
2674
|
-
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2993
|
+
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2675
2994
|
/* @__PURE__ */ jsx(DataPage.Content, { className: contentClassName, children: /* @__PURE__ */ jsxs("div", { className: "grid gap-(--designkit-panel-gap) lg:grid-cols-[16rem_minmax(0,1fr)]", children: [
|
|
2676
2995
|
/* @__PURE__ */ jsx("nav", { className: "space-y-1", children: sections.map((section) => {
|
|
2677
2996
|
const active = section.props.id === activeSection?.props.id;
|
|
@@ -2705,7 +3024,7 @@ function Root2({
|
|
|
2705
3024
|
/* @__PURE__ */ jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2706
3025
|
/* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
|
|
2707
3026
|
] }),
|
|
2708
|
-
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
3027
|
+
summaryEl && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2709
3028
|
hasTabs && /* @__PURE__ */ jsx(DataPage.Tabs, { children: tabs.map((tab) => /* @__PURE__ */ jsx(
|
|
2710
3029
|
DataPage.Tab,
|
|
2711
3030
|
{
|
|
@@ -2771,7 +3090,7 @@ function BrowseBodyTemplate({
|
|
|
2771
3090
|
/* @__PURE__ */ jsx(DataPage.Actions, { children: actions })
|
|
2772
3091
|
] }),
|
|
2773
3092
|
/* @__PURE__ */ jsxs(DataPage.Content, { padding: "none", className: "flex flex-col overflow-hidden", children: [
|
|
2774
|
-
(toolbar || isNarrow) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b px-(--designkit-page-padding-x) py-2", children: [
|
|
3093
|
+
(toolbar || isNarrow) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-(--designkit-page-padding-x) py-2", children: [
|
|
2775
3094
|
isNarrow && /* @__PURE__ */ jsxs(Sheet, { children: [
|
|
2776
3095
|
/* @__PURE__ */ jsxs(
|
|
2777
3096
|
SheetTrigger,
|
|
@@ -2784,14 +3103,21 @@ function BrowseBodyTemplate({
|
|
|
2784
3103
|
}
|
|
2785
3104
|
),
|
|
2786
3105
|
/* @__PURE__ */ jsxs(SheetContent, { side: "left", className: "flex flex-col gap-0 p-0", children: [
|
|
2787
|
-
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: sidebarTitle }) }),
|
|
3106
|
+
/* @__PURE__ */ jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsx(SheetTitle, { children: sidebarTitle }) }),
|
|
2788
3107
|
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsx("div", { className: "p-4", children: sidebar }) })
|
|
2789
3108
|
] })
|
|
2790
3109
|
] }),
|
|
2791
3110
|
toolbar && /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: toolbar })
|
|
2792
3111
|
] }),
|
|
2793
3112
|
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
|
|
2794
|
-
!isNarrow && /* @__PURE__ */ jsx(
|
|
3113
|
+
!isNarrow && /* @__PURE__ */ jsx(
|
|
3114
|
+
"aside",
|
|
3115
|
+
{
|
|
3116
|
+
className: "shrink-0 overflow-hidden border-r border-border",
|
|
3117
|
+
style: { width: sidebarWidth },
|
|
3118
|
+
children: /* @__PURE__ */ jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsx("div", { className: "px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: sidebar }) })
|
|
3119
|
+
}
|
|
3120
|
+
),
|
|
2795
3121
|
/* @__PURE__ */ jsx(
|
|
2796
3122
|
"div",
|
|
2797
3123
|
{
|
|
@@ -2849,8 +3175,8 @@ function DetailBodySection({
|
|
|
2849
3175
|
{
|
|
2850
3176
|
className: cn(
|
|
2851
3177
|
"min-h-0",
|
|
2852
|
-
surface === "card" && "rounded-(--radius) border bg-card p-(--designkit-panel-gap) text-card-foreground shadow-sm",
|
|
2853
|
-
surface === "bordered" && "rounded-(--radius) border p-(--designkit-panel-gap)",
|
|
3178
|
+
surface === "card" && "rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap) text-card-foreground shadow-sm",
|
|
3179
|
+
surface === "bordered" && "rounded-(--radius) border border-border p-(--designkit-panel-gap)",
|
|
2854
3180
|
className
|
|
2855
3181
|
),
|
|
2856
3182
|
children: [
|
|
@@ -2895,11 +3221,14 @@ function DetailBodyTemplateRoot({
|
|
|
2895
3221
|
const hasTabs = tabs.length > 0;
|
|
2896
3222
|
const [activeTab, setActiveTab] = useState(() => tabs[0]?.props.id ?? "");
|
|
2897
3223
|
const selectedTab = tabs.find((tab) => tab.props.id === activeTab) ?? tabs[0];
|
|
2898
|
-
const summarySlot = summary ? /* @__PURE__ */ jsx("div", { className: "min-h-0 rounded-(--radius) border bg-card p-(--designkit-panel-gap) text-card-foreground", children: summary }) : null;
|
|
3224
|
+
const summarySlot = summary ? /* @__PURE__ */ jsx("div", { className: "min-h-0 rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap) text-card-foreground", children: summary }) : null;
|
|
2899
3225
|
const mediaSlot = media ? /* @__PURE__ */ jsx(
|
|
2900
3226
|
"div",
|
|
2901
3227
|
{
|
|
2902
|
-
className: cn(
|
|
3228
|
+
className: cn(
|
|
3229
|
+
"min-h-0 overflow-hidden rounded-(--radius) border border-border bg-card",
|
|
3230
|
+
mediaClassName
|
|
3231
|
+
),
|
|
2903
3232
|
children: media
|
|
2904
3233
|
}
|
|
2905
3234
|
) : null;
|
|
@@ -2969,7 +3298,7 @@ function DetailBodyTemplateRoot({
|
|
|
2969
3298
|
"div",
|
|
2970
3299
|
{
|
|
2971
3300
|
className: cn(
|
|
2972
|
-
"min-h-0 rounded-(--radius) border bg-card p-(--designkit-panel-gap)",
|
|
3301
|
+
"min-h-0 rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap)",
|
|
2973
3302
|
asideClassName
|
|
2974
3303
|
),
|
|
2975
3304
|
children: insideAsideSlot
|
|
@@ -3012,7 +3341,7 @@ function DetailBodyTemplateRoot({
|
|
|
3012
3341
|
"aside",
|
|
3013
3342
|
{
|
|
3014
3343
|
className: cn(
|
|
3015
|
-
"min-h-0 border-t bg-background lg:border-l lg:border-t-0",
|
|
3344
|
+
"min-h-0 border-t border-border bg-background lg:border-l lg:border-t-0",
|
|
3016
3345
|
asideClassName
|
|
3017
3346
|
),
|
|
3018
3347
|
children: /* @__PURE__ */ jsx(
|
|
@@ -3063,8 +3392,9 @@ function ListDetailBodyTemplate({
|
|
|
3063
3392
|
/* @__PURE__ */ jsx(
|
|
3064
3393
|
"aside",
|
|
3065
3394
|
{
|
|
3395
|
+
"data-slot": "list-detail-list",
|
|
3066
3396
|
className: cn(
|
|
3067
|
-
"min-h-0 shrink-0 overflow-hidden border-r",
|
|
3397
|
+
"min-h-0 shrink-0 overflow-hidden border-r border-border",
|
|
3068
3398
|
detail ? "hidden lg:flex lg:w-[var(--ld-list-width)] lg:flex-col" : "flex w-full flex-col lg:w-[var(--ld-list-width)]",
|
|
3069
3399
|
listClassName
|
|
3070
3400
|
),
|
|
@@ -3080,7 +3410,7 @@ function ListDetailBodyTemplate({
|
|
|
3080
3410
|
detailClassName
|
|
3081
3411
|
),
|
|
3082
3412
|
children: [
|
|
3083
|
-
detail && onBack && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center border-b px-3 py-2 lg:hidden", children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", className: "-ml-1 gap-1", onClick: onBack, children: [
|
|
3413
|
+
detail && onBack && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center border-b border-border px-3 py-2 lg:hidden", children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", className: "-ml-1 gap-1", onClick: onBack, children: [
|
|
3084
3414
|
/* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
|
|
3085
3415
|
backLabel
|
|
3086
3416
|
] }) }),
|
|
@@ -3133,7 +3463,7 @@ function PanelTemplateRoot({
|
|
|
3133
3463
|
] })
|
|
3134
3464
|
] }),
|
|
3135
3465
|
/* @__PURE__ */ jsx("div", { className: cn("min-h-0 flex-1 overflow-y-auto px-4 py-4", bodyClassName), children: /* @__PURE__ */ jsx("div", { className: "space-y-5", children }) }),
|
|
3136
|
-
footer && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-t px-4 py-3", children: footer })
|
|
3466
|
+
footer && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-t border-border px-4 py-3", children: footer })
|
|
3137
3467
|
] });
|
|
3138
3468
|
}
|
|
3139
3469
|
var PanelTemplate = Object.assign(PanelTemplateRoot, {
|
|
@@ -3273,7 +3603,7 @@ function TypographyBodyTemplate({ theme, breadcrumb }) {
|
|
|
3273
3603
|
/* @__PURE__ */ jsx("div", { className: "grid gap-2", children: ["API Gateway", "Billing Worker", "Notification Queue"].map((item, index) => /* @__PURE__ */ jsxs(
|
|
3274
3604
|
"div",
|
|
3275
3605
|
{
|
|
3276
|
-
className: "flex items-center justify-between rounded-lg border px-3 py-2",
|
|
3606
|
+
className: "flex items-center justify-between rounded-lg border border-border px-3 py-2",
|
|
3277
3607
|
children: [
|
|
3278
3608
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
3279
3609
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: item }),
|
|
@@ -3321,14 +3651,10 @@ var useThemeStore = create((set) => ({
|
|
|
3321
3651
|
darkMode: false
|
|
3322
3652
|
},
|
|
3323
3653
|
overrides: {},
|
|
3324
|
-
activeShell: "sidebar",
|
|
3325
|
-
activeTemplate: "table",
|
|
3326
3654
|
setGlobal: (patch) => set((s) => ({ global: { ...s.global, ...patch } })),
|
|
3327
3655
|
setOverride: (id, patch) => set((s) => ({
|
|
3328
3656
|
overrides: { ...s.overrides, [id]: { ...s.overrides[id], ...patch } }
|
|
3329
|
-
}))
|
|
3330
|
-
setShell: (shell) => set({ activeShell: shell }),
|
|
3331
|
-
setTemplate: (template) => set({ activeTemplate: template })
|
|
3657
|
+
}))
|
|
3332
3658
|
}));
|
|
3333
3659
|
var tonalTokenDefs = [
|
|
3334
3660
|
{
|
|
@@ -3394,7 +3720,7 @@ function ColorSwatch({
|
|
|
3394
3720
|
variable,
|
|
3395
3721
|
formula
|
|
3396
3722
|
}) {
|
|
3397
|
-
return /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border", children: [
|
|
3723
|
+
return /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border border-border", children: [
|
|
3398
3724
|
/* @__PURE__ */ jsx("div", { className: `${bg} flex h-14 items-center justify-center`, children: /* @__PURE__ */ jsx("span", { className: `${fg} text-sm font-semibold`, children: "Aa" }) }),
|
|
3399
3725
|
/* @__PURE__ */ jsxs("div", { className: "bg-card px-3 py-2 space-y-0.5", children: [
|
|
3400
3726
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium", children: name }),
|
|
@@ -3491,7 +3817,7 @@ function ColorsBodyTemplate({ theme, breadcrumb }) {
|
|
|
3491
3817
|
" \xB7 ",
|
|
3492
3818
|
"factor = 2\u20136% of primary chroma"
|
|
3493
3819
|
] }),
|
|
3494
|
-
/* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border divide-y text-xs font-mono", children: [
|
|
3820
|
+
/* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border border-border divide-y divide-border text-xs font-mono", children: [
|
|
3495
3821
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[7rem_1fr_1fr] bg-muted/50 px-3 py-1.5 text-muted-foreground", children: [
|
|
3496
3822
|
/* @__PURE__ */ jsx("span", { children: "token" }),
|
|
3497
3823
|
/* @__PURE__ */ jsx("span", { children: "light" }),
|
|
@@ -3503,7 +3829,7 @@ function ColorsBodyTemplate({ theme, breadcrumb }) {
|
|
|
3503
3829
|
className: "grid grid-cols-[7rem_1fr_1fr] items-center gap-x-3 px-3 py-2",
|
|
3504
3830
|
children: [
|
|
3505
3831
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3506
|
-
/* @__PURE__ */ jsx("div", { className: `${t.bg} h-5 w-5 shrink-0 rounded border` }),
|
|
3832
|
+
/* @__PURE__ */ jsx("div", { className: `${t.bg} h-5 w-5 shrink-0 rounded border border-border` }),
|
|
3507
3833
|
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: t.name })
|
|
3508
3834
|
] }),
|
|
3509
3835
|
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
@@ -3570,7 +3896,16 @@ function FormCard({
|
|
|
3570
3896
|
}) {
|
|
3571
3897
|
const widthCls = cardWidthClass[cardWidth];
|
|
3572
3898
|
if (card === "card") {
|
|
3573
|
-
return /* @__PURE__ */ jsx(
|
|
3899
|
+
return /* @__PURE__ */ jsx(
|
|
3900
|
+
"div",
|
|
3901
|
+
{
|
|
3902
|
+
className: cn(
|
|
3903
|
+
"w-full rounded-2xl border border-border bg-card px-8 py-10 shadow-lg",
|
|
3904
|
+
widthCls
|
|
3905
|
+
),
|
|
3906
|
+
children
|
|
3907
|
+
}
|
|
3908
|
+
);
|
|
3574
3909
|
}
|
|
3575
3910
|
return /* @__PURE__ */ jsx("div", { className: cn("w-full", widthCls), children });
|
|
3576
3911
|
}
|
|
@@ -3613,73 +3948,6 @@ function LoginBodyTemplate({
|
|
|
3613
3948
|
}
|
|
3614
3949
|
);
|
|
3615
3950
|
}
|
|
3616
|
-
function Breadcrumb({ className, ...props }) {
|
|
3617
|
-
return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(className), ...props });
|
|
3618
|
-
}
|
|
3619
|
-
function BreadcrumbList({ className, ...props }) {
|
|
3620
|
-
return /* @__PURE__ */ jsx(
|
|
3621
|
-
"ol",
|
|
3622
|
-
{
|
|
3623
|
-
"data-slot": "breadcrumb-list",
|
|
3624
|
-
className: cn(
|
|
3625
|
-
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
|
|
3626
|
-
className
|
|
3627
|
-
),
|
|
3628
|
-
...props
|
|
3629
|
-
}
|
|
3630
|
-
);
|
|
3631
|
-
}
|
|
3632
|
-
function BreadcrumbItem({ className, ...props }) {
|
|
3633
|
-
return /* @__PURE__ */ jsx(
|
|
3634
|
-
"li",
|
|
3635
|
-
{
|
|
3636
|
-
"data-slot": "breadcrumb-item",
|
|
3637
|
-
className: cn("inline-flex items-center gap-1", className),
|
|
3638
|
-
...props
|
|
3639
|
-
}
|
|
3640
|
-
);
|
|
3641
|
-
}
|
|
3642
|
-
function BreadcrumbLink({ className, render, ...props }) {
|
|
3643
|
-
return useRender({
|
|
3644
|
-
defaultTagName: "a",
|
|
3645
|
-
props: mergeProps(
|
|
3646
|
-
{
|
|
3647
|
-
className: cn("transition-colors hover:text-foreground", className)
|
|
3648
|
-
},
|
|
3649
|
-
props
|
|
3650
|
-
),
|
|
3651
|
-
render,
|
|
3652
|
-
state: {
|
|
3653
|
-
slot: "breadcrumb-link"
|
|
3654
|
-
}
|
|
3655
|
-
});
|
|
3656
|
-
}
|
|
3657
|
-
function BreadcrumbPage({ className, ...props }) {
|
|
3658
|
-
return /* @__PURE__ */ jsx(
|
|
3659
|
-
"span",
|
|
3660
|
-
{
|
|
3661
|
-
"data-slot": "breadcrumb-page",
|
|
3662
|
-
role: "link",
|
|
3663
|
-
"aria-disabled": "true",
|
|
3664
|
-
"aria-current": "page",
|
|
3665
|
-
className: cn("font-normal text-foreground", className),
|
|
3666
|
-
...props
|
|
3667
|
-
}
|
|
3668
|
-
);
|
|
3669
|
-
}
|
|
3670
|
-
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
3671
|
-
return /* @__PURE__ */ jsx(
|
|
3672
|
-
"li",
|
|
3673
|
-
{
|
|
3674
|
-
"data-slot": "breadcrumb-separator",
|
|
3675
|
-
role: "presentation",
|
|
3676
|
-
"aria-hidden": "true",
|
|
3677
|
-
className: cn("[&>svg]:size-3.5", className),
|
|
3678
|
-
...props,
|
|
3679
|
-
children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
3680
|
-
}
|
|
3681
|
-
);
|
|
3682
|
-
}
|
|
3683
3951
|
function PageBreadcrumb({ items }) {
|
|
3684
3952
|
return /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsx(BreadcrumbList, { className: "text-xs gap-1", children: items.map((item, i) => {
|
|
3685
3953
|
const isLast = i === items.length - 1;
|
|
@@ -3725,6 +3993,7 @@ function PageTopBar({
|
|
|
3725
3993
|
right,
|
|
3726
3994
|
variant = "ghost",
|
|
3727
3995
|
height = "var(--designkit-toolbar-height)",
|
|
3996
|
+
minHeight,
|
|
3728
3997
|
className,
|
|
3729
3998
|
style,
|
|
3730
3999
|
children,
|
|
@@ -3735,11 +4004,11 @@ function PageTopBar({
|
|
|
3735
4004
|
"div",
|
|
3736
4005
|
{
|
|
3737
4006
|
className: cn(
|
|
3738
|
-
"flex shrink-0 items-center justify-between gap-4 px-(--designkit-page-padding-x)",
|
|
3739
|
-
variant === "default" && "border-b",
|
|
4007
|
+
"flex shrink-0 items-center justify-between gap-4 overflow-visible px-(--designkit-page-padding-x)",
|
|
4008
|
+
variant === "default" && "border-b border-border",
|
|
3740
4009
|
className
|
|
3741
4010
|
),
|
|
3742
|
-
style: { height, ...style },
|
|
4011
|
+
style: { height, minHeight, ...style },
|
|
3743
4012
|
children: [
|
|
3744
4013
|
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2 text-xs text-muted-foreground", children: [
|
|
3745
4014
|
trigger,
|
|
@@ -3866,9 +4135,22 @@ function buildDarkTonalTokens(primaryHue, primaryChroma) {
|
|
|
3866
4135
|
function tokenMapToCss(tokens) {
|
|
3867
4136
|
return Object.entries(tokens).map(([key, value]) => ` ${key}: ${value};`).join("\n");
|
|
3868
4137
|
}
|
|
3869
|
-
function
|
|
4138
|
+
function getScopedTarget(scopeSelector) {
|
|
4139
|
+
if (scopeSelector === ":root") return document.documentElement;
|
|
4140
|
+
return document.querySelector(scopeSelector);
|
|
4141
|
+
}
|
|
4142
|
+
function getDarkSelector(scopeSelector) {
|
|
4143
|
+
if (scopeSelector === ":root") return ".dark";
|
|
4144
|
+
return `${scopeSelector}.dark, .dark ${scopeSelector}`;
|
|
4145
|
+
}
|
|
4146
|
+
function getLayoutSelector(scopeSelector, layoutClassName) {
|
|
4147
|
+
if (scopeSelector === ":root") return `.${layoutClassName}`;
|
|
4148
|
+
return `${scopeSelector}.${layoutClassName}, ${scopeSelector} .${layoutClassName}`;
|
|
4149
|
+
}
|
|
4150
|
+
function useStyleInjector(options = {}) {
|
|
3870
4151
|
const g = useThemeStore((s) => s.global);
|
|
3871
4152
|
const ov = useThemeStore((s) => s.overrides);
|
|
4153
|
+
const scopeSelector = options.scope?.trim() || ":root";
|
|
3872
4154
|
useEffect(() => {
|
|
3873
4155
|
let el = document.getElementById(STYLE_ID);
|
|
3874
4156
|
if (!el) {
|
|
@@ -3876,10 +4158,10 @@ function useStyleInjector() {
|
|
|
3876
4158
|
el.id = STYLE_ID;
|
|
3877
4159
|
document.head.appendChild(el);
|
|
3878
4160
|
}
|
|
3879
|
-
const rootBlock =
|
|
4161
|
+
const rootBlock = `${scopeSelector} {
|
|
3880
4162
|
${tokenMapToCss(buildTokenMap(g))}
|
|
3881
4163
|
}`;
|
|
3882
|
-
const darkTonalBlock =
|
|
4164
|
+
const darkTonalBlock = `${getDarkSelector(scopeSelector)} {
|
|
3883
4165
|
${tokenMapToCss(buildDarkTonalTokens(g.primaryHue, g.primaryChroma))}
|
|
3884
4166
|
}`;
|
|
3885
4167
|
const tmplBlocks = Object.entries(ov).map(([id, o]) => {
|
|
@@ -3895,22 +4177,27 @@ ${tokenMapToCss(buildDarkTonalTokens(g.primaryHue, g.primaryChroma))}
|
|
|
3895
4177
|
toolbarHeight: o.toolbarHeight
|
|
3896
4178
|
});
|
|
3897
4179
|
const layoutClassName = `layout-${id}`;
|
|
3898
|
-
return
|
|
4180
|
+
return `${getLayoutSelector(scopeSelector, layoutClassName)} {
|
|
3899
4181
|
${tokenMapToCss(tokens)}
|
|
3900
4182
|
}`;
|
|
3901
4183
|
}).filter(Boolean);
|
|
3902
|
-
|
|
3903
|
-
|
|
4184
|
+
const layerBody = [rootBlock, darkTonalBlock, ...tmplBlocks].join("\n\n");
|
|
4185
|
+
el.textContent = `@layer designkit {
|
|
4186
|
+
${layerBody}
|
|
4187
|
+
}`;
|
|
4188
|
+
}, [g, ov, scopeSelector]);
|
|
3904
4189
|
useEffect(() => {
|
|
3905
|
-
|
|
3906
|
-
}, [g.darkMode]);
|
|
4190
|
+
getScopedTarget(scopeSelector)?.classList.toggle("dark", g.darkMode);
|
|
4191
|
+
}, [g.darkMode, scopeSelector]);
|
|
3907
4192
|
useEffect(() => {
|
|
4193
|
+
const target = getScopedTarget(scopeSelector);
|
|
4194
|
+
if (!target) return;
|
|
3908
4195
|
if (g.density === "default") {
|
|
3909
|
-
|
|
4196
|
+
target.removeAttribute("data-designkit-density");
|
|
3910
4197
|
return;
|
|
3911
4198
|
}
|
|
3912
|
-
|
|
3913
|
-
}, [g.density]);
|
|
4199
|
+
target.dataset.designkitDensity = g.density;
|
|
4200
|
+
}, [g.density, scopeSelector]);
|
|
3914
4201
|
}
|
|
3915
4202
|
function buildTemplateTheme(g, ov = {}) {
|
|
3916
4203
|
const tokens = buildTokenMap({
|
|
@@ -3930,6 +4217,6 @@ function buildTemplateTheme(g, ov = {}) {
|
|
|
3930
4217
|
return tokens;
|
|
3931
4218
|
}
|
|
3932
4219
|
|
|
3933
|
-
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BrowseBodyTemplate, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, DashboardBodyTemplate, DashboardPanel, DataBodyTemplate, DataPage, DetailBodyTemplate, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FormWizardBodyTemplate, Input, Label, ListDetailBodyTemplate, LoginBodyTemplate, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, PageTopBar, PanelTemplate, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, WorkbenchBodyTemplate, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useSidebarOptional, useStyleInjector, useThemeStore };
|
|
4220
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BrowseBodyTemplate, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, DashboardBodyTemplate, DashboardPanel, DataBodyTemplate, DataPage, DetailBodyTemplate, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FormWizardBodyTemplate, Input, Label, ListDetailBodyTemplate, LoginBodyTemplate, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, PageTopBar, PanelTemplate, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, WorkbenchBodyTemplate, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useSidebarOptional, useStyleInjector, useThemeStore };
|
|
3934
4221
|
//# sourceMappingURL=index.js.map
|
|
3935
4222
|
//# sourceMappingURL=index.js.map
|