@tscircuit/runframe 0.0.310 → 0.0.312

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/runner.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  buttonVariants,
21
21
  cn,
22
22
  linkify
23
- } from "./chunk-MVZMUL3H.js";
23
+ } from "./chunk-U2ZLCEUS.js";
24
24
 
25
25
  // lib/components/RunFrame/RunFrame.tsx
26
26
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -770,7 +770,7 @@ function useLocalStorageState(key, initialValue) {
770
770
  }
771
771
 
772
772
  // lib/components/RunFrameForCli/LeftHeader.tsx
773
- import { useEffect as useEffect7, useMemo as useMemo3, useState as useState9 } from "react";
773
+ import { useEffect as useEffect8, useMemo as useMemo3, useState as useState10 } from "react";
774
774
 
775
775
  // lib/components/RunFrameForCli/SelectSnippetDialog.tsx
776
776
  import { useState as useState4 } from "react";
@@ -1469,11 +1469,11 @@ var importComponentFromJlcpcb = async (jlcpcbPartNumber) => {
1469
1469
  };
1470
1470
 
1471
1471
  // lib/components/OrderDialog/useOrderDialog.tsx
1472
- import { useState as useState8 } from "react";
1472
+ import { useState as useState9 } from "react";
1473
1473
 
1474
1474
  // lib/components/OrderDialog/OrderDialog.tsx
1475
1475
  import ky3 from "ky";
1476
- import { useState as useState7 } from "react";
1476
+ import { useState as useState8 } from "react";
1477
1477
  import { QueryClient, QueryClientProvider } from "react-query";
1478
1478
 
1479
1479
  // lib/components/OrderDialog/CheckoutOrder.tsx
@@ -1718,31 +1718,227 @@ var CheckoutOrder = ({
1718
1718
  ] });
1719
1719
  };
1720
1720
 
1721
- // lib/components/OrderDialog/InitialOrder.tsx
1721
+ // lib/components/ui/select.tsx
1722
+ import * as SelectPrimitive from "@radix-ui/react-select";
1723
+ import { Check as Check2, ChevronDown, ChevronUp } from "lucide-react";
1724
+ import * as React5 from "react";
1722
1725
  import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
1726
+ var Select = SelectPrimitive.Root;
1727
+ var SelectValue = SelectPrimitive.Value;
1728
+ var SelectTrigger = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs7(
1729
+ SelectPrimitive.Trigger,
1730
+ {
1731
+ ref,
1732
+ className: cn(
1733
+ "rf-flex rf-h-10 rf-w-full rf-items-center rf-justify-between rf-rounded-md rf-border rf-border-input rf-bg-background rf-px-3 rf-py-2 rf-text-sm rf-ring-offset-background rf-placeholder:text-muted-foreground focus:rf-outline-none focus:rf-ring-2 focus:rf-ring-ring focus:rf-ring-offset-2 disabled:rf-cursor-not-allowed disabled:rf-opacity-50 [&>span]:rf-line-clamp-1",
1734
+ className
1735
+ ),
1736
+ ...props,
1737
+ children: [
1738
+ children,
1739
+ /* @__PURE__ */ jsx9(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx9(ChevronDown, { className: "rf-h-4 rf-w-4 rf-opacity-50" }) })
1740
+ ]
1741
+ }
1742
+ ));
1743
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
1744
+ var SelectScrollUpButton = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
1745
+ SelectPrimitive.ScrollUpButton,
1746
+ {
1747
+ ref,
1748
+ className: cn(
1749
+ "rf-flex rf-cursor-default rf-items-center rf-justify-center rf-py-1",
1750
+ className
1751
+ ),
1752
+ ...props,
1753
+ children: /* @__PURE__ */ jsx9(ChevronUp, { className: "rf-h-4 rf-w-4" })
1754
+ }
1755
+ ));
1756
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
1757
+ var SelectScrollDownButton = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
1758
+ SelectPrimitive.ScrollDownButton,
1759
+ {
1760
+ ref,
1761
+ className: cn(
1762
+ "rf-flex rf-cursor-default rf-items-center rf-justify-center rf-py-1",
1763
+ className
1764
+ ),
1765
+ ...props,
1766
+ children: /* @__PURE__ */ jsx9(ChevronDown, { className: "rf-h-4 rf-w-4" })
1767
+ }
1768
+ ));
1769
+ SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
1770
+ var SelectContent = React5.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx9(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs7(
1771
+ SelectPrimitive.Content,
1772
+ {
1773
+ ref,
1774
+ className: cn(
1775
+ "rf-relative rf-z-[100] rf-max-h-96 rf-min-w-[8rem] rf-overflow-hidden rf-rounded-md rf-border rf-bg-white rf-text-black rf-shadow-md data-[state=open]:rf-animate-in data-[state=closed]:rf-animate-out data-[state=closed]:rf-fade-out-0 data-[state=open]:rf-fade-in-0 data-[state=closed]:rf-zoom-out-95 data-[state=open]:rf-zoom-in-95 data-[side=bottom]:rf-slide-in-from-top-2 data-[side=left]:rf-slide-in-from-right-2 data-[side=right]:rf-slide-in-from-left-2 data-[side=top]:rf-slide-in-from-bottom-2",
1776
+ position === "popper" && "data-[side=bottom]:rf-translate-y-1 data-[side=left]:-rf-translate-x-1 data-[side=right]:rf-translate-x-1 data-[side=top]:-rf-translate-y-1",
1777
+ className
1778
+ ),
1779
+ position,
1780
+ ...props,
1781
+ children: [
1782
+ /* @__PURE__ */ jsx9(SelectScrollUpButton, {}),
1783
+ /* @__PURE__ */ jsx9(
1784
+ SelectPrimitive.Viewport,
1785
+ {
1786
+ className: cn(
1787
+ "rf-p-1",
1788
+ position === "popper" && "rf-h-[var(--radix-select-trigger-height)] rf-w-full rf-min-w-[var(--radix-select-trigger-width)]"
1789
+ ),
1790
+ children
1791
+ }
1792
+ ),
1793
+ /* @__PURE__ */ jsx9(SelectScrollDownButton, {})
1794
+ ]
1795
+ }
1796
+ ) }));
1797
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
1798
+ var SelectLabel = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
1799
+ SelectPrimitive.Label,
1800
+ {
1801
+ ref,
1802
+ className: cn(
1803
+ "rf-py-1.5 rf-pl-8 rf-pr-2 rf-text-sm rf-font-semibold",
1804
+ className
1805
+ ),
1806
+ ...props
1807
+ }
1808
+ ));
1809
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
1810
+ var SelectItem = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs7(
1811
+ SelectPrimitive.Item,
1812
+ {
1813
+ ref,
1814
+ className: cn(
1815
+ "rf-relative rf-flex rf-w-full rf-cursor-default rf-select-none rf-items-center rf-rounded-sm rf-py-1.5 rf-pl-8 rf-pr-2 rf-text-sm rf-text-gray-800 rf-outline-none focus:rf-bg-gray-100 focus:rf-text-gray-900 data-[disabled]:rf-pointer-events-none data-[disabled]:rf-opacity-50",
1816
+ className
1817
+ ),
1818
+ ...props,
1819
+ children: [
1820
+ /* @__PURE__ */ jsx9("span", { className: "rf-absolute rf-left-2 rf-flex rf-h-3.5 rf-w-3.5 rf-items-center rf-justify-center", children: /* @__PURE__ */ jsx9(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx9(Check2, { className: "rf-h-4 rf-w-4" }) }) }),
1821
+ /* @__PURE__ */ jsx9(SelectPrimitive.ItemText, { children })
1822
+ ]
1823
+ }
1824
+ ));
1825
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
1826
+ var SelectSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
1827
+ SelectPrimitive.Separator,
1828
+ {
1829
+ ref,
1830
+ className: cn("-rf-mx-1 rf-my-1 rf-h-px rf-bg-muted", className),
1831
+ ...props
1832
+ }
1833
+ ));
1834
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
1835
+
1836
+ // lib/components/ui/skeleton.tsx
1837
+ import { jsx as jsx10 } from "react/jsx-runtime";
1838
+ function Skeleton({
1839
+ className,
1840
+ ...props
1841
+ }) {
1842
+ return /* @__PURE__ */ jsx10(
1843
+ "div",
1844
+ {
1845
+ className: cn("rf-animate-pulse rf-rounded-md rf-bg-muted", className),
1846
+ ...props
1847
+ }
1848
+ );
1849
+ }
1850
+
1851
+ // lib/components/OrderDialog/InitialOrder.tsx
1852
+ import { ArrowDown } from "lucide-react";
1853
+ import { useEffect as useEffect7 } from "react";
1854
+ import { useState as useState7 } from "react";
1855
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
1723
1856
  var InitialOrderScreen = ({
1724
1857
  onCancel,
1725
1858
  onContinue
1726
1859
  }) => {
1727
- return /* @__PURE__ */ jsxs7("div", { className: "rf-flex rf-flex-col rf-bg-white rf-rounded-xl rf-p-8 rf-max-w-md rf-w-full rf-mx-auto", children: [
1728
- /* @__PURE__ */ jsx9("h2", { className: "rf-text-3xl rf-font-bold rf-text-center rf-mb-8", children: "Order" }),
1729
- /* @__PURE__ */ jsx9("p", { className: "rf-text-lg rf-text-center rf-mb-12", children: "Want to place an order?" }),
1730
- /* @__PURE__ */ jsxs7("div", { className: "rf-flex rf-justify-between rf-mt-auto", children: [
1731
- /* @__PURE__ */ jsx9(
1860
+ const productCategories = [
1861
+ { id: "prototype", name: "Prototype" },
1862
+ { id: "development", name: "Development board" }
1863
+ ];
1864
+ const [isLoading, setIsLoading] = useState7(false);
1865
+ const [estimatedCost, setEstimatedCost] = useState7(null);
1866
+ const [selectedCategory, setSelectedCategory] = useState7("prototype");
1867
+ useEffect7(() => {
1868
+ handleGetEstimate();
1869
+ }, []);
1870
+ const handleSelectCategory = (category) => {
1871
+ setSelectedCategory(category);
1872
+ setEstimatedCost(null);
1873
+ setTimeout(() => {
1874
+ handleGetEstimate();
1875
+ }, 0);
1876
+ };
1877
+ const handleGetEstimate = () => {
1878
+ if (!selectedCategory) return;
1879
+ setIsLoading(true);
1880
+ setEstimatedCost(null);
1881
+ setTimeout(() => {
1882
+ const cost = Math.floor(Math.random() * 150) + 50;
1883
+ setEstimatedCost(cost);
1884
+ setIsLoading(false);
1885
+ }, 1500);
1886
+ };
1887
+ return /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-flex-col rf-bg-white rf-rounded-xl rf-p-8 rf-max-w-md rf-w-full rf-mx-auto", children: [
1888
+ /* @__PURE__ */ jsx11("h2", { className: "rf-text-3xl rf-font-bold rf-text-center rf-mb-8", children: "Order PCB" }),
1889
+ /* @__PURE__ */ jsxs8("div", { className: "rf-mb-8", children: [
1890
+ /* @__PURE__ */ jsx11(
1891
+ "label",
1892
+ {
1893
+ htmlFor: "category",
1894
+ className: "rf-block rf-text-sm rf-font-medium rf-text-gray-700 rf-mb-2",
1895
+ children: "Select Product Category"
1896
+ }
1897
+ ),
1898
+ /* @__PURE__ */ jsxs8(
1899
+ Select,
1900
+ {
1901
+ onValueChange: handleSelectCategory,
1902
+ value: selectedCategory || void 0,
1903
+ children: [
1904
+ /* @__PURE__ */ jsx11(SelectTrigger, { className: "rf-w-full", children: /* @__PURE__ */ jsx11(SelectValue, { placeholder: "Select a category" }) }),
1905
+ /* @__PURE__ */ jsx11(SelectContent, { children: productCategories.map((category) => /* @__PURE__ */ jsx11(SelectItem, { value: category.id, children: category.name }, category.id)) })
1906
+ ]
1907
+ }
1908
+ )
1909
+ ] }),
1910
+ isLoading ? /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-flex-col rf-items-center rf-mb-8", children: [
1911
+ /* @__PURE__ */ jsxs8("div", { className: "rf-animate-pulse rf-flex rf-space-x-2 rf-items-center rf-mb-3", children: [
1912
+ /* @__PURE__ */ jsx11(ArrowDown, { className: "rf-h-5 rf-w-5 rf-text-gray-400" }),
1913
+ /* @__PURE__ */ jsx11("span", { className: "rf-text-gray-500", children: "Fetching estimate..." })
1914
+ ] }),
1915
+ /* @__PURE__ */ jsx11(Skeleton, { className: "rf-h-6 rf-w-3/4 rf-mb-2" }),
1916
+ /* @__PURE__ */ jsx11(Skeleton, { className: "rf-h-6 rf-w-1/2" })
1917
+ ] }) : estimatedCost !== null ? /* @__PURE__ */ jsxs8("div", { className: "rf-bg-gray-50 rf-p-4 rf-rounded-lg rf-mb-8", children: [
1918
+ /* @__PURE__ */ jsx11("p", { className: "rf-text-sm rf-text-gray-600 rf-mb-2", children: "Estimated Cost:" }),
1919
+ /* @__PURE__ */ jsxs8("p", { className: "rf-text-2xl rf-font-bold rf-text-gray-900", children: [
1920
+ "$",
1921
+ estimatedCost.toFixed(2)
1922
+ ] }),
1923
+ /* @__PURE__ */ jsx11("p", { className: "rf-text-xs rf-text-gray-500 rf-mt-1", children: "Pricing may vary based on specifications" })
1924
+ ] }) : null,
1925
+ /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-justify-between rf-mt-auto", children: [
1926
+ /* @__PURE__ */ jsx11(
1732
1927
  Button,
1733
1928
  {
1734
1929
  variant: "outline",
1735
1930
  onClick: onCancel,
1736
- className: "rf-px-8 rf-border-red-500 rf-text-red-500 rf-hover:bg-red-50 rf-hover:text-red-600",
1931
+ className: "rf-px-8 rf-border-red-500 rf-text-red-500 hover:rf-bg-red-50 hover:rf-text-red-600",
1737
1932
  children: "Cancel"
1738
1933
  }
1739
1934
  ),
1740
- /* @__PURE__ */ jsx9(
1935
+ /* @__PURE__ */ jsx11(
1741
1936
  Button,
1742
1937
  {
1743
- onClick: onContinue,
1744
- className: "rf-px-8 rf-bg-gray-700 rf-hover:bg-gray-800",
1745
- children: "Continue"
1938
+ onClick: estimatedCost !== null ? onContinue : handleGetEstimate,
1939
+ disabled: !selectedCategory || isLoading,
1940
+ className: estimatedCost !== null ? "rf-px-8 rf-bg-gray-700 hover:rf-bg-gray-800" : "rf-px-8 rf-bg-blue-600 hover:rf-bg-blue-700",
1941
+ children: estimatedCost !== null ? "Continue" : "Get Estimate"
1746
1942
  }
1747
1943
  )
1748
1944
  ] })
@@ -1753,10 +1949,10 @@ var InitialOrderScreen = ({
1753
1949
  import ky2 from "ky";
1754
1950
 
1755
1951
  // lib/components/ui/progress.tsx
1756
- import * as React5 from "react";
1952
+ import * as React6 from "react";
1757
1953
  import * as ProgressPrimitive from "@radix-ui/react-progress";
1758
- import { jsx as jsx10 } from "react/jsx-runtime";
1759
- var Progress = React5.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx10(
1954
+ import { jsx as jsx12 } from "react/jsx-runtime";
1955
+ var Progress = React6.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx12(
1760
1956
  ProgressPrimitive.Root,
1761
1957
  {
1762
1958
  ref,
@@ -1765,7 +1961,7 @@ var Progress = React5.forwardRef(({ className, value, ...props }, ref) => /* @__
1765
1961
  className
1766
1962
  ),
1767
1963
  ...props,
1768
- children: /* @__PURE__ */ jsx10(
1964
+ children: /* @__PURE__ */ jsx12(
1769
1965
  ProgressPrimitive.Indicator,
1770
1966
  {
1771
1967
  className: "rf-h-full rf-w-full rf-flex-1 rf-bg-zinc-900 rf-transition-all dark:rf-bg-zinc-50",
@@ -1777,7 +1973,7 @@ var Progress = React5.forwardRef(({ className, value, ...props }, ref) => /* @__
1777
1973
  Progress.displayName = "Progress";
1778
1974
 
1779
1975
  // lib/components/OrderDialog/StepwiseProgress.tsx
1780
- import { ArrowDown, Check as Check2, Loader2 as Loader23 } from "lucide-react";
1976
+ import { ArrowDown as ArrowDown2, Check as Check3, Loader2 as Loader23 } from "lucide-react";
1781
1977
  import { useQuery } from "react-query";
1782
1978
 
1783
1979
  // lib/utils/order-steps.ts
@@ -1844,7 +2040,7 @@ var orderSteps = [
1844
2040
  }));
1845
2041
 
1846
2042
  // lib/components/OrderDialog/StepwiseProgress.tsx
1847
- import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
2043
+ import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
1848
2044
  var StepwiseProgressPanel = ({
1849
2045
  orderId,
1850
2046
  title = "Order PCB",
@@ -1889,35 +2085,35 @@ var StepwiseProgressPanel = ({
1889
2085
  const totalSteps = steps.length;
1890
2086
  const progress = Math.round(completedSteps.length / totalSteps * 100);
1891
2087
  const loading = isLoading || externalLoading;
1892
- return /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-flex-col rf-bg-white rf-rounded-xl rf-p-6 rf-max-w-xl rf-w-full rf-mx-auto", children: [
1893
- /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-items-center rf-justify-between rf-mb-6", children: [
1894
- /* @__PURE__ */ jsx11("h2", { className: "rf-text-2xl rf-font-bold", children: title }),
1895
- /* @__PURE__ */ jsxs8("div", { className: "rf-text-sm rf-text-muted-foreground", children: [
2088
+ return /* @__PURE__ */ jsxs9("div", { className: "rf-flex rf-flex-col rf-bg-white rf-rounded-xl rf-p-6 rf-max-w-xl rf-w-full rf-mx-auto", children: [
2089
+ /* @__PURE__ */ jsxs9("div", { className: "rf-flex rf-items-center rf-justify-between rf-mb-6", children: [
2090
+ /* @__PURE__ */ jsx13("h2", { className: "rf-text-2xl rf-font-bold", children: title }),
2091
+ /* @__PURE__ */ jsxs9("div", { className: "rf-text-sm rf-text-muted-foreground", children: [
1896
2092
  completedSteps.length,
1897
2093
  " of ",
1898
2094
  totalSteps,
1899
2095
  " completed"
1900
2096
  ] })
1901
2097
  ] }),
1902
- /* @__PURE__ */ jsx11(Progress, { value: progress, className: "rf-h-2 rf-mb-8" }),
1903
- /* @__PURE__ */ jsxs8("div", { className: "rf-space-y-6 rf-mb-8", children: [
1904
- lastCompletedStep && /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-items-start rf-gap-4", children: [
1905
- /* @__PURE__ */ jsx11("div", { className: "rf-flex-shrink-0 rf-mt-0.5", children: /* @__PURE__ */ jsx11("div", { className: "rf-w-8 rf-h-8 rf-rounded-full rf-bg-green-100 rf-flex rf-items-center rf-justify-center", children: /* @__PURE__ */ jsx11(Check2, { className: "rf-h-5 rf-w-5 rf-text-green-600" }) }) }),
1906
- /* @__PURE__ */ jsxs8("div", { className: "rf-flex-1", children: [
1907
- /* @__PURE__ */ jsx11("p", { className: "rf-text-sm rf-font-medium rf-text-muted-foreground", children: "Last Completed" }),
1908
- /* @__PURE__ */ jsxs8("p", { className: "rf-font-medium rf-text-green-600", children: [
2098
+ /* @__PURE__ */ jsx13(Progress, { value: progress, className: "rf-h-2 rf-mb-8" }),
2099
+ /* @__PURE__ */ jsxs9("div", { className: "rf-space-y-6 rf-mb-8", children: [
2100
+ lastCompletedStep && /* @__PURE__ */ jsxs9("div", { className: "rf-flex rf-items-start rf-gap-4", children: [
2101
+ /* @__PURE__ */ jsx13("div", { className: "rf-flex-shrink-0 rf-mt-0.5", children: /* @__PURE__ */ jsx13("div", { className: "rf-w-8 rf-h-8 rf-rounded-full rf-bg-green-100 rf-flex rf-items-center rf-justify-center", children: /* @__PURE__ */ jsx13(Check3, { className: "rf-h-5 rf-w-5 rf-text-green-600" }) }) }),
2102
+ /* @__PURE__ */ jsxs9("div", { className: "rf-flex-1", children: [
2103
+ /* @__PURE__ */ jsx13("p", { className: "rf-text-sm rf-font-medium rf-text-muted-foreground", children: "Last Completed" }),
2104
+ /* @__PURE__ */ jsxs9("p", { className: "rf-font-medium rf-text-green-600", children: [
1909
2105
  lastCompletedStep.order_step_id,
1910
2106
  ". ",
1911
2107
  lastCompletedStep.title
1912
2108
  ] })
1913
2109
  ] })
1914
2110
  ] }),
1915
- lastCompletedStep && activeStep && /* @__PURE__ */ jsx11("div", { className: "rf-pl-4", children: /* @__PURE__ */ jsx11(ArrowDown, { className: "rf-h-5 rf-w-5 rf-text-muted-foreground" }) }),
1916
- activeStep && /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-items-start rf-gap-4", children: [
1917
- /* @__PURE__ */ jsx11("div", { className: "rf-flex-shrink-0 rf-mt-0.5", children: /* @__PURE__ */ jsx11("div", { className: "rf-w-8 rf-h-8 rf-rounded-full rf-bg-blue-100 rf-flex rf-items-center rf-justify-center", children: loading ? /* @__PURE__ */ jsx11(Loader23, { className: "rf-h-5 rf-w-5 rf-text-blue-600 rf-animate-spin" }) : /* @__PURE__ */ jsx11("div", { className: "rf-h-2.5 rf-w-2.5 rf-rounded-full rf-bg-blue-600" }) }) }),
1918
- /* @__PURE__ */ jsxs8("div", { className: "rf-flex-1", children: [
1919
- /* @__PURE__ */ jsx11("p", { className: "rf-text-sm rf-font-medium rf-text-muted-foreground", children: "Current Step" }),
1920
- /* @__PURE__ */ jsxs8("p", { className: "rf-font-medium rf-text-blue-600", children: [
2111
+ lastCompletedStep && activeStep && /* @__PURE__ */ jsx13("div", { className: "rf-pl-4", children: /* @__PURE__ */ jsx13(ArrowDown2, { className: "rf-h-5 rf-w-5 rf-text-muted-foreground" }) }),
2112
+ activeStep && /* @__PURE__ */ jsxs9("div", { className: "rf-flex rf-items-start rf-gap-4", children: [
2113
+ /* @__PURE__ */ jsx13("div", { className: "rf-flex-shrink-0 rf-mt-0.5", children: /* @__PURE__ */ jsx13("div", { className: "rf-w-8 rf-h-8 rf-rounded-full rf-bg-blue-100 rf-flex rf-items-center rf-justify-center", children: loading ? /* @__PURE__ */ jsx13(Loader23, { className: "rf-h-5 rf-w-5 rf-text-blue-600 rf-animate-spin" }) : /* @__PURE__ */ jsx13("div", { className: "rf-h-2.5 rf-w-2.5 rf-rounded-full rf-bg-blue-600" }) }) }),
2114
+ /* @__PURE__ */ jsxs9("div", { className: "rf-flex-1", children: [
2115
+ /* @__PURE__ */ jsx13("p", { className: "rf-text-sm rf-font-medium rf-text-muted-foreground", children: "Current Step" }),
2116
+ /* @__PURE__ */ jsxs9("p", { className: "rf-font-medium rf-text-blue-600", children: [
1921
2117
  activeStep.order_step_id,
1922
2118
  ". ",
1923
2119
  activeStep.title
@@ -1925,12 +2121,12 @@ var StepwiseProgressPanel = ({
1925
2121
  ] })
1926
2122
  ] })
1927
2123
  ] }),
1928
- /* @__PURE__ */ jsx11("div", { className: "rf-flex rf-justify-end rf-gap-3 rf-mt-auto", children: onCancel && /* @__PURE__ */ jsx11(Button, { variant: "outline", onClick: onCancel, className: "rf-px-6", children: "Cancel" }) })
2124
+ /* @__PURE__ */ jsx13("div", { className: "rf-flex rf-justify-end rf-gap-3 rf-mt-auto", children: onCancel && /* @__PURE__ */ jsx13(Button, { variant: "outline", onClick: onCancel, className: "rf-px-6", children: "Cancel" }) })
1929
2125
  ] });
1930
2126
  };
1931
2127
 
1932
2128
  // lib/components/OrderDialog/OrderDialog.tsx
1933
- import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
2129
+ import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
1934
2130
  var queryClient = new QueryClient();
1935
2131
  var OrderDialog = ({
1936
2132
  isOpen,
@@ -1939,8 +2135,8 @@ var OrderDialog = ({
1939
2135
  setStage,
1940
2136
  circuitJson
1941
2137
  }) => {
1942
- const [order, setOrder] = useState7(null);
1943
- const [loading, setLoading] = useState7(false);
2138
+ const [order, setOrder] = useState8(null);
2139
+ const [loading, setLoading] = useState8(false);
1944
2140
  const createOrder = async () => {
1945
2141
  const { order: order2 } = await ky3.post("registry/orders/create", {
1946
2142
  json: {
@@ -1957,15 +2153,15 @@ var OrderDialog = ({
1957
2153
  setOrder(order2);
1958
2154
  setStage("progress");
1959
2155
  };
1960
- return /* @__PURE__ */ jsx12(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx12(AlertDialog, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsx12(AlertDialogContent, { className: "!rf-max-w-[660px] !rf-p-0", children: /* @__PURE__ */ jsxs9("div", { className: "rf-relative rf-w-full", children: [
1961
- stage === "initial" && /* @__PURE__ */ jsx12(
2156
+ return /* @__PURE__ */ jsx14(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx14(AlertDialog, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsx14(AlertDialogContent, { className: "!rf-max-w-[660px] !rf-p-0", children: /* @__PURE__ */ jsxs10("div", { className: "rf-relative rf-w-full", children: [
2157
+ stage === "initial" && /* @__PURE__ */ jsx14(
1962
2158
  InitialOrderScreen,
1963
2159
  {
1964
2160
  onCancel: onClose,
1965
2161
  onContinue: handleInitialContinue
1966
2162
  }
1967
2163
  ),
1968
- stage === "progress" && order?.order_id && /* @__PURE__ */ jsx12(
2164
+ stage === "progress" && order?.order_id && /* @__PURE__ */ jsx14(
1969
2165
  StepwiseProgressPanel,
1970
2166
  {
1971
2167
  onCancel: onClose,
@@ -1974,7 +2170,7 @@ var OrderDialog = ({
1974
2170
  setStage
1975
2171
  }
1976
2172
  ),
1977
- stage === "checkout" && /* @__PURE__ */ jsx12(
2173
+ stage === "checkout" && /* @__PURE__ */ jsx14(
1978
2174
  CheckoutOrder,
1979
2175
  {
1980
2176
  finalCost: 0,
@@ -1986,7 +2182,7 @@ var OrderDialog = ({
1986
2182
  };
1987
2183
 
1988
2184
  // lib/components/OrderDialog/CliOrderDialog.tsx
1989
- import { jsx as jsx13 } from "react/jsx-runtime";
2185
+ import { jsx as jsx15 } from "react/jsx-runtime";
1990
2186
  var CliOrderDialog = ({
1991
2187
  isOpen,
1992
2188
  onClose,
@@ -1994,7 +2190,7 @@ var CliOrderDialog = ({
1994
2190
  setStage
1995
2191
  }) => {
1996
2192
  const circuitJson = useRunFrameStore((state) => state.circuitJson);
1997
- return /* @__PURE__ */ jsx13(
2193
+ return /* @__PURE__ */ jsx15(
1998
2194
  OrderDialog,
1999
2195
  {
2000
2196
  isOpen,
@@ -2007,14 +2203,14 @@ var CliOrderDialog = ({
2007
2203
  };
2008
2204
 
2009
2205
  // lib/components/OrderDialog/useOrderDialog.tsx
2010
- import { jsx as jsx14 } from "react/jsx-runtime";
2206
+ import { jsx as jsx16 } from "react/jsx-runtime";
2011
2207
  var OrderDialogComponent = ({
2012
2208
  isOpen,
2013
2209
  onClose,
2014
2210
  stage,
2015
2211
  setStage
2016
2212
  }) => {
2017
- return /* @__PURE__ */ jsx14(
2213
+ return /* @__PURE__ */ jsx16(
2018
2214
  CliOrderDialog,
2019
2215
  {
2020
2216
  isOpen,
@@ -2025,9 +2221,9 @@ var OrderDialogComponent = ({
2025
2221
  );
2026
2222
  };
2027
2223
  var useOrderDialog = () => {
2028
- const [isOpen, setIsOpen] = useState8(false);
2029
- const [stage, setStage] = useState8("initial");
2030
- const [isRegistryConnected, setIsRegistryConnected] = useState8(false);
2224
+ const [isOpen, setIsOpen] = useState9(false);
2225
+ const [stage, setStage] = useState9("initial");
2226
+ const [isRegistryConnected, setIsRegistryConnected] = useState9(false);
2031
2227
  const handleClose = () => {
2032
2228
  setIsOpen(false);
2033
2229
  setStage("initial");
@@ -2045,26 +2241,26 @@ var useOrderDialog = () => {
2045
2241
  };
2046
2242
 
2047
2243
  // lib/components/RunFrameForCli/LeftHeader.tsx
2048
- import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
2244
+ import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
2049
2245
  var RunframeCliLeftHeader = (props) => {
2050
2246
  const lastRunEvalVersion = useRunnerStore((s) => s.lastRunEvalVersion);
2051
- const [snippetName, setSnippetName] = useState9(null);
2052
- const [hasUnsavedChanges, setHasUnsavedChanges] = useState9(false);
2053
- const [hasNeverBeenSaved, setHasNeverBeenSaved] = useState9(true);
2054
- const [isSaving, setIsSaving] = useState9(false);
2055
- const [requestToSaveSentAt, setRequestToSaveSentAt] = useState9(
2247
+ const [snippetName, setSnippetName] = useState10(null);
2248
+ const [hasUnsavedChanges, setHasUnsavedChanges] = useState10(false);
2249
+ const [hasNeverBeenSaved, setHasNeverBeenSaved] = useState10(true);
2250
+ const [isSaving, setIsSaving] = useState10(false);
2251
+ const [requestToSaveSentAt, setRequestToSaveSentAt] = useState10(
2056
2252
  null
2057
2253
  );
2058
- const [availableSnippets, setAvailableSnippets] = useState9(
2254
+ const [availableSnippets, setAvailableSnippets] = useState10(
2059
2255
  null
2060
2256
  );
2061
- const [isSelectSnippetDialogOpen, setIsSelectSnippetDialogOpen] = useState9(false);
2062
- const [notificationMessage, setNotificationMessage] = useState9(
2257
+ const [isSelectSnippetDialogOpen, setIsSelectSnippetDialogOpen] = useState10(false);
2258
+ const [notificationMessage, setNotificationMessage] = useState10(
2063
2259
  null
2064
2260
  );
2065
- const [errorMessage, setErrorMessage] = useState9(null);
2066
- const [isError, setIsError] = useState9(false);
2067
- const [isExporting, setisExporting] = useState9(false);
2261
+ const [errorMessage, setErrorMessage] = useState10(null);
2262
+ const [isError, setIsError] = useState10(false);
2263
+ const [isExporting, setisExporting] = useState10(false);
2068
2264
  const orderDialog = useOrderDialog();
2069
2265
  const pushEvent = useRunFrameStore((state) => state.pushEvent);
2070
2266
  const recentEvents = useRunFrameStore((state) => state.recentEvents);
@@ -2093,7 +2289,7 @@ var RunframeCliLeftHeader = (props) => {
2093
2289
  setisExporting(false);
2094
2290
  }
2095
2291
  });
2096
- useEffect7(() => {
2292
+ useEffect8(() => {
2097
2293
  if (!isSaving || requestToSaveSentAt === null) return;
2098
2294
  const eventsSinceRequestToSave = recentEvents.filter(
2099
2295
  (event) => new Date(event.created_at).valueOf() > requestToSaveSentAt
@@ -2135,12 +2331,12 @@ var RunframeCliLeftHeader = (props) => {
2135
2331
  });
2136
2332
  };
2137
2333
  const circuitJson = useRunFrameStore((state) => state.circuitJson);
2138
- const [isImportDialogOpen, setIsImportDialogOpen] = useState9(false);
2139
- return /* @__PURE__ */ jsxs10(Fragment2, { children: [
2140
- /* @__PURE__ */ jsxs10(DropdownMenu, { children: [
2141
- /* @__PURE__ */ jsx15(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx15("div", { className: "rf-whitespace-nowrap rf-text-xs font-medium rf-p-2 rf-mx-1 rf-cursor-pointer rf-relative", children: "File" }) }),
2142
- /* @__PURE__ */ jsxs10(DropdownMenuContent, { children: [
2143
- /* @__PURE__ */ jsx15(
2334
+ const [isImportDialogOpen, setIsImportDialogOpen] = useState10(false);
2335
+ return /* @__PURE__ */ jsxs11(Fragment2, { children: [
2336
+ /* @__PURE__ */ jsxs11(DropdownMenu, { children: [
2337
+ /* @__PURE__ */ jsx17(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx17("div", { className: "rf-whitespace-nowrap rf-text-xs font-medium rf-p-2 rf-mx-1 rf-cursor-pointer rf-relative", children: "File" }) }),
2338
+ /* @__PURE__ */ jsxs11(DropdownMenuContent, { children: [
2339
+ /* @__PURE__ */ jsx17(
2144
2340
  DropdownMenuItem,
2145
2341
  {
2146
2342
  className: "rf-text-xs",
@@ -2149,7 +2345,7 @@ var RunframeCliLeftHeader = (props) => {
2149
2345
  children: isSaving ? "Saving..." : "Push"
2150
2346
  }
2151
2347
  ),
2152
- parseInt(window.location.port) > 5e3 && /* @__PURE__ */ jsx15(
2348
+ parseInt(window.location.port) > 5e3 && /* @__PURE__ */ jsx17(
2153
2349
  DropdownMenuItem,
2154
2350
  {
2155
2351
  className: "rf-text-xs",
@@ -2159,7 +2355,7 @@ var RunframeCliLeftHeader = (props) => {
2159
2355
  children: "Order"
2160
2356
  }
2161
2357
  ),
2162
- /* @__PURE__ */ jsx15(
2358
+ /* @__PURE__ */ jsx17(
2163
2359
  DropdownMenuItem,
2164
2360
  {
2165
2361
  className: "rf-text-xs",
@@ -2168,8 +2364,8 @@ var RunframeCliLeftHeader = (props) => {
2168
2364
  children: "Import"
2169
2365
  }
2170
2366
  ),
2171
- /* @__PURE__ */ jsxs10(DropdownMenuSub, { children: [
2172
- /* @__PURE__ */ jsx15(
2367
+ /* @__PURE__ */ jsxs11(DropdownMenuSub, { children: [
2368
+ /* @__PURE__ */ jsx17(
2173
2369
  DropdownMenuSubTrigger,
2174
2370
  {
2175
2371
  className: "rf-text-xs",
@@ -2177,7 +2373,7 @@ var RunframeCliLeftHeader = (props) => {
2177
2373
  children: isExporting ? "Exporting..." : "Export"
2178
2374
  }
2179
2375
  ),
2180
- /* @__PURE__ */ jsx15(DropdownMenuPortal, { children: /* @__PURE__ */ jsx15(DropdownMenuSubContent, { children: availableExports.map((exp, i) => /* @__PURE__ */ jsx15(
2376
+ /* @__PURE__ */ jsx17(DropdownMenuPortal, { children: /* @__PURE__ */ jsx17(DropdownMenuSubContent, { children: availableExports.map((exp, i) => /* @__PURE__ */ jsx17(
2181
2377
  DropdownMenuItem,
2182
2378
  {
2183
2379
  onSelect: () => {
@@ -2192,16 +2388,16 @@ var RunframeCliLeftHeader = (props) => {
2192
2388
  });
2193
2389
  },
2194
2390
  disabled: isExporting,
2195
- children: /* @__PURE__ */ jsx15("span", { className: "rf-text-xs", children: exp.name })
2391
+ children: /* @__PURE__ */ jsx17("span", { className: "rf-text-xs", children: exp.name })
2196
2392
  },
2197
2393
  i
2198
2394
  )) }) })
2199
2395
  ] }),
2200
- /* @__PURE__ */ jsxs10(DropdownMenuSub, { children: [
2201
- /* @__PURE__ */ jsx15(DropdownMenuSubTrigger, { className: "rf-text-xs", children: "Advanced" }),
2202
- /* @__PURE__ */ jsx15(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs10(DropdownMenuSubContent, { children: [
2203
- /* @__PURE__ */ jsx15(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsxs10("div", { className: "rf-flex rf-items-center rf-gap-2", children: [
2204
- /* @__PURE__ */ jsx15(
2396
+ /* @__PURE__ */ jsxs11(DropdownMenuSub, { children: [
2397
+ /* @__PURE__ */ jsx17(DropdownMenuSubTrigger, { className: "rf-text-xs", children: "Advanced" }),
2398
+ /* @__PURE__ */ jsx17(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs11(DropdownMenuSubContent, { children: [
2399
+ /* @__PURE__ */ jsx17(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsxs11("div", { className: "rf-flex rf-items-center rf-gap-2", children: [
2400
+ /* @__PURE__ */ jsx17(
2205
2401
  Checkbox,
2206
2402
  {
2207
2403
  id: "load-latest-eval",
@@ -2211,7 +2407,7 @@ var RunframeCliLeftHeader = (props) => {
2211
2407
  }
2212
2408
  }
2213
2409
  ),
2214
- /* @__PURE__ */ jsx15(
2410
+ /* @__PURE__ */ jsx17(
2215
2411
  "label",
2216
2412
  {
2217
2413
  htmlFor: "load-latest-eval",
@@ -2220,31 +2416,31 @@ var RunframeCliLeftHeader = (props) => {
2220
2416
  }
2221
2417
  )
2222
2418
  ] }) }),
2223
- lastRunEvalVersion && /* @__PURE__ */ jsx15(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsx15("div", { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsxs10("span", { className: "rf-text-xs", children: [
2419
+ lastRunEvalVersion && /* @__PURE__ */ jsx17(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsx17("div", { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsxs11("span", { className: "rf-text-xs", children: [
2224
2420
  "@tscircuit/eval@",
2225
2421
  lastRunEvalVersion
2226
2422
  ] }) }) }),
2227
- /* @__PURE__ */ jsx15(
2423
+ /* @__PURE__ */ jsx17(
2228
2424
  DropdownMenuItem,
2229
2425
  {
2230
2426
  className: "rf-flex rf-items-center rf-gap-2",
2231
2427
  onClick: () => {
2232
2428
  window.open("/api/admin", "_blank");
2233
2429
  },
2234
- children: /* @__PURE__ */ jsx15("div", { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsx15("span", { className: "rf-text-xs", children: "CLI Admin Panel" }) })
2430
+ children: /* @__PURE__ */ jsx17("div", { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsx17("span", { className: "rf-text-xs", children: "CLI Admin Panel" }) })
2235
2431
  }
2236
2432
  )
2237
2433
  ] }) })
2238
2434
  ] })
2239
2435
  ] }),
2240
- /* @__PURE__ */ jsx15(AlertDialog, { open: isError, onOpenChange: setIsError, children: /* @__PURE__ */ jsxs10(AlertDialogContent, { children: [
2241
- /* @__PURE__ */ jsxs10(AlertDialogHeader, { children: [
2242
- /* @__PURE__ */ jsx15(AlertDialogTitle, { children: "Error Saving Snippet" }),
2243
- /* @__PURE__ */ jsx15(AlertDialogDescription, { children: errorMessage })
2436
+ /* @__PURE__ */ jsx17(AlertDialog, { open: isError, onOpenChange: setIsError, children: /* @__PURE__ */ jsxs11(AlertDialogContent, { children: [
2437
+ /* @__PURE__ */ jsxs11(AlertDialogHeader, { children: [
2438
+ /* @__PURE__ */ jsx17(AlertDialogTitle, { children: "Error Saving Snippet" }),
2439
+ /* @__PURE__ */ jsx17(AlertDialogDescription, { children: errorMessage })
2244
2440
  ] }),
2245
- /* @__PURE__ */ jsx15(AlertDialogFooter, { children: /* @__PURE__ */ jsx15(AlertDialogCancel, { onClick: () => setIsError(false), children: "Dismiss" }) })
2441
+ /* @__PURE__ */ jsx17(AlertDialogFooter, { children: /* @__PURE__ */ jsx17(AlertDialogCancel, { onClick: () => setIsError(false), children: "Dismiss" }) })
2246
2442
  ] }) }),
2247
- /* @__PURE__ */ jsx15(
2443
+ /* @__PURE__ */ jsx17(
2248
2444
  SelectSnippetDialog,
2249
2445
  {
2250
2446
  snippetNames: availableSnippets ?? [],
@@ -2263,7 +2459,7 @@ var RunframeCliLeftHeader = (props) => {
2263
2459
  }
2264
2460
  )
2265
2461
  ] }),
2266
- /* @__PURE__ */ jsx15(
2462
+ /* @__PURE__ */ jsx17(
2267
2463
  ImportComponentDialog,
2268
2464
  {
2269
2465
  isOpen: isImportDialogOpen,
@@ -2292,8 +2488,8 @@ var RunframeCliLeftHeader = (props) => {
2292
2488
  }
2293
2489
  }
2294
2490
  ),
2295
- /* @__PURE__ */ jsx15(Toaster, { position: "top-center", reverseOrder: false }),
2296
- /* @__PURE__ */ jsx15(
2491
+ /* @__PURE__ */ jsx17(Toaster, { position: "top-center", reverseOrder: false }),
2492
+ /* @__PURE__ */ jsx17(
2297
2493
  orderDialog.OrderDialog,
2298
2494
  {
2299
2495
  isOpen: orderDialog.isOpen,
@@ -2306,21 +2502,21 @@ var RunframeCliLeftHeader = (props) => {
2306
2502
  };
2307
2503
 
2308
2504
  // lib/components/RunFrameForCli/RunFrameForCli.tsx
2309
- import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
2505
+ import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
2310
2506
  var RunFrameForCli = (props) => {
2311
2507
  const [shouldLoadLatestEval, setLoadLatestEval] = useLocalStorageState(
2312
2508
  "load-latest-eval",
2313
2509
  true
2314
2510
  );
2315
- return /* @__PURE__ */ jsx16(
2511
+ return /* @__PURE__ */ jsx18(
2316
2512
  RunFrameWithApi,
2317
2513
  {
2318
2514
  debug: props.debug,
2319
2515
  forceLatestEvalVersion: shouldLoadLatestEval,
2320
2516
  defaultToFullScreen: true,
2321
2517
  showToggleFullScreen: false,
2322
- leftHeaderContent: /* @__PURE__ */ jsxs11("div", { className: "rf-flex rf-items-center rf-justify-between", children: [
2323
- /* @__PURE__ */ jsx16(
2518
+ leftHeaderContent: /* @__PURE__ */ jsxs12("div", { className: "rf-flex rf-items-center rf-justify-between", children: [
2519
+ /* @__PURE__ */ jsx18(
2324
2520
  RunframeCliLeftHeader,
2325
2521
  {
2326
2522
  shouldLoadLatestEval,