@xyo-network/react-payload-raw-info 2.81.9 → 2.82.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 (253) hide show
  1. package/dist/browser/components/Button/RawInfoButton.d.cts +3 -3
  2. package/dist/browser/components/Button/RawInfoButton.d.cts.map +1 -1
  3. package/dist/browser/components/Button/RawInfoButton.d.mts +3 -3
  4. package/dist/browser/components/Button/RawInfoButton.d.mts.map +1 -1
  5. package/dist/browser/components/Button/RawInfoButton.d.ts +3 -3
  6. package/dist/browser/components/Button/RawInfoButton.d.ts.map +1 -1
  7. package/dist/browser/components/Button/RawInfoIconButton.d.cts +4 -4
  8. package/dist/browser/components/Button/RawInfoIconButton.d.cts.map +1 -1
  9. package/dist/browser/components/Button/RawInfoIconButton.d.mts +4 -4
  10. package/dist/browser/components/Button/RawInfoIconButton.d.mts.map +1 -1
  11. package/dist/browser/components/Button/RawInfoIconButton.d.ts +4 -4
  12. package/dist/browser/components/Button/RawInfoIconButton.d.ts.map +1 -1
  13. package/dist/browser/components/Button/index.d.cts +2 -2
  14. package/dist/browser/components/Button/index.d.cts.map +1 -1
  15. package/dist/browser/components/Button/index.d.mts +2 -2
  16. package/dist/browser/components/Button/index.d.mts.map +1 -1
  17. package/dist/browser/components/Button/index.d.ts +2 -2
  18. package/dist/browser/components/Button/index.d.ts.map +1 -1
  19. package/dist/browser/components/Button/lib/index.d.cts +2 -2
  20. package/dist/browser/components/Button/lib/index.d.mts +2 -2
  21. package/dist/browser/components/Button/lib/index.d.ts +2 -2
  22. package/dist/browser/components/Button/lib/presetIconSize.d.cts +1 -1
  23. package/dist/browser/components/Button/lib/presetIconSize.d.mts +1 -1
  24. package/dist/browser/components/Button/lib/presetIconSize.d.ts +1 -1
  25. package/dist/browser/components/img/index.d.cts.map +1 -1
  26. package/dist/browser/components/img/index.d.mts.map +1 -1
  27. package/dist/browser/components/img/index.d.ts.map +1 -1
  28. package/dist/browser/components/index.d.cts +3 -3
  29. package/dist/browser/components/index.d.mts +3 -3
  30. package/dist/browser/components/index.d.ts +3 -3
  31. package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.cts +2 -1
  32. package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.cts.map +1 -1
  33. package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.mts +2 -1
  34. package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.mts.map +1 -1
  35. package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.ts +2 -1
  36. package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.ts.map +1 -1
  37. package/dist/browser/components/shared/Dialog/RawInfoDialog.d.cts +2 -2
  38. package/dist/browser/components/shared/Dialog/RawInfoDialog.d.cts.map +1 -1
  39. package/dist/browser/components/shared/Dialog/RawInfoDialog.d.mts +2 -2
  40. package/dist/browser/components/shared/Dialog/RawInfoDialog.d.mts.map +1 -1
  41. package/dist/browser/components/shared/Dialog/RawInfoDialog.d.ts +2 -2
  42. package/dist/browser/components/shared/Dialog/RawInfoDialog.d.ts.map +1 -1
  43. package/dist/browser/components/shared/Dialog/index.d.cts +2 -2
  44. package/dist/browser/components/shared/Dialog/index.d.cts.map +1 -1
  45. package/dist/browser/components/shared/Dialog/index.d.mts +2 -2
  46. package/dist/browser/components/shared/Dialog/index.d.mts.map +1 -1
  47. package/dist/browser/components/shared/Dialog/index.d.ts +2 -2
  48. package/dist/browser/components/shared/Dialog/index.d.ts.map +1 -1
  49. package/dist/browser/components/shared/JsonViewerEx.d.cts +1 -0
  50. package/dist/browser/components/shared/JsonViewerEx.d.cts.map +1 -1
  51. package/dist/browser/components/shared/JsonViewerEx.d.mts +1 -0
  52. package/dist/browser/components/shared/JsonViewerEx.d.mts.map +1 -1
  53. package/dist/browser/components/shared/JsonViewerEx.d.ts +1 -0
  54. package/dist/browser/components/shared/JsonViewerEx.d.ts.map +1 -1
  55. package/dist/browser/components/shared/index.d.cts +2 -2
  56. package/dist/browser/components/shared/index.d.cts.map +1 -1
  57. package/dist/browser/components/shared/index.d.mts +2 -2
  58. package/dist/browser/components/shared/index.d.mts.map +1 -1
  59. package/dist/browser/components/shared/index.d.ts +2 -2
  60. package/dist/browser/components/shared/index.d.ts.map +1 -1
  61. package/dist/browser/components/styled/index.d.cts +1 -1
  62. package/dist/browser/components/styled/index.d.cts.map +1 -1
  63. package/dist/browser/components/styled/index.d.mts +1 -1
  64. package/dist/browser/components/styled/index.d.mts.map +1 -1
  65. package/dist/browser/components/styled/index.d.ts +1 -1
  66. package/dist/browser/components/styled/index.d.ts.map +1 -1
  67. package/dist/browser/index.cjs +170 -168
  68. package/dist/browser/index.cjs.map +1 -1
  69. package/dist/browser/index.d.cts +1 -1
  70. package/dist/browser/index.d.mts +1 -1
  71. package/dist/browser/index.d.ts +1 -1
  72. package/dist/browser/index.mjs +244 -0
  73. package/dist/browser/index.mjs.map +1 -0
  74. package/dist/browser/lib/index.d.cts +1 -1
  75. package/dist/browser/lib/index.d.mts +1 -1
  76. package/dist/browser/lib/index.d.ts +1 -1
  77. package/dist/neutral/components/Button/RawInfoButton.d.cts +3 -3
  78. package/dist/neutral/components/Button/RawInfoButton.d.cts.map +1 -1
  79. package/dist/neutral/components/Button/RawInfoButton.d.mts +3 -3
  80. package/dist/neutral/components/Button/RawInfoButton.d.mts.map +1 -1
  81. package/dist/neutral/components/Button/RawInfoButton.d.ts +3 -3
  82. package/dist/neutral/components/Button/RawInfoButton.d.ts.map +1 -1
  83. package/dist/neutral/components/Button/RawInfoIconButton.d.cts +4 -4
  84. package/dist/neutral/components/Button/RawInfoIconButton.d.cts.map +1 -1
  85. package/dist/neutral/components/Button/RawInfoIconButton.d.mts +4 -4
  86. package/dist/neutral/components/Button/RawInfoIconButton.d.mts.map +1 -1
  87. package/dist/neutral/components/Button/RawInfoIconButton.d.ts +4 -4
  88. package/dist/neutral/components/Button/RawInfoIconButton.d.ts.map +1 -1
  89. package/dist/neutral/components/Button/index.d.cts +2 -2
  90. package/dist/neutral/components/Button/index.d.cts.map +1 -1
  91. package/dist/neutral/components/Button/index.d.mts +2 -2
  92. package/dist/neutral/components/Button/index.d.mts.map +1 -1
  93. package/dist/neutral/components/Button/index.d.ts +2 -2
  94. package/dist/neutral/components/Button/index.d.ts.map +1 -1
  95. package/dist/neutral/components/Button/lib/index.d.cts +2 -2
  96. package/dist/neutral/components/Button/lib/index.d.mts +2 -2
  97. package/dist/neutral/components/Button/lib/index.d.ts +2 -2
  98. package/dist/neutral/components/Button/lib/presetIconSize.d.cts +1 -1
  99. package/dist/neutral/components/Button/lib/presetIconSize.d.mts +1 -1
  100. package/dist/neutral/components/Button/lib/presetIconSize.d.ts +1 -1
  101. package/dist/neutral/components/img/index.d.cts.map +1 -1
  102. package/dist/neutral/components/img/index.d.mts.map +1 -1
  103. package/dist/neutral/components/img/index.d.ts.map +1 -1
  104. package/dist/neutral/components/index.d.cts +3 -3
  105. package/dist/neutral/components/index.d.mts +3 -3
  106. package/dist/neutral/components/index.d.ts +3 -3
  107. package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.cts +2 -1
  108. package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.cts.map +1 -1
  109. package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.mts +2 -1
  110. package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.mts.map +1 -1
  111. package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.ts +2 -1
  112. package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.ts.map +1 -1
  113. package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.cts +2 -2
  114. package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.cts.map +1 -1
  115. package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.mts +2 -2
  116. package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.mts.map +1 -1
  117. package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.ts +2 -2
  118. package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.ts.map +1 -1
  119. package/dist/neutral/components/shared/Dialog/index.d.cts +2 -2
  120. package/dist/neutral/components/shared/Dialog/index.d.cts.map +1 -1
  121. package/dist/neutral/components/shared/Dialog/index.d.mts +2 -2
  122. package/dist/neutral/components/shared/Dialog/index.d.mts.map +1 -1
  123. package/dist/neutral/components/shared/Dialog/index.d.ts +2 -2
  124. package/dist/neutral/components/shared/Dialog/index.d.ts.map +1 -1
  125. package/dist/neutral/components/shared/JsonViewerEx.d.cts +1 -0
  126. package/dist/neutral/components/shared/JsonViewerEx.d.cts.map +1 -1
  127. package/dist/neutral/components/shared/JsonViewerEx.d.mts +1 -0
  128. package/dist/neutral/components/shared/JsonViewerEx.d.mts.map +1 -1
  129. package/dist/neutral/components/shared/JsonViewerEx.d.ts +1 -0
  130. package/dist/neutral/components/shared/JsonViewerEx.d.ts.map +1 -1
  131. package/dist/neutral/components/shared/index.d.cts +2 -2
  132. package/dist/neutral/components/shared/index.d.cts.map +1 -1
  133. package/dist/neutral/components/shared/index.d.mts +2 -2
  134. package/dist/neutral/components/shared/index.d.mts.map +1 -1
  135. package/dist/neutral/components/shared/index.d.ts +2 -2
  136. package/dist/neutral/components/shared/index.d.ts.map +1 -1
  137. package/dist/neutral/components/styled/index.d.cts +1 -1
  138. package/dist/neutral/components/styled/index.d.cts.map +1 -1
  139. package/dist/neutral/components/styled/index.d.mts +1 -1
  140. package/dist/neutral/components/styled/index.d.mts.map +1 -1
  141. package/dist/neutral/components/styled/index.d.ts +1 -1
  142. package/dist/neutral/components/styled/index.d.ts.map +1 -1
  143. package/dist/neutral/index.cjs +170 -168
  144. package/dist/neutral/index.cjs.map +1 -1
  145. package/dist/neutral/index.d.cts +1 -1
  146. package/dist/neutral/index.d.mts +1 -1
  147. package/dist/neutral/index.d.ts +1 -1
  148. package/dist/neutral/index.mjs +244 -0
  149. package/dist/neutral/index.mjs.map +1 -0
  150. package/dist/neutral/lib/index.d.cts +1 -1
  151. package/dist/neutral/lib/index.d.mts +1 -1
  152. package/dist/neutral/lib/index.d.ts +1 -1
  153. package/dist/node/components/Button/RawInfoButton.d.cts +3 -3
  154. package/dist/node/components/Button/RawInfoButton.d.cts.map +1 -1
  155. package/dist/node/components/Button/RawInfoButton.d.mts +3 -3
  156. package/dist/node/components/Button/RawInfoButton.d.mts.map +1 -1
  157. package/dist/node/components/Button/RawInfoButton.d.ts +3 -3
  158. package/dist/node/components/Button/RawInfoButton.d.ts.map +1 -1
  159. package/dist/node/components/Button/RawInfoIconButton.d.cts +4 -4
  160. package/dist/node/components/Button/RawInfoIconButton.d.cts.map +1 -1
  161. package/dist/node/components/Button/RawInfoIconButton.d.mts +4 -4
  162. package/dist/node/components/Button/RawInfoIconButton.d.mts.map +1 -1
  163. package/dist/node/components/Button/RawInfoIconButton.d.ts +4 -4
  164. package/dist/node/components/Button/RawInfoIconButton.d.ts.map +1 -1
  165. package/dist/node/components/Button/index.d.cts +2 -2
  166. package/dist/node/components/Button/index.d.cts.map +1 -1
  167. package/dist/node/components/Button/index.d.mts +2 -2
  168. package/dist/node/components/Button/index.d.mts.map +1 -1
  169. package/dist/node/components/Button/index.d.ts +2 -2
  170. package/dist/node/components/Button/index.d.ts.map +1 -1
  171. package/dist/node/components/Button/lib/index.d.cts +2 -2
  172. package/dist/node/components/Button/lib/index.d.mts +2 -2
  173. package/dist/node/components/Button/lib/index.d.ts +2 -2
  174. package/dist/node/components/Button/lib/presetIconSize.d.cts +1 -1
  175. package/dist/node/components/Button/lib/presetIconSize.d.mts +1 -1
  176. package/dist/node/components/Button/lib/presetIconSize.d.ts +1 -1
  177. package/dist/node/components/img/index.d.cts.map +1 -1
  178. package/dist/node/components/img/index.d.mts.map +1 -1
  179. package/dist/node/components/img/index.d.ts.map +1 -1
  180. package/dist/node/components/index.d.cts +3 -3
  181. package/dist/node/components/index.d.mts +3 -3
  182. package/dist/node/components/index.d.ts +3 -3
  183. package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.cts +2 -1
  184. package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.cts.map +1 -1
  185. package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.mts +2 -1
  186. package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.mts.map +1 -1
  187. package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.ts +2 -1
  188. package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.ts.map +1 -1
  189. package/dist/node/components/shared/Dialog/RawInfoDialog.d.cts +2 -2
  190. package/dist/node/components/shared/Dialog/RawInfoDialog.d.cts.map +1 -1
  191. package/dist/node/components/shared/Dialog/RawInfoDialog.d.mts +2 -2
  192. package/dist/node/components/shared/Dialog/RawInfoDialog.d.mts.map +1 -1
  193. package/dist/node/components/shared/Dialog/RawInfoDialog.d.ts +2 -2
  194. package/dist/node/components/shared/Dialog/RawInfoDialog.d.ts.map +1 -1
  195. package/dist/node/components/shared/Dialog/index.d.cts +2 -2
  196. package/dist/node/components/shared/Dialog/index.d.cts.map +1 -1
  197. package/dist/node/components/shared/Dialog/index.d.mts +2 -2
  198. package/dist/node/components/shared/Dialog/index.d.mts.map +1 -1
  199. package/dist/node/components/shared/Dialog/index.d.ts +2 -2
  200. package/dist/node/components/shared/Dialog/index.d.ts.map +1 -1
  201. package/dist/node/components/shared/JsonViewerEx.d.cts +1 -0
  202. package/dist/node/components/shared/JsonViewerEx.d.cts.map +1 -1
  203. package/dist/node/components/shared/JsonViewerEx.d.mts +1 -0
  204. package/dist/node/components/shared/JsonViewerEx.d.mts.map +1 -1
  205. package/dist/node/components/shared/JsonViewerEx.d.ts +1 -0
  206. package/dist/node/components/shared/JsonViewerEx.d.ts.map +1 -1
  207. package/dist/node/components/shared/index.d.cts +2 -2
  208. package/dist/node/components/shared/index.d.cts.map +1 -1
  209. package/dist/node/components/shared/index.d.mts +2 -2
  210. package/dist/node/components/shared/index.d.mts.map +1 -1
  211. package/dist/node/components/shared/index.d.ts +2 -2
  212. package/dist/node/components/shared/index.d.ts.map +1 -1
  213. package/dist/node/components/styled/index.d.cts +1 -1
  214. package/dist/node/components/styled/index.d.cts.map +1 -1
  215. package/dist/node/components/styled/index.d.mts +1 -1
  216. package/dist/node/components/styled/index.d.mts.map +1 -1
  217. package/dist/node/components/styled/index.d.ts +1 -1
  218. package/dist/node/components/styled/index.d.ts.map +1 -1
  219. package/dist/node/index.cjs +170 -168
  220. package/dist/node/index.cjs.map +1 -1
  221. package/dist/node/index.d.cts +1 -1
  222. package/dist/node/index.d.mts +1 -1
  223. package/dist/node/index.d.ts +1 -1
  224. package/dist/node/index.mjs +244 -0
  225. package/dist/node/index.mjs.map +1 -0
  226. package/dist/node/lib/index.d.cts +1 -1
  227. package/dist/node/lib/index.d.mts +1 -1
  228. package/dist/node/lib/index.d.ts +1 -1
  229. package/package.json +16 -16
  230. package/src/components/Button/RawInfoButton.stories.tsx +3 -3
  231. package/src/components/Button/RawInfoButton.tsx +17 -15
  232. package/src/components/Button/RawInfoIconButton.stories.tsx +3 -3
  233. package/src/components/Button/RawInfoIconButton.tsx +17 -15
  234. package/src/components/Button/index.ts +2 -2
  235. package/src/components/Button/lib/index.ts +2 -2
  236. package/src/components/Button/lib/presetIconSize.ts +1 -1
  237. package/src/components/img/index.tsx +1 -0
  238. package/src/components/index.ts +3 -3
  239. package/src/components/shared/Dialog/JsonViewerCollapse.tsx +24 -19
  240. package/src/components/shared/Dialog/RawInfoDialog.stories.tsx +3 -3
  241. package/src/components/shared/Dialog/RawInfoDialog.tsx +3 -3
  242. package/src/components/shared/Dialog/index.ts +2 -2
  243. package/src/components/shared/JsonViewerEx.tsx +1 -0
  244. package/src/components/shared/index.ts +2 -2
  245. package/src/components/styled/index.ts +1 -1
  246. package/src/index.ts +1 -1
  247. package/src/lib/index.ts +1 -1
  248. package/dist/browser/index.js +0 -250
  249. package/dist/browser/index.js.map +0 -1
  250. package/dist/neutral/index.js +0 -250
  251. package/dist/neutral/index.js.map +0 -1
  252. package/dist/node/index.js +0 -250
  253. package/dist/node/index.js.map +0 -1
@@ -0,0 +1,244 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/components/Button/RawInfoButton.tsx
5
+ import { toJson } from "@xylabs/object";
6
+ import { ButtonEx } from "@xylabs/react-button";
7
+ import React5, { useMemo, useState } from "react";
8
+
9
+ // src/components/img/index.tsx
10
+ import { createSvgIcon } from "@mui/material";
11
+ import React from "react";
12
+ var XyoColorLogo = createSvgIcon(/* @__PURE__ */ React.createElement("svg", {
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ viewBox: "0 0 256 238"
15
+ }, /* @__PURE__ */ React.createElement("path", {
16
+ className: "cls-1",
17
+ d: "M74.5,28.33,21.29,120.5,74.5,212.67H180.94l1.76-3,51.46-89.13L180.94,28.33ZM84.65,40.54h78.83L111.65,56.93a15.85,15.85,0,0,1,2,5l59.66-18.81L185.22,101a20.12,20.12,0,0,1,5.36-.78l-10-47.91,37.87,65.53h-7.62a24.21,24.21,0,0,1,.15,2.68,23.29,23.29,0,0,1-.15,2.68h7.62l-39.1,67.75,10.92-50.13A20.57,20.57,0,0,1,185,140l-12.88,59-58.37-19.53a17.61,17.61,0,0,1-1.7,5l47.5,15.92H84.65l4-6.85A20.17,20.17,0,0,1,83.93,191L80,197.78,42.67,133.13l37,32.66a20.52,20.52,0,0,1,3.6-4L36.69,120.66,85,77.79a17.45,17.45,0,0,1-3.19-4.32l-39.46,35L80,43.22l5.56,9.69A17.51,17.51,0,0,1,90.12,50Zm28.24,31.17a16.15,16.15,0,0,1-2.68,4.64l62,35.81a19.74,19.74,0,0,1,2.83-4.54Zm-20,10.51v75.33a18,18,0,0,1,2.47-.16,17.18,17.18,0,0,1,2.89.21v-75a11.21,11.21,0,0,1-1.29,0,17.57,17.57,0,0,1-4.07-.47Zm79.34,46.63-62.08,35.81a18.45,18.45,0,0,1,2.68,4.68l62.23-36a19.68,19.68,0,0,1-2.83-4.53Z",
18
+ fill: "#8d8fc6"
19
+ }), /* @__PURE__ */ React.createElement("path", {
20
+ className: "cls-2",
21
+ d: "M97,48.58a17.06,17.06,0,1,0,17,17,17.08,17.08,0,0,0-17-17Zm0,5.36a11.7,11.7,0,1,1-11.7,11.69A11.65,11.65,0,0,1,97,53.94Z",
22
+ fill: "#579fd6"
23
+ }), /* @__PURE__ */ React.createElement("path", {
24
+ className: "cls-3",
25
+ d: "M95.37,157.39a18.73,18.73,0,1,0,18.7,18.7,18.74,18.74,0,0,0-18.7-18.7Zm0,5.31A13.4,13.4,0,1,1,82,176.09a13.37,13.37,0,0,1,13.4-13.39Z",
26
+ fill: "#f27046"
27
+ }), /* @__PURE__ */ React.createElement("path", {
28
+ className: "cls-4",
29
+ d: "M190.73,100.2A20.3,20.3,0,1,0,211,120.5a20.34,20.34,0,0,0-20.3-20.3Zm0,5.36a14.94,14.94,0,1,1-14.94,14.94,14.88,14.88,0,0,1,14.94-14.94Z",
30
+ fill: "#eb407a"
31
+ })), "XyoColorLogo");
32
+
33
+ // src/components/shared/Dialog/JsonViewerCollapse.tsx
34
+ import { Button, Chip, Collapse, Typography as Typography2 } from "@mui/material";
35
+ import { FlexCol, FlexRow } from "@xylabs/react-flexbox";
36
+ import { usePromise } from "@xylabs/react-promise";
37
+ import { PayloadBuilder } from "@xyo-network/payload-builder";
38
+ import { isAnyPayload } from "@xyo-network/payload-model";
39
+ import { useDataState } from "@xyo-network/react-shared";
40
+ import React3 from "react";
41
+
42
+ // src/components/styled/StyledChipLabel.tsx
43
+ import { styled, Typography } from "@mui/material";
44
+ var StyledChipLabel = styled(Typography, {
45
+ name: "StyledChipLabel"
46
+ })(({ theme }) => ({
47
+ display: "block",
48
+ lineHeight: 1,
49
+ overflow: "hidden",
50
+ paddingRight: theme.spacing(0.95),
51
+ textOverflow: "ellipsis",
52
+ whiteSpace: "nowrap"
53
+ }));
54
+
55
+ // src/components/shared/JsonViewerEx.tsx
56
+ import { useTheme } from "@mui/material";
57
+ import { JsonViewer } from "@textea/json-viewer";
58
+ import { useColorSchemeEx } from "@xylabs/react-invertible-theme";
59
+ import React2 from "react";
60
+ var JsonViewerEx = /* @__PURE__ */ __name((props) => {
61
+ const theme = useTheme();
62
+ const { darkMode } = useColorSchemeEx();
63
+ return /* @__PURE__ */ React2.createElement(JsonViewer, {
64
+ theme: darkMode ? "dark" : "light",
65
+ collapseStringsAfterLength: 50,
66
+ style: {
67
+ background: darkMode ? theme.palette.background.paper : theme.palette.grey[200],
68
+ borderRadius: theme.shape.borderRadius,
69
+ padding: theme.spacing(2)
70
+ },
71
+ ...props
72
+ });
73
+ }, "JsonViewerEx");
74
+
75
+ // src/components/shared/Dialog/JsonViewerCollapse.tsx
76
+ var JsonViewerCollapse = /* @__PURE__ */ __name(({ defaultExpandedJson, jsonValue, updateExpandedJson, ...props }) => {
77
+ const [expandedJson, setExpandedJson] = useDataState(defaultExpandedJson);
78
+ const [hash] = usePromise(async () => {
79
+ if (!jsonValue || !isAnyPayload(jsonValue)) return;
80
+ return await PayloadBuilder.dataHash(jsonValue);
81
+ }, [
82
+ jsonValue
83
+ ]);
84
+ const actionText = expandedJson ? "Hide JSON" : "Show JSON";
85
+ const handleExpansion = /* @__PURE__ */ __name(() => {
86
+ updateExpandedJson == null ? void 0 : updateExpandedJson(!expandedJson);
87
+ setExpandedJson(!expandedJson);
88
+ }, "handleExpansion");
89
+ return /* @__PURE__ */ React3.createElement(React3.Fragment, null, jsonValue ? /* @__PURE__ */ React3.createElement(FlexRow, null, /* @__PURE__ */ React3.createElement(Button, {
90
+ onClick: handleExpansion,
91
+ size: "small",
92
+ variant: "outlined"
93
+ }, actionText)) : null, /* @__PURE__ */ React3.createElement(Collapse, {
94
+ in: expandedJson,
95
+ ...props
96
+ }, jsonValue ? /* @__PURE__ */ React3.createElement(FlexCol, {
97
+ alignItems: "stretch",
98
+ gap: 1.5
99
+ }, /* @__PURE__ */ React3.createElement(Typography2, {
100
+ sx: {
101
+ lineHeight: 1
102
+ }
103
+ }, "Payload Hash:"), hash ? /* @__PURE__ */ React3.createElement(Chip, {
104
+ label: /* @__PURE__ */ React3.createElement(StyledChipLabel, null, hash),
105
+ sx: {
106
+ alignSelf: "start"
107
+ }
108
+ }) : null, /* @__PURE__ */ React3.createElement(JsonViewerEx, {
109
+ value: jsonValue
110
+ })) : null));
111
+ }, "JsonViewerCollapse");
112
+
113
+ // src/components/shared/Dialog/RawInfoDialog.tsx
114
+ import { Button as Button2, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
115
+ import React4 from "react";
116
+ var RawInfoDialog = /* @__PURE__ */ __name(({ defaultExpandedJson, dialogContent, onCloseCallback, jsonValue: jsonObject, updateExpandedJson, open = false, ...props }) => {
117
+ const onDialogClick = /* @__PURE__ */ __name((event) => {
118
+ event.stopPropagation();
119
+ }, "onDialogClick");
120
+ return (
121
+ // Wrapping in a span so we can catch click events and prevent them from propagating outside the component
122
+ /* @__PURE__ */ React4.createElement("span", {
123
+ onClick: onDialogClick
124
+ }, /* @__PURE__ */ React4.createElement(Dialog, {
125
+ fullWidth: true,
126
+ maxWidth: "lg",
127
+ onClose: /* @__PURE__ */ __name(() => onCloseCallback == null ? void 0 : onCloseCallback(), "onClose"),
128
+ open,
129
+ ...props
130
+ }, /* @__PURE__ */ React4.createElement(DialogTitle, null, "Raw Data"), /* @__PURE__ */ React4.createElement(DialogContent, {
131
+ sx: {
132
+ display: "flex",
133
+ flexDirection: "column",
134
+ gap: 2
135
+ }
136
+ }, dialogContent, /* @__PURE__ */ React4.createElement(JsonViewerCollapse, {
137
+ defaultExpandedJson,
138
+ jsonValue: jsonObject,
139
+ updateExpandedJson
140
+ })), /* @__PURE__ */ React4.createElement(DialogActions, null, /* @__PURE__ */ React4.createElement(Button2, {
141
+ variant: "contained",
142
+ onClick: /* @__PURE__ */ __name(() => onCloseCallback == null ? void 0 : onCloseCallback(), "onClick")
143
+ }, "Close"))))
144
+ );
145
+ }, "RawInfoDialog");
146
+
147
+ // src/components/Button/lib/presetIconSize.ts
148
+ var presetIconSizeValue = /* @__PURE__ */ __name((size) => {
149
+ switch (size) {
150
+ case "small": {
151
+ return 16;
152
+ }
153
+ case "medium": {
154
+ return 32;
155
+ }
156
+ case "large": {
157
+ return 48;
158
+ }
159
+ }
160
+ }, "presetIconSizeValue");
161
+
162
+ // src/components/Button/RawInfoButton.tsx
163
+ var RawInfoButton = /* @__PURE__ */ __name(({ defaultExpandedJson = true, dialogContent, iconOnly, iconSize = 24, onCloseCallback, children, rawValue, presetIconSize, updateExpandedJson, ...props }) => {
164
+ const [open, setOpen] = useState(false);
165
+ const size = presetIconSizeValue(presetIconSize);
166
+ const json = useMemo(() => toJson(rawValue), [
167
+ rawValue
168
+ ]);
169
+ const handleClick = /* @__PURE__ */ __name((event) => {
170
+ event.stopPropagation();
171
+ setOpen(true);
172
+ }, "handleClick");
173
+ const onCloseCallBackWrapped = /* @__PURE__ */ __name(() => {
174
+ setOpen(false);
175
+ onCloseCallback == null ? void 0 : onCloseCallback();
176
+ }, "onCloseCallBackWrapped");
177
+ return /* @__PURE__ */ React5.createElement("span", null, /* @__PURE__ */ React5.createElement(ButtonEx, {
178
+ variant: "outlined",
179
+ size: "small",
180
+ startIcon: /* @__PURE__ */ React5.createElement(XyoColorLogo, {
181
+ sx: {
182
+ height: size ?? iconSize,
183
+ width: size ?? iconSize
184
+ }
185
+ }),
186
+ onClick: handleClick,
187
+ disabled: iconOnly ? false : !rawValue,
188
+ ...props
189
+ }, children ?? /* @__PURE__ */ React5.createElement("span", null, "Data")), iconOnly ? null : /* @__PURE__ */ React5.createElement(RawInfoDialog, {
190
+ defaultExpandedJson,
191
+ jsonValue: json,
192
+ onCloseCallback: onCloseCallBackWrapped,
193
+ dialogContent,
194
+ open,
195
+ updateExpandedJson
196
+ }));
197
+ }, "RawInfoButton");
198
+
199
+ // src/components/Button/RawInfoIconButton.tsx
200
+ import { IconButton } from "@mui/material";
201
+ import { toJson as toJson2 } from "@xylabs/object";
202
+ import React6, { forwardRef, useMemo as useMemo2, useState as useState2 } from "react";
203
+ var RawInfoIconButton = /* @__PURE__ */ forwardRef(({ defaultExpandedJson = true, dialogContent, iconOnly, iconSize = 32, onCloseCallback, rawValue, presetIconSize, updateExpandedJson, ...props }, ref) => {
204
+ const [open, setOpen] = useState2(false);
205
+ const size = presetIconSizeValue(presetIconSize);
206
+ const json = useMemo2(() => toJson2(rawValue), [
207
+ rawValue
208
+ ]);
209
+ const handleClick = /* @__PURE__ */ __name((event) => {
210
+ event.stopPropagation();
211
+ setOpen(true);
212
+ }, "handleClick");
213
+ const onCloseCallBackWrapped = /* @__PURE__ */ __name(() => {
214
+ setOpen(false);
215
+ onCloseCallback == null ? void 0 : onCloseCallback();
216
+ }, "onCloseCallBackWrapped");
217
+ return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(IconButton, {
218
+ onClick: handleClick,
219
+ ref,
220
+ ...props
221
+ }, /* @__PURE__ */ React6.createElement(XyoColorLogo, {
222
+ sx: {
223
+ height: size ?? iconSize,
224
+ width: size ?? iconSize
225
+ }
226
+ })), iconOnly ? null : /* @__PURE__ */ React6.createElement(RawInfoDialog, {
227
+ defaultExpandedJson,
228
+ jsonValue: json,
229
+ onCloseCallback: onCloseCallBackWrapped,
230
+ dialogContent,
231
+ open,
232
+ updateExpandedJson
233
+ }));
234
+ });
235
+ RawInfoIconButton.displayName = "RawInfoIcon";
236
+ export {
237
+ JsonViewerCollapse,
238
+ JsonViewerEx,
239
+ RawInfoButton,
240
+ RawInfoDialog,
241
+ RawInfoIconButton,
242
+ StyledChipLabel
243
+ };
244
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/Button/RawInfoButton.tsx","../../src/components/img/index.tsx","../../src/components/shared/Dialog/JsonViewerCollapse.tsx","../../src/components/styled/StyledChipLabel.tsx","../../src/components/shared/JsonViewerEx.tsx","../../src/components/shared/Dialog/RawInfoDialog.tsx","../../src/components/Button/lib/presetIconSize.ts","../../src/components/Button/RawInfoIconButton.tsx"],"sourcesContent":["import { toJson } from '@xylabs/object'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport React, { MouseEventHandler, ReactNode, useMemo, useState } from 'react'\n\nimport { ExpansionProps } from '../../lib/index.ts'\nimport { XyoColorLogo } from '../img/index.tsx'\nimport { RawInfoDialog } from '../shared/index.ts'\nimport { IconSize, presetIconSizeValue } from './lib/index.ts'\n\nexport interface RawInfoButtonProps extends ButtonExProps, ExpansionProps {\n dialogContent?: ReactNode\n iconOnly?: boolean\n iconSize?: number\n onCloseCallback?: () => void\n presetIconSize?: IconSize\n rawValue?: unknown\n}\n\nexport const RawInfoButton: React.FC<RawInfoButtonProps> = ({\n defaultExpandedJson = true,\n dialogContent,\n iconOnly,\n iconSize = 24,\n onCloseCallback,\n children,\n rawValue,\n presetIconSize,\n updateExpandedJson,\n ...props\n}) => {\n const [open, setOpen] = useState(false)\n const size = presetIconSizeValue(presetIconSize)\n const json = useMemo(() => toJson(rawValue), [rawValue])\n\n const handleClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n event.stopPropagation()\n setOpen(true)\n }\n\n const onCloseCallBackWrapped = () => {\n setOpen(false)\n onCloseCallback?.()\n }\n\n return (\n <span>\n <ButtonEx\n variant=\"outlined\"\n size=\"small\"\n startIcon={<XyoColorLogo sx={{ height: size ?? iconSize, width: size ?? iconSize }} />}\n onClick={handleClick}\n disabled={iconOnly ? false : !rawValue}\n {...props}\n >\n {children ?? <span>Data</span>}\n </ButtonEx>\n {iconOnly\n ? null\n : (\n <RawInfoDialog\n defaultExpandedJson={defaultExpandedJson}\n jsonValue={json}\n onCloseCallback={onCloseCallBackWrapped}\n dialogContent={dialogContent}\n open={open}\n updateExpandedJson={updateExpandedJson}\n />\n )}\n </span>\n )\n}\n","import { createSvgIcon } from '@mui/material'\nimport React from 'react'\n\nexport const XyoColorLogo = createSvgIcon(\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 238\">\n <path\n className=\"cls-1\"\n d=\"M74.5,28.33,21.29,120.5,74.5,212.67H180.94l1.76-3,51.46-89.13L180.94,28.33ZM84.65,40.54h78.83L111.65,56.93a15.85,15.85,0,0,1,2,5l59.66-18.81L185.22,101a20.12,20.12,0,0,1,5.36-.78l-10-47.91,37.87,65.53h-7.62a24.21,24.21,0,0,1,.15,2.68,23.29,23.29,0,0,1-.15,2.68h7.62l-39.1,67.75,10.92-50.13A20.57,20.57,0,0,1,185,140l-12.88,59-58.37-19.53a17.61,17.61,0,0,1-1.7,5l47.5,15.92H84.65l4-6.85A20.17,20.17,0,0,1,83.93,191L80,197.78,42.67,133.13l37,32.66a20.52,20.52,0,0,1,3.6-4L36.69,120.66,85,77.79a17.45,17.45,0,0,1-3.19-4.32l-39.46,35L80,43.22l5.56,9.69A17.51,17.51,0,0,1,90.12,50Zm28.24,31.17a16.15,16.15,0,0,1-2.68,4.64l62,35.81a19.74,19.74,0,0,1,2.83-4.54Zm-20,10.51v75.33a18,18,0,0,1,2.47-.16,17.18,17.18,0,0,1,2.89.21v-75a11.21,11.21,0,0,1-1.29,0,17.57,17.57,0,0,1-4.07-.47Zm79.34,46.63-62.08,35.81a18.45,18.45,0,0,1,2.68,4.68l62.23-36a19.68,19.68,0,0,1-2.83-4.53Z\"\n fill=\"#8d8fc6\"\n />\n <path\n className=\"cls-2\"\n d=\"M97,48.58a17.06,17.06,0,1,0,17,17,17.08,17.08,0,0,0-17-17Zm0,5.36a11.7,11.7,0,1,1-11.7,11.69A11.65,11.65,0,0,1,97,53.94Z\"\n fill=\"#579fd6\"\n />\n <path\n className=\"cls-3\"\n d=\"M95.37,157.39a18.73,18.73,0,1,0,18.7,18.7,18.74,18.74,0,0,0-18.7-18.7Zm0,5.31A13.4,13.4,0,1,1,82,176.09a13.37,13.37,0,0,1,13.4-13.39Z\"\n fill=\"#f27046\"\n />\n <path\n className=\"cls-4\"\n d=\"M190.73,100.2A20.3,20.3,0,1,0,211,120.5a20.34,20.34,0,0,0-20.3-20.3Zm0,5.36a14.94,14.94,0,1,1-14.94,14.94,14.88,14.88,0,0,1,14.94-14.94Z\"\n fill=\"#eb407a\"\n />\n </svg>,\n 'XyoColorLogo',\n)\n","import { Button, Chip, Collapse, CollapseProps, Typography } from '@mui/material'\nimport { JsonValue } from '@xylabs/object'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { isAnyPayload } from '@xyo-network/payload-model'\nimport { useDataState } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { ExpansionProps } from '../../../lib/index.ts'\nimport { StyledChipLabel } from '../../styled/index.ts'\nimport { JsonViewerEx } from '../JsonViewerEx.tsx'\n\nexport interface RawInfoPayloadCollapse extends CollapseProps, ExpansionProps {\n jsonValue?: JsonValue\n}\n\nexport const JsonViewerCollapse: React.FC<RawInfoPayloadCollapse> = ({ defaultExpandedJson, jsonValue, updateExpandedJson, ...props }) => {\n const [expandedJson, setExpandedJson] = useDataState(defaultExpandedJson)\n\n const [hash] = usePromise(async () => {\n if (!jsonValue || !isAnyPayload(jsonValue)) return\n return await PayloadBuilder.dataHash(jsonValue)\n }, [jsonValue])\n\n const actionText = expandedJson ? 'Hide JSON' : 'Show JSON'\n\n const handleExpansion = () => {\n updateExpandedJson?.(!expandedJson)\n setExpandedJson(!expandedJson)\n }\n\n return (\n <>\n {jsonValue\n ? (\n <FlexRow>\n <Button onClick={handleExpansion} size=\"small\" variant=\"outlined\">\n {actionText}\n </Button>\n </FlexRow>\n )\n : null}\n <Collapse in={expandedJson} {...props}>\n {jsonValue\n ? (\n <FlexCol alignItems=\"stretch\" gap={1.5}>\n <Typography sx={{ lineHeight: 1 }}>Payload Hash:</Typography>\n {hash\n ? <Chip label={<StyledChipLabel>{hash}</StyledChipLabel>} sx={{ alignSelf: 'start' }} />\n : null}\n <JsonViewerEx value={jsonValue} />\n </FlexCol>\n )\n : null}\n </Collapse>\n </>\n )\n}\n","import { styled, Typography } from '@mui/material'\n\nexport const StyledChipLabel = styled(Typography, { name: 'StyledChipLabel' })(({ theme }) => ({\n display: 'block',\n lineHeight: 1,\n overflow: 'hidden',\n paddingRight: theme.spacing(0.95),\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n}))\n","import { useTheme } from '@mui/material'\nimport { JsonViewer, JsonViewerProps } from '@textea/json-viewer'\nimport { useColorSchemeEx } from '@xylabs/react-invertible-theme'\nimport React from 'react'\n\nexport type JsonViewerExProps = JsonViewerProps\n\nexport const JsonViewerEx: React.FC<JsonViewerExProps> = (props) => {\n const theme = useTheme()\n const { darkMode } = useColorSchemeEx()\n\n return (\n <JsonViewer\n theme={darkMode ? 'dark' : 'light'}\n collapseStringsAfterLength={50}\n style={{\n background: darkMode ? theme.palette.background.paper : theme.palette.grey[200],\n borderRadius: theme.shape.borderRadius,\n padding: theme.spacing(2),\n }}\n {...props}\n />\n )\n}\n","import { Button, Dialog, DialogActions, DialogContent, DialogProps, DialogTitle } from '@mui/material'\nimport { JsonValue } from '@xylabs/object'\nimport React, { MouseEventHandler, ReactNode } from 'react'\n\nimport { ExpansionProps } from '../../../lib/index.ts'\nimport { JsonViewerCollapse } from './JsonViewerCollapse.tsx'\n\nexport interface RawInfoDialogProps extends DialogProps, ExpansionProps {\n dialogContent?: ReactNode\n jsonValue?: JsonValue\n onCloseCallback?: () => void\n}\n\nexport const RawInfoDialog: React.FC<RawInfoDialogProps> = ({\n defaultExpandedJson,\n dialogContent,\n onCloseCallback,\n jsonValue: jsonObject,\n updateExpandedJson,\n open = false,\n ...props\n}) => {\n const onDialogClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n event.stopPropagation()\n }\n\n return (\n // Wrapping in a span so we can catch click events and prevent them from propagating outside the component\n <span onClick={onDialogClick}>\n <Dialog fullWidth maxWidth=\"lg\" onClose={() => onCloseCallback?.()} open={open} {...props}>\n <DialogTitle>Raw Data</DialogTitle>\n <DialogContent sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>\n {dialogContent}\n <JsonViewerCollapse defaultExpandedJson={defaultExpandedJson} jsonValue={jsonObject} updateExpandedJson={updateExpandedJson} />\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => onCloseCallback?.()}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n </span>\n )\n}\n","import { IconSize } from './IconSize.ts'\n\nexport const presetIconSizeValue = (size?: IconSize) => {\n switch (size) {\n case 'small': {\n return 16\n }\n case 'medium': {\n return 32\n }\n case 'large': {\n return 48\n }\n }\n}\n","import { IconButton, IconButtonProps } from '@mui/material'\nimport { toJson } from '@xylabs/object'\nimport React, { forwardRef, MouseEventHandler, ReactNode, useMemo, useState } from 'react'\n\nimport { ExpansionProps } from '../../lib/index.ts'\nimport { XyoColorLogo } from '../img/index.tsx'\nimport { RawInfoDialog } from '../shared/index.ts'\nimport { IconSize, presetIconSizeValue } from './lib/index.ts'\n\nexport interface RawInfoIconProps extends IconButtonProps, ExpansionProps {\n dialogContent?: ReactNode\n iconOnly?: boolean\n iconSize?: number\n onCloseCallback?: () => void\n presetIconSize?: IconSize\n rawValue?: unknown\n}\n\nexport const RawInfoIconButton = forwardRef<HTMLButtonElement, RawInfoIconProps>(\n (\n { defaultExpandedJson = true, dialogContent, iconOnly, iconSize = 32, onCloseCallback, rawValue, presetIconSize, updateExpandedJson, ...props },\n ref,\n ) => {\n const [open, setOpen] = useState(false)\n const size = presetIconSizeValue(presetIconSize)\n const json = useMemo(() => toJson(rawValue), [rawValue])\n\n const handleClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n event.stopPropagation()\n setOpen(true)\n }\n\n const onCloseCallBackWrapped = () => {\n setOpen(false)\n onCloseCallback?.()\n }\n\n return (\n <>\n <IconButton onClick={handleClick} ref={ref} {...props}>\n <XyoColorLogo sx={{ height: size ?? iconSize, width: size ?? iconSize }} />\n </IconButton>\n {iconOnly\n ? null\n : (\n <RawInfoDialog\n defaultExpandedJson={defaultExpandedJson}\n jsonValue={json}\n onCloseCallback={onCloseCallBackWrapped}\n dialogContent={dialogContent}\n open={open}\n updateExpandedJson={updateExpandedJson}\n />\n )}\n </>\n )\n },\n)\n\nRawInfoIconButton.displayName = 'RawInfoIcon'\n"],"mappings":";;;;AAAA,SAASA,cAAc;AACvB,SAASC,gBAA+B;AACxC,OAAOC,UAAuCC,SAASC,gBAAgB;;;ACFvE,SAASC,qBAAqB;AAC9B,OAAOC,WAAW;AAEX,IAAMC,eAAeF,cAC1B,sBAAA,cAACG,OAAAA;EAAIC,OAAM;EAA6BC,SAAQ;GAC9C,sBAAA,cAACC,QAAAA;EACCC,WAAU;EACVC,GAAE;EACFC,MAAK;IAEP,sBAAA,cAACH,QAAAA;EACCC,WAAU;EACVC,GAAE;EACFC,MAAK;IAEP,sBAAA,cAACH,QAAAA;EACCC,WAAU;EACVC,GAAE;EACFC,MAAK;IAEP,sBAAA,cAACH,QAAAA;EACCC,WAAU;EACVC,GAAE;EACFC,MAAK;KAGT,cAAA;;;AC1BF,SAASC,QAAQC,MAAMC,UAAyBC,cAAAA,mBAAkB;AAElE,SAASC,SAASC,eAAe;AACjC,SAASC,kBAAkB;AAC3B,SAASC,sBAAsB;AAC/B,SAASC,oBAAoB;AAC7B,SAASC,oBAAoB;AAC7B,OAAOC,YAAW;;;ACPlB,SAASC,QAAQC,kBAAkB;AAE5B,IAAMC,kBAAkBF,OAAOC,YAAY;EAAEE,MAAM;AAAkB,CAAA,EAAG,CAAC,EAAEC,MAAK,OAAQ;EAC7FC,SAAS;EACTC,YAAY;EACZC,UAAU;EACVC,cAAcJ,MAAMK,QAAQ,IAAA;EAC5BC,cAAc;EACdC,YAAY;AACd,EAAA;;;ACTA,SAASC,gBAAgB;AACzB,SAASC,kBAAmC;AAC5C,SAASC,wBAAwB;AACjC,OAAOC,YAAW;AAIX,IAAMC,eAA4C,wBAACC,UAAAA;AACxD,QAAMC,QAAQC,SAAAA;AACd,QAAM,EAAEC,SAAQ,IAAKC,iBAAAA;AAErB,SACE,gBAAAC,OAAA,cAACC,YAAAA;IACCL,OAAOE,WAAW,SAAS;IAC3BI,4BAA4B;IAC5BC,OAAO;MACLC,YAAYN,WAAWF,MAAMS,QAAQD,WAAWE,QAAQV,MAAMS,QAAQE,KAAK,GAAA;MAC3EC,cAAcZ,MAAMa,MAAMD;MAC1BE,SAASd,MAAMe,QAAQ,CAAA;IACzB;IACC,GAAGhB;;AAGV,GAhByD;;;AFUlD,IAAMiB,qBAAuD,wBAAC,EAAEC,qBAAqBC,WAAWC,oBAAoB,GAAGC,MAAAA,MAAO;AACnI,QAAM,CAACC,cAAcC,eAAAA,IAAmBC,aAAaN,mBAAAA;AAErD,QAAM,CAACO,IAAAA,IAAQC,WAAW,YAAA;AACxB,QAAI,CAACP,aAAa,CAACQ,aAAaR,SAAAA,EAAY;AAC5C,WAAO,MAAMS,eAAeC,SAASV,SAAAA;EACvC,GAAG;IAACA;GAAU;AAEd,QAAMW,aAAaR,eAAe,cAAc;AAEhD,QAAMS,kBAAkB,6BAAA;AACtBX,6DAAqB,CAACE;AACtBC,oBAAgB,CAACD,YAAAA;EACnB,GAHwB;AAKxB,SACE,gBAAAU,OAAA,cAAAA,OAAA,UAAA,MACGb,YAEK,gBAAAa,OAAA,cAACC,SAAAA,MACC,gBAAAD,OAAA,cAACE,QAAAA;IAAOC,SAASJ;IAAiBK,MAAK;IAAQC,SAAQ;KACpDP,UAAAA,CAAAA,IAIP,MACJ,gBAAAE,OAAA,cAACM,UAAAA;IAASC,IAAIjB;IAAe,GAAGD;KAC7BF,YAEK,gBAAAa,OAAA,cAACQ,SAAAA;IAAQC,YAAW;IAAUC,KAAK;KACjC,gBAAAV,OAAA,cAACW,aAAAA;IAAWC,IAAI;MAAEC,YAAY;IAAE;KAAG,eAAA,GAClCpB,OACG,gBAAAO,OAAA,cAACc,MAAAA;IAAKC,OAAO,gBAAAf,OAAA,cAACgB,iBAAAA,MAAiBvB,IAAAA;IAAyBmB,IAAI;MAAEK,WAAW;IAAQ;OACjF,MACJ,gBAAAjB,OAAA,cAACkB,cAAAA;IAAaC,OAAOhC;QAGzB,IAAA,CAAA;AAIZ,GAzCoE;;;AGjBpE,SAASiC,UAAAA,SAAQC,QAAQC,eAAeC,eAA4BC,mBAAmB;AAEvF,OAAOC,YAA6C;AAW7C,IAAMC,gBAA8C,wBAAC,EAC1DC,qBACAC,eACAC,iBACAC,WAAWC,YACXC,oBACAC,OAAO,OACP,GAAGC,MAAAA,MACJ;AACC,QAAMC,gBAAoD,wBAACC,UAAAA;AACzDA,UAAMC,gBAAe;EACvB,GAF0D;AAI1D;;IAEE,gBAAAC,OAAA,cAACC,QAAAA;MAAKC,SAASL;OACb,gBAAAG,OAAA,cAACG,QAAAA;MAAOC,WAAAA;MAAUC,UAAS;MAAKC,SAAS,6BAAMf,sDAAN;MAA2BI;MAAa,GAAGC;OAClF,gBAAAI,OAAA,cAACO,aAAAA,MAAY,UAAA,GACb,gBAAAP,OAAA,cAACQ,eAAAA;MAAcC,IAAI;QAAEC,SAAS;QAAQC,eAAe;QAAUC,KAAK;MAAE;OACnEtB,eACD,gBAAAU,OAAA,cAACa,oBAAAA;MAAmBxB;MAA0CG,WAAWC;MAAYC;SAEvF,gBAAAM,OAAA,cAACc,eAAAA,MACC,gBAAAd,OAAA,cAACe,SAAAA;MAAOC,SAAQ;MAAYd,SAAS,6BAAMX,sDAAN;OAA2B,OAAA,CAAA,CAAA,CAAA;;AAO1E,GA9B2D;;;ACXpD,IAAM0B,sBAAsB,wBAACC,SAAAA;AAClC,UAAQA,MAAAA;IACN,KAAK,SAAS;AACZ,aAAO;IACT;IACA,KAAK,UAAU;AACb,aAAO;IACT;IACA,KAAK,SAAS;AACZ,aAAO;IACT;EACF;AACF,GAZmC;;;ANgB5B,IAAMC,gBAA8C,wBAAC,EAC1DC,sBAAsB,MACtBC,eACAC,UACAC,WAAW,IACXC,iBACAC,UACAC,UACAC,gBACAC,oBACA,GAAGC,MAAAA,MACJ;AACC,QAAM,CAACC,MAAMC,OAAAA,IAAWC,SAAS,KAAA;AACjC,QAAMC,OAAOC,oBAAoBP,cAAAA;AACjC,QAAMQ,OAAOC,QAAQ,MAAMC,OAAOX,QAAAA,GAAW;IAACA;GAAS;AAEvD,QAAMY,cAAoD,wBAACC,UAAAA;AACzDA,UAAMC,gBAAe;AACrBT,YAAQ,IAAA;EACV,GAH0D;AAK1D,QAAMU,yBAAyB,6BAAA;AAC7BV,YAAQ,KAAA;AACRP;EACF,GAH+B;AAK/B,SACE,gBAAAkB,OAAA,cAACC,QAAAA,MACC,gBAAAD,OAAA,cAACE,UAAAA;IACCC,SAAQ;IACRZ,MAAK;IACLa,WAAW,gBAAAJ,OAAA,cAACK,cAAAA;MAAaC,IAAI;QAAEC,QAAQhB,QAAQV;QAAU2B,OAAOjB,QAAQV;MAAS;;IACjF4B,SAASb;IACTc,UAAU9B,WAAW,QAAQ,CAACI;IAC7B,GAAGG;KAEHJ,YAAY,gBAAAiB,OAAA,cAACC,QAAAA,MAAK,MAAA,CAAA,GAEpBrB,WACG,OAEE,gBAAAoB,OAAA,cAACW,eAAAA;IACCjC;IACAkC,WAAWnB;IACXX,iBAAiBiB;IACjBpB;IACAS;IACAF;;AAKd,GApD2D;;;AOlB3D,SAAS2B,kBAAmC;AAC5C,SAASC,UAAAA,eAAc;AACvB,OAAOC,UAASC,YAA0CC,WAAAA,UAASC,YAAAA,iBAAgB;AAgB5E,IAAMC,oBAAoBC,2BAC/B,CACE,EAAEC,sBAAsB,MAAMC,eAAeC,UAAUC,WAAW,IAAIC,iBAAiBC,UAAUC,gBAAgBC,oBAAoB,GAAGC,MAAAA,GACxIC,QAAAA;AAEA,QAAM,CAACC,MAAMC,OAAAA,IAAWC,UAAS,KAAA;AACjC,QAAMC,OAAOC,oBAAoBR,cAAAA;AACjC,QAAMS,OAAOC,SAAQ,MAAMC,QAAOZ,QAAAA,GAAW;IAACA;GAAS;AAEvD,QAAMa,cAAoD,wBAACC,UAAAA;AACzDA,UAAMC,gBAAe;AACrBT,YAAQ,IAAA;EACV,GAH0D;AAK1D,QAAMU,yBAAyB,6BAAA;AAC7BV,YAAQ,KAAA;AACRP;EACF,GAH+B;AAK/B,SACE,gBAAAkB,OAAA,cAAAA,OAAA,UAAA,MACE,gBAAAA,OAAA,cAACC,YAAAA;IAAWC,SAASN;IAAaT;IAAW,GAAGD;KAC9C,gBAAAc,OAAA,cAACG,cAAAA;IAAaC,IAAI;MAAEC,QAAQd,QAAQV;MAAUyB,OAAOf,QAAQV;IAAS;OAEvED,WACG,OAEE,gBAAAoB,OAAA,cAACO,eAAAA;IACC7B;IACA8B,WAAWf;IACXX,iBAAiBiB;IACjBpB;IACAS;IACAH;;AAKd,CAAA;AAGFT,kBAAkBiC,cAAc;","names":["toJson","ButtonEx","React","useMemo","useState","createSvgIcon","React","XyoColorLogo","svg","xmlns","viewBox","path","className","d","fill","Button","Chip","Collapse","Typography","FlexCol","FlexRow","usePromise","PayloadBuilder","isAnyPayload","useDataState","React","styled","Typography","StyledChipLabel","name","theme","display","lineHeight","overflow","paddingRight","spacing","textOverflow","whiteSpace","useTheme","JsonViewer","useColorSchemeEx","React","JsonViewerEx","props","theme","useTheme","darkMode","useColorSchemeEx","React","JsonViewer","collapseStringsAfterLength","style","background","palette","paper","grey","borderRadius","shape","padding","spacing","JsonViewerCollapse","defaultExpandedJson","jsonValue","updateExpandedJson","props","expandedJson","setExpandedJson","useDataState","hash","usePromise","isAnyPayload","PayloadBuilder","dataHash","actionText","handleExpansion","React","FlexRow","Button","onClick","size","variant","Collapse","in","FlexCol","alignItems","gap","Typography","sx","lineHeight","Chip","label","StyledChipLabel","alignSelf","JsonViewerEx","value","Button","Dialog","DialogActions","DialogContent","DialogTitle","React","RawInfoDialog","defaultExpandedJson","dialogContent","onCloseCallback","jsonValue","jsonObject","updateExpandedJson","open","props","onDialogClick","event","stopPropagation","React","span","onClick","Dialog","fullWidth","maxWidth","onClose","DialogTitle","DialogContent","sx","display","flexDirection","gap","JsonViewerCollapse","DialogActions","Button","variant","presetIconSizeValue","size","RawInfoButton","defaultExpandedJson","dialogContent","iconOnly","iconSize","onCloseCallback","children","rawValue","presetIconSize","updateExpandedJson","props","open","setOpen","useState","size","presetIconSizeValue","json","useMemo","toJson","handleClick","event","stopPropagation","onCloseCallBackWrapped","React","span","ButtonEx","variant","startIcon","XyoColorLogo","sx","height","width","onClick","disabled","RawInfoDialog","jsonValue","IconButton","toJson","React","forwardRef","useMemo","useState","RawInfoIconButton","forwardRef","defaultExpandedJson","dialogContent","iconOnly","iconSize","onCloseCallback","rawValue","presetIconSize","updateExpandedJson","props","ref","open","setOpen","useState","size","presetIconSizeValue","json","useMemo","toJson","handleClick","event","stopPropagation","onCloseCallBackWrapped","React","IconButton","onClick","XyoColorLogo","sx","height","width","RawInfoDialog","jsonValue","displayName"]}
@@ -1,2 +1,2 @@
1
- export * from './ExpansionProps.js';
1
+ export * from './ExpansionProps.ts';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- export * from './ExpansionProps.js';
1
+ export * from './ExpansionProps.ts';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- export * from './ExpansionProps.js';
1
+ export * from './ExpansionProps.ts';
2
2
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -11,19 +11,19 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@textea/json-viewer": "^3.4.1",
14
- "@xylabs/object": "^3.6.4",
15
- "@xylabs/react-button": "^3.4.1",
16
- "@xylabs/react-flexbox": "^3.4.1",
17
- "@xylabs/react-invertible-theme": "^3.4.1",
18
- "@xylabs/react-promise": "^3.4.1",
19
- "@xyo-network/payload-builder": "^2.110.9",
20
- "@xyo-network/payload-model": "^2.110.9",
21
- "@xyo-network/react-shared": "^2.81.9"
14
+ "@xylabs/object": "^3.6.12",
15
+ "@xylabs/react-button": "^3.4.2",
16
+ "@xylabs/react-flexbox": "^3.4.2",
17
+ "@xylabs/react-invertible-theme": "^3.4.2",
18
+ "@xylabs/react-promise": "^3.4.2",
19
+ "@xyo-network/payload-builder": "^2.111.3",
20
+ "@xyo-network/payload-model": "^2.111.3",
21
+ "@xyo-network/react-shared": "^2.82.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@storybook/react": "^7.6.20",
25
- "@xylabs/ts-scripts-yarn3": "^3.12.4",
26
- "@xylabs/tsconfig-react": "^3.12.4",
24
+ "@storybook/react": "^8.2.7",
25
+ "@xylabs/ts-scripts-yarn3": "^3.15.16",
26
+ "@xylabs/tsconfig-react": "^3.15.16",
27
27
  "typescript": "^5.5.4"
28
28
  },
29
29
  "peerDependencies": {
@@ -42,7 +42,7 @@
42
42
  "node": {
43
43
  "import": {
44
44
  "types": "./dist/node/index.d.mts",
45
- "default": "./dist/node/index.js"
45
+ "default": "./dist/node/index.mjs"
46
46
  },
47
47
  "require": {
48
48
  "types": "./dist/node/index.d.cts",
@@ -52,19 +52,19 @@
52
52
  "browser": {
53
53
  "import": {
54
54
  "types": "./dist/browser/index.d.mts",
55
- "default": "./dist/browser/index.js"
55
+ "default": "./dist/browser/index.mjs"
56
56
  },
57
57
  "require": {
58
58
  "types": "./dist/browser/index.d.cts",
59
59
  "default": "./dist/browser/index.cjs"
60
60
  }
61
61
  },
62
- "default": "./dist/browser/index.js"
62
+ "default": "./dist/browser/index.mjs"
63
63
  },
64
64
  "./package.json": "./package.json"
65
65
  },
66
66
  "main": "dist/browser/index.cjs",
67
- "module": "dist/browser/index.js",
67
+ "module": "dist/browser/index.mjs",
68
68
  "types": "dist/browser/index.d.ts",
69
69
  "homepage": "https://xyo.network",
70
70
  "keywords": [
@@ -86,6 +86,6 @@
86
86
  "license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\""
87
87
  },
88
88
  "sideEffects": false,
89
- "version": "2.81.9",
89
+ "version": "2.82.0",
90
90
  "type": "module"
91
91
  }
@@ -1,8 +1,9 @@
1
1
  import { Meta, StoryFn } from '@storybook/react'
2
2
  import { FlexCol } from '@xylabs/react-flexbox'
3
3
  import { Payload } from '@xyo-network/payload-model'
4
+ import React from 'react'
4
5
 
5
- import { RawInfoButton } from './RawInfoButton.js'
6
+ import { RawInfoButton } from './RawInfoButton.tsx'
6
7
 
7
8
  type TestPayload = Payload<{ id: string; schema: string; type: string }, 'network.xyo.test'>
8
9
  const TestPayload: TestPayload = {
@@ -11,13 +12,12 @@ const TestPayload: TestPayload = {
11
12
  type: 'test',
12
13
  }
13
14
 
14
- // eslint-disable-next-line import/no-default-export
15
15
  export default {
16
16
  component: RawInfoButton,
17
17
  title: 'payload/RawInfoButton',
18
18
  } as Meta
19
19
 
20
- const Template: StoryFn<typeof RawInfoButton> = (args) => (
20
+ const Template: StoryFn<typeof RawInfoButton> = args => (
21
21
  <FlexCol>
22
22
  <RawInfoButton {...args} />
23
23
  </FlexCol>
@@ -1,11 +1,11 @@
1
1
  import { toJson } from '@xylabs/object'
2
2
  import { ButtonEx, ButtonExProps } from '@xylabs/react-button'
3
- import { MouseEventHandler, ReactNode, useMemo, useState } from 'react'
3
+ import React, { MouseEventHandler, ReactNode, useMemo, useState } from 'react'
4
4
 
5
- import { ExpansionProps } from '../../lib/index.js'
6
- import { XyoColorLogo } from '../img/index.js'
7
- import { RawInfoDialog } from '../shared/index.js'
8
- import { IconSize, presetIconSizeValue } from './lib/index.js'
5
+ import { ExpansionProps } from '../../lib/index.ts'
6
+ import { XyoColorLogo } from '../img/index.tsx'
7
+ import { RawInfoDialog } from '../shared/index.ts'
8
+ import { IconSize, presetIconSizeValue } from './lib/index.ts'
9
9
 
10
10
  export interface RawInfoButtonProps extends ButtonExProps, ExpansionProps {
11
11
  dialogContent?: ReactNode
@@ -54,16 +54,18 @@ export const RawInfoButton: React.FC<RawInfoButtonProps> = ({
54
54
  >
55
55
  {children ?? <span>Data</span>}
56
56
  </ButtonEx>
57
- {iconOnly ? null : (
58
- <RawInfoDialog
59
- defaultExpandedJson={defaultExpandedJson}
60
- jsonValue={json}
61
- onCloseCallback={onCloseCallBackWrapped}
62
- dialogContent={dialogContent}
63
- open={open}
64
- updateExpandedJson={updateExpandedJson}
65
- />
66
- )}
57
+ {iconOnly
58
+ ? null
59
+ : (
60
+ <RawInfoDialog
61
+ defaultExpandedJson={defaultExpandedJson}
62
+ jsonValue={json}
63
+ onCloseCallback={onCloseCallBackWrapped}
64
+ dialogContent={dialogContent}
65
+ open={open}
66
+ updateExpandedJson={updateExpandedJson}
67
+ />
68
+ )}
67
69
  </span>
68
70
  )
69
71
  }
@@ -1,8 +1,9 @@
1
1
  import { Meta, StoryFn } from '@storybook/react'
2
2
  import { FlexCol } from '@xylabs/react-flexbox'
3
3
  import { Payload } from '@xyo-network/payload-model'
4
+ import React from 'react'
4
5
 
5
- import { RawInfoIconButton } from './RawInfoIconButton.js'
6
+ import { RawInfoIconButton } from './RawInfoIconButton.tsx'
6
7
 
7
8
  type TestPayload = Payload<{ id: string; schema: string; type: string }, 'network.xyo.test'>
8
9
  const TestPayload: TestPayload = {
@@ -11,13 +12,12 @@ const TestPayload: TestPayload = {
11
12
  type: 'test',
12
13
  }
13
14
 
14
- // eslint-disable-next-line import/no-default-export
15
15
  export default {
16
16
  component: RawInfoIconButton,
17
17
  title: 'payload/RawInfoIconButton',
18
18
  } as Meta
19
19
 
20
- const Template: StoryFn<typeof RawInfoIconButton> = (args) => (
20
+ const Template: StoryFn<typeof RawInfoIconButton> = args => (
21
21
  <FlexCol>
22
22
  <RawInfoIconButton {...args} />
23
23
  </FlexCol>
@@ -1,11 +1,11 @@
1
1
  import { IconButton, IconButtonProps } from '@mui/material'
2
2
  import { toJson } from '@xylabs/object'
3
- import { forwardRef, MouseEventHandler, ReactNode, useMemo, useState } from 'react'
3
+ import React, { forwardRef, MouseEventHandler, ReactNode, useMemo, useState } from 'react'
4
4
 
5
- import { ExpansionProps } from '../../lib/index.js'
6
- import { XyoColorLogo } from '../img/index.js'
7
- import { RawInfoDialog } from '../shared/index.js'
8
- import { IconSize, presetIconSizeValue } from './lib/index.js'
5
+ import { ExpansionProps } from '../../lib/index.ts'
6
+ import { XyoColorLogo } from '../img/index.tsx'
7
+ import { RawInfoDialog } from '../shared/index.ts'
8
+ import { IconSize, presetIconSizeValue } from './lib/index.ts'
9
9
 
10
10
  export interface RawInfoIconProps extends IconButtonProps, ExpansionProps {
11
11
  dialogContent?: ReactNode
@@ -40,16 +40,18 @@ export const RawInfoIconButton = forwardRef<HTMLButtonElement, RawInfoIconProps>
40
40
  <IconButton onClick={handleClick} ref={ref} {...props}>
41
41
  <XyoColorLogo sx={{ height: size ?? iconSize, width: size ?? iconSize }} />
42
42
  </IconButton>
43
- {iconOnly ? null : (
44
- <RawInfoDialog
45
- defaultExpandedJson={defaultExpandedJson}
46
- jsonValue={json}
47
- onCloseCallback={onCloseCallBackWrapped}
48
- dialogContent={dialogContent}
49
- open={open}
50
- updateExpandedJson={updateExpandedJson}
51
- />
52
- )}
43
+ {iconOnly
44
+ ? null
45
+ : (
46
+ <RawInfoDialog
47
+ defaultExpandedJson={defaultExpandedJson}
48
+ jsonValue={json}
49
+ onCloseCallback={onCloseCallBackWrapped}
50
+ dialogContent={dialogContent}
51
+ open={open}
52
+ updateExpandedJson={updateExpandedJson}
53
+ />
54
+ )}
53
55
  </>
54
56
  )
55
57
  },
@@ -1,2 +1,2 @@
1
- export * from './RawInfoButton.js'
2
- export * from './RawInfoIconButton.js'
1
+ export * from './RawInfoButton.tsx'
2
+ export * from './RawInfoIconButton.tsx'
@@ -1,2 +1,2 @@
1
- export * from './IconSize.js'
2
- export * from './presetIconSize.js'
1
+ export * from './IconSize.ts'
2
+ export * from './presetIconSize.ts'
@@ -1,4 +1,4 @@
1
- import { IconSize } from './IconSize.js'
1
+ import { IconSize } from './IconSize.ts'
2
2
 
3
3
  export const presetIconSizeValue = (size?: IconSize) => {
4
4
  switch (size) {
@@ -1,4 +1,5 @@
1
1
  import { createSvgIcon } from '@mui/material'
2
+ import React from 'react'
2
3
 
3
4
  export const XyoColorLogo = createSvgIcon(
4
5
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 238">
@@ -1,3 +1,3 @@
1
- export * from './Button/index.js'
2
- export * from './shared/index.js'
3
- export * from './styled/index.js'
1
+ export * from './Button/index.ts'
2
+ export * from './shared/index.ts'
3
+ export * from './styled/index.ts'
@@ -5,10 +5,11 @@ import { usePromise } from '@xylabs/react-promise'
5
5
  import { PayloadBuilder } from '@xyo-network/payload-builder'
6
6
  import { isAnyPayload } from '@xyo-network/payload-model'
7
7
  import { useDataState } from '@xyo-network/react-shared'
8
+ import React from 'react'
8
9
 
9
- import { ExpansionProps } from '../../../lib/index.js'
10
- import { StyledChipLabel } from '../../styled/index.js'
11
- import { JsonViewerEx } from '../JsonViewerEx.js'
10
+ import { ExpansionProps } from '../../../lib/index.ts'
11
+ import { StyledChipLabel } from '../../styled/index.ts'
12
+ import { JsonViewerEx } from '../JsonViewerEx.tsx'
12
13
 
13
14
  export interface RawInfoPayloadCollapse extends CollapseProps, ExpansionProps {
14
15
  jsonValue?: JsonValue
@@ -31,23 +32,27 @@ export const JsonViewerCollapse: React.FC<RawInfoPayloadCollapse> = ({ defaultEx
31
32
 
32
33
  return (
33
34
  <>
34
- {jsonValue ?
35
- <FlexRow>
36
- <Button onClick={handleExpansion} size="small" variant="outlined">
37
- {actionText}
38
- </Button>
39
- </FlexRow>
40
- : null}
41
- <Collapse in={expandedJson} {...props}>
42
- {jsonValue ?
43
- <FlexCol alignItems="stretch" gap={1.5}>
44
- <Typography sx={{ lineHeight: 1 }}>Payload Hash:</Typography>
45
- {hash ?
46
- <Chip label={<StyledChipLabel>{hash}</StyledChipLabel>} sx={{ alignSelf: 'start' }} />
47
- : null}
48
- <JsonViewerEx value={jsonValue} />
49
- </FlexCol>
35
+ {jsonValue
36
+ ? (
37
+ <FlexRow>
38
+ <Button onClick={handleExpansion} size="small" variant="outlined">
39
+ {actionText}
40
+ </Button>
41
+ </FlexRow>
42
+ )
50
43
  : null}
44
+ <Collapse in={expandedJson} {...props}>
45
+ {jsonValue
46
+ ? (
47
+ <FlexCol alignItems="stretch" gap={1.5}>
48
+ <Typography sx={{ lineHeight: 1 }}>Payload Hash:</Typography>
49
+ {hash
50
+ ? <Chip label={<StyledChipLabel>{hash}</StyledChipLabel>} sx={{ alignSelf: 'start' }} />
51
+ : null}
52
+ <JsonViewerEx value={jsonValue} />
53
+ </FlexCol>
54
+ )
55
+ : null}
51
56
  </Collapse>
52
57
  </>
53
58
  )
@@ -2,8 +2,9 @@ import { Meta, StoryFn } from '@storybook/react'
2
2
  import { toJson } from '@xylabs/object'
3
3
  import { FlexCol } from '@xylabs/react-flexbox'
4
4
  import { Payload } from '@xyo-network/payload-model'
5
+ import React from 'react'
5
6
 
6
- import { RawInfoDialog } from './RawInfoDialog.js'
7
+ import { RawInfoDialog } from './RawInfoDialog.tsx'
7
8
 
8
9
  type TestPayload = Payload<{ id: string; schema: string; type: string }, 'network.xyo.test'>
9
10
  const TestPayload: TestPayload = {
@@ -12,13 +13,12 @@ const TestPayload: TestPayload = {
12
13
  type: 'test',
13
14
  }
14
15
 
15
- // eslint-disable-next-line import/no-default-export
16
16
  export default {
17
17
  component: RawInfoDialog,
18
18
  title: 'payload/RawInfoDialog',
19
19
  } as Meta
20
20
 
21
- const Template: StoryFn<typeof RawInfoDialog> = (args) => (
21
+ const Template: StoryFn<typeof RawInfoDialog> = args => (
22
22
  <FlexCol>
23
23
  <RawInfoDialog {...args} />
24
24
  </FlexCol>