@metamask/snaps-sdk 6.2.1 → 6.4.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 +30 -1
- package/dist/error-wrappers.cjs +146 -0
- package/dist/error-wrappers.cjs.map +1 -0
- package/dist/error-wrappers.d.cts +830 -0
- package/dist/error-wrappers.d.cts.map +1 -0
- package/dist/{types/error-wrappers.d.ts → error-wrappers.d.mts} +193 -192
- package/dist/error-wrappers.d.mts.map +1 -0
- package/dist/error-wrappers.mjs +143 -0
- package/dist/error-wrappers.mjs.map +1 -0
- package/dist/errors.cjs +124 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/{types/errors.d.ts → errors.d.cts} +3 -2
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.mts +87 -0
- package/dist/errors.d.mts.map +1 -0
- package/dist/errors.mjs +120 -0
- package/dist/errors.mjs.map +1 -0
- package/dist/images.cjs +91 -0
- package/dist/images.cjs.map +1 -0
- package/dist/{types/images.d.ts → images.d.cts} +2 -1
- package/dist/images.d.cts.map +1 -0
- package/dist/images.d.mts +70 -0
- package/dist/images.d.mts.map +1 -0
- package/dist/images.mjs +86 -0
- package/dist/images.mjs.map +1 -0
- package/dist/index.cjs +36 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +7 -1201
- package/dist/index.mjs.map +1 -1
- package/dist/internals/error-wrappers.cjs +44 -0
- package/dist/internals/error-wrappers.cjs.map +1 -0
- package/dist/internals/error-wrappers.d.cts +60 -0
- package/dist/internals/error-wrappers.d.cts.map +1 -0
- package/dist/{types/internals/error-wrappers.d.ts → internals/error-wrappers.d.mts} +15 -14
- package/dist/internals/error-wrappers.d.mts.map +1 -0
- package/dist/internals/error-wrappers.mjs +40 -0
- package/dist/internals/error-wrappers.mjs.map +1 -0
- package/dist/internals/errors.cjs +80 -0
- package/dist/internals/errors.cjs.map +1 -0
- package/dist/{types/internals/errors.d.ts → internals/errors.d.cts} +1 -0
- package/dist/internals/errors.d.cts.map +1 -0
- package/dist/internals/errors.d.mts +42 -0
- package/dist/internals/errors.d.mts.map +1 -0
- package/dist/internals/errors.mjs +73 -0
- package/dist/internals/errors.mjs.map +1 -0
- package/dist/internals/helpers.cjs +3 -0
- package/dist/internals/helpers.cjs.map +1 -0
- package/dist/{types/internals/helpers.d.ts → internals/helpers.d.cts} +2 -1
- package/dist/internals/helpers.d.cts.map +1 -0
- package/dist/internals/helpers.d.mts +37 -0
- package/dist/internals/helpers.d.mts.map +1 -0
- package/dist/internals/helpers.mjs +2 -0
- package/dist/internals/helpers.mjs.map +1 -0
- package/dist/internals/index.cjs +23 -0
- package/dist/internals/index.cjs.map +1 -0
- package/dist/internals/index.d.cts +7 -0
- package/dist/internals/index.d.cts.map +1 -0
- package/dist/internals/index.d.mts +7 -0
- package/dist/internals/index.d.mts.map +1 -0
- package/dist/internals/index.mjs +7 -0
- package/dist/internals/index.mjs.map +1 -0
- package/dist/internals/jsx.cjs +17 -0
- package/dist/internals/jsx.cjs.map +1 -0
- package/dist/{types/internals/jsx.d.ts → internals/jsx.d.cts} +3 -2
- package/dist/internals/jsx.d.cts.map +1 -0
- package/dist/internals/jsx.d.mts +31 -0
- package/dist/internals/jsx.d.mts.map +1 -0
- package/dist/internals/jsx.mjs +13 -0
- package/dist/internals/jsx.mjs.map +1 -0
- package/dist/internals/structs.cjs +161 -0
- package/dist/internals/structs.cjs.map +1 -0
- package/dist/{types/internals/structs.d.ts → internals/structs.d.cts} +13 -3
- package/dist/internals/structs.d.cts.map +1 -0
- package/dist/internals/structs.d.mts +69 -0
- package/dist/internals/structs.d.mts.map +1 -0
- package/dist/internals/structs.mjs +153 -0
- package/dist/internals/structs.mjs.map +1 -0
- package/dist/internals/svg.cjs +23 -0
- package/dist/internals/svg.cjs.map +1 -0
- package/dist/{types/internals/svg.d.ts → internals/svg.d.cts} +1 -0
- package/dist/internals/svg.d.cts.map +1 -0
- package/dist/internals/svg.d.mts +8 -0
- package/dist/internals/svg.d.mts.map +1 -0
- package/dist/internals/svg.mjs +19 -0
- package/dist/internals/svg.mjs.map +1 -0
- package/dist/jsx/component.cjs +32 -0
- package/dist/jsx/component.cjs.map +1 -0
- package/dist/{types/jsx/component.d.ts → jsx/component.d.cts} +2 -1
- package/dist/jsx/component.d.cts.map +1 -0
- package/dist/jsx/component.d.mts +74 -0
- package/dist/jsx/component.d.mts.map +1 -0
- package/dist/jsx/component.mjs +28 -0
- package/dist/jsx/component.mjs.map +1 -0
- package/dist/jsx/components/Address.cjs +23 -0
- package/dist/jsx/components/Address.cjs.map +1 -0
- package/dist/jsx/components/Address.d.cts +34 -0
- package/dist/jsx/components/Address.d.cts.map +1 -0
- package/dist/jsx/components/Address.d.mts +34 -0
- package/dist/jsx/components/Address.d.mts.map +1 -0
- package/dist/jsx/components/Address.mjs +20 -0
- package/dist/jsx/components/Address.mjs.map +1 -0
- package/dist/jsx/components/Box.cjs +18 -0
- package/dist/jsx/components/Box.cjs.map +1 -0
- package/dist/{types/jsx/components/Box.d.ts → jsx/components/Box.d.cts} +2 -1
- package/dist/jsx/components/Box.d.cts.map +1 -0
- package/dist/jsx/components/Box.d.mts +32 -0
- package/dist/jsx/components/Box.d.mts.map +1 -0
- package/dist/jsx/components/Box.mjs +15 -0
- package/dist/jsx/components/Box.mjs.map +1 -0
- package/dist/jsx/components/Card.cjs +20 -0
- package/dist/jsx/components/Card.cjs.map +1 -0
- package/dist/{types/jsx/components/Card.d.ts → jsx/components/Card.d.cts} +1 -0
- package/dist/jsx/components/Card.d.cts.map +1 -0
- package/dist/jsx/components/Card.d.mts +37 -0
- package/dist/jsx/components/Card.d.mts.map +1 -0
- package/dist/jsx/components/Card.mjs +17 -0
- package/dist/jsx/components/Card.mjs.map +1 -0
- package/dist/jsx/components/Container.cjs +24 -0
- package/dist/jsx/components/Container.cjs.map +1 -0
- package/dist/{types/jsx/components/Container.d.ts → jsx/components/Container.d.cts} +4 -3
- package/dist/jsx/components/Container.d.cts.map +1 -0
- package/dist/jsx/components/Container.d.mts +35 -0
- package/dist/jsx/components/Container.d.mts.map +1 -0
- package/dist/jsx/components/Container.mjs +21 -0
- package/dist/jsx/components/Container.mjs.map +1 -0
- package/dist/jsx/components/Copyable.cjs +20 -0
- package/dist/jsx/components/Copyable.cjs.map +1 -0
- package/dist/{types/jsx/components/Copyable.d.ts → jsx/components/Copyable.d.cts} +1 -0
- package/dist/jsx/components/Copyable.d.cts.map +1 -0
- package/dist/jsx/components/Copyable.d.mts +33 -0
- package/dist/jsx/components/Copyable.d.mts.map +1 -0
- package/dist/jsx/components/Copyable.mjs +17 -0
- package/dist/jsx/components/Copyable.mjs.map +1 -0
- package/dist/jsx/components/Divider.cjs +17 -0
- package/dist/jsx/components/Divider.cjs.map +1 -0
- package/dist/{types/jsx/components/Divider.d.ts → jsx/components/Divider.d.cts} +1 -0
- package/dist/jsx/components/Divider.d.cts.map +1 -0
- package/dist/jsx/components/Divider.d.mts +18 -0
- package/dist/jsx/components/Divider.d.mts.map +1 -0
- package/dist/jsx/components/Divider.mjs +14 -0
- package/dist/jsx/components/Divider.mjs.map +1 -0
- package/dist/jsx/components/Footer.cjs +19 -0
- package/dist/jsx/components/Footer.cjs.map +1 -0
- package/dist/{types/jsx/components/Footer.d.ts → jsx/components/Footer.d.cts} +2 -1
- package/dist/jsx/components/Footer.d.cts.map +1 -0
- package/dist/jsx/components/Footer.d.mts +29 -0
- package/dist/jsx/components/Footer.d.mts.map +1 -0
- package/dist/jsx/components/Footer.mjs +16 -0
- package/dist/jsx/components/Footer.mjs.map +1 -0
- package/dist/jsx/components/Heading.cjs +16 -0
- package/dist/jsx/components/Heading.cjs.map +1 -0
- package/dist/{types/jsx/components/Heading.d.ts → jsx/components/Heading.d.cts} +2 -1
- package/dist/jsx/components/Heading.d.cts.map +1 -0
- package/dist/jsx/components/Heading.d.mts +27 -0
- package/dist/jsx/components/Heading.d.mts.map +1 -0
- package/dist/jsx/components/Heading.mjs +13 -0
- package/dist/jsx/components/Heading.mjs.map +1 -0
- package/dist/jsx/components/Icon.cjs +180 -0
- package/dist/jsx/components/Icon.cjs.map +1 -0
- package/dist/jsx/components/Icon.d.cts +190 -0
- package/dist/jsx/components/Icon.d.cts.map +1 -0
- package/dist/jsx/components/Icon.d.mts +190 -0
- package/dist/jsx/components/Icon.d.mts.map +1 -0
- package/dist/jsx/components/Icon.mjs +177 -0
- package/dist/jsx/components/Icon.mjs.map +1 -0
- package/dist/jsx/components/Image.cjs +22 -0
- package/dist/jsx/components/Image.cjs.map +1 -0
- package/dist/{types/jsx/components/Image.d.ts → jsx/components/Image.d.cts} +1 -0
- package/dist/jsx/components/Image.d.cts.map +1 -0
- package/dist/jsx/components/Image.d.mts +37 -0
- package/dist/jsx/components/Image.d.mts.map +1 -0
- package/dist/jsx/components/Image.mjs +19 -0
- package/dist/jsx/components/Image.mjs.map +1 -0
- package/dist/jsx/components/Link.cjs +18 -0
- package/dist/jsx/components/Link.cjs.map +1 -0
- package/dist/{types/jsx/components/Link.d.ts → jsx/components/Link.d.cts} +3 -2
- package/dist/jsx/components/Link.d.cts.map +1 -0
- package/dist/jsx/components/Link.d.mts +36 -0
- package/dist/jsx/components/Link.d.mts.map +1 -0
- package/dist/jsx/components/Link.mjs +15 -0
- package/dist/jsx/components/Link.mjs.map +1 -0
- package/dist/jsx/components/Row.cjs +22 -0
- package/dist/jsx/components/Row.cjs.map +1 -0
- package/dist/{types/jsx/components/Row.d.ts → jsx/components/Row.d.cts} +5 -4
- package/dist/jsx/components/Row.d.cts.map +1 -0
- package/dist/jsx/components/Row.d.mts +46 -0
- package/dist/jsx/components/Row.d.mts.map +1 -0
- package/dist/jsx/components/Row.mjs +19 -0
- package/dist/jsx/components/Row.mjs.map +1 -0
- package/dist/jsx/components/Section.cjs +26 -0
- package/dist/jsx/components/Section.cjs.map +1 -0
- package/dist/jsx/components/Section.d.cts +38 -0
- package/dist/jsx/components/Section.d.cts.map +1 -0
- package/dist/jsx/components/Section.d.mts +38 -0
- package/dist/jsx/components/Section.d.mts.map +1 -0
- package/dist/jsx/components/Section.mjs +23 -0
- package/dist/jsx/components/Section.mjs.map +1 -0
- package/dist/jsx/components/Spinner.cjs +17 -0
- package/dist/jsx/components/Spinner.cjs.map +1 -0
- package/dist/{types/jsx/components/Spinner.d.ts → jsx/components/Spinner.d.cts} +1 -0
- package/dist/jsx/components/Spinner.d.cts.map +1 -0
- package/dist/jsx/components/Spinner.d.mts +18 -0
- package/dist/jsx/components/Spinner.d.mts.map +1 -0
- package/dist/jsx/components/Spinner.mjs +14 -0
- package/dist/jsx/components/Spinner.mjs.map +1 -0
- package/dist/jsx/components/Text.cjs +22 -0
- package/dist/jsx/components/Text.cjs.map +1 -0
- package/dist/{types/jsx/components/Text.d.ts → jsx/components/Text.d.cts} +11 -4
- package/dist/jsx/components/Text.d.cts.map +1 -0
- package/dist/jsx/components/Text.d.mts +45 -0
- package/dist/jsx/components/Text.d.mts.map +1 -0
- package/dist/jsx/components/Text.mjs +19 -0
- package/dist/jsx/components/Text.mjs.map +1 -0
- package/dist/jsx/components/Tooltip.cjs +23 -0
- package/dist/jsx/components/Tooltip.cjs.map +1 -0
- package/dist/{types/jsx/components/Tooltip.d.ts → jsx/components/Tooltip.d.cts} +8 -6
- package/dist/jsx/components/Tooltip.d.cts.map +1 -0
- package/dist/jsx/components/Tooltip.d.mts +40 -0
- package/dist/jsx/components/Tooltip.d.mts.map +1 -0
- package/dist/jsx/components/Tooltip.mjs +20 -0
- package/dist/jsx/components/Tooltip.mjs.map +1 -0
- package/dist/jsx/components/Value.cjs +21 -0
- package/dist/jsx/components/Value.cjs.map +1 -0
- package/dist/{types/jsx/components/Value.d.ts → jsx/components/Value.d.cts} +1 -0
- package/dist/jsx/components/Value.d.cts.map +1 -0
- package/dist/jsx/components/Value.d.mts +32 -0
- package/dist/jsx/components/Value.d.mts.map +1 -0
- package/dist/jsx/components/Value.mjs +18 -0
- package/dist/jsx/components/Value.mjs.map +1 -0
- package/dist/jsx/components/form/Button.cjs +17 -0
- package/dist/jsx/components/form/Button.cjs.map +1 -0
- package/dist/{types/jsx/components/form/Button.d.ts → jsx/components/form/Button.d.cts} +5 -2
- package/dist/jsx/components/form/Button.d.cts.map +1 -0
- package/dist/jsx/components/form/Button.d.mts +40 -0
- package/dist/jsx/components/form/Button.d.mts.map +1 -0
- package/dist/jsx/components/form/Button.mjs +14 -0
- package/dist/jsx/components/form/Button.mjs.map +1 -0
- package/dist/jsx/components/form/Checkbox.cjs +20 -0
- package/dist/jsx/components/form/Checkbox.cjs.map +1 -0
- package/dist/{types/jsx/components/form/Checkbox.d.ts → jsx/components/form/Checkbox.d.cts} +1 -0
- package/dist/jsx/components/form/Checkbox.d.cts.map +1 -0
- package/dist/jsx/components/form/Checkbox.d.mts +36 -0
- package/dist/jsx/components/form/Checkbox.d.mts.map +1 -0
- package/dist/jsx/components/form/Checkbox.mjs +17 -0
- package/dist/jsx/components/form/Checkbox.mjs.map +1 -0
- package/dist/jsx/components/form/Dropdown.cjs +23 -0
- package/dist/jsx/components/form/Dropdown.cjs.map +1 -0
- package/dist/{types/jsx/components/form/Dropdown.d.ts → jsx/components/form/Dropdown.d.cts} +3 -2
- package/dist/jsx/components/form/Dropdown.d.cts.map +1 -0
- package/dist/jsx/components/form/Dropdown.d.mts +39 -0
- package/dist/jsx/components/form/Dropdown.d.mts.map +1 -0
- package/dist/jsx/components/form/Dropdown.mjs +20 -0
- package/dist/jsx/components/form/Dropdown.mjs.map +1 -0
- package/dist/jsx/components/form/Field.cjs +26 -0
- package/dist/jsx/components/form/Field.cjs.map +1 -0
- package/dist/{types/jsx/components/form/Field.d.ts → jsx/components/form/Field.d.cts} +9 -7
- package/dist/jsx/components/form/Field.d.cts.map +1 -0
- package/dist/jsx/components/form/Field.d.mts +46 -0
- package/dist/jsx/components/form/Field.d.mts.map +1 -0
- package/dist/jsx/components/form/Field.mjs +23 -0
- package/dist/jsx/components/form/Field.mjs.map +1 -0
- package/dist/jsx/components/form/FileInput.cjs +31 -0
- package/dist/jsx/components/form/FileInput.cjs.map +1 -0
- package/dist/{types/jsx/components/form/FileInput.d.ts → jsx/components/form/FileInput.d.cts} +1 -0
- package/dist/jsx/components/form/FileInput.d.cts.map +1 -0
- package/dist/jsx/components/form/FileInput.d.mts +48 -0
- package/dist/jsx/components/form/FileInput.d.mts.map +1 -0
- package/dist/jsx/components/form/FileInput.mjs +28 -0
- package/dist/jsx/components/form/FileInput.mjs.map +1 -0
- package/dist/jsx/components/form/Form.cjs +24 -0
- package/dist/jsx/components/form/Form.cjs.map +1 -0
- package/dist/{types/jsx/components/form/Form.d.ts → jsx/components/form/Form.d.cts} +2 -1
- package/dist/jsx/components/form/Form.d.cts.map +1 -0
- package/dist/jsx/components/form/Form.d.mts +37 -0
- package/dist/jsx/components/form/Form.d.mts.map +1 -0
- package/dist/jsx/components/form/Form.mjs +21 -0
- package/dist/jsx/components/form/Form.mjs.map +1 -0
- package/dist/jsx/components/form/Input.cjs +20 -0
- package/dist/jsx/components/form/Input.cjs.map +1 -0
- package/dist/{types/jsx/components/form/Input.d.ts → jsx/components/form/Input.d.cts} +1 -0
- package/dist/jsx/components/form/Input.d.cts.map +1 -0
- package/dist/jsx/components/form/Input.d.mts +36 -0
- package/dist/jsx/components/form/Input.d.mts.map +1 -0
- package/dist/jsx/components/form/Input.mjs +17 -0
- package/dist/jsx/components/form/Input.mjs.map +1 -0
- package/dist/jsx/components/form/Option.cjs +25 -0
- package/dist/jsx/components/form/Option.cjs.map +1 -0
- package/dist/{types/jsx/components/form/Option.d.ts → jsx/components/form/Option.d.cts} +1 -0
- package/dist/jsx/components/form/Option.d.cts.map +1 -0
- package/dist/jsx/components/form/Option.d.mts +36 -0
- package/dist/jsx/components/form/Option.d.mts.map +1 -0
- package/dist/jsx/components/form/Option.mjs +22 -0
- package/dist/jsx/components/form/Option.mjs.map +1 -0
- package/dist/jsx/components/form/Radio.cjs +23 -0
- package/dist/jsx/components/form/Radio.cjs.map +1 -0
- package/dist/{types/jsx/components/form/Radio.d.ts → jsx/components/form/Radio.d.cts} +1 -0
- package/dist/jsx/components/form/Radio.d.cts.map +1 -0
- package/dist/jsx/components/form/Radio.d.mts +36 -0
- package/dist/jsx/components/form/Radio.d.mts.map +1 -0
- package/dist/jsx/components/form/Radio.mjs +20 -0
- package/dist/jsx/components/form/Radio.mjs.map +1 -0
- package/dist/jsx/components/form/RadioGroup.cjs +14 -0
- package/dist/jsx/components/form/RadioGroup.cjs.map +1 -0
- package/dist/{types/jsx/components/form/RadioGroup.d.ts → jsx/components/form/RadioGroup.d.cts} +3 -2
- package/dist/jsx/components/form/RadioGroup.d.cts.map +1 -0
- package/dist/jsx/components/form/RadioGroup.d.mts +30 -0
- package/dist/jsx/components/form/RadioGroup.d.mts.map +1 -0
- package/dist/jsx/components/form/RadioGroup.mjs +11 -0
- package/dist/jsx/components/form/RadioGroup.mjs.map +1 -0
- package/dist/jsx/components/form/Selector.cjs +24 -0
- package/dist/jsx/components/form/Selector.cjs.map +1 -0
- package/dist/jsx/components/form/Selector.d.cts +42 -0
- package/dist/jsx/components/form/Selector.d.cts.map +1 -0
- package/dist/jsx/components/form/Selector.d.mts +42 -0
- package/dist/jsx/components/form/Selector.d.mts.map +1 -0
- package/dist/jsx/components/form/Selector.mjs +21 -0
- package/dist/jsx/components/form/Selector.mjs.map +1 -0
- package/dist/jsx/components/form/SelectorOption.cjs +23 -0
- package/dist/jsx/components/form/SelectorOption.cjs.map +1 -0
- package/dist/jsx/components/form/SelectorOption.d.cts +36 -0
- package/dist/jsx/components/form/SelectorOption.d.cts.map +1 -0
- package/dist/jsx/components/form/SelectorOption.d.mts +36 -0
- package/dist/jsx/components/form/SelectorOption.d.mts.map +1 -0
- package/dist/jsx/components/form/SelectorOption.mjs +20 -0
- package/dist/jsx/components/form/SelectorOption.mjs.map +1 -0
- package/dist/jsx/components/form/index.cjs +29 -0
- package/dist/jsx/components/form/index.cjs.map +1 -0
- package/dist/jsx/components/form/index.d.cts +26 -0
- package/dist/jsx/components/form/index.d.cts.map +1 -0
- package/dist/jsx/components/form/index.d.mts +26 -0
- package/dist/jsx/components/form/index.d.mts.map +1 -0
- package/dist/jsx/components/form/index.mjs +13 -0
- package/dist/jsx/components/form/index.mjs.map +1 -0
- package/dist/jsx/components/formatting/Bold.cjs +21 -0
- package/dist/jsx/components/formatting/Bold.cjs.map +1 -0
- package/dist/{types/jsx/components/formatting/Bold.d.ts → jsx/components/formatting/Bold.d.cts} +2 -1
- package/dist/jsx/components/formatting/Bold.d.cts.map +1 -0
- package/dist/jsx/components/formatting/Bold.d.mts +33 -0
- package/dist/jsx/components/formatting/Bold.d.mts.map +1 -0
- package/dist/jsx/components/formatting/Bold.mjs +18 -0
- package/dist/jsx/components/formatting/Bold.mjs.map +1 -0
- package/dist/jsx/components/formatting/Italic.cjs +20 -0
- package/dist/jsx/components/formatting/Italic.cjs.map +1 -0
- package/dist/{types/jsx/components/formatting/Italic.d.ts → jsx/components/formatting/Italic.d.cts} +2 -1
- package/dist/jsx/components/formatting/Italic.d.cts.map +1 -0
- package/dist/jsx/components/formatting/Italic.d.mts +35 -0
- package/dist/jsx/components/formatting/Italic.d.mts.map +1 -0
- package/dist/jsx/components/formatting/Italic.mjs +17 -0
- package/dist/jsx/components/formatting/Italic.mjs.map +1 -0
- package/dist/jsx/components/formatting/index.cjs +19 -0
- package/dist/jsx/components/formatting/index.cjs.map +1 -0
- package/dist/jsx/components/formatting/index.d.cts +6 -0
- package/dist/jsx/components/formatting/index.d.cts.map +1 -0
- package/dist/jsx/components/formatting/index.d.mts +6 -0
- package/dist/jsx/components/formatting/index.d.mts.map +1 -0
- package/dist/jsx/components/formatting/index.mjs +3 -0
- package/dist/jsx/components/formatting/index.mjs.map +1 -0
- package/dist/jsx/components/index.cjs +36 -0
- package/dist/jsx/components/index.cjs.map +1 -0
- package/dist/jsx/components/index.d.cts +43 -0
- package/dist/jsx/components/index.d.cts.map +1 -0
- package/dist/jsx/components/index.d.mts +43 -0
- package/dist/jsx/components/index.d.mts.map +1 -0
- package/dist/jsx/components/index.mjs +20 -0
- package/dist/jsx/components/index.mjs.map +1 -0
- package/dist/jsx/index.cjs +31 -0
- package/dist/jsx/index.cjs.map +1 -0
- package/dist/jsx/index.d.cts +6 -0
- package/dist/jsx/index.d.cts.map +1 -0
- package/dist/jsx/index.d.mts +6 -0
- package/dist/jsx/index.d.mts.map +1 -0
- package/dist/jsx/index.mjs +5 -586
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/jsx-dev-runtime.cjs +27 -0
- package/dist/jsx/jsx-dev-runtime.cjs.map +1 -0
- package/dist/{types/jsx/jsx-dev-runtime.d.ts → jsx/jsx-dev-runtime.d.cts} +2 -1
- package/dist/jsx/jsx-dev-runtime.d.cts.map +1 -0
- package/dist/jsx/jsx-dev-runtime.d.mts +18 -0
- package/dist/jsx/jsx-dev-runtime.d.mts.map +1 -0
- package/dist/jsx/jsx-dev-runtime.mjs +21 -414
- package/dist/jsx/jsx-dev-runtime.mjs.map +1 -1
- package/dist/jsx/jsx-runtime.cjs +54 -0
- package/dist/jsx/jsx-runtime.cjs.map +1 -0
- package/dist/{types/jsx/jsx-runtime.d.ts → jsx/jsx-runtime.d.cts} +2 -1
- package/dist/jsx/jsx-runtime.d.cts.map +1 -0
- package/dist/jsx/jsx-runtime.d.mts +36 -0
- package/dist/jsx/jsx-runtime.d.mts.map +1 -0
- package/dist/jsx/jsx-runtime.mjs +46 -21
- package/dist/jsx/jsx-runtime.mjs.map +1 -1
- package/dist/jsx/validation.cjs +577 -0
- package/dist/jsx/validation.cjs.map +1 -0
- package/dist/{types/jsx/validation.d.ts → jsx/validation.d.cts} +55 -38
- package/dist/jsx/validation.d.cts.map +1 -0
- package/dist/jsx/validation.d.mts +247 -0
- package/dist/jsx/validation.d.mts.map +1 -0
- package/dist/jsx/validation.mjs +571 -0
- package/dist/jsx/validation.mjs.map +1 -0
- package/dist/types/caip.cjs +3 -0
- package/dist/types/caip.cjs.map +1 -0
- package/dist/types/{types/caip.d.ts → caip.d.cts} +1 -0
- package/dist/types/caip.d.cts.map +1 -0
- package/dist/types/caip.d.mts +13 -0
- package/dist/types/caip.d.mts.map +1 -0
- package/dist/types/caip.mjs +2 -0
- package/dist/types/caip.mjs.map +1 -0
- package/dist/types/global.cjs +3 -0
- package/dist/types/global.cjs.map +1 -0
- package/dist/types/{types/global.d.ts → global.d.cts} +2 -1
- package/dist/types/global.d.cts.map +1 -0
- package/dist/types/global.d.mts +9 -0
- package/dist/types/global.d.mts.map +1 -0
- package/dist/types/global.mjs +2 -0
- package/dist/types/global.mjs.map +1 -0
- package/dist/types/handlers/cronjob.cjs +3 -0
- package/dist/types/handlers/cronjob.cjs.map +1 -0
- package/dist/types/{types/handlers/cronjob.d.ts → handlers/cronjob.d.cts} +2 -1
- package/dist/types/handlers/cronjob.d.cts.map +1 -0
- package/dist/types/handlers/cronjob.d.mts +15 -0
- package/dist/types/handlers/cronjob.d.mts.map +1 -0
- package/dist/types/handlers/cronjob.mjs +2 -0
- package/dist/types/handlers/cronjob.mjs.map +1 -0
- package/dist/types/handlers/home-page.cjs +3 -0
- package/dist/types/handlers/home-page.cjs.map +1 -0
- package/dist/types/{types/handlers/home-page.d.ts → handlers/home-page.d.cts} +2 -1
- package/dist/types/handlers/home-page.d.cts.map +1 -0
- package/dist/types/handlers/home-page.d.mts +23 -0
- package/dist/types/handlers/home-page.d.mts.map +1 -0
- package/dist/types/handlers/home-page.mjs +2 -0
- package/dist/types/handlers/home-page.mjs.map +1 -0
- package/dist/types/handlers/index.cjs +26 -0
- package/dist/types/handlers/index.cjs.map +1 -0
- package/dist/types/handlers/index.d.cts +10 -0
- package/dist/types/handlers/index.d.cts.map +1 -0
- package/dist/types/handlers/index.d.mts +10 -0
- package/dist/types/handlers/index.d.mts.map +1 -0
- package/dist/types/handlers/index.mjs +10 -0
- package/dist/types/handlers/index.mjs.map +1 -0
- package/dist/types/handlers/keyring.cjs +3 -0
- package/dist/types/handlers/keyring.cjs.map +1 -0
- package/dist/types/{types/handlers/keyring.d.ts → handlers/keyring.d.cts} +2 -1
- package/dist/types/handlers/keyring.d.cts.map +1 -0
- package/dist/types/handlers/keyring.d.mts +21 -0
- package/dist/types/handlers/keyring.d.mts.map +1 -0
- package/dist/types/handlers/keyring.mjs +2 -0
- package/dist/types/handlers/keyring.mjs.map +1 -0
- package/dist/types/handlers/lifecycle.cjs +3 -0
- package/dist/types/handlers/lifecycle.cjs.map +1 -0
- package/dist/types/{types/handlers/lifecycle.d.ts → handlers/lifecycle.d.cts} +1 -0
- package/dist/types/handlers/lifecycle.d.cts.map +1 -0
- package/dist/types/handlers/lifecycle.d.mts +38 -0
- package/dist/types/handlers/lifecycle.d.mts.map +1 -0
- package/dist/types/handlers/lifecycle.mjs +2 -0
- package/dist/types/handlers/lifecycle.mjs.map +1 -0
- package/dist/types/handlers/name-lookup.cjs +3 -0
- package/dist/types/handlers/name-lookup.cjs.map +1 -0
- package/dist/types/{types/handlers/name-lookup.d.ts → handlers/name-lookup.d.cts} +3 -2
- package/dist/types/handlers/name-lookup.d.cts.map +1 -0
- package/dist/types/handlers/name-lookup.d.mts +82 -0
- package/dist/types/handlers/name-lookup.d.mts.map +1 -0
- package/dist/types/handlers/name-lookup.mjs +2 -0
- package/dist/types/handlers/name-lookup.mjs.map +1 -0
- package/dist/types/handlers/rpc-request.cjs +3 -0
- package/dist/types/handlers/rpc-request.cjs.map +1 -0
- package/dist/types/{types/handlers/rpc-request.d.ts → handlers/rpc-request.d.cts} +2 -1
- package/dist/types/handlers/rpc-request.d.cts.map +1 -0
- package/dist/types/handlers/rpc-request.d.mts +22 -0
- package/dist/types/handlers/rpc-request.d.mts.map +1 -0
- package/dist/types/handlers/rpc-request.mjs +2 -0
- package/dist/types/handlers/rpc-request.mjs.map +1 -0
- package/dist/types/handlers/signature.cjs +3 -0
- package/dist/types/handlers/signature.cjs.map +1 -0
- package/dist/types/{types/handlers/signature.d.ts → handlers/signature.d.cts} +4 -3
- package/dist/types/handlers/signature.d.cts.map +1 -0
- package/dist/types/handlers/signature.d.mts +112 -0
- package/dist/types/handlers/signature.d.mts.map +1 -0
- package/dist/types/handlers/signature.mjs +2 -0
- package/dist/types/handlers/signature.mjs.map +1 -0
- package/dist/types/handlers/transaction.cjs +15 -0
- package/dist/types/handlers/transaction.cjs.map +1 -0
- package/dist/types/{types/handlers/transaction.d.ts → handlers/transaction.d.cts} +4 -3
- package/dist/types/handlers/transaction.d.cts.map +1 -0
- package/dist/types/handlers/transaction.d.mts +115 -0
- package/dist/types/handlers/transaction.d.mts.map +1 -0
- package/dist/types/handlers/transaction.mjs +12 -0
- package/dist/types/handlers/transaction.mjs.map +1 -0
- package/dist/types/handlers/user-input.cjs +56 -0
- package/dist/types/handlers/user-input.cjs.map +1 -0
- package/dist/types/{types/handlers/user-input.d.ts → handlers/user-input.d.cts} +11 -10
- package/dist/types/handlers/user-input.d.cts.map +1 -0
- package/dist/types/handlers/user-input.d.mts +196 -0
- package/dist/types/handlers/user-input.d.mts.map +1 -0
- package/dist/types/handlers/user-input.mjs +53 -0
- package/dist/types/handlers/user-input.mjs.map +1 -0
- package/dist/types/images.cjs +2 -0
- package/dist/types/images.cjs.map +1 -0
- package/dist/types/{types/images.d.ts → images.d.cts} +1 -0
- package/dist/types/images.d.cts.map +1 -0
- package/dist/types/images.d.mts +13 -0
- package/dist/types/images.d.mts.map +1 -0
- package/dist/types/images.mjs +2 -0
- package/dist/types/images.mjs.map +1 -0
- package/dist/types/index.cjs +29 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +10 -0
- package/dist/types/index.d.cts.map +1 -0
- package/dist/types/index.d.mts +10 -0
- package/dist/types/index.d.mts.map +1 -0
- package/dist/types/index.mjs +13 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/interface.cjs +26 -0
- package/dist/types/interface.cjs.map +1 -0
- package/dist/types/{types/interface.d.ts → interface.d.cts} +27 -26
- package/dist/types/interface.d.cts.map +1 -0
- package/dist/types/interface.d.mts +120 -0
- package/dist/types/interface.d.mts.map +1 -0
- package/dist/types/interface.mjs +23 -0
- package/dist/types/interface.mjs.map +1 -0
- package/dist/types/methods/create-interface.cjs +3 -0
- package/dist/types/methods/create-interface.cjs.map +1 -0
- package/dist/types/{types/methods/create-interface.d.ts → methods/create-interface.d.cts} +2 -1
- package/dist/types/methods/create-interface.d.cts.map +1 -0
- package/dist/types/methods/create-interface.d.mts +15 -0
- package/dist/types/methods/create-interface.d.mts.map +1 -0
- package/dist/types/methods/create-interface.mjs +2 -0
- package/dist/types/methods/create-interface.mjs.map +1 -0
- package/dist/types/methods/dialog.cjs +18 -0
- package/dist/types/methods/dialog.cjs.map +1 -0
- package/dist/types/{types/methods/dialog.d.ts → methods/dialog.d.cts} +4 -3
- package/dist/types/methods/dialog.d.cts.map +1 -0
- package/dist/types/methods/dialog.d.mts +88 -0
- package/dist/types/methods/dialog.d.mts.map +1 -0
- package/dist/types/methods/dialog.mjs +15 -0
- package/dist/types/methods/dialog.mjs.map +1 -0
- package/dist/types/methods/get-bip32-entropy.cjs +3 -0
- package/dist/types/methods/get-bip32-entropy.cjs.map +1 -0
- package/dist/types/{types/methods/get-bip32-entropy.d.ts → methods/get-bip32-entropy.d.cts} +3 -2
- package/dist/types/methods/get-bip32-entropy.d.cts.map +1 -0
- package/dist/types/methods/get-bip32-entropy.d.mts +16 -0
- package/dist/types/methods/get-bip32-entropy.d.mts.map +1 -0
- package/dist/types/methods/get-bip32-entropy.mjs +2 -0
- package/dist/types/methods/get-bip32-entropy.mjs.map +1 -0
- package/dist/types/methods/get-bip32-public-key.cjs +3 -0
- package/dist/types/methods/get-bip32-public-key.cjs.map +1 -0
- package/dist/types/{types/methods/get-bip32-public-key.d.ts → methods/get-bip32-public-key.d.cts} +2 -1
- package/dist/types/methods/get-bip32-public-key.d.cts.map +1 -0
- package/dist/types/methods/get-bip32-public-key.d.mts +20 -0
- package/dist/types/methods/get-bip32-public-key.d.mts.map +1 -0
- package/dist/types/methods/get-bip32-public-key.mjs +2 -0
- package/dist/types/methods/get-bip32-public-key.mjs.map +1 -0
- package/dist/types/methods/get-bip44-entropy.cjs +3 -0
- package/dist/types/methods/get-bip44-entropy.cjs.map +1 -0
- package/dist/types/{types/methods/get-bip44-entropy.d.ts → methods/get-bip44-entropy.d.cts} +3 -2
- package/dist/types/methods/get-bip44-entropy.d.cts.map +1 -0
- package/dist/types/methods/get-bip44-entropy.d.mts +15 -0
- package/dist/types/methods/get-bip44-entropy.d.mts.map +1 -0
- package/dist/types/methods/get-bip44-entropy.mjs +2 -0
- package/dist/types/methods/get-bip44-entropy.mjs.map +1 -0
- package/dist/types/methods/get-client-status.cjs +3 -0
- package/dist/types/methods/get-client-status.cjs.map +1 -0
- package/dist/types/{types/methods/get-client-status.d.ts → methods/get-client-status.d.cts} +1 -0
- package/dist/types/methods/get-client-status.d.cts.map +1 -0
- package/dist/types/methods/get-client-status.d.mts +15 -0
- package/dist/types/methods/get-client-status.d.mts.map +1 -0
- package/dist/types/methods/get-client-status.mjs +2 -0
- package/dist/types/methods/get-client-status.mjs.map +1 -0
- package/dist/types/methods/get-entropy.cjs +3 -0
- package/dist/types/methods/get-entropy.cjs.map +1 -0
- package/dist/types/{types/methods/get-entropy.d.ts → methods/get-entropy.d.cts} +2 -1
- package/dist/types/methods/get-entropy.d.cts.map +1 -0
- package/dist/types/methods/get-entropy.d.mts +17 -0
- package/dist/types/methods/get-entropy.d.mts.map +1 -0
- package/dist/types/methods/get-entropy.mjs +2 -0
- package/dist/types/methods/get-entropy.mjs.map +1 -0
- package/dist/types/methods/get-file.cjs +13 -0
- package/dist/types/methods/get-file.cjs.map +1 -0
- package/dist/types/{types/methods/get-file.d.ts → methods/get-file.d.cts} +2 -1
- package/dist/types/methods/get-file.d.cts.map +1 -0
- package/dist/types/methods/get-file.d.mts +24 -0
- package/dist/types/methods/get-file.d.mts.map +1 -0
- package/dist/types/methods/get-file.mjs +10 -0
- package/dist/types/methods/get-file.mjs.map +1 -0
- package/dist/types/methods/get-interface-state.cjs +3 -0
- package/dist/types/methods/get-interface-state.cjs.map +1 -0
- package/dist/types/{types/methods/get-interface-state.d.ts → methods/get-interface-state.d.cts} +2 -1
- package/dist/types/methods/get-interface-state.d.cts.map +1 -0
- package/dist/types/methods/get-interface-state.d.mts +14 -0
- package/dist/types/methods/get-interface-state.d.mts.map +1 -0
- package/dist/types/methods/get-interface-state.mjs +2 -0
- package/dist/types/methods/get-interface-state.mjs.map +1 -0
- package/dist/types/methods/get-locale.cjs +3 -0
- package/dist/types/methods/get-locale.cjs.map +1 -0
- package/dist/types/{types/methods/get-locale.d.ts → methods/get-locale.d.cts} +1 -0
- package/dist/types/methods/get-locale.d.cts.map +1 -0
- package/dist/types/methods/get-locale.d.mts +13 -0
- package/dist/types/methods/get-locale.d.mts.map +1 -0
- package/dist/types/methods/get-locale.mjs +2 -0
- package/dist/types/methods/get-locale.mjs.map +1 -0
- package/dist/types/methods/get-preferences.cjs +3 -0
- package/dist/types/methods/get-preferences.cjs.map +1 -0
- package/dist/types/{types/methods/get-preferences.d.ts → methods/get-preferences.d.cts} +1 -0
- package/dist/types/methods/get-preferences.d.cts.map +1 -0
- package/dist/types/methods/get-preferences.d.mts +16 -0
- package/dist/types/methods/get-preferences.d.mts.map +1 -0
- package/dist/types/methods/get-preferences.mjs +2 -0
- package/dist/types/methods/get-preferences.mjs.map +1 -0
- package/dist/types/methods/get-snaps.cjs +3 -0
- package/dist/types/methods/get-snaps.cjs.map +1 -0
- package/dist/types/{types/methods/get-snaps.d.ts → methods/get-snaps.d.cts} +3 -2
- package/dist/types/methods/get-snaps.d.cts.map +1 -0
- package/dist/types/methods/get-snaps.d.mts +17 -0
- package/dist/types/methods/get-snaps.d.mts.map +1 -0
- package/dist/types/methods/get-snaps.mjs +2 -0
- package/dist/types/methods/get-snaps.mjs.map +1 -0
- package/dist/types/methods/index.cjs +38 -0
- package/dist/types/methods/index.cjs.map +1 -0
- package/dist/types/methods/index.d.cts +22 -0
- package/dist/types/methods/index.d.cts.map +1 -0
- package/dist/types/methods/index.d.mts +22 -0
- package/dist/types/methods/index.d.mts.map +1 -0
- package/dist/types/methods/index.mjs +22 -0
- package/dist/types/methods/index.mjs.map +1 -0
- package/dist/types/methods/invoke-keyring.cjs +3 -0
- package/dist/types/methods/invoke-keyring.cjs.map +1 -0
- package/dist/types/{types/methods/invoke-keyring.d.ts → methods/invoke-keyring.d.cts} +3 -2
- package/dist/types/methods/invoke-keyring.d.cts.map +1 -0
- package/dist/types/methods/invoke-keyring.d.mts +15 -0
- package/dist/types/methods/invoke-keyring.d.mts.map +1 -0
- package/dist/types/methods/invoke-keyring.mjs +2 -0
- package/dist/types/methods/invoke-keyring.mjs.map +1 -0
- package/dist/types/methods/invoke-snap.cjs +3 -0
- package/dist/types/methods/invoke-snap.cjs.map +1 -0
- package/dist/types/{types/methods/invoke-snap.d.ts → methods/invoke-snap.d.cts} +2 -1
- package/dist/types/methods/invoke-snap.d.cts.map +1 -0
- package/dist/types/methods/invoke-snap.d.mts +17 -0
- package/dist/types/methods/invoke-snap.d.mts.map +1 -0
- package/dist/types/methods/invoke-snap.mjs +2 -0
- package/dist/types/methods/invoke-snap.mjs.map +1 -0
- package/dist/types/methods/manage-accounts.cjs +3 -0
- package/dist/types/methods/manage-accounts.cjs.map +1 -0
- package/dist/types/{types/methods/manage-accounts.d.ts → methods/manage-accounts.d.cts} +2 -1
- package/dist/types/methods/manage-accounts.d.cts.map +1 -0
- package/dist/types/methods/manage-accounts.d.mts +19 -0
- package/dist/types/methods/manage-accounts.d.mts.map +1 -0
- package/dist/types/methods/manage-accounts.mjs +2 -0
- package/dist/types/methods/manage-accounts.mjs.map +1 -0
- package/dist/types/methods/manage-state.cjs +13 -0
- package/dist/types/methods/manage-state.cjs.map +1 -0
- package/dist/types/{types/methods/manage-state.d.ts → methods/manage-state.d.cts} +3 -2
- package/dist/types/methods/manage-state.d.cts.map +1 -0
- package/dist/types/methods/manage-state.d.mts +70 -0
- package/dist/types/methods/manage-state.d.mts.map +1 -0
- package/dist/types/methods/manage-state.mjs +10 -0
- package/dist/types/methods/manage-state.mjs.map +1 -0
- package/dist/types/methods/methods.cjs +3 -0
- package/dist/types/methods/methods.cjs.map +1 -0
- package/dist/types/{types/methods/methods.d.ts → methods/methods.d.cts} +22 -21
- package/dist/types/methods/methods.d.cts.map +1 -0
- package/dist/types/methods/methods.d.mts +75 -0
- package/dist/types/methods/methods.d.mts.map +1 -0
- package/dist/types/methods/methods.mjs +2 -0
- package/dist/types/methods/methods.mjs.map +1 -0
- package/dist/types/methods/notify.cjs +15 -0
- package/dist/types/methods/notify.cjs.map +1 -0
- package/dist/types/{types/methods/notify.d.ts → methods/notify.d.cts} +2 -1
- package/dist/types/methods/notify.d.cts.map +1 -0
- package/dist/types/methods/notify.d.mts +28 -0
- package/dist/types/methods/notify.d.mts.map +1 -0
- package/dist/types/methods/notify.mjs +12 -0
- package/dist/types/methods/notify.mjs.map +1 -0
- package/dist/types/methods/request-snaps.cjs +3 -0
- package/dist/types/methods/request-snaps.cjs.map +1 -0
- package/dist/types/{types/methods/request-snaps.d.ts → methods/request-snaps.d.cts} +3 -2
- package/dist/types/methods/request-snaps.d.cts.map +1 -0
- package/dist/types/methods/request-snaps.d.mts +19 -0
- package/dist/types/methods/request-snaps.d.mts.map +1 -0
- package/dist/types/methods/request-snaps.mjs +2 -0
- package/dist/types/methods/request-snaps.mjs.map +1 -0
- package/dist/types/methods/resolve-interface.cjs +3 -0
- package/dist/types/methods/resolve-interface.cjs.map +1 -0
- package/dist/types/{types/methods/resolve-interface.d.ts → methods/resolve-interface.d.cts} +2 -1
- package/dist/types/methods/resolve-interface.d.cts.map +1 -0
- package/dist/types/methods/resolve-interface.d.mts +16 -0
- package/dist/types/methods/resolve-interface.d.mts.map +1 -0
- package/dist/types/methods/resolve-interface.mjs +2 -0
- package/dist/types/methods/resolve-interface.mjs.map +1 -0
- package/dist/types/methods/update-interface.cjs +3 -0
- package/dist/types/methods/update-interface.cjs.map +1 -0
- package/dist/types/{types/methods/update-interface.d.ts → methods/update-interface.d.cts} +2 -1
- package/dist/types/methods/update-interface.d.cts.map +1 -0
- package/dist/types/methods/update-interface.d.mts +16 -0
- package/dist/types/methods/update-interface.d.mts.map +1 -0
- package/dist/types/methods/update-interface.mjs +2 -0
- package/dist/types/methods/update-interface.mjs.map +1 -0
- package/dist/types/permissions.cjs +3 -0
- package/dist/types/permissions.cjs.map +1 -0
- package/dist/types/{types/permissions.d.ts → permissions.d.cts} +4 -3
- package/dist/types/permissions.d.cts.map +1 -0
- package/dist/types/permissions.d.mts +75 -0
- package/dist/types/permissions.d.mts.map +1 -0
- package/dist/types/permissions.mjs +2 -0
- package/dist/types/permissions.mjs.map +1 -0
- package/dist/types/provider.cjs +3 -0
- package/dist/types/provider.cjs.map +1 -0
- package/dist/types/{types/provider.d.ts → provider.d.cts} +3 -2
- package/dist/types/provider.d.cts.map +1 -0
- package/dist/types/provider.d.mts +15 -0
- package/dist/types/provider.d.mts.map +1 -0
- package/dist/types/provider.mjs +2 -0
- package/dist/types/provider.mjs.map +1 -0
- package/dist/types/snap.cjs +3 -0
- package/dist/types/snap.cjs.map +1 -0
- package/dist/types/{types/snap.d.ts → snap.d.cts} +3 -2
- package/dist/types/snap.d.cts.map +1 -0
- package/dist/types/snap.d.mts +13 -0
- package/dist/types/snap.d.mts.map +1 -0
- package/dist/types/snap.mjs +2 -0
- package/dist/types/snap.mjs.map +1 -0
- package/dist/ui/builder.cjs +49 -0
- package/dist/ui/builder.cjs.map +1 -0
- package/dist/{types/ui/builder.d.ts → ui/builder.d.cts} +4 -3
- package/dist/ui/builder.d.cts.map +1 -0
- package/dist/ui/builder.d.mts +43 -0
- package/dist/ui/builder.d.mts.map +1 -0
- package/dist/ui/builder.mjs +45 -0
- package/dist/ui/builder.mjs.map +1 -0
- package/dist/ui/component.cjs +29 -0
- package/dist/ui/component.cjs.map +1 -0
- package/dist/{types/ui/component.d.ts → ui/component.d.cts} +2 -1
- package/dist/ui/component.d.cts.map +1 -0
- package/dist/ui/component.d.mts +18 -0
- package/dist/ui/component.d.mts.map +1 -0
- package/dist/ui/component.mjs +24 -0
- package/dist/ui/component.mjs.map +1 -0
- package/dist/ui/components/address.cjs +28 -0
- package/dist/ui/components/address.cjs.map +1 -0
- package/dist/{types/ui/components/address.d.ts → ui/components/address.d.cts} +6 -5
- package/dist/ui/components/address.d.cts.map +1 -0
- package/dist/ui/components/address.d.mts +37 -0
- package/dist/ui/components/address.d.mts.map +1 -0
- package/dist/ui/components/address.mjs +25 -0
- package/dist/ui/components/address.mjs.map +1 -0
- package/dist/ui/components/button.cjs +52 -0
- package/dist/ui/components/button.cjs.map +1 -0
- package/dist/{types/ui/components/button.d.ts → ui/components/button.d.cts} +9 -8
- package/dist/ui/components/button.d.cts.map +1 -0
- package/dist/ui/components/button.d.mts +65 -0
- package/dist/ui/components/button.d.mts.map +1 -0
- package/dist/ui/components/button.mjs +49 -0
- package/dist/ui/components/button.mjs.map +1 -0
- package/dist/ui/components/copyable.cjs +32 -0
- package/dist/ui/components/copyable.cjs.map +1 -0
- package/dist/{types/ui/components/copyable.d.ts → ui/components/copyable.d.cts} +6 -5
- package/dist/ui/components/copyable.d.cts.map +1 -0
- package/dist/ui/components/copyable.d.mts +49 -0
- package/dist/ui/components/copyable.d.mts.map +1 -0
- package/dist/ui/components/copyable.mjs +29 -0
- package/dist/ui/components/copyable.mjs.map +1 -0
- package/dist/ui/components/divider.cjs +20 -0
- package/dist/ui/components/divider.cjs.map +1 -0
- package/dist/{types/ui/components/divider.d.ts → ui/components/divider.d.cts} +3 -2
- package/dist/ui/components/divider.d.cts.map +1 -0
- package/dist/ui/components/divider.d.mts +24 -0
- package/dist/ui/components/divider.d.mts.map +1 -0
- package/dist/ui/components/divider.mjs +17 -0
- package/dist/ui/components/divider.mjs.map +1 -0
- package/dist/ui/components/form.cjs +41 -0
- package/dist/ui/components/form.cjs.map +1 -0
- package/dist/{types/ui/components/form.d.ts → ui/components/form.d.cts} +31 -30
- package/dist/ui/components/form.d.cts.map +1 -0
- package/dist/ui/components/form.d.mts +154 -0
- package/dist/ui/components/form.d.mts.map +1 -0
- package/dist/ui/components/form.mjs +38 -0
- package/dist/ui/components/form.mjs.map +1 -0
- package/dist/ui/components/heading.cjs +27 -0
- package/dist/ui/components/heading.cjs.map +1 -0
- package/dist/{types/ui/components/heading.d.ts → ui/components/heading.d.cts} +6 -5
- package/dist/ui/components/heading.d.cts.map +1 -0
- package/dist/ui/components/heading.d.mts +39 -0
- package/dist/ui/components/heading.d.mts.map +1 -0
- package/dist/ui/components/heading.mjs +24 -0
- package/dist/ui/components/heading.mjs.map +1 -0
- package/dist/ui/components/image.cjs +27 -0
- package/dist/ui/components/image.cjs.map +1 -0
- package/dist/{types/ui/components/image.d.ts → ui/components/image.d.cts} +6 -5
- package/dist/ui/components/image.d.cts.map +1 -0
- package/dist/ui/components/image.d.mts +38 -0
- package/dist/ui/components/image.d.mts.map +1 -0
- package/dist/ui/components/image.mjs +24 -0
- package/dist/ui/components/image.mjs.map +1 -0
- package/dist/ui/components/index.cjs +35 -0
- package/dist/ui/components/index.cjs.map +1 -0
- package/dist/ui/components/index.d.cts +15 -0
- package/dist/ui/components/index.d.cts.map +1 -0
- package/dist/ui/components/index.d.mts +15 -0
- package/dist/ui/components/index.d.mts.map +1 -0
- package/dist/ui/components/index.mjs +13 -0
- package/dist/ui/components/index.mjs.map +1 -0
- package/dist/ui/components/input.cjs +60 -0
- package/dist/ui/components/input.cjs.map +1 -0
- package/dist/{types/ui/components/input.d.ts → ui/components/input.d.cts} +9 -8
- package/dist/ui/components/input.d.cts.map +1 -0
- package/dist/ui/components/input.d.mts +78 -0
- package/dist/ui/components/input.d.mts.map +1 -0
- package/dist/ui/components/input.mjs +57 -0
- package/dist/ui/components/input.mjs.map +1 -0
- package/dist/ui/components/panel.cjs +72 -0
- package/dist/ui/components/panel.cjs.map +1 -0
- package/dist/{types/ui/components/panel.d.ts → ui/components/panel.d.cts} +88 -87
- package/dist/ui/components/panel.d.cts.map +1 -0
- package/dist/ui/components/panel.d.mts +406 -0
- package/dist/ui/components/panel.d.mts.map +1 -0
- package/dist/ui/components/panel.mjs +69 -0
- package/dist/ui/components/panel.mjs.map +1 -0
- package/dist/ui/components/row.cjs +51 -0
- package/dist/ui/components/row.cjs.map +1 -0
- package/dist/{types/ui/components/row.d.ts → ui/components/row.d.cts} +21 -20
- package/dist/ui/components/row.d.cts.map +1 -0
- package/dist/ui/components/row.d.mts +107 -0
- package/dist/ui/components/row.d.mts.map +1 -0
- package/dist/ui/components/row.mjs +48 -0
- package/dist/ui/components/row.mjs.map +1 -0
- package/dist/ui/components/spinner.cjs +20 -0
- package/dist/ui/components/spinner.cjs.map +1 -0
- package/dist/{types/ui/components/spinner.d.ts → ui/components/spinner.d.cts} +3 -2
- package/dist/ui/components/spinner.d.cts.map +1 -0
- package/dist/ui/components/spinner.d.mts +25 -0
- package/dist/ui/components/spinner.d.mts.map +1 -0
- package/dist/ui/components/spinner.mjs +17 -0
- package/dist/ui/components/spinner.mjs.map +1 -0
- package/dist/ui/components/text.cjs +34 -0
- package/dist/ui/components/text.cjs.map +1 -0
- package/dist/{types/ui/components/text.d.ts → ui/components/text.d.cts} +6 -5
- package/dist/ui/components/text.d.cts.map +1 -0
- package/dist/ui/components/text.d.mts +49 -0
- package/dist/ui/components/text.d.mts.map +1 -0
- package/dist/ui/components/text.mjs +31 -0
- package/dist/ui/components/text.mjs.map +1 -0
- package/dist/ui/index.cjs +22 -0
- package/dist/ui/index.cjs.map +1 -0
- package/dist/ui/index.d.cts +4 -0
- package/dist/ui/index.d.cts.map +1 -0
- package/dist/ui/index.d.mts +4 -0
- package/dist/ui/index.d.mts.map +1 -0
- package/dist/ui/index.mjs +4 -0
- package/dist/ui/index.mjs.map +1 -0
- package/dist/ui/nodes.cjs +38 -0
- package/dist/ui/nodes.cjs.map +1 -0
- package/dist/{types/ui/nodes.d.ts → ui/nodes.d.cts} +3 -2
- package/dist/ui/nodes.d.cts.map +1 -0
- package/dist/ui/nodes.d.mts +57 -0
- package/dist/ui/nodes.d.mts.map +1 -0
- package/dist/ui/nodes.mjs +35 -0
- package/dist/ui/nodes.mjs.map +1 -0
- package/jsx-dev-runtime.d.ts +3 -1
- package/jsx-dev-runtime.js +1 -1
- package/jsx-runtime.d.ts +3 -1
- package/jsx-runtime.js +1 -1
- package/jsx.d.ts +3 -1
- package/jsx.js +1 -1
- package/package.json +42 -27
- package/dist/index.js +0 -1142
- package/dist/index.js.map +0 -1
- package/dist/jsx/index.js +0 -587
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/jsx-dev-runtime.js +0 -416
- package/dist/jsx/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx/jsx-runtime.js +0 -45
- package/dist/jsx/jsx-runtime.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/index.d.ts +0 -9
- package/dist/types/internals/index.d.ts +0 -6
- package/dist/types/jsx/components/Address.d.ts +0 -28
- package/dist/types/jsx/components/form/index.d.ts +0 -21
- package/dist/types/jsx/components/formatting/index.d.ts +0 -5
- package/dist/types/jsx/components/index.d.ts +0 -38
- package/dist/types/jsx/index.d.ts +0 -5
- package/dist/types/types/handlers/index.d.ts +0 -9
- package/dist/types/types/index.d.ts +0 -9
- package/dist/types/types/methods/index.d.ts +0 -21
- package/dist/types/ui/components/index.d.ts +0 -14
- package/dist/types/ui/index.d.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.cjs","sourceRoot":"","sources":["../../src/jsx/validation.ts"],"names":[],"mappings":";;;AAOA,uDAa+B;AAC/B,2CAMyB;AAGzB,sDAMsB;AAWtB,uDAmCsB;AAEtB;;GAEG;AACU,QAAA,SAAS,GAAkB,IAAA,qBAAS,EAAC,CAAC,IAAA,oBAAM,GAAE,EAAE,IAAA,oBAAM,GAAE,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wCAAwC,IAAI,CAAC,SAAS,CACpD,KAAK,CACN,qFAAqF,CACvF,CAAC;IACJ,CAAC;AACH,CAAC;AAXD,4CAWC","sourcesContent":["import type {\n AnyStruct,\n Infer,\n InferStructTuple,\n ObjectSchema,\n Struct,\n} from '@metamask/superstruct';\nimport {\n is,\n boolean,\n optional,\n array,\n lazy,\n nullable,\n number,\n object,\n record,\n string,\n tuple,\n refine,\n} from '@metamask/superstruct';\nimport {\n CaipAccountIdStruct,\n hasProperty,\n HexChecksumAddressStruct,\n isPlainObject,\n JsonStruct,\n} from '@metamask/utils';\n\nimport type { Describe } from '../internals';\nimport {\n literal,\n nullUnion,\n selectiveUnion,\n svg,\n typedUnion,\n} from '../internals';\nimport type { EmptyObject } from '../types';\nimport type {\n GenericSnapElement,\n JsonObject,\n Key,\n Nestable,\n SnapElement,\n SnapsChildren,\n StringElement,\n} from './component';\nimport {\n type AddressElement,\n type BoldElement,\n type BoxElement,\n type ButtonElement,\n type CheckboxElement,\n type CardElement,\n type CopyableElement,\n type DividerElement,\n type DropdownElement,\n type OptionElement,\n type RadioElement,\n type RadioGroupElement,\n type FieldElement,\n type FormElement,\n type HeadingElement,\n type ImageElement,\n type InputElement,\n type ItalicElement,\n type JSXElement,\n type LinkElement,\n type RowElement,\n type SpinnerElement,\n type StandardFormattingElement,\n type TextElement,\n type TooltipElement,\n type ValueElement,\n type FileInputElement,\n type ContainerElement,\n type FooterElement,\n type IconElement,\n type SectionElement,\n type SelectorElement,\n type SelectorOptionElement,\n IconName,\n} from './components';\n\n/**\n * A struct for the {@link Key} type.\n */\nexport const KeyStruct: Describe<Key> = nullUnion([string(), number()]);\n\n/**\n * A struct for the {@link StringElement} type.\n */\nexport const StringElementStruct: Describe<StringElement> = children([\n string(),\n]);\n\n/**\n * A struct for the {@link GenericSnapElement} type.\n */\nexport const ElementStruct: Describe<GenericSnapElement> = object({\n type: string(),\n props: record(string(), JsonStruct),\n key: nullable(KeyStruct),\n});\n\n/**\n * A helper function for creating a struct for a {@link Nestable} type.\n *\n * @param struct - The struct for the type to test.\n * @returns The struct for the nestable type.\n */\nfunction nestable<Type, Schema>(\n struct: Struct<Type, Schema>,\n): Struct<Nestable<Type>, any> {\n const nestableStruct: Struct<Nestable<Type>> = selectiveUnion((value) => {\n if (Array.isArray(value)) {\n return array(lazy(() => nestableStruct));\n }\n return struct;\n });\n\n return nestableStruct;\n}\n\n/**\n * A helper function for creating a struct which allows children of a specific\n * type, as well as `null` and `boolean`.\n *\n * @param structs - The structs to allow as children.\n * @returns The struct for the children.\n */\nfunction children<Head extends AnyStruct, Tail extends AnyStruct[]>(\n structs: [head: Head, ...tail: Tail],\n): Struct<\n Nestable<Infer<Head> | InferStructTuple<Tail>[number] | boolean | null>,\n null\n> {\n return nestable(\n nullable(\n selectiveUnion((value) => {\n if (typeof value === 'boolean') {\n return boolean();\n }\n if (structs.length === 1) {\n return structs[0];\n }\n return nullUnion(structs);\n }),\n ),\n ) as unknown as Struct<\n Nestable<Infer<Head> | InferStructTuple<Tail>[number] | boolean | null>,\n null\n >;\n}\n\n/**\n * A helper function for creating a struct for a JSX element.\n *\n * @param name - The name of the element.\n * @param props - The props of the element.\n * @returns The struct for the element.\n */\nfunction element<Name extends string, Props extends ObjectSchema = EmptyObject>(\n name: Name,\n props: Props = {} as Props,\n) {\n return object({\n type: literal(name) as unknown as Struct<Name, Name>,\n props: object(props),\n key: nullable(KeyStruct),\n });\n}\n\n/**\n * A struct for the {@link ImageElement} type.\n */\nexport const ImageStruct: Describe<ImageElement> = element('Image', {\n src: svg(),\n alt: optional(string()),\n});\n\nconst IconNameStruct: Struct<`${IconName}`, null> = nullUnion(\n Object.values(IconName).map((name) => literal(name)) as any,\n);\n\n/**\n * A struct for the {@link IconElement} type.\n */\nexport const IconStruct: Describe<IconElement> = element('Icon', {\n name: IconNameStruct,\n color: optional(\n nullUnion([literal('default'), literal('primary'), literal('muted')]),\n ),\n size: optional(nullUnion([literal('md'), literal('inherit')])),\n});\n\n/**\n * A struct for the {@link ButtonElement} type.\n */\nexport const ButtonStruct: Describe<ButtonElement> = element('Button', {\n children: children([StringElementStruct, ImageStruct, IconStruct]),\n name: optional(string()),\n type: optional(nullUnion([literal('button'), literal('submit')])),\n variant: optional(nullUnion([literal('primary'), literal('destructive')])),\n disabled: optional(boolean()),\n});\n\n/**\n * A struct for the {@link CheckboxElement} type.\n */\nexport const CheckboxStruct: Describe<CheckboxElement> = element('Checkbox', {\n name: string(),\n checked: optional(boolean()),\n label: optional(string()),\n variant: optional(nullUnion([literal('default'), literal('toggle')])),\n});\n\n/**\n * A struct for the {@link InputElement} type.\n */\nexport const InputStruct: Describe<InputElement> = element('Input', {\n name: string(),\n type: optional(\n nullUnion([literal('text'), literal('password'), literal('number')]),\n ),\n value: optional(string()),\n placeholder: optional(string()),\n});\n\n/**\n * A struct for the {@link OptionElement} type.\n */\nexport const OptionStruct: Describe<OptionElement> = element('Option', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link DropdownElement} type.\n */\nexport const DropdownStruct: Describe<DropdownElement> = element('Dropdown', {\n name: string(),\n value: optional(string()),\n children: children([OptionStruct]),\n});\n\n/**\n * A struct for the {@link CardElement} type.\n */\nexport const CardStruct: Describe<CardElement> = element('Card', {\n image: optional(string()),\n title: string(),\n description: optional(string()),\n value: string(),\n extra: optional(string()),\n});\n\n/**\n * A struct for the {@link SelectorOptionElement} type.\n */\nexport const SelectorOptionStruct: Describe<SelectorOptionElement> = element(\n 'SelectorOption',\n {\n value: string(),\n children: CardStruct,\n },\n);\n\n/**\n * A struct for the {@link SelectorElement} type.\n */\nexport const SelectorStruct: Describe<SelectorElement> = element('Selector', {\n name: string(),\n title: string(),\n value: optional(string()),\n children: children([SelectorOptionStruct]),\n});\n\n/**\n * A struct for the {@link RadioElement} type.\n */\nexport const RadioStruct: Describe<RadioElement> = element('Radio', {\n value: string(),\n children: string(),\n});\n\n/**\n * A struct for the {@link RadioGroupElement} type.\n */\nexport const RadioGroupStruct: Describe<RadioGroupElement> = element(\n 'RadioGroup',\n {\n name: string(),\n value: optional(string()),\n children: children([RadioStruct]),\n },\n);\n\n/**\n * A struct for the {@link FileInputElement} type.\n */\nexport const FileInputStruct: Describe<FileInputElement> = element(\n 'FileInput',\n {\n name: string(),\n accept: nullUnion([optional(array(string()))]),\n compact: optional(boolean()),\n },\n);\n\n/**\n * A subset of JSX elements that represent the tuple Box + Input of the Field children.\n */\n// eslint-disable-next-line @typescript-eslint/no-use-before-define\nconst BOX_INPUT_LEFT = [lazy(() => BoxChildStruct), InputStruct] as [\n typeof BoxChildStruct,\n typeof InputStruct,\n];\n\n/**\n * A subset of JSX elements that represent the tuple Input + Box of the Field children.\n */\n// eslint-disable-next-line @typescript-eslint/no-use-before-define\nconst BOX_INPUT_RIGHT = [InputStruct, lazy(() => BoxChildStruct)] as [\n typeof InputStruct,\n typeof BoxChildStruct,\n];\n\n/**\n * A subset of JSX elements that represent the tuple Box + Input + Box of the Field children.\n */\nconst BOX_INPUT_BOTH = [\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoxChildStruct),\n InputStruct,\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoxChildStruct),\n] as [typeof BoxChildStruct, typeof InputStruct, typeof BoxChildStruct];\n\n/**\n * A subset of JSX elements that are allowed as single children of the Field component.\n */\nconst FIELD_CHILDREN_ARRAY = [\n InputStruct,\n DropdownStruct,\n RadioGroupStruct,\n FileInputStruct,\n CheckboxStruct,\n SelectorStruct,\n] as [\n typeof InputStruct,\n typeof DropdownStruct,\n typeof RadioGroupStruct,\n typeof FileInputStruct,\n typeof CheckboxStruct,\n typeof SelectorStruct,\n];\n\n/**\n * A union of the allowed children of the Field component.\n * This is mainly used in the simulator for validation purposes.\n */\nexport const FieldChildUnionStruct = nullUnion([\n ...FIELD_CHILDREN_ARRAY,\n ...BOX_INPUT_LEFT,\n ...BOX_INPUT_RIGHT,\n ...BOX_INPUT_BOTH,\n]);\n\n/**\n * A subset of JSX elements that are allowed as children of the Field component.\n */\nconst FieldChildStruct = nullUnion([\n tuple(BOX_INPUT_LEFT),\n tuple(BOX_INPUT_RIGHT),\n tuple(BOX_INPUT_BOTH),\n ...FIELD_CHILDREN_ARRAY,\n]) as unknown as Struct<\n | [InputElement, GenericSnapElement]\n | [GenericSnapElement, InputElement]\n | [GenericSnapElement, InputElement, GenericSnapElement]\n | DropdownElement\n | RadioGroupElement\n | FileInputElement\n | InputElement\n | CheckboxElement\n | SelectorElement,\n null\n>;\n\n/**\n * A struct for the {@link FieldElement} type.\n */\nexport const FieldStruct: Describe<FieldElement> = element('Field', {\n label: optional(string()),\n error: optional(string()),\n children: FieldChildStruct,\n});\n\n/**\n * A subset of JSX elements that are allowed as children of the Form component.\n */\nexport const FormChildStruct = children(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n [FieldStruct, lazy(() => BoxChildStruct)],\n) as unknown as Struct<SnapsChildren<GenericSnapElement>, null>;\n\n/**\n * A struct for the {@link FormElement} type.\n */\nexport const FormStruct: Describe<FormElement> = element('Form', {\n children: FormChildStruct,\n name: string(),\n});\n\n/**\n * A struct for the {@link BoldElement} type.\n */\nexport const BoldStruct: Describe<BoldElement> = element('Bold', {\n children: children([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => ItalicStruct) as unknown as Struct<\n SnapElement<JsonObject, 'Italic'>\n >,\n ]),\n});\n\n/**\n * A struct for the {@link ItalicElement} type.\n */\nexport const ItalicStruct: Describe<ItalicElement> = element('Italic', {\n children: children([\n string(),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n lazy(() => BoldStruct) as unknown as Struct<\n SnapElement<JsonObject, 'Bold'>\n >,\n ]),\n});\n\nexport const FormattingStruct: Describe<StandardFormattingElement> = typedUnion(\n [BoldStruct, ItalicStruct],\n);\n\n/**\n * A struct for the {@link AddressElement} type.\n */\nexport const AddressStruct: Describe<AddressElement> = element('Address', {\n address: nullUnion([HexChecksumAddressStruct, CaipAccountIdStruct]),\n});\n\nexport const BoxChildrenStruct = children(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n [lazy(() => BoxChildStruct)],\n) as unknown as Struct<SnapsChildren<GenericSnapElement>, null>;\n\n/**\n * A struct for the {@link BoxElement} type.\n */\nexport const BoxStruct: Describe<BoxElement> = element('Box', {\n children: BoxChildrenStruct,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\nconst FooterButtonStruct = refine(ButtonStruct, 'FooterButton', (value) => {\n if (\n typeof value.props.children === 'string' ||\n typeof value.props.children === 'boolean' ||\n value.props.children === null\n ) {\n return true;\n }\n\n if (Array.isArray(value.props.children)) {\n const hasNonTextElements = value.props.children.some(\n (child) =>\n typeof child !== 'string' &&\n typeof child !== 'boolean' &&\n child !== null,\n );\n\n if (!hasNonTextElements) {\n return true;\n }\n }\n\n return 'Footer buttons may only contain text.';\n});\n\n/**\n * A struct for the {@link SectionElement} type.\n */\nexport const SectionStruct: Describe<SectionElement> = element('Section', {\n children: BoxChildrenStruct,\n direction: optional(nullUnion([literal('horizontal'), literal('vertical')])),\n alignment: optional(\n nullUnion([\n literal('start'),\n literal('center'),\n literal('end'),\n literal('space-between'),\n literal('space-around'),\n ]),\n ),\n});\n\n/**\n * A subset of JSX elements that are allowed as children of the Footer component.\n * This set should include a single button or a tuple of two buttons.\n */\n\nexport const FooterChildStruct = selectiveUnion((value) => {\n if (Array.isArray(value)) {\n return tuple([FooterButtonStruct, FooterButtonStruct]);\n }\n return FooterButtonStruct;\n});\n\n/**\n * A struct for the {@link FooterElement} type.\n */\nexport const FooterStruct: Describe<FooterElement> = element('Footer', {\n children: FooterChildStruct,\n});\n\n/**\n * A struct for the {@link CopyableElement} type.\n */\nexport const CopyableStruct: Describe<CopyableElement> = element('Copyable', {\n value: string(),\n sensitive: optional(boolean()),\n});\n\n/**\n * A struct for the {@link DividerElement} type.\n */\nexport const DividerStruct: Describe<DividerElement> = element('Divider');\n\n/**\n * A struct for the {@link ValueElement} type.\n */\nexport const ValueStruct: Describe<ValueElement> = element('Value', {\n value: string(),\n extra: string(),\n});\n\n/**\n * A struct for the {@link HeadingElement} type.\n */\nexport const HeadingStruct: Describe<HeadingElement> = element('Heading', {\n children: StringElementStruct,\n});\n\n/**\n * A struct for the {@link LinkElement} type.\n */\nexport const LinkStruct: Describe<LinkElement> = element('Link', {\n href: string(),\n children: children([FormattingStruct, string()]),\n});\n\n/**\n * A struct for the {@link TextElement} type.\n */\nexport const TextStruct: Describe<TextElement> = element('Text', {\n children: children([\n selectiveUnion((value) => {\n if (typeof value === 'string') {\n return string();\n }\n return typedUnion([BoldStruct, ItalicStruct, LinkStruct, IconStruct]);\n }),\n ]),\n alignment: optional(\n nullUnion([literal('start'), literal('center'), literal('end')]),\n ),\n color: optional(\n nullUnion([\n literal('default'),\n literal('alternative'),\n literal('muted'),\n literal('error'),\n literal('success'),\n literal('warning'),\n ]),\n ),\n});\n\n/**\n * A subset of JSX elements that are allowed as children of the Tooltip component.\n * This set should include all text components and the Image.\n */\nexport const TooltipChildStruct = selectiveUnion((value) => {\n if (typeof value === 'boolean') {\n return boolean();\n }\n return typedUnion([\n TextStruct,\n BoldStruct,\n ItalicStruct,\n LinkStruct,\n ImageStruct,\n IconStruct,\n ]);\n});\n\n/**\n * A subset of JSX elements that are allowed as content of the Tooltip component.\n * This set should include all text components.\n */\nexport const TooltipContentStruct = selectiveUnion((value) => {\n if (typeof value === 'string') {\n return string();\n }\n return typedUnion([\n TextStruct,\n BoldStruct,\n ItalicStruct,\n LinkStruct,\n IconStruct,\n ]);\n});\n\n/**\n * A struct for the {@link TooltipElement} type.\n */\nexport const TooltipStruct: Describe<TooltipElement> = element('Tooltip', {\n children: nullable(TooltipChildStruct),\n content: TooltipContentStruct,\n});\n\n/**\n * A struct for the {@link RowElement} type.\n */\nexport const RowStruct: Describe<RowElement> = element('Row', {\n label: string(),\n children: typedUnion([AddressStruct, ImageStruct, TextStruct, ValueStruct]),\n variant: optional(\n nullUnion([literal('default'), literal('warning'), literal('critical')]),\n ),\n tooltip: optional(string()),\n});\n\n/**\n * A struct for the {@link SpinnerElement} type.\n */\nexport const SpinnerStruct: Describe<SpinnerElement> = element('Spinner');\n\n/**\n * A subset of JSX elements that are allowed as children of the Box component.\n * This set includes all components, except components that need to be nested in\n * another component (e.g., Field must be contained in a Form).\n */\nexport const BoxChildStruct = typedUnion([\n AddressStruct,\n BoldStruct,\n BoxStruct,\n ButtonStruct,\n CopyableStruct,\n DividerStruct,\n DropdownStruct,\n RadioGroupStruct,\n FileInputStruct,\n FormStruct,\n HeadingStruct,\n InputStruct,\n ImageStruct,\n ItalicStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n TooltipStruct,\n CheckboxStruct,\n CardStruct,\n IconStruct,\n SelectorStruct,\n SectionStruct,\n]);\n\n/**\n * A struct for the {@link ContainerElement} type.\n */\nexport const ContainerStruct: Describe<ContainerElement> = element(\n 'Container',\n {\n children: selectiveUnion((value) => {\n if (Array.isArray(value)) {\n return tuple([BoxChildStruct, FooterStruct]);\n }\n return BoxChildStruct;\n }) as unknown as Struct<\n [GenericSnapElement, FooterElement] | GenericSnapElement,\n null\n >,\n },\n);\n\n/**\n * For now, the allowed JSX elements at the root are the same as the allowed\n * children of the Box component.\n */\nexport const RootJSXElementStruct = typedUnion([\n BoxChildStruct,\n ContainerStruct,\n]);\n\n/**\n * A struct for the {@link JSXElement} type.\n */\nexport const JSXElementStruct: Describe<JSXElement> = typedUnion([\n ButtonStruct,\n InputStruct,\n FileInputStruct,\n FieldStruct,\n FormStruct,\n BoldStruct,\n ItalicStruct,\n AddressStruct,\n BoxStruct,\n CopyableStruct,\n DividerStruct,\n HeadingStruct,\n ImageStruct,\n LinkStruct,\n RowStruct,\n SpinnerStruct,\n TextStruct,\n DropdownStruct,\n OptionStruct,\n RadioGroupStruct,\n RadioStruct,\n ValueStruct,\n TooltipStruct,\n CheckboxStruct,\n FooterStruct,\n ContainerStruct,\n CardStruct,\n IconStruct,\n SelectorStruct,\n SelectorOptionStruct,\n SectionStruct,\n]);\n\n/**\n * Check if a value is a JSX element.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElement(value: unknown): value is JSXElement {\n return is(value, JSXElementStruct);\n}\n\n/**\n * Check if a value is a JSX element, without validating all of its contents.\n * This is useful when you want to validate the structure of a value, but not\n * all the children.\n *\n * This should only be used when you are sure that the value is safe to use,\n * i.e., after using {@link isJSXElement}.\n *\n * @param value - The value to check.\n * @returns True if the value is a JSX element, false otherwise.\n */\nexport function isJSXElementUnsafe(value: unknown): value is JSXElement {\n return (\n isPlainObject(value) &&\n hasProperty(value, 'type') &&\n hasProperty(value, 'props') &&\n hasProperty(value, 'key')\n );\n}\n\n/**\n * Assert that a value is a JSX element.\n *\n * @param value - The value to check.\n * @throws If the value is not a JSX element.\n */\nexport function assertJSXElement(value: unknown): asserts value is JSXElement {\n // TODO: We should use the error parsing utils from `snaps-utils` to improve\n // the error messages. It currently includes colours and potentially other\n // formatting that we might not want to include in the SDK.\n if (!isJSXElement(value)) {\n throw new Error(\n `Expected a JSX element, but received ${JSON.stringify(\n value,\n )}. Please refer to the documentation for the supported JSX elements and their props.`,\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Struct } from
|
|
2
|
-
import type { Describe } from
|
|
3
|
-
import type { GenericSnapElement, Key, SnapElement, SnapsChildren, StringElement } from
|
|
4
|
-
import type
|
|
1
|
+
import type { Struct } from "@metamask/superstruct";
|
|
2
|
+
import type { Describe } from "../internals/index.cjs";
|
|
3
|
+
import type { GenericSnapElement, Key, SnapElement, SnapsChildren, StringElement } from "./component.cjs";
|
|
4
|
+
import { type AddressElement, type BoldElement, type BoxElement, type ButtonElement, type CheckboxElement, type CardElement, type CopyableElement, type DividerElement, type DropdownElement, type OptionElement, type RadioElement, type RadioGroupElement, type FieldElement, type FormElement, type HeadingElement, type ImageElement, type InputElement, type ItalicElement, type JSXElement, type LinkElement, type RowElement, type SpinnerElement, type StandardFormattingElement, type TextElement, type TooltipElement, type ValueElement, type FileInputElement, type ContainerElement, type FooterElement, type IconElement, type SectionElement, type SelectorElement, type SelectorOptionElement } from "./components/index.cjs";
|
|
5
5
|
/**
|
|
6
6
|
* A struct for the {@link Key} type.
|
|
7
7
|
*/
|
|
@@ -14,6 +14,14 @@ export declare const StringElementStruct: Describe<StringElement>;
|
|
|
14
14
|
* A struct for the {@link GenericSnapElement} type.
|
|
15
15
|
*/
|
|
16
16
|
export declare const ElementStruct: Describe<GenericSnapElement>;
|
|
17
|
+
/**
|
|
18
|
+
* A struct for the {@link ImageElement} type.
|
|
19
|
+
*/
|
|
20
|
+
export declare const ImageStruct: Describe<ImageElement>;
|
|
21
|
+
/**
|
|
22
|
+
* A struct for the {@link IconElement} type.
|
|
23
|
+
*/
|
|
24
|
+
export declare const IconStruct: Describe<IconElement>;
|
|
17
25
|
/**
|
|
18
26
|
* A struct for the {@link ButtonElement} type.
|
|
19
27
|
*/
|
|
@@ -34,6 +42,18 @@ export declare const OptionStruct: Describe<OptionElement>;
|
|
|
34
42
|
* A struct for the {@link DropdownElement} type.
|
|
35
43
|
*/
|
|
36
44
|
export declare const DropdownStruct: Describe<DropdownElement>;
|
|
45
|
+
/**
|
|
46
|
+
* A struct for the {@link CardElement} type.
|
|
47
|
+
*/
|
|
48
|
+
export declare const CardStruct: Describe<CardElement>;
|
|
49
|
+
/**
|
|
50
|
+
* A struct for the {@link SelectorOptionElement} type.
|
|
51
|
+
*/
|
|
52
|
+
export declare const SelectorOptionStruct: Describe<SelectorOptionElement>;
|
|
53
|
+
/**
|
|
54
|
+
* A struct for the {@link SelectorElement} type.
|
|
55
|
+
*/
|
|
56
|
+
export declare const SelectorStruct: Describe<SelectorElement>;
|
|
37
57
|
/**
|
|
38
58
|
* A struct for the {@link RadioElement} type.
|
|
39
59
|
*/
|
|
@@ -50,14 +70,19 @@ export declare const FileInputStruct: Describe<FileInputElement>;
|
|
|
50
70
|
* A union of the allowed children of the Field component.
|
|
51
71
|
* This is mainly used in the simulator for validation purposes.
|
|
52
72
|
*/
|
|
53
|
-
export declare const FieldChildUnionStruct: Struct<SnapElement<import("./components").
|
|
73
|
+
export declare const FieldChildUnionStruct: Struct<SnapElement<import("./components").IconProps, "Icon"> | SnapElement<{
|
|
74
|
+
src: string;
|
|
75
|
+
alt?: string | undefined;
|
|
76
|
+
}, "Image"> | SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").FormProps, "Form"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<{
|
|
54
77
|
name: string;
|
|
55
78
|
value?: string | undefined;
|
|
56
79
|
children: SnapsChildren<SnapElement<{
|
|
57
80
|
value: string;
|
|
58
81
|
children: string;
|
|
59
82
|
}, "Radio">>;
|
|
60
|
-
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput">,
|
|
83
|
+
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").CardProps, "Card"> | SnapElement<import("./components").SelectorProps, "Selector"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").AddressProps, "Address"> | SnapElement<import("./components").BoxProps, "Box"> | SnapElement<import("./components").CopyableProps, "Copyable"> | SnapElement<Record<string, never>, "Divider"> | SnapElement<{
|
|
84
|
+
children: StringElement;
|
|
85
|
+
}, "Heading"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text"> | SnapElement<import("./components").RowProps, "Row"> | SnapElement<import("./components").SectionProps, "Section"> | SnapElement<Record<string, never>, "Spinner"> | SnapElement<import("./components").TooltipProps, "Tooltip">, null>;
|
|
61
86
|
/**
|
|
62
87
|
* A struct for the {@link FieldElement} type.
|
|
63
88
|
*/
|
|
@@ -88,6 +113,10 @@ export declare const BoxChildrenStruct: Struct<SnapsChildren<GenericSnapElement>
|
|
|
88
113
|
* A struct for the {@link BoxElement} type.
|
|
89
114
|
*/
|
|
90
115
|
export declare const BoxStruct: Describe<BoxElement>;
|
|
116
|
+
/**
|
|
117
|
+
* A struct for the {@link SectionElement} type.
|
|
118
|
+
*/
|
|
119
|
+
export declare const SectionStruct: Describe<SectionElement>;
|
|
91
120
|
/**
|
|
92
121
|
* A subset of JSX elements that are allowed as children of the Footer component.
|
|
93
122
|
* This set should include a single button or a tuple of two buttons.
|
|
@@ -97,15 +126,6 @@ export declare const FooterChildStruct: Struct<SnapElement<import("./components"
|
|
|
97
126
|
* A struct for the {@link FooterElement} type.
|
|
98
127
|
*/
|
|
99
128
|
export declare const FooterStruct: Describe<FooterElement>;
|
|
100
|
-
/**
|
|
101
|
-
* A subset of JSX elements that are allowed as children of the Container component.
|
|
102
|
-
* This set should include a single Box or a tuple of a Box and a Footer component.
|
|
103
|
-
*/
|
|
104
|
-
export declare const ContainerChildStruct: Struct<SnapElement<import("./components").BoxProps, "Box"> | [SnapElement<import("./components").BoxProps, "Box">, SnapElement<import("./components").FooterProps, "Footer">], null>;
|
|
105
|
-
/**
|
|
106
|
-
* A struct for the {@link ContainerElement} type.
|
|
107
|
-
*/
|
|
108
|
-
export declare const ContainerStruct: Describe<ContainerElement>;
|
|
109
129
|
/**
|
|
110
130
|
* A struct for the {@link CopyableElement} type.
|
|
111
131
|
*/
|
|
@@ -118,18 +138,10 @@ export declare const DividerStruct: Describe<DividerElement>;
|
|
|
118
138
|
* A struct for the {@link ValueElement} type.
|
|
119
139
|
*/
|
|
120
140
|
export declare const ValueStruct: Describe<ValueElement>;
|
|
121
|
-
/**
|
|
122
|
-
* A struct for the {@link CardElement} type.
|
|
123
|
-
*/
|
|
124
|
-
export declare const CardStruct: Describe<CardElement>;
|
|
125
141
|
/**
|
|
126
142
|
* A struct for the {@link HeadingElement} type.
|
|
127
143
|
*/
|
|
128
144
|
export declare const HeadingStruct: Describe<HeadingElement>;
|
|
129
|
-
/**
|
|
130
|
-
* A struct for the {@link ImageElement} type.
|
|
131
|
-
*/
|
|
132
|
-
export declare const ImageStruct: Describe<ImageElement>;
|
|
133
145
|
/**
|
|
134
146
|
* A struct for the {@link LinkElement} type.
|
|
135
147
|
*/
|
|
@@ -142,15 +154,15 @@ export declare const TextStruct: Describe<TextElement>;
|
|
|
142
154
|
* A subset of JSX elements that are allowed as children of the Tooltip component.
|
|
143
155
|
* This set should include all text components and the Image.
|
|
144
156
|
*/
|
|
145
|
-
export declare const TooltipChildStruct: Struct<boolean | SnapElement<import("./components").
|
|
157
|
+
export declare const TooltipChildStruct: Struct<boolean | SnapElement<import("./components").IconProps, "Icon"> | SnapElement<{
|
|
146
158
|
src: string;
|
|
147
159
|
alt?: string | undefined;
|
|
148
|
-
}, "Image"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text">, null>;
|
|
160
|
+
}, "Image"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text">, null>;
|
|
149
161
|
/**
|
|
150
162
|
* A subset of JSX elements that are allowed as content of the Tooltip component.
|
|
151
163
|
* This set should include all text components.
|
|
152
164
|
*/
|
|
153
|
-
export declare const TooltipContentStruct: Struct<string | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text">, null>;
|
|
165
|
+
export declare const TooltipContentStruct: Struct<string | SnapElement<import("./components").IconProps, "Icon"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text">, null>;
|
|
154
166
|
/**
|
|
155
167
|
* A struct for the {@link TooltipElement} type.
|
|
156
168
|
*/
|
|
@@ -168,36 +180,40 @@ export declare const SpinnerStruct: Describe<SpinnerElement>;
|
|
|
168
180
|
* This set includes all components, except components that need to be nested in
|
|
169
181
|
* another component (e.g., Field must be contained in a Form).
|
|
170
182
|
*/
|
|
171
|
-
export declare const BoxChildStruct: Struct<SnapElement<import("./components").
|
|
183
|
+
export declare const BoxChildStruct: Struct<SnapElement<import("./components").IconProps, "Icon"> | SnapElement<{
|
|
184
|
+
src: string;
|
|
185
|
+
alt?: string | undefined;
|
|
186
|
+
}, "Image"> | SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").FormProps, "Form"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<{
|
|
172
187
|
name: string;
|
|
173
188
|
value?: string | undefined;
|
|
174
189
|
children: SnapsChildren<SnapElement<{
|
|
175
190
|
value: string;
|
|
176
191
|
children: string;
|
|
177
192
|
}, "Radio">>;
|
|
178
|
-
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").
|
|
193
|
+
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").CardProps, "Card"> | SnapElement<import("./components").SelectorProps, "Selector"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").AddressProps, "Address"> | SnapElement<import("./components").BoxProps, "Box"> | SnapElement<import("./components").CopyableProps, "Copyable"> | SnapElement<Record<string, never>, "Divider"> | SnapElement<{
|
|
179
194
|
children: StringElement;
|
|
180
|
-
}, "Heading"> | SnapElement<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
195
|
+
}, "Heading"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text"> | SnapElement<import("./components").RowProps, "Row"> | SnapElement<import("./components").SectionProps, "Section"> | SnapElement<Record<string, never>, "Spinner"> | SnapElement<import("./components").TooltipProps, "Tooltip">, null>;
|
|
196
|
+
/**
|
|
197
|
+
* A struct for the {@link ContainerElement} type.
|
|
198
|
+
*/
|
|
199
|
+
export declare const ContainerStruct: Describe<ContainerElement>;
|
|
184
200
|
/**
|
|
185
201
|
* For now, the allowed JSX elements at the root are the same as the allowed
|
|
186
202
|
* children of the Box component.
|
|
187
203
|
*/
|
|
188
|
-
export declare const RootJSXElementStruct: Struct<SnapElement<import("./components").
|
|
204
|
+
export declare const RootJSXElementStruct: Struct<SnapElement<import("./components").IconProps, "Icon"> | SnapElement<{
|
|
205
|
+
src: string;
|
|
206
|
+
alt?: string | undefined;
|
|
207
|
+
}, "Image"> | SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").FormProps, "Form"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<{
|
|
189
208
|
name: string;
|
|
190
209
|
value?: string | undefined;
|
|
191
210
|
children: SnapsChildren<SnapElement<{
|
|
192
211
|
value: string;
|
|
193
212
|
children: string;
|
|
194
213
|
}, "Radio">>;
|
|
195
|
-
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").
|
|
214
|
+
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").CardProps, "Card"> | SnapElement<import("./components").SelectorProps, "Selector"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").AddressProps, "Address"> | SnapElement<import("./components").BoxProps, "Box"> | SnapElement<import("./components").ContainerProps, "Container"> | SnapElement<import("./components").CopyableProps, "Copyable"> | SnapElement<Record<string, never>, "Divider"> | SnapElement<{
|
|
196
215
|
children: StringElement;
|
|
197
|
-
}, "Heading"> | SnapElement<
|
|
198
|
-
src: string;
|
|
199
|
-
alt?: string | undefined;
|
|
200
|
-
}, "Image"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text"> | SnapElement<import("./components").RowProps, "Row"> | SnapElement<Record<string, never>, "Spinner"> | SnapElement<import("./components").TooltipProps, "Tooltip">, null>;
|
|
216
|
+
}, "Heading"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text"> | SnapElement<import("./components").RowProps, "Row"> | SnapElement<import("./components").SectionProps, "Section"> | SnapElement<Record<string, never>, "Spinner"> | SnapElement<import("./components").TooltipProps, "Tooltip">, null>;
|
|
201
217
|
/**
|
|
202
218
|
* A struct for the {@link JSXElement} type.
|
|
203
219
|
*/
|
|
@@ -228,3 +244,4 @@ export declare function isJSXElementUnsafe(value: unknown): value is JSXElement;
|
|
|
228
244
|
* @throws If the value is not a JSX element.
|
|
229
245
|
*/
|
|
230
246
|
export declare function assertJSXElement(value: unknown): asserts value is JSXElement;
|
|
247
|
+
//# sourceMappingURL=validation.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.cts","sourceRoot":"","sources":["../../src/jsx/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,MAAM,EACP,8BAA8B;AAuB/B,OAAO,KAAK,EAAE,QAAQ,EAAE,+BAAqB;AAS7C,OAAO,KAAK,EACV,kBAAkB,EAElB,GAAG,EAEH,WAAW,EACX,aAAa,EACb,aAAa,EACd,wBAAoB;AACrB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,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,CAOtE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,CAW5E"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import type { Struct } from "@metamask/superstruct";
|
|
2
|
+
import type { Describe } from "../internals/index.mjs";
|
|
3
|
+
import type { GenericSnapElement, Key, SnapElement, SnapsChildren, StringElement } from "./component.mjs";
|
|
4
|
+
import { type AddressElement, type BoldElement, type BoxElement, type ButtonElement, type CheckboxElement, type CardElement, type CopyableElement, type DividerElement, type DropdownElement, type OptionElement, type RadioElement, type RadioGroupElement, type FieldElement, type FormElement, type HeadingElement, type ImageElement, type InputElement, type ItalicElement, type JSXElement, type LinkElement, type RowElement, type SpinnerElement, type StandardFormattingElement, type TextElement, type TooltipElement, type ValueElement, type FileInputElement, type ContainerElement, type FooterElement, type IconElement, type SectionElement, type SelectorElement, type SelectorOptionElement } from "./components/index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* A struct for the {@link Key} type.
|
|
7
|
+
*/
|
|
8
|
+
export declare const KeyStruct: Describe<Key>;
|
|
9
|
+
/**
|
|
10
|
+
* A struct for the {@link StringElement} type.
|
|
11
|
+
*/
|
|
12
|
+
export declare const StringElementStruct: Describe<StringElement>;
|
|
13
|
+
/**
|
|
14
|
+
* A struct for the {@link GenericSnapElement} type.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ElementStruct: Describe<GenericSnapElement>;
|
|
17
|
+
/**
|
|
18
|
+
* A struct for the {@link ImageElement} type.
|
|
19
|
+
*/
|
|
20
|
+
export declare const ImageStruct: Describe<ImageElement>;
|
|
21
|
+
/**
|
|
22
|
+
* A struct for the {@link IconElement} type.
|
|
23
|
+
*/
|
|
24
|
+
export declare const IconStruct: Describe<IconElement>;
|
|
25
|
+
/**
|
|
26
|
+
* A struct for the {@link ButtonElement} type.
|
|
27
|
+
*/
|
|
28
|
+
export declare const ButtonStruct: Describe<ButtonElement>;
|
|
29
|
+
/**
|
|
30
|
+
* A struct for the {@link CheckboxElement} type.
|
|
31
|
+
*/
|
|
32
|
+
export declare const CheckboxStruct: Describe<CheckboxElement>;
|
|
33
|
+
/**
|
|
34
|
+
* A struct for the {@link InputElement} type.
|
|
35
|
+
*/
|
|
36
|
+
export declare const InputStruct: Describe<InputElement>;
|
|
37
|
+
/**
|
|
38
|
+
* A struct for the {@link OptionElement} type.
|
|
39
|
+
*/
|
|
40
|
+
export declare const OptionStruct: Describe<OptionElement>;
|
|
41
|
+
/**
|
|
42
|
+
* A struct for the {@link DropdownElement} type.
|
|
43
|
+
*/
|
|
44
|
+
export declare const DropdownStruct: Describe<DropdownElement>;
|
|
45
|
+
/**
|
|
46
|
+
* A struct for the {@link CardElement} type.
|
|
47
|
+
*/
|
|
48
|
+
export declare const CardStruct: Describe<CardElement>;
|
|
49
|
+
/**
|
|
50
|
+
* A struct for the {@link SelectorOptionElement} type.
|
|
51
|
+
*/
|
|
52
|
+
export declare const SelectorOptionStruct: Describe<SelectorOptionElement>;
|
|
53
|
+
/**
|
|
54
|
+
* A struct for the {@link SelectorElement} type.
|
|
55
|
+
*/
|
|
56
|
+
export declare const SelectorStruct: Describe<SelectorElement>;
|
|
57
|
+
/**
|
|
58
|
+
* A struct for the {@link RadioElement} type.
|
|
59
|
+
*/
|
|
60
|
+
export declare const RadioStruct: Describe<RadioElement>;
|
|
61
|
+
/**
|
|
62
|
+
* A struct for the {@link RadioGroupElement} type.
|
|
63
|
+
*/
|
|
64
|
+
export declare const RadioGroupStruct: Describe<RadioGroupElement>;
|
|
65
|
+
/**
|
|
66
|
+
* A struct for the {@link FileInputElement} type.
|
|
67
|
+
*/
|
|
68
|
+
export declare const FileInputStruct: Describe<FileInputElement>;
|
|
69
|
+
/**
|
|
70
|
+
* A union of the allowed children of the Field component.
|
|
71
|
+
* This is mainly used in the simulator for validation purposes.
|
|
72
|
+
*/
|
|
73
|
+
export declare const FieldChildUnionStruct: Struct<SnapElement<import("./components").IconProps, "Icon"> | SnapElement<{
|
|
74
|
+
src: string;
|
|
75
|
+
alt?: string | undefined;
|
|
76
|
+
}, "Image"> | SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").FormProps, "Form"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<{
|
|
77
|
+
name: string;
|
|
78
|
+
value?: string | undefined;
|
|
79
|
+
children: SnapsChildren<SnapElement<{
|
|
80
|
+
value: string;
|
|
81
|
+
children: string;
|
|
82
|
+
}, "Radio">>;
|
|
83
|
+
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").CardProps, "Card"> | SnapElement<import("./components").SelectorProps, "Selector"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").AddressProps, "Address"> | SnapElement<import("./components").BoxProps, "Box"> | SnapElement<import("./components").CopyableProps, "Copyable"> | SnapElement<Record<string, never>, "Divider"> | SnapElement<{
|
|
84
|
+
children: StringElement;
|
|
85
|
+
}, "Heading"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text"> | SnapElement<import("./components").RowProps, "Row"> | SnapElement<import("./components").SectionProps, "Section"> | SnapElement<Record<string, never>, "Spinner"> | SnapElement<import("./components").TooltipProps, "Tooltip">, null>;
|
|
86
|
+
/**
|
|
87
|
+
* A struct for the {@link FieldElement} type.
|
|
88
|
+
*/
|
|
89
|
+
export declare const FieldStruct: Describe<FieldElement>;
|
|
90
|
+
/**
|
|
91
|
+
* A subset of JSX elements that are allowed as children of the Form component.
|
|
92
|
+
*/
|
|
93
|
+
export declare const FormChildStruct: Struct<SnapsChildren<GenericSnapElement>, null>;
|
|
94
|
+
/**
|
|
95
|
+
* A struct for the {@link FormElement} type.
|
|
96
|
+
*/
|
|
97
|
+
export declare const FormStruct: Describe<FormElement>;
|
|
98
|
+
/**
|
|
99
|
+
* A struct for the {@link BoldElement} type.
|
|
100
|
+
*/
|
|
101
|
+
export declare const BoldStruct: Describe<BoldElement>;
|
|
102
|
+
/**
|
|
103
|
+
* A struct for the {@link ItalicElement} type.
|
|
104
|
+
*/
|
|
105
|
+
export declare const ItalicStruct: Describe<ItalicElement>;
|
|
106
|
+
export declare const FormattingStruct: Describe<StandardFormattingElement>;
|
|
107
|
+
/**
|
|
108
|
+
* A struct for the {@link AddressElement} type.
|
|
109
|
+
*/
|
|
110
|
+
export declare const AddressStruct: Describe<AddressElement>;
|
|
111
|
+
export declare const BoxChildrenStruct: Struct<SnapsChildren<GenericSnapElement>, null>;
|
|
112
|
+
/**
|
|
113
|
+
* A struct for the {@link BoxElement} type.
|
|
114
|
+
*/
|
|
115
|
+
export declare const BoxStruct: Describe<BoxElement>;
|
|
116
|
+
/**
|
|
117
|
+
* A struct for the {@link SectionElement} type.
|
|
118
|
+
*/
|
|
119
|
+
export declare const SectionStruct: Describe<SectionElement>;
|
|
120
|
+
/**
|
|
121
|
+
* A subset of JSX elements that are allowed as children of the Footer component.
|
|
122
|
+
* This set should include a single button or a tuple of two buttons.
|
|
123
|
+
*/
|
|
124
|
+
export declare const FooterChildStruct: Struct<SnapElement<import("./components").ButtonProps, "Button"> | [SnapElement<import("./components").ButtonProps, "Button">, SnapElement<import("./components").ButtonProps, "Button">], null>;
|
|
125
|
+
/**
|
|
126
|
+
* A struct for the {@link FooterElement} type.
|
|
127
|
+
*/
|
|
128
|
+
export declare const FooterStruct: Describe<FooterElement>;
|
|
129
|
+
/**
|
|
130
|
+
* A struct for the {@link CopyableElement} type.
|
|
131
|
+
*/
|
|
132
|
+
export declare const CopyableStruct: Describe<CopyableElement>;
|
|
133
|
+
/**
|
|
134
|
+
* A struct for the {@link DividerElement} type.
|
|
135
|
+
*/
|
|
136
|
+
export declare const DividerStruct: Describe<DividerElement>;
|
|
137
|
+
/**
|
|
138
|
+
* A struct for the {@link ValueElement} type.
|
|
139
|
+
*/
|
|
140
|
+
export declare const ValueStruct: Describe<ValueElement>;
|
|
141
|
+
/**
|
|
142
|
+
* A struct for the {@link HeadingElement} type.
|
|
143
|
+
*/
|
|
144
|
+
export declare const HeadingStruct: Describe<HeadingElement>;
|
|
145
|
+
/**
|
|
146
|
+
* A struct for the {@link LinkElement} type.
|
|
147
|
+
*/
|
|
148
|
+
export declare const LinkStruct: Describe<LinkElement>;
|
|
149
|
+
/**
|
|
150
|
+
* A struct for the {@link TextElement} type.
|
|
151
|
+
*/
|
|
152
|
+
export declare const TextStruct: Describe<TextElement>;
|
|
153
|
+
/**
|
|
154
|
+
* A subset of JSX elements that are allowed as children of the Tooltip component.
|
|
155
|
+
* This set should include all text components and the Image.
|
|
156
|
+
*/
|
|
157
|
+
export declare const TooltipChildStruct: Struct<boolean | SnapElement<import("./components").IconProps, "Icon"> | SnapElement<{
|
|
158
|
+
src: string;
|
|
159
|
+
alt?: string | undefined;
|
|
160
|
+
}, "Image"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text">, null>;
|
|
161
|
+
/**
|
|
162
|
+
* A subset of JSX elements that are allowed as content of the Tooltip component.
|
|
163
|
+
* This set should include all text components.
|
|
164
|
+
*/
|
|
165
|
+
export declare const TooltipContentStruct: Struct<string | SnapElement<import("./components").IconProps, "Icon"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text">, null>;
|
|
166
|
+
/**
|
|
167
|
+
* A struct for the {@link TooltipElement} type.
|
|
168
|
+
*/
|
|
169
|
+
export declare const TooltipStruct: Describe<TooltipElement>;
|
|
170
|
+
/**
|
|
171
|
+
* A struct for the {@link RowElement} type.
|
|
172
|
+
*/
|
|
173
|
+
export declare const RowStruct: Describe<RowElement>;
|
|
174
|
+
/**
|
|
175
|
+
* A struct for the {@link SpinnerElement} type.
|
|
176
|
+
*/
|
|
177
|
+
export declare const SpinnerStruct: Describe<SpinnerElement>;
|
|
178
|
+
/**
|
|
179
|
+
* A subset of JSX elements that are allowed as children of the Box component.
|
|
180
|
+
* This set includes all components, except components that need to be nested in
|
|
181
|
+
* another component (e.g., Field must be contained in a Form).
|
|
182
|
+
*/
|
|
183
|
+
export declare const BoxChildStruct: Struct<SnapElement<import("./components").IconProps, "Icon"> | SnapElement<{
|
|
184
|
+
src: string;
|
|
185
|
+
alt?: string | undefined;
|
|
186
|
+
}, "Image"> | SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").FormProps, "Form"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<{
|
|
187
|
+
name: string;
|
|
188
|
+
value?: string | undefined;
|
|
189
|
+
children: SnapsChildren<SnapElement<{
|
|
190
|
+
value: string;
|
|
191
|
+
children: string;
|
|
192
|
+
}, "Radio">>;
|
|
193
|
+
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").CardProps, "Card"> | SnapElement<import("./components").SelectorProps, "Selector"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").AddressProps, "Address"> | SnapElement<import("./components").BoxProps, "Box"> | SnapElement<import("./components").CopyableProps, "Copyable"> | SnapElement<Record<string, never>, "Divider"> | SnapElement<{
|
|
194
|
+
children: StringElement;
|
|
195
|
+
}, "Heading"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text"> | SnapElement<import("./components").RowProps, "Row"> | SnapElement<import("./components").SectionProps, "Section"> | SnapElement<Record<string, never>, "Spinner"> | SnapElement<import("./components").TooltipProps, "Tooltip">, null>;
|
|
196
|
+
/**
|
|
197
|
+
* A struct for the {@link ContainerElement} type.
|
|
198
|
+
*/
|
|
199
|
+
export declare const ContainerStruct: Describe<ContainerElement>;
|
|
200
|
+
/**
|
|
201
|
+
* For now, the allowed JSX elements at the root are the same as the allowed
|
|
202
|
+
* children of the Box component.
|
|
203
|
+
*/
|
|
204
|
+
export declare const RootJSXElementStruct: Struct<SnapElement<import("./components").IconProps, "Icon"> | SnapElement<{
|
|
205
|
+
src: string;
|
|
206
|
+
alt?: string | undefined;
|
|
207
|
+
}, "Image"> | SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").FormProps, "Form"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<{
|
|
208
|
+
name: string;
|
|
209
|
+
value?: string | undefined;
|
|
210
|
+
children: SnapsChildren<SnapElement<{
|
|
211
|
+
value: string;
|
|
212
|
+
children: string;
|
|
213
|
+
}, "Radio">>;
|
|
214
|
+
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").CardProps, "Card"> | SnapElement<import("./components").SelectorProps, "Selector"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").AddressProps, "Address"> | SnapElement<import("./components").BoxProps, "Box"> | SnapElement<import("./components").ContainerProps, "Container"> | SnapElement<import("./components").CopyableProps, "Copyable"> | SnapElement<Record<string, never>, "Divider"> | SnapElement<{
|
|
215
|
+
children: StringElement;
|
|
216
|
+
}, "Heading"> | SnapElement<import("./components").LinkProps, "Link"> | SnapElement<import("./components").TextProps, "Text"> | SnapElement<import("./components").RowProps, "Row"> | SnapElement<import("./components").SectionProps, "Section"> | SnapElement<Record<string, never>, "Spinner"> | SnapElement<import("./components").TooltipProps, "Tooltip">, null>;
|
|
217
|
+
/**
|
|
218
|
+
* A struct for the {@link JSXElement} type.
|
|
219
|
+
*/
|
|
220
|
+
export declare const JSXElementStruct: Describe<JSXElement>;
|
|
221
|
+
/**
|
|
222
|
+
* Check if a value is a JSX element.
|
|
223
|
+
*
|
|
224
|
+
* @param value - The value to check.
|
|
225
|
+
* @returns True if the value is a JSX element, false otherwise.
|
|
226
|
+
*/
|
|
227
|
+
export declare function isJSXElement(value: unknown): value is JSXElement;
|
|
228
|
+
/**
|
|
229
|
+
* Check if a value is a JSX element, without validating all of its contents.
|
|
230
|
+
* This is useful when you want to validate the structure of a value, but not
|
|
231
|
+
* all the children.
|
|
232
|
+
*
|
|
233
|
+
* This should only be used when you are sure that the value is safe to use,
|
|
234
|
+
* i.e., after using {@link isJSXElement}.
|
|
235
|
+
*
|
|
236
|
+
* @param value - The value to check.
|
|
237
|
+
* @returns True if the value is a JSX element, false otherwise.
|
|
238
|
+
*/
|
|
239
|
+
export declare function isJSXElementUnsafe(value: unknown): value is JSXElement;
|
|
240
|
+
/**
|
|
241
|
+
* Assert that a value is a JSX element.
|
|
242
|
+
*
|
|
243
|
+
* @param value - The value to check.
|
|
244
|
+
* @throws If the value is not a JSX element.
|
|
245
|
+
*/
|
|
246
|
+
export declare function assertJSXElement(value: unknown): asserts value is JSXElement;
|
|
247
|
+
//# sourceMappingURL=validation.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.mts","sourceRoot":"","sources":["../../src/jsx/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,MAAM,EACP,8BAA8B;AAuB/B,OAAO,KAAK,EAAE,QAAQ,EAAE,+BAAqB;AAS7C,OAAO,KAAK,EACV,kBAAkB,EAElB,GAAG,EAEH,WAAW,EACX,aAAa,EACb,aAAa,EACd,wBAAoB;AACrB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAA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