@salmonui/chat 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -2
  3. package/dist/conversation/Conversation.d.ts +4 -0
  4. package/dist/conversation/Conversation.d.ts.map +1 -0
  5. package/dist/conversation/Conversation.js +588 -0
  6. package/dist/conversation/Conversation.js.map +1 -0
  7. package/dist/conversation/Item.d.ts +67 -0
  8. package/dist/conversation/Item.d.ts.map +1 -0
  9. package/dist/conversation/Item.js +149 -0
  10. package/dist/conversation/Item.js.map +1 -0
  11. package/dist/conversation/assistant-lazy.d.ts +6 -0
  12. package/dist/conversation/assistant-lazy.d.ts.map +1 -0
  13. package/dist/conversation/assistant-lazy.js +16 -0
  14. package/dist/conversation/assistant-lazy.js.map +1 -0
  15. package/dist/conversation/assistant-static.d.ts +4 -0
  16. package/dist/conversation/assistant-static.d.ts.map +1 -0
  17. package/dist/conversation/assistant-static.js +9 -0
  18. package/dist/conversation/assistant-static.js.map +1 -0
  19. package/dist/conversation/assistant-types.d.ts +2 -0
  20. package/dist/conversation/assistant-types.d.ts.map +1 -0
  21. package/dist/conversation/assistant-types.js +3 -0
  22. package/dist/conversation/assistant-types.js.map +1 -0
  23. package/dist/conversation/assistant.d.ts +54 -0
  24. package/dist/conversation/assistant.d.ts.map +1 -0
  25. package/dist/conversation/assistant.js +348 -0
  26. package/dist/conversation/assistant.js.map +1 -0
  27. package/dist/conversation/context.d.ts +80 -0
  28. package/dist/conversation/context.d.ts.map +1 -0
  29. package/dist/conversation/context.js +40 -0
  30. package/dist/conversation/context.js.map +1 -0
  31. package/dist/conversation/format.d.ts +33 -0
  32. package/dist/conversation/format.d.ts.map +1 -0
  33. package/dist/conversation/format.js +150 -0
  34. package/dist/conversation/format.js.map +1 -0
  35. package/dist/conversation/parts.d.ts +16 -0
  36. package/dist/conversation/parts.d.ts.map +1 -0
  37. package/dist/conversation/parts.js +326 -0
  38. package/dist/conversation/parts.js.map +1 -0
  39. package/dist/conversation/runner.d.ts +15 -0
  40. package/dist/conversation/runner.d.ts.map +1 -0
  41. package/dist/conversation/runner.js +52 -0
  42. package/dist/conversation/runner.js.map +1 -0
  43. package/dist/conversation/store.d.ts +63 -0
  44. package/dist/conversation/store.d.ts.map +1 -0
  45. package/dist/conversation/store.js +142 -0
  46. package/dist/conversation/store.js.map +1 -0
  47. package/dist/conversation/types.d.ts +473 -0
  48. package/dist/conversation/types.d.ts.map +1 -0
  49. package/dist/conversation/types.js +5 -0
  50. package/dist/conversation/types.js.map +1 -0
  51. package/dist/conversation.css +788 -0
  52. package/dist/conversation.d.ts +18 -0
  53. package/dist/conversation.d.ts.map +1 -0
  54. package/dist/conversation.js +26 -0
  55. package/dist/conversation.js.map +1 -0
  56. package/dist/inline-assist/InlineAssist.d.ts +16 -0
  57. package/dist/inline-assist/InlineAssist.d.ts.map +1 -0
  58. package/dist/inline-assist/InlineAssist.js +384 -0
  59. package/dist/inline-assist/InlineAssist.js.map +1 -0
  60. package/dist/inline-assist/model.d.ts +40 -0
  61. package/dist/inline-assist/model.d.ts.map +1 -0
  62. package/dist/inline-assist/model.js +87 -0
  63. package/dist/inline-assist/model.js.map +1 -0
  64. package/dist/inline-assist/types.d.ts +216 -0
  65. package/dist/inline-assist/types.d.ts.map +1 -0
  66. package/dist/inline-assist/types.js +5 -0
  67. package/dist/inline-assist/types.js.map +1 -0
  68. package/dist/inline-assist.css +890 -0
  69. package/dist/inline-assist.d.ts +5 -0
  70. package/dist/inline-assist.d.ts.map +1 -0
  71. package/dist/inline-assist.js +12 -0
  72. package/dist/inline-assist.js.map +1 -0
  73. package/dist/internal/stream-run.d.ts +71 -0
  74. package/dist/internal/stream-run.d.ts.map +1 -0
  75. package/dist/internal/stream-run.js +161 -0
  76. package/dist/internal/stream-run.js.map +1 -0
  77. package/dist/internal/suggest.d.ts +90 -0
  78. package/dist/internal/suggest.d.ts.map +1 -0
  79. package/dist/internal/suggest.js +332 -0
  80. package/dist/internal/suggest.js.map +1 -0
  81. package/dist/smart-paste/fields.d.ts +31 -0
  82. package/dist/smart-paste/fields.d.ts.map +1 -0
  83. package/dist/smart-paste/fields.js +162 -0
  84. package/dist/smart-paste/fields.js.map +1 -0
  85. package/dist/smart-paste/useSmartPaste.d.ts +38 -0
  86. package/dist/smart-paste/useSmartPaste.d.ts.map +1 -0
  87. package/dist/smart-paste/useSmartPaste.js +56 -0
  88. package/dist/smart-paste/useSmartPaste.js.map +1 -0
  89. package/dist/smart-paste.d.ts +3 -0
  90. package/dist/smart-paste.d.ts.map +1 -0
  91. package/dist/smart-paste.js +6 -0
  92. package/dist/smart-paste.js.map +1 -0
  93. package/dist/styles.css +1754 -0
  94. package/dist/text-suggest/useTextSuggest.d.ts +13 -0
  95. package/dist/text-suggest/useTextSuggest.d.ts.map +1 -0
  96. package/dist/text-suggest/useTextSuggest.js +55 -0
  97. package/dist/text-suggest/useTextSuggest.js.map +1 -0
  98. package/dist/text-suggest.css +78 -0
  99. package/dist/text-suggest.d.ts +4 -0
  100. package/dist/text-suggest.d.ts.map +1 -0
  101. package/dist/text-suggest.js +9 -0
  102. package/dist/text-suggest.js.map +1 -0
  103. package/package.json +68 -4
@@ -0,0 +1,890 @@
1
+ @layer salmon.a,salmon.b,salmon.c,salmon.d;
2
+ @layer salmon.a {
3
+ /* @salmonui/buttons/button/styles.css, first part (button-core): Button,
4
+ ToggleButton, ButtonGroup, ToggleButtonGroup without the chip, progress
5
+ and floating extras of styles/button.css. Colors come from --salmon-*
6
+ theme variables only; tone and variant are orthogonal (data-tone x
7
+ data-variant); sizes are three fixed metric sets. Logical properties only. */
8
+
9
+ .salmon-button {
10
+ --salmon-button-c: var(--salmon-surface-sunken);
11
+ --salmon-button-c-hover: var(--salmon-surface-hover);
12
+ --salmon-button-c-active: var(--salmon-border-subtle);
13
+ --salmon-button-c-on: var(--salmon-text-primary);
14
+ --salmon-button-c-edge: var(--salmon-border-default);
15
+ --salmon-button-c-subtle: var(--salmon-surface-hover);
16
+ --salmon-button-c-subtle-hover: var(--salmon-surface-sunken);
17
+ --salmon-button-c-text: var(--salmon-text-primary);
18
+ --salmon-button-c-border: var(--salmon-border-default);
19
+ --salmon-button-c-selected: var(--salmon-surface-selected);
20
+ --salmon-button-c-selected-edge: var(--salmon-border-selected);
21
+ --salmon-button-h: var(--salmon-control-height-md, 32px);
22
+ --salmon-button-pad: var(--salmon-control-padding-md, 12px);
23
+ --salmon-button-bg: var(--salmon-button-c);
24
+ --salmon-button-fg: var(--salmon-button-c-on);
25
+ --salmon-button-bd: var(--salmon-button-c-edge);
26
+ position: relative;
27
+ isolation: isolate;
28
+ display: inline-flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ gap: 6px;
32
+ box-sizing: border-box;
33
+ min-block-size: var(--salmon-button-h);
34
+ margin: 0;
35
+ padding-block: 0;
36
+ padding-inline: var(--salmon-button-pad);
37
+ overflow: hidden;
38
+ border: 1px solid var(--salmon-button-bd);
39
+ border-radius: var(--salmon-radius-md);
40
+ background: var(--salmon-button-bg);
41
+ color: var(--salmon-button-fg);
42
+ font-family: var(--salmon-font-sans);
43
+ font-size: var(--salmon-font-size-md);
44
+ font-weight: var(--salmon-font-weight-medium);
45
+ line-height: var(--salmon-line-height-tight);
46
+ text-decoration: none;
47
+ white-space: nowrap;
48
+ vertical-align: middle;
49
+ cursor: pointer;
50
+ user-select: none;
51
+ -webkit-tap-highlight-color: transparent;
52
+ transition: background-color var(--salmon-motion-duration-fast) var(--salmon-motion-easing), border-color var(--salmon-motion-duration-fast) var(--salmon-motion-easing), color var(--salmon-motion-duration-fast) var(--salmon-motion-easing);
53
+ }
54
+
55
+ /* The class's display would override the native hidden attribute. */
56
+ .salmon-button[hidden] {
57
+ display: none;
58
+ }
59
+
60
+ .salmon-button[data-tone='primary'],
61
+ .salmon-button[data-tone='success'],
62
+ .salmon-button[data-tone='warning'],
63
+ .salmon-button[data-tone='danger'],
64
+ .salmon-button[data-tone='info'] {
65
+ --salmon-button-c-edge: var(--salmon-button-c);
66
+ --salmon-button-c-selected: var(--salmon-button-c-subtle);
67
+ --salmon-button-c-selected-edge: var(--salmon-button-c);
68
+ }
69
+ .salmon-button[data-tone='primary'] {
70
+ --salmon-button-c: var(--salmon-color-primary);
71
+ --salmon-button-c-hover: var(--salmon-color-primary-hover);
72
+ --salmon-button-c-active: var(--salmon-color-primary-active);
73
+ --salmon-button-c-on: var(--salmon-color-primary-on);
74
+ --salmon-button-c-subtle: var(--salmon-color-primary-subtle);
75
+ --salmon-button-c-subtle-hover: var(--salmon-color-primary-subtle-hover);
76
+ --salmon-button-c-text: var(--salmon-color-primary-text);
77
+ --salmon-button-c-border: var(--salmon-color-primary-border);
78
+ }
79
+ .salmon-button[data-tone='success'] {
80
+ --salmon-button-c: var(--salmon-color-success);
81
+ --salmon-button-c-hover: var(--salmon-color-success-hover);
82
+ --salmon-button-c-active: var(--salmon-color-success-active);
83
+ --salmon-button-c-on: var(--salmon-color-success-on);
84
+ --salmon-button-c-subtle: var(--salmon-color-success-subtle);
85
+ --salmon-button-c-subtle-hover: var(--salmon-color-success-subtle-hover);
86
+ --salmon-button-c-text: var(--salmon-color-success-text);
87
+ --salmon-button-c-border: var(--salmon-color-success-border);
88
+ }
89
+ .salmon-button[data-tone='warning'] {
90
+ --salmon-button-c: var(--salmon-color-warning);
91
+ --salmon-button-c-hover: var(--salmon-color-warning-hover);
92
+ --salmon-button-c-active: var(--salmon-color-warning-active);
93
+ --salmon-button-c-on: var(--salmon-color-warning-on);
94
+ --salmon-button-c-subtle: var(--salmon-color-warning-subtle);
95
+ --salmon-button-c-subtle-hover: var(--salmon-color-warning-subtle-hover);
96
+ --salmon-button-c-text: var(--salmon-color-warning-text);
97
+ --salmon-button-c-border: var(--salmon-color-warning-border);
98
+ }
99
+ .salmon-button[data-tone='danger'] {
100
+ --salmon-button-c: var(--salmon-color-danger);
101
+ --salmon-button-c-hover: var(--salmon-color-danger-hover);
102
+ --salmon-button-c-active: var(--salmon-color-danger-active);
103
+ --salmon-button-c-on: var(--salmon-color-danger-on);
104
+ --salmon-button-c-subtle: var(--salmon-color-danger-subtle);
105
+ --salmon-button-c-subtle-hover: var(--salmon-color-danger-subtle-hover);
106
+ --salmon-button-c-text: var(--salmon-color-danger-text);
107
+ --salmon-button-c-border: var(--salmon-color-danger-border);
108
+ }
109
+ .salmon-button[data-tone='info'] {
110
+ --salmon-button-c: var(--salmon-color-info);
111
+ --salmon-button-c-hover: var(--salmon-color-info-hover);
112
+ --salmon-button-c-active: var(--salmon-color-info-active);
113
+ --salmon-button-c-on: var(--salmon-color-info-on);
114
+ --salmon-button-c-subtle: var(--salmon-color-info-subtle);
115
+ --salmon-button-c-subtle-hover: var(--salmon-color-info-subtle-hover);
116
+ --salmon-button-c-text: var(--salmon-color-info-text);
117
+ --salmon-button-c-border: var(--salmon-color-info-border);
118
+ }
119
+
120
+ /* Sizes: the density control metrics. */
121
+ .salmon-button[data-size='sm'] {
122
+ --salmon-button-h: var(--salmon-control-height-sm, 24px);
123
+ --salmon-button-pad: var(--salmon-control-padding-sm, 8px);
124
+ gap: 4px;
125
+ font-size: var(--salmon-font-size-sm);
126
+ }
127
+ .salmon-button[data-size='lg'] {
128
+ --salmon-button-h: var(--salmon-control-height-lg, 40px);
129
+ --salmon-button-pad: var(--salmon-control-padding-lg, 16px);
130
+ gap: 8px;
131
+ font-size: var(--salmon-font-size-lg);
132
+ }
133
+ .salmon-button[data-icon-only] {
134
+ min-inline-size: var(--salmon-button-h);
135
+ padding-inline: 0;
136
+ }
137
+ /* A glyph in the label is a flex item, not an inline box on the text baseline,
138
+ so it sits on the centre axis. */
139
+ .salmon-button[data-icon-only] > .salmon-button__label {
140
+ display: flex;
141
+ }
142
+
143
+ /* Variants. */
144
+ .salmon-button[data-variant='solid']:hover {
145
+ --salmon-button-bg: var(--salmon-button-c-hover);
146
+ }
147
+ .salmon-button[data-variant='solid']:active {
148
+ --salmon-button-bg: var(--salmon-button-c-active);
149
+ }
150
+ /* A pressed state persists, so it keeps the guaranteed pairs:
151
+ the fill with its on-color, marked by an inset ring
152
+ of that on-color; outline and ghost use the subtle surface with tone text. */
153
+ .salmon-button[data-variant='solid'][data-pressed] {
154
+ --salmon-button-bg: var(--salmon-button-c);
155
+ box-shadow: inset 0 0 0 2px var(--salmon-button-c-on);
156
+ }
157
+ .salmon-button[data-variant='outline'],
158
+ .salmon-button[data-variant='ghost'],
159
+ .salmon-button[data-variant='link'] {
160
+ --salmon-button-bg: transparent;
161
+ --salmon-button-fg: var(--salmon-button-c-text);
162
+ --salmon-button-bd: transparent;
163
+ }
164
+ .salmon-button[data-variant='outline'] {
165
+ --salmon-button-bd: var(--salmon-button-c-border);
166
+ }
167
+ .salmon-button[data-variant='outline']:hover,
168
+ .salmon-button[data-variant='ghost']:hover {
169
+ --salmon-button-bg: var(--salmon-button-c-subtle);
170
+ }
171
+ .salmon-button[data-variant='outline']:active,
172
+ .salmon-button[data-variant='ghost']:active {
173
+ --salmon-button-bg: var(--salmon-button-c-subtle-hover);
174
+ }
175
+ .salmon-button[data-variant='outline'][data-pressed],
176
+ .salmon-button[data-variant='ghost'][data-pressed] {
177
+ --salmon-button-bg: var(--salmon-button-c-subtle);
178
+ --salmon-button-bd: var(--salmon-button-c-selected-edge);
179
+ }
180
+ .salmon-button[data-variant='link'] {
181
+ padding-inline: 2px;
182
+ min-block-size: auto;
183
+ font-weight: var(--salmon-font-weight-regular);
184
+ }
185
+ .salmon-button[data-variant='link'][data-tone='neutral'] {
186
+ --salmon-button-fg: var(--salmon-text-link);
187
+ }
188
+ .salmon-button[data-variant='link']:hover,
189
+ .salmon-button[data-variant='link'][data-pressed] {
190
+ text-decoration: underline;
191
+ }
192
+ /* States. */
193
+ .salmon-button:focus-visible {
194
+ z-index: 1;
195
+ outline: var(--salmon-state-focus-ring-width) solid var(--salmon-state-focus-ring);
196
+ outline-offset: var(--salmon-state-focus-ring-offset);
197
+ }
198
+ .salmon-button[data-variant]:disabled,
199
+ .salmon-button[data-variant][aria-disabled='true']:not([data-loading]) {
200
+ --salmon-button-bg: var(--salmon-surface-disabled);
201
+ --salmon-button-fg: var(--salmon-text-disabled);
202
+ --salmon-button-bd: var(--salmon-border-subtle);
203
+ cursor: not-allowed;
204
+ }
205
+ .salmon-button[data-variant='link']:disabled,
206
+ .salmon-button[data-variant='link'][aria-disabled='true']:not([data-loading]),
207
+ .salmon-button[data-variant='ghost']:disabled {
208
+ --salmon-button-bg: transparent;
209
+ --salmon-button-bd: transparent;
210
+ }
211
+ .salmon-button[data-loading] {
212
+ cursor: progress;
213
+ }
214
+
215
+ .salmon-button__label {
216
+ min-inline-size: 0;
217
+ overflow: hidden;
218
+ text-overflow: ellipsis;
219
+ }
220
+ .salmon-button__icon,
221
+ .salmon-button__spinner {
222
+ display: inline-flex;
223
+ flex: none;
224
+ align-items: center;
225
+ justify-content: center;
226
+ }
227
+ .salmon-button__spinner:empty {
228
+ inline-size: 1em;
229
+ block-size: 1em;
230
+ box-sizing: border-box;
231
+ border: 2px solid currentColor;
232
+ border-inline-end-color: transparent;
233
+ border-radius: 50%;
234
+ animation: salmon-button-spin 0.8s linear infinite;
235
+ }
236
+ @keyframes salmon-button-spin {
237
+ to {
238
+ rotate: 360deg;
239
+ }
240
+ }
241
+ .salmon-button__sr {
242
+ position: absolute;
243
+ inline-size: 1px;
244
+ block-size: 1px;
245
+ margin: -1px;
246
+ padding: 0;
247
+ overflow: hidden;
248
+ clip-path: inset(50%);
249
+ white-space: nowrap;
250
+ border: 0;
251
+ }
252
+
253
+ /* Groups. */
254
+ .salmon-button-group,
255
+ .salmon-toggle-button-group {
256
+ display: inline-flex;
257
+ gap: 8px;
258
+ vertical-align: middle;
259
+ }
260
+ .salmon-button-group:not([data-attached]),
261
+ .salmon-toggle-button-group:not([data-attached]) {
262
+ flex-wrap: wrap;
263
+ }
264
+ .salmon-button-group[data-orientation='vertical'],
265
+ .salmon-toggle-button-group[data-orientation='vertical'] {
266
+ flex-direction: column;
267
+ align-items: stretch;
268
+ }
269
+ .salmon-button-group[data-attached],
270
+ .salmon-toggle-button-group[data-attached] {
271
+ gap: 0;
272
+ }
273
+ [data-attached][data-orientation='horizontal'] > .salmon-button:not(:first-of-type) {
274
+ margin-inline-start: -1px;
275
+ border-start-start-radius: 0;
276
+ border-end-start-radius: 0;
277
+ }
278
+ [data-attached][data-orientation='horizontal'] > .salmon-button:not(:last-of-type) {
279
+ border-start-end-radius: 0;
280
+ border-end-end-radius: 0;
281
+ }
282
+ [data-attached][data-orientation='vertical'] > .salmon-button:not(:first-of-type) {
283
+ margin-block-start: -1px;
284
+ border-start-start-radius: 0;
285
+ border-start-end-radius: 0;
286
+ }
287
+ [data-attached][data-orientation='vertical'] > .salmon-button:not(:last-of-type) {
288
+ border-end-start-radius: 0;
289
+ border-end-end-radius: 0;
290
+ }
291
+ [data-attached] > .salmon-button:hover,
292
+ [data-attached] > .salmon-button[data-pressed] {
293
+ z-index: 1;
294
+ }
295
+
296
+ @media (prefers-reduced-motion: reduce) {
297
+ .salmon-button {
298
+ transition: none;
299
+ }
300
+ .salmon-button__spinner:empty {
301
+ animation-duration: 2.4s;
302
+ }
303
+ }
304
+
305
+ @media (forced-colors: active) {
306
+ .salmon-button {
307
+ border-color: ButtonText;
308
+ }
309
+ .salmon-button[data-pressed] {
310
+ forced-color-adjust: none;
311
+ border-color: Highlight;
312
+ background: Highlight;
313
+ color: HighlightText;
314
+ }
315
+ .salmon-button:disabled {
316
+ border-color: GrayText;
317
+ color: GrayText;
318
+ }
319
+ }
320
+
321
+ }
322
+ @layer salmon.a {
323
+ /* Shared accessibility helper: text for assistive technology only (badge
324
+ counts, spinner labels, live regions). Carried by the family stylesheets
325
+ whose markup uses it (`@salmonui/core:a11y` in the manifest). */
326
+
327
+ .salmon-visually-hidden {
328
+ position: absolute;
329
+ inline-size: 1px;
330
+ block-size: 1px;
331
+ margin: -1px;
332
+ padding: 0;
333
+ overflow: hidden;
334
+ clip-path: inset(50%);
335
+ white-space: nowrap;
336
+ border: 0;
337
+ }
338
+
339
+ }
340
+ @layer salmon.b {
341
+ /* @salmonui/buttons/button/styles.css, second part: the filter chip variant,
342
+ the progress fill and the floating action button. tooling/checks/copy-css.mjs
343
+ writes dist/button.css as styles/button-core.css followed by this file;
344
+ families of other packages that render plain buttons only carry
345
+ button-core.css (`@salmonui/buttons:button-core` in the manifest).
346
+ Chip hover and pressed apply
347
+ to enabled chips only, so the disabled state of button-core.css, which
348
+ comes first, keeps winning. */
349
+
350
+ .salmon-button[data-variant='chip'] {
351
+ --salmon-button-h: calc(var(--salmon-control-height-md, 32px) - 4px);
352
+ --salmon-button-bg: transparent;
353
+ --salmon-button-fg: var(--salmon-button-c-text);
354
+ --salmon-button-bd: var(--salmon-button-c-border);
355
+ border-radius: var(--salmon-radius-sm);
356
+ font-weight: var(--salmon-font-weight-regular);
357
+ }
358
+ .salmon-button[data-variant='chip'][data-size='sm'] {
359
+ --salmon-button-h: calc(var(--salmon-control-height-sm, 24px) - 2px);
360
+ }
361
+ .salmon-button[data-variant='chip'][data-size='lg'] {
362
+ --salmon-button-h: calc(var(--salmon-control-height-lg, 40px) - 6px);
363
+ }
364
+ .salmon-button[data-variant='chip']:hover:where(:enabled) {
365
+ --salmon-button-bg: var(--salmon-button-c-subtle);
366
+ }
367
+ .salmon-button[data-variant='chip'][data-pressed]:where(:enabled) {
368
+ --salmon-button-bg: var(--salmon-button-c-selected);
369
+ --salmon-button-bd: var(--salmon-button-c-selected-edge);
370
+ }
371
+ /* Filter chips show a check when pressed. */
372
+ .salmon-button[data-variant='chip'][data-pressed]::after {
373
+ content: '';
374
+ order: -1;
375
+ inline-size: 0.3em;
376
+ block-size: 0.6em;
377
+ margin-block-start: -0.2em;
378
+ border: solid currentColor;
379
+ border-width: 0 2px 2px 0;
380
+ rotate: 45deg;
381
+ }
382
+
383
+ /* Progress fill from inline-start. */
384
+ .salmon-button[data-progress]::before {
385
+ content: '';
386
+ position: absolute;
387
+ z-index: -1;
388
+ inset-block: 0;
389
+ inset-inline-start: 0;
390
+ inline-size: var(--salmon-button-progress, 0%);
391
+ background: currentColor;
392
+ opacity: 0.22;
393
+ transition: inline-size var(--salmon-motion-duration-fast) var(--salmon-motion-easing);
394
+ }
395
+
396
+ /* Floating action button: circular, elevated, CSS positioned. */
397
+ .salmon-button[data-floating] {
398
+ --salmon-button-h: 56px;
399
+ --salmon-button-pad: 20px;
400
+ --salmon-button-inset: 16px;
401
+ position: fixed;
402
+ z-index: 10;
403
+ border-radius: var(--salmon-radius-full);
404
+ box-shadow: var(--salmon-shadow-lg);
405
+ }
406
+ .salmon-button[data-floating][data-size='sm'] {
407
+ --salmon-button-h: 40px;
408
+ --salmon-button-pad: 14px;
409
+ }
410
+ .salmon-button[data-floating][data-size='lg'] {
411
+ --salmon-button-h: 64px;
412
+ --salmon-button-pad: 24px;
413
+ }
414
+ .salmon-button[data-floating-scope='parent'] {
415
+ position: absolute;
416
+ }
417
+ .salmon-button[data-floating^='top'] {
418
+ inset-block-start: var(--salmon-button-inset);
419
+ }
420
+ .salmon-button[data-floating^='bottom'] {
421
+ inset-block-end: var(--salmon-button-inset);
422
+ }
423
+ .salmon-button[data-floating$='Start'] {
424
+ inset-inline-start: var(--salmon-button-inset);
425
+ }
426
+ .salmon-button[data-floating$='End'] {
427
+ inset-inline-end: var(--salmon-button-inset);
428
+ }
429
+ .salmon-button[data-floating^='middle'] {
430
+ inset-block-start: 50%;
431
+ translate: 0 -50%;
432
+ }
433
+ /* Direction sign: -1 under the nearest dir="rtl", 1 under dir="ltr". */
434
+ :where([dir='rtl']) { --salmon-dir: -1; }
435
+ :where([dir='ltr']) { --salmon-dir: 1; }
436
+ .salmon-button[data-floating$='Center'] {
437
+ inset-inline-start: 50%;
438
+ translate: calc(-50% * var(--salmon-dir, 1)) 0;
439
+ }
440
+ .salmon-button[data-floating='middleCenter'] {
441
+ translate: calc(-50% * var(--salmon-dir, 1)) -50%;
442
+ }
443
+
444
+ @media (prefers-reduced-motion: reduce) {
445
+ .salmon-button[data-progress]::before {
446
+ transition: none;
447
+ }
448
+ }
449
+
450
+ }
451
+ @layer salmon.c {
452
+ /* @salmonui/react/menu: Menu family, MenuButton and SplitButton parts.
453
+ The trigger buttons are styled by /button/styles.css. Logical properties only. */
454
+
455
+ .salmon-menu {
456
+ box-sizing: border-box;
457
+ display: flex;
458
+ flex-direction: column;
459
+ /* A popup opened from a trigger is at least as wide as the trigger (list.tsx). */
460
+ min-inline-size: max(160px, var(--salmon-menu-anchor-width, 0px));
461
+ max-height: calc(100vh - 16px);
462
+ overflow: auto;
463
+ padding: var(--salmon-space-2);
464
+ font-family: var(--salmon-font-sans);
465
+ font-size: var(--salmon-font-size-md);
466
+ line-height: var(--salmon-line-height-tight);
467
+ color: var(--salmon-text-primary);
468
+ background: var(--salmon-surface-overlay);
469
+ border: 1px solid var(--salmon-border-default);
470
+ border-radius: var(--salmon-radius-lg);
471
+ outline: none;
472
+ }
473
+
474
+ .salmon-menu[data-popup] {
475
+ inset: 0 auto auto 0;
476
+ margin: 0;
477
+ z-index: 1000;
478
+ box-shadow: var(--salmon-shadow-md);
479
+ }
480
+
481
+ .salmon-menu[data-popup]:not([data-placed]) {
482
+ visibility: hidden;
483
+ }
484
+
485
+ .salmon-menu *,
486
+ .salmon-menu ::before,
487
+ .salmon-menu ::after {
488
+ box-sizing: border-box;
489
+ }
490
+
491
+ .salmon-menu-item {
492
+ display: flex;
493
+ align-items: center;
494
+ gap: var(--salmon-space-2);
495
+ min-height: var(--salmon-control-height-md, 32px);
496
+ padding-block: var(--salmon-space-1);
497
+ padding-inline: var(--salmon-space-3);
498
+ border-radius: var(--salmon-radius-sm);
499
+ color: inherit;
500
+ text-decoration: none;
501
+ white-space: nowrap;
502
+ cursor: pointer;
503
+ outline: none;
504
+ user-select: none;
505
+ }
506
+
507
+ .salmon-menu-item[data-highlighted],
508
+ .salmon-menu-item[data-open] {
509
+ background: var(--salmon-surface-hover);
510
+ }
511
+
512
+ .salmon-menu-item:focus-visible {
513
+ outline: var(--salmon-state-focus-ring-width) solid var(--salmon-state-focus-ring);
514
+ outline-offset: calc(-1 * var(--salmon-state-focus-ring-width));
515
+ }
516
+
517
+ .salmon-menu-item[data-disabled] {
518
+ color: var(--salmon-text-disabled);
519
+ background: none;
520
+ cursor: default;
521
+ }
522
+
523
+ .salmon-menu-item-icon,
524
+ .salmon-menu-item-check,
525
+ .salmon-menu-submenu-indicator {
526
+ display: inline-flex;
527
+ flex: none;
528
+ align-items: center;
529
+ justify-content: center;
530
+ width: 16px;
531
+ height: 16px;
532
+ }
533
+
534
+ .salmon-menu-item-check {
535
+ visibility: hidden;
536
+ }
537
+
538
+ .salmon-menu-item[data-checked] .salmon-menu-item-check {
539
+ visibility: visible;
540
+ }
541
+
542
+ .salmon-menu-item-dot {
543
+ width: 6px;
544
+ height: 6px;
545
+ border-radius: var(--salmon-radius-full);
546
+ background: currentColor;
547
+ }
548
+
549
+ .salmon-menu-item-label {
550
+ flex: 1 1 auto;
551
+ }
552
+
553
+ .salmon-menu-submenu-indicator {
554
+ margin-inline-start: var(--salmon-space-3);
555
+ color: var(--salmon-text-secondary);
556
+ }
557
+
558
+ .salmon-menu-separator {
559
+ flex: none;
560
+ height: 1px;
561
+ margin-block: var(--salmon-space-1);
562
+ background: var(--salmon-border-subtle);
563
+ }
564
+
565
+ .salmon-menu-group {
566
+ display: flex;
567
+ flex-direction: column;
568
+ }
569
+
570
+ .salmon-menu-group-label {
571
+ padding-block: var(--salmon-space-1);
572
+ padding-inline: var(--salmon-space-3);
573
+ font-size: var(--salmon-font-size-sm);
574
+ font-weight: var(--salmon-font-weight-semibold);
575
+ color: var(--salmon-text-secondary);
576
+ }
577
+
578
+ .salmon-menu-button-indicator {
579
+ display: inline-flex;
580
+ transition: transform var(--salmon-motion-duration-fast) var(--salmon-motion-easing);
581
+ }
582
+
583
+ [data-open] > .salmon-button__icon > .salmon-menu-button-indicator,
584
+ [data-open] > .salmon-menu-button-indicator {
585
+ transform: rotate(180deg);
586
+ }
587
+
588
+ /* Directional icons supplied by the system mirror in RTL. */
589
+ .salmon-menu[dir='rtl'] .salmon-menu-submenu-indicator svg {
590
+ transform: scaleX(-1);
591
+ }
592
+
593
+ /* SplitButton is an attached ButtonGroup (button.css). Nested in an outer group
594
+ it joins its neighbours; in a vertical group it stretches and stays horizontal. */
595
+ [data-attached][data-orientation='horizontal'] > .salmon-split-button:not(:first-child) {
596
+ margin-inline-start: -1px;
597
+ }
598
+ [data-attached][data-orientation='horizontal'] > .salmon-split-button:not(:first-child) > .salmon-button:first-child,
599
+ [data-attached][data-orientation='horizontal'] > .salmon-split-button + .salmon-button {
600
+ border-start-start-radius: 0;
601
+ border-end-start-radius: 0;
602
+ }
603
+ [data-attached][data-orientation='horizontal'] > .salmon-split-button:not(:last-child) > .salmon-button:last-child,
604
+ [data-attached][data-orientation='horizontal'] > .salmon-button:has(+ .salmon-split-button) {
605
+ border-start-end-radius: 0;
606
+ border-end-end-radius: 0;
607
+ }
608
+ [data-orientation='vertical'] > .salmon-split-button {
609
+ display: flex;
610
+ }
611
+ [data-orientation='vertical'] > .salmon-split-button > .salmon-split-button-primary {
612
+ flex: 1 1 auto;
613
+ }
614
+ [data-attached][data-orientation='vertical'] > .salmon-split-button:not(:first-child) {
615
+ margin-block-start: -1px;
616
+ }
617
+ [data-attached][data-orientation='vertical'] > .salmon-split-button:not(:first-child) > .salmon-button,
618
+ [data-attached][data-orientation='vertical'] > .salmon-split-button + .salmon-button {
619
+ border-start-start-radius: 0;
620
+ border-start-end-radius: 0;
621
+ }
622
+ [data-attached][data-orientation='vertical'] > .salmon-split-button:not(:last-child) > .salmon-button,
623
+ [data-attached][data-orientation='vertical'] > .salmon-button:has(+ .salmon-split-button) {
624
+ border-end-start-radius: 0;
625
+ border-end-end-radius: 0;
626
+ }
627
+
628
+ /* ContextMenu target: a long-press opens the menu, not the touch callout. */
629
+ .salmon-context-menu {
630
+ -webkit-touch-callout: none;
631
+ }
632
+
633
+ /* Menubar (APG Menubar, horizontal). */
634
+ .salmon-menubar {
635
+ box-sizing: border-box;
636
+ display: flex;
637
+ align-items: center;
638
+ gap: 2px;
639
+ min-width: 0;
640
+ padding: var(--salmon-space-2);
641
+ font-family: var(--salmon-font-sans);
642
+ font-size: var(--salmon-font-size-md);
643
+ line-height: var(--salmon-line-height-tight);
644
+ color: var(--salmon-text-primary);
645
+ background: var(--salmon-surface-raised);
646
+ border: 1px solid var(--salmon-border-default);
647
+ border-radius: var(--salmon-radius-lg);
648
+ }
649
+
650
+ .salmon-menubar[data-overflow='scroll'] {
651
+ overflow-x: auto;
652
+ scrollbar-width: none;
653
+ }
654
+
655
+ .salmon-menubar[data-overflow='scroll']::-webkit-scrollbar {
656
+ display: none;
657
+ }
658
+
659
+ .salmon-menubar-item {
660
+ box-sizing: border-box;
661
+ display: inline-flex;
662
+ flex: none;
663
+ align-items: center;
664
+ gap: var(--salmon-space-2);
665
+ min-height: var(--salmon-control-height-md, 32px);
666
+ padding-block: var(--salmon-space-1);
667
+ padding-inline: var(--salmon-space-3);
668
+ border-radius: var(--salmon-radius-sm);
669
+ color: inherit;
670
+ text-decoration: none;
671
+ white-space: nowrap;
672
+ cursor: pointer;
673
+ outline: none;
674
+ user-select: none;
675
+ }
676
+
677
+ .salmon-menubar-item:hover,
678
+ .salmon-menubar-item[data-open] {
679
+ background: var(--salmon-surface-hover);
680
+ }
681
+
682
+ .salmon-menubar-item:focus-visible {
683
+ outline: var(--salmon-state-focus-ring-width) solid var(--salmon-state-focus-ring);
684
+ outline-offset: calc(-1 * var(--salmon-state-focus-ring-width));
685
+ }
686
+
687
+ .salmon-menubar-item[data-disabled] {
688
+ color: var(--salmon-text-disabled);
689
+ background: none;
690
+ cursor: default;
691
+ }
692
+
693
+ .salmon-menubar-item-icon {
694
+ display: inline-flex;
695
+ flex: none;
696
+ width: 16px;
697
+ height: 16px;
698
+ }
699
+
700
+ /* overflow: 'scroll' indicators, shown while there is more to scroll to on that side. */
701
+ .salmon-menubar-scroll {
702
+ position: sticky;
703
+ z-index: 1;
704
+ display: none;
705
+ flex: none;
706
+ align-self: stretch;
707
+ align-items: center;
708
+ justify-content: center;
709
+ width: 24px;
710
+ color: var(--salmon-text-secondary);
711
+ background: var(--salmon-surface-raised);
712
+ cursor: pointer;
713
+ }
714
+
715
+ .salmon-menubar-scroll[data-direction='backward'] {
716
+ inset-inline-start: calc(-1 * var(--salmon-space-2));
717
+ }
718
+
719
+ .salmon-menubar-scroll[data-direction='forward'] {
720
+ inset-inline-end: calc(-1 * var(--salmon-space-2));
721
+ margin-inline-start: auto;
722
+ }
723
+
724
+ .salmon-menubar-scroll[data-direction='forward'] svg {
725
+ transform: scaleX(-1);
726
+ }
727
+
728
+ .salmon-menubar[data-scroll-start] > .salmon-menubar-scroll[data-direction='backward'],
729
+ .salmon-menubar[data-scroll-end] > .salmon-menubar-scroll[data-direction='forward'] {
730
+ display: flex;
731
+ }
732
+
733
+ .salmon-menubar[dir='rtl'] .salmon-menubar-scroll svg,
734
+ [dir='rtl'] .salmon-menubar .salmon-menubar-scroll svg {
735
+ transform: scaleX(-1);
736
+ }
737
+
738
+ [dir='rtl'] .salmon-menubar .salmon-menubar-scroll[data-direction='forward'] svg {
739
+ transform: none;
740
+ }
741
+
742
+ @media (prefers-reduced-motion: reduce) {
743
+ .salmon-menu-button-indicator {
744
+ transition: none;
745
+ }
746
+ }
747
+
748
+ @media (forced-colors: active) {
749
+ .salmon-menu-item[data-highlighted] {
750
+ forced-color-adjust: none;
751
+ color: HighlightText;
752
+ background: Highlight;
753
+ }
754
+ }
755
+
756
+ }
757
+ @layer salmon.c {
758
+ /* SpeechToTextButton: the button rules come from
759
+ button.css (prepended by tooling/checks/copy-css.mjs); this file adds the
760
+ listening cue on top of the button's [data-pressed] colors.
761
+ The glyph size follows the control size in SpeechToTextButton.tsx. */
762
+ .salmon-speech-to-text[data-state='listening'] {
763
+ animation: salmon-speech-to-text-pulse 1.6s ease-in-out infinite;
764
+ }
765
+
766
+ @keyframes salmon-speech-to-text-pulse {
767
+ 50% {
768
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--salmon-button-c, currentColor) 35%, transparent);
769
+ }
770
+ }
771
+
772
+ @media (prefers-reduced-motion: reduce) {
773
+ .salmon-speech-to-text[data-state='listening'] {
774
+ animation: none;
775
+ box-shadow: 0 0 0 2px var(--salmon-button-c, currentColor);
776
+ }
777
+ }
778
+
779
+ }
780
+ @layer salmon.d {
781
+ /* InlineAssist: the a11y helper, the Button, Menu
782
+ and SpeechToText rules come first (prepended by tooling/checks/copy-css.mjs);
783
+ this file is the panel, the prompt row, the command menu and the response.
784
+ Logical properties only. */
785
+ .salmon-inline-assist {
786
+ box-sizing: border-box;
787
+ display: flex;
788
+ flex-direction: column;
789
+ gap: 8px;
790
+ inline-size: min(420px, calc(100vw - 16px));
791
+ padding: 8px;
792
+ font-family: var(--salmon-font-sans);
793
+ font-size: var(--salmon-font-size-md);
794
+ line-height: 1.5;
795
+ color: var(--salmon-text-primary);
796
+ background: var(--salmon-surface-overlay, Canvas);
797
+ border: 1px solid var(--salmon-border-default, GrayText);
798
+ border-radius: var(--salmon-radius-lg, 10px);
799
+ box-shadow: var(--salmon-shadow-md);
800
+ }
801
+
802
+ .salmon-inline-assist[data-mode='popover'] {
803
+ z-index: 1000;
804
+ max-block-size: var(--salmon-overlay-available-height, calc(100vh - 16px));
805
+ overflow: auto;
806
+ }
807
+
808
+ .salmon-inline-assist[data-mode='popover']:not([data-placed]) {
809
+ visibility: hidden;
810
+ }
811
+
812
+ .salmon-inline-assist[data-mode='inline'] {
813
+ inline-size: auto;
814
+ box-shadow: none;
815
+ }
816
+
817
+ .salmon-inline-assist__composer,
818
+ .salmon-inline-assist__toolbar,
819
+ .salmon-inline-assist__actions {
820
+ display: flex;
821
+ flex-wrap: wrap;
822
+ align-items: center;
823
+ gap: 4px;
824
+ }
825
+
826
+ .salmon-inline-assist__input {
827
+ flex: 1;
828
+ box-sizing: border-box;
829
+ min-inline-size: 8rem;
830
+ min-block-size: 32px;
831
+ max-block-size: 160px;
832
+ padding: 5px 8px;
833
+ font: inherit;
834
+ line-height: 20px;
835
+ color: inherit;
836
+ resize: none;
837
+ field-sizing: content;
838
+ background: var(--salmon-surface-base, Field);
839
+ border: 1px solid var(--salmon-border-default, GrayText);
840
+ border-radius: var(--salmon-radius-md, 6px);
841
+ }
842
+
843
+ .salmon-inline-assist__input::placeholder {
844
+ color: var(--salmon-text-placeholder, GrayText);
845
+ }
846
+
847
+ .salmon-inline-assist__input:focus-visible {
848
+ outline: var(--salmon-state-focus-ring-width, 2px) solid var(--salmon-state-focus-ring, Highlight);
849
+ outline-offset: -1px;
850
+ }
851
+
852
+ .salmon-inline-assist__commands {
853
+ max-block-size: 240px;
854
+ overflow: auto;
855
+ }
856
+
857
+ .salmon-inline-assist__response {
858
+ display: flex;
859
+ flex-direction: column;
860
+ gap: 8px;
861
+ padding-block-start: 8px;
862
+ border-block-start: 1px solid var(--salmon-border-subtle, GrayText);
863
+ }
864
+
865
+ .salmon-inline-assist__text {
866
+ white-space: pre-wrap;
867
+ overflow-wrap: anywhere;
868
+ }
869
+
870
+ .salmon-inline-assist__pending,
871
+ .salmon-inline-assist__error {
872
+ color: var(--salmon-text-secondary, GrayText);
873
+ }
874
+
875
+ .salmon-inline-assist__error {
876
+ color: var(--salmon-color-danger, red);
877
+ }
878
+
879
+ /* Coarse pointers on narrow screens: a bottom sheet instead of an anchored box. */
880
+ @media (pointer: coarse) and (max-width: 640px) {
881
+ .salmon-inline-assist[data-mode='popover'] {
882
+ inset: auto 0 0 0 !important;
883
+ inline-size: 100%;
884
+ transform: none !important;
885
+ padding-block-end: max(8px, env(safe-area-inset-bottom));
886
+ border-radius: var(--salmon-radius-lg, 10px) var(--salmon-radius-lg, 10px) 0 0;
887
+ }
888
+ }
889
+
890
+ }