@sarchauhan/chat 0.0.0-stage → 0.0.1

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,345 @@
1
+ .chat-model-trigger [data-slot="select-value"] {
2
+ min-width: 0;
3
+ overflow: hidden;
4
+ text-overflow: ellipsis;
5
+ }
6
+
7
+ .chat-model-selected {
8
+ display: inline-flex;
9
+ min-width: 0;
10
+ align-items: center;
11
+ gap: var(--chat-space-2, 0.5rem);
12
+ overflow: hidden;
13
+ text-overflow: ellipsis;
14
+ white-space: nowrap;
15
+ }
16
+
17
+ .chat-model-selected > span:last-child {
18
+ overflow: hidden;
19
+ text-overflow: ellipsis;
20
+ }
21
+
22
+ .chat-model-selected .chat-model-provider-logo {
23
+ height: 1rem;
24
+ width: 1rem;
25
+ }
26
+
27
+ .chat-model-trigger svg {
28
+ height: 1rem;
29
+ width: 1rem;
30
+ flex: 0 0 auto;
31
+ color: currentColor;
32
+ opacity: 0.45;
33
+ }
34
+
35
+ .chat-model-trigger[data-state="open"] {
36
+ background: var(--chat-control-bg, rgba(0, 0, 0, 0.04));
37
+ color: var(--chat-fg, #0d0d0d);
38
+ }
39
+
40
+ .chat-model-trigger[data-state="open"] svg {
41
+ transform: rotate(180deg);
42
+ }
43
+
44
+ .chat-model-content {
45
+ z-index: 10;
46
+ min-width: max(var(--radix-select-trigger-width, 11rem), 15rem);
47
+ max-width: min(22rem, calc(100vw - 2rem));
48
+ max-height: min(24rem, var(--radix-select-content-available-height, 24rem));
49
+ overflow-x: hidden;
50
+ overflow-y: auto;
51
+ overscroll-behavior: contain;
52
+ border: 1px solid var(--chat-border, rgba(0, 0, 0, 0.07));
53
+ border-radius: var(--chat-radius);
54
+ background: var(--chat-bg-elevated, #ffffff);
55
+ color: var(--chat-fg, #0d0d0d);
56
+ box-shadow:
57
+ 0 1px 2px rgba(0, 0, 0, 0.04),
58
+ 0 8px 24px rgba(0, 0, 0, 0.08);
59
+ padding: 0;
60
+ scrollbar-gutter: stable;
61
+ }
62
+
63
+ .chat-model-search {
64
+ position: sticky;
65
+ top: 0;
66
+ z-index: 2;
67
+ background: var(--chat-bg-elevated, #ffffff);
68
+ padding: var(--chat-space-2_5) var(--chat-space-2_5) var(--chat-space-2);
69
+ }
70
+
71
+ .chat-model-search-input {
72
+ width: 100%;
73
+ height: 2.15rem;
74
+ border: 1px solid var(--chat-border, rgba(0, 0, 0, 0.08));
75
+ border-radius: var(--chat-radius);
76
+ background: var(--chat-composer-bg, #ffffff);
77
+ color: var(--chat-fg, #0d0d0d);
78
+ font-size: var(--chat-fs-13);
79
+ font-weight: var(--chat-weight-regular);
80
+ letter-spacing: var(--chat-tracking-normal);
81
+ line-height: var(--chat-leading-none);
82
+ padding: 0 var(--chat-space-3);
83
+ outline: none;
84
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02);
85
+ transition:
86
+ border-color var(--chat-transition, 160ms ease),
87
+ box-shadow var(--chat-transition, 160ms ease),
88
+ background-color var(--chat-transition, 160ms ease);
89
+ }
90
+
91
+ .chat-model-search-input::placeholder {
92
+ color: var(--chat-fg-subtle, #8e8ea0);
93
+ font-weight: var(--chat-weight-regular);
94
+ }
95
+
96
+ .chat-model-search-input:focus {
97
+ border-color: var(--chat-border-strong, rgba(0, 0, 0, 0.14));
98
+ background: var(--chat-bg-elevated, #ffffff);
99
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--chat-border-strong, rgba(0, 0, 0, 0.12)) 22%, transparent);
100
+ }
101
+
102
+ .chat-root[data-theme="dark"] .chat-model-search-input {
103
+ background: var(--chat-control-bg, rgba(255, 255, 255, 0.06));
104
+ border-color: var(--chat-border, rgba(255, 255, 255, 0.08));
105
+ }
106
+
107
+ .chat-root[data-theme="dark"] .chat-model-search-input:focus {
108
+ background: var(--chat-bg-elevated, #2f2f2f);
109
+ border-color: var(--chat-border-strong, rgba(255, 255, 255, 0.14));
110
+ }
111
+
112
+ .chat-model-list {
113
+ padding: var(--chat-space-1_5);
114
+ }
115
+
116
+ .chat-model-content [data-slot="select-viewport"] {
117
+ height: auto !important;
118
+ max-height: none;
119
+ overflow: visible !important;
120
+ }
121
+
122
+ .chat-model-content [data-slot="select-group"] + [data-slot="select-group"] {
123
+ margin-top: var(--chat-space-05);
124
+ }
125
+
126
+ .chat-model-content .chat-model-label {
127
+ display: flex;
128
+ align-items: center;
129
+ gap: var(--chat-space-2, 0.5rem);
130
+ color: var(--chat-fg-subtle, #8e8ea0);
131
+ font-size: var(--chat-fs-11);
132
+ font-weight: var(--chat-weight-medium);
133
+ letter-spacing: var(--chat-tracking-wide);
134
+ text-transform: uppercase;
135
+ line-height: var(--chat-leading-tight);
136
+ padding: var(--chat-space-2) var(--chat-space-2) var(--chat-space-1);
137
+ }
138
+
139
+ .chat-model-provider-logo {
140
+ height: 0.875rem;
141
+ width: 0.875rem;
142
+ flex: 0 0 auto;
143
+ border-radius: var(--chat-radius-xs);
144
+ object-fit: contain;
145
+ }
146
+
147
+ /* Mono SVGs (black on transparent) auto-invert in dark mode so a single logo works */
148
+ .chat-root[data-theme="dark"] .chat-model-provider-logo {
149
+ filter: invert(1) contrast(1.05);
150
+ }
151
+
152
+ @media (prefers-color-scheme: dark) {
153
+ .chat-root[data-theme="system"] .chat-model-provider-logo {
154
+ filter: invert(1) contrast(1.05);
155
+ }
156
+ }
157
+
158
+ .chat-model-provider-fallback {
159
+ display: inline-flex;
160
+ align-items: center;
161
+ justify-content: center;
162
+ border: 1px solid var(--chat-border, rgba(0, 0, 0, 0.08));
163
+ background: var(--chat-control-bg, rgba(0, 0, 0, 0.04));
164
+ color: var(--chat-fg-muted, #6e6e80);
165
+ font-size: var(--chat-fs-11);
166
+ font-weight: var(--chat-weight-semibold);
167
+ text-transform: uppercase;
168
+ }
169
+
170
+ .chat-model-content .chat-model-item {
171
+ position: relative;
172
+ display: flex;
173
+ min-height: 2.15rem;
174
+ width: 100%;
175
+ cursor: pointer;
176
+ align-items: center;
177
+ justify-content: space-between;
178
+ gap: var(--chat-space-3);
179
+ border-radius: var(--chat-radius);
180
+ color: var(--chat-fg, #0d0d0d);
181
+ font-size: var(--chat-fs-13);
182
+ font-weight: var(--chat-weight-regular);
183
+ line-height: var(--chat-leading-snug);
184
+ letter-spacing: var(--chat-tracking-normal);
185
+ padding: var(--chat-space-2) 2.2rem var(--chat-space-2) var(--chat-space-3);
186
+ outline: none;
187
+ user-select: none;
188
+ }
189
+
190
+ .chat-model-item-label {
191
+ min-width: 0;
192
+ overflow: hidden;
193
+ text-overflow: ellipsis;
194
+ white-space: nowrap;
195
+ }
196
+
197
+ .chat-model-item-hint {
198
+ flex: 0 0 auto;
199
+ color: var(--chat-fg-subtle, #8e8ea0);
200
+ font-size: var(--chat-fs-12);
201
+ font-weight: var(--chat-weight-regular);
202
+ letter-spacing: var(--chat-tracking-normal);
203
+ white-space: nowrap;
204
+ }
205
+
206
+ .chat-model-empty {
207
+ padding: var(--chat-space-4) var(--chat-space-3);
208
+ text-align: center;
209
+ color: var(--chat-fg-subtle, #8e8ea0);
210
+ font-size: var(--chat-fs-13);
211
+ }
212
+
213
+ .chat-model-content [data-slot="select-viewport"] .chat-model-item {
214
+ white-space: nowrap;
215
+ }
216
+
217
+ .chat-model-content .chat-model-item[data-highlighted] {
218
+ background: var(--chat-control-bg, rgba(0, 0, 0, 0.04));
219
+ color: var(--chat-fg, #0d0d0d);
220
+ }
221
+
222
+ .chat-model-content .chat-model-item[data-state="checked"] {
223
+ background: rgba(0, 0, 0, 0.06);
224
+ color: var(--chat-fg, #0d0d0d);
225
+ }
226
+
227
+ .chat-root[data-theme="dark"] .chat-model-content .chat-model-item[data-state="checked"] {
228
+ background: rgba(255, 255, 255, 0.09);
229
+ }
230
+
231
+ .chat-model-content .chat-model-item [data-slot="select-item-indicator"] {
232
+ display: none !important;
233
+ }
234
+
235
+ .chat-model-content [data-slot="select-scroll-up-button"],
236
+ .chat-model-content [data-slot="select-scroll-down-button"] {
237
+ display: none !important;
238
+ }
239
+
240
+ .chat-model-row {
241
+ position: relative;
242
+ display: flex;
243
+ align-items: center;
244
+ }
245
+
246
+ .chat-model-row .chat-model-item {
247
+ flex: 1 1 auto;
248
+ min-width: 0;
249
+ padding-right: 2.2rem;
250
+ }
251
+
252
+ .chat-model-thinking-trigger {
253
+ position: absolute;
254
+ right: 0.5rem;
255
+ display: inline-flex;
256
+ align-items: center;
257
+ justify-content: center;
258
+ height: 1.5rem;
259
+ width: 1.5rem;
260
+ border: 0;
261
+ border-radius: var(--chat-radius-xs);
262
+ background: transparent;
263
+ color: var(--chat-fg-subtle, #8e8ea0);
264
+ cursor: pointer;
265
+ opacity: 0;
266
+ pointer-events: none;
267
+ transition:
268
+ background-color var(--chat-transition, 160ms ease),
269
+ color var(--chat-transition, 160ms ease),
270
+ opacity var(--chat-transition, 160ms ease);
271
+ }
272
+
273
+ .chat-model-row:hover .chat-model-thinking-trigger,
274
+ .chat-model-row:focus-within .chat-model-thinking-trigger,
275
+ .chat-model-row:has(.chat-model-item[data-highlighted]) .chat-model-thinking-trigger,
276
+ .chat-model-thinking-trigger[data-open="true"] {
277
+ opacity: 1;
278
+ pointer-events: auto;
279
+ color: var(--chat-fg, #0d0d0d);
280
+ }
281
+
282
+ .chat-model-thinking-trigger:hover,
283
+ .chat-model-thinking-trigger[data-open="true"] {
284
+ background: var(--chat-control-bg, rgba(0, 0, 0, 0.06));
285
+ color: var(--chat-fg, #0d0d0d);
286
+ }
287
+
288
+ .chat-model-thinking-icon {
289
+ height: 0.95rem;
290
+ width: 0.95rem;
291
+ }
292
+
293
+ .chat-model-thinking-menu {
294
+ position: absolute;
295
+ right: 0.35rem;
296
+ top: calc(100% + 0.2rem);
297
+ z-index: 5;
298
+ min-width: 7.5rem;
299
+ padding: var(--chat-space-1);
300
+ border: 1px solid var(--chat-border, rgba(0, 0, 0, 0.07));
301
+ border-radius: var(--chat-radius);
302
+ background: var(--chat-bg-elevated, #ffffff);
303
+ box-shadow:
304
+ 0 1px 2px rgba(0, 0, 0, 0.04),
305
+ 0 8px 20px rgba(0, 0, 0, 0.1);
306
+ }
307
+
308
+ .chat-model-thinking-option {
309
+ display: flex;
310
+ width: 100%;
311
+ align-items: center;
312
+ justify-content: space-between;
313
+ gap: var(--chat-space-2);
314
+ height: 1.9rem;
315
+ padding: 0 var(--chat-space-2);
316
+ border: 0;
317
+ border-radius: var(--chat-radius-xs);
318
+ background: transparent;
319
+ color: var(--chat-fg, #0d0d0d);
320
+ font-size: var(--chat-fs-12);
321
+ font-weight: var(--chat-weight-regular);
322
+ letter-spacing: var(--chat-tracking-normal);
323
+ text-transform: capitalize;
324
+ cursor: pointer;
325
+ text-align: left;
326
+ }
327
+
328
+ .chat-model-thinking-option:hover {
329
+ background: var(--chat-control-bg, rgba(0, 0, 0, 0.04));
330
+ }
331
+
332
+ .chat-model-thinking-option[data-active="true"] {
333
+ background: rgba(0, 0, 0, 0.06);
334
+ font-weight: var(--chat-weight-medium);
335
+ }
336
+
337
+ .chat-root[data-theme="dark"] .chat-model-thinking-option[data-active="true"] {
338
+ background: rgba(255, 255, 255, 0.08);
339
+ }
340
+
341
+ .chat-model-thinking-check {
342
+ height: 0.85rem;
343
+ width: 0.85rem;
344
+ color: var(--chat-fg, #0d0d0d);
345
+ }
package/dist/chips.css ADDED
@@ -0,0 +1,248 @@
1
+ @keyframes chat-tool-spin {
2
+ to {
3
+ transform: rotate(360deg);
4
+ }
5
+ }
6
+
7
+ @keyframes chat-tool-pulse {
8
+ 0%,
9
+ 100% {
10
+ opacity: 0.42;
11
+ }
12
+
13
+ 50% {
14
+ opacity: 1;
15
+ }
16
+ }
17
+
18
+ .chat-tool-group {
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: var(--chat-space-2);
22
+ min-width: 0;
23
+ }
24
+
25
+ .chat-tool-group-details {
26
+ min-width: 0;
27
+ }
28
+
29
+ .chat-tool-group-summary {
30
+ display: inline-flex;
31
+ align-items: center;
32
+ gap: var(--chat-space-2);
33
+ padding: var(--chat-space-05) 0;
34
+ color: var(--chat-fg-muted);
35
+ cursor: pointer;
36
+ font-size: var(--chat-text-sm);
37
+ font-weight: var(--chat-weight-medium);
38
+ line-height: var(--chat-leading-tight);
39
+ list-style: none;
40
+ user-select: none;
41
+ }
42
+
43
+ .chat-tool-group-summary::-webkit-details-marker {
44
+ display: none;
45
+ }
46
+
47
+ .chat-tool-group-summary:hover {
48
+ color: var(--chat-fg);
49
+ }
50
+
51
+ .chat-tool-group-chevron {
52
+ width: 0.85rem;
53
+ height: 0.85rem;
54
+ flex: 0 0 auto;
55
+ opacity: 0.6;
56
+ transition: transform var(--chat-transition);
57
+ }
58
+
59
+ .chat-tool-group-details[open] .chat-tool-group-chevron {
60
+ transform: rotate(180deg);
61
+ }
62
+
63
+ .chat-tool-list {
64
+ display: flex;
65
+ flex-direction: column;
66
+ gap: var(--chat-space-1);
67
+ padding: var(--chat-space-05) 0 var(--chat-space-05);
68
+ }
69
+
70
+ .chat-tool-row {
71
+ display: flex;
72
+ align-items: center;
73
+ gap: var(--chat-space-2);
74
+ min-height: 1.7rem;
75
+ min-width: 0;
76
+ color: var(--chat-fg);
77
+ }
78
+
79
+ .chat-tool-icon {
80
+ display: inline-flex;
81
+ width: 1.05rem;
82
+ height: 1.05rem;
83
+ flex: 0 0 auto;
84
+ align-items: center;
85
+ justify-content: center;
86
+ color: var(--chat-fg-muted);
87
+ }
88
+
89
+ .chat-tool-spinner {
90
+ width: 0.7rem;
91
+ height: 0.7rem;
92
+ border: 1.5px solid currentColor;
93
+ border-top-color: transparent;
94
+ border-radius: 999px;
95
+ animation: chat-tool-spin 0.75s linear infinite;
96
+ }
97
+
98
+ .chat-tool-row.is-pending .chat-tool-icon {
99
+ color: color-mix(in oklab, var(--chat-warning) 70%, currentColor);
100
+ animation: chat-tool-pulse 1.4s ease-in-out infinite;
101
+ }
102
+
103
+ .chat-tool-row.is-failed .chat-tool-icon,
104
+ .chat-tool-row.is-failed .chat-tool-label {
105
+ color: color-mix(in oklab, var(--chat-danger) 72%, currentColor);
106
+ }
107
+
108
+ .chat-tool-label {
109
+ flex: 0 1 auto;
110
+ min-width: 0;
111
+ overflow: hidden;
112
+ font-size: var(--chat-text-sm);
113
+ font-weight: var(--chat-weight-medium);
114
+ line-height: var(--chat-leading-snug);
115
+ text-overflow: ellipsis;
116
+ white-space: nowrap;
117
+ }
118
+
119
+ .chat-tool-pill {
120
+ min-width: 0;
121
+ max-width: min(100%, 22rem);
122
+ overflow: hidden;
123
+ border-radius: var(--chat-radius-pill);
124
+ background: var(--chat-control-bg);
125
+ color: var(--chat-fg-muted);
126
+ font-family: var(--chat-font-mono);
127
+ font-size: var(--chat-text-xs);
128
+ line-height: var(--chat-leading-tight);
129
+ padding: var(--chat-space-1) var(--chat-space-2);
130
+ text-overflow: ellipsis;
131
+ white-space: nowrap;
132
+ }
133
+
134
+ .chat-diff-row {
135
+ display: flex;
136
+ flex-wrap: wrap;
137
+ gap: var(--chat-space-1_5);
138
+ padding: var(--chat-space-05) 0 var(--chat-space-05);
139
+ }
140
+
141
+ .chat-diff-chip {
142
+ display: inline-flex;
143
+ align-items: center;
144
+ gap: var(--chat-space-1_5);
145
+ max-width: 100%;
146
+ border: 0;
147
+ border-radius: var(--chat-radius-pill);
148
+ background: var(--chat-control-bg);
149
+ color: var(--chat-fg);
150
+ font-size: var(--chat-text-xs);
151
+ line-height: var(--chat-leading-tight);
152
+ padding: var(--chat-space-1) var(--chat-space-2_5);
153
+ }
154
+
155
+ .chat-diff-file {
156
+ overflow: hidden;
157
+ font-family: var(--chat-font-mono);
158
+ text-overflow: ellipsis;
159
+ white-space: nowrap;
160
+ }
161
+
162
+ .chat-diff-add {
163
+ color: var(--chat-success);
164
+ font-variant-numeric: tabular-nums;
165
+ }
166
+
167
+ .chat-diff-del {
168
+ color: var(--chat-danger);
169
+ font-variant-numeric: tabular-nums;
170
+ }
171
+
172
+ .chat-diff-more {
173
+ display: inline-flex;
174
+ align-items: center;
175
+ color: var(--chat-fg-subtle);
176
+ font-size: var(--chat-text-xs);
177
+ padding: var(--chat-space-1) var(--chat-space-05);
178
+ }
179
+
180
+ .chat-task-list {
181
+ display: flex;
182
+ flex-direction: column;
183
+ gap: var(--chat-space-2);
184
+ }
185
+
186
+ .chat-task-row {
187
+ display: flex;
188
+ align-items: center;
189
+ gap: var(--chat-space-3);
190
+ min-height: 2.25rem;
191
+ border: 0;
192
+ border-radius: 0;
193
+ padding: var(--chat-space-1_5) 0;
194
+ }
195
+
196
+ .chat-task-glyph {
197
+ display: inline-grid;
198
+ width: 1.35rem;
199
+ height: 1.35rem;
200
+ flex: 0 0 auto;
201
+ place-items: center;
202
+ border-radius: 999px;
203
+ background: var(--chat-control-bg);
204
+ color: var(--chat-fg);
205
+ font-size: var(--chat-fs-11);
206
+ font-weight: var(--chat-weight-semibold);
207
+ line-height: var(--chat-leading-none);
208
+ }
209
+
210
+ .chat-task-row.is-completed .chat-task-glyph {
211
+ background: var(--chat-success);
212
+ color: var(--chat-bg);
213
+ }
214
+
215
+ .chat-task-row.is-running .chat-task-glyph {
216
+ animation: chat-tool-pulse 1.4s ease-in-out infinite;
217
+ }
218
+
219
+ .chat-task-row.is-failed .chat-task-glyph {
220
+ background: color-mix(in oklab, var(--chat-danger) 18%, var(--chat-control-bg));
221
+ color: var(--chat-danger);
222
+ }
223
+
224
+ .chat-task-title {
225
+ min-width: 0;
226
+ overflow: hidden;
227
+ font-size: var(--chat-text-sm);
228
+ font-weight: var(--chat-weight-medium);
229
+ text-overflow: ellipsis;
230
+ white-space: nowrap;
231
+ }
232
+
233
+ .chat-task-meta {
234
+ min-width: 0;
235
+ overflow: hidden;
236
+ color: var(--chat-fg-muted);
237
+ font-size: var(--chat-text-xs);
238
+ text-overflow: ellipsis;
239
+ white-space: nowrap;
240
+ }
241
+
242
+ @media (prefers-reduced-motion: reduce) {
243
+ .chat-tool-spinner,
244
+ .chat-tool-row.is-pending .chat-tool-icon,
245
+ .chat-task-row.is-running .chat-task-glyph {
246
+ animation: none;
247
+ }
248
+ }