@brdgapp/ui 1.0.0 → 1.1.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/components/action-menu.d.ts +9 -2
  3. package/components/action-menu.js +14 -5
  4. package/components/avatar.d.ts +1 -1
  5. package/components/avatar.js +7 -5
  6. package/components/badge.js +2 -1
  7. package/components/bottom-sheet.d.ts +21 -4
  8. package/components/bottom-sheet.js +90 -6
  9. package/components/button-group.d.ts +2 -2
  10. package/components/button-group.js +1 -1
  11. package/components/button.d.ts +2 -2
  12. package/components/button.js +8 -6
  13. package/components/card.d.ts +2 -2
  14. package/components/card.js +1 -1
  15. package/components/checkbox.js +2 -2
  16. package/components/collapsible.js +4 -3
  17. package/components/column-filter-menu.d.ts +2 -1
  18. package/components/column-filter-menu.js +3 -2
  19. package/components/column-sort-button.d.ts +8 -2
  20. package/components/column-sort-button.js +12 -2
  21. package/components/confirm-dialog.d.ts +11 -3
  22. package/components/confirm-dialog.js +41 -6
  23. package/components/copy-field.js +4 -2
  24. package/components/data-state.js +2 -2
  25. package/components/data-table.d.ts +54 -5
  26. package/components/data-table.js +79 -30
  27. package/components/dialog.d.ts +29 -5
  28. package/components/dialog.js +27 -3
  29. package/components/drawer.d.ts +16 -6
  30. package/components/drawer.js +26 -9
  31. package/components/expandable-bio.js +2 -1
  32. package/components/field.js +3 -3
  33. package/components/filter-chip.js +4 -1
  34. package/components/filter-pill.js +6 -6
  35. package/components/hover-card.js +4 -2
  36. package/components/icon-button.d.ts +2 -2
  37. package/components/icon-button.js +6 -1
  38. package/components/info-hint.d.ts +8 -1
  39. package/components/info-hint.js +22 -7
  40. package/components/input.js +1 -1
  41. package/components/network-graph.js +1 -1
  42. package/components/page-banner.js +11 -5
  43. package/components/scene.d.ts +3 -1
  44. package/components/scene.js +2 -2
  45. package/components/search-input.d.ts +2 -2
  46. package/components/search-input.js +24 -3
  47. package/components/segmented-control.js +5 -1
  48. package/components/skeleton.js +3 -1
  49. package/components/skip-link.js +3 -1
  50. package/components/stat-box.d.ts +23 -5
  51. package/components/stat-box.js +33 -16
  52. package/components/switch.js +5 -1
  53. package/components/tabs.js +10 -2
  54. package/components/tag-input.d.ts +3 -1
  55. package/components/tag-input.js +27 -8
  56. package/components/tag.js +4 -2
  57. package/components/textarea.js +2 -2
  58. package/components/toast.d.ts +9 -5
  59. package/components/toast.js +10 -5
  60. package/package.json +1 -1
  61. package/styles/globals.css +26 -3
@@ -3,6 +3,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
4
4
  import { cn } from "@brdgapp/ui/lib/utils";
5
5
  function Switch({ checked, onChange, disabled = false, className, ...props }) {
6
- return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", checked: checked, onCheckedChange: (next) => onChange(next), disabled: disabled, className: cn("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full bg-[var(--surface-tertiary)] transition-colors duration-200 outline-none", "focus-visible:ring-2 focus-visible:ring-[var(--primary)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface-primary)]", "data-[checked]:bg-[var(--primary-solid)]", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: "inline-block size-4 translate-x-[2px] rounded-full bg-white shadow-[0_1px_2px_rgba(0,0,0,0.3)] transition-transform duration-200 data-[checked]:translate-x-[18px]" }) }));
6
+ return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", checked: checked, onCheckedChange: (next) => onChange(next), disabled: disabled, className: cn(
7
+ // Off is mid-grey, not pale: the track's edge has to reach 3:1 against the page (4.8:1 on white). 2026-11-04.
8
+ "relative inline-flex h-5 w-9 shrink-0 items-center rounded-full bg-[var(--text-muted)] transition-colors duration-200 outline-none",
9
+ // Hover steps darker in light and in dark, so the white thumb always stands out from the track.
10
+ "hover:bg-[var(--text-secondary)] dark:hover:bg-[var(--text-disabled)] data-[checked]:hover:bg-[var(--primary-solid-hover)]", "focus-visible:ring-2 focus-visible:ring-[var(--primary)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface-primary)]", "data-[checked]:bg-[var(--primary-solid)]", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: "inline-block size-4 translate-x-[2px] rounded-full bg-white shadow-[0_1px_2px_rgba(0,0,0,0.3)] transition-transform duration-200 data-[checked]:translate-x-[18px]" }) }));
7
11
  }
8
12
  export { Switch };
@@ -11,12 +11,20 @@ function Tabs({ className, ...props }) {
11
11
  }
12
12
  // The baseline is an inset shadow, not a border, so the active tab's 2px underline can cover it without
13
13
  // sticking out of the row. (A border plus a -1px tab margin got clipped by the row's sideways scrolling.)
14
+ // 4px of padding each side (cancelled by -mx-1) leaves room for the tabs' focus ring at the row's ends.
14
15
  // When the page draws its own baseline, pass `shadow-none -mb-px` so the row sits on that line instead.
15
16
  function TabList({ className, ...props }) {
16
- return (_jsx(TabsPrimitive.List, { "data-slot": "tab-list", className: cn("flex items-center gap-6 overflow-x-auto shadow-[inset_0_-1px_0_var(--border-default)] scrollbar-none", className), ...props }));
17
+ return (_jsx(TabsPrimitive.List, { "data-slot": "tab-list", className: cn("-mx-1 flex items-center gap-6 overflow-x-auto px-1 shadow-[inset_0_-1px_0_var(--border-default)] scrollbar-none", className), ...props }));
17
18
  }
18
19
  function Tab({ className, ...props }) {
19
- return (_jsx(TabsPrimitive.Tab, { "data-slot": "tab", className: cn("relative shrink-0 rounded-t border-b-2 border-transparent pt-1 pb-3 max-md:min-h-11 text-[14px] font-bold tracking-[0.4px] whitespace-nowrap", "text-[var(--text-muted)] transition-colors duration-150 outline-none hover:text-[var(--text-body)]", "focus-visible:ring-2 focus-visible:ring-[var(--primary)]", "data-[active]:border-[var(--text-primary)] data-[active]:text-[var(--text-primary)]", "disabled:pointer-events-none disabled:opacity-50", className), ...props }));
20
+ return (_jsx(TabsPrimitive.Tab, { "data-slot": "tab", className: cn("relative -mx-1 shrink-0 rounded-t border-b-2 border-transparent px-1 pt-1 pb-3 max-md:min-h-11 text-14 leading-[1.625] font-bold tracking-[0.4px] whitespace-nowrap",
21
+ // Hover darkens an unselected tab a clear step; a selected tab stays dark.
22
+ "text-[var(--text-muted)] transition-colors duration-150 outline-none not-data-[active]:hover:text-[var(--text-secondary)]",
23
+ // The ring sits inside the tab: the row scrolls sideways, which clips anything outside it. 4px of room each
24
+ // side (px-1, cancelled by -mx-1) keeps it off the letters without moving the tabs.
25
+ "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--primary)]", "data-[active]:border-[var(--text-primary)] data-[active]:text-[var(--text-primary)]",
26
+ // Base UI marks a disabled tab with data-disabled (it stays focusable), not the disabled attribute.
27
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props }));
20
28
  }
21
29
  // A panel takes focus when it has nothing focusable inside, so it shows the same ring as everything else.
22
30
  function TabPanel({ className, ...props }) {
@@ -8,8 +8,10 @@ type TagInputProps = ElementProps<HTMLDivElement> & {
8
8
  ariaLabel?: string;
9
9
  /** Chip colour: `primary` (blue tint) or `muted` (grey). */
10
10
  variant?: "primary" | "muted";
11
+ /** Can't be changed: dimmed, no remove buttons. */
12
+ disabled?: boolean;
11
13
  className?: string;
12
14
  };
13
- declare function TagInput({ value, onChange, placeholder, ariaLabel, variant, className, ...rest }: TagInputProps): React.JSX.Element;
15
+ declare function TagInput({ value, onChange, placeholder, ariaLabel, variant, disabled, className, ...rest }: TagInputProps): React.JSX.Element;
14
16
  export { TagInput };
15
17
  export type { TagInputProps };
@@ -5,16 +5,31 @@ import { Button as ButtonPrimitive } from "@base-ui/react/button";
5
5
  import { Input as InputPrimitive } from "@base-ui/react/input";
6
6
  import { X } from "lucide-react";
7
7
  import { cn } from "@brdgapp/ui/lib/utils";
8
- function TagInput({ value, onChange, placeholder, ariaLabel, variant = "primary", className, ...rest }) {
8
+ function TagInput({ value, onChange, placeholder, ariaLabel, variant = "primary", disabled = false, className, ...rest }) {
9
9
  const [draft, setDraft] = useState("");
10
10
  const inputRef = useRef(null);
11
+ /** Adds each entry that isn't already there (ignoring case), then clears the text box. */
12
+ function addAll(entries) {
13
+ const next = [...value];
14
+ for (const raw of entries) {
15
+ const v = raw.trim();
16
+ if (v && !next.some((t) => t.toLowerCase() === v.toLowerCase()))
17
+ next.push(v);
18
+ }
19
+ if (next.length !== value.length)
20
+ onChange(next);
21
+ setDraft("");
22
+ }
11
23
  function add(raw) {
12
- const v = raw.trim();
13
- if (!v)
24
+ addAll([raw]);
25
+ }
26
+ // A pasted list ("Climate, Health" or one per line) becomes one chip per entry.
27
+ function onPaste(e) {
28
+ const text = e.clipboardData.getData("text");
29
+ if (!/[,\n]/.test(text))
14
30
  return;
15
- if (!value.some((t) => t.toLowerCase() === v.toLowerCase()))
16
- onChange([...value, v]);
17
- setDraft("");
31
+ e.preventDefault();
32
+ addAll((draft + text).split(/[,\n]/));
18
33
  }
19
34
  function removeAt(index) {
20
35
  onChange(value.filter((_, i) => i !== index));
@@ -32,9 +47,13 @@ function TagInput({ value, onChange, placeholder, ariaLabel, variant = "primary"
32
47
  }
33
48
  return (
34
49
  // Clicking anywhere in the box focuses the text field (a mouse convenience; the field is reachable by Tab).
35
- _jsxs("div", { ...rest, "data-slot": "tag-input", onClick: () => inputRef.current?.focus(), className: cn("flex min-h-11 md:min-h-10 w-full cursor-text flex-wrap items-center gap-1.5 rounded-lg border border-[var(--border-default)] bg-[var(--surface-primary)] px-2 py-1.5", "transition-all duration-150 hover:border-[var(--border-hover)] focus-within:border-[var(--primary)] focus-within:ring-2 focus-within:ring-[var(--primary)]/20", className), children: [value.map((tag, i) => (_jsxs("span", { "data-slot": "tag-input-chip", className: cn("inline-flex items-center gap-0.5 rounded-full py-0.5 pr-0.5 pl-2.5 text-[11px] font-semibold", variant === "primary" ? "bg-[var(--primary)]/[0.08] text-[var(--primary)]" : "bg-[var(--surface-secondary)] text-[var(--text-body)]"), children: [tag, _jsx(ButtonPrimitive, { "aria-label": `Remove ${tag}`, onClick: (e) => {
50
+ _jsxs("div", { ...rest, "data-slot": "tag-input", onClick: () => inputRef.current?.focus(), "data-disabled": disabled || undefined, className: cn("flex min-h-11 md:min-h-10 w-full cursor-text flex-wrap items-center gap-1.5 rounded-lg border border-[var(--border-field)] bg-[var(--surface-primary)] px-2 py-1.5", "transition-all duration-150 hover:border-[var(--text-muted)] focus-within:border-[var(--primary)] focus-within:ring-2 focus-within:ring-[var(--primary)]/20",
51
+ // Inside an invalid Field, Base UI marks the text box; the whole field turns red, as Input does.
52
+ "has-[[data-invalid]]:border-[var(--error)] has-[[data-invalid]]:hover:border-[var(--error)] has-[[data-invalid]]:focus-within:ring-[var(--error)]/20",
53
+ // Disabled by the prop, or by a disabled Field around it.
54
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50 has-[input:disabled]:pointer-events-none has-[input:disabled]:opacity-50", className), children: [value.map((tag, i) => (_jsxs("span", { "data-slot": "tag-input-chip", className: cn("inline-flex items-center gap-0.5 rounded-full py-0.5 pr-0.5 pl-2.5 text-11 leading-normal font-semibold", disabled && "pr-2.5", variant === "primary" ? "bg-[var(--primary)]/[0.08] text-[var(--primary)]" : "bg-[var(--surface-secondary)] text-[var(--text-body)]"), children: [tag, disabled ? null : (_jsx(ButtonPrimitive, { "aria-label": `Remove ${tag}`, onClick: (e) => {
36
55
  e.stopPropagation();
37
56
  removeAt(i);
38
- }, className: "inline-flex size-5 items-center justify-center rounded-full opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-[var(--primary)]", children: _jsx(X, { "aria-hidden": "true", className: "size-3" }) })] }, `${tag}-${i}`))), _jsx(InputPrimitive, { ref: inputRef, "data-slot": "tag-input-field", type: "text", value: draft, "aria-label": ariaLabel, onChange: (e) => setDraft(e.target.value), onKeyDown: onKeyDown, onBlur: () => add(draft), placeholder: value.length === 0 ? placeholder : "", className: "min-w-[80px] flex-1 border-0 bg-transparent px-1.5 py-0.5 text-16 md:text-14 text-[var(--text-primary)] outline-none placeholder:text-[var(--text-muted)]" })] }));
57
+ }, className: "inline-flex size-5 items-center justify-center rounded-full opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-[var(--primary)]", children: _jsx(X, { "aria-hidden": "true", className: "size-3" }) }))] }, `${tag}-${i}`))), _jsx(InputPrimitive, { ref: inputRef, "data-slot": "tag-input-field", type: "text", value: draft, "aria-label": ariaLabel, onChange: (e) => setDraft(e.target.value), onKeyDown: onKeyDown, onPaste: onPaste, disabled: disabled, onBlur: () => add(draft), placeholder: value.length === 0 ? placeholder : "", className: "min-w-[80px] flex-1 border-0 bg-transparent px-1.5 py-0.5 text-16 md:text-14 text-[var(--text-primary)] outline-none placeholder:text-[var(--text-muted)]" })] }));
39
58
  }
40
59
  export { TagInput };
package/components/tag.js CHANGED
@@ -16,9 +16,11 @@ const tagVariants = cva("inline-flex items-center gap-1 rounded-[4px] border fon
16
16
  red: "border-[var(--error-border)] bg-[var(--error-bg)] text-[var(--error-text)]",
17
17
  purple: "border-[var(--purple-border)] bg-[var(--purple-bg)] text-[var(--purple)]",
18
18
  },
19
+ // Named sizes with the line height tags have always had (1.625), so they stay 25.5px (sm) and 33px (md)
20
+ // tall, as in Bridge OS (decision 2026-11-04).
19
21
  size: {
20
- sm: "px-2 py-0.5 text-[12px] [&_svg]:size-3.5",
21
- md: "px-2.5 py-1 text-[14px] [&_svg]:size-4",
22
+ sm: "px-2 py-0.5 text-12 leading-[1.625] [&_svg]:size-3.5",
23
+ md: "px-2.5 py-1 text-14 leading-[1.625] [&_svg]:size-4",
22
24
  },
23
25
  },
24
26
  defaultVariants: { color: "grey", size: "sm" },
@@ -17,7 +17,7 @@ import { cn } from "@brdgapp/ui/lib/utils";
17
17
  const LINE = 20; // a 20px line (leading-5), at 14px and at 16px on phones
18
18
  const PAD_Y = 10; // py-2.5
19
19
  const BORDER = 1;
20
- const textareaClasses = cn("block w-full min-w-0 resize-none rounded-lg border border-[var(--border-default)] bg-[var(--surface-primary)] px-3.5 py-2.5", "text-16 leading-5 md:text-14 md:leading-5 text-[var(--text-primary)] placeholder:text-[var(--text-muted)]", "transition-colors duration-150 ease-out outline-none", "hover:border-[var(--border-hover)]", "focus-visible:border-[var(--primary)] focus-visible:ring-2 focus-visible:ring-[var(--primary)]/20", "aria-invalid:border-[var(--error)] aria-invalid:hover:border-[var(--error)] aria-invalid:focus-visible:border-[var(--error)] aria-invalid:focus-visible:ring-[var(--error)]/20", "data-[invalid]:border-[var(--error)] data-[invalid]:hover:border-[var(--error)] data-[invalid]:focus-visible:border-[var(--error)] data-[invalid]:focus-visible:ring-[var(--error)]/20", "disabled:cursor-not-allowed disabled:opacity-50");
20
+ const textareaClasses = cn("block w-full min-w-0 resize-none rounded-lg border border-[var(--border-field)] bg-[var(--surface-primary)] px-3.5 py-2.5", "text-16 leading-5 md:text-14 md:leading-5 text-[var(--text-primary)] placeholder:text-[var(--text-muted)]", "transition-colors duration-150 ease-out outline-none", "hover:border-[var(--text-muted)]", "focus-visible:border-[var(--primary)] focus-visible:ring-2 focus-visible:ring-[var(--primary)]/20", "aria-invalid:border-[var(--error)] aria-invalid:hover:border-[var(--error)] aria-invalid:focus-visible:border-[var(--error)] aria-invalid:focus-visible:ring-[var(--error)]/20", "data-[invalid]:border-[var(--error)] data-[invalid]:hover:border-[var(--error)] data-[invalid]:focus-visible:border-[var(--error)] data-[invalid]:focus-visible:ring-[var(--error)]/20", "disabled:cursor-not-allowed disabled:opacity-50");
21
21
  /** How close to the limit the count turns red: the last 10%, at most 50 characters. */
22
22
  function nearLimit(length, max) {
23
23
  return max - length <= Math.min(50, Math.ceil(max * 0.1));
@@ -73,6 +73,6 @@ function Textarea({ rows = 3, maxRows = 10, maxLength, className, value, default
73
73
  setTyped(e.target.value.length);
74
74
  fit();
75
75
  } }));
76
- } }), maxLength !== undefined ? (_jsxs("p", { id: countId, "data-slot": "textarea-count", className: cn("self-end text-[12px] tabular-nums", warn ? "text-[var(--danger-text)]" : "text-[var(--text-muted)]"), children: [_jsxs("span", { "aria-hidden": "true", children: [length, "/", maxLength] }), _jsx("span", { className: "sr-only", children: `${remaining} of ${maxLength} characters left` })] })) : null, maxLength !== undefined ? (_jsx("span", { className: "sr-only", "aria-live": "polite", children: warn ? (remaining === 0 ? "Character limit reached" : `${remaining} characters left`) : "" })) : null] }));
76
+ } }), maxLength !== undefined ? (_jsxs("p", { id: countId, "data-slot": "textarea-count", className: cn("self-end text-12 leading-[1.625] tabular-nums", warn ? "text-[var(--danger-text)]" : "text-[var(--text-muted)]"), children: [_jsxs("span", { "aria-hidden": "true", children: [length, "/", maxLength] }), _jsx("span", { className: "sr-only", children: `${remaining} of ${maxLength} characters left` })] })) : null, maxLength !== undefined ? (_jsx("span", { className: "sr-only", "aria-live": "polite", children: warn ? (remaining === 0 ? "Character limit reached" : `${remaining} characters left`) : "" })) : null] }));
77
77
  }
78
78
  export { Textarea };
@@ -1,13 +1,17 @@
1
1
  type ToastVariant = "success" | "error";
2
+ type ToastOptions = {
3
+ /** A second, smaller line with detail the message can't hold: "12 couldn't be matched to a known firm". */
4
+ description?: string;
5
+ };
2
6
  declare const toast: {
3
7
  /** A past-tense confirmation: "Intro sent". */
4
- success: (message: string) => string;
5
- /** Something that failed out of sight: "Couldn't copy the link". Errors people must fix stay on the page. */
6
- error: (message: string) => string;
8
+ success: (message: string, options?: ToastOptions) => string;
9
+ /** Something that failed out of sight: "Couldn't copy the link". Stays 6 seconds. Errors people must fix stay on the page. */
10
+ error: (message: string, options?: ToastOptions) => string;
7
11
  /** Hide one toast, or all of them. */
8
12
  close: (id?: string) => void;
9
13
  };
10
- /** Mount once in the app's root layout. Toasts last 3 seconds; at most 3 show at once. */
14
+ /** Mount once in the app's root layout. Toasts last 3 seconds (errors 6); at most 3 show at once. */
11
15
  declare function Toaster({ timeout }: {
12
16
  timeout?: number;
13
17
  }): import("react").JSX.Element;
@@ -22,4 +26,4 @@ type ToastProps = {
22
26
  */
23
27
  declare function Toast({ open, message, variant }: ToastProps): import("react").JSX.Element;
24
28
  export { Toast, Toaster, toast };
25
- export type { ToastProps, ToastVariant };
29
+ export type { ToastOptions, ToastProps, ToastVariant };
@@ -6,11 +6,13 @@ import { AlertCircle, Check } from "lucide-react";
6
6
  import { cn } from "@brdgapp/ui/lib/utils";
7
7
  /** The app-wide toast queue. Needs one `<Toaster />` mounted. */
8
8
  const manager = ToastPrimitive.createToastManager();
9
+ /** Errors stay twice as long as the default 3 seconds: they are longer and matter more. */
10
+ const ERROR_TIMEOUT = 6000;
9
11
  const toast = {
10
12
  /** A past-tense confirmation: "Intro sent". */
11
- success: (message) => manager.add({ title: message, type: "success" }),
12
- /** Something that failed out of sight: "Couldn't copy the link". Errors people must fix stay on the page. */
13
- error: (message) => manager.add({ title: message, type: "error", priority: "high" }),
13
+ success: (message, options) => manager.add({ title: message, description: options?.description, type: "success" }),
14
+ /** Something that failed out of sight: "Couldn't copy the link". Stays 6 seconds. Errors people must fix stay on the page. */
15
+ error: (message, options) => manager.add({ title: message, description: options?.description, type: "error", priority: "high", timeout: ERROR_TIMEOUT }),
14
16
  /** Hide one toast, or all of them. */
15
17
  close: (id) => manager.close(id),
16
18
  };
@@ -19,10 +21,13 @@ function ToastList() {
19
21
  const { toasts } = ToastPrimitive.useToastManager();
20
22
  return toasts.map((t) => {
21
23
  const Icon = t.type === "error" ? AlertCircle : Check;
22
- return (_jsxs(ToastPrimitive.Root, { toast: t, swipeDirection: "up", "data-slot": "toast", className: cn("pointer-events-auto inline-flex items-center gap-2 rounded-full border border-[var(--border-default)] bg-[var(--surface-elevated)] py-2 pr-4 pl-3 shadow-[var(--shadow-menu)]", "transition-[opacity,translate] duration-200 ease-out data-[ending-style]:duration-150 data-[starting-style]:-translate-y-2 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"), children: [_jsx(Icon, { "aria-hidden": "true", className: cn("size-4 shrink-0", t.type === "error" ? "text-[var(--danger-text)]" : "text-[var(--success)]") }), _jsx(ToastPrimitive.Title, { className: "text-[13px] font-semibold text-[var(--text-primary)]" })] }, t.id));
24
+ const twoLines = Boolean(t.description);
25
+ return (_jsxs(ToastPrimitive.Root, { toast: t, swipeDirection: "up", "data-slot": "toast", className: cn("pointer-events-auto inline-flex gap-2 border border-[var(--border-default)] bg-[var(--surface-elevated)] pr-4 pl-3 shadow-[var(--shadow-menu)]",
26
+ // One line is a pill; with a second line it becomes a rounded box, the icon level with the first line.
27
+ twoLines ? "max-w-sm items-start rounded-xl py-2.5" : "items-center rounded-full py-2", "transition-[opacity,translate] duration-200 ease-out data-[ending-style]:duration-150 data-[starting-style]:-translate-y-2 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"), children: [_jsx("span", { className: "flex h-[1.21875rem] shrink-0 items-center", children: _jsx(Icon, { "aria-hidden": "true", className: cn("size-4", t.type === "error" ? "text-[var(--danger-text)]" : "text-[var(--success)]") }) }), _jsxs("span", { className: "min-w-0", children: [_jsx(ToastPrimitive.Title, { render: _jsx("p", {}), className: "text-13 leading-normal font-semibold text-[var(--text-primary)]" }), twoLines ? _jsx(ToastPrimitive.Description, { render: _jsx("p", {}), className: "text-12 leading-normal text-[var(--text-muted)]" }) : null] })] }, t.id));
23
28
  });
24
29
  }
25
- /** Mount once in the app's root layout. Toasts last 3 seconds; at most 3 show at once. */
30
+ /** Mount once in the app's root layout. Toasts last 3 seconds (errors 6); at most 3 show at once. */
26
31
  function Toaster({ timeout = 3000 }) {
27
32
  return (_jsx(ToastPrimitive.Provider, { toastManager: manager, timeout: timeout, limit: 3, children: _jsx(ToastPrimitive.Portal, { children: _jsx(ToastPrimitive.Viewport, { "data-slot": "toaster", className: VIEWPORT, children: _jsx(ToastList, {}) }) }) }));
28
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brdgapp/ui",
3
- "version": "1.0.0",
3
+ "version": "1.1.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",
@@ -33,11 +33,13 @@
33
33
  --surface-primary: #FFFFFF;
34
34
  --surface-secondary: #F9F9FA;
35
35
  --surface-tertiary: #F2F3F5;
36
+ --skeleton: #F2F3F5; /* loading placeholders (Bridge OS's grey) */
36
37
  --surface-elevated: #FFFFFF;
37
38
 
38
39
  /* Borders */
39
40
  --border-default: #ECEDF0;
40
41
  --border-hover: #D9DBE1;
42
+ --border-field: #A3A7B5; /* Text fields' edge: 2.4:1 on white. 3:1 (#878C9D, 2026-11-04) looked too heavy on long forms; one step lighter picked by Aman 2026-11-05. The label, and the darker hover and focus edges, mark the field. */
41
43
  --border-divider: #F2F3F5;
42
44
 
43
45
  /* Text */
@@ -91,6 +93,7 @@
91
93
  /* Accent: Honey — the alum/outline sticker hue (Arch "Solid label / Warning"). Distinct from
92
94
  --warning (amber #F59E0B): honey is the darker Arch value used for the ALUM badge outline. */
93
95
  --honey: #E19500;
96
+ --honey-text: #9A6B00; /* Honey for text on light surfaces: 4.7:1 on white (honey itself is 2.5). Decision 2026-11-04. */
94
97
 
95
98
  /* Avatar badges — the same in both themes: they mark the person, not the page. The white mark
96
99
  on each passes 3:1 (super connector 3.3–6.0, warning 3.6). */
@@ -147,11 +150,13 @@
147
150
  --surface-primary: #0B0F1A;
148
151
  --surface-secondary: #111627;
149
152
  --surface-tertiary: #1A2035;
153
+ --skeleton: #283049; /* lighter than surfaces, so lines show on cards */
150
154
  --surface-elevated: #151B2E;
151
155
 
152
156
  /* Borders */
153
157
  --border-default: #252D44;
154
158
  --border-hover: #3A4460;
159
+ --border-field: #565D78;
155
160
  --border-divider: #1E2640;
156
161
 
157
162
  /* Text */
@@ -203,6 +208,7 @@
203
208
 
204
209
  /* Accent: Honey (alum/outline sticker) — lightened for dark surfaces */
205
210
  --honey: #F5C451;
211
+ --honey-text: #F5C451;
206
212
 
207
213
  /* Avatar badges — the same in both themes: they mark the person, not the page. The white mark
208
214
  on each passes 3:1 (super connector 3.3–6.0, warning 3.6). */
@@ -314,9 +320,13 @@ body {
314
320
  a mouse click. A component's own `outline-none` + ring wins over it. Solid, not 40%, so it clears WCAG's
315
321
  3:1 (7:1 light, 5:1 dark); decided 2026-11-03. Bridge OS's global `:focus-visible { outline: none }` is
316
322
  not copied: it hid focus on anything without its own ring. */
317
- :where(a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"]), [role="button"]):focus-visible {
318
- outline: 2px solid var(--primary);
319
- outline-offset: 2px;
323
+ /* In the base layer, so a component's own `outline-none` (a utility) wins; outside a layer this rule beat every
324
+ utility and drew a second outline on top of components' rings (fixed 2026-11-04). */
325
+ @layer base {
326
+ :where(a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"]), [role="button"]):focus-visible {
327
+ outline: 2px solid var(--primary);
328
+ outline-offset: 2px;
329
+ }
320
330
  }
321
331
 
322
332
  /* SkipLink: off screen until it has keyboard focus, then top-left above everything. */
@@ -357,6 +367,8 @@ body {
357
367
  *::before,
358
368
  *::after {
359
369
  animation-duration: 0.01ms !important;
370
+ /* Play once and stop: a looping animation cut to 0.01ms flickers (a skeleton's pulse did). */
371
+ animation-iteration-count: 1 !important;
360
372
  transition-duration: 0.01ms !important;
361
373
  }
362
374
  }
@@ -499,6 +511,8 @@ body {
499
511
  /* Here, not in Tailwind classes, because the glass rule outranks Tailwind's background, border and
500
512
  shadow classes. A clickable card has an invisible link or button (the cover) across it; the content
501
513
  sits on top and lets clicks fall through to the cover, except its own controls. */
514
+ /* Avatars on a card ring themselves in the card's surface, not the page's. */
515
+ [data-slot="card"] { --avatar-ring: var(--surface-elevated); }
502
516
  [data-slot="card"] > [data-card-cover] {
503
517
  position: absolute;
504
518
  inset: 0;
@@ -543,12 +557,21 @@ body {
543
557
  linear-gradient(color-mix(in srgb, var(--primary) 5%, transparent), color-mix(in srgb, var(--primary) 5%, transparent)),
544
558
  var(--glass-bg);
545
559
  }
560
+ /* The open card deepens a little on hover, so the pointer still shows. */
561
+ .liquid-glass[data-slot="card"][data-selected][data-clickable]:not([data-disabled]):hover {
562
+ background:
563
+ linear-gradient(color-mix(in srgb, var(--primary) 9%, transparent), color-mix(in srgb, var(--primary) 9%, transparent)),
564
+ var(--glass-bg);
565
+ }
546
566
  [data-slot="card"][data-bare][data-clickable]:not([data-disabled]):not([data-selected]):hover {
547
567
  background: var(--surface-secondary);
548
568
  }
549
569
  [data-slot="card"][data-bare][data-selected] {
550
570
  background: color-mix(in srgb, var(--primary) 6%, transparent);
551
571
  }
572
+ [data-slot="card"][data-bare][data-selected][data-clickable]:not([data-disabled]):hover {
573
+ background: color-mix(in srgb, var(--primary) 10%, transparent);
574
+ }
552
575
 
553
576
  /* Ensure content sits above the highlight */
554
577
  .liquid-glass > * {