@lastbrain/ai-ui-react 1.0.3 → 1.0.5

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.
package/src/styles.css ADDED
@@ -0,0 +1,539 @@
1
+ /**
2
+ * @lastbrain/ai-ui-react - Styles CSS
3
+ * Framework-agnostic styles for AI UI components
4
+ */
5
+
6
+ /* ========== Variables ========== */
7
+ :root {
8
+ --ai-primary: #3b82f6;
9
+ --ai-primary-hover: #2563eb;
10
+ --ai-success: #10b981;
11
+ --ai-warning: #f59e0b;
12
+ --ai-danger: #ef4444;
13
+ --ai-border: #e5e7eb;
14
+ --ai-text: #1f2937;
15
+ --ai-text-secondary: #6b7280;
16
+ --ai-bg: #ffffff;
17
+ --ai-bg-hover: #f9fafb;
18
+ --ai-radius: 8px;
19
+ --ai-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
20
+ --ai-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
21
+ }
22
+
23
+ /* ========== Status Button ========== */
24
+ .ai-status-button-wrapper {
25
+ position: relative;
26
+ display: inline-block;
27
+ }
28
+
29
+ .ai-status-button {
30
+ display: inline-flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ width: 40px;
34
+ height: 40px;
35
+ border: 1px solid var(--ai-border);
36
+ border-radius: var(--ai-radius);
37
+ background: var(--ai-bg);
38
+ color: var(--ai-text);
39
+ cursor: pointer;
40
+ transition: all 0.2s;
41
+ }
42
+
43
+ .ai-status-button:hover {
44
+ background: var(--ai-bg-hover);
45
+ box-shadow: var(--ai-shadow);
46
+ }
47
+
48
+ .ai-status-button:disabled {
49
+ opacity: 0.5;
50
+ cursor: not-allowed;
51
+ }
52
+
53
+ .ai-status-button--loading {
54
+ cursor: wait;
55
+ }
56
+
57
+ .ai-status-button--success {
58
+ color: var(--ai-success);
59
+ }
60
+
61
+ .ai-status-button--error {
62
+ color: var(--ai-danger);
63
+ }
64
+
65
+ .ai-spinner {
66
+ animation: spin 1s linear infinite;
67
+ }
68
+
69
+ @keyframes spin {
70
+ from {
71
+ transform: rotate(0deg);
72
+ }
73
+ to {
74
+ transform: rotate(360deg);
75
+ }
76
+ }
77
+
78
+ /* ========== Tooltip ========== */
79
+ .ai-tooltip {
80
+ position: absolute;
81
+ top: calc(100% + 8px);
82
+ right: 0;
83
+ z-index: 1000;
84
+ min-width: 200px;
85
+ padding: 8px;
86
+ background: var(--ai-bg);
87
+ border: 1px solid var(--ai-border);
88
+ border-radius: var(--ai-radius);
89
+ box-shadow: var(--ai-shadow-lg);
90
+ font-size: 12px;
91
+ animation: fadeIn 0.2s;
92
+ }
93
+
94
+ .ai-tooltip--status {
95
+ min-width: 280px;
96
+ }
97
+
98
+ .ai-tooltip__header {
99
+ font-weight: 600;
100
+ font-size: 14px;
101
+ padding-bottom: 8px;
102
+ margin-bottom: 8px;
103
+ border-bottom: 1px solid var(--ai-border);
104
+ }
105
+
106
+ .ai-tooltip__section {
107
+ padding: 8px 0;
108
+ border-top: 1px solid var(--ai-border);
109
+ }
110
+
111
+ .ai-tooltip__section:first-child {
112
+ border-top: none;
113
+ padding-top: 0;
114
+ }
115
+
116
+ .ai-tooltip__subtitle {
117
+ font-weight: 500;
118
+ margin-bottom: 4px;
119
+ font-size: 11px;
120
+ }
121
+
122
+ .ai-tooltip__row {
123
+ display: flex;
124
+ justify-content: space-between;
125
+ gap: 12px;
126
+ margin-bottom: 4px;
127
+ }
128
+
129
+ .ai-tooltip__label {
130
+ color: var(--ai-text-secondary);
131
+ }
132
+
133
+ .ai-tooltip__value {
134
+ font-family: monospace;
135
+ font-size: 11px;
136
+ }
137
+
138
+ .ai-tooltip__value--bold {
139
+ font-weight: 600;
140
+ }
141
+
142
+ .ai-tooltip__value--capitalize {
143
+ text-transform: capitalize;
144
+ }
145
+
146
+ .ai-tooltip__value--success {
147
+ color: var(--ai-success);
148
+ }
149
+
150
+ .ai-tooltip__value--warning {
151
+ color: var(--ai-warning);
152
+ }
153
+
154
+ .ai-tooltip__actions {
155
+ display: flex;
156
+ gap: 8px;
157
+ justify-content: space-between;
158
+ padding-top: 8px;
159
+ }
160
+
161
+ .ai-tooltip__link {
162
+ flex: 1;
163
+ text-align: center;
164
+ padding: 4px 8px;
165
+ color: var(--ai-primary);
166
+ text-decoration: none;
167
+ border-radius: 4px;
168
+ transition: background 0.2s;
169
+ font-size: 11px;
170
+ }
171
+
172
+ .ai-tooltip__link:hover {
173
+ background: var(--ai-bg-hover);
174
+ }
175
+
176
+ @keyframes fadeIn {
177
+ from {
178
+ opacity: 0;
179
+ transform: translateY(-4px);
180
+ }
181
+ to {
182
+ opacity: 1;
183
+ transform: translateY(0);
184
+ }
185
+ }
186
+
187
+ /* ========== Input ========== */
188
+ .ai-input {
189
+ width: 100%;
190
+ padding: 10px 12px;
191
+ border: 1px solid var(--ai-border);
192
+ border-radius: var(--ai-radius);
193
+ font-size: 14px;
194
+ color: var(--ai-text);
195
+ background: var(--ai-bg);
196
+ transition: all 0.2s;
197
+ }
198
+
199
+ .ai-input:hover {
200
+ border-color: var(--ai-primary);
201
+ }
202
+
203
+ .ai-input:focus {
204
+ outline: none;
205
+ border-color: var(--ai-primary);
206
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
207
+ }
208
+
209
+ .ai-input:disabled {
210
+ opacity: 0.5;
211
+ cursor: not-allowed;
212
+ background: var(--ai-bg-hover);
213
+ }
214
+
215
+ .ai-input--error {
216
+ border-color: var(--ai-danger);
217
+ }
218
+
219
+ .ai-input--error:focus {
220
+ box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
221
+ }
222
+
223
+ /* ========== Textarea ========== */
224
+ .ai-textarea {
225
+ width: 100%;
226
+ min-height: 100px;
227
+ padding: 10px 12px;
228
+ border: 1px solid var(--ai-border);
229
+ border-radius: var(--ai-radius);
230
+ font-size: 14px;
231
+ font-family: inherit;
232
+ color: var(--ai-text);
233
+ background: var(--ai-bg);
234
+ resize: vertical;
235
+ transition: all 0.2s;
236
+ }
237
+
238
+ .ai-textarea:hover {
239
+ border-color: var(--ai-primary);
240
+ }
241
+
242
+ .ai-textarea:focus {
243
+ outline: none;
244
+ border-color: var(--ai-primary);
245
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
246
+ }
247
+
248
+ .ai-textarea:disabled {
249
+ opacity: 0.5;
250
+ cursor: not-allowed;
251
+ background: var(--ai-bg-hover);
252
+ }
253
+
254
+ /* ========== Button ========== */
255
+ .ai-button {
256
+ display: inline-flex;
257
+ align-items: center;
258
+ justify-content: center;
259
+ gap: 8px;
260
+ padding: 10px 16px;
261
+ border: none;
262
+ border-radius: var(--ai-radius);
263
+ font-size: 14px;
264
+ font-weight: 500;
265
+ color: white;
266
+ background: var(--ai-primary);
267
+ cursor: pointer;
268
+ transition: all 0.2s;
269
+ }
270
+
271
+ .ai-button:hover {
272
+ background: var(--ai-primary-hover);
273
+ transform: translateY(-1px);
274
+ box-shadow: var(--ai-shadow);
275
+ }
276
+
277
+ .ai-button:active {
278
+ transform: translateY(0);
279
+ }
280
+
281
+ .ai-button:disabled {
282
+ opacity: 0.5;
283
+ cursor: not-allowed;
284
+ transform: none;
285
+ }
286
+
287
+ .ai-button--secondary {
288
+ background: var(--ai-bg);
289
+ color: var(--ai-text);
290
+ border: 1px solid var(--ai-border);
291
+ }
292
+
293
+ .ai-button--secondary:hover {
294
+ background: var(--ai-bg-hover);
295
+ }
296
+
297
+ .ai-button--danger {
298
+ background: var(--ai-danger);
299
+ }
300
+
301
+ .ai-button--success {
302
+ background: var(--ai-success);
303
+ }
304
+
305
+ .ai-button--sm {
306
+ padding: 6px 12px;
307
+ font-size: 12px;
308
+ }
309
+
310
+ .ai-button--lg {
311
+ padding: 14px 20px;
312
+ font-size: 16px;
313
+ }
314
+
315
+ /* ========== Select ========== */
316
+ .ai-select {
317
+ width: 100%;
318
+ padding: 10px 12px;
319
+ border: 1px solid var(--ai-border);
320
+ border-radius: var(--ai-radius);
321
+ font-size: 14px;
322
+ color: var(--ai-text);
323
+ background: var(--ai-bg);
324
+ cursor: pointer;
325
+ transition: all 0.2s;
326
+ }
327
+
328
+ .ai-select:hover {
329
+ border-color: var(--ai-primary);
330
+ }
331
+
332
+ .ai-select:focus {
333
+ outline: none;
334
+ border-color: var(--ai-primary);
335
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
336
+ }
337
+
338
+ .ai-select:disabled {
339
+ opacity: 0.5;
340
+ cursor: not-allowed;
341
+ background: var(--ai-bg-hover);
342
+ }
343
+
344
+ /* ========== Modal ========== */
345
+ .ai-modal-overlay {
346
+ position: fixed;
347
+ inset: 0;
348
+ z-index: 9998;
349
+ background: rgba(0, 0, 0, 0.5);
350
+ display: flex;
351
+ align-items: center;
352
+ justify-content: center;
353
+ padding: 16px;
354
+ animation: fadeIn 0.2s;
355
+ }
356
+
357
+ .ai-modal {
358
+ position: relative;
359
+ z-index: 9999;
360
+ width: 100%;
361
+ max-width: 500px;
362
+ max-height: 90vh;
363
+ overflow-y: auto;
364
+ background: var(--ai-bg);
365
+ border-radius: var(--ai-radius);
366
+ box-shadow: var(--ai-shadow-lg);
367
+ animation: slideUp 0.3s;
368
+ }
369
+
370
+ .ai-modal__header {
371
+ display: flex;
372
+ align-items: center;
373
+ justify-content: space-between;
374
+ padding: 16px 20px;
375
+ border-bottom: 1px solid var(--ai-border);
376
+ }
377
+
378
+ .ai-modal__title {
379
+ font-size: 18px;
380
+ font-weight: 600;
381
+ color: var(--ai-text);
382
+ }
383
+
384
+ .ai-modal__close {
385
+ display: flex;
386
+ align-items: center;
387
+ justify-content: center;
388
+ width: 32px;
389
+ height: 32px;
390
+ border: none;
391
+ border-radius: 4px;
392
+ background: transparent;
393
+ color: var(--ai-text-secondary);
394
+ cursor: pointer;
395
+ transition: all 0.2s;
396
+ }
397
+
398
+ .ai-modal__close:hover {
399
+ background: var(--ai-bg-hover);
400
+ color: var(--ai-text);
401
+ }
402
+
403
+ .ai-modal__body {
404
+ padding: 20px;
405
+ }
406
+
407
+ .ai-modal__footer {
408
+ display: flex;
409
+ gap: 8px;
410
+ justify-content: flex-end;
411
+ padding: 16px 20px;
412
+ border-top: 1px solid var(--ai-border);
413
+ }
414
+
415
+ @keyframes slideUp {
416
+ from {
417
+ opacity: 0;
418
+ transform: translateY(20px);
419
+ }
420
+ to {
421
+ opacity: 1;
422
+ transform: translateY(0);
423
+ }
424
+ }
425
+
426
+ /* ========== Chip Label ========== */
427
+ .ai-chip {
428
+ display: inline-flex;
429
+ align-items: center;
430
+ gap: 6px;
431
+ padding: 4px 12px;
432
+ border-radius: 9999px;
433
+ font-size: 12px;
434
+ font-weight: 500;
435
+ background: var(--ai-bg-hover);
436
+ color: var(--ai-text);
437
+ }
438
+
439
+ .ai-chip--primary {
440
+ background: rgba(59, 130, 246, 0.1);
441
+ color: var(--ai-primary);
442
+ }
443
+
444
+ .ai-chip--success {
445
+ background: rgba(16, 185, 129, 0.1);
446
+ color: var(--ai-success);
447
+ }
448
+
449
+ .ai-chip--warning {
450
+ background: rgba(245, 158, 11, 0.1);
451
+ color: var(--ai-warning);
452
+ }
453
+
454
+ .ai-chip--danger {
455
+ background: rgba(239, 68, 68, 0.1);
456
+ color: var(--ai-danger);
457
+ }
458
+
459
+ .ai-chip__close {
460
+ display: flex;
461
+ align-items: center;
462
+ justify-content: center;
463
+ width: 16px;
464
+ height: 16px;
465
+ border: none;
466
+ border-radius: 50%;
467
+ background: transparent;
468
+ color: currentColor;
469
+ cursor: pointer;
470
+ transition: background 0.2s;
471
+ }
472
+
473
+ .ai-chip__close:hover {
474
+ background: rgba(0, 0, 0, 0.1);
475
+ }
476
+
477
+ /* ========== Loading States ========== */
478
+ .ai-loading {
479
+ display: inline-flex;
480
+ align-items: center;
481
+ gap: 8px;
482
+ }
483
+
484
+ .ai-loading__spinner {
485
+ width: 16px;
486
+ height: 16px;
487
+ border: 2px solid var(--ai-border);
488
+ border-top-color: var(--ai-primary);
489
+ border-radius: 50%;
490
+ animation: spin 1s linear infinite;
491
+ }
492
+
493
+ .ai-loading__text {
494
+ font-size: 14px;
495
+ color: var(--ai-text-secondary);
496
+ }
497
+
498
+ /* ========== Form Group ========== */
499
+ .ai-form-group {
500
+ margin-bottom: 16px;
501
+ }
502
+
503
+ .ai-form-label {
504
+ display: block;
505
+ margin-bottom: 6px;
506
+ font-size: 14px;
507
+ font-weight: 500;
508
+ color: var(--ai-text);
509
+ }
510
+
511
+ .ai-form-label--required::after {
512
+ content: " *";
513
+ color: var(--ai-danger);
514
+ }
515
+
516
+ .ai-form-hint {
517
+ display: block;
518
+ margin-top: 4px;
519
+ font-size: 12px;
520
+ color: var(--ai-text-secondary);
521
+ }
522
+
523
+ .ai-form-error {
524
+ display: block;
525
+ margin-top: 4px;
526
+ font-size: 12px;
527
+ color: var(--ai-danger);
528
+ }
529
+
530
+ /* ========== Dark Mode Support ========== */
531
+ @media (prefers-color-scheme: dark) {
532
+ :root {
533
+ --ai-border: #374151;
534
+ --ai-text: #f9fafb;
535
+ --ai-text-secondary: #9ca3af;
536
+ --ai-bg: #1f2937;
537
+ --ai-bg-hover: #374151;
538
+ }
539
+ }