@saar-ai/web-widget 0.17.0 → 0.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 (81) hide show
  1. package/dist/avatar-face.d.ts +9 -3
  2. package/dist/avatar-face.d.ts.map +1 -1
  3. package/dist/avatar.d.ts +15 -2
  4. package/dist/avatar.d.ts.map +1 -1
  5. package/dist/chunks/{chat-DHMjOVms.js → chat-Bm4MPdY9.js} +25 -1
  6. package/dist/chunks/{form-fill-dom-D4ZMwxX1.js → form-fill-dom-Dxt-z0H0.js} +4 -0
  7. package/dist/chunks/{host-widget-BPHMVIjq.js → host-widget-kHzdanwT.js} +2037 -1333
  8. package/dist/concierge-shell.css +1 -1
  9. package/dist/dock/dock-row.d.ts +4 -2
  10. package/dist/dock/dock-row.d.ts.map +1 -1
  11. package/dist/dock/dock-sheet.d.ts.map +1 -1
  12. package/dist/dock/dock.d.ts +6 -0
  13. package/dist/dock/dock.d.ts.map +1 -1
  14. package/dist/dock/geometry.d.ts +1 -2
  15. package/dist/dock/geometry.d.ts.map +1 -1
  16. package/dist/form-fill/form-fill-dom.d.ts +5 -11
  17. package/dist/form-fill/form-fill-dom.d.ts.map +1 -1
  18. package/dist/generated/concierge-shell-css.d.ts.map +1 -1
  19. package/dist/generated/widget-css.d.ts.map +1 -1
  20. package/dist/host-widget.d.ts +2 -3
  21. package/dist/host-widget.d.ts.map +1 -1
  22. package/dist/index.d.ts +4 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +15 -15
  25. package/dist/messages.d.ts +17 -3
  26. package/dist/messages.d.ts.map +1 -1
  27. package/dist/next/index.js +1 -1
  28. package/dist/scroll-row.d.ts +29 -0
  29. package/dist/scroll-row.d.ts.map +1 -0
  30. package/dist/spoken-transcript.d.ts +23 -7
  31. package/dist/spoken-transcript.d.ts.map +1 -1
  32. package/dist/theme/derive.d.ts +71 -3
  33. package/dist/theme/derive.d.ts.map +1 -1
  34. package/dist/theme/host-tone.d.ts +0 -7
  35. package/dist/theme/host-tone.d.ts.map +1 -1
  36. package/dist/theme/index.d.ts +5 -1
  37. package/dist/theme/index.d.ts.map +1 -1
  38. package/dist/theme/widget-derive.d.ts +17 -0
  39. package/dist/theme/widget-derive.d.ts.map +1 -0
  40. package/dist/theme/widget-theme-scope.d.ts +17 -0
  41. package/dist/theme/widget-theme-scope.d.ts.map +1 -0
  42. package/dist/turn-order.d.ts +2 -1
  43. package/dist/turn-order.d.ts.map +1 -1
  44. package/dist/use-voice-session.d.ts +1 -1
  45. package/dist/use-voice-session.d.ts.map +1 -1
  46. package/dist/voice-widget.d.ts +32 -2
  47. package/dist/voice-widget.d.ts.map +1 -1
  48. package/dist/widget/call-view.d.ts +176 -0
  49. package/dist/widget/call-view.d.ts.map +1 -0
  50. package/dist/widget/concierge-launcher.d.ts +26 -2
  51. package/dist/widget/concierge-launcher.d.ts.map +1 -1
  52. package/dist/widget/concierge-shell.d.ts +51 -67
  53. package/dist/widget/concierge-shell.d.ts.map +1 -1
  54. package/dist/widget/launcher-look.d.ts +37 -0
  55. package/dist/widget/launcher-look.d.ts.map +1 -0
  56. package/dist/widget/mark-look.d.ts +35 -0
  57. package/dist/widget/mark-look.d.ts.map +1 -0
  58. package/dist/widget/mark.d.ts +35 -0
  59. package/dist/widget/mark.d.ts.map +1 -0
  60. package/dist/widget/mic-button.d.ts +31 -0
  61. package/dist/widget/mic-button.d.ts.map +1 -0
  62. package/dist/widget/shell-renderer.d.ts +1 -1
  63. package/dist/widget/shell-renderer.d.ts.map +1 -1
  64. package/dist/widget/style-of.d.ts +9 -0
  65. package/dist/widget/style-of.d.ts.map +1 -0
  66. package/dist/widget/use-follow-bottom.d.ts +17 -0
  67. package/dist/widget/use-follow-bottom.d.ts.map +1 -0
  68. package/dist/widget-cards.d.ts.map +1 -1
  69. package/dist/widget-cart-summary.d.ts.map +1 -1
  70. package/dist/widget.css +1 -1
  71. package/package.json +23 -7
  72. package/src/styles/call-view.css +290 -0
  73. package/src/styles/concierge-shell-entry.css +11 -0
  74. package/src/styles/concierge.css +3 -0
  75. package/src/styles/mark.css +94 -0
  76. package/src/styles/scroll-row.css +62 -0
  77. package/src/styles/tokens.css +1 -1
  78. package/src/styles/widget-entry.css +1 -0
  79. package/src/styles/widget-panel.css +644 -0
  80. package/dist/widget/transcript-geometry.d.ts +0 -226
  81. package/dist/widget/transcript-geometry.d.ts.map +0 -1
@@ -0,0 +1,290 @@
1
+ /*
2
+ * The widget generation's CALL (`widget/call-view.tsx`, docs/CONCIERGE_GENERATIONS.md
3
+ * "Call mode"). Scoped under `.wgc`, which the panel (`.wgp`) swaps in for its
4
+ * body while a call runs. Every colour and radius reads the literal-backed
5
+ * aliases `widget-panel.css` declares for `.wgc`, which also holds the rules
6
+ * the two share (focus ring, header, edge fade, chips, the live dot, the end
7
+ * control). Unlayered, like `widget-panel.css`, and imported after it: the
8
+ * call's turns carry the transcript's testids, and the panel's bubble rules
9
+ * for them must not apply here. Only transform and opacity animate.
10
+ */
11
+ .wgc {
12
+ display: flex;
13
+ flex: 1;
14
+ flex-direction: column;
15
+ width: 100%;
16
+ height: 100%;
17
+ min-height: 0;
18
+ color: var(--wgp-tx);
19
+ }
20
+
21
+ .wgc button {
22
+ border: 0;
23
+ font: inherit;
24
+ cursor: pointer;
25
+ }
26
+
27
+ .wgc-hd {
28
+ padding-block-end: 4px;
29
+ }
30
+
31
+ /* The orb and the knot are drawn at 64px and shown at 44; the mark is drawn at 44. */
32
+ .wgc-mk {
33
+ display: grid;
34
+ flex: none;
35
+ place-items: center;
36
+ width: 44px;
37
+ height: 44px;
38
+ padding: 0;
39
+ border-radius: 999px;
40
+ background: none;
41
+ }
42
+
43
+ .wgc-mk > :not(.wmk) {
44
+ margin: -10px;
45
+ transform: scale(0.69);
46
+ }
47
+
48
+ .wgc-st {
49
+ flex: 1;
50
+ min-width: 0;
51
+ margin: 0;
52
+ overflow: hidden;
53
+ font-size: 15px;
54
+ font-weight: 600;
55
+ text-overflow: ellipsis;
56
+ white-space: nowrap;
57
+ }
58
+
59
+ .wgc-tm {
60
+ display: inline-flex;
61
+ flex: none;
62
+ align-items: center;
63
+ justify-content: flex-end;
64
+ gap: 6px;
65
+ width: 4.75rem;
66
+ font-size: 13px;
67
+ font-variant-numeric: tabular-nums;
68
+ }
69
+
70
+ .wgc-tm > i {
71
+ width: 8px;
72
+ height: 8px;
73
+ border-radius: 50%;
74
+ animation: wgc-blink 1.6s ease-in-out infinite;
75
+ }
76
+
77
+ .wgc-hint {
78
+ display: flex;
79
+ flex-wrap: wrap;
80
+ align-items: center;
81
+ gap: 8px;
82
+ padding-inline: 16px;
83
+ color: var(--wgp-mu);
84
+ font-size: 12.5px;
85
+ }
86
+
87
+ .wgc-log {
88
+ --wgp-fade-t: 24px;
89
+ --wgp-fade-b: 10px;
90
+ flex: 1;
91
+ min-height: 0;
92
+ overflow-y: auto;
93
+ padding-block: 16px 10px;
94
+ padding-inline: 20px;
95
+ }
96
+
97
+ /* The content box `useFollowBottom` watches: it grows as the turns do. */
98
+ .wgc-log > div {
99
+ display: flex;
100
+ flex-direction: column;
101
+ gap: 16px;
102
+ }
103
+
104
+ .wgc-t {
105
+ display: flex;
106
+ flex-direction: column;
107
+ align-items: flex-start;
108
+ gap: 6px;
109
+ }
110
+
111
+ .wgc-t[data-you] {
112
+ align-items: flex-end;
113
+ text-align: end;
114
+ }
115
+
116
+ .wgc .wgc-t > .wgc-tx {
117
+ max-width: 88%;
118
+ margin: 0;
119
+ padding: 0;
120
+ border-radius: 0;
121
+ background: none;
122
+ box-shadow: none;
123
+ color: var(--wgp-t2);
124
+ font-size: 14.5px;
125
+ line-height: 1.5;
126
+ }
127
+
128
+ .wgc .wgc-t > .wgc-tx[data-cur] {
129
+ color: var(--wgp-tx);
130
+ font-size: 18px;
131
+ line-height: 1.4;
132
+ }
133
+
134
+ .wgc .wgc-t[data-you] > .wgc-tx,
135
+ .wgc .wgc-t > .wgc-tx[data-cut] {
136
+ color: var(--wgp-mu);
137
+ }
138
+
139
+ .wgc .wgc-t[data-you] > .wgc-tx[data-partial] {
140
+ font-style: italic;
141
+ }
142
+
143
+ .wgc-cut {
144
+ display: inline-block;
145
+ margin-inline-start: 6px;
146
+ padding: 2px 8px;
147
+ border-radius: var(--wgp-chip-r);
148
+ background: var(--wgp-s3);
149
+ font-size: 11.5px;
150
+ font-weight: 500;
151
+ font-style: normal;
152
+ line-height: 1.4;
153
+ vertical-align: middle;
154
+ }
155
+
156
+ .wgc-cards {
157
+ width: 100%;
158
+ }
159
+
160
+ .wgc-say {
161
+ padding-inline: 16px;
162
+ }
163
+
164
+ .wgc-say > p {
165
+ margin: 0 0 8px;
166
+ margin-inline-start: 4px;
167
+ color: var(--wgp-mu);
168
+ font-size: 12px;
169
+ font-weight: 600;
170
+ }
171
+
172
+ .wgc .wgc-say ul {
173
+ display: flex;
174
+ flex-wrap: nowrap;
175
+ gap: 8px;
176
+ margin: 0 -16px;
177
+ padding: 0 16px 2px;
178
+ overflow-x: auto;
179
+ list-style: none;
180
+ scrollbar-width: none;
181
+ -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
182
+ mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
183
+ }
184
+
185
+ [dir='rtl'] .wgc .wgc-say ul,
186
+ .wgc[dir='rtl'] .wgc-say ul {
187
+ -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent);
188
+ mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent);
189
+ }
190
+
191
+ /* A mask fades everything the element paints, its focus ring too: a keyboard
192
+ focus drops the fade and rings inside the edge (no `:has()` below Firefox
193
+ 121). After every rule that masks either, here and in `widget-panel.css`. */
194
+ .wgc-log:focus-visible,
195
+ .wgc .wgc-say ul:focus-visible {
196
+ -webkit-mask-image: none;
197
+ mask-image: none;
198
+ outline-offset: -2px;
199
+ }
200
+
201
+ .wgc-say li {
202
+ flex: none;
203
+ }
204
+
205
+ .wgc .wgc-chip {
206
+ background: var(--wgp-s3);
207
+ box-shadow: none;
208
+ white-space: nowrap;
209
+ }
210
+
211
+ .wgc-ctl {
212
+ display: flex;
213
+ justify-content: center;
214
+ gap: 28px;
215
+ padding-block: 14px calc(18px + env(safe-area-inset-bottom, 0px));
216
+ }
217
+
218
+ .wgc-ctl > button {
219
+ display: grid;
220
+ place-items: center;
221
+ width: 56px;
222
+ height: 56px;
223
+ padding: 0;
224
+ border-radius: 999px;
225
+ background: var(--wgp-s3);
226
+ color: var(--wgp-tx);
227
+ transition: transform 0.12s ease;
228
+ }
229
+
230
+ .wgc-ctl > button:active:enabled {
231
+ transform: scale(0.93);
232
+ }
233
+
234
+ .wgc-ctl > button:disabled {
235
+ opacity: 0.45;
236
+ }
237
+
238
+ .wgc-ctl > button[aria-pressed='true'] {
239
+ background: var(--wgp-tx);
240
+ color: var(--wgp-sf);
241
+ }
242
+
243
+ .wgc-ctl svg {
244
+ width: 24px;
245
+ height: 24px;
246
+ }
247
+
248
+ [dir='rtl'] .wgc-ctl > [data-testid='widget-call-to-text'] svg {
249
+ transform: scaleX(-1);
250
+ }
251
+
252
+ .wgc-sum {
253
+ display: flex;
254
+ flex-direction: column;
255
+ gap: 12px;
256
+ margin: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
257
+ padding: 16px;
258
+ border-radius: var(--wgp-card-r);
259
+ background: var(--wgp-s3);
260
+ font-size: 14px;
261
+ }
262
+
263
+ .wgc-sum > p {
264
+ margin: 0;
265
+ }
266
+
267
+ .wgc-sum > button {
268
+ min-height: 48px;
269
+ border-radius: var(--wgp-btn-r);
270
+ background: var(--wgp-p);
271
+ color: var(--wgp-op);
272
+ font-weight: 600;
273
+ text-transform: var(--wgt-caps, none);
274
+ }
275
+
276
+ @keyframes wgc-blink {
277
+ 50% {
278
+ opacity: 0.35;
279
+ }
280
+ }
281
+
282
+ @media (prefers-reduced-motion: reduce) {
283
+ .wgc-tm > i {
284
+ animation: none;
285
+ }
286
+
287
+ .wgc-ctl > button {
288
+ transition: none;
289
+ }
290
+ }
@@ -51,6 +51,17 @@
51
51
  @source '../widget-cards.tsx';
52
52
  @source '../widget-cart-summary.tsx';
53
53
  @import './tokens.css';
54
+ @import './scroll-row.css';
54
55
  @import './cursor.css';
55
56
  /* The brand aliases the shared transcript colours itself with — see `brand.css`. */
56
57
  @import './brand.css';
58
+ /* The widget mark's motion — `widget/mark.tsx`. */
59
+ @import './mark.css';
60
+ /*
61
+ * The panel's look: plain rules scoped under `.wgp`, including the restyle of
62
+ * the shared transcript markup. Light-DOM hosts import it themselves
63
+ * (`@saar-ai/web-widget/styles/widget-panel.css`).
64
+ */
65
+ @import './widget-panel.css';
66
+ /* The call view, after the panel so its turn rules win (docs/CONCIERGE_GENERATIONS.md "Call mode"). */
67
+ @import './call-view.css';
@@ -961,6 +961,9 @@
961
961
  .wgt-mark-face[data-handoff] {
962
962
  background: var(--wgt-primary);
963
963
  color: var(--wgt-on-primary);
964
+ /* Never dimmed: the person holding the conversation is the live party, and
965
+ * their initials at 55 % fell to 2.08:1 (axe). */
966
+ opacity: 1;
964
967
  }
965
968
 
966
969
  .wgt-mark-initials {
@@ -0,0 +1,94 @@
1
+ /*
2
+ * The widget mark's motion (`src/widget/mark.tsx`). Geometry and colour are
3
+ * inline styles from `widget/mark-look.ts`, shared with the cold launcher;
4
+ * only state lives here. Three keyframes, for the `ui-widget` budget: the
5
+ * monogram and the dot carry state through the ring and the arc alone.
6
+ * Transform and opacity only; nothing animates under `prefers-reduced-motion`.
7
+ */
8
+ @keyframes wmk-eq {
9
+ from {
10
+ transform: scaleY(0.25);
11
+ }
12
+ to {
13
+ transform: scaleY(1);
14
+ }
15
+ }
16
+ @keyframes wmk-rip {
17
+ from {
18
+ transform: scale(1);
19
+ opacity: 0.55;
20
+ }
21
+ to {
22
+ transform: scale(1.5);
23
+ opacity: 0;
24
+ }
25
+ }
26
+ @keyframes wmk-spin {
27
+ to {
28
+ transform: rotate(360deg);
29
+ }
30
+ }
31
+ .wmk-i {
32
+ transition: transform 0.25s;
33
+ }
34
+ .wmk-i:nth-child(2) {
35
+ animation-delay: -0.3s !important;
36
+ }
37
+ .wmk-i:nth-child(3) {
38
+ animation-delay: -0.55s !important;
39
+ }
40
+ .wmk-i:nth-child(4) {
41
+ animation-delay: -0.15s !important;
42
+ }
43
+ .wmk[data-mark-state='listening'] .wmk-i {
44
+ animation: wmk-eq 0.8s ease-in-out infinite alternate;
45
+ }
46
+ .wmk[data-mark-state='speaking'] .wmk-i {
47
+ animation: wmk-eq 0.42s ease-in-out infinite alternate;
48
+ }
49
+ .wmk[data-mark-state='connecting'] .wmk-i {
50
+ animation: wmk-eq 1.1s ease-in-out infinite alternate;
51
+ }
52
+ .wmk[data-mark-state='thinking'] .wmk-i {
53
+ transform: scaleY(0.2) !important;
54
+ }
55
+ .wmk-r {
56
+ position: absolute;
57
+ inset: 0;
58
+ border-radius: 50%;
59
+ border: 1.5px solid var(--wgt-primary, #111827);
60
+ opacity: 0;
61
+ pointer-events: none;
62
+ animation: wmk-rip 1.8s ease-out infinite;
63
+ }
64
+ .wmk-r + .wmk-r {
65
+ animation-delay: 0.9s;
66
+ }
67
+ .wmk-a {
68
+ position: absolute;
69
+ inset: -9px;
70
+ overflow: visible;
71
+ pointer-events: none;
72
+ animation: wmk-spin 1s linear infinite;
73
+ }
74
+ .wmk-a circle {
75
+ fill: none;
76
+ stroke: var(--wgt-accent-ink, var(--wgt-primary, #111827));
77
+ stroke-width: 2;
78
+ stroke-linecap: round;
79
+ stroke-dasharray: 44 400;
80
+ }
81
+ .wmk[data-mark-state='muted'] {
82
+ background: var(--wgt-surface-3, #e5e4e5) !important;
83
+ color: var(--wgt-text-muted, rgb(28 22 24 / 0.73)) !important;
84
+ }
85
+ @media (prefers-reduced-motion: reduce) {
86
+ .wmk,
87
+ .wmk * {
88
+ animation: none !important;
89
+ transition: none !important;
90
+ }
91
+ .wmk-r {
92
+ opacity: 0.4;
93
+ }
94
+ }
@@ -0,0 +1,62 @@
1
+ /*
2
+ * `scroll-row.tsx`: the previous/next buttons over a horizontal row, shared by
3
+ * the card carousel (dock and widget generation) and the call view's "Try
4
+ * saying" chips. A 44px target around a 32px disc, absolutely placed so
5
+ * showing or hiding one never moves the row. Touch screens swipe instead.
6
+ * Preflight already resets the button and hides `[hidden]`; the focus ring is
7
+ * the panel's (`.wgp :focus-visible`), or the browser's in the dock.
8
+ */
9
+ .wsr {
10
+ position: relative;
11
+ }
12
+
13
+ .wsr > [tabindex] {
14
+ scroll-behavior: smooth;
15
+ }
16
+
17
+ .wsr-b {
18
+ position: absolute;
19
+ inset-inline-start: -8px;
20
+ top: calc(50% - 22px);
21
+ display: grid;
22
+ place-items: center;
23
+ width: 44px;
24
+ height: 44px;
25
+ border-radius: 50%;
26
+ color: var(--widget-foreground);
27
+ cursor: pointer;
28
+ }
29
+
30
+ .wsr-b[data-n] {
31
+ inset-inline: auto -8px;
32
+ }
33
+
34
+ .wsr-b svg {
35
+ width: 32px;
36
+ height: 32px;
37
+ padding: 7px;
38
+ border-radius: 50%;
39
+ background: var(--widget-card);
40
+ box-shadow: 0 1px 6px #0003;
41
+ fill: none;
42
+ stroke: currentColor;
43
+ stroke-width: 2;
44
+ }
45
+
46
+ /* The chevron points to inline-end; previous turns it round, and RTL turns both. */
47
+ .wsr-b:not([data-n]):dir(ltr) svg,
48
+ .wsr-b[data-n]:dir(rtl) svg {
49
+ scale: -1 1;
50
+ }
51
+
52
+ @media (pointer: coarse) {
53
+ .wsr-b {
54
+ display: none;
55
+ }
56
+ }
57
+
58
+ @media (prefers-reduced-motion: reduce) {
59
+ .wsr > [tabindex] {
60
+ scroll-behavior: auto;
61
+ }
62
+ }
@@ -27,7 +27,7 @@
27
27
  --widget-bubble: oklch(95% 0.006 84.6 / 0.92);
28
28
  --widget-chip: oklch(92.7% 0.008 73.7 / 0.78);
29
29
  --widget-foreground: oklch(30.5% 0.002 106.5);
30
- --widget-foreground-muted: oklch(30.5% 0.002 106.5 / 0.62);
30
+ --widget-foreground-muted: oklch(30.5% 0.002 106.5 / 0.7);
31
31
  --widget-accent: oklch(46.8% 0.043 126.6);
32
32
  --widget-accent-foreground: oklch(97% 0.012 125.3);
33
33
  --widget-accent-ring: oklch(80% 0.05 125.3);
@@ -48,6 +48,7 @@
48
48
  @source not '../**/__tests__/**';
49
49
  @source not '../**/*.test.{ts,tsx}';
50
50
  @import './tokens.css';
51
+ @import './scroll-row.css';
51
52
  @import './cursor.css';
52
53
  @import './concierge.css';
53
54
  /* LAST, after concierge.css — its rules win the cascade by order. See the