@timbal-ai/timbal-react 1.4.0 → 1.5.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 (53) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +18 -4
  3. package/dist/app.cjs +3532 -1483
  4. package/dist/app.d.cts +75 -30
  5. package/dist/app.d.ts +75 -30
  6. package/dist/app.esm.js +29 -7
  7. package/dist/{chart-artifact-CMnDys2t.d.ts → chart-artifact-2OTDTRwM.d.ts} +194 -40
  8. package/dist/{chart-artifact-C8-Py6lc.d.cts → chart-artifact-CS3qyGIY.d.cts} +194 -40
  9. package/dist/chat.cjs +264 -107
  10. package/dist/chat.d.cts +2 -2
  11. package/dist/chat.d.ts +2 -2
  12. package/dist/chat.esm.js +4 -3
  13. package/dist/chunk-5ECRZ5O7.esm.js +899 -0
  14. package/dist/{chunk-QU7ET55D.esm.js → chunk-AZL2WANO.esm.js} +320 -177
  15. package/dist/{chunk-OH23AX2V.esm.js → chunk-B4XAC4G7.esm.js} +430 -780
  16. package/dist/chunk-EDEKQYSU.esm.js +10 -0
  17. package/dist/{chunk-GQBYZRD7.esm.js → chunk-IGHBLJV3.esm.js} +38 -27
  18. package/dist/{chunk-OFWC4MIY.esm.js → chunk-JYDJRGDE.esm.js} +5 -3
  19. package/dist/{chunk-VOWNCS3F.esm.js → chunk-SZDYIRMB.esm.js} +1567 -490
  20. package/dist/chunk-TZI3ID3C.esm.js +232 -0
  21. package/dist/{chunk-THBA27QY.esm.js → chunk-WMKPT5BV.esm.js} +242 -123
  22. package/dist/{chunk-VXMM2HX7.esm.js → chunk-ZNYAETFD.esm.js} +1 -1
  23. package/dist/{circular-progress-Ci8L-Hfa.d.cts → circular-progress-CDsJwIPF.d.cts} +19 -77
  24. package/dist/{circular-progress-Ci8L-Hfa.d.ts → circular-progress-CDsJwIPF.d.ts} +19 -77
  25. package/dist/index.cjs +5506 -3626
  26. package/dist/index.d.cts +7 -6
  27. package/dist/index.d.ts +7 -6
  28. package/dist/index.esm.js +45 -33
  29. package/dist/kanban-U5xNe9py.d.cts +212 -0
  30. package/dist/kanban-U5xNe9py.d.ts +212 -0
  31. package/dist/{layout-BTJyU8wd.d.ts → layout-B8r6Jbat.d.ts} +1 -1
  32. package/dist/{layout-C2G-FcER.d.cts → layout-Cu7Ijn04.d.cts} +1 -1
  33. package/dist/site.cjs +358 -0
  34. package/dist/site.d.cts +184 -0
  35. package/dist/site.d.ts +184 -0
  36. package/dist/site.esm.js +322 -0
  37. package/dist/studio.cjs +702 -343
  38. package/dist/studio.d.cts +1 -1
  39. package/dist/studio.d.ts +1 -1
  40. package/dist/studio.esm.js +7 -5
  41. package/dist/styles.css +56 -0
  42. package/dist/{timbal-v2-button-CNfdwGq4.d.cts → timbal-v2-button-B7vPs7gg.d.cts} +2 -2
  43. package/dist/{timbal-v2-button-CNfdwGq4.d.ts → timbal-v2-button-B7vPs7gg.d.ts} +2 -2
  44. package/dist/ui.cjs +1504 -659
  45. package/dist/ui.d.cts +11 -4
  46. package/dist/ui.d.ts +11 -4
  47. package/dist/ui.esm.js +35 -26
  48. package/dist/{welcome-DXqsGTwH.d.ts → welcome-DduQAC4K.d.ts} +4 -0
  49. package/dist/{welcome-BFGRoNfK.d.cts → welcome-NXZlcihe.d.cts} +4 -0
  50. package/package.json +9 -1
  51. package/dist/button-BoyX5pM_.d.cts +0 -18
  52. package/dist/button-BoyX5pM_.d.ts +0 -18
  53. package/dist/chunk-UCGVL7ZY.esm.js +0 -52
package/dist/studio.cjs CHANGED
@@ -956,7 +956,7 @@ function TooltipContent({
956
956
  "data-slot": "tooltip-content",
957
957
  sideOffset,
958
958
  className: cn(
959
- "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
959
+ "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-2.5 py-1 text-xs text-balance",
960
960
  className
961
961
  ),
962
962
  ...props,
@@ -979,14 +979,6 @@ var TIMBAL_V2_MODAL_SURFACE = cn(
979
979
  "border border-border shadow-card-elevated"
980
980
  );
981
981
  var TIMBAL_V2_PRIMARY_GRADIENT = "bg-gradient-to-b from-primary-fill-from to-primary-fill-to";
982
- var TIMBAL_V2_FROM_LEGACY_BUTTON = {
983
- default: "primary",
984
- destructive: "destructive",
985
- outline: "secondary",
986
- secondary: "secondary",
987
- ghost: "ghost",
988
- link: "link"
989
- };
990
982
  var TIMBAL_V2_SIZE_HEIGHT = {
991
983
  xs: "min-h-8 h-8",
992
984
  sm: "min-h-9 h-9",
@@ -1022,6 +1014,11 @@ var TIMBAL_V2_FILL = {
1022
1014
  "group-hover/tbv2:from-destructive-fill-hover-from group-hover/tbv2:to-destructive-fill-hover-to",
1023
1015
  "group-active/tbv2:from-destructive-fill-active-from group-active/tbv2:to-destructive-fill-active-to"
1024
1016
  ].join(" "),
1017
+ "destructive-solid": [
1018
+ "bg-gradient-to-b from-destructive-solid-from to-destructive-solid-to",
1019
+ "group-hover/tbv2:from-destructive-solid-hover-from group-hover/tbv2:to-destructive-solid-hover-to",
1020
+ "group-active/tbv2:from-destructive-solid-active-from group-active/tbv2:to-destructive-solid-active-to"
1021
+ ].join(" "),
1025
1022
  secondary: [
1026
1023
  TIMBAL_V2_ELEVATED_GRADIENT,
1027
1024
  "group-hover/tbv2:from-secondary-fill-hover-from group-hover/tbv2:to-secondary-fill-hover-to",
@@ -1038,6 +1035,7 @@ var TIMBAL_V2_LABEL = {
1038
1035
  primary: "text-primary-foreground",
1039
1036
  informative: "text-primary-foreground",
1040
1037
  destructive: "text-destructive",
1038
+ "destructive-solid": "text-destructive-foreground",
1041
1039
  secondary: "text-foreground",
1042
1040
  ghost: "text-foreground",
1043
1041
  link: "text-foreground underline decoration-foreground/25 underline-offset-2 group-hover/tbv2:decoration-foreground/45"
@@ -1046,6 +1044,7 @@ var TIMBAL_V2_BORDER = {
1046
1044
  primary: "",
1047
1045
  informative: "border border-foreground/15",
1048
1046
  destructive: "border border-destructive/45",
1047
+ "destructive-solid": "",
1049
1048
  secondary: "border border-border",
1050
1049
  ghost: "",
1051
1050
  link: ""
@@ -1054,6 +1053,7 @@ var TIMBAL_V2_SHADOW = {
1054
1053
  primary: "shadow-card",
1055
1054
  informative: "shadow-card",
1056
1055
  destructive: "shadow-card",
1056
+ "destructive-solid": "shadow-card",
1057
1057
  secondary: "shadow-card",
1058
1058
  ghost: "",
1059
1059
  link: ""
@@ -1299,8 +1299,8 @@ function AvatarFallback({
1299
1299
  branded ? cn(
1300
1300
  "bg-transparent font-medium",
1301
1301
  TIMBAL_V2_LABEL.secondary,
1302
- "text-sm group-data-[size=sm]/avatar:text-xs"
1303
- ) : "bg-muted font-normal text-muted-foreground text-sm group-data-[size=sm]/avatar:text-xs",
1302
+ "text-xs group-data-[size=sm]/avatar:text-[10px]"
1303
+ ) : "bg-muted font-normal text-muted-foreground text-xs group-data-[size=sm]/avatar:text-[10px]",
1304
1304
  className
1305
1305
  ),
1306
1306
  style,
@@ -1334,6 +1334,11 @@ var TIMBAL_V2_FILL_AS_CHILD = {
1334
1334
  "hover:from-destructive-fill-hover-from hover:to-destructive-fill-hover-to",
1335
1335
  "active:from-destructive-fill-active-from active:to-destructive-fill-active-to"
1336
1336
  ].join(" "),
1337
+ "destructive-solid": [
1338
+ "bg-gradient-to-b from-destructive-solid-from to-destructive-solid-to",
1339
+ "hover:from-destructive-solid-hover-from hover:to-destructive-solid-hover-to",
1340
+ "active:from-destructive-solid-active-from active:to-destructive-solid-active-to"
1341
+ ].join(" "),
1337
1342
  secondary: [
1338
1343
  TIMBAL_V2_ELEVATED_GRADIENT,
1339
1344
  "hover:from-secondary-fill-hover-from hover:to-secondary-fill-hover-to",
@@ -1356,7 +1361,7 @@ var TimbalV2Button = React2.forwardRef(function TimbalV2Button2({
1356
1361
  isIconOnly = false,
1357
1362
  isLoading = false,
1358
1363
  fullWidth = false,
1359
- shape: _shape = "pill",
1364
+ shape = "pill",
1360
1365
  asChild = false,
1361
1366
  className,
1362
1367
  disabled,
@@ -1366,7 +1371,7 @@ var TimbalV2Button = React2.forwardRef(function TimbalV2Button2({
1366
1371
  }, ref) {
1367
1372
  const isDisabled = disabled || isLoading;
1368
1373
  const sizeClass = isIconOnly ? TIMBAL_V2_SIZE_ICON[size] : TIMBAL_V2_SIZE_HEIGHT[size];
1369
- const radiusClass = "rounded-full";
1374
+ const radiusClass = shape === "rect" ? "rounded-lg" : "rounded-full";
1370
1375
  const sharedRootClass = cn(
1371
1376
  "relative box-border inline-flex items-center justify-center gap-2 whitespace-nowrap border-0 text-sm font-normal shadow-none transition duration-200 ease-in-out",
1372
1377
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 focus-visible:ring-offset-background",
@@ -1667,7 +1672,7 @@ function ChartContainer({
1667
1672
  ...props,
1668
1673
  children: [
1669
1674
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChartStyle, { id: chartId, config }),
1670
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RechartsPrimitive.ResponsiveContainer, { children })
1675
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RechartsPrimitive.ResponsiveContainer, { width: "100%", height: "100%", children })
1671
1676
  ]
1672
1677
  }
1673
1678
  ) });
@@ -1698,6 +1703,36 @@ ${colorConfig.map(([key, itemConfig]) => {
1698
1703
  );
1699
1704
  };
1700
1705
  var ChartTooltip = RechartsPrimitive.Tooltip;
1706
+ var CHART_TOOLTIP_SURFACE = "rounded-xl border px-5 py-4 text-left text-[11px] leading-snug shadow-[0_12px_40px_-10px_rgba(0,0,0,0.55)] border-white/10 bg-gradient-to-b from-neutral-800 to-neutral-950 text-white dark:border-black/10 dark:from-white dark:to-neutral-100 dark:text-neutral-900";
1707
+ var CHART_TOOLTIP_TEXT = "text-white dark:text-neutral-900";
1708
+ var CHART_TOOLTIP_MUTED = "text-neutral-300 dark:text-neutral-600";
1709
+ function isCssColor(value) {
1710
+ return typeof value === "string" && value.length > 0 && !value.startsWith("url(");
1711
+ }
1712
+ function resolvePayloadConfigKey(payload, key) {
1713
+ if (typeof payload !== "object" || payload === null) {
1714
+ return key;
1715
+ }
1716
+ const row = payload;
1717
+ const nested = "payload" in row && typeof row.payload === "object" && row.payload !== null ? row.payload : void 0;
1718
+ if (key in row && typeof row[key] === "string") {
1719
+ return row[key];
1720
+ }
1721
+ if (nested && key in nested && typeof nested[key] === "string") {
1722
+ return nested[key];
1723
+ }
1724
+ if (typeof row.value === "string") {
1725
+ return row.value;
1726
+ }
1727
+ return key;
1728
+ }
1729
+ function resolveSwatchColor(itemConfig, configKey, ...candidates) {
1730
+ for (const candidate of candidates) {
1731
+ if (isCssColor(candidate)) return candidate;
1732
+ }
1733
+ if (isCssColor(itemConfig?.color)) return itemConfig.color;
1734
+ return `var(--color-${configKey})`;
1735
+ }
1701
1736
  function ChartTooltipContent({
1702
1737
  active,
1703
1738
  payload,
@@ -1709,6 +1744,7 @@ function ChartTooltipContent({
1709
1744
  labelFormatter,
1710
1745
  labelClassName,
1711
1746
  formatter,
1747
+ valueFormatter,
1712
1748
  color,
1713
1749
  nameKey,
1714
1750
  labelKey
@@ -1723,12 +1759,12 @@ function ChartTooltipContent({
1723
1759
  const itemConfig = getPayloadConfigFromPayload(config, item, key);
1724
1760
  const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
1725
1761
  if (labelFormatter) {
1726
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
1762
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: cn("font-medium leading-none", labelClassName), children: labelFormatter(value, payload) });
1727
1763
  }
1728
1764
  if (!value) {
1729
1765
  return null;
1730
1766
  }
1731
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: cn("font-medium", labelClassName), children: value });
1767
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: cn("font-medium leading-none", labelClassName), children: value });
1732
1768
  }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
1733
1769
  if (!active || !payload?.length) {
1734
1770
  return null;
@@ -1738,7 +1774,8 @@ function ChartTooltipContent({
1738
1774
  "div",
1739
1775
  {
1740
1776
  className: cn(
1741
- "border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
1777
+ "grid min-w-[8rem] items-start gap-1.5",
1778
+ CHART_TOOLTIP_SURFACE,
1742
1779
  "animate-in fade-in-0 zoom-in-95 duration-150",
1743
1780
  className
1744
1781
  ),
@@ -1746,31 +1783,35 @@ function ChartTooltipContent({
1746
1783
  !nestLabel ? tooltipLabel : null,
1747
1784
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid gap-1.5", children: payload.filter((item) => item.type !== "none").map((item, index) => {
1748
1785
  const key = `${nameKey || item.name || item.dataKey || "value"}`;
1786
+ const configKey = resolvePayloadConfigKey(item, key);
1749
1787
  const itemConfig = getPayloadConfigFromPayload(config, item, key);
1750
- const indicatorColor = color || item.payload?.fill || item.color;
1788
+ const indicatorColor = resolveSwatchColor(
1789
+ itemConfig,
1790
+ configKey,
1791
+ color,
1792
+ item.payload?.fill,
1793
+ item.color
1794
+ );
1751
1795
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1752
1796
  "div",
1753
1797
  {
1754
1798
  className: cn(
1755
- "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
1799
+ "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-neutral-500 dark:[&>svg]:text-neutral-400",
1756
1800
  indicator === "dot" && "items-center"
1757
1801
  ),
1758
1802
  children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1759
1803
  itemConfig?.icon ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1760
1804
  "div",
1761
1805
  {
1762
- className: cn(
1763
- "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
1764
- {
1765
- "h-2.5 w-2.5": indicator === "dot",
1766
- "w-1": indicator === "line",
1767
- "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
1768
- "my-0.5": nestLabel && indicator === "dashed"
1769
- }
1770
- ),
1806
+ className: cn("shrink-0 rounded-[2px]", {
1807
+ "h-2.5 w-2.5": indicator === "dot",
1808
+ "w-1": indicator === "line",
1809
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
1810
+ "my-0.5": nestLabel && indicator === "dashed"
1811
+ }),
1771
1812
  style: {
1772
- "--color-bg": indicatorColor,
1773
- "--color-border": indicatorColor
1813
+ backgroundColor: indicator === "dashed" ? void 0 : indicatorColor,
1814
+ borderColor: indicatorColor
1774
1815
  }
1775
1816
  }
1776
1817
  ),
@@ -1778,15 +1819,15 @@ function ChartTooltipContent({
1778
1819
  "div",
1779
1820
  {
1780
1821
  className: cn(
1781
- "flex flex-1 justify-between leading-none",
1822
+ "flex flex-1 justify-between gap-3 leading-none",
1782
1823
  nestLabel ? "items-end" : "items-center"
1783
1824
  ),
1784
1825
  children: [
1785
1826
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid gap-1.5", children: [
1786
1827
  nestLabel ? tooltipLabel : null,
1787
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-muted-foreground", children: itemConfig?.label || item.name })
1828
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: CHART_TOOLTIP_MUTED, children: itemConfig?.label || item.name })
1788
1829
  ] }),
1789
- item.value != null && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-foreground font-mono font-medium tabular-nums", children: typeof item.value === "number" ? item.value.toLocaleString() : String(item.value) })
1830
+ item.value != null && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: cn("font-medium tabular-nums", CHART_TOOLTIP_TEXT), children: valueFormatter ? valueFormatter(item.value, item) : typeof item.value === "number" ? item.value.toLocaleString() : String(item.value) })
1790
1831
  ]
1791
1832
  }
1792
1833
  )
@@ -1821,7 +1862,9 @@ function ChartLegendContent({
1821
1862
  ),
1822
1863
  children: payload.filter((item) => item.type !== "none").map((item, index) => {
1823
1864
  const key = `${nameKey || item.dataKey || "value"}`;
1865
+ const configKey = resolvePayloadConfigKey(item, key);
1824
1866
  const itemConfig = getPayloadConfigFromPayload(config, item, key);
1867
+ const swatchColor = resolveSwatchColor(itemConfig, configKey, item.color);
1825
1868
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1826
1869
  "div",
1827
1870
  {
@@ -1831,7 +1874,7 @@ function ChartLegendContent({
1831
1874
  "div",
1832
1875
  {
1833
1876
  className: "h-2 w-2 shrink-0 rounded-[2px]",
1834
- style: { backgroundColor: item.color }
1877
+ style: { backgroundColor: swatchColor }
1835
1878
  }
1836
1879
  ),
1837
1880
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "min-w-0 truncate", children: itemConfig?.label ?? (item.value != null ? String(item.value) : null) })
@@ -1847,13 +1890,7 @@ function getPayloadConfigFromPayload(config, payload, key) {
1847
1890
  if (typeof payload !== "object" || payload === null) {
1848
1891
  return void 0;
1849
1892
  }
1850
- const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
1851
- let configLabelKey = key;
1852
- if (key in payload && typeof payload[key] === "string") {
1853
- configLabelKey = payload[key];
1854
- } else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
1855
- configLabelKey = payloadPayload[key];
1856
- }
1893
+ const configLabelKey = resolvePayloadConfigKey(payload, key);
1857
1894
  return configLabelKey in config ? config[configLabelKey] : config[key];
1858
1895
  }
1859
1896
 
@@ -1959,13 +1996,13 @@ function resolveChartMargin(options) {
1959
1996
  }
1960
1997
  const anyAxis = showXAxis || showYAxis;
1961
1998
  if (!anyAxis) {
1962
- return { top: 8, right: 12, bottom: 8, left: 12 };
1999
+ return { top: 8, right: 0, bottom: 0, left: 0 };
1963
2000
  }
1964
2001
  return {
1965
2002
  top: 8,
1966
- right: 12,
1967
- bottom: showXAxis ? 24 : 8,
1968
- left: showYAxis ? 8 : 12
2003
+ right: showYAxis ? 12 : 0,
2004
+ bottom: showXAxis ? 24 : 0,
2005
+ left: showYAxis ? 8 : 0
1969
2006
  };
1970
2007
  }
1971
2008
  function flushBarCategoryGap(flush, showCategoryAxis) {
@@ -2013,7 +2050,7 @@ var LineAreaChart = ({
2013
2050
  barRadius = 4,
2014
2051
  gridLines,
2015
2052
  layout = "default",
2016
- showGrid = true,
2053
+ showGrid: showGridProp,
2017
2054
  showXAxis: showXAxisProp,
2018
2055
  showYAxis: showYAxisProp,
2019
2056
  showLegend: showLegendProp,
@@ -2029,6 +2066,7 @@ var LineAreaChart = ({
2029
2066
  const xKey = xKeyProp ?? inferXKey(data);
2030
2067
  const series = resolveSeries(seriesProp, data, xKey);
2031
2068
  const flush = layout === "flush";
2069
+ const showGrid = showGridProp ?? !flush;
2032
2070
  const horizontal = orientation === "horizontal" && variant === "bar";
2033
2071
  const showXAxis = showXAxisProp ?? !flush;
2034
2072
  const showYAxis = showYAxisProp ?? !flush;
@@ -2069,14 +2107,7 @@ var LineAreaChart = ({
2069
2107
  const category = resolveTooltipCategory(label, items, xKey, data, xFmt);
2070
2108
  return category || null;
2071
2109
  },
2072
- formatter: (value, name, item) => {
2073
- const key = String(item.dataKey ?? name ?? "value");
2074
- const seriesLabel = config[key]?.label ?? name;
2075
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-1 items-center justify-between leading-none", children: [
2076
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-muted-foreground", children: seriesLabel }),
2077
- value != null ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-foreground font-mono font-medium tabular-nums", children: valueFmt(value) }) : null
2078
- ] });
2079
- }
2110
+ valueFormatter: (value) => value != null ? valueFmt(value) : null
2080
2111
  }
2081
2112
  )
2082
2113
  }
@@ -2087,13 +2118,27 @@ var LineAreaChart = ({
2087
2118
  if (variant === "bar") {
2088
2119
  const dataKeys = series.map((s) => s.dataKey);
2089
2120
  const barDefs = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BarGradientDefs, { scopeId: gradientScopeId, dataKeys, horizontal });
2090
- const bars = series.map((s) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2121
+ const bars = stacked ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2122
+ import_recharts.BarStack,
2123
+ {
2124
+ radius: barCornerRadius(barRadius, horizontal, false),
2125
+ stackId: "stack",
2126
+ children: series.map((s) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2127
+ import_recharts.Bar,
2128
+ {
2129
+ dataKey: s.dataKey,
2130
+ fill: `url(#${barGradientId(gradientScopeId, s.dataKey)})`,
2131
+ isAnimationActive: true
2132
+ },
2133
+ s.dataKey
2134
+ ))
2135
+ }
2136
+ ) : series.map((s) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2091
2137
  import_recharts.Bar,
2092
2138
  {
2093
2139
  dataKey: s.dataKey,
2094
2140
  fill: `url(#${barGradientId(gradientScopeId, s.dataKey)})`,
2095
- radius: barCornerRadius(barRadius, horizontal, stacked),
2096
- stackId: stacked ? "stack" : void 0,
2141
+ radius: barCornerRadius(barRadius, horizontal, false),
2097
2142
  isAnimationActive: true
2098
2143
  },
2099
2144
  s.dataKey
@@ -2166,7 +2211,7 @@ var LineAreaChart = ({
2166
2211
  tick: categoryTick("middle"),
2167
2212
  ...flushCategoryXAxisProps
2168
2213
  }
2169
- ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts.XAxis, { dataKey: xKey, hide: true }),
2214
+ ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts.XAxis, { dataKey: xKey, hide: true, height: 0 }),
2170
2215
  showYAxis ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2171
2216
  import_recharts.YAxis,
2172
2217
  {
@@ -2177,7 +2222,7 @@ var LineAreaChart = ({
2177
2222
  tickFormatter: (v) => valueFmt(v),
2178
2223
  domain: yDomain
2179
2224
  }
2180
- ) : null,
2225
+ ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts.YAxis, { hide: true, width: 0, domain: yDomain }),
2181
2226
  tooltipEl,
2182
2227
  legendEl,
2183
2228
  bars
@@ -2213,7 +2258,7 @@ var LineAreaChart = ({
2213
2258
  tickFormatter: (v, i) => xFmt(v, i),
2214
2259
  ...flushCategoryXAxisProps
2215
2260
  }
2216
- ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts.XAxis, { dataKey: chartXKey, hide: true }),
2261
+ ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts.XAxis, { dataKey: chartXKey, hide: true, height: 0 }),
2217
2262
  showYAxis ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2218
2263
  import_recharts.YAxis,
2219
2264
  {
@@ -2224,7 +2269,7 @@ var LineAreaChart = ({
2224
2269
  tickFormatter: (v) => valueFmt(v),
2225
2270
  domain: yDomain
2226
2271
  }
2227
- ) : null
2272
+ ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts.YAxis, { hide: true, width: 0, domain: yDomain })
2228
2273
  ] });
2229
2274
  const chartA11y = flush ? {} : { accessibilityLayer: true };
2230
2275
  if (variant === "area") {
@@ -2403,7 +2448,7 @@ var PieChart = ({
2403
2448
  fill: palette[i % palette.length]
2404
2449
  }));
2405
2450
  const config = {};
2406
- for (const s of slices) config[s.name] = { label: s.name };
2451
+ for (const s of slices) config[s.name] = { label: s.name, color: s.fill };
2407
2452
  const innerPct = innerRadius > 0 ? `${Math.round(innerRadius * 75)}%` : 0;
2408
2453
  const hasCenter = innerRadius > 0 && (centerValue != null || centerLabel != null);
2409
2454
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
@@ -2523,7 +2568,7 @@ var RadialChart = ({
2523
2568
  }));
2524
2569
  const max = maxValue ?? Math.max(...rows.map((r) => r.value), 1);
2525
2570
  const config = {};
2526
- for (const r of rows) config[r.name] = { label: r.name };
2571
+ for (const r of rows) config[r.name] = { label: r.name, color: r.fill };
2527
2572
  const hasCenter = centerValue != null || centerLabel != null;
2528
2573
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("flex w-full flex-col items-center gap-3", className), children: [
2529
2574
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
@@ -3203,69 +3248,181 @@ var import_react16 = require("@assistant-ui/react");
3203
3248
 
3204
3249
  // src/ui/button.tsx
3205
3250
  var import_class_variance_authority = require("class-variance-authority");
3251
+ var import_radix_ui5 = require("radix-ui");
3206
3252
  var import_jsx_runtime24 = require("react/jsx-runtime");
3207
- var LEGACY_SIZE_TO_V2 = {
3208
- default: "md",
3209
- xs: "xs",
3210
- sm: "sm",
3211
- lg: "lg",
3212
- icon: "sm",
3213
- "icon-xs": "xs",
3214
- "icon-sm": "sm",
3215
- "icon-lg": "lg"
3216
- };
3253
+ var SOLID_SKEUOMORPHIC_SHADOW = "shadow-skeuomorphic-solid";
3254
+ var BORDERED_SKEUOMORPHIC_SHADOW = "shadow-skeuomorphic-bordered";
3217
3255
  var buttonVariants = (0, import_class_variance_authority.cva)(
3218
- "inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0",
3256
+ cn(
3257
+ "relative inline-flex shrink-0 cursor-pointer select-none items-center justify-center whitespace-nowrap font-medium",
3258
+ "transition-all duration-300 ease-in-out outline-none border",
3259
+ "focus-visible:ring-4 focus-visible:ring-primary/20 focus-visible:ring-offset-0",
3260
+ "disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:pointer-events-none",
3261
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-5",
3262
+ // Overflow hidden can clip out-of-bounds shadow, so we use precise overflow management and rounded-[inherit] on pseudo overlays
3263
+ "after:absolute after:inset-0 after:rounded-[inherit] after:pointer-events-none after:transition-opacity after:duration-300 after:ease-in-out after:opacity-0"
3264
+ ),
3219
3265
  {
3220
3266
  variants: {
3221
- variant: {
3222
- default: "",
3223
- destructive: "",
3224
- outline: "",
3225
- secondary: "",
3226
- ghost: "",
3227
- link: ""
3267
+ color: {
3268
+ primary: cn(
3269
+ // Exact Premium Untitled UI primary BLACK / dark charcoal: gradient + borders
3270
+ "bg-gradient-to-b from-[#344054] to-[#0F1117] text-white border-[#1A1E29]",
3271
+ "hover:border-[#181C26]",
3272
+ "active:border-[#0A0D14]",
3273
+ SOLID_SKEUOMORPHIC_SHADOW,
3274
+ // Hover/active overlays for beautiful animation (the gradient is static, the overlay opacity is transitioned)
3275
+ "after:bg-white/[0.08] hover:after:opacity-100 active:after:bg-black/[0.12]",
3276
+ // Premium Dark Mode inversion: Primary becomes white, popping out elegantly
3277
+ "dark:bg-gradient-to-b dark:from-white dark:to-[#F9FAFB] dark:text-[#10121C] dark:border-white",
3278
+ "dark:hover:border-[#D0D5DD] dark:hover:text-[#10121C]",
3279
+ "dark:shadow-skeuomorphic-bordered",
3280
+ "dark:after:bg-black/[0.04] dark:active:after:bg-black/[0.08]"
3281
+ ),
3282
+ secondary: cn(
3283
+ // Exact Untitled UI secondary: premium white/gray gradient + borders
3284
+ "bg-gradient-to-b from-white to-[#F9FAFB] text-[#344054] border-[#D0D5DD]",
3285
+ "hover:text-[#1D2939] hover:border-[#D0D5DD]",
3286
+ BORDERED_SKEUOMORPHIC_SHADOW,
3287
+ // Hover/active overlays for white/gray gradient
3288
+ "after:bg-black/[0.03] hover:after:opacity-100 active:after:bg-black/[0.08]",
3289
+ // Premium Dark Mode inversion: Secondary becomes dark charcoal/gray, merging into the background
3290
+ "dark:bg-gradient-to-b dark:from-[#1F242F] dark:to-[#10121C] dark:text-[#D1D5DB] dark:border-[#344054]",
3291
+ "dark:hover:border-[#475467] dark:hover:text-white",
3292
+ "dark:shadow-skeuomorphic-solid",
3293
+ "dark:after:bg-white/[0.06] dark:active:after:bg-black/[0.15]"
3294
+ ),
3295
+ tertiary: cn(
3296
+ "bg-transparent text-[#475467] border-transparent",
3297
+ "hover:bg-[#F9FAFB] hover:text-[#344054]",
3298
+ "active:bg-[#F2F4F7] active:text-[#1D2939]",
3299
+ "after:hidden",
3300
+ // No overlay needed for transparent surfaces
3301
+ // Dark Mode
3302
+ "dark:text-[#9CA3AF] dark:hover:bg-[#1F242F] dark:hover:text-white dark:active:bg-[#11131A]"
3303
+ ),
3304
+ link: cn(
3305
+ "h-auto! bg-transparent p-0! border-transparent text-[#1F242F] hover:text-[#10121C]",
3306
+ "hover:underline",
3307
+ "after:hidden",
3308
+ // Dark Mode
3309
+ "dark:text-[#9CA3AF] dark:hover:text-white"
3310
+ ),
3311
+ "primary-destructive": cn(
3312
+ // Exact Untitled UI primary destructive: premium red gradient + borders (vibrant and subtle, not too dark)
3313
+ "bg-gradient-to-b from-[#D92D20] to-[#B42318] text-white border-[#B42318]",
3314
+ "hover:border-[#9E1B12]",
3315
+ "active:border-[#84140D]",
3316
+ SOLID_SKEUOMORPHIC_SHADOW,
3317
+ // Destructive red hover/active overlays
3318
+ "after:bg-white/[0.12] hover:after:opacity-100 active:after:bg-black/[0.15]"
3319
+ ),
3320
+ "secondary-destructive": cn(
3321
+ // Exact Untitled UI secondary destructive: soft red bordered
3322
+ "bg-gradient-to-b from-white to-[#F9FAFB] text-[#B42318] border-[#FDA29B]",
3323
+ "hover:text-[#9E1B12] hover:border-[#FDA29B]",
3324
+ BORDERED_SKEUOMORPHIC_SHADOW,
3325
+ // Hover overlay
3326
+ "after:bg-red-500/[0.04] hover:after:opacity-100 active:after:bg-red-950/[0.08]",
3327
+ // Dark Mode Secondary Destructive: Charcoal fill with red borders and label
3328
+ "dark:bg-gradient-to-b dark:from-[#1F242F] dark:to-[#10121C] dark:text-[#F87171] dark:border-[#9E1B12]/50",
3329
+ "dark:hover:border-[#F87171]/40",
3330
+ "dark:shadow-skeuomorphic-solid",
3331
+ "dark:after:bg-white/[0.06] dark:active:after:bg-black/[0.15]"
3332
+ )
3228
3333
  },
3229
3334
  size: {
3230
- default: "",
3231
- xs: "",
3232
- sm: "",
3233
- lg: "",
3234
- icon: "",
3235
- "icon-xs": "",
3236
- "icon-sm": "",
3237
- "icon-lg": ""
3335
+ xs: "h-8 gap-1 rounded-md px-2.5 text-xs",
3336
+ sm: "h-9 gap-1.5 rounded-lg px-3 text-sm",
3337
+ md: "h-10 gap-1.5 rounded-lg px-3.5 text-sm",
3338
+ lg: "h-11 gap-2 rounded-lg px-4 text-base",
3339
+ xl: "h-12 gap-2 rounded-lg px-5 text-base",
3340
+ default: "h-10 gap-1.5 rounded-lg px-3.5 text-sm",
3341
+ icon: "h-10 w-10 rounded-lg",
3342
+ "icon-xs": "h-8 w-8 rounded-md",
3343
+ "icon-sm": "h-9 w-9 rounded-lg",
3344
+ "icon-lg": "h-11 w-11 rounded-lg"
3345
+ },
3346
+ shape: {
3347
+ pill: "rounded-full!",
3348
+ rounded: ""
3349
+ // defaults to the size variant's standard rounded-lg
3238
3350
  }
3239
3351
  },
3240
3352
  defaultVariants: {
3241
- variant: "default",
3242
- size: "default"
3353
+ color: "primary",
3354
+ size: "default",
3355
+ shape: "rounded"
3243
3356
  }
3244
3357
  }
3245
3358
  );
3246
3359
  function Button({
3247
3360
  className,
3248
- variant = "default",
3249
- size = "default",
3361
+ variant,
3362
+ color,
3363
+ size,
3364
+ shape,
3365
+ iconLeading,
3366
+ iconTrailing,
3367
+ isLoading = false,
3250
3368
  asChild = false,
3369
+ disabled,
3370
+ type = "button",
3371
+ children,
3251
3372
  ...props
3252
3373
  }) {
3253
- const v2Variant = TIMBAL_V2_FROM_LEGACY_BUTTON[variant ?? "default"];
3254
- const v2Size = LEGACY_SIZE_TO_V2[size ?? "default"];
3255
- const isIconOnly = typeof size === "string" && size.startsWith("icon");
3256
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3257
- TimbalV2Button,
3374
+ const isDisabled = disabled || isLoading;
3375
+ let resolvedColor = "primary";
3376
+ if (color) {
3377
+ resolvedColor = color;
3378
+ } else if (variant) {
3379
+ if (variant === "default" || variant === "informative") resolvedColor = "primary";
3380
+ else if (variant === "secondary" || variant === "outline") resolvedColor = "secondary";
3381
+ else if (variant === "destructive") resolvedColor = "primary-destructive";
3382
+ else if (variant === "ghost") resolvedColor = "tertiary";
3383
+ else if (variant === "link") resolvedColor = "link";
3384
+ }
3385
+ const classes = cn(
3386
+ buttonVariants({
3387
+ color: resolvedColor,
3388
+ size: size ?? "default",
3389
+ shape: shape ?? "rounded"
3390
+ }),
3391
+ className
3392
+ );
3393
+ if (asChild) {
3394
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3395
+ import_radix_ui5.Slot.Root,
3396
+ {
3397
+ className: classes,
3398
+ "aria-disabled": isDisabled ? true : void 0,
3399
+ "data-slot": "button",
3400
+ "data-variant": resolvedColor,
3401
+ ...props,
3402
+ children
3403
+ }
3404
+ );
3405
+ }
3406
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3407
+ "button",
3258
3408
  {
3409
+ type,
3410
+ disabled: isDisabled,
3259
3411
  "data-slot": "button",
3260
- "data-variant": variant,
3261
- "data-size": size,
3262
- variant: v2Variant,
3263
- size: v2Size,
3264
- shape: "pill",
3265
- isIconOnly,
3266
- asChild,
3267
- className: cn(buttonVariants({ variant, size, className })),
3268
- ...props
3412
+ "data-variant": resolvedColor,
3413
+ className: classes,
3414
+ ...props,
3415
+ children: [
3416
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3417
+ "span",
3418
+ {
3419
+ "aria-hidden": true,
3420
+ className: "size-4 animate-spin rounded-full border-2 border-current border-t-transparent"
3421
+ }
3422
+ ) : iconLeading,
3423
+ children,
3424
+ !isLoading ? iconTrailing : null
3425
+ ]
3269
3426
  }
3270
3427
  );
3271
3428
  }
@@ -5067,6 +5224,7 @@ var overlayListPanelClass = cn(
5067
5224
  overlaySurfaceClass,
5068
5225
  "overflow-hidden rounded-lg p-0 outline-hidden"
5069
5226
  );
5227
+ var overlayItemClass = "relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground";
5070
5228
 
5071
5229
  // src/chat/workforce-selector.tsx
5072
5230
  var import_jsx_runtime38 = require("react/jsx-runtime");
@@ -5308,9 +5466,9 @@ var TimbalChatShell = ({
5308
5466
  };
5309
5467
 
5310
5468
  // src/studio/shell/studio-shell.tsx
5311
- var import_react48 = require("react");
5312
- var import_lucide_react13 = require("lucide-react");
5313
- var import_react49 = require("motion/react");
5469
+ var import_react49 = require("react");
5470
+ var import_lucide_react14 = require("lucide-react");
5471
+ var import_react50 = require("motion/react");
5314
5472
 
5315
5473
  // src/design/sidebar-motion.ts
5316
5474
  var STUDIO_SIDEBAR_EASE_ENTER = [0, 0, 0.2, 1];
@@ -5493,8 +5651,8 @@ function useStudioSidebarLayout() {
5493
5651
  }
5494
5652
 
5495
5653
  // src/studio/sidebar/sidebar.tsx
5496
- var import_react42 = require("react");
5497
- var import_react43 = require("motion/react");
5654
+ var import_react43 = require("react");
5655
+ var import_react44 = require("motion/react");
5498
5656
 
5499
5657
  // src/studio/sidebar/sidebar-entries.tsx
5500
5658
  var import_react37 = require("motion/react");
@@ -5530,7 +5688,8 @@ var StudioSidebarEntries = ({
5530
5688
  };
5531
5689
 
5532
5690
  // src/studio/sidebar/sidebar-footer.tsx
5533
- var import_lucide_react10 = require("lucide-react");
5691
+ var import_react40 = require("react");
5692
+ var import_lucide_react11 = require("lucide-react");
5534
5693
 
5535
5694
  // src/auth/provider.tsx
5536
5695
  var import_react38 = require("react");
@@ -5591,8 +5750,100 @@ var StudioSidebarTooltip = ({
5591
5750
  ] });
5592
5751
  };
5593
5752
 
5594
- // src/studio/sidebar/sidebar-footer.tsx
5753
+ // src/ui/dropdown-menu.tsx
5754
+ var import_radix_ui6 = require("radix-ui");
5755
+ var import_lucide_react10 = require("lucide-react");
5595
5756
  var import_jsx_runtime45 = require("react/jsx-runtime");
5757
+ function DropdownMenu({
5758
+ ...props
5759
+ }) {
5760
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui6.DropdownMenu.Root, { "data-slot": "dropdown-menu", ...props });
5761
+ }
5762
+ function DropdownMenuTrigger({
5763
+ ...props
5764
+ }) {
5765
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5766
+ import_radix_ui6.DropdownMenu.Trigger,
5767
+ {
5768
+ "data-slot": "dropdown-menu-trigger",
5769
+ ...props
5770
+ }
5771
+ );
5772
+ }
5773
+ function DropdownMenuContent({
5774
+ className,
5775
+ sideOffset = 4,
5776
+ ...props
5777
+ }) {
5778
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui6.DropdownMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5779
+ import_radix_ui6.DropdownMenu.Content,
5780
+ {
5781
+ "data-slot": "dropdown-menu-content",
5782
+ sideOffset,
5783
+ className: cn(
5784
+ overlayListPanelClass,
5785
+ "max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] origin-[var(--radix-dropdown-menu-content-transform-origin)] overflow-x-hidden overflow-y-auto p-1",
5786
+ className
5787
+ ),
5788
+ ...props
5789
+ }
5790
+ ) });
5791
+ }
5792
+ function DropdownMenuItem({
5793
+ className,
5794
+ inset,
5795
+ variant = "default",
5796
+ ...props
5797
+ }) {
5798
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5799
+ import_radix_ui6.DropdownMenu.Item,
5800
+ {
5801
+ "data-slot": "dropdown-menu-item",
5802
+ "data-inset": inset,
5803
+ "data-variant": variant,
5804
+ className: cn(
5805
+ overlayItemClass,
5806
+ "data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10",
5807
+ className
5808
+ ),
5809
+ ...props
5810
+ }
5811
+ );
5812
+ }
5813
+ function DropdownMenuLabel({
5814
+ className,
5815
+ inset,
5816
+ ...props
5817
+ }) {
5818
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5819
+ import_radix_ui6.DropdownMenu.Label,
5820
+ {
5821
+ "data-slot": "dropdown-menu-label",
5822
+ "data-inset": inset,
5823
+ className: cn(
5824
+ "px-2 py-1.5 text-xs font-medium text-muted-foreground data-[inset]:pl-8",
5825
+ className
5826
+ ),
5827
+ ...props
5828
+ }
5829
+ );
5830
+ }
5831
+ function DropdownMenuSeparator({
5832
+ className,
5833
+ ...props
5834
+ }) {
5835
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5836
+ import_radix_ui6.DropdownMenu.Separator,
5837
+ {
5838
+ "data-slot": "dropdown-menu-separator",
5839
+ className: cn("-mx-1 my-1 h-px bg-border", className),
5840
+ ...props
5841
+ }
5842
+ );
5843
+ }
5844
+
5845
+ // src/studio/sidebar/sidebar-footer.tsx
5846
+ var import_jsx_runtime46 = require("react/jsx-runtime");
5596
5847
  function userInitials(name, email) {
5597
5848
  const fromName = name.trim().split(/\s+/).map((part) => part.charAt(0)).join("").slice(0, 2).toUpperCase();
5598
5849
  if (fromName) return fromName;
@@ -5606,68 +5857,127 @@ var StudioSidebarFooter = ({
5606
5857
  }) => {
5607
5858
  const session = useOptionalSession();
5608
5859
  const user = session?.user ?? null;
5860
+ const [isDark, setIsDark] = (0, import_react40.useState)(false);
5861
+ (0, import_react40.useEffect)(() => {
5862
+ if (typeof window === "undefined" || typeof document === "undefined") return;
5863
+ const stored = window.localStorage.getItem(STORAGE_KEYS.theme);
5864
+ if (stored) {
5865
+ setIsDark(stored === "dark");
5866
+ } else {
5867
+ setIsDark(document.documentElement.classList.contains("dark"));
5868
+ }
5869
+ const observer = new MutationObserver(() => {
5870
+ setIsDark(document.documentElement.classList.contains("dark"));
5871
+ });
5872
+ observer.observe(document.documentElement, {
5873
+ attributes: true,
5874
+ attributeFilter: ["class"]
5875
+ });
5876
+ return () => observer.disconnect();
5877
+ }, []);
5878
+ const handleToggleTheme = () => {
5879
+ const nextIsDark = !isDark;
5880
+ setIsDark(nextIsDark);
5881
+ if (typeof document !== "undefined") {
5882
+ document.documentElement.classList.toggle("dark", nextIsDark);
5883
+ }
5884
+ if (typeof window !== "undefined") {
5885
+ try {
5886
+ window.localStorage.setItem(STORAGE_KEYS.theme, nextIsDark ? "dark" : "light");
5887
+ } catch {
5888
+ }
5889
+ }
5890
+ };
5609
5891
  const handleSignOut = () => {
5610
5892
  session?.logout();
5611
5893
  onSignOut?.();
5612
5894
  };
5613
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(StudioSidebarEntryMotion, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5895
+ const dropdownContent = user ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
5896
+ DropdownMenuContent,
5897
+ {
5898
+ side: iconOnlyLayout ? "right" : "top",
5899
+ align: iconOnlyLayout ? "end" : "start",
5900
+ className: "w-56 z-[70]",
5901
+ children: [
5902
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DropdownMenuLabel, { className: "font-normal", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col space-y-1", children: [
5903
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "truncate text-sm font-medium leading-none text-foreground", children: user.user_name }),
5904
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "truncate text-xs leading-none text-muted-foreground", children: user.user_email })
5905
+ ] }) }),
5906
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DropdownMenuSeparator, {}),
5907
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DropdownMenuItem, { onClick: handleToggleTheme, className: "cursor-pointer", children: isDark ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
5908
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react11.Sun, { className: "mr-2 size-3.5 shrink-0 text-muted-foreground" }),
5909
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: "Light mode" })
5910
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
5911
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react11.Moon, { className: "mr-2 size-3.5 shrink-0 text-muted-foreground" }),
5912
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: "Dark mode" })
5913
+ ] }) }),
5914
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DropdownMenuSeparator, {}),
5915
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
5916
+ DropdownMenuItem,
5917
+ {
5918
+ onClick: handleSignOut,
5919
+ className: "cursor-pointer text-destructive focus:text-destructive focus:bg-destructive/10",
5920
+ children: [
5921
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react11.LogOut, { className: "mr-2 size-3.5 shrink-0" }),
5922
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: "Sign out" })
5923
+ ]
5924
+ }
5925
+ )
5926
+ ]
5927
+ }
5928
+ ) : null;
5929
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(StudioSidebarEntryMotion, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5614
5930
  "footer",
5615
5931
  {
5616
5932
  className: cn(
5617
5933
  "mt-auto w-full shrink-0 py-2.5",
5618
5934
  iconOnlyLayout ? studioSidebarCollapsedRailInsetClass : "px-2.5"
5619
5935
  ),
5620
- children: user ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-2", children: [
5621
- iconOnlyLayout ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: studioSidebarCollapsedRailChipRowClass, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Avatar, { size: "sm", className: "size-8", children: [
5622
- user.user_photo_url ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AvatarImage, { src: user.user_photo_url, alt: user.user_name }) : null,
5623
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AvatarFallback, { className: "text-[10px]", children: userInitials(user.user_name, user.user_email) })
5624
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
5625
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Avatar, { size: "sm", children: [
5626
- user.user_photo_url ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AvatarImage, { src: user.user_photo_url, alt: user.user_name }) : null,
5627
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AvatarFallback, { children: userInitials(user.user_name, user.user_email) })
5628
- ] }),
5629
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "min-w-0 flex-1", children: [
5630
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "truncate text-sm font-medium text-foreground", children: user.user_name }),
5631
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: user.user_email })
5632
- ] })
5633
- ] }),
5634
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5635
- "div",
5936
+ children: user ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(DropdownMenu, { children: [
5937
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: cn(iconOnlyLayout && studioSidebarCollapsedRailChipRowClass), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(StudioSidebarTooltip, { label: iconOnlyLayout ? user.user_name : "User menu", enabled: showTooltips, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DropdownMenuTrigger, { asChild: true, children: iconOnlyLayout ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5938
+ "button",
5636
5939
  {
5637
- className: iconOnlyLayout ? studioSidebarCollapsedRailChipRowClass : void 0,
5638
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(StudioSidebarTooltip, { label: "Sign out", enabled: showTooltips, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
5639
- "button",
5640
- {
5641
- type: "button",
5642
- onClick: handleSignOut,
5643
- className: cn(
5644
- studioSidebarNavItemClasses(iconOnlyLayout, false),
5645
- iconOnlyLayout && "inline-flex"
5646
- ),
5647
- "aria-label": "Sign out",
5648
- children: [
5649
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react10.LogOut, { className: "size-3.5 shrink-0" }),
5650
- !iconOnlyLayout ? "Sign out" : null
5651
- ]
5652
- }
5653
- ) })
5940
+ type: "button",
5941
+ className: "rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 transition-colors hover:bg-accent/50 p-0.5",
5942
+ "aria-label": "User menu",
5943
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Avatar, { size: "sm", className: "size-8", children: [
5944
+ user.user_photo_url ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AvatarImage, { src: user.user_photo_url, alt: user.user_name }) : null,
5945
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AvatarFallback, { className: "text-[10px]", children: userInitials(user.user_name, user.user_email) })
5946
+ ] })
5654
5947
  }
5655
- )
5656
- ] }) : !iconOnlyLayout && emptyCaption ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "px-1 text-xs text-muted-foreground", children: emptyCaption }) : null
5948
+ ) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
5949
+ "button",
5950
+ {
5951
+ type: "button",
5952
+ className: "flex w-full min-w-0 items-center gap-2.5 rounded-lg p-2 hover:bg-accent/50 outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors text-left",
5953
+ children: [
5954
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Avatar, { size: "sm", className: "shrink-0", children: [
5955
+ user.user_photo_url ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AvatarImage, { src: user.user_photo_url, alt: user.user_name }) : null,
5956
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AvatarFallback, { children: userInitials(user.user_name, user.user_email) })
5957
+ ] }),
5958
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "min-w-0 flex-1", children: [
5959
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "truncate text-sm font-medium text-foreground", children: user.user_name }),
5960
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: user.user_email })
5961
+ ] })
5962
+ ]
5963
+ }
5964
+ ) }) }) }),
5965
+ dropdownContent
5966
+ ] }) : !iconOnlyLayout && emptyCaption ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "px-1 text-xs text-muted-foreground", children: emptyCaption }) : null
5657
5967
  }
5658
5968
  ) });
5659
5969
  };
5660
5970
 
5661
5971
  // src/studio/sidebar/sidebar-header.tsx
5662
- var import_lucide_react11 = require("lucide-react");
5663
- var import_jsx_runtime46 = require("react/jsx-runtime");
5972
+ var import_lucide_react12 = require("lucide-react");
5973
+ var import_jsx_runtime47 = require("react/jsx-runtime");
5664
5974
  var sidebarHeaderClass = "flex h-12 shrink-0 items-center px-2";
5665
5975
  var toggleButtonClass = cn(
5666
5976
  "flex shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors",
5667
5977
  "hover:bg-muted hover:text-foreground",
5668
5978
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-foreground/15"
5669
5979
  );
5670
- var SidebarToggleButton = ({ ariaLabel, expanded, onClick, children }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5980
+ var SidebarToggleButton = ({ ariaLabel, expanded, onClick, children }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5671
5981
  "button",
5672
5982
  {
5673
5983
  type: "button",
@@ -5678,89 +5988,113 @@ var SidebarToggleButton = ({ ariaLabel, expanded, onClick, children }) => /* @__
5678
5988
  children
5679
5989
  }
5680
5990
  );
5681
- var CollapsedBrandToggle = ({
5682
- onExpand,
5683
- brand
5684
- }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: studioSidebarCollapsedRailChipRowClass, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(StudioSidebarTooltip, { label: "Expand sidebar", enabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
5685
- "button",
5686
- {
5687
- type: "button",
5688
- onClick: onExpand,
5689
- "aria-label": "Expand sidebar",
5690
- "aria-expanded": false,
5691
- className: cn(
5692
- toggleButtonClass,
5693
- "group relative inline-flex size-8 items-center justify-center overflow-hidden rounded-lg"
5694
- ),
5695
- children: [
5696
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5697
- "span",
5698
- {
5699
- "aria-hidden": true,
5700
- className: cn(
5701
- "pointer-events-none flex items-center justify-center",
5702
- "transition-[opacity,transform] duration-200 ease-out",
5703
- "group-hover:scale-90 group-hover:opacity-0"
5704
- ),
5705
- children: brand
5706
- }
5707
- ),
5708
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5709
- import_lucide_react11.ChevronRight,
5710
- {
5711
- "aria-hidden": true,
5712
- className: cn(
5713
- "pointer-events-none absolute inset-0 m-auto size-4",
5714
- "opacity-0 transition-[opacity,transform] duration-200 ease-out",
5715
- "group-hover:opacity-100"
5716
- )
5717
- }
5718
- )
5719
- ]
5991
+ var CollapsedBrandToggle = ({ onExpand, logo, fallbackToChevron }) => {
5992
+ if (fallbackToChevron || !logo) {
5993
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: studioSidebarCollapsedRailChipRowClass, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(StudioSidebarTooltip, { label: "Expand sidebar", enabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5994
+ "button",
5995
+ {
5996
+ type: "button",
5997
+ onClick: onExpand,
5998
+ "aria-label": "Expand sidebar",
5999
+ "aria-expanded": false,
6000
+ className: cn(
6001
+ toggleButtonClass,
6002
+ "group relative inline-flex size-8 items-center justify-center overflow-hidden rounded-lg"
6003
+ ),
6004
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react12.ChevronRight, { "aria-hidden": true, className: "size-4" })
6005
+ }
6006
+ ) }) });
5720
6007
  }
5721
- ) }) });
6008
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: studioSidebarCollapsedRailChipRowClass, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(StudioSidebarTooltip, { label: "Expand sidebar", enabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
6009
+ "button",
6010
+ {
6011
+ type: "button",
6012
+ onClick: onExpand,
6013
+ "aria-label": "Expand sidebar",
6014
+ "aria-expanded": false,
6015
+ className: cn(
6016
+ toggleButtonClass,
6017
+ "group relative inline-flex size-8 items-center justify-center overflow-hidden rounded-lg"
6018
+ ),
6019
+ children: [
6020
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
6021
+ "span",
6022
+ {
6023
+ "aria-hidden": true,
6024
+ className: cn(
6025
+ "pointer-events-none flex items-center justify-center",
6026
+ "transition-[opacity,transform] duration-200 ease-out",
6027
+ "group-hover:scale-90 group-hover:opacity-0"
6028
+ ),
6029
+ children: logo
6030
+ }
6031
+ ),
6032
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
6033
+ import_lucide_react12.ChevronRight,
6034
+ {
6035
+ "aria-hidden": true,
6036
+ className: cn(
6037
+ "pointer-events-none absolute inset-0 m-auto size-4",
6038
+ "opacity-0 transition-[opacity,transform] duration-200 ease-out",
6039
+ "group-hover:opacity-100"
6040
+ )
6041
+ }
6042
+ )
6043
+ ]
6044
+ }
6045
+ ) }) });
6046
+ };
5722
6047
  var StudioSidebarHeader = ({
5723
6048
  isCollapsedRail,
5724
6049
  isMobile,
5725
6050
  mobileOpen,
5726
6051
  onToggle,
5727
- brand
6052
+ brand,
6053
+ logo,
6054
+ fallbackToChevron
5728
6055
  }) => {
5729
6056
  if (isMobile) {
5730
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: cn(sidebarHeaderClass, "justify-between gap-2 pr-2"), children: [
6057
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("header", { className: cn(sidebarHeaderClass, "justify-between gap-2 pr-2"), children: [
5731
6058
  brand,
5732
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
6059
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5733
6060
  SidebarToggleButton,
5734
6061
  {
5735
6062
  ariaLabel: "Close menu",
5736
6063
  expanded: mobileOpen,
5737
6064
  onClick: onToggle,
5738
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react11.X, { className: "size-3.5" })
6065
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react12.X, { className: "size-3.5" })
5739
6066
  }
5740
6067
  )
5741
6068
  ] });
5742
6069
  }
5743
6070
  if (isCollapsedRail) {
5744
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
6071
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5745
6072
  "header",
5746
6073
  {
5747
6074
  className: cn(
5748
6075
  "flex h-12 shrink-0 items-center",
5749
6076
  studioSidebarCollapsedRailInsetClass
5750
6077
  ),
5751
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CollapsedBrandToggle, { onExpand: onToggle, brand })
6078
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
6079
+ CollapsedBrandToggle,
6080
+ {
6081
+ onExpand: onToggle,
6082
+ logo,
6083
+ fallbackToChevron
6084
+ }
6085
+ )
5752
6086
  }
5753
6087
  );
5754
6088
  }
5755
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: cn(sidebarHeaderClass, "justify-between gap-1 pr-2"), children: [
6089
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("header", { className: cn(sidebarHeaderClass, "justify-between gap-1 pr-2"), children: [
5756
6090
  brand,
5757
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
6091
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5758
6092
  SidebarToggleButton,
5759
6093
  {
5760
6094
  ariaLabel: "Collapse sidebar",
5761
6095
  expanded: true,
5762
6096
  onClick: onToggle,
5763
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react11.ChevronLeft, { className: "size-4" })
6097
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react12.ChevronLeft, { className: "size-4" })
5764
6098
  }
5765
6099
  )
5766
6100
  ] });
@@ -5779,7 +6113,7 @@ function workforceItemInitial(w) {
5779
6113
  }
5780
6114
 
5781
6115
  // src/studio/sidebar/sidebar-nav.tsx
5782
- var import_jsx_runtime47 = require("react/jsx-runtime");
6116
+ var import_jsx_runtime48 = require("react/jsx-runtime");
5783
6117
  var StudioSidebarNav = ({
5784
6118
  workforces,
5785
6119
  selectedId,
@@ -5788,7 +6122,7 @@ var StudioSidebarNav = ({
5788
6122
  showTooltips
5789
6123
  }) => {
5790
6124
  if (workforces.length === 0) return null;
5791
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
6125
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5792
6126
  "nav",
5793
6127
  {
5794
6128
  className: cn(
@@ -5800,11 +6134,11 @@ var StudioSidebarNav = ({
5800
6134
  const id = workforceItemId(w);
5801
6135
  const isActive = id === selectedId;
5802
6136
  const label = workforceItemLabel(w);
5803
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
6137
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5804
6138
  StudioSidebarEntryMotion,
5805
6139
  {
5806
6140
  className: iconOnlyLayout ? studioSidebarCollapsedRailChipRowClass : void 0,
5807
- children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(StudioSidebarTooltip, { label, enabled: showTooltips, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
6141
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(StudioSidebarTooltip, { label, enabled: showTooltips, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5808
6142
  "button",
5809
6143
  {
5810
6144
  type: "button",
@@ -5815,7 +6149,7 @@ var StudioSidebarNav = ({
5815
6149
  studioSidebarNavItemClasses(iconOnlyLayout, isActive),
5816
6150
  iconOnlyLayout && "inline-flex"
5817
6151
  ),
5818
- children: iconOnlyLayout ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-xs font-semibold leading-none", children: workforceItemInitial(w) }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "min-w-0 truncate", children: label })
6152
+ children: iconOnlyLayout ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-xs font-semibold leading-none", children: workforceItemInitial(w) }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "min-w-0 truncate", children: label })
5819
6153
  }
5820
6154
  ) })
5821
6155
  },
@@ -5828,7 +6162,7 @@ var StudioSidebarNav = ({
5828
6162
 
5829
6163
  // src/studio/sidebar/timbal-mark.tsx
5830
6164
  var import_shaders_react = require("@paper-design/shaders-react");
5831
- var import_jsx_runtime48 = require("react/jsx-runtime");
6165
+ var import_jsx_runtime49 = require("react/jsx-runtime");
5832
6166
  var DEFAULT_SIZE = 64;
5833
6167
  var TRANSPARENT_BACK = "#00000000";
5834
6168
  var TIMBAL_SYMBOL_DATA_URI = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAH6ElEQVR4Aeyci7EcNRBFFxIBIgEygUiASCATyASIBOa4rFrZntmPPq1W93218o5nZyTd26dbmnX5fX3TjxyY4IDAmmCqurzdBJYomOKAwJpiqzoVWGJgigMCa4qt6lRgZWHAWKfAMjY8y3ACK0ukjXUKLGPDswwnsLJE2linwDI2PMtwAitLpI11Cixjw+/DxT4SWLHju0ydwHrP+p/euzzE1T8cKr492lsvgfWaXZj733Hp90fL9Pr1EPvn0QTWYcLoF8bS6Pdf/kjQAAnNv7RqVcW6do4q9ffxMe/HW5oXy323boF1zkvzEnDe3RZnS5X6fcRsBdbdRY6oTl1LAJ1s2NDdXaVq3QLr7kapUph8Pxv/iESiDVUqsG63sgQ0b1Rve/6QQEOrVG1DdrCGbFRrQzc5Zh9FlSKppkw5M1gYi8FTjHXaaalSJNTUKWYEC3P5spP3qeY667zsIadVqVpvNrCoUrTag+jHgIRm0z2ka7AGRpzqNG2jOnCeo7uiSi3RnQEszCVjydzRgfPaH1rRbFqlajMig0WVWmpubbThMRvzJVWq1hgVrFKlgKvWG/2YRHLxpBsNrOVLwCJySSBXT7qRwHKxBCwAiypFWzD09ZARwCpVysUScG318E+oUsv3Uleq3gPrqpd1512bO9GWsockqSYO0971zmBR/mnt6ve7k0RC87KvEV61bEewMNftEvCq8Q3XlSqF/obbbW/ZDSz2UWSs2yVgQvjQimb3VarWvgtYZCnm8uRXzz/6MXq3rM47gLXVEjCI9FKlqNCDurTtxjNYxdytloAB4aM6r65S3TK8grXtEtAZEZZ7Wmc362/3BlapUtsuAY0hDVGlau2ewApnbm30g+OyhySpHly210dewKL80/Zyr2+2JBKaQ+4hV4OFudtvVBv4KlUK/Q23+79lJVjso8jYUEvAk5CjFc0hq1StfQVYZCnm8uRXzyX6MXqbq/Nu5liDFX4JOAGgVCkq9MnHMU9ZgVXMDb8EfIYJ1TlNlaq1W4BFlcpoLss9rfY7zfFMsFSl0mD0pdBZYKXaqFa2so+iSpFU1el8hzPAwlgMzuQmeyl0k1ARdf/zrqiRYGGuq/+C9K4Zb11/v5g9JFCh/342+dEosDCWlslOljs0Z3vSfSnGvWCRpRmf+KhSGXW/BBUX9YCFuWQsmUtfGdo3h0g0q0odRjx6tYAFSFnNZXNOlX7kqT47HGgB67jtJnNv+nnkQCtYj/rUZ3LgFggsRdOTAwLLUzQCzUVgBQqmJykCy1M0As1FYAUKpicpAstTNALNRWAFCqYnKTPB8qRTczF2QGAZG55lOIGVJdLGOgWWseFZhhNYWSJtrFNgGRueZTiBlSXSM3We9C2wTkzRqX4HBFa/h+rhxAGBdWKKTvU7ILD6PVQPJw4IrBNTdKrfAYHV76F6OHFAYJ2Ysv+p9QoE1voYhJyBwAoZ1vWiBNb6GIScgcAKGdb1ogTW+hiEnIHAChnW9aIElk0M0o0isNKF3EawwLLxOd0oAitdyN8W/Ndxx9LfmnyMH/aFuX+EVXct7Lfjox+P9vZLFeu5ZcXcf59fGuYKKhRA8Xtmm0QJrGvbqFJd5l537foTKvN3xwzRf7y1vdKC9cSuUqW6zH0yhsePSaSfR0xMYH3qYvcS8Gl32/yNBPrqmC3vx1v/S2DdPRyyBNy72+aIKkUbOuEWsPg970MnsbizUqWGLAGLtbwzPNWpey91NWALWFd97Xh+qrmODSl7SJJqyjQzg0X5p00x1mmnJBKam79GeFVXRrAwd9oS8KrxC64rVQr904f3A9Z0qR8GYB9Fxk5bAj6M4usPtKJ5epWqZWcBiyzFXJ78av3Rj9G7pDpnAMt0CXBCaqlSVOglU4oMVjHXdAlYEsVPB6U6L6lS9TSigkWVWm5ubbTRMcs9zWi462GigaUqdR1r008igbVso2oasS8HYx9FlSKpvvx00ZkHYC2aUduwGIvBbXfveRd7KXSTUO4U7A4W5g79V3l3ETqfEHtIoEL/+RWLz+4MFsbSFltoOjzLHZrdP+nuCBZZmvGJjyVvG927gVWWADLXtFQsHAytVKmt9pC7gEWVwlz3S8BgANG9TZWqte8AVqlSmFzPPfoxiUSbrnPGAJ7BKkuAqtSMyE/u0ytYW21UB8aIfRRViqQa2K19Vx7BwlgMtndj3Ygs8+gmodbNYuDInsDCXH3ZOTC4K7vyAhbZSlvphfXYLHdoDrmHXA0WVWrLx+lOCnnSDa17JViYS8aSuZ1x2uZ2tKL5cZXaRs71RFeARZVKYe5ntrMxD12lar3WYJUqBVz1PKIfk0ipnnStwEqzBHyWISRQxifdmwVYqZaACiyqFK06ledwJlilSqVaAg50qFJp9lKH3tPXLLCymlv2kCTVqeFZTs4Ai/JPC+ThUykkEprDf43w1ImPF4wEC3MzLgGlSqH/o616GwUW+ygyNtMSgFY0q0qd5FEvWGQp5vLkd9J92FPozVidXw5oD1hZlwASiQr9sskZL2wBK+sSgO6UX3a2JEYrWCyBLePtfA/L387zN517C1imE7wYTKedOyCwnAdo1+kJrF0j53zeAst5gHadnsDaNXLO5y2wnAdo1+kJrF0j53zew8ByrlPTM3ZAYBkbnmU4gZUl0sY6BZax4VmGE1hZIm2sU2AZG55lOIGVJdLDdL7W0f8AAAD//x3VUCQAAAAGSURBVAMArsj7LTb9pqMAAAAASUVORK5CYII=";
@@ -5837,14 +6171,14 @@ function TimbalMark({
5837
6171
  size = DEFAULT_SIZE,
5838
6172
  src = TIMBAL_SYMBOL_DATA_URI
5839
6173
  }) {
5840
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
6174
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
5841
6175
  "div",
5842
6176
  {
5843
6177
  className: cn("relative shrink-0 bg-transparent", className),
5844
6178
  style: { width: size, height: size },
5845
6179
  role: "img",
5846
6180
  "aria-label": "Timbal",
5847
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
6181
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
5848
6182
  import_shaders_react.LiquidMetal,
5849
6183
  {
5850
6184
  width: size,
@@ -5876,14 +6210,14 @@ function TimbalMark({
5876
6210
  }
5877
6211
 
5878
6212
  // src/studio/sidebar/shell-inset-bridge-context.tsx
5879
- var import_react41 = require("react");
6213
+ var import_react42 = require("react");
5880
6214
 
5881
6215
  // src/layout/shell-inset-context.tsx
5882
- var import_react40 = require("react");
5883
- var ShellInsetContext = (0, import_react40.createContext)(null);
6216
+ var import_react41 = require("react");
6217
+ var ShellInsetContext = (0, import_react41.createContext)(null);
5884
6218
  var ShellInsetProvider = ShellInsetContext.Provider;
5885
6219
  function useShellInsetReporter() {
5886
- return (0, import_react40.useContext)(ShellInsetContext);
6220
+ return (0, import_react41.useContext)(ShellInsetContext);
5887
6221
  }
5888
6222
 
5889
6223
  // src/studio/sidebar/shell-inset-bridge-context.tsx
@@ -5892,7 +6226,7 @@ var StudioSidebarShellInsetBridge = ({
5892
6226
  }) => {
5893
6227
  const reportInset = useShellInsetReporter();
5894
6228
  const { isMobile, isCollapsedRail } = useStudioSidebarLayout();
5895
- (0, import_react41.useLayoutEffect)(() => {
6229
+ (0, import_react42.useLayoutEffect)(() => {
5896
6230
  const insetPx = isMobile ? 0 : isCollapsedRail ? SIDEBAR_INSET_PX_COLLAPSED : SIDEBAR_INSET_PX_EXPANDED;
5897
6231
  reportInset?.(insetPx);
5898
6232
  onInsetChange?.(insetPx);
@@ -5901,7 +6235,7 @@ var StudioSidebarShellInsetBridge = ({
5901
6235
  };
5902
6236
 
5903
6237
  // src/studio/sidebar/sidebar.tsx
5904
- var import_jsx_runtime49 = require("react/jsx-runtime");
6238
+ var import_jsx_runtime50 = require("react/jsx-runtime");
5905
6239
  var DEFAULT_BREAKPOINT_PX = 768;
5906
6240
  function readPersistedCollapsed(key) {
5907
6241
  if (!key || typeof window === "undefined") return false;
@@ -5932,9 +6266,10 @@ var StudioSidebarPanel = ({
5932
6266
  onEntriesBlurOutComplete,
5933
6267
  onPanelWidthComplete,
5934
6268
  brand,
6269
+ logo,
5935
6270
  emptyCaption = null
5936
6271
  }) => {
5937
- const reducedMotion = (0, import_react43.useReducedMotion)();
6272
+ const reducedMotion = (0, import_react44.useReducedMotion)();
5938
6273
  const isCollapsedRail = widthCollapsed && !isMobile;
5939
6274
  const iconOnlyLayout = studioSidebarIconOnlyLayout(isMobile, isCollapsedRail);
5940
6275
  const isDrawerOpen = isMobile && mobileOpen;
@@ -5951,9 +6286,12 @@ var StudioSidebarPanel = ({
5951
6286
  onCollapsedChange(!collapsed);
5952
6287
  };
5953
6288
  const panelWidthPx = isMobile ? SIDEBAR_MOBILE_PX : widthCollapsed ? SIDEBAR_WIDTH_COLLAPSED_PX : SIDEBAR_WIDTH_PX;
5954
- const brandNode = brand ?? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TimbalMark, { size: 32 });
5955
- const panel = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
5956
- import_react43.motion.div,
6289
+ const isCustomBrand = brand !== void 0;
6290
+ const fallbackToChevron = isCustomBrand && !logo;
6291
+ const brandNode = brand ?? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TimbalMark, { size: 32 });
6292
+ const logoNode = logo ?? (isCustomBrand ? null : brandNode);
6293
+ const panel = /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
6294
+ import_react44.motion.div,
5957
6295
  {
5958
6296
  "data-sidebar-collapsed": isCollapsedRail ? "" : void 0,
5959
6297
  className: cn(
@@ -5967,23 +6305,25 @@ var StudioSidebarPanel = ({
5967
6305
  style: { willChange: entriesVisible ? void 0 : "width" },
5968
6306
  onAnimationComplete: isMobile || entriesVisible ? void 0 : () => onPanelWidthComplete(),
5969
6307
  children: [
5970
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
6308
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5971
6309
  StudioSidebarHeader,
5972
6310
  {
5973
6311
  isCollapsedRail,
5974
6312
  isMobile,
5975
6313
  mobileOpen,
5976
6314
  onToggle: handleToggle,
5977
- brand: brandNode
6315
+ brand: brandNode,
6316
+ logo: logoNode,
6317
+ fallbackToChevron
5978
6318
  }
5979
6319
  ),
5980
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
6320
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
5981
6321
  StudioSidebarEntries,
5982
6322
  {
5983
6323
  visible: entriesVisible,
5984
6324
  onBlurOutComplete: onEntriesBlurOutComplete,
5985
6325
  children: [
5986
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
6326
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5987
6327
  "div",
5988
6328
  {
5989
6329
  id: DOM_IDS.sidebarRuntimeAnchor,
@@ -5993,7 +6333,7 @@ var StudioSidebarPanel = ({
5993
6333
  )
5994
6334
  }
5995
6335
  ),
5996
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
6336
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5997
6337
  StudioSidebarNav,
5998
6338
  {
5999
6339
  workforces,
@@ -6003,8 +6343,8 @@ var StudioSidebarPanel = ({
6003
6343
  showTooltips: isCollapsedRail
6004
6344
  }
6005
6345
  ),
6006
- workforces.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "min-h-0 flex-1" }) : null,
6007
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
6346
+ workforces.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "min-h-0 flex-1" }) : null,
6347
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
6008
6348
  StudioSidebarFooter,
6009
6349
  {
6010
6350
  iconOnlyLayout,
@@ -6020,8 +6360,8 @@ var StudioSidebarPanel = ({
6020
6360
  }
6021
6361
  );
6022
6362
  if (isMobile) {
6023
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
6024
- import_react43.motion.aside,
6363
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
6364
+ import_react44.motion.aside,
6025
6365
  {
6026
6366
  className: "fixed inset-y-0 left-0 z-[60] flex",
6027
6367
  "aria-label": "Studio navigation",
@@ -6036,7 +6376,7 @@ var StudioSidebarPanel = ({
6036
6376
  }
6037
6377
  );
6038
6378
  }
6039
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
6379
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
6040
6380
  "aside",
6041
6381
  {
6042
6382
  className: "absolute inset-y-0 left-0 z-[60] flex py-[var(--studio-sidebar-gap)] pl-[var(--studio-sidebar-gap)]",
@@ -6053,62 +6393,75 @@ var StudioSidebar = ({
6053
6393
  persistKey = STORAGE_KEYS.sidebarCollapsed,
6054
6394
  mobileBreakpointPx = DEFAULT_BREAKPOINT_PX,
6055
6395
  brand,
6396
+ logo,
6056
6397
  emptyCaption,
6057
6398
  mobileOpen: mobileOpenProp,
6058
6399
  onMobileOpenChange: onMobileOpenChangeProp,
6059
6400
  onInsetChange
6060
6401
  }) => {
6061
- const reducedMotion = (0, import_react43.useReducedMotion)();
6402
+ const reducedMotion = (0, import_react44.useReducedMotion)();
6062
6403
  const fetched = useWorkforces({ enabled: workforcesProp === void 0 });
6063
6404
  const workforces = workforcesProp ?? fetched.workforces;
6064
- const [internalSelected, setInternalSelected] = (0, import_react42.useState)(
6405
+ const [internalSelected, setInternalSelected] = (0, import_react43.useState)(
6065
6406
  selectedIdProp ?? ""
6066
6407
  );
6067
- (0, import_react42.useEffect)(() => {
6408
+ (0, import_react43.useEffect)(() => {
6068
6409
  if (selectedIdProp !== void 0) return;
6069
6410
  if (internalSelected) return;
6070
6411
  const first = workforces[0]?.id ?? workforces[0]?.uid ?? workforces[0]?.name;
6071
6412
  if (first) setInternalSelected(first);
6072
6413
  }, [workforces, selectedIdProp, internalSelected]);
6073
6414
  const selectedId = selectedIdProp ?? internalSelected ?? workforces[0]?.id ?? workforces[0]?.uid ?? workforces[0]?.name ?? "";
6074
- const handleSelect = (0, import_react42.useCallback)(
6075
- (id) => {
6076
- if (selectedIdProp === void 0) setInternalSelected(id);
6077
- onSelect?.(id);
6078
- },
6079
- [selectedIdProp, onSelect]
6080
- );
6081
- const [collapsed, setCollapsed] = (0, import_react42.useState)(() => {
6415
+ const [collapsed, setCollapsed] = (0, import_react43.useState)(() => {
6082
6416
  const persisted = readPersistedCollapsed(persistKey);
6083
6417
  return persisted || defaultCollapsed;
6084
6418
  });
6085
- const handleCollapsedChange = (0, import_react42.useCallback)(
6419
+ const handleCollapsedChange = (0, import_react43.useCallback)(
6086
6420
  (next) => {
6087
6421
  setCollapsed(next);
6088
6422
  writePersistedCollapsed(persistKey, next);
6089
6423
  },
6090
6424
  [persistKey]
6091
6425
  );
6092
- const [isMobile, setIsMobile] = (0, import_react42.useState)(() => {
6426
+ const [isMobile, setIsMobile] = (0, import_react43.useState)(() => {
6093
6427
  if (typeof window === "undefined") return false;
6094
6428
  return window.innerWidth < mobileBreakpointPx;
6095
6429
  });
6096
- (0, import_react42.useEffect)(() => {
6430
+ (0, import_react43.useEffect)(() => {
6097
6431
  if (typeof window === "undefined") return;
6098
6432
  const onResize = () => setIsMobile(window.innerWidth < mobileBreakpointPx);
6099
6433
  onResize();
6100
6434
  window.addEventListener("resize", onResize);
6101
6435
  return () => window.removeEventListener("resize", onResize);
6102
6436
  }, [mobileBreakpointPx]);
6103
- const [internalMobileOpen, setInternalMobileOpen] = (0, import_react42.useState)(false);
6437
+ const [internalMobileOpen, setInternalMobileOpen] = (0, import_react43.useState)(false);
6104
6438
  const mobileOpen = mobileOpenProp ?? internalMobileOpen;
6105
- const setMobileOpen = (0, import_react42.useCallback)(
6439
+ const setMobileOpen = (0, import_react43.useCallback)(
6106
6440
  (next) => {
6107
6441
  if (mobileOpenProp === void 0) setInternalMobileOpen(next);
6108
6442
  onMobileOpenChangeProp?.(next);
6109
6443
  },
6110
6444
  [mobileOpenProp, onMobileOpenChangeProp]
6111
6445
  );
6446
+ const handleSelect = (0, import_react43.useCallback)(
6447
+ (id) => {
6448
+ if (selectedIdProp === void 0) setInternalSelected(id);
6449
+ onSelect?.(id);
6450
+ if (isMobile) setMobileOpen(false);
6451
+ },
6452
+ [selectedIdProp, onSelect, isMobile, setMobileOpen]
6453
+ );
6454
+ (0, import_react43.useEffect)(() => {
6455
+ if (!isMobile && mobileOpen) setMobileOpen(false);
6456
+ }, [isMobile, mobileOpen, setMobileOpen]);
6457
+ (0, import_react43.useEffect)(() => {
6458
+ if (!isMobile || !mobileOpen) return;
6459
+ const onKeyDown = (e) => {
6460
+ if (e.key === "Escape") setMobileOpen(false);
6461
+ };
6462
+ window.addEventListener("keydown", onKeyDown);
6463
+ return () => window.removeEventListener("keydown", onKeyDown);
6464
+ }, [isMobile, mobileOpen, setMobileOpen]);
6112
6465
  const effectiveCollapsed = isMobile ? false : collapsed;
6113
6466
  const {
6114
6467
  widthCollapsed,
@@ -6119,18 +6472,19 @@ var StudioSidebar = ({
6119
6472
  const entriesVisible = isMobile || phaseEntriesVisible;
6120
6473
  const isCollapsedRail = widthCollapsed && !isMobile;
6121
6474
  const iconOnlyLayout = studioSidebarIconOnlyLayout(isMobile, isCollapsedRail);
6122
- const contextValue = (0, import_react42.useMemo)(
6475
+ const contextValue = (0, import_react43.useMemo)(
6123
6476
  () => ({
6124
6477
  collapsed: effectiveCollapsed,
6125
6478
  isMobile,
6126
6479
  isCollapsedRail,
6127
- iconOnlyLayout
6480
+ iconOnlyLayout,
6481
+ closeMobile: () => setMobileOpen(false)
6128
6482
  }),
6129
- [effectiveCollapsed, isMobile, isCollapsedRail, iconOnlyLayout]
6483
+ [effectiveCollapsed, isMobile, isCollapsedRail, iconOnlyLayout, setMobileOpen]
6130
6484
  );
6131
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(StudioSidebarContext.Provider, { value: contextValue, children: [
6132
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(StudioSidebarShellInsetBridge, { onInsetChange }),
6133
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
6485
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(StudioSidebarContext.Provider, { value: contextValue, children: [
6486
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(StudioSidebarShellInsetBridge, { onInsetChange }),
6487
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
6134
6488
  StudioSidebarPanel,
6135
6489
  {
6136
6490
  workforces,
@@ -6146,6 +6500,7 @@ var StudioSidebar = ({
6146
6500
  onEntriesBlurOutComplete,
6147
6501
  onPanelWidthComplete,
6148
6502
  brand,
6503
+ logo,
6149
6504
  emptyCaption
6150
6505
  }
6151
6506
  )
@@ -6153,26 +6508,27 @@ var StudioSidebar = ({
6153
6508
  };
6154
6509
 
6155
6510
  // src/studio/sidebar/sidebar-runtime-portal.tsx
6156
- var import_react44 = require("react");
6511
+ var import_react45 = require("react");
6157
6512
  var import_react_dom = require("react-dom");
6158
- var import_lucide_react12 = require("lucide-react");
6159
- var import_react45 = require("@assistant-ui/react");
6160
- var import_jsx_runtime50 = require("react/jsx-runtime");
6513
+ var import_lucide_react13 = require("lucide-react");
6514
+ var import_react46 = require("@assistant-ui/react");
6515
+ var import_jsx_runtime51 = require("react/jsx-runtime");
6161
6516
  var StudioSidebarRuntimePortal = ({
6162
6517
  label = "New chat"
6163
6518
  }) => {
6164
- const { iconOnlyLayout } = useStudioSidebarLayout();
6165
- const hasMessages = (0, import_react45.useThread)((s) => s.messages.length > 0);
6519
+ const { iconOnlyLayout, isMobile, closeMobile } = useStudioSidebarLayout();
6520
+ const hasMessages = (0, import_react46.useThread)((s) => s.messages.length > 0);
6166
6521
  const { clear } = useTimbalRuntime();
6167
- const [anchor, setAnchor] = (0, import_react44.useState)(null);
6168
- const startNewChat = (0, import_react44.useCallback)(() => {
6522
+ const [anchor, setAnchor] = (0, import_react45.useState)(null);
6523
+ const startNewChat = (0, import_react45.useCallback)(() => {
6169
6524
  clear();
6170
- }, [clear]);
6171
- (0, import_react44.useLayoutEffect)(() => {
6525
+ if (isMobile) closeMobile?.();
6526
+ }, [clear, isMobile, closeMobile]);
6527
+ (0, import_react45.useLayoutEffect)(() => {
6172
6528
  setAnchor(document.getElementById(DOM_IDS.sidebarRuntimeAnchor));
6173
6529
  }, []);
6174
6530
  if (!anchor || !hasMessages) return null;
6175
- const button = /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
6531
+ const button = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
6176
6532
  "button",
6177
6533
  {
6178
6534
  type: "button",
@@ -6180,24 +6536,24 @@ var StudioSidebarRuntimePortal = ({
6180
6536
  "aria-label": label,
6181
6537
  className: studioSidebarNavItemClasses(iconOnlyLayout, false),
6182
6538
  children: [
6183
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react12.MessageSquarePlus, { className: "size-3.5 shrink-0" }),
6184
- !iconOnlyLayout ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "min-w-0 truncate", children: label }) : null
6539
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react13.MessageSquarePlus, { className: "size-3.5 shrink-0" }),
6540
+ !iconOnlyLayout ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "min-w-0 truncate", children: label }) : null
6185
6541
  ]
6186
6542
  }
6187
6543
  );
6188
6544
  return (0, import_react_dom.createPortal)(
6189
- iconOnlyLayout ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Tooltip, { children: [
6190
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TooltipTrigger, { asChild: true, children: button }),
6191
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TooltipContent, { side: "right", className: "text-xs", children: label })
6545
+ iconOnlyLayout ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Tooltip, { children: [
6546
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipTrigger, { asChild: true, children: button }),
6547
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipContent, { side: "right", className: "text-xs", children: label })
6192
6548
  ] }) : button,
6193
6549
  anchor
6194
6550
  );
6195
6551
  };
6196
6552
 
6197
6553
  // src/studio/sidebar/welcome.tsx
6198
- var import_react46 = require("motion/react");
6199
- var import_react47 = require("@assistant-ui/react");
6200
- var import_jsx_runtime51 = require("react/jsx-runtime");
6554
+ var import_react47 = require("motion/react");
6555
+ var import_react48 = require("@assistant-ui/react");
6556
+ var import_jsx_runtime52 = require("react/jsx-runtime");
6201
6557
  var welcomeStagger2 = {
6202
6558
  initial: {},
6203
6559
  animate: {
@@ -6222,34 +6578,34 @@ var welcomeIcon2 = {
6222
6578
  }
6223
6579
  };
6224
6580
  var StudioWelcome = ({ config, icon }) => {
6225
- const isEmpty = (0, import_react47.useThread)((s) => s.messages.length === 0);
6581
+ const isEmpty = (0, import_react48.useThread)((s) => s.messages.length === 0);
6226
6582
  if (!isEmpty) return null;
6227
- const iconNode = icon ?? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
6583
+ const iconNode = icon ?? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6228
6584
  TimbalMark,
6229
6585
  {
6230
6586
  size: 112,
6231
6587
  className: "max-md:scale-[0.58] max-md:origin-center"
6232
6588
  }
6233
6589
  );
6234
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "aui-thread-welcome-root mx-auto my-auto flex w-full max-w-(--thread-max-width) grow flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "aui-thread-welcome-center flex w-full grow flex-col items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
6235
- import_react46.motion.div,
6590
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "aui-thread-welcome-root mx-auto my-auto flex w-full max-w-(--thread-max-width) grow flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "aui-thread-welcome-center flex w-full grow flex-col items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
6591
+ import_react47.motion.div,
6236
6592
  {
6237
6593
  className: "aui-thread-welcome-message flex flex-col items-center justify-center px-2 text-center sm:px-4",
6238
6594
  variants: welcomeStagger2,
6239
6595
  initial: "initial",
6240
6596
  animate: "animate",
6241
6597
  children: [
6242
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react46.motion.div, { variants: welcomeIcon2, className: "mb-4 md:mb-5", children: iconNode }),
6243
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
6244
- import_react46.motion.h1,
6598
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react47.motion.div, { variants: welcomeIcon2, className: "mb-4 md:mb-5", children: iconNode }),
6599
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6600
+ import_react47.motion.h1,
6245
6601
  {
6246
6602
  variants: welcomeItem2,
6247
6603
  className: "aui-thread-welcome-message-inner text-xl font-semibold sm:text-2xl",
6248
6604
  children: config?.heading ?? "How can I help you today?"
6249
6605
  }
6250
6606
  ),
6251
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
6252
- import_react46.motion.p,
6607
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6608
+ import_react47.motion.p,
6253
6609
  {
6254
6610
  variants: welcomeItem2,
6255
6611
  className: "aui-thread-welcome-message-inner mt-2 text-muted-foreground",
@@ -6262,8 +6618,8 @@ var StudioWelcome = ({ config, icon }) => {
6262
6618
  };
6263
6619
 
6264
6620
  // src/studio/shell/studio-shell.tsx
6265
- var import_jsx_runtime52 = require("react/jsx-runtime");
6266
- var import_react50 = require("react");
6621
+ var import_jsx_runtime53 = require("react/jsx-runtime");
6622
+ var import_react51 = require("react");
6267
6623
  var DEFAULT_BREAKPOINT_PX2 = 768;
6268
6624
  function readPersistedCollapsed2(key) {
6269
6625
  if (!key || typeof window === "undefined") return false;
@@ -6283,9 +6639,9 @@ function writePersistedCollapsed2(key, collapsed) {
6283
6639
  function makeComposerWithPortal(BaseComposer) {
6284
6640
  const Resolved = BaseComposer ?? Composer;
6285
6641
  return function StudioComposerWithSidebar(props) {
6286
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
6287
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StudioSidebarRuntimePortal, {}),
6288
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Resolved, { ...props })
6642
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
6643
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(StudioSidebarRuntimePortal, {}),
6644
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Resolved, { ...props })
6289
6645
  ] });
6290
6646
  };
6291
6647
  }
@@ -6295,6 +6651,7 @@ var TimbalStudioShell = ({
6295
6651
  workforcesFetch,
6296
6652
  workforcesBaseUrl,
6297
6653
  brand,
6654
+ logo,
6298
6655
  headerActions,
6299
6656
  headerStart,
6300
6657
  defaultCollapsed = false,
@@ -6305,7 +6662,7 @@ var TimbalStudioShell = ({
6305
6662
  components,
6306
6663
  ...chatProps
6307
6664
  }) => {
6308
- const reducedMotion = (0, import_react49.useReducedMotion)();
6665
+ const reducedMotion = (0, import_react50.useReducedMotion)();
6309
6666
  const shouldFetchWorkforces = !workforceId && workforcesProp === void 0;
6310
6667
  const fetched = useWorkforces({
6311
6668
  enabled: shouldFetchWorkforces,
@@ -6313,36 +6670,36 @@ var TimbalStudioShell = ({
6313
6670
  baseUrl: workforcesBaseUrl
6314
6671
  });
6315
6672
  const workforces = workforcesProp ?? fetched.workforces;
6316
- const [internalSelected, setInternalSelected] = (0, import_react48.useState)(
6673
+ const [internalSelected, setInternalSelected] = (0, import_react49.useState)(
6317
6674
  workforceId ?? ""
6318
6675
  );
6319
- (0, import_react48.useEffect)(() => {
6676
+ (0, import_react49.useEffect)(() => {
6320
6677
  if (workforceId) return;
6321
6678
  if (internalSelected) return;
6322
6679
  const first = workforces[0]?.id ?? workforces[0]?.uid ?? workforces[0]?.name;
6323
6680
  if (first) setInternalSelected(first);
6324
6681
  }, [workforces, workforceId, internalSelected]);
6325
6682
  const activeWorkforceId = workforceId ?? internalSelected ?? fetched.selectedId ?? "";
6326
- const [collapsed, setCollapsed] = (0, import_react48.useState)(() => {
6683
+ const [collapsed, setCollapsed] = (0, import_react49.useState)(() => {
6327
6684
  const persisted = readPersistedCollapsed2(persistKey);
6328
6685
  return persisted || defaultCollapsed;
6329
6686
  });
6330
- const [isMobile, setIsMobile] = (0, import_react48.useState)(() => {
6687
+ const [isMobile, setIsMobile] = (0, import_react49.useState)(() => {
6331
6688
  if (typeof window === "undefined") return false;
6332
6689
  return window.innerWidth < mobileBreakpointPx;
6333
6690
  });
6334
- const [mobileSidebarOpen, setMobileSidebarOpen] = (0, import_react48.useState)(false);
6335
- (0, import_react48.useEffect)(() => {
6691
+ const [mobileSidebarOpen, setMobileSidebarOpen] = (0, import_react49.useState)(false);
6692
+ (0, import_react49.useEffect)(() => {
6336
6693
  if (typeof window === "undefined") return;
6337
6694
  const onResize = () => setIsMobile(window.innerWidth < mobileBreakpointPx);
6338
6695
  onResize();
6339
6696
  window.addEventListener("resize", onResize);
6340
6697
  return () => window.removeEventListener("resize", onResize);
6341
6698
  }, [mobileBreakpointPx]);
6342
- (0, import_react48.useEffect)(() => {
6699
+ (0, import_react49.useEffect)(() => {
6343
6700
  if (!isMobile) setMobileSidebarOpen(false);
6344
6701
  }, [isMobile]);
6345
- (0, import_react48.useEffect)(() => {
6702
+ (0, import_react49.useEffect)(() => {
6346
6703
  if (!mobileSidebarOpen) return;
6347
6704
  const onKeyDown = (e) => {
6348
6705
  if (e.key === "Escape") setMobileSidebarOpen(false);
@@ -6366,35 +6723,36 @@ var TimbalStudioShell = ({
6366
6723
  layoutDirection
6367
6724
  );
6368
6725
  const desktopInsetPx = widthCollapsed ? SIDEBAR_INSET_PX_COLLAPSED : SIDEBAR_INSET_PX_EXPANDED;
6369
- const onCollapsedChange = (0, import_react48.useCallback)(
6726
+ const onCollapsedChange = (0, import_react49.useCallback)(
6370
6727
  (next) => {
6371
6728
  setCollapsed(next);
6372
6729
  writePersistedCollapsed2(persistKey, next);
6373
6730
  },
6374
6731
  [persistKey]
6375
6732
  );
6376
- const handleSelectWorkforce = (0, import_react48.useCallback)(
6733
+ const handleSelectWorkforce = (0, import_react49.useCallback)(
6377
6734
  (id) => {
6378
6735
  if (!workforceId) setInternalSelected(id);
6379
6736
  if (isMobile) setMobileSidebarOpen(false);
6380
6737
  },
6381
6738
  [workforceId, isMobile]
6382
6739
  );
6383
- const sidebarContext = (0, import_react48.useMemo)(
6740
+ const sidebarContext = (0, import_react49.useMemo)(
6384
6741
  () => ({
6385
6742
  collapsed: effectiveCollapsed,
6386
6743
  isMobile,
6387
6744
  isCollapsedRail,
6388
- iconOnlyLayout
6745
+ iconOnlyLayout,
6746
+ closeMobile: () => setMobileSidebarOpen(false)
6389
6747
  }),
6390
6748
  [effectiveCollapsed, isMobile, isCollapsedRail, iconOnlyLayout]
6391
6749
  );
6392
- const resolvedComponents = (0, import_react48.useMemo)(() => {
6750
+ const resolvedComponents = (0, import_react49.useMemo)(() => {
6393
6751
  const next = { Welcome: StudioWelcome, ...components };
6394
6752
  next.Composer = makeComposerWithPortal(components?.Composer);
6395
6753
  return next;
6396
6754
  }, [components]);
6397
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StudioSidebarContext.Provider, { value: sidebarContext, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
6755
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(StudioSidebarContext.Provider, { value: sidebarContext, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
6398
6756
  "div",
6399
6757
  {
6400
6758
  className: cn(
@@ -6403,14 +6761,14 @@ var TimbalStudioShell = ({
6403
6761
  ),
6404
6762
  style: studioChromeShellStyle,
6405
6763
  children: [
6406
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6764
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6407
6765
  "div",
6408
6766
  {
6409
6767
  className: "pointer-events-none absolute inset-0 z-0 bg-background",
6410
6768
  "aria-hidden": true
6411
6769
  }
6412
6770
  ),
6413
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6771
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6414
6772
  "div",
6415
6773
  {
6416
6774
  className: cn(
@@ -6420,14 +6778,14 @@ var TimbalStudioShell = ({
6420
6778
  "aria-hidden": true
6421
6779
  }
6422
6780
  ),
6423
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6781
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6424
6782
  StudioSidebarBackdrop,
6425
6783
  {
6426
6784
  open: isMobile && mobileSidebarOpen,
6427
6785
  onClose: () => setMobileSidebarOpen(false)
6428
6786
  }
6429
6787
  ),
6430
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6788
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6431
6789
  StudioSidebarPanel,
6432
6790
  {
6433
6791
  workforces,
@@ -6443,11 +6801,12 @@ var TimbalStudioShell = ({
6443
6801
  onEntriesBlurOutComplete,
6444
6802
  onPanelWidthComplete,
6445
6803
  brand,
6804
+ logo,
6446
6805
  emptyCaption: sidebarEmptyCaption
6447
6806
  }
6448
6807
  ),
6449
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
6450
- import_react49.motion.header,
6808
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
6809
+ import_react50.motion.header,
6451
6810
  {
6452
6811
  className: cn(
6453
6812
  "absolute top-0 right-0 z-40 flex items-start justify-between gap-2",
@@ -6458,7 +6817,7 @@ var TimbalStudioShell = ({
6458
6817
  animate: { left: isMobile ? 0 : desktopInsetPx },
6459
6818
  transition: layoutTransition,
6460
6819
  children: [
6461
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
6820
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
6462
6821
  "div",
6463
6822
  {
6464
6823
  className: cn(
@@ -6466,7 +6825,7 @@ var TimbalStudioShell = ({
6466
6825
  studioTopbarPillHeightClass
6467
6826
  ),
6468
6827
  children: [
6469
- isMobile && !mobileSidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6828
+ isMobile && !mobileSidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6470
6829
  TimbalV2Button,
6471
6830
  {
6472
6831
  variant: "secondary",
@@ -6476,19 +6835,19 @@ var TimbalStudioShell = ({
6476
6835
  onClick: () => setMobileSidebarOpen(true),
6477
6836
  "aria-label": "Open menu",
6478
6837
  "aria-expanded": false,
6479
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react13.Menu, { className: "size-4" })
6838
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react14.Menu, { className: "size-4" })
6480
6839
  }
6481
6840
  ) : null,
6482
6841
  headerStart
6483
6842
  ]
6484
6843
  }
6485
6844
  ),
6486
- headerActions ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex shrink-0 items-center gap-1", children: headerActions }) : null
6845
+ headerActions ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex shrink-0 items-center gap-1", children: headerActions }) : null
6487
6846
  ]
6488
6847
  }
6489
6848
  ),
6490
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6491
- import_react49.motion.main,
6849
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6850
+ import_react50.motion.main,
6492
6851
  {
6493
6852
  className: cn(
6494
6853
  "relative z-10 flex h-full min-w-0 flex-col",
@@ -6498,7 +6857,7 @@ var TimbalStudioShell = ({
6498
6857
  initial: false,
6499
6858
  animate: { paddingLeft: isMobile ? 12 : desktopInsetPx },
6500
6859
  transition: layoutTransition,
6501
- children: activeWorkforceId ? /* @__PURE__ */ (0, import_react50.createElement)(
6860
+ children: activeWorkforceId ? /* @__PURE__ */ (0, import_react51.createElement)(
6502
6861
  TimbalChat,
6503
6862
  {
6504
6863
  ...chatProps,
@@ -6517,9 +6876,9 @@ var TimbalStudioShell = ({
6517
6876
  };
6518
6877
 
6519
6878
  // src/studio/sidebar/mode-toggle.tsx
6520
- var import_react51 = require("react");
6521
- var import_lucide_react14 = require("lucide-react");
6522
- var import_jsx_runtime53 = require("react/jsx-runtime");
6879
+ var import_react52 = require("react");
6880
+ var import_lucide_react15 = require("lucide-react");
6881
+ var import_jsx_runtime54 = require("react/jsx-runtime");
6523
6882
  function readStoredTheme() {
6524
6883
  if (typeof window === "undefined") return null;
6525
6884
  try {
@@ -6547,8 +6906,8 @@ var ModeToggle = ({
6547
6906
  label = "Toggle theme"
6548
6907
  }) => {
6549
6908
  const isControlled = theme !== void 0;
6550
- const [internalIsDark, setInternalIsDark] = (0, import_react51.useState)(false);
6551
- (0, import_react51.useLayoutEffect)(() => {
6909
+ const [internalIsDark, setInternalIsDark] = (0, import_react52.useState)(false);
6910
+ (0, import_react52.useLayoutEffect)(() => {
6552
6911
  if (isControlled) return;
6553
6912
  const stored = readStoredTheme();
6554
6913
  if (stored) {
@@ -6560,7 +6919,7 @@ var ModeToggle = ({
6560
6919
  setInternalIsDark(document.documentElement.classList.contains("dark"));
6561
6920
  }, [isControlled]);
6562
6921
  const isDark = isControlled ? theme === "dark" : internalIsDark;
6563
- const onClick = (0, import_react51.useCallback)(() => {
6922
+ const onClick = (0, import_react52.useCallback)(() => {
6564
6923
  const next = isDark ? "light" : "dark";
6565
6924
  if (setTheme) {
6566
6925
  setTheme(next);
@@ -6571,7 +6930,7 @@ var ModeToggle = ({
6571
6930
  writeStoredTheme(isDarkNext ? "dark" : "light");
6572
6931
  setInternalIsDark(isDarkNext);
6573
6932
  }, [isDark, setTheme]);
6574
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
6933
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
6575
6934
  TimbalV2Button,
6576
6935
  {
6577
6936
  variant: "secondary",
@@ -6587,20 +6946,20 @@ var ModeToggle = ({
6587
6946
  "aria-label": label,
6588
6947
  title: label,
6589
6948
  children: [
6590
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react14.Sun, { className: "size-3.5 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" }),
6591
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react14.Moon, { className: "absolute size-3.5 scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" }),
6592
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "sr-only", children: label })
6949
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react15.Sun, { className: "size-3.5 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" }),
6950
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react15.Moon, { className: "absolute size-3.5 scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" }),
6951
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "sr-only", children: label })
6593
6952
  ]
6594
6953
  }
6595
6954
  );
6596
6955
  };
6597
6956
 
6598
6957
  // src/studio/mode-switch.tsx
6599
- var import_react54 = require("react");
6958
+ var import_react55 = require("react");
6600
6959
 
6601
6960
  // src/ui/pill-segmented-tabs.tsx
6602
- var import_react52 = require("react");
6603
- var import_react53 = require("motion/react");
6961
+ var import_react53 = require("react");
6962
+ var import_react54 = require("motion/react");
6604
6963
 
6605
6964
  // src/design/pill-segmented-classes.ts
6606
6965
  var pillSegmentedTrackBase = "inline-flex w-fit max-w-max shrink-0 self-start items-center rounded-full";
@@ -6633,7 +6992,7 @@ var pillSegmentedActiveIndicatorClass = cn(
6633
6992
  );
6634
6993
 
6635
6994
  // src/ui/pill-segmented-tabs.tsx
6636
- var import_jsx_runtime54 = require("react/jsx-runtime");
6995
+ var import_jsx_runtime55 = require("react/jsx-runtime");
6637
6996
  var PillTab = ({
6638
6997
  tabKey,
6639
6998
  label,
@@ -6644,10 +7003,10 @@ var PillTab = ({
6644
7003
  segmentClassName,
6645
7004
  animateIndicator
6646
7005
  }) => {
6647
- const handlePress = (0, import_react52.useCallback)(() => {
7006
+ const handlePress = (0, import_react53.useCallback)(() => {
6648
7007
  if (!disabled) onSelect(tabKey);
6649
7008
  }, [disabled, onSelect, tabKey]);
6650
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
7009
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
6651
7010
  "button",
6652
7011
  {
6653
7012
  type: "button",
@@ -6660,15 +7019,15 @@ var PillTab = ({
6660
7019
  !disabled && (isActive ? "text-foreground" : "text-muted-foreground hover:text-foreground")
6661
7020
  ),
6662
7021
  children: [
6663
- isActive && animateIndicator ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
6664
- import_react53.motion.div,
7022
+ isActive && animateIndicator ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7023
+ import_react54.motion.div,
6665
7024
  {
6666
7025
  layoutId,
6667
7026
  className: pillSegmentedActiveIndicatorClass,
6668
7027
  transition: { type: "spring", duration: 0.3, bounce: 0.15 }
6669
7028
  }
6670
- ) : isActive ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: pillSegmentedActiveIndicatorClass, "aria-hidden": true }) : null,
6671
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "relative z-10 whitespace-nowrap", children: label })
7029
+ ) : isActive ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: pillSegmentedActiveIndicatorClass, "aria-hidden": true }) : null,
7030
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "relative z-10 whitespace-nowrap", children: label })
6672
7031
  ]
6673
7032
  }
6674
7033
  );
@@ -6682,13 +7041,13 @@ var PillSegmentedTabs = ({
6682
7041
  layoutId: layoutIdProp,
6683
7042
  "aria-label": ariaLabel
6684
7043
  }) => {
6685
- const reactId = (0, import_react52.useId)();
7044
+ const reactId = (0, import_react53.useId)();
6686
7045
  const layoutId = layoutIdProp ?? `pill-segmented-${reactId.replace(/:/g, "")}`;
6687
- const reducedMotion = (0, import_react53.useReducedMotion)();
7046
+ const reducedMotion = (0, import_react54.useReducedMotion)();
6688
7047
  const isFlush = trackVariant === "flush";
6689
7048
  const trackClass = isFlush ? pillSegmentedTrackFlushClass : pillSegmentedTrackClass;
6690
7049
  const segmentClassName = isFlush ? pillSegmentedFlushSegmentClass : pillSegmentedSegmentClass;
6691
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { role: "group", "aria-label": ariaLabel, className: cn(trackClass, className), children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
7050
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { role: "group", "aria-label": ariaLabel, className: cn(trackClass, className), children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
6692
7051
  PillTab,
6693
7052
  {
6694
7053
  tabKey: tab.key,
@@ -6703,15 +7062,15 @@ var PillSegmentedTabs = ({
6703
7062
  tab.key
6704
7063
  )) });
6705
7064
  };
6706
- var MemoPillSegmentedTabs = (0, import_react52.memo)(PillSegmentedTabs);
7065
+ var MemoPillSegmentedTabs = (0, import_react53.memo)(PillSegmentedTabs);
6707
7066
 
6708
7067
  // src/studio/mode-switch.tsx
6709
- var import_jsx_runtime55 = require("react/jsx-runtime");
7068
+ var import_jsx_runtime56 = require("react/jsx-runtime");
6710
7069
  var STUDIO_NAV_MODE = {
6711
7070
  BUILD: "build",
6712
7071
  OPERATE: "operate"
6713
7072
  };
6714
- var StudioModeSwitch = (0, import_react54.memo)(
7073
+ var StudioModeSwitch = (0, import_react55.memo)(
6715
7074
  function StudioModeSwitch2({
6716
7075
  value,
6717
7076
  onChange,
@@ -6720,14 +7079,14 @@ var StudioModeSwitch = (0, import_react54.memo)(
6720
7079
  manageLabel = "Manage",
6721
7080
  "aria-label": ariaLabel = "Studio mode"
6722
7081
  }) {
6723
- const tabs = (0, import_react54.useMemo)(
7082
+ const tabs = (0, import_react55.useMemo)(
6724
7083
  () => [
6725
7084
  { key: STUDIO_NAV_MODE.BUILD, label: buildLabel },
6726
7085
  { key: STUDIO_NAV_MODE.OPERATE, label: manageLabel }
6727
7086
  ],
6728
7087
  [buildLabel, manageLabel]
6729
7088
  );
6730
- const handleChange = (0, import_react54.useCallback)(
7089
+ const handleChange = (0, import_react55.useCallback)(
6731
7090
  (key) => {
6732
7091
  if (key === STUDIO_NAV_MODE.BUILD || key === STUDIO_NAV_MODE.OPERATE) {
6733
7092
  onChange(key);
@@ -6735,14 +7094,14 @@ var StudioModeSwitch = (0, import_react54.memo)(
6735
7094
  },
6736
7095
  [onChange]
6737
7096
  );
6738
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7097
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6739
7098
  "div",
6740
7099
  {
6741
7100
  "data-tour": "studio-mode-switch",
6742
7101
  "data-studio-chrome-align": "mode-switch",
6743
7102
  id: "studio-chrome-mode-switch",
6744
7103
  className,
6745
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7104
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6746
7105
  PillSegmentedTabs,
6747
7106
  {
6748
7107
  value,