@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.cjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var alertDialog = require('@base-ui/react/alert-dialog');
|
|
4
4
|
var clsx = require('clsx');
|
|
5
5
|
var tailwindMerge = require('tailwind-merge');
|
|
6
|
+
var button = require('@base-ui/react/button');
|
|
7
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
6
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
var avatar = require('@base-ui/react/avatar');
|
|
7
10
|
var mergeProps = require('@base-ui/react/merge-props');
|
|
8
11
|
var useRender = require('@base-ui/react/use-render');
|
|
9
|
-
var classVarianceAuthority = require('class-variance-authority');
|
|
10
|
-
var button = require('@base-ui/react/button');
|
|
11
|
-
var checkbox = require('@base-ui/react/checkbox');
|
|
12
12
|
var lucideReact = require('lucide-react');
|
|
13
|
+
var checkbox = require('@base-ui/react/checkbox');
|
|
13
14
|
var menu = require('@base-ui/react/menu');
|
|
14
15
|
var input = require('@base-ui/react/input');
|
|
15
16
|
var popover = require('@base-ui/react/popover');
|
|
@@ -45,10 +46,143 @@ function _interopNamespace(e) {
|
|
|
45
46
|
|
|
46
47
|
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
47
48
|
|
|
48
|
-
// src/components/ui/
|
|
49
|
+
// src/components/ui/alert-dialog.tsx
|
|
49
50
|
function cn(...inputs) {
|
|
50
51
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
51
52
|
}
|
|
53
|
+
var buttonVariants = classVarianceAuthority.cva(
|
|
54
|
+
"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",
|
|
55
|
+
{
|
|
56
|
+
variants: {
|
|
57
|
+
variant: {
|
|
58
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
59
|
+
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",
|
|
60
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
61
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
62
|
+
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",
|
|
63
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
67
|
+
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",
|
|
68
|
+
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",
|
|
69
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
70
|
+
icon: "size-8",
|
|
71
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
72
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
73
|
+
"icon-lg": "size-9"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
defaultVariants: {
|
|
77
|
+
variant: "default",
|
|
78
|
+
size: "default"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
function Button({
|
|
83
|
+
className,
|
|
84
|
+
variant = "default",
|
|
85
|
+
size = "default",
|
|
86
|
+
...props
|
|
87
|
+
}) {
|
|
88
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
89
|
+
button.Button,
|
|
90
|
+
{
|
|
91
|
+
"data-slot": "button",
|
|
92
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
93
|
+
...props
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
function AlertDialog({ ...props }) {
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Root, { "data-slot": "alert-dialog", ...props });
|
|
99
|
+
}
|
|
100
|
+
function AlertDialogTrigger({ ...props }) {
|
|
101
|
+
return /* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
|
|
102
|
+
}
|
|
103
|
+
function AlertDialogPortal({ ...props }) {
|
|
104
|
+
return /* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
105
|
+
}
|
|
106
|
+
function AlertDialogOverlay({ className, ...props }) {
|
|
107
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
108
|
+
alertDialog.AlertDialog.Backdrop,
|
|
109
|
+
{
|
|
110
|
+
"data-slot": "alert-dialog-overlay",
|
|
111
|
+
className: cn(
|
|
112
|
+
"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",
|
|
113
|
+
className
|
|
114
|
+
),
|
|
115
|
+
...props
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
function AlertDialogContent({ className, children, ...props }) {
|
|
120
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogPortal, { children: [
|
|
121
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogOverlay, {}),
|
|
122
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
123
|
+
alertDialog.AlertDialog.Popup,
|
|
124
|
+
{
|
|
125
|
+
"data-slot": "alert-dialog-content",
|
|
126
|
+
className: cn(
|
|
127
|
+
"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",
|
|
128
|
+
className
|
|
129
|
+
),
|
|
130
|
+
...props,
|
|
131
|
+
children
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] });
|
|
135
|
+
}
|
|
136
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
137
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "alert-dialog-header", className: cn("flex flex-col gap-0.5", className), ...props });
|
|
138
|
+
}
|
|
139
|
+
function AlertDialogFooter({ className, ...props }) {
|
|
140
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
141
|
+
"div",
|
|
142
|
+
{
|
|
143
|
+
"data-slot": "alert-dialog-footer",
|
|
144
|
+
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
145
|
+
...props
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
function AlertDialogTitle({ className, ...props }) {
|
|
150
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
151
|
+
alertDialog.AlertDialog.Title,
|
|
152
|
+
{
|
|
153
|
+
"data-slot": "alert-dialog-title",
|
|
154
|
+
className: cn("font-heading text-base font-medium text-foreground", className),
|
|
155
|
+
...props
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
function AlertDialogDescription({ className, ...props }) {
|
|
160
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
161
|
+
alertDialog.AlertDialog.Description,
|
|
162
|
+
{
|
|
163
|
+
"data-slot": "alert-dialog-description",
|
|
164
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
165
|
+
...props
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
function AlertDialogAction({
|
|
170
|
+
className,
|
|
171
|
+
variant = "default",
|
|
172
|
+
...props
|
|
173
|
+
}) {
|
|
174
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Button, { "data-slot": "alert-dialog-action", variant, className, ...props });
|
|
175
|
+
}
|
|
176
|
+
function AlertDialogCancel({ className, ...props }) {
|
|
177
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
178
|
+
alertDialog.AlertDialog.Close,
|
|
179
|
+
{
|
|
180
|
+
"data-slot": "alert-dialog-cancel",
|
|
181
|
+
render: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", className }),
|
|
182
|
+
...props
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}
|
|
52
186
|
function Avatar({
|
|
53
187
|
className,
|
|
54
188
|
size = "default",
|
|
@@ -175,50 +309,89 @@ function Badge({
|
|
|
175
309
|
}
|
|
176
310
|
});
|
|
177
311
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
312
|
+
function Breadcrumb({ className, ...props }) {
|
|
313
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(className), ...props });
|
|
314
|
+
}
|
|
315
|
+
function BreadcrumbList({ className, ...props }) {
|
|
316
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
317
|
+
"ol",
|
|
318
|
+
{
|
|
319
|
+
"data-slot": "breadcrumb-list",
|
|
320
|
+
className: cn(
|
|
321
|
+
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
|
|
322
|
+
className
|
|
323
|
+
),
|
|
324
|
+
...props
|
|
325
|
+
}
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
329
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
330
|
+
"li",
|
|
331
|
+
{
|
|
332
|
+
"data-slot": "breadcrumb-item",
|
|
333
|
+
className: cn("inline-flex items-center gap-1", className),
|
|
334
|
+
...props
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
function BreadcrumbLink({ className, render, ...props }) {
|
|
339
|
+
return useRender.useRender({
|
|
340
|
+
defaultTagName: "a",
|
|
341
|
+
props: mergeProps.mergeProps(
|
|
342
|
+
{
|
|
343
|
+
className: cn("transition-colors hover:text-foreground", className)
|
|
189
344
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
icon: "size-8",
|
|
196
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
197
|
-
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
198
|
-
"icon-lg": "size-9"
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
defaultVariants: {
|
|
202
|
-
variant: "default",
|
|
203
|
-
size: "default"
|
|
345
|
+
props
|
|
346
|
+
),
|
|
347
|
+
render,
|
|
348
|
+
state: {
|
|
349
|
+
slot: "breadcrumb-link"
|
|
204
350
|
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
function
|
|
208
|
-
className,
|
|
209
|
-
variant = "default",
|
|
210
|
-
size = "default",
|
|
211
|
-
...props
|
|
212
|
-
}) {
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
213
354
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
214
|
-
|
|
355
|
+
"span",
|
|
215
356
|
{
|
|
216
|
-
"data-slot": "
|
|
217
|
-
|
|
357
|
+
"data-slot": "breadcrumb-page",
|
|
358
|
+
role: "link",
|
|
359
|
+
"aria-disabled": "true",
|
|
360
|
+
"aria-current": "page",
|
|
361
|
+
className: cn("font-normal text-foreground", className),
|
|
218
362
|
...props
|
|
219
363
|
}
|
|
220
364
|
);
|
|
221
365
|
}
|
|
366
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
367
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
368
|
+
"li",
|
|
369
|
+
{
|
|
370
|
+
"data-slot": "breadcrumb-separator",
|
|
371
|
+
role: "presentation",
|
|
372
|
+
"aria-hidden": "true",
|
|
373
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
374
|
+
...props,
|
|
375
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, {})
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
380
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
381
|
+
"span",
|
|
382
|
+
{
|
|
383
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
384
|
+
role: "presentation",
|
|
385
|
+
"aria-hidden": "true",
|
|
386
|
+
className: cn("flex size-5 items-center justify-center [&>svg]:size-4", className),
|
|
387
|
+
...props,
|
|
388
|
+
children: [
|
|
389
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontalIcon, {}),
|
|
390
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More" })
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
);
|
|
394
|
+
}
|
|
222
395
|
function Card({
|
|
223
396
|
className,
|
|
224
397
|
size = "default",
|
|
@@ -1993,8 +2166,17 @@ function TabsContent({ className, ...props }) {
|
|
|
1993
2166
|
}
|
|
1994
2167
|
);
|
|
1995
2168
|
}
|
|
2169
|
+
var DataPageNestingContext = React2.createContext(false);
|
|
1996
2170
|
function Root({ children, className, style }) {
|
|
1997
|
-
|
|
2171
|
+
const isNested = React2.useContext(DataPageNestingContext);
|
|
2172
|
+
React2.useEffect(() => {
|
|
2173
|
+
if (isNested) {
|
|
2174
|
+
console.error(
|
|
2175
|
+
"[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."
|
|
2176
|
+
);
|
|
2177
|
+
}
|
|
2178
|
+
}, [isNested]);
|
|
2179
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DataPageNestingContext.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1998
2180
|
"div",
|
|
1999
2181
|
{
|
|
2000
2182
|
"data-slot": "data-page",
|
|
@@ -2005,7 +2187,7 @@ function Root({ children, className, style }) {
|
|
|
2005
2187
|
style,
|
|
2006
2188
|
children
|
|
2007
2189
|
}
|
|
2008
|
-
);
|
|
2190
|
+
) });
|
|
2009
2191
|
}
|
|
2010
2192
|
function Header({ children, className }) {
|
|
2011
2193
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2020,7 +2202,13 @@ function Header({ children, className }) {
|
|
|
2020
2202
|
}
|
|
2021
2203
|
);
|
|
2022
2204
|
}
|
|
2023
|
-
function TitleBlock({
|
|
2205
|
+
function TitleBlock({
|
|
2206
|
+
title,
|
|
2207
|
+
description,
|
|
2208
|
+
breadcrumb,
|
|
2209
|
+
status,
|
|
2210
|
+
className
|
|
2211
|
+
}) {
|
|
2024
2212
|
if (!title && !description && !breadcrumb && !status) return null;
|
|
2025
2213
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "data-page-title-block", className: cn("min-w-0 flex-1", className), children: [
|
|
2026
2214
|
breadcrumb && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 text-xs text-muted-foreground", children: breadcrumb }),
|
|
@@ -2047,7 +2235,14 @@ function Actions({ children, className }) {
|
|
|
2047
2235
|
}
|
|
2048
2236
|
function Tabs2({ children, className }) {
|
|
2049
2237
|
if (!children) return null;
|
|
2050
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2238
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2239
|
+
"div",
|
|
2240
|
+
{
|
|
2241
|
+
"data-slot": "data-page-tabs",
|
|
2242
|
+
className: cn("shrink-0 border-b border-border px-6", className),
|
|
2243
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-0 overflow-x-auto", children })
|
|
2244
|
+
}
|
|
2245
|
+
);
|
|
2051
2246
|
}
|
|
2052
2247
|
function Tab({ active, count, children, onClick, disabled, className }) {
|
|
2053
2248
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2095,8 +2290,8 @@ function Group({ children, className, surface = "none" }) {
|
|
|
2095
2290
|
"data-surface": surface,
|
|
2096
2291
|
className: cn(
|
|
2097
2292
|
"min-h-0",
|
|
2098
|
-
surface === "bordered" && "overflow-hidden rounded-[var(--radius)] border bg-background",
|
|
2099
|
-
surface === "card" && "overflow-hidden rounded-[var(--radius)] border bg-card text-card-foreground shadow-sm",
|
|
2293
|
+
surface === "bordered" && "overflow-hidden rounded-[var(--radius)] border border-border bg-background",
|
|
2294
|
+
surface === "card" && "overflow-hidden rounded-[var(--radius)] border border-border bg-card text-card-foreground shadow-sm",
|
|
2100
2295
|
className
|
|
2101
2296
|
),
|
|
2102
2297
|
children
|
|
@@ -2149,7 +2344,14 @@ function GroupBody({ children, className }) {
|
|
|
2149
2344
|
}
|
|
2150
2345
|
function Footer({ children, className }) {
|
|
2151
2346
|
if (!children) return null;
|
|
2152
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2347
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2348
|
+
"footer",
|
|
2349
|
+
{
|
|
2350
|
+
"data-slot": "data-page-footer",
|
|
2351
|
+
className: cn("shrink-0 border-t border-border px-6 py-3", className),
|
|
2352
|
+
children
|
|
2353
|
+
}
|
|
2354
|
+
);
|
|
2153
2355
|
}
|
|
2154
2356
|
var DataPage = Object.assign(Root, {
|
|
2155
2357
|
Header,
|
|
@@ -2183,7 +2385,7 @@ var DashboardPanel = React2.forwardRef(
|
|
|
2183
2385
|
ref,
|
|
2184
2386
|
className: cn(
|
|
2185
2387
|
"group flex h-full flex-col overflow-hidden",
|
|
2186
|
-
transparent ? "" : "rounded-(--radius) border bg-card text-card-foreground",
|
|
2388
|
+
transparent ? "" : "rounded-(--radius) border border-border bg-card text-card-foreground",
|
|
2187
2389
|
editable && "ring-1 ring-border/60 ring-inset",
|
|
2188
2390
|
className
|
|
2189
2391
|
),
|
|
@@ -2220,7 +2422,7 @@ function DashboardBodyTemplate({
|
|
|
2220
2422
|
}) {
|
|
2221
2423
|
return /* @__PURE__ */ jsxRuntime.jsxs(DataPage, { className: cn("layout-dashboard", className), style: theme, children: [
|
|
2222
2424
|
topBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: topBar }),
|
|
2223
|
-
(title || toolbar) && /* @__PURE__ */ jsxRuntime.jsx("header", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
2425
|
+
(title || toolbar) && /* @__PURE__ */ jsxRuntime.jsx("header", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
2224
2426
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
2225
2427
|
title && /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-sm font-semibold truncate", children: title }),
|
|
2226
2428
|
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
|
|
@@ -2245,20 +2447,31 @@ function clamp(value, min, max) {
|
|
|
2245
2447
|
}
|
|
2246
2448
|
function ResizeHandle({
|
|
2247
2449
|
axis,
|
|
2450
|
+
label,
|
|
2451
|
+
min,
|
|
2452
|
+
max,
|
|
2453
|
+
value,
|
|
2248
2454
|
onPointerDown,
|
|
2455
|
+
onKeyDown,
|
|
2249
2456
|
className
|
|
2250
2457
|
}) {
|
|
2251
2458
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2252
2459
|
"div",
|
|
2253
2460
|
{
|
|
2254
2461
|
role: "separator",
|
|
2462
|
+
tabIndex: 0,
|
|
2463
|
+
"aria-label": label,
|
|
2255
2464
|
"aria-orientation": axis === "x" ? "vertical" : "horizontal",
|
|
2465
|
+
"aria-valuemin": min,
|
|
2466
|
+
"aria-valuemax": max,
|
|
2467
|
+
"aria-valuenow": value,
|
|
2256
2468
|
className: cn(
|
|
2257
|
-
"group/resize relative z-10 shrink-0 touch-none bg-transparent",
|
|
2469
|
+
"group/resize relative z-10 shrink-0 touch-none bg-transparent outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
2258
2470
|
axis === "x" ? "-mx-1 w-2 cursor-col-resize" : "-my-1 h-2 cursor-row-resize",
|
|
2259
2471
|
className
|
|
2260
2472
|
),
|
|
2261
2473
|
onPointerDown,
|
|
2474
|
+
onKeyDown,
|
|
2262
2475
|
children: [
|
|
2263
2476
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2264
2477
|
"div",
|
|
@@ -2291,7 +2504,6 @@ function WorkbenchBodyTemplate({
|
|
|
2291
2504
|
status,
|
|
2292
2505
|
topBar,
|
|
2293
2506
|
headerRight,
|
|
2294
|
-
toolbar,
|
|
2295
2507
|
actions,
|
|
2296
2508
|
leftPane,
|
|
2297
2509
|
mainPane,
|
|
@@ -2311,6 +2523,7 @@ function WorkbenchBodyTemplate({
|
|
|
2311
2523
|
maxRightPaneWidth = 520,
|
|
2312
2524
|
minBottomPaneHeight = 120,
|
|
2313
2525
|
maxBottomPaneHeight = 420,
|
|
2526
|
+
onResize,
|
|
2314
2527
|
leftPaneClassName,
|
|
2315
2528
|
mainPaneClassName,
|
|
2316
2529
|
rightPaneClassName,
|
|
@@ -2321,6 +2534,79 @@ function WorkbenchBodyTemplate({
|
|
|
2321
2534
|
const [leftWidth, setLeftWidth] = React2.useState(leftPaneWidth);
|
|
2322
2535
|
const [rightWidth, setRightWidth] = React2.useState(rightPaneWidth);
|
|
2323
2536
|
const [bottomHeight, setBottomHeight] = React2.useState(bottomPaneHeight);
|
|
2537
|
+
React2.useEffect(() => {
|
|
2538
|
+
setLeftWidth(leftPaneWidth);
|
|
2539
|
+
}, [leftPaneWidth]);
|
|
2540
|
+
React2.useEffect(() => {
|
|
2541
|
+
setRightWidth(rightPaneWidth);
|
|
2542
|
+
}, [rightPaneWidth]);
|
|
2543
|
+
React2.useEffect(() => {
|
|
2544
|
+
setBottomHeight(bottomPaneHeight);
|
|
2545
|
+
}, [bottomPaneHeight]);
|
|
2546
|
+
const updateResizeState = React2.useCallback(
|
|
2547
|
+
(patch) => {
|
|
2548
|
+
const next = {
|
|
2549
|
+
leftPaneWidth: leftWidth,
|
|
2550
|
+
rightPaneWidth: rightWidth,
|
|
2551
|
+
bottomPaneHeight: bottomHeight,
|
|
2552
|
+
...patch
|
|
2553
|
+
};
|
|
2554
|
+
if (patch.leftPaneWidth !== void 0) setLeftWidth(patch.leftPaneWidth);
|
|
2555
|
+
if (patch.rightPaneWidth !== void 0) setRightWidth(patch.rightPaneWidth);
|
|
2556
|
+
if (patch.bottomPaneHeight !== void 0) setBottomHeight(patch.bottomPaneHeight);
|
|
2557
|
+
onResize?.(next);
|
|
2558
|
+
},
|
|
2559
|
+
[bottomHeight, leftWidth, onResize, rightWidth]
|
|
2560
|
+
);
|
|
2561
|
+
const updateLeftWidth = React2.useCallback(
|
|
2562
|
+
(next) => {
|
|
2563
|
+
updateResizeState({
|
|
2564
|
+
leftPaneWidth: clamp(next, minLeftPaneWidth, maxLeftPaneWidth)
|
|
2565
|
+
});
|
|
2566
|
+
},
|
|
2567
|
+
[maxLeftPaneWidth, minLeftPaneWidth, updateResizeState]
|
|
2568
|
+
);
|
|
2569
|
+
const updateRightWidth = React2.useCallback(
|
|
2570
|
+
(next) => {
|
|
2571
|
+
updateResizeState({
|
|
2572
|
+
rightPaneWidth: clamp(next, minRightPaneWidth, maxRightPaneWidth)
|
|
2573
|
+
});
|
|
2574
|
+
},
|
|
2575
|
+
[maxRightPaneWidth, minRightPaneWidth, updateResizeState]
|
|
2576
|
+
);
|
|
2577
|
+
const updateBottomHeight = React2.useCallback(
|
|
2578
|
+
(next) => {
|
|
2579
|
+
updateResizeState({
|
|
2580
|
+
bottomPaneHeight: clamp(next, minBottomPaneHeight, maxBottomPaneHeight)
|
|
2581
|
+
});
|
|
2582
|
+
},
|
|
2583
|
+
[maxBottomPaneHeight, minBottomPaneHeight, updateResizeState]
|
|
2584
|
+
);
|
|
2585
|
+
const handleResizeKey = React2.useCallback(
|
|
2586
|
+
(event, options) => {
|
|
2587
|
+
const step = event.shiftKey ? 48 : 12;
|
|
2588
|
+
if (options.decreaseKeys.includes(event.key)) {
|
|
2589
|
+
event.preventDefault();
|
|
2590
|
+
options.update(options.value - step);
|
|
2591
|
+
return;
|
|
2592
|
+
}
|
|
2593
|
+
if (options.increaseKeys.includes(event.key)) {
|
|
2594
|
+
event.preventDefault();
|
|
2595
|
+
options.update(options.value + step);
|
|
2596
|
+
return;
|
|
2597
|
+
}
|
|
2598
|
+
if (event.key === "Home") {
|
|
2599
|
+
event.preventDefault();
|
|
2600
|
+
options.update(options.min);
|
|
2601
|
+
return;
|
|
2602
|
+
}
|
|
2603
|
+
if (event.key === "End") {
|
|
2604
|
+
event.preventDefault();
|
|
2605
|
+
options.update(options.max);
|
|
2606
|
+
}
|
|
2607
|
+
},
|
|
2608
|
+
[]
|
|
2609
|
+
);
|
|
2324
2610
|
const startResize = React2.useCallback(
|
|
2325
2611
|
(event, axis, applyDelta) => {
|
|
2326
2612
|
if (!resizable) return;
|
|
@@ -2344,14 +2630,13 @@ function WorkbenchBodyTemplate({
|
|
|
2344
2630
|
},
|
|
2345
2631
|
[resizable]
|
|
2346
2632
|
);
|
|
2347
|
-
const
|
|
2348
|
-
const showHeader = title || description || status || headerRightContent || actions;
|
|
2633
|
+
const showHeader = title || description || status || headerRight || actions;
|
|
2349
2634
|
const showLeftPane = leftPane && !leftPaneCollapsed;
|
|
2350
2635
|
const showRightPane = rightPane && !rightPaneCollapsed;
|
|
2351
2636
|
const showBottomPane = bottomPane && !bottomPaneCollapsed;
|
|
2352
2637
|
return /* @__PURE__ */ jsxRuntime.jsxs(DataPage, { className: cn("layout-workbench", className), style: theme, children: [
|
|
2353
2638
|
topBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: topBar }),
|
|
2354
|
-
showHeader && /* @__PURE__ */ jsxRuntime.jsx("header", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-[calc(var(--designkit-page-padding-y)*0.75)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-[var(--designkit-toolbar-height)] items-center justify-between gap-3", children: [
|
|
2639
|
+
showHeader && /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsxs("div", { className: "flex min-h-[var(--designkit-toolbar-height)] items-center justify-between gap-3", children: [
|
|
2355
2640
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
2356
2641
|
(title || status) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2357
2642
|
title && /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "min-w-0 truncate text-sm font-semibold", children: title }),
|
|
@@ -2359,23 +2644,23 @@ function WorkbenchBodyTemplate({
|
|
|
2359
2644
|
] }),
|
|
2360
2645
|
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: description })
|
|
2361
2646
|
] }),
|
|
2362
|
-
(
|
|
2363
|
-
|
|
2647
|
+
(headerRight || actions) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
2648
|
+
headerRight,
|
|
2364
2649
|
actions
|
|
2365
2650
|
] })
|
|
2366
2651
|
] }) }),
|
|
2367
|
-
(showLeftPane || showRightPane) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1.5 border-b px-2 py-1.5 md:hidden", children: [
|
|
2652
|
+
(showLeftPane || showRightPane) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1.5 border-b border-border px-2 py-1.5 md:hidden", children: [
|
|
2368
2653
|
showLeftPane && /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
|
|
2369
2654
|
/* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { render: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "sm" }), children: leftPaneLabel }),
|
|
2370
2655
|
/* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "left", className: "flex flex-col gap-0 p-0", children: [
|
|
2371
|
-
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: leftPaneLabel }) }),
|
|
2656
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: leftPaneLabel }) }),
|
|
2372
2657
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "flex-1", children: leftPane })
|
|
2373
2658
|
] })
|
|
2374
2659
|
] }),
|
|
2375
2660
|
showRightPane && /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
|
|
2376
2661
|
/* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { render: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "sm" }), children: rightPaneLabel }),
|
|
2377
2662
|
/* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "flex flex-col gap-0 p-0", children: [
|
|
2378
|
-
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: rightPaneLabel }) }),
|
|
2663
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: rightPaneLabel }) }),
|
|
2379
2664
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "flex-1", children: rightPane })
|
|
2380
2665
|
] })
|
|
2381
2666
|
] })
|
|
@@ -2386,7 +2671,7 @@ function WorkbenchBodyTemplate({
|
|
|
2386
2671
|
"aside",
|
|
2387
2672
|
{
|
|
2388
2673
|
className: cn(
|
|
2389
|
-
"hidden min-h-0 shrink-0 overflow-hidden border-r bg-card/45 md:flex md:flex-col",
|
|
2674
|
+
"hidden min-h-0 shrink-0 overflow-hidden border-r border-border bg-card/45 md:flex md:flex-col",
|
|
2390
2675
|
leftPaneClassName
|
|
2391
2676
|
),
|
|
2392
2677
|
style: { width: leftWidth },
|
|
@@ -2397,13 +2682,25 @@ function WorkbenchBodyTemplate({
|
|
|
2397
2682
|
ResizeHandle,
|
|
2398
2683
|
{
|
|
2399
2684
|
axis: "x",
|
|
2685
|
+
label: "Resize left pane",
|
|
2686
|
+
min: minLeftPaneWidth,
|
|
2687
|
+
max: maxLeftPaneWidth,
|
|
2688
|
+
value: leftWidth,
|
|
2400
2689
|
className: "hidden md:flex",
|
|
2401
2690
|
onPointerDown: (event) => {
|
|
2402
2691
|
const start = leftWidth;
|
|
2403
2692
|
startResize(event, "x", (delta) => {
|
|
2404
|
-
|
|
2693
|
+
updateLeftWidth(start + delta);
|
|
2405
2694
|
});
|
|
2406
|
-
}
|
|
2695
|
+
},
|
|
2696
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2697
|
+
value: leftWidth,
|
|
2698
|
+
min: minLeftPaneWidth,
|
|
2699
|
+
max: maxLeftPaneWidth,
|
|
2700
|
+
decreaseKeys: ["ArrowLeft"],
|
|
2701
|
+
increaseKeys: ["ArrowRight"],
|
|
2702
|
+
update: updateLeftWidth
|
|
2703
|
+
})
|
|
2407
2704
|
}
|
|
2408
2705
|
)
|
|
2409
2706
|
] }),
|
|
@@ -2414,22 +2711,32 @@ function WorkbenchBodyTemplate({
|
|
|
2414
2711
|
ResizeHandle,
|
|
2415
2712
|
{
|
|
2416
2713
|
axis: "y",
|
|
2714
|
+
label: "Resize bottom pane",
|
|
2715
|
+
min: minBottomPaneHeight,
|
|
2716
|
+
max: maxBottomPaneHeight,
|
|
2717
|
+
value: bottomHeight,
|
|
2417
2718
|
className: "hidden md:flex",
|
|
2418
2719
|
onPointerDown: (event) => {
|
|
2419
2720
|
const start = bottomHeight;
|
|
2420
2721
|
startResize(event, "y", (delta) => {
|
|
2421
|
-
|
|
2422
|
-
clamp(start - delta, minBottomPaneHeight, maxBottomPaneHeight)
|
|
2423
|
-
);
|
|
2722
|
+
updateBottomHeight(start - delta);
|
|
2424
2723
|
});
|
|
2425
|
-
}
|
|
2724
|
+
},
|
|
2725
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2726
|
+
value: bottomHeight,
|
|
2727
|
+
min: minBottomPaneHeight,
|
|
2728
|
+
max: maxBottomPaneHeight,
|
|
2729
|
+
decreaseKeys: ["ArrowDown"],
|
|
2730
|
+
increaseKeys: ["ArrowUp"],
|
|
2731
|
+
update: updateBottomHeight
|
|
2732
|
+
})
|
|
2426
2733
|
}
|
|
2427
2734
|
),
|
|
2428
2735
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2429
2736
|
"section",
|
|
2430
2737
|
{
|
|
2431
2738
|
className: cn(
|
|
2432
|
-
"min-h-0 shrink-0 overflow-auto border-t bg-card/40 md:overflow-hidden",
|
|
2739
|
+
"min-h-0 shrink-0 overflow-auto border-t border-border bg-card/40 md:overflow-hidden",
|
|
2433
2740
|
bottomPaneClassName
|
|
2434
2741
|
),
|
|
2435
2742
|
style: { height: bottomHeight },
|
|
@@ -2443,20 +2750,32 @@ function WorkbenchBodyTemplate({
|
|
|
2443
2750
|
ResizeHandle,
|
|
2444
2751
|
{
|
|
2445
2752
|
axis: "x",
|
|
2753
|
+
label: "Resize right pane",
|
|
2754
|
+
min: minRightPaneWidth,
|
|
2755
|
+
max: maxRightPaneWidth,
|
|
2756
|
+
value: rightWidth,
|
|
2446
2757
|
className: "hidden md:flex",
|
|
2447
2758
|
onPointerDown: (event) => {
|
|
2448
2759
|
const start = rightWidth;
|
|
2449
2760
|
startResize(event, "x", (delta) => {
|
|
2450
|
-
|
|
2761
|
+
updateRightWidth(start - delta);
|
|
2451
2762
|
});
|
|
2452
|
-
}
|
|
2763
|
+
},
|
|
2764
|
+
onKeyDown: (event) => handleResizeKey(event, {
|
|
2765
|
+
value: rightWidth,
|
|
2766
|
+
min: minRightPaneWidth,
|
|
2767
|
+
max: maxRightPaneWidth,
|
|
2768
|
+
decreaseKeys: ["ArrowRight"],
|
|
2769
|
+
increaseKeys: ["ArrowLeft"],
|
|
2770
|
+
update: updateRightWidth
|
|
2771
|
+
})
|
|
2453
2772
|
}
|
|
2454
2773
|
),
|
|
2455
2774
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2456
2775
|
"aside",
|
|
2457
2776
|
{
|
|
2458
2777
|
className: cn(
|
|
2459
|
-
"hidden min-h-0 shrink-0 overflow-hidden border-l bg-card/45 md:flex md:flex-col",
|
|
2778
|
+
"hidden min-h-0 shrink-0 overflow-hidden border-l border-border bg-card/45 md:flex md:flex-col",
|
|
2460
2779
|
rightPaneClassName
|
|
2461
2780
|
),
|
|
2462
2781
|
style: { width: rightWidth },
|
|
@@ -2517,9 +2836,9 @@ function GroupWrapper({
|
|
|
2517
2836
|
}
|
|
2518
2837
|
if (variant === "bordered") {
|
|
2519
2838
|
if (layout === "inline") {
|
|
2520
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden rounded-(--radius) border divide-y", children });
|
|
2839
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden rounded-(--radius) border border-border divide-y divide-border", children });
|
|
2521
2840
|
}
|
|
2522
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-(--radius) border p-(--designkit-panel-gap)", children });
|
|
2841
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-(--radius) border border-border p-(--designkit-panel-gap)", children });
|
|
2523
2842
|
}
|
|
2524
2843
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
2525
2844
|
}
|
|
@@ -2680,7 +2999,7 @@ function Root2({
|
|
|
2680
2999
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2681
3000
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Actions, { children: actions })
|
|
2682
3001
|
] }),
|
|
2683
|
-
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
3002
|
+
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2684
3003
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Content, { className: contentClassName, children: /* @__PURE__ */ jsxRuntime.jsx(DataPage.Group, { className: "h-full", children: /* @__PURE__ */ jsxRuntime.jsx(DataPage.GroupBody, { className: cn("h-full", bodyEl.props.className), children: bodyEl.props.children }) }) })
|
|
2685
3004
|
] });
|
|
2686
3005
|
}
|
|
@@ -2692,7 +3011,7 @@ function Root2({
|
|
|
2692
3011
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2693
3012
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Actions, { children: actions })
|
|
2694
3013
|
] }),
|
|
2695
|
-
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
3014
|
+
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2696
3015
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Content, { className: contentClassName, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-(--designkit-panel-gap) lg:grid-cols-[16rem_minmax(0,1fr)]", children: [
|
|
2697
3016
|
/* @__PURE__ */ jsxRuntime.jsx("nav", { className: "space-y-1", children: sections.map((section) => {
|
|
2698
3017
|
const active = section.props.id === activeSection?.props.id;
|
|
@@ -2726,7 +3045,7 @@ function Root2({
|
|
|
2726
3045
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.TitleBlock, { title, description, status }),
|
|
2727
3046
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Actions, { children: actions })
|
|
2728
3047
|
] }),
|
|
2729
|
-
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
3048
|
+
summaryEl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b border-border px-(--designkit-page-padding-x) py-(--designkit-panel-gap)", children: summaryEl.props.children }),
|
|
2730
3049
|
hasTabs && /* @__PURE__ */ jsxRuntime.jsx(DataPage.Tabs, { children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2731
3050
|
DataPage.Tab,
|
|
2732
3051
|
{
|
|
@@ -2792,7 +3111,7 @@ function BrowseBodyTemplate({
|
|
|
2792
3111
|
/* @__PURE__ */ jsxRuntime.jsx(DataPage.Actions, { children: actions })
|
|
2793
3112
|
] }),
|
|
2794
3113
|
/* @__PURE__ */ jsxRuntime.jsxs(DataPage.Content, { padding: "none", className: "flex flex-col overflow-hidden", children: [
|
|
2795
|
-
(toolbar || isNarrow) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b px-(--designkit-page-padding-x) py-2", children: [
|
|
3114
|
+
(toolbar || isNarrow) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-(--designkit-page-padding-x) py-2", children: [
|
|
2796
3115
|
isNarrow && /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
|
|
2797
3116
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2798
3117
|
SheetTrigger,
|
|
@@ -2805,14 +3124,21 @@ function BrowseBodyTemplate({
|
|
|
2805
3124
|
}
|
|
2806
3125
|
),
|
|
2807
3126
|
/* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "left", className: "flex flex-col gap-0 p-0", children: [
|
|
2808
|
-
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: sidebarTitle }) }),
|
|
3127
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { className: "shrink-0 border-b border-border px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: sidebarTitle }) }),
|
|
2809
3128
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: sidebar }) })
|
|
2810
3129
|
] })
|
|
2811
3130
|
] }),
|
|
2812
3131
|
toolbar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: toolbar })
|
|
2813
3132
|
] }),
|
|
2814
3133
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
|
|
2815
|
-
!isNarrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3134
|
+
!isNarrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3135
|
+
"aside",
|
|
3136
|
+
{
|
|
3137
|
+
className: "shrink-0 overflow-hidden border-r border-border",
|
|
3138
|
+
style: { width: sidebarWidth },
|
|
3139
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-(--designkit-page-padding-x) py-(--designkit-page-padding-y)", children: sidebar }) })
|
|
3140
|
+
}
|
|
3141
|
+
),
|
|
2816
3142
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2817
3143
|
"div",
|
|
2818
3144
|
{
|
|
@@ -2870,8 +3196,8 @@ function DetailBodySection({
|
|
|
2870
3196
|
{
|
|
2871
3197
|
className: cn(
|
|
2872
3198
|
"min-h-0",
|
|
2873
|
-
surface === "card" && "rounded-(--radius) border bg-card p-(--designkit-panel-gap) text-card-foreground shadow-sm",
|
|
2874
|
-
surface === "bordered" && "rounded-(--radius) border p-(--designkit-panel-gap)",
|
|
3199
|
+
surface === "card" && "rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap) text-card-foreground shadow-sm",
|
|
3200
|
+
surface === "bordered" && "rounded-(--radius) border border-border p-(--designkit-panel-gap)",
|
|
2875
3201
|
className
|
|
2876
3202
|
),
|
|
2877
3203
|
children: [
|
|
@@ -2916,11 +3242,14 @@ function DetailBodyTemplateRoot({
|
|
|
2916
3242
|
const hasTabs = tabs.length > 0;
|
|
2917
3243
|
const [activeTab, setActiveTab] = React2.useState(() => tabs[0]?.props.id ?? "");
|
|
2918
3244
|
const selectedTab = tabs.find((tab) => tab.props.id === activeTab) ?? tabs[0];
|
|
2919
|
-
const summarySlot = summary ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 rounded-(--radius) border bg-card p-(--designkit-panel-gap) text-card-foreground", children: summary }) : null;
|
|
3245
|
+
const summarySlot = summary ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap) text-card-foreground", children: summary }) : null;
|
|
2920
3246
|
const mediaSlot = media ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2921
3247
|
"div",
|
|
2922
3248
|
{
|
|
2923
|
-
className: cn(
|
|
3249
|
+
className: cn(
|
|
3250
|
+
"min-h-0 overflow-hidden rounded-(--radius) border border-border bg-card",
|
|
3251
|
+
mediaClassName
|
|
3252
|
+
),
|
|
2924
3253
|
children: media
|
|
2925
3254
|
}
|
|
2926
3255
|
) : null;
|
|
@@ -2990,7 +3319,7 @@ function DetailBodyTemplateRoot({
|
|
|
2990
3319
|
"div",
|
|
2991
3320
|
{
|
|
2992
3321
|
className: cn(
|
|
2993
|
-
"min-h-0 rounded-(--radius) border bg-card p-(--designkit-panel-gap)",
|
|
3322
|
+
"min-h-0 rounded-(--radius) border border-border bg-card p-(--designkit-panel-gap)",
|
|
2994
3323
|
asideClassName
|
|
2995
3324
|
),
|
|
2996
3325
|
children: insideAsideSlot
|
|
@@ -3033,7 +3362,7 @@ function DetailBodyTemplateRoot({
|
|
|
3033
3362
|
"aside",
|
|
3034
3363
|
{
|
|
3035
3364
|
className: cn(
|
|
3036
|
-
"min-h-0 border-t bg-background lg:border-l lg:border-t-0",
|
|
3365
|
+
"min-h-0 border-t border-border bg-background lg:border-l lg:border-t-0",
|
|
3037
3366
|
asideClassName
|
|
3038
3367
|
),
|
|
3039
3368
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3084,8 +3413,9 @@ function ListDetailBodyTemplate({
|
|
|
3084
3413
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3085
3414
|
"aside",
|
|
3086
3415
|
{
|
|
3416
|
+
"data-slot": "list-detail-list",
|
|
3087
3417
|
className: cn(
|
|
3088
|
-
"min-h-0 shrink-0 overflow-hidden border-r",
|
|
3418
|
+
"min-h-0 shrink-0 overflow-hidden border-r border-border",
|
|
3089
3419
|
detail ? "hidden lg:flex lg:w-[var(--ld-list-width)] lg:flex-col" : "flex w-full flex-col lg:w-[var(--ld-list-width)]",
|
|
3090
3420
|
listClassName
|
|
3091
3421
|
),
|
|
@@ -3101,7 +3431,7 @@ function ListDetailBodyTemplate({
|
|
|
3101
3431
|
detailClassName
|
|
3102
3432
|
),
|
|
3103
3433
|
children: [
|
|
3104
|
-
detail && onBack && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center border-b px-3 py-2 lg:hidden", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", className: "-ml-1 gap-1", onClick: onBack, children: [
|
|
3434
|
+
detail && onBack && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center border-b border-border px-3 py-2 lg:hidden", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", className: "-ml-1 gap-1", onClick: onBack, children: [
|
|
3105
3435
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" }),
|
|
3106
3436
|
backLabel
|
|
3107
3437
|
] }) }),
|
|
@@ -3154,7 +3484,7 @@ function PanelTemplateRoot({
|
|
|
3154
3484
|
] })
|
|
3155
3485
|
] }),
|
|
3156
3486
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("min-h-0 flex-1 overflow-y-auto px-4 py-4", bodyClassName), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-5", children }) }),
|
|
3157
|
-
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-t px-4 py-3", children: footer })
|
|
3487
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-t border-border px-4 py-3", children: footer })
|
|
3158
3488
|
] });
|
|
3159
3489
|
}
|
|
3160
3490
|
var PanelTemplate = Object.assign(PanelTemplateRoot, {
|
|
@@ -3294,7 +3624,7 @@ function TypographyBodyTemplate({ theme, breadcrumb }) {
|
|
|
3294
3624
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-2", children: ["API Gateway", "Billing Worker", "Notification Queue"].map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3295
3625
|
"div",
|
|
3296
3626
|
{
|
|
3297
|
-
className: "flex items-center justify-between rounded-lg border px-3 py-2",
|
|
3627
|
+
className: "flex items-center justify-between rounded-lg border border-border px-3 py-2",
|
|
3298
3628
|
children: [
|
|
3299
3629
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3300
3630
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: item }),
|
|
@@ -3342,14 +3672,10 @@ var useThemeStore = zustand.create((set) => ({
|
|
|
3342
3672
|
darkMode: false
|
|
3343
3673
|
},
|
|
3344
3674
|
overrides: {},
|
|
3345
|
-
activeShell: "sidebar",
|
|
3346
|
-
activeTemplate: "table",
|
|
3347
3675
|
setGlobal: (patch) => set((s) => ({ global: { ...s.global, ...patch } })),
|
|
3348
3676
|
setOverride: (id, patch) => set((s) => ({
|
|
3349
3677
|
overrides: { ...s.overrides, [id]: { ...s.overrides[id], ...patch } }
|
|
3350
|
-
}))
|
|
3351
|
-
setShell: (shell) => set({ activeShell: shell }),
|
|
3352
|
-
setTemplate: (template) => set({ activeTemplate: template })
|
|
3678
|
+
}))
|
|
3353
3679
|
}));
|
|
3354
3680
|
var tonalTokenDefs = [
|
|
3355
3681
|
{
|
|
@@ -3415,7 +3741,7 @@ function ColorSwatch({
|
|
|
3415
3741
|
variable,
|
|
3416
3742
|
formula
|
|
3417
3743
|
}) {
|
|
3418
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border", children: [
|
|
3744
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border border-border", children: [
|
|
3419
3745
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${bg} flex h-14 items-center justify-center`, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: `${fg} text-sm font-semibold`, children: "Aa" }) }),
|
|
3420
3746
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-card px-3 py-2 space-y-0.5", children: [
|
|
3421
3747
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium", children: name }),
|
|
@@ -3512,7 +3838,7 @@ function ColorsBodyTemplate({ theme, breadcrumb }) {
|
|
|
3512
3838
|
" \xB7 ",
|
|
3513
3839
|
"factor = 2\u20136% of primary chroma"
|
|
3514
3840
|
] }),
|
|
3515
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border divide-y text-xs font-mono", children: [
|
|
3841
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-hidden rounded-[var(--radius)] border border-border divide-y divide-border text-xs font-mono", children: [
|
|
3516
3842
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[7rem_1fr_1fr] bg-muted/50 px-3 py-1.5 text-muted-foreground", children: [
|
|
3517
3843
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "token" }),
|
|
3518
3844
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "light" }),
|
|
@@ -3524,7 +3850,7 @@ function ColorsBodyTemplate({ theme, breadcrumb }) {
|
|
|
3524
3850
|
className: "grid grid-cols-[7rem_1fr_1fr] items-center gap-x-3 px-3 py-2",
|
|
3525
3851
|
children: [
|
|
3526
3852
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3527
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${t.bg} h-5 w-5 shrink-0 rounded border` }),
|
|
3853
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${t.bg} h-5 w-5 shrink-0 rounded border border-border` }),
|
|
3528
3854
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: t.name })
|
|
3529
3855
|
] }),
|
|
3530
3856
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
|
|
@@ -3591,7 +3917,16 @@ function FormCard({
|
|
|
3591
3917
|
}) {
|
|
3592
3918
|
const widthCls = cardWidthClass[cardWidth];
|
|
3593
3919
|
if (card === "card") {
|
|
3594
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3920
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3921
|
+
"div",
|
|
3922
|
+
{
|
|
3923
|
+
className: cn(
|
|
3924
|
+
"w-full rounded-2xl border border-border bg-card px-8 py-10 shadow-lg",
|
|
3925
|
+
widthCls
|
|
3926
|
+
),
|
|
3927
|
+
children
|
|
3928
|
+
}
|
|
3929
|
+
);
|
|
3595
3930
|
}
|
|
3596
3931
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", widthCls), children });
|
|
3597
3932
|
}
|
|
@@ -3634,73 +3969,6 @@ function LoginBodyTemplate({
|
|
|
3634
3969
|
}
|
|
3635
3970
|
);
|
|
3636
3971
|
}
|
|
3637
|
-
function Breadcrumb({ className, ...props }) {
|
|
3638
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(className), ...props });
|
|
3639
|
-
}
|
|
3640
|
-
function BreadcrumbList({ className, ...props }) {
|
|
3641
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3642
|
-
"ol",
|
|
3643
|
-
{
|
|
3644
|
-
"data-slot": "breadcrumb-list",
|
|
3645
|
-
className: cn(
|
|
3646
|
-
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
|
|
3647
|
-
className
|
|
3648
|
-
),
|
|
3649
|
-
...props
|
|
3650
|
-
}
|
|
3651
|
-
);
|
|
3652
|
-
}
|
|
3653
|
-
function BreadcrumbItem({ className, ...props }) {
|
|
3654
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3655
|
-
"li",
|
|
3656
|
-
{
|
|
3657
|
-
"data-slot": "breadcrumb-item",
|
|
3658
|
-
className: cn("inline-flex items-center gap-1", className),
|
|
3659
|
-
...props
|
|
3660
|
-
}
|
|
3661
|
-
);
|
|
3662
|
-
}
|
|
3663
|
-
function BreadcrumbLink({ className, render, ...props }) {
|
|
3664
|
-
return useRender.useRender({
|
|
3665
|
-
defaultTagName: "a",
|
|
3666
|
-
props: mergeProps.mergeProps(
|
|
3667
|
-
{
|
|
3668
|
-
className: cn("transition-colors hover:text-foreground", className)
|
|
3669
|
-
},
|
|
3670
|
-
props
|
|
3671
|
-
),
|
|
3672
|
-
render,
|
|
3673
|
-
state: {
|
|
3674
|
-
slot: "breadcrumb-link"
|
|
3675
|
-
}
|
|
3676
|
-
});
|
|
3677
|
-
}
|
|
3678
|
-
function BreadcrumbPage({ className, ...props }) {
|
|
3679
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3680
|
-
"span",
|
|
3681
|
-
{
|
|
3682
|
-
"data-slot": "breadcrumb-page",
|
|
3683
|
-
role: "link",
|
|
3684
|
-
"aria-disabled": "true",
|
|
3685
|
-
"aria-current": "page",
|
|
3686
|
-
className: cn("font-normal text-foreground", className),
|
|
3687
|
-
...props
|
|
3688
|
-
}
|
|
3689
|
-
);
|
|
3690
|
-
}
|
|
3691
|
-
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
3692
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3693
|
-
"li",
|
|
3694
|
-
{
|
|
3695
|
-
"data-slot": "breadcrumb-separator",
|
|
3696
|
-
role: "presentation",
|
|
3697
|
-
"aria-hidden": "true",
|
|
3698
|
-
className: cn("[&>svg]:size-3.5", className),
|
|
3699
|
-
...props,
|
|
3700
|
-
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, {})
|
|
3701
|
-
}
|
|
3702
|
-
);
|
|
3703
|
-
}
|
|
3704
3972
|
function PageBreadcrumb({ items }) {
|
|
3705
3973
|
return /* @__PURE__ */ jsxRuntime.jsx(Breadcrumb, { children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbList, { className: "text-xs gap-1", children: items.map((item, i) => {
|
|
3706
3974
|
const isLast = i === items.length - 1;
|
|
@@ -3746,6 +4014,7 @@ function PageTopBar({
|
|
|
3746
4014
|
right,
|
|
3747
4015
|
variant = "ghost",
|
|
3748
4016
|
height = "var(--designkit-toolbar-height)",
|
|
4017
|
+
minHeight,
|
|
3749
4018
|
className,
|
|
3750
4019
|
style,
|
|
3751
4020
|
children,
|
|
@@ -3756,11 +4025,11 @@ function PageTopBar({
|
|
|
3756
4025
|
"div",
|
|
3757
4026
|
{
|
|
3758
4027
|
className: cn(
|
|
3759
|
-
"flex shrink-0 items-center justify-between gap-4 px-(--designkit-page-padding-x)",
|
|
3760
|
-
variant === "default" && "border-b",
|
|
4028
|
+
"flex shrink-0 items-center justify-between gap-4 overflow-visible px-(--designkit-page-padding-x)",
|
|
4029
|
+
variant === "default" && "border-b border-border",
|
|
3761
4030
|
className
|
|
3762
4031
|
),
|
|
3763
|
-
style: { height, ...style },
|
|
4032
|
+
style: { height, minHeight, ...style },
|
|
3764
4033
|
children: [
|
|
3765
4034
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2 text-xs text-muted-foreground", children: [
|
|
3766
4035
|
trigger,
|
|
@@ -3887,9 +4156,22 @@ function buildDarkTonalTokens(primaryHue, primaryChroma) {
|
|
|
3887
4156
|
function tokenMapToCss(tokens) {
|
|
3888
4157
|
return Object.entries(tokens).map(([key, value]) => ` ${key}: ${value};`).join("\n");
|
|
3889
4158
|
}
|
|
3890
|
-
function
|
|
4159
|
+
function getScopedTarget(scopeSelector) {
|
|
4160
|
+
if (scopeSelector === ":root") return document.documentElement;
|
|
4161
|
+
return document.querySelector(scopeSelector);
|
|
4162
|
+
}
|
|
4163
|
+
function getDarkSelector(scopeSelector) {
|
|
4164
|
+
if (scopeSelector === ":root") return ".dark";
|
|
4165
|
+
return `${scopeSelector}.dark, .dark ${scopeSelector}`;
|
|
4166
|
+
}
|
|
4167
|
+
function getLayoutSelector(scopeSelector, layoutClassName) {
|
|
4168
|
+
if (scopeSelector === ":root") return `.${layoutClassName}`;
|
|
4169
|
+
return `${scopeSelector}.${layoutClassName}, ${scopeSelector} .${layoutClassName}`;
|
|
4170
|
+
}
|
|
4171
|
+
function useStyleInjector(options = {}) {
|
|
3891
4172
|
const g = useThemeStore((s) => s.global);
|
|
3892
4173
|
const ov = useThemeStore((s) => s.overrides);
|
|
4174
|
+
const scopeSelector = options.scope?.trim() || ":root";
|
|
3893
4175
|
React2.useEffect(() => {
|
|
3894
4176
|
let el = document.getElementById(STYLE_ID);
|
|
3895
4177
|
if (!el) {
|
|
@@ -3897,10 +4179,10 @@ function useStyleInjector() {
|
|
|
3897
4179
|
el.id = STYLE_ID;
|
|
3898
4180
|
document.head.appendChild(el);
|
|
3899
4181
|
}
|
|
3900
|
-
const rootBlock =
|
|
4182
|
+
const rootBlock = `${scopeSelector} {
|
|
3901
4183
|
${tokenMapToCss(buildTokenMap(g))}
|
|
3902
4184
|
}`;
|
|
3903
|
-
const darkTonalBlock =
|
|
4185
|
+
const darkTonalBlock = `${getDarkSelector(scopeSelector)} {
|
|
3904
4186
|
${tokenMapToCss(buildDarkTonalTokens(g.primaryHue, g.primaryChroma))}
|
|
3905
4187
|
}`;
|
|
3906
4188
|
const tmplBlocks = Object.entries(ov).map(([id, o]) => {
|
|
@@ -3916,22 +4198,27 @@ ${tokenMapToCss(buildDarkTonalTokens(g.primaryHue, g.primaryChroma))}
|
|
|
3916
4198
|
toolbarHeight: o.toolbarHeight
|
|
3917
4199
|
});
|
|
3918
4200
|
const layoutClassName = `layout-${id}`;
|
|
3919
|
-
return
|
|
4201
|
+
return `${getLayoutSelector(scopeSelector, layoutClassName)} {
|
|
3920
4202
|
${tokenMapToCss(tokens)}
|
|
3921
4203
|
}`;
|
|
3922
4204
|
}).filter(Boolean);
|
|
3923
|
-
|
|
3924
|
-
|
|
4205
|
+
const layerBody = [rootBlock, darkTonalBlock, ...tmplBlocks].join("\n\n");
|
|
4206
|
+
el.textContent = `@layer designkit {
|
|
4207
|
+
${layerBody}
|
|
4208
|
+
}`;
|
|
4209
|
+
}, [g, ov, scopeSelector]);
|
|
3925
4210
|
React2.useEffect(() => {
|
|
3926
|
-
|
|
3927
|
-
}, [g.darkMode]);
|
|
4211
|
+
getScopedTarget(scopeSelector)?.classList.toggle("dark", g.darkMode);
|
|
4212
|
+
}, [g.darkMode, scopeSelector]);
|
|
3928
4213
|
React2.useEffect(() => {
|
|
4214
|
+
const target = getScopedTarget(scopeSelector);
|
|
4215
|
+
if (!target) return;
|
|
3929
4216
|
if (g.density === "default") {
|
|
3930
|
-
|
|
4217
|
+
target.removeAttribute("data-designkit-density");
|
|
3931
4218
|
return;
|
|
3932
4219
|
}
|
|
3933
|
-
|
|
3934
|
-
}, [g.density]);
|
|
4220
|
+
target.dataset.designkitDensity = g.density;
|
|
4221
|
+
}, [g.density, scopeSelector]);
|
|
3935
4222
|
}
|
|
3936
4223
|
function buildTemplateTheme(g, ov = {}) {
|
|
3937
4224
|
const tokens = buildTokenMap({
|
|
@@ -3951,6 +4238,17 @@ function buildTemplateTheme(g, ov = {}) {
|
|
|
3951
4238
|
return tokens;
|
|
3952
4239
|
}
|
|
3953
4240
|
|
|
4241
|
+
exports.AlertDialog = AlertDialog;
|
|
4242
|
+
exports.AlertDialogAction = AlertDialogAction;
|
|
4243
|
+
exports.AlertDialogCancel = AlertDialogCancel;
|
|
4244
|
+
exports.AlertDialogContent = AlertDialogContent;
|
|
4245
|
+
exports.AlertDialogDescription = AlertDialogDescription;
|
|
4246
|
+
exports.AlertDialogFooter = AlertDialogFooter;
|
|
4247
|
+
exports.AlertDialogHeader = AlertDialogHeader;
|
|
4248
|
+
exports.AlertDialogOverlay = AlertDialogOverlay;
|
|
4249
|
+
exports.AlertDialogPortal = AlertDialogPortal;
|
|
4250
|
+
exports.AlertDialogTitle = AlertDialogTitle;
|
|
4251
|
+
exports.AlertDialogTrigger = AlertDialogTrigger;
|
|
3954
4252
|
exports.Avatar = Avatar;
|
|
3955
4253
|
exports.AvatarBadge = AvatarBadge;
|
|
3956
4254
|
exports.AvatarFallback = AvatarFallback;
|
|
@@ -3958,6 +4256,13 @@ exports.AvatarGroup = AvatarGroup;
|
|
|
3958
4256
|
exports.AvatarGroupCount = AvatarGroupCount;
|
|
3959
4257
|
exports.AvatarImage = AvatarImage;
|
|
3960
4258
|
exports.Badge = Badge;
|
|
4259
|
+
exports.Breadcrumb = Breadcrumb;
|
|
4260
|
+
exports.BreadcrumbEllipsis = BreadcrumbEllipsis;
|
|
4261
|
+
exports.BreadcrumbItem = BreadcrumbItem;
|
|
4262
|
+
exports.BreadcrumbLink = BreadcrumbLink;
|
|
4263
|
+
exports.BreadcrumbList = BreadcrumbList;
|
|
4264
|
+
exports.BreadcrumbPage = BreadcrumbPage;
|
|
4265
|
+
exports.BreadcrumbSeparator = BreadcrumbSeparator;
|
|
3961
4266
|
exports.BrowseBodyTemplate = BrowseBodyTemplate;
|
|
3962
4267
|
exports.Button = Button;
|
|
3963
4268
|
exports.Card = Card;
|