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