@metamask/snaps-sdk 6.16.0 → 6.17.1
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 +20 -1
- package/dist/error-wrappers.d.cts +192 -192
- package/dist/error-wrappers.d.mts +192 -192
- package/dist/internals/error-wrappers.d.cts +12 -12
- package/dist/internals/error-wrappers.d.mts +12 -12
- package/dist/jsx/components/Avatar.cjs +1 -0
- package/dist/jsx/components/Avatar.cjs.map +1 -1
- package/dist/jsx/components/Avatar.d.cts +2 -0
- package/dist/jsx/components/Avatar.d.cts.map +1 -1
- package/dist/jsx/components/Avatar.d.mts +2 -0
- package/dist/jsx/components/Avatar.d.mts.map +1 -1
- package/dist/jsx/components/Avatar.mjs +1 -0
- package/dist/jsx/components/Avatar.mjs.map +1 -1
- package/dist/jsx/components/form/Checkbox.cjs +1 -0
- package/dist/jsx/components/form/Checkbox.cjs.map +1 -1
- package/dist/jsx/components/form/Checkbox.d.cts +3 -0
- package/dist/jsx/components/form/Checkbox.d.cts.map +1 -1
- package/dist/jsx/components/form/Checkbox.d.mts +3 -0
- package/dist/jsx/components/form/Checkbox.d.mts.map +1 -1
- package/dist/jsx/components/form/Checkbox.mjs +1 -0
- package/dist/jsx/components/form/Checkbox.mjs.map +1 -1
- package/dist/jsx/components/form/Dropdown.cjs +1 -0
- package/dist/jsx/components/form/Dropdown.cjs.map +1 -1
- package/dist/jsx/components/form/Dropdown.d.cts +3 -0
- package/dist/jsx/components/form/Dropdown.d.cts.map +1 -1
- package/dist/jsx/components/form/Dropdown.d.mts +3 -0
- package/dist/jsx/components/form/Dropdown.d.mts.map +1 -1
- package/dist/jsx/components/form/Dropdown.mjs +1 -0
- package/dist/jsx/components/form/Dropdown.mjs.map +1 -1
- package/dist/jsx/components/form/FileInput.cjs +1 -0
- package/dist/jsx/components/form/FileInput.cjs.map +1 -1
- package/dist/jsx/components/form/FileInput.d.cts +3 -0
- package/dist/jsx/components/form/FileInput.d.cts.map +1 -1
- package/dist/jsx/components/form/FileInput.d.mts +3 -0
- package/dist/jsx/components/form/FileInput.d.mts.map +1 -1
- package/dist/jsx/components/form/FileInput.mjs +1 -0
- package/dist/jsx/components/form/FileInput.mjs.map +1 -1
- package/dist/jsx/components/form/Input.cjs +1 -0
- package/dist/jsx/components/form/Input.cjs.map +1 -1
- package/dist/jsx/components/form/Input.d.cts +2 -0
- package/dist/jsx/components/form/Input.d.cts.map +1 -1
- package/dist/jsx/components/form/Input.d.mts +2 -0
- package/dist/jsx/components/form/Input.d.mts.map +1 -1
- package/dist/jsx/components/form/Input.mjs +1 -0
- package/dist/jsx/components/form/Input.mjs.map +1 -1
- package/dist/jsx/components/form/Option.cjs +1 -0
- package/dist/jsx/components/form/Option.cjs.map +1 -1
- package/dist/jsx/components/form/Option.d.cts +3 -0
- package/dist/jsx/components/form/Option.d.cts.map +1 -1
- package/dist/jsx/components/form/Option.d.mts +3 -0
- package/dist/jsx/components/form/Option.d.mts.map +1 -1
- package/dist/jsx/components/form/Option.mjs +1 -0
- package/dist/jsx/components/form/Option.mjs.map +1 -1
- package/dist/jsx/components/form/Radio.cjs +1 -0
- package/dist/jsx/components/form/Radio.cjs.map +1 -1
- package/dist/jsx/components/form/Radio.d.cts +3 -0
- package/dist/jsx/components/form/Radio.d.cts.map +1 -1
- package/dist/jsx/components/form/Radio.d.mts +3 -0
- package/dist/jsx/components/form/Radio.d.mts.map +1 -1
- package/dist/jsx/components/form/Radio.mjs +1 -0
- package/dist/jsx/components/form/Radio.mjs.map +1 -1
- package/dist/jsx/components/form/RadioGroup.cjs +5 -0
- package/dist/jsx/components/form/RadioGroup.cjs.map +1 -1
- package/dist/jsx/components/form/RadioGroup.d.cts +8 -0
- package/dist/jsx/components/form/RadioGroup.d.cts.map +1 -1
- package/dist/jsx/components/form/RadioGroup.d.mts +8 -0
- package/dist/jsx/components/form/RadioGroup.d.mts.map +1 -1
- package/dist/jsx/components/form/RadioGroup.mjs +5 -0
- package/dist/jsx/components/form/RadioGroup.mjs.map +1 -1
- package/dist/jsx/components/form/Selector.cjs +1 -0
- package/dist/jsx/components/form/Selector.cjs.map +1 -1
- package/dist/jsx/components/form/Selector.d.cts +3 -0
- package/dist/jsx/components/form/Selector.d.cts.map +1 -1
- package/dist/jsx/components/form/Selector.d.mts +3 -0
- package/dist/jsx/components/form/Selector.d.mts.map +1 -1
- package/dist/jsx/components/form/Selector.mjs +1 -0
- package/dist/jsx/components/form/Selector.mjs.map +1 -1
- package/dist/jsx/components/form/SelectorOption.cjs +1 -0
- package/dist/jsx/components/form/SelectorOption.cjs.map +1 -1
- package/dist/jsx/components/form/SelectorOption.d.cts +3 -0
- package/dist/jsx/components/form/SelectorOption.d.cts.map +1 -1
- package/dist/jsx/components/form/SelectorOption.d.mts +3 -0
- package/dist/jsx/components/form/SelectorOption.d.mts.map +1 -1
- package/dist/jsx/components/form/SelectorOption.mjs +1 -0
- package/dist/jsx/components/form/SelectorOption.mjs.map +1 -1
- package/dist/jsx/validation.cjs +9 -0
- package/dist/jsx/validation.cjs.map +1 -1
- package/dist/jsx/validation.d.cts +14 -0
- package/dist/jsx/validation.d.cts.map +1 -1
- package/dist/jsx/validation.d.mts +14 -0
- package/dist/jsx/validation.d.mts.map +1 -1
- package/dist/jsx/validation.mjs +9 -0
- package/dist/jsx/validation.mjs.map +1 -1
- package/dist/types/handlers/assets-conversion.cjs +1 -1
- package/dist/types/handlers/assets-conversion.cjs.map +1 -1
- package/dist/types/handlers/assets-conversion.d.cts +4 -4
- package/dist/types/handlers/assets-conversion.d.cts.map +1 -1
- package/dist/types/handlers/assets-conversion.d.mts +4 -4
- package/dist/types/handlers/assets-conversion.d.mts.map +1 -1
- package/dist/types/handlers/assets-conversion.mjs +2 -2
- package/dist/types/handlers/assets-conversion.mjs.map +1 -1
- package/dist/types/handlers/assets-lookup.cjs +1 -1
- package/dist/types/handlers/assets-lookup.cjs.map +1 -1
- package/dist/types/handlers/assets-lookup.d.cts +4 -4
- package/dist/types/handlers/assets-lookup.d.cts.map +1 -1
- package/dist/types/handlers/assets-lookup.d.mts +4 -4
- package/dist/types/handlers/assets-lookup.d.mts.map +1 -1
- package/dist/types/handlers/assets-lookup.mjs +2 -2
- package/dist/types/handlers/assets-lookup.mjs.map +1 -1
- package/dist/types/handlers/index.cjs +1 -0
- package/dist/types/handlers/index.cjs.map +1 -1
- package/dist/types/handlers/index.d.cts +1 -0
- package/dist/types/handlers/index.d.cts.map +1 -1
- package/dist/types/handlers/index.d.mts +1 -0
- package/dist/types/handlers/index.d.mts.map +1 -1
- package/dist/types/handlers/index.mjs +1 -0
- package/dist/types/handlers/index.mjs.map +1 -1
- package/dist/types/handlers/protocol.cjs +3 -0
- package/dist/types/handlers/protocol.cjs.map +1 -0
- package/dist/types/handlers/protocol.d.cts +23 -0
- package/dist/types/handlers/protocol.d.cts.map +1 -0
- package/dist/types/handlers/protocol.d.mts +23 -0
- package/dist/types/handlers/protocol.d.mts.map +1 -0
- package/dist/types/handlers/protocol.mjs +2 -0
- package/dist/types/handlers/protocol.mjs.map +1 -0
- package/dist/types/interface.d.cts +2 -0
- package/dist/types/interface.d.cts.map +1 -1
- package/dist/types/interface.d.mts +2 -0
- package/dist/types/interface.d.mts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AACtD,6DAA6D;AAC7D,6CAAsC;
|
|
1
|
+
{"version":3,"file":"Option.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AACtD,6DAA6D;AAC7D,6CAAsC;AAgBtC,MAAM,IAAI,GAAG,QAAQ,CAAC;AAEtB;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,MAAM,GAAG,IAAA,+BAAmB,EAA2B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Dropdown } from './Dropdown';\n\n/**\n * The props of the {@link Option} component.\n *\n * @property value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @property children - The text to display.\n * @property disabled - Whether the option is disabled.\n */\ntype OptionProps = {\n value: string;\n children: string;\n disabled?: boolean;\n};\n\nconst TYPE = 'Option';\n\n/**\n * A dropdown option component, which is used to create a dropdown option. This component\n * can only be used as a child of the {@link Dropdown} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @param props.children - The text to display.\n * @param props.disabled - Whether the option is disabled.\n * @returns A dropdown option element.\n * @example\n * <Dropdown name=\"dropdown\">\n * <Option value=\"option1\">Option 1</Option>\n * <Option value=\"option2\">Option 2</Option>\n * <Option value=\"option3\">Option 3</Option>\n * </Dropdown>\n */\nexport const Option = createSnapComponent<OptionProps, typeof TYPE>(TYPE);\n\n/**\n * A dropdown option element.\n *\n * @see Option\n */\nexport type OptionElement = ReturnType<typeof Option>;\n"]}
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* @property value - The value of the dropdown option. This is used to populate the
|
|
5
5
|
* state in the form data.
|
|
6
6
|
* @property children - The text to display.
|
|
7
|
+
* @property disabled - Whether the option is disabled.
|
|
7
8
|
*/
|
|
8
9
|
type OptionProps = {
|
|
9
10
|
value: string;
|
|
10
11
|
children: string;
|
|
12
|
+
disabled?: boolean;
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
13
15
|
* A dropdown option component, which is used to create a dropdown option. This component
|
|
@@ -17,6 +19,7 @@ type OptionProps = {
|
|
|
17
19
|
* @param props.value - The value of the dropdown option. This is used to populate the
|
|
18
20
|
* state in the form data.
|
|
19
21
|
* @param props.children - The text to display.
|
|
22
|
+
* @param props.disabled - Whether the option is disabled.
|
|
20
23
|
* @returns A dropdown option element.
|
|
21
24
|
* @example
|
|
22
25
|
* <Dropdown name="dropdown">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Option.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,gEAAsD,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* @property value - The value of the dropdown option. This is used to populate the
|
|
5
5
|
* state in the form data.
|
|
6
6
|
* @property children - The text to display.
|
|
7
|
+
* @property disabled - Whether the option is disabled.
|
|
7
8
|
*/
|
|
8
9
|
type OptionProps = {
|
|
9
10
|
value: string;
|
|
10
11
|
children: string;
|
|
12
|
+
disabled?: boolean;
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
13
15
|
* A dropdown option component, which is used to create a dropdown option. This component
|
|
@@ -17,6 +19,7 @@ type OptionProps = {
|
|
|
17
19
|
* @param props.value - The value of the dropdown option. This is used to populate the
|
|
18
20
|
* state in the form data.
|
|
19
21
|
* @param props.children - The text to display.
|
|
22
|
+
* @param props.disabled - Whether the option is disabled.
|
|
20
23
|
* @returns A dropdown option element.
|
|
21
24
|
* @example
|
|
22
25
|
* <Dropdown name="dropdown">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Option.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,gEAAsD,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
|
@@ -10,6 +10,7 @@ const TYPE = 'Option';
|
|
|
10
10
|
* @param props.value - The value of the dropdown option. This is used to populate the
|
|
11
11
|
* state in the form data.
|
|
12
12
|
* @param props.children - The text to display.
|
|
13
|
+
* @param props.disabled - Whether the option is disabled.
|
|
13
14
|
* @returns A dropdown option element.
|
|
14
15
|
* @example
|
|
15
16
|
* <Dropdown name="dropdown">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AACtD,6DAA6D;AAC7D,OAAO,EAAE,QAAQ,EAAE,uBAAmB;
|
|
1
|
+
{"version":3,"file":"Option.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AACtD,6DAA6D;AAC7D,OAAO,EAAE,QAAQ,EAAE,uBAAmB;AAgBtC,MAAM,IAAI,GAAG,QAAQ,CAAC;AAEtB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,mBAAmB,CAA2B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Dropdown } from './Dropdown';\n\n/**\n * The props of the {@link Option} component.\n *\n * @property value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @property children - The text to display.\n * @property disabled - Whether the option is disabled.\n */\ntype OptionProps = {\n value: string;\n children: string;\n disabled?: boolean;\n};\n\nconst TYPE = 'Option';\n\n/**\n * A dropdown option component, which is used to create a dropdown option. This component\n * can only be used as a child of the {@link Dropdown} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the dropdown option. This is used to populate the\n * state in the form data.\n * @param props.children - The text to display.\n * @param props.disabled - Whether the option is disabled.\n * @returns A dropdown option element.\n * @example\n * <Dropdown name=\"dropdown\">\n * <Option value=\"option1\">Option 1</Option>\n * <Option value=\"option2\">Option 2</Option>\n * <Option value=\"option3\">Option 3</Option>\n * </Dropdown>\n */\nexport const Option = createSnapComponent<OptionProps, typeof TYPE>(TYPE);\n\n/**\n * A dropdown option element.\n *\n * @see Option\n */\nexport type OptionElement = ReturnType<typeof Option>;\n"]}
|
|
@@ -11,6 +11,7 @@ const TYPE = 'Radio';
|
|
|
11
11
|
* @param props.value - The value of the radio option. This is used to populate the
|
|
12
12
|
* state in the form data.
|
|
13
13
|
* @param props.children - The text to display.
|
|
14
|
+
* @param props.disabled - Whether the radio is disabled.
|
|
14
15
|
* @returns A radio element.
|
|
15
16
|
* @example
|
|
16
17
|
* <RadioGroup name="radio-group">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Radio.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;
|
|
1
|
+
{"version":3,"file":"Radio.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Radio.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AAgBtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,KAAK,GAAG,IAAA,+BAAmB,EAA0B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Radio} component.\n *\n * @property value - The value of the radio option. This is used to populate the\n * state in the form data.\n * @property children - The text to display.\n * @property disabled - Whether the radio is disabled.\n */\ntype RadioProps = {\n value: string;\n children: string;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Radio';\n\n/**\n * A radio component, which is used to create a radio option. This component\n * can only be used as a child of the {@link RadioGroup} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the radio option. This is used to populate the\n * state in the form data.\n * @param props.children - The text to display.\n * @param props.disabled - Whether the radio is disabled.\n * @returns A radio element.\n * @example\n * <RadioGroup name=\"radio-group\">\n * <Radio value=\"option1\">Option 1</Radio>\n * <Radio value=\"option2\">Option 2</Radio>\n * <Radio value=\"option3\">Option 3</Radio>\n * </RadioGroup>\n */\nexport const Radio = createSnapComponent<RadioProps, typeof TYPE>(TYPE);\n\n/**\n * A radio element.\n *\n * @see Radio\n */\nexport type RadioElement = ReturnType<typeof Radio>;\n"]}
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* @property value - The value of the radio option. This is used to populate the
|
|
5
5
|
* state in the form data.
|
|
6
6
|
* @property children - The text to display.
|
|
7
|
+
* @property disabled - Whether the radio is disabled.
|
|
7
8
|
*/
|
|
8
9
|
type RadioProps = {
|
|
9
10
|
value: string;
|
|
10
11
|
children: string;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
13
15
|
* A radio component, which is used to create a radio option. This component
|
|
@@ -17,6 +19,7 @@ type RadioProps = {
|
|
|
17
19
|
* @param props.value - The value of the radio option. This is used to populate the
|
|
18
20
|
* state in the form data.
|
|
19
21
|
* @param props.children - The text to display.
|
|
22
|
+
* @param props.disabled - Whether the radio is disabled.
|
|
20
23
|
* @returns A radio element.
|
|
21
24
|
* @example
|
|
22
25
|
* <RadioGroup name="radio-group">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Radio.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"Radio.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Radio.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* @property value - The value of the radio option. This is used to populate the
|
|
5
5
|
* state in the form data.
|
|
6
6
|
* @property children - The text to display.
|
|
7
|
+
* @property disabled - Whether the radio is disabled.
|
|
7
8
|
*/
|
|
8
9
|
type RadioProps = {
|
|
9
10
|
value: string;
|
|
10
11
|
children: string;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
13
15
|
* A radio component, which is used to create a radio option. This component
|
|
@@ -17,6 +19,7 @@ type RadioProps = {
|
|
|
17
19
|
* @param props.value - The value of the radio option. This is used to populate the
|
|
18
20
|
* state in the form data.
|
|
19
21
|
* @param props.children - The text to display.
|
|
22
|
+
* @param props.disabled - Whether the radio is disabled.
|
|
20
23
|
* @returns A radio element.
|
|
21
24
|
* @example
|
|
22
25
|
* <RadioGroup name="radio-group">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Radio.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"Radio.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Radio.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,KAAK,8DAAqD,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC"}
|
|
@@ -8,6 +8,7 @@ const TYPE = 'Radio';
|
|
|
8
8
|
* @param props.value - The value of the radio option. This is used to populate the
|
|
9
9
|
* state in the form data.
|
|
10
10
|
* @param props.children - The text to display.
|
|
11
|
+
* @param props.disabled - Whether the radio is disabled.
|
|
11
12
|
* @returns A radio element.
|
|
12
13
|
* @example
|
|
13
14
|
* <RadioGroup name="radio-group">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Radio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;
|
|
1
|
+
{"version":3,"file":"Radio.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Radio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAgBtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,mBAAmB,CAA0B,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Radio} component.\n *\n * @property value - The value of the radio option. This is used to populate the\n * state in the form data.\n * @property children - The text to display.\n * @property disabled - Whether the radio is disabled.\n */\ntype RadioProps = {\n value: string;\n children: string;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Radio';\n\n/**\n * A radio component, which is used to create a radio option. This component\n * can only be used as a child of the {@link RadioGroup} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the radio option. This is used to populate the\n * state in the form data.\n * @param props.children - The text to display.\n * @param props.disabled - Whether the radio is disabled.\n * @returns A radio element.\n * @example\n * <RadioGroup name=\"radio-group\">\n * <Radio value=\"option1\">Option 1</Radio>\n * <Radio value=\"option2\">Option 2</Radio>\n * <Radio value=\"option3\">Option 3</Radio>\n * </RadioGroup>\n */\nexport const Radio = createSnapComponent<RadioProps, typeof TYPE>(TYPE);\n\n/**\n * A radio element.\n *\n * @see Radio\n */\nexport type RadioElement = ReturnType<typeof Radio>;\n"]}
|
|
@@ -6,6 +6,11 @@ const TYPE = 'RadioGroup';
|
|
|
6
6
|
/**
|
|
7
7
|
* A RadioGroup component, used to display multiple choices, where only one can be chosen.
|
|
8
8
|
*
|
|
9
|
+
* @param props.name - The name of the dropdown. This is used to identify the
|
|
10
|
+
* state in the form data.
|
|
11
|
+
* @param props.value - The value of the radio group element.
|
|
12
|
+
* @param props.children - Radio options in form of <Radio> elements.
|
|
13
|
+
* @param props.disabled - Whether the radio group is disabled.
|
|
9
14
|
* @returns A RadioGroup element.
|
|
10
15
|
* @example
|
|
11
16
|
* <RadioGroup />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":";;;AACA,mDAAsD;AAGtD,MAAM,IAAI,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioGroup.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":";;;AACA,mDAAsD;AAGtD,MAAM,IAAI,GAAG,YAAY,CAAC;AAkB1B;;;;;;;;;;;GAWG;AACU,QAAA,UAAU,GAAG,IAAA,+BAAmB,EAC3C,IAAI,CACL,CAAC","sourcesContent":["import type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { RadioElement } from './Radio';\n\nconst TYPE = 'RadioGroup';\n\n/**\n * The props of the {@link RadioGroup} component.\n *\n * @property name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @property value - The value of the radio group element.\n * @property children - Radio options in form of <Radio> elements.\n * @property disabled - Whether the radio group is disabled.\n */\ntype RadioGroupProps = {\n name: string;\n value?: string | undefined;\n children: SnapsChildren<RadioElement>;\n disabled?: boolean | undefined;\n};\n\n/**\n * A RadioGroup component, used to display multiple choices, where only one can be chosen.\n *\n * @param props.name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @param props.value - The value of the radio group element.\n * @param props.children - Radio options in form of <Radio> elements.\n * @param props.disabled - Whether the radio group is disabled.\n * @returns A RadioGroup element.\n * @example\n * <RadioGroup />\n */\nexport const RadioGroup = createSnapComponent<RadioGroupProps, typeof TYPE>(\n TYPE,\n);\n\n/**\n * A RadioGroup element.\n *\n * @see RadioGroup\n */\nexport type RadioGroupElement = ReturnType<typeof RadioGroup>;\n"]}
|
|
@@ -5,16 +5,24 @@ import type { RadioElement } from "./Radio.cjs";
|
|
|
5
5
|
*
|
|
6
6
|
* @property name - The name of the dropdown. This is used to identify the
|
|
7
7
|
* state in the form data.
|
|
8
|
+
* @property value - The value of the radio group element.
|
|
8
9
|
* @property children - Radio options in form of <Radio> elements.
|
|
10
|
+
* @property disabled - Whether the radio group is disabled.
|
|
9
11
|
*/
|
|
10
12
|
type RadioGroupProps = {
|
|
11
13
|
name: string;
|
|
12
14
|
value?: string | undefined;
|
|
13
15
|
children: SnapsChildren<RadioElement>;
|
|
16
|
+
disabled?: boolean | undefined;
|
|
14
17
|
};
|
|
15
18
|
/**
|
|
16
19
|
* A RadioGroup component, used to display multiple choices, where only one can be chosen.
|
|
17
20
|
*
|
|
21
|
+
* @param props.name - The name of the dropdown. This is used to identify the
|
|
22
|
+
* state in the form data.
|
|
23
|
+
* @param props.value - The value of the radio group element.
|
|
24
|
+
* @param props.children - Radio options in form of <Radio> elements.
|
|
25
|
+
* @param props.disabled - Whether the radio group is disabled.
|
|
18
26
|
* @returns A RadioGroup element.
|
|
19
27
|
* @example
|
|
20
28
|
* <RadioGroup />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAI5C
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAI5C;;;;;;;;GAQG;AACH,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,wEAEtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -5,16 +5,24 @@ import type { RadioElement } from "./Radio.mjs";
|
|
|
5
5
|
*
|
|
6
6
|
* @property name - The name of the dropdown. This is used to identify the
|
|
7
7
|
* state in the form data.
|
|
8
|
+
* @property value - The value of the radio group element.
|
|
8
9
|
* @property children - Radio options in form of <Radio> elements.
|
|
10
|
+
* @property disabled - Whether the radio group is disabled.
|
|
9
11
|
*/
|
|
10
12
|
type RadioGroupProps = {
|
|
11
13
|
name: string;
|
|
12
14
|
value?: string | undefined;
|
|
13
15
|
children: SnapsChildren<RadioElement>;
|
|
16
|
+
disabled?: boolean | undefined;
|
|
14
17
|
};
|
|
15
18
|
/**
|
|
16
19
|
* A RadioGroup component, used to display multiple choices, where only one can be chosen.
|
|
17
20
|
*
|
|
21
|
+
* @param props.name - The name of the dropdown. This is used to identify the
|
|
22
|
+
* state in the form data.
|
|
23
|
+
* @param props.value - The value of the radio group element.
|
|
24
|
+
* @param props.children - Radio options in form of <Radio> elements.
|
|
25
|
+
* @param props.disabled - Whether the radio group is disabled.
|
|
18
26
|
* @returns A RadioGroup element.
|
|
19
27
|
* @example
|
|
20
28
|
* <RadioGroup />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAI5C
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAgB;AAI5C;;;;;;;;GAQG;AACH,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,wEAEtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -3,6 +3,11 @@ const TYPE = 'RadioGroup';
|
|
|
3
3
|
/**
|
|
4
4
|
* A RadioGroup component, used to display multiple choices, where only one can be chosen.
|
|
5
5
|
*
|
|
6
|
+
* @param props.name - The name of the dropdown. This is used to identify the
|
|
7
|
+
* state in the form data.
|
|
8
|
+
* @param props.value - The value of the radio group element.
|
|
9
|
+
* @param props.children - Radio options in form of <Radio> elements.
|
|
10
|
+
* @param props.disabled - Whether the radio group is disabled.
|
|
6
11
|
* @returns A RadioGroup element.
|
|
7
12
|
* @example
|
|
8
13
|
* <RadioGroup />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAGtD,MAAM,IAAI,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioGroup.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/RadioGroup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAGtD,MAAM,IAAI,GAAG,YAAY,CAAC;AAkB1B;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,mBAAmB,CAC3C,IAAI,CACL,CAAC","sourcesContent":["import type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { RadioElement } from './Radio';\n\nconst TYPE = 'RadioGroup';\n\n/**\n * The props of the {@link RadioGroup} component.\n *\n * @property name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @property value - The value of the radio group element.\n * @property children - Radio options in form of <Radio> elements.\n * @property disabled - Whether the radio group is disabled.\n */\ntype RadioGroupProps = {\n name: string;\n value?: string | undefined;\n children: SnapsChildren<RadioElement>;\n disabled?: boolean | undefined;\n};\n\n/**\n * A RadioGroup component, used to display multiple choices, where only one can be chosen.\n *\n * @param props.name - The name of the dropdown. This is used to identify the\n * state in the form data.\n * @param props.value - The value of the radio group element.\n * @param props.children - Radio options in form of <Radio> elements.\n * @param props.disabled - Whether the radio group is disabled.\n * @returns A RadioGroup element.\n * @example\n * <RadioGroup />\n */\nexport const RadioGroup = createSnapComponent<RadioGroupProps, typeof TYPE>(\n TYPE,\n);\n\n/**\n * A RadioGroup element.\n *\n * @see RadioGroup\n */\nexport type RadioGroupElement = ReturnType<typeof RadioGroup>;\n"]}
|
|
@@ -12,6 +12,7 @@ const TYPE = 'Selector';
|
|
|
12
12
|
* @param props.title - The title of the selector field. This is displayed in the UI.
|
|
13
13
|
* @param props.value - The selected value of the selector.
|
|
14
14
|
* @param props.children - The children of the selector.
|
|
15
|
+
* @property disabled - Whether the selector is disabled.
|
|
15
16
|
* @returns A selector element.
|
|
16
17
|
* @example
|
|
17
18
|
* <Selector name="selector">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":";;;AACA,mDAAsD;
|
|
1
|
+
{"version":3,"file":"Selector.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":";;;AACA,mDAAsD;AAqBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,QAAQ,GAAG,IAAA,+BAAmB,EAA6B,IAAI,CAAC,CAAC","sourcesContent":["import type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { SelectorOptionElement } from './SelectorOption';\n\n/**\n * The props of the {@link Selector} component.\n *\n * @property name - The name of the selector. This is used to identify the\n * state in the form data.\n * @property title - The title of the selector. This is displayed in the UI.\n * @property value - The selected value of the selector.\n * @property children - The children of the selector.\n * @property disabled - Whether the selector is disabled.\n */\nexport type SelectorProps = {\n name: string;\n title: string;\n value?: string | undefined;\n children: SnapsChildren<SelectorOptionElement>;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Selector';\n\n/**\n * A selector component, which is used to create a selector.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the selector field. This is used to identify the\n * state in the form data.\n * @param props.title - The title of the selector field. This is displayed in the UI.\n * @param props.value - The selected value of the selector.\n * @param props.children - The children of the selector.\n * @property disabled - Whether the selector is disabled.\n * @returns A selector element.\n * @example\n * <Selector name=\"selector\">\n * <SelectorOption value=\"option1\"><Card title=\"Option 1\" value=\"Foo\" /></SelectorOption>\n * <SelectorOption value=\"option2\"><Card title=\"Option 2\" value=\"Bar\" /></SelectorOption>\n * <SelectorOption value=\"option3\"><Card title=\"Option 3\" value=\"Baz\" /></SelectorOption>\n * </Selector>\n */\nexport const Selector = createSnapComponent<SelectorProps, typeof TYPE>(TYPE);\n\n/**\n * A selector element.\n *\n * @see Selector\n */\nexport type SelectorElement = ReturnType<typeof Selector>;\n"]}
|
|
@@ -8,12 +8,14 @@ import type { SelectorOptionElement } from "./SelectorOption.cjs";
|
|
|
8
8
|
* @property title - The title of the selector. This is displayed in the UI.
|
|
9
9
|
* @property value - The selected value of the selector.
|
|
10
10
|
* @property children - The children of the selector.
|
|
11
|
+
* @property disabled - Whether the selector is disabled.
|
|
11
12
|
*/
|
|
12
13
|
export type SelectorProps = {
|
|
13
14
|
name: string;
|
|
14
15
|
title: string;
|
|
15
16
|
value?: string | undefined;
|
|
16
17
|
children: SnapsChildren<SelectorOptionElement>;
|
|
18
|
+
disabled?: boolean | undefined;
|
|
17
19
|
};
|
|
18
20
|
/**
|
|
19
21
|
* A selector component, which is used to create a selector.
|
|
@@ -24,6 +26,7 @@ export type SelectorProps = {
|
|
|
24
26
|
* @param props.title - The title of the selector field. This is displayed in the UI.
|
|
25
27
|
* @param props.value - The selected value of the selector.
|
|
26
28
|
* @param props.children - The children of the selector.
|
|
29
|
+
* @property disabled - Whether the selector is disabled.
|
|
27
30
|
* @returns A selector element.
|
|
28
31
|
* @example
|
|
29
32
|
* <Selector name="selector">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAE9D
|
|
1
|
+
{"version":3,"file":"Selector.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAE9D;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -8,12 +8,14 @@ import type { SelectorOptionElement } from "./SelectorOption.mjs";
|
|
|
8
8
|
* @property title - The title of the selector. This is displayed in the UI.
|
|
9
9
|
* @property value - The selected value of the selector.
|
|
10
10
|
* @property children - The children of the selector.
|
|
11
|
+
* @property disabled - Whether the selector is disabled.
|
|
11
12
|
*/
|
|
12
13
|
export type SelectorProps = {
|
|
13
14
|
name: string;
|
|
14
15
|
title: string;
|
|
15
16
|
value?: string | undefined;
|
|
16
17
|
children: SnapsChildren<SelectorOptionElement>;
|
|
18
|
+
disabled?: boolean | undefined;
|
|
17
19
|
};
|
|
18
20
|
/**
|
|
19
21
|
* A selector component, which is used to create a selector.
|
|
@@ -24,6 +26,7 @@ export type SelectorProps = {
|
|
|
24
26
|
* @param props.title - The title of the selector field. This is displayed in the UI.
|
|
25
27
|
* @param props.value - The selected value of the selector.
|
|
26
28
|
* @param props.children - The children of the selector.
|
|
29
|
+
* @property disabled - Whether the selector is disabled.
|
|
27
30
|
* @returns A selector element.
|
|
28
31
|
* @example
|
|
29
32
|
* <Selector name="selector">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAE9D
|
|
1
|
+
{"version":3,"file":"Selector.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAwB;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAE9D;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ,oEAAwD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -9,6 +9,7 @@ const TYPE = 'Selector';
|
|
|
9
9
|
* @param props.title - The title of the selector field. This is displayed in the UI.
|
|
10
10
|
* @param props.value - The selected value of the selector.
|
|
11
11
|
* @param props.children - The children of the selector.
|
|
12
|
+
* @property disabled - Whether the selector is disabled.
|
|
12
13
|
* @returns A selector element.
|
|
13
14
|
* @example
|
|
14
15
|
* <Selector name="selector">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;
|
|
1
|
+
{"version":3,"file":"Selector.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Selector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAqBtD,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,mBAAmB,CAA6B,IAAI,CAAC,CAAC","sourcesContent":["import type { SnapsChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\nimport type { SelectorOptionElement } from './SelectorOption';\n\n/**\n * The props of the {@link Selector} component.\n *\n * @property name - The name of the selector. This is used to identify the\n * state in the form data.\n * @property title - The title of the selector. This is displayed in the UI.\n * @property value - The selected value of the selector.\n * @property children - The children of the selector.\n * @property disabled - Whether the selector is disabled.\n */\nexport type SelectorProps = {\n name: string;\n title: string;\n value?: string | undefined;\n children: SnapsChildren<SelectorOptionElement>;\n disabled?: boolean | undefined;\n};\n\nconst TYPE = 'Selector';\n\n/**\n * A selector component, which is used to create a selector.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the selector field. This is used to identify the\n * state in the form data.\n * @param props.title - The title of the selector field. This is displayed in the UI.\n * @param props.value - The selected value of the selector.\n * @param props.children - The children of the selector.\n * @property disabled - Whether the selector is disabled.\n * @returns A selector element.\n * @example\n * <Selector name=\"selector\">\n * <SelectorOption value=\"option1\"><Card title=\"Option 1\" value=\"Foo\" /></SelectorOption>\n * <SelectorOption value=\"option2\"><Card title=\"Option 2\" value=\"Bar\" /></SelectorOption>\n * <SelectorOption value=\"option3\"><Card title=\"Option 3\" value=\"Baz\" /></SelectorOption>\n * </Selector>\n */\nexport const Selector = createSnapComponent<SelectorProps, typeof TYPE>(TYPE);\n\n/**\n * A selector element.\n *\n * @see Selector\n */\nexport type SelectorElement = ReturnType<typeof Selector>;\n"]}
|
|
@@ -11,6 +11,7 @@ const TYPE = 'SelectorOption';
|
|
|
11
11
|
* @param props.value - The value of the selector option. This is used to populate the
|
|
12
12
|
* state in the form data.
|
|
13
13
|
* @param props.children - The component to display.
|
|
14
|
+
* @param props.disabled - Whether the selector option is disabled.
|
|
14
15
|
* @returns A selector option element.
|
|
15
16
|
* @example
|
|
16
17
|
* <Selector name="selector">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectorOption.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/SelectorOption.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;
|
|
1
|
+
{"version":3,"file":"SelectorOption.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/SelectorOption.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AAiBtD,MAAM,IAAI,GAAG,gBAAgB,CAAC;AAE9B;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,cAAc,GAAG,IAAA,+BAAmB,EAG/C,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\nimport type { CardElement } from '../Card';\n\n/**\n * The props of the {@link SelectorOption} component.\n *\n * @property value - The value of the selector option. This is used to populate the\n * state in the form data.\n * @property children - The component to display.\n * @property disabled - Whether the selector option is disabled.\n */\nexport type SelectorOptionProps = {\n value: string;\n children: CardElement;\n disabled?: boolean;\n};\n\nconst TYPE = 'SelectorOption';\n\n/**\n * A selector option component, which is used to create a selector option. This component\n * can only be used as a child of the {@link Selector} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the selector option. This is used to populate the\n * state in the form data.\n * @param props.children - The component to display.\n * @param props.disabled - Whether the selector option is disabled.\n * @returns A selector option element.\n * @example\n * <Selector name=\"selector\">\n * <SelectorOption value=\"option1\"><Card title=\"Option 1\" value=\"Foo\" /></SelectorOption>\n * <SelectorOption value=\"option2\"><Card title=\"Option 2\" value=\"Bar\" /></SelectorOption>\n * <SelectorOption value=\"option3\"><Card title=\"Option 3\" value=\"Baz\" /></SelectorOption>\n * </Selector>\n */\nexport const SelectorOption = createSnapComponent<\n SelectorOptionProps,\n typeof TYPE\n>(TYPE);\n\n/**\n * A selector option element.\n *\n * @see SelectorOption\n */\nexport type SelectorOptionElement = ReturnType<typeof SelectorOption>;\n"]}
|
|
@@ -5,10 +5,12 @@ import type { CardElement } from "../Card.cjs";
|
|
|
5
5
|
* @property value - The value of the selector option. This is used to populate the
|
|
6
6
|
* state in the form data.
|
|
7
7
|
* @property children - The component to display.
|
|
8
|
+
* @property disabled - Whether the selector option is disabled.
|
|
8
9
|
*/
|
|
9
10
|
export type SelectorOptionProps = {
|
|
10
11
|
value: string;
|
|
11
12
|
children: CardElement;
|
|
13
|
+
disabled?: boolean;
|
|
12
14
|
};
|
|
13
15
|
/**
|
|
14
16
|
* A selector option component, which is used to create a selector option. This component
|
|
@@ -18,6 +20,7 @@ export type SelectorOptionProps = {
|
|
|
18
20
|
* @param props.value - The value of the selector option. This is used to populate the
|
|
19
21
|
* state in the form data.
|
|
20
22
|
* @param props.children - The component to display.
|
|
23
|
+
* @param props.disabled - Whether the selector option is disabled.
|
|
21
24
|
* @returns A selector option element.
|
|
22
25
|
* @example
|
|
23
26
|
* <Selector name="selector">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectorOption.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/SelectorOption.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAgB;AAE3C
|
|
1
|
+
{"version":3,"file":"SelectorOption.d.cts","sourceRoot":"","sources":["../../../../src/jsx/components/form/SelectorOption.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAgB;AAE3C;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,cAAc,gFAGpB,CAAC;AAER;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -5,10 +5,12 @@ import type { CardElement } from "../Card.mjs";
|
|
|
5
5
|
* @property value - The value of the selector option. This is used to populate the
|
|
6
6
|
* state in the form data.
|
|
7
7
|
* @property children - The component to display.
|
|
8
|
+
* @property disabled - Whether the selector option is disabled.
|
|
8
9
|
*/
|
|
9
10
|
export type SelectorOptionProps = {
|
|
10
11
|
value: string;
|
|
11
12
|
children: CardElement;
|
|
13
|
+
disabled?: boolean;
|
|
12
14
|
};
|
|
13
15
|
/**
|
|
14
16
|
* A selector option component, which is used to create a selector option. This component
|
|
@@ -18,6 +20,7 @@ export type SelectorOptionProps = {
|
|
|
18
20
|
* @param props.value - The value of the selector option. This is used to populate the
|
|
19
21
|
* state in the form data.
|
|
20
22
|
* @param props.children - The component to display.
|
|
23
|
+
* @param props.disabled - Whether the selector option is disabled.
|
|
21
24
|
* @returns A selector option element.
|
|
22
25
|
* @example
|
|
23
26
|
* <Selector name="selector">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectorOption.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/SelectorOption.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAgB;AAE3C
|
|
1
|
+
{"version":3,"file":"SelectorOption.d.mts","sourceRoot":"","sources":["../../../../src/jsx/components/form/SelectorOption.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAgB;AAE3C;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,cAAc,gFAGpB,CAAC;AAER;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -8,6 +8,7 @@ const TYPE = 'SelectorOption';
|
|
|
8
8
|
* @param props.value - The value of the selector option. This is used to populate the
|
|
9
9
|
* state in the form data.
|
|
10
10
|
* @param props.children - The component to display.
|
|
11
|
+
* @param props.disabled - Whether the selector option is disabled.
|
|
11
12
|
* @returns A selector option element.
|
|
12
13
|
* @example
|
|
13
14
|
* <Selector name="selector">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectorOption.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/SelectorOption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;
|
|
1
|
+
{"version":3,"file":"SelectorOption.mjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/SelectorOption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAAwB;AAiBtD,MAAM,IAAI,GAAG,gBAAgB,CAAC;AAE9B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAG/C,IAAI,CAAC,CAAC","sourcesContent":["import { createSnapComponent } from '../../component';\nimport type { CardElement } from '../Card';\n\n/**\n * The props of the {@link SelectorOption} component.\n *\n * @property value - The value of the selector option. This is used to populate the\n * state in the form data.\n * @property children - The component to display.\n * @property disabled - Whether the selector option is disabled.\n */\nexport type SelectorOptionProps = {\n value: string;\n children: CardElement;\n disabled?: boolean;\n};\n\nconst TYPE = 'SelectorOption';\n\n/**\n * A selector option component, which is used to create a selector option. This component\n * can only be used as a child of the {@link Selector} component.\n *\n * @param props - The props of the component.\n * @param props.value - The value of the selector option. This is used to populate the\n * state in the form data.\n * @param props.children - The component to display.\n * @param props.disabled - Whether the selector option is disabled.\n * @returns A selector option element.\n * @example\n * <Selector name=\"selector\">\n * <SelectorOption value=\"option1\"><Card title=\"Option 1\" value=\"Foo\" /></SelectorOption>\n * <SelectorOption value=\"option2\"><Card title=\"Option 2\" value=\"Bar\" /></SelectorOption>\n * <SelectorOption value=\"option3\"><Card title=\"Option 3\" value=\"Baz\" /></SelectorOption>\n * </Selector>\n */\nexport const SelectorOption = createSnapComponent<\n SelectorOptionProps,\n typeof TYPE\n>(TYPE);\n\n/**\n * A selector option element.\n *\n * @see SelectorOption\n */\nexport type SelectorOptionElement = ReturnType<typeof SelectorOption>;\n"]}
|
package/dist/jsx/validation.cjs
CHANGED
|
@@ -146,6 +146,7 @@ exports.CheckboxStruct = element('Checkbox', {
|
|
|
146
146
|
checked: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
147
147
|
label: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
148
148
|
variant: (0, superstruct_1.optional)((0, internals_1.nullUnion)([(0, internals_1.literal)('default'), (0, internals_1.literal)('toggle')])),
|
|
149
|
+
disabled: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
149
150
|
});
|
|
150
151
|
/**
|
|
151
152
|
* A struct for the generic input element props.
|
|
@@ -154,6 +155,7 @@ exports.GenericInputPropsStruct = (0, superstruct_1.object)({
|
|
|
154
155
|
name: (0, superstruct_1.string)(),
|
|
155
156
|
value: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
156
157
|
placeholder: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
158
|
+
disabled: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
157
159
|
});
|
|
158
160
|
/**
|
|
159
161
|
* A struct for the text type input props.
|
|
@@ -200,6 +202,7 @@ exports.InputStruct = elementWithSelectiveProps('Input', (value) => {
|
|
|
200
202
|
exports.OptionStruct = element('Option', {
|
|
201
203
|
value: (0, superstruct_1.string)(),
|
|
202
204
|
children: (0, superstruct_1.string)(),
|
|
205
|
+
disabled: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
203
206
|
});
|
|
204
207
|
/**
|
|
205
208
|
* A struct for the {@link DropdownElement} type.
|
|
@@ -208,6 +211,7 @@ exports.DropdownStruct = element('Dropdown', {
|
|
|
208
211
|
name: (0, superstruct_1.string)(),
|
|
209
212
|
value: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
210
213
|
children: children([exports.OptionStruct]),
|
|
214
|
+
disabled: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
211
215
|
});
|
|
212
216
|
/**
|
|
213
217
|
* A struct for the {@link AddressElement} type.
|
|
@@ -239,6 +243,7 @@ exports.CardStruct = element('Card', {
|
|
|
239
243
|
exports.SelectorOptionStruct = element('SelectorOption', {
|
|
240
244
|
value: (0, superstruct_1.string)(),
|
|
241
245
|
children: exports.CardStruct,
|
|
246
|
+
disabled: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
242
247
|
});
|
|
243
248
|
/**
|
|
244
249
|
* A struct for the {@link SelectorElement} type.
|
|
@@ -248,6 +253,7 @@ exports.SelectorStruct = element('Selector', {
|
|
|
248
253
|
title: (0, superstruct_1.string)(),
|
|
249
254
|
value: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
250
255
|
children: children([exports.SelectorOptionStruct]),
|
|
256
|
+
disabled: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
251
257
|
});
|
|
252
258
|
/**
|
|
253
259
|
* A struct for the {@link RadioElement} type.
|
|
@@ -255,6 +261,7 @@ exports.SelectorStruct = element('Selector', {
|
|
|
255
261
|
exports.RadioStruct = element('Radio', {
|
|
256
262
|
value: (0, superstruct_1.string)(),
|
|
257
263
|
children: (0, superstruct_1.string)(),
|
|
264
|
+
disabled: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
258
265
|
});
|
|
259
266
|
/**
|
|
260
267
|
* A struct for the {@link RadioGroupElement} type.
|
|
@@ -263,6 +270,7 @@ exports.RadioGroupStruct = element('RadioGroup', {
|
|
|
263
270
|
name: (0, superstruct_1.string)(),
|
|
264
271
|
value: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
265
272
|
children: children([exports.RadioStruct]),
|
|
273
|
+
disabled: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
266
274
|
});
|
|
267
275
|
/**
|
|
268
276
|
* A struct for the {@link FileInputElement} type.
|
|
@@ -271,6 +279,7 @@ exports.FileInputStruct = element('FileInput', {
|
|
|
271
279
|
name: (0, superstruct_1.string)(),
|
|
272
280
|
accept: (0, internals_1.nullUnion)([(0, superstruct_1.optional)((0, superstruct_1.array)((0, superstruct_1.string)()))]),
|
|
273
281
|
compact: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
282
|
+
disabled: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
274
283
|
});
|
|
275
284
|
/**
|
|
276
285
|
* A subset of JSX elements that represent the tuple Box + Input of the Field children.
|