@lastbrain/ai-ui-react 1.0.67 → 1.0.69

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 (60) hide show
  1. package/dist/components/AiChipLabel.d.ts +8 -3
  2. package/dist/components/AiChipLabel.d.ts.map +1 -1
  3. package/dist/components/AiChipLabel.js +21 -70
  4. package/dist/components/AiContextButton.d.ts +5 -1
  5. package/dist/components/AiContextButton.d.ts.map +1 -1
  6. package/dist/components/AiContextButton.js +67 -291
  7. package/dist/components/AiImageButton.d.ts +5 -1
  8. package/dist/components/AiImageButton.d.ts.map +1 -1
  9. package/dist/components/AiImageButton.js +6 -142
  10. package/dist/components/AiInput.d.ts +5 -3
  11. package/dist/components/AiInput.d.ts.map +1 -1
  12. package/dist/components/AiInput.js +13 -25
  13. package/dist/components/AiPromptPanel.d.ts.map +1 -1
  14. package/dist/components/AiPromptPanel.js +58 -212
  15. package/dist/components/AiSelect.d.ts +5 -3
  16. package/dist/components/AiSelect.d.ts.map +1 -1
  17. package/dist/components/AiSelect.js +21 -30
  18. package/dist/components/AiStatusButton.d.ts +4 -1
  19. package/dist/components/AiStatusButton.d.ts.map +1 -1
  20. package/dist/components/AiStatusButton.js +198 -626
  21. package/dist/components/AiTextarea.d.ts +4 -2
  22. package/dist/components/AiTextarea.d.ts.map +1 -1
  23. package/dist/components/AiTextarea.js +14 -26
  24. package/dist/components/LBApiKeySelector.d.ts.map +1 -1
  25. package/dist/components/LBApiKeySelector.js +5 -166
  26. package/dist/components/LBConnectButton.d.ts +4 -7
  27. package/dist/components/LBConnectButton.d.ts.map +1 -1
  28. package/dist/components/LBConnectButton.js +17 -86
  29. package/dist/components/LBSigninModal.d.ts +1 -1
  30. package/dist/components/LBSigninModal.d.ts.map +1 -1
  31. package/dist/components/LBSigninModal.js +42 -320
  32. package/dist/examples/AiUiPremiumShowcase.d.ts +2 -0
  33. package/dist/examples/AiUiPremiumShowcase.d.ts.map +1 -0
  34. package/dist/examples/AiUiPremiumShowcase.js +15 -0
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +2 -0
  38. package/dist/styles/inline.d.ts +1 -0
  39. package/dist/styles/inline.d.ts.map +1 -1
  40. package/dist/styles/inline.js +25 -129
  41. package/dist/styles.css +1268 -369
  42. package/dist/types.d.ts +3 -0
  43. package/dist/types.d.ts.map +1 -1
  44. package/package.json +2 -2
  45. package/src/components/AiChipLabel.tsx +64 -101
  46. package/src/components/AiContextButton.tsx +138 -430
  47. package/src/components/AiImageButton.tsx +29 -190
  48. package/src/components/AiInput.tsx +49 -74
  49. package/src/components/AiPromptPanel.tsx +71 -254
  50. package/src/components/AiSelect.tsx +61 -69
  51. package/src/components/AiStatusButton.tsx +477 -1219
  52. package/src/components/AiTextarea.tsx +49 -64
  53. package/src/components/LBApiKeySelector.tsx +86 -274
  54. package/src/components/LBConnectButton.tsx +46 -334
  55. package/src/components/LBSigninModal.tsx +140 -481
  56. package/src/examples/AiUiPremiumShowcase.tsx +91 -0
  57. package/src/index.ts +3 -0
  58. package/src/styles/inline.ts +27 -148
  59. package/src/styles.css +1268 -369
  60. package/src/types.ts +3 -0
@@ -16,94 +16,21 @@ const colors = {
16
16
  warningLight: "#fbbf24",
17
17
  danger: "#ef4444",
18
18
  dangerLight: "#f87171",
19
- // Neutral colors - Light mode
20
- light: {
21
- bg: "#ffffff",
22
- bgSecondary: "#f9fafb",
23
- bgTertiary: "#f3f4f6",
24
- border: "#e2e8f0",
25
- borderLight: "#f1f5f9",
26
- text: "#111827",
27
- textSecondary: "#6b7280",
28
- textTertiary: "#9ca3af",
29
- shadow: "rgba(0, 0, 0, 0.1)",
30
- shadowMd: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
31
- shadowLg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
32
- shadowXl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",
33
- },
34
- // Neutral colors - Dark mode
35
- dark: {
36
- bg: "#1f2937",
37
- bgSecondary: "#111827",
38
- bgTertiary: "#0f172a",
39
- border: "#374151",
40
- borderLight: "#4b5563",
41
- text: "#f9fafb",
42
- textSecondary: "#d1d5db",
43
- textTertiary: "#9ca3af",
44
- shadow: "rgba(0, 0, 0, 0.3)",
45
- shadowMd: "0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3)",
46
- shadowLg: "0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3)",
47
- shadowXl: "0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3)",
48
- },
49
- };
50
- // Use light mode by default (can be made dynamic later)
51
- const getIsDark = () => {
52
- if (typeof document !== "undefined") {
53
- const root = document.documentElement;
54
- if (root.classList.contains("dark")) {
55
- return true;
56
- }
57
- if (root.classList.contains("light")) {
58
- return false;
59
- }
60
- }
61
- return (typeof window !== "undefined" &&
62
- window.matchMedia?.("(prefers-color-scheme: dark)").matches);
63
19
  };
64
20
  const themeVars = {
65
21
  bg: "var(--ai-bg)",
66
- bgSecondary: "var(--ai-bg-secondary)",
67
- bgTertiary: "var(--ai-bg-tertiary)",
22
+ bgSecondary: "var(--ai-bg2)",
23
+ bgTertiary: "var(--ai-bg3)",
68
24
  border: "var(--ai-border)",
69
- borderLight: "var(--ai-border-light)",
70
- text: "var(--ai-text)",
71
- textSecondary: "var(--ai-text-secondary)",
72
- textTertiary: "var(--ai-text-tertiary)",
73
- shadow: "var(--ai-shadow)",
74
- shadowMd: "var(--ai-shadow-md)",
25
+ borderLight: "color-mix(in srgb, var(--ai-border) 70%, transparent)",
26
+ text: "var(--ai-foreground)",
27
+ textSecondary: "var(--ai-secondary)",
28
+ textTertiary: "var(--ai-tertiary)",
29
+ shadow: "var(--ai-shadow-sm)",
30
+ shadowMd: "var(--ai-shadow-sm)",
75
31
  shadowLg: "var(--ai-shadow-lg)",
76
32
  shadowXl: "var(--ai-shadow-xl)",
77
33
  };
78
- const applyThemeVariables = () => {
79
- if (typeof document === "undefined") {
80
- return;
81
- }
82
- const nextTheme = getIsDark() ? colors.dark : colors.light;
83
- const root = document.documentElement;
84
- root.style.setProperty("--ai-bg", nextTheme.bg);
85
- root.style.setProperty("--ai-bg-secondary", nextTheme.bgSecondary);
86
- root.style.setProperty("--ai-bg-tertiary", nextTheme.bgTertiary);
87
- root.style.setProperty("--ai-border", nextTheme.border);
88
- root.style.setProperty("--ai-border-light", nextTheme.borderLight);
89
- root.style.setProperty("--ai-text", nextTheme.text);
90
- root.style.setProperty("--ai-text-secondary", nextTheme.textSecondary);
91
- root.style.setProperty("--ai-text-tertiary", nextTheme.textTertiary);
92
- root.style.setProperty("--ai-shadow", nextTheme.shadow);
93
- root.style.setProperty("--ai-shadow-md", nextTheme.shadowMd);
94
- root.style.setProperty("--ai-shadow-lg", nextTheme.shadowLg);
95
- root.style.setProperty("--ai-shadow-xl", nextTheme.shadowXl);
96
- };
97
- if (typeof window !== "undefined") {
98
- applyThemeVariables();
99
- const media = window.matchMedia?.("(prefers-color-scheme: dark)");
100
- media?.addEventListener?.("change", applyThemeVariables);
101
- const observer = new MutationObserver(() => applyThemeVariables());
102
- observer.observe(document.documentElement, {
103
- attributes: true,
104
- attributeFilter: ["class"],
105
- });
106
- }
107
34
  export const aiStyles = {
108
35
  // Input field
109
36
  input: {
@@ -112,7 +39,7 @@ export const aiStyles = {
112
39
  fontSize: "14px",
113
40
  lineHeight: "1.5",
114
41
  color: themeVars.text,
115
- background: themeVars.bg,
42
+ background: "var(--ai-glass-strong)",
116
43
  border: `1px solid ${themeVars.border}`,
117
44
  borderColor: themeVars.border,
118
45
  borderRadius: "8px",
@@ -164,7 +91,7 @@ export const aiStyles = {
164
91
  fontSize: "14px",
165
92
  lineHeight: "1.5",
166
93
  color: themeVars.text,
167
- background: themeVars.bg,
94
+ background: "var(--ai-glass-strong)",
168
95
  border: `1px solid ${themeVars.border}`,
169
96
  borderColor: themeVars.border,
170
97
  borderRadius: "8px",
@@ -241,7 +168,7 @@ export const aiStyles = {
241
168
  fontSize: "14px",
242
169
  lineHeight: "1.5",
243
170
  color: themeVars.text,
244
- background: themeVars.bg,
171
+ background: "var(--ai-glass-strong)",
245
172
  borderWidth: "1px",
246
173
  borderStyle: "solid",
247
174
  borderColor: themeVars.border,
@@ -273,14 +200,14 @@ export const aiStyles = {
273
200
  height: "40px",
274
201
  border: `1px solid ${themeVars.border}`,
275
202
  borderRadius: "8px",
276
- background: themeVars.bg,
203
+ background: "var(--ai-glass, rgba(255,255,255,0.7))",
277
204
  color: themeVars.text,
278
205
  cursor: "pointer",
279
206
  transition: "all 0.2s",
280
207
  boxShadow: themeVars.shadowMd,
281
208
  },
282
209
  statusButtonHover: {
283
- background: themeVars.bgSecondary,
210
+ background: "var(--ai-glass-strong, rgba(255,255,255,0.82))",
284
211
  boxShadow: themeVars.shadowLg,
285
212
  transform: "scale(1.05)",
286
213
  },
@@ -295,7 +222,7 @@ export const aiStyles = {
295
222
  minWidth: "320px",
296
223
  maxWidth: "400px",
297
224
  padding: "16px",
298
- background: themeVars.bg,
225
+ background: "var(--ai-bg2)",
299
226
  border: `1px solid ${themeVars.border}`,
300
227
  borderRadius: "12px",
301
228
  boxShadow: themeVars.shadowXl,
@@ -374,12 +301,12 @@ export const aiStyles = {
374
301
  transition: "all 0.2s",
375
302
  fontSize: "11px",
376
303
  fontWeight: 500,
377
- background: `${colors.primary}10`,
378
- border: `1px solid ${colors.primary}30`,
304
+ background: "color-mix(in srgb, var(--ai-primary) 10%, transparent)",
305
+ border: "1px solid color-mix(in srgb, var(--ai-primary) 30%, transparent)",
379
306
  },
380
307
  tooltipLinkHover: {
381
- background: `${colors.primary}20`,
382
- borderColor: colors.primary,
308
+ background: "color-mix(in srgb, var(--ai-primary) 20%, transparent)",
309
+ borderColor: "var(--ai-primary)",
383
310
  },
384
311
  // Chip/Label
385
312
  chip: {
@@ -390,9 +317,9 @@ export const aiStyles = {
390
317
  fontSize: "12px",
391
318
  fontWeight: 500,
392
319
  borderRadius: "6px",
393
- background: `${colors.primary}10`,
394
- color: colors.primary,
395
- border: `1px solid ${colors.primary}30`,
320
+ background: "color-mix(in srgb, var(--ai-primary) 10%, transparent)",
321
+ color: "var(--ai-primary)",
322
+ border: "1px solid color-mix(in srgb, var(--ai-primary) 30%, transparent)",
396
323
  },
397
324
  // Modal (basic styles)
398
325
  modal: {
@@ -401,7 +328,7 @@ export const aiStyles = {
401
328
  left: 0,
402
329
  right: 0,
403
330
  bottom: 0,
404
- zIndex: 9999,
331
+ zIndex: 2147483645,
405
332
  display: "flex",
406
333
  alignItems: "center",
407
334
  justifyContent: "center",
@@ -414,7 +341,7 @@ export const aiStyles = {
414
341
  left: 0,
415
342
  right: 0,
416
343
  bottom: 0,
417
- background: "rgba(0, 0, 0, 0.5)",
344
+ background: "var(--ai-overlay, rgba(0, 0, 0, 0.5))",
418
345
  backdropFilter: "blur(4px)",
419
346
  WebkitBackdropFilter: "blur(4px)",
420
347
  },
@@ -424,7 +351,8 @@ export const aiStyles = {
424
351
  maxWidth: "600px",
425
352
  maxHeight: "90vh",
426
353
  overflow: "auto",
427
- background: themeVars.bg,
354
+ background: "var(--ai-bg2)",
355
+ border: "1px solid var(--ai-border)",
428
356
  borderRadius: "12px",
429
357
  boxShadow: themeVars.shadowXl,
430
358
  padding: "0",
@@ -507,38 +435,6 @@ export const aiStyles = {
507
435
  animation: "ai-spin 1s linear infinite",
508
436
  },
509
437
  };
510
- // Inject keyframes animation for spinner
511
- if (typeof document !== "undefined") {
512
- const styleSheet = document.createElement("style");
513
- styleSheet.textContent = `
514
- @keyframes ai-spin {
515
- from { transform: rotate(0deg); }
516
- to { transform: rotate(360deg); }
517
- }
518
-
519
- @keyframes ai-fadeIn {
520
- from { opacity: 0; }
521
- to { opacity: 1; }
522
- }
523
-
524
- @keyframes ai-slideUp {
525
- from {
526
- opacity: 0;
527
- transform: translateY(20px);
528
- }
529
- to {
530
- opacity: 1;
531
- transform: translateY(0);
532
- }
533
- }
534
-
535
- @keyframes pulse {
536
- 0%, 100% { opacity: 1; }
537
- 50% { opacity: 0.6; }
538
- }
539
- `;
540
- document.head.appendChild(styleSheet);
541
- }
542
438
  // Helper function to calculate tooltip position
543
439
  export function calculateTooltipPosition(buttonRect, tooltipWidth = 350, tooltipHeight = 500) {
544
440
  const viewportWidth = window.innerWidth;