@vendure-io/ui 2.0.0-beta.4 → 2.0.0-beta.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure-io/ui",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.6",
|
|
4
4
|
"description": "React component library for Vendure, built on shadcn/ui and Tailwind v4",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://github.com/vendurehq/design/tree/main/packages/ui",
|
|
@@ -302,22 +302,32 @@ function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
|
|
|
302
302
|
)
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
function SidebarInset({
|
|
305
|
+
function SidebarInset({
|
|
306
|
+
className,
|
|
307
|
+
render,
|
|
308
|
+
...props
|
|
309
|
+
}: useRender.ComponentProps<"main">) {
|
|
306
310
|
// The inset variant is our recessed content pane, built on the surface ramp: it
|
|
307
311
|
// steps up to --surface while the wrapper stays on --background, so the shell
|
|
308
312
|
// recedes and cards (--surface-raised) lift off the pane. A border carries the
|
|
309
313
|
// tier in light mode where the ramp collapses to white; flat by design, no drop
|
|
310
314
|
// shadow (see AGENTS.md "flat look"). The default variant stays flush on canvas.
|
|
311
|
-
return (
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
315
|
+
return useRender({
|
|
316
|
+
defaultTagName: "main",
|
|
317
|
+
props: mergeProps<"main">(
|
|
318
|
+
{
|
|
319
|
+
className: cn(
|
|
320
|
+
"bg-background relative flex w-full flex-1 flex-col md:peer-data-[variant=inset]:bg-surface md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:border md:peer-data-[variant=inset]:border-border/60 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
|
|
321
|
+
className
|
|
322
|
+
),
|
|
323
|
+
},
|
|
324
|
+
props
|
|
325
|
+
),
|
|
326
|
+
render,
|
|
327
|
+
state: {
|
|
328
|
+
slot: "sidebar-inset",
|
|
329
|
+
},
|
|
330
|
+
})
|
|
321
331
|
}
|
|
322
332
|
|
|
323
333
|
function SidebarInput({
|
|
@@ -17,13 +17,14 @@ import type * as React from 'react';
|
|
|
17
17
|
// The sidebar slot is deliberately unopinionated: drop the full `Sidebar` atom in
|
|
18
18
|
// for a real app, or use `AppShellSidebar` for a lightweight rail. Content owns a
|
|
19
19
|
// header + main anatomy so every consumer gets the same scroll boundary and skip
|
|
20
|
-
// link target without coupling the design system to a router or auth provider.
|
|
20
|
+
// link target without coupling the design system to a router or auth provider. The
|
|
21
|
+
// shell is viewport-bound so the canvas inset remains visible while main scrolls.
|
|
21
22
|
|
|
22
23
|
function AppShell({ className, ...props }: React.ComponentProps<'div'>) {
|
|
23
24
|
return (
|
|
24
25
|
<div
|
|
25
26
|
data-slot="app-shell"
|
|
26
|
-
className={cn('bg-background text-foreground flex
|
|
27
|
+
className={cn('bg-background text-foreground flex h-svh w-full overflow-hidden', className)}
|
|
27
28
|
{...props}
|
|
28
29
|
/>
|
|
29
30
|
);
|
|
@@ -72,16 +73,38 @@ function AppShellHeader({ className, ...props }: React.ComponentProps<'header'>)
|
|
|
72
73
|
);
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
interface AppShellMainProps extends React.ComponentProps<'main'> {
|
|
77
|
+
/** The element responsible for scrolling the main content region. */
|
|
78
|
+
scrollOwner?: 'main' | 'container';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function AppShellMain({
|
|
82
|
+
className,
|
|
83
|
+
id = 'main-content',
|
|
84
|
+
scrollOwner = 'main',
|
|
85
|
+
...props
|
|
86
|
+
}: AppShellMainProps) {
|
|
76
87
|
return (
|
|
77
88
|
<main
|
|
78
89
|
id={id}
|
|
79
90
|
tabIndex={-1}
|
|
80
91
|
data-slot="app-shell-main"
|
|
81
|
-
className={cn(
|
|
92
|
+
className={cn(
|
|
93
|
+
scrollOwner === 'main'
|
|
94
|
+
? 'min-h-0 min-w-0 flex-1 overflow-auto outline-none'
|
|
95
|
+
: 'min-w-0 flex-1 outline-none',
|
|
96
|
+
className,
|
|
97
|
+
)}
|
|
82
98
|
{...props}
|
|
83
99
|
/>
|
|
84
100
|
);
|
|
85
101
|
}
|
|
86
102
|
|
|
87
|
-
export {
|
|
103
|
+
export {
|
|
104
|
+
AppShell,
|
|
105
|
+
AppShellSidebar,
|
|
106
|
+
AppShellContent,
|
|
107
|
+
AppShellHeader,
|
|
108
|
+
AppShellMain,
|
|
109
|
+
type AppShellMainProps,
|
|
110
|
+
};
|