@robr0/design-system 0.10.0 → 0.11.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 (93) hide show
  1. package/README.md +7 -6
  2. package/components/AgentPlan/AgentPlan.css +14 -3
  3. package/components/AiButton/AiButton.css +1 -1
  4. package/components/Alert/Alert.css +9 -0
  5. package/components/AlertDialog/AlertDialog.css +3 -1
  6. package/components/AlertDialog/AlertDialog.js +2 -3
  7. package/components/AppSidebar/AppSidebar.css +9 -0
  8. package/components/Card/Card.css +7 -2
  9. package/components/CardStack/CardStack.css +106 -0
  10. package/components/CardStack/CardStack.d.ts +44 -0
  11. package/components/CardStack/CardStack.js +140 -0
  12. package/components/Carousel/Carousel.css +9 -0
  13. package/components/Carousel/Carousel.js +37 -4
  14. package/components/Chart/AreaChart.js +6 -5
  15. package/components/Chart/LineChart.js +4 -3
  16. package/components/Chart/PieChart.js +2 -15
  17. package/components/Chart/RadarChart.js +5 -4
  18. package/components/Chart/RadialChart.js +2 -15
  19. package/components/Chart/ScatterChart.js +3 -13
  20. package/components/Chart/StackedBarChart.js +2 -15
  21. package/components/Chart/Treemap.js +3 -17
  22. package/components/Chart/palette.d.ts +1 -0
  23. package/components/Chart/palette.js +19 -0
  24. package/components/ChatMarker/ChatMarker.css +9 -0
  25. package/components/ChatMessage/ChatMessage.css +16 -0
  26. package/components/ChatThread/ChatThread.js +2 -2
  27. package/components/Chip/Chip.css +9 -0
  28. package/components/CodeBlock/CodeBlock.css +10 -1
  29. package/components/CodeBlock/CodeBlock.js +2 -1
  30. package/components/ColorPicker/ColorPicker.js +10 -0
  31. package/components/Combobox/Combobox.css +9 -0
  32. package/components/CommandPalette/CommandPalette.css +9 -0
  33. package/components/CommandPalette/CommandPalette.js +31 -5
  34. package/components/Composer/Composer.css +118 -0
  35. package/components/Composer/Composer.d.ts +7 -0
  36. package/components/Composer/Composer.js +7 -1
  37. package/components/ContactCard/ContactCard.css +9 -0
  38. package/components/ContextMenu/ContextMenu.js +39 -3
  39. package/components/DatePicker/DatePicker.js +16 -0
  40. package/components/Dialog/Dialog.css +3 -1
  41. package/components/Dialog/Dialog.js +5 -4
  42. package/components/DocumentChip/DocumentChip.css +9 -0
  43. package/components/Dropdown/Dropdown.js +22 -3
  44. package/components/DropdownMenu/DropdownMenu.js +43 -6
  45. package/components/EmptyState/EmptyState.css +9 -0
  46. package/components/FileInput/FileInput.css +9 -0
  47. package/components/Globe/Globe.css +155 -0
  48. package/components/Globe/Globe.d.ts +96 -0
  49. package/components/Globe/Globe.js +415 -0
  50. package/components/InterruptCard/InterruptCard.css +27 -17
  51. package/components/InterruptCard/InterruptCard.d.ts +1 -1
  52. package/components/InterruptCard/InterruptCard.js +1 -1
  53. package/components/MapCallout/MapCallout.css +46 -0
  54. package/components/MapCallout/MapCallout.d.ts +29 -0
  55. package/components/MapCallout/MapCallout.js +17 -0
  56. package/components/MapLegend/MapLegend.css +88 -0
  57. package/components/MapLegend/MapLegend.d.ts +39 -0
  58. package/components/MapLegend/MapLegend.js +68 -0
  59. package/components/MessageActions/MessageActions.css +9 -0
  60. package/components/MessageCard/MessageCard.css +68 -16
  61. package/components/MessageCard/MessageCard.d.ts +1 -1
  62. package/components/MessageCard/MessageCard.js +6 -4
  63. package/components/ModelPicker/ModelPicker.css +4 -1
  64. package/components/ModelPicker/ModelPicker.js +43 -1
  65. package/components/NotificationCenter/NotificationCenter.css +9 -0
  66. package/components/NotificationCenter/NotificationCenter.js +26 -10
  67. package/components/NumberInput/NumberInput.css +9 -0
  68. package/components/Popover/Popover.css +3 -1
  69. package/components/Popover/Popover.js +2 -1
  70. package/components/SourceChip/SourceChip.css +9 -0
  71. package/components/Stat/Stat.css +9 -0
  72. package/components/Stepper/Stepper.css +9 -0
  73. package/components/TagInput/TagInput.css +9 -0
  74. package/components/TimePicker/TimePicker.js +4 -1
  75. package/components/Toast/Toast.css +32 -11
  76. package/components/Toast/Toast.js +5 -4
  77. package/components/ToggleGroup/ToggleGroup.css +9 -0
  78. package/components/ToolCall/ToolCall.css +18 -6
  79. package/components/Tooltip/Tooltip.js +20 -16
  80. package/components/registry.json +37 -0
  81. package/components/registry.json.d.ts +37 -0
  82. package/components/registry.json.js +2 -2
  83. package/index.d.ts +4 -0
  84. package/index.js +8 -0
  85. package/package.json +5 -1
  86. package/tokens/motion.d.ts +23 -0
  87. package/tokens/motion.js +14 -0
  88. package/tokens/registry.json +17 -0
  89. package/tokens/registry.json.d.ts +17 -0
  90. package/tokens/registry.json.js +1 -1
  91. package/tokens/tokens-dark.css +11 -0
  92. package/tokens/tokens-light.css +11 -0
  93. package/tokens/tokens-typography.css +20 -0
@@ -1,6 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback } from "react";
3
3
  import { ResponsiveContainer, LineChart as LineChart$1, CartesianGrid, XAxis, YAxis, Tooltip, Line } from "recharts";
4
+ import { getChartSeriesColors } from "./palette.js";
4
5
  import "./Chart.css";
5
6
  function getCSSVar(name, fallback) {
6
7
  if (typeof window === "undefined") return fallback;
@@ -31,7 +32,7 @@ const LineChart = ({
31
32
  const classes = [baseClass, className].filter(Boolean).join(" ");
32
33
  const textSecondary = getCSSVar("--color-text-secondary", "#A2A2A2");
33
34
  const gridColor = getCSSVar("--color-divider", "#232323");
34
- const defaultColor = getCSSVar("--color-action-primary-bg", "#0E6E8F");
35
+ const seriesColors = getChartSeriesColors();
35
36
  const renderTooltip = useCallback(
36
37
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
37
38
  (props) => /* @__PURE__ */ jsx(LineChartTooltip, { ...props }),
@@ -68,13 +69,13 @@ const LineChart = ({
68
69
  }
69
70
  ),
70
71
  /* @__PURE__ */ jsx(Tooltip, { content: renderTooltip }),
71
- series.map((s) => /* @__PURE__ */ jsx(
72
+ series.map((s, i) => /* @__PURE__ */ jsx(
72
73
  Line,
73
74
  {
74
75
  type: "monotone",
75
76
  dataKey: s.dataKey,
76
77
  name: s.label,
77
- stroke: s.color || defaultColor,
78
+ stroke: s.color || seriesColors[i % seriesColors.length],
78
79
  strokeWidth: 2,
79
80
  strokeDasharray: s.strokeDasharray,
80
81
  dot: false,
@@ -1,21 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback } from "react";
3
3
  import { ResponsiveContainer, PieChart as PieChart$1, Pie, Cell, Tooltip, Legend } from "recharts";
4
+ import { getChartSeriesColors } from "./palette.js";
4
5
  import "./Chart.css";
5
- function getDefaultColors() {
6
- if (typeof window === "undefined") {
7
- return ["#0E6E8F", "#06D6A0", "#FFD166", "#EF476F", "#9E47EF", "#EF8247"];
8
- }
9
- const get = (v, fb) => getComputedStyle(document.documentElement).getPropertyValue(v).trim() || fb;
10
- return [
11
- get("--color-action-primary-bg", "#0E6E8F"),
12
- get("--color-core-accent-mint", "#06D6A0"),
13
- get("--color-core-accent-gold", "#FFD166"),
14
- get("--color-core-accent-coral", "#EF476F"),
15
- get("--color-core-accent-violet", "#9E47EF"),
16
- get("--color-core-accent-amber", "#EF8247")
17
- ];
18
- }
19
6
  function getCSSVar(name, fallback) {
20
7
  if (typeof window === "undefined") return fallback;
21
8
  return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || fallback;
@@ -48,7 +35,7 @@ const PieChart = ({
48
35
  }) => {
49
36
  const baseClass = "ds-chart";
50
37
  const classes = [baseClass, className].filter(Boolean).join(" ");
51
- const defaultColors = getDefaultColors();
38
+ const defaultColors = getChartSeriesColors();
52
39
  const textSecondary = getCSSVar("--color-text-secondary", "#A2A2A2");
53
40
  const renderTooltip = useCallback(
54
41
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
@@ -1,6 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback } from "react";
3
3
  import { ResponsiveContainer, RadarChart as RadarChart$1, PolarGrid, PolarAngleAxis, PolarRadiusAxis, Tooltip, Radar, Legend } from "recharts";
4
+ import { getChartSeriesColors } from "./palette.js";
4
5
  import "./Chart.css";
5
6
  function getCSSVar(name, fallback) {
6
7
  if (typeof window === "undefined") return fallback;
@@ -31,7 +32,7 @@ const RadarChart = ({
31
32
  const classes = [baseClass, className].filter(Boolean).join(" ");
32
33
  const textSecondary = getCSSVar("--color-text-secondary", "#A2A2A2");
33
34
  const gridColor = getCSSVar("--color-divider", "#232323");
34
- const defaultColor = getCSSVar("--color-action-primary-bg", "#0E6E8F");
35
+ const seriesColors = getChartSeriesColors();
35
36
  const renderTooltip = useCallback(
36
37
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
37
38
  (props) => /* @__PURE__ */ jsx(RadarTooltip, { ...props }),
@@ -66,13 +67,13 @@ const RadarChart = ({
66
67
  }
67
68
  ),
68
69
  /* @__PURE__ */ jsx(Tooltip, { content: renderTooltip }),
69
- series.map((s) => /* @__PURE__ */ jsx(
70
+ series.map((s, i) => /* @__PURE__ */ jsx(
70
71
  Radar,
71
72
  {
72
73
  name: s.label,
73
74
  dataKey: s.dataKey,
74
- stroke: s.color || defaultColor,
75
- fill: s.color || defaultColor,
75
+ stroke: s.color || seriesColors[i % seriesColors.length],
76
+ fill: s.color || seriesColors[i % seriesColors.length],
76
77
  fillOpacity: s.fillOpacity ?? 0.3
77
78
  },
78
79
  s.dataKey
@@ -1,21 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback } from "react";
3
3
  import { ResponsiveContainer, RadialBarChart, PolarAngleAxis, RadialBar, Tooltip, Legend } from "recharts";
4
+ import { getChartSeriesColors } from "./palette.js";
4
5
  import "./Chart.css";
5
- function getDefaultColors() {
6
- if (typeof window === "undefined") {
7
- return ["#0E6E8F", "#06D6A0", "#FFD166", "#EF476F", "#9E47EF", "#EF8247"];
8
- }
9
- const get = (v, fb) => getComputedStyle(document.documentElement).getPropertyValue(v).trim() || fb;
10
- return [
11
- get("--color-action-primary-bg", "#0E6E8F"),
12
- get("--color-core-accent-mint", "#06D6A0"),
13
- get("--color-core-accent-gold", "#FFD166"),
14
- get("--color-core-accent-coral", "#EF476F"),
15
- get("--color-core-accent-violet", "#9E47EF"),
16
- get("--color-core-accent-amber", "#EF8247")
17
- ];
18
- }
19
6
  function getCSSVar(name, fallback) {
20
7
  if (typeof window === "undefined") return fallback;
21
8
  return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || fallback;
@@ -49,7 +36,7 @@ const RadialChart = ({
49
36
  }) => {
50
37
  const baseClass = "ds-chart";
51
38
  const classes = [baseClass, className].filter(Boolean).join(" ");
52
- const defaultColors = getDefaultColors();
39
+ const defaultColors = getChartSeriesColors();
53
40
  const textSecondary = getCSSVar("--color-text-secondary", "#A2A2A2");
54
41
  const bgColor = getCSSVar("--color-bg-container-primary", "#0E0E0E");
55
42
  const chartData = data.map((item, i) => ({
@@ -1,19 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback } from "react";
3
3
  import { ResponsiveContainer, ScatterChart as ScatterChart$1, CartesianGrid, XAxis, YAxis, ZAxis, Tooltip, Scatter, Legend } from "recharts";
4
+ import { getChartSeriesColors } from "./palette.js";
4
5
  import "./Chart.css";
5
- const PALETTE = [
6
- "#118AB2",
7
- // teal-07
8
- "#06D6A0",
9
- // green-07
10
- "#EF476F",
11
- // red-07
12
- "#FFD166",
13
- // yellow-07
14
- "#9E47EF"
15
- // purple-07
16
- ];
17
6
  function getCSSVar(name, fallback) {
18
7
  if (typeof window === "undefined") return fallback;
19
8
  return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || fallback;
@@ -47,6 +36,7 @@ const ScatterChart = ({
47
36
  }) => {
48
37
  const baseClass = "ds-chart";
49
38
  const classes = [baseClass, className].filter(Boolean).join(" ");
39
+ const seriesColors = getChartSeriesColors();
50
40
  const textSecondary = getCSSVar("--color-text-secondary", "#A2A2A2");
51
41
  const gridColor = getCSSVar("--color-divider", "#232323");
52
42
  const renderTooltip = useCallback(
@@ -96,7 +86,7 @@ const ScatterChart = ({
96
86
  {
97
87
  name: ds.name,
98
88
  data: ds.data,
99
- fill: ds.color || PALETTE[i % PALETTE.length]
89
+ fill: ds.color || seriesColors[i % seriesColors.length]
100
90
  },
101
91
  ds.name
102
92
  )),
@@ -1,25 +1,12 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback } from "react";
3
3
  import { ResponsiveContainer, BarChart, CartesianGrid, XAxis, YAxis, Tooltip, Bar } from "recharts";
4
+ import { getChartSeriesColors } from "./palette.js";
4
5
  import "./Chart.css";
5
6
  function getCSSVar(name, fallback) {
6
7
  if (typeof window === "undefined") return fallback;
7
8
  return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || fallback;
8
9
  }
9
- function getDefaultColors() {
10
- if (typeof window === "undefined") {
11
- return ["#0E6E8F", "#06D6A0", "#FFD166", "#EF476F", "#9E47EF", "#EF8247"];
12
- }
13
- const get = (v, fb) => getComputedStyle(document.documentElement).getPropertyValue(v).trim() || fb;
14
- return [
15
- get("--color-action-primary-bg", "#0E6E8F"),
16
- get("--color-core-accent-mint", "#06D6A0"),
17
- get("--color-core-accent-gold", "#FFD166"),
18
- get("--color-core-accent-coral", "#EF476F"),
19
- get("--color-core-accent-violet", "#9E47EF"),
20
- get("--color-core-accent-amber", "#EF8247")
21
- ];
22
- }
23
10
  function StackedTooltip({ active, payload, label }) {
24
11
  if (!active || !payload?.length) return null;
25
12
  return /* @__PURE__ */ jsxs("div", { className: "ds-chart__tooltip", children: [
@@ -47,7 +34,7 @@ const StackedBarChart = ({
47
34
  const textSecondary = getCSSVar("--color-text-secondary", "#A2A2A2");
48
35
  const gridColor = getCSSVar("--color-divider", "#232323");
49
36
  const cursorColor = getCSSVar("--color-bg-container-secondary", "#303030");
50
- const defaultColors = getDefaultColors();
37
+ const defaultColors = getChartSeriesColors();
51
38
  const renderTooltip = useCallback(
52
39
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
53
40
  (props) => /* @__PURE__ */ jsx(StackedTooltip, { ...props }),
@@ -1,23 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback } from "react";
3
3
  import { ResponsiveContainer, Treemap as Treemap$1, Tooltip } from "recharts";
4
+ import { getChartSeriesColors } from "./palette.js";
4
5
  import "./Chart.css";
5
- const PALETTE = [
6
- "#118AB2",
7
- // teal-07
8
- "#06D6A0",
9
- // green-07
10
- "#EF476F",
11
- // red-07
12
- "#FFD166",
13
- // yellow-07
14
- "#9E47EF",
15
- // purple-07
16
- "#1E47B0",
17
- // blue-07
18
- "#EF8247"
19
- // orange
20
- ];
21
6
  function getCSSVar(name, fallback) {
22
7
  if (typeof window === "undefined") return fallback;
23
8
  return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || fallback;
@@ -25,7 +10,8 @@ function getCSSVar(name, fallback) {
25
10
  function TreemapContent(props) {
26
11
  const { x, y, width, height, name, index, color } = props;
27
12
  if (width < 4 || height < 4) return null;
28
- const fill = color || PALETTE[index % PALETTE.length];
13
+ const seriesColors = getChartSeriesColors();
14
+ const fill = color || seriesColors[index % seriesColors.length];
29
15
  const textColor = getCSSVar("--color-text-primary", "#050505");
30
16
  const showLabel = width > 50 && height > 28;
31
17
  return /* @__PURE__ */ jsxs("g", { children: [
@@ -0,0 +1 @@
1
+ export declare function getChartSeriesColors(): string[];
@@ -0,0 +1,19 @@
1
+ const SERIES_FALLBACKS = [
2
+ "#0E6E8F",
3
+ "#06D6A0",
4
+ "#FFD166",
5
+ "#EF476F",
6
+ "#9E47EF",
7
+ "#EF8247",
8
+ "#1E47B0"
9
+ ];
10
+ function getChartSeriesColors() {
11
+ if (typeof window === "undefined") return SERIES_FALLBACKS;
12
+ const style = getComputedStyle(document.documentElement);
13
+ return SERIES_FALLBACKS.map(
14
+ (fallback, i) => style.getPropertyValue(`--color-chart-series-${i + 1}`).trim() || fallback
15
+ );
16
+ }
17
+ export {
18
+ getChartSeriesColors
19
+ };
@@ -50,3 +50,12 @@
50
50
  .ds-chat-marker__icon .material-symbols-rounded {
51
51
  --icon-size: var(--icon-size-sm);
52
52
  }
53
+
54
+ /* Icons take the colour of the text around them. Explicit, not just
55
+ inherited by default: a consumer stylesheet that sets a colour on
56
+ .material-symbols-rounded itself (a common global default) would
57
+ otherwise override inheritance and detach the icon from the state
58
+ colours this component sets on its parents. */
59
+ .ds-chat-marker .material-symbols-rounded {
60
+ color: inherit;
61
+ }
@@ -110,6 +110,22 @@
110
110
  color: var(--color-text-primary);
111
111
  }
112
112
 
113
+ /* Card furniture inside a turn steps clear of the content around it — at
114
+ the body's default rhythm an adjacent text line sits close enough to read
115
+ as a caption rather than a neighbouring block. Margins, not gap, so a
116
+ card standing alone adds nothing. */
117
+ .ds-chat-message__content > .ds-message-card:not(:first-child),
118
+ .ds-chat-message__content > .ds-interrupt-card:not(:first-child),
119
+ .ds-chat-message__content > .ds-tool-call:not(:first-child) {
120
+ margin-top: var(--gap-sm-md);
121
+ }
122
+
123
+ .ds-chat-message__content > .ds-message-card:not(:last-child),
124
+ .ds-chat-message__content > .ds-interrupt-card:not(:last-child),
125
+ .ds-chat-message__content > .ds-tool-call:not(:last-child) {
126
+ margin-bottom: var(--gap-sm-md);
127
+ }
128
+
113
129
  /* Bubble — capped width so a short line never drags a surface across the
114
130
  whole row; the fallback is the sanctioned consumer-override hook */
115
131
  .ds-chat-message--bubble .ds-chat-message__content {
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import React, { useRef, useEffect, useState, useLayoutEffect } from "react";
4
+ import { MOTION_SCROLL_SETTLE_MS } from "../../tokens/motion.js";
4
5
  import "./ChatThread.css";
5
6
  import "../../fonts/material-symbols.css";
6
- const SCROLLBAR_SETTLE_MS = 600;
7
7
  const JUMP_THRESHOLD_PX = 24;
8
8
  const ChatThread = React.forwardRef(
9
9
  ({
@@ -129,7 +129,7 @@ const ChatThread = React.forwardRef(
129
129
  window.clearTimeout(settleTimer.current);
130
130
  settleTimer.current = window.setTimeout(
131
131
  () => setScrolling(false),
132
- SCROLLBAR_SETTLE_MS
132
+ MOTION_SCROLL_SETTLE_MS
133
133
  );
134
134
  };
135
135
  const jumpToBottom = () => {
@@ -220,3 +220,12 @@
220
220
  outline: 2px solid var(--color-action-primary-bg);
221
221
  outline-offset: 2px;
222
222
  }
223
+
224
+ /* Icons take the colour of the text around them. Explicit, not just
225
+ inherited by default: a consumer stylesheet that sets a colour on
226
+ .material-symbols-rounded itself (a common global default) would
227
+ otherwise override inheritance and detach the icon from the state
228
+ colours this component sets on its parents. */
229
+ .ds-chip .material-symbols-rounded {
230
+ color: inherit;
231
+ }
@@ -95,7 +95,7 @@
95
95
  font-weight: var(--font-paragraph-sm-em-weight);
96
96
  line-height: var(--font-paragraph-sm-line-height);
97
97
  text-transform: uppercase;
98
- letter-spacing: 0.08em;
98
+ letter-spacing: var(--font-overline-letter-spacing);
99
99
  color: var(--color-text-tertiary);
100
100
  flex-shrink: 0;
101
101
  }
@@ -178,3 +178,12 @@
178
178
  color: var(--color-text-primary);
179
179
  white-space: pre;
180
180
  }
181
+
182
+ /* Icons take the colour of the text around them. Explicit, not just
183
+ inherited by default: a consumer stylesheet that sets a colour on
184
+ .material-symbols-rounded itself (a common global default) would
185
+ otherwise override inheritance and detach the icon from the state
186
+ colours this component sets on its parents. */
187
+ .ds-code-block .material-symbols-rounded {
188
+ color: inherit;
189
+ }
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import { useState, useId } from "react";
4
+ import { MOTION_FEEDBACK_RESET_MS } from "../../tokens/motion.js";
4
5
  import "./CodeBlock.css";
5
6
  import "../../fonts/material-symbols.css";
6
7
  const CodeBlock = ({
@@ -44,7 +45,7 @@ const CodeBlock = ({
44
45
  fallback();
45
46
  }
46
47
  setCopied(true);
47
- window.setTimeout(() => setCopied(false), 2e3);
48
+ window.setTimeout(() => setCopied(false), MOTION_FEEDBACK_RESET_MS);
48
49
  };
49
50
  return /* @__PURE__ */ jsxs("div", { className: classes, style, children: [
50
51
  hasHeader && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__header`, children: [
@@ -170,6 +170,16 @@ const ColorPicker = React.forwardRef(
170
170
  e.preventDefault();
171
171
  commit({ h, s, v: clamp(v - step, 0, 100), a });
172
172
  break;
173
+ // The slider pattern requires Home/End; they act on the horizontal
174
+ // (saturation) axis, matching the arrow keys above.
175
+ case "Home":
176
+ e.preventDefault();
177
+ commit({ h, s: 0, v, a });
178
+ break;
179
+ case "End":
180
+ e.preventDefault();
181
+ commit({ h, s: 100, v, a });
182
+ break;
173
183
  }
174
184
  };
175
185
  const displayHex = formatHex(hsva, showAlpha);
@@ -373,3 +373,12 @@
373
373
  animation: none;
374
374
  }
375
375
  }
376
+
377
+ /* Icons take the colour of the text around them. Explicit, not just
378
+ inherited by default: a consumer stylesheet that sets a colour on
379
+ .material-symbols-rounded itself (a common global default) would
380
+ otherwise override inheritance and detach the icon from the state
381
+ colours this component sets on its parents. */
382
+ .ds-combobox .material-symbols-rounded {
383
+ color: inherit;
384
+ }
@@ -294,3 +294,12 @@
294
294
  transition: none;
295
295
  }
296
296
  }
297
+
298
+ /* Icons take the colour of the text around them. Explicit, not just
299
+ inherited by default: a consumer stylesheet that sets a colour on
300
+ .material-symbols-rounded itself (a common global default) would
301
+ otherwise override inheritance and detach the icon from the state
302
+ colours this component sets on its parents. */
303
+ .ds-command-palette .material-symbols-rounded {
304
+ color: inherit;
305
+ }
@@ -7,6 +7,7 @@ import "./CommandPalette.css";
7
7
  import "../../fonts/material-symbols.css";
8
8
  const emptySubscribe = () => () => {
9
9
  };
10
+ const FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
10
11
  const CommandPalette = ({
11
12
  open,
12
13
  onOpenChange,
@@ -25,6 +26,7 @@ const CommandPalette = ({
25
26
  const [rawActiveIndex, setActiveIndex] = useState(0);
26
27
  const [prevOpen, setPrevOpen] = useState(open);
27
28
  const inputRef = useRef(null);
29
+ const panelRef = useRef(null);
28
30
  const listRef = useRef(null);
29
31
  const previousFocusRef = useRef(null);
30
32
  const generatedId = useId();
@@ -87,6 +89,33 @@ const CommandPalette = ({
87
89
  document.body.style.overflow = "";
88
90
  };
89
91
  }, [open]);
92
+ useEffect(() => {
93
+ if (!open) return;
94
+ const handleTrapKeyDown = (e) => {
95
+ if (e.key === "Escape") {
96
+ e.preventDefault();
97
+ onOpenChange(false);
98
+ return;
99
+ }
100
+ if (e.key === "Tab") {
101
+ const panel = panelRef.current;
102
+ if (!panel) return;
103
+ const focusable = panel.querySelectorAll(FOCUSABLE);
104
+ if (focusable.length === 0) return;
105
+ const first = focusable[0];
106
+ const last = focusable[focusable.length - 1];
107
+ if (e.shiftKey && document.activeElement === first) {
108
+ e.preventDefault();
109
+ last.focus();
110
+ } else if (!e.shiftKey && document.activeElement === last) {
111
+ e.preventDefault();
112
+ first.focus();
113
+ }
114
+ }
115
+ };
116
+ document.addEventListener("keydown", handleTrapKeyDown);
117
+ return () => document.removeEventListener("keydown", handleTrapKeyDown);
118
+ }, [open, onOpenChange]);
90
119
  const runCommand = (command) => {
91
120
  if (command.disabled) return;
92
121
  command.onSelect?.();
@@ -119,10 +148,6 @@ const CommandPalette = ({
119
148
  e.preventDefault();
120
149
  if (flatCommands[activeIndex]) runCommand(flatCommands[activeIndex]);
121
150
  break;
122
- case "Escape":
123
- e.preventDefault();
124
- onOpenChange(false);
125
- break;
126
151
  }
127
152
  };
128
153
  useEffect(() => {
@@ -148,6 +173,7 @@ const CommandPalette = ({
148
173
  "div",
149
174
  {
150
175
  className: `${baseClass}__panel`,
176
+ ref: panelRef,
151
177
  role: "dialog",
152
178
  "aria-modal": "true",
153
179
  "aria-label": "Command palette",
@@ -186,7 +212,7 @@ const CommandPalette = ({
186
212
  ] }),
187
213
  /* @__PURE__ */ jsxs("div", { className: `${baseClass}__list`, role: "listbox", id: listboxId, ref: listRef, children: [
188
214
  loading && /* @__PURE__ */ jsx("p", { className: `${baseClass}__status`, children: "Loading…" }),
189
- !loading && filteredGroups.length === 0 && /* @__PURE__ */ jsx("p", { className: `${baseClass}__status`, children: emptyMessage }),
215
+ !loading && filteredGroups.length === 0 && /* @__PURE__ */ jsx("p", { className: `${baseClass}__status`, "aria-live": "polite", children: emptyMessage }),
190
216
  !loading && filteredGroups.map((group) => /* @__PURE__ */ jsxs(
191
217
  "div",
192
218
  {
@@ -3,7 +3,20 @@
3
3
  The chat input shell: attachments, auto-growing textarea, send/stop
4
4
  ============================================ */
5
5
 
6
+ /* The focus treatment animates a registered custom property, exactly as
7
+ AiButton does: a conic gradient's angle cannot tween otherwise. Browsers
8
+ without @property render the ring at its initial angle, static — a
9
+ correct, quieter fallback. Registered under its own name so Composer
10
+ never depends on AiButton's stylesheet being loaded. */
11
+ @property --ds-composer-glow-angle {
12
+ syntax: '<angle>';
13
+ initial-value: 0deg;
14
+ inherits: false;
15
+ }
16
+
6
17
  .ds-composer {
18
+ /* Anchors the focus ring and glow pseudo-elements */
19
+ position: relative;
7
20
  display: flex;
8
21
  flex-direction: column;
9
22
  width: 100%;
@@ -36,6 +49,105 @@
36
49
  border-color: var(--color-input-border-selected);
37
50
  }
38
51
 
52
+ /* ============================================
53
+ AI GLOW — opt-in via the `aiGlow` prop
54
+ While focused, the plain selected border stands down and the AI gradient
55
+ ring takes its place — the same "a model answers here" signal AiButton
56
+ carries, for composers whose messages are answered by a model.
57
+ ============================================ */
58
+
59
+ .ds-composer--ai-glow:focus-within {
60
+ border-color: transparent;
61
+ }
62
+
63
+ /* The gradient ring: AiButton's treatment on the composer shell — a conic
64
+ gradient painted across the whole box, masked to the border band (two
65
+ fills, exclude-composited, inset by the border width). The gradient
66
+ repeats back to its start colour so the seam at 360° is invisible while
67
+ it turns. Negative inset lays the pseudo over the shell's own border
68
+ box, so the ring replaces the border exactly. */
69
+ .ds-composer--ai-glow::before {
70
+ content: '';
71
+ position: absolute;
72
+ inset: calc(-1 * var(--border-xs));
73
+ border-radius: inherit;
74
+ /* One step up from the shell's --border-xs border: the outer edge stays on
75
+ the border box and the extra pixel grows inward, so the thicker band
76
+ reads clearly on low-density screens without changing the geometry. */
77
+ padding: var(--border-md);
78
+ background: conic-gradient(
79
+ from var(--ds-composer-glow-angle),
80
+ var(--color-ai-gradient-start),
81
+ var(--color-ai-gradient-mid),
82
+ var(--color-ai-gradient-end),
83
+ var(--color-ai-gradient-mid),
84
+ var(--color-ai-gradient-start)
85
+ );
86
+ /* Standard properties only — the build pipeline prefixes per its browser
87
+ targets, and hand-written -webkit- duplicates confuse its merging. */
88
+ mask:
89
+ linear-gradient(#fff 0 0) content-box,
90
+ linear-gradient(#fff 0 0);
91
+ mask-composite: exclude;
92
+ pointer-events: none;
93
+ opacity: 0;
94
+ transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
95
+ /* ds-allow(motion): ambient signature rotation, matched to AiButton's —
96
+ deliberately far slower than the interaction-scale motion tokens */
97
+ animation: ds-composer-glow-turn 7s linear infinite paused;
98
+ }
99
+
100
+ /* The glow: the same gradient, blurred behind the opaque shell at low
101
+ opacity, so it reads as a halo around the border. A colour effect, not
102
+ an elevation shadow — depth stays token-owned. */
103
+ .ds-composer--ai-glow::after {
104
+ content: '';
105
+ position: absolute;
106
+ inset: calc(-1 * var(--border-xs));
107
+ border-radius: inherit;
108
+ background: conic-gradient(
109
+ from var(--ds-composer-glow-angle),
110
+ var(--color-ai-gradient-start),
111
+ var(--color-ai-gradient-mid),
112
+ var(--color-ai-gradient-end),
113
+ var(--color-ai-gradient-mid),
114
+ var(--color-ai-gradient-start)
115
+ );
116
+ /* The glow's spread; a length with no token family, matched to AiButton. */
117
+ --ds-composer-glow: 14px;
118
+ filter: blur(var(--ds-composer-glow));
119
+ opacity: 0;
120
+ z-index: -1;
121
+ pointer-events: none;
122
+ transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
123
+ /* ds-allow(motion): same ambient rotation as the ring, kept in phase */
124
+ animation: ds-composer-glow-turn 7s linear infinite paused;
125
+ }
126
+
127
+ .ds-composer--ai-glow:focus-within::before {
128
+ opacity: 1;
129
+ animation-play-state: running;
130
+ }
131
+
132
+ .ds-composer--ai-glow:focus-within::after {
133
+ opacity: 0.3;
134
+ animation-play-state: running;
135
+ }
136
+
137
+ @keyframes ds-composer-glow-turn {
138
+ to {
139
+ --ds-composer-glow-angle: 360deg;
140
+ }
141
+ }
142
+
143
+ /* Reduced motion: the ring and glow stay, the turning stops. */
144
+ @media (prefers-reduced-motion: reduce) {
145
+ .ds-composer--ai-glow::before,
146
+ .ds-composer--ai-glow::after {
147
+ animation: none;
148
+ }
149
+ }
150
+
39
151
  /* ============================================
40
152
  ATTACHMENTS ROW
41
153
  ============================================ */
@@ -175,6 +287,12 @@
175
287
  border-color: var(--color-input-border-disabled);
176
288
  }
177
289
 
290
+ .ds-composer--disabled:focus-within::before,
291
+ .ds-composer--disabled:focus-within::after {
292
+ opacity: 0;
293
+ animation-play-state: paused;
294
+ }
295
+
178
296
  .ds-composer--disabled .ds-composer__textarea {
179
297
  cursor: not-allowed;
180
298
  color: var(--color-input-text-disabled);
@@ -28,6 +28,13 @@ type ComposerOwnProps = {
28
28
  onStop?: () => void;
29
29
  /** Growth cap in text rows before the textarea scrolls internally. */
30
30
  maxRows?: number;
31
+ /**
32
+ * While focused, the shell wears AiButton's slowly rotating gradient ring
33
+ * and glow in place of the plain selected border — the system's "a model
34
+ * answers here" signal, for composers whose messages are answered by one.
35
+ * Off by default.
36
+ */
37
+ aiGlow?: boolean;
31
38
  /**
32
39
  * Attachment row rendered above the textarea (DocumentChips). Fully
33
40
  * controlled by the caller — Composer never owns the list.