braid-ui 1.0.8 → 1.0.10

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.cjs CHANGED
@@ -5791,6 +5791,50 @@ var StatementView = ({
5791
5791
  !statementGenerated && /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
5792
5792
  /* @__PURE__ */ jsxRuntime.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: "Statement Parameters" }) }),
5793
5793
  /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "space-y-4", children: [
5794
+ statementType === "program" && programsError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 p-4 bg-destructive/10 border border-destructive/20 rounded-md", children: [
5795
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
5796
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-5 w-5 text-destructive flex-shrink-0" }),
5797
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5798
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-destructive", children: "Failed to load programs" }),
5799
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive/80 mt-0.5", children: programsError })
5800
+ ] })
5801
+ ] }),
5802
+ /* @__PURE__ */ jsxRuntime.jsxs(
5803
+ Button,
5804
+ {
5805
+ onClick: onRetryFetch,
5806
+ variant: "outline",
5807
+ size: "sm",
5808
+ disabled: programsLoading,
5809
+ children: [
5810
+ programsLoading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "h-4 w-4" }),
5811
+ "Retry"
5812
+ ]
5813
+ }
5814
+ )
5815
+ ] }),
5816
+ statementType === "product" && productsError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 p-4 bg-destructive/10 border border-destructive/20 rounded-md", children: [
5817
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
5818
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-5 w-5 text-destructive flex-shrink-0" }),
5819
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5820
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-destructive", children: "Failed to load products" }),
5821
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive/80 mt-0.5", children: productsError })
5822
+ ] })
5823
+ ] }),
5824
+ /* @__PURE__ */ jsxRuntime.jsxs(
5825
+ Button,
5826
+ {
5827
+ onClick: onRetryFetch,
5828
+ variant: "outline",
5829
+ size: "sm",
5830
+ disabled: productsLoading,
5831
+ children: [
5832
+ productsLoading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "h-4 w-4" }),
5833
+ "Retry"
5834
+ ]
5835
+ }
5836
+ )
5837
+ ] }),
5794
5838
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4", children: [
5795
5839
  /* @__PURE__ */ jsxRuntime.jsx(
5796
5840
  EnhancedSelect,
@@ -5802,14 +5846,6 @@ var StatementView = ({
5802
5846
  onValueChange: onStatementTypeChange
5803
5847
  }
5804
5848
  ),
5805
- statementType === "program" && programsError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-md text-sm text-destructive", children: [
5806
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-4 w-4" }),
5807
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: programsError })
5808
- ] }) }),
5809
- statementType === "product" && productsError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-md text-sm text-destructive", children: [
5810
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-4 w-4" }),
5811
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: productsError })
5812
- ] }) }),
5813
5849
  statementType === "program" && /* @__PURE__ */ jsxRuntime.jsx(
5814
5850
  EnhancedSelect,
5815
5851
  {
@@ -5866,21 +5902,7 @@ var StatementView = ({
5866
5902
  )
5867
5903
  ] })
5868
5904
  ] }),
5869
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: shouldShowRetry ? /* @__PURE__ */ jsxRuntime.jsxs(
5870
- Button,
5871
- {
5872
- onClick: onRetryFetch,
5873
- variant: "outline",
5874
- disabled: programsLoading || productsLoading,
5875
- children: [
5876
- (programsLoading || productsLoading) && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin" }),
5877
- programsLoading || productsLoading ? "Retrying..." : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5878
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "h-4 w-4" }),
5879
- "Retry"
5880
- ] })
5881
- ]
5882
- }
5883
- ) : /* @__PURE__ */ jsxRuntime.jsxs(
5905
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsxs(
5884
5906
  Button,
5885
5907
  {
5886
5908
  onClick: onGenerateStatement,
@@ -8723,7 +8745,12 @@ function Statement() {
8723
8745
  setProgramsError(null);
8724
8746
  try {
8725
8747
  await new Promise((resolve) => setTimeout(resolve, 1e3));
8726
- setPrograms(mockPrograms);
8748
+ throw new Error("Network connection timeout - Unable to reach program service");
8749
+ const data = mockPrograms;
8750
+ if (typeof data === "string") {
8751
+ throw new Error(data);
8752
+ }
8753
+ setPrograms(data);
8727
8754
  } catch (error) {
8728
8755
  const errorMessage = error instanceof Error ? error.message : "Failed to load programs";
8729
8756
  setProgramsError(errorMessage);
@@ -8742,7 +8769,11 @@ function Statement() {
8742
8769
  setProductsError(null);
8743
8770
  try {
8744
8771
  await new Promise((resolve) => setTimeout(resolve, 1e3));
8745
- setProducts(mockProducts);
8772
+ const data = mockProducts;
8773
+ if (typeof data === "string") {
8774
+ throw new Error(data);
8775
+ }
8776
+ setProducts(data);
8746
8777
  } catch (error) {
8747
8778
  const errorMessage = error instanceof Error ? error.message : "Failed to load products";
8748
8779
  setProductsError(errorMessage);