@columenlabs/lumen-ui 0.1.144 → 0.1.146

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.
@@ -11,6 +11,9 @@ export interface LumenApp {
11
11
  icon?: NavIcon;
12
12
  /** An image of its mark (another site's favicon). */
13
13
  iconUrl?: string;
14
+ /** Its `icon` or `iconUrl` is a whole app tile (its own coloured square, like a favicon): the
15
+ * switcher draws it at the box's full size instead of a small glyph inside the box. */
16
+ tile?: boolean;
14
17
  href: string;
15
18
  /** The heading it sits under; apps with none lead the menu under `menuLabel`. */
16
19
  group?: string;
@@ -33,6 +36,8 @@ export interface SuiteApp {
33
36
  url: string;
34
37
  icon?: string;
35
38
  iconUrl?: string;
39
+ /** The icon is a whole app tile (LumenApp `tile`). */
40
+ tile?: boolean;
36
41
  group?: string;
37
42
  }
38
43
  /** What a suite list address answers. */
@@ -42,7 +42,7 @@ export function LumenAppSwitcher({ current, apps, product, menuLabel = 'Apps', }
42
42
  else
43
43
  groups.unshift({ label, apps: [a] });
44
44
  }
45
- return (_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { size: "lg", tooltip: current.name, className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground", children: [_jsx("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground", children: _jsx(AppMark, { app: current, className: "size-4" }) }), _jsxs("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [_jsx("span", { className: "truncate font-semibold", children: current.label ?? current.name }), product && (_jsx("span", { className: "truncate text-xs text-muted-foreground", children: product }))] }), _jsx(ChevronsUpDownIcon, { className: "ml-auto" })] }) }), _jsx(DropdownMenuContent, { className: "min-w-56 max-w-96 rounded-lg", align: "start", side: isMobile ? 'bottom' : 'right', sideOffset: 4, children: groups.map((g, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuLabel, { className: "text-xs text-muted-foreground", children: g.label }), g.apps.map((a) => (_jsx(DropdownMenuItem, { asChild: true, className: cn('gap-2 p-2', a.id === current.id && 'bg-muted'), children: _jsxs("a", { href: a.href, "aria-current": a.id === current.id ? 'page' : undefined, children: [_jsx("div", { className: "flex size-6 shrink-0 items-center justify-center rounded-md border", children: _jsx(AppMark, { app: a, className: "size-3.5 shrink-0" }) }), _jsx("span", { className: cn('truncate', a.external && 'shrink-0'), children: a.label ?? a.name }), a.external && (_jsxs(_Fragment, { children: [_jsx("span", { className: "ml-auto min-w-0 truncate text-xs text-muted-foreground", children: hostOf(a.href) }), _jsx(ArrowUpRightIcon, { className: "size-3.5 shrink-0 text-muted-foreground" })] }))] }) }, a.id)))] }, g.label))) })] }) }) }));
45
+ return (_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { size: "lg", tooltip: current.name, className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground", children: [current.tile ? (_jsx(AppMark, { app: current, className: "aspect-square size-8 shrink-0 rounded-lg" })) : (_jsx("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground", children: _jsx(AppMark, { app: current, className: "size-4" }) })), _jsxs("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [_jsx("span", { className: "truncate font-semibold", children: current.label ?? current.name }), product && (_jsx("span", { className: "truncate text-xs text-muted-foreground", children: product }))] }), _jsx(ChevronsUpDownIcon, { className: "ml-auto" })] }) }), _jsx(DropdownMenuContent, { className: "min-w-56 max-w-96 rounded-lg", align: "start", side: isMobile ? 'bottom' : 'right', sideOffset: 4, children: groups.map((g, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuLabel, { className: "text-xs text-muted-foreground", children: g.label }), g.apps.map((a) => (_jsx(DropdownMenuItem, { asChild: true, className: cn('gap-2 p-2', a.id === current.id && 'bg-muted'), children: _jsxs("a", { href: a.href, "aria-current": a.id === current.id ? 'page' : undefined, children: [a.tile ? (_jsx(AppMark, { app: a, className: "size-6 shrink-0 rounded-md" })) : (_jsx("div", { className: "flex size-6 shrink-0 items-center justify-center rounded-md border", children: _jsx(AppMark, { app: a, className: "size-3.5 shrink-0" }) })), _jsx("span", { className: cn('truncate', a.external && 'shrink-0'), children: a.label ?? a.name }), a.external && (_jsxs(_Fragment, { children: [_jsx("span", { className: "ml-auto min-w-0 truncate text-xs text-muted-foreground", children: hostOf(a.href) }), _jsx(ArrowUpRightIcon, { className: "size-3.5 shrink-0 text-muted-foreground" })] }))] }) }, a.id)))] }, g.label))) })] }) }) }));
46
46
  }
47
47
  /** How far `url` matches this page: its host, then the longest path it starts. */
48
48
  const matchLength = (url, here) => {
@@ -67,6 +67,7 @@ export function suiteApps(list, here) {
67
67
  href: a.url,
68
68
  icon: a.icon ? lucideIcon(a.icon) : undefined,
69
69
  iconUrl: a.iconUrl,
70
+ tile: a.tile,
70
71
  group: a.group,
71
72
  external: hostOf(a.url) !== here.host,
72
73
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@columenlabs/lumen-ui",
3
- "version": "0.1.144",
3
+ "version": "0.1.146",
4
4
  "description": "Lumen: shared React components (frame, views, widgets, charts, drawers).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -49,7 +49,7 @@
49
49
  "@codemirror/lang-javascript": "6.2.5",
50
50
  "@codemirror/lang-json": "6.0.2",
51
51
  "@codemirror/lang-sql": "6.10.0",
52
- "@columenlabs/lumen-ui-types": "0.1.144",
52
+ "@columenlabs/lumen-ui-types": "0.1.146",
53
53
  "@dnd-kit/core": "6.3.1",
54
54
  "@dnd-kit/sortable": "10.0.0",
55
55
  "@dnd-kit/utilities": "3.2.2",