@metamask/snaps-sdk 6.21.0 → 6.22.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 (158) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/error-wrappers.d.cts +192 -192
  3. package/dist/error-wrappers.d.mts +192 -192
  4. package/dist/images.d.cts +1 -1
  5. package/dist/images.d.mts +1 -1
  6. package/dist/index.cjs +2 -1
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.cts +1 -1
  9. package/dist/index.d.cts.map +1 -1
  10. package/dist/index.d.mts +1 -1
  11. package/dist/index.d.mts.map +1 -1
  12. package/dist/index.mjs +1 -1
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/internals/error-wrappers.d.cts +12 -12
  15. package/dist/internals/error-wrappers.d.mts +12 -12
  16. package/dist/internals/structs.cjs +29 -8
  17. package/dist/internals/structs.cjs.map +1 -1
  18. package/dist/internals/structs.d.cts +8 -0
  19. package/dist/internals/structs.d.cts.map +1 -1
  20. package/dist/internals/structs.d.mts +8 -0
  21. package/dist/internals/structs.d.mts.map +1 -1
  22. package/dist/internals/structs.mjs +29 -9
  23. package/dist/internals/structs.mjs.map +1 -1
  24. package/dist/jsx/validation.cjs +8 -5
  25. package/dist/jsx/validation.cjs.map +1 -1
  26. package/dist/jsx/validation.d.cts +15 -15
  27. package/dist/jsx/validation.d.cts.map +1 -1
  28. package/dist/jsx/validation.d.mts +15 -15
  29. package/dist/jsx/validation.d.mts.map +1 -1
  30. package/dist/jsx/validation.mjs +8 -5
  31. package/dist/jsx/validation.mjs.map +1 -1
  32. package/dist/types/handlers/asset-historical-price.cjs +3 -0
  33. package/dist/types/handlers/asset-historical-price.cjs.map +1 -0
  34. package/dist/types/handlers/asset-historical-price.d.cts +46 -0
  35. package/dist/types/handlers/asset-historical-price.d.cts.map +1 -0
  36. package/dist/types/handlers/asset-historical-price.d.mts +46 -0
  37. package/dist/types/handlers/asset-historical-price.d.mts.map +1 -0
  38. package/dist/types/handlers/asset-historical-price.mjs +2 -0
  39. package/dist/types/handlers/asset-historical-price.mjs.map +1 -0
  40. package/dist/types/handlers/assets-conversion.cjs +0 -11
  41. package/dist/types/handlers/assets-conversion.cjs.map +1 -1
  42. package/dist/types/handlers/assets-conversion.d.cts +43 -22
  43. package/dist/types/handlers/assets-conversion.d.cts.map +1 -1
  44. package/dist/types/handlers/assets-conversion.d.mts +43 -22
  45. package/dist/types/handlers/assets-conversion.d.mts.map +1 -1
  46. package/dist/types/handlers/assets-conversion.mjs +1 -10
  47. package/dist/types/handlers/assets-conversion.mjs.map +1 -1
  48. package/dist/types/handlers/assets-lookup.cjs +4 -4
  49. package/dist/types/handlers/assets-lookup.cjs.map +1 -1
  50. package/dist/types/handlers/assets-lookup.d.cts +24 -24
  51. package/dist/types/handlers/assets-lookup.d.cts.map +1 -1
  52. package/dist/types/handlers/assets-lookup.d.mts +24 -24
  53. package/dist/types/handlers/assets-lookup.d.mts.map +1 -1
  54. package/dist/types/handlers/assets-lookup.mjs +5 -5
  55. package/dist/types/handlers/assets-lookup.mjs.map +1 -1
  56. package/dist/types/handlers/index.cjs +0 -1
  57. package/dist/types/handlers/index.cjs.map +1 -1
  58. package/dist/types/handlers/index.d.cts +2 -1
  59. package/dist/types/handlers/index.d.cts.map +1 -1
  60. package/dist/types/handlers/index.d.mts +2 -1
  61. package/dist/types/handlers/index.d.mts.map +1 -1
  62. package/dist/types/handlers/index.mjs +0 -1
  63. package/dist/types/handlers/index.mjs.map +1 -1
  64. package/dist/types/handlers/user-input.d.cts +10 -10
  65. package/dist/types/handlers/user-input.d.mts +10 -10
  66. package/dist/types/interface.d.cts +21 -21
  67. package/dist/types/interface.d.mts +21 -21
  68. package/dist/ui/components/address.cjs +2 -1
  69. package/dist/ui/components/address.cjs.map +1 -1
  70. package/dist/ui/components/address.d.cts +4 -4
  71. package/dist/ui/components/address.d.cts.map +1 -1
  72. package/dist/ui/components/address.d.mts +4 -4
  73. package/dist/ui/components/address.d.mts.map +1 -1
  74. package/dist/ui/components/address.mjs +2 -1
  75. package/dist/ui/components/address.mjs.map +1 -1
  76. package/dist/ui/components/button.cjs +1 -1
  77. package/dist/ui/components/button.cjs.map +1 -1
  78. package/dist/ui/components/button.d.cts +7 -7
  79. package/dist/ui/components/button.d.cts.map +1 -1
  80. package/dist/ui/components/button.d.mts +7 -7
  81. package/dist/ui/components/button.d.mts.map +1 -1
  82. package/dist/ui/components/button.mjs +2 -2
  83. package/dist/ui/components/button.mjs.map +1 -1
  84. package/dist/ui/components/copyable.cjs +2 -1
  85. package/dist/ui/components/copyable.cjs.map +1 -1
  86. package/dist/ui/components/copyable.d.cts +4 -4
  87. package/dist/ui/components/copyable.d.mts +4 -4
  88. package/dist/ui/components/copyable.mjs +2 -1
  89. package/dist/ui/components/copyable.mjs.map +1 -1
  90. package/dist/ui/components/divider.cjs +2 -1
  91. package/dist/ui/components/divider.cjs.map +1 -1
  92. package/dist/ui/components/divider.d.cts +1 -1
  93. package/dist/ui/components/divider.d.cts.map +1 -1
  94. package/dist/ui/components/divider.d.mts +1 -1
  95. package/dist/ui/components/divider.d.mts.map +1 -1
  96. package/dist/ui/components/divider.mjs +2 -1
  97. package/dist/ui/components/divider.mjs.map +1 -1
  98. package/dist/ui/components/form.cjs +2 -1
  99. package/dist/ui/components/form.cjs.map +1 -1
  100. package/dist/ui/components/form.d.cts +39 -39
  101. package/dist/ui/components/form.d.cts.map +1 -1
  102. package/dist/ui/components/form.d.mts +39 -39
  103. package/dist/ui/components/form.d.mts.map +1 -1
  104. package/dist/ui/components/form.mjs +2 -1
  105. package/dist/ui/components/form.mjs.map +1 -1
  106. package/dist/ui/components/heading.cjs +2 -1
  107. package/dist/ui/components/heading.cjs.map +1 -1
  108. package/dist/ui/components/heading.d.cts +4 -4
  109. package/dist/ui/components/heading.d.cts.map +1 -1
  110. package/dist/ui/components/heading.d.mts +4 -4
  111. package/dist/ui/components/heading.d.mts.map +1 -1
  112. package/dist/ui/components/heading.mjs +2 -1
  113. package/dist/ui/components/heading.mjs.map +1 -1
  114. package/dist/ui/components/image.cjs +1 -1
  115. package/dist/ui/components/image.cjs.map +1 -1
  116. package/dist/ui/components/image.d.cts +4 -4
  117. package/dist/ui/components/image.d.mts +4 -4
  118. package/dist/ui/components/image.mjs +2 -2
  119. package/dist/ui/components/image.mjs.map +1 -1
  120. package/dist/ui/components/input.cjs +1 -1
  121. package/dist/ui/components/input.cjs.map +1 -1
  122. package/dist/ui/components/input.d.cts +10 -10
  123. package/dist/ui/components/input.d.cts.map +1 -1
  124. package/dist/ui/components/input.d.mts +10 -10
  125. package/dist/ui/components/input.d.mts.map +1 -1
  126. package/dist/ui/components/input.mjs +2 -2
  127. package/dist/ui/components/input.mjs.map +1 -1
  128. package/dist/ui/components/panel.cjs +1 -1
  129. package/dist/ui/components/panel.cjs.map +1 -1
  130. package/dist/ui/components/panel.d.cts +105 -105
  131. package/dist/ui/components/panel.d.mts +105 -105
  132. package/dist/ui/components/panel.mjs +2 -2
  133. package/dist/ui/components/panel.mjs.map +1 -1
  134. package/dist/ui/components/row.cjs +1 -1
  135. package/dist/ui/components/row.cjs.map +1 -1
  136. package/dist/ui/components/row.d.cts +23 -23
  137. package/dist/ui/components/row.d.cts.map +1 -1
  138. package/dist/ui/components/row.d.mts +23 -23
  139. package/dist/ui/components/row.d.mts.map +1 -1
  140. package/dist/ui/components/row.mjs +2 -2
  141. package/dist/ui/components/row.mjs.map +1 -1
  142. package/dist/ui/components/spinner.cjs +2 -1
  143. package/dist/ui/components/spinner.cjs.map +1 -1
  144. package/dist/ui/components/spinner.d.cts +1 -1
  145. package/dist/ui/components/spinner.d.cts.map +1 -1
  146. package/dist/ui/components/spinner.d.mts +1 -1
  147. package/dist/ui/components/spinner.d.mts.map +1 -1
  148. package/dist/ui/components/spinner.mjs +2 -1
  149. package/dist/ui/components/spinner.mjs.map +1 -1
  150. package/dist/ui/components/text.cjs +2 -1
  151. package/dist/ui/components/text.cjs.map +1 -1
  152. package/dist/ui/components/text.d.cts +4 -4
  153. package/dist/ui/components/text.d.mts +4 -4
  154. package/dist/ui/components/text.mjs +2 -1
  155. package/dist/ui/components/text.mjs.map +1 -1
  156. package/dist/ui/nodes.d.cts +1 -1
  157. package/dist/ui/nodes.d.mts +1 -1
  158. package/package.json +3 -3
@@ -10,15 +10,15 @@ export declare enum InputType {
10
10
  Password = "password"
11
11
  }
12
12
  export declare const InputStruct: import("@metamask/superstruct").Struct<{
13
- type: NodeType.Input;
14
13
  name: string;
15
- error?: string | undefined;
16
- inputType?: "number" | "text" | "password" | undefined;
14
+ type: NodeType.Input;
17
15
  value?: string | undefined;
18
16
  label?: string | undefined;
17
+ inputType?: "number" | "text" | "password" | undefined;
19
18
  placeholder?: string | undefined;
19
+ error?: string | undefined;
20
20
  }, {
21
- type: import("@metamask/superstruct").Struct<NodeType.Input, NodeType.Input>;
21
+ type: import("@metamask/superstruct").Struct<NodeType.Input, null>;
22
22
  value: import("@metamask/superstruct").Struct<string | undefined, null>;
23
23
  name: import("@metamask/superstruct").Struct<string, null>;
24
24
  inputType: import("@metamask/superstruct").Struct<"number" | "text" | "password" | undefined, null>;
@@ -59,20 +59,20 @@ export type Input = Infer<typeof InputStruct>;
59
59
  * const node = input({name: 'myInput', value: 'myValue', inputType: InputType.Password, placeholder: 'placeholder'})
60
60
  */
61
61
  export declare const input: (...args: (string | undefined)[] | [Omit<{
62
- type: NodeType.Input;
63
62
  name: string;
64
- error?: string | undefined;
65
- inputType?: "number" | "text" | "password" | undefined;
63
+ type: NodeType.Input;
66
64
  value?: string | undefined;
67
65
  label?: string | undefined;
66
+ inputType?: "number" | "text" | "password" | undefined;
68
67
  placeholder?: string | undefined;
68
+ error?: string | undefined;
69
69
  }, "type">]) => {
70
- type: NodeType.Input;
71
70
  name: string;
72
- error?: string | undefined;
73
- inputType?: "number" | "text" | "password" | undefined;
71
+ type: NodeType.Input;
74
72
  value?: string | undefined;
75
73
  label?: string | undefined;
74
+ inputType?: "number" | "text" | "password" | undefined;
76
75
  placeholder?: string | undefined;
76
+ error?: string | undefined;
77
77
  };
78
78
  //# sourceMappingURL=input.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.cts","sourceRoot":"","sources":["../../../src/ui/components/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAYnD,OAAO,EAAiB,QAAQ,EAAE,qBAAiB;AAEnD;;;GAGG;AACH,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;EAiBvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;CAMhB,CAAC"}
1
+ {"version":3,"file":"input.d.cts","sourceRoot":"","sources":["../../../src/ui/components/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,OAAO,EAAiB,QAAQ,EAAE,qBAAiB;AAEnD;;;GAGG;AACH,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;EAiBvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;CAMhB,CAAC"}
@@ -10,15 +10,15 @@ export declare enum InputType {
10
10
  Password = "password"
11
11
  }
12
12
  export declare const InputStruct: import("@metamask/superstruct").Struct<{
13
- type: NodeType.Input;
14
13
  name: string;
15
- error?: string | undefined;
16
- inputType?: "number" | "text" | "password" | undefined;
14
+ type: NodeType.Input;
17
15
  value?: string | undefined;
18
16
  label?: string | undefined;
17
+ inputType?: "number" | "text" | "password" | undefined;
19
18
  placeholder?: string | undefined;
19
+ error?: string | undefined;
20
20
  }, {
21
- type: import("@metamask/superstruct").Struct<NodeType.Input, NodeType.Input>;
21
+ type: import("@metamask/superstruct").Struct<NodeType.Input, null>;
22
22
  value: import("@metamask/superstruct").Struct<string | undefined, null>;
23
23
  name: import("@metamask/superstruct").Struct<string, null>;
24
24
  inputType: import("@metamask/superstruct").Struct<"number" | "text" | "password" | undefined, null>;
@@ -59,20 +59,20 @@ export type Input = Infer<typeof InputStruct>;
59
59
  * const node = input({name: 'myInput', value: 'myValue', inputType: InputType.Password, placeholder: 'placeholder'})
60
60
  */
61
61
  export declare const input: (...args: (string | undefined)[] | [Omit<{
62
- type: NodeType.Input;
63
62
  name: string;
64
- error?: string | undefined;
65
- inputType?: "number" | "text" | "password" | undefined;
63
+ type: NodeType.Input;
66
64
  value?: string | undefined;
67
65
  label?: string | undefined;
66
+ inputType?: "number" | "text" | "password" | undefined;
68
67
  placeholder?: string | undefined;
68
+ error?: string | undefined;
69
69
  }, "type">]) => {
70
- type: NodeType.Input;
71
70
  name: string;
72
- error?: string | undefined;
73
- inputType?: "number" | "text" | "password" | undefined;
71
+ type: NodeType.Input;
74
72
  value?: string | undefined;
75
73
  label?: string | undefined;
74
+ inputType?: "number" | "text" | "password" | undefined;
76
75
  placeholder?: string | undefined;
76
+ error?: string | undefined;
77
77
  };
78
78
  //# sourceMappingURL=input.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.mts","sourceRoot":"","sources":["../../../src/ui/components/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAYnD,OAAO,EAAiB,QAAQ,EAAE,qBAAiB;AAEnD;;;GAGG;AACH,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;EAiBvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;CAMhB,CAAC"}
1
+ {"version":3,"file":"input.d.mts","sourceRoot":"","sources":["../../../src/ui/components/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,OAAO,EAAiB,QAAQ,EAAE,qBAAiB;AAEnD;;;GAGG;AACH,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;EAiBvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;CAMhB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { assign, literal, object, optional, string, union } from "@metamask/superstruct";
2
- import { enumValue } from "../../internals/index.mjs";
1
+ import { assign, object, optional, string, union } from "@metamask/superstruct";
2
+ import { enumValue, literal } from "../../internals/index.mjs";
3
3
  import { createBuilder } from "../builder.mjs";
4
4
  import { LiteralStruct, NodeType } from "../nodes.mjs";
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"input.mjs","sourceRoot":"","sources":["../../../src/ui/components/input.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,QAAQ,EACR,MAAM,EACN,KAAK,EACN,8BAA8B;AAE/B,OAAO,EAAE,SAAS,EAAE,kCAAwB;AAC5C,OAAO,EAAE,aAAa,EAAE,uBAAmB;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAiB;AAEnD;;;GAGG;AACH,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;AACvB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAC/B,aAAa,EACb,MAAM,CAAC;IACL,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC7B,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,MAAM,EAAE;IACd,SAAS,EAAE,QAAQ,CACjB,KAAK,CAAC;QACJ,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC;QACzB,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC7B,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;KAC5B,CAAC,CACH;IACD,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC/B,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IACzB,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC,CACH,CAAC;AAeF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE;IAC9D,MAAM;IACN,WAAW;IACX,aAAa;IACb,OAAO;IACP,OAAO;CACR,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n assign,\n literal,\n object,\n optional,\n string,\n union,\n} from '@metamask/superstruct';\n\nimport { enumValue } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\n/**\n * This replicates the available input types from the metamask extension.\n * https://github.com/MetaMask/metamask-extension/main/ui/components/component-library/input/input.constants.js\n */\nexport enum InputType {\n Text = 'text',\n Number = 'number',\n Password = 'password',\n}\n\nexport const InputStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Input),\n value: optional(string()),\n name: string(),\n inputType: optional(\n union([\n enumValue(InputType.Text),\n enumValue(InputType.Password),\n enumValue(InputType.Number),\n ]),\n ),\n placeholder: optional(string()),\n label: optional(string()),\n error: optional(string()),\n }),\n);\n\n/**\n * An input node, that renders an input.\n *\n * @property type - The type of the node, must be the string 'input'.\n * @property name - The name for the input.\n * @property value - The value of the input.\n * @property inputType - An optional type, either `text`, `password` or `number`.\n * @property placeholder - An optional input placeholder.\n * @property label - An optional input label.\n * @property error - An optional error text.\n */\nexport type Input = Infer<typeof InputStruct>;\n\n/**\n * Create a {@link Input} node.\n *\n * @param args - The node arguments. This can either be a name and an optional variant, value and placeholder or an object\n * with the properties: `inputType`, `value`, `variant`, `placeholder` and `name`.\n * @param args.name - The name for the input.\n * @param args.value - The value of the input.\n * @param args.inputType - An optional type, either `text`, `password` or `number`.\n * @param args.placeholder - An optional input placeholder.\n * @param args.label - An optional input label.\n * @param args.error - An optional error text.\n * @returns The input node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = input('myInput');\n * const node = input('myInput', InputType.Text, 'my placeholder', 'myValue', 'myLabel');\n * const node = input({ name: 'myInput' });\n * const node = input({name: 'myInput', value: 'myValue', inputType: InputType.Password, placeholder: 'placeholder'})\n */\nexport const input = createBuilder(NodeType.Input, InputStruct, [\n 'name',\n 'inputType',\n 'placeholder',\n 'value',\n 'label',\n]);\n"]}
1
+ {"version":3,"file":"input.mjs","sourceRoot":"","sources":["../../../src/ui/components/input.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AAEhF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kCAAwB;AACrD,OAAO,EAAE,aAAa,EAAE,uBAAmB;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAiB;AAEnD;;;GAGG;AACH,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;AACvB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAC/B,aAAa,EACb,MAAM,CAAC;IACL,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC7B,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,MAAM,EAAE;IACd,SAAS,EAAE,QAAQ,CACjB,KAAK,CAAC;QACJ,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC;QACzB,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC7B,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;KAC5B,CAAC,CACH;IACD,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC/B,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IACzB,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC,CACH,CAAC;AAeF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE;IAC9D,MAAM;IACN,WAAW;IACX,aAAa;IACb,OAAO;IACP,OAAO;CACR,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { assign, object, optional, string, union } from '@metamask/superstruct';\n\nimport { enumValue, literal } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { LiteralStruct, NodeType } from '../nodes';\n\n/**\n * This replicates the available input types from the metamask extension.\n * https://github.com/MetaMask/metamask-extension/main/ui/components/component-library/input/input.constants.js\n */\nexport enum InputType {\n Text = 'text',\n Number = 'number',\n Password = 'password',\n}\n\nexport const InputStruct = assign(\n LiteralStruct,\n object({\n type: literal(NodeType.Input),\n value: optional(string()),\n name: string(),\n inputType: optional(\n union([\n enumValue(InputType.Text),\n enumValue(InputType.Password),\n enumValue(InputType.Number),\n ]),\n ),\n placeholder: optional(string()),\n label: optional(string()),\n error: optional(string()),\n }),\n);\n\n/**\n * An input node, that renders an input.\n *\n * @property type - The type of the node, must be the string 'input'.\n * @property name - The name for the input.\n * @property value - The value of the input.\n * @property inputType - An optional type, either `text`, `password` or `number`.\n * @property placeholder - An optional input placeholder.\n * @property label - An optional input label.\n * @property error - An optional error text.\n */\nexport type Input = Infer<typeof InputStruct>;\n\n/**\n * Create a {@link Input} node.\n *\n * @param args - The node arguments. This can either be a name and an optional variant, value and placeholder or an object\n * with the properties: `inputType`, `value`, `variant`, `placeholder` and `name`.\n * @param args.name - The name for the input.\n * @param args.value - The value of the input.\n * @param args.inputType - An optional type, either `text`, `password` or `number`.\n * @param args.placeholder - An optional input placeholder.\n * @param args.label - An optional input label.\n * @param args.error - An optional error text.\n * @returns The input node as an object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = input('myInput');\n * const node = input('myInput', InputType.Text, 'my placeholder', 'myValue', 'myLabel');\n * const node = input({ name: 'myInput' });\n * const node = input({name: 'myInput', value: 'myValue', inputType: InputType.Password, placeholder: 'placeholder'})\n */\nexport const input = createBuilder(NodeType.Input, InputStruct, [\n 'name',\n 'inputType',\n 'placeholder',\n 'value',\n 'label',\n]);\n"]}
@@ -28,7 +28,7 @@ exports.ParentStruct = (0, superstruct_1.assign)(nodes_1.NodeStruct, (0, superst
28
28
  * @internal
29
29
  */
30
30
  exports.PanelStruct = (0, superstruct_1.assign)(exports.ParentStruct, (0, superstruct_1.object)({
31
- type: (0, superstruct_1.literal)(nodes_1.NodeType.Panel),
31
+ type: (0, internals_1.literal)(nodes_1.NodeType.Panel),
32
32
  }));
33
33
  /**
34
34
  * Create a {@link Panel} node.
@@ -1 +1 @@
1
- {"version":3,"file":"panel.cjs","sourceRoot":"","sources":["../../../src/ui/components/panel.ts"],"names":[],"mappings":";;;AACA,uDAA6E;AAE7E,2CAA0C;AAC1C,yCAAwC;AACxC,6CAA4C;AAC5C,2CAA0C;AAC1C,qCAAoC;AACpC,2CAA0C;AAC1C,uCAAsC;AACtC,uCAAsC;AACtC,mCAAkC;AAClC,2CAA0C;AAC1C,qCAAoC;AACpC,yDAA6C;AAC7C,4CAA2C;AAC3C,wCAAgD;AAEhD;;GAEG;AACU,QAAA,YAAY,GAAG,IAAA,oBAAM,EAChC,kBAAU,EACV,IAAA,oBAAM,EAAC;IACL,sEAAsE;IACtE,mEAAmE;IACnE,QAAQ,EAAE,IAAA,mBAAK,EAAC,IAAA,kBAAI,EAAC,GAAG,EAAE,CAAC,uBAAe,CAAC,CAAC;CAC7C,CAAC,CACH,CAAC;AAYF;;GAEG;AACU,QAAA,WAAW,GAAkB,IAAA,oBAAM,EAC9C,oBAAY,EACZ,IAAA,oBAAM,EAAC;IACL,IAAI,EAAE,IAAA,qBAAO,EAAC,gBAAQ,CAAC,KAAK,CAAC;CAC9B,CAAC,CACH,CAAC;AAeF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACU,QAAA,KAAK,GAAG,IAAA,uBAAa,EAAC,gBAAQ,CAAC,KAAK,EAAE,mBAAW,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AAE9E,8EAA8E;AACjE,QAAA,eAAe,GAAG,IAAA,sBAAU,EAAC;IACxC,yBAAc;IACd,uBAAa;IACb,uBAAa;IACb,mBAAW;IACX,mBAAW;IACX,uBAAa;IACb,iBAAU;IACV,eAAS;IACT,uBAAa;IACb,mBAAW;IACX,iBAAU;IACV,qBAAY;CACb,CAAC,CAAC","sourcesContent":["import type { Infer, Struct } from '@metamask/superstruct';\nimport { array, assign, lazy, literal, object } from '@metamask/superstruct';\n\nimport { AddressStruct } from './address';\nimport { ButtonStruct } from './button';\nimport { CopyableStruct } from './copyable';\nimport { DividerStruct } from './divider';\nimport { FormStruct } from './form';\nimport { HeadingStruct } from './heading';\nimport { ImageStruct } from './image';\nimport { InputStruct } from './input';\nimport { RowStruct } from './row';\nimport { SpinnerStruct } from './spinner';\nimport { TextStruct } from './text';\nimport { typedUnion } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\n/**\n * @internal\n */\nexport const ParentStruct = assign(\n NodeStruct,\n object({\n // This node references itself indirectly, so we need to use `lazy()`.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n children: array(lazy(() => ComponentStruct)),\n }),\n);\n\n/**\n * A node which supports child nodes. This is used for nodes that render their\n * children, such as {@link Panel}.\n *\n * @property type - The type of the node.\n * @property children - The children of the node\n * @internal\n */\nexport type Parent = Infer<typeof ParentStruct>;\n\n/**\n * @internal\n */\nexport const PanelStruct: Struct<Panel> = assign(\n ParentStruct,\n object({\n type: literal(NodeType.Panel),\n }),\n);\n\n/**\n * A panel node, which renders its children.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n */\n// This node references itself indirectly, so it cannot be inferred.\nexport type Panel = {\n type: NodeType.Panel;\n children: Component[];\n};\n\n/**\n * Create a {@link Panel} node.\n *\n * @param args - The node arguments. This can be either an array of children, or\n * an object with a `children` property.\n * @param args.children - The child nodes of the panel. This can be any valid\n * {@link Component}.\n * @returns The panel node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = panel({\n * children: [\n * heading({ text: 'Hello, world!' }),\n * text({ text: 'This is a panel.' }),\n * ],\n * });\n *\n * const node = panel([\n * heading('Hello, world!'),\n * text('This is a panel.'),\n * ]);\n */\nexport const panel = createBuilder(NodeType.Panel, PanelStruct, ['children']);\n\n// This is defined separately from `Component` to avoid circular dependencies.\nexport const ComponentStruct = typedUnion([\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n PanelStruct,\n SpinnerStruct,\n TextStruct,\n RowStruct,\n AddressStruct,\n InputStruct,\n FormStruct,\n ButtonStruct,\n]);\n\n/**\n * All supported component types.\n */\nexport type Component = Infer<typeof ComponentStruct>;\n"]}
1
+ {"version":3,"file":"panel.cjs","sourceRoot":"","sources":["../../../src/ui/components/panel.ts"],"names":[],"mappings":";;;AACA,uDAAoE;AAEpE,2CAA0C;AAC1C,yCAAwC;AACxC,6CAA4C;AAC5C,2CAA0C;AAC1C,qCAAoC;AACpC,2CAA0C;AAC1C,uCAAsC;AACtC,uCAAsC;AACtC,mCAAkC;AAClC,2CAA0C;AAC1C,qCAAoC;AACpC,yDAAsD;AACtD,4CAA2C;AAC3C,wCAAgD;AAEhD;;GAEG;AACU,QAAA,YAAY,GAAG,IAAA,oBAAM,EAChC,kBAAU,EACV,IAAA,oBAAM,EAAC;IACL,sEAAsE;IACtE,mEAAmE;IACnE,QAAQ,EAAE,IAAA,mBAAK,EAAC,IAAA,kBAAI,EAAC,GAAG,EAAE,CAAC,uBAAe,CAAC,CAAC;CAC7C,CAAC,CACH,CAAC;AAYF;;GAEG;AACU,QAAA,WAAW,GAAkB,IAAA,oBAAM,EAC9C,oBAAY,EACZ,IAAA,oBAAM,EAAC;IACL,IAAI,EAAE,IAAA,mBAAO,EAAC,gBAAQ,CAAC,KAAK,CAAC;CAC9B,CAAC,CACH,CAAC;AAeF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACU,QAAA,KAAK,GAAG,IAAA,uBAAa,EAAC,gBAAQ,CAAC,KAAK,EAAE,mBAAW,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AAE9E,8EAA8E;AACjE,QAAA,eAAe,GAAG,IAAA,sBAAU,EAAC;IACxC,yBAAc;IACd,uBAAa;IACb,uBAAa;IACb,mBAAW;IACX,mBAAW;IACX,uBAAa;IACb,iBAAU;IACV,eAAS;IACT,uBAAa;IACb,mBAAW;IACX,iBAAU;IACV,qBAAY;CACb,CAAC,CAAC","sourcesContent":["import type { Infer, Struct } from '@metamask/superstruct';\nimport { array, assign, lazy, object } from '@metamask/superstruct';\n\nimport { AddressStruct } from './address';\nimport { ButtonStruct } from './button';\nimport { CopyableStruct } from './copyable';\nimport { DividerStruct } from './divider';\nimport { FormStruct } from './form';\nimport { HeadingStruct } from './heading';\nimport { ImageStruct } from './image';\nimport { InputStruct } from './input';\nimport { RowStruct } from './row';\nimport { SpinnerStruct } from './spinner';\nimport { TextStruct } from './text';\nimport { typedUnion, literal } from '../../internals';\nimport { createBuilder } from '../builder';\nimport { NodeStruct, NodeType } from '../nodes';\n\n/**\n * @internal\n */\nexport const ParentStruct = assign(\n NodeStruct,\n object({\n // This node references itself indirectly, so we need to use `lazy()`.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n children: array(lazy(() => ComponentStruct)),\n }),\n);\n\n/**\n * A node which supports child nodes. This is used for nodes that render their\n * children, such as {@link Panel}.\n *\n * @property type - The type of the node.\n * @property children - The children of the node\n * @internal\n */\nexport type Parent = Infer<typeof ParentStruct>;\n\n/**\n * @internal\n */\nexport const PanelStruct: Struct<Panel> = assign(\n ParentStruct,\n object({\n type: literal(NodeType.Panel),\n }),\n);\n\n/**\n * A panel node, which renders its children.\n *\n * @property type - The type of the node, must be the string 'text'.\n * @property value - The text content of the node, either as plain text, or as a\n * markdown string.\n */\n// This node references itself indirectly, so it cannot be inferred.\nexport type Panel = {\n type: NodeType.Panel;\n children: Component[];\n};\n\n/**\n * Create a {@link Panel} node.\n *\n * @param args - The node arguments. This can be either an array of children, or\n * an object with a `children` property.\n * @param args.children - The child nodes of the panel. This can be any valid\n * {@link Component}.\n * @returns The panel node as object.\n * @deprecated Snaps component functions are deprecated, in favor of the new JSX\n * components. This function will be removed in a future release.\n * @example\n * const node = panel({\n * children: [\n * heading({ text: 'Hello, world!' }),\n * text({ text: 'This is a panel.' }),\n * ],\n * });\n *\n * const node = panel([\n * heading('Hello, world!'),\n * text('This is a panel.'),\n * ]);\n */\nexport const panel = createBuilder(NodeType.Panel, PanelStruct, ['children']);\n\n// This is defined separately from `Component` to avoid circular dependencies.\nexport const ComponentStruct = typedUnion([\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n PanelStruct,\n SpinnerStruct,\n TextStruct,\n RowStruct,\n AddressStruct,\n InputStruct,\n FormStruct,\n ButtonStruct,\n]);\n\n/**\n * All supported component types.\n */\nexport type Component = Infer<typeof ComponentStruct>;\n"]}
@@ -6,209 +6,209 @@ import { NodeType } from "../nodes.cjs";
6
6
  export declare const ParentStruct: Struct<{
7
7
  type: string;
8
8
  children: ({
9
- type: NodeType.Copyable;
10
9
  value: string;
10
+ type: NodeType.Copyable;
11
11
  sensitive?: boolean | undefined;
12
12
  } | {
13
13
  type: NodeType.Divider;
14
14
  } | {
15
- type: NodeType.Heading;
16
15
  value: string;
16
+ type: NodeType.Heading;
17
17
  } | {
18
- type: NodeType.Image;
19
18
  value: string;
19
+ type: NodeType.Image;
20
20
  } | Panel | {
21
21
  type: NodeType.Spinner;
22
22
  } | {
23
- type: NodeType.Text;
24
23
  value: string;
24
+ type: NodeType.Text;
25
25
  markdown?: boolean | undefined;
26
26
  } | {
27
- type: NodeType.Address;
28
27
  value: `0x${string}`;
28
+ type: NodeType.Address;
29
29
  } | {
30
- type: NodeType.Row;
31
30
  value: {
32
- type: NodeType.Image;
33
31
  value: string;
32
+ type: NodeType.Image;
34
33
  } | {
35
- type: NodeType.Text;
36
34
  value: string;
35
+ type: NodeType.Text;
37
36
  markdown?: boolean | undefined;
38
37
  } | {
39
- type: NodeType.Address;
40
38
  value: `0x${string}`;
39
+ type: NodeType.Address;
41
40
  };
41
+ type: NodeType.Row;
42
42
  label: string;
43
- variant?: "default" | "warning" | "critical" | undefined;
43
+ variant?: "default" | "critical" | "warning" | undefined;
44
44
  } | {
45
- type: NodeType.Input;
46
45
  name: string;
47
- error?: string | undefined;
48
- inputType?: "number" | "text" | "password" | undefined;
46
+ type: NodeType.Input;
49
47
  value?: string | undefined;
50
48
  label?: string | undefined;
49
+ inputType?: "number" | "text" | "password" | undefined;
51
50
  placeholder?: string | undefined;
51
+ error?: string | undefined;
52
52
  } | {
53
- type: NodeType.Button;
54
53
  value: string;
55
- variant?: "primary" | "secondary" | undefined;
54
+ type: NodeType.Button;
56
55
  name?: string | undefined;
56
+ variant?: "primary" | "secondary" | undefined;
57
57
  buttonType?: "button" | "submit" | undefined;
58
58
  } | {
59
- type: NodeType.Form;
60
59
  name: string;
60
+ type: NodeType.Form;
61
61
  children: ({
62
- type: NodeType.Input;
63
62
  name: string;
64
- error?: string | undefined;
65
- inputType?: "number" | "text" | "password" | undefined;
63
+ type: NodeType.Input;
66
64
  value?: string | undefined;
67
65
  label?: string | undefined;
66
+ inputType?: "number" | "text" | "password" | undefined;
68
67
  placeholder?: string | undefined;
68
+ error?: string | undefined;
69
69
  } | {
70
- type: NodeType.Button;
71
70
  value: string;
72
- variant?: "primary" | "secondary" | undefined;
71
+ type: NodeType.Button;
73
72
  name?: string | undefined;
73
+ variant?: "primary" | "secondary" | undefined;
74
74
  buttonType?: "button" | "submit" | undefined;
75
75
  })[];
76
76
  })[];
77
77
  }, {
78
78
  children: Struct<({
79
- type: NodeType.Copyable;
80
79
  value: string;
80
+ type: NodeType.Copyable;
81
81
  sensitive?: boolean | undefined;
82
82
  } | {
83
83
  type: NodeType.Divider;
84
84
  } | {
85
- type: NodeType.Heading;
86
85
  value: string;
86
+ type: NodeType.Heading;
87
87
  } | {
88
- type: NodeType.Image;
89
88
  value: string;
89
+ type: NodeType.Image;
90
90
  } | Panel | {
91
91
  type: NodeType.Spinner;
92
92
  } | {
93
- type: NodeType.Text;
94
93
  value: string;
94
+ type: NodeType.Text;
95
95
  markdown?: boolean | undefined;
96
96
  } | {
97
- type: NodeType.Address;
98
97
  value: `0x${string}`;
98
+ type: NodeType.Address;
99
99
  } | {
100
- type: NodeType.Row;
101
100
  value: {
102
- type: NodeType.Image;
103
101
  value: string;
102
+ type: NodeType.Image;
104
103
  } | {
105
- type: NodeType.Text;
106
104
  value: string;
105
+ type: NodeType.Text;
107
106
  markdown?: boolean | undefined;
108
107
  } | {
109
- type: NodeType.Address;
110
108
  value: `0x${string}`;
109
+ type: NodeType.Address;
111
110
  };
111
+ type: NodeType.Row;
112
112
  label: string;
113
- variant?: "default" | "warning" | "critical" | undefined;
113
+ variant?: "default" | "critical" | "warning" | undefined;
114
114
  } | {
115
- type: NodeType.Input;
116
115
  name: string;
117
- error?: string | undefined;
118
- inputType?: "number" | "text" | "password" | undefined;
116
+ type: NodeType.Input;
119
117
  value?: string | undefined;
120
118
  label?: string | undefined;
119
+ inputType?: "number" | "text" | "password" | undefined;
121
120
  placeholder?: string | undefined;
121
+ error?: string | undefined;
122
122
  } | {
123
- type: NodeType.Button;
124
123
  value: string;
125
- variant?: "primary" | "secondary" | undefined;
124
+ type: NodeType.Button;
126
125
  name?: string | undefined;
126
+ variant?: "primary" | "secondary" | undefined;
127
127
  buttonType?: "button" | "submit" | undefined;
128
128
  } | {
129
- type: NodeType.Form;
130
129
  name: string;
130
+ type: NodeType.Form;
131
131
  children: ({
132
- type: NodeType.Input;
133
132
  name: string;
134
- error?: string | undefined;
135
- inputType?: "number" | "text" | "password" | undefined;
133
+ type: NodeType.Input;
136
134
  value?: string | undefined;
137
135
  label?: string | undefined;
136
+ inputType?: "number" | "text" | "password" | undefined;
138
137
  placeholder?: string | undefined;
138
+ error?: string | undefined;
139
139
  } | {
140
- type: NodeType.Button;
141
140
  value: string;
142
- variant?: "primary" | "secondary" | undefined;
141
+ type: NodeType.Button;
143
142
  name?: string | undefined;
143
+ variant?: "primary" | "secondary" | undefined;
144
144
  buttonType?: "button" | "submit" | undefined;
145
145
  })[];
146
146
  })[], Struct<{
147
- type: NodeType.Copyable;
148
147
  value: string;
148
+ type: NodeType.Copyable;
149
149
  sensitive?: boolean | undefined;
150
150
  } | {
151
151
  type: NodeType.Divider;
152
152
  } | {
153
- type: NodeType.Heading;
154
153
  value: string;
154
+ type: NodeType.Heading;
155
155
  } | {
156
- type: NodeType.Image;
157
156
  value: string;
157
+ type: NodeType.Image;
158
158
  } | Panel | {
159
159
  type: NodeType.Spinner;
160
160
  } | {
161
- type: NodeType.Text;
162
161
  value: string;
162
+ type: NodeType.Text;
163
163
  markdown?: boolean | undefined;
164
164
  } | {
165
- type: NodeType.Address;
166
165
  value: `0x${string}`;
166
+ type: NodeType.Address;
167
167
  } | {
168
- type: NodeType.Row;
169
168
  value: {
170
- type: NodeType.Image;
171
169
  value: string;
170
+ type: NodeType.Image;
172
171
  } | {
173
- type: NodeType.Text;
174
172
  value: string;
173
+ type: NodeType.Text;
175
174
  markdown?: boolean | undefined;
176
175
  } | {
177
- type: NodeType.Address;
178
176
  value: `0x${string}`;
177
+ type: NodeType.Address;
179
178
  };
179
+ type: NodeType.Row;
180
180
  label: string;
181
- variant?: "default" | "warning" | "critical" | undefined;
181
+ variant?: "default" | "critical" | "warning" | undefined;
182
182
  } | {
183
- type: NodeType.Input;
184
183
  name: string;
185
- error?: string | undefined;
186
- inputType?: "number" | "text" | "password" | undefined;
184
+ type: NodeType.Input;
187
185
  value?: string | undefined;
188
186
  label?: string | undefined;
187
+ inputType?: "number" | "text" | "password" | undefined;
189
188
  placeholder?: string | undefined;
189
+ error?: string | undefined;
190
190
  } | {
191
- type: NodeType.Button;
192
191
  value: string;
193
- variant?: "primary" | "secondary" | undefined;
192
+ type: NodeType.Button;
194
193
  name?: string | undefined;
194
+ variant?: "primary" | "secondary" | undefined;
195
195
  buttonType?: "button" | "submit" | undefined;
196
196
  } | {
197
- type: NodeType.Form;
198
197
  name: string;
198
+ type: NodeType.Form;
199
199
  children: ({
200
- type: NodeType.Input;
201
200
  name: string;
202
- error?: string | undefined;
203
- inputType?: "number" | "text" | "password" | undefined;
201
+ type: NodeType.Input;
204
202
  value?: string | undefined;
205
203
  label?: string | undefined;
204
+ inputType?: "number" | "text" | "password" | undefined;
206
205
  placeholder?: string | undefined;
206
+ error?: string | undefined;
207
207
  } | {
208
- type: NodeType.Button;
209
208
  value: string;
210
- variant?: "primary" | "secondary" | undefined;
209
+ type: NodeType.Button;
211
210
  name?: string | undefined;
211
+ variant?: "primary" | "secondary" | undefined;
212
212
  buttonType?: "button" | "submit" | undefined;
213
213
  })[];
214
214
  }, null>>;
@@ -262,140 +262,140 @@ export type Panel = {
262
262
  * ]);
263
263
  */
264
264
  export declare const panel: (...args: [Omit<Panel, "type">] | ({
265
- type: NodeType.Copyable;
266
265
  value: string;
266
+ type: NodeType.Copyable;
267
267
  sensitive?: boolean | undefined;
268
268
  } | {
269
269
  type: NodeType.Divider;
270
270
  } | {
271
- type: NodeType.Heading;
272
271
  value: string;
272
+ type: NodeType.Heading;
273
273
  } | {
274
- type: NodeType.Image;
275
274
  value: string;
275
+ type: NodeType.Image;
276
276
  } | Panel | {
277
277
  type: NodeType.Spinner;
278
278
  } | {
279
- type: NodeType.Text;
280
279
  value: string;
280
+ type: NodeType.Text;
281
281
  markdown?: boolean | undefined;
282
282
  } | {
283
- type: NodeType.Address;
284
283
  value: `0x${string}`;
284
+ type: NodeType.Address;
285
285
  } | {
286
- type: NodeType.Row;
287
286
  value: {
288
- type: NodeType.Image;
289
287
  value: string;
288
+ type: NodeType.Image;
290
289
  } | {
291
- type: NodeType.Text;
292
290
  value: string;
291
+ type: NodeType.Text;
293
292
  markdown?: boolean | undefined;
294
293
  } | {
295
- type: NodeType.Address;
296
294
  value: `0x${string}`;
295
+ type: NodeType.Address;
297
296
  };
297
+ type: NodeType.Row;
298
298
  label: string;
299
- variant?: "default" | "warning" | "critical" | undefined;
299
+ variant?: "default" | "critical" | "warning" | undefined;
300
300
  } | {
301
- type: NodeType.Input;
302
301
  name: string;
303
- error?: string | undefined;
304
- inputType?: "number" | "text" | "password" | undefined;
302
+ type: NodeType.Input;
305
303
  value?: string | undefined;
306
304
  label?: string | undefined;
305
+ inputType?: "number" | "text" | "password" | undefined;
307
306
  placeholder?: string | undefined;
307
+ error?: string | undefined;
308
308
  } | {
309
- type: NodeType.Button;
310
309
  value: string;
311
- variant?: "primary" | "secondary" | undefined;
310
+ type: NodeType.Button;
312
311
  name?: string | undefined;
312
+ variant?: "primary" | "secondary" | undefined;
313
313
  buttonType?: "button" | "submit" | undefined;
314
314
  } | {
315
- type: NodeType.Form;
316
315
  name: string;
316
+ type: NodeType.Form;
317
317
  children: ({
318
- type: NodeType.Input;
319
318
  name: string;
320
- error?: string | undefined;
321
- inputType?: "number" | "text" | "password" | undefined;
319
+ type: NodeType.Input;
322
320
  value?: string | undefined;
323
321
  label?: string | undefined;
322
+ inputType?: "number" | "text" | "password" | undefined;
324
323
  placeholder?: string | undefined;
324
+ error?: string | undefined;
325
325
  } | {
326
- type: NodeType.Button;
327
326
  value: string;
328
- variant?: "primary" | "secondary" | undefined;
327
+ type: NodeType.Button;
329
328
  name?: string | undefined;
329
+ variant?: "primary" | "secondary" | undefined;
330
330
  buttonType?: "button" | "submit" | undefined;
331
331
  })[];
332
332
  })[][]) => Panel;
333
333
  export declare const ComponentStruct: Struct<{
334
- type: NodeType.Copyable;
335
334
  value: string;
335
+ type: NodeType.Copyable;
336
336
  sensitive?: boolean | undefined;
337
337
  } | {
338
338
  type: NodeType.Divider;
339
339
  } | {
340
- type: NodeType.Heading;
341
340
  value: string;
341
+ type: NodeType.Heading;
342
342
  } | {
343
- type: NodeType.Image;
344
343
  value: string;
344
+ type: NodeType.Image;
345
345
  } | Panel | {
346
346
  type: NodeType.Spinner;
347
347
  } | {
348
- type: NodeType.Text;
349
348
  value: string;
349
+ type: NodeType.Text;
350
350
  markdown?: boolean | undefined;
351
351
  } | {
352
- type: NodeType.Address;
353
352
  value: `0x${string}`;
353
+ type: NodeType.Address;
354
354
  } | {
355
- type: NodeType.Row;
356
355
  value: {
357
- type: NodeType.Image;
358
356
  value: string;
357
+ type: NodeType.Image;
359
358
  } | {
360
- type: NodeType.Text;
361
359
  value: string;
360
+ type: NodeType.Text;
362
361
  markdown?: boolean | undefined;
363
362
  } | {
364
- type: NodeType.Address;
365
363
  value: `0x${string}`;
364
+ type: NodeType.Address;
366
365
  };
366
+ type: NodeType.Row;
367
367
  label: string;
368
- variant?: "default" | "warning" | "critical" | undefined;
368
+ variant?: "default" | "critical" | "warning" | undefined;
369
369
  } | {
370
- type: NodeType.Input;
371
370
  name: string;
372
- error?: string | undefined;
373
- inputType?: "number" | "text" | "password" | undefined;
371
+ type: NodeType.Input;
374
372
  value?: string | undefined;
375
373
  label?: string | undefined;
374
+ inputType?: "number" | "text" | "password" | undefined;
376
375
  placeholder?: string | undefined;
376
+ error?: string | undefined;
377
377
  } | {
378
- type: NodeType.Button;
379
378
  value: string;
380
- variant?: "primary" | "secondary" | undefined;
379
+ type: NodeType.Button;
381
380
  name?: string | undefined;
381
+ variant?: "primary" | "secondary" | undefined;
382
382
  buttonType?: "button" | "submit" | undefined;
383
383
  } | {
384
- type: NodeType.Form;
385
384
  name: string;
385
+ type: NodeType.Form;
386
386
  children: ({
387
- type: NodeType.Input;
388
387
  name: string;
389
- error?: string | undefined;
390
- inputType?: "number" | "text" | "password" | undefined;
388
+ type: NodeType.Input;
391
389
  value?: string | undefined;
392
390
  label?: string | undefined;
391
+ inputType?: "number" | "text" | "password" | undefined;
393
392
  placeholder?: string | undefined;
393
+ error?: string | undefined;
394
394
  } | {
395
- type: NodeType.Button;
396
395
  value: string;
397
- variant?: "primary" | "secondary" | undefined;
396
+ type: NodeType.Button;
398
397
  name?: string | undefined;
398
+ variant?: "primary" | "secondary" | undefined;
399
399
  buttonType?: "button" | "submit" | undefined;
400
400
  })[];
401
401
  }, null>;