@metamask/snaps-sdk 6.16.0 → 6.17.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 (114) hide show
  1. package/CHANGELOG.md +13 -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/jsx/components/Avatar.cjs +1 -0
  7. package/dist/jsx/components/Avatar.cjs.map +1 -1
  8. package/dist/jsx/components/Avatar.d.cts +2 -0
  9. package/dist/jsx/components/Avatar.d.cts.map +1 -1
  10. package/dist/jsx/components/Avatar.d.mts +2 -0
  11. package/dist/jsx/components/Avatar.d.mts.map +1 -1
  12. package/dist/jsx/components/Avatar.mjs +1 -0
  13. package/dist/jsx/components/Avatar.mjs.map +1 -1
  14. package/dist/jsx/components/form/Checkbox.cjs +1 -0
  15. package/dist/jsx/components/form/Checkbox.cjs.map +1 -1
  16. package/dist/jsx/components/form/Checkbox.d.cts +3 -0
  17. package/dist/jsx/components/form/Checkbox.d.cts.map +1 -1
  18. package/dist/jsx/components/form/Checkbox.d.mts +3 -0
  19. package/dist/jsx/components/form/Checkbox.d.mts.map +1 -1
  20. package/dist/jsx/components/form/Checkbox.mjs +1 -0
  21. package/dist/jsx/components/form/Checkbox.mjs.map +1 -1
  22. package/dist/jsx/components/form/Dropdown.cjs +1 -0
  23. package/dist/jsx/components/form/Dropdown.cjs.map +1 -1
  24. package/dist/jsx/components/form/Dropdown.d.cts +3 -0
  25. package/dist/jsx/components/form/Dropdown.d.cts.map +1 -1
  26. package/dist/jsx/components/form/Dropdown.d.mts +3 -0
  27. package/dist/jsx/components/form/Dropdown.d.mts.map +1 -1
  28. package/dist/jsx/components/form/Dropdown.mjs +1 -0
  29. package/dist/jsx/components/form/Dropdown.mjs.map +1 -1
  30. package/dist/jsx/components/form/FileInput.cjs +1 -0
  31. package/dist/jsx/components/form/FileInput.cjs.map +1 -1
  32. package/dist/jsx/components/form/FileInput.d.cts +3 -0
  33. package/dist/jsx/components/form/FileInput.d.cts.map +1 -1
  34. package/dist/jsx/components/form/FileInput.d.mts +3 -0
  35. package/dist/jsx/components/form/FileInput.d.mts.map +1 -1
  36. package/dist/jsx/components/form/FileInput.mjs +1 -0
  37. package/dist/jsx/components/form/FileInput.mjs.map +1 -1
  38. package/dist/jsx/components/form/Input.cjs +1 -0
  39. package/dist/jsx/components/form/Input.cjs.map +1 -1
  40. package/dist/jsx/components/form/Input.d.cts +2 -0
  41. package/dist/jsx/components/form/Input.d.cts.map +1 -1
  42. package/dist/jsx/components/form/Input.d.mts +2 -0
  43. package/dist/jsx/components/form/Input.d.mts.map +1 -1
  44. package/dist/jsx/components/form/Input.mjs +1 -0
  45. package/dist/jsx/components/form/Input.mjs.map +1 -1
  46. package/dist/jsx/components/form/Option.cjs +1 -0
  47. package/dist/jsx/components/form/Option.cjs.map +1 -1
  48. package/dist/jsx/components/form/Option.d.cts +3 -0
  49. package/dist/jsx/components/form/Option.d.cts.map +1 -1
  50. package/dist/jsx/components/form/Option.d.mts +3 -0
  51. package/dist/jsx/components/form/Option.d.mts.map +1 -1
  52. package/dist/jsx/components/form/Option.mjs +1 -0
  53. package/dist/jsx/components/form/Option.mjs.map +1 -1
  54. package/dist/jsx/components/form/Radio.cjs +1 -0
  55. package/dist/jsx/components/form/Radio.cjs.map +1 -1
  56. package/dist/jsx/components/form/Radio.d.cts +3 -0
  57. package/dist/jsx/components/form/Radio.d.cts.map +1 -1
  58. package/dist/jsx/components/form/Radio.d.mts +3 -0
  59. package/dist/jsx/components/form/Radio.d.mts.map +1 -1
  60. package/dist/jsx/components/form/Radio.mjs +1 -0
  61. package/dist/jsx/components/form/Radio.mjs.map +1 -1
  62. package/dist/jsx/components/form/RadioGroup.cjs +5 -0
  63. package/dist/jsx/components/form/RadioGroup.cjs.map +1 -1
  64. package/dist/jsx/components/form/RadioGroup.d.cts +8 -0
  65. package/dist/jsx/components/form/RadioGroup.d.cts.map +1 -1
  66. package/dist/jsx/components/form/RadioGroup.d.mts +8 -0
  67. package/dist/jsx/components/form/RadioGroup.d.mts.map +1 -1
  68. package/dist/jsx/components/form/RadioGroup.mjs +5 -0
  69. package/dist/jsx/components/form/RadioGroup.mjs.map +1 -1
  70. package/dist/jsx/components/form/Selector.cjs +1 -0
  71. package/dist/jsx/components/form/Selector.cjs.map +1 -1
  72. package/dist/jsx/components/form/Selector.d.cts +3 -0
  73. package/dist/jsx/components/form/Selector.d.cts.map +1 -1
  74. package/dist/jsx/components/form/Selector.d.mts +3 -0
  75. package/dist/jsx/components/form/Selector.d.mts.map +1 -1
  76. package/dist/jsx/components/form/Selector.mjs +1 -0
  77. package/dist/jsx/components/form/Selector.mjs.map +1 -1
  78. package/dist/jsx/components/form/SelectorOption.cjs +1 -0
  79. package/dist/jsx/components/form/SelectorOption.cjs.map +1 -1
  80. package/dist/jsx/components/form/SelectorOption.d.cts +3 -0
  81. package/dist/jsx/components/form/SelectorOption.d.cts.map +1 -1
  82. package/dist/jsx/components/form/SelectorOption.d.mts +3 -0
  83. package/dist/jsx/components/form/SelectorOption.d.mts.map +1 -1
  84. package/dist/jsx/components/form/SelectorOption.mjs +1 -0
  85. package/dist/jsx/components/form/SelectorOption.mjs.map +1 -1
  86. package/dist/jsx/validation.cjs +9 -0
  87. package/dist/jsx/validation.cjs.map +1 -1
  88. package/dist/jsx/validation.d.cts +14 -0
  89. package/dist/jsx/validation.d.cts.map +1 -1
  90. package/dist/jsx/validation.d.mts +14 -0
  91. package/dist/jsx/validation.d.mts.map +1 -1
  92. package/dist/jsx/validation.mjs +9 -0
  93. package/dist/jsx/validation.mjs.map +1 -1
  94. package/dist/types/handlers/index.cjs +1 -0
  95. package/dist/types/handlers/index.cjs.map +1 -1
  96. package/dist/types/handlers/index.d.cts +1 -0
  97. package/dist/types/handlers/index.d.cts.map +1 -1
  98. package/dist/types/handlers/index.d.mts +1 -0
  99. package/dist/types/handlers/index.d.mts.map +1 -1
  100. package/dist/types/handlers/index.mjs +1 -0
  101. package/dist/types/handlers/index.mjs.map +1 -1
  102. package/dist/types/handlers/protocol.cjs +3 -0
  103. package/dist/types/handlers/protocol.cjs.map +1 -0
  104. package/dist/types/handlers/protocol.d.cts +23 -0
  105. package/dist/types/handlers/protocol.d.cts.map +1 -0
  106. package/dist/types/handlers/protocol.d.mts +23 -0
  107. package/dist/types/handlers/protocol.d.mts.map +1 -0
  108. package/dist/types/handlers/protocol.mjs +2 -0
  109. package/dist/types/handlers/protocol.mjs.map +1 -0
  110. package/dist/types/interface.d.cts +2 -0
  111. package/dist/types/interface.d.cts.map +1 -1
  112. package/dist/types/interface.d.mts +2 -0
  113. package/dist/types/interface.d.mts.map +1 -1
  114. package/package.json +1 -1
@@ -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 "__#184531@#code": number;
19
- readonly "__#184531@#message": string;
20
- readonly "__#184531@#data"?: Record<string, Json> | undefined;
21
- readonly "__#184531@#stack"?: string | undefined;
18
+ readonly "__#184589@#code": number;
19
+ readonly "__#184589@#message": string;
20
+ readonly "__#184589@#data"?: Record<string, Json> | undefined;
21
+ readonly "__#184589@#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 "__#184531@#code": number;
33
- readonly "__#184531@#message": string;
34
- readonly "__#184531@#data"?: Record<string, Json> | undefined;
35
- readonly "__#184531@#stack"?: string | undefined;
32
+ readonly "__#184589@#code": number;
33
+ readonly "__#184589@#message": string;
34
+ readonly "__#184589@#data"?: Record<string, Json> | undefined;
35
+ readonly "__#184589@#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 "__#184531@#code": number;
47
- readonly "__#184531@#message": string;
48
- readonly "__#184531@#data"?: Record<string, Json> | undefined;
49
- readonly "__#184531@#stack"?: string | undefined;
46
+ readonly "__#184589@#code": number;
47
+ readonly "__#184589@#message": string;
48
+ readonly "__#184589@#data"?: Record<string, Json> | undefined;
49
+ readonly "__#184589@#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 "__#92267@#code": number;
19
- readonly "__#92267@#message": string;
20
- readonly "__#92267@#data"?: Record<string, Json> | undefined;
21
- readonly "__#92267@#stack"?: string | undefined;
18
+ readonly "__#92296@#code": number;
19
+ readonly "__#92296@#message": string;
20
+ readonly "__#92296@#data"?: Record<string, Json> | undefined;
21
+ readonly "__#92296@#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 "__#92267@#code": number;
33
- readonly "__#92267@#message": string;
34
- readonly "__#92267@#data"?: Record<string, Json> | undefined;
35
- readonly "__#92267@#stack"?: string | undefined;
32
+ readonly "__#92296@#code": number;
33
+ readonly "__#92296@#message": string;
34
+ readonly "__#92296@#data"?: Record<string, Json> | undefined;
35
+ readonly "__#92296@#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 "__#92267@#code": number;
47
- readonly "__#92267@#message": string;
48
- readonly "__#92267@#data"?: Record<string, Json> | undefined;
49
- readonly "__#92267@#stack"?: string | undefined;
46
+ readonly "__#92296@#code": number;
47
+ readonly "__#92296@#message": string;
48
+ readonly "__#92296@#data"?: Record<string, Json> | undefined;
49
+ readonly "__#92296@#stack"?: string | undefined;
50
50
  readonly name: string;
51
51
  readonly code: number;
52
52
  readonly message: string;
@@ -10,6 +10,7 @@ const TYPE = 'Avatar';
10
10
  *
11
11
  * @param props - The props of the component.
12
12
  * @param props.address - The address to display. This should be a valid CAIP-10 address.
13
+ * @param props.size - The size of the avatar. Can be `sm`, `md`, or `lg`. Defaults to `md`.
13
14
  * @returns An avatar element.
14
15
  * @example
15
16
  * <Avatar address="eip155:1:0x1234567890123456789012345678901234567890" />
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.cjs","sourceRoot":"","sources":["../../../src/jsx/components/Avatar.ts"],"names":[],"mappings":";;;AAEA,gDAAmD;AAYnD,MAAM,IAAI,GAAG,QAAQ,CAAC;AAEtB;;;;;;;;;;;;GAYG;AACU,QAAA,MAAM,GAAG,IAAA,+BAAmB,EAA2B,IAAI,CAAC,CAAC","sourcesContent":["import type { CaipAccountId } from '@metamask/utils';\n\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Avatar} component.\n *\n * @property address - The address to display. This should be a valid CAIP-10 address.\n */\nexport type AvatarProps = {\n address: CaipAccountId;\n size?: 'sm' | 'md' | 'lg' | undefined;\n};\n\nconst TYPE = 'Avatar';\n\n/**\n * An avatar component, which is used to display an avatar for a CAIP-10 address.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.address - The address to display. This should be a valid CAIP-10 address.\n * @returns An avatar element.\n * @example\n * <Avatar address=\"eip155:1:0x1234567890123456789012345678901234567890\" />\n * @example\n * <Avatar address=\"bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6\" />\n */\nexport const Avatar = createSnapComponent<AvatarProps, typeof TYPE>(TYPE);\n\n/**\n * An avatar element.\n *\n * @see Avatar\n */\nexport type AvatarElement = ReturnType<typeof Avatar>;\n"]}
1
+ {"version":3,"file":"Avatar.cjs","sourceRoot":"","sources":["../../../src/jsx/components/Avatar.ts"],"names":[],"mappings":";;;AAEA,gDAAmD;AAanD,MAAM,IAAI,GAAG,QAAQ,CAAC;AAEtB;;;;;;;;;;;;;GAaG;AACU,QAAA,MAAM,GAAG,IAAA,+BAAmB,EAA2B,IAAI,CAAC,CAAC","sourcesContent":["import type { CaipAccountId } from '@metamask/utils';\n\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Avatar} component.\n *\n * @property address - The address to display. This should be a valid CAIP-10 address.\n * @property size - The size of the avatar. Can be `sm`, `md`, or `lg`. Defaults to `md`.\n */\nexport type AvatarProps = {\n address: CaipAccountId;\n size?: 'sm' | 'md' | 'lg' | undefined;\n};\n\nconst TYPE = 'Avatar';\n\n/**\n * An avatar component, which is used to display an avatar for a CAIP-10 address.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.address - The address to display. This should be a valid CAIP-10 address.\n * @param props.size - The size of the avatar. Can be `sm`, `md`, or `lg`. Defaults to `md`.\n * @returns An avatar element.\n * @example\n * <Avatar address=\"eip155:1:0x1234567890123456789012345678901234567890\" />\n * @example\n * <Avatar address=\"bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6\" />\n */\nexport const Avatar = createSnapComponent<AvatarProps, typeof TYPE>(TYPE);\n\n/**\n * An avatar element.\n *\n * @see Avatar\n */\nexport type AvatarElement = ReturnType<typeof Avatar>;\n"]}
@@ -3,6 +3,7 @@ import type { CaipAccountId } from "@metamask/utils";
3
3
  * The props of the {@link Avatar} component.
4
4
  *
5
5
  * @property address - The address to display. This should be a valid CAIP-10 address.
6
+ * @property size - The size of the avatar. Can be `sm`, `md`, or `lg`. Defaults to `md`.
6
7
  */
7
8
  export type AvatarProps = {
8
9
  address: CaipAccountId;
@@ -15,6 +16,7 @@ export type AvatarProps = {
15
16
  *
16
17
  * @param props - The props of the component.
17
18
  * @param props.address - The address to display. This should be a valid CAIP-10 address.
19
+ * @param props.size - The size of the avatar. Can be `sm`, `md`, or `lg`. Defaults to `md`.
18
20
  * @returns An avatar element.
19
21
  * @example
20
22
  * <Avatar address="eip155:1:0x1234567890123456789012345678901234567890" />
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.cts","sourceRoot":"","sources":["../../../src/jsx/components/Avatar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAIrD;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAIF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,6DAAsD,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"Avatar.d.cts","sourceRoot":"","sources":["../../../src/jsx/components/Avatar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAIrD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAIF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM,6DAAsD,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
@@ -3,6 +3,7 @@ import type { CaipAccountId } from "@metamask/utils";
3
3
  * The props of the {@link Avatar} component.
4
4
  *
5
5
  * @property address - The address to display. This should be a valid CAIP-10 address.
6
+ * @property size - The size of the avatar. Can be `sm`, `md`, or `lg`. Defaults to `md`.
6
7
  */
7
8
  export type AvatarProps = {
8
9
  address: CaipAccountId;
@@ -15,6 +16,7 @@ export type AvatarProps = {
15
16
  *
16
17
  * @param props - The props of the component.
17
18
  * @param props.address - The address to display. This should be a valid CAIP-10 address.
19
+ * @param props.size - The size of the avatar. Can be `sm`, `md`, or `lg`. Defaults to `md`.
18
20
  * @returns An avatar element.
19
21
  * @example
20
22
  * <Avatar address="eip155:1:0x1234567890123456789012345678901234567890" />
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.mts","sourceRoot":"","sources":["../../../src/jsx/components/Avatar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAIrD;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAIF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,6DAAsD,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"Avatar.d.mts","sourceRoot":"","sources":["../../../src/jsx/components/Avatar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAIrD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAIF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM,6DAAsD,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
@@ -7,6 +7,7 @@ const TYPE = 'Avatar';
7
7
  *
8
8
  * @param props - The props of the component.
9
9
  * @param props.address - The address to display. This should be a valid CAIP-10 address.
10
+ * @param props.size - The size of the avatar. Can be `sm`, `md`, or `lg`. Defaults to `md`.
10
11
  * @returns An avatar element.
11
12
  * @example
12
13
  * <Avatar address="eip155:1:0x1234567890123456789012345678901234567890" />
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.mjs","sourceRoot":"","sources":["../../../src/jsx/components/Avatar.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,yBAAqB;AAYnD,MAAM,IAAI,GAAG,QAAQ,CAAC;AAEtB;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,mBAAmB,CAA2B,IAAI,CAAC,CAAC","sourcesContent":["import type { CaipAccountId } from '@metamask/utils';\n\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Avatar} component.\n *\n * @property address - The address to display. This should be a valid CAIP-10 address.\n */\nexport type AvatarProps = {\n address: CaipAccountId;\n size?: 'sm' | 'md' | 'lg' | undefined;\n};\n\nconst TYPE = 'Avatar';\n\n/**\n * An avatar component, which is used to display an avatar for a CAIP-10 address.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.address - The address to display. This should be a valid CAIP-10 address.\n * @returns An avatar element.\n * @example\n * <Avatar address=\"eip155:1:0x1234567890123456789012345678901234567890\" />\n * @example\n * <Avatar address=\"bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6\" />\n */\nexport const Avatar = createSnapComponent<AvatarProps, typeof TYPE>(TYPE);\n\n/**\n * An avatar element.\n *\n * @see Avatar\n */\nexport type AvatarElement = ReturnType<typeof Avatar>;\n"]}
1
+ {"version":3,"file":"Avatar.mjs","sourceRoot":"","sources":["../../../src/jsx/components/Avatar.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,yBAAqB;AAanD,MAAM,IAAI,GAAG,QAAQ,CAAC;AAEtB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,mBAAmB,CAA2B,IAAI,CAAC,CAAC","sourcesContent":["import type { CaipAccountId } from '@metamask/utils';\n\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Avatar} component.\n *\n * @property address - The address to display. This should be a valid CAIP-10 address.\n * @property size - The size of the avatar. Can be `sm`, `md`, or `lg`. Defaults to `md`.\n */\nexport type AvatarProps = {\n address: CaipAccountId;\n size?: 'sm' | 'md' | 'lg' | undefined;\n};\n\nconst TYPE = 'Avatar';\n\n/**\n * An avatar component, which is used to display an avatar for a CAIP-10 address.\n *\n * This component does not accept any children.\n *\n * @param props - The props of the component.\n * @param props.address - The address to display. This should be a valid CAIP-10 address.\n * @param props.size - The size of the avatar. Can be `sm`, `md`, or `lg`. Defaults to `md`.\n * @returns An avatar element.\n * @example\n * <Avatar address=\"eip155:1:0x1234567890123456789012345678901234567890\" />\n * @example\n * <Avatar address=\"bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6\" />\n */\nexport const Avatar = createSnapComponent<AvatarProps, typeof TYPE>(TYPE);\n\n/**\n * An avatar element.\n *\n * @see Avatar\n */\nexport type AvatarElement = ReturnType<typeof Avatar>;\n"]}
@@ -12,6 +12,7 @@ const TYPE = 'Checkbox';
12
12
  * @param props.checked - Whether the checkbox is checked or not.
13
13
  * @param props.label - An optional label for the checkbox.
14
14
  * @param props.variant - An optional variant for the checkbox.
15
+ * @param props.disabled - Whether the checkbox is disabled.
15
16
  * @returns A checkbox element.
16
17
  * @example
17
18
  * <Checkbox name="accept-terms" />
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Checkbox.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AAkBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;GAYG;AACU,QAAA,QAAQ,GAAG,IAAA,+BAAmB,EAA6B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Checkbox} component.\n *\n * @property name - The name of the checkbox. This is used to identify the\n * state in the form data.\n * @property checked - Whether the checkbox is checked or not.\n * @property label - An optional label for the checkbox.\n * @property variant - An optional variant for the checkbox.\n */\nexport type CheckboxProps = {\n name: string;\n checked?: boolean | undefined;\n label?: string | undefined;\n variant?: 'default' | 'toggle' | undefined;\n};\n\nconst TYPE = 'Checkbox';\n\n/**\n * A checkbox component, which is used to create a checkbox.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the checkbox. This is used to identify the\n * state in the form data.\n * @param props.checked - Whether the checkbox is checked or not.\n * @param props.label - An optional label for the checkbox.\n * @param props.variant - An optional variant for the checkbox.\n * @returns A checkbox element.\n * @example\n * <Checkbox name=\"accept-terms\" />\n */\nexport const Checkbox = createSnapComponent<CheckboxProps, typeof TYPE>(TYPE);\n\n/**\n * A checkbox element.\n *\n * @see Checkbox\n */\nexport type CheckboxElement = ReturnType<typeof Checkbox>;\n"]}
1
+ {"version":3,"file":"Checkbox.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Checkbox.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AAoBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;GAaG;AACU,QAAA,QAAQ,GAAG,IAAA,+BAAmB,EAA6B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Checkbox} component.\n *\n * @property name - The name of the checkbox. This is used to identify the\n * state in the form data.\n * @property checked - Whether the checkbox is checked or not.\n * @property label - An optional label for the checkbox.\n * @property variant - An optional variant for the checkbox.\n * @property disabled - Whether the checkbox is disabled.\n */\nexport type CheckboxProps = {\n name: string;\n checked?: boolean | undefined;\n label?: string | undefined;\n variant?: 'default' | 'toggle' | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Checkbox';\n\n/**\n * A checkbox component, which is used to create a checkbox.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the checkbox. This is used to identify the\n * state in the form data.\n * @param props.checked - Whether the checkbox is checked or not.\n * @param props.label - An optional label for the checkbox.\n * @param props.variant - An optional variant for the checkbox.\n * @param props.disabled - Whether the checkbox is disabled.\n * @returns A checkbox element.\n * @example\n * <Checkbox name=\"accept-terms\" />\n */\nexport const Checkbox = createSnapComponent<CheckboxProps, typeof TYPE>(TYPE);\n\n/**\n * A checkbox element.\n *\n * @see Checkbox\n */\nexport type CheckboxElement = ReturnType<typeof Checkbox>;\n"]}
@@ -6,12 +6,14 @@
6
6
  * @property checked - Whether the checkbox is checked or not.
7
7
  * @property label - An optional label for the checkbox.
8
8
  * @property variant - An optional variant for the checkbox.
9
+ * @property disabled - Whether the checkbox is disabled.
9
10
  */
10
11
  export type CheckboxProps = {
11
12
  name: string;
12
13
  checked?: boolean | undefined;
13
14
  label?: string | undefined;
14
15
  variant?: 'default' | 'toggle' | undefined;
16
+ disabled?: boolean | undefined;
15
17
  };
16
18
  /**
17
19
  * A checkbox component, which is used to create a checkbox.
@@ -22,6 +24,7 @@ export type CheckboxProps = {
22
24
  * @param props.checked - Whether the checkbox is checked or not.
23
25
  * @param props.label - An optional label for the checkbox.
24
26
  * @param props.variant - An optional variant for the checkbox.
27
+ * @param props.disabled - Whether the checkbox is disabled.
25
28
  * @returns A checkbox element.
26
29
  * @example
27
30
  * <Checkbox name="accept-terms" />
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Checkbox.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC5C,CAAC;AAIF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"Checkbox.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Checkbox.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
@@ -6,12 +6,14 @@
6
6
  * @property checked - Whether the checkbox is checked or not.
7
7
  * @property label - An optional label for the checkbox.
8
8
  * @property variant - An optional variant for the checkbox.
9
+ * @property disabled - Whether the checkbox is disabled.
9
10
  */
10
11
  export type CheckboxProps = {
11
12
  name: string;
12
13
  checked?: boolean | undefined;
13
14
  label?: string | undefined;
14
15
  variant?: 'default' | 'toggle' | undefined;
16
+ disabled?: boolean | undefined;
15
17
  };
16
18
  /**
17
19
  * A checkbox component, which is used to create a checkbox.
@@ -22,6 +24,7 @@ export type CheckboxProps = {
22
24
  * @param props.checked - Whether the checkbox is checked or not.
23
25
  * @param props.label - An optional label for the checkbox.
24
26
  * @param props.variant - An optional variant for the checkbox.
27
+ * @param props.disabled - Whether the checkbox is disabled.
25
28
  * @returns A checkbox element.
26
29
  * @example
27
30
  * <Checkbox name="accept-terms" />
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Checkbox.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC5C,CAAC;AAIF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"Checkbox.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Checkbox.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
@@ -9,6 +9,7 @@ const TYPE = 'Checkbox';
9
9
  * @param props.checked - Whether the checkbox is checked or not.
10
10
  * @param props.label - An optional label for the checkbox.
11
11
  * @param props.variant - An optional variant for the checkbox.
12
+ * @param props.disabled - Whether the checkbox is disabled.
12
13
  * @returns A checkbox element.
13
14
  * @example
14
15
  * <Checkbox name="accept-terms" />
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAkBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,mBAAmB,CAA6B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Checkbox} component.\n *\n * @property name - The name of the checkbox. This is used to identify the\n * state in the form data.\n * @property checked - Whether the checkbox is checked or not.\n * @property label - An optional label for the checkbox.\n * @property variant - An optional variant for the checkbox.\n */\nexport type CheckboxProps = {\n name: string;\n checked?: boolean | undefined;\n label?: string | undefined;\n variant?: 'default' | 'toggle' | undefined;\n};\n\nconst TYPE = 'Checkbox';\n\n/**\n * A checkbox component, which is used to create a checkbox.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the checkbox. This is used to identify the\n * state in the form data.\n * @param props.checked - Whether the checkbox is checked or not.\n * @param props.label - An optional label for the checkbox.\n * @param props.variant - An optional variant for the checkbox.\n * @returns A checkbox element.\n * @example\n * <Checkbox name=\"accept-terms\" />\n */\nexport const Checkbox = createSnapComponent<CheckboxProps, typeof TYPE>(TYPE);\n\n/**\n * A checkbox element.\n *\n * @see Checkbox\n */\nexport type CheckboxElement = ReturnType<typeof Checkbox>;\n"]}
1
+ {"version":3,"file":"Checkbox.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAoBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,mBAAmB,CAA6B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Checkbox} component.\n *\n * @property name - The name of the checkbox. This is used to identify the\n * state in the form data.\n * @property checked - Whether the checkbox is checked or not.\n * @property label - An optional label for the checkbox.\n * @property variant - An optional variant for the checkbox.\n * @property disabled - Whether the checkbox is disabled.\n */\nexport type CheckboxProps = {\n name: string;\n checked?: boolean | undefined;\n label?: string | undefined;\n variant?: 'default' | 'toggle' | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Checkbox';\n\n/**\n * A checkbox component, which is used to create a checkbox.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the checkbox. This is used to identify the\n * state in the form data.\n * @param props.checked - Whether the checkbox is checked or not.\n * @param props.label - An optional label for the checkbox.\n * @param props.variant - An optional variant for the checkbox.\n * @param props.disabled - Whether the checkbox is disabled.\n * @returns A checkbox element.\n * @example\n * <Checkbox name=\"accept-terms\" />\n */\nexport const Checkbox = createSnapComponent<CheckboxProps, typeof TYPE>(TYPE);\n\n/**\n * A checkbox element.\n *\n * @see Checkbox\n */\nexport type CheckboxElement = ReturnType<typeof Checkbox>;\n"]}
@@ -11,6 +11,7 @@ const TYPE = 'Dropdown';
11
11
  * state in the form data.
12
12
  * @param props.value - The selected value of the dropdown.
13
13
  * @param props.children - The children of the dropdown.
14
+ * @param props.disabled - Whether the dropdown is disabled.
14
15
  * @returns A dropdown element.
15
16
  * @example
16
17
  * <Dropdown name="dropdown">
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":";;;AACA,mDAAsD;AAiBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;;;GAeG;AACU,QAAA,QAAQ,GAAG,IAAA,+BAAmB,EAA6B,IAAI,CAAC,CAAC","sourcesContent":["import type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { OptionElement } from './Option';\n\n/**\n * The props of the {@link Dropdown} component.\n *\n * @property name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @property value - The selected value of the dropdown.\n * @property children - The children of the dropdown.\n */\nexport type DropdownProps = {\n name: string;\n value?: string | undefined;\n children: SnapsChildren<OptionElement>;\n};\n\nconst TYPE = 'Dropdown';\n\n/**\n * A dropdown component, which is used to create a dropdown.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the dropdown field. This is used to identify the\n * state in the form data.\n * @param props.value - The selected value of the dropdown.\n * @param props.children - The children of the dropdown.\n * @returns A dropdown element.\n * @example\n * <Dropdown name=\"dropdown\">\n * <Option value=\"option1\">Option 1</Option>\n * <Option value=\"option2\">Option 2</Option>\n * <Option value=\"option3\">Option 3</Option>\n * </Dropdown>\n */\nexport const Dropdown = createSnapComponent<DropdownProps, typeof TYPE>(TYPE);\n\n/**\n * A dropdown element.\n *\n * @see Dropdown\n */\nexport type DropdownElement = ReturnType<typeof Dropdown>;\n"]}
1
+ {"version":3,"file":"Dropdown.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":";;;AACA,mDAAsD;AAmBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,QAAQ,GAAG,IAAA,+BAAmB,EAA6B,IAAI,CAAC,CAAC","sourcesContent":["import type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { OptionElement } from './Option';\n\n/**\n * The props of the {@link Dropdown} component.\n *\n * @property name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @property value - The selected value of the dropdown.\n * @property children - The children of the dropdown.\n * @property disabled - Whether the dropdown is disabled.\n */\nexport type DropdownProps = {\n name: string;\n value?: string | undefined;\n children: SnapsChildren<OptionElement>;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Dropdown';\n\n/**\n * A dropdown component, which is used to create a dropdown.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the dropdown field. This is used to identify the\n * state in the form data.\n * @param props.value - The selected value of the dropdown.\n * @param props.children - The children of the dropdown.\n * @param props.disabled - Whether the dropdown is disabled.\n * @returns A dropdown element.\n * @example\n * <Dropdown name=\"dropdown\">\n * <Option value=\"option1\">Option 1</Option>\n * <Option value=\"option2\">Option 2</Option>\n * <Option value=\"option3\">Option 3</Option>\n * </Dropdown>\n */\nexport const Dropdown = createSnapComponent<DropdownProps, typeof TYPE>(TYPE);\n\n/**\n * A dropdown element.\n *\n * @see Dropdown\n */\nexport type DropdownElement = ReturnType<typeof Dropdown>;\n"]}
@@ -7,11 +7,13 @@ import type { OptionElement } from "./Option.cjs";
7
7
  * state in the form data.
8
8
  * @property value - The selected value of the dropdown.
9
9
  * @property children - The children of the dropdown.
10
+ * @property disabled - Whether the dropdown is disabled.
10
11
  */
11
12
  export type DropdownProps = {
12
13
  name: string;
13
14
  value?: string | undefined;
14
15
  children: SnapsChildren<OptionElement>;
16
+ disabled?: boolean | undefined;
15
17
  };
16
18
  /**
17
19
  * A dropdown component, which is used to create a dropdown.
@@ -21,6 +23,7 @@ export type DropdownProps = {
21
23
  * state in the form data.
22
24
  * @param props.value - The selected value of the dropdown.
23
25
  * @param props.children - The children of the dropdown.
26
+ * @param props.disabled - Whether the dropdown is disabled.
24
27
  * @returns A dropdown element.
25
28
  * @example
26
29
  * <Dropdown name="dropdown">
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAE9C;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CACxC,CAAC;AAIF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"Dropdown.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAE9C;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
@@ -7,11 +7,13 @@ import type { OptionElement } from "./Option.mjs";
7
7
  * state in the form data.
8
8
  * @property value - The selected value of the dropdown.
9
9
  * @property children - The children of the dropdown.
10
+ * @property disabled - Whether the dropdown is disabled.
10
11
  */
11
12
  export type DropdownProps = {
12
13
  name: string;
13
14
  value?: string | undefined;
14
15
  children: SnapsChildren<OptionElement>;
16
+ disabled?: boolean | undefined;
15
17
  };
16
18
  /**
17
19
  * A dropdown component, which is used to create a dropdown.
@@ -21,6 +23,7 @@ export type DropdownProps = {
21
23
  * state in the form data.
22
24
  * @param props.value - The selected value of the dropdown.
23
25
  * @param props.children - The children of the dropdown.
26
+ * @param props.disabled - Whether the dropdown is disabled.
24
27
  * @returns A dropdown element.
25
28
  * @example
26
29
  * <Dropdown name="dropdown">
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAE9C;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CACxC,CAAC;AAIF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"Dropdown.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAE9C;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
@@ -8,6 +8,7 @@ const TYPE = 'Dropdown';
8
8
  * state in the form data.
9
9
  * @param props.value - The selected value of the dropdown.
10
10
  * @param props.children - The children of the dropdown.
11
+ * @param props.disabled - Whether the dropdown is disabled.
11
12
  * @returns A dropdown element.
12
13
  * @example
13
14
  * <Dropdown name="dropdown">
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAiBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,mBAAmB,CAA6B,IAAI,CAAC,CAAC","sourcesContent":["import type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { OptionElement } from './Option';\n\n/**\n * The props of the {@link Dropdown} component.\n *\n * @property name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @property value - The selected value of the dropdown.\n * @property children - The children of the dropdown.\n */\nexport type DropdownProps = {\n name: string;\n value?: string | undefined;\n children: SnapsChildren<OptionElement>;\n};\n\nconst TYPE = 'Dropdown';\n\n/**\n * A dropdown component, which is used to create a dropdown.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the dropdown field. This is used to identify the\n * state in the form data.\n * @param props.value - The selected value of the dropdown.\n * @param props.children - The children of the dropdown.\n * @returns A dropdown element.\n * @example\n * <Dropdown name=\"dropdown\">\n * <Option value=\"option1\">Option 1</Option>\n * <Option value=\"option2\">Option 2</Option>\n * <Option value=\"option3\">Option 3</Option>\n * </Dropdown>\n */\nexport const Dropdown = createSnapComponent<DropdownProps, typeof TYPE>(TYPE);\n\n/**\n * A dropdown element.\n *\n * @see Dropdown\n */\nexport type DropdownElement = ReturnType<typeof Dropdown>;\n"]}
1
+ {"version":3,"file":"Dropdown.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAmBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,mBAAmB,CAA6B,IAAI,CAAC,CAAC","sourcesContent":["import type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { OptionElement } from './Option';\n\n/**\n * The props of the {@link Dropdown} component.\n *\n * @property name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @property value - The selected value of the dropdown.\n * @property children - The children of the dropdown.\n * @property disabled - Whether the dropdown is disabled.\n */\nexport type DropdownProps = {\n name: string;\n value?: string | undefined;\n children: SnapsChildren<OptionElement>;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Dropdown';\n\n/**\n * A dropdown component, which is used to create a dropdown.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the dropdown field. This is used to identify the\n * state in the form data.\n * @param props.value - The selected value of the dropdown.\n * @param props.children - The children of the dropdown.\n * @param props.disabled - Whether the dropdown is disabled.\n * @returns A dropdown element.\n * @example\n * <Dropdown name=\"dropdown\">\n * <Option value=\"option1\">Option 1</Option>\n * <Option value=\"option2\">Option 2</Option>\n * <Option value=\"option3\">Option 3</Option>\n * </Dropdown>\n */\nexport const Dropdown = createSnapComponent<DropdownProps, typeof TYPE>(TYPE);\n\n/**\n * A dropdown element.\n *\n * @see Dropdown\n */\nexport type DropdownElement = ReturnType<typeof Dropdown>;\n"]}
@@ -17,6 +17,7 @@ const TYPE = 'FileInput';
17
17
  * valid values, see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept).
18
18
  * @param props.compact - Whether the file input field is compact. Default is
19
19
  * `false`.
20
+ * @param props.disabled - Whether the file input is disabled.
20
21
  * @returns A file input element.
21
22
  * @example
22
23
  * <FileInput name="file" accept={['image/*']} />
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/FileInput.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AAmBtD,MAAM,IAAI,GAAG,WAAW,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACU,QAAA,SAAS,GAAG,IAAA,+BAAmB,EAA8B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link FileInput} component.\n *\n * @property name - The name of the file input field. This is used to identify\n * the file input field in the form data.\n * @property label - The label of the file input field.\n * @property accept - The file types that the file input field accepts. If not\n * specified, the file input field accepts all file types.\n * @property compact - Whether the file input field is compact. Default is\n * `false`.\n */\nexport type FileInputProps = {\n name: string;\n accept?: string[] | undefined;\n compact?: boolean | undefined;\n};\n\nconst TYPE = 'FileInput';\n\n/**\n * A file input component, which is used to create a file input field. This\n * component can only be used as a child of the {@link Field} component.\n *\n * The total size of the files that can be uploaded may not exceed 64 MB.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the file input field. This is used to\n * identify the file input field in the form data.\n * @param props.accept - The file types that the file input field accepts. If\n * not specified, the file input field accepts all file types. For examples of\n * valid values, see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept).\n * @param props.compact - Whether the file input field is compact. Default is\n * `false`.\n * @returns A file input element.\n * @example\n * <FileInput name=\"file\" accept={['image/*']} />\n * @example\n * <FileInput name=\"file\" compact />\n * @example\n * <Field label=\"Upload file\">\n * <FileInput name=\"file\" />\n * </Field>\n */\nexport const FileInput = createSnapComponent<FileInputProps, typeof TYPE>(TYPE);\n\n/**\n * A file input element.\n *\n * @see FileInput\n */\nexport type FileInputElement = ReturnType<typeof FileInput>;\n"]}
1
+ {"version":3,"file":"FileInput.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/FileInput.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AAqBtD,MAAM,IAAI,GAAG,WAAW,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACU,QAAA,SAAS,GAAG,IAAA,+BAAmB,EAA8B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link FileInput} component.\n *\n * @property name - The name of the file input field. This is used to identify\n * the file input field in the form data.\n * @property label - The label of the file input field.\n * @property accept - The file types that the file input field accepts. If not\n * specified, the file input field accepts all file types.\n * @property compact - Whether the file input field is compact. Default is\n * `false`.\n * @property disabled - whether the file input is disabled.\n */\nexport type FileInputProps = {\n name: string;\n accept?: string[] | undefined;\n compact?: boolean | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'FileInput';\n\n/**\n * A file input component, which is used to create a file input field. This\n * component can only be used as a child of the {@link Field} component.\n *\n * The total size of the files that can be uploaded may not exceed 64 MB.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the file input field. This is used to\n * identify the file input field in the form data.\n * @param props.accept - The file types that the file input field accepts. If\n * not specified, the file input field accepts all file types. For examples of\n * valid values, see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept).\n * @param props.compact - Whether the file input field is compact. Default is\n * `false`.\n * @param props.disabled - Whether the file input is disabled.\n * @returns A file input element.\n * @example\n * <FileInput name=\"file\" accept={['image/*']} />\n * @example\n * <FileInput name=\"file\" compact />\n * @example\n * <Field label=\"Upload file\">\n * <FileInput name=\"file\" />\n * </Field>\n */\nexport const FileInput = createSnapComponent<FileInputProps, typeof TYPE>(TYPE);\n\n/**\n * A file input element.\n *\n * @see FileInput\n */\nexport type FileInputElement = ReturnType<typeof FileInput>;\n"]}
@@ -8,11 +8,13 @@
8
8
  * specified, the file input field accepts all file types.
9
9
  * @property compact - Whether the file input field is compact. Default is
10
10
  * `false`.
11
+ * @property disabled - whether the file input is disabled.
11
12
  */
12
13
  export type FileInputProps = {
13
14
  name: string;
14
15
  accept?: string[] | undefined;
15
16
  compact?: boolean | undefined;
17
+ disabled?: boolean | undefined;
16
18
  };
17
19
  /**
18
20
  * A file input component, which is used to create a file input field. This
@@ -28,6 +30,7 @@ export type FileInputProps = {
28
30
  * valid values, see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept).
29
31
  * @param props.compact - Whether the file input field is compact. Default is
30
32
  * `false`.
33
+ * @param props.disabled - Whether the file input is disabled.
31
34
  * @returns A file input element.
32
35
  * @example
33
36
  * <FileInput name="file" accept={['image/*']} />
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/FileInput.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,SAAS,sEAAyD,CAAC;AAEhF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"FileInput.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/FileInput.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,SAAS,sEAAyD,CAAC;AAEhF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
@@ -8,11 +8,13 @@
8
8
  * specified, the file input field accepts all file types.
9
9
  * @property compact - Whether the file input field is compact. Default is
10
10
  * `false`.
11
+ * @property disabled - whether the file input is disabled.
11
12
  */
12
13
  export type FileInputProps = {
13
14
  name: string;
14
15
  accept?: string[] | undefined;
15
16
  compact?: boolean | undefined;
17
+ disabled?: boolean | undefined;
16
18
  };
17
19
  /**
18
20
  * A file input component, which is used to create a file input field. This
@@ -28,6 +30,7 @@ export type FileInputProps = {
28
30
  * valid values, see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept).
29
31
  * @param props.compact - Whether the file input field is compact. Default is
30
32
  * `false`.
33
+ * @param props.disabled - Whether the file input is disabled.
31
34
  * @returns A file input element.
32
35
  * @example
33
36
  * <FileInput name="file" accept={['image/*']} />
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/FileInput.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,SAAS,sEAAyD,CAAC;AAEhF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"FileInput.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/FileInput.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,SAAS,sEAAyD,CAAC;AAEhF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
@@ -14,6 +14,7 @@ const TYPE = 'FileInput';
14
14
  * valid values, see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept).
15
15
  * @param props.compact - Whether the file input field is compact. Default is
16
16
  * `false`.
17
+ * @param props.disabled - Whether the file input is disabled.
17
18
  * @returns A file input element.
18
19
  * @example
19
20
  * <FileInput name="file" accept={['image/*']} />
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/FileInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAmBtD,MAAM,IAAI,GAAG,WAAW,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAA8B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link FileInput} component.\n *\n * @property name - The name of the file input field. This is used to identify\n * the file input field in the form data.\n * @property label - The label of the file input field.\n * @property accept - The file types that the file input field accepts. If not\n * specified, the file input field accepts all file types.\n * @property compact - Whether the file input field is compact. Default is\n * `false`.\n */\nexport type FileInputProps = {\n name: string;\n accept?: string[] | undefined;\n compact?: boolean | undefined;\n};\n\nconst TYPE = 'FileInput';\n\n/**\n * A file input component, which is used to create a file input field. This\n * component can only be used as a child of the {@link Field} component.\n *\n * The total size of the files that can be uploaded may not exceed 64 MB.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the file input field. This is used to\n * identify the file input field in the form data.\n * @param props.accept - The file types that the file input field accepts. If\n * not specified, the file input field accepts all file types. For examples of\n * valid values, see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept).\n * @param props.compact - Whether the file input field is compact. Default is\n * `false`.\n * @returns A file input element.\n * @example\n * <FileInput name=\"file\" accept={['image/*']} />\n * @example\n * <FileInput name=\"file\" compact />\n * @example\n * <Field label=\"Upload file\">\n * <FileInput name=\"file\" />\n * </Field>\n */\nexport const FileInput = createSnapComponent<FileInputProps, typeof TYPE>(TYPE);\n\n/**\n * A file input element.\n *\n * @see FileInput\n */\nexport type FileInputElement = ReturnType<typeof FileInput>;\n"]}
1
+ {"version":3,"file":"FileInput.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/FileInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAqBtD,MAAM,IAAI,GAAG,WAAW,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAA8B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link FileInput} component.\n *\n * @property name - The name of the file input field. This is used to identify\n * the file input field in the form data.\n * @property label - The label of the file input field.\n * @property accept - The file types that the file input field accepts. If not\n * specified, the file input field accepts all file types.\n * @property compact - Whether the file input field is compact. Default is\n * `false`.\n * @property disabled - whether the file input is disabled.\n */\nexport type FileInputProps = {\n name: string;\n accept?: string[] | undefined;\n compact?: boolean | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'FileInput';\n\n/**\n * A file input component, which is used to create a file input field. This\n * component can only be used as a child of the {@link Field} component.\n *\n * The total size of the files that can be uploaded may not exceed 64 MB.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the file input field. This is used to\n * identify the file input field in the form data.\n * @param props.accept - The file types that the file input field accepts. If\n * not specified, the file input field accepts all file types. For examples of\n * valid values, see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept).\n * @param props.compact - Whether the file input field is compact. Default is\n * `false`.\n * @param props.disabled - Whether the file input is disabled.\n * @returns A file input element.\n * @example\n * <FileInput name=\"file\" accept={['image/*']} />\n * @example\n * <FileInput name=\"file\" compact />\n * @example\n * <Field label=\"Upload file\">\n * <FileInput name=\"file\" />\n * </Field>\n */\nexport const FileInput = createSnapComponent<FileInputProps, typeof TYPE>(TYPE);\n\n/**\n * A file input element.\n *\n * @see FileInput\n */\nexport type FileInputElement = ReturnType<typeof FileInput>;\n"]}
@@ -18,6 +18,7 @@ const TYPE = 'Input';
18
18
  * Only applicable to the type `number` input.
19
19
  * @param props.step - The step value of the input field.
20
20
  * Only applicable to the type `number` input.
21
+ * @param props.disabled - Whether the input is disabled.
21
22
  * @returns An input element.
22
23
  * @example
23
24
  * <Input name="username" type="text" />
@@ -1 +1 @@
1
- {"version":3,"file":"Input.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Input.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AA0CtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;GAoBG;AACU,QAAA,KAAK,GAAG,IAAA,+BAAmB,EAA0B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n// TODO: Add the `onChange` prop to the `InputProps` type.\n\nexport type GenericInputProps = {\n name: string;\n value?: string | undefined;\n placeholder?: string | undefined;\n};\n\nexport type TextInputProps = { type: 'text' } & GenericInputProps;\n\nexport type PasswordInputProps = { type: 'password' } & GenericInputProps;\n\nexport type NumberInputProps = {\n type: 'number';\n min?: number;\n max?: number;\n step?: number;\n} & GenericInputProps;\n\n/**\n * The props of the {@link Input} component.\n *\n * @property name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @property type - The type of the input field. Defaults to `text`.\n * @property value - The value of the input field.\n * @property placeholder - The placeholder text of the input field.\n * @property min - The minimum value of the input field.\n * Only applicable to the type `number` input.\n * @property max - The maximum value of the input field.\n * Only applicable to the type `number` input.\n * @property step - The step value of the input field.\n * Only applicable to the type `number` input.\n */\nexport type InputProps =\n | GenericInputProps\n | TextInputProps\n | PasswordInputProps\n | NumberInputProps;\n\nconst TYPE = 'Input';\n\n/**\n * An input component, which is used to create an input field.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @param props.type - The type of the input field.\n * @param props.value - The value of the input field.\n * @param props.placeholder - The placeholder text of the input field.\n * @param props.min - The minimum value of the input field.\n * Only applicable to the type `number` input.\n * @param props.max - The maximum value of the input field.\n * Only applicable to the type `number` input.\n * @param props.step - The step value of the input field.\n * Only applicable to the type `number` input.\n * @returns An input element.\n * @example\n * <Input name=\"username\" type=\"text\" />\n * @example\n * <Input name=\"numeric\" type=\"number\" min={1} max={100} step={1} />\n */\nexport const Input = createSnapComponent<InputProps, typeof TYPE>(TYPE);\n\n/**\n * An input element.\n *\n * @see Input\n */\nexport type InputElement = ReturnType<typeof Input>;\n"]}
1
+ {"version":3,"file":"Input.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Input.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AA2CtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACU,QAAA,KAAK,GAAG,IAAA,+BAAmB,EAA0B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n// TODO: Add the `onChange` prop to the `InputProps` type.\n\nexport type GenericInputProps = {\n name: string;\n value?: string | undefined;\n placeholder?: string | undefined;\n disabled?: boolean | undefined;\n};\n\nexport type TextInputProps = { type: 'text' } & GenericInputProps;\n\nexport type PasswordInputProps = { type: 'password' } & GenericInputProps;\n\nexport type NumberInputProps = {\n type: 'number';\n min?: number;\n max?: number;\n step?: number;\n} & GenericInputProps;\n\n/**\n * The props of the {@link Input} component.\n *\n * @property name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @property type - The type of the input field. Defaults to `text`.\n * @property value - The value of the input field.\n * @property placeholder - The placeholder text of the input field.\n * @property min - The minimum value of the input field.\n * Only applicable to the type `number` input.\n * @property max - The maximum value of the input field.\n * Only applicable to the type `number` input.\n * @property step - The step value of the input field.\n * Only applicable to the type `number` input.\n */\nexport type InputProps =\n | GenericInputProps\n | TextInputProps\n | PasswordInputProps\n | NumberInputProps;\n\nconst TYPE = 'Input';\n\n/**\n * An input component, which is used to create an input field.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @param props.type - The type of the input field.\n * @param props.value - The value of the input field.\n * @param props.placeholder - The placeholder text of the input field.\n * @param props.min - The minimum value of the input field.\n * Only applicable to the type `number` input.\n * @param props.max - The maximum value of the input field.\n * Only applicable to the type `number` input.\n * @param props.step - The step value of the input field.\n * Only applicable to the type `number` input.\n * @param props.disabled - Whether the input is disabled.\n * @returns An input element.\n * @example\n * <Input name=\"username\" type=\"text\" />\n * @example\n * <Input name=\"numeric\" type=\"number\" min={1} max={100} step={1} />\n */\nexport const Input = createSnapComponent<InputProps, typeof TYPE>(TYPE);\n\n/**\n * An input element.\n *\n * @see Input\n */\nexport type InputElement = ReturnType<typeof Input>;\n"]}
@@ -2,6 +2,7 @@ export type GenericInputProps = {
2
2
  name: string;
3
3
  value?: string | undefined;
4
4
  placeholder?: string | undefined;
5
+ disabled?: boolean | undefined;
5
6
  };
6
7
  export type TextInputProps = {
7
8
  type: 'text';
@@ -46,6 +47,7 @@ export type InputProps = GenericInputProps | TextInputProps | PasswordInputProps
46
47
  * Only applicable to the type `number` input.
47
48
  * @param props.step - The step value of the input field.
48
49
  * Only applicable to the type `number` input.
50
+ * @param props.disabled - Whether the input is disabled.
49
51
  * @returns An input element.
50
52
  * @example
51
53
  * <Input name="username" type="text" />
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Input.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAAC;AAElE,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,iBAAiB,CAAC;AAE1E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,iBAAiB,CAAC;AAEtB;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,cAAc,GACd,kBAAkB,GAClB,gBAAgB,CAAC;AAIrB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"Input.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Input.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAAC;AAElE,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,iBAAiB,CAAC;AAE1E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,iBAAiB,CAAC;AAEtB;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,cAAc,GACd,kBAAkB,GAClB,gBAAgB,CAAC;AAIrB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
@@ -2,6 +2,7 @@ export type GenericInputProps = {
2
2
  name: string;
3
3
  value?: string | undefined;
4
4
  placeholder?: string | undefined;
5
+ disabled?: boolean | undefined;
5
6
  };
6
7
  export type TextInputProps = {
7
8
  type: 'text';
@@ -46,6 +47,7 @@ export type InputProps = GenericInputProps | TextInputProps | PasswordInputProps
46
47
  * Only applicable to the type `number` input.
47
48
  * @param props.step - The step value of the input field.
48
49
  * Only applicable to the type `number` input.
50
+ * @param props.disabled - Whether the input is disabled.
49
51
  * @returns An input element.
50
52
  * @example
51
53
  * <Input name="username" type="text" />
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Input.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAAC;AAElE,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,iBAAiB,CAAC;AAE1E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,iBAAiB,CAAC;AAEtB;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,cAAc,GACd,kBAAkB,GAClB,gBAAgB,CAAC;AAIrB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"Input.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Input.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAAC;AAElE,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,iBAAiB,CAAC;AAE1E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,iBAAiB,CAAC;AAEtB;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,cAAc,GACd,kBAAkB,GAClB,gBAAgB,CAAC;AAIrB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
@@ -15,6 +15,7 @@ const TYPE = 'Input';
15
15
  * Only applicable to the type `number` input.
16
16
  * @param props.step - The step value of the input field.
17
17
  * Only applicable to the type `number` input.
18
+ * @param props.disabled - Whether the input is disabled.
18
19
  * @returns An input element.
19
20
  * @example
20
21
  * <Input name="username" type="text" />
@@ -1 +1 @@
1
- {"version":3,"file":"Input.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AA0CtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,mBAAmB,CAA0B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n// TODO: Add the `onChange` prop to the `InputProps` type.\n\nexport type GenericInputProps = {\n name: string;\n value?: string | undefined;\n placeholder?: string | undefined;\n};\n\nexport type TextInputProps = { type: 'text' } & GenericInputProps;\n\nexport type PasswordInputProps = { type: 'password' } & GenericInputProps;\n\nexport type NumberInputProps = {\n type: 'number';\n min?: number;\n max?: number;\n step?: number;\n} & GenericInputProps;\n\n/**\n * The props of the {@link Input} component.\n *\n * @property name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @property type - The type of the input field. Defaults to `text`.\n * @property value - The value of the input field.\n * @property placeholder - The placeholder text of the input field.\n * @property min - The minimum value of the input field.\n * Only applicable to the type `number` input.\n * @property max - The maximum value of the input field.\n * Only applicable to the type `number` input.\n * @property step - The step value of the input field.\n * Only applicable to the type `number` input.\n */\nexport type InputProps =\n | GenericInputProps\n | TextInputProps\n | PasswordInputProps\n | NumberInputProps;\n\nconst TYPE = 'Input';\n\n/**\n * An input component, which is used to create an input field.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @param props.type - The type of the input field.\n * @param props.value - The value of the input field.\n * @param props.placeholder - The placeholder text of the input field.\n * @param props.min - The minimum value of the input field.\n * Only applicable to the type `number` input.\n * @param props.max - The maximum value of the input field.\n * Only applicable to the type `number` input.\n * @param props.step - The step value of the input field.\n * Only applicable to the type `number` input.\n * @returns An input element.\n * @example\n * <Input name=\"username\" type=\"text\" />\n * @example\n * <Input name=\"numeric\" type=\"number\" min={1} max={100} step={1} />\n */\nexport const Input = createSnapComponent<InputProps, typeof TYPE>(TYPE);\n\n/**\n * An input element.\n *\n * @see Input\n */\nexport type InputElement = ReturnType<typeof Input>;\n"]}
1
+ {"version":3,"file":"Input.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AA2CtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,mBAAmB,CAA0B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n// TODO: Add the `onChange` prop to the `InputProps` type.\n\nexport type GenericInputProps = {\n name: string;\n value?: string | undefined;\n placeholder?: string | undefined;\n disabled?: boolean | undefined;\n};\n\nexport type TextInputProps = { type: 'text' } & GenericInputProps;\n\nexport type PasswordInputProps = { type: 'password' } & GenericInputProps;\n\nexport type NumberInputProps = {\n type: 'number';\n min?: number;\n max?: number;\n step?: number;\n} & GenericInputProps;\n\n/**\n * The props of the {@link Input} component.\n *\n * @property name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @property type - The type of the input field. Defaults to `text`.\n * @property value - The value of the input field.\n * @property placeholder - The placeholder text of the input field.\n * @property min - The minimum value of the input field.\n * Only applicable to the type `number` input.\n * @property max - The maximum value of the input field.\n * Only applicable to the type `number` input.\n * @property step - The step value of the input field.\n * Only applicable to the type `number` input.\n */\nexport type InputProps =\n | GenericInputProps\n | TextInputProps\n | PasswordInputProps\n | NumberInputProps;\n\nconst TYPE = 'Input';\n\n/**\n * An input component, which is used to create an input field.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the input field. This is used to identify the\n * input field in the form data.\n * @param props.type - The type of the input field.\n * @param props.value - The value of the input field.\n * @param props.placeholder - The placeholder text of the input field.\n * @param props.min - The minimum value of the input field.\n * Only applicable to the type `number` input.\n * @param props.max - The maximum value of the input field.\n * Only applicable to the type `number` input.\n * @param props.step - The step value of the input field.\n * Only applicable to the type `number` input.\n * @param props.disabled - Whether the input is disabled.\n * @returns An input element.\n * @example\n * <Input name=\"username\" type=\"text\" />\n * @example\n * <Input name=\"numeric\" type=\"number\" min={1} max={100} step={1} />\n */\nexport const Input = createSnapComponent<InputProps, typeof TYPE>(TYPE);\n\n/**\n * An input element.\n *\n * @see Input\n */\nexport type InputElement = ReturnType<typeof Input>;\n"]}
@@ -13,6 +13,7 @@ const TYPE = 'Option';
13
13
  * @param props.value - The value of the dropdown option. This is used to populate the
14
14
  * state in the form data.
15
15
  * @param props.children - The text to display.
16
+ * @param props.disabled - Whether the option is disabled.
16
17
  * @returns A dropdown option element.
17
18
  * @example
18
19
  * <Dropdown name="dropdown">