@secondlayer/stacks 0.2.2 → 0.3.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 (159) hide show
  1. package/dist/shared/stacks-02actsrx.cjs.map +2 -2
  2. package/dist/shared/{stacks-xp9n3r0t.js → stacks-09wa7ewe.js} +108 -108
  3. package/dist/shared/stacks-09wa7ewe.js.map +15 -0
  4. package/dist/shared/{stacks-ky14tdf6.cjs → stacks-0nfexv24.cjs} +20 -8
  5. package/dist/shared/stacks-0nfexv24.cjs.map +14 -0
  6. package/dist/shared/{stacks-an5k8n4t.cjs → stacks-14pgpkrr.cjs} +82 -73
  7. package/dist/shared/stacks-14pgpkrr.cjs.map +23 -0
  8. package/dist/shared/{stacks-v6ja2eh7.cjs → stacks-17sdtaxg.cjs} +106 -102
  9. package/dist/shared/stacks-17sdtaxg.cjs.map +15 -0
  10. package/dist/shared/{stacks-96gaxfcf.js → stacks-1s5w4ncf.js} +44 -32
  11. package/dist/shared/stacks-1s5w4ncf.js.map +17 -0
  12. package/dist/shared/stacks-24h5k94q.cjs.map +3 -3
  13. package/dist/shared/{stacks-evnzth1q.cjs → stacks-4vzmhw3q.cjs} +3 -3
  14. package/dist/shared/stacks-4vzmhw3q.cjs.map +10 -0
  15. package/dist/shared/{stacks-k9p8m3wf.js → stacks-4x2bcc2k.js} +87 -78
  16. package/dist/shared/stacks-4x2bcc2k.js.map +23 -0
  17. package/dist/shared/stacks-5tprhns9.cjs.map +3 -3
  18. package/dist/shared/stacks-709tra19.js.map +2 -2
  19. package/dist/shared/{stacks-q79dx28x.js → stacks-70p84bgg.js} +3 -3
  20. package/dist/shared/stacks-70p84bgg.js.map +10 -0
  21. package/dist/shared/{stacks-k2p5tv6x.js → stacks-913a2rx7.js} +3 -3
  22. package/dist/shared/stacks-913a2rx7.js.map +10 -0
  23. package/dist/shared/{stacks-jrnmh4kc.js → stacks-96d6m1zy.js} +15 -6
  24. package/dist/shared/stacks-96d6m1zy.js.map +11 -0
  25. package/dist/shared/stacks-9g0jhab3.cjs.map +2 -2
  26. package/dist/shared/stacks-dr5en54r.cjs.map +2 -2
  27. package/dist/shared/stacks-fcaefc5b.cjs.map +2 -2
  28. package/dist/shared/stacks-gck1sq7h.cjs.map +2 -2
  29. package/dist/shared/stacks-je937aas.js.map +2 -2
  30. package/dist/shared/{stacks-k58k970n.js → stacks-kg1npstf.js} +5 -3
  31. package/dist/shared/stacks-kg1npstf.js.map +10 -0
  32. package/dist/shared/{stacks-qvg7c24g.cjs → stacks-n98w7g57.cjs} +5 -3
  33. package/dist/shared/stacks-n98w7g57.cjs.map +10 -0
  34. package/dist/shared/{stacks-6m1z4j07.js → stacks-nqae5amn.cjs} +74 -160
  35. package/dist/shared/stacks-nqae5amn.cjs.map +10 -0
  36. package/dist/shared/stacks-qcae5852.js.map +2 -2
  37. package/dist/shared/stacks-qt8ehebn.js.map +3 -3
  38. package/dist/shared/stacks-ra02bpny.cjs.map +3 -3
  39. package/dist/shared/stacks-rwfgts3s.js.map +2 -2
  40. package/dist/shared/stacks-s10yb9gz.js.map +2 -2
  41. package/dist/shared/{stacks-etf219gs.cjs → stacks-s30kkvm8.js} +101 -118
  42. package/dist/shared/stacks-s30kkvm8.js.map +10 -0
  43. package/dist/shared/stacks-s7z5q8be.js.map +3 -3
  44. package/dist/shared/stacks-v9jqcpd4.js.map +2 -2
  45. package/dist/shared/stacks-vdfag81a.cjs.map +2 -2
  46. package/dist/shared/{stacks-rg1g0fja.js → stacks-wjem3xw9.js} +21 -9
  47. package/dist/shared/stacks-wjem3xw9.js.map +14 -0
  48. package/dist/shared/{stacks-k08tgzyp.cjs → stacks-wyxj879g.cjs} +3 -3
  49. package/dist/shared/stacks-wyxj879g.cjs.map +13 -0
  50. package/dist/shared/stacks-y3dh7hv1.js.map +3 -3
  51. package/dist/shared/{stacks-2ar4prfz.cjs → stacks-y5262j0z.cjs} +14 -5
  52. package/dist/shared/stacks-y5262j0z.cjs.map +11 -0
  53. package/dist/shared/stacks-ya3x01yd.cjs.map +2 -2
  54. package/dist/shared/{stacks-p93g814f.js → stacks-zf7rbpzp.js} +4 -4
  55. package/dist/shared/stacks-zf7rbpzp.js.map +13 -0
  56. package/dist/shared/{stacks-61rvzkz1.cjs → stacks-znrb59ce.cjs} +41 -29
  57. package/dist/shared/stacks-znrb59ce.cjs.map +17 -0
  58. package/dist/src/accounts/index.cjs +2 -2
  59. package/dist/src/accounts/index.cjs.map +5 -5
  60. package/dist/src/accounts/index.js +2 -6
  61. package/dist/src/accounts/index.js.map +5 -5
  62. package/dist/src/actions/index.d.cts +29 -29
  63. package/dist/src/actions/index.d.ts +29 -29
  64. package/dist/src/actions/index.js +7 -7
  65. package/dist/src/bns/index.cjs +55 -43
  66. package/dist/src/bns/index.cjs.map +9 -9
  67. package/dist/src/bns/index.d.cts +29 -29
  68. package/dist/src/bns/index.d.ts +29 -29
  69. package/dist/src/bns/index.js +62 -50
  70. package/dist/src/bns/index.js.map +9 -9
  71. package/dist/src/clarity/index.js +4 -4
  72. package/dist/src/connect/index.cjs +114 -112
  73. package/dist/src/connect/index.cjs.map +13 -13
  74. package/dist/src/connect/index.js +114 -112
  75. package/dist/src/connect/index.js.map +13 -13
  76. package/dist/src/connect/walletconnect/index.cjs +3 -3
  77. package/dist/src/connect/walletconnect/index.cjs.map +10 -10
  78. package/dist/src/connect/walletconnect/index.js +3 -3
  79. package/dist/src/connect/walletconnect/index.js.map +10 -10
  80. package/dist/src/index.cjs +108 -2
  81. package/dist/src/index.cjs.map +19 -15
  82. package/dist/src/index.d.cts +291 -112
  83. package/dist/src/index.d.ts +291 -112
  84. package/dist/src/index.js +122 -9
  85. package/dist/src/index.js.map +19 -15
  86. package/dist/src/pox/index.cjs.map +6 -6
  87. package/dist/src/pox/index.d.cts +29 -29
  88. package/dist/src/pox/index.d.ts +29 -29
  89. package/dist/src/pox/index.js +5 -5
  90. package/dist/src/pox/index.js.map +6 -6
  91. package/dist/src/stackingdao/index.cjs +31 -6
  92. package/dist/src/stackingdao/index.cjs.map +6 -6
  93. package/dist/src/stackingdao/index.d.cts +29 -29
  94. package/dist/src/stackingdao/index.d.ts +29 -29
  95. package/dist/src/stackingdao/index.js +37 -12
  96. package/dist/src/stackingdao/index.js.map +6 -6
  97. package/dist/src/subscriptions/index.d.cts +29 -29
  98. package/dist/src/subscriptions/index.d.ts +29 -29
  99. package/dist/src/tools/btc/index.cjs +130 -0
  100. package/dist/src/tools/btc/index.cjs.map +10 -0
  101. package/dist/src/tools/btc/index.d.cts +8 -0
  102. package/dist/src/tools/btc/index.d.ts +8 -0
  103. package/dist/src/tools/btc/index.js +89 -0
  104. package/dist/src/tools/btc/index.js.map +10 -0
  105. package/dist/src/tools/index.cjs +2470 -0
  106. package/dist/src/tools/index.cjs.map +61 -0
  107. package/dist/src/tools/index.d.cts +144 -0
  108. package/dist/src/tools/index.d.ts +144 -0
  109. package/dist/src/tools/index.js +2435 -0
  110. package/dist/src/tools/index.js.map +61 -0
  111. package/dist/src/transactions/index.js +3 -3
  112. package/dist/src/triggers/index.cjs +66 -0
  113. package/dist/src/triggers/index.cjs.map +10 -0
  114. package/dist/src/triggers/index.d.cts +116 -0
  115. package/dist/src/triggers/index.d.ts +116 -0
  116. package/dist/src/triggers/index.js +25 -0
  117. package/dist/src/triggers/index.js.map +10 -0
  118. package/dist/src/tx/index.cjs +65 -0
  119. package/dist/src/tx/index.cjs.map +10 -0
  120. package/dist/src/tx/index.d.cts +42 -0
  121. package/dist/src/tx/index.d.ts +42 -0
  122. package/dist/src/tx/index.js +22 -0
  123. package/dist/src/tx/index.js.map +10 -0
  124. package/dist/src/ui/index.cjs +431 -0
  125. package/dist/src/ui/index.cjs.map +27 -0
  126. package/dist/src/ui/index.d.cts +107 -0
  127. package/dist/src/ui/index.d.ts +107 -0
  128. package/dist/src/ui/index.js +391 -0
  129. package/dist/src/ui/index.js.map +27 -0
  130. package/dist/src/ui/schemas.cjs +134 -0
  131. package/dist/src/ui/schemas.cjs.map +18 -0
  132. package/dist/src/ui/schemas.d.cts +83 -0
  133. package/dist/src/ui/schemas.d.ts +83 -0
  134. package/dist/src/ui/schemas.js +91 -0
  135. package/dist/src/ui/schemas.js.map +18 -0
  136. package/dist/src/utils/index.cjs +3 -3
  137. package/dist/src/utils/index.cjs.map +4 -4
  138. package/dist/src/utils/index.js +4 -4
  139. package/dist/src/utils/index.js.map +4 -4
  140. package/package.json +157 -105
  141. package/dist/shared/stacks-2ar4prfz.cjs.map +0 -11
  142. package/dist/shared/stacks-61rvzkz1.cjs.map +0 -17
  143. package/dist/shared/stacks-6m1z4j07.js.map +0 -10
  144. package/dist/shared/stacks-96gaxfcf.js.map +0 -17
  145. package/dist/shared/stacks-an5k8n4t.cjs.map +0 -23
  146. package/dist/shared/stacks-etf219gs.cjs.map +0 -10
  147. package/dist/shared/stacks-evnzth1q.cjs.map +0 -10
  148. package/dist/shared/stacks-jrnmh4kc.js.map +0 -11
  149. package/dist/shared/stacks-k08tgzyp.cjs.map +0 -13
  150. package/dist/shared/stacks-k2p5tv6x.js.map +0 -10
  151. package/dist/shared/stacks-k58k970n.js.map +0 -10
  152. package/dist/shared/stacks-k9p8m3wf.js.map +0 -23
  153. package/dist/shared/stacks-ky14tdf6.cjs.map +0 -13
  154. package/dist/shared/stacks-p93g814f.js.map +0 -13
  155. package/dist/shared/stacks-q79dx28x.js.map +0 -10
  156. package/dist/shared/stacks-qvg7c24g.cjs.map +0 -10
  157. package/dist/shared/stacks-rg1g0fja.js.map +0 -13
  158. package/dist/shared/stacks-v6ja2eh7.cjs.map +0 -15
  159. package/dist/shared/stacks-xp9n3r0t.js.map +0 -15
@@ -0,0 +1,107 @@
1
+ import { defineCatalog } from "@json-render/core";
2
+ import { schema } from "@json-render/react";
3
+ import { ReactElement } from "react";
4
+ import { z } from "zod";
5
+ /**
6
+ * Shared shape for all Stacks UI atom components — keeps `*Component` +
7
+ * the `atoms` registry typed explicitly so oxc's isolated-declarations
8
+ * mode (used by bunup for fast .d.ts generation) can emit the package's
9
+ * declaration files without walking through every atom's props Zod schema.
10
+ */
11
+ type AtomRender = (props: any) => ReactElement;
12
+ interface StacksAtom {
13
+ props: z.ZodTypeAny;
14
+ render: AtomRender;
15
+ }
16
+ import { ReactElement as ReactElement2 } from "react";
17
+ import { z as z2 } from "zod";
18
+ interface AddressPropsType {
19
+ value: string;
20
+ bns?: string | null | undefined;
21
+ truncate?: boolean;
22
+ }
23
+ declare const AddressProps: z2.ZodTypeAny;
24
+ declare function Address(props: AddressPropsType): ReactElement2;
25
+ import { ReactElement as ReactElement3 } from "react";
26
+ import { z as z3 } from "zod";
27
+ interface AmountPropsType {
28
+ microUnits: string;
29
+ decimals?: number;
30
+ symbol?: string;
31
+ usdValue?: number | null | undefined;
32
+ }
33
+ declare const AmountProps: z3.ZodTypeAny;
34
+ declare function Amount(props: AmountPropsType): ReactElement3;
35
+ import { ReactElement as ReactElement4 } from "react";
36
+ import { z as z4 } from "zod";
37
+ interface BlockHeightPropsType {
38
+ height: number;
39
+ timestamp?: string | null | undefined;
40
+ }
41
+ declare const BlockHeightProps: z4.ZodTypeAny;
42
+ declare function BlockHeight(props: BlockHeightPropsType): ReactElement4;
43
+ import { ReactElement as ReactElement5 } from "react";
44
+ import { z as z5 } from "zod";
45
+ interface BnsNamePropsType {
46
+ name: string;
47
+ namespace: string;
48
+ expiresAt?: string | null | undefined;
49
+ }
50
+ declare const BnsNameProps: z5.ZodTypeAny;
51
+ declare function BnsName(props: BnsNamePropsType): ReactElement5;
52
+ import { ReactElement as ReactElement6 } from "react";
53
+ import { z as z6 } from "zod";
54
+ interface NftAssetPropsType {
55
+ assetIdentifier: string;
56
+ tokenId: string;
57
+ name?: string | null | undefined;
58
+ imageUrl?: string | null | undefined;
59
+ }
60
+ declare const NftAssetProps: z6.ZodTypeAny;
61
+ declare function NftAsset(props: NftAssetPropsType): ReactElement6;
62
+ import { ReactElement as ReactElement7 } from "react";
63
+ import { z as z7 } from "zod";
64
+ interface PrincipalPropsType {
65
+ value: string;
66
+ bns?: string | null | undefined;
67
+ kind?: "standard" | "contract" | undefined;
68
+ }
69
+ declare const PrincipalProps: z7.ZodTypeAny;
70
+ declare function Principal(props: PrincipalPropsType): ReactElement7;
71
+ import { ReactElement as ReactElement8 } from "react";
72
+ import { z as z8 } from "zod";
73
+ interface TokenPropsType {
74
+ symbol: string;
75
+ contract?: string | null | undefined;
76
+ decimals?: number;
77
+ }
78
+ declare const TokenProps: z8.ZodTypeAny;
79
+ declare function Token(props: TokenPropsType): ReactElement8;
80
+ import { ReactElement as ReactElement9 } from "react";
81
+ import { z as z9 } from "zod";
82
+ interface TxStatusPropsType {
83
+ status: "pending" | "success" | "failed" | "abort_by_post_condition" | "abort_by_response";
84
+ txId?: string | null | undefined;
85
+ }
86
+ declare const TxStatusProps: z9.ZodTypeAny;
87
+ declare function TxStatus(props: TxStatusPropsType): ReactElement9;
88
+ import { ReactElement as ReactElement10 } from "react";
89
+ type AtomRenderer = (args: {
90
+ element: {
91
+ props: unknown
92
+ }
93
+ }) => ReactElement10;
94
+ /**
95
+ * Component map for `createRenderer()` from `@json-render/react`. Bridges
96
+ * json-render's `{ element }` wrapper back to each atom's typed props
97
+ * signature.
98
+ *
99
+ * import { createRenderer } from "@json-render/react";
100
+ * import { defineCatalog, schema, atoms, atomComponentMap } from "@secondlayer/stacks/ui";
101
+ * const catalog = defineCatalog(schema, { components: atoms, actions: {} });
102
+ * const Renderer = createRenderer(catalog, atomComponentMap);
103
+ * // <Renderer spec={step.output.spec} />
104
+ */
105
+ declare const atomComponentMap: Record<string, AtomRenderer>;
106
+ declare const atoms: Record<string, StacksAtom>;
107
+ export { schema, defineCatalog, atoms, atomComponentMap, TxStatusProps, TxStatus, TokenProps, Token, StacksAtom, PrincipalProps, Principal, NftAssetProps, NftAsset, BnsNameProps, BnsName, BlockHeightProps, BlockHeight, AmountProps, Amount, AddressProps, Address };
@@ -0,0 +1,391 @@
1
+ // src/ui/index.ts
2
+ import { defineCatalog } from "@json-render/core";
3
+ import { schema } from "@json-render/react";
4
+
5
+ // src/ui/atoms/address.schema.ts
6
+ import { z } from "zod";
7
+ var AddressProps = z.object({
8
+ value: z.string().describe("Stacks principal (SP…/SM…/ST…)"),
9
+ bns: z.string().nullable().optional().describe("Optional BNS override"),
10
+ truncate: z.boolean().optional().default(true)
11
+ });
12
+
13
+ // src/ui/atoms/address.tsx
14
+ import { jsxDEV } from "react/jsx-dev-runtime";
15
+ function truncatePrincipal(value) {
16
+ if (value.length <= 14)
17
+ return value;
18
+ return `${value.slice(0, 6)}…${value.slice(-4)}`;
19
+ }
20
+ function Address(props) {
21
+ const display = props.bns ?? (props.truncate ? truncatePrincipal(props.value) : props.value);
22
+ return /* @__PURE__ */ jsxDEV("span", {
23
+ className: "font-mono text-sm",
24
+ title: props.value,
25
+ children: display
26
+ }, undefined, false, undefined, this);
27
+ }
28
+ var AddressComponent = {
29
+ props: AddressProps,
30
+ render: Address
31
+ };
32
+
33
+ // src/ui/atoms/amount.schema.ts
34
+ import { z as z2 } from "zod";
35
+ var AmountProps = z2.object({
36
+ microUnits: z2.string().describe("Amount in micro-units (as string to preserve bigint precision)"),
37
+ decimals: z2.number().int().min(0).max(18).default(6).describe("Decimal places (6 for STX, 8 for sBTC, varies for SIP-010 tokens)"),
38
+ symbol: z2.string().default("STX"),
39
+ usdValue: z2.number().nullable().optional()
40
+ });
41
+
42
+ // src/ui/atoms/amount.tsx
43
+ import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
44
+ function formatAmount(microUnits, decimals) {
45
+ try {
46
+ const raw = BigInt(microUnits);
47
+ const divisor = 10n ** BigInt(decimals);
48
+ const whole = raw / divisor;
49
+ const fraction = raw % divisor;
50
+ if (fraction === 0n)
51
+ return whole.toLocaleString();
52
+ const fracStr = fraction.toString().padStart(decimals, "0").replace(/0+$/, "");
53
+ return `${whole.toLocaleString()}.${fracStr}`;
54
+ } catch {
55
+ return microUnits;
56
+ }
57
+ }
58
+ function Amount(props) {
59
+ const decimals = props.decimals ?? 6;
60
+ const symbol = props.symbol ?? "STX";
61
+ const formatted = formatAmount(props.microUnits, decimals);
62
+ return /* @__PURE__ */ jsxDEV2("span", {
63
+ className: "font-mono tabular-nums",
64
+ children: [
65
+ /* @__PURE__ */ jsxDEV2("span", {
66
+ className: "font-medium",
67
+ children: formatted
68
+ }, undefined, false, undefined, this),
69
+ /* @__PURE__ */ jsxDEV2("span", {
70
+ className: "ml-1 text-muted-foreground",
71
+ children: symbol
72
+ }, undefined, false, undefined, this),
73
+ props.usdValue != null && /* @__PURE__ */ jsxDEV2("span", {
74
+ className: "ml-2 text-sm text-muted-foreground",
75
+ children: [
76
+ "($",
77
+ props.usdValue.toLocaleString(undefined, {
78
+ maximumFractionDigits: 2
79
+ }),
80
+ ")"
81
+ ]
82
+ }, undefined, true, undefined, this)
83
+ ]
84
+ }, undefined, true, undefined, this);
85
+ }
86
+ var AmountComponent = {
87
+ props: AmountProps,
88
+ render: Amount
89
+ };
90
+
91
+ // src/ui/atoms/blockHeight.schema.ts
92
+ import { z as z3 } from "zod";
93
+ var BlockHeightProps = z3.object({
94
+ height: z3.number().int().nonnegative(),
95
+ timestamp: z3.string().nullable().optional().describe("ISO-8601 block timestamp")
96
+ });
97
+
98
+ // src/ui/atoms/blockHeight.tsx
99
+ import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
100
+ function relative(timestamp) {
101
+ if (!timestamp)
102
+ return null;
103
+ const then = new Date(timestamp).getTime();
104
+ if (Number.isNaN(then))
105
+ return null;
106
+ const delta = Math.max(0, Date.now() - then);
107
+ const s = Math.floor(delta / 1000);
108
+ if (s < 60)
109
+ return `${s}s ago`;
110
+ const m = Math.floor(s / 60);
111
+ if (m < 60)
112
+ return `${m}m ago`;
113
+ const h = Math.floor(m / 60);
114
+ if (h < 24)
115
+ return `${h}h ago`;
116
+ return `${Math.floor(h / 24)}d ago`;
117
+ }
118
+ function BlockHeight(props) {
119
+ const rel = relative(props.timestamp);
120
+ return /* @__PURE__ */ jsxDEV3("span", {
121
+ className: "font-mono text-sm",
122
+ children: [
123
+ /* @__PURE__ */ jsxDEV3("span", {
124
+ children: [
125
+ "#",
126
+ props.height.toLocaleString()
127
+ ]
128
+ }, undefined, true, undefined, this),
129
+ rel && /* @__PURE__ */ jsxDEV3("span", {
130
+ className: "ml-1 text-muted-foreground",
131
+ children: [
132
+ "· ",
133
+ rel
134
+ ]
135
+ }, undefined, true, undefined, this)
136
+ ]
137
+ }, undefined, true, undefined, this);
138
+ }
139
+ var BlockHeightComponent = {
140
+ props: BlockHeightProps,
141
+ render: BlockHeight
142
+ };
143
+
144
+ // src/ui/atoms/bnsName.schema.ts
145
+ import { z as z4 } from "zod";
146
+ var BnsNameProps = z4.object({
147
+ name: z4.string(),
148
+ namespace: z4.string(),
149
+ expiresAt: z4.string().nullable().optional().describe("ISO-8601 timestamp")
150
+ });
151
+
152
+ // src/ui/atoms/bnsName.tsx
153
+ import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
154
+ function BnsName(props) {
155
+ return /* @__PURE__ */ jsxDEV4("span", {
156
+ className: "font-mono text-sm",
157
+ children: [
158
+ /* @__PURE__ */ jsxDEV4("span", {
159
+ className: "font-medium",
160
+ children: props.name
161
+ }, undefined, false, undefined, this),
162
+ /* @__PURE__ */ jsxDEV4("span", {
163
+ className: "text-muted-foreground",
164
+ children: [
165
+ ".",
166
+ props.namespace
167
+ ]
168
+ }, undefined, true, undefined, this)
169
+ ]
170
+ }, undefined, true, undefined, this);
171
+ }
172
+ var BnsNameComponent = {
173
+ props: BnsNameProps,
174
+ render: BnsName
175
+ };
176
+
177
+ // src/ui/atoms/nftAsset.schema.ts
178
+ import { z as z5 } from "zod";
179
+ var NftAssetProps = z5.object({
180
+ assetIdentifier: z5.string().describe("Full asset identifier (e.g. SP123.contract::asset-name)"),
181
+ tokenId: z5.string().describe("Token id (as string to preserve bigint precision)"),
182
+ name: z5.string().nullable().optional(),
183
+ imageUrl: z5.string().url().nullable().optional()
184
+ });
185
+
186
+ // src/ui/atoms/nftAsset.tsx
187
+ import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
188
+ function NftAsset(props) {
189
+ const [, assetName] = props.assetIdentifier.split("::", 2);
190
+ const displayName = props.name ?? `${assetName ?? "NFT"} #${props.tokenId}`;
191
+ return /* @__PURE__ */ jsxDEV5("span", {
192
+ className: "inline-flex items-center gap-2",
193
+ children: [
194
+ props.imageUrl && /* @__PURE__ */ jsxDEV5("img", {
195
+ src: props.imageUrl,
196
+ alt: displayName,
197
+ className: "h-5 w-5 rounded",
198
+ loading: "lazy"
199
+ }, undefined, false, undefined, this),
200
+ /* @__PURE__ */ jsxDEV5("span", {
201
+ className: "font-mono text-sm",
202
+ children: displayName
203
+ }, undefined, false, undefined, this)
204
+ ]
205
+ }, undefined, true, undefined, this);
206
+ }
207
+ var NftAssetComponent = {
208
+ props: NftAssetProps,
209
+ render: NftAsset
210
+ };
211
+
212
+ // src/ui/atoms/principal.schema.ts
213
+ import { z as z6 } from "zod";
214
+ var PrincipalProps = z6.object({
215
+ value: z6.string().describe("Standard or contract principal"),
216
+ bns: z6.string().nullable().optional(),
217
+ kind: z6.enum(["standard", "contract"]).optional()
218
+ });
219
+
220
+ // src/ui/atoms/principal.tsx
221
+ import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
222
+ function inferKind(value) {
223
+ return value.includes(".") ? "contract" : "standard";
224
+ }
225
+ function Principal(props) {
226
+ const kind = props.kind ?? inferKind(props.value);
227
+ if (kind === "contract") {
228
+ const parts = props.value.split(".", 2);
229
+ const addr = parts[0] ?? props.value;
230
+ const name = parts[1] ?? "";
231
+ return /* @__PURE__ */ jsxDEV6("span", {
232
+ className: "font-mono text-sm",
233
+ title: props.value,
234
+ children: [
235
+ /* @__PURE__ */ jsxDEV6(Address, {
236
+ value: addr,
237
+ bns: props.bns,
238
+ truncate: true
239
+ }, undefined, false, undefined, this),
240
+ /* @__PURE__ */ jsxDEV6("span", {
241
+ className: "text-muted-foreground",
242
+ children: "."
243
+ }, undefined, false, undefined, this),
244
+ /* @__PURE__ */ jsxDEV6("span", {
245
+ className: "text-foreground",
246
+ children: name
247
+ }, undefined, false, undefined, this)
248
+ ]
249
+ }, undefined, true, undefined, this);
250
+ }
251
+ return /* @__PURE__ */ jsxDEV6(Address, {
252
+ value: props.value,
253
+ bns: props.bns,
254
+ truncate: true
255
+ }, undefined, false, undefined, this);
256
+ }
257
+ var PrincipalComponent = {
258
+ props: PrincipalProps,
259
+ render: Principal
260
+ };
261
+
262
+ // src/ui/atoms/token.schema.ts
263
+ import { z as z7 } from "zod";
264
+ var TokenProps = z7.object({
265
+ symbol: z7.string(),
266
+ contract: z7.string().nullable().optional().describe("SIP-010 contract id (for non-STX tokens)"),
267
+ decimals: z7.number().int().min(0).max(18).default(6)
268
+ });
269
+
270
+ // src/ui/atoms/token.tsx
271
+ import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
272
+ function Token(props) {
273
+ return /* @__PURE__ */ jsxDEV7("span", {
274
+ className: "font-mono text-sm",
275
+ title: props.contract ?? undefined,
276
+ children: /* @__PURE__ */ jsxDEV7("span", {
277
+ className: "font-medium",
278
+ children: props.symbol
279
+ }, undefined, false, undefined, this)
280
+ }, undefined, false, undefined, this);
281
+ }
282
+ var TokenComponent = {
283
+ props: TokenProps,
284
+ render: Token
285
+ };
286
+
287
+ // src/ui/atoms/txStatus.schema.ts
288
+ import { z as z8 } from "zod";
289
+ var TxStatusProps = z8.object({
290
+ status: z8.enum([
291
+ "pending",
292
+ "success",
293
+ "failed",
294
+ "abort_by_post_condition",
295
+ "abort_by_response"
296
+ ]),
297
+ txId: z8.string().nullable().optional()
298
+ });
299
+
300
+ // src/ui/atoms/txStatus.tsx
301
+ import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
302
+ var TONE = {
303
+ pending: "bg-yellow-100 text-yellow-900 dark:bg-yellow-950 dark:text-yellow-200",
304
+ success: "bg-green-100 text-green-900 dark:bg-green-950 dark:text-green-200",
305
+ failed: "bg-red-100 text-red-900 dark:bg-red-950 dark:text-red-200",
306
+ abort_by_post_condition: "bg-orange-100 text-orange-900 dark:bg-orange-950 dark:text-orange-200",
307
+ abort_by_response: "bg-red-100 text-red-900 dark:bg-red-950 dark:text-red-200"
308
+ };
309
+ var LABEL = {
310
+ pending: "pending",
311
+ success: "confirmed",
312
+ failed: "failed",
313
+ abort_by_post_condition: "post-condition aborted",
314
+ abort_by_response: "aborted"
315
+ };
316
+ function TxStatus(props) {
317
+ return /* @__PURE__ */ jsxDEV8("span", {
318
+ className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${TONE[props.status]}`,
319
+ title: props.txId ?? undefined,
320
+ children: LABEL[props.status]
321
+ }, undefined, false, undefined, this);
322
+ }
323
+ var TxStatusComponent = {
324
+ props: TxStatusProps,
325
+ render: TxStatus
326
+ };
327
+ // src/ui/componentMap.tsx
328
+ import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
329
+ var atomComponentMap = {
330
+ Address: ({ element }) => /* @__PURE__ */ jsxDEV9(Address, {
331
+ ...element.props
332
+ }, undefined, false, undefined, this),
333
+ Amount: ({ element }) => /* @__PURE__ */ jsxDEV9(Amount, {
334
+ ...element.props
335
+ }, undefined, false, undefined, this),
336
+ BlockHeight: ({ element }) => /* @__PURE__ */ jsxDEV9(BlockHeight, {
337
+ ...element.props
338
+ }, undefined, false, undefined, this),
339
+ BnsName: ({ element }) => /* @__PURE__ */ jsxDEV9(BnsName, {
340
+ ...element.props
341
+ }, undefined, false, undefined, this),
342
+ NftAsset: ({ element }) => /* @__PURE__ */ jsxDEV9(NftAsset, {
343
+ ...element.props
344
+ }, undefined, false, undefined, this),
345
+ Principal: ({ element }) => /* @__PURE__ */ jsxDEV9(Principal, {
346
+ ...element.props
347
+ }, undefined, false, undefined, this),
348
+ Token: ({ element }) => /* @__PURE__ */ jsxDEV9(Token, {
349
+ ...element.props
350
+ }, undefined, false, undefined, this),
351
+ TxStatus: ({ element }) => /* @__PURE__ */ jsxDEV9(TxStatus, {
352
+ ...element.props
353
+ }, undefined, false, undefined, this)
354
+ };
355
+
356
+ // src/ui/index.ts
357
+ var atoms = {
358
+ Address: AddressComponent,
359
+ Amount: AmountComponent,
360
+ BlockHeight: BlockHeightComponent,
361
+ BnsName: BnsNameComponent,
362
+ NftAsset: NftAssetComponent,
363
+ Principal: PrincipalComponent,
364
+ Token: TokenComponent,
365
+ TxStatus: TxStatusComponent
366
+ };
367
+ export {
368
+ schema,
369
+ defineCatalog,
370
+ atoms,
371
+ atomComponentMap,
372
+ TxStatusProps,
373
+ TxStatus,
374
+ TokenProps,
375
+ Token,
376
+ PrincipalProps,
377
+ Principal,
378
+ NftAssetProps,
379
+ NftAsset,
380
+ BnsNameProps,
381
+ BnsName,
382
+ BlockHeightProps,
383
+ BlockHeight,
384
+ AmountProps,
385
+ Amount,
386
+ AddressProps,
387
+ Address
388
+ };
389
+
390
+ //# debugId=B28A322BCA92F0BF64756E2164756E21
391
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,27 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ui/index.ts", "../../../src/ui/atoms/address.schema.ts", "../../../src/ui/atoms/address.tsx", "../../../src/ui/atoms/amount.schema.ts", "../../../src/ui/atoms/amount.tsx", "../../../src/ui/atoms/blockHeight.schema.ts", "../../../src/ui/atoms/blockHeight.tsx", "../../../src/ui/atoms/bnsName.schema.ts", "../../../src/ui/atoms/bnsName.tsx", "../../../src/ui/atoms/nftAsset.schema.ts", "../../../src/ui/atoms/nftAsset.tsx", "../../../src/ui/atoms/principal.schema.ts", "../../../src/ui/atoms/principal.tsx", "../../../src/ui/atoms/token.schema.ts", "../../../src/ui/atoms/token.tsx", "../../../src/ui/atoms/txStatus.schema.ts", "../../../src/ui/atoms/txStatus.tsx", "../../../src/ui/componentMap.tsx"],
4
+ "sourcesContent": [
5
+ "/**\n * Stacks UI atoms for json-render catalogs.\n *\n * These are reusable building blocks authors compose into their own\n * json-render catalog when calling `step.render(id, catalog, opts)`.\n *\n * Usage:\n *\n * import { defineCatalog, schema, atoms } from \"@secondlayer/stacks/ui\"\n * import { z } from \"zod\"\n *\n * const whaleUI = defineCatalog(schema, {\n * components: {\n * Address: atoms.Address,\n * Amount: atoms.Amount,\n * WhaleCard: {\n * props: z.object({ from: z.string(), amount: z.string() }),\n * render: WhaleCard,\n * },\n * },\n * actions: {},\n * })\n *\n * Re-exports `defineCatalog` + the React `schema` from `@json-render/*` so\n * users only import from one place.\n */\n\nexport { defineCatalog } from \"@json-render/core\";\nexport { schema } from \"@json-render/react\";\n\nimport type { StacksAtom } from \"./atom-types.ts\";\nimport { AddressComponent } from \"./atoms/address.tsx\";\nimport { AmountComponent } from \"./atoms/amount.tsx\";\nimport { BlockHeightComponent } from \"./atoms/blockHeight.tsx\";\nimport { BnsNameComponent } from \"./atoms/bnsName.tsx\";\nimport { NftAssetComponent } from \"./atoms/nftAsset.tsx\";\nimport { PrincipalComponent } from \"./atoms/principal.tsx\";\nimport { TokenComponent } from \"./atoms/token.tsx\";\nimport { TxStatusComponent } from \"./atoms/txStatus.tsx\";\n\nexport type { StacksAtom } from \"./atom-types.ts\";\n\nexport const atoms: Record<string, StacksAtom> = {\n\tAddress: AddressComponent,\n\tAmount: AmountComponent,\n\tBlockHeight: BlockHeightComponent,\n\tBnsName: BnsNameComponent,\n\tNftAsset: NftAssetComponent,\n\tPrincipal: PrincipalComponent,\n\tToken: TokenComponent,\n\tTxStatus: TxStatusComponent,\n};\n\n// Named exports for direct import (e.g. `import { Address } from \"@secondlayer/stacks/ui\"`)\nexport { Address, AddressProps } from \"./atoms/address.tsx\";\nexport { Amount, AmountProps } from \"./atoms/amount.tsx\";\nexport { BlockHeight, BlockHeightProps } from \"./atoms/blockHeight.tsx\";\nexport { BnsName, BnsNameProps } from \"./atoms/bnsName.tsx\";\nexport { NftAsset, NftAssetProps } from \"./atoms/nftAsset.tsx\";\nexport { Principal, PrincipalProps } from \"./atoms/principal.tsx\";\nexport { Token, TokenProps } from \"./atoms/token.tsx\";\nexport { TxStatus, TxStatusProps } from \"./atoms/txStatus.tsx\";\n\nexport { atomComponentMap } from \"./componentMap.tsx\";\n",
6
+ "import { z } from \"zod\";\n\nexport interface AddressPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\ttruncate?: boolean;\n}\n\nexport const AddressProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Stacks principal (SP…/SM…/ST…)\"),\n\tbns: z.string().nullable().optional().describe(\"Optional BNS override\"),\n\ttruncate: z.boolean().optional().default(true),\n});\n",
7
+ "import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { AddressProps, type AddressPropsType } from \"./address.schema.ts\";\n\nexport { AddressProps, type AddressPropsType };\n\nfunction truncatePrincipal(value: string): string {\n\tif (value.length <= 14) return value;\n\treturn `${value.slice(0, 6)}…${value.slice(-4)}`;\n}\n\nexport function Address(props: AddressPropsType): ReactElement {\n\tconst display =\n\t\tprops.bns ??\n\t\t(props.truncate ? truncatePrincipal(props.value) : props.value);\n\treturn (\n\t\t<span className=\"font-mono text-sm\" title={props.value}>\n\t\t\t{display}\n\t\t</span>\n\t);\n}\n\nexport const AddressComponent: StacksAtom = {\n\tprops: AddressProps,\n\trender: Address,\n};\n",
8
+ "import { z } from \"zod\";\n\nexport interface AmountPropsType {\n\tmicroUnits: string;\n\tdecimals?: number;\n\tsymbol?: string;\n\tusdValue?: number | null | undefined;\n}\n\nexport const AmountProps: z.ZodTypeAny = z.object({\n\tmicroUnits: z\n\t\t.string()\n\t\t.describe(\"Amount in micro-units (as string to preserve bigint precision)\"),\n\tdecimals: z\n\t\t.number()\n\t\t.int()\n\t\t.min(0)\n\t\t.max(18)\n\t\t.default(6)\n\t\t.describe(\n\t\t\t\"Decimal places (6 for STX, 8 for sBTC, varies for SIP-010 tokens)\",\n\t\t),\n\tsymbol: z.string().default(\"STX\"),\n\tusdValue: z.number().nullable().optional(),\n});\n",
9
+ "import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { AmountProps, type AmountPropsType } from \"./amount.schema.ts\";\n\nexport { AmountProps, type AmountPropsType };\n\nfunction formatAmount(microUnits: string, decimals: number): string {\n\ttry {\n\t\tconst raw = BigInt(microUnits);\n\t\tconst divisor = 10n ** BigInt(decimals);\n\t\tconst whole = raw / divisor;\n\t\tconst fraction = raw % divisor;\n\t\tif (fraction === 0n) return whole.toLocaleString();\n\t\tconst fracStr = fraction\n\t\t\t.toString()\n\t\t\t.padStart(decimals, \"0\")\n\t\t\t.replace(/0+$/, \"\");\n\t\treturn `${whole.toLocaleString()}.${fracStr}`;\n\t} catch {\n\t\treturn microUnits;\n\t}\n}\n\nexport function Amount(props: AmountPropsType): ReactElement {\n\tconst decimals = props.decimals ?? 6;\n\tconst symbol = props.symbol ?? \"STX\";\n\tconst formatted = formatAmount(props.microUnits, decimals);\n\treturn (\n\t\t<span className=\"font-mono tabular-nums\">\n\t\t\t<span className=\"font-medium\">{formatted}</span>\n\t\t\t<span className=\"ml-1 text-muted-foreground\">{symbol}</span>\n\t\t\t{props.usdValue != null && (\n\t\t\t\t<span className=\"ml-2 text-sm text-muted-foreground\">\n\t\t\t\t\t($\n\t\t\t\t\t{props.usdValue.toLocaleString(undefined, {\n\t\t\t\t\t\tmaximumFractionDigits: 2,\n\t\t\t\t\t})}\n\t\t\t\t\t)\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</span>\n\t);\n}\n\nexport const AmountComponent: StacksAtom = {\n\tprops: AmountProps,\n\trender: Amount,\n};\n",
10
+ "import { z } from \"zod\";\n\nexport interface BlockHeightPropsType {\n\theight: number;\n\ttimestamp?: string | null | undefined;\n}\n\nexport const BlockHeightProps: z.ZodTypeAny = z.object({\n\theight: z.number().int().nonnegative(),\n\ttimestamp: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"ISO-8601 block timestamp\"),\n});\n",
11
+ "import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport {\n\tBlockHeightProps,\n\ttype BlockHeightPropsType,\n} from \"./blockHeight.schema.ts\";\n\nexport { BlockHeightProps, type BlockHeightPropsType };\n\nfunction relative(timestamp: string | null | undefined): string | null {\n\tif (!timestamp) return null;\n\tconst then = new Date(timestamp).getTime();\n\tif (Number.isNaN(then)) return null;\n\tconst delta = Math.max(0, Date.now() - then);\n\tconst s = Math.floor(delta / 1000);\n\tif (s < 60) return `${s}s ago`;\n\tconst m = Math.floor(s / 60);\n\tif (m < 60) return `${m}m ago`;\n\tconst h = Math.floor(m / 60);\n\tif (h < 24) return `${h}h ago`;\n\treturn `${Math.floor(h / 24)}d ago`;\n}\n\nexport function BlockHeight(props: BlockHeightPropsType): ReactElement {\n\tconst rel = relative(props.timestamp);\n\treturn (\n\t\t<span className=\"font-mono text-sm\">\n\t\t\t<span>#{props.height.toLocaleString()}</span>\n\t\t\t{rel && <span className=\"ml-1 text-muted-foreground\">· {rel}</span>}\n\t\t</span>\n\t);\n}\n\nexport const BlockHeightComponent: StacksAtom = {\n\tprops: BlockHeightProps,\n\trender: BlockHeight,\n};\n",
12
+ "import { z } from \"zod\";\n\nexport interface BnsNamePropsType {\n\tname: string;\n\tnamespace: string;\n\texpiresAt?: string | null | undefined;\n}\n\nexport const BnsNameProps: z.ZodTypeAny = z.object({\n\tname: z.string(),\n\tnamespace: z.string(),\n\texpiresAt: z.string().nullable().optional().describe(\"ISO-8601 timestamp\"),\n});\n",
13
+ "import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { BnsNameProps, type BnsNamePropsType } from \"./bnsName.schema.ts\";\n\nexport { BnsNameProps, type BnsNamePropsType };\n\nexport function BnsName(props: BnsNamePropsType): ReactElement {\n\treturn (\n\t\t<span className=\"font-mono text-sm\">\n\t\t\t<span className=\"font-medium\">{props.name}</span>\n\t\t\t<span className=\"text-muted-foreground\">.{props.namespace}</span>\n\t\t</span>\n\t);\n}\n\nexport const BnsNameComponent: StacksAtom = {\n\tprops: BnsNameProps,\n\trender: BnsName,\n};\n",
14
+ "import { z } from \"zod\";\n\nexport interface NftAssetPropsType {\n\tassetIdentifier: string;\n\ttokenId: string;\n\tname?: string | null | undefined;\n\timageUrl?: string | null | undefined;\n}\n\nexport const NftAssetProps: z.ZodTypeAny = z.object({\n\tassetIdentifier: z\n\t\t.string()\n\t\t.describe(\"Full asset identifier (e.g. SP123.contract::asset-name)\"),\n\ttokenId: z\n\t\t.string()\n\t\t.describe(\"Token id (as string to preserve bigint precision)\"),\n\tname: z.string().nullable().optional(),\n\timageUrl: z.string().url().nullable().optional(),\n});\n",
15
+ "import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { NftAssetProps, type NftAssetPropsType } from \"./nftAsset.schema.ts\";\n\nexport { NftAssetProps, type NftAssetPropsType };\n\nexport function NftAsset(props: NftAssetPropsType): ReactElement {\n\tconst [, assetName] = props.assetIdentifier.split(\"::\", 2);\n\tconst displayName = props.name ?? `${assetName ?? \"NFT\"} #${props.tokenId}`;\n\treturn (\n\t\t<span className=\"inline-flex items-center gap-2\">\n\t\t\t{props.imageUrl && (\n\t\t\t\t<img\n\t\t\t\t\tsrc={props.imageUrl}\n\t\t\t\t\talt={displayName}\n\t\t\t\t\tclassName=\"h-5 w-5 rounded\"\n\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<span className=\"font-mono text-sm\">{displayName}</span>\n\t\t</span>\n\t);\n}\n\nexport const NftAssetComponent: StacksAtom = {\n\tprops: NftAssetProps,\n\trender: NftAsset,\n};\n",
16
+ "import { z } from \"zod\";\n\nexport interface PrincipalPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\tkind?: \"standard\" | \"contract\" | undefined;\n}\n\nexport const PrincipalProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Standard or contract principal\"),\n\tbns: z.string().nullable().optional(),\n\tkind: z.enum([\"standard\", \"contract\"]).optional(),\n});\n",
17
+ "import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { Address } from \"./address.tsx\";\nimport { PrincipalProps, type PrincipalPropsType } from \"./principal.schema.ts\";\n\nexport { PrincipalProps, type PrincipalPropsType };\n\nfunction inferKind(value: string): \"standard\" | \"contract\" {\n\treturn value.includes(\".\") ? \"contract\" : \"standard\";\n}\n\nexport function Principal(props: PrincipalPropsType): ReactElement {\n\tconst kind = props.kind ?? inferKind(props.value);\n\tif (kind === \"contract\") {\n\t\tconst parts = props.value.split(\".\", 2);\n\t\tconst addr = parts[0] ?? props.value;\n\t\tconst name = parts[1] ?? \"\";\n\t\treturn (\n\t\t\t<span className=\"font-mono text-sm\" title={props.value}>\n\t\t\t\t<Address value={addr} bns={props.bns} truncate />\n\t\t\t\t<span className=\"text-muted-foreground\">.</span>\n\t\t\t\t<span className=\"text-foreground\">{name}</span>\n\t\t\t</span>\n\t\t);\n\t}\n\treturn <Address value={props.value} bns={props.bns} truncate />;\n}\n\nexport const PrincipalComponent: StacksAtom = {\n\tprops: PrincipalProps,\n\trender: Principal,\n};\n",
18
+ "import { z } from \"zod\";\n\nexport interface TokenPropsType {\n\tsymbol: string;\n\tcontract?: string | null | undefined;\n\tdecimals?: number;\n}\n\nexport const TokenProps: z.ZodTypeAny = z.object({\n\tsymbol: z.string(),\n\tcontract: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"SIP-010 contract id (for non-STX tokens)\"),\n\tdecimals: z.number().int().min(0).max(18).default(6),\n});\n",
19
+ "import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { TokenProps, type TokenPropsType } from \"./token.schema.ts\";\n\nexport { TokenProps, type TokenPropsType };\n\nexport function Token(props: TokenPropsType): ReactElement {\n\treturn (\n\t\t<span className=\"font-mono text-sm\" title={props.contract ?? undefined}>\n\t\t\t<span className=\"font-medium\">{props.symbol}</span>\n\t\t</span>\n\t);\n}\n\nexport const TokenComponent: StacksAtom = {\n\tprops: TokenProps,\n\trender: Token,\n};\n",
20
+ "import { z } from \"zod\";\n\nexport interface TxStatusPropsType {\n\tstatus:\n\t\t| \"pending\"\n\t\t| \"success\"\n\t\t| \"failed\"\n\t\t| \"abort_by_post_condition\"\n\t\t| \"abort_by_response\";\n\ttxId?: string | null | undefined;\n}\n\nexport const TxStatusProps: z.ZodTypeAny = z.object({\n\tstatus: z.enum([\n\t\t\"pending\",\n\t\t\"success\",\n\t\t\"failed\",\n\t\t\"abort_by_post_condition\",\n\t\t\"abort_by_response\",\n\t]),\n\ttxId: z.string().nullable().optional(),\n});\n",
21
+ "import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { TxStatusProps, type TxStatusPropsType } from \"./txStatus.schema.ts\";\n\nexport { TxStatusProps, type TxStatusPropsType };\n\nconst TONE: Record<TxStatusPropsType[\"status\"], string> = {\n\tpending:\n\t\t\"bg-yellow-100 text-yellow-900 dark:bg-yellow-950 dark:text-yellow-200\",\n\tsuccess: \"bg-green-100 text-green-900 dark:bg-green-950 dark:text-green-200\",\n\tfailed: \"bg-red-100 text-red-900 dark:bg-red-950 dark:text-red-200\",\n\tabort_by_post_condition:\n\t\t\"bg-orange-100 text-orange-900 dark:bg-orange-950 dark:text-orange-200\",\n\tabort_by_response:\n\t\t\"bg-red-100 text-red-900 dark:bg-red-950 dark:text-red-200\",\n};\n\nconst LABEL: Record<TxStatusPropsType[\"status\"], string> = {\n\tpending: \"pending\",\n\tsuccess: \"confirmed\",\n\tfailed: \"failed\",\n\tabort_by_post_condition: \"post-condition aborted\",\n\tabort_by_response: \"aborted\",\n};\n\nexport function TxStatus(props: TxStatusPropsType): ReactElement {\n\treturn (\n\t\t<span\n\t\t\tclassName={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${TONE[props.status]}`}\n\t\t\ttitle={props.txId ?? undefined}\n\t\t>\n\t\t\t{LABEL[props.status]}\n\t\t</span>\n\t);\n}\n\nexport const TxStatusComponent: StacksAtom = {\n\tprops: TxStatusProps,\n\trender: TxStatus,\n};\n",
22
+ "import type { ReactElement } from \"react\";\nimport { Address } from \"./atoms/address.tsx\";\nimport { Amount } from \"./atoms/amount.tsx\";\nimport { BlockHeight } from \"./atoms/blockHeight.tsx\";\nimport { BnsName } from \"./atoms/bnsName.tsx\";\nimport { NftAsset } from \"./atoms/nftAsset.tsx\";\nimport { Principal } from \"./atoms/principal.tsx\";\nimport { Token } from \"./atoms/token.tsx\";\nimport { TxStatus } from \"./atoms/txStatus.tsx\";\n\ntype AtomRenderer = (args: { element: { props: unknown } }) => ReactElement;\n\n/**\n * Component map for `createRenderer()` from `@json-render/react`. Bridges\n * json-render's `{ element }` wrapper back to each atom's typed props\n * signature.\n *\n * import { createRenderer } from \"@json-render/react\";\n * import { defineCatalog, schema, atoms, atomComponentMap } from \"@secondlayer/stacks/ui\";\n * const catalog = defineCatalog(schema, { components: atoms, actions: {} });\n * const Renderer = createRenderer(catalog, atomComponentMap);\n * // <Renderer spec={step.output.spec} />\n */\nexport const atomComponentMap: Record<string, AtomRenderer> = {\n\tAddress: ({ element }) => (\n\t\t<Address {...(element.props as Parameters<typeof Address>[0])} />\n\t),\n\tAmount: ({ element }) => (\n\t\t<Amount {...(element.props as Parameters<typeof Amount>[0])} />\n\t),\n\tBlockHeight: ({ element }) => (\n\t\t<BlockHeight {...(element.props as Parameters<typeof BlockHeight>[0])} />\n\t),\n\tBnsName: ({ element }) => (\n\t\t<BnsName {...(element.props as Parameters<typeof BnsName>[0])} />\n\t),\n\tNftAsset: ({ element }) => (\n\t\t<NftAsset {...(element.props as Parameters<typeof NftAsset>[0])} />\n\t),\n\tPrincipal: ({ element }) => (\n\t\t<Principal {...(element.props as Parameters<typeof Principal>[0])} />\n\t),\n\tToken: ({ element }) => (\n\t\t<Token {...(element.props as Parameters<typeof Token>[0])} />\n\t),\n\tTxStatus: ({ element }) => (\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