@brdgapp/ui 1.0.0 → 1.1.1

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +14 -3
  3. package/components/action-menu.d.ts +9 -2
  4. package/components/action-menu.js +14 -5
  5. package/components/avatar.d.ts +1 -1
  6. package/components/avatar.js +7 -5
  7. package/components/badge.js +2 -1
  8. package/components/bottom-sheet.d.ts +21 -4
  9. package/components/bottom-sheet.js +90 -6
  10. package/components/button-group.d.ts +2 -2
  11. package/components/button-group.js +1 -1
  12. package/components/button.d.ts +2 -2
  13. package/components/button.js +8 -6
  14. package/components/card.d.ts +2 -2
  15. package/components/card.js +1 -1
  16. package/components/checkbox.js +2 -2
  17. package/components/collapsible.js +4 -3
  18. package/components/column-filter-menu.d.ts +2 -1
  19. package/components/column-filter-menu.js +3 -2
  20. package/components/column-sort-button.d.ts +8 -2
  21. package/components/column-sort-button.js +12 -2
  22. package/components/confirm-dialog.d.ts +11 -3
  23. package/components/confirm-dialog.js +41 -6
  24. package/components/copy-field.js +4 -2
  25. package/components/data-state.js +2 -2
  26. package/components/data-table.d.ts +54 -5
  27. package/components/data-table.js +79 -30
  28. package/components/dialog.d.ts +29 -5
  29. package/components/dialog.js +27 -3
  30. package/components/drawer.d.ts +16 -6
  31. package/components/drawer.js +26 -9
  32. package/components/expandable-bio.js +2 -1
  33. package/components/field.js +3 -3
  34. package/components/filter-chip.js +4 -1
  35. package/components/filter-pill.js +6 -6
  36. package/components/hover-card.js +4 -2
  37. package/components/icon-button.d.ts +2 -2
  38. package/components/icon-button.js +6 -1
  39. package/components/info-hint.d.ts +8 -1
  40. package/components/info-hint.js +22 -7
  41. package/components/input.js +1 -1
  42. package/components/network-graph.js +1 -1
  43. package/components/page-banner.js +11 -5
  44. package/components/scene.d.ts +3 -1
  45. package/components/scene.js +2 -2
  46. package/components/search-input.d.ts +2 -2
  47. package/components/search-input.js +24 -3
  48. package/components/segmented-control.js +5 -1
  49. package/components/skeleton.js +3 -1
  50. package/components/skip-link.js +3 -1
  51. package/components/stat-box.d.ts +23 -5
  52. package/components/stat-box.js +33 -16
  53. package/components/switch.js +5 -1
  54. package/components/tabs.js +10 -2
  55. package/components/tag-input.d.ts +3 -1
  56. package/components/tag-input.js +27 -8
  57. package/components/tag.js +4 -2
  58. package/components/textarea.js +2 -2
  59. package/components/toast.d.ts +12 -5
  60. package/components/toast.js +15 -5
  61. package/lib/font-check.d.ts +3 -0
  62. package/lib/font-check.js +31 -0
  63. package/package.json +1 -1
  64. package/styles/globals.css +26 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,71 @@
2
2
 
3
3
  Every release of `@brdgapp/ui`. Versions follow the rules in README.md → Versions.
4
4
 
5
+ ## 1.1.1
6
+
7
+ 2026-11-06. A fix that changes nothing an app relies on.
8
+
9
+ - `<Toaster />` warns in the browser console, once and only in development, when the app hasn't loaded Mulish
10
+ (`lib/font-check`). The README makes loading Mulish a required setup step.
11
+
12
+ ## 1.1.0
13
+
14
+ 2026-11-06. Changes from reviewing every component's handbook page. Nothing is renamed or removed, so apps on
15
+ 1.0.0 can update without changes; Dialog's `footer` is deprecated (use `primaryAction`, `cancelLabel` and
16
+ `dangerAction`), and BottomSheet options belong in the new `BottomSheetOptions`.
17
+
18
+ - New tokens: `--border-field` (one grey for text field edges), `--honey-text` (legible ALUM
19
+ sticker) and `--skeleton` (one grey for every loading placeholder; lighter in dark mode so it shows on cards).
20
+ - Skeleton, ButtonSkeleton, StatBoxSkeleton and DataTableSkeleton all use `--skeleton`.
21
+ - Reduced motion: animations play once and stop, so pulsing placeholders hold still instead of flickering.
22
+ - Focus: the fallback outline moved into the base layer, so it no longer doubles up with a component's own ring.
23
+ - Tabs: visible hover, a focus ring the scrolling row no longer clips, and disabled tabs that work.
24
+ - SegmentedControl, FilterChip and Switch: hover now shows; Switch's off track is a visible mid grey.
25
+ - Input, Textarea, TagInput and SearchInput: clearer field edges (`--border-field`, a soft grey that darkens on hover); SearchInput gains a hover.
26
+ - Card: the open (`selected`) card deepens a little on hover.
27
+ - HoverCard: the trigger's focus ring has a small gap so it clears the name.
28
+ - Collapsible: room around the focus ring; the inline arrow darkens on hover; counts shortened (12.3K).
29
+ - FilterChip counts shortened the same way (`formatCount`).
30
+ - Avatar: the ring between stacked faces and around a badge takes the card's colour on a card.
31
+ - Field: a disabled field dims its label along with the control.
32
+ - SearchInput: a disabled look; Esc clears it in every browser; Clear puts focus back in the field.
33
+ - CopyField: the inline version's focus ring has a small gap so it clears the text.
34
+ - ExpandableBio: keeps the bio's own line breaks.
35
+ - PageBanner: the page strip no longer stretches to the screen edges from inside the page column (it gave Windows
36
+ a sideways scrollbar and ran under sidebars). Put it in the layout under the top bar; it pins at
37
+ `--page-banner-top` (56px). The icon and action stay level with the first line when the text wraps.
38
+ - InfoHint: the ⓘ is the muted grey (4.8:1; it was 2:1) with a 24px click area. HoverTip and Tip wait 300ms
39
+ before opening; new `TipProvider` (mount once) opens the next tip at once. Focus rings have a small gap.
40
+ - ActionMenu: the ⋮ shows its name in a Tip; `align="start"` for a trigger on the left; `ActionMenuGroup` puts a
41
+ heading over rows. A red row with a second line keeps its title red.
42
+ - ConfirmDialog: spins by itself while `onConfirm`'s promise runs and stays open if it throws; `cancelLabel`
43
+ ("Keep editing"); `requireText` makes people type a name before a permanent delete.
44
+ - Toast: an optional second line (`toast.success(message, { description })`); errors stay 6 seconds. The message
45
+ is a paragraph, not a heading.
46
+ - FilterPill: on and off look like FilterChip, so an active filter shows; the on pill reacts to hover.
47
+ - ColumnSortButton and ColumnFilterMenu: `icon` is optional. DataTable columns take `sort`, which tells screen readers which column is
48
+ sorted (`aria-sort`).
49
+ - TagInput: `disabled`; a red edge inside an invalid Field, like Input; pasting a list adds one chip per entry.
50
+ - DataTable: every header row is 48px (was 42 or 46px, so loading jumped); `maxHeight` scrolls a long list in its
51
+ own area with the header pinned; `pinFirstColumn` keeps the first column in place while the others scroll
52
+ sideways; `addRow` (the first column's header and a last row) and `addColumn` (a last column) for adding one more, as on Raise's intros grid; in a header it's a 24px outline IconButton with a +. Choosing from a row's ⋮ menu no longer opens the row. ColumnSortButton and ColumnFilterMenu are 24px tall.
53
+ - New `DataTableToolbar`: the row above a table, with search on the left and filters and buttons on the right.
54
+ Tables have no title bar of their own; the page's heading names them.
55
+ - Dialog: `size="wide"` (672px) next to the default 512px. `primaryAction`, `cancelLabel` and `dangerAction` replace
56
+ a hand-made `footer` (deprecated, removed in 2.0). On a phone it fills the screen, with the buttons in a footer
57
+ pinned at the bottom, as in Drawer. Opening puts focus in the first field.
58
+ - Drawer: an edit drawer takes `primaryAction`, `cancelLabel`, `dangerAction` and `busy`, in a footer that stays put while
59
+ the body scrolls. On a phone it fills the screen with the same header and footer. Reduced motion fades it.
60
+ - BottomSheet: a swipe down on the handle or title closes it. `BottomSheetOptions` holds the rows: one choice is a
61
+ list (↑ ↓ and Enter), `multiple` makes each row a Checkbox, and `primaryAction` adds an Apply footer. Rows show
62
+ hover; the tick is Lucide's Check.
63
+ - StatBox: `change` (↑ 12% vs last month, green or red, `downIsGood` for less-is-better numbers) and `icon`. A linking
64
+ box keeps its ⓘ. Every line sets its own height (70px a box); StatBoxSkeleton takes `sub` and `change` to match,
65
+ so a row no longer jumps 6px when the numbers load. The link's focus ring has a 2px gap.
66
+ - ConfirmDialog: on a phone it slides up from the bottom with stacked, full-width buttons (Cancel last).
67
+ - IconButton: `variant="outline"` (a grey edge on a solid fill, like Button `secondary`) and `size="xs"` (24px).
68
+ - Text uses the named sizes (`text-12`, `text-14`…) at the same heights as before.
69
+
5
70
  ## 1.0.0
6
71
 
7
72
  The first release of Bridge's design system as a package. A new major version: the 0.1.x releases
package/README.md CHANGED
@@ -7,7 +7,7 @@ Bridge's shared components, tokens and styles. How and when to use each part is
7
7
 
8
8
  - React 19
9
9
  - Tailwind CSS 4 (apps still on Tailwind 3 upgrade first)
10
- - The Mulish font, loaded by the app
10
+ - The Mulish font, loaded by the app. Every Bridge app uses Mulish, and only Mulish (rule "One typeface").
11
11
 
12
12
  ## Set up
13
13
 
@@ -25,13 +25,24 @@ In the app's main CSS file, after Tailwind:
25
25
  That brings every token (light and dark), the base styles, and tells Tailwind to read the package's
26
26
  files, so its classes are included.
27
27
 
28
- Load Mulish however the app loads fonts. With `next/font`, name the variable `--font-mulish`:
28
+ **Then load Mulish. This step is required.** The base styles ask for Mulish, but the app has to load the
29
+ font; without it, text falls back to the device's font. If the app uses another font (VAG Rounded, Inter,
30
+ Geist) or none, switch it to Mulish and remove the old one.
31
+
32
+ In Next.js, with `next/font`, name the variable `--font-mulish` and put it on `<html>`:
29
33
 
30
34
  ```ts
35
+ import { Mulish } from "next/font/google";
31
36
  const mulish = Mulish({ subsets: ["latin"], variable: "--font-mulish" });
37
+ // <html lang="en" className={mulish.variable}>
32
38
  ```
33
39
 
34
- Anything else (a Google Fonts link, a self-hosted file) works too, as long as the family is "Mulish".
40
+ In Vite or anything else: `npm install @fontsource/mulish`, then import `@fontsource/mulish/400.css`, `500.css`,
41
+ `600.css` and `700.css` once in the entry file. A Google Fonts link or a self-hosted file also works, as long
42
+ as the family is "Mulish".
43
+
44
+ If Mulish doesn't load, `<Toaster />` says so in the browser console while you develop, and the handbook's
45
+ `check_code` flags a root layout that doesn't load it.
35
46
 
36
47
  Themes follow `data-theme="light"` or `data-theme="dark"` on `<html>`, not the device setting.
37
48
 
@@ -18,6 +18,8 @@ type ActionMenuProps = {
18
18
  size?: "sm" | "md";
19
19
  /** Menu width in px. 248 is the contact-menu width. */
20
20
  width?: number;
21
+ /** Which edge of the trigger the menu lines up with. `end` for a ⋮ on the right; `start` for a trigger on the left. */
22
+ align?: "start" | "end";
21
23
  /** Trigger icon. Defaults to vertical dots. */
22
24
  icon?: React.ReactNode;
23
25
  triggerClassName?: string;
@@ -35,7 +37,7 @@ type ActionMenuProps = {
35
37
  }) => React.ReactElement;
36
38
  children: React.ReactNode | ((close: (restoreFocus?: boolean) => void) => React.ReactNode);
37
39
  };
38
- declare function ActionMenu({ ariaLabel, size, width, icon, triggerClassName, menuClassName, stopPropagation, onOpenChange, renderTrigger, children, }: ActionMenuProps): React.JSX.Element;
40
+ declare function ActionMenu({ ariaLabel, size, width, align, icon, triggerClassName, menuClassName, stopPropagation, onOpenChange, renderTrigger, children, }: ActionMenuProps): React.JSX.Element;
39
41
  type ActionMenuItemProps = {
40
42
  icon?: React.ReactNode;
41
43
  children: React.ReactNode;
@@ -61,5 +63,10 @@ type ActionMenuItemProps = {
61
63
  declare function ActionMenuItem({ icon, children, description, onClick, href, external, danger, disabled, closeOnClick, render, className, }: ActionMenuItemProps): React.JSX.Element;
62
64
  /** A thin line between groups of rows. */
63
65
  declare function ActionMenuSeparator(): React.JSX.Element;
64
- export { ActionMenu, ActionMenuItem, ActionMenuSeparator, useActionMenu, ACTION_MENU_ITEM_CLASS };
66
+ /** Rows under a small heading ("Sort by", "Signed in as …"). The heading is announced with the group. */
67
+ declare function ActionMenuGroup({ label, children }: {
68
+ label: React.ReactNode;
69
+ children: React.ReactNode;
70
+ }): React.JSX.Element;
71
+ export { ActionMenu, ActionMenuGroup, ActionMenuItem, ActionMenuSeparator, useActionMenu, ACTION_MENU_ITEM_CLASS };
65
72
  export type { ActionMenuProps, ActionMenuItemProps };
@@ -4,13 +4,16 @@ import { createContext, useCallback, useContext, useMemo, useState } from "react
4
4
  import { Menu } from "@base-ui/react/menu";
5
5
  import { MoreVertical } from "lucide-react";
6
6
  import { IconButton } from "@brdgapp/ui/components/icon-button";
7
+ import { Tip } from "@brdgapp/ui/components/info-hint";
7
8
  import { cn } from "@brdgapp/ui/lib/utils";
8
9
  // THE overflow (⋮) menu. Ported from Bridge OS src/components/ui/action-menu.tsx with the same API.
9
10
  // Bridge OS hand-built the portal, positioning, outside-click and Escape handling; Base UI Menu now
10
11
  // does that, plus arrow-key movement, type-to-find and focus return. It also follows the trigger on
11
12
  // scroll instead of closing. The danger colour is now a token (Bridge OS hard-coded #E13535).
13
+ // Added from the app survey (2026-11-05): a Tip on the ⋮ with its name, `align="start"` (9 of the apps'
14
+ // 49 menus open from the left), and ActionMenuGroup for a heading over rows (DropdownMenuLabel, 16 uses).
12
15
  // The one menu-row look. Exported so custom stateful rows can match it.
13
- const ACTION_MENU_ITEM_CLASS = "flex w-full cursor-default items-center gap-3 px-3.5 py-2.5 max-md:min-h-11 text-left text-[13px] text-[var(--text-body)] outline-none transition-colors " +
16
+ const ACTION_MENU_ITEM_CLASS = "flex w-full cursor-default items-center gap-3 px-3.5 py-2.5 max-md:min-h-11 text-left text-13 leading-normal text-[var(--text-body)] outline-none transition-colors " +
14
17
  "data-[highlighted]:bg-[var(--surface-secondary)] hover:bg-[var(--surface-secondary)] data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0";
15
18
  const ACTION_MENU_ITEM_DANGER_CLASS = "text-[var(--danger-text)] data-[highlighted]:bg-[var(--error-bg)] hover:bg-[var(--error-bg)]";
16
19
  const ActionMenuContext = createContext(null);
@@ -21,7 +24,7 @@ function useActionMenu() {
21
24
  throw new Error("useActionMenu must be used inside <ActionMenu>");
22
25
  return ctx;
23
26
  }
24
- function ActionMenu({ ariaLabel = "More options", size = "md", width = 248, icon, triggerClassName, menuClassName, stopPropagation = true, onOpenChange, renderTrigger, children, }) {
27
+ function ActionMenu({ ariaLabel = "More options", size = "md", width = 248, align = "end", icon, triggerClassName, menuClassName, stopPropagation = true, onOpenChange, renderTrigger, children, }) {
25
28
  const [open, setOpen] = useState(false);
26
29
  const setOpenAndNotify = useCallback((next) => {
27
30
  setOpen(next);
@@ -31,11 +34,13 @@ function ActionMenu({ ariaLabel = "More options", size = "md", width = 248, icon
31
34
  const close = useCallback(() => setOpenAndNotify(false), [setOpenAndNotify]);
32
35
  const ctx = useMemo(() => ({ close }), [close]);
33
36
  const stop = stopPropagation ? (e) => e.stopPropagation() : undefined;
34
- return (_jsxs(Menu.Root, { open: open, onOpenChange: setOpenAndNotify, children: [renderTrigger ? (_jsx(Menu.Trigger, { render: (props) => renderTrigger(props, { open }) })) : (_jsx(Menu.Trigger, { render: _jsx(IconButton, { "aria-label": ariaLabel, size: size, className: cn("shrink-0", triggerClassName), children: icon ?? _jsx(MoreVertical, {}) }), onClick: stop, onPointerDown: stop })), _jsx(Menu.Portal, { children: _jsx(Menu.Positioner, { side: "bottom", align: "end", sideOffset: 6, collisionPadding: 8, className: "z-[80]", children: _jsx(Menu.Popup, { "data-slot": "action-menu", style: { width }, className: cn("max-w-[calc(100vw-16px)] rounded-xl border border-[var(--border-default)] bg-[var(--surface-elevated)] py-1 shadow-[var(--shadow-menu)] outline-none", "origin-[var(--transform-origin)] transition-[opacity,scale] duration-200 ease-out data-[ending-style]:duration-150 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0", menuClassName), children: _jsx(ActionMenuContext.Provider, { value: ctx, children: typeof children === "function" ? children(close) : children }) }) }) })] }));
37
+ return (_jsxs(Menu.Root, { open: open, onOpenChange: setOpenAndNotify, children: [renderTrigger ? (_jsx(Menu.Trigger, { render: (props) => renderTrigger(props, { open }) })) : (
38
+ // The same words as the trigger's name, in a Tip, so people who see it and people who hear it get one name.
39
+ _jsx(Tip, { text: ariaLabel, disabled: open, children: _jsx(Menu.Trigger, { render: _jsx(IconButton, { "aria-label": ariaLabel, size: size, className: cn("shrink-0", triggerClassName), children: icon ?? _jsx(MoreVertical, {}) }), onClick: stop, onPointerDown: stop }) })), _jsx(Menu.Portal, { children: _jsx(Menu.Positioner, { side: "bottom", align: align, sideOffset: 6, collisionPadding: 8, className: "z-[80]", children: _jsx(Menu.Popup, { "data-slot": "action-menu", style: { width }, className: cn("max-w-[calc(100vw-16px)] rounded-xl border border-[var(--border-default)] bg-[var(--surface-elevated)] py-1 shadow-[var(--shadow-menu)] outline-none", "origin-[var(--transform-origin)] transition-[opacity,scale] duration-200 ease-out data-[ending-style]:duration-150 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0", menuClassName), children: _jsx(ActionMenuContext.Provider, { value: ctx, children: typeof children === "function" ? children(close) : children }) }) }) })] }));
35
40
  }
36
41
  function ActionMenuItem({ icon, children, description, onClick, href, external = false, danger = false, disabled = false, closeOnClick = true, render, className, }) {
37
42
  const classes = cn(ACTION_MENU_ITEM_CLASS, danger && ACTION_MENU_ITEM_DANGER_CLASS, description && "items-start", className);
38
- const body = description ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", className: "mt-0.5 inline-flex shrink-0", children: icon }), _jsxs("span", { className: "min-w-0", children: [_jsx("span", { className: "block text-[13px] font-semibold text-[var(--text-primary)]", children: children }), _jsx("span", { className: "block text-[12px] text-[var(--text-muted)]", children: description })] })] })) : (_jsxs(_Fragment, { children: [icon ? (_jsx("span", { "aria-hidden": "true", className: "inline-flex shrink-0", children: icon })) : null, children] }));
43
+ const body = description ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", className: "mt-0.5 inline-flex shrink-0", children: icon }), _jsxs("span", { className: "min-w-0", children: [_jsx("span", { className: cn("block text-13 leading-normal font-semibold", !danger && "text-[var(--text-primary)]"), children: children }), _jsx("span", { className: "block text-12 leading-normal text-[var(--text-muted)]", children: description })] })] })) : (_jsxs(_Fragment, { children: [icon ? (_jsx("span", { "aria-hidden": "true", className: "inline-flex shrink-0", children: icon })) : null, children] }));
39
44
  if (href && !disabled) {
40
45
  return (_jsx(Menu.LinkItem, { "data-slot": "action-menu-item", href: href, closeOnClick: closeOnClick, onClick: onClick, className: classes, render: render, ...(external ? { target: "_blank", rel: "noopener noreferrer" } : {}), children: body }));
41
46
  }
@@ -45,4 +50,8 @@ function ActionMenuItem({ icon, children, description, onClick, href, external =
45
50
  function ActionMenuSeparator() {
46
51
  return _jsx(Menu.Separator, { "data-slot": "action-menu-separator", className: "my-1 h-px bg-[var(--border-divider)]" });
47
52
  }
48
- export { ActionMenu, ActionMenuItem, ActionMenuSeparator, useActionMenu, ACTION_MENU_ITEM_CLASS };
53
+ /** Rows under a small heading ("Sort by", "Signed in as …"). The heading is announced with the group. */
54
+ function ActionMenuGroup({ label, children }) {
55
+ return (_jsxs(Menu.Group, { "data-slot": "action-menu-group", children: [_jsx(Menu.GroupLabel, { className: "px-3.5 pt-2 pb-1 text-12 leading-normal font-semibold text-[var(--text-muted)]", children: label }), children] }));
56
+ }
57
+ export { ActionMenu, ActionMenuGroup, ActionMenuItem, ActionMenuSeparator, useActionMenu, ACTION_MENU_ITEM_CLASS };
@@ -1,7 +1,7 @@
1
1
  import type { CSSProperties } from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const avatarVariants: (props?: ({
4
- size?: "sm" | "md" | "lg" | "xs" | "xl" | "2xl" | null | undefined;
4
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  type AvatarSize = NonNullable<VariantProps<typeof avatarVariants>["size"]>;
7
7
  type AvatarBadge = "member" | "super-connector" | "warning";
@@ -22,9 +22,9 @@ const avatarVariants = cva("relative inline-flex shrink-0 rounded-full bg-[var(-
22
22
  size: {
23
23
  xs: "size-4 text-[8px]",
24
24
  sm: "size-6 text-[10px]",
25
- md: "size-8 text-[12px]",
26
- lg: "size-10 text-[14px]",
27
- xl: "size-12 text-[16px]",
25
+ md: "size-8 text-12",
26
+ lg: "size-10 text-14",
27
+ xl: "size-12 text-16",
28
28
  "2xl": "size-16 text-[20px]",
29
29
  },
30
30
  },
@@ -45,6 +45,8 @@ const BADGE_SIZE = {
45
45
  "2xl": "size-5 ring-2",
46
46
  };
47
47
  /** "Priya Natarajan" → "PN", "Priya" → "P", "" → "?". First and last word, so middle names don't crowd it. */
48
+ // Rings (between stacked faces, round a badge) take the color of what the avatar sits on: the page by
49
+ // default, a card's surface inside a Card (globals.css sets --avatar-ring there), so no dark or white halo shows.
48
50
  function initialsOf(name) {
49
51
  const words = (name ?? "").trim().split(/\s+/).filter(Boolean);
50
52
  const first = words[0]?.[0] ?? "";
@@ -69,7 +71,7 @@ const BADGE_FILL = {
69
71
  function Avatar({ name, src, size = "md", badge, standalone = false, className, style }) {
70
72
  const badgeSize = badge ? BADGE_SIZE[size] : null;
71
73
  const label = badge ? BADGE_LABEL[badge] : null;
72
- return (_jsxs(AvatarPrimitive.Root, { "data-slot": "avatar", "data-size": size, className: cn(avatarVariants({ size }), className), style: style, ...(standalone ? { role: "img", "aria-label": [name || "Unknown person", label].filter(Boolean).join(", ") } : {}), children: [_jsxs("span", { className: "block size-full overflow-hidden rounded-full", "aria-hidden": "true", children: [src ? _jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", src: src, alt: "", className: "size-full object-cover" }) : null, _jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: "flex size-full items-center justify-center leading-none font-bold text-[var(--info)]", children: initialsOf(name) })] }), badge && badgeSize ? (_jsx("span", { "data-slot": "avatar-badge", "data-badge": badge, "aria-hidden": "true", className: cn("absolute -right-0.5 -bottom-0.5 flex items-center justify-center rounded-full text-white ring-[var(--surface-primary)]", BADGE_FILL[badge], badgeSize), children: _jsx(BadgeMark, { badge: badge }) })) : null, badge && !standalone ? _jsx("span", { className: "sr-only", children: label }) : null] }));
74
+ return (_jsxs(AvatarPrimitive.Root, { "data-slot": "avatar", "data-size": size, className: cn(avatarVariants({ size }), className), style: style, ...(standalone ? { role: "img", "aria-label": [name || "Unknown person", label].filter(Boolean).join(", ") } : {}), children: [_jsxs("span", { className: "block size-full overflow-hidden rounded-full", "aria-hidden": "true", children: [src ? _jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", src: src, alt: "", className: "size-full object-cover" }) : null, _jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: "flex size-full items-center justify-center leading-none font-bold text-[var(--info)]", children: initialsOf(name) })] }), badge && badgeSize ? (_jsx("span", { "data-slot": "avatar-badge", "data-badge": badge, "aria-hidden": "true", className: cn("absolute -right-0.5 -bottom-0.5 flex items-center justify-center rounded-full text-white ring-[var(--avatar-ring,var(--surface-primary))]", BADGE_FILL[badge], badgeSize), children: _jsx(BadgeMark, { badge: badge }) })) : null, badge && !standalone ? _jsx("span", { className: "sr-only", children: label }) : null] }));
73
75
  }
74
76
  // How far each face tucks under the one before it: a quarter of the face less the ring, so two-letter
75
77
  // initials stay readable (the apps' 6px at 24px hid the first letter).
@@ -86,6 +88,6 @@ function AvatarGroup({ people, max = 3, size = "sm", decorative = false, classNa
86
88
  const extra = people.length - shown.length;
87
89
  const names = shown.map((p) => p.name || "Unknown person");
88
90
  const label = extra > 0 ? `${names.join(", ")} and ${extra} ${extra === 1 ? "other" : "others"}` : names.join(", ");
89
- return (_jsxs("span", { "data-slot": "avatar-group", className: cn("inline-flex items-center align-middle", className), ...(decorative ? { "aria-hidden": true } : { role: "img", "aria-label": label }), children: [shown.map((p, i) => (_jsx(Avatar, { name: p.name, src: p.src, size: size, className: cn("ring-2 ring-[var(--surface-primary)]", i > 0 && OVERLAP[size]), style: { zIndex: shown.length - i } }, `${p.name}-${i}`))), extra > 0 ? (_jsxs("span", { "data-slot": "avatar-group-count", className: cn(avatarVariants({ size }), OVERLAP[size], "items-center justify-center bg-[var(--surface-tertiary)] leading-none font-semibold text-[var(--text-secondary)] ring-2 ring-[var(--surface-primary)]"), children: ["+", extra] })) : null] }));
91
+ return (_jsxs("span", { "data-slot": "avatar-group", className: cn("inline-flex items-center align-middle", className), ...(decorative ? { "aria-hidden": true } : { role: "img", "aria-label": label }), children: [shown.map((p, i) => (_jsx(Avatar, { name: p.name, src: p.src, size: size, className: cn("ring-2 ring-[var(--avatar-ring,var(--surface-primary))]", i > 0 && OVERLAP[size]), style: { zIndex: shown.length - i } }, `${p.name}-${i}`))), extra > 0 ? (_jsxs("span", { "data-slot": "avatar-group-count", className: cn(avatarVariants({ size }), OVERLAP[size], "items-center justify-center bg-[var(--surface-tertiary)] leading-none font-semibold text-[var(--text-secondary)] ring-2 ring-[var(--avatar-ring,var(--surface-primary))]"), children: ["+", extra] })) : null] }));
90
92
  }
91
93
  export { Avatar, AvatarGroup, avatarVariants, initialsOf };
@@ -5,12 +5,13 @@ import { cn } from "@brdgapp/ui/lib/utils";
5
5
  // src/components/ui/badge.tsx. Rounded 4px, never a pill. For soft status and category labels use Tag.
6
6
  // Two fixes over Bridge OS: solid-red fills with --danger-solid (white on --error fails AA at 4.41:1), and
7
7
  // solid-dark's text uses --surface-primary so it stays readable in dark mode (white on light grey didn't).
8
+ // ALUM's text is --honey-text, a deeper gold that reaches 4.7:1 on white; the border stays --honey (2026-11-04).
8
9
  const badgeVariants = cva("inline-flex items-center rounded-[4px] px-[7px] py-1 text-[8px] leading-[8px] font-bold tracking-[1px] uppercase", {
9
10
  variants: {
10
11
  // Named `style` to match Bridge OS's API. It is not React's style prop: Badge takes no CSS styles.
11
12
  style: {
12
13
  outline: "border border-[var(--text-disabled)] text-[var(--text-muted)]",
13
- alum: "border border-[var(--honey)] text-[var(--honey)]",
14
+ alum: "border border-[var(--honey)] text-[var(--honey-text)]",
14
15
  "solid-red": "bg-[var(--danger-solid)] text-white",
15
16
  "solid-dark": "bg-[var(--text-secondary)] text-[var(--surface-primary)]",
16
17
  },
@@ -1,17 +1,34 @@
1
- import type * as React from "react";
1
+ import * as React from "react";
2
+ import type { DialogAction } from "@brdgapp/ui/components/dialog";
2
3
  type BottomSheetProps = {
3
4
  open: boolean;
4
5
  onClose: () => void;
5
6
  /** What's being chosen: "Degree", "Sort by". */
6
7
  title: React.ReactNode;
8
+ /** The options: a BottomSheetOptions holding BottomSheetOption rows. */
7
9
  children: React.ReactNode;
10
+ /** For several choices: the footer's filled button, like "Apply". One choice needs none: picking closes the sheet. */
11
+ primaryAction?: DialogAction;
12
+ /** The footer button that closes without applying. Default "Cancel". Shown with `primaryAction`. */
13
+ cancelLabel?: string;
8
14
  };
9
- declare function BottomSheet({ open, onClose, title, children }: BottomSheetProps): React.JSX.Element;
10
- /** One choice in a sheet: a 44px row with a tick when chosen. Wrap a set in `role="radiogroup"`. */
15
+ declare function BottomSheet({ open, onClose, title, children, primaryAction, cancelLabel }: BottomSheetProps): React.JSX.Element;
16
+ /**
17
+ * The options in a sheet. One choice (default): a list where ↑ and ↓ move and Enter picks; Tab enters at the
18
+ * chosen row. `multiple`: a checkbox per row, ticked and unticked until Apply.
19
+ */
20
+ declare function BottomSheetOptions({ multiple, children }: {
21
+ multiple?: boolean;
22
+ children: React.ReactNode;
23
+ }): React.JSX.Element;
24
+ /**
25
+ * One option: a 44px row. In a one-choice sheet it shows a blue tick when chosen, and picking it should
26
+ * close the sheet. In a `multiple` sheet it is a Checkbox.
27
+ */
11
28
  declare function BottomSheetOption({ selected, onSelect, children }: {
12
29
  selected?: boolean;
13
30
  onSelect: () => void;
14
31
  children: React.ReactNode;
15
32
  }): React.JSX.Element;
16
- export { BottomSheet, BottomSheetOption };
33
+ export { BottomSheet, BottomSheetOption, BottomSheetOptions };
17
34
  export type { BottomSheetProps };
@@ -1,12 +1,96 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
3
4
  import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
5
+ import { Check } from "lucide-react";
6
+ import { Button } from "@brdgapp/ui/components/button";
7
+ import { Checkbox } from "@brdgapp/ui/components/checkbox";
4
8
  import { cn } from "@brdgapp/ui/lib/utils";
5
- function BottomSheet({ open, onClose, title, children }) {
6
- return (_jsx(DialogPrimitive.Root, { open: open, onOpenChange: (next) => !next && onClose(), children: _jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Backdrop, { className: "fixed inset-0 z-[80] 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": "bottom-sheet", className: cn("fixed inset-x-0 bottom-0 z-[80] flex max-h-[85dvh] flex-col rounded-t-2xl border-t border-[var(--border-default)] bg-[var(--surface-elevated)] shadow-[var(--shadow-dialog)] outline-none", "pb-[max(12px,env(safe-area-inset-bottom))]", "transition-transform duration-300 ease-out data-[ending-style]:duration-200 data-[starting-style]:translate-y-full data-[ending-style]:translate-y-full motion-reduce:transition-none"), children: [_jsx("div", { "aria-hidden": "true", className: "mx-auto mt-2 h-1 w-10 shrink-0 rounded-full bg-[var(--border-hover)]" }), _jsx(DialogPrimitive.Title, { className: "shrink-0 px-5 pt-3 pb-2 text-16 font-bold tracking-tight text-[var(--text-primary)]", children: title }), _jsx("div", { "data-slot": "bottom-sheet-body", className: "min-h-0 flex-1 overflow-y-auto overscroll-contain", children: children })] })] }) }));
9
+ const SheetContext = React.createContext({ titleId: "" });
10
+ /** How far down, as a share of the sheet's height, a swipe has to go to close it. */
11
+ const CLOSE_AT = 1 / 3;
12
+ /** Or how fast, in px per ms: a quick flick closes it from anywhere. */
13
+ const FLICK = 0.5;
14
+ function BottomSheet({ open, onClose, title, children, primaryAction, cancelLabel = "Cancel" }) {
15
+ const titleId = React.useId();
16
+ const popup = React.useRef(null);
17
+ const start = React.useRef(null);
18
+ // How far the sheet has been dragged down (px), and whether a finger is on it now.
19
+ const [drag, setDrag] = React.useState(null);
20
+ const [dragging, setDragging] = React.useState(false);
21
+ function endDrag(clientY) {
22
+ if (!start.current)
23
+ return;
24
+ const dy = Math.max(0, clientY - start.current.y);
25
+ const speed = dy / Math.max(1, performance.now() - start.current.t);
26
+ const height = popup.current?.offsetHeight ?? 1;
27
+ start.current = null;
28
+ setDragging(false);
29
+ if (dy > height * CLOSE_AT || speed > FLICK) {
30
+ // Carry on down from where the finger let go, rather than jumping back first.
31
+ setDrag(height);
32
+ onClose();
33
+ }
34
+ else {
35
+ setDrag(null);
36
+ }
37
+ }
38
+ return (_jsx(DialogPrimitive.Root, { open: open, onOpenChange: (next) => !next && onClose(), onOpenChangeComplete: (isOpen) => {
39
+ if (!isOpen)
40
+ setDrag(null);
41
+ }, children: _jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Backdrop, { className: "fixed inset-0 z-[80] 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, { ref: popup, "data-slot": "bottom-sheet", "aria-labelledby": titleId, style: drag === null ? undefined : { translate: `0 ${drag}px`, transition: dragging ? "none" : undefined }, className: cn("fixed inset-x-0 bottom-0 z-[80] flex max-h-[85dvh] flex-col rounded-t-2xl border-t border-[var(--border-default)] bg-[var(--surface-elevated)] shadow-[var(--shadow-dialog)] outline-none", primaryAction ? null : "pb-[max(12px,env(safe-area-inset-bottom))]", "transition-[translate] duration-300 ease-out data-[ending-style]:duration-200 data-[starting-style]:translate-y-full data-[ending-style]:translate-y-full motion-reduce:transition-none"), children: [_jsxs("div", { "data-slot": "bottom-sheet-grab", className: "shrink-0 cursor-grab touch-none select-none active:cursor-grabbing", onPointerDown: (e) => {
42
+ if (e.button !== 0)
43
+ return;
44
+ start.current = { y: e.clientY, t: performance.now() };
45
+ setDragging(true);
46
+ e.currentTarget.setPointerCapture(e.pointerId);
47
+ }, onPointerMove: (e) => {
48
+ if (start.current)
49
+ setDrag(Math.max(0, e.clientY - start.current.y));
50
+ }, onPointerUp: (e) => endDrag(e.clientY), onPointerCancel: (e) => endDrag(e.clientY), children: [_jsx("div", { "aria-hidden": "true", className: "mx-auto mt-2 h-1 w-10 rounded-full bg-[var(--border-hover)]" }), _jsx(DialogPrimitive.Title, { id: titleId, className: "px-5 pt-3 pb-2 text-16 font-bold tracking-tight text-[var(--text-primary)]", children: title })] }), _jsx("div", { "data-slot": "bottom-sheet-body", className: "min-h-0 flex-1 overflow-y-auto overscroll-contain", children: _jsx(SheetContext.Provider, { value: { titleId }, children: children }) }), primaryAction ? (_jsxs("footer", { "data-slot": "bottom-sheet-footer", className: "flex shrink-0 gap-2 border-t border-[var(--border-divider)] px-5 pt-3 pb-[max(12px,env(safe-area-inset-bottom))]", children: [_jsx(Button, { variant: "secondary", size: "md", onClick: onClose, className: "flex-1", children: cancelLabel }), _jsx(Button, { size: "md", disabled: primaryAction.disabled, icon: primaryAction.icon, onClick: primaryAction.onClick, className: "flex-1", children: primaryAction.label })] })) : null] })] }) }));
7
51
  }
8
- /** One choice in a sheet: a 44px row with a tick when chosen. Wrap a set in `role="radiogroup"`. */
9
- function BottomSheetOption({ selected, onSelect, children }) {
10
- return (_jsxs("button", { type: "button", role: "radio", "aria-checked": selected, onClick: onSelect, "data-slot": "bottom-sheet-option", className: cn("flex min-h-11 w-full items-center justify-between gap-3 px-5 text-left text-14 outline-none transition-colors", "active:bg-[var(--surface-tertiary)] focus-visible:bg-[var(--surface-secondary)]", selected ? "font-semibold text-[var(--text-primary)]" : "text-[var(--text-body)]"), children: [_jsx("span", { className: "truncate", children: children }), selected ? (_jsx("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", className: "size-4 shrink-0 text-[var(--primary)]", children: _jsx("polyline", { points: "20 6 9 17 4 12" }) })) : null] }));
52
+ const OptionsContext = React.createContext({ multiple: false, tabStop: 0, index: 0 });
53
+ /**
54
+ * The options in a sheet. One choice (default): a list where ↑ and ↓ move and Enter picks; Tab enters at the
55
+ * chosen row. `multiple`: a checkbox per row, ticked and unticked until Apply.
56
+ */
57
+ function BottomSheetOptions({ multiple = false, children }) {
58
+ const { titleId } = React.useContext(SheetContext);
59
+ const rows = React.Children.toArray(children).filter(React.isValidElement);
60
+ const chosen = rows.findIndex((r) => r.props.selected);
61
+ const tabStop = chosen === -1 ? 0 : chosen;
62
+ function onKeyDown(e) {
63
+ const keys = {
64
+ ArrowDown: (i, n) => (i + 1) % n,
65
+ ArrowUp: (i, n) => (i - 1 + n) % n,
66
+ Home: () => 0,
67
+ End: (_, n) => n - 1,
68
+ };
69
+ const move = keys[e.key];
70
+ if (!move)
71
+ return;
72
+ const items = Array.from(e.currentTarget.querySelectorAll("[data-slot=bottom-sheet-option], [data-slot=checkbox]"));
73
+ if (items.length === 0)
74
+ return;
75
+ e.preventDefault();
76
+ const at = items.findIndex((el) => el === document.activeElement || el.contains(document.activeElement));
77
+ items[move(at === -1 ? 0 : at, items.length)]?.focus();
78
+ }
79
+ return (_jsx("div", { "data-slot": "bottom-sheet-options", role: multiple ? "group" : "listbox", "aria-labelledby": titleId || undefined, onKeyDown: onKeyDown, className: "flex flex-col", children: rows.map((row, index) => (_jsx(OptionsContext.Provider, { value: { multiple, tabStop, index }, children: row }, row.key ?? index))) }));
11
80
  }
12
- export { BottomSheet, BottomSheetOption };
81
+ // Hover is the menus' light grey. Keyboard focus adds the blue inner ring table rows use, since the grey alone
82
+ // is too faint on the white sheet; a checkbox row's box draws its own ring.
83
+ const ROW = "flex min-h-11 w-full items-center gap-3 px-5 text-left text-14 leading-normal outline-none transition-colors hover:bg-[var(--surface-secondary)] active:bg-[var(--surface-tertiary)] focus-visible:bg-[var(--surface-secondary)] focus-visible:ring-2 focus-visible:ring-[var(--primary)] focus-visible:ring-inset";
84
+ /**
85
+ * One option: a 44px row. In a one-choice sheet it shows a blue tick when chosen, and picking it should
86
+ * close the sheet. In a `multiple` sheet it is a Checkbox.
87
+ */
88
+ function BottomSheetOption({ selected = false, onSelect, children }) {
89
+ const { multiple, tabStop, index } = React.useContext(OptionsContext);
90
+ if (multiple) {
91
+ // Focus is on the box inside the row, so the row lights up with `has-[:focus-visible]`.
92
+ return (_jsx(Checkbox, { label: children, checked: selected, onCheckedChange: onSelect, className: cn(ROW, "text-[var(--text-primary)] has-[:focus-visible]:bg-[var(--surface-secondary)]") }));
93
+ }
94
+ return (_jsxs("button", { type: "button", role: "option", "aria-selected": selected, tabIndex: index === tabStop ? 0 : -1, onClick: onSelect, "data-slot": "bottom-sheet-option", className: cn(ROW, "justify-between", selected ? "font-semibold text-[var(--text-primary)]" : "text-[var(--text-body)]"), children: [_jsx("span", { className: "truncate", children: children }), selected ? _jsx(Check, { "aria-hidden": "true", className: "size-4 shrink-0 text-[var(--primary)]", strokeWidth: 2.5 }) : null] }));
95
+ }
96
+ export { BottomSheet, BottomSheetOption, BottomSheetOptions };
@@ -2,7 +2,7 @@ import type * as React from "react";
2
2
  import { Button as ButtonPrimitive } from "@base-ui/react/button";
3
3
  type ButtonGroupVariant = "secondary" | "primary";
4
4
  declare const buttonGroupVariants: (props?: ({
5
- variant?: "secondary" | "primary" | null | undefined;
5
+ variant?: "primary" | "secondary" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  declare function ButtonGroup({ variant, className, children, ...props }: {
8
8
  variant?: ButtonGroupVariant;
@@ -12,7 +12,7 @@ declare function ButtonGroup({ variant, className, children, ...props }: {
12
12
  children: React.ReactNode;
13
13
  }): React.JSX.Element;
14
14
  declare const buttonGroupItemVariants: (props?: ({
15
- variant?: "secondary" | "primary" | null | undefined;
15
+ variant?: "primary" | "secondary" | null | undefined;
16
16
  iconOnly?: boolean | null | undefined;
17
17
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
18
18
  type ButtonGroupItemProps = Omit<ButtonPrimitive.Props, "className"> & {
@@ -22,7 +22,7 @@ function ButtonGroup({ variant = "secondary", className, children, ...props }) {
22
22
  return (_jsx(ButtonGroupContext.Provider, { value: variant, children: _jsx("div", { "data-slot": "button-group", role: "group", className: cn(buttonGroupVariants({ variant }), className), ...props, children: children }) }));
23
23
  }
24
24
  const buttonGroupItemVariants = cva([
25
- "inline-flex h-8 items-center justify-center gap-1.5 text-[14px] font-semibold tracking-[0.4px]",
25
+ "inline-flex h-8 items-center justify-center gap-1.5 text-14 font-semibold tracking-[0.4px]",
26
26
  "transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-inset",
27
27
  "disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-[15px] [&_svg]:shrink-0",
28
28
  ], {
@@ -2,8 +2,8 @@ import type * as React from "react";
2
2
  import { Button as ButtonPrimitive } from "@base-ui/react/button";
3
3
  import { type VariantProps } from "class-variance-authority";
4
4
  declare const buttonVariants: (props?: ({
5
- variant?: "link" | "secondary" | "primary" | "ghost" | "destructive" | "danger-ghost" | null | undefined;
6
- size?: "sm" | "md" | "lg" | "xs" | null | undefined;
5
+ variant?: "link" | "primary" | "secondary" | "ghost" | "destructive" | "danger-ghost" | null | undefined;
6
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
7
7
  fullWidth?: boolean | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  type ButtonProps = Omit<ButtonPrimitive.Props, "className"> & VariantProps<typeof buttonVariants> & {
@@ -27,12 +27,12 @@ const buttonVariants = cva([
27
27
  // Inline text action: no pill, no padding, primary colour, underline on hover.
28
28
  link: "justify-start bg-transparent p-0 text-[var(--primary)] underline-offset-2 hover:text-[var(--primary-hover)] hover:underline focus-visible:underline disabled:no-underline",
29
29
  },
30
- // xs (28px) is the smallest allowed: it clears the 24px minimum target.
30
+ // xs (28px) is the smallest button with words. Only IconButton `xs` goes to 24px, WCAG's minimum target.
31
31
  size: {
32
- xs: "text-[12px] [&_svg:not([class*='size-'])]:size-3.5",
33
- sm: "text-[14px] [&_svg:not([class*='size-'])]:size-4",
34
- md: "text-[14px] [&_svg:not([class*='size-'])]:size-4",
35
- lg: "text-[16px] [&_svg:not([class*='size-'])]:size-[18px]",
32
+ xs: "text-12 [&_svg:not([class*='size-'])]:size-3.5",
33
+ sm: "text-14 [&_svg:not([class*='size-'])]:size-4",
34
+ md: "text-14 [&_svg:not([class*='size-'])]:size-4",
35
+ lg: "text-16 [&_svg:not([class*='size-'])]:size-[18px]",
36
36
  },
37
37
  fullWidth: {
38
38
  true: "w-full",
@@ -51,6 +51,8 @@ const buttonVariants = cva([
51
51
  { variant: ["primary", "secondary", "ghost", "destructive", "danger-ghost"], size: "lg", className: "h-12 px-6 py-3" },
52
52
  // A link reads as text, so it never stretches.
53
53
  { variant: "link", fullWidth: true, className: "w-auto" },
54
+ // The line height links have always had (1.625), after the size so it isn't dropped: a link keeps its height.
55
+ { variant: "link", className: "leading-[1.625]" },
54
56
  ],
55
57
  defaultVariants: {
56
58
  variant: "primary",
@@ -77,6 +79,6 @@ const buttonSkeletonHeights = { xs: "h-7", sm: "h-8", md: "h-11 md:h-10", lg: "h
77
79
  * it in causes no layout shift. Not the same as `loading`, which is an action already running.
78
80
  */
79
81
  function ButtonSkeleton({ size = "sm", width = "7rem", className, }) {
80
- return (_jsx("span", { "data-slot": "button-skeleton", "aria-hidden": "true", style: { width }, className: cn("inline-block animate-pulse rounded-full bg-[var(--border-hover)] motion-reduce:animate-none", buttonSkeletonHeights[size], className) }));
82
+ return (_jsx("span", { "data-slot": "button-skeleton", "aria-hidden": "true", style: { width }, className: cn("inline-block animate-pulse rounded-full bg-[var(--skeleton)] motion-reduce:animate-none", buttonSkeletonHeights[size], className) }));
81
83
  }
82
84
  export { Button, ButtonSkeleton, buttonVariants };
@@ -4,7 +4,7 @@ declare const cardVariants: (props?: ({
4
4
  size?: "sm" | "md" | "lg" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  type CardProps = VariantProps<typeof cardVariants> & {
7
- /** No padding: for a table or list that runs edge to edge. Pair with a header strip. */
7
+ /** No padding: for a table or list that runs edge to edge. A table's card has no header (the page names it). */
8
8
  flush?: boolean;
9
9
  /** No glass and no side padding: a row inside another card or pane, split from its neighbours by dividers. */
10
10
  bare?: boolean;
@@ -48,7 +48,7 @@ type CardHeaderProps = {
48
48
  meta?: React.ReactNode;
49
49
  /** One control on the right: a link button, an IconButton or an ActionMenu. */
50
50
  action?: React.ReactNode;
51
- /** A tinted band across the top of the card, split from the body by a line. For dense cards and tables. */
51
+ /** A tinted band across the top of the card, split from the body by a line. For dense cards; never over a table. */
52
52
  strip?: boolean;
53
53
  /** The title's heading level. Match the page: `h2` under the page title. */
54
54
  as?: "h2" | "h3" | "h4";
@@ -60,7 +60,7 @@ function CardHeader({ title, icon, iconColor = "blue", hint, leading, descriptio
60
60
  const ctx = React.useContext(CardContext);
61
61
  return (_jsxs("header", { "data-slot": "card-header", className: cn("flex gap-3", description ? "items-start" : "items-center", strip
62
62
  ? "-mx-[var(--card-inset)] -mt-[var(--card-inset)] mb-[var(--card-inset)] items-center border-b border-[var(--border-divider)] bg-[var(--surface-secondary)]/50 px-[var(--card-pad)] py-3.5"
63
- : "mb-4 last:mb-0"), children: [icon ? (_jsx("span", { "aria-hidden": "true", className: cn("flex size-9 shrink-0 items-center justify-center rounded-lg [&_svg]:size-[18px]", ICON_COLOR[iconColor]), children: icon })) : leading ? (_jsx("span", { className: "flex shrink-0", children: leading })) : null, _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-1.5", children: [_jsx(Heading, { id: ctx?.titleId, "data-slot": "card-title", className: cn("truncate font-bold tracking-tight text-[var(--text-primary)]", strip || compact ? "text-14" : "text-16"), children: title }), hint ? _jsx(InfoHint, { text: hint }) : null] }), description ? (_jsx("p", { "data-slot": "card-description", className: "mt-0.5 text-[13px] text-[var(--text-muted)]", children: description })) : null] }), meta ? (_jsx("div", { "data-slot": "card-meta", className: "flex shrink-0 items-center gap-2 text-[12px] tabular-nums text-[var(--text-muted)]", children: meta })) : null, action ? (_jsx("div", { "data-slot": "card-action", className: "shrink-0", children: action })) : null] }));
63
+ : "mb-4 last:mb-0"), children: [icon ? (_jsx("span", { "aria-hidden": "true", className: cn("flex size-9 shrink-0 items-center justify-center rounded-lg [&_svg]:size-[18px]", ICON_COLOR[iconColor]), children: icon })) : leading ? (_jsx("span", { className: "flex shrink-0", children: leading })) : null, _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-1.5", children: [_jsx(Heading, { id: ctx?.titleId, "data-slot": "card-title", className: cn("truncate font-bold tracking-tight text-[var(--text-primary)]", strip || compact ? "text-14" : "text-16"), children: title }), hint ? _jsx(InfoHint, { text: hint }) : null] }), description ? (_jsx("p", { "data-slot": "card-description", className: "mt-0.5 text-13 leading-[1.625] text-[var(--text-muted)]", children: description })) : null] }), meta ? (_jsx("div", { "data-slot": "card-meta", className: "flex shrink-0 items-center gap-2 text-12 leading-[1.625] tabular-nums text-[var(--text-muted)]", children: meta })) : null, action ? (_jsx("div", { "data-slot": "card-action", className: "shrink-0", children: action })) : null] }));
64
64
  }
65
65
  /** A picture across the top of the card, edge to edge. Put it first. */
66
66
  function CardMedia({ src, alt, height = 128 }) {
@@ -25,11 +25,11 @@ function Checkbox({ label, description, className, disabled, ...props }) {
25
25
  const box = (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", disabled: disabled, "aria-describedby": description ? descriptionId : undefined, className: cn(boxClasses, !label && className, label && "mt-0.5"), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", keepMounted: true, className: "flex data-[unchecked]:hidden", render: (indicatorProps, state) => (_jsx("span", { ...indicatorProps, children: state.indeterminate ? _jsx(Minus, { className: "size-3", strokeWidth: 3 }) : _jsx(Check, { className: "size-3", strokeWidth: 3 }) })) }) }));
26
26
  if (!label)
27
27
  return box;
28
- return (_jsxs("label", { "data-slot": "checkbox-label", className: cn("flex w-fit items-start gap-2.5", disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer", className), children: [box, _jsxs("span", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-[14px] leading-5 text-[var(--text-primary)]", children: label }), description ? (_jsx("span", { id: descriptionId, className: "text-[12px] leading-4 text-[var(--text-muted)]", children: description })) : null] })] }));
28
+ return (_jsxs("label", { "data-slot": "checkbox-label", className: cn("flex w-fit items-start gap-2.5", disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer", className), children: [box, _jsxs("span", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-14 text-[var(--text-primary)]", children: label }), description ? (_jsx("span", { id: descriptionId, className: "text-12 text-[var(--text-muted)]", children: description })) : null] })] }));
29
29
  }
30
30
  /** A list of options, each a Checkbox with a `value` and a `label`. The group holds the ticked values. */
31
31
  function CheckboxGroup({ label, className, children, ...props }) {
32
32
  const labelId = React.useId();
33
- return (_jsxs(CheckboxGroupPrimitive, { "data-slot": "checkbox-group", "aria-labelledby": labelId, className: cn("flex flex-col gap-3", className), ...props, children: [_jsx("span", { id: labelId, className: "text-[14px] font-medium text-[var(--text-primary)]", children: label }), children] }));
33
+ return (_jsxs(CheckboxGroupPrimitive, { "data-slot": "checkbox-group", "aria-labelledby": labelId, className: cn("flex flex-col gap-3", className), ...props, children: [_jsx("span", { id: labelId, className: "text-14 leading-[1.625] font-medium text-[var(--text-primary)]", children: label }), children] }));
34
34
  }
35
35
  export { Checkbox, CheckboxGroup };
@@ -3,6 +3,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
3
3
  import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
4
4
  import { cva } from "class-variance-authority";
5
5
  import { ChevronDown, ChevronRight } from "lucide-react";
6
+ import { formatCount } from "@brdgapp/ui/lib/format";
6
7
  import { cn } from "@brdgapp/ui/lib/utils";
7
8
  // A section people open and close: "Advanced", "History on this list". Started from shadcn's Base UI
8
9
  // collapsible, then given Bridge's two looks.
@@ -17,8 +18,8 @@ import { cn } from "@brdgapp/ui/lib/utils";
17
18
  const triggerVariants = cva("group/collapsible-trigger inline-flex items-center rounded text-left outline-none transition-colors duration-150 ease-out focus-visible:ring-2 focus-visible:ring-[var(--primary)] disabled:cursor-not-allowed disabled:opacity-50", {
18
19
  variants: {
19
20
  variant: {
20
- section: "w-full justify-between gap-3 py-1 text-[13px] font-bold text-[var(--text-primary)]",
21
- inline: "-mx-1 gap-1 px-1 text-[13px] font-medium text-[var(--text-secondary)] hover:text-[var(--text-primary)]",
21
+ section: "-mx-1 w-[calc(100%+0.5rem)] justify-between gap-3 px-1 py-1 text-13 leading-[1.625] font-bold text-[var(--text-primary)]",
22
+ inline: "-mx-1 gap-1 px-1 text-13 leading-[1.625] font-medium text-[var(--text-secondary)] hover:text-[var(--text-primary)]",
22
23
  },
23
24
  },
24
25
  defaultVariants: { variant: "section" },
@@ -29,7 +30,7 @@ function Collapsible({ className, ...props }) {
29
30
  }
30
31
  function CollapsibleTrigger({ variant = "section", count, className, children, ...props }) {
31
32
  const arrow = "size-4 shrink-0 text-[var(--text-muted)] transition-transform duration-200 ease-out motion-reduce:transition-none";
32
- return (_jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", "data-variant": variant, className: cn(triggerVariants({ variant }), className), ...props, children: variant === "inline" ? (_jsxs(_Fragment, { children: [_jsx(ChevronRight, { "aria-hidden": "true", className: cn(arrow, "group-data-[panel-open]/collapsible-trigger:rotate-90") }), children] })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1", children: children }), count !== undefined ? (_jsx("span", { className: "text-[12px] font-medium tabular-nums text-[var(--text-muted)]", children: count.toLocaleString("en-US") })) : null, _jsx(ChevronDown, { "aria-hidden": "true", className: cn(arrow, "group-hover/collapsible-trigger:text-[var(--text-primary)] group-data-[panel-open]/collapsible-trigger:rotate-180") })] })) }));
33
+ return (_jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", "data-variant": variant, className: cn(triggerVariants({ variant }), className), ...props, children: variant === "inline" ? (_jsxs(_Fragment, { children: [_jsx(ChevronRight, { "aria-hidden": "true", className: cn(arrow, "group-hover/collapsible-trigger:text-[var(--text-primary)] group-data-[panel-open]/collapsible-trigger:rotate-90") }), children] })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1", children: children }), count !== undefined ? (_jsx("span", { className: "text-12 leading-[1.625] font-medium tabular-nums text-[var(--text-muted)]", children: formatCount(count) })) : null, _jsx(ChevronDown, { "aria-hidden": "true", className: cn(arrow, "group-hover/collapsible-trigger:text-[var(--text-primary)] group-data-[panel-open]/collapsible-trigger:rotate-180") })] })) }));
33
34
  }
34
35
  /** What opens. Slides open and shut; content inside keeps its own spacing. */
35
36
  function CollapsibleContent({ className, children, ...props }) {
@@ -2,7 +2,8 @@ import { type LucideIcon } from "lucide-react";
2
2
  import { type FilterPillOption } from "@brdgapp/ui/components/filter-pill";
3
3
  import { type ElementProps } from "@brdgapp/ui/lib/utils";
4
4
  type ColumnFilterMenuProps<T extends string> = ElementProps<HTMLButtonElement> & {
5
- icon: LucideIcon;
5
+ /** The column's icon component. Optional: leave it out for a header with only a name. */
6
+ icon?: LucideIcon;
6
7
  label: string;
7
8
  /** Explains the column. Hidden while the menu is open. */
8
9
  tooltip?: string;