@metamask/snaps-sdk 6.8.0 → 6.10.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.
- package/CHANGELOG.md +29 -1
- package/dist/error-wrappers.d.cts +192 -192
- package/dist/error-wrappers.d.mts +192 -192
- package/dist/internals/error-wrappers.d.cts +12 -12
- package/dist/internals/error-wrappers.d.mts +12 -12
- package/dist/jsx/components/Address.cjs +7 -0
- package/dist/jsx/components/Address.cjs.map +1 -1
- package/dist/jsx/components/Address.d.cts +13 -0
- package/dist/jsx/components/Address.d.cts.map +1 -1
- package/dist/jsx/components/Address.d.mts +13 -0
- package/dist/jsx/components/Address.d.mts.map +1 -1
- package/dist/jsx/components/Address.mjs +7 -0
- package/dist/jsx/components/Address.mjs.map +1 -1
- package/dist/jsx/components/Avatar.cjs +20 -0
- package/dist/jsx/components/Avatar.cjs.map +1 -0
- package/dist/jsx/components/Avatar.d.cts +31 -0
- package/dist/jsx/components/Avatar.d.cts.map +1 -0
- package/dist/jsx/components/Avatar.d.mts +31 -0
- package/dist/jsx/components/Avatar.d.mts.map +1 -0
- package/dist/jsx/components/Avatar.mjs +17 -0
- package/dist/jsx/components/Avatar.mjs.map +1 -0
- package/dist/jsx/components/Heading.cjs +1 -1
- package/dist/jsx/components/Heading.cjs.map +1 -1
- package/dist/jsx/components/Heading.d.cts +3 -3
- package/dist/jsx/components/Heading.d.cts.map +1 -1
- package/dist/jsx/components/Heading.d.mts +3 -3
- package/dist/jsx/components/Heading.d.mts.map +1 -1
- package/dist/jsx/components/Heading.mjs +1 -1
- package/dist/jsx/components/Heading.mjs.map +1 -1
- package/dist/jsx/components/form/Input.cjs +8 -0
- package/dist/jsx/components/form/Input.cjs.map +1 -1
- package/dist/jsx/components/form/Input.d.cts +32 -6
- package/dist/jsx/components/form/Input.d.cts.map +1 -1
- package/dist/jsx/components/form/Input.d.mts +32 -6
- package/dist/jsx/components/form/Input.d.mts.map +1 -1
- package/dist/jsx/components/form/Input.mjs +8 -0
- package/dist/jsx/components/form/Input.mjs.map +1 -1
- package/dist/jsx/components/index.cjs +1 -0
- package/dist/jsx/components/index.cjs.map +1 -1
- package/dist/jsx/components/index.d.cts +3 -1
- package/dist/jsx/components/index.d.cts.map +1 -1
- package/dist/jsx/components/index.d.mts +3 -1
- package/dist/jsx/components/index.d.mts.map +1 -1
- package/dist/jsx/components/index.mjs +1 -0
- package/dist/jsx/components/index.mjs.map +1 -1
- package/dist/jsx/index.cjs +1 -2
- package/dist/jsx/index.cjs.map +1 -1
- package/dist/jsx/index.d.cts +1 -1
- package/dist/jsx/index.d.cts.map +1 -1
- package/dist/jsx/index.d.mts +1 -1
- package/dist/jsx/index.d.mts.map +1 -1
- package/dist/jsx/index.mjs +1 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/validation.cjs +70 -36
- package/dist/jsx/validation.cjs.map +1 -1
- package/dist/jsx/validation.d.cts +70 -15
- package/dist/jsx/validation.d.cts.map +1 -1
- package/dist/jsx/validation.d.mts +70 -15
- package/dist/jsx/validation.d.mts.map +1 -1
- package/dist/jsx/validation.mjs +69 -36
- package/dist/jsx/validation.mjs.map +1 -1
- package/dist/types/global.cjs.map +1 -1
- package/dist/types/global.d.cts.map +1 -1
- package/dist/types/global.d.mts.map +1 -1
- package/dist/types/global.mjs.map +1 -1
- package/dist/types/images.cjs.map +1 -1
- package/dist/types/images.d.cts.map +1 -1
- package/dist/types/images.d.mts.map +1 -1
- package/dist/types/images.mjs.map +1 -1
- package/dist/types/interface.d.cts +2 -2
- package/dist/types/interface.d.mts +2 -2
- package/dist/types/methods/methods.cjs.map +1 -1
- package/dist/types/methods/methods.d.cts +2 -0
- package/dist/types/methods/methods.d.cts.map +1 -1
- package/dist/types/methods/methods.d.mts +2 -0
- package/dist/types/methods/methods.d.mts.map +1 -1
- package/dist/types/methods/methods.mjs.map +1 -1
- package/dist/types/methods/notify.cjs.map +1 -1
- package/dist/types/methods/notify.d.cts +2 -21
- package/dist/types/methods/notify.d.cts.map +1 -1
- package/dist/types/methods/notify.d.mts +2 -21
- package/dist/types/methods/notify.d.mts.map +1 -1
- package/dist/types/methods/notify.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -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 "__#
|
|
19
|
-
readonly "__#
|
|
20
|
-
readonly "__#
|
|
21
|
-
readonly "__#
|
|
18
|
+
readonly "__#182149@#code": number;
|
|
19
|
+
readonly "__#182149@#message": string;
|
|
20
|
+
readonly "__#182149@#data"?: Record<string, Json> | undefined;
|
|
21
|
+
readonly "__#182149@#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 "__#
|
|
33
|
-
readonly "__#
|
|
34
|
-
readonly "__#
|
|
35
|
-
readonly "__#
|
|
32
|
+
readonly "__#182149@#code": number;
|
|
33
|
+
readonly "__#182149@#message": string;
|
|
34
|
+
readonly "__#182149@#data"?: Record<string, Json> | undefined;
|
|
35
|
+
readonly "__#182149@#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 "__#
|
|
47
|
-
readonly "__#
|
|
48
|
-
readonly "__#
|
|
49
|
-
readonly "__#
|
|
46
|
+
readonly "__#182149@#code": number;
|
|
47
|
+
readonly "__#182149@#message": string;
|
|
48
|
+
readonly "__#182149@#data"?: Record<string, Json> | undefined;
|
|
49
|
+
readonly "__#182149@#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 "__#
|
|
19
|
-
readonly "__#
|
|
20
|
-
readonly "__#
|
|
21
|
-
readonly "__#
|
|
18
|
+
readonly "__#91076@#code": number;
|
|
19
|
+
readonly "__#91076@#message": string;
|
|
20
|
+
readonly "__#91076@#data"?: Record<string, Json> | undefined;
|
|
21
|
+
readonly "__#91076@#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 "__#
|
|
33
|
-
readonly "__#
|
|
34
|
-
readonly "__#
|
|
35
|
-
readonly "__#
|
|
32
|
+
readonly "__#91076@#code": number;
|
|
33
|
+
readonly "__#91076@#message": string;
|
|
34
|
+
readonly "__#91076@#data"?: Record<string, Json> | undefined;
|
|
35
|
+
readonly "__#91076@#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 "__#
|
|
47
|
-
readonly "__#
|
|
48
|
-
readonly "__#
|
|
49
|
-
readonly "__#
|
|
46
|
+
readonly "__#91076@#code": number;
|
|
47
|
+
readonly "__#91076@#message": string;
|
|
48
|
+
readonly "__#91076@#data"?: Record<string, Json> | undefined;
|
|
49
|
+
readonly "__#91076@#stack"?: string | undefined;
|
|
50
50
|
readonly name: string;
|
|
51
51
|
readonly code: number;
|
|
52
52
|
readonly message: string;
|
|
@@ -11,6 +11,9 @@ const TYPE = 'Address';
|
|
|
11
11
|
* @param props - The props of the component.
|
|
12
12
|
* @param props.address - The address to display. This should be a
|
|
13
13
|
* valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.
|
|
14
|
+
* @param props.truncate - Whether to truncate the address. Defaults to `true`.
|
|
15
|
+
* @param props.displayName - Whether to show the account name. Defaults to `false`.
|
|
16
|
+
* @param props.avatar - Whether to show the address avatar. Defaults to `true`.
|
|
14
17
|
* @returns An address element.
|
|
15
18
|
* @example
|
|
16
19
|
* <Address address="0x1234567890123456789012345678901234567890" />
|
|
@@ -18,6 +21,10 @@ const TYPE = 'Address';
|
|
|
18
21
|
* <Address address="eip155:1:0x1234567890123456789012345678901234567890" />
|
|
19
22
|
* @example
|
|
20
23
|
* <Address address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
|
|
24
|
+
* @example
|
|
25
|
+
* <Address address="0x1234567890123456789012345678901234567890" truncate={false} avatar={false} />
|
|
26
|
+
* @example
|
|
27
|
+
* <Address address="0x1234567890123456789012345678901234567890" displayName={true} />
|
|
21
28
|
*/
|
|
22
29
|
exports.Address = (0, component_1.createSnapComponent)(TYPE);
|
|
23
30
|
//# sourceMappingURL=Address.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Address.cjs","sourceRoot":"","sources":["../../../src/jsx/components/Address.ts"],"names":[],"mappings":";;;AAEA,gDAAmD;
|
|
1
|
+
{"version":3,"file":"Address.cjs","sourceRoot":"","sources":["../../../src/jsx/components/Address.ts"],"names":[],"mappings":";;;AAEA,gDAAmD;AAkBnD,MAAM,IAAI,GAAG,SAAS,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACU,QAAA,OAAO,GAAG,IAAA,+BAAmB,EAA4B,IAAI,CAAC,CAAC","sourcesContent":["import type { CaipAccountId } from '@metamask/utils';\n\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Address} component.\n *\n * @property address - The (Ethereum) address to display. This should be a\n * valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.\n * @property truncate - Whether to truncate the address. Defaults to `true`.\n * @property displayName - Whether to show the account name. Defaults to `false`.\n * @property avatar - Whether to show the address avatar. Defaults to `true`.\n */\nexport type AddressProps = {\n address: `0x${string}` | CaipAccountId;\n truncate?: boolean | undefined;\n displayName?: boolean | undefined;\n avatar?: boolean | undefined;\n};\n\nconst TYPE = 'Address';\n\n/**\n * An address component, which is used to display a CAIP-10 address or a Ethereum 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\n * valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.\n * @param props.truncate - Whether to truncate the address. Defaults to `true`.\n * @param props.displayName - Whether to show the account name. Defaults to `false`.\n * @param props.avatar - Whether to show the address avatar. Defaults to `true`.\n * @returns An address element.\n * @example\n * <Address address=\"0x1234567890123456789012345678901234567890\" />\n * @example\n * <Address address=\"eip155:1:0x1234567890123456789012345678901234567890\" />\n * @example\n * <Address address=\"bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6\" />\n * @example\n * <Address address=\"0x1234567890123456789012345678901234567890\" truncate={false} avatar={false} />\n * @example\n * <Address address=\"0x1234567890123456789012345678901234567890\" displayName={true} />\n */\nexport const Address = createSnapComponent<AddressProps, typeof TYPE>(TYPE);\n\n/**\n * An address element.\n *\n * @see Address\n */\nexport type AddressElement = ReturnType<typeof Address>;\n"]}
|
|
@@ -4,9 +4,15 @@ import type { CaipAccountId } from "@metamask/utils";
|
|
|
4
4
|
*
|
|
5
5
|
* @property address - The (Ethereum) address to display. This should be a
|
|
6
6
|
* valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.
|
|
7
|
+
* @property truncate - Whether to truncate the address. Defaults to `true`.
|
|
8
|
+
* @property displayName - Whether to show the account name. Defaults to `false`.
|
|
9
|
+
* @property avatar - Whether to show the address avatar. Defaults to `true`.
|
|
7
10
|
*/
|
|
8
11
|
export type AddressProps = {
|
|
9
12
|
address: `0x${string}` | CaipAccountId;
|
|
13
|
+
truncate?: boolean | undefined;
|
|
14
|
+
displayName?: boolean | undefined;
|
|
15
|
+
avatar?: boolean | undefined;
|
|
10
16
|
};
|
|
11
17
|
/**
|
|
12
18
|
* An address component, which is used to display a CAIP-10 address or a Ethereum address.
|
|
@@ -16,6 +22,9 @@ export type AddressProps = {
|
|
|
16
22
|
* @param props - The props of the component.
|
|
17
23
|
* @param props.address - The address to display. This should be a
|
|
18
24
|
* valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.
|
|
25
|
+
* @param props.truncate - Whether to truncate the address. Defaults to `true`.
|
|
26
|
+
* @param props.displayName - Whether to show the account name. Defaults to `false`.
|
|
27
|
+
* @param props.avatar - Whether to show the address avatar. Defaults to `true`.
|
|
19
28
|
* @returns An address element.
|
|
20
29
|
* @example
|
|
21
30
|
* <Address address="0x1234567890123456789012345678901234567890" />
|
|
@@ -23,6 +32,10 @@ export type AddressProps = {
|
|
|
23
32
|
* <Address address="eip155:1:0x1234567890123456789012345678901234567890" />
|
|
24
33
|
* @example
|
|
25
34
|
* <Address address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
|
|
35
|
+
* @example
|
|
36
|
+
* <Address address="0x1234567890123456789012345678901234567890" truncate={false} avatar={false} />
|
|
37
|
+
* @example
|
|
38
|
+
* <Address address="0x1234567890123456789012345678901234567890" displayName={true} />
|
|
26
39
|
*/
|
|
27
40
|
export declare const Address: import("../component.cjs").SnapComponent<AddressProps, "Address">;
|
|
28
41
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Address.d.cts","sourceRoot":"","sources":["../../../src/jsx/components/Address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAIrD
|
|
1
|
+
{"version":3,"file":"Address.d.cts","sourceRoot":"","sources":["../../../src/jsx/components/Address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAIrD;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,KAAK,MAAM,EAAE,GAAG,aAAa,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,OAAO,+DAAuD,CAAC;AAE5E;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -4,9 +4,15 @@ import type { CaipAccountId } from "@metamask/utils";
|
|
|
4
4
|
*
|
|
5
5
|
* @property address - The (Ethereum) address to display. This should be a
|
|
6
6
|
* valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.
|
|
7
|
+
* @property truncate - Whether to truncate the address. Defaults to `true`.
|
|
8
|
+
* @property displayName - Whether to show the account name. Defaults to `false`.
|
|
9
|
+
* @property avatar - Whether to show the address avatar. Defaults to `true`.
|
|
7
10
|
*/
|
|
8
11
|
export type AddressProps = {
|
|
9
12
|
address: `0x${string}` | CaipAccountId;
|
|
13
|
+
truncate?: boolean | undefined;
|
|
14
|
+
displayName?: boolean | undefined;
|
|
15
|
+
avatar?: boolean | undefined;
|
|
10
16
|
};
|
|
11
17
|
/**
|
|
12
18
|
* An address component, which is used to display a CAIP-10 address or a Ethereum address.
|
|
@@ -16,6 +22,9 @@ export type AddressProps = {
|
|
|
16
22
|
* @param props - The props of the component.
|
|
17
23
|
* @param props.address - The address to display. This should be a
|
|
18
24
|
* valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.
|
|
25
|
+
* @param props.truncate - Whether to truncate the address. Defaults to `true`.
|
|
26
|
+
* @param props.displayName - Whether to show the account name. Defaults to `false`.
|
|
27
|
+
* @param props.avatar - Whether to show the address avatar. Defaults to `true`.
|
|
19
28
|
* @returns An address element.
|
|
20
29
|
* @example
|
|
21
30
|
* <Address address="0x1234567890123456789012345678901234567890" />
|
|
@@ -23,6 +32,10 @@ export type AddressProps = {
|
|
|
23
32
|
* <Address address="eip155:1:0x1234567890123456789012345678901234567890" />
|
|
24
33
|
* @example
|
|
25
34
|
* <Address address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
|
|
35
|
+
* @example
|
|
36
|
+
* <Address address="0x1234567890123456789012345678901234567890" truncate={false} avatar={false} />
|
|
37
|
+
* @example
|
|
38
|
+
* <Address address="0x1234567890123456789012345678901234567890" displayName={true} />
|
|
26
39
|
*/
|
|
27
40
|
export declare const Address: import("../component.mjs").SnapComponent<AddressProps, "Address">;
|
|
28
41
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Address.d.mts","sourceRoot":"","sources":["../../../src/jsx/components/Address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAIrD
|
|
1
|
+
{"version":3,"file":"Address.d.mts","sourceRoot":"","sources":["../../../src/jsx/components/Address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAIrD;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,KAAK,MAAM,EAAE,GAAG,aAAa,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,OAAO,+DAAuD,CAAC;AAE5E;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -8,6 +8,9 @@ const TYPE = 'Address';
|
|
|
8
8
|
* @param props - The props of the component.
|
|
9
9
|
* @param props.address - The address to display. This should be a
|
|
10
10
|
* valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.
|
|
11
|
+
* @param props.truncate - Whether to truncate the address. Defaults to `true`.
|
|
12
|
+
* @param props.displayName - Whether to show the account name. Defaults to `false`.
|
|
13
|
+
* @param props.avatar - Whether to show the address avatar. Defaults to `true`.
|
|
11
14
|
* @returns An address element.
|
|
12
15
|
* @example
|
|
13
16
|
* <Address address="0x1234567890123456789012345678901234567890" />
|
|
@@ -15,6 +18,10 @@ const TYPE = 'Address';
|
|
|
15
18
|
* <Address address="eip155:1:0x1234567890123456789012345678901234567890" />
|
|
16
19
|
* @example
|
|
17
20
|
* <Address address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
|
|
21
|
+
* @example
|
|
22
|
+
* <Address address="0x1234567890123456789012345678901234567890" truncate={false} avatar={false} />
|
|
23
|
+
* @example
|
|
24
|
+
* <Address address="0x1234567890123456789012345678901234567890" displayName={true} />
|
|
18
25
|
*/
|
|
19
26
|
export const Address = createSnapComponent(TYPE);
|
|
20
27
|
//# sourceMappingURL=Address.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Address.mjs","sourceRoot":"","sources":["../../../src/jsx/components/Address.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,yBAAqB;
|
|
1
|
+
{"version":3,"file":"Address.mjs","sourceRoot":"","sources":["../../../src/jsx/components/Address.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,yBAAqB;AAkBnD,MAAM,IAAI,GAAG,SAAS,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAA4B,IAAI,CAAC,CAAC","sourcesContent":["import type { CaipAccountId } from '@metamask/utils';\n\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Address} component.\n *\n * @property address - The (Ethereum) address to display. This should be a\n * valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.\n * @property truncate - Whether to truncate the address. Defaults to `true`.\n * @property displayName - Whether to show the account name. Defaults to `false`.\n * @property avatar - Whether to show the address avatar. Defaults to `true`.\n */\nexport type AddressProps = {\n address: `0x${string}` | CaipAccountId;\n truncate?: boolean | undefined;\n displayName?: boolean | undefined;\n avatar?: boolean | undefined;\n};\n\nconst TYPE = 'Address';\n\n/**\n * An address component, which is used to display a CAIP-10 address or a Ethereum 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\n * valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.\n * @param props.truncate - Whether to truncate the address. Defaults to `true`.\n * @param props.displayName - Whether to show the account name. Defaults to `false`.\n * @param props.avatar - Whether to show the address avatar. Defaults to `true`.\n * @returns An address element.\n * @example\n * <Address address=\"0x1234567890123456789012345678901234567890\" />\n * @example\n * <Address address=\"eip155:1:0x1234567890123456789012345678901234567890\" />\n * @example\n * <Address address=\"bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6\" />\n * @example\n * <Address address=\"0x1234567890123456789012345678901234567890\" truncate={false} avatar={false} />\n * @example\n * <Address address=\"0x1234567890123456789012345678901234567890\" displayName={true} />\n */\nexport const Address = createSnapComponent<AddressProps, typeof TYPE>(TYPE);\n\n/**\n * An address element.\n *\n * @see Address\n */\nexport type AddressElement = ReturnType<typeof Address>;\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Avatar = void 0;
|
|
4
|
+
const component_1 = require("../component.cjs");
|
|
5
|
+
const TYPE = 'Avatar';
|
|
6
|
+
/**
|
|
7
|
+
* An avatar component, which is used to display an avatar for a CAIP-10 address.
|
|
8
|
+
*
|
|
9
|
+
* This component does not accept any children.
|
|
10
|
+
*
|
|
11
|
+
* @param props - The props of the component.
|
|
12
|
+
* @param props.address - The address to display. This should be a valid CAIP-10 address.
|
|
13
|
+
* @returns An avatar element.
|
|
14
|
+
* @example
|
|
15
|
+
* <Avatar address="eip155:1:0x1234567890123456789012345678901234567890" />
|
|
16
|
+
* @example
|
|
17
|
+
* <Avatar address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
|
|
18
|
+
*/
|
|
19
|
+
exports.Avatar = (0, component_1.createSnapComponent)(TYPE);
|
|
20
|
+
//# sourceMappingURL=Avatar.cjs.map
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CaipAccountId } from "@metamask/utils";
|
|
2
|
+
/**
|
|
3
|
+
* The props of the {@link Avatar} component.
|
|
4
|
+
*
|
|
5
|
+
* @property address - The address to display. This should be a valid CAIP-10 address.
|
|
6
|
+
*/
|
|
7
|
+
export type AvatarProps = {
|
|
8
|
+
address: CaipAccountId;
|
|
9
|
+
size?: 'sm' | 'md' | 'lg' | undefined;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* An avatar component, which is used to display an avatar for a CAIP-10 address.
|
|
13
|
+
*
|
|
14
|
+
* This component does not accept any children.
|
|
15
|
+
*
|
|
16
|
+
* @param props - The props of the component.
|
|
17
|
+
* @param props.address - The address to display. This should be a valid CAIP-10 address.
|
|
18
|
+
* @returns An avatar element.
|
|
19
|
+
* @example
|
|
20
|
+
* <Avatar address="eip155:1:0x1234567890123456789012345678901234567890" />
|
|
21
|
+
* @example
|
|
22
|
+
* <Avatar address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
|
|
23
|
+
*/
|
|
24
|
+
export declare const Avatar: import("../component.cjs").SnapComponent<AvatarProps, "Avatar">;
|
|
25
|
+
/**
|
|
26
|
+
* An avatar element.
|
|
27
|
+
*
|
|
28
|
+
* @see Avatar
|
|
29
|
+
*/
|
|
30
|
+
export type AvatarElement = ReturnType<typeof Avatar>;
|
|
31
|
+
//# sourceMappingURL=Avatar.d.cts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CaipAccountId } from "@metamask/utils";
|
|
2
|
+
/**
|
|
3
|
+
* The props of the {@link Avatar} component.
|
|
4
|
+
*
|
|
5
|
+
* @property address - The address to display. This should be a valid CAIP-10 address.
|
|
6
|
+
*/
|
|
7
|
+
export type AvatarProps = {
|
|
8
|
+
address: CaipAccountId;
|
|
9
|
+
size?: 'sm' | 'md' | 'lg' | undefined;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* An avatar component, which is used to display an avatar for a CAIP-10 address.
|
|
13
|
+
*
|
|
14
|
+
* This component does not accept any children.
|
|
15
|
+
*
|
|
16
|
+
* @param props - The props of the component.
|
|
17
|
+
* @param props.address - The address to display. This should be a valid CAIP-10 address.
|
|
18
|
+
* @returns An avatar element.
|
|
19
|
+
* @example
|
|
20
|
+
* <Avatar address="eip155:1:0x1234567890123456789012345678901234567890" />
|
|
21
|
+
* @example
|
|
22
|
+
* <Avatar address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
|
|
23
|
+
*/
|
|
24
|
+
export declare const Avatar: import("../component.mjs").SnapComponent<AvatarProps, "Avatar">;
|
|
25
|
+
/**
|
|
26
|
+
* An avatar element.
|
|
27
|
+
*
|
|
28
|
+
* @see Avatar
|
|
29
|
+
*/
|
|
30
|
+
export type AvatarElement = ReturnType<typeof Avatar>;
|
|
31
|
+
//# sourceMappingURL=Avatar.d.mts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createSnapComponent } from "../component.mjs";
|
|
2
|
+
const TYPE = 'Avatar';
|
|
3
|
+
/**
|
|
4
|
+
* An avatar component, which is used to display an avatar for a CAIP-10 address.
|
|
5
|
+
*
|
|
6
|
+
* This component does not accept any children.
|
|
7
|
+
*
|
|
8
|
+
* @param props - The props of the component.
|
|
9
|
+
* @param props.address - The address to display. This should be a valid CAIP-10 address.
|
|
10
|
+
* @returns An avatar element.
|
|
11
|
+
* @example
|
|
12
|
+
* <Avatar address="eip155:1:0x1234567890123456789012345678901234567890" />
|
|
13
|
+
* @example
|
|
14
|
+
* <Avatar address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
|
|
15
|
+
*/
|
|
16
|
+
export const Avatar = createSnapComponent(TYPE);
|
|
17
|
+
//# sourceMappingURL=Avatar.mjs.map
|
|
@@ -0,0 +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"]}
|
|
@@ -8,7 +8,7 @@ const TYPE = 'Heading';
|
|
|
8
8
|
*
|
|
9
9
|
* @param props - The props of the component.
|
|
10
10
|
* @param props.children - The text to display in the heading.
|
|
11
|
-
* @param props.size - The size of the heading.
|
|
11
|
+
* @param props.size - The size of the heading. Defaults to `sm`.
|
|
12
12
|
* @returns A heading element.
|
|
13
13
|
* @example
|
|
14
14
|
* <Heading>Hello world!</Heading>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.cjs","sourceRoot":"","sources":["../../../src/jsx/components/Heading.ts"],"names":[],"mappings":";;;AACA,gDAAmD;AAanD,MAAM,IAAI,GAAG,SAAS,CAAC;AAEvB;;;;;;;;;;;GAWG;AACU,QAAA,OAAO,GAAG,IAAA,+BAAmB,EAA4B,IAAI,CAAC,CAAC","sourcesContent":["import type { StringElement } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Heading} component.\n *\n * @property children - The text to display in the heading.\n * @property size - The size of the heading
|
|
1
|
+
{"version":3,"file":"Heading.cjs","sourceRoot":"","sources":["../../../src/jsx/components/Heading.ts"],"names":[],"mappings":";;;AACA,gDAAmD;AAanD,MAAM,IAAI,GAAG,SAAS,CAAC;AAEvB;;;;;;;;;;;GAWG;AACU,QAAA,OAAO,GAAG,IAAA,+BAAmB,EAA4B,IAAI,CAAC,CAAC","sourcesContent":["import type { StringElement } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Heading} component.\n *\n * @property children - The text to display in the heading.\n * @property size - The size of the heading. Defaults to `sm`.\n */\ntype HeadingProps = {\n children: StringElement;\n size?: 'sm' | 'md' | 'lg' | undefined;\n};\n\nconst TYPE = 'Heading';\n\n/**\n * A heading component, which is used to display heading text.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in the heading.\n * @param props.size - The size of the heading. Defaults to `sm`.\n * @returns A heading element.\n * @example\n * <Heading>Hello world!</Heading>\n * @example\n * <Heading size=\"lg\">Hello world!</Heading>\n */\nexport const Heading = createSnapComponent<HeadingProps, typeof TYPE>(TYPE);\n\n/**\n * A heading element.\n *\n * @see Heading\n */\nexport type HeadingElement = ReturnType<typeof Heading>;\n"]}
|
|
@@ -3,18 +3,18 @@ import type { StringElement } from "../component.cjs";
|
|
|
3
3
|
* The props of the {@link Heading} component.
|
|
4
4
|
*
|
|
5
5
|
* @property children - The text to display in the heading.
|
|
6
|
-
* @property size - The size of the heading.
|
|
6
|
+
* @property size - The size of the heading. Defaults to `sm`.
|
|
7
7
|
*/
|
|
8
8
|
type HeadingProps = {
|
|
9
9
|
children: StringElement;
|
|
10
|
-
size?: 'md' | 'lg' | undefined;
|
|
10
|
+
size?: 'sm' | 'md' | 'lg' | undefined;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* A heading component, which is used to display heading text.
|
|
14
14
|
*
|
|
15
15
|
* @param props - The props of the component.
|
|
16
16
|
* @param props.children - The text to display in the heading.
|
|
17
|
-
* @param props.size - The size of the heading.
|
|
17
|
+
* @param props.size - The size of the heading. Defaults to `sm`.
|
|
18
18
|
* @returns A heading element.
|
|
19
19
|
* @example
|
|
20
20
|
* <Heading>Hello world!</Heading>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.cts","sourceRoot":"","sources":["../../../src/jsx/components/Heading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAqB;AAGlD;;;;;GAKG;AACH,KAAK,YAAY,GAAG;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Heading.d.cts","sourceRoot":"","sources":["../../../src/jsx/components/Heading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAqB;AAGlD;;;;;GAKG;AACH,KAAK,YAAY,GAAG;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAIF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,+DAAuD,CAAC;AAE5E;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -3,18 +3,18 @@ import type { StringElement } from "../component.mjs";
|
|
|
3
3
|
* The props of the {@link Heading} component.
|
|
4
4
|
*
|
|
5
5
|
* @property children - The text to display in the heading.
|
|
6
|
-
* @property size - The size of the heading.
|
|
6
|
+
* @property size - The size of the heading. Defaults to `sm`.
|
|
7
7
|
*/
|
|
8
8
|
type HeadingProps = {
|
|
9
9
|
children: StringElement;
|
|
10
|
-
size?: 'md' | 'lg' | undefined;
|
|
10
|
+
size?: 'sm' | 'md' | 'lg' | undefined;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* A heading component, which is used to display heading text.
|
|
14
14
|
*
|
|
15
15
|
* @param props - The props of the component.
|
|
16
16
|
* @param props.children - The text to display in the heading.
|
|
17
|
-
* @param props.size - The size of the heading.
|
|
17
|
+
* @param props.size - The size of the heading. Defaults to `sm`.
|
|
18
18
|
* @returns A heading element.
|
|
19
19
|
* @example
|
|
20
20
|
* <Heading>Hello world!</Heading>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.mts","sourceRoot":"","sources":["../../../src/jsx/components/Heading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAqB;AAGlD;;;;;GAKG;AACH,KAAK,YAAY,GAAG;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Heading.d.mts","sourceRoot":"","sources":["../../../src/jsx/components/Heading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAqB;AAGlD;;;;;GAKG;AACH,KAAK,YAAY,GAAG;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAIF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,+DAAuD,CAAC;AAE5E;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -5,7 +5,7 @@ const TYPE = 'Heading';
|
|
|
5
5
|
*
|
|
6
6
|
* @param props - The props of the component.
|
|
7
7
|
* @param props.children - The text to display in the heading.
|
|
8
|
-
* @param props.size - The size of the heading.
|
|
8
|
+
* @param props.size - The size of the heading. Defaults to `sm`.
|
|
9
9
|
* @returns A heading element.
|
|
10
10
|
* @example
|
|
11
11
|
* <Heading>Hello world!</Heading>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.mjs","sourceRoot":"","sources":["../../../src/jsx/components/Heading.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,yBAAqB;AAanD,MAAM,IAAI,GAAG,SAAS,CAAC;AAEvB;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAA4B,IAAI,CAAC,CAAC","sourcesContent":["import type { StringElement } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Heading} component.\n *\n * @property children - The text to display in the heading.\n * @property size - The size of the heading
|
|
1
|
+
{"version":3,"file":"Heading.mjs","sourceRoot":"","sources":["../../../src/jsx/components/Heading.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,yBAAqB;AAanD,MAAM,IAAI,GAAG,SAAS,CAAC;AAEvB;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAA4B,IAAI,CAAC,CAAC","sourcesContent":["import type { StringElement } from '../component';\nimport { createSnapComponent } from '../component';\n\n/**\n * The props of the {@link Heading} component.\n *\n * @property children - The text to display in the heading.\n * @property size - The size of the heading. Defaults to `sm`.\n */\ntype HeadingProps = {\n children: StringElement;\n size?: 'sm' | 'md' | 'lg' | undefined;\n};\n\nconst TYPE = 'Heading';\n\n/**\n * A heading component, which is used to display heading text.\n *\n * @param props - The props of the component.\n * @param props.children - The text to display in the heading.\n * @param props.size - The size of the heading. Defaults to `sm`.\n * @returns A heading element.\n * @example\n * <Heading>Hello world!</Heading>\n * @example\n * <Heading size=\"lg\">Hello world!</Heading>\n */\nexport const Heading = createSnapComponent<HeadingProps, typeof TYPE>(TYPE);\n\n/**\n * A heading element.\n *\n * @see Heading\n */\nexport type HeadingElement = ReturnType<typeof Heading>;\n"]}
|
|
@@ -12,9 +12,17 @@ const TYPE = 'Input';
|
|
|
12
12
|
* @param props.type - The type of the input field.
|
|
13
13
|
* @param props.value - The value of the input field.
|
|
14
14
|
* @param props.placeholder - The placeholder text of the input field.
|
|
15
|
+
* @param props.min - The minimum value of the input field.
|
|
16
|
+
* Only applicable to the type `number` input.
|
|
17
|
+
* @param props.max - The maximum value of the input field.
|
|
18
|
+
* Only applicable to the type `number` input.
|
|
19
|
+
* @param props.step - The step value of the input field.
|
|
20
|
+
* Only applicable to the type `number` input.
|
|
15
21
|
* @returns An input element.
|
|
16
22
|
* @example
|
|
17
23
|
* <Input name="username" type="text" />
|
|
24
|
+
* @example
|
|
25
|
+
* <Input name="numeric" type="number" min={1} max={100} step={1} />
|
|
18
26
|
*/
|
|
19
27
|
exports.Input = (0, component_1.createSnapComponent)(TYPE);
|
|
20
28
|
//# sourceMappingURL=Input.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Input.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;
|
|
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,3 +1,20 @@
|
|
|
1
|
+
export type GenericInputProps = {
|
|
2
|
+
name: string;
|
|
3
|
+
value?: string | undefined;
|
|
4
|
+
placeholder?: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
export type TextInputProps = {
|
|
7
|
+
type: 'text';
|
|
8
|
+
} & GenericInputProps;
|
|
9
|
+
export type PasswordInputProps = {
|
|
10
|
+
type: 'password';
|
|
11
|
+
} & GenericInputProps;
|
|
12
|
+
export type NumberInputProps = {
|
|
13
|
+
type: 'number';
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
step?: number;
|
|
17
|
+
} & GenericInputProps;
|
|
1
18
|
/**
|
|
2
19
|
* The props of the {@link Input} component.
|
|
3
20
|
*
|
|
@@ -6,13 +23,14 @@
|
|
|
6
23
|
* @property type - The type of the input field. Defaults to `text`.
|
|
7
24
|
* @property value - The value of the input field.
|
|
8
25
|
* @property placeholder - The placeholder text of the input field.
|
|
26
|
+
* @property min - The minimum value of the input field.
|
|
27
|
+
* Only applicable to the type `number` input.
|
|
28
|
+
* @property max - The maximum value of the input field.
|
|
29
|
+
* Only applicable to the type `number` input.
|
|
30
|
+
* @property step - The step value of the input field.
|
|
31
|
+
* Only applicable to the type `number` input.
|
|
9
32
|
*/
|
|
10
|
-
export type InputProps =
|
|
11
|
-
name: string;
|
|
12
|
-
type?: 'text' | 'password' | 'number' | undefined;
|
|
13
|
-
value?: string | undefined;
|
|
14
|
-
placeholder?: string | undefined;
|
|
15
|
-
};
|
|
33
|
+
export type InputProps = GenericInputProps | TextInputProps | PasswordInputProps | NumberInputProps;
|
|
16
34
|
/**
|
|
17
35
|
* An input component, which is used to create an input field.
|
|
18
36
|
*
|
|
@@ -22,9 +40,17 @@ export type InputProps = {
|
|
|
22
40
|
* @param props.type - The type of the input field.
|
|
23
41
|
* @param props.value - The value of the input field.
|
|
24
42
|
* @param props.placeholder - The placeholder text of the input field.
|
|
43
|
+
* @param props.min - The minimum value of the input field.
|
|
44
|
+
* Only applicable to the type `number` input.
|
|
45
|
+
* @param props.max - The maximum value of the input field.
|
|
46
|
+
* Only applicable to the type `number` input.
|
|
47
|
+
* @param props.step - The step value of the input field.
|
|
48
|
+
* Only applicable to the type `number` input.
|
|
25
49
|
* @returns An input element.
|
|
26
50
|
* @example
|
|
27
51
|
* <Input name="username" type="text" />
|
|
52
|
+
* @example
|
|
53
|
+
* <Input name="numeric" type="number" min={1} max={100} step={1} />
|
|
28
54
|
*/
|
|
29
55
|
export declare const Input: import("../../component.cjs").SnapComponent<InputProps, "Input">;
|
|
30
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Input.ts"],"names":[],"mappings":"AAIA
|
|
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,3 +1,20 @@
|
|
|
1
|
+
export type GenericInputProps = {
|
|
2
|
+
name: string;
|
|
3
|
+
value?: string | undefined;
|
|
4
|
+
placeholder?: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
export type TextInputProps = {
|
|
7
|
+
type: 'text';
|
|
8
|
+
} & GenericInputProps;
|
|
9
|
+
export type PasswordInputProps = {
|
|
10
|
+
type: 'password';
|
|
11
|
+
} & GenericInputProps;
|
|
12
|
+
export type NumberInputProps = {
|
|
13
|
+
type: 'number';
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
step?: number;
|
|
17
|
+
} & GenericInputProps;
|
|
1
18
|
/**
|
|
2
19
|
* The props of the {@link Input} component.
|
|
3
20
|
*
|
|
@@ -6,13 +23,14 @@
|
|
|
6
23
|
* @property type - The type of the input field. Defaults to `text`.
|
|
7
24
|
* @property value - The value of the input field.
|
|
8
25
|
* @property placeholder - The placeholder text of the input field.
|
|
26
|
+
* @property min - The minimum value of the input field.
|
|
27
|
+
* Only applicable to the type `number` input.
|
|
28
|
+
* @property max - The maximum value of the input field.
|
|
29
|
+
* Only applicable to the type `number` input.
|
|
30
|
+
* @property step - The step value of the input field.
|
|
31
|
+
* Only applicable to the type `number` input.
|
|
9
32
|
*/
|
|
10
|
-
export type InputProps =
|
|
11
|
-
name: string;
|
|
12
|
-
type?: 'text' | 'password' | 'number' | undefined;
|
|
13
|
-
value?: string | undefined;
|
|
14
|
-
placeholder?: string | undefined;
|
|
15
|
-
};
|
|
33
|
+
export type InputProps = GenericInputProps | TextInputProps | PasswordInputProps | NumberInputProps;
|
|
16
34
|
/**
|
|
17
35
|
* An input component, which is used to create an input field.
|
|
18
36
|
*
|
|
@@ -22,9 +40,17 @@ export type InputProps = {
|
|
|
22
40
|
* @param props.type - The type of the input field.
|
|
23
41
|
* @param props.value - The value of the input field.
|
|
24
42
|
* @param props.placeholder - The placeholder text of the input field.
|
|
43
|
+
* @param props.min - The minimum value of the input field.
|
|
44
|
+
* Only applicable to the type `number` input.
|
|
45
|
+
* @param props.max - The maximum value of the input field.
|
|
46
|
+
* Only applicable to the type `number` input.
|
|
47
|
+
* @param props.step - The step value of the input field.
|
|
48
|
+
* Only applicable to the type `number` input.
|
|
25
49
|
* @returns An input element.
|
|
26
50
|
* @example
|
|
27
51
|
* <Input name="username" type="text" />
|
|
52
|
+
* @example
|
|
53
|
+
* <Input name="numeric" type="number" min={1} max={100} step={1} />
|
|
28
54
|
*/
|
|
29
55
|
export declare const Input: import("../../component.mjs").SnapComponent<InputProps, "Input">;
|
|
30
56
|
/**
|