@tscircuit/runframe 0.0.411 → 0.0.413

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.
@@ -1092,7 +1092,7 @@ var RenderLogViewer = ({
1092
1092
  };
1093
1093
 
1094
1094
  // package.json
1095
- var version = "0.0.410";
1095
+ var version = "0.0.412";
1096
1096
 
1097
1097
  // lib/components/CircuitJsonPreview/CircuitJsonPreview.tsx
1098
1098
  import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
@@ -1720,8 +1720,8 @@ import { Loader2 as Loader22 } from "lucide-react";
1720
1720
  import { useEffect as useEffect3, useState as useState6 } from "react";
1721
1721
 
1722
1722
  // lib/components/OrderDialog/VendorQuoteCard.tsx
1723
- import { Package } from "lucide-react";
1724
- import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
1723
+ import { Truck, Package } from "lucide-react";
1724
+ import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
1725
1725
  function VendorQuoteCard({
1726
1726
  vendor,
1727
1727
  isActive,
@@ -1729,7 +1729,7 @@ function VendorQuoteCard({
1729
1729
  selectedShippingIdx,
1730
1730
  onSelectShipping
1731
1731
  }) {
1732
- return /* @__PURE__ */ jsx18(
1732
+ return /* @__PURE__ */ jsxs14(
1733
1733
  "div",
1734
1734
  {
1735
1735
  className: cn(
@@ -1737,22 +1737,62 @@ function VendorQuoteCard({
1737
1737
  isActive ? "rf-ring-2 rf-ring-primary rf-border-primary" : "rf-border-gray-200"
1738
1738
  ),
1739
1739
  onClick: onSelect,
1740
- children: /* @__PURE__ */ jsxs14("div", { className: "rf-flex rf-items-center rf-justify-between rf-px-6 rf-py-4", children: [
1741
- /* @__PURE__ */ jsxs14("div", { className: "rf-flex rf-items-center rf-gap-2", children: [
1742
- /* @__PURE__ */ jsx18(Package, { className: "rf-w-6 rf-h-6 rf-text-blue-500" }),
1743
- /* @__PURE__ */ jsx18("span", { className: "rf-font-semibold rf-text-lg", children: vendor.vendor_name })
1744
- ] }),
1745
- /* @__PURE__ */ jsxs14("div", { className: "rf-flex rf-flex-col rf-items-end", children: [
1746
- /* @__PURE__ */ jsx18("span", { className: "rf-text-gray-500 rf-text-sm", children: "PCB + Components" }),
1740
+ children: [
1741
+ /* @__PURE__ */ jsxs14("div", { className: "rf-flex rf-items-center rf-justify-between rf-px-6 rf-py-4", children: [
1747
1742
  /* @__PURE__ */ jsxs14("div", { className: "rf-flex rf-items-center rf-gap-2", children: [
1748
- /* @__PURE__ */ jsxs14("span", { className: "rf-text-gray-400 rf-line-through rf-text-base rf-mr-2", children: [
1743
+ /* @__PURE__ */ jsx18(Package, { className: "rf-w-6 rf-h-6 rf-text-blue-500" }),
1744
+ /* @__PURE__ */ jsx18("span", { className: "rf-font-semibold rf-text-lg", children: vendor.vendor_name.toUpperCase() })
1745
+ ] }),
1746
+ /* @__PURE__ */ jsxs14("div", { className: "rf-flex rf-flex-col rf-items-end", children: [
1747
+ /* @__PURE__ */ jsx18("span", { className: "rf-text-gray-500 rf-text-sm", children: "Fully Assembled PCB" }),
1748
+ /* @__PURE__ */ jsx18("div", { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsxs14("span", { className: "rf-font-bold rf-text-xl rf-text-blue-600", children: [
1749
1749
  "$",
1750
1750
  vendor.total_cost_without_shipping.toFixed(2)
1751
+ ] }) })
1752
+ ] })
1753
+ ] }),
1754
+ isActive && /* @__PURE__ */ jsxs14(Fragment3, { children: [
1755
+ /* @__PURE__ */ jsx18("hr", { className: "rf-border-gray-200" }),
1756
+ /* @__PURE__ */ jsxs14("div", { className: "rf-px-6 rf-py-2", children: [
1757
+ /* @__PURE__ */ jsx18("div", { className: "rf-mb-2 rf-text-sm rf-font-medium rf-text-gray-700", children: "Shipping Options:" }),
1758
+ /* @__PURE__ */ jsx18("div", { className: "rf-flex rf-gap-4 rf-flex-wrap rf-mb-2", children: vendor.shipping_options.map((ship, idx) => /* @__PURE__ */ jsxs14(
1759
+ "button",
1760
+ {
1761
+ type: "button",
1762
+ className: cn(
1763
+ "rf-flex rf-items-center rf-gap-2 rf-px-4 rf-py-2 rf-rounded-lg rf-border rf-shadow rf-min-w-[148px] rf-transition-colors",
1764
+ selectedShippingIdx === idx ? "rf-border-blue-600 rf-bg-blue-50 rf-ring-2 rf-ring-blue-500" : "rf-border-gray-300 rf-bg-gray-50 hover:rf-border-blue-300"
1765
+ ),
1766
+ onClick: (e) => {
1767
+ e.stopPropagation();
1768
+ onSelectShipping(idx);
1769
+ },
1770
+ children: [
1771
+ /* @__PURE__ */ jsx18(Truck, { className: "rf-w-5 rf-h-5 rf-text-yellow-500" }),
1772
+ /* @__PURE__ */ jsxs14("div", { className: "rf-text-left rf-flex-1", children: [
1773
+ /* @__PURE__ */ jsx18("div", { className: "rf-leading-tight rf-font-medium", children: ship.carrier }),
1774
+ /* @__PURE__ */ jsx18("div", { className: "rf-text-xs rf-text-gray-500", children: ship.service })
1775
+ ] })
1776
+ ]
1777
+ },
1778
+ ship.carrier + idx
1779
+ )) })
1780
+ ] })
1781
+ ] }),
1782
+ isActive && selectedShippingIdx !== null && /* @__PURE__ */ jsx18("div", { className: "rf-px-6 rf-pb-3", children: /* @__PURE__ */ jsxs14("div", { className: "rf-flex rf-justify-between rf-items-center rf-mt-2", children: [
1783
+ /* @__PURE__ */ jsx18("span", { className: "rf-text-gray-800 rf-font-medium rf-text-sm", children: "Total (incl. shipping):" }),
1784
+ /* @__PURE__ */ jsxs14("div", { className: "rf-flex rf-items-center rf-gap-2", children: [
1785
+ /* @__PURE__ */ jsxs14("span", { className: "rf-text-gray-400 rf-line-through rf-text-sm rf-mr-2", children: [
1786
+ "($",
1787
+ vendor.total_cost_without_shipping.toFixed(2),
1788
+ " + $",
1789
+ vendor.shipping_options[selectedShippingIdx].cost.toFixed(2),
1790
+ ")"
1751
1791
  ] }),
1752
1792
  /* @__PURE__ */ jsx18("span", { className: "rf-font-bold rf-text-xl rf-text-blue-600", children: "$50.00" })
1753
1793
  ] })
1754
- ] })
1755
- ] })
1794
+ ] }) })
1795
+ ]
1756
1796
  }
1757
1797
  );
1758
1798
  }
@@ -1891,15 +1931,16 @@ var InitialOrderScreen = ({
1891
1931
  createOrderQuote2();
1892
1932
  }, [packageReleaseId, createOrderQuote2]);
1893
1933
  return /* @__PURE__ */ jsxs15("div", { className: "rf-max-w-lg rf-mx-auto rf-bg-white rf-rounded-2xl rf-p-8 rf-flex rf-flex-col rf-gap-3", children: [
1894
- /* @__PURE__ */ jsx19("h2", { className: "rf-text-3xl rf-font-bold rf-text-center rf-mb-8", children: "Order PCB \u2013 Choose a Vendor" }),
1934
+ /* @__PURE__ */ jsx19("h2", { className: "rf-text-3xl rf-font-bold rf-text-center rf-mb-8", children: "Order PCB" }),
1895
1935
  /* @__PURE__ */ jsx19("div", { className: "rf-mb-4 rf-text-gray-700 rf-text-center", children: "Select a quote from below, then pick a shipping method." }),
1896
- !orderQuoteId && !isError ? /* @__PURE__ */ jsxs15("div", { className: "rf-flex rf-flex-col rf-items-center rf-gap-2 rf-my-12", children: [
1897
- /* @__PURE__ */ jsx19(Loader22, { className: "rf-animate-spin rf-w-8 rf-h-8 rf-text-gray-400" }),
1898
- /* @__PURE__ */ jsx19("p", { className: "rf-text-gray-600", children: "Fetching quotes..." })
1899
- ] }) : createOrderQuoteError && isError ? /* @__PURE__ */ jsx19("div", { className: "rf-text-red-600 rf-text-center rf-py-12", children: JSON.stringify(createOrderQuoteError.message) }) : orderQuote?.error ? /* @__PURE__ */ jsx19("div", { className: "rf-text-red-600 rf-text-center rf-py-12", children: orderQuote?.error?.message || "Failed to fetch quotes" }) : !orderQuote ? /* @__PURE__ */ jsx19("div", { className: "rf-text-red-600 rf-text-center rf-py-12", children: "No quotes available." }) : !orderQuote.is_completed ? /* @__PURE__ */ jsxs15("div", { className: "rf-flex rf-flex-col rf-items-center rf-gap-2 rf-my-12", children: [
1900
- /* @__PURE__ */ jsx19(Loader22, { className: "rf-animate-spin rf-w-8 rf-h-8 rf-text-gray-400" }),
1901
- /* @__PURE__ */ jsx19("p", { className: "rf-text-gray-600", children: "Calculating quote..." })
1902
- ] }) : /* @__PURE__ */ jsx19(
1936
+ !orderQuoteId && !isError && /* @__PURE__ */ jsx19(LoadingMessage, { message: "Fetching quotes..." }),
1937
+ (createOrderQuoteError || orderQuote?.error) && /* @__PURE__ */ jsx19(
1938
+ ErrorMessage,
1939
+ {
1940
+ message: createOrderQuoteError?.message || orderQuote?.error?.message || "Failed to fetch quotes"
1941
+ }
1942
+ ),
1943
+ orderQuote?.is_completed && !createOrderQuoteError && !orderQuote?.error && /* @__PURE__ */ jsx19(
1903
1944
  VendorQuoteCard,
1904
1945
  {
1905
1946
  vendor: orderQuote,
@@ -1908,7 +1949,7 @@ var InitialOrderScreen = ({
1908
1949
  selectedShippingIdx: selectedVendorIdx === 0 ? selectedShippingIdx : null,
1909
1950
  onSelectShipping: setSelectedShippingIdx
1910
1951
  },
1911
- orderQuote.order_quote_id
1952
+ orderQuote?.order_quote_id
1912
1953
  ),
1913
1954
  /* @__PURE__ */ jsxs15("div", { className: "rf-flex rf-justify-between rf-mt-5 rf-gap-4", children: [
1914
1955
  /* @__PURE__ */ jsx19(
@@ -1943,6 +1984,11 @@ var InitialOrderScreen = ({
1943
1984
  /* @__PURE__ */ jsx19("div", { className: "rf-text-xs rf-text-center rf-text-gray-400 rf-mt-4", children: "Pricing may vary based on specifications." })
1944
1985
  ] });
1945
1986
  };
1987
+ var LoadingMessage = ({ message }) => /* @__PURE__ */ jsxs15("div", { className: "rf-flex rf-flex-col rf-items-center rf-gap-2 rf-my-12", children: [
1988
+ /* @__PURE__ */ jsx19(Loader22, { className: "rf-animate-spin rf-w-8 rf-h-8 rf-text-gray-400" }),
1989
+ /* @__PURE__ */ jsx19("p", { className: "rf-text-gray-600", children: message })
1990
+ ] });
1991
+ var ErrorMessage = ({ message }) => /* @__PURE__ */ jsx19("div", { className: "rf-text-red-600 rf-text-center rf-py-12", children: message });
1946
1992
 
1947
1993
  // lib/components/OrderDialog/OrderDialog.tsx
1948
1994
  import { jsx as jsx20 } from "react/jsx-runtime";
package/dist/preview.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  linkify,
9
9
  useOrderDialog,
10
10
  useOrderDialogCli
11
- } from "./chunk-7CVVYSN5.js";
11
+ } from "./chunk-EY4WZIT6.js";
12
12
  export {
13
13
  BomTable,
14
14
  CadViewer,
package/dist/runner.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  useOrderDialog,
27
27
  useOrderDialogCli,
28
28
  useRunFrameStore
29
- } from "./chunk-7CVVYSN5.js";
29
+ } from "./chunk-EY4WZIT6.js";
30
30
 
31
31
  // lib/components/RunFrame/RunFrame.tsx
32
32
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";