@runtypelabs/persona 4.19.0 → 4.20.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 (57) hide show
  1. package/dist/approval-ui.d.cts +77 -5
  2. package/dist/approval-ui.d.ts +77 -5
  3. package/dist/artifacts-ui.d.cts +77 -5
  4. package/dist/artifacts-ui.d.ts +77 -5
  5. package/dist/codegen.cjs +1 -1
  6. package/dist/codegen.js +1 -1
  7. package/dist/context-mentions.d.cts +77 -5
  8. package/dist/context-mentions.d.ts +77 -5
  9. package/dist/event-stream-view.d.cts +77 -5
  10. package/dist/event-stream-view.d.ts +77 -5
  11. package/dist/forms-ui.d.cts +77 -5
  12. package/dist/forms-ui.d.ts +77 -5
  13. package/dist/index.cjs +50 -50
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +78 -6
  16. package/dist/index.d.ts +78 -6
  17. package/dist/index.global.js +31 -31
  18. package/dist/index.global.js.map +1 -1
  19. package/dist/index.js +50 -50
  20. package/dist/index.js.map +1 -1
  21. package/dist/launcher.global.js.map +1 -1
  22. package/dist/session-reconnect.d.cts +77 -5
  23. package/dist/session-reconnect.d.ts +77 -5
  24. package/dist/smart-dom-reader.d.cts +77 -5
  25. package/dist/smart-dom-reader.d.ts +77 -5
  26. package/dist/theme-editor-preview.cjs +49 -49
  27. package/dist/theme-editor-preview.d.cts +77 -5
  28. package/dist/theme-editor-preview.d.ts +77 -5
  29. package/dist/theme-editor-preview.js +28 -28
  30. package/dist/theme-editor.d.cts +77 -5
  31. package/dist/theme-editor.d.ts +77 -5
  32. package/dist/theme-reference.cjs +1 -1
  33. package/dist/theme-reference.d.cts +46 -5
  34. package/dist/theme-reference.d.ts +46 -5
  35. package/dist/theme-reference.js +1 -1
  36. package/dist/widget.css +1 -1
  37. package/package.json +1 -1
  38. package/src/components/composer-actions.ts +27 -1
  39. package/src/components/composer-model-picker.ts +4 -14
  40. package/src/components/composer-overflow-menu.ts +14 -0
  41. package/src/components/composer-parts.ts +20 -0
  42. package/src/index-core.ts +2 -0
  43. package/src/styles/widget-styles.test.ts +83 -1
  44. package/src/styles/widget.css +50 -14
  45. package/src/theme-reference.ts +1 -1
  46. package/src/types/theme.ts +47 -5
  47. package/src/types.ts +33 -0
  48. package/src/ui.composer-action-visibility.test.ts +202 -0
  49. package/src/ui.composer-models.test.ts +37 -0
  50. package/src/ui.composer-modes.test.ts +82 -0
  51. package/src/ui.composer-overflow.test.ts +78 -0
  52. package/src/utils/__snapshots__/tokens-parity.test.ts.snap +1633 -686
  53. package/src/utils/composer-modes.test.ts +33 -0
  54. package/src/utils/composer-modes.ts +19 -2
  55. package/src/utils/tokens-parity.test.ts +20 -0
  56. package/src/utils/tokens.test.ts +76 -0
  57. package/src/utils/tokens.ts +4 -4
@@ -1224,27 +1224,66 @@ interface ComposerSegmentedTokens {
1224
1224
  itemPadding?: string;
1225
1225
  }
1226
1226
  /**
1227
- * Model picker popover (`composer.modelPicker.presentation: "popover"`).
1227
+ * Model picker chrome (`composer.models`).
1228
+ *
1229
+ * The surface keys (`background`, `hoverBackground`, `borderColor`,
1230
+ * `borderRadius`, `labelColor`) style the CLOSED control, so the native
1231
+ * `<select>` and the `presentation: "popover"` trigger share one vocabulary.
1232
+ * The `menu*`, `rowHoverBackground`, and `descriptionColor` keys style the
1233
+ * popover panel and are inert under the native select, as is `suffixColor`,
1234
+ * which a `<select>` cannot carry either.
1228
1235
  *
1229
1236
  * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1230
1237
  * fallbacks own the default look, which derives from the surface and ghost
1231
- * button tokens. Inert under the native `<select>` presentation, except
1232
- * `suffixColor`, which the native control cannot carry either.
1238
+ * button tokens.
1233
1239
  */
1234
1240
  interface ComposerModelPickerTokens {
1241
+ /** Closed control fill. @default the ghost button fill (transparent) */
1242
+ background?: TokenReference<'color'>;
1243
+ /** Closed control fill under hover. @default the ghost hover wash */
1244
+ hoverBackground?: TokenReference<'color'>;
1245
+ /**
1246
+ * Closed control outline, drawn as a 1px inset ring so setting it never
1247
+ * resizes the control. @default none
1248
+ */
1249
+ borderColor?: TokenReference<'color'>;
1250
+ /** Closed control corner radius. @default the ghost button radius */
1251
+ borderRadius?: TokenReference<'radius'>;
1235
1252
  /** Panel fill behind the rows. @default semantic.colors.surface */
1236
1253
  menuBackground?: TokenReference<'color'>;
1237
1254
  /** Panel corner radius. @default palette.radius.lg */
1238
1255
  menuBorderRadius?: TokenReference<'radius'>;
1239
1256
  /** Row fill under hover and the focused option. @default the ghost hover wash */
1240
1257
  rowHoverBackground?: TokenReference<'color'>;
1241
- /** Row label and closed-control label color. @default inherited text */
1258
+ /**
1259
+ * Row label color, plus the closed control's text and chevron in both
1260
+ * presentations. @default the ghost button foreground
1261
+ */
1242
1262
  labelColor?: TokenReference<'color'>;
1243
1263
  /** Second line under a row label. @default semantic.colors.textMuted */
1244
1264
  descriptionColor?: TokenReference<'color'>;
1245
1265
  /** `composer.modelPicker.suffix` on the closed control. @default semantic.colors.textMuted */
1246
1266
  suffixColor?: TokenReference<'color'>;
1247
1267
  }
1268
+ /**
1269
+ * Composer overflow `+` menu panel (`composer.actionOverflow`).
1270
+ *
1271
+ * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1272
+ * fallbacks own the default look. The panel is portaled outside the themed
1273
+ * mount, so the menu forwards the configured values onto it when it opens.
1274
+ */
1275
+ interface ComposerOverflowMenuTokens {
1276
+ /** Panel fill behind the rows. @default semantic.colors.surface */
1277
+ background?: TokenReference<'color'>;
1278
+ /** Panel border color. @default semantic.colors.border */
1279
+ borderColor?: TokenReference<'color'>;
1280
+ /** Panel corner radius. @default palette.radius.lg */
1281
+ borderRadius?: TokenReference<'radius'>;
1282
+ /** Row text and glyph color. @default semantic.colors.text */
1283
+ foreground?: TokenReference<'color'>;
1284
+ /** Panel elevation (raw CSS box-shadow, `none` allowed). @default palette.shadows.md */
1285
+ shadow?: string;
1286
+ }
1248
1287
  /** Composer (message input) chrome. */
1249
1288
  interface ComposerChromeTokens {
1250
1289
  /** Box-shadow on the composer form (raw CSS, e.g. `none`). */
@@ -1279,8 +1318,10 @@ interface ComposerChromeTokens {
1279
1318
  overlayBand?: string;
1280
1319
  /** Segmented mode-group track. */
1281
1320
  segmented?: ComposerSegmentedTokens;
1282
- /** Model picker popover chrome. */
1321
+ /** Model picker chrome (closed control plus popover panel). */
1283
1322
  modelPicker?: ComposerModelPickerTokens;
1323
+ /** Overflow `+` menu panel chrome. */
1324
+ overflowMenu?: ComposerOverflowMenuTokens;
1284
1325
  }
1285
1326
  /**
1286
1327
  * Motion timing shared by every composer animation.
@@ -5717,6 +5758,15 @@ type ComposerActionPlacement = "start" | "end";
5717
5758
  * it, `"overflow"` and `"auto"` both render in the bar.
5718
5759
  */
5719
5760
  type ComposerActionPresentation = "bar" | "overflow" | "auto";
5761
+ /**
5762
+ * When a composer action is mounted, as a function of the draft.
5763
+ *
5764
+ * - `"always"` (default): the control is always mounted.
5765
+ * - `"when-empty"`: hidden as soon as the draft holds text or an attachment,
5766
+ * and while a response streams.
5767
+ * - `"when-text"`: the inverse, on the same draft state the send control reads.
5768
+ */
5769
+ type ComposerActionVisibility = "always" | "when-empty" | "when-text";
5720
5770
  /**
5721
5771
  * Fields shared by every composer action.
5722
5772
  *
@@ -5732,6 +5782,13 @@ type ComposerActionBase = {
5732
5782
  presentation?: ComposerActionPresentation;
5733
5783
  order?: number;
5734
5784
  visible?: boolean | ((state: Readonly<ComposerState>) => boolean);
5785
+ /**
5786
+ * Draft-driven visibility, on the same state `sendButton.visibility` reads.
5787
+ * Hidden removes the control from layout and tab order. Combined with
5788
+ * `visible`: both must pass.
5789
+ * @default "always"
5790
+ */
5791
+ visibility?: ComposerActionVisibility;
5735
5792
  disabled?: boolean | ((state: Readonly<ComposerState>) => boolean);
5736
5793
  /** Disable while a response streams, through the composer's own mechanism. */
5737
5794
  disableWhenStreaming?: boolean;
@@ -5878,6 +5935,15 @@ type ComposerMode = {
5878
5935
  * row, never in the overflow menu.
5879
5936
  */
5880
5937
  type ComposerModeGroupPresentation = "buttons" | "segmented";
5938
+ /**
5939
+ * Whether a group's active modes also render as removable chips.
5940
+ *
5941
+ * - `"auto"` (default): one chip per active mode, except under `"segmented"`
5942
+ * presentation, where the track already shows the state.
5943
+ * - `"hidden"`: no chips for this group under any presentation. The pressed bar
5944
+ * button carries the state, and deselection stays on the button.
5945
+ */
5946
+ type ComposerModeChipVisibility = "auto" | "hidden";
5881
5947
  /**
5882
5948
  * Selection policy for a set of modes. `"single"` deselects siblings when one
5883
5949
  * is chosen; `"multiple"` toggles independently.
@@ -5887,6 +5953,12 @@ type ComposerModeGroup = {
5887
5953
  selection: "single" | "multiple";
5888
5954
  /** @default "buttons" */
5889
5955
  presentation?: ComposerModeGroupPresentation;
5956
+ /**
5957
+ * Chip row policy for this group's active modes. The chip row itself is
5958
+ * derived from its children, so a group with no other chips leaves no gap.
5959
+ * @default "auto"
5960
+ */
5961
+ chipVisibility?: ComposerModeChipVisibility;
5890
5962
  /**
5891
5963
  * Accessible name for a segmented track. With it the track is a labelled
5892
5964
  * `role="group"`; without it the segments stand on their own names.
@@ -1224,27 +1224,66 @@ interface ComposerSegmentedTokens {
1224
1224
  itemPadding?: string;
1225
1225
  }
1226
1226
  /**
1227
- * Model picker popover (`composer.modelPicker.presentation: "popover"`).
1227
+ * Model picker chrome (`composer.models`).
1228
+ *
1229
+ * The surface keys (`background`, `hoverBackground`, `borderColor`,
1230
+ * `borderRadius`, `labelColor`) style the CLOSED control, so the native
1231
+ * `<select>` and the `presentation: "popover"` trigger share one vocabulary.
1232
+ * The `menu*`, `rowHoverBackground`, and `descriptionColor` keys style the
1233
+ * popover panel and are inert under the native select, as is `suffixColor`,
1234
+ * which a `<select>` cannot carry either.
1228
1235
  *
1229
1236
  * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1230
1237
  * fallbacks own the default look, which derives from the surface and ghost
1231
- * button tokens. Inert under the native `<select>` presentation, except
1232
- * `suffixColor`, which the native control cannot carry either.
1238
+ * button tokens.
1233
1239
  */
1234
1240
  interface ComposerModelPickerTokens {
1241
+ /** Closed control fill. @default the ghost button fill (transparent) */
1242
+ background?: TokenReference<'color'>;
1243
+ /** Closed control fill under hover. @default the ghost hover wash */
1244
+ hoverBackground?: TokenReference<'color'>;
1245
+ /**
1246
+ * Closed control outline, drawn as a 1px inset ring so setting it never
1247
+ * resizes the control. @default none
1248
+ */
1249
+ borderColor?: TokenReference<'color'>;
1250
+ /** Closed control corner radius. @default the ghost button radius */
1251
+ borderRadius?: TokenReference<'radius'>;
1235
1252
  /** Panel fill behind the rows. @default semantic.colors.surface */
1236
1253
  menuBackground?: TokenReference<'color'>;
1237
1254
  /** Panel corner radius. @default palette.radius.lg */
1238
1255
  menuBorderRadius?: TokenReference<'radius'>;
1239
1256
  /** Row fill under hover and the focused option. @default the ghost hover wash */
1240
1257
  rowHoverBackground?: TokenReference<'color'>;
1241
- /** Row label and closed-control label color. @default inherited text */
1258
+ /**
1259
+ * Row label color, plus the closed control's text and chevron in both
1260
+ * presentations. @default the ghost button foreground
1261
+ */
1242
1262
  labelColor?: TokenReference<'color'>;
1243
1263
  /** Second line under a row label. @default semantic.colors.textMuted */
1244
1264
  descriptionColor?: TokenReference<'color'>;
1245
1265
  /** `composer.modelPicker.suffix` on the closed control. @default semantic.colors.textMuted */
1246
1266
  suffixColor?: TokenReference<'color'>;
1247
1267
  }
1268
+ /**
1269
+ * Composer overflow `+` menu panel (`composer.actionOverflow`).
1270
+ *
1271
+ * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1272
+ * fallbacks own the default look. The panel is portaled outside the themed
1273
+ * mount, so the menu forwards the configured values onto it when it opens.
1274
+ */
1275
+ interface ComposerOverflowMenuTokens {
1276
+ /** Panel fill behind the rows. @default semantic.colors.surface */
1277
+ background?: TokenReference<'color'>;
1278
+ /** Panel border color. @default semantic.colors.border */
1279
+ borderColor?: TokenReference<'color'>;
1280
+ /** Panel corner radius. @default palette.radius.lg */
1281
+ borderRadius?: TokenReference<'radius'>;
1282
+ /** Row text and glyph color. @default semantic.colors.text */
1283
+ foreground?: TokenReference<'color'>;
1284
+ /** Panel elevation (raw CSS box-shadow, `none` allowed). @default palette.shadows.md */
1285
+ shadow?: string;
1286
+ }
1248
1287
  /** Composer (message input) chrome. */
1249
1288
  interface ComposerChromeTokens {
1250
1289
  /** Box-shadow on the composer form (raw CSS, e.g. `none`). */
@@ -1279,8 +1318,10 @@ interface ComposerChromeTokens {
1279
1318
  overlayBand?: string;
1280
1319
  /** Segmented mode-group track. */
1281
1320
  segmented?: ComposerSegmentedTokens;
1282
- /** Model picker popover chrome. */
1321
+ /** Model picker chrome (closed control plus popover panel). */
1283
1322
  modelPicker?: ComposerModelPickerTokens;
1323
+ /** Overflow `+` menu panel chrome. */
1324
+ overflowMenu?: ComposerOverflowMenuTokens;
1284
1325
  }
1285
1326
  /**
1286
1327
  * Motion timing shared by every composer animation.
@@ -5717,6 +5758,15 @@ type ComposerActionPlacement = "start" | "end";
5717
5758
  * it, `"overflow"` and `"auto"` both render in the bar.
5718
5759
  */
5719
5760
  type ComposerActionPresentation = "bar" | "overflow" | "auto";
5761
+ /**
5762
+ * When a composer action is mounted, as a function of the draft.
5763
+ *
5764
+ * - `"always"` (default): the control is always mounted.
5765
+ * - `"when-empty"`: hidden as soon as the draft holds text or an attachment,
5766
+ * and while a response streams.
5767
+ * - `"when-text"`: the inverse, on the same draft state the send control reads.
5768
+ */
5769
+ type ComposerActionVisibility = "always" | "when-empty" | "when-text";
5720
5770
  /**
5721
5771
  * Fields shared by every composer action.
5722
5772
  *
@@ -5732,6 +5782,13 @@ type ComposerActionBase = {
5732
5782
  presentation?: ComposerActionPresentation;
5733
5783
  order?: number;
5734
5784
  visible?: boolean | ((state: Readonly<ComposerState>) => boolean);
5785
+ /**
5786
+ * Draft-driven visibility, on the same state `sendButton.visibility` reads.
5787
+ * Hidden removes the control from layout and tab order. Combined with
5788
+ * `visible`: both must pass.
5789
+ * @default "always"
5790
+ */
5791
+ visibility?: ComposerActionVisibility;
5735
5792
  disabled?: boolean | ((state: Readonly<ComposerState>) => boolean);
5736
5793
  /** Disable while a response streams, through the composer's own mechanism. */
5737
5794
  disableWhenStreaming?: boolean;
@@ -5878,6 +5935,15 @@ type ComposerMode = {
5878
5935
  * row, never in the overflow menu.
5879
5936
  */
5880
5937
  type ComposerModeGroupPresentation = "buttons" | "segmented";
5938
+ /**
5939
+ * Whether a group's active modes also render as removable chips.
5940
+ *
5941
+ * - `"auto"` (default): one chip per active mode, except under `"segmented"`
5942
+ * presentation, where the track already shows the state.
5943
+ * - `"hidden"`: no chips for this group under any presentation. The pressed bar
5944
+ * button carries the state, and deselection stays on the button.
5945
+ */
5946
+ type ComposerModeChipVisibility = "auto" | "hidden";
5881
5947
  /**
5882
5948
  * Selection policy for a set of modes. `"single"` deselects siblings when one
5883
5949
  * is chosen; `"multiple"` toggles independently.
@@ -5887,6 +5953,12 @@ type ComposerModeGroup = {
5887
5953
  selection: "single" | "multiple";
5888
5954
  /** @default "buttons" */
5889
5955
  presentation?: ComposerModeGroupPresentation;
5956
+ /**
5957
+ * Chip row policy for this group's active modes. The chip row itself is
5958
+ * derived from its children, so a group with no other chips leaves no gap.
5959
+ * @default "auto"
5960
+ */
5961
+ chipVisibility?: ComposerModeChipVisibility;
5890
5962
  /**
5891
5963
  * Accessible name for a segmented track. With it the track is a labelled
5892
5964
  * `role="group"`; without it the segments stand on their own names.
@@ -1493,27 +1493,66 @@ interface ComposerSegmentedTokens {
1493
1493
  itemPadding?: string;
1494
1494
  }
1495
1495
  /**
1496
- * Model picker popover (`composer.modelPicker.presentation: "popover"`).
1496
+ * Model picker chrome (`composer.models`).
1497
+ *
1498
+ * The surface keys (`background`, `hoverBackground`, `borderColor`,
1499
+ * `borderRadius`, `labelColor`) style the CLOSED control, so the native
1500
+ * `<select>` and the `presentation: "popover"` trigger share one vocabulary.
1501
+ * The `menu*`, `rowHoverBackground`, and `descriptionColor` keys style the
1502
+ * popover panel and are inert under the native select, as is `suffixColor`,
1503
+ * which a `<select>` cannot carry either.
1497
1504
  *
1498
1505
  * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1499
1506
  * fallbacks own the default look, which derives from the surface and ghost
1500
- * button tokens. Inert under the native `<select>` presentation, except
1501
- * `suffixColor`, which the native control cannot carry either.
1507
+ * button tokens.
1502
1508
  */
1503
1509
  interface ComposerModelPickerTokens {
1510
+ /** Closed control fill. @default the ghost button fill (transparent) */
1511
+ background?: TokenReference<'color'>;
1512
+ /** Closed control fill under hover. @default the ghost hover wash */
1513
+ hoverBackground?: TokenReference<'color'>;
1514
+ /**
1515
+ * Closed control outline, drawn as a 1px inset ring so setting it never
1516
+ * resizes the control. @default none
1517
+ */
1518
+ borderColor?: TokenReference<'color'>;
1519
+ /** Closed control corner radius. @default the ghost button radius */
1520
+ borderRadius?: TokenReference<'radius'>;
1504
1521
  /** Panel fill behind the rows. @default semantic.colors.surface */
1505
1522
  menuBackground?: TokenReference<'color'>;
1506
1523
  /** Panel corner radius. @default palette.radius.lg */
1507
1524
  menuBorderRadius?: TokenReference<'radius'>;
1508
1525
  /** Row fill under hover and the focused option. @default the ghost hover wash */
1509
1526
  rowHoverBackground?: TokenReference<'color'>;
1510
- /** Row label and closed-control label color. @default inherited text */
1527
+ /**
1528
+ * Row label color, plus the closed control's text and chevron in both
1529
+ * presentations. @default the ghost button foreground
1530
+ */
1511
1531
  labelColor?: TokenReference<'color'>;
1512
1532
  /** Second line under a row label. @default semantic.colors.textMuted */
1513
1533
  descriptionColor?: TokenReference<'color'>;
1514
1534
  /** `composer.modelPicker.suffix` on the closed control. @default semantic.colors.textMuted */
1515
1535
  suffixColor?: TokenReference<'color'>;
1516
1536
  }
1537
+ /**
1538
+ * Composer overflow `+` menu panel (`composer.actionOverflow`).
1539
+ *
1540
+ * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1541
+ * fallbacks own the default look. The panel is portaled outside the themed
1542
+ * mount, so the menu forwards the configured values onto it when it opens.
1543
+ */
1544
+ interface ComposerOverflowMenuTokens {
1545
+ /** Panel fill behind the rows. @default semantic.colors.surface */
1546
+ background?: TokenReference<'color'>;
1547
+ /** Panel border color. @default semantic.colors.border */
1548
+ borderColor?: TokenReference<'color'>;
1549
+ /** Panel corner radius. @default palette.radius.lg */
1550
+ borderRadius?: TokenReference<'radius'>;
1551
+ /** Row text and glyph color. @default semantic.colors.text */
1552
+ foreground?: TokenReference<'color'>;
1553
+ /** Panel elevation (raw CSS box-shadow, `none` allowed). @default palette.shadows.md */
1554
+ shadow?: string;
1555
+ }
1517
1556
  /** Composer (message input) chrome. */
1518
1557
  interface ComposerChromeTokens {
1519
1558
  /** Box-shadow on the composer form (raw CSS, e.g. `none`). */
@@ -1548,8 +1587,10 @@ interface ComposerChromeTokens {
1548
1587
  overlayBand?: string;
1549
1588
  /** Segmented mode-group track. */
1550
1589
  segmented?: ComposerSegmentedTokens;
1551
- /** Model picker popover chrome. */
1590
+ /** Model picker chrome (closed control plus popover panel). */
1552
1591
  modelPicker?: ComposerModelPickerTokens;
1592
+ /** Overflow `+` menu panel chrome. */
1593
+ overflowMenu?: ComposerOverflowMenuTokens;
1553
1594
  }
1554
1595
  /**
1555
1596
  * Motion timing shared by every composer animation.
@@ -5986,6 +6027,15 @@ type ComposerActionPlacement = "start" | "end";
5986
6027
  * it, `"overflow"` and `"auto"` both render in the bar.
5987
6028
  */
5988
6029
  type ComposerActionPresentation = "bar" | "overflow" | "auto";
6030
+ /**
6031
+ * When a composer action is mounted, as a function of the draft.
6032
+ *
6033
+ * - `"always"` (default): the control is always mounted.
6034
+ * - `"when-empty"`: hidden as soon as the draft holds text or an attachment,
6035
+ * and while a response streams.
6036
+ * - `"when-text"`: the inverse, on the same draft state the send control reads.
6037
+ */
6038
+ type ComposerActionVisibility = "always" | "when-empty" | "when-text";
5989
6039
  /**
5990
6040
  * Fields shared by every composer action.
5991
6041
  *
@@ -6001,6 +6051,13 @@ type ComposerActionBase = {
6001
6051
  presentation?: ComposerActionPresentation;
6002
6052
  order?: number;
6003
6053
  visible?: boolean | ((state: Readonly<ComposerState>) => boolean);
6054
+ /**
6055
+ * Draft-driven visibility, on the same state `sendButton.visibility` reads.
6056
+ * Hidden removes the control from layout and tab order. Combined with
6057
+ * `visible`: both must pass.
6058
+ * @default "always"
6059
+ */
6060
+ visibility?: ComposerActionVisibility;
6004
6061
  disabled?: boolean | ((state: Readonly<ComposerState>) => boolean);
6005
6062
  /** Disable while a response streams, through the composer's own mechanism. */
6006
6063
  disableWhenStreaming?: boolean;
@@ -6147,6 +6204,15 @@ type ComposerMode = {
6147
6204
  * row, never in the overflow menu.
6148
6205
  */
6149
6206
  type ComposerModeGroupPresentation = "buttons" | "segmented";
6207
+ /**
6208
+ * Whether a group's active modes also render as removable chips.
6209
+ *
6210
+ * - `"auto"` (default): one chip per active mode, except under `"segmented"`
6211
+ * presentation, where the track already shows the state.
6212
+ * - `"hidden"`: no chips for this group under any presentation. The pressed bar
6213
+ * button carries the state, and deselection stays on the button.
6214
+ */
6215
+ type ComposerModeChipVisibility = "auto" | "hidden";
6150
6216
  /**
6151
6217
  * Selection policy for a set of modes. `"single"` deselects siblings when one
6152
6218
  * is chosen; `"multiple"` toggles independently.
@@ -6156,6 +6222,12 @@ type ComposerModeGroup = {
6156
6222
  selection: "single" | "multiple";
6157
6223
  /** @default "buttons" */
6158
6224
  presentation?: ComposerModeGroupPresentation;
6225
+ /**
6226
+ * Chip row policy for this group's active modes. The chip row itself is
6227
+ * derived from its children, so a group with no other chips leaves no gap.
6228
+ * @default "auto"
6229
+ */
6230
+ chipVisibility?: ComposerModeChipVisibility;
6159
6231
  /**
6160
6232
  * Accessible name for a segmented track. With it the track is a labelled
6161
6233
  * `role="group"`; without it the segments stand on their own names.
@@ -1493,27 +1493,66 @@ interface ComposerSegmentedTokens {
1493
1493
  itemPadding?: string;
1494
1494
  }
1495
1495
  /**
1496
- * Model picker popover (`composer.modelPicker.presentation: "popover"`).
1496
+ * Model picker chrome (`composer.models`).
1497
+ *
1498
+ * The surface keys (`background`, `hoverBackground`, `borderColor`,
1499
+ * `borderRadius`, `labelColor`) style the CLOSED control, so the native
1500
+ * `<select>` and the `presentation: "popover"` trigger share one vocabulary.
1501
+ * The `menu*`, `rowHoverBackground`, and `descriptionColor` keys style the
1502
+ * popover panel and are inert under the native select, as is `suffixColor`,
1503
+ * which a `<select>` cannot carry either.
1497
1504
  *
1498
1505
  * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1499
1506
  * fallbacks own the default look, which derives from the surface and ghost
1500
- * button tokens. Inert under the native `<select>` presentation, except
1501
- * `suffixColor`, which the native control cannot carry either.
1507
+ * button tokens.
1502
1508
  */
1503
1509
  interface ComposerModelPickerTokens {
1510
+ /** Closed control fill. @default the ghost button fill (transparent) */
1511
+ background?: TokenReference<'color'>;
1512
+ /** Closed control fill under hover. @default the ghost hover wash */
1513
+ hoverBackground?: TokenReference<'color'>;
1514
+ /**
1515
+ * Closed control outline, drawn as a 1px inset ring so setting it never
1516
+ * resizes the control. @default none
1517
+ */
1518
+ borderColor?: TokenReference<'color'>;
1519
+ /** Closed control corner radius. @default the ghost button radius */
1520
+ borderRadius?: TokenReference<'radius'>;
1504
1521
  /** Panel fill behind the rows. @default semantic.colors.surface */
1505
1522
  menuBackground?: TokenReference<'color'>;
1506
1523
  /** Panel corner radius. @default palette.radius.lg */
1507
1524
  menuBorderRadius?: TokenReference<'radius'>;
1508
1525
  /** Row fill under hover and the focused option. @default the ghost hover wash */
1509
1526
  rowHoverBackground?: TokenReference<'color'>;
1510
- /** Row label and closed-control label color. @default inherited text */
1527
+ /**
1528
+ * Row label color, plus the closed control's text and chevron in both
1529
+ * presentations. @default the ghost button foreground
1530
+ */
1511
1531
  labelColor?: TokenReference<'color'>;
1512
1532
  /** Second line under a row label. @default semantic.colors.textMuted */
1513
1533
  descriptionColor?: TokenReference<'color'>;
1514
1534
  /** `composer.modelPicker.suffix` on the closed control. @default semantic.colors.textMuted */
1515
1535
  suffixColor?: TokenReference<'color'>;
1516
1536
  }
1537
+ /**
1538
+ * Composer overflow `+` menu panel (`composer.actionOverflow`).
1539
+ *
1540
+ * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1541
+ * fallbacks own the default look. The panel is portaled outside the themed
1542
+ * mount, so the menu forwards the configured values onto it when it opens.
1543
+ */
1544
+ interface ComposerOverflowMenuTokens {
1545
+ /** Panel fill behind the rows. @default semantic.colors.surface */
1546
+ background?: TokenReference<'color'>;
1547
+ /** Panel border color. @default semantic.colors.border */
1548
+ borderColor?: TokenReference<'color'>;
1549
+ /** Panel corner radius. @default palette.radius.lg */
1550
+ borderRadius?: TokenReference<'radius'>;
1551
+ /** Row text and glyph color. @default semantic.colors.text */
1552
+ foreground?: TokenReference<'color'>;
1553
+ /** Panel elevation (raw CSS box-shadow, `none` allowed). @default palette.shadows.md */
1554
+ shadow?: string;
1555
+ }
1517
1556
  /** Composer (message input) chrome. */
1518
1557
  interface ComposerChromeTokens {
1519
1558
  /** Box-shadow on the composer form (raw CSS, e.g. `none`). */
@@ -1548,8 +1587,10 @@ interface ComposerChromeTokens {
1548
1587
  overlayBand?: string;
1549
1588
  /** Segmented mode-group track. */
1550
1589
  segmented?: ComposerSegmentedTokens;
1551
- /** Model picker popover chrome. */
1590
+ /** Model picker chrome (closed control plus popover panel). */
1552
1591
  modelPicker?: ComposerModelPickerTokens;
1592
+ /** Overflow `+` menu panel chrome. */
1593
+ overflowMenu?: ComposerOverflowMenuTokens;
1553
1594
  }
1554
1595
  /**
1555
1596
  * Motion timing shared by every composer animation.
@@ -5986,6 +6027,15 @@ type ComposerActionPlacement = "start" | "end";
5986
6027
  * it, `"overflow"` and `"auto"` both render in the bar.
5987
6028
  */
5988
6029
  type ComposerActionPresentation = "bar" | "overflow" | "auto";
6030
+ /**
6031
+ * When a composer action is mounted, as a function of the draft.
6032
+ *
6033
+ * - `"always"` (default): the control is always mounted.
6034
+ * - `"when-empty"`: hidden as soon as the draft holds text or an attachment,
6035
+ * and while a response streams.
6036
+ * - `"when-text"`: the inverse, on the same draft state the send control reads.
6037
+ */
6038
+ type ComposerActionVisibility = "always" | "when-empty" | "when-text";
5989
6039
  /**
5990
6040
  * Fields shared by every composer action.
5991
6041
  *
@@ -6001,6 +6051,13 @@ type ComposerActionBase = {
6001
6051
  presentation?: ComposerActionPresentation;
6002
6052
  order?: number;
6003
6053
  visible?: boolean | ((state: Readonly<ComposerState>) => boolean);
6054
+ /**
6055
+ * Draft-driven visibility, on the same state `sendButton.visibility` reads.
6056
+ * Hidden removes the control from layout and tab order. Combined with
6057
+ * `visible`: both must pass.
6058
+ * @default "always"
6059
+ */
6060
+ visibility?: ComposerActionVisibility;
6004
6061
  disabled?: boolean | ((state: Readonly<ComposerState>) => boolean);
6005
6062
  /** Disable while a response streams, through the composer's own mechanism. */
6006
6063
  disableWhenStreaming?: boolean;
@@ -6147,6 +6204,15 @@ type ComposerMode = {
6147
6204
  * row, never in the overflow menu.
6148
6205
  */
6149
6206
  type ComposerModeGroupPresentation = "buttons" | "segmented";
6207
+ /**
6208
+ * Whether a group's active modes also render as removable chips.
6209
+ *
6210
+ * - `"auto"` (default): one chip per active mode, except under `"segmented"`
6211
+ * presentation, where the track already shows the state.
6212
+ * - `"hidden"`: no chips for this group under any presentation. The pressed bar
6213
+ * button carries the state, and deselection stays on the button.
6214
+ */
6215
+ type ComposerModeChipVisibility = "auto" | "hidden";
6150
6216
  /**
6151
6217
  * Selection policy for a set of modes. `"single"` deselects siblings when one
6152
6218
  * is chosen; `"multiple"` toggles independently.
@@ -6156,6 +6222,12 @@ type ComposerModeGroup = {
6156
6222
  selection: "single" | "multiple";
6157
6223
  /** @default "buttons" */
6158
6224
  presentation?: ComposerModeGroupPresentation;
6225
+ /**
6226
+ * Chip row policy for this group's active modes. The chip row itself is
6227
+ * derived from its children, so a group with no other chips leaves no gap.
6228
+ * @default "auto"
6229
+ */
6230
+ chipVisibility?: ComposerModeChipVisibility;
6159
6231
  /**
6160
6232
  * Accessible name for a segmented track. With it the track is a labelled
6161
6233
  * `role="group"`; without it the segments stand on their own names.