@smart-cloud/ai-kit-ui 1.5.14 → 1.5.15

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 (54) hide show
  1. package/dist/LocaleDirectionProvider.d.ts +5 -0
  2. package/dist/index.cjs +9 -9
  3. package/dist/index.js +9 -9
  4. package/dist/locale.d.ts +13 -0
  5. package/package.json +35 -19
  6. package/eslint.config.js +0 -18
  7. package/src/ShadowBoundary.tsx +0 -229
  8. package/src/ai-chatbot/AiChatbot.tsx +0 -2325
  9. package/src/ai-chatbot/attachmentStorage.ts +0 -238
  10. package/src/ai-chatbot/index.tsx +0 -1
  11. package/src/ai-feature/AiFeature.tsx +0 -2334
  12. package/src/ai-feature/AiFeatureBorder.tsx +0 -22
  13. package/src/ai-feature/ProofreadDiff.tsx +0 -118
  14. package/src/ai-feature/index.tsx +0 -2
  15. package/src/ai-feature/utils.tsx +0 -20
  16. package/src/doc-search/DocSearch.tsx +0 -1313
  17. package/src/doc-search/index.tsx +0 -1
  18. package/src/doc-search/initialFilters.ts +0 -10
  19. package/src/errorHandling.ts +0 -305
  20. package/src/i18n/ar.ts +0 -254
  21. package/src/i18n/de.ts +0 -257
  22. package/src/i18n/en.ts +0 -269
  23. package/src/i18n/es.ts +0 -257
  24. package/src/i18n/fr.ts +0 -258
  25. package/src/i18n/he.ts +0 -250
  26. package/src/i18n/hi.ts +0 -256
  27. package/src/i18n/hu.ts +0 -269
  28. package/src/i18n/id.ts +0 -256
  29. package/src/i18n/index.ts +0 -47
  30. package/src/i18n/it.ts +0 -259
  31. package/src/i18n/ja.ts +0 -256
  32. package/src/i18n/ko.ts +0 -254
  33. package/src/i18n/nb.ts +0 -254
  34. package/src/i18n/nl.ts +0 -255
  35. package/src/i18n/pl.ts +0 -258
  36. package/src/i18n/pt.ts +0 -254
  37. package/src/i18n/ru.ts +0 -254
  38. package/src/i18n/sv.ts +0 -253
  39. package/src/i18n/th.ts +0 -252
  40. package/src/i18n/tr.ts +0 -256
  41. package/src/i18n/ua.ts +0 -257
  42. package/src/i18n/zh.ts +0 -247
  43. package/src/index.tsx +0 -7
  44. package/src/poweredBy.tsx +0 -39
  45. package/src/styles/ai-kit-ui.css +0 -1006
  46. package/src/useAiRun.ts +0 -182
  47. package/src/withAiKitShell.tsx +0 -363
  48. package/tests/ai-disclosures.test.ts +0 -126
  49. package/tests/doc-search-initial-filters.test.ts +0 -20
  50. package/tests/error-handling.test.ts +0 -140
  51. package/tsconfig.json +0 -32
  52. package/tsconfig.node.json +0 -13
  53. package/tsconfig.types.json +0 -13
  54. package/tsup.config.ts +0 -22
@@ -1,1006 +0,0 @@
1
- /* ==========================================================================
2
- WP Suite AI Kit UI – Customizable Design Tokens (v2.1)
3
- - External customization via --ai-kit-* variables
4
- - Unified launcher + chat positioning (single source of truth via variables)
5
- - Default squared corners everywhere (radius = 0), optional launcher override
6
- - Mantine Button radius override supported via --button-radius
7
- ========================================================================== */
8
-
9
- :host,
10
- #ai-kit-inline-root,
11
- #ai-kit-portal-root {
12
- /* ---------------------------
13
- 0) Core typography & rhythm
14
- --------------------------- */
15
- --ai-kit-font-family:
16
- Archivo, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
17
- Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
18
-
19
- /* Base font sizes */
20
- --ai-kit-font-size: 14px;
21
- --ai-kit-font-size-sm: 0.85rem;
22
- --ai-kit-font-size-xs: 0.78rem;
23
- --ai-kit-font-size-title: 0.9rem;
24
-
25
- --ai-kit-line-height: 1.4;
26
-
27
- /* Spacing scale */
28
- --ai-kit-space-1: 4px;
29
- --ai-kit-space-2: 8px;
30
- --ai-kit-space-3: 12px;
31
- --ai-kit-space-4: 16px;
32
- --ai-kit-space-5: 20px;
33
-
34
- /* Back-compat aliases */
35
- --ai-kit-spacing-sm: var(--ai-kit-space-2);
36
- --ai-kit-spacing-md: var(--ai-kit-space-3);
37
- --ai-kit-spacing-lg: var(--ai-kit-space-4);
38
-
39
- /* Radius
40
- IMPORTANT: default squared corners everywhere */
41
- --ai-kit-radius: 0px;
42
- --ai-kit-radius-sm: 8px;
43
- --ai-kit-radius-pill: 999px;
44
- --ai-kit-radius-round: 50%;
45
-
46
- /* Launcher can override independently */
47
- --ai-kit-launcher-radius: var(--ai-kit-radius-sm);
48
-
49
- /* Useful “bridge” vars */
50
- --ai-kit-button-padding-x: var(--button-padding-x, 12px);
51
- --ai-kit-input-padding-x: var(--input-padding-x, 12px);
52
- --ai-kit-action-transition:
53
- background-color 160ms ease, border-color 160ms ease, color 160ms ease,
54
- box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
55
- --ai-kit-action-focus-ring: var(--mantine-primary-color-filled, #1c7ed6);
56
- --ai-kit-action-disabled-opacity: 0.6;
57
-
58
- /* ---------------------------
59
- 1) Semantic color tokens
60
- --------------------------- */
61
- --ai-kit-color-text: var(--mantine-color-text, #222);
62
- --ai-kit-color-text-muted: rgba(0, 0, 0, 0.6);
63
- --ai-kit-color-border: var(
64
- --mantine-color-default-border,
65
- rgba(0, 0, 0, 0.12)
66
- );
67
- --ai-kit-color-border-muted: rgba(0, 0, 0, 0.18);
68
-
69
- --ai-kit-color-surface: var(--mantine-color-body, #fff);
70
- --ai-kit-color-surface-2: rgba(235, 235, 235, 0.15);
71
- --ai-kit-color-surface-3: rgba(0, 0, 0, 0.03);
72
-
73
- --ai-kit-color-danger: #c92a2a;
74
- --ai-kit-color-warning: #f59e0b;
75
- --ai-kit-color-success: #22c55e;
76
-
77
- /* Brand / primary */
78
- --ai-kit-color-primary: var(--mantine-primary-color-filled, #1c7ed6);
79
- --ai-kit-color-primary-hover: var(
80
- --mantine-primary-color-filled-hover,
81
- #1971c2
82
- );
83
- --ai-kit-color-primary-contrast: var(--mantine-primary-color-contrast, #fff);
84
-
85
- /* Back-compat aliases (existing names) */
86
- --ai-kit-text-color: var(--ai-kit-color-text);
87
- --ai-kit-background-color: var(--ai-kit-color-surface);
88
- --ai-kit-options-background-color: var(--ai-kit-color-surface-2);
89
-
90
- --ai-kit-color-text-light: var(--ai-kit-color-text-muted);
91
- --ai-kit-color-border-light: rgba(0, 0, 0, 0.1);
92
- --ai-kit-color-background: var(--ai-kit-color-surface);
93
- --ai-kit-color-background-light: var(--ai-kit-color-surface-3);
94
- --ai-kit-color-background-lighter: rgba(0, 0, 0, 0.04);
95
- --ai-kit-color-background-input: rgba(0, 0, 0, 0.06);
96
-
97
- /* ---------------------------
98
- 2) Shadows
99
- --------------------------- */
100
- --ai-kit-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
101
- --ai-kit-shadow-sm-hover: 0 6px 16px rgba(0, 0, 0, 0.2);
102
-
103
- /* ---------------------------
104
- 3) Feature border animation tokens
105
- --------------------------- */
106
- --ai-kit-border-width: 1px;
107
- --ai-kit-border-color: var(--ai-kit-color-border);
108
-
109
- --ai-kit-border-thickness: 2px;
110
- --ai-kit-border-speed: 1400ms;
111
- --ai-kit-border-angle: 0deg;
112
-
113
- --ai-kit-border-stops: #00c2ff, #7c3aed, #22c55e, #f59e0b, #00c2ff;
114
-
115
- --ai-kit-position-z-index: 100001;
116
-
117
- /* default offsets */
118
- --ai-kit-open-button-offset-x: 20px;
119
- --ai-kit-open-button-offset-y: 20px;
120
-
121
- /* The active position values (set by wrapper variants) */
122
- --ai-kit-pos-top: auto;
123
- --ai-kit-pos-right: var(--ai-kit-open-button-offset-x);
124
- --ai-kit-pos-bottom: var(--ai-kit-open-button-offset-y);
125
- --ai-kit-pos-left: auto;
126
-
127
- /* Sizing */
128
- --ai-kit-chat-launcher-size: 60px;
129
-
130
- --ai-kit-chat-width: 480px;
131
- --ai-kit-chat-height-min: 360px;
132
- --ai-kit-chat-height-max: 80vh;
133
- --ai-kit-chat-height-cap: 1000px;
134
-
135
- /* Launcher colors */
136
- --ai-kit-launcher-bg: var(--button-bg, var(--ai-kit-color-primary));
137
- --ai-kit-launcher-color: var(
138
- --button-color,
139
- var(--ai-kit-color-primary-contrast)
140
- );
141
- --ai-kit-launcher-bg-hover: var(
142
- --button-bg-hover,
143
- var(--ai-kit-color-primary-hover)
144
- );
145
- --ai-kit-launcher-shadow: var(--ai-kit-shadow-sm);
146
- --ai-kit-launcher-shadow-hover: var(--ai-kit-shadow-sm-hover);
147
-
148
- /* Chat surface & borders */
149
- --ai-kit-chat-surface: var(--ai-kit-color-background);
150
- --ai-kit-chat-surface-subtle: var(--ai-kit-color-background-light);
151
- --ai-kit-chat-border-color: var(--ai-kit-color-border);
152
- --ai-kit-chat-border-radius: var(--ai-kit-radius-sm);
153
-
154
- /* Icon color in header actions */
155
- --ai-kit-chat-icon-color: var(--ai-kit-color-text);
156
-
157
- /* Status */
158
- --ai-kit-chat-status-bg: rgba(255, 255, 255, 0.95);
159
- --ai-kit-chat-status-fg: var(--ai-kit-color-text-muted);
160
-
161
- /* Bubbles */
162
- --ai-kit-user-bubble-bg: var(--ai-kit-color-primary);
163
- --ai-kit-user-bubble-color: var(--ai-kit-color-primary-contrast);
164
- --ai-kit-assistant-bubble-bg: rgba(0, 0, 0, 0.05);
165
- --ai-kit-assistant-bubble-color: inherit;
166
-
167
- /* Markdown */
168
- --ai-kit-chat-code-bg: rgba(0, 0, 0, 0.1);
169
- --ai-kit-chat-pre-bg: rgba(0, 0, 0, 0.05);
170
-
171
- /* Close button */
172
- --ai-kit-chat-close-bg: var(--ai-kit-color-background-lighter);
173
- --ai-kit-chat-close-bg-hover: rgba(0, 0, 0, 0.07);
174
-
175
- /* Typing */
176
- --ai-kit-chat-typing-dot-color: #adb5bd;
177
-
178
- /* Feedback */
179
- --ai-kit-chat-feedback-bg: var(--ai-kit-color-background-lighter);
180
- --ai-kit-chat-feedback-border: var(--ai-kit-color-border);
181
- --ai-kit-chat-feedback-active-bg: #ffd43b;
182
-
183
- --mantine-cursor-type: pointer;
184
- --switch-cursor: pointer;
185
-
186
- /* Typography apply */
187
- font-family: var(--ai-kit-font-family);
188
- }
189
-
190
- /* Variation defaults */
191
- :host[data-ai-kit-variation="default"] {
192
- --ai-kit-background-color: transparent;
193
- }
194
-
195
- /* ==========================================================================
196
- AI Feature & Doc Search – Shared styles
197
- ========================================================================== */
198
-
199
- .ai-feature-root,
200
- .doc-search-root {
201
- --mb-z-index: var(--ai-kit-position-z-index) !important;
202
- border: var(--ai-kit-border-width) solid var(--ai-kit-border-color);
203
- border-radius: var(--ai-kit-radius);
204
- }
205
-
206
- .ai-feature-root .Mantine-Paper-root,
207
- .doc-search-root .Mantine-Paper-root {
208
- background-color: transparent;
209
- }
210
-
211
- .ai-generated-content-disclosure {
212
- font-size: 0.75rem;
213
- line-height: 1.4;
214
- opacity: 0.78;
215
- text-align: center;
216
- }
217
-
218
- .ai-chatbot-generated-content-disclosure {
219
- margin: 0;
220
- padding: var(--ai-kit-space-1) var(--ai-kit-space-4)
221
- var(--ai-kit-space-2);
222
- background: var(--ai-kit-chat-status-bg);
223
- text-align: start;
224
- }
225
-
226
- .ai-feature-title-icon,
227
- .doc-search-title-icon {
228
- width: 24px;
229
- height: 24px;
230
- fill: none;
231
- margin-right: var(--ai-kit-space-2);
232
- }
233
-
234
- .ai-feature-open-button-no-title,
235
- .doc-search-button-no-title {
236
- padding-inline-start: var(--ai-kit-button-padding-x);
237
- padding-inline-end: var(--ai-kit-button-padding-x);
238
- }
239
-
240
- .ai-feature-open-button-no-title .mantine-Button-section,
241
- .doc-search-button-no-title .mantine-Button-section {
242
- margin-inline-end: unset;
243
- }
244
-
245
- .ai-feature-options {
246
- background-color: var(--ai-kit-options-background-color);
247
- border: var(--ai-kit-border-width) solid var(--ai-kit-border-color);
248
- border-radius: var(--ai-kit-radius-sm);
249
- font-size: var(--ai-kit-font-size-xs);
250
- cursor: pointer;
251
- }
252
-
253
- .ai-feature-options[data-options-display="horizontal"] {
254
- cursor: default;
255
- }
256
-
257
- .ai-feature-options[data-options-display="horizontal"] .ai-feature-option {
258
- flex: 1 1 auto;
259
- min-width: 120px;
260
- }
261
-
262
- .ai-feature-options-summary {
263
- --group-wrap: nowrap !important;
264
- }
265
-
266
- .ai-feature-status-text {
267
- font-size: var(--ai-kit-font-size-xs);
268
- opacity: 0.85;
269
- }
270
-
271
- .ai-feature-generated-content {
272
- border: var(--ai-kit-border-width) solid var(--ai-kit-border-color);
273
- border-radius: var(--ai-kit-radius);
274
- white-space: normal;
275
- background-color: var(--ai-kit-options-background-color);
276
- max-height: 400px;
277
- overflow: auto;
278
- padding: var(--ai-kit-space-2);
279
- font-size: var(--ai-kit-font-size);
280
- line-height: var(--ai-kit-line-height);
281
- }
282
-
283
- .ai-feature-generated-content * {
284
- margin-block-start: auto;
285
- margin-block-end: auto;
286
- }
287
-
288
- .ai-feature-generated-content.ai-feature-preview,
289
- .ai-feature-generated-content.ai-feature-editor {
290
- max-height: 200px;
291
- }
292
-
293
- .ai-feature-generated-content.ai-feature-editor textarea {
294
- border: 0;
295
- max-height: 198px;
296
- resize: vertical;
297
- }
298
-
299
- /* Animated border wrapper */
300
- .ai-kit-feature-border {
301
- background-color: var(--ai-kit-background-color);
302
- position: relative;
303
- overflow: visible;
304
- padding: var(--ai-kit-border-thickness);
305
- border-radius: var(--ai-kit-radius);
306
- width: 100%;
307
- box-sizing: border-box;
308
- }
309
-
310
- .ai-kit-feature-border__content {
311
- position: relative;
312
- z-index: 1;
313
- }
314
-
315
- .ai-kit-feature-border[data-ai-kit-active="false"]::before {
316
- content: "";
317
- position: absolute;
318
- inset: 0;
319
- z-index: 0;
320
- border-radius: var(--ai-kit-radius);
321
- padding: var(--ai-kit-border-thickness);
322
- }
323
-
324
- .ai-kit-feature-border[data-ai-kit-active="true"]::before {
325
- content: "";
326
- position: absolute;
327
- inset: 0;
328
- z-index: 0;
329
- border-radius: var(--ai-kit-radius);
330
- padding: var(--ai-kit-border-thickness);
331
- background: conic-gradient(
332
- from var(--ai-kit-border-angle, 0deg) at 50% 50%,
333
- var(--ai-kit-border-stops)
334
- );
335
- animation: ai-kit-border-run var(--ai-kit-border-speed) linear infinite;
336
- -webkit-mask:
337
- linear-gradient(#000 0 0) content-box,
338
- linear-gradient(#000 0 0);
339
- -webkit-mask-composite: xor;
340
- mask:
341
- linear-gradient(#000 0 0) content-box,
342
- linear-gradient(#000 0 0);
343
- mask-composite: exclude;
344
- }
345
-
346
- .ai-kit-feature-border[data-ai-kit-active="true"][data-ai-kit-variation="modal"] {
347
- box-shadow:
348
- 0 0 0 0.5px rgba(0, 0, 0, 0.06),
349
- 0 8px 24px rgba(0, 0, 0, 0.14),
350
- 0 0 28px rgba(124, 58, 237, 0.22);
351
- }
352
-
353
- @keyframes ai-kit-border-run {
354
- from {
355
- --ai-kit-border-angle: 0deg;
356
- }
357
- to {
358
- --ai-kit-border-angle: 360deg;
359
- }
360
- }
361
-
362
- @media (prefers-reduced-motion: reduce) {
363
- .ai-kit-feature-border[data-ai-kit-active="true"]::before {
364
- animation: none;
365
- }
366
- }
367
-
368
- /* Actions layout */
369
- .ai-kit-actions {
370
- display: flex;
371
- width: 100%;
372
- gap: var(--ai-kit-actions-gap, var(--ai-kit-space-2));
373
- justify-content: flex-end;
374
- flex-wrap: wrap;
375
- }
376
-
377
- .ai-kit-actions .mantine-Button-root {
378
- flex: var(--ai-kit-actions-button-flex, 1 1 0);
379
- min-width: var(--ai-kit-actions-button-min-width, 140px);
380
- }
381
-
382
- /* Leave action colors to Mantine's resolved primary palette and the shared
383
- WP Suite Theme CSS; this layer only standardizes interaction states. */
384
- .ai-feature-root .mantine-Button-root,
385
- .doc-search-root .mantine-Button-root,
386
- .ai-docs-ask .mantine-Button-root,
387
- .ai-docs-ask .mantine-ActionIcon-root {
388
- transition: var(--ai-kit-action-transition);
389
- }
390
-
391
- .ai-feature-root .mantine-Button-root:focus-visible,
392
- .doc-search-root .mantine-Button-root:focus-visible,
393
- .ai-docs-ask .mantine-Button-root:focus-visible,
394
- .ai-docs-ask .mantine-ActionIcon-root:focus-visible {
395
- outline: 2px solid var(--ai-kit-action-focus-ring);
396
- outline-offset: 2px;
397
- }
398
-
399
- .ai-feature-root .mantine-Button-root:disabled,
400
- .doc-search-root .mantine-Button-root:disabled,
401
- .ai-docs-ask .mantine-Button-root:disabled,
402
- .ai-docs-ask .mantine-ActionIcon-root:disabled {
403
- cursor: not-allowed;
404
- opacity: var(--ai-kit-action-disabled-opacity);
405
- }
406
-
407
- @media (max-width: var(--ai-kit-actions-breakpoint, 520px)) {
408
- .ai-kit-actions {
409
- flex-direction: column;
410
- align-items: stretch;
411
- }
412
-
413
- .ai-kit-actions .mantine-Button-root {
414
- flex: 1 1 auto;
415
- width: 100%;
416
- min-width: 0;
417
- }
418
- }
419
-
420
- /* ==========================================================================
421
- AI Chatbot
422
- ========================================================================== */
423
-
424
- /* Wrapper does not position; it only sets variables for the chosen corner */
425
- .ai-docs-ask {
426
- display: contents;
427
- }
428
-
429
- .ai-docs-ask[data-ai-kit-theme="dark"] {
430
- --ai-kit-chat-status-fg: var(--ai-kit-color-text);
431
- --ai-kit-chat-status-bg: transparent;
432
- }
433
-
434
- .ai-open-btn-icon {
435
- width: 24px;
436
- height: 24px;
437
- }
438
-
439
- .ai-docs-ask.ai-open-btn--bottom-right {
440
- --ai-kit-pos-top: auto;
441
- --ai-kit-pos-right: var(--ai-kit-open-button-offset-x);
442
- --ai-kit-pos-bottom: var(--ai-kit-open-button-offset-y);
443
- --ai-kit-pos-left: auto;
444
- }
445
-
446
- .ai-docs-ask.ai-open-btn--bottom-left {
447
- --ai-kit-pos-top: auto;
448
- --ai-kit-pos-right: auto;
449
- --ai-kit-pos-bottom: var(--ai-kit-open-button-offset-y);
450
- --ai-kit-pos-left: var(--ai-kit-open-button-offset-x);
451
- }
452
-
453
- .ai-docs-ask.ai-open-btn--top-right {
454
- --ai-kit-pos-top: var(--ai-kit-open-button-offset-y);
455
- --ai-kit-pos-right: var(--ai-kit-open-button-offset-x);
456
- --ai-kit-pos-bottom: auto;
457
- --ai-kit-pos-left: auto;
458
- }
459
-
460
- .ai-docs-ask.ai-open-btn--top-left {
461
- --ai-kit-pos-top: var(--ai-kit-open-button-offset-y);
462
- --ai-kit-pos-right: auto;
463
- --ai-kit-pos-bottom: auto;
464
- --ai-kit-pos-left: var(--ai-kit-open-button-offset-x);
465
- }
466
-
467
- .ai-docs-ask.ai-open-btn--bottom-right .ai-chat-container {
468
- transform-origin: bottom right;
469
- }
470
- .ai-docs-ask.ai-open-btn--bottom-left .ai-chat-container {
471
- transform-origin: bottom left;
472
- }
473
- .ai-docs-ask.ai-open-btn--top-right .ai-chat-container {
474
- transform-origin: top right;
475
- }
476
- .ai-docs-ask.ai-open-btn--top-left .ai-chat-container {
477
- transform-origin: top left;
478
- }
479
-
480
- /* Launcher Button (closed state)
481
- Note: This is a Mantine Button; ensure radius works by also overriding --button-radius */
482
- .ai-launcher-button {
483
- position: fixed;
484
- top: var(--ai-kit-pos-top, auto);
485
- right: var(--ai-kit-pos-right, auto);
486
- bottom: var(--ai-kit-pos-bottom, auto);
487
- left: var(--ai-kit-pos-left, auto);
488
-
489
- z-index: var(--ai-kit-position-z-index);
490
-
491
- width: auto;
492
- height: auto;
493
-
494
- /* Radius: apply both border-radius and Mantine variable */
495
- border-radius: var(--ai-kit-launcher-radius) !important;
496
- --button-radius: var(--ai-kit-launcher-radius) !important;
497
-
498
- border: none;
499
- background: var(--ai-kit-launcher-bg);
500
- color: var(--ai-kit-launcher-color);
501
-
502
- cursor: pointer;
503
-
504
- display: flex;
505
- align-items: center;
506
- justify-content: center;
507
- flex-direction: column;
508
- gap: 2px;
509
-
510
- box-shadow: var(--ai-kit-launcher-shadow);
511
- transition: var(--ai-kit-action-transition);
512
-
513
- padding: var(--ai-kit-space-3);
514
- pointer-events: auto;
515
- }
516
-
517
- .ai-launcher-button:hover {
518
- transform: scale(1.1);
519
- box-shadow: var(--ai-kit-launcher-shadow-hover);
520
- background: var(--ai-kit-launcher-bg-hover);
521
- }
522
-
523
- .ai-launcher-button:active {
524
- transform: scale(0.95);
525
- }
526
-
527
- .ai-launcher-button svg {
528
- width: 24px;
529
- height: 24px;
530
- stroke-linecap: round;
531
- stroke-linejoin: round;
532
- }
533
-
534
- .ai-launcher-text {
535
- font-size: 10px;
536
- font-weight: 600;
537
- text-transform: uppercase;
538
- letter-spacing: 0.3px;
539
- line-height: 1;
540
- }
541
-
542
- /* Chat Container (open state) – same corner as launcher */
543
- .ai-chat-container {
544
- position: fixed;
545
- top: var(--ai-kit-pos-top, auto);
546
- right: var(--ai-kit-pos-right, auto);
547
- bottom: var(--ai-kit-pos-bottom, auto);
548
- left: var(--ai-kit-pos-left, auto);
549
-
550
- z-index: var(--ai-kit-position-z-index);
551
-
552
- width: var(--ai-kit-chat-width);
553
- min-height: var(--ai-kit-chat-height-min);
554
- max-height: var(--ai-kit-chat-height-max);
555
- max-width: calc(90vw - 40px);
556
-
557
- border-radius: var(--ai-kit-chat-border-radius);
558
- border: 1px solid var(--ai-kit-chat-border-color);
559
- background: var(--ai-kit-chat-surface);
560
- box-shadow: var(--ai-kit-launcher-shadow);
561
-
562
- overflow: hidden;
563
- display: flex;
564
- pointer-events: auto;
565
- gap: 0;
566
-
567
- transition:
568
- transform 0.28s ease,
569
- opacity 0.2s ease;
570
- will-change: transform;
571
- }
572
-
573
- .ai-chat-container.maximized {
574
- top: 0 !important;
575
- right: 0 !important;
576
- bottom: 0 !important;
577
- left: 0 !important;
578
-
579
- width: 100vw !important;
580
- height: 100vh !important;
581
- max-width: 100vw !important;
582
- max-height: 100vh !important;
583
- border-radius: 0;
584
-
585
- transform: scale(1);
586
- opacity: 1;
587
- }
588
-
589
- .ai-chat-container.maximized.ai-max-enter {
590
- transform: scale(0.2);
591
- opacity: 0.9;
592
- }
593
-
594
- .ai-chat-container-internal {
595
- display: flex;
596
- width: 100%;
597
- max-width: 1300px;
598
- margin-right: auto;
599
- margin-left: auto;
600
- flex-direction: column;
601
- padding: 0 var(--ai-kit-space-3) var(--ai-kit-space-3) var(--ai-kit-space-3);
602
- }
603
-
604
- /* Input Box */
605
- .ai-box-open {
606
- gap: var(--ai-kit-space-2);
607
- padding: var(--ai-kit-space-4);
608
- border-top: 1px solid var(--ai-kit-color-border-light);
609
- background: var(--ai-kit-chat-surface-subtle);
610
- margin-top: auto;
611
- }
612
-
613
- /* Responsive tweaks */
614
- @media (max-width: 996px) {
615
- :host {
616
- --ai-kit-chat-launcher-size: 56px;
617
- }
618
-
619
- .ai-launcher-button svg {
620
- width: 22px;
621
- height: 22px;
622
- }
623
-
624
- .ai-chat-container {
625
- width: calc(100vw - 40px);
626
- height: calc(100vh - 40px);
627
- max-width: none;
628
- max-height: none;
629
-
630
- /* Keep same position variables */
631
- top: var(--ai-kit-pos-top, auto);
632
- right: var(--ai-kit-pos-right, auto);
633
- bottom: var(--ai-kit-pos-bottom, auto);
634
- left: var(--ai-kit-pos-left, auto);
635
- }
636
- }
637
-
638
- @media (max-width: 600px) {
639
- .ai-chat-container {
640
- top: 0 !important;
641
- right: 0 !important;
642
- bottom: 0 !important;
643
- left: 0 !important;
644
-
645
- width: 100% !important;
646
- height: 100% !important;
647
- border-radius: 0;
648
- max-width: 100% !important;
649
- max-height: 100% !important;
650
- }
651
-
652
- .ai-box-open {
653
- padding: var(--ai-kit-space-3);
654
- }
655
- }
656
-
657
- /* Header / status */
658
- .ai-chat-header-bar {
659
- background: var(--ai-kit-chat-surface);
660
- display: flex;
661
- align-items: center;
662
- justify-content: space-between;
663
- padding: 0 var(--ai-kit-space-3);
664
- border-bottom: 1px solid var(--ai-kit-chat-border-color);
665
- margin-left: calc(-1 * var(--ai-kit-button-padding-x));
666
- margin-right: calc(-1 * var(--ai-kit-button-padding-x));
667
- }
668
-
669
- .ai-status-line {
670
- padding: var(--ai-kit-space-2) var(--ai-kit-space-4);
671
- font-size: var(--ai-kit-font-size-sm);
672
- color: var(--ai-kit-chat-status-fg);
673
- background: var(--ai-kit-chat-status-bg);
674
- }
675
-
676
- .ai-chat-title {
677
- font-weight: 600;
678
- font-size: var(--ai-kit-font-size-title);
679
- }
680
-
681
- .ai-close-button {
682
- display: inline-flex;
683
- align-items: center;
684
- justify-content: center;
685
- gap: 4px;
686
- padding: 4px 8px;
687
- border-radius: var(--ai-kit-radius-pill);
688
- border: 1px solid var(--ai-kit-color-border);
689
- background: var(--ai-kit-chat-close-bg);
690
- color: inherit;
691
- cursor: pointer;
692
- font-size: 0.8rem;
693
- transition:
694
- background 0.2s ease,
695
- transform 0.1s ease;
696
- }
697
-
698
- .ai-close-button:hover {
699
- background: var(--ai-kit-chat-close-bg-hover);
700
- transform: scale(1.05);
701
- }
702
-
703
- .ai-close-button:active {
704
- transform: scale(0.95);
705
- }
706
-
707
- .ai-close-button svg {
708
- width: 16px;
709
- height: 16px;
710
- stroke-linecap: round;
711
- stroke-linejoin: round;
712
- }
713
-
714
- /* Chat area */
715
- .ai-chat-scroll {
716
- flex: 1;
717
- overflow-y: auto;
718
- padding: var(--ai-kit-space-4);
719
- overscroll-behavior: auto;
720
- }
721
-
722
- .ai-chat-scroll[data-scrollable="true"] {
723
- overscroll-behavior: contain;
724
- }
725
-
726
- .ai-chat-placeholder {
727
- padding: var(--ai-kit-space-4);
728
- color: #868e96;
729
- }
730
-
731
- .ai-chat-row {
732
- margin-bottom: var(--ai-kit-space-2);
733
- display: flex;
734
- }
735
-
736
- .ai-chat-row.user {
737
- justify-content: flex-end;
738
- }
739
-
740
- .ai-chat-row.assistant {
741
- justify-content: flex-start;
742
- }
743
-
744
- .ai-chat-bubble {
745
- padding: 10px 12px;
746
- border-radius: var(--ai-kit-radius-sm);
747
- background: var(--ai-kit-assistant-bubble-bg);
748
- font-size: var(--ai-kit-font-size);
749
- color: var(--ai-kit-assistant-bubble-color);
750
- word-wrap: break-word;
751
- overflow-wrap: break-word;
752
- word-break: break-word;
753
- hyphens: auto;
754
- line-height: var(--ai-kit-line-height);
755
- width: fit-content;
756
- max-width: 80%;
757
- }
758
-
759
- .ai-chat-bubble > * {
760
- margin: 0;
761
- }
762
-
763
- .ai-chat-row.user .ai-chat-bubble {
764
- background: var(--ai-kit-user-bubble-bg);
765
- color: var(--ai-kit-user-bubble-color);
766
- }
767
-
768
- .ai-chat-header {
769
- display: flex;
770
- justify-content: space-between;
771
- font-size: 0.75rem;
772
- margin-bottom: 4px;
773
- opacity: 0.8;
774
- }
775
-
776
- /* Input card */
777
- .ai-box {
778
- border-radius: var(--ai-kit-radius-sm);
779
- border: 1px solid var(--ai-kit-color-border);
780
- padding: var(--ai-kit-space-2);
781
- background: var(--ai-kit-color-background);
782
- display: flex;
783
- flex-direction: column;
784
- gap: var(--ai-kit-space-2);
785
- }
786
-
787
- .ai-message {
788
- --input-padding-inline-start: var(--ai-kit-input-padding-x);
789
- --input-padding-inline-end: var(--ai-kit-input-padding-x);
790
-
791
- flex: 1;
792
- resize: vertical;
793
- outline: none;
794
- border: 1px solid var(--ai-kit-color-border-muted);
795
- border-radius: var(--ai-kit-radius-sm);
796
- font-size: var(--ai-kit-font-size);
797
- }
798
-
799
- .ai-message textarea {
800
- border: 0;
801
- resize: vertical;
802
- min-height: 64px;
803
- }
804
-
805
- /* Thumbs */
806
- .ai-thumbs {
807
- display: flex;
808
- flex-wrap: wrap;
809
- gap: var(--ai-kit-space-2);
810
- }
811
-
812
- .ai-thumbs .thumb {
813
- position: relative;
814
- width: 80px;
815
- height: 80px;
816
- border-radius: var(--ai-kit-radius-sm);
817
- overflow: hidden;
818
- border: 1px solid var(--ai-kit-color-border);
819
- }
820
-
821
- .ai-chat-scroll.ai-thumbs {
822
- gap: var(--ai-kit-space-1);
823
- }
824
-
825
- .ai-chat-scroll .ai-thumbs .thumb {
826
- width: 40px;
827
- height: 40px;
828
- }
829
-
830
- .ai-thumbs img {
831
- width: 100%;
832
- height: 100%;
833
- object-fit: cover;
834
- }
835
-
836
- .ai-thumbs .thumb button {
837
- position: absolute;
838
- top: 2px;
839
- right: 2px;
840
- border-radius: var(--ai-kit-radius-pill);
841
- border: none;
842
- background: rgba(0, 0, 0, 0.6);
843
- color: #fff;
844
- width: 20px;
845
- height: 20px;
846
- cursor: pointer;
847
- font-size: 14px;
848
- line-height: 18px;
849
- }
850
-
851
- /* Citations / status / feedback */
852
- .ai-citations {
853
- margin-top: var(--ai-kit-space-2);
854
- font-size: 0.8rem;
855
- }
856
-
857
- .ai-citations ul {
858
- padding-left: 16px;
859
- margin: 4px 0 0;
860
- }
861
-
862
- .ai-status-text {
863
- font-size: 0.85rem;
864
- color: var(--ai-kit-color-text);
865
- }
866
-
867
- .ai-feedback {
868
- margin-top: 6px;
869
- display: flex;
870
- gap: 4px;
871
- }
872
-
873
- .ai-feedback button {
874
- border-radius: var(--ai-kit-radius-pill) !important;
875
- border: 1px solid var(--ai-kit-chat-feedback-border);
876
- background: var(--ai-kit-chat-feedback-bg);
877
- width: 32px;
878
- height: 32px;
879
- cursor: pointer;
880
- padding: 0;
881
- }
882
-
883
- .ai-feedback button.active {
884
- background: var(--ai-kit-chat-feedback-active-bg);
885
- }
886
-
887
- .ai-error {
888
- color: var(--ai-kit-color-danger);
889
- font-size: 0.9rem;
890
- }
891
-
892
- /* Markdown formatting */
893
- .ai-feature-root p,
894
- .doc-search-root p,
895
- .ai-feature-root ul,
896
- .doc-search-root ul,
897
- .ai-feature-root ol,
898
- .doc-search-root ol,
899
- .ai-feature-root pre,
900
- .doc-search-root pre,
901
- .ai-feature-root code,
902
- .doc-search-root code {
903
- margin: 0;
904
- word-wrap: break-word;
905
- overflow-wrap: break-word;
906
- }
907
-
908
- .ai-chat-bubble code {
909
- background: var(--ai-kit-chat-code-bg);
910
- padding: 2px 4px;
911
- border-radius: 3px;
912
- font-size: 0.9em;
913
- }
914
-
915
- .ai-chat-bubble pre {
916
- background: var(--ai-kit-chat-pre-bg);
917
- padding: 8px;
918
- border-radius: 4px;
919
- overflow-x: auto;
920
- max-width: 100%;
921
- }
922
-
923
- /* Typing indicator */
924
- .typing-indicator {
925
- display: inline-flex;
926
- gap: 4px;
927
- }
928
-
929
- .typing-indicator span {
930
- width: 6px;
931
- height: 6px;
932
- border-radius: 999px;
933
- background: var(--ai-kit-chat-typing-dot-color);
934
- animation: typing-bounce 0.9s infinite ease-in-out;
935
- }
936
-
937
- .typing-indicator span:nth-child(2) {
938
- animation-delay: 0.15s;
939
- }
940
-
941
- .typing-indicator span:nth-child(3) {
942
- animation-delay: 0.3s;
943
- }
944
-
945
- @keyframes typing-bounce {
946
- 0%,
947
- 80%,
948
- 100% {
949
- transform: translateY(0);
950
- }
951
- 40% {
952
- transform: translateY(-4px);
953
- }
954
- }
955
-
956
- /* Audio recording pulse animation */
957
- @keyframes pulse {
958
- 0% {
959
- opacity: 1;
960
- transform: scale(1);
961
- }
962
- 50% {
963
- opacity: 0.7;
964
- transform: scale(1.05);
965
- }
966
- 100% {
967
- opacity: 1;
968
- transform: scale(1);
969
- }
970
- }
971
-
972
- /* Recording pulse button animation */
973
- .recording-pulse {
974
- animation: pulse 1.5s ease-in-out infinite !important;
975
- }
976
-
977
- /* Audio player styling */
978
- .ai-kit-audio-player {
979
- max-width: 100%;
980
- max-height: 40px;
981
- border-radius: var(--ai-kit-radius, 4px);
982
- outline: none;
983
- background: transparent;
984
- border: none;
985
- }
986
-
987
- .ai-kit-audio-player::-webkit-media-controls-panel {
988
- background: var(--ai-kit-color-surface-3, rgba(0, 0, 0, 0.03));
989
- border: 1px solid var(--ai-kit-color-border, rgba(0, 0, 0, 0.12));
990
- border-radius: var(--ai-kit-radius, 4px);
991
- }
992
-
993
- .ai-kit-audio-player::-webkit-media-controls-play-button,
994
- .ai-kit-audio-player::-webkit-media-controls-mute-button {
995
- background-color: transparent;
996
- border-radius: 2px;
997
- }
998
-
999
- .ai-kit-audio-player::-webkit-media-controls-timeline {
1000
- border-radius: 2px;
1001
- }
1002
-
1003
- .ai-kit-audio-player::-webkit-media-controls-current-time-display,
1004
- .ai-kit-audio-player::-webkit-media-controls-time-remaining-display {
1005
- border-radius: 0;
1006
- }