@duskmoon-dev/core 1.16.0 → 1.17.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.
@@ -0,0 +1,413 @@
1
+ // Auto-generated from chat.css
2
+ export const css = `/**
3
+ * Chat Component Styles
4
+ * DuskMoonUI - LLM-oriented chat primitives
5
+ */
6
+
7
+ @layer components {
8
+ .chat {
9
+ display: grid;
10
+ grid-template-columns: auto minmax(0, 1fr);
11
+ column-gap: 0.75rem;
12
+ align-items: end;
13
+ padding: 0.25rem 0;
14
+ }
15
+
16
+ .chat-start {
17
+ grid-template-columns: auto minmax(0, 1fr);
18
+ }
19
+
20
+ .chat-end {
21
+ grid-template-columns: minmax(0, 1fr) auto;
22
+ }
23
+
24
+ .chat-avatar {
25
+ grid-row: 1 / span 999;
26
+ grid-column: 1;
27
+ align-self: start;
28
+ justify-self: start;
29
+ }
30
+
31
+ .chat-end .chat-avatar {
32
+ grid-column: 2;
33
+ justify-self: end;
34
+ }
35
+
36
+ .chat > :not(.chat-avatar) {
37
+ grid-column: 2;
38
+ justify-self: start;
39
+ max-width: 100%;
40
+ margin-bottom: 0.25rem;
41
+ }
42
+
43
+ .chat-end > :not(.chat-avatar) {
44
+ grid-column: 1;
45
+ justify-self: end;
46
+ }
47
+
48
+ .chat-header,
49
+ .chat-footer {
50
+ color: var(--color-on-surface-variant);
51
+ font-size: 0.75rem;
52
+ line-height: 1rem;
53
+ }
54
+
55
+ .chat-header {
56
+ margin-bottom: 0.125rem;
57
+ }
58
+
59
+ .chat-footer {
60
+ margin-top: 0.125rem;
61
+ margin-bottom: 0;
62
+ }
63
+
64
+ .chat-bubble {
65
+ --chat-bubble-bg: var(--color-surface-container-highest);
66
+ --chat-bubble-fg: var(--color-on-surface);
67
+
68
+ position: relative;
69
+ max-width: min(80ch, 100%);
70
+ padding: 0.625rem 0.875rem;
71
+ border-radius: 1rem;
72
+ background-color: var(--chat-bubble-bg);
73
+ color: var(--chat-bubble-fg);
74
+ box-shadow: inset 0 0 0 1px var(--color-outline-variant);
75
+ font-size: 0.875rem;
76
+ line-height: 1.45;
77
+ overflow-wrap: anywhere;
78
+ word-break: break-word;
79
+ }
80
+
81
+ .chat-start .chat-bubble::before,
82
+ .chat-end .chat-bubble::before,
83
+ .chat-start .chat-bubble::after,
84
+ .chat-end .chat-bubble::after {
85
+ content: "";
86
+ position: absolute;
87
+ top: 0;
88
+ clip-path: polygon(0 0, 100% 0, 100% 100%);
89
+ }
90
+
91
+ .chat-start .chat-bubble::before {
92
+ left: -0.625rem;
93
+ width: 1rem;
94
+ height: 1rem;
95
+ background-color: var(--color-outline-variant);
96
+ }
97
+
98
+ .chat-start .chat-bubble::after {
99
+ left: -0.5rem;
100
+ width: calc(1rem - 2px);
101
+ height: calc(1rem - 2px);
102
+ top: 1px;
103
+ background-color: var(--chat-bubble-bg);
104
+ }
105
+
106
+ .chat-start .chat-bubble {
107
+ border-top-left-radius: 0;
108
+ }
109
+
110
+ .chat-end .chat-bubble::before {
111
+ right: -0.625rem;
112
+ width: 1rem;
113
+ height: 1rem;
114
+ background-color: var(--color-outline-variant);
115
+ transform: scaleX(-1);
116
+ }
117
+
118
+ .chat-end .chat-bubble::after {
119
+ right: -0.5rem;
120
+ width: calc(1rem - 2px);
121
+ height: calc(1rem - 2px);
122
+ top: 1px;
123
+ background-color: var(--chat-bubble-bg);
124
+ transform: scaleX(-1);
125
+ }
126
+
127
+ .chat-end .chat-bubble {
128
+ border-top-right-radius: 0;
129
+ }
130
+
131
+ .chat-bubble-primary {
132
+ --chat-bubble-bg: var(--color-primary-container);
133
+ --chat-bubble-fg: var(--color-on-primary-container);
134
+ }
135
+
136
+ .chat-bubble-secondary {
137
+ --chat-bubble-bg: var(--color-secondary-container);
138
+ --chat-bubble-fg: var(--color-on-secondary-container);
139
+ }
140
+
141
+ .chat-bubble-tertiary {
142
+ --chat-bubble-bg: var(--color-tertiary-container);
143
+ --chat-bubble-fg: var(--color-on-tertiary-container);
144
+ }
145
+
146
+ .chat-bubble-info {
147
+ --chat-bubble-bg: var(--color-info-container);
148
+ --chat-bubble-fg: var(--color-on-info-container);
149
+ }
150
+
151
+ .chat-bubble-success {
152
+ --chat-bubble-bg: var(--color-success-container);
153
+ --chat-bubble-fg: var(--color-on-success-container);
154
+ }
155
+
156
+ .chat-bubble-warning {
157
+ --chat-bubble-bg: var(--color-warning-container);
158
+ --chat-bubble-fg: var(--color-on-warning-container);
159
+ }
160
+
161
+ .chat-bubble-error {
162
+ --chat-bubble-bg: var(--color-error-container);
163
+ --chat-bubble-fg: var(--color-on-error-container);
164
+ }
165
+
166
+ .chat-bubble-filled.chat-bubble-primary {
167
+ --chat-bubble-bg: var(--color-primary);
168
+ --chat-bubble-fg: var(--color-primary-content);
169
+ }
170
+
171
+ .chat-bubble-filled.chat-bubble-secondary {
172
+ --chat-bubble-bg: var(--color-secondary);
173
+ --chat-bubble-fg: var(--color-secondary-content);
174
+ }
175
+
176
+ .chat-bubble-filled.chat-bubble-tertiary {
177
+ --chat-bubble-bg: var(--color-tertiary);
178
+ --chat-bubble-fg: var(--color-tertiary-content);
179
+ }
180
+
181
+ .chat-bubble-filled.chat-bubble-info {
182
+ --chat-bubble-bg: var(--color-info);
183
+ --chat-bubble-fg: var(--color-info-content);
184
+ }
185
+
186
+ .chat-bubble-filled.chat-bubble-success {
187
+ --chat-bubble-bg: var(--color-success);
188
+ --chat-bubble-fg: var(--color-success-content);
189
+ }
190
+
191
+ .chat-bubble-filled.chat-bubble-warning {
192
+ --chat-bubble-bg: var(--color-warning);
193
+ --chat-bubble-fg: var(--color-warning-content);
194
+ }
195
+
196
+ .chat-bubble-filled.chat-bubble-error {
197
+ --chat-bubble-bg: var(--color-error);
198
+ --chat-bubble-fg: var(--color-error-content);
199
+ }
200
+
201
+ .chat-bubble-xs {
202
+ padding: 0.375rem 0.625rem;
203
+ font-size: 0.75rem;
204
+ }
205
+
206
+ .chat-bubble-sm {
207
+ padding: 0.5rem 0.75rem;
208
+ font-size: 0.8125rem;
209
+ }
210
+
211
+ .chat-bubble-md {
212
+ padding: 0.625rem 0.875rem;
213
+ font-size: 0.875rem;
214
+ }
215
+
216
+ .chat-bubble-lg {
217
+ padding: 0.875rem 1.125rem;
218
+ font-size: 1rem;
219
+ }
220
+
221
+ .chat-reasoning,
222
+ .chat-tool {
223
+ width: min(80ch, 100%);
224
+ border: 1px solid var(--color-outline);
225
+ border-radius: var(--radius-sm);
226
+ background-color: var(--color-surface-container-low);
227
+ color: var(--color-on-surface);
228
+ font-size: 0.8125rem;
229
+ line-height: 1.45;
230
+ overflow: hidden;
231
+ }
232
+
233
+ .chat-reasoning > summary,
234
+ .chat-tool > summary {
235
+ cursor: pointer;
236
+ list-style-position: inside;
237
+ }
238
+
239
+ .chat-reasoning > summary {
240
+ padding: 0.5rem 0.75rem;
241
+ color: var(--color-on-surface-variant);
242
+ font-weight: 500;
243
+ }
244
+
245
+ .chat-reasoning > :not(summary) {
246
+ padding: 0 0.75rem 0.75rem;
247
+ color: var(--color-on-surface-variant);
248
+ font-style: italic;
249
+ }
250
+
251
+ .chat-tool-header {
252
+ display: flex;
253
+ align-items: center;
254
+ gap: 0.5rem;
255
+ padding: 0.5rem 0.75rem;
256
+ color: var(--color-on-surface);
257
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
258
+ font-size: 0.75rem;
259
+ font-weight: 600;
260
+ }
261
+
262
+ .chat-tool-status {
263
+ display: inline-flex;
264
+ align-items: center;
265
+ min-height: 1.25rem;
266
+ padding: 0.125rem 0.5rem;
267
+ border-radius: 999px;
268
+ margin-left: auto;
269
+ font-family: inherit;
270
+ font-size: 0.6875rem;
271
+ font-weight: 600;
272
+ line-height: 1;
273
+ }
274
+
275
+ .chat-tool-call,
276
+ .chat-tool-result {
277
+ padding: 0.75rem;
278
+ border-top: 1px solid var(--color-outline);
279
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
280
+ font-size: 0.75rem;
281
+ overflow-x: auto;
282
+ }
283
+
284
+ .chat-tool-result {
285
+ background-color: color-mix(in oklch, var(--color-surface-container) 65%, transparent);
286
+ }
287
+
288
+ .chat-tool-pending .chat-tool-status {
289
+ border: 1px solid var(--color-outline);
290
+ color: var(--color-on-surface-variant);
291
+ }
292
+
293
+ .chat-tool-running .chat-tool-status {
294
+ background-color: var(--color-info-container);
295
+ color: var(--color-on-info-container);
296
+ }
297
+
298
+ .chat-tool-running .chat-tool-header::before {
299
+ content: "";
300
+ width: 0.875rem;
301
+ height: 0.875rem;
302
+ border: 2px solid currentColor;
303
+ border-top-color: transparent;
304
+ border-radius: 999px;
305
+ animation: chat-tool-spin 800ms linear infinite;
306
+ }
307
+
308
+ .chat-tool-success .chat-tool-status {
309
+ background-color: var(--color-success-container);
310
+ color: var(--color-on-success-container);
311
+ }
312
+
313
+ .chat-tool-error .chat-tool-status {
314
+ background-color: var(--color-error-container);
315
+ color: var(--color-on-error-container);
316
+ }
317
+
318
+ .chat-typing {
319
+ display: inline-flex;
320
+ align-items: center;
321
+ gap: 0.25rem;
322
+ min-width: 2.25rem;
323
+ }
324
+
325
+ .chat-typing::before,
326
+ .chat-typing::after,
327
+ .chat-typing span {
328
+ content: "";
329
+ width: 0.375rem;
330
+ height: 0.375rem;
331
+ border-radius: 999px;
332
+ background-color: currentColor;
333
+ opacity: 0.55;
334
+ animation: chat-typing-dot 1.4s ease-in-out infinite;
335
+ }
336
+
337
+ .chat-typing span {
338
+ animation-delay: 150ms;
339
+ }
340
+
341
+ .chat-typing::after {
342
+ animation-delay: 300ms;
343
+ }
344
+
345
+ .chat-bubble-streaming::after {
346
+ content: "";
347
+ display: inline-block;
348
+ width: 1px;
349
+ height: 1em;
350
+ margin-left: 0.25rem;
351
+ background-color: currentColor;
352
+ vertical-align: -0.125em;
353
+ animation: chat-stream-caret 1s step-end infinite;
354
+ }
355
+
356
+ .chat-reasoning > summary:focus-visible,
357
+ .chat-tool > summary:focus-visible {
358
+ outline: none;
359
+ box-shadow: 0 0 0 3px color-mix(in oklch, currentColor 20%, transparent);
360
+ }
361
+
362
+ @keyframes chat-typing-dot {
363
+ 0%,
364
+ 80%,
365
+ 100% {
366
+ opacity: 0.45;
367
+ transform: translateY(0);
368
+ }
369
+
370
+ 40% {
371
+ opacity: 1;
372
+ transform: translateY(-0.1875rem);
373
+ }
374
+ }
375
+
376
+ @keyframes chat-stream-caret {
377
+ 0%,
378
+ 49% {
379
+ opacity: 1;
380
+ }
381
+
382
+ 50%,
383
+ 100% {
384
+ opacity: 0;
385
+ }
386
+ }
387
+
388
+ @keyframes chat-tool-spin {
389
+ to {
390
+ transform: rotate(360deg);
391
+ }
392
+ }
393
+
394
+ @media (prefers-reduced-motion: reduce) {
395
+ .chat-typing::before,
396
+ .chat-typing::after,
397
+ .chat-typing span,
398
+ .chat-bubble-streaming::after,
399
+ .chat-tool-running .chat-tool-header::before {
400
+ animation: none;
401
+ }
402
+
403
+ .chat-bubble-streaming::after {
404
+ opacity: 1;
405
+ }
406
+ }
407
+ }
408
+ `;
409
+
410
+ const sheet = new CSSStyleSheet();
411
+ sheet.replaceSync(css);
412
+ export const styles = sheet;
413
+ export default sheet;