@brdgapp/ui 1.1.0 → 1.2.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,24 @@
2
2
 
3
3
  Every release of `@brdgapp/ui`. Versions follow the rules in README.md → Versions.
4
4
 
5
+ ## 1.2.0
6
+
7
+ 2026-11-06. A new component and new tokens. Nothing changes for apps already on 1.1, so they can update
8
+ without changes.
9
+
10
+ - New: Chart (`components/chart`), for line, bar and area charts with Recharts. `ChartContainer` with
11
+ `ChartGrid`, `ChartXAxis`, `ChartYAxis`, `ChartTooltip`, `ChartLegend`, `ChartSkeleton` and `useChartMotion`.
12
+ Recharts (3.8 or newer) is an optional peer dependency: install it only in an app that draws charts.
13
+ - New tokens: `--chart-1` to `--chart-5`, the chart colours in order (Royal, Teal, Amber, Purple, Slate), for
14
+ light and dark.
15
+
16
+ ## 1.1.1
17
+
18
+ 2026-11-06. A fix that changes nothing an app relies on.
19
+
20
+ - `<Toaster />` warns in the browser console, once and only in development, when the app hasn't loaded Mulish
21
+ (`lib/font-check`). The README makes loading Mulish a required setup step.
22
+
5
23
  ## 1.1.0
6
24
 
7
25
  2026-11-06. Changes from reviewing every component's handbook page. Nothing is renamed or removed, so apps on
package/README.md CHANGED
@@ -7,7 +7,8 @@ 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
+ - Recharts 3.8 or newer, only if the app draws charts (`npm install recharts`). Chart is the one part that needs it.
11
12
 
12
13
  ## Set up
13
14
 
@@ -25,13 +26,24 @@ In the app's main CSS file, after Tailwind:
25
26
  That brings every token (light and dark), the base styles, and tells Tailwind to read the package's
26
27
  files, so its classes are included.
27
28
 
28
- Load Mulish however the app loads fonts. With `next/font`, name the variable `--font-mulish`:
29
+ **Then load Mulish. This step is required.** The base styles ask for Mulish, but the app has to load the
30
+ font; without it, text falls back to the device's font. If the app uses another font (VAG Rounded, Inter,
31
+ Geist) or none, switch it to Mulish and remove the old one.
32
+
33
+ In Next.js, with `next/font`, name the variable `--font-mulish` and put it on `<html>`:
29
34
 
30
35
  ```ts
36
+ import { Mulish } from "next/font/google";
31
37
  const mulish = Mulish({ subsets: ["latin"], variable: "--font-mulish" });
38
+ // <html lang="en" className={mulish.variable}>
32
39
  ```
33
40
 
34
- Anything else (a Google Fonts link, a self-hosted file) works too, as long as the family is "Mulish".
41
+ In Vite or anything else: `npm install @fontsource/mulish`, then import `@fontsource/mulish/400.css`, `500.css`,
42
+ `600.css` and `700.css` once in the entry file. A Google Fonts link or a self-hosted file also works, as long
43
+ as the family is "Mulish".
44
+
45
+ If Mulish doesn't load, `<Toaster />` says so in the browser console while you develop, and the handbook's
46
+ `check_code` flags a root layout that doesn't load it.
35
47
 
36
48
  Themes follow `data-theme="light"` or `data-theme="dark"` on `<html>`, not the device setting.
37
49
 
@@ -0,0 +1,55 @@
1
+ import * as React from "react";
2
+ import * as Recharts from "recharts";
3
+ /** A chart colour: the five come in order, and a chart with one series uses the first. */
4
+ export type ChartColor = "var(--chart-1)" | "var(--chart-2)" | "var(--chart-3)" | "var(--chart-4)" | "var(--chart-5)";
5
+ /** One entry per series. Keys match the series `dataKey`. */
6
+ export type ChartConfig = Record<string, {
7
+ label: string;
8
+ color: ChartColor;
9
+ }>;
10
+ type ChartContainerProps = {
11
+ /** One entry per series: its label and chart colour. */
12
+ config: ChartConfig;
13
+ /** What the chart shows, in one sentence, for screen readers: "Intros per week, 12 weeks, 148 in all." */
14
+ summary: string;
15
+ /** Height in px. Width always fills the space. */
16
+ height?: number;
17
+ /** One Recharts chart: `BarChart`, `LineChart` or `AreaChart`. */
18
+ children: React.ReactElement;
19
+ /** Layout only (margins, grid placement). */
20
+ className?: string;
21
+ };
22
+ /** Wraps one Recharts chart: colours, sizing, the screen-reader summary and the keyboard read-out. */
23
+ declare function ChartContainer({ config, summary, height, children, className }: ChartContainerProps): React.JSX.Element;
24
+ /** Horizontal rules only. */
25
+ declare function ChartGrid(props: React.ComponentProps<typeof Recharts.CartesianGrid>): React.JSX.Element;
26
+ /** The category axis along the base: no tick or axis lines, labels thinned so they never collide. */
27
+ declare function ChartXAxis(props: React.ComponentProps<typeof Recharts.XAxis>): React.JSX.Element;
28
+ /** The value axis: no tick or axis lines, a fixed width so charts in a row line up. */
29
+ declare function ChartYAxis(props: React.ComponentProps<typeof Recharts.YAxis>): React.JSX.Element;
30
+ type ChartTooltipContentProps = {
31
+ /** Rewrites the category label: `(label) => \`Week of ${label}\``. */
32
+ labelFormatter?: (label: string) => string;
33
+ /** Formats each value. Defaults to the full number with commas (1,284). Use `formatMoney` for money. */
34
+ valueFormatter?: (value: number) => string;
35
+ /** Hides the category label (when the series names say it all). */
36
+ hideLabel?: boolean;
37
+ };
38
+ /** The tooltip, on hover and as the arrow keys move through the chart. */
39
+ declare function ChartTooltip({ labelFormatter, valueFormatter, hideLabel, ...props }: ChartTooltipContentProps & Omit<React.ComponentProps<typeof Recharts.Tooltip>, "content" | "labelFormatter">): React.JSX.Element;
40
+ /** Names each series under the chart. Leave it out when there's one series: the title names it. */
41
+ declare function ChartLegend(props: Omit<React.ComponentProps<typeof Recharts.Legend>, "content">): React.JSX.Element;
42
+ /**
43
+ * Spread onto each series: `<Bar {...motion} />`. Series grow in over 300ms, once, and not at all under
44
+ * reduced motion. Recharts' own default is 1.5s on every series.
45
+ */
46
+ declare function useChartMotion(): {
47
+ isAnimationActive: boolean;
48
+ animationDuration: number;
49
+ animationEasing: "ease-out";
50
+ };
51
+ /** The loading chart: one grey block, the same height as the chart, so nothing jumps when data arrives. */
52
+ declare function ChartSkeleton({ height }: {
53
+ height?: number;
54
+ }): React.JSX.Element;
55
+ export { ChartContainer, ChartGrid, ChartXAxis, ChartYAxis, ChartTooltip, ChartLegend, ChartSkeleton, useChartMotion };
@@ -0,0 +1,137 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // Line, bar and area charts, drawn with Recharts in Bridge's look. Seven apps already draw charts with
4
+ // Recharts, each with its own hex colours; this is the one way now (decision 2026-11-06).
5
+ //
6
+ // `ChartContainer` names each series and gives it a chart colour, in order: Royal, Teal, Amber, Purple,
7
+ // Slate (`--chart-1` … `--chart-5`). It writes `--color-<key>` for lines and bars and `--fade-<key>` for
8
+ // the soft fade under an area. Its styles set the grid, ticks, line width and dots, so Recharts' defaults
9
+ // never show. The parts below (`ChartGrid`, `ChartXAxis`, `ChartYAxis`, `ChartTooltip`, `ChartLegend`)
10
+ // come set up; pass Recharts props to change data, not the look.
11
+ //
12
+ // Recharts is an optional peer dependency: install it (`npm install recharts`) only if the app draws charts.
13
+ import * as React from "react";
14
+ import * as Recharts from "recharts";
15
+ import { skeletonVariants } from "@brdgapp/ui/components/skeleton";
16
+ import { cn } from "@brdgapp/ui/lib/utils";
17
+ const ChartContext = React.createContext(null);
18
+ function useChart() {
19
+ const ctx = React.useContext(ChartContext);
20
+ if (!ctx)
21
+ throw new Error("Chart parts must sit inside <ChartContainer>.");
22
+ return ctx;
23
+ }
24
+ // Keys become CSS variable names and SVG ids, so keep only safe characters.
25
+ const safe = (key) => key.replace(/[^a-zA-Z0-9_-]/g, "_");
26
+ // Where a series sits in `config`; anything not in it goes last.
27
+ const rankIn = (config, key) => {
28
+ const i = Object.keys(config).indexOf(key);
29
+ return i === -1 ? Number.MAX_SAFE_INTEGER : i;
30
+ };
31
+ // The container's styles: Bridge's grid, ticks, cursor, line width and dots, whatever props a chart passes.
32
+ const CHART_STYLES = [
33
+ "relative w-full text-12 tabular-nums",
34
+ "[&_.recharts-cartesian-axis-tick-value]:fill-[var(--text-muted)]",
35
+ "[&_.recharts-cartesian-grid_line]:stroke-[var(--border-default)]",
36
+ "[&_.recharts-reference-line_line]:stroke-[var(--text-muted)]",
37
+ "[&_.recharts-reference-line_text]:fill-[var(--text-muted)]",
38
+ "[&_.recharts-curve.recharts-tooltip-cursor]:stroke-[var(--border-hover)]",
39
+ "[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-[var(--surface-tertiary)]",
40
+ // Lines are 2px with no dots; the hovered point still shows its dot.
41
+ "[&_.recharts-line-curve]:stroke-2 [&_.recharts-area-curve]:stroke-2 [&_.recharts-line-dots]:hidden [&_.recharts-area-dots]:hidden",
42
+ "[&_.recharts-active-dot_.recharts-dot]:stroke-[var(--surface-elevated)] [&_.recharts-active-dot_.recharts-dot]:stroke-2",
43
+ "[&_.recharts-area-area]:[fill-opacity:1]",
44
+ // Recharts makes the chart a tab stop. Show where focus is, as every control does.
45
+ "[&_.recharts-wrapper]:outline-none [&_.recharts-surface]:outline-none [&_.recharts-layer]:outline-none [&_.recharts-sector]:outline-none",
46
+ "[&_.recharts-surface:focus-visible]:outline-2 [&_.recharts-surface:focus-visible]:outline-offset-2 [&_.recharts-surface:focus-visible]:outline-solid [&_.recharts-surface:focus-visible]:outline-[var(--primary)] [&_.recharts-surface]:rounded-sm",
47
+ ].join(" ");
48
+ /** Wraps one Recharts chart: colours, sizing, the screen-reader summary and the keyboard read-out. */
49
+ function ChartContainer({ config, summary, height = 240, children, className }) {
50
+ const id = `chart-${React.useId().replace(/[^a-zA-Z0-9]/g, "")}`;
51
+ const root = React.useRef(null);
52
+ const [announcement, setAnnouncement] = React.useState("");
53
+ const value = React.useMemo(() => ({ config, announce: setAnnouncement, root }), [config]);
54
+ const keys = Object.keys(config);
55
+ const css = keys.map((key) => `--color-${safe(key)}: ${config[key].color}; --fade-${safe(key)}: url(#${id}-fade-${safe(key)});`).join(" ");
56
+ return (_jsx(ChartContext.Provider, { value: value, children: _jsxs("div", { ref: root, "data-slot": "chart", "data-chart": id, role: "figure", "aria-label": summary, className: cn(CHART_STYLES, className), style: { height }, children: [_jsx("style", { children: `[data-chart="${id}"] { ${css} }` }), _jsx("svg", { "aria-hidden": "true", width: "0", height: "0", className: "absolute", children: _jsx("defs", { children: keys.map((key) => (_jsxs("linearGradient", { id: `${id}-fade-${safe(key)}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [_jsx("stop", { offset: "0%", stopColor: `var(--color-${safe(key)})`, stopOpacity: 0.3 }), _jsx("stop", { offset: "100%", stopColor: `var(--color-${safe(key)})`, stopOpacity: 0 })] }, key))) }) }), _jsx(Recharts.ResponsiveContainer, { width: "100%", height: "100%", initialDimension: { width: 320, height }, children: children }), _jsx("div", { "aria-live": "polite", className: "sr-only", children: announcement })] }) }));
57
+ }
58
+ /** Horizontal rules only. */
59
+ function ChartGrid(props) {
60
+ return _jsx(Recharts.CartesianGrid, { vertical: false, ...props });
61
+ }
62
+ /** The category axis along the base: no tick or axis lines, labels thinned so they never collide. */
63
+ function ChartXAxis(props) {
64
+ return _jsx(Recharts.XAxis, { tickLine: false, axisLine: false, tickMargin: 8, minTickGap: 24, ...props });
65
+ }
66
+ /** The value axis: no tick or axis lines, a fixed width so charts in a row line up. */
67
+ function ChartYAxis(props) {
68
+ return _jsx(Recharts.YAxis, { tickLine: false, axisLine: false, tickMargin: 4, width: 40, ...props });
69
+ }
70
+ function ChartTooltipContent({ active, payload, label, labelFormatter, valueFormatter = (v) => v.toLocaleString("en-US"), hideLabel = false, }) {
71
+ const { config, announce, root } = useChart();
72
+ const heading = label == null ? "" : labelFormatter ? labelFormatter(String(label)) : String(label);
73
+ const rows = (payload ?? [])
74
+ .filter((item) => item.type !== "none" && item.value != null)
75
+ .map((item) => {
76
+ const key = String(item.dataKey ?? item.name ?? "value");
77
+ const entry = config[key];
78
+ const raw = Array.isArray(item.value) ? item.value[1] : item.value;
79
+ return {
80
+ key,
81
+ label: entry?.label ?? String(item.name ?? key),
82
+ color: entry ? `var(--color-${safe(key)})` : String(item.color ?? "currentColor"),
83
+ value: typeof raw === "number" ? valueFormatter(raw) : String(raw),
84
+ };
85
+ })
86
+ // In the order of `config`, like the legend.
87
+ .sort((a, b) => rankIn(config, a.key) - rankIn(config, b.key));
88
+ const text = active && rows.length ? [hideLabel ? "" : heading, rows.map((r) => `${r.label} ${r.value}`).join(", ")].filter(Boolean).join(": ") : "";
89
+ // Keyboard users step through the chart with the arrow keys; read each point out as it shows.
90
+ React.useEffect(() => {
91
+ if (root.current?.contains(document.activeElement))
92
+ announce(text);
93
+ }, [text, announce, root]);
94
+ if (!active || !rows.length)
95
+ return null;
96
+ return (_jsxs("div", { className: "grid min-w-32 gap-1.5 rounded-lg border border-[var(--border-default)] bg-[var(--surface-elevated)] px-2.5 py-2 text-12 shadow-[var(--shadow-menu)]", children: [!hideLabel && heading ? _jsx("div", { className: "font-semibold text-[var(--text-primary)]", children: heading }) : null, rows.map((row) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { "aria-hidden": "true", className: "size-2 shrink-0 rounded-[2px]", style: { background: row.color } }), _jsx("span", { className: "flex-1 text-[var(--text-secondary)]", children: row.label }), _jsx("span", { className: "font-semibold text-[var(--text-primary)] tabular-nums", children: row.value })] }, row.key)))] }));
97
+ }
98
+ /** The tooltip, on hover and as the arrow keys move through the chart. */
99
+ function ChartTooltip({ labelFormatter, valueFormatter, hideLabel, ...props }) {
100
+ return (_jsx(Recharts.Tooltip, { cursor: true, isAnimationActive: false, ...props, content: (p) => (_jsx(ChartTooltipContent, { active: p.active, payload: p.payload, label: p.label, labelFormatter: labelFormatter, valueFormatter: valueFormatter, hideLabel: hideLabel })) }));
101
+ }
102
+ function ChartLegendContent({ payload }) {
103
+ const { config } = useChart();
104
+ if (!payload?.length)
105
+ return null;
106
+ // In the order of `config`, which is the order of the series and of a stack.
107
+ const rank = (item) => rankIn(config, String(item.dataKey ?? item.value));
108
+ return (_jsx("ul", { className: "flex flex-wrap items-center justify-center gap-x-4 gap-y-1 pt-3 text-12 text-[var(--text-secondary)]", children: [...payload]
109
+ .filter((item) => item.type !== "none")
110
+ .sort((a, b) => rank(a) - rank(b))
111
+ .map((item) => {
112
+ const key = String(item.dataKey ?? item.value);
113
+ return (_jsxs("li", { className: "flex items-center gap-1.5", children: [_jsx("span", { "aria-hidden": "true", className: "size-2 shrink-0 rounded-[2px]", style: { background: config[key] ? `var(--color-${safe(key)})` : item.color } }), config[key]?.label ?? String(item.value)] }, key));
114
+ }) }));
115
+ }
116
+ /** Names each series under the chart. Leave it out when there's one series: the title names it. */
117
+ function ChartLegend(props) {
118
+ return _jsx(Recharts.Legend, { verticalAlign: "bottom", itemSorter: null, ...props, content: (p) => _jsx(ChartLegendContent, { payload: p.payload }) });
119
+ }
120
+ const subscribeToMotion = (onChange) => {
121
+ const query = window.matchMedia("(prefers-reduced-motion: reduce)");
122
+ query.addEventListener("change", onChange);
123
+ return () => query.removeEventListener("change", onChange);
124
+ };
125
+ /**
126
+ * Spread onto each series: `<Bar {...motion} />`. Series grow in over 300ms, once, and not at all under
127
+ * reduced motion. Recharts' own default is 1.5s on every series.
128
+ */
129
+ function useChartMotion() {
130
+ const reduced = React.useSyncExternalStore(subscribeToMotion, () => window.matchMedia("(prefers-reduced-motion: reduce)").matches, () => true);
131
+ return { isAnimationActive: !reduced, animationDuration: 300, animationEasing: "ease-out" };
132
+ }
133
+ /** The loading chart: one grey block, the same height as the chart, so nothing jumps when data arrives. */
134
+ function ChartSkeleton({ height = 240 }) {
135
+ return _jsx("span", { "aria-hidden": "true", className: cn(skeletonVariants({ shape: "block" }), "w-full"), style: { height } });
136
+ }
137
+ export { ChartContainer, ChartGrid, ChartXAxis, ChartYAxis, ChartTooltip, ChartLegend, ChartSkeleton, useChartMotion };
@@ -11,7 +11,10 @@ declare const toast: {
11
11
  /** Hide one toast, or all of them. */
12
12
  close: (id?: string) => void;
13
13
  };
14
- /** Mount once in the app's root layout. Toasts last 3 seconds (errors 6); at most 3 show at once. */
14
+ /**
15
+ * Mount once in the app's root layout. Toasts last 3 seconds (errors 6); at most 3 show at once. Being in
16
+ * every app's root, it also checks in development that the app loaded Mulish (see lib/font-check).
17
+ */
15
18
  declare function Toaster({ timeout }: {
16
19
  timeout?: number;
17
20
  }): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useState } from "react";
4
+ import { checkMulishLoaded } from "@brdgapp/ui/lib/font-check";
4
5
  import { Toast as ToastPrimitive } from "@base-ui/react/toast";
5
6
  import { AlertCircle, Check } from "lucide-react";
6
7
  import { cn } from "@brdgapp/ui/lib/utils";
@@ -27,8 +28,12 @@ function ToastList() {
27
28
  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));
28
29
  });
29
30
  }
30
- /** Mount once in the app's root layout. Toasts last 3 seconds (errors 6); at most 3 show at once. */
31
+ /**
32
+ * Mount once in the app's root layout. Toasts last 3 seconds (errors 6); at most 3 show at once. Being in
33
+ * every app's root, it also checks in development that the app loaded Mulish (see lib/font-check).
34
+ */
31
35
  function Toaster({ timeout = 3000 }) {
36
+ useEffect(checkMulishLoaded, []);
32
37
  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, {}) }) }) }));
33
38
  }
34
39
  /**
@@ -0,0 +1,3 @@
1
+ /** Warns in the console, once and only in development, when no Mulish font has loaded. */
2
+ declare function checkMulishLoaded(): void;
3
+ export { checkMulishLoaded };
@@ -0,0 +1,31 @@
1
+ // Every Bridge app sets its text in Mulish (rule "One typeface", 2026-11-06). The package's base styles ask
2
+ // for Mulish, but the app has to load the font file; without it, text quietly falls back to the device's
3
+ // font. So in development, once the page's fonts have settled, this checks that a Mulish face actually
4
+ // loaded and says how to fix it if not. Agents testing an app in a browser read the console too.
5
+ // It never runs in production, and never twice. Any way of loading works: next/font (its faces are named
6
+ // "__Mulish_…"), Fontsource, a Google Fonts link or a self-hosted file.
7
+ let checked = false;
8
+ function isDevelopment() {
9
+ // Bundlers (Next, Vite) replace `process.env.NODE_ENV`; where nothing does, `process` may not exist.
10
+ try {
11
+ return process.env.NODE_ENV !== "production";
12
+ }
13
+ catch {
14
+ return false;
15
+ }
16
+ }
17
+ /** Warns in the console, once and only in development, when no Mulish font has loaded. */
18
+ function checkMulishLoaded() {
19
+ if (checked || typeof document === "undefined" || !document.fonts || !isDevelopment())
20
+ return;
21
+ checked = true;
22
+ void document.fonts.ready.then(() => {
23
+ const loaded = Array.from(document.fonts).some((face) => /mulish/i.test(face.family) && face.status === "loaded");
24
+ if (loaded)
25
+ return;
26
+ console.warn("@brdgapp/ui: Mulish isn't loaded, so text is falling back to the device's font. Every Bridge app uses Mulish. " +
27
+ 'Load it once in the root layout: next/font (Mulish with variable "--font-mulish") or @fontsource/mulish (400, 500, 600, 700). ' +
28
+ "Setup: https://handbook.brdg.app/migrating#install");
29
+ });
30
+ }
31
+ export { checkMulishLoaded };
package/lib/motion.d.ts CHANGED
@@ -11,6 +11,6 @@ export declare const DURATION: {
11
11
  export declare const EASE: readonly [0.23, 1, 0.32, 1];
12
12
  /** A ready-made transition for Framer Motion: `transition={transition("base")}`. */
13
13
  export declare function transition(speed?: keyof typeof DURATION): {
14
- duration: 0.15 | 0.2 | 0.3;
14
+ duration: 0.3 | 0.15 | 0.2;
15
15
  ease: readonly [0.23, 1, 0.32, 1];
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brdgapp/ui",
3
- "version": "1.1.0",
3
+ "version": "1.2.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",
@@ -39,6 +39,12 @@
39
39
  "peerDependencies": {
40
40
  "react": ">=19",
41
41
  "react-dom": ">=19",
42
- "tailwindcss": ">=4"
42
+ "tailwindcss": ">=4",
43
+ "recharts": ">=3.8"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "recharts": {
47
+ "optional": true
48
+ }
43
49
  }
44
50
  }
@@ -95,6 +95,14 @@
95
95
  --honey: #E19500;
96
96
  --honey-text: #9A6B00; /* Honey for text on light surfaces: 4.7:1 on white (honey itself is 2.5). Decision 2026-11-04. */
97
97
 
98
+ /* Chart series — used in this order, Royal first (decision 2026-11-06). Each passes 3:1 on white and
99
+ --surface-secondary, and every pair stays apart under protan, deutan and tritan simulation. */
100
+ --chart-1: #0038FF; /* Royal */
101
+ --chart-2: #0E9384; /* Teal */
102
+ --chart-3: #C27A00; /* Amber */
103
+ --chart-4: #A855F7; /* Purple */
104
+ --chart-5: #4B5267; /* Slate */
105
+
98
106
  /* Avatar badges — the same in both themes: they mark the person, not the page. The white mark
99
107
  on each passes 3:1 (super connector 3.3–6.0, warning 3.6). */
100
108
  --super-connector-from: #6A3AF3;
@@ -210,6 +218,13 @@
210
218
  --honey: #F5C451;
211
219
  --honey-text: #F5C451;
212
220
 
221
+ /* Chart series — lightened for dark surfaces: each passes 3:1 on --surface-primary and --surface-secondary. */
222
+ --chart-1: #4D7AFF;
223
+ --chart-2: #2DD4BF;
224
+ --chart-3: #F5C451;
225
+ --chart-4: #C4A1FF;
226
+ --chart-5: #6B7189;
227
+
213
228
  /* Avatar badges — the same in both themes: they mark the person, not the page. The white mark
214
229
  on each passes 3:1 (super connector 3.3–6.0, warning 3.6). */
215
230
  --super-connector-from: #6A3AF3;