@metamask/snaps-sdk 6.18.0 → 6.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/internals/index.cjs +0 -1
- package/dist/internals/index.cjs.map +1 -1
- package/dist/internals/index.d.cts +1 -1
- package/dist/internals/index.d.cts.map +1 -1
- package/dist/internals/index.d.mts +1 -1
- package/dist/internals/index.d.mts.map +1 -1
- package/dist/internals/index.mjs +0 -1
- package/dist/internals/index.mjs.map +1 -1
- package/dist/internals/jsx.cjs.map +1 -1
- package/dist/internals/jsx.d.cts +2 -1
- package/dist/internals/jsx.d.cts.map +1 -1
- package/dist/internals/jsx.d.mts +2 -1
- package/dist/internals/jsx.d.mts.map +1 -1
- package/dist/internals/jsx.mjs.map +1 -1
- package/dist/jsx/components/Banner.cjs.map +1 -1
- package/dist/jsx/components/Banner.d.cts +1 -1
- package/dist/jsx/components/Banner.d.cts.map +1 -1
- package/dist/jsx/components/Banner.d.mts +1 -1
- package/dist/jsx/components/Banner.d.mts.map +1 -1
- package/dist/jsx/components/Banner.mjs.map +1 -1
- package/dist/jsx/components/Box.cjs +4 -0
- package/dist/jsx/components/Box.cjs.map +1 -1
- package/dist/jsx/components/Box.d.cts +5 -1
- package/dist/jsx/components/Box.d.cts.map +1 -1
- package/dist/jsx/components/Box.d.mts +5 -1
- package/dist/jsx/components/Box.d.mts.map +1 -1
- package/dist/jsx/components/Box.mjs +4 -0
- package/dist/jsx/components/Box.mjs.map +1 -1
- package/dist/jsx/components/Card.cjs.map +1 -1
- package/dist/jsx/components/Card.d.cts.map +1 -1
- package/dist/jsx/components/Card.d.mts.map +1 -1
- package/dist/jsx/components/Card.mjs.map +1 -1
- package/dist/jsx/components/Container.cjs.map +1 -1
- package/dist/jsx/components/Container.d.cts +1 -1
- package/dist/jsx/components/Container.d.cts.map +1 -1
- package/dist/jsx/components/Container.d.mts +1 -1
- package/dist/jsx/components/Container.d.mts.map +1 -1
- package/dist/jsx/components/Container.mjs.map +1 -1
- package/dist/jsx/components/Footer.cjs.map +1 -1
- package/dist/jsx/components/Footer.d.cts.map +1 -1
- package/dist/jsx/components/Footer.d.mts.map +1 -1
- package/dist/jsx/components/Footer.mjs.map +1 -1
- package/dist/jsx/components/Image.cjs.map +1 -1
- package/dist/jsx/components/Image.d.cts.map +1 -1
- package/dist/jsx/components/Image.d.mts.map +1 -1
- package/dist/jsx/components/Image.mjs.map +1 -1
- package/dist/jsx/components/Link.cjs.map +1 -1
- package/dist/jsx/components/Link.d.cts +1 -1
- package/dist/jsx/components/Link.d.cts.map +1 -1
- package/dist/jsx/components/Link.d.mts +1 -1
- package/dist/jsx/components/Link.d.mts.map +1 -1
- package/dist/jsx/components/Link.mjs.map +1 -1
- package/dist/jsx/components/Row.cjs.map +1 -1
- package/dist/jsx/components/Row.d.cts.map +1 -1
- package/dist/jsx/components/Row.d.mts.map +1 -1
- package/dist/jsx/components/Row.mjs.map +1 -1
- package/dist/jsx/components/Skeleton.cjs.map +1 -1
- package/dist/jsx/components/Skeleton.d.cts.map +1 -1
- package/dist/jsx/components/Skeleton.d.mts.map +1 -1
- package/dist/jsx/components/Skeleton.mjs.map +1 -1
- package/dist/jsx/components/Text.cjs.map +1 -1
- package/dist/jsx/components/Text.d.cts +1 -1
- package/dist/jsx/components/Text.d.cts.map +1 -1
- package/dist/jsx/components/Text.d.mts +1 -1
- package/dist/jsx/components/Text.d.mts.map +1 -1
- package/dist/jsx/components/Text.mjs.map +1 -1
- package/dist/jsx/components/Tooltip.cjs.map +1 -1
- package/dist/jsx/components/Tooltip.d.cts.map +1 -1
- package/dist/jsx/components/Tooltip.d.mts.map +1 -1
- package/dist/jsx/components/Tooltip.mjs.map +1 -1
- package/dist/jsx/components/Value.cjs.map +1 -1
- package/dist/jsx/components/Value.d.cts.map +1 -1
- package/dist/jsx/components/Value.d.mts.map +1 -1
- package/dist/jsx/components/Value.mjs.map +1 -1
- package/dist/jsx/components/form/AddressInput.cjs +20 -0
- package/dist/jsx/components/form/AddressInput.cjs.map +1 -0
- package/dist/jsx/components/form/AddressInput.d.cts +24 -0
- package/dist/jsx/components/form/AddressInput.d.cts.map +1 -0
- package/dist/jsx/components/form/AddressInput.d.mts +24 -0
- package/dist/jsx/components/form/AddressInput.d.mts.map +1 -0
- package/dist/jsx/components/form/AddressInput.mjs +17 -0
- package/dist/jsx/components/form/AddressInput.mjs.map +1 -0
- package/dist/jsx/components/form/AssetSelector.cjs +37 -0
- package/dist/jsx/components/form/AssetSelector.cjs.map +1 -0
- package/dist/jsx/components/form/AssetSelector.d.cts +55 -0
- package/dist/jsx/components/form/AssetSelector.d.cts.map +1 -0
- package/dist/jsx/components/form/AssetSelector.d.mts +55 -0
- package/dist/jsx/components/form/AssetSelector.d.mts.map +1 -0
- package/dist/jsx/components/form/AssetSelector.mjs +34 -0
- package/dist/jsx/components/form/AssetSelector.mjs.map +1 -0
- package/dist/jsx/components/form/Dropdown.cjs.map +1 -1
- package/dist/jsx/components/form/Dropdown.d.cts +1 -1
- package/dist/jsx/components/form/Dropdown.d.cts.map +1 -1
- package/dist/jsx/components/form/Dropdown.d.mts +1 -1
- package/dist/jsx/components/form/Dropdown.d.mts.map +1 -1
- package/dist/jsx/components/form/Dropdown.mjs.map +1 -1
- package/dist/jsx/components/form/Field.cjs.map +1 -1
- package/dist/jsx/components/form/Field.d.cts +4 -2
- package/dist/jsx/components/form/Field.d.cts.map +1 -1
- package/dist/jsx/components/form/Field.d.mts +4 -2
- package/dist/jsx/components/form/Field.d.mts.map +1 -1
- package/dist/jsx/components/form/Field.mjs.map +1 -1
- package/dist/jsx/components/form/Option.cjs +0 -2
- package/dist/jsx/components/form/Option.cjs.map +1 -1
- package/dist/jsx/components/form/Option.d.cts.map +1 -1
- package/dist/jsx/components/form/Option.d.mts.map +1 -1
- package/dist/jsx/components/form/Option.mjs +0 -2
- package/dist/jsx/components/form/Option.mjs.map +1 -1
- package/dist/jsx/components/form/RadioGroup.cjs.map +1 -1
- package/dist/jsx/components/form/RadioGroup.d.cts +1 -1
- package/dist/jsx/components/form/RadioGroup.d.cts.map +1 -1
- package/dist/jsx/components/form/RadioGroup.d.mts +1 -1
- package/dist/jsx/components/form/RadioGroup.d.mts.map +1 -1
- package/dist/jsx/components/form/RadioGroup.mjs.map +1 -1
- package/dist/jsx/components/form/Selector.cjs.map +1 -1
- package/dist/jsx/components/form/Selector.d.cts +1 -1
- package/dist/jsx/components/form/Selector.d.cts.map +1 -1
- package/dist/jsx/components/form/Selector.d.mts +1 -1
- package/dist/jsx/components/form/Selector.d.mts.map +1 -1
- package/dist/jsx/components/form/Selector.mjs.map +1 -1
- package/dist/jsx/components/form/index.cjs +2 -0
- package/dist/jsx/components/form/index.cjs.map +1 -1
- package/dist/jsx/components/form/index.d.cts +5 -1
- package/dist/jsx/components/form/index.d.cts.map +1 -1
- package/dist/jsx/components/form/index.d.mts +5 -1
- package/dist/jsx/components/form/index.d.mts.map +1 -1
- package/dist/jsx/components/form/index.mjs +2 -0
- package/dist/jsx/components/form/index.mjs.map +1 -1
- package/dist/jsx/components/index.cjs +0 -1
- package/dist/jsx/components/index.cjs.map +1 -1
- package/dist/jsx/components/index.d.cts +1 -1
- package/dist/jsx/components/index.d.cts.map +1 -1
- package/dist/jsx/components/index.d.mts +1 -1
- package/dist/jsx/components/index.d.mts.map +1 -1
- package/dist/jsx/components/index.mjs +0 -1
- package/dist/jsx/components/index.mjs.map +1 -1
- package/dist/jsx/validation.cjs +30 -4
- package/dist/jsx/validation.cjs.map +1 -1
- package/dist/jsx/validation.d.cts +13 -6
- package/dist/jsx/validation.d.cts.map +1 -1
- package/dist/jsx/validation.d.mts +13 -6
- package/dist/jsx/validation.d.mts.map +1 -1
- package/dist/jsx/validation.mjs +29 -3
- package/dist/jsx/validation.mjs.map +1 -1
- package/dist/types/caip.cjs +40 -0
- package/dist/types/caip.cjs.map +1 -1
- package/dist/types/caip.d.cts +13 -1
- package/dist/types/caip.d.cts.map +1 -1
- package/dist/types/caip.d.mts +13 -1
- package/dist/types/caip.d.mts.map +1 -1
- package/dist/types/caip.mjs +39 -1
- package/dist/types/caip.mjs.map +1 -1
- package/dist/types/handlers/index.cjs +0 -9
- package/dist/types/handlers/index.cjs.map +1 -1
- package/dist/types/handlers/index.d.cts +9 -9
- package/dist/types/handlers/index.d.cts.map +1 -1
- package/dist/types/handlers/index.d.mts +9 -9
- package/dist/types/handlers/index.d.mts.map +1 -1
- package/dist/types/handlers/index.mjs +0 -9
- package/dist/types/handlers/index.mjs.map +1 -1
- package/dist/types/handlers/signature.cjs.map +1 -1
- package/dist/types/handlers/signature.d.cts +1 -1
- package/dist/types/handlers/signature.d.cts.map +1 -1
- package/dist/types/handlers/signature.d.mts +1 -1
- package/dist/types/handlers/signature.d.mts.map +1 -1
- package/dist/types/handlers/signature.mjs.map +1 -1
- package/dist/types/handlers/user-input.cjs +9 -3
- package/dist/types/handlers/user-input.cjs.map +1 -1
- package/dist/types/handlers/user-input.d.cts +44 -3
- package/dist/types/handlers/user-input.d.cts.map +1 -1
- package/dist/types/handlers/user-input.d.mts +44 -3
- package/dist/types/handlers/user-input.d.mts.map +1 -1
- package/dist/types/handlers/user-input.mjs +8 -2
- package/dist/types/handlers/user-input.mjs.map +1 -1
- package/dist/types/images.cjs.map +1 -1
- package/dist/types/images.mjs.map +1 -1
- package/dist/types/index.cjs +2 -5
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +3 -3
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +2 -5
- package/dist/types/index.mjs.map +1 -1
- package/dist/types/interface.cjs +8 -2
- package/dist/types/interface.cjs.map +1 -1
- package/dist/types/interface.d.cts +17 -1
- package/dist/types/interface.d.cts.map +1 -1
- package/dist/types/interface.d.mts +17 -1
- package/dist/types/interface.d.mts.map +1 -1
- package/dist/types/interface.mjs +9 -3
- package/dist/types/interface.mjs.map +1 -1
- package/dist/types/methods/get-bip32-entropy.cjs.map +1 -1
- package/dist/types/methods/get-bip32-entropy.d.cts +8 -4
- package/dist/types/methods/get-bip32-entropy.d.cts.map +1 -1
- package/dist/types/methods/get-bip32-entropy.d.mts +8 -4
- package/dist/types/methods/get-bip32-entropy.d.mts.map +1 -1
- package/dist/types/methods/get-bip32-entropy.mjs.map +1 -1
- package/dist/types/methods/get-bip32-public-key.cjs.map +1 -1
- package/dist/types/methods/get-bip32-public-key.d.cts +9 -5
- package/dist/types/methods/get-bip32-public-key.d.cts.map +1 -1
- package/dist/types/methods/get-bip32-public-key.d.mts +9 -5
- package/dist/types/methods/get-bip32-public-key.d.mts.map +1 -1
- package/dist/types/methods/get-bip32-public-key.mjs.map +1 -1
- package/dist/types/methods/get-bip44-entropy.cjs.map +1 -1
- package/dist/types/methods/get-bip44-entropy.d.cts +8 -3
- package/dist/types/methods/get-bip44-entropy.d.cts.map +1 -1
- package/dist/types/methods/get-bip44-entropy.d.mts +8 -3
- package/dist/types/methods/get-bip44-entropy.d.mts.map +1 -1
- package/dist/types/methods/get-bip44-entropy.mjs.map +1 -1
- package/dist/types/methods/get-entropy.cjs.map +1 -1
- package/dist/types/methods/get-entropy.d.cts +14 -5
- package/dist/types/methods/get-entropy.d.cts.map +1 -1
- package/dist/types/methods/get-entropy.d.mts +14 -5
- package/dist/types/methods/get-entropy.d.mts.map +1 -1
- package/dist/types/methods/get-entropy.mjs.map +1 -1
- package/dist/types/methods/index.cjs +0 -26
- package/dist/types/methods/index.cjs.map +1 -1
- package/dist/types/methods/index.d.cts +27 -26
- package/dist/types/methods/index.d.cts.map +1 -1
- package/dist/types/methods/index.d.mts +27 -26
- package/dist/types/methods/index.d.mts.map +1 -1
- package/dist/types/methods/index.mjs +0 -26
- package/dist/types/methods/index.mjs.map +1 -1
- package/dist/types/methods/list-entropy-sources.cjs +3 -0
- package/dist/types/methods/list-entropy-sources.cjs.map +1 -0
- package/dist/types/methods/list-entropy-sources.d.cts +31 -0
- package/dist/types/methods/list-entropy-sources.d.cts.map +1 -0
- package/dist/types/methods/list-entropy-sources.d.mts +31 -0
- package/dist/types/methods/list-entropy-sources.d.mts.map +1 -0
- package/dist/types/methods/list-entropy-sources.mjs +2 -0
- package/dist/types/methods/list-entropy-sources.mjs.map +1 -0
- package/dist/types/methods/methods.cjs.map +1 -1
- package/dist/types/methods/methods.d.cts +3 -1
- package/dist/types/methods/methods.d.cts.map +1 -1
- package/dist/types/methods/methods.d.mts +3 -1
- package/dist/types/methods/methods.d.mts.map +1 -1
- package/dist/types/methods/methods.mjs.map +1 -1
- package/dist/types/snap.cjs.map +1 -1
- package/dist/types/snap.d.cts.map +1 -1
- package/dist/types/snap.d.mts.map +1 -1
- package/dist/types/snap.mjs.map +1 -1
- package/dist/ui/builder.cjs.map +1 -1
- package/dist/ui/builder.d.cts.map +1 -1
- package/dist/ui/builder.d.mts.map +1 -1
- package/dist/ui/builder.mjs.map +1 -1
- package/dist/ui/components/form.cjs +2 -2
- package/dist/ui/components/form.cjs.map +1 -1
- package/dist/ui/components/form.d.cts.map +1 -1
- package/dist/ui/components/form.d.mts.map +1 -1
- package/dist/ui/components/form.mjs +2 -2
- package/dist/ui/components/form.mjs.map +1 -1
- package/dist/ui/components/input.cjs +0 -2
- package/dist/ui/components/input.cjs.map +1 -1
- package/dist/ui/components/input.d.cts.map +1 -1
- package/dist/ui/components/input.d.mts.map +1 -1
- package/dist/ui/components/input.mjs +0 -2
- package/dist/ui/components/input.mjs.map +1 -1
- package/dist/ui/components/panel.cjs +3 -3
- package/dist/ui/components/panel.cjs.map +1 -1
- package/dist/ui/components/panel.d.cts.map +1 -1
- package/dist/ui/components/panel.d.mts.map +1 -1
- package/dist/ui/components/panel.mjs +3 -3
- package/dist/ui/components/panel.mjs.map +1 -1
- package/dist/ui/components/row.cjs +3 -3
- package/dist/ui/components/row.cjs.map +1 -1
- package/dist/ui/components/row.d.cts.map +1 -1
- package/dist/ui/components/row.d.mts.map +1 -1
- package/dist/ui/components/row.mjs +3 -3
- package/dist/ui/components/row.mjs.map +1 -1
- package/dist/ui/nodes.cjs +0 -1
- package/dist/ui/nodes.cjs.map +1 -1
- package/dist/ui/nodes.d.cts.map +1 -1
- package/dist/ui/nodes.d.mts.map +1 -1
- package/dist/ui/nodes.mjs +0 -1
- package/dist/ui/nodes.mjs.map +1 -1
- package/jsx-dev-runtime.d.ts +0 -2
- package/jsx-dev-runtime.js +0 -2
- package/jsx-runtime.d.ts +0 -2
- package/jsx-runtime.js +0 -2
- package/jsx.d.ts +1 -1
- package/jsx.js +0 -2
- package/package.json +8 -22
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { CaipChainId, CaipAssetType, CaipAccountId } from "@metamask/utils";
|
|
2
|
+
/**
|
|
3
|
+
* The props of the {@link AssetSelector} component.
|
|
4
|
+
*
|
|
5
|
+
* @property name - The name of the asset selector. This is used to identify the
|
|
6
|
+
* state in the form data.
|
|
7
|
+
* @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.
|
|
8
|
+
* Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.
|
|
9
|
+
* Only non-EIP-155 namespaces are supported for now.
|
|
10
|
+
* @property chainIds - The chain IDs to filter the assets.
|
|
11
|
+
* Only non-EIP-155 namespaces are supported for now.
|
|
12
|
+
* @property value - The selected value of the asset selector.
|
|
13
|
+
* Only non-EIP-155 namespaces are supported for now.
|
|
14
|
+
* @property disabled - Whether the asset selector is disabled.
|
|
15
|
+
*/
|
|
16
|
+
export type AssetSelectorProps = {
|
|
17
|
+
name: string;
|
|
18
|
+
addresses: CaipAccountId[];
|
|
19
|
+
chainIds?: CaipChainId[] | undefined;
|
|
20
|
+
value?: CaipAssetType | undefined;
|
|
21
|
+
disabled?: boolean | undefined;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* An asset selector component, which is used to create an asset selector.
|
|
25
|
+
*
|
|
26
|
+
* @param props - The props of the component.
|
|
27
|
+
* @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.
|
|
28
|
+
* Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.
|
|
29
|
+
* Only non-EIP-155 namespaces are supported for now.
|
|
30
|
+
* @param props.chainIds - The chain IDs to filter the assets.
|
|
31
|
+
* Only non-EIP-155 namespaces are supported for now.
|
|
32
|
+
* @param props.value - The selected value of the asset selector.
|
|
33
|
+
* Only non-EIP-155 namespaces are supported for now.
|
|
34
|
+
* @param props.disabled - Whether the asset selector is disabled.
|
|
35
|
+
* @returns An asset selector element.
|
|
36
|
+
* @example
|
|
37
|
+
* <AssetSelector
|
|
38
|
+
* addresses={[
|
|
39
|
+
* 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
|
|
40
|
+
* 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
|
|
41
|
+
* ]}
|
|
42
|
+
* value="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
|
|
43
|
+
* />
|
|
44
|
+
* @example
|
|
45
|
+
* <AssetSelector
|
|
46
|
+
* addresses={[
|
|
47
|
+
* 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
|
|
48
|
+
* 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
|
|
49
|
+
* ]}
|
|
50
|
+
* chainIds={['solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp']}
|
|
51
|
+
* />
|
|
52
|
+
*/
|
|
53
|
+
export declare const AssetSelector: import("../../component.mjs").SnapComponent<AssetSelectorProps, "AssetSelector">;
|
|
54
|
+
export type AssetSelectorElement = ReturnType<typeof AssetSelector>;
|
|
55
|
+
//# sourceMappingURL=AssetSelector.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetSelector.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/AssetSelector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACd,wBAAwB;AAIzB;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;IACrC,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,aAAa,8EAGnB,CAAC;AAER,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createSnapComponent } from "../../component.mjs";
|
|
2
|
+
const TYPE = 'AssetSelector';
|
|
3
|
+
/**
|
|
4
|
+
* An asset selector component, which is used to create an asset selector.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The props of the component.
|
|
7
|
+
* @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.
|
|
8
|
+
* Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.
|
|
9
|
+
* Only non-EIP-155 namespaces are supported for now.
|
|
10
|
+
* @param props.chainIds - The chain IDs to filter the assets.
|
|
11
|
+
* Only non-EIP-155 namespaces are supported for now.
|
|
12
|
+
* @param props.value - The selected value of the asset selector.
|
|
13
|
+
* Only non-EIP-155 namespaces are supported for now.
|
|
14
|
+
* @param props.disabled - Whether the asset selector is disabled.
|
|
15
|
+
* @returns An asset selector element.
|
|
16
|
+
* @example
|
|
17
|
+
* <AssetSelector
|
|
18
|
+
* addresses={[
|
|
19
|
+
* 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
|
|
20
|
+
* 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
|
|
21
|
+
* ]}
|
|
22
|
+
* value="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
|
|
23
|
+
* />
|
|
24
|
+
* @example
|
|
25
|
+
* <AssetSelector
|
|
26
|
+
* addresses={[
|
|
27
|
+
* 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
|
|
28
|
+
* 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',
|
|
29
|
+
* ]}
|
|
30
|
+
* chainIds={['solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp']}
|
|
31
|
+
* />
|
|
32
|
+
*/
|
|
33
|
+
export const AssetSelector = createSnapComponent(TYPE);
|
|
34
|
+
//# sourceMappingURL=AssetSelector.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetSelector.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/AssetSelector.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAwBtD,MAAM,IAAI,GAAG,eAAe,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAG9C,IAAI,CAAC,CAAC","sourcesContent":["import type {\n CaipChainId,\n CaipAssetType,\n CaipAccountId,\n} from '@metamask/utils';\n\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link AssetSelector} component.\n *\n * @property name - The name of the asset selector. This is used to identify the\n * state in the form data.\n * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.\n * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.\n * Only non-EIP-155 namespaces are supported for now.\n * @property chainIds - The chain IDs to filter the assets.\n * Only non-EIP-155 namespaces are supported for now.\n * @property value - The selected value of the asset selector.\n * Only non-EIP-155 namespaces are supported for now.\n * @property disabled - Whether the asset selector is disabled.\n */\nexport type AssetSelectorProps = {\n name: string;\n addresses: CaipAccountId[];\n chainIds?: CaipChainId[] | undefined;\n value?: CaipAssetType | undefined;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'AssetSelector';\n\n/**\n * An asset selector component, which is used to create an asset selector.\n *\n * @param props - The props of the component.\n * @property addresses - The addresses of the account to pull the assets from as CAIP-10 Account IDs.\n * Multiple CAIP-10 Account IDs can be provided, but the account address should be the same on all Account IDs.\n * Only non-EIP-155 namespaces are supported for now.\n * @param props.chainIds - The chain IDs to filter the assets.\n * Only non-EIP-155 namespaces are supported for now.\n * @param props.value - The selected value of the asset selector.\n * Only non-EIP-155 namespaces are supported for now.\n * @param props.disabled - Whether the asset selector is disabled.\n * @returns An asset selector element.\n * @example\n * <AssetSelector\n * addresses={[\n * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * ]}\n * value=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"\n * />\n * @example\n * <AssetSelector\n * addresses={[\n * 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv',\n * ]}\n * chainIds={['solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp']}\n * />\n */\nexport const AssetSelector = createSnapComponent<\n AssetSelectorProps,\n typeof TYPE\n>(TYPE);\n\nexport type AssetSelectorElement = ReturnType<typeof AssetSelector>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Dropdown.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AAkBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,QAAQ,GAAG,IAAA,+BAAmB,EAA6B,IAAI,CAAC,CAAC","sourcesContent":["import type { OptionElement } from './Option';\nimport type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\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"]}
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"Dropdown.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAGrD;;;;;;;;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"}
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"Dropdown.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAGrD;;;;;;;;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dropdown.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Dropdown.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAkBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,mBAAmB,CAA6B,IAAI,CAAC,CAAC","sourcesContent":["import type { OptionElement } from './Option';\nimport type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Field.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":";;;AASA,mDAAsD;AA0BtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,KAAK,GAAG,IAAA,+BAAmB,EAA0B,IAAI,CAAC,CAAC","sourcesContent":["import type { AddressInputElement } from './AddressInput';\nimport type { AssetSelectorElement } from './AssetSelector';\nimport type { CheckboxElement } from './Checkbox';\nimport type { DropdownElement } from './Dropdown';\nimport type { FileInputElement } from './FileInput';\nimport type { InputElement } from './Input';\nimport type { RadioGroupElement } from './RadioGroup';\nimport type { SelectorElement } from './Selector';\nimport type { GenericSnapChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Field} component.\n *\n * @property label - The label of the field.\n * @property error - The error message of the field.\n * @property children - The input field and the submit button.\n */\nexport type FieldProps = {\n label?: string | undefined;\n error?: string | undefined;\n children:\n | [InputElement, GenericSnapChildren]\n | [GenericSnapChildren, InputElement]\n | [GenericSnapChildren, InputElement, GenericSnapChildren]\n | DropdownElement\n | RadioGroupElement\n | FileInputElement\n | InputElement\n | CheckboxElement\n | SelectorElement\n | AssetSelectorElement\n | AddressInputElement;\n};\n\nconst TYPE = 'Field';\n\n/**\n * A field component, which is used to create a form field.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the field.\n * @param props.error - The error message of the field.\n * @param props.children - The input field and the submit button.\n * @returns A field element.\n * @example\n * <Field label=\"Username\">\n * <Input name=\"username\" type=\"text\" />\n * <Button type=\"submit\">Submit</Button>\n * </Field>\n * @example\n * <Field label=\"Upload file\">\n * <FileInput name=\"file\" accept={['image/*']} multiple />\n * </Field>\n */\nexport const Field = createSnapComponent<FieldProps, typeof TYPE>(TYPE);\n\n/**\n * A field element.\n *\n * @see Field\n */\nexport type FieldElement = ReturnType<typeof Field>;\n"]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AddressInputElement } from "./AddressInput.cjs";
|
|
2
|
+
import type { AssetSelectorElement } from "./AssetSelector.cjs";
|
|
2
3
|
import type { CheckboxElement } from "./Checkbox.cjs";
|
|
3
4
|
import type { DropdownElement } from "./Dropdown.cjs";
|
|
4
5
|
import type { FileInputElement } from "./FileInput.cjs";
|
|
5
6
|
import type { InputElement } from "./Input.cjs";
|
|
6
7
|
import type { RadioGroupElement } from "./RadioGroup.cjs";
|
|
7
8
|
import type { SelectorElement } from "./Selector.cjs";
|
|
9
|
+
import type { GenericSnapChildren } from "../../component.cjs";
|
|
8
10
|
/**
|
|
9
11
|
* The props of the {@link Field} component.
|
|
10
12
|
*
|
|
@@ -15,7 +17,7 @@ import type { SelectorElement } from "./Selector.cjs";
|
|
|
15
17
|
export type FieldProps = {
|
|
16
18
|
label?: string | undefined;
|
|
17
19
|
error?: string | undefined;
|
|
18
|
-
children: [InputElement, GenericSnapChildren] | [GenericSnapChildren, InputElement] | [GenericSnapChildren, InputElement, GenericSnapChildren] | DropdownElement | RadioGroupElement | FileInputElement | InputElement | CheckboxElement | SelectorElement;
|
|
20
|
+
children: [InputElement, GenericSnapChildren] | [GenericSnapChildren, InputElement] | [GenericSnapChildren, InputElement, GenericSnapChildren] | DropdownElement | RadioGroupElement | FileInputElement | InputElement | CheckboxElement | SelectorElement | AssetSelectorElement | AddressInputElement;
|
|
19
21
|
};
|
|
20
22
|
/**
|
|
21
23
|
* A field component, which is used to create a form field.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,4BAAwB;
|
|
1
|
+
{"version":3,"file":"Field.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,2BAAuB;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,4BAAwB;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAoB;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAqB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,4BAAwB;AAG3D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EACJ,CAAC,YAAY,EAAE,mBAAmB,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,EAAE,mBAAmB,CAAC,GACxD,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,oBAAoB,GACpB,mBAAmB,CAAC;CACzB,CAAC;AAIF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AddressInputElement } from "./AddressInput.mjs";
|
|
2
|
+
import type { AssetSelectorElement } from "./AssetSelector.mjs";
|
|
2
3
|
import type { CheckboxElement } from "./Checkbox.mjs";
|
|
3
4
|
import type { DropdownElement } from "./Dropdown.mjs";
|
|
4
5
|
import type { FileInputElement } from "./FileInput.mjs";
|
|
5
6
|
import type { InputElement } from "./Input.mjs";
|
|
6
7
|
import type { RadioGroupElement } from "./RadioGroup.mjs";
|
|
7
8
|
import type { SelectorElement } from "./Selector.mjs";
|
|
9
|
+
import type { GenericSnapChildren } from "../../component.mjs";
|
|
8
10
|
/**
|
|
9
11
|
* The props of the {@link Field} component.
|
|
10
12
|
*
|
|
@@ -15,7 +17,7 @@ import type { SelectorElement } from "./Selector.mjs";
|
|
|
15
17
|
export type FieldProps = {
|
|
16
18
|
label?: string | undefined;
|
|
17
19
|
error?: string | undefined;
|
|
18
|
-
children: [InputElement, GenericSnapChildren] | [GenericSnapChildren, InputElement] | [GenericSnapChildren, InputElement, GenericSnapChildren] | DropdownElement | RadioGroupElement | FileInputElement | InputElement | CheckboxElement | SelectorElement;
|
|
20
|
+
children: [InputElement, GenericSnapChildren] | [GenericSnapChildren, InputElement] | [GenericSnapChildren, InputElement, GenericSnapChildren] | DropdownElement | RadioGroupElement | FileInputElement | InputElement | CheckboxElement | SelectorElement | AssetSelectorElement | AddressInputElement;
|
|
19
21
|
};
|
|
20
22
|
/**
|
|
21
23
|
* A field component, which is used to create a form field.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,4BAAwB;
|
|
1
|
+
{"version":3,"file":"Field.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,2BAAuB;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,4BAAwB;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAoB;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAqB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,4BAAwB;AAG3D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EACJ,CAAC,YAAY,EAAE,mBAAmB,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,CAAC,GACnC,CAAC,mBAAmB,EAAE,YAAY,EAAE,mBAAmB,CAAC,GACxD,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,oBAAoB,GACpB,mBAAmB,CAAC;CACzB,CAAC;AAIF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Field.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AA0BtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,mBAAmB,CAA0B,IAAI,CAAC,CAAC","sourcesContent":["import type { AddressInputElement } from './AddressInput';\nimport type { AssetSelectorElement } from './AssetSelector';\nimport type { CheckboxElement } from './Checkbox';\nimport type { DropdownElement } from './Dropdown';\nimport type { FileInputElement } from './FileInput';\nimport type { InputElement } from './Input';\nimport type { RadioGroupElement } from './RadioGroup';\nimport type { SelectorElement } from './Selector';\nimport type { GenericSnapChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Field} component.\n *\n * @property label - The label of the field.\n * @property error - The error message of the field.\n * @property children - The input field and the submit button.\n */\nexport type FieldProps = {\n label?: string | undefined;\n error?: string | undefined;\n children:\n | [InputElement, GenericSnapChildren]\n | [GenericSnapChildren, InputElement]\n | [GenericSnapChildren, InputElement, GenericSnapChildren]\n | DropdownElement\n | RadioGroupElement\n | FileInputElement\n | InputElement\n | CheckboxElement\n | SelectorElement\n | AssetSelectorElement\n | AddressInputElement;\n};\n\nconst TYPE = 'Field';\n\n/**\n * A field component, which is used to create a form field.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the field.\n * @param props.error - The error message of the field.\n * @param props.children - The input field and the submit button.\n * @returns A field element.\n * @example\n * <Field label=\"Username\">\n * <Input name=\"username\" type=\"text\" />\n * <Button type=\"submit\">Submit</Button>\n * </Field>\n * @example\n * <Field label=\"Upload file\">\n * <FileInput name=\"file\" accept={['image/*']} multiple />\n * </Field>\n */\nexport const Field = createSnapComponent<FieldProps, typeof TYPE>(TYPE);\n\n/**\n * A field element.\n *\n * @see Field\n */\nexport type FieldElement = ReturnType<typeof Field>;\n"]}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Option = void 0;
|
|
4
4
|
const component_1 = require("../../component.cjs");
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
-
const Dropdown_1 = require("./Dropdown.cjs");
|
|
7
5
|
const TYPE = 'Option';
|
|
8
6
|
/**
|
|
9
7
|
* A dropdown option component, which is used to create a dropdown option. This component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Option.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":";;;AAIA,mDAAsD;AAgBtD,MAAM,IAAI,GAAG,QAAQ,CAAC;AAEtB;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,MAAM,GAAG,IAAA,+BAAmB,EAA2B,IAAI,CAAC,CAAC","sourcesContent":["// TODO: Either fix this lint violation or explain why it's necessary to\n// ignore.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Dropdown } from './Dropdown';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Option} component.\n *\n * @property value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @property children - The text to display.\n * @property disabled - Whether the option is disabled.\n */\ntype OptionProps = {\n value: string;\n children: string;\n disabled?: boolean;\n};\n\nconst TYPE = 'Option';\n\n/**\n * A dropdown option component, which is used to create a dropdown option. This component\n * can only be used as a child of the {@link Dropdown} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @param props.children - The text to display.\n * @param props.disabled - Whether the option is disabled.\n * @returns A dropdown option 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 Option = createSnapComponent<OptionProps, typeof TYPE>(TYPE);\n\n/**\n * A dropdown option element.\n *\n * @see Option\n */\nexport type OptionElement = ReturnType<typeof Option>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Option.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,gEAAsD,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Option.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,gEAAsD,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { createSnapComponent } from "../../component.mjs";
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
|
-
import { Dropdown } from "./Dropdown.mjs";
|
|
4
2
|
const TYPE = 'Option';
|
|
5
3
|
/**
|
|
6
4
|
* A dropdown option component, which is used to create a dropdown option. This component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Option.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAgBtD,MAAM,IAAI,GAAG,QAAQ,CAAC;AAEtB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,mBAAmB,CAA2B,IAAI,CAAC,CAAC","sourcesContent":["// TODO: Either fix this lint violation or explain why it's necessary to\n// ignore.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Dropdown } from './Dropdown';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Option} component.\n *\n * @property value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @property children - The text to display.\n * @property disabled - Whether the option is disabled.\n */\ntype OptionProps = {\n value: string;\n children: string;\n disabled?: boolean;\n};\n\nconst TYPE = 'Option';\n\n/**\n * A dropdown option component, which is used to create a dropdown option. This component\n * can only be used as a child of the {@link Dropdown} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @param props.children - The text to display.\n * @param props.disabled - Whether the option is disabled.\n * @returns A dropdown option 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 Option = createSnapComponent<OptionProps, typeof TYPE>(TYPE);\n\n/**\n * A dropdown option element.\n *\n * @see Option\n */\nexport type OptionElement = ReturnType<typeof Option>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"RadioGroup.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AAEtD,MAAM,IAAI,GAAG,YAAY,CAAC;AAkB1B;;;;;;;;;;;GAWG;AACU,QAAA,UAAU,GAAG,IAAA,+BAAmB,EAC3C,IAAI,CACL,CAAC","sourcesContent":["import type { RadioElement } from './Radio';\nimport type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\n\nconst TYPE = 'RadioGroup';\n\n/**\n * The props of the {@link RadioGroup} 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 value of the radio group element.\n * @property children - Radio options in form of <Radio> elements.\n * @property disabled - Whether the radio group is disabled.\n */\ntype RadioGroupProps = {\n name: string;\n value?: string | undefined;\n children: SnapsChildren<RadioElement>;\n disabled?: boolean | undefined;\n};\n\n/**\n * A RadioGroup component, used to display multiple choices, where only one can be chosen.\n *\n * @param props.name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @param props.value - The value of the radio group element.\n * @param props.children - Radio options in form of <Radio> elements.\n * @param props.disabled - Whether the radio group is disabled.\n * @returns A RadioGroup element.\n * @example\n * <RadioGroup />\n */\nexport const RadioGroup = createSnapComponent<RadioGroupProps, typeof TYPE>(\n TYPE,\n);\n\n/**\n * A RadioGroup element.\n *\n * @see RadioGroup\n */\nexport type RadioGroupElement = ReturnType<typeof RadioGroup>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAKrD;;;;;;;;GAQG;AACH,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,wEAEtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAKrD;;;;;;;;GAQG;AACH,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,wEAEtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioGroup.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAEtD,MAAM,IAAI,GAAG,YAAY,CAAC;AAkB1B;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,mBAAmB,CAC3C,IAAI,CACL,CAAC","sourcesContent":["import type { RadioElement } from './Radio';\nimport type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\n\nconst TYPE = 'RadioGroup';\n\n/**\n * The props of the {@link RadioGroup} 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 value of the radio group element.\n * @property children - Radio options in form of <Radio> elements.\n * @property disabled - Whether the radio group is disabled.\n */\ntype RadioGroupProps = {\n name: string;\n value?: string | undefined;\n children: SnapsChildren<RadioElement>;\n disabled?: boolean | undefined;\n};\n\n/**\n * A RadioGroup component, used to display multiple choices, where only one can be chosen.\n *\n * @param props.name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @param props.value - The value of the radio group element.\n * @param props.children - Radio options in form of <Radio> elements.\n * @param props.disabled - Whether the radio group is disabled.\n * @returns A RadioGroup element.\n * @example\n * <RadioGroup />\n */\nexport const RadioGroup = createSnapComponent<RadioGroupProps, typeof TYPE>(\n TYPE,\n);\n\n/**\n * A RadioGroup element.\n *\n * @see RadioGroup\n */\nexport type RadioGroupElement = ReturnType<typeof RadioGroup>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Selector.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AAoBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,QAAQ,GAAG,IAAA,+BAAmB,EAA6B,IAAI,CAAC,CAAC","sourcesContent":["import type { SelectorOptionElement } from './SelectorOption';\nimport type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Selector} component.\n *\n * @property name - The name of the selector. This is used to identify the\n * state in the form data.\n * @property title - The title of the selector. This is displayed in the UI.\n * @property value - The selected value of the selector.\n * @property children - The children of the selector.\n * @property disabled - Whether the selector is disabled.\n */\nexport type SelectorProps = {\n name: string;\n title: string;\n value?: string | undefined;\n children: SnapsChildren<SelectorOptionElement>;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Selector';\n\n/**\n * A selector component, which is used to create a selector.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the selector field. This is used to identify the\n * state in the form data.\n * @param props.title - The title of the selector field. This is displayed in the UI.\n * @param props.value - The selected value of the selector.\n * @param props.children - The children of the selector.\n * @property disabled - Whether the selector is disabled.\n * @returns A selector element.\n * @example\n * <Selector name=\"selector\">\n * <SelectorOption value=\"option1\"><Card title=\"Option 1\" value=\"Foo\" /></SelectorOption>\n * <SelectorOption value=\"option2\"><Card title=\"Option 2\" value=\"Bar\" /></SelectorOption>\n * <SelectorOption value=\"option3\"><Card title=\"Option 3\" value=\"Baz\" /></SelectorOption>\n * </Selector>\n */\nexport const Selector = createSnapComponent<SelectorProps, typeof TYPE>(TYPE);\n\n/**\n * A selector element.\n *\n * @see Selector\n */\nexport type SelectorElement = ReturnType<typeof Selector>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Selector.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAGrD;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Selector.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAGrD;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Selector.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAoBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,mBAAmB,CAA6B,IAAI,CAAC,CAAC","sourcesContent":["import type { SelectorOptionElement } from './SelectorOption';\nimport type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Selector} component.\n *\n * @property name - The name of the selector. This is used to identify the\n * state in the form data.\n * @property title - The title of the selector. This is displayed in the UI.\n * @property value - The selected value of the selector.\n * @property children - The children of the selector.\n * @property disabled - Whether the selector is disabled.\n */\nexport type SelectorProps = {\n name: string;\n title: string;\n value?: string | undefined;\n children: SnapsChildren<SelectorOptionElement>;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Selector';\n\n/**\n * A selector component, which is used to create a selector.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the selector field. This is used to identify the\n * state in the form data.\n * @param props.title - The title of the selector field. This is displayed in the UI.\n * @param props.value - The selected value of the selector.\n * @param props.children - The children of the selector.\n * @property disabled - Whether the selector is disabled.\n * @returns A selector element.\n * @example\n * <Selector name=\"selector\">\n * <SelectorOption value=\"option1\"><Card title=\"Option 1\" value=\"Foo\" /></SelectorOption>\n * <SelectorOption value=\"option2\"><Card title=\"Option 2\" value=\"Bar\" /></SelectorOption>\n * <SelectorOption value=\"option3\"><Card title=\"Option 3\" value=\"Baz\" /></SelectorOption>\n * </Selector>\n */\nexport const Selector = createSnapComponent<SelectorProps, typeof TYPE>(TYPE);\n\n/**\n * A selector element.\n *\n * @see Selector\n */\nexport type SelectorElement = ReturnType<typeof Selector>;\n"]}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AssetSelector.cjs"), exports);
|
|
17
18
|
__exportStar(require("./Button.cjs"), exports);
|
|
18
19
|
__exportStar(require("./Checkbox.cjs"), exports);
|
|
19
20
|
__exportStar(require("./Dropdown.cjs"), exports);
|
|
@@ -26,4 +27,5 @@ __exportStar(require("./Form.cjs"), exports);
|
|
|
26
27
|
__exportStar(require("./Input.cjs"), exports);
|
|
27
28
|
__exportStar(require("./Selector.cjs"), exports);
|
|
28
29
|
__exportStar(require("./SelectorOption.cjs"), exports);
|
|
30
|
+
__exportStar(require("./AddressInput.cjs"), exports);
|
|
29
31
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAeA,sDAAgC;AAChC,+CAAyB;AACzB,iDAA2B;AAC3B,iDAA2B;AAC3B,+CAAyB;AACzB,8CAAwB;AACxB,mDAA6B;AAC7B,8CAAwB;AACxB,kDAA4B;AAC5B,6CAAuB;AACvB,8CAAwB;AACxB,iDAA2B;AAC3B,uDAAiC;AACjC,qDAA+B","sourcesContent":["import type { AddressInputElement } from './AddressInput';\nimport type { AssetSelectorElement } from './AssetSelector';\nimport type { ButtonElement } from './Button';\nimport type { CheckboxElement } from './Checkbox';\nimport type { DropdownElement } from './Dropdown';\nimport type { FieldElement } from './Field';\nimport type { FileInputElement } from './FileInput';\nimport type { FormElement } from './Form';\nimport type { InputElement } from './Input';\nimport type { OptionElement } from './Option';\nimport type { RadioElement } from './Radio';\nimport type { RadioGroupElement } from './RadioGroup';\nimport type { SelectorElement } from './Selector';\nimport type { SelectorOptionElement } from './SelectorOption';\n\nexport * from './AssetSelector';\nexport * from './Button';\nexport * from './Checkbox';\nexport * from './Dropdown';\nexport * from './Option';\nexport * from './Radio';\nexport * from './RadioGroup';\nexport * from './Field';\nexport * from './FileInput';\nexport * from './Form';\nexport * from './Input';\nexport * from './Selector';\nexport * from './SelectorOption';\nexport * from './AddressInput';\n\nexport type StandardFormElement =\n | AssetSelectorElement\n | AddressInputElement\n | ButtonElement\n | CheckboxElement\n | FormElement\n | FieldElement\n | FileInputElement\n | InputElement\n | DropdownElement\n | OptionElement\n | RadioElement\n | RadioGroupElement\n | SelectorElement\n | SelectorOptionElement;\n"]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { AddressInputElement } from "./AddressInput.cjs";
|
|
2
|
+
import type { AssetSelectorElement } from "./AssetSelector.cjs";
|
|
1
3
|
import type { ButtonElement } from "./Button.cjs";
|
|
2
4
|
import type { CheckboxElement } from "./Checkbox.cjs";
|
|
3
5
|
import type { DropdownElement } from "./Dropdown.cjs";
|
|
@@ -10,6 +12,7 @@ import type { RadioElement } from "./Radio.cjs";
|
|
|
10
12
|
import type { RadioGroupElement } from "./RadioGroup.cjs";
|
|
11
13
|
import type { SelectorElement } from "./Selector.cjs";
|
|
12
14
|
import type { SelectorOptionElement } from "./SelectorOption.cjs";
|
|
15
|
+
export * from "./AssetSelector.cjs";
|
|
13
16
|
export * from "./Button.cjs";
|
|
14
17
|
export * from "./Checkbox.cjs";
|
|
15
18
|
export * from "./Dropdown.cjs";
|
|
@@ -22,5 +25,6 @@ export * from "./Form.cjs";
|
|
|
22
25
|
export * from "./Input.cjs";
|
|
23
26
|
export * from "./Selector.cjs";
|
|
24
27
|
export * from "./SelectorOption.cjs";
|
|
25
|
-
export
|
|
28
|
+
export * from "./AddressInput.cjs";
|
|
29
|
+
export type StandardFormElement = AssetSelectorElement | AddressInputElement | ButtonElement | CheckboxElement | FormElement | FieldElement | FileInputElement | InputElement | DropdownElement | OptionElement | RadioElement | RadioGroupElement | SelectorElement | SelectorOptionElement;
|
|
26
30
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAoB;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAe;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAqB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAE9D,6BAAyB;AACzB,+BAA2B;AAC3B,+BAA2B;AAC3B,6BAAyB;AACzB,4BAAwB;AACxB,iCAA6B;AAC7B,4BAAwB;AACxB,gCAA4B;AAC5B,2BAAuB;AACvB,4BAAwB;AACxB,+BAA2B;AAC3B,qCAAiC;
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,2BAAuB;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,4BAAwB;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAoB;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAe;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAqB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAE9D,oCAAgC;AAChC,6BAAyB;AACzB,+BAA2B;AAC3B,+BAA2B;AAC3B,6BAAyB;AACzB,4BAAwB;AACxB,iCAA6B;AAC7B,4BAAwB;AACxB,gCAA4B;AAC5B,2BAAuB;AACvB,4BAAwB;AACxB,+BAA2B;AAC3B,qCAAiC;AACjC,mCAA+B;AAE/B,MAAM,MAAM,mBAAmB,GAC3B,oBAAoB,GACpB,mBAAmB,GACnB,aAAa,GACb,eAAe,GACf,WAAW,GACX,YAAY,GACZ,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,aAAa,GACb,YAAY,GACZ,iBAAiB,GACjB,eAAe,GACf,qBAAqB,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { AddressInputElement } from "./AddressInput.mjs";
|
|
2
|
+
import type { AssetSelectorElement } from "./AssetSelector.mjs";
|
|
1
3
|
import type { ButtonElement } from "./Button.mjs";
|
|
2
4
|
import type { CheckboxElement } from "./Checkbox.mjs";
|
|
3
5
|
import type { DropdownElement } from "./Dropdown.mjs";
|
|
@@ -10,6 +12,7 @@ import type { RadioElement } from "./Radio.mjs";
|
|
|
10
12
|
import type { RadioGroupElement } from "./RadioGroup.mjs";
|
|
11
13
|
import type { SelectorElement } from "./Selector.mjs";
|
|
12
14
|
import type { SelectorOptionElement } from "./SelectorOption.mjs";
|
|
15
|
+
export * from "./AssetSelector.mjs";
|
|
13
16
|
export * from "./Button.mjs";
|
|
14
17
|
export * from "./Checkbox.mjs";
|
|
15
18
|
export * from "./Dropdown.mjs";
|
|
@@ -22,5 +25,6 @@ export * from "./Form.mjs";
|
|
|
22
25
|
export * from "./Input.mjs";
|
|
23
26
|
export * from "./Selector.mjs";
|
|
24
27
|
export * from "./SelectorOption.mjs";
|
|
25
|
-
export
|
|
28
|
+
export * from "./AddressInput.mjs";
|
|
29
|
+
export type StandardFormElement = AssetSelectorElement | AddressInputElement | ButtonElement | CheckboxElement | FormElement | FieldElement | FileInputElement | InputElement | DropdownElement | OptionElement | RadioElement | RadioGroupElement | SelectorElement | SelectorOptionElement;
|
|
26
30
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAoB;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAe;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAqB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAE9D,6BAAyB;AACzB,+BAA2B;AAC3B,+BAA2B;AAC3B,6BAAyB;AACzB,4BAAwB;AACxB,iCAA6B;AAC7B,4BAAwB;AACxB,gCAA4B;AAC5B,2BAAuB;AACvB,4BAAwB;AACxB,+BAA2B;AAC3B,qCAAiC;
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,2BAAuB;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,4BAAwB;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAoB;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAe;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAiB;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAqB;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAE9D,oCAAgC;AAChC,6BAAyB;AACzB,+BAA2B;AAC3B,+BAA2B;AAC3B,6BAAyB;AACzB,4BAAwB;AACxB,iCAA6B;AAC7B,4BAAwB;AACxB,gCAA4B;AAC5B,2BAAuB;AACvB,4BAAwB;AACxB,+BAA2B;AAC3B,qCAAiC;AACjC,mCAA+B;AAE/B,MAAM,MAAM,mBAAmB,GAC3B,oBAAoB,GACpB,mBAAmB,GACnB,aAAa,GACb,eAAe,GACf,WAAW,GACX,YAAY,GACZ,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,aAAa,GACb,YAAY,GACZ,iBAAiB,GACjB,eAAe,GACf,qBAAqB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./AssetSelector.mjs";
|
|
1
2
|
export * from "./Button.mjs";
|
|
2
3
|
export * from "./Checkbox.mjs";
|
|
3
4
|
export * from "./Dropdown.mjs";
|
|
@@ -10,4 +11,5 @@ export * from "./Form.mjs";
|
|
|
10
11
|
export * from "./Input.mjs";
|
|
11
12
|
export * from "./Selector.mjs";
|
|
12
13
|
export * from "./SelectorOption.mjs";
|
|
14
|
+
export * from "./AddressInput.mjs";
|
|
13
15
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/index.ts"],"names":[],"mappings":"AAeA,oCAAgC;AAChC,6BAAyB;AACzB,+BAA2B;AAC3B,+BAA2B;AAC3B,6BAAyB;AACzB,4BAAwB;AACxB,iCAA6B;AAC7B,4BAAwB;AACxB,gCAA4B;AAC5B,2BAAuB;AACvB,4BAAwB;AACxB,+BAA2B;AAC3B,qCAAiC;AACjC,mCAA+B","sourcesContent":["import type { AddressInputElement } from './AddressInput';\nimport type { AssetSelectorElement } from './AssetSelector';\nimport type { ButtonElement } from './Button';\nimport type { CheckboxElement } from './Checkbox';\nimport type { DropdownElement } from './Dropdown';\nimport type { FieldElement } from './Field';\nimport type { FileInputElement } from './FileInput';\nimport type { FormElement } from './Form';\nimport type { InputElement } from './Input';\nimport type { OptionElement } from './Option';\nimport type { RadioElement } from './Radio';\nimport type { RadioGroupElement } from './RadioGroup';\nimport type { SelectorElement } from './Selector';\nimport type { SelectorOptionElement } from './SelectorOption';\n\nexport * from './AssetSelector';\nexport * from './Button';\nexport * from './Checkbox';\nexport * from './Dropdown';\nexport * from './Option';\nexport * from './Radio';\nexport * from './RadioGroup';\nexport * from './Field';\nexport * from './FileInput';\nexport * from './Form';\nexport * from './Input';\nexport * from './Selector';\nexport * from './SelectorOption';\nexport * from './AddressInput';\n\nexport type StandardFormElement =\n | AssetSelectorElement\n | AddressInputElement\n | ButtonElement\n | CheckboxElement\n | FormElement\n | FieldElement\n | FileInputElement\n | InputElement\n | DropdownElement\n | OptionElement\n | RadioElement\n | RadioGroupElement\n | SelectorElement\n | SelectorOptionElement;\n"]}
|
|
@@ -36,5 +36,4 @@ __exportStar(require("./Container.cjs"), exports);
|
|
|
36
36
|
__exportStar(require("./Section.cjs"), exports);
|
|
37
37
|
__exportStar(require("./Banner.cjs"), exports);
|
|
38
38
|
__exportStar(require("./Skeleton.cjs"), exports);
|
|
39
|
-
__exportStar(require("./utils.cjs"), exports);
|
|
40
39
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/jsx/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuBA,mDAAuB;AACvB,yDAA6B;AAC7B,gDAA0B;AAC1B,+CAAyB;AACzB,4CAAsB;AACtB,6CAAuB;AACvB,iDAA2B;AAC3B,gDAA0B;AAC1B,8CAAwB;AACxB,gDAA0B;AAC1B,6CAAuB;AACvB,8CAAwB;AACxB,6CAAuB;AACvB,4CAAsB;AACtB,gDAA0B;AAC1B,6CAAuB;AACvB,gDAA0B;AAC1B,+CAAyB;AACzB,kDAA4B;AAC5B,gDAA0B;AAC1B,+CAAyB;AACzB,iDAA2B
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/jsx/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuBA,mDAAuB;AACvB,yDAA6B;AAC7B,gDAA0B;AAC1B,+CAAyB;AACzB,4CAAsB;AACtB,6CAAuB;AACvB,iDAA2B;AAC3B,gDAA0B;AAC1B,8CAAwB;AACxB,gDAA0B;AAC1B,6CAAuB;AACvB,8CAAwB;AACxB,6CAAuB;AACvB,4CAAsB;AACtB,gDAA0B;AAC1B,6CAAuB;AACvB,gDAA0B;AAC1B,+CAAyB;AACzB,kDAA4B;AAC5B,gDAA0B;AAC1B,+CAAyB;AACzB,iDAA2B","sourcesContent":["import type { AddressElement } from './Address';\nimport type { AvatarElement } from './Avatar';\nimport type { BannerElement } from './Banner';\nimport type { BoxElement } from './Box';\nimport type { CardElement } from './Card';\nimport type { ContainerElement } from './Container';\nimport type { CopyableElement } from './Copyable';\nimport type { DividerElement } from './Divider';\nimport type { FooterElement } from './Footer';\nimport type { StandardFormElement } from './form';\nimport type { StandardFormattingElement } from './formatting';\nimport type { HeadingElement } from './Heading';\nimport type { IconElement } from './Icon';\nimport type { ImageElement } from './Image';\nimport type { LinkElement } from './Link';\nimport type { RowElement } from './Row';\nimport type { SectionElement } from './Section';\nimport type { SkeletonElement } from './Skeleton';\nimport type { SpinnerElement } from './Spinner';\nimport type { TextElement } from './Text';\nimport type { TooltipElement } from './Tooltip';\nimport type { ValueElement } from './Value';\n\nexport * from './form';\nexport * from './formatting';\nexport * from './Address';\nexport * from './Avatar';\nexport * from './Box';\nexport * from './Card';\nexport * from './Copyable';\nexport * from './Divider';\nexport * from './Value';\nexport * from './Heading';\nexport * from './Icon';\nexport * from './Image';\nexport * from './Link';\nexport * from './Row';\nexport * from './Spinner';\nexport * from './Text';\nexport * from './Tooltip';\nexport * from './Footer';\nexport * from './Container';\nexport * from './Section';\nexport * from './Banner';\nexport * from './Skeleton';\nexport type * from './utils';\n\n/**\n * A built-in JSX element, which can be used in a Snap user interface.\n */\nexport type JSXElement =\n | StandardFormElement\n | StandardFormattingElement\n | AvatarElement\n | AddressElement\n | BoxElement\n | CardElement\n | ContainerElement\n | CopyableElement\n | DividerElement\n | FooterElement\n | ValueElement\n | HeadingElement\n | IconElement\n | ImageElement\n | LinkElement\n | RowElement\n | SectionElement\n | SpinnerElement\n | TextElement\n | TooltipElement\n | BannerElement\n | SkeletonElement;\n"]}
|
|
@@ -42,7 +42,7 @@ export * from "./Container.cjs";
|
|
|
42
42
|
export * from "./Section.cjs";
|
|
43
43
|
export * from "./Banner.cjs";
|
|
44
44
|
export * from "./Skeleton.cjs";
|
|
45
|
-
export * from "./utils.cjs";
|
|
45
|
+
export type * from "./utils.cjs";
|
|
46
46
|
/**
|
|
47
47
|
* A built-in JSX element, which can be used in a Snap user interface.
|
|
48
48
|
*/
|