@timbal-ai/timbal-react 0.6.0 → 0.7.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +24 -5
  3. package/dist/app.cjs +2282 -738
  4. package/dist/app.d.cts +4 -1
  5. package/dist/app.d.ts +4 -1
  6. package/dist/app.esm.js +58 -5
  7. package/dist/button-CIKzUrJI.d.cts +18 -0
  8. package/dist/button-CIKzUrJI.d.ts +18 -0
  9. package/dist/chart-artifact-BFDz8Tf9.d.ts +756 -0
  10. package/dist/chart-artifact-bWUa-iSG.d.cts +756 -0
  11. package/dist/chat.cjs +872 -562
  12. package/dist/chat.d.cts +2 -2
  13. package/dist/chat.d.ts +2 -2
  14. package/dist/chat.esm.js +3 -3
  15. package/dist/{chunk-4TCJQSIX.esm.js → chunk-2XZ3S4OP.esm.js} +14 -3
  16. package/dist/chunk-533MK5EA.esm.js +2294 -0
  17. package/dist/{chunk-OVHR7J3J.esm.js → chunk-7O5VY3TP.esm.js} +38 -11
  18. package/dist/{chunk-WLTW56MC.esm.js → chunk-N3PYVTY5.esm.js} +2 -2
  19. package/dist/{chunk-IYENDIRY.esm.js → chunk-TDIJHV4I.esm.js} +1 -1
  20. package/dist/{chunk-YJQLLFKP.esm.js → chunk-TLUF2RUL.esm.js} +813 -507
  21. package/dist/{chunk-OFHLFNJH.esm.js → chunk-Z27GBSOT.esm.js} +3 -1
  22. package/dist/index.cjs +2587 -1016
  23. package/dist/index.d.cts +6 -5
  24. package/dist/index.d.ts +6 -5
  25. package/dist/index.esm.js +57 -7
  26. package/dist/{layout-CQWngNQ7.d.ts → layout-BTJyU8wd.d.ts} +1 -1
  27. package/dist/{layout-B9VayJhZ.d.cts → layout-C2G-FcER.d.cts} +1 -1
  28. package/dist/studio.cjs +1127 -788
  29. package/dist/studio.d.cts +1 -1
  30. package/dist/studio.d.ts +1 -1
  31. package/dist/studio.esm.js +6 -6
  32. package/dist/{timbal-v2-button-F4-z7m33.d.ts → timbal-v2-button-CNfdwGq4.d.cts} +1 -1
  33. package/dist/{timbal-v2-button-F4-z7m33.d.cts → timbal-v2-button-CNfdwGq4.d.ts} +1 -1
  34. package/dist/ui.cjs +12 -3
  35. package/dist/ui.d.cts +5 -16
  36. package/dist/ui.d.ts +5 -16
  37. package/dist/ui.esm.js +2 -2
  38. package/dist/{welcome-BOizSp5h.d.ts → welcome-BBmB3tl7.d.ts} +4 -3
  39. package/dist/{welcome--80i_O0p.d.cts → welcome-C89Mgdaw.d.cts} +4 -3
  40. package/package.json +2 -1
  41. package/vite/local-dev.mjs +91 -5
  42. package/dist/chart-artifact-C71dk4xI.d.ts +0 -329
  43. package/dist/chart-artifact-CPEpOmtV.d.cts +0 -329
  44. package/dist/chunk-M4V6Q6XO.esm.js +0 -1082
@@ -17,10 +17,10 @@ import {
17
17
  studioSidebarEntryItemVariants,
18
18
  studioSidebarWidthTransition,
19
19
  useShellInsetReporter
20
- } from "./chunk-OFHLFNJH.esm.js";
20
+ } from "./chunk-Z27GBSOT.esm.js";
21
21
  import {
22
22
  WorkforceSelector
23
- } from "./chunk-WLTW56MC.esm.js";
23
+ } from "./chunk-N3PYVTY5.esm.js";
24
24
  import {
25
25
  Composer,
26
26
  TimbalChat,
@@ -43,10 +43,10 @@ import {
43
43
  studioTopbarIconPillClass,
44
44
  studioTopbarPillHeightClass,
45
45
  useTimbalRuntime
46
- } from "./chunk-YJQLLFKP.esm.js";
46
+ } from "./chunk-TLUF2RUL.esm.js";
47
47
  import {
48
48
  PillSegmentedTabs
49
- } from "./chunk-IYENDIRY.esm.js";
49
+ } from "./chunk-TDIJHV4I.esm.js";
50
50
  import {
51
51
  Avatar,
52
52
  AvatarFallback,
@@ -56,7 +56,7 @@ import {
56
56
  TooltipContent,
57
57
  TooltipTrigger,
58
58
  cn
59
- } from "./chunk-4TCJQSIX.esm.js";
59
+ } from "./chunk-2XZ3S4OP.esm.js";
60
60
 
61
61
  // src/hooks/use-workforces.ts
62
62
  import { useEffect, useMemo, useRef, useState } from "react";
@@ -1452,9 +1452,29 @@ var TimbalStudioShell = ({
1452
1452
  };
1453
1453
 
1454
1454
  // src/studio/sidebar/mode-toggle.tsx
1455
- import { useCallback as useCallback6, useEffect as useEffect6, useState as useState7 } from "react";
1455
+ import { useCallback as useCallback6, useLayoutEffect as useLayoutEffect3, useState as useState7 } from "react";
1456
1456
  import { Moon, Sun } from "lucide-react";
1457
1457
  import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
1458
+ function readStoredTheme() {
1459
+ if (typeof window === "undefined") return null;
1460
+ try {
1461
+ const value = window.localStorage.getItem(STORAGE_KEYS.theme);
1462
+ return value === "dark" || value === "light" ? value : null;
1463
+ } catch {
1464
+ return null;
1465
+ }
1466
+ }
1467
+ function writeStoredTheme(theme) {
1468
+ if (typeof window === "undefined") return;
1469
+ try {
1470
+ window.localStorage.setItem(STORAGE_KEYS.theme, theme);
1471
+ } catch {
1472
+ }
1473
+ }
1474
+ function applyDarkClass(isDark) {
1475
+ if (typeof document === "undefined") return;
1476
+ document.documentElement.classList.toggle("dark", isDark);
1477
+ }
1458
1478
  var ModeToggle = ({
1459
1479
  theme,
1460
1480
  setTheme,
@@ -1463,9 +1483,15 @@ var ModeToggle = ({
1463
1483
  }) => {
1464
1484
  const isControlled = theme !== void 0;
1465
1485
  const [internalIsDark, setInternalIsDark] = useState7(false);
1466
- useEffect6(() => {
1486
+ useLayoutEffect3(() => {
1467
1487
  if (isControlled) return;
1468
- if (typeof document === "undefined") return;
1488
+ const stored = readStoredTheme();
1489
+ if (stored) {
1490
+ const isDark2 = stored === "dark";
1491
+ applyDarkClass(isDark2);
1492
+ setInternalIsDark(isDark2);
1493
+ return;
1494
+ }
1469
1495
  setInternalIsDark(document.documentElement.classList.contains("dark"));
1470
1496
  }, [isControlled]);
1471
1497
  const isDark = isControlled ? theme === "dark" : internalIsDark;
@@ -1475,9 +1501,10 @@ var ModeToggle = ({
1475
1501
  setTheme(next);
1476
1502
  return;
1477
1503
  }
1478
- if (typeof document === "undefined") return;
1479
- document.documentElement.classList.toggle("dark", next === "dark");
1480
- setInternalIsDark(next === "dark");
1504
+ const isDarkNext = next === "dark";
1505
+ applyDarkClass(isDarkNext);
1506
+ writeStoredTheme(isDarkNext ? "dark" : "light");
1507
+ setInternalIsDark(isDarkNext);
1481
1508
  }, [isDark, setTheme]);
1482
1509
  return /* @__PURE__ */ jsxs9(
1483
1510
  TimbalV2Button,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  studioSecondaryChromeClass,
3
3
  studioTopbarPillHeightClass
4
- } from "./chunk-YJQLLFKP.esm.js";
4
+ } from "./chunk-TLUF2RUL.esm.js";
5
5
  import {
6
6
  cn
7
- } from "./chunk-4TCJQSIX.esm.js";
7
+ } from "./chunk-2XZ3S4OP.esm.js";
8
8
 
9
9
  // src/chat/workforce-selector.tsx
10
10
  import { ChevronDownIcon } from "lucide-react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cn
3
- } from "./chunk-4TCJQSIX.esm.js";
3
+ } from "./chunk-2XZ3S4OP.esm.js";
4
4
 
5
5
  // src/ui/pill-segmented-tabs.tsx
6
6
  import {