@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.
- package/dist/approval-ui.d.cts +77 -5
- package/dist/approval-ui.d.ts +77 -5
- package/dist/artifacts-ui.d.cts +77 -5
- package/dist/artifacts-ui.d.ts +77 -5
- package/dist/codegen.cjs +1 -1
- package/dist/codegen.js +1 -1
- package/dist/context-mentions.d.cts +77 -5
- package/dist/context-mentions.d.ts +77 -5
- package/dist/event-stream-view.d.cts +77 -5
- package/dist/event-stream-view.d.ts +77 -5
- package/dist/forms-ui.d.cts +77 -5
- package/dist/forms-ui.d.ts +77 -5
- package/dist/index.cjs +50 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +78 -6
- package/dist/index.d.ts +78 -6
- package/dist/index.global.js +31 -31
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +50 -50
- package/dist/index.js.map +1 -1
- package/dist/launcher.global.js.map +1 -1
- package/dist/session-reconnect.d.cts +77 -5
- package/dist/session-reconnect.d.ts +77 -5
- package/dist/smart-dom-reader.d.cts +77 -5
- package/dist/smart-dom-reader.d.ts +77 -5
- package/dist/theme-editor-preview.cjs +49 -49
- package/dist/theme-editor-preview.d.cts +77 -5
- package/dist/theme-editor-preview.d.ts +77 -5
- package/dist/theme-editor-preview.js +28 -28
- package/dist/theme-editor.d.cts +77 -5
- package/dist/theme-editor.d.ts +77 -5
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.d.cts +46 -5
- package/dist/theme-reference.d.ts +46 -5
- package/dist/theme-reference.js +1 -1
- package/dist/widget.css +1 -1
- package/package.json +1 -1
- package/src/components/composer-actions.ts +27 -1
- package/src/components/composer-model-picker.ts +4 -14
- package/src/components/composer-overflow-menu.ts +14 -0
- package/src/components/composer-parts.ts +20 -0
- package/src/index-core.ts +2 -0
- package/src/styles/widget-styles.test.ts +83 -1
- package/src/styles/widget.css +50 -14
- package/src/theme-reference.ts +1 -1
- package/src/types/theme.ts +47 -5
- package/src/types.ts +33 -0
- package/src/ui.composer-action-visibility.test.ts +202 -0
- package/src/ui.composer-models.test.ts +37 -0
- package/src/ui.composer-modes.test.ts +82 -0
- package/src/ui.composer-overflow.test.ts +78 -0
- package/src/utils/__snapshots__/tokens-parity.test.ts.snap +1633 -686
- package/src/utils/composer-modes.test.ts +33 -0
- package/src/utils/composer-modes.ts +19 -2
- package/src/utils/tokens-parity.test.ts +20 -0
- package/src/utils/tokens.test.ts +76 -0
- package/src/utils/tokens.ts +4 -4
|
@@ -1224,27 +1224,66 @@ interface ComposerSegmentedTokens {
|
|
|
1224
1224
|
itemPadding?: string;
|
|
1225
1225
|
}
|
|
1226
1226
|
/**
|
|
1227
|
-
* Model picker
|
|
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.
|
|
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
|
-
/**
|
|
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
|
|
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
|
|
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.
|
|
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
|
-
/**
|
|
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
|
|
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
|
|
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.
|
|
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
|
-
/**
|
|
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
|
|
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
|
|
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.
|
|
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
|
-
/**
|
|
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
|
|
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.
|