rift-ds 1.31.0 → 1.32.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 (91) hide show
  1. package/README.md +1 -1
  2. package/behaviors/chat-card.css +4 -1
  3. package/behaviors/deferComponent.d.ts +43 -0
  4. package/behaviors/deferComponent.js +35 -0
  5. package/bin/templates/blocks/components/blocks/AppShell.module.css +10 -1
  6. package/chat/ChatLauncher.d.ts +9 -1
  7. package/chat/ChatLauncher.js +51 -33
  8. package/chat/ChatWidget.css +13 -4
  9. package/chat/ChatWidget.js +15 -15
  10. package/chat/deferredChatWidget.d.ts +10 -0
  11. package/chat/deferredChatWidget.js +10 -0
  12. package/chat/index.d.ts +1 -0
  13. package/chat/index.js +2 -0
  14. package/chat/registry.json.d.ts +2 -1
  15. package/chat/registry.json.js +1 -1
  16. package/components/Accordion/Accordion.css +8 -0
  17. package/components/AgentPlan/AgentPlan.css +8 -0
  18. package/components/AgentRail/AgentRail.css +3 -3
  19. package/components/AiButton/AiButton.css +19 -0
  20. package/components/AiButton/AiButton.d.ts +10 -1
  21. package/components/AiButton/AiButton.js +6 -1
  22. package/components/ArtifactPanel/ArtifactPanel.js +5 -5
  23. package/components/Attachment/AttachmentViewer.js +7 -7
  24. package/components/BentoTile/BentoTile.css +1 -1
  25. package/components/BentoTile/BentoTile.js +5 -5
  26. package/components/Button/Button.css +28 -1
  27. package/components/Button/Button.d.ts +7 -2
  28. package/components/Button/Button.js +7 -3
  29. package/components/ChatHeader/ChatHeader.d.ts +1 -1
  30. package/components/ChatThread/ChatThread.css +1 -1
  31. package/components/Chip/Chip.css +26 -0
  32. package/components/CircularButton/CircularButton.d.ts +16 -96
  33. package/components/CircularButton/CircularButton.js +11 -94
  34. package/components/Combobox/Combobox.css +12 -0
  35. package/components/CommandPalette/CommandPalette.css +1 -1
  36. package/components/CommandPalette/CommandPalette.js +3 -3
  37. package/components/CommandPaletteTrigger/CommandPaletteTrigger.css +9 -0
  38. package/components/CommandPaletteTrigger/CommandPaletteTrigger.d.ts +10 -2
  39. package/components/CommandPaletteTrigger/CommandPaletteTrigger.js +7 -2
  40. package/components/Composer/Composer.css +3 -3
  41. package/components/Composer/Composer.js +9 -9
  42. package/components/ContextMenu/ContextMenu.css +24 -0
  43. package/components/DataTable/DataTable.css +2 -2
  44. package/components/DataTable/DataTable.js +15 -15
  45. package/components/DateInput/DateInput.css +20 -0
  46. package/components/DescriptionList/DescriptionListCopy.d.ts +1 -1
  47. package/components/DescriptionList/DescriptionListCopy.js +3 -3
  48. package/components/Dialog/Dialog.css +1 -1
  49. package/components/Dialog/Dialog.js +3 -3
  50. package/components/DocumentChip/DocumentChip.css +12 -0
  51. package/components/DocumentViewer/DocumentViewer.js +10 -10
  52. package/components/Drawer/Drawer.css +1 -1
  53. package/components/Drawer/Drawer.js +3 -3
  54. package/components/Dropdown/Dropdown.css +30 -0
  55. package/components/DropdownMenu/DropdownMenu.css +24 -0
  56. package/components/FileInput/FileInput.css +9 -0
  57. package/components/FilterBar/FilterBar.css +12 -0
  58. package/components/{CircularButton/CircularButton.css → IconButton/IconButton.css} +91 -81
  59. package/components/IconButton/IconButton.d.ts +108 -0
  60. package/components/IconButton/IconButton.js +101 -0
  61. package/components/Input/Input.css +53 -0
  62. package/components/Input/Input.js +3 -3
  63. package/components/MaskedInput/MaskedInput.js +3 -3
  64. package/components/ModelPicker/ModelPicker.css +12 -1
  65. package/components/NavList/NavList.css +1 -1
  66. package/components/Pagination/Pagination.css +1 -1
  67. package/components/QuestionCard/QuestionCard.js +3 -3
  68. package/components/RadioButton/RadioButton.css +14 -12
  69. package/components/RichDropdown/RichDropdown.css +7 -0
  70. package/components/SegmentedControl/SegmentedControl.css +16 -5
  71. package/components/SegmentedControl/SegmentedControl.js +7 -4
  72. package/components/SiteHeader/SiteHeader.css +12 -5
  73. package/components/SiteHeader/SiteHeader.js +3 -3
  74. package/components/SourceTrail/SourceTrail.css +8 -0
  75. package/components/SplitButton/SplitButton.css +14 -14
  76. package/components/SplitButton/SplitButton.js +3 -3
  77. package/components/TableToolbar/TableToolbar.css +2 -2
  78. package/components/TableToolbar/TableToolbar.js +36 -37
  79. package/components/ThreadPanel/ThreadPanel.css +8 -0
  80. package/components/ThreadTabs/ThreadTabs.css +7 -0
  81. package/components/TimePicker/TimePicker.css +12 -0
  82. package/components/ToolCall/ToolCall.css +8 -0
  83. package/components/Tooltip/Tooltip.js +3 -2
  84. package/components/WorldMap/WorldMap.js +5 -5
  85. package/components/registry.d.ts +3 -1
  86. package/components/registry.json +19 -10
  87. package/components/registry.json.d.ts +19 -10
  88. package/components/registry.json.js +1 -1
  89. package/index.d.ts +1 -0
  90. package/index.js +2 -0
  91. package/package.json +6 -2
@@ -0,0 +1,101 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { Spinner } from "../Spinner/Spinner.js";
4
+ import { Tooltip } from "../Tooltip/Tooltip.js";
5
+ import "./IconButton.css";
6
+ import "../../fonts/material-symbols.css";
7
+ import { mirrorClass } from "../../behaviors/direction.js";
8
+ import { formatNumber, DEFAULT_LOCALE } from "../../behaviors/locale.js";
9
+ function resolveIconButtonCell(variant, tone) {
10
+ const emphasis = variant === "neutral" ? "primary" : variant;
11
+ const resolvedTone = tone ?? (variant === "neutral" ? "neutral" : "default");
12
+ if (resolvedTone === "destructive") {
13
+ return emphasis === "primary" ? "primary-destructive" : "destructive";
14
+ }
15
+ if (resolvedTone === "neutral" && emphasis !== "tertiary") {
16
+ return emphasis === "primary" ? "neutral" : "secondary-neutral";
17
+ }
18
+ return emphasis;
19
+ }
20
+ const IconButton = React.forwardRef(
21
+ ({
22
+ icon,
23
+ variant,
24
+ tone,
25
+ priority,
26
+ disabled,
27
+ state,
28
+ size = "default",
29
+ loading,
30
+ label,
31
+ tooltip,
32
+ tooltipPosition = "top",
33
+ href,
34
+ target,
35
+ rel,
36
+ badge,
37
+ badgeMax = 99,
38
+ badgeLabel = defaultBadgeLabel,
39
+ locale = DEFAULT_LOCALE,
40
+ className = "",
41
+ linkComponent,
42
+ ...rest
43
+ }, ref) => {
44
+ const baseClass = "ds-icon-button";
45
+ const Link = linkComponent ?? "a";
46
+ const resolvedVariant = resolveIconButtonCell(variant ?? priority ?? "primary", tone);
47
+ const isDisabled = disabled ?? state === "disabled";
48
+ const resolvedState = state ?? (isDisabled ? "disabled" : "default");
49
+ const isLoading = Boolean(loading);
50
+ const classes = [
51
+ baseClass,
52
+ `${baseClass}--${resolvedVariant}`,
53
+ `${baseClass}--${resolvedState}`,
54
+ `${baseClass}--${size}`,
55
+ isLoading && `${baseClass}--loading`,
56
+ badge !== void 0 && `${baseClass}--badged`,
57
+ className
58
+ ].filter(Boolean).join(" ");
59
+ const glyph = isLoading ? /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx(Spinner, { size: size === "compact" ? "sm" : "md", tone: "inherit" }) }) : /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon${typeof icon === "string" ? ` material-symbols-rounded ${mirrorClass(icon)}` : ""}`, "aria-hidden": "true", children: icon });
60
+ const badgeText = badge === void 0 || badge === true ? null : typeof badge === "number" ? badge > badgeMax ? `${formatNumber(badgeMax, locale)}+` : formatNumber(badge, locale) : badge;
61
+ const children = /* @__PURE__ */ jsxs(Fragment, { children: [
62
+ glyph,
63
+ badge === true && /* @__PURE__ */ jsx("span", { className: `${baseClass}__badge ${baseClass}__badge--dot`, "aria-hidden": "true" }),
64
+ badgeText !== null && /* @__PURE__ */ jsx("span", { className: `${baseClass}__badge`, "aria-hidden": "true", children: badgeText })
65
+ ] });
66
+ const accessibleName = badge === void 0 ? label : `${label}${badgeLabel(badge)}`;
67
+ const control = href && !isDisabled && !isLoading ? /* @__PURE__ */ jsx(
68
+ Link,
69
+ {
70
+ ...rest,
71
+ ref,
72
+ className: classes,
73
+ href,
74
+ target,
75
+ rel,
76
+ "aria-label": accessibleName,
77
+ children
78
+ }
79
+ ) : /* @__PURE__ */ jsx(
80
+ "button",
81
+ {
82
+ ...rest,
83
+ ref,
84
+ type: "button",
85
+ className: classes,
86
+ disabled: isDisabled || isLoading,
87
+ "aria-busy": isLoading || void 0,
88
+ "aria-label": accessibleName,
89
+ children
90
+ }
91
+ );
92
+ const tooltipContent = tooltip === false ? null : tooltip ?? label;
93
+ if (!tooltipContent) return control;
94
+ return /* @__PURE__ */ jsx(Tooltip, { content: tooltipContent, position: tooltipPosition, children: control });
95
+ }
96
+ );
97
+ IconButton.displayName = "IconButton";
98
+ const defaultBadgeLabel = (badge) => badge === true ? ", new" : `, ${badge} new`;
99
+ export {
100
+ IconButton
101
+ };
@@ -274,3 +274,56 @@
274
274
  .ds-input--affixed.ds-input--compact .ds-input__clear {
275
275
  margin-inline-end: calc(-1 * var(--padding-300));
276
276
  }
277
+
278
+ /* Icon side padding, Button's rule (design.md): a glyph's box carries its
279
+ own side bearing, so a side that holds one takes the step below the text
280
+ side. An icon drawn in the field moves in one step and the text keeps
281
+ its distance from it (16 → 12, compact 12 → 8). The affixed wrapper's clear
282
+ and action buttons already pull into the edge with their own margin. */
283
+ .ds-input__icon--left {
284
+ inset-inline-start: var(--padding-300);
285
+ }
286
+
287
+ .ds-input__icon--right {
288
+ inset-inline-end: var(--padding-300);
289
+ }
290
+
291
+ .ds-input--has-icon-left .ds-input__field {
292
+ padding-inline-start: calc(var(--padding-300) + 24px + var(--gap-200)); /* 12px + 24px icon + 8px gap */
293
+ }
294
+
295
+ .ds-input--has-icon-right .ds-input__field {
296
+ padding-inline-end: calc(var(--padding-300) + 24px + var(--gap-200)); /* 12px + 24px icon + 8px gap */
297
+ }
298
+
299
+ .ds-input--compact .ds-input__icon--left {
300
+ inset-inline-start: var(--padding-200);
301
+ }
302
+
303
+ .ds-input--compact .ds-input__icon--right {
304
+ inset-inline-end: var(--padding-200);
305
+ }
306
+
307
+ .ds-input--compact.ds-input--has-icon-left .ds-input__field {
308
+ padding-inline-start: calc(var(--padding-200) + 20px + var(--gap-200)); /* 8px + 20px icon + 8px gap */
309
+ }
310
+
311
+ .ds-input--compact.ds-input--has-icon-right .ds-input__field {
312
+ padding-inline-end: calc(var(--padding-200) + 20px + var(--gap-200)); /* 8px + 20px icon + 8px gap */
313
+ }
314
+
315
+ .ds-input--affixed.ds-input--has-icon-left .ds-input__field-wrapper {
316
+ padding-inline-start: var(--padding-300);
317
+ }
318
+
319
+ .ds-input--affixed.ds-input--has-icon-right .ds-input__field-wrapper {
320
+ padding-inline-end: var(--padding-300);
321
+ }
322
+
323
+ .ds-input--affixed.ds-input--compact.ds-input--has-icon-left .ds-input__field-wrapper {
324
+ padding-inline-start: var(--padding-200);
325
+ }
326
+
327
+ .ds-input--affixed.ds-input--compact.ds-input--has-icon-right .ds-input__field-wrapper {
328
+ padding-inline-end: var(--padding-200);
329
+ }
@@ -2,7 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import React, { useRef, useState, useId } from "react";
4
4
  import { Field } from "../Field/Field.js";
5
- import { CircularButton } from "../CircularButton/CircularButton.js";
5
+ import { IconButton } from "../IconButton/IconButton.js";
6
6
  import "./Input.css";
7
7
  import "../../fonts/material-symbols.css";
8
8
  import { mirrorClass } from "../../behaviors/direction.js";
@@ -136,13 +136,13 @@ const Input = React.forwardRef(
136
136
  hasSuffix && /* @__PURE__ */ jsx("span", { className: `${baseClass}__affix ${baseClass}__affix--suffix`, id: suffixId, dir: "auto", children: suffix }),
137
137
  hasAction && /* @__PURE__ */ jsx("span", { className: `${baseClass}__action`, children: action }),
138
138
  showClear && /* @__PURE__ */ jsx(
139
- CircularButton,
139
+ IconButton,
140
140
  {
141
141
  className: `${baseClass}__clear`,
142
142
  icon: "close",
143
143
  variant: "tertiary",
144
144
  size: "compact",
145
- ariaLabel: clearLabel,
145
+ label: clearLabel,
146
146
  onClick: handleClear
147
147
  }
148
148
  ),
@@ -2,7 +2,7 @@
2
2
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
3
  import { useState, useMemo, useRef, useLayoutEffect, useEffect } from "react";
4
4
  import { Input } from "../Input/Input.js";
5
- import { CircularButton } from "../CircularButton/CircularButton.js";
5
+ import { IconButton } from "../IconButton/IconButton.js";
6
6
  import { MOTION_SENSITIVE_HIDE_MS } from "../../tokens/motion.js";
7
7
  import { applyMask, concealMasked, maskIsNumeric, readEdit, maskCapacity, caretFor } from "./mask.js";
8
8
  import { MASK_PRESETS } from "./mask.js";
@@ -89,12 +89,12 @@ function MaskedInput({
89
89
  onValueChange?.(next.raw, next.text);
90
90
  };
91
91
  const revealButton = sensitive && revealable ? /* @__PURE__ */ jsx(
92
- CircularButton,
92
+ IconButton,
93
93
  {
94
94
  icon: revealed ? "visibility_off" : "visibility",
95
95
  variant: "tertiary",
96
96
  size: "compact",
97
- ariaLabel: revealed ? hideLabel : showLabel,
97
+ label: revealed ? hideLabel : showLabel,
98
98
  "aria-pressed": revealed,
99
99
  disabled,
100
100
  onClick: () => setRevealed(!revealed)
@@ -22,7 +22,7 @@
22
22
  display: inline-flex;
23
23
  align-items: center;
24
24
  gap: var(--gap-050);
25
- /* The row height (--control-height-*), CircularButton's too, so the pill
25
+ /* The row height (--control-height-*), IconButton's too, so the pill
26
26
  and the composer's round icon buttons read as one row of equals. */
27
27
  box-sizing: border-box;
28
28
  height: var(--control-height-default);
@@ -203,3 +203,14 @@
203
203
  .ds-model-picker__effort-options {
204
204
  flex: none;
205
205
  }
206
+
207
+ /* Icon side padding, Button's rule: the chevron always trails, and its box
208
+ carries its own side bearing, so the end takes the step below the label
209
+ side (16 → 12, compact 12 → 8). */
210
+ .ds-model-picker__trigger {
211
+ padding-inline-end: var(--padding-300);
212
+ }
213
+
214
+ .ds-model-picker--compact .ds-model-picker__trigger {
215
+ padding-inline-end: var(--padding-200);
216
+ }
@@ -64,7 +64,7 @@
64
64
 
65
65
  /* ============================================
66
66
  TOGGLE
67
- Mirrors CircularButton's 40px tertiary recipe.
67
+ Mirrors IconButton's 40px tertiary recipe.
68
68
  ============================================ */
69
69
 
70
70
  .ds-nav-list__toggle {
@@ -20,7 +20,7 @@
20
20
 
21
21
  /* ============================================
22
22
  PAGE BUTTONS
23
- Pill-shaped, matching CircularButton sizing
23
+ Pill-shaped, matching IconButton sizing
24
24
  ============================================ */
25
25
 
26
26
  .ds-pagination__page,
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import React from "react";
4
4
  import { Button } from "../Button/Button.js";
5
5
  import { CheckboxIndicator } from "../Checkbox/Checkbox.js";
6
- import { CircularButton } from "../CircularButton/CircularButton.js";
6
+ import { IconButton } from "../IconButton/IconButton.js";
7
7
  import { RadioIndicator } from "../RadioButton/RadioButton.js";
8
8
  import "./QuestionCard.css";
9
9
  import "../../behaviors/chat-card.css";
@@ -272,11 +272,11 @@ const QuestionCard = React.forwardRef(
272
272
  ),
273
273
  showSubmit && /* @__PURE__ */ jsx(Mark, { base: baseClass, chosen: draft.other.trim() !== "", multi }),
274
274
  !showSubmit && /* @__PURE__ */ jsx(
275
- CircularButton,
275
+ IconButton,
276
276
  {
277
277
  icon: "arrow_upward",
278
278
  size: "compact",
279
- ariaLabel: labels.submit,
279
+ label: labels.submit,
280
280
  disabled: !draft.other.trim(),
281
281
  onClick: submitDraft
282
282
  }
@@ -31,24 +31,28 @@
31
31
  meaning, so it never follows --radius-pill into a square. */
32
32
  border-radius: 50%;
33
33
  background-color: var(--color-input-bg-primary);
34
+ box-shadow: inset 0 0 0 var(--padding-300) var(--color-input-bg-primary);
35
+ transition: box-shadow var(--motion-duration-base) var(--motion-ease-standard), background-color var(--motion-duration-base) var(--motion-ease-standard), border-color var(--motion-duration-base) var(--motion-ease-standard);
34
36
  display: inline-flex;
35
37
  align-items: center;
36
38
  justify-content: center;
37
39
  flex-shrink: 0;
38
- transition: border-color var(--motion-duration-base) var(--motion-ease-standard);
39
40
  }
40
41
 
41
42
  /* ============================================
42
43
  DOT (inner fill)
43
44
  ============================================ */
44
45
 
46
+ /* The dot is painted by the circle itself, never by a child box: a child
47
+ centred by flex at a fractional page position rounds its edges apart from
48
+ the ring's, and the dot reads off-centre by a pixel. The checked circle
49
+ fills with the action colour and an inset ring of the field colour, one
50
+ padding step wide, carves the gap, so ring, gap and dot are one rounded
51
+ shape and stay concentric at any position or zoom. Unchecked, the inset
52
+ ring covers the whole face. The span stays in the markup for any
53
+ consumer that selects it, and draws nothing. */
45
54
  .ds-radio__dot {
46
- width: 12px;
47
- height: 12px;
48
- border-radius: 50%;
49
- background-color: var(--color-action-primary-bg);
50
- transform: scale(0);
51
- transition: transform var(--motion-duration-base) var(--motion-ease-standard);
55
+ display: none;
52
56
  }
53
57
 
54
58
  /* ============================================
@@ -72,10 +76,8 @@
72
76
 
73
77
  .ds-radio__circle--checked {
74
78
  border-color: var(--color-action-primary-bg);
75
- }
76
-
77
- .ds-radio__circle--checked .ds-radio__dot {
78
- transform: scale(1);
79
+ background-color: var(--color-action-primary-bg);
80
+ box-shadow: inset 0 0 0 var(--padding-100) var(--color-input-bg-primary);
79
81
  }
80
82
 
81
83
  /* ============================================
@@ -92,7 +94,7 @@
92
94
  border-color: var(--color-action-primary-bg-hover);
93
95
  }
94
96
 
95
- .ds-control-host:not(:disabled):not([aria-disabled='true']):hover .ds-radio__circle--checked .ds-radio__dot {
97
+ .ds-control-host:not(:disabled):not([aria-disabled='true']):hover .ds-radio__circle--checked {
96
98
  background-color: var(--color-action-primary-bg-hover);
97
99
  }
98
100
 
@@ -241,3 +241,10 @@
241
241
  .ds-rich-dropdown--disabled .ds-rich-dropdown__chevron {
242
242
  color: var(--color-input-text-disabled);
243
243
  }
244
+
245
+ /* Icon side padding, Button's rule (design.md): a glyph's box carries its
246
+ own side bearing, so a side that holds one takes the step below the text
247
+ side. The trigger always ends on its chevron (16 → 12). */
248
+ .ds-rich-dropdown__trigger {
249
+ padding-inline-end: var(--padding-300);
250
+ }
@@ -219,6 +219,17 @@
219
219
  padding-block: 0;
220
220
  }
221
221
 
222
+ /* Icon side padding: beside a label the icon's box carries its own side
223
+ bearing, so its edge takes the step below the text's, as Button's does:
224
+ 16 → 12 at default, 12 → 8 at compact. */
225
+ .ds-segmented-control__segment--icon-start {
226
+ padding-inline-start: var(--padding-300);
227
+ }
228
+
229
+ .ds-segmented-control--compact .ds-segmented-control__segment--icon-start {
230
+ padding-inline-start: var(--padding-200);
231
+ }
232
+
222
233
  .ds-segmented-control--compact .ds-segmented-control__label {
223
234
  font-size: var(--font-paragraph-sm-emphasis-size);
224
235
  line-height: var(--font-paragraph-sm-emphasis-line-height);
@@ -325,20 +336,20 @@
325
336
  background: none;
326
337
  }
327
338
 
328
- .ds-segmented-control--cycle .ds-circular-button {
339
+ .ds-segmented-control--cycle .ds-icon-button {
329
340
  background-color: var(--color-bg-container-primary);
330
341
  border: var(--border-025) solid var(--color-bg-container-border);
331
342
  border-radius: calc(var(--radius-pill) + var(--padding-100));
332
343
  }
333
344
 
334
- .ds-segmented-control--cycle .ds-circular-button:not(.ds-circular-button--disabled):hover {
345
+ .ds-segmented-control--cycle .ds-icon-button:not(.ds-icon-button--disabled):hover {
335
346
  background-color: var(--color-bg-container-secondary);
336
347
  }
337
348
 
338
349
  /* The glyph holds the icon colour in every state, as the family's glyphs
339
350
  do: only the fill steps on hover. */
340
- .ds-segmented-control--cycle .ds-circular-button .ds-circular-button__icon,
341
- .ds-segmented-control--cycle .ds-circular-button:not(.ds-circular-button--disabled):hover .ds-circular-button__icon,
342
- .ds-segmented-control--cycle .ds-circular-button:not(.ds-circular-button--disabled):active .ds-circular-button__icon {
351
+ .ds-segmented-control--cycle .ds-icon-button .ds-icon-button__icon,
352
+ .ds-segmented-control--cycle .ds-icon-button:not(.ds-icon-button--disabled):hover .ds-icon-button__icon,
353
+ .ds-segmented-control--cycle .ds-icon-button:not(.ds-icon-button--disabled):active .ds-icon-button__icon {
343
354
  color: var(--color-action-icon-default);
344
355
  }
@@ -7,7 +7,7 @@ import "../../fonts/material-symbols.css";
7
7
  import { mirrorClass, logicalArrowKey } from "../../behaviors/direction.js";
8
8
  import { useAnchoredPosition } from "../../behaviors/useAnchoredPosition.js";
9
9
  import { useTopLayer } from "../../behaviors/useTopLayer.js";
10
- import { CircularButton } from "../CircularButton/CircularButton.js";
10
+ import { IconButton } from "../IconButton/IconButton.js";
11
11
  import { warnOnce } from "../../behaviors/devWarning.js";
12
12
  const SegmentedControl = React.forwardRef(
13
13
  ({
@@ -266,13 +266,13 @@ const SegmentedControl = React.forwardRef(
266
266
  ref: setRef,
267
267
  className: [baseClass, sizeClass, variantClass, `${baseClass}--cycle`, className].filter(Boolean).join(" "),
268
268
  children: current && /* @__PURE__ */ jsx(
269
- CircularButton,
269
+ IconButton,
270
270
  {
271
271
  icon: current.icon ?? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: current.label.charAt(0) }),
272
272
  size,
273
273
  variant: "secondary",
274
274
  tone: "neutral",
275
- ariaLabel: label,
275
+ label,
276
276
  tooltip: current.label,
277
277
  disabled: next === current,
278
278
  onClick: () => select(next.value)
@@ -304,7 +304,10 @@ const SegmentedControl = React.forwardRef(
304
304
  const btnClasses = [
305
305
  `${baseClass}__segment`,
306
306
  isActive ? `${baseClass}__segment--active` : "",
307
- segment.disabled ? `${baseClass}__segment--disabled` : ""
307
+ segment.disabled ? `${baseClass}__segment--disabled` : "",
308
+ // Icon and label both on screen: the icon's edge takes a step
309
+ // less padding (design.md, SegmentedControl).
310
+ segment.icon && showLabels && collapseMode === "full" ? `${baseClass}__segment--icon-start` : ""
308
311
  ].filter(Boolean).join(" ");
309
312
  return /* @__PURE__ */ jsxs(
310
313
  "button",
@@ -174,13 +174,13 @@
174
174
  border-radius: calc(var(--radius-pill) + var(--padding-100));
175
175
  }
176
176
 
177
- .ds-site-header .ds-site-header__menu-button:not(.ds-circular-button--disabled):hover {
177
+ .ds-site-header .ds-site-header__menu-button:not(.ds-icon-button--disabled):hover {
178
178
  background-color: var(--color-bg-container-secondary);
179
179
  }
180
180
 
181
- .ds-site-header .ds-site-header__menu-button .ds-circular-button__icon,
182
- .ds-site-header .ds-site-header__menu-button:not(.ds-circular-button--disabled):hover .ds-circular-button__icon,
183
- .ds-site-header .ds-site-header__menu-button:not(.ds-circular-button--disabled):active .ds-circular-button__icon {
181
+ .ds-site-header .ds-site-header__menu-button .ds-icon-button__icon,
182
+ .ds-site-header .ds-site-header__menu-button:not(.ds-icon-button--disabled):hover .ds-icon-button__icon,
183
+ .ds-site-header .ds-site-header__menu-button:not(.ds-icon-button--disabled):active .ds-icon-button__icon {
184
184
  color: var(--color-action-icon-default);
185
185
  }
186
186
 
@@ -328,7 +328,7 @@
328
328
  turning into another. */
329
329
  .ds-site-header__drawer .ds-drawer__close .material-symbols-rounded {
330
330
  --icon-size: var(--icon-size-600);
331
- /* The glyph takes the close's on-scrim white, not CircularButton's
331
+ /* The glyph takes the close's on-scrim white, not IconButton's
332
332
  icon colour, which is dark in light mode and vanished on the scrim. */
333
333
  color: inherit;
334
334
  }
@@ -361,3 +361,10 @@
361
361
  .ds-site-header__drawer .ds-nav-list {
362
362
  width: 100%;
363
363
  }
364
+
365
+ /* Icon side padding, Button's rule: a section with a mega menu trails a
366
+ caret, whose box carries its own side bearing, so that pill's end takes
367
+ the step below the label side (16 → 12). */
368
+ .ds-site-header__pill:has(.ds-site-header__caret) {
369
+ padding-inline-end: var(--padding-300);
370
+ }
@@ -5,7 +5,7 @@ import { useLinkComponent } from "../../behaviors/LinkProvider.js";
5
5
  import { useLayer } from "../../behaviors/useLayer.js";
6
6
  import { isRtl } from "../../behaviors/direction.js";
7
7
  import { MOTION_HOVER_HIDE_DELAY_MS } from "../../tokens/motion.js";
8
- import { CircularButton } from "../CircularButton/CircularButton.js";
8
+ import { IconButton } from "../IconButton/IconButton.js";
9
9
  import { Drawer } from "../Drawer/Drawer.js";
10
10
  import { MegaMenu } from "../MegaMenu/MegaMenu.js";
11
11
  import { NavList } from "../NavList/NavList.js";
@@ -284,7 +284,7 @@ function SiteHeader({
284
284
  ),
285
285
  wideActions && /* @__PURE__ */ jsx("div", { ref: wideRef, className: `${baseClass}__wide-actions`, inert: folded, children: wideActions }),
286
286
  /* @__PURE__ */ jsx(
287
- CircularButton,
287
+ IconButton,
288
288
  {
289
289
  ref: menuButtonRef,
290
290
  className: [`${baseClass}__menu-button`, drawerOpen && `${baseClass}__menu-button--hidden`].filter(Boolean).join(" "),
@@ -292,7 +292,7 @@ function SiteHeader({
292
292
  size: "compact",
293
293
  variant: "secondary",
294
294
  tone: "neutral",
295
- ariaLabel: drawerOpenLabel,
295
+ label: drawerOpenLabel,
296
296
  tooltip: false,
297
297
  "aria-expanded": drawerOpen,
298
298
  "aria-haspopup": "dialog",
@@ -216,3 +216,11 @@
216
216
  .ds-source-trail .material-symbols-rounded:not(.ds-source-trail__chevron) {
217
217
  color: inherit;
218
218
  }
219
+
220
+ /* Icon side padding, Button's rule (design.md): a glyph's box carries its
221
+ own side bearing, so a side that holds one takes the step below the text
222
+ side. The header's chevron end steps in from the card inset; the
223
+ leading side keeps the inset, the line the body below it reads from. */
224
+ .ds-source-trail__header:has(.ds-source-trail__chevron) {
225
+ padding-inline-end: calc(var(--ds-chat-card-inset) - var(--padding-100));
226
+ }
@@ -35,33 +35,33 @@
35
35
  .ds-split-button .ds-split-button__trigger {
36
36
  border-start-start-radius: var(--radius-050);
37
37
  border-end-start-radius: var(--radius-050);
38
- /* Standalone, CircularButton is a fixed circle; inside the split its
38
+ /* Standalone, IconButton is a fixed even box; inside the split its
39
39
  explicit height would block the wrapper's align-items: stretch, and
40
40
  the main segment's height moves (secondary's border adds to it, a
41
41
  loading spinner grows it) — so the flat edges overhang at the seam.
42
42
  Let the flex stretch size it to the main segment instead. */
43
43
  height: auto;
44
44
  align-self: stretch;
45
+ /* Icon side padding, as Button's: the chevron's cap side takes one step
46
+ less than the even box would give it, so the trigger is a padding
47
+ step narrower than the row height and the chevron sits centred in it,
48
+ 6px either side. This replaces the old optical nudge toward the seam,
49
+ which reached the same seam-side gap by moving the glyph instead of
50
+ trimming the cap. The compact trigger keeps its even box: its
51
+ chevron already sits 6px from either side, and trimming it would put
52
+ the glyph in the cap's curve. */
53
+ width: calc(var(--control-height-default) - var(--padding-100));
45
54
  }
46
55
 
47
- /* Optical centering: the trigger is flat on the left and a full round cap
48
- on the right, so its visual mass sits left of the box centre (the
49
- centroid of a square-plus-semicircle is ~5% of the width off-centre).
50
- A geometrically centred chevron reads as pushed toward the cap; nudge
51
- it toward the flat edge to match. */
52
- .ds-split-button .ds-split-button__trigger .ds-circular-button__icon {
53
- transform: translateX(calc(-2px * var(--ds-inline-sign, 1)));
54
- }
55
-
56
- .ds-split-button .ds-split-button__trigger.ds-circular-button--compact .ds-circular-button__icon {
57
- transform: translateX(calc(-1px * var(--ds-inline-sign, 1)));
56
+ .ds-split-button .ds-split-button__trigger.ds-icon-button--compact {
57
+ width: var(--control-height-compact);
58
58
  }
59
59
 
60
60
  /* ============================================
61
61
  LOADING
62
62
  The trigger is inert while the main segment
63
63
  runs its async action, but it is busy, not
64
- broken: Button and CircularButton both define
64
+ broken: Button and IconButton both define
65
65
  loading as full-colour appearance with a
66
66
  progress cursor, and the disabled dim on one
67
67
  half would split the pill into two unrelated
@@ -70,7 +70,7 @@
70
70
  this rule deliberately stands down.
71
71
  ============================================ */
72
72
 
73
- .ds-split-button:has(.ds-button--loading:not(.ds-button--disabled)) .ds-split-button__trigger.ds-circular-button--disabled {
73
+ .ds-split-button:has(.ds-button--loading:not(.ds-button--disabled)) .ds-split-button__trigger.ds-icon-button--disabled {
74
74
  opacity: 1;
75
75
  cursor: progress;
76
76
  }
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { Button } from "../Button/Button.js";
4
- import { CircularButton } from "../CircularButton/CircularButton.js";
4
+ import { IconButton } from "../IconButton/IconButton.js";
5
5
  import { DropdownMenu } from "../DropdownMenu/DropdownMenu.js";
6
6
  import "./SplitButton.css";
7
7
  import "../../behaviors/direction.css";
@@ -55,12 +55,12 @@ const SplitButton = React.forwardRef(
55
55
  size,
56
56
  items,
57
57
  trigger: /* @__PURE__ */ jsx(
58
- CircularButton,
58
+ IconButton,
59
59
  {
60
60
  className: `${baseClass}__trigger`,
61
61
  icon: "keyboard_arrow_down",
62
62
  tooltip: false,
63
- ariaLabel: menuLabel,
63
+ label: menuLabel,
64
64
  variant: emphasis,
65
65
  tone: resolvedTone,
66
66
  size,
@@ -120,8 +120,8 @@
120
120
  /* A trigger whose panel is open (the More panel's columns, the Filter menu, a
121
121
  chip's editor) holds its pressed fill until the panel closes, so the
122
122
  bar says which control the open panel belongs to. */
123
- .ds-table-toolbar .ds-circular-button--tertiary[aria-expanded='true'],
124
- .ds-table-toolbar .ds-circular-button--secondary-neutral[aria-expanded='true'],
123
+ .ds-table-toolbar .ds-icon-button--tertiary[aria-expanded='true'],
124
+ .ds-table-toolbar .ds-icon-button--secondary-neutral[aria-expanded='true'],
125
125
  .ds-table-toolbar .ds-chip[aria-expanded='true'],
126
126
  .ds-table-toolbar .ds-button[aria-expanded='true'] {
127
127
  background-color: var(--color-action-passive-bg-active);