@vendure-io/ui 2.0.0-beta.2 → 2.0.0-beta.3

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.2",
3
+ "version": "2.0.0-beta.3",
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",
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@base-ui/react": "^1.2.0",
52
52
  "@tanstack/react-table": "^8.21.3",
53
- "@vendure-io/design-tokens": "^2.0.0-beta.0",
53
+ "@vendure-io/design-tokens": "^2.0.0-beta.1",
54
54
  "class-variance-authority": "^0.7.1",
55
55
  "clsx": "^2.1.1",
56
56
  "cmdk": "^1.1.1",
@@ -12,7 +12,7 @@ function Card({
12
12
  data-slot="card"
13
13
  data-size={size}
14
14
  className={cn(
15
- "bg-card text-card-foreground group/card flex flex-col gap-6 overflow-hidden rounded-xl py-6 text-sm has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
15
+ "bg-card text-card-foreground group/card flex flex-col gap-6 overflow-hidden rounded-xl border border-border/60 py-6 text-sm has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
16
16
  className
17
17
  )}
18
18
  {...props}
@@ -303,11 +303,16 @@ function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
303
303
  }
304
304
 
305
305
  function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
306
+ // The inset variant is our recessed content pane, built on the surface ramp: it
307
+ // steps up to --surface while the wrapper stays on --background, so the shell
308
+ // recedes and cards (--surface-raised) lift off the pane. A border carries the
309
+ // tier in light mode where the ramp collapses to white; flat by design, no drop
310
+ // shadow (see AGENTS.md "flat look"). The default variant stays flush on canvas.
306
311
  return (
307
312
  <main
308
313
  data-slot="sidebar-inset"
309
314
  className={cn(
310
- "bg-background relative flex w-full flex-1 flex-col 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]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
315
+ "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",
311
316
  className
312
317
  )}
313
318
  {...props}
@@ -57,7 +57,7 @@ function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
57
57
  <tr
58
58
  data-slot="table-row"
59
59
  className={cn(
60
- "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
60
+ "hover:bg-muted/50 data-[state=selected]:bg-muted border-b border-border/50 transition-colors",
61
61
  className
62
62
  )}
63
63
  {...props}
@@ -0,0 +1,60 @@
1
+ import { cn } from '@vendure-io/ui/lib/utils';
2
+ import type * as React from 'react';
3
+
4
+ // AppShell — the recessed-surface app layout, built on the surface ramp.
5
+ //
6
+ // Nests three surface tiers so the chrome reads as "deep" the way Linear's does:
7
+ //
8
+ // AppShell → --background the canvas the whole window sits on
9
+ // AppShellSidebar → --sidebar nav rail; equals the canvas, so it recedes
10
+ // AppShellContent → --surface the content pane, stepped forward + inset
11
+ //
12
+ // Cards dropped into the content pane resolve to --surface-raised (via the `card`
13
+ // token), completing the third step. In dark mode each tier is a lightness step;
14
+ // in light mode the ramp collapses to white, so the pane's border + shadow carry
15
+ // the step instead. That asymmetry is intentional, not a gap.
16
+ //
17
+ // The sidebar slot is deliberately unopinionated: drop the full `Sidebar` atom in
18
+ // for a real app, or use `AppShellSidebar` for a lightweight rail.
19
+
20
+ function AppShell({ className, ...props }: React.ComponentProps<'div'>) {
21
+ return (
22
+ <div
23
+ data-slot="app-shell"
24
+ className={cn('bg-background text-foreground flex min-h-svh w-full', className)}
25
+ {...props}
26
+ />
27
+ );
28
+ }
29
+
30
+ function AppShellSidebar({ className, ...props }: React.ComponentProps<'aside'>) {
31
+ return (
32
+ <aside
33
+ data-slot="app-shell-sidebar"
34
+ className={cn(
35
+ 'bg-sidebar text-sidebar-foreground flex w-64 shrink-0 flex-col gap-1 p-3',
36
+ className,
37
+ )}
38
+ {...props}
39
+ />
40
+ );
41
+ }
42
+
43
+ function AppShellContent({ className, ...props }: React.ComponentProps<'main'>) {
44
+ return (
45
+ <main
46
+ data-slot="app-shell-content"
47
+ className={cn(
48
+ // The missing tier: step up to --surface and inset from the canvas so the
49
+ // shell frames the pane on all sides, including a gutter between the
50
+ // sidebar and the pane. Flat by design: the border carries the tier in
51
+ // light mode (see AGENTS.md "flat look"), so no drop shadow.
52
+ 'bg-surface m-3 flex flex-1 flex-col overflow-hidden rounded-xl border border-border/60',
53
+ className,
54
+ )}
55
+ {...props}
56
+ />
57
+ );
58
+ }
59
+
60
+ export { AppShell, AppShellSidebar, AppShellContent };
@@ -367,7 +367,7 @@ function DataTable<TData>({
367
367
  <DataTableBulkActions table={table} cache={selectionCache} render={bulkActions} />
368
368
  )}
369
369
 
370
- <div className="bg-card overflow-hidden rounded-xl border">
370
+ <div className="bg-card overflow-hidden rounded-xl border border-border/60">
371
371
  <Table>
372
372
  <TableHeader>
373
373
  {table.getHeaderGroups().map((headerGroup) => (