@trops/dash-core 0.1.635 → 0.1.637

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -2633,11 +2633,22 @@ var ThemeWrapper = function ThemeWrapper(_ref) {
2633
2633
  written.push(name);
2634
2634
  }
2635
2635
  }
2636
+ // Expose the active light/dark variant as a data attribute so the
2637
+ // design system (dash-electron's design.css `[data-mode="light"]`
2638
+ // block) can flip its surface/text tokens to match. Nothing else
2639
+ // keys off this today, so it's purely additive.
2640
+ var prevMode = root.getAttribute("data-mode");
2641
+ root.setAttribute("data-mode", themeVariant);
2636
2642
  return function () {
2637
2643
  for (var _i2 = 0, _written = written; _i2 < _written.length; _i2++) {
2638
2644
  var _name = _written[_i2];
2639
2645
  root.style.removeProperty(_name);
2640
2646
  }
2647
+ if (prevMode === null) {
2648
+ root.removeAttribute("data-mode");
2649
+ } else {
2650
+ root.setAttribute("data-mode", prevMode);
2651
+ }
2641
2652
  };
2642
2653
  }, [chosenTheme, themeVariant]);
2643
2654
 
@@ -26929,7 +26940,7 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
26929
26940
  })
26930
26941
  }) : useGridLayout ? scrollable ? /*#__PURE__*/jsx("div", {
26931
26942
  id: "grid-container-".concat(id),
26932
- className: "grid w-full min-h-24 p-3 ".concat(item.grid.gap || "gap-2"),
26943
+ className: "dr-grid ".concat(!item.grid.gap || item.grid.gap === "gap-2" ? "dr-grid-gap" : "", " grid w-full min-h-24 p-3 ").concat(item.grid.gap || "gap-2"),
26933
26944
  style: {
26934
26945
  gridTemplateRows: getRowTemplate(item.grid),
26935
26946
  gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
@@ -26940,7 +26951,7 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
26940
26951
  className: "relative w-full ".concat(height, " min-h-24"),
26941
26952
  children: /*#__PURE__*/jsx("div", {
26942
26953
  id: "grid-container-".concat(id),
26943
- className: "absolute inset-0 grid p-3 ".concat(item.grid.gap || "gap-2"),
26954
+ className: "dr-grid ".concat(!item.grid.gap || item.grid.gap === "gap-2" ? "dr-grid-gap" : "", " absolute inset-0 grid p-3 ").concat(item.grid.gap || "gap-2"),
26944
26955
  style: {
26945
26956
  gridTemplateRows: hasExplicitRowModes() ? getRowTemplate(item.grid) : "repeat(".concat(item.grid.rows, ", minmax(0, 1fr))"),
26946
26957
  gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
@@ -29611,6 +29622,21 @@ var ThemeModel = function ThemeModel() {
29611
29622
  cssVarsAll["--".concat(type, "-").concat(shade)] = hex;
29612
29623
  }
29613
29624
  }
29625
+ } else {
29626
+ // Named channel (e.g. "blue"): emit the shade-500 (brand) hex so
29627
+ // the design system's accent tokens — `var(--primary-500)` /
29628
+ // `var(--secondary-500)` in dash-electron's design.css — bind to
29629
+ // named themes too. Previously only hex themes produced cssVars,
29630
+ // so the Aurora accent fell back to a hardcoded default under any
29631
+ // named theme. cssValueFor resolves named colors via
29632
+ // TAILWIND_PALETTE and is variant-independent, so the accent stays
29633
+ // the same brand color in both light and dark (only surfaces flip).
29634
+ // Components still render via Tailwind class strings (bg-blue-700),
29635
+ // so this is purely additive — no named-theme rendering changes.
29636
+ var hex500 = cssValueFor(type, 500, channelValue);
29637
+ if (hex500) {
29638
+ cssVarsAll["--".concat(type, "-500")] = hex500;
29639
+ }
29614
29640
  }
29615
29641
  });
29616
29642
  // Merge base channel vars with per-token override vars (collected
@@ -58017,7 +58043,7 @@ var DashTabBar = function DashTabBar(_ref) {
58017
58043
  currentTheme = _useContext.currentTheme;
58018
58044
  if (tabs.length === 0) return null;
58019
58045
  return /*#__PURE__*/jsx("div", {
58020
- className: "flex flex-row items-center shrink-0 overflow-x-auto gap-1 px-2 py-2.5 border-t ".concat(currentTheme["border-primary-dark"] || "border-gray-700", " ").concat(currentTheme["bg-primary-dark"] || "bg-gray-900", " scrollbar-none"),
58046
+ className: "dr-tabstrip flex flex-row items-center shrink-0 overflow-x-auto gap-1 px-2 py-2.5 border-t ".concat(currentTheme["border-primary-dark"] || "border-gray-700", " ").concat(currentTheme["bg-primary-dark"] || "bg-gray-900", " scrollbar-none"),
58021
58047
  children: tabs.map(function (tab) {
58022
58048
  var isActive = tab.id === activeTabId;
58023
58049
  return /*#__PURE__*/jsxs("button", {
@@ -58025,7 +58051,7 @@ var DashTabBar = function DashTabBar(_ref) {
58025
58051
  onClick: function onClick() {
58026
58052
  return onSwitchTab && onSwitchTab(tab.id);
58027
58053
  },
58028
- className: "group flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md whitespace-nowrap transition-all duration-100 cursor-pointer ".concat(isActive ? "bg-white/15 text-white" : "text-gray-400 hover:bg-white/10 hover:text-gray-200"),
58054
+ className: "dr-pill ".concat(isActive ? "dr-pill-active" : "", " group flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md whitespace-nowrap transition-all duration-100 cursor-pointer ").concat(isActive ? "bg-white/15 text-white" : "text-gray-400 hover:bg-white/10 hover:text-gray-200"),
58029
58055
  children: [/*#__PURE__*/jsx("span", {
58030
58056
  className: "truncate max-w-[140px]",
58031
58057
  children: (tab.name || "Untitled").replace(/^./, function (c) {
@@ -58157,7 +58183,7 @@ var PageTabBar = function PageTabBar(_ref) {
58157
58183
  setDragOverId(null);
58158
58184
  };
58159
58185
  return /*#__PURE__*/jsxs("div", {
58160
- className: "flex flex-row items-center shrink-0 overflow-x-auto gap-1 px-2 py-1.5 border-b ".concat(currentTheme["border-primary-dark"] || "border-gray-700", " ").concat(currentTheme["bg-primary-medium"] || "bg-gray-800/50", " scrollbar-none"),
58186
+ className: "dr-tabs flex flex-row items-center shrink-0 overflow-x-auto gap-1 px-2 py-1.5 border-b ".concat(currentTheme["border-neutral-dark"] || "border-neutral-800", " ").concat(currentTheme["bg-none"] || "bg-transparent", " scrollbar-none"),
58161
58187
  children: [pages.length > 1 && sortedPages.map(function (page) {
58162
58188
  var isActive = page.id === activePageId;
58163
58189
  var isDragOver = page.id === dragOverId;
@@ -58180,7 +58206,7 @@ var PageTabBar = function PageTabBar(_ref) {
58180
58206
  return handleDrop(e, page.id);
58181
58207
  },
58182
58208
  onDragEnd: handleDragEnd,
58183
- className: "group flex items-center gap-1.5 px-3 py-1 text-xs rounded-md whitespace-nowrap transition-all duration-100 cursor-pointer ".concat(isActive ? "bg-white/15 text-white" : "text-gray-400 hover:bg-white/10 hover:text-gray-200", " ").concat(isDragOver ? "ring-1 ring-blue-400" : "", " ").concat(editMode ? "cursor-grab active:cursor-grabbing" : ""),
58209
+ className: "dr-tab ".concat(isActive ? "dr-tab-active" : "", " group flex items-center gap-1.5 px-3 py-1 text-xs rounded-md whitespace-nowrap transition-all duration-100 cursor-pointer ").concat(isActive ? "bg-white/15 text-white" : "text-gray-400 hover:bg-white/10 hover:text-gray-200", " ").concat(isDragOver ? "ring-1 ring-blue-400" : "", " ").concat(editMode ? "cursor-grab active:cursor-grabbing" : ""),
58184
58210
  children: [editingId === page.id ? /*#__PURE__*/jsx("input", {
58185
58211
  ref: inputRef,
58186
58212
  type: "text",
@@ -58223,7 +58249,7 @@ var PageTabBar = function PageTabBar(_ref) {
58223
58249
  }), editMode && onAddPage && /*#__PURE__*/jsxs("button", {
58224
58250
  type: "button",
58225
58251
  onClick: onAddPage,
58226
- className: "flex items-center gap-1 px-2 py-1 text-xs rounded-md text-gray-500 hover:bg-white/10 hover:text-gray-300 transition-colors",
58252
+ className: "dr-tab flex items-center gap-1 px-2 py-1 text-xs rounded-md text-gray-500 hover:bg-white/10 hover:text-gray-300 transition-colors",
58227
58253
  children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
58228
58254
  icon: "plus",
58229
58255
  className: "h-2.5 w-2.5"
@@ -65810,7 +65836,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
65810
65836
  }
65811
65837
  }, [workspace, workspaceSelected]);
65812
65838
  return /*#__PURE__*/jsx("div", {
65813
- className: "flex flex-row p-1 justify-between shrink items-center px-4 ".concat(currentTheme["bg-primary-dark"], " py-2"),
65839
+ className: "dr-header flex flex-row p-1 justify-between shrink items-center px-4 ".concat(currentTheme["bg-none"], " py-2"),
65814
65840
  children: preview === true ? /*#__PURE__*/jsxs(Fragment, {
65815
65841
  children: [/*#__PURE__*/jsx(SubHeading3, {
65816
65842
  title: (workspaceSelected.name || "Untitled").replace(/^./, function (c) {
@@ -65823,11 +65849,11 @@ var DashboardHeader = function DashboardHeader(_ref) {
65823
65849
  children: [onPopout !== null && /*#__PURE__*/jsx(ButtonIcon, {
65824
65850
  icon: "arrow-up-right-from-square",
65825
65851
  onClick: onPopout,
65826
- hoverBackgroundColor: "hover:bg-indigo-700"
65852
+ hoverBackgroundColor: "hover:bg-neutral-700"
65827
65853
  }), onClickEdit !== null && /*#__PURE__*/jsx(ButtonIcon, {
65828
65854
  icon: "pencil",
65829
65855
  onClick: onClickEdit,
65830
- hoverBackgroundColor: "hover:bg-indigo-700"
65856
+ hoverBackgroundColor: "hover:bg-neutral-700"
65831
65857
  })]
65832
65858
  })]
65833
65859
  }) : /*#__PURE__*/jsxs(Fragment, {
@@ -65839,7 +65865,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
65839
65865
  onChange: onNameChange,
65840
65866
  textSize: "text-lg",
65841
65867
  placeholder: "My Workspace",
65842
- bgColor: currentTheme["bg-primary-very-dark"],
65868
+ bgColor: currentTheme["bg-neutral-very-dark"],
65843
65869
  textColor: currentTheme["text-primary-medium"],
65844
65870
  hasBorder: false,
65845
65871
  autoFocus: true
@@ -65863,7 +65889,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
65863
65889
  onFolderChange(menuId);
65864
65890
  },
65865
65891
  placeholder: "Folder",
65866
- backgroundColor: currentTheme["bg-primary-very-dark"],
65892
+ backgroundColor: currentTheme["bg-neutral-very-dark"],
65867
65893
  textColor: currentTheme["text-primary-medium"],
65868
65894
  borderColor: currentTheme["border-primary-dark"],
65869
65895
  inputClassName: "py-1 text-sm",
@@ -65898,7 +65924,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
65898
65924
  onThemeChange(themeKey);
65899
65925
  },
65900
65926
  placeholder: "Select a theme",
65901
- backgroundColor: currentTheme["bg-primary-very-dark"],
65927
+ backgroundColor: currentTheme["bg-neutral-very-dark"],
65902
65928
  textColor: currentTheme["text-primary-medium"],
65903
65929
  borderColor: currentTheme["border-primary-dark"],
65904
65930
  inputClassName: "py-1 text-sm",
@@ -65921,7 +65947,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
65921
65947
  icon: "xmark",
65922
65948
  text: "Cancel",
65923
65949
  onClick: onClickEdit,
65924
- hoverBackgroundColor: "hover:bg-indigo-700"
65950
+ hoverBackgroundColor: "hover:bg-neutral-700"
65925
65951
  }), onSaveChanges !== null && /*#__PURE__*/jsx(ButtonIcon2, {
65926
65952
  icon: "check",
65927
65953
  text: "Save",
@@ -65949,7 +65975,7 @@ function DashboardConfigButton(_ref8) {
65949
65975
  children: [/*#__PURE__*/jsx(ButtonIcon, {
65950
65976
  icon: "sliders",
65951
65977
  onClick: onClick,
65952
- hoverBackgroundColor: "hover:bg-indigo-700"
65978
+ hoverBackgroundColor: "hover:bg-neutral-700"
65953
65979
  }), unresolvedCount > 0 && /*#__PURE__*/jsx("span", {
65954
65980
  className: "absolute top-1 right-1 h-2 w-2 rounded-full bg-amber-400 border border-black/40 pointer-events-none",
65955
65981
  title: "".concat(unresolvedCount, " unresolved provider").concat(unresolvedCount === 1 ? "" : "s")
@@ -67715,6 +67741,15 @@ var ChatMessages = function ChatMessages(_ref) {
67715
67741
  });
67716
67742
  };
67717
67743
 
67744
+ var autoResize = function autoResize(el) {
67745
+ if (!el) return;
67746
+ el.style.height = "auto";
67747
+ if (el.scrollHeight === 0) {
67748
+ el.style.height = "";
67749
+ return;
67750
+ }
67751
+ el.style.height = Math.min(el.scrollHeight, 120) + "px";
67752
+ };
67718
67753
  var ChatInput = function ChatInput(_ref) {
67719
67754
  var onSend = _ref.onSend,
67720
67755
  onStop = _ref.onStop,
@@ -67725,13 +67760,24 @@ var ChatInput = function ChatInput(_ref) {
67725
67760
  input = _useState2[0],
67726
67761
  setInput = _useState2[1];
67727
67762
  var textareaRef = useRef(null);
67763
+
67764
+ // Auto-resize; re-measure once the input's container actually gets laid
67765
+ // out (e.g. the panel is expanded).
67728
67766
  useEffect(function () {
67729
- var el = textareaRef.current;
67730
- if (el) {
67731
- el.style.height = "auto";
67732
- el.style.height = Math.min(el.scrollHeight, 120) + "px";
67733
- }
67767
+ autoResize(textareaRef.current);
67734
67768
  }, [input]);
67769
+ useEffect(function () {
67770
+ var el = textareaRef.current;
67771
+ var parent = el === null || el === void 0 ? void 0 : el.parentElement;
67772
+ if (!parent || typeof ResizeObserver === "undefined") return;
67773
+ var observer = new ResizeObserver(function () {
67774
+ return autoResize(el);
67775
+ });
67776
+ observer.observe(parent);
67777
+ return function () {
67778
+ return observer.disconnect();
67779
+ };
67780
+ }, []);
67735
67781
  var handleSend = function handleSend() {
67736
67782
  var trimmed = input.trim();
67737
67783
  if (!trimmed || isLoading) return;