@metamask/snaps-sdk 6.19.0 → 6.20.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 (82) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/dist/error-wrappers.d.cts +192 -192
  3. package/dist/error-wrappers.d.mts +192 -192
  4. package/dist/internals/error-wrappers.d.cts +12 -12
  5. package/dist/internals/error-wrappers.d.mts +12 -12
  6. package/dist/internals/jsx.cjs.map +1 -1
  7. package/dist/internals/jsx.d.cts +2 -1
  8. package/dist/internals/jsx.d.cts.map +1 -1
  9. package/dist/internals/jsx.d.mts +2 -1
  10. package/dist/internals/jsx.d.mts.map +1 -1
  11. package/dist/internals/jsx.mjs.map +1 -1
  12. package/dist/jsx/components/form/AddressInput.cjs +20 -0
  13. package/dist/jsx/components/form/AddressInput.cjs.map +1 -0
  14. package/dist/jsx/components/form/AddressInput.d.cts +24 -0
  15. package/dist/jsx/components/form/AddressInput.d.cts.map +1 -0
  16. package/dist/jsx/components/form/AddressInput.d.mts +24 -0
  17. package/dist/jsx/components/form/AddressInput.d.mts.map +1 -0
  18. package/dist/jsx/components/form/AddressInput.mjs +17 -0
  19. package/dist/jsx/components/form/AddressInput.mjs.map +1 -0
  20. package/dist/jsx/components/form/AssetSelector.cjs +37 -0
  21. package/dist/jsx/components/form/AssetSelector.cjs.map +1 -0
  22. package/dist/jsx/components/form/AssetSelector.d.cts +55 -0
  23. package/dist/jsx/components/form/AssetSelector.d.cts.map +1 -0
  24. package/dist/jsx/components/form/AssetSelector.d.mts +55 -0
  25. package/dist/jsx/components/form/AssetSelector.d.mts.map +1 -0
  26. package/dist/jsx/components/form/AssetSelector.mjs +34 -0
  27. package/dist/jsx/components/form/AssetSelector.mjs.map +1 -0
  28. package/dist/jsx/components/form/Field.cjs.map +1 -1
  29. package/dist/jsx/components/form/Field.d.cts +3 -1
  30. package/dist/jsx/components/form/Field.d.cts.map +1 -1
  31. package/dist/jsx/components/form/Field.d.mts +3 -1
  32. package/dist/jsx/components/form/Field.d.mts.map +1 -1
  33. package/dist/jsx/components/form/Field.mjs.map +1 -1
  34. package/dist/jsx/components/form/index.cjs +2 -0
  35. package/dist/jsx/components/form/index.cjs.map +1 -1
  36. package/dist/jsx/components/form/index.d.cts +5 -1
  37. package/dist/jsx/components/form/index.d.cts.map +1 -1
  38. package/dist/jsx/components/form/index.d.mts +5 -1
  39. package/dist/jsx/components/form/index.d.mts.map +1 -1
  40. package/dist/jsx/components/form/index.mjs +2 -0
  41. package/dist/jsx/components/form/index.mjs.map +1 -1
  42. package/dist/jsx/validation.cjs +29 -2
  43. package/dist/jsx/validation.cjs.map +1 -1
  44. package/dist/jsx/validation.d.cts +12 -4
  45. package/dist/jsx/validation.d.cts.map +1 -1
  46. package/dist/jsx/validation.d.mts +12 -4
  47. package/dist/jsx/validation.d.mts.map +1 -1
  48. package/dist/jsx/validation.mjs +28 -1
  49. package/dist/jsx/validation.mjs.map +1 -1
  50. package/dist/types/caip.cjs +40 -0
  51. package/dist/types/caip.cjs.map +1 -1
  52. package/dist/types/caip.d.cts +13 -1
  53. package/dist/types/caip.d.cts.map +1 -1
  54. package/dist/types/caip.d.mts +13 -1
  55. package/dist/types/caip.d.mts.map +1 -1
  56. package/dist/types/caip.mjs +39 -1
  57. package/dist/types/caip.mjs.map +1 -1
  58. package/dist/types/handlers/user-input.cjs +9 -3
  59. package/dist/types/handlers/user-input.cjs.map +1 -1
  60. package/dist/types/handlers/user-input.d.cts +44 -3
  61. package/dist/types/handlers/user-input.d.cts.map +1 -1
  62. package/dist/types/handlers/user-input.d.mts +44 -3
  63. package/dist/types/handlers/user-input.d.mts.map +1 -1
  64. package/dist/types/handlers/user-input.mjs +8 -2
  65. package/dist/types/handlers/user-input.mjs.map +1 -1
  66. package/dist/types/index.cjs +2 -0
  67. package/dist/types/index.cjs.map +1 -1
  68. package/dist/types/index.d.cts +1 -1
  69. package/dist/types/index.d.cts.map +1 -1
  70. package/dist/types/index.d.mts +1 -1
  71. package/dist/types/index.d.mts.map +1 -1
  72. package/dist/types/index.mjs +2 -0
  73. package/dist/types/index.mjs.map +1 -1
  74. package/dist/types/interface.cjs +7 -1
  75. package/dist/types/interface.cjs.map +1 -1
  76. package/dist/types/interface.d.cts +17 -1
  77. package/dist/types/interface.d.cts.map +1 -1
  78. package/dist/types/interface.d.mts +17 -1
  79. package/dist/types/interface.d.mts.map +1 -1
  80. package/dist/types/interface.mjs +9 -3
  81. package/dist/types/interface.mjs.map +1 -1
  82. package/package.json +3 -3
@@ -15,10 +15,10 @@ export type JsonRpcErrorFunction = typeof rpcErrors.parse;
15
15
  */
16
16
  export declare function createSnapError(fn: JsonRpcErrorFunction): {
17
17
  new (message?: string): {
18
- readonly "__#188421@#code": number;
19
- readonly "__#188421@#message": string;
20
- readonly "__#188421@#data"?: Record<string, Json> | undefined;
21
- readonly "__#188421@#stack"?: string | undefined;
18
+ readonly "__#188773@#code": number;
19
+ readonly "__#188773@#message": string;
20
+ readonly "__#188773@#data"?: Record<string, Json> | undefined;
21
+ readonly "__#188773@#stack"?: string | undefined;
22
22
  readonly name: string;
23
23
  readonly code: number;
24
24
  readonly message: string;
@@ -29,10 +29,10 @@ export declare function createSnapError(fn: JsonRpcErrorFunction): {
29
29
  cause?: unknown;
30
30
  };
31
31
  new (data?: Record<string, Json>): {
32
- readonly "__#188421@#code": number;
33
- readonly "__#188421@#message": string;
34
- readonly "__#188421@#data"?: Record<string, Json> | undefined;
35
- readonly "__#188421@#stack"?: string | undefined;
32
+ readonly "__#188773@#code": number;
33
+ readonly "__#188773@#message": string;
34
+ readonly "__#188773@#data"?: Record<string, Json> | undefined;
35
+ readonly "__#188773@#stack"?: string | undefined;
36
36
  readonly name: string;
37
37
  readonly code: number;
38
38
  readonly message: string;
@@ -43,10 +43,10 @@ export declare function createSnapError(fn: JsonRpcErrorFunction): {
43
43
  cause?: unknown;
44
44
  };
45
45
  new (message?: string | Record<string, Json>, data?: Record<string, Json>): {
46
- readonly "__#188421@#code": number;
47
- readonly "__#188421@#message": string;
48
- readonly "__#188421@#data"?: Record<string, Json> | undefined;
49
- readonly "__#188421@#stack"?: string | undefined;
46
+ readonly "__#188773@#code": number;
47
+ readonly "__#188773@#message": string;
48
+ readonly "__#188773@#data"?: Record<string, Json> | undefined;
49
+ readonly "__#188773@#stack"?: string | undefined;
50
50
  readonly name: string;
51
51
  readonly code: number;
52
52
  readonly message: string;
@@ -15,10 +15,10 @@ export type JsonRpcErrorFunction = typeof rpcErrors.parse;
15
15
  */
16
16
  export declare function createSnapError(fn: JsonRpcErrorFunction): {
17
17
  new (message?: string): {
18
- readonly "__#94212@#code": number;
19
- readonly "__#94212@#message": string;
20
- readonly "__#94212@#data"?: Record<string, Json> | undefined;
21
- readonly "__#94212@#stack"?: string | undefined;
18
+ readonly "__#94388@#code": number;
19
+ readonly "__#94388@#message": string;
20
+ readonly "__#94388@#data"?: Record<string, Json> | undefined;
21
+ readonly "__#94388@#stack"?: string | undefined;
22
22
  readonly name: string;
23
23
  readonly code: number;
24
24
  readonly message: string;
@@ -29,10 +29,10 @@ export declare function createSnapError(fn: JsonRpcErrorFunction): {
29
29
  cause?: unknown;
30
30
  };
31
31
  new (data?: Record<string, Json>): {
32
- readonly "__#94212@#code": number;
33
- readonly "__#94212@#message": string;
34
- readonly "__#94212@#data"?: Record<string, Json> | undefined;
35
- readonly "__#94212@#stack"?: string | undefined;
32
+ readonly "__#94388@#code": number;
33
+ readonly "__#94388@#message": string;
34
+ readonly "__#94388@#data"?: Record<string, Json> | undefined;
35
+ readonly "__#94388@#stack"?: string | undefined;
36
36
  readonly name: string;
37
37
  readonly code: number;
38
38
  readonly message: string;
@@ -43,10 +43,10 @@ export declare function createSnapError(fn: JsonRpcErrorFunction): {
43
43
  cause?: unknown;
44
44
  };
45
45
  new (message?: string | Record<string, Json>, data?: Record<string, Json>): {
46
- readonly "__#94212@#code": number;
47
- readonly "__#94212@#message": string;
48
- readonly "__#94212@#data"?: Record<string, Json> | undefined;
49
- readonly "__#94212@#stack"?: string | undefined;
46
+ readonly "__#94388@#code": number;
47
+ readonly "__#94388@#message": string;
48
+ readonly "__#94388@#data"?: Record<string, Json> | undefined;
49
+ readonly "__#94388@#stack"?: string | undefined;
50
50
  readonly name: string;
51
51
  readonly code: number;
52
52
  readonly message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"jsx.cjs","sourceRoot":"","sources":["../../src/internals/jsx.ts"],"names":[],"mappings":";;;AAaA,2CAAkC;AAuElC;;;;;;;GAOG;AACH,SAAgB,SAAS,CACvB,OAAoC;IAEpC,OAAO,IAAA,eAAK,EAAC,OAAO,CAGnB,CAAC;AACJ,CAAC;AAPD,8BAOC","sourcesContent":["import type {\n AnyStruct,\n EnumSchema,\n Infer,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n Struct,\n UnionToIntersection,\n} from '@metamask/superstruct';\n\nimport { union } from './structs';\nimport type { EmptyObject } from '../types';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion<Type> = [Type] extends [UnionToIntersection<Type>] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema<Type> =\n IsUnion<Type> extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch<Type, string | undefined | null>]\n ? null\n : [Type] extends [IsUnion<Type>]\n ? EnumSchema<Type>\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch<Type, number | undefined | null>]\n ? null\n : [Type] extends [IsUnion<Type>]\n ? EnumSchema<Type>\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch<Type, boolean>]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n | Function\n | Date\n | Error\n | RegExp\n | Map<any, any>\n | WeakMap<any, any>\n | Set<any>\n | WeakSet<any>\n | Promise<any>\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple<Type>\n ? null\n : Struct<E>\n : Type extends object\n ? Type extends IsRecord<Type>\n ? null\n : {\n [InnerKey in keyof Type]: Describe<Type[InnerKey]>;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe<Type> = Struct<Type, StructSchema<Type>>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion<Head extends AnyStruct, Tail extends AnyStruct[]>(\n structs: [head: Head, ...tail: Tail],\n): Struct<Infer<Head> | InferStructTuple<Tail>[number], null> {\n return union(structs) as unknown as Struct<\n Infer<Head> | InferStructTuple<Tail>[number],\n null\n >;\n}\n"]}
1
+ {"version":3,"file":"jsx.cjs","sourceRoot":"","sources":["../../src/internals/jsx.ts"],"names":[],"mappings":";;;AAcA,2CAAkC;AAyElC;;;;;;;GAOG;AACH,SAAgB,SAAS,CACvB,OAAoC;IAEpC,OAAO,IAAA,eAAK,EAAC,OAAO,CAGnB,CAAC;AACJ,CAAC;AAPD,8BAOC","sourcesContent":["import type {\n AnyStruct,\n EnumSchema,\n Infer,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n Struct,\n UnionToIntersection,\n} from '@metamask/superstruct';\nimport type { CaipChainId } from '@metamask/utils';\n\nimport { union } from './structs';\nimport type { EmptyObject } from '../types';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion<Type> = [Type] extends [UnionToIntersection<Type>] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema<Type> =\n IsUnion<Type> extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [CaipChainId]\n ? null\n : [Type] extends [IsMatch<Type, string | undefined | null>]\n ? null\n : [Type] extends [IsUnion<Type>]\n ? EnumSchema<Type>\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch<Type, number | undefined | null>]\n ? null\n : [Type] extends [IsUnion<Type>]\n ? EnumSchema<Type>\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch<Type, boolean>]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n | Function\n | Date\n | Error\n | RegExp\n | Map<any, any>\n | WeakMap<any, any>\n | Set<any>\n | WeakSet<any>\n | Promise<any>\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple<Type>\n ? null\n : Struct<E>\n : Type extends object\n ? Type extends IsRecord<Type>\n ? null\n : {\n [InnerKey in keyof Type]: Describe<Type[InnerKey]>;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe<Type> = Struct<Type, StructSchema<Type>>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion<Head extends AnyStruct, Tail extends AnyStruct[]>(\n structs: [head: Head, ...tail: Tail],\n): Struct<Infer<Head> | InferStructTuple<Tail>[number], null> {\n return union(structs) as unknown as Struct<\n Infer<Head> | InferStructTuple<Tail>[number],\n null\n >;\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import type { AnyStruct, EnumSchema, Infer, InferStructTuple, IsExactMatch, IsMatch, IsRecord, IsTuple, Struct, UnionToIntersection } from "@metamask/superstruct";
2
+ import type { CaipChainId } from "@metamask/utils";
2
3
  import type { EmptyObject } from "../types/index.cjs";
3
4
  /**
4
5
  * Check if a type is a union. Infers `true` if it is a union, otherwise
@@ -11,7 +12,7 @@ type IsUnion<Type> = [Type] extends [UnionToIntersection<Type>] ? false : true;
11
12
  * This is copied from `superstruct` but fixes some issues with the original
12
13
  * implementation.
13
14
  */
14
- type StructSchema<Type> = IsUnion<Type> extends true ? null : [Type] extends [EmptyObject] ? EmptyObject : [Type] extends [string | undefined | null] ? [Type] extends [`0x${string}`] ? null : [Type] extends [IsMatch<Type, string | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [number | undefined | null] ? [Type] extends [IsMatch<Type, number | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [boolean] ? [Type] extends [IsExactMatch<Type, boolean>] ? null : Type : Type extends bigint | symbol | undefined | null | Function | Date | Error | RegExp | Map<any, any> | WeakMap<any, any> | Set<any> | WeakSet<any> | Promise<any> ? null : Type extends (infer E)[] ? Type extends IsTuple<Type> ? null : Struct<E> : Type extends object ? Type extends IsRecord<Type> ? null : {
15
+ type StructSchema<Type> = IsUnion<Type> extends true ? null : [Type] extends [EmptyObject] ? EmptyObject : [Type] extends [string | undefined | null] ? [Type] extends [`0x${string}`] ? null : [Type] extends [CaipChainId] ? null : [Type] extends [IsMatch<Type, string | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [number | undefined | null] ? [Type] extends [IsMatch<Type, number | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [boolean] ? [Type] extends [IsExactMatch<Type, boolean>] ? null : Type : Type extends bigint | symbol | undefined | null | Function | Date | Error | RegExp | Map<any, any> | WeakMap<any, any> | Set<any> | WeakSet<any> | Promise<any> ? null : Type extends (infer E)[] ? Type extends IsTuple<Type> ? null : Struct<E> : Type extends object ? Type extends IsRecord<Type> ? null : {
15
16
  [InnerKey in keyof Type]: Describe<Type[InnerKey]>;
16
17
  } : null;
17
18
  /**
@@ -1 +1 @@
1
- {"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1
  import type { AnyStruct, EnumSchema, Infer, InferStructTuple, IsExactMatch, IsMatch, IsRecord, IsTuple, Struct, UnionToIntersection } from "@metamask/superstruct";
2
+ import type { CaipChainId } from "@metamask/utils";
2
3
  import type { EmptyObject } from "../types/index.mjs";
3
4
  /**
4
5
  * Check if a type is a union. Infers `true` if it is a union, otherwise
@@ -11,7 +12,7 @@ type IsUnion<Type> = [Type] extends [UnionToIntersection<Type>] ? false : true;
11
12
  * This is copied from `superstruct` but fixes some issues with the original
12
13
  * implementation.
13
14
  */
14
- type StructSchema<Type> = IsUnion<Type> extends true ? null : [Type] extends [EmptyObject] ? EmptyObject : [Type] extends [string | undefined | null] ? [Type] extends [`0x${string}`] ? null : [Type] extends [IsMatch<Type, string | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [number | undefined | null] ? [Type] extends [IsMatch<Type, number | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [boolean] ? [Type] extends [IsExactMatch<Type, boolean>] ? null : Type : Type extends bigint | symbol | undefined | null | Function | Date | Error | RegExp | Map<any, any> | WeakMap<any, any> | Set<any> | WeakSet<any> | Promise<any> ? null : Type extends (infer E)[] ? Type extends IsTuple<Type> ? null : Struct<E> : Type extends object ? Type extends IsRecord<Type> ? null : {
15
+ type StructSchema<Type> = IsUnion<Type> extends true ? null : [Type] extends [EmptyObject] ? EmptyObject : [Type] extends [string | undefined | null] ? [Type] extends [`0x${string}`] ? null : [Type] extends [CaipChainId] ? null : [Type] extends [IsMatch<Type, string | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [number | undefined | null] ? [Type] extends [IsMatch<Type, number | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [boolean] ? [Type] extends [IsExactMatch<Type, boolean>] ? null : Type : Type extends bigint | symbol | undefined | null | Function | Date | Error | RegExp | Map<any, any> | WeakMap<any, any> | Set<any> | WeakSet<any> | Promise<any> ? null : Type extends (infer E)[] ? Type extends IsTuple<Type> ? null : Struct<E> : Type extends object ? Type extends IsRecord<Type> ? null : {
15
16
  [InnerKey in keyof Type]: Describe<Type[InnerKey]>;
16
17
  } : null;
17
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"jsx.d.mts","sourceRoot":"","sources":["../../src/internals/jsx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,OAAO,EACP,MAAM,EACN,mBAAmB,EACpB,8BAA8B;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,2BAAiB;AAE5C;;;GAGG;AACH,KAAK,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC;AAE/E;;;;;GAKG;AACH,KAAK,YAAY,CAAC,IAAI,IACpB,OAAO,CAAC,IAAI,CAAC,SAAS,IAAI,GACtB,IAAI,GACJ,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAC1B,WAAW,GACX,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GACxC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,MAAM,EAAE,CAAC,GAC5B,IAAI,GACJ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC,GACvD,IAAI,GACJ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAC5B,UAAU,CAAC,IAAI,CAAC,GAChB,IAAI,GACV,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GACxC,CAAC,IAAI,CAAC,SA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C,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,CAAC,GACnC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAK5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"jsx.mjs","sourceRoot":"","sources":["../../src/internals/jsx.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,EAAE,sBAAkB;AAuElC;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,OAAoC;IAEpC,OAAO,KAAK,CAAC,OAAO,CAGnB,CAAC;AACJ,CAAC","sourcesContent":["import type {\n AnyStruct,\n EnumSchema,\n Infer,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n Struct,\n UnionToIntersection,\n} from '@metamask/superstruct';\n\nimport { union } from './structs';\nimport type { EmptyObject } from '../types';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion<Type> = [Type] extends [UnionToIntersection<Type>] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema<Type> =\n IsUnion<Type> extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [IsMatch<Type, string | undefined | null>]\n ? null\n : [Type] extends [IsUnion<Type>]\n ? EnumSchema<Type>\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch<Type, number | undefined | null>]\n ? null\n : [Type] extends [IsUnion<Type>]\n ? EnumSchema<Type>\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch<Type, boolean>]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n | Function\n | Date\n | Error\n | RegExp\n | Map<any, any>\n | WeakMap<any, any>\n | Set<any>\n | WeakSet<any>\n | Promise<any>\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple<Type>\n ? null\n : Struct<E>\n : Type extends object\n ? Type extends IsRecord<Type>\n ? null\n : {\n [InnerKey in keyof Type]: Describe<Type[InnerKey]>;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe<Type> = Struct<Type, StructSchema<Type>>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion<Head extends AnyStruct, Tail extends AnyStruct[]>(\n structs: [head: Head, ...tail: Tail],\n): Struct<Infer<Head> | InferStructTuple<Tail>[number], null> {\n return union(structs) as unknown as Struct<\n Infer<Head> | InferStructTuple<Tail>[number],\n null\n >;\n}\n"]}
1
+ {"version":3,"file":"jsx.mjs","sourceRoot":"","sources":["../../src/internals/jsx.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,EAAE,sBAAkB;AAyElC;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,OAAoC;IAEpC,OAAO,KAAK,CAAC,OAAO,CAGnB,CAAC;AACJ,CAAC","sourcesContent":["import type {\n AnyStruct,\n EnumSchema,\n Infer,\n InferStructTuple,\n IsExactMatch,\n IsMatch,\n IsRecord,\n IsTuple,\n Struct,\n UnionToIntersection,\n} from '@metamask/superstruct';\nimport type { CaipChainId } from '@metamask/utils';\n\nimport { union } from './structs';\nimport type { EmptyObject } from '../types';\n\n/**\n * Check if a type is a union. Infers `true` if it is a union, otherwise\n * `false`.\n */\ntype IsUnion<Type> = [Type] extends [UnionToIntersection<Type>] ? false : true;\n\n/**\n * Get a struct schema for a type.\n *\n * This is copied from `superstruct` but fixes some issues with the original\n * implementation.\n */\ntype StructSchema<Type> =\n IsUnion<Type> extends true\n ? null\n : [Type] extends [EmptyObject]\n ? EmptyObject\n : [Type] extends [string | undefined | null]\n ? [Type] extends [`0x${string}`]\n ? null\n : [Type] extends [CaipChainId]\n ? null\n : [Type] extends [IsMatch<Type, string | undefined | null>]\n ? null\n : [Type] extends [IsUnion<Type>]\n ? EnumSchema<Type>\n : Type\n : [Type] extends [number | undefined | null]\n ? [Type] extends [IsMatch<Type, number | undefined | null>]\n ? null\n : [Type] extends [IsUnion<Type>]\n ? EnumSchema<Type>\n : Type\n : [Type] extends [boolean]\n ? [Type] extends [IsExactMatch<Type, boolean>]\n ? null\n : Type\n : Type extends\n | bigint\n | symbol\n | undefined\n | null\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n | Function\n | Date\n | Error\n | RegExp\n | Map<any, any>\n | WeakMap<any, any>\n | Set<any>\n | WeakSet<any>\n | Promise<any>\n ? null\n : Type extends (infer E)[]\n ? Type extends IsTuple<Type>\n ? null\n : Struct<E>\n : Type extends object\n ? Type extends IsRecord<Type>\n ? null\n : {\n [InnerKey in keyof Type]: Describe<Type[InnerKey]>;\n }\n : null;\n\n/**\n * Describe a struct type.\n */\nexport type Describe<Type> = Struct<Type, StructSchema<Type>>;\n\n/**\n * Create a union struct that uses `null` for the schema type, for better\n * compatibility with `Describe`.\n *\n * @param structs - The structs to union.\n * @returns The `superstruct` struct, which validates that the value satisfies\n * one of the structs.\n */\nexport function nullUnion<Head extends AnyStruct, Tail extends AnyStruct[]>(\n structs: [head: Head, ...tail: Tail],\n): Struct<Infer<Head> | InferStructTuple<Tail>[number], null> {\n return union(structs) as unknown as Struct<\n Infer<Head> | InferStructTuple<Tail>[number],\n null\n >;\n}\n"]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressInput = void 0;
4
+ const component_1 = require("../../component.cjs");
5
+ const TYPE = 'AddressInput';
6
+ /**
7
+ * An input component for entering an address. Resolves the address to a display name and avatar.
8
+ *
9
+ * @param props - The props of the component.
10
+ * @param props.name - The name of the input field.
11
+ * @param props.value - The value of the input field.
12
+ * @param props.chainId - The CAIP-2 chain ID of the address.
13
+ * @param props.placeholder - The placeholder text of the input field.
14
+ * @param props.disabled - Whether the input field is disabled.
15
+ * @returns An input element.
16
+ * @example
17
+ * <AddressInput name="address" value="0x1234567890123456789012345678901234567890" chainId="eip155:1" />
18
+ */
19
+ exports.AddressInput = (0, component_1.createSnapComponent)(TYPE);
20
+ //# sourceMappingURL=AddressInput.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddressInput.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/AddressInput.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AAUtD,MAAM,IAAI,GAAG,cAAc,CAAC;AAE5B;;;;;;;;;;;;GAYG;AACU,QAAA,YAAY,GAAG,IAAA,+BAAmB,EAC7C,IAAI,CACL,CAAC","sourcesContent":["import type { CaipChainId } from '@metamask/utils';\n\nimport { createSnapComponent } from '../../component';\n\nexport type AddressInputProps = {\n name: string;\n value?: string | undefined;\n chainId: CaipChainId;\n placeholder?: string | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'AddressInput';\n\n/**\n * An input component for entering an address. Resolves the address to a display name and avatar.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the input field.\n * @param props.value - The value of the input field.\n * @param props.chainId - The CAIP-2 chain ID of the address.\n * @param props.placeholder - The placeholder text of the input field.\n * @param props.disabled - Whether the input field is disabled.\n * @returns An input element.\n * @example\n * <AddressInput name=\"address\" value=\"0x1234567890123456789012345678901234567890\" chainId=\"eip155:1\" />\n */\nexport const AddressInput = createSnapComponent<AddressInputProps, typeof TYPE>(\n TYPE,\n);\n\nexport type AddressInputElement = ReturnType<typeof AddressInput>;\n"]}
@@ -0,0 +1,24 @@
1
+ import type { CaipChainId } from "@metamask/utils";
2
+ export type AddressInputProps = {
3
+ name: string;
4
+ value?: string | undefined;
5
+ chainId: CaipChainId;
6
+ placeholder?: string | undefined;
7
+ disabled?: boolean | undefined;
8
+ };
9
+ /**
10
+ * An input component for entering an address. Resolves the address to a display name and avatar.
11
+ *
12
+ * @param props - The props of the component.
13
+ * @param props.name - The name of the input field.
14
+ * @param props.value - The value of the input field.
15
+ * @param props.chainId - The CAIP-2 chain ID of the address.
16
+ * @param props.placeholder - The placeholder text of the input field.
17
+ * @param props.disabled - Whether the input field is disabled.
18
+ * @returns An input element.
19
+ * @example
20
+ * <AddressInput name="address" value="0x1234567890123456789012345678901234567890" chainId="eip155:1" />
21
+ */
22
+ export declare const AddressInput: import("../../component.cjs").SnapComponent<AddressInputProps, "AddressInput">;
23
+ export type AddressInputElement = ReturnType<typeof AddressInput>;
24
+ //# sourceMappingURL=AddressInput.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddressInput.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/AddressInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AAInD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,4EAExB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { CaipChainId } from "@metamask/utils";
2
+ export type AddressInputProps = {
3
+ name: string;
4
+ value?: string | undefined;
5
+ chainId: CaipChainId;
6
+ placeholder?: string | undefined;
7
+ disabled?: boolean | undefined;
8
+ };
9
+ /**
10
+ * An input component for entering an address. Resolves the address to a display name and avatar.
11
+ *
12
+ * @param props - The props of the component.
13
+ * @param props.name - The name of the input field.
14
+ * @param props.value - The value of the input field.
15
+ * @param props.chainId - The CAIP-2 chain ID of the address.
16
+ * @param props.placeholder - The placeholder text of the input field.
17
+ * @param props.disabled - Whether the input field is disabled.
18
+ * @returns An input element.
19
+ * @example
20
+ * <AddressInput name="address" value="0x1234567890123456789012345678901234567890" chainId="eip155:1" />
21
+ */
22
+ export declare const AddressInput: import("../../component.mjs").SnapComponent<AddressInputProps, "AddressInput">;
23
+ export type AddressInputElement = ReturnType<typeof AddressInput>;
24
+ //# sourceMappingURL=AddressInput.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddressInput.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/AddressInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AAInD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,4EAExB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { createSnapComponent } from "../../component.mjs";
2
+ const TYPE = 'AddressInput';
3
+ /**
4
+ * An input component for entering an address. Resolves the address to a display name and avatar.
5
+ *
6
+ * @param props - The props of the component.
7
+ * @param props.name - The name of the input field.
8
+ * @param props.value - The value of the input field.
9
+ * @param props.chainId - The CAIP-2 chain ID of the address.
10
+ * @param props.placeholder - The placeholder text of the input field.
11
+ * @param props.disabled - Whether the input field is disabled.
12
+ * @returns An input element.
13
+ * @example
14
+ * <AddressInput name="address" value="0x1234567890123456789012345678901234567890" chainId="eip155:1" />
15
+ */
16
+ export const AddressInput = createSnapComponent(TYPE);
17
+ //# sourceMappingURL=AddressInput.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddressInput.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/AddressInput.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAUtD,MAAM,IAAI,GAAG,cAAc,CAAC;AAE5B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,mBAAmB,CAC7C,IAAI,CACL,CAAC","sourcesContent":["import type { CaipChainId } from '@metamask/utils';\n\nimport { createSnapComponent } from '../../component';\n\nexport type AddressInputProps = {\n name: string;\n value?: string | undefined;\n chainId: CaipChainId;\n placeholder?: string | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'AddressInput';\n\n/**\n * An input component for entering an address. Resolves the address to a display name and avatar.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the input field.\n * @param props.value - The value of the input field.\n * @param props.chainId - The CAIP-2 chain ID of the address.\n * @param props.placeholder - The placeholder text of the input field.\n * @param props.disabled - Whether the input field is disabled.\n * @returns An input element.\n * @example\n * <AddressInput name=\"address\" value=\"0x1234567890123456789012345678901234567890\" chainId=\"eip155:1\" />\n */\nexport const AddressInput = createSnapComponent<AddressInputProps, typeof TYPE>(\n TYPE,\n);\n\nexport type AddressInputElement = ReturnType<typeof AddressInput>;\n"]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AssetSelector = void 0;
4
+ const component_1 = require("../../component.cjs");
5
+ const TYPE = 'AssetSelector';
6
+ /**
7
+ * An asset selector component, which is used to create an asset selector.
8
+ *
9
+ * @param props - The props of the component.
10
+ * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.
11
+ * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.
12
+ * Only non-EIP-155 namespaces are supported for now.
13
+ * @param props.chainIds - The chain IDs to filter the assets.
14
+ * Only non-EIP-155 namespaces are supported for now.
15
+ * @param props.value - The selected value of the asset selector.
16
+ * Only non-EIP-155 namespaces are supported for now.
17
+ * @param props.disabled - Whether the asset selector is disabled.
18
+ * @returns An asset selector element.
19
+ * @example
20
+ * <AssetSelector
21
+ * addresses={[
22
+ * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
23
+ * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
24
+ * ]}
25
+ * value="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
26
+ * />
27
+ * @example
28
+ * <AssetSelector
29
+ * addresses={[
30
+ * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
31
+ * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
32
+ * ]}
33
+ * chainIds={['solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp']}
34
+ * />
35
+ */
36
+ exports.AssetSelector = (0, component_1.createSnapComponent)(TYPE);
37
+ //# sourceMappingURL=AssetSelector.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetSelector.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/AssetSelector.ts"],"names":[],"mappings":";;;AAMA,mDAAsD;AAwBtD,MAAM,IAAI,GAAG,eAAe,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACU,QAAA,aAAa,GAAG,IAAA,+BAAmB,EAG9C,IAAI,CAAC,CAAC","sourcesContent":["import type {\n CaipChainId,\n CaipAssetType,\n CaipAccountId,\n} from '@metamask/utils';\n\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link AssetSelector} component.\n *\n * @property name - The name of the asset selector. This is used to identify the\n * state in the form data.\n * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.\n * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.\n * Only non-EIP-155 namespaces are supported for now.\n * @property chainIds - The chain IDs to filter the assets.\n * Only non-EIP-155 namespaces are supported for now.\n * @property value - The selected value of the asset selector.\n * Only non-EIP-155 namespaces are supported for now.\n * @property disabled - Whether the asset selector is disabled.\n */\nexport type AssetSelectorProps = {\n name: string;\n addresses: CaipAccountId[];\n chainIds?: CaipChainId[] | undefined;\n value?: CaipAssetType | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'AssetSelector';\n\n/**\n * An asset selector component, which is used to create an asset selector.\n *\n * @param props - The props of the component.\n * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.\n * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.\n * Only non-EIP-155 namespaces are supported for now.\n * @param props.chainIds - The chain IDs to filter the assets.\n * Only non-EIP-155 namespaces are supported for now.\n * @param props.value - The selected value of the asset selector.\n * Only non-EIP-155 namespaces are supported for now.\n * @param props.disabled - Whether the asset selector is disabled.\n * @returns An asset selector element.\n * @example\n * <AssetSelector\n * addresses={[\n * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * ]}\n * value=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"\n * />\n * @example\n * <AssetSelector\n * addresses={[\n * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * ]}\n * chainIds={['solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp']}\n * />\n */\nexport const AssetSelector = createSnapComponent<\n AssetSelectorProps,\n typeof TYPE\n>(TYPE);\n\nexport type AssetSelectorElement = ReturnType<typeof AssetSelector>;\n"]}
@@ -0,0 +1,55 @@
1
+ import type { CaipChainId, CaipAssetType, CaipAccountId } from "@metamask/utils";
2
+ /**
3
+ * The props of the {@link AssetSelector} component.
4
+ *
5
+ * @property name - The name of the asset selector. This is used to identify the
6
+ * state in the form data.
7
+ * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.
8
+ * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.
9
+ * Only non-EIP-155 namespaces are supported for now.
10
+ * @property chainIds - The chain IDs to filter the assets.
11
+ * Only non-EIP-155 namespaces are supported for now.
12
+ * @property value - The selected value of the asset selector.
13
+ * Only non-EIP-155 namespaces are supported for now.
14
+ * @property disabled - Whether the asset selector is disabled.
15
+ */
16
+ export type AssetSelectorProps = {
17
+ name: string;
18
+ addresses: CaipAccountId[];
19
+ chainIds?: CaipChainId[] | undefined;
20
+ value?: CaipAssetType | undefined;
21
+ disabled?: boolean | undefined;
22
+ };
23
+ /**
24
+ * An asset selector component, which is used to create an asset selector.
25
+ *
26
+ * @param props - The props of the component.
27
+ * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.
28
+ * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.
29
+ * Only non-EIP-155 namespaces are supported for now.
30
+ * @param props.chainIds - The chain IDs to filter the assets.
31
+ * Only non-EIP-155 namespaces are supported for now.
32
+ * @param props.value - The selected value of the asset selector.
33
+ * Only non-EIP-155 namespaces are supported for now.
34
+ * @param props.disabled - Whether the asset selector is disabled.
35
+ * @returns An asset selector element.
36
+ * @example
37
+ * <AssetSelector
38
+ * addresses={[
39
+ * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
40
+ * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
41
+ * ]}
42
+ * value="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
43
+ * />
44
+ * @example
45
+ * <AssetSelector
46
+ * addresses={[
47
+ * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
48
+ * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
49
+ * ]}
50
+ * chainIds={['solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp']}
51
+ * />
52
+ */
53
+ export declare const AssetSelector: import("../../component.cjs").SnapComponent<AssetSelectorProps, "AssetSelector">;
54
+ export type AssetSelectorElement = ReturnType<typeof AssetSelector>;
55
+ //# sourceMappingURL=AssetSelector.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetSelector.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/AssetSelector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACd,wBAAwB;AAIzB;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;IACrC,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,aAAa,8EAGnB,CAAC;AAER,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { CaipChainId, CaipAssetType, CaipAccountId } from "@metamask/utils";
2
+ /**
3
+ * The props of the {@link AssetSelector} component.
4
+ *
5
+ * @property name - The name of the asset selector. This is used to identify the
6
+ * state in the form data.
7
+ * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.
8
+ * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.
9
+ * Only non-EIP-155 namespaces are supported for now.
10
+ * @property chainIds - The chain IDs to filter the assets.
11
+ * Only non-EIP-155 namespaces are supported for now.
12
+ * @property value - The selected value of the asset selector.
13
+ * Only non-EIP-155 namespaces are supported for now.
14
+ * @property disabled - Whether the asset selector is disabled.
15
+ */
16
+ export type AssetSelectorProps = {
17
+ name: string;
18
+ addresses: CaipAccountId[];
19
+ chainIds?: CaipChainId[] | undefined;
20
+ value?: CaipAssetType | undefined;
21
+ disabled?: boolean | undefined;
22
+ };
23
+ /**
24
+ * An asset selector component, which is used to create an asset selector.
25
+ *
26
+ * @param props - The props of the component.
27
+ * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.
28
+ * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.
29
+ * Only non-EIP-155 namespaces are supported for now.
30
+ * @param props.chainIds - The chain IDs to filter the assets.
31
+ * Only non-EIP-155 namespaces are supported for now.
32
+ * @param props.value - The selected value of the asset selector.
33
+ * Only non-EIP-155 namespaces are supported for now.
34
+ * @param props.disabled - Whether the asset selector is disabled.
35
+ * @returns An asset selector element.
36
+ * @example
37
+ * <AssetSelector
38
+ * addresses={[
39
+ * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
40
+ * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
41
+ * ]}
42
+ * value="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
43
+ * />
44
+ * @example
45
+ * <AssetSelector
46
+ * addresses={[
47
+ * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
48
+ * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
49
+ * ]}
50
+ * chainIds={['solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp']}
51
+ * />
52
+ */
53
+ export declare const AssetSelector: import("../../component.mjs").SnapComponent<AssetSelectorProps, "AssetSelector">;
54
+ export type AssetSelectorElement = ReturnType<typeof AssetSelector>;
55
+ //# sourceMappingURL=AssetSelector.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetSelector.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/AssetSelector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACd,wBAAwB;AAIzB;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;IACrC,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,aAAa,8EAGnB,CAAC;AAER,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { createSnapComponent } from "../../component.mjs";
2
+ const TYPE = 'AssetSelector';
3
+ /**
4
+ * An asset selector component, which is used to create an asset selector.
5
+ *
6
+ * @param props - The props of the component.
7
+ * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.
8
+ * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.
9
+ * Only non-EIP-155 namespaces are supported for now.
10
+ * @param props.chainIds - The chain IDs to filter the assets.
11
+ * Only non-EIP-155 namespaces are supported for now.
12
+ * @param props.value - The selected value of the asset selector.
13
+ * Only non-EIP-155 namespaces are supported for now.
14
+ * @param props.disabled - Whether the asset selector is disabled.
15
+ * @returns An asset selector element.
16
+ * @example
17
+ * <AssetSelector
18
+ * addresses={[
19
+ * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
20
+ * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
21
+ * ]}
22
+ * value="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
23
+ * />
24
+ * @example
25
+ * <AssetSelector
26
+ * addresses={[
27
+ * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
28
+ * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
29
+ * ]}
30
+ * chainIds={['solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp']}
31
+ * />
32
+ */
33
+ export const AssetSelector = createSnapComponent(TYPE);
34
+ //# sourceMappingURL=AssetSelector.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetSelector.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/AssetSelector.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAwBtD,MAAM,IAAI,GAAG,eAAe,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAG9C,IAAI,CAAC,CAAC","sourcesContent":["import type {\n CaipChainId,\n CaipAssetType,\n CaipAccountId,\n} from '@metamask/utils';\n\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link AssetSelector} component.\n *\n * @property name - The name of the asset selector. This is used to identify the\n * state in the form data.\n * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.\n * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.\n * Only non-EIP-155 namespaces are supported for now.\n * @property chainIds - The chain IDs to filter the assets.\n * Only non-EIP-155 namespaces are supported for now.\n * @property value - The selected value of the asset selector.\n * Only non-EIP-155 namespaces are supported for now.\n * @property disabled - Whether the asset selector is disabled.\n */\nexport type AssetSelectorProps = {\n name: string;\n addresses: CaipAccountId[];\n chainIds?: CaipChainId[] | undefined;\n value?: CaipAssetType | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'AssetSelector';\n\n/**\n * An asset selector component, which is used to create an asset selector.\n *\n * @param props - The props of the component.\n * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.\n * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.\n * Only non-EIP-155 namespaces are supported for now.\n * @param props.chainIds - The chain IDs to filter the assets.\n * Only non-EIP-155 namespaces are supported for now.\n * @param props.value - The selected value of the asset selector.\n * Only non-EIP-155 namespaces are supported for now.\n * @param props.disabled - Whether the asset selector is disabled.\n * @returns An asset selector element.\n * @example\n * <AssetSelector\n * addresses={[\n * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * ]}\n * value=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"\n * />\n * @example\n * <AssetSelector\n * addresses={[\n * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * ]}\n * chainIds={['solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp']}\n * />\n */\nexport const AssetSelector = createSnapComponent<\n AssetSelectorProps,\n typeof TYPE\n>(TYPE);\n\nexport type AssetSelectorElement = ReturnType<typeof AssetSelector>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":";;;AAMA,mDAAsD;AAyBtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,KAAK,GAAG,IAAA,+BAAmB,EAA0B,IAAI,CAAC,CAAC","sourcesContent":["import type { CheckboxElement } from './Checkbox';\nimport type { DropdownElement } from './Dropdown';\nimport type { FileInputElement } from './FileInput';\nimport type { InputElement } from './Input';\nimport type { RadioGroupElement } from './RadioGroup';\nimport type { SelectorElement } from './Selector';\nimport { createSnapComponent } from '../../component';\nimport type { GenericSnapChildren } from '../../component';\n\n/**\n * The props of the {@link Field} component.\n *\n * @property label - The label of the field.\n * @property error - The error message of the field.\n * @property children - The input field and the submit button.\n */\nexport type FieldProps = {\n label?: string | undefined;\n error?: string | undefined;\n children:\n | [InputElement, GenericSnapChildren]\n | [GenericSnapChildren, InputElement]\n | [GenericSnapChildren, InputElement, GenericSnapChildren]\n | DropdownElement\n | RadioGroupElement\n | FileInputElement\n | InputElement\n | CheckboxElement\n | SelectorElement;\n};\n\nconst TYPE = 'Field';\n\n/**\n * A field component, which is used to create a form field.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the field.\n * @param props.error - The error message of the field.\n * @param props.children - The input field and the submit button.\n * @returns A field element.\n * @example\n * <Field label=\"Username\">\n * <Input name=\"username\" type=\"text\" />\n * <Button type=\"submit\">Submit</Button>\n * </Field>\n * @example\n * <Field label=\"Upload file\">\n * <FileInput name=\"file\" accept={['image/*']} multiple />\n * </Field>\n */\nexport const Field = createSnapComponent<FieldProps, typeof TYPE>(TYPE);\n\n/**\n * A field element.\n *\n * @see Field\n */\nexport type FieldElement = ReturnType<typeof Field>;\n"]}
1
+ {"version":3,"file":"Field.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":";;;AASA,mDAAsD;AA0BtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,KAAK,GAAG,IAAA,+BAAmB,EAA0B,IAAI,CAAC,CAAC","sourcesContent":["import type { AddressInputElement } from './AddressInput';\nimport type { AssetSelectorElement } from './AssetSelector';\nimport type { CheckboxElement } from './Checkbox';\nimport type { DropdownElement } from './Dropdown';\nimport type { FileInputElement } from './FileInput';\nimport type { InputElement } from './Input';\nimport type { RadioGroupElement } from './RadioGroup';\nimport type { SelectorElement } from './Selector';\nimport type { GenericSnapChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Field} component.\n *\n * @property label - The label of the field.\n * @property error - The error message of the field.\n * @property children - The input field and the submit button.\n */\nexport type FieldProps = {\n label?: string | undefined;\n error?: string | undefined;\n children:\n | [InputElement, GenericSnapChildren]\n | [GenericSnapChildren, InputElement]\n | [GenericSnapChildren, InputElement, GenericSnapChildren]\n | DropdownElement\n | RadioGroupElement\n | FileInputElement\n | InputElement\n | CheckboxElement\n | SelectorElement\n | AssetSelectorElement\n | AddressInputElement;\n};\n\nconst TYPE = 'Field';\n\n/**\n * A field component, which is used to create a form field.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the field.\n * @param props.error - The error message of the field.\n * @param props.children - The input field and the submit button.\n * @returns A field element.\n * @example\n * <Field label=\"Username\">\n * <Input name=\"username\" type=\"text\" />\n * <Button type=\"submit\">Submit</Button>\n * </Field>\n * @example\n * <Field label=\"Upload file\">\n * <FileInput name=\"file\" accept={['image/*']} multiple />\n * </Field>\n */\nexport const Field = createSnapComponent<FieldProps, typeof TYPE>(TYPE);\n\n/**\n * A field element.\n *\n * @see Field\n */\nexport type FieldElement = ReturnType<typeof Field>;\n"]}
@@ -1,3 +1,5 @@
1
+ import type { AddressInputElement } from "./AddressInput.cjs";
2
+ import type { AssetSelectorElement } from "./AssetSelector.cjs";
1
3
  import type { CheckboxElement } from "./Checkbox.cjs";
2
4
  import type { DropdownElement } from "./Dropdown.cjs";
3
5
  import type { FileInputElement } from "./FileInput.cjs";
@@ -15,7 +17,7 @@ import type { GenericSnapChildren } from "../../component.cjs";
15
17
  export type FieldProps = {
16
18
  label?: string | undefined;
17
19
  error?: string | undefined;
18
- children: [InputElement, GenericSnapChildren] | [GenericSnapChildren, InputElement] | [GenericSnapChildren, InputElement, GenericSnapChildren] | DropdownElement | RadioGroupElement | FileInputElement | InputElement | CheckboxElement | SelectorElement;
20
+ children: [InputElement, GenericSnapChildren] | [GenericSnapChildren, InputElement] | [GenericSnapChildren, InputElement, GenericSnapChildren] | DropdownElement | RadioGroupElement | FileInputElement | InputElement | CheckboxElement | SelectorElement | AssetSelectorElement | AddressInputElement;
19
21
  };
20
22
  /**
21
23
  * A field component, which is used to create a form field.
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAoB;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAqB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,4BAAwB;AAE3D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EACJ,CAAC,YAAY,EAAE,mBAAmB,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,EAAE,mBAAmB,CAAC,GACxD,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,eAAe,CAAC;CACrB,CAAC;AAIF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"Field.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,2BAAuB;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,4BAAwB;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAoB;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAqB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,4BAAwB;AAG3D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EACJ,CAAC,YAAY,EAAE,mBAAmB,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,EAAE,mBAAmB,CAAC,GACxD,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,oBAAoB,GACpB,mBAAmB,CAAC;CACzB,CAAC;AAIF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
@@ -1,3 +1,5 @@
1
+ import type { AddressInputElement } from "./AddressInput.mjs";
2
+ import type { AssetSelectorElement } from "./AssetSelector.mjs";
1
3
  import type { CheckboxElement } from "./Checkbox.mjs";
2
4
  import type { DropdownElement } from "./Dropdown.mjs";
3
5
  import type { FileInputElement } from "./FileInput.mjs";
@@ -15,7 +17,7 @@ import type { GenericSnapChildren } from "../../component.mjs";
15
17
  export type FieldProps = {
16
18
  label?: string | undefined;
17
19
  error?: string | undefined;
18
- children: [InputElement, GenericSnapChildren] | [GenericSnapChildren, InputElement] | [GenericSnapChildren, InputElement, GenericSnapChildren] | DropdownElement | RadioGroupElement | FileInputElement | InputElement | CheckboxElement | SelectorElement;
20
+ children: [InputElement, GenericSnapChildren] | [GenericSnapChildren, InputElement] | [GenericSnapChildren, InputElement, GenericSnapChildren] | DropdownElement | RadioGroupElement | FileInputElement | InputElement | CheckboxElement | SelectorElement | AssetSelectorElement | AddressInputElement;
19
21
  };
20
22
  /**
21
23
  * A field component, which is used to create a form field.
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAoB;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAqB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,4BAAwB;AAE3D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EACJ,CAAC,YAAY,EAAE,mBAAmB,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,EAAE,mBAAmB,CAAC,GACxD,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,eAAe,CAAC;CACrB,CAAC;AAIF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"Field.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,2BAAuB;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,4BAAwB;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAoB;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAqB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,4BAAwB;AAG3D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EACJ,CAAC,YAAY,EAAE,mBAAmB,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,EAAE,mBAAmB,CAAC,GACxD,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,oBAAoB,GACpB,mBAAmB,CAAC;CACzB,CAAC;AAIF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAyBtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,mBAAmB,CAA0B,IAAI,CAAC,CAAC","sourcesContent":["import type { CheckboxElement } from './Checkbox';\nimport type { DropdownElement } from './Dropdown';\nimport type { FileInputElement } from './FileInput';\nimport type { InputElement } from './Input';\nimport type { RadioGroupElement } from './RadioGroup';\nimport type { SelectorElement } from './Selector';\nimport { createSnapComponent } from '../../component';\nimport type { GenericSnapChildren } from '../../component';\n\n/**\n * The props of the {@link Field} component.\n *\n * @property label - The label of the field.\n * @property error - The error message of the field.\n * @property children - The input field and the submit button.\n */\nexport type FieldProps = {\n label?: string | undefined;\n error?: string | undefined;\n children:\n | [InputElement, GenericSnapChildren]\n | [GenericSnapChildren, InputElement]\n | [GenericSnapChildren, InputElement, GenericSnapChildren]\n | DropdownElement\n | RadioGroupElement\n | FileInputElement\n | InputElement\n | CheckboxElement\n | SelectorElement;\n};\n\nconst TYPE = 'Field';\n\n/**\n * A field component, which is used to create a form field.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the field.\n * @param props.error - The error message of the field.\n * @param props.children - The input field and the submit button.\n * @returns A field element.\n * @example\n * <Field label=\"Username\">\n * <Input name=\"username\" type=\"text\" />\n * <Button type=\"submit\">Submit</Button>\n * </Field>\n * @example\n * <Field label=\"Upload file\">\n * <FileInput name=\"file\" accept={['image/*']} multiple />\n * </Field>\n */\nexport const Field = createSnapComponent<FieldProps, typeof TYPE>(TYPE);\n\n/**\n * A field element.\n *\n * @see Field\n */\nexport type FieldElement = ReturnType<typeof Field>;\n"]}
1
+ {"version":3,"file":"Field.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AA0BtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,mBAAmB,CAA0B,IAAI,CAAC,CAAC","sourcesContent":["import type { AddressInputElement } from './AddressInput';\nimport type { AssetSelectorElement } from './AssetSelector';\nimport type { CheckboxElement } from './Checkbox';\nimport type { DropdownElement } from './Dropdown';\nimport type { FileInputElement } from './FileInput';\nimport type { InputElement } from './Input';\nimport type { RadioGroupElement } from './RadioGroup';\nimport type { SelectorElement } from './Selector';\nimport type { GenericSnapChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Field} component.\n *\n * @property label - The label of the field.\n * @property error - The error message of the field.\n * @property children - The input field and the submit button.\n */\nexport type FieldProps = {\n label?: string | undefined;\n error?: string | undefined;\n children:\n | [InputElement, GenericSnapChildren]\n | [GenericSnapChildren, InputElement]\n | [GenericSnapChildren, InputElement, GenericSnapChildren]\n | DropdownElement\n | RadioGroupElement\n | FileInputElement\n | InputElement\n | CheckboxElement\n | SelectorElement\n | AssetSelectorElement\n | AddressInputElement;\n};\n\nconst TYPE = 'Field';\n\n/**\n * A field component, which is used to create a form field.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the field.\n * @param props.error - The error message of the field.\n * @param props.children - The input field and the submit button.\n * @returns A field element.\n * @example\n * <Field label=\"Username\">\n * <Input name=\"username\" type=\"text\" />\n * <Button type=\"submit\">Submit</Button>\n * </Field>\n * @example\n * <Field label=\"Upload file\">\n * <FileInput name=\"file\" accept={['image/*']} multiple />\n * </Field>\n */\nexport const Field = createSnapComponent<FieldProps, typeof TYPE>(TYPE);\n\n/**\n * A field element.\n *\n * @see Field\n */\nexport type FieldElement = ReturnType<typeof Field>;\n"]}