@brdgapp/ui 1.4.0 → 1.5.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  Every release of `@brdgapp/ui`. Versions follow the rules in README.md → Versions.
4
4
 
5
+ ## 1.5.0
6
+
7
+ 2026-11-16. AppShell, AccountMenu and Breadcrumbs, and Drawer gains a width and a toolbar. Nothing changes for apps already on 1.4, so they can update without changes.
8
+
9
+ - New: AppShell (`components/app-shell`), every app's navigation. A 56px glass top bar with search,
10
+ `actions` (the AppLauncher) and `account` on its right in every app. `nav="top"`: the logo and the tabs
11
+ (four places or fewer) on its left; five or more use `nav="side"`. `nav="side"`: a full-height 224px side menu, in groups, with the logo and its
12
+ shrink button at the top; it shrinks to 56px of icons (the button or ⌘B, `logoMark` at the top) and
13
+ remembers it, and the top bar beside it takes `breadcrumbs`. Phones: tabs move to a bottom bar; a side
14
+ menu slides in from ☰. `renderLink` takes your router's link. Every app's own header, sidebar and bottom
15
+ bar become this.
16
+ - New: AccountMenu (`components/account-menu`): your account from the top bar's avatar. "Signed in as" always;
17
+ then only the parts an app passes: `tag`, `workspaces`, `profileHref`, `settingsHref`, `adminHref`,
18
+ `bridgeAccountHref`, `connectedAccounts` (with sync and Manage), `extra`, `onSignOut`. Every app's own avatar
19
+ dropdown becomes this, in AppShell's `account`.
20
+ - New: Breadcrumbs (`components/breadcrumbs`): where a page sits, Admin › Directory › Firms, for AppShell's
21
+ `breadcrumbs`.
22
+ - Drawer: `size="wide"`, 1152px (always leaving 64px of the page in view), for a table or a two-pane editor.
23
+ Its body has no padding, so a DataTable runs edge to edge. Bridge OS's "Your contacts" drawer and
24
+ app-directories' page builder become this.
25
+ - Drawer: `toolbar`, pinned under the header. Pass a DataTableToolbar with the search and filters, so they stay
26
+ in view while the list scrolls.
27
+ - DataTableToolbar: with no search, filters start at the left instead of the right (a drawer's row of
28
+ FilterChips). With a search, nothing moves.
29
+
5
30
  ## 1.4.0
6
31
 
7
32
  2026-11-12. Three new components. Nothing changes for apps already on 1.3, so they can update without changes.
@@ -0,0 +1,75 @@
1
+ import * as React from "react";
2
+ import { type TagColor } from "@brdgapp/ui/components/tag";
3
+ type AccountMenuUser = {
4
+ name: string;
5
+ email?: string;
6
+ /** Their photo. Without it, initials. */
7
+ avatarUrl?: string;
8
+ };
9
+ type AccountMenuWorkspace = {
10
+ id: string;
11
+ name: string;
12
+ /** A logo or favicon, 24px. Without it, the name's initials. */
13
+ icon?: React.ReactNode;
14
+ /** The one people are in: gets a check. */
15
+ current?: boolean;
16
+ /** Something new there: a count. */
17
+ badge?: number;
18
+ };
19
+ type AccountMenuConnectedAccount = {
20
+ id: string;
21
+ /** The company's domain for a work account ("brdg.app"), or the address for a personal one. */
22
+ name: string;
23
+ /** The line under it: the address, or "Synced 2h ago". */
24
+ detail?: string;
25
+ /** The company's favicon, 20px. */
26
+ icon?: React.ReactNode;
27
+ kind: "work" | "personal";
28
+ primary?: boolean;
29
+ };
30
+ type AccountMenuLinkProps = {
31
+ href: string;
32
+ className: string;
33
+ children: React.ReactNode;
34
+ onClick?: () => void;
35
+ };
36
+ type AccountMenuProps = {
37
+ /** Who's signed in. Required: the menu always starts with "Signed in as". */
38
+ user: AccountMenuUser;
39
+ /** Their plan or role beside the name: `{ label: "Pro", color: "blue" }`. Free is grey, paid blue, custom purple. */
40
+ tag?: {
41
+ label: string;
42
+ color?: TagColor;
43
+ };
44
+ /** Apps with workspaces: listed under your name. Choosing one calls `onWorkspaceChange`. */
45
+ workspaces?: AccountMenuWorkspace[];
46
+ onWorkspaceChange?: (id: string) => void;
47
+ /** Shows "View profile". */
48
+ profileHref?: string;
49
+ /** Shows "Account settings". */
50
+ settingsHref?: string;
51
+ /** Shows "Bridge account", opening in a new tab: `"https://brdg.app/account"`. */
52
+ bridgeAccountHref?: string;
53
+ /** Shows "Admin controls", for people allowed in. */
54
+ adminHref?: string;
55
+ /** Shows "Connected accounts": the email accounts Bridge reads, under Work and Personal. */
56
+ connectedAccounts?: AccountMenuConnectedAccount[];
57
+ /** While they load, after opening. */
58
+ connectedAccountsLoading?: boolean;
59
+ /** Shows the sync button beside "Connected accounts". Return a promise to show it spinning, then done or failed. */
60
+ onSyncAccounts?: () => void | Promise<unknown>;
61
+ /** Shows "Manage" beside "Connected accounts". */
62
+ manageAccountsHref?: string;
63
+ /** One section of the app's own, before Sign out: a card, a toggle, "Clear cache". */
64
+ extra?: React.ReactNode;
65
+ /** Shows "Sign out", the last row, in red. */
66
+ onSignOut?: () => void;
67
+ /** Your router's link, as in AppShell: `(p) => <Link {...p} />`. Default a plain <a>. */
68
+ renderLink?: (props: AccountMenuLinkProps) => React.ReactElement;
69
+ /** Control it, to load connected accounts when it opens. Leave both out and it opens and closes itself. */
70
+ open?: boolean;
71
+ onOpenChange?: (open: boolean) => void;
72
+ };
73
+ declare function AccountMenu({ user, tag, workspaces, onWorkspaceChange, profileHref, settingsHref, bridgeAccountHref, adminHref, connectedAccounts, connectedAccountsLoading, onSyncAccounts, manageAccountsHref, extra, onSignOut, renderLink, open: openProp, onOpenChange, }: AccountMenuProps): React.JSX.Element;
74
+ export { AccountMenu };
75
+ export type { AccountMenuConnectedAccount, AccountMenuLinkProps, AccountMenuProps, AccountMenuUser, AccountMenuWorkspace };
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Check, CircleAlert, CircleCheck, CircleUser, ExternalLink, LogOut, RefreshCw, Settings, Shield, User } from "lucide-react";
5
+ import { Avatar } from "@brdgapp/ui/components/avatar";
6
+ import { IconButton } from "@brdgapp/ui/components/icon-button";
7
+ import { Popover } from "@brdgapp/ui/components/popover";
8
+ import { Skeleton } from "@brdgapp/ui/components/skeleton";
9
+ import { Tag } from "@brdgapp/ui/components/tag";
10
+ import { cn } from "@brdgapp/ui/lib/utils";
11
+ const plainLink = (props) => _jsx("a", { ...props });
12
+ // The same row as ActionMenu's items, run edge to edge across the panel.
13
+ const ROW = "flex w-full items-center gap-3 px-4 py-2.5 max-md:min-h-11 text-left text-13 font-medium leading-normal text-[var(--text-body)] outline-none transition-colors " +
14
+ "hover:bg-[var(--surface-secondary)] hover:text-[var(--text-primary)] focus-visible:bg-[var(--surface-secondary)] focus-visible:text-[var(--text-primary)] " +
15
+ "[&_svg]:size-4 [&_svg]:shrink-0 [&>svg:first-child]:text-[var(--text-muted)]";
16
+ const HEADING = "px-4 pb-1.5 text-12 font-medium text-[var(--text-muted)]";
17
+ function Divider() {
18
+ return _jsx("div", { "aria-hidden": "true", className: "my-1 border-t border-[var(--border-divider)]" });
19
+ }
20
+ function AccountMenu({ user, tag, workspaces, onWorkspaceChange, profileHref, settingsHref, bridgeAccountHref, adminHref, connectedAccounts, connectedAccountsLoading = false, onSyncAccounts, manageAccountsHref, extra, onSignOut, renderLink, open: openProp, onOpenChange, }) {
21
+ const link = renderLink ?? plainLink;
22
+ const [ownOpen, setOwnOpen] = React.useState(false);
23
+ const open = openProp ?? ownOpen;
24
+ const setOpen = (next) => {
25
+ if (openProp === undefined)
26
+ setOwnOpen(next);
27
+ onOpenChange?.(next);
28
+ };
29
+ const close = () => setOpen(false);
30
+ const links = [
31
+ profileHref ? link({ href: profileHref, onClick: close, className: ROW, children: _jsxs(_Fragment, { children: [_jsx(User, { "aria-hidden": "true" }), "View profile"] }) }) : null,
32
+ settingsHref ? link({ href: settingsHref, onClick: close, className: ROW, children: _jsxs(_Fragment, { children: [_jsx(Settings, { "aria-hidden": "true" }), "Account settings"] }) }) : null,
33
+ adminHref ? link({ href: adminHref, onClick: close, className: ROW, children: _jsxs(_Fragment, { children: [_jsx(Shield, { "aria-hidden": "true" }), "Admin controls"] }) }) : null,
34
+ bridgeAccountHref ? (_jsxs("a", { href: bridgeAccountHref, target: "_blank", rel: "noopener noreferrer", onClick: close, className: ROW, children: [_jsx(CircleUser, { "aria-hidden": "true" }), _jsx("span", { className: "flex-1", children: "Bridge account" }), _jsx(ExternalLink, { "aria-hidden": "true", className: "text-[var(--text-muted)]" }), _jsx("span", { className: "sr-only", children: "(opens in a new tab)" })] })) : null,
35
+ ].filter(Boolean);
36
+ return (_jsx(Popover, { open: open, onOpenChange: setOpen, title: "Your account", hideTitle: true, align: "end", trigger: _jsx("button", { type: "button", "aria-label": "Your account", className: "flex shrink-0 rounded-full ring-1 ring-[var(--border-default)] transition-shadow outline-none hover:ring-[var(--border-hover)] focus-visible:ring-2 focus-visible:ring-[var(--primary)] focus-visible:ring-offset-2", children: _jsx(Avatar, { name: user.name, src: user.avatarUrl, size: "md" }) }), children: _jsxs("div", { "data-slot": "account-menu", className: "-m-4 py-2", children: [_jsx("p", { className: cn(HEADING, "pt-2"), children: "Signed in as" }), _jsxs("div", { className: "flex items-center gap-3 px-4 pb-3", children: [_jsx(Avatar, { name: user.name, src: user.avatarUrl, size: "lg", className: "shrink-0" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "truncate text-14 font-semibold text-[var(--text-primary)]", children: user.name }), user.email ? _jsx("p", { className: "truncate text-12 text-[var(--text-muted)]", children: user.email }) : null] }), tag ? (_jsx(Tag, { color: tag.color ?? "grey", size: "sm", className: "shrink-0", children: tag.label })) : null] }), workspaces?.length ? (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsxs("div", { role: "group", "aria-label": "Workspaces", className: "py-1", children: [_jsx("p", { className: cn(HEADING, "pt-1.5"), children: "Workspaces" }), workspaces.map((w) => (_jsxs("button", { type: "button", "aria-current": w.current ? "true" : undefined, onClick: () => {
37
+ onWorkspaceChange?.(w.id);
38
+ close();
39
+ }, className: cn(ROW, w.current ? "text-[var(--text-primary)]" : ""), children: [_jsx("span", { "aria-hidden": "true", className: "flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-md [&_img]:size-6", children: w.icon ?? _jsx(Avatar, { name: w.name, size: "sm" }) }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: w.name }), w.badge ? (_jsxs("span", { className: "text-12 text-[var(--text-muted)] tabular-nums", children: [w.badge, _jsx("span", { className: "sr-only", children: " new" })] })) : null, w.current ? _jsx(Check, { "aria-hidden": "true", className: "text-[var(--primary)]" }) : _jsx("span", { "aria-hidden": "true", className: "size-4" })] }, w.id)))] })] })) : null, links.length ? (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx("div", { className: "py-1", children: links.map((l, i) => React.cloneElement(l, { key: i })) })] })) : null, connectedAccounts ? (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(ConnectedAccounts, { accounts: connectedAccounts, loading: connectedAccountsLoading, onSync: onSyncAccounts, manage: manageAccountsHref ? link({ href: manageAccountsHref, onClick: close, className: "rounded-sm text-12 font-semibold text-[var(--primary)] outline-none hover:underline focus-visible:ring-2 focus-visible:ring-[var(--primary)]", children: "Manage" }) : null })] })) : null, extra ? (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx("div", { className: "px-4 py-2", children: extra })] })) : null, onSignOut ? (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx("div", { className: "py-1", children: _jsxs("button", { type: "button", onClick: () => {
40
+ close();
41
+ onSignOut();
42
+ }, className: cn(ROW, "text-[var(--danger-text)] hover:bg-[var(--error-bg)] hover:text-[var(--danger-text)] focus-visible:bg-[var(--error-bg)] focus-visible:text-[var(--danger-text)] [&>svg:first-child]:text-[var(--danger-text)]"), children: [_jsx(LogOut, { "aria-hidden": "true" }), "Sign out"] }) })] })) : null] }) }));
43
+ }
44
+ function ConnectedAccounts({ accounts, loading, onSync, manage, }) {
45
+ const [sync, setSync] = React.useState("idle");
46
+ const run = async () => {
47
+ if (!onSync || sync === "syncing")
48
+ return;
49
+ const result = onSync();
50
+ if (!(result instanceof Promise))
51
+ return;
52
+ setSync("syncing");
53
+ try {
54
+ await result;
55
+ setSync("done");
56
+ }
57
+ catch {
58
+ setSync("error");
59
+ }
60
+ setTimeout(() => setSync("idle"), 3000);
61
+ };
62
+ const work = accounts.filter((a) => a.kind === "work");
63
+ const personal = accounts.filter((a) => a.kind === "personal");
64
+ return (_jsxs("div", { role: "group", "aria-label": "Connected accounts", className: "px-4 py-2", children: [_jsxs("div", { className: "mb-2 flex items-center justify-between gap-2", children: [_jsx("p", { className: "text-12 font-medium text-[var(--text-muted)]", children: "Connected accounts" }), _jsxs("div", { className: "flex items-center gap-2", children: [onSync ? (_jsx(IconButton, { size: "sm", variant: sync === "error" ? "danger" : "default", loading: sync === "syncing", onClick: run, "aria-label": sync === "syncing" ? "Syncing accounts" : sync === "done" ? "Sync started" : sync === "error" ? "Sync failed" : "Sync accounts", children: sync === "done" ? _jsx(CircleCheck, {}) : sync === "error" ? _jsx(CircleAlert, {}) : _jsx(RefreshCw, {}) })) : null, manage] })] }), loading ? (_jsx("div", { className: "space-y-1.5", children: [0, 1].map((i) => (_jsxs("div", { className: "flex items-center gap-2.5 rounded-lg bg-[var(--surface-secondary)] px-3 py-2", children: [_jsx(Skeleton, { className: "size-5 shrink-0" }), _jsxs("div", { className: "flex-1 space-y-1.5", children: [_jsx(Skeleton, { className: "h-3 w-24" }), _jsx(Skeleton, { className: "h-2.5 w-32" })] })] }, i))) })) : accounts.length ? (_jsx("div", { className: "space-y-3", children: [
65
+ { label: "Work", list: work },
66
+ { label: "Personal", list: personal },
67
+ ].map((g) => g.list.length ? (_jsxs("div", { children: [_jsx("p", { className: "mb-1.5 text-11 font-medium text-[var(--text-muted)]", children: g.label }), _jsx("ul", { className: "space-y-1.5", children: g.list.map((a) => (_jsxs("li", { className: "flex items-center gap-2.5 rounded-lg bg-[var(--surface-secondary)] px-3 py-2", children: [_jsx("span", { "aria-hidden": "true", className: "flex size-5 shrink-0 items-center justify-center overflow-hidden rounded-sm bg-[var(--border-default)] [&_img]:size-5", children: a.icon }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate text-12 font-medium text-[var(--text-secondary)]", children: a.name }), a.detail ? _jsx("span", { className: "block truncate text-11 text-[var(--text-muted)]", children: a.detail }) : null] }), a.primary ? (_jsx(Tag, { color: "blue", size: "sm", className: "shrink-0", children: "Primary" })) : null] }, a.id))) })] }, g.label)) : null) })) : (_jsx("p", { className: "text-12 text-[var(--text-muted)]", children: "No connected accounts" }))] }));
68
+ }
69
+ export { AccountMenu };
@@ -0,0 +1,52 @@
1
+ import * as React from "react";
2
+ type AppShellItem = {
3
+ /** Unique: "activity". */
4
+ id: string;
5
+ /** The place's name: "Activity". Short: one word where possible. */
6
+ label: string;
7
+ href: string;
8
+ /** A Lucide icon. Shown in the bottom bar and the side menu; the top bar's tabs are words only. */
9
+ icon: React.ReactNode;
10
+ /** The page people are on. Set it from your router: the shell doesn't read the address. */
11
+ active?: boolean;
12
+ /** Something new there: `true` is a red dot; a number is a count in the side menu and a dot elsewhere. */
13
+ badge?: boolean | number;
14
+ /** Side menu only: a heading the item sits under ("Directory", "Inbox"). Items with the same group go together. */
15
+ group?: string;
16
+ };
17
+ type AppShellLinkProps = {
18
+ href: string;
19
+ className: string;
20
+ children: React.ReactNode;
21
+ "aria-current"?: "page";
22
+ onClick?: () => void;
23
+ };
24
+ type AppShellProps = {
25
+ /** The app's lockup: the Bridge icon and the app's name. Links home. */
26
+ logo: React.ReactNode;
27
+ /** Side menu only: the Bridge icon alone, shown at the top when the side menu is shrunk. */
28
+ logoMark?: React.ReactNode;
29
+ /** Where the logo goes. Default "/". */
30
+ homeHref?: string;
31
+ /** The app's main places. */
32
+ items: AppShellItem[];
33
+ /** `top`: tabs in the top bar (and a bottom bar on phones), for four places or fewer. `side`: a full-height side menu with the logo at its top, for five or more, or groups. */
34
+ nav?: "top" | "side";
35
+ /** Side menu only: Breadcrumbs, on the left of the top bar. Hidden on phones. */
36
+ breadcrumbs?: React.ReactNode;
37
+ /** A GlobalSearchTrigger. On the right of the top bar, before the launcher; on a phone it shrinks to an icon. */
38
+ search?: React.ReactNode;
39
+ /** Buttons before your account: the AppLauncher, a notifications button. */
40
+ actions?: React.ReactNode;
41
+ /** Your account: an AccountMenu, or a "Log in" button. Always last. */
42
+ account?: React.ReactNode;
43
+ /** Side menu only: a link at the bottom, such as "Back to Bridge OS" in an admin area. */
44
+ sideFooter?: React.ReactNode;
45
+ /** Draws each link with your router's: `(p) => <Link {...p} />` (Next), `({ href, ...p }) => <Link to={href} {...p} />` (React Router). Default a plain <a>. */
46
+ renderLink?: (props: AppShellLinkProps) => React.ReactElement;
47
+ /** The page. */
48
+ children: React.ReactNode;
49
+ };
50
+ declare function AppShell({ logo, logoMark, homeHref, items, nav, breadcrumbs, search, actions, account, sideFooter, renderLink, children, }: AppShellProps): React.JSX.Element;
51
+ export { AppShell };
52
+ export type { AppShellItem, AppShellLinkProps, AppShellProps };
@@ -0,0 +1,138 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
5
+ import { Menu, PanelLeftClose, PanelLeftOpen, X } from "lucide-react";
6
+ import { IconButton } from "@brdgapp/ui/components/icon-button";
7
+ import { SkipLink } from "@brdgapp/ui/components/skip-link";
8
+ import { Tip } from "@brdgapp/ui/components/info-hint";
9
+ import { cn } from "@brdgapp/ui/lib/utils";
10
+ const plainLink = (props) => _jsx("a", { ...props });
11
+ // GlobalSearchTrigger sized by the top bar (see `searchSized`). The `!` beats the trigger's own window-based sizes.
12
+ const SEARCH_SIZE = [
13
+ "w-9! justify-center! px-0! [&>span]:hidden! [&>kbd]:hidden!",
14
+ "@min-[760px]:w-[240px]! @min-[760px]:justify-start! @min-[760px]:px-3.5! @min-[760px]:[&>span]:block! @min-[760px]:[&>kbd]:inline-flex!",
15
+ "@min-[1200px]:w-[280px]!",
16
+ ].join(" ");
17
+ function Dot({ className }) {
18
+ return _jsx("span", { "aria-hidden": "true", className: cn("absolute size-2 rounded-full bg-[var(--error)] ring-2 ring-[var(--surface-primary)]", className) });
19
+ }
20
+ function badgeText(badge) {
21
+ if (!badge)
22
+ return "";
23
+ return typeof badge === "number" ? `, ${badge} new` : ", new";
24
+ }
25
+ // ── The side menu's remembered width ───────────────────────────────────────────────────────────
26
+ const KEY = "brdg-side-nav-collapsed";
27
+ const listeners = new Set();
28
+ function readCollapsed() {
29
+ try {
30
+ return window.localStorage.getItem(KEY) === "1";
31
+ }
32
+ catch {
33
+ return false;
34
+ }
35
+ }
36
+ function setCollapsed(next) {
37
+ try {
38
+ window.localStorage.setItem(KEY, next ? "1" : "0");
39
+ }
40
+ catch {
41
+ // Storage blocked: it still collapses until the page reloads.
42
+ }
43
+ memory = next;
44
+ listeners.forEach((l) => l());
45
+ }
46
+ let memory = null;
47
+ function subscribe(l) {
48
+ listeners.add(l);
49
+ return () => listeners.delete(l);
50
+ }
51
+ const getCollapsed = () => memory ?? (memory = readCollapsed());
52
+ function useCollapsed() {
53
+ return React.useSyncExternalStore(subscribe, getCollapsed, () => false);
54
+ }
55
+ // ── Pieces ─────────────────────────────────────────────────────────────────────────────────────
56
+ function TopTabs({ items, link }) {
57
+ return (_jsx("div", { className: "hidden shrink-0 items-center gap-6 self-stretch md:flex", children: items.map((item) => React.cloneElement(link({
58
+ href: item.href,
59
+ "aria-current": item.active ? "page" : undefined,
60
+ className: cn("relative flex h-full items-center text-14 leading-5 font-bold tracking-[0.4px] transition-colors outline-none", "focus-visible:ring-2 focus-visible:ring-[var(--primary)] focus-visible:ring-offset-2 rounded-sm", item.active ? "text-[var(--text-primary)]" : "text-[var(--text-muted)] hover:text-[var(--text-body)]"),
61
+ children: (_jsxs(_Fragment, { children: [_jsxs("span", { className: "relative", children: [item.label, item.badge ? _jsx(Dot, { className: "-top-1 -right-2.5" }) : null, item.badge ? _jsx("span", { className: "sr-only", children: badgeText(item.badge) }) : null] }), _jsx("span", { "aria-hidden": "true", className: cn("absolute inset-x-0 bottom-0 h-0.5 bg-[var(--text-primary)]", item.active ? "opacity-100" : "opacity-0") })] })),
62
+ }), { key: item.id })) }));
63
+ }
64
+ function BottomBar({ items, link }) {
65
+ if (process.env.NODE_ENV !== "production" && items.length > 4) {
66
+ console.warn(`AppShell: ${items.length} places. Four or fewer use tabs; five or more use nav="side".`);
67
+ }
68
+ return (_jsx("nav", { "aria-label": "Main", "data-slot": "app-shell-bottom-bar", className: "fixed inset-x-0 bottom-0 z-50 border-t border-[var(--glass-border)] bg-[var(--glass-bg)] pb-[env(safe-area-inset-bottom)] backdrop-blur-2xl backdrop-saturate-150 md:hidden", children: _jsx("div", { className: "flex h-14 items-stretch", children: items.map((item) => React.cloneElement(link({
69
+ href: item.href,
70
+ "aria-current": item.active ? "page" : undefined,
71
+ className: cn("flex flex-1 flex-col items-center justify-center gap-0.5 transition-colors outline-none focus-visible:bg-[var(--surface-secondary)]", item.active ? "text-[var(--primary)]" : "text-[var(--text-muted)]"),
72
+ children: (_jsxs(_Fragment, { children: [_jsxs("span", { "aria-hidden": "true", className: cn("relative [&>svg]:size-[22px]", item.active ? "[&>svg]:stroke-[2.4]" : ""), children: [item.icon, item.badge ? _jsx(Dot, { className: "-top-1 -right-1.5" }) : null] }), _jsxs("span", { className: "text-11 leading-none font-semibold tracking-[0.2px]", children: [item.label, item.badge ? _jsx("span", { className: "sr-only", children: badgeText(item.badge) }) : null] })] })),
73
+ }), { key: item.id })) }) }));
74
+ }
75
+ function groupsOf(items) {
76
+ const groups = [];
77
+ for (const item of items) {
78
+ const last = groups.at(-1);
79
+ if (last && last.label === item.group)
80
+ last.items.push(item);
81
+ else
82
+ groups.push({ label: item.group, items: [item] });
83
+ }
84
+ return groups;
85
+ }
86
+ function SideMenu({ items, link, collapsed, footer, onNavigate, }) {
87
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto overscroll-contain px-2 py-3", children: groupsOf(items).map((group, i) => (_jsxs("div", { role: "group", "aria-label": group.label, className: "flex flex-col gap-px", children: [group.label ? (collapsed ? (i > 0 ? _jsx("span", { "aria-hidden": "true", className: "mx-3 mb-2 h-px bg-[var(--border-divider)]" }) : null) : (_jsx("p", { "aria-hidden": "true", className: "truncate px-2.5 pb-1 text-12 font-medium text-[var(--text-muted)]", children: group.label }))) : null, group.items.map((item) => {
88
+ const row = link({
89
+ href: item.href,
90
+ onClick: onNavigate,
91
+ "aria-current": item.active ? "page" : undefined,
92
+ className: cn("group/item relative flex h-8 items-center gap-2.5 rounded-md px-2.5 text-13 font-medium transition-colors outline-none", "focus-visible:ring-2 focus-visible:ring-[var(--primary)]", collapsed ? "justify-center px-0" : "", item.active
93
+ ? "bg-[var(--surface-tertiary)] text-[var(--text-primary)]"
94
+ : "text-[var(--text-secondary)] hover:bg-[var(--surface-secondary)] hover:text-[var(--text-primary)]"),
95
+ children: (_jsxs(_Fragment, { children: [_jsxs("span", { "aria-hidden": "true", className: cn("relative flex shrink-0 [&>svg]:size-4", item.active ? "text-[var(--text-primary)]" : "text-[var(--text-muted)] group-hover/item:text-[var(--text-primary)]"), children: [item.icon, collapsed && item.badge ? _jsx(Dot, { className: "-top-1 -right-1" }) : null] }), _jsx("span", { className: cn("min-w-0 flex-1 truncate", collapsed ? "sr-only" : ""), children: item.label }), item.badge ? (collapsed ? (_jsx("span", { className: "sr-only", children: badgeText(item.badge) })) : typeof item.badge === "number" ? (_jsxs("span", { className: "text-12 text-[var(--text-muted)] tabular-nums", children: [item.badge, _jsx("span", { className: "sr-only", children: " new" })] })) : (_jsx("span", { className: "size-1.5 rounded-full bg-[var(--error)]", children: _jsx("span", { className: "sr-only", children: ", new" }) }))) : null] })),
96
+ });
97
+ return collapsed ? (_jsx(Tip, { text: item.label, children: row }, item.id)) : (React.cloneElement(row, { key: item.id }));
98
+ })] }, `${group.label ?? ""}-${i}`))) }), footer && !collapsed ? _jsx("div", { className: "shrink-0 px-2 pt-2 pb-3", children: footer }) : null] }));
99
+ }
100
+ // ── The shell ──────────────────────────────────────────────────────────────────────────────────
101
+ function AppShell({ logo, logoMark, homeHref = "/", items, nav = "top", breadcrumbs, search, actions, account, sideFooter, renderLink, children, }) {
102
+ const link = renderLink ?? plainLink;
103
+ const side = nav === "side";
104
+ const collapsed = useCollapsed();
105
+ const [menuOpen, setMenuOpen] = React.useState(false);
106
+ // ⌘B / Ctrl+B shrinks or widens the side menu, as in shadcn's Sidebar.
107
+ React.useEffect(() => {
108
+ if (!side)
109
+ return;
110
+ const onKey = (e) => {
111
+ if (e.key.toLowerCase() === "b" && (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey) {
112
+ e.preventDefault();
113
+ setCollapsed(!getCollapsed());
114
+ }
115
+ };
116
+ document.addEventListener("keydown", onKey);
117
+ return () => document.removeEventListener("keydown", onKey);
118
+ }, [side]);
119
+ const divider = _jsx("span", { "aria-hidden": "true", className: "hidden h-6 w-px shrink-0 bg-[var(--border-default)] md:block" });
120
+ const logoLink = (children, onClick) => link({
121
+ href: homeHref,
122
+ onClick,
123
+ className: "flex min-w-0 shrink-0 items-center rounded-sm transition-opacity outline-none hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--primary)] focus-visible:ring-offset-2",
124
+ children,
125
+ });
126
+ const toggle = (_jsx(Tip, { text: collapsed ? "Expand menu (⌘B)" : "Collapse menu (⌘B)", children: _jsx(IconButton, { size: "sm", "aria-label": collapsed ? "Expand menu" : "Collapse menu", "aria-keyshortcuts": "Meta+B Control+B", onClick: () => setCollapsed(!collapsed), children: collapsed ? _jsx(PanelLeftOpen, {}) : _jsx(PanelLeftClose, {}) }) }));
127
+ // The search's size follows the top bar's own width (a container query), not the window's, so the bar
128
+ // looks the same in every app and both layouts: an icon below 760px of bar, a 240px pill from 760px,
129
+ // 280px from 1200px. It always sits by the launcher.
130
+ const searchSized = React.isValidElement(search)
131
+ ? React.cloneElement(search, { className: cn(search.props.className, SEARCH_SIZE) })
132
+ : search;
133
+ // The right of the top bar, the same in every app: search, the launcher, your account.
134
+ const right = (_jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-3 pl-4 md:gap-4 md:pl-8", children: [search ? _jsx("div", { className: "flex shrink-0 items-center", children: searchSized }) : null, actions ? _jsx("div", { className: "flex shrink-0 items-center gap-2 md:gap-4", children: actions }) : null, account ? (_jsxs(_Fragment, { children: [actions || search ? _jsx("span", { "aria-hidden": "true", className: "h-6 w-px shrink-0 bg-[var(--border-default)]" }) : null, _jsx("div", { className: "flex shrink-0 items-center", children: account })] })) : null] }));
135
+ const topBar = (_jsx("header", { "data-slot": "app-shell-top-bar", className: "glass-chrome @container sticky top-0 z-50 h-14 shrink-0 border-b border-[var(--glass-border)] bg-[var(--glass-bg)] backdrop-blur-2xl backdrop-saturate-150", children: _jsxs("nav", { "aria-label": "Top bar", className: "flex h-full items-center gap-3 px-4 md:gap-5 md:px-6 lg:px-8", children: [side ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "-ml-1.5 md:hidden", children: _jsx(IconButton, { size: "sm", "aria-label": "Open menu", "aria-expanded": menuOpen, onClick: () => setMenuOpen(true), children: _jsx(Menu, {}) }) }), _jsx("span", { className: "flex min-w-0 overflow-hidden md:hidden", children: logoLink(logo) }), breadcrumbs ? _jsx("div", { className: "hidden min-w-0 shrink md:flex", children: breadcrumbs }) : null] })) : (_jsxs(_Fragment, { children: [logoLink(logo), items.length ? (_jsxs(_Fragment, { children: [divider, _jsx(TopTabs, { items: items, link: link })] })) : null] })), right] }) }));
136
+ return (_jsxs("div", { "data-slot": "app-shell", "data-nav": nav, className: cn("flex min-h-dvh", side ? "flex-row" : "flex-col"), children: [_jsx(SkipLink, {}), side ? (_jsxs("nav", { "aria-label": "Main", "data-slot": "app-shell-side-menu", "data-collapsed": collapsed || undefined, className: cn("sticky top-0 hidden h-dvh shrink-0 flex-col border-r border-[var(--border-divider)] bg-[var(--surface-primary)] transition-[width] duration-200 ease-out motion-reduce:transition-none md:flex", collapsed ? "w-14" : "w-56"), children: [collapsed ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex h-14 shrink-0 items-center justify-center border-b border-[var(--glass-border)]", children: logoMark ? logoLink(logoMark) : null }), _jsx("div", { className: "flex shrink-0 justify-center pt-3", children: toggle })] })) : (_jsxs("div", { className: "flex h-14 shrink-0 items-center gap-2 border-b border-[var(--glass-border)] pr-3 pl-4", children: [logoLink(logo), _jsx("span", { className: "ml-auto", children: toggle })] })), _jsx(SideMenu, { items: items, link: link, collapsed: collapsed, footer: sideFooter })] })) : null, _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [topBar, _jsx("main", { id: "main", tabIndex: -1, className: cn("min-w-0 flex-1 outline-none", side ? "" : "max-md:pb-[calc(56px+env(safe-area-inset-bottom))]"), children: children })] }), !side && items.length ? _jsx(BottomBar, { items: items, link: link }) : null, side ? (_jsx(DialogPrimitive.Root, { open: menuOpen, onOpenChange: setMenuOpen, children: _jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Backdrop, { className: "fixed inset-0 z-[60] bg-black/30 transition-opacity duration-300 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 md:hidden" }), _jsxs(DialogPrimitive.Popup, { "data-slot": "app-shell-menu-sheet", className: cn("fixed inset-y-0 left-0 z-[60] flex w-72 max-w-[85vw] flex-col bg-[var(--surface-elevated)] shadow-[var(--shadow-drawer)] outline-none md:hidden", "transition-[translate] duration-300 ease-out data-[ending-style]:-translate-x-full data-[starting-style]:-translate-x-full motion-reduce:transition-none"), children: [_jsxs("div", { className: "flex h-14 shrink-0 items-center justify-between gap-3 border-b border-[var(--border-divider)] px-4 pt-[env(safe-area-inset-top)]", children: [_jsx(DialogPrimitive.Title, { className: "sr-only", children: "Menu" }), link({ href: homeHref, onClick: () => setMenuOpen(false), className: "flex items-center rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]", children: logo }), _jsx(DialogPrimitive.Close, { render: _jsx(IconButton, { size: "sm", "aria-label": "Close menu", children: _jsx(X, {}) }) })] }), _jsx(SideMenu, { items: items, link: link, collapsed: false, footer: sideFooter, onNavigate: () => setMenuOpen(false) })] })] }) })) : null] }));
137
+ }
138
+ export { AppShell };
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ type BreadcrumbsItem = {
3
+ /** "Firms". */
4
+ label: string;
5
+ /** Leave it out on the last item: that's the page people are on. */
6
+ href?: string;
7
+ };
8
+ type BreadcrumbsLinkProps = {
9
+ href: string;
10
+ className: string;
11
+ children: React.ReactNode;
12
+ };
13
+ type BreadcrumbsProps = {
14
+ /** From the top down; the last is the page people are on. */
15
+ items: BreadcrumbsItem[];
16
+ /** Your router's link, as in AppShell: `(p) => <Link {...p} />`. Default a plain <a>. */
17
+ renderLink?: (props: BreadcrumbsLinkProps) => React.ReactElement;
18
+ className?: string;
19
+ };
20
+ declare function Breadcrumbs({ items, renderLink, className }: BreadcrumbsProps): React.JSX.Element;
21
+ export { Breadcrumbs };
22
+ export type { BreadcrumbsItem, BreadcrumbsLinkProps, BreadcrumbsProps };
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ChevronRight } from "lucide-react";
3
+ import { cn } from "@brdgapp/ui/lib/utils";
4
+ const plainLink = (props) => _jsx("a", { ...props });
5
+ function Breadcrumbs({ items, renderLink, className }) {
6
+ const link = renderLink ?? plainLink;
7
+ return (_jsx("nav", { "aria-label": "Breadcrumb", "data-slot": "breadcrumbs", className: cn("min-w-0", className), children: _jsx("ol", { className: "flex min-w-0 items-center gap-1.5 text-13", children: items.map((item, i) => {
8
+ const last = i === items.length - 1;
9
+ return (_jsxs("li", { className: cn("flex min-w-0 items-center gap-1.5", i < items.length - 2 ? "max-lg:hidden" : ""), children: [i > 0 ? _jsx(ChevronRight, { "aria-hidden": "true", className: "size-3.5 shrink-0 text-[var(--text-disabled)]" }) : null, last || !item.href ? (_jsx("span", { "aria-current": last ? "page" : undefined, className: cn("truncate", last ? "font-semibold text-[var(--text-primary)]" : "text-[var(--text-muted)]"), children: item.label })) : (link({
10
+ href: item.href,
11
+ className: "truncate rounded-sm text-[var(--text-muted)] transition-colors outline-none hover:text-[var(--text-primary)] focus-visible:ring-2 focus-visible:ring-[var(--primary)]",
12
+ children: item.label,
13
+ }))] }, `${item.label}-${i}`));
14
+ }) }) }));
15
+ }
16
+ export { Breadcrumbs };
@@ -90,7 +90,10 @@ function DataTable({ columns, rows, rowKey, onRowClick, onRowPrefetch, rowProps,
90
90
  * so it stays while the rows load, fail or filter down to nothing.
91
91
  */
92
92
  function DataTableToolbar({ search, filters, actions, ...rest }) {
93
- return (_jsxs("div", { ...rest, "data-slot": "data-table-toolbar", className: "flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-[var(--border-divider)] px-6 py-3", children: [search ? _jsx("div", { className: "w-full md:w-72 [&>*]:w-full", children: search }) : null, filters || actions ? (_jsxs("div", { className: "flex flex-wrap items-center gap-3 md:ml-auto", children: [filters ? _jsx("div", { className: "flex flex-wrap items-center gap-2", children: filters }) : null, actions ? _jsx("div", { className: "flex flex-wrap items-center gap-2", children: actions }) : null] })) : null] }));
93
+ return (_jsxs("div", { ...rest, "data-slot": "data-table-toolbar", className: "flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-[var(--border-divider)] px-6 py-3", children: [search ? _jsx("div", { className: "w-full md:w-72 [&>*]:w-full", children: search }) : null, filters || actions ? (
94
+ // Beside a search, filters and actions sit at the right. Without one, filters start at the left
95
+ // (a drawer's row of FilterChips) and actions stay at the right.
96
+ _jsxs("div", { className: cn("flex flex-1 flex-wrap items-center gap-3", search ? "md:justify-end" : ""), children: [filters ? _jsx("div", { className: "flex flex-wrap items-center gap-2", children: filters }) : null, actions ? _jsx("div", { className: cn("flex flex-wrap items-center gap-2", search ? "" : "ml-auto"), children: actions }) : null] })) : null] }));
94
97
  }
95
98
  /**
96
99
  * The loading body for a DataTable. Takes the same column list (without `render`), so its widths and
@@ -3,6 +3,7 @@ import type { DialogAction } from "@brdgapp/ui/components/dialog";
3
3
  declare const WIDTH: {
4
4
  readonly item: "md:max-w-xl";
5
5
  readonly list: "md:max-w-2xl";
6
+ readonly wide: "md:max-w-[min(1152px,calc(100vw-64px))]";
6
7
  };
7
8
  type DrawerProps = {
8
9
  open: boolean;
@@ -11,8 +12,11 @@ type DrawerProps = {
11
12
  title: React.ReactNode;
12
13
  /** One line under the title: who, when. */
13
14
  subtitle?: React.ReactNode;
14
- /** `item` 576px for one record; `list` 672px for a list. A phone fills the screen either way. */
15
+ /** `item` 576px for one record; `list` 672px for a list; `wide` 1152px for a table or a two-pane editor, with
16
+ * no padding round the body so it runs edge to edge. A phone fills the screen either way. */
15
17
  size?: keyof typeof WIDTH;
18
+ /** Pinned under the header, above the scrolling body: a DataTableToolbar with the search and filters. */
19
+ toolbar?: React.ReactNode;
16
20
  /** Actions beside the close button, such as an ActionMenu. Not Save: that goes in `primaryAction`. */
17
21
  actions?: React.ReactNode;
18
22
  /** For a drawer that edits: the footer's one filled button, bottom right. Spins while `busy`. */
@@ -26,6 +30,6 @@ type DrawerProps = {
26
30
  children: React.ReactNode;
27
31
  className?: string;
28
32
  };
29
- declare function Drawer({ open, onClose, title, subtitle, size, actions, primaryAction, cancelLabel, dangerAction, busy, children, className, }: DrawerProps): React.JSX.Element;
33
+ declare function Drawer({ open, onClose, title, subtitle, size, actions, toolbar, primaryAction, cancelLabel, dangerAction, busy, children, className, }: DrawerProps): React.JSX.Element;
30
34
  export { Drawer };
31
35
  export type { DrawerProps };
@@ -19,15 +19,22 @@ import { cn } from "@brdgapp/ui/lib/utils";
19
19
  // still slides in from the right, and it is not a dialog: Save stays in the footer. An edit drawer has a footer pinned at the bottom
20
20
  // (`primaryAction`, `cancelLabel`, `dangerAction`, the same options as Dialog); Save is never in the header,
21
21
  // next to ✕. The header and footer stay put and only the body scrolls. Reduced motion: it fades, no slide.
22
- const WIDTH = { item: "md:max-w-xl", list: "md:max-w-2xl" };
22
+ //
23
+ // Added 2026-11-16 (Aman: "if a variant can solve the problem do the variant"), for Bridge OS's 1152px
24
+ // "Your contacts" table and app-directories' 896px page builder, the only side panels wider than 672px in
25
+ // the 12 apps: a third width, `wide`, 1152px, whose body runs edge to edge for a table or a two-pane editor,
26
+ // and always leaves 64px of the page showing on the left. And `toolbar`, pinned under the header so search and
27
+ // filters stay put while the list scrolls (both Bridge OS list drawers have them). It takes a DataTableToolbar,
28
+ // the one row for search and filters everywhere, so the drawer adds no styling of its own.
29
+ const WIDTH = { item: "md:max-w-xl", list: "md:max-w-2xl", wide: "md:max-w-[min(1152px,calc(100vw-64px))]" };
23
30
  const FIRST_FIELD = "input:not([disabled]):not([type=hidden]), textarea:not([disabled]), select:not([disabled]), [contenteditable=true]";
24
- function Drawer({ open, onClose, title, subtitle, size = "item", actions, primaryAction, cancelLabel = "Cancel", dangerAction, busy = false, children, className, }) {
31
+ function Drawer({ open, onClose, title, subtitle, size = "item", actions, toolbar, primaryAction, cancelLabel = "Cancel", dangerAction, busy = false, children, className, }) {
25
32
  const body = React.useRef(null);
26
33
  return (_jsx(DialogPrimitive.Root, { open: open, onOpenChange: (next) => !next && !busy && onClose(), children: _jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Backdrop, { className: "fixed inset-x-0 top-0 bottom-0 z-[60] md:top-14 bg-black/30 transition-opacity duration-300 ease-out data-[ending-style]:duration-200 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0" }), _jsxs(DialogPrimitive.Popup, { "data-slot": "drawer", "data-size": size,
27
34
  // An edit drawer starts in its first field; a details drawer starts on its first control.
28
35
  initialFocus: (openType) => (openType === "touch" ? true : (body.current?.querySelector(FIRST_FIELD) ?? true)), className: cn(
29
36
  // Phone: the whole screen. Computer: below the top bar, from the right edge.
30
- "fixed inset-0 z-[60] flex w-full flex-col bg-[var(--surface-elevated)] outline-none md:top-14 md:left-auto md:border-l md:border-[var(--border-default)] md:shadow-[var(--shadow-drawer)]", "transition-[translate,opacity] duration-300 ease-out data-[ending-style]:duration-200 data-[starting-style]:translate-x-full data-[ending-style]:translate-x-full", "motion-reduce:transition-opacity motion-reduce:data-[starting-style]:translate-x-0 motion-reduce:data-[ending-style]:translate-x-0 motion-reduce:data-[starting-style]:opacity-0 motion-reduce:data-[ending-style]:opacity-0", WIDTH[size], className), children: [_jsxs("header", { "data-slot": "drawer-header", className: "flex shrink-0 items-start gap-2 border-b border-[var(--border-divider)] px-6 py-4 max-md:px-5 max-md:pt-[max(16px,env(safe-area-inset-top))]", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(DialogPrimitive.Title, { className: "truncate text-18 font-bold tracking-tight text-[var(--text-primary)]", children: title }), subtitle ? (_jsx(DialogPrimitive.Description, { className: "mt-0.5 truncate text-12 leading-normal text-[var(--text-muted)]", children: subtitle })) : null] }), actions, _jsx(DialogPrimitive.Close, { disabled: busy, render: _jsx(IconButton, { "aria-label": "Close", size: "sm", children: _jsx(X, {}) }) })] }), _jsx("div", { ref: body, "data-slot": "drawer-body", className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-5 max-md:px-5", children: children }), primaryAction || dangerAction ? (_jsxs("footer", { "data-slot": "drawer-footer", className: "flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-[var(--border-divider)] px-6 py-4 pb-[max(16px,env(safe-area-inset-bottom))] max-md:px-5", children: [dangerAction ? (_jsx(Button, { variant: "danger-ghost", size: "md", icon: dangerAction.icon, disabled: busy || dangerAction.disabled, onClick: dangerAction.onClick,
37
+ "fixed inset-0 z-[60] flex w-full flex-col bg-[var(--surface-elevated)] outline-none md:top-14 md:left-auto md:border-l md:border-[var(--border-default)] md:shadow-[var(--shadow-drawer)]", "transition-[translate,opacity] duration-300 ease-out data-[ending-style]:duration-200 data-[starting-style]:translate-x-full data-[ending-style]:translate-x-full", "motion-reduce:transition-opacity motion-reduce:data-[starting-style]:translate-x-0 motion-reduce:data-[ending-style]:translate-x-0 motion-reduce:data-[starting-style]:opacity-0 motion-reduce:data-[ending-style]:opacity-0", WIDTH[size], className), children: [_jsxs("header", { "data-slot": "drawer-header", className: "flex shrink-0 items-start gap-2 border-b border-[var(--border-divider)] px-6 py-4 max-md:px-5 max-md:pt-[max(16px,env(safe-area-inset-top))]", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(DialogPrimitive.Title, { className: "truncate text-18 font-bold tracking-tight text-[var(--text-primary)]", children: title }), subtitle ? (_jsx(DialogPrimitive.Description, { className: "mt-0.5 truncate text-12 leading-normal text-[var(--text-muted)]", children: subtitle })) : null] }), actions, _jsx(DialogPrimitive.Close, { disabled: busy, render: _jsx(IconButton, { "aria-label": "Close", size: "sm", children: _jsx(X, {}) }) })] }), toolbar ? (_jsx("div", { "data-slot": "drawer-toolbar", className: "shrink-0", children: toolbar })) : null, _jsx("div", { ref: body, "data-slot": "drawer-body", className: cn("min-h-0 flex-1 overflow-y-auto overscroll-contain", size === "wide" ? "" : "px-6 py-5 max-md:px-5"), children: children }), primaryAction || dangerAction ? (_jsxs("footer", { "data-slot": "drawer-footer", className: "flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-[var(--border-divider)] px-6 py-4 pb-[max(16px,env(safe-area-inset-bottom))] max-md:px-5", children: [dangerAction ? (_jsx(Button, { variant: "danger-ghost", size: "md", icon: dangerAction.icon, disabled: busy || dangerAction.disabled, onClick: dangerAction.onClick,
31
38
  // Phone: its own row above Cancel and the main button, so the three never squeeze into one.
32
39
  className: "mr-auto max-md:mr-0 max-md:w-full", children: dangerAction.label })) : null, primaryAction ? (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "secondary", size: "md", disabled: busy, onClick: onClose, className: "max-md:flex-1", children: cancelLabel }), _jsx(Button, { size: "md", loading: busy, disabled: primaryAction.disabled, icon: primaryAction.icon, onClick: primaryAction.onClick, className: "max-md:flex-1", children: primaryAction.label })] })) : null] })) : null] })] }) }));
33
40
  }
@@ -2,7 +2,7 @@ import type * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  import { type ElementProps } from "@brdgapp/ui/lib/utils";
4
4
  declare const tagVariants: (props?: ({
5
- color?: "blue" | "green" | "purple" | "grey" | "red" | "yellow" | null | undefined;
5
+ color?: "grey" | "blue" | "green" | "yellow" | "red" | "purple" | null | undefined;
6
6
  size?: "sm" | "md" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  type TagProps = VariantProps<typeof tagVariants> & ElementProps & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brdgapp/ui",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Bridge's shared components, tokens and styles. Documented at handbook.brdg.app.",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://handbook.brdg.app",