@plasmicpkgs/react-aria 0.0.14 → 0.0.15
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/dist/.tsbuildinfo +1 -1
- package/dist/react-aria.esm.js +44 -35
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +44 -35
- package/dist/react-aria.js.map +1 -1
- package/dist/registerCheckbox.d.ts +1 -0
- package/dist/registerTextField.d.ts +1 -0
- package/package.json +2 -2
- package/skinny/registerCheckbox.cjs.js +22 -3
- package/skinny/registerCheckbox.cjs.js.map +1 -1
- package/skinny/registerCheckbox.d.ts +1 -0
- package/skinny/registerCheckbox.esm.js +22 -3
- package/skinny/registerCheckbox.esm.js.map +1 -1
- package/skinny/registerCheckboxGroup.cjs.js +0 -12
- package/skinny/registerCheckboxGroup.cjs.js.map +1 -1
- package/skinny/registerCheckboxGroup.esm.js +0 -12
- package/skinny/registerCheckboxGroup.esm.js.map +1 -1
- package/skinny/registerRadioGroup.cjs.js +0 -12
- package/skinny/registerRadioGroup.cjs.js.map +1 -1
- package/skinny/registerRadioGroup.esm.js +0 -12
- package/skinny/registerRadioGroup.esm.js.map +1 -1
- package/skinny/registerTextField.cjs.js +24 -9
- package/skinny/registerTextField.cjs.js.map +1 -1
- package/skinny/registerTextField.d.ts +1 -0
- package/skinny/registerTextField.esm.js +25 -10
- package/skinny/registerTextField.esm.js.map +1 -1
|
@@ -4,6 +4,7 @@ import { CodeComponentMetaOverrides, Registerable } from "./utils";
|
|
|
4
4
|
interface BaseCheckboxProps extends CheckboxProps {
|
|
5
5
|
onPressChange: (isPressed: boolean) => void;
|
|
6
6
|
onFocusVisibleChange: (isFocusVisible: boolean) => void;
|
|
7
|
+
onInvalidChange: (isInvalid: boolean) => void;
|
|
7
8
|
}
|
|
8
9
|
export declare function BaseCheckbox(props: BaseCheckboxProps): React.JSX.Element;
|
|
9
10
|
export declare function registerCheckbox(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseCheckbox>): void;
|
|
@@ -8,6 +8,7 @@ interface BaseTextFieldProps extends TextFieldProps {
|
|
|
8
8
|
enableAutoComplete?: boolean;
|
|
9
9
|
multiline?: boolean;
|
|
10
10
|
inputProps?: InputProps;
|
|
11
|
+
onInvalidChange?: (isInvalid: boolean) => void;
|
|
11
12
|
}
|
|
12
13
|
export declare function BaseTextField(props: BaseTextFieldProps): React.JSX.Element;
|
|
13
14
|
export declare function registerTextField(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseTextField>): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/react-aria",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Plasmic registration calls for react-aria based components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "f5fe8247bea258216686a3f688103aa265610273"
|
|
74
74
|
}
|
|
@@ -42,14 +42,24 @@ var __objRest = (source, exclude) => {
|
|
|
42
42
|
return target;
|
|
43
43
|
};
|
|
44
44
|
function BaseCheckbox(props) {
|
|
45
|
-
const _a = props, {
|
|
46
|
-
|
|
45
|
+
const _a = props, {
|
|
46
|
+
children,
|
|
47
|
+
onPressChange,
|
|
48
|
+
onFocusVisibleChange,
|
|
49
|
+
onInvalidChange
|
|
50
|
+
} = _a, rest = __objRest(_a, [
|
|
51
|
+
"children",
|
|
52
|
+
"onPressChange",
|
|
53
|
+
"onFocusVisibleChange",
|
|
54
|
+
"onInvalidChange"
|
|
55
|
+
]);
|
|
56
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Checkbox, __spreadValues({}, rest), ({ isFocusVisible, isPressed, isInvalid }) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
|
|
47
57
|
utils.ValueObserver,
|
|
48
58
|
{
|
|
49
59
|
value: isFocusVisible,
|
|
50
60
|
onChange: onFocusVisibleChange
|
|
51
61
|
}
|
|
52
|
-
), /* @__PURE__ */ React__default.default.createElement(utils.ValueObserver, { value: isPressed, onChange: onPressChange }), children)));
|
|
62
|
+
), /* @__PURE__ */ React__default.default.createElement(utils.ValueObserver, { value: isPressed, onChange: onPressChange }), /* @__PURE__ */ React__default.default.createElement(utils.ValueObserver, { value: isInvalid, onChange: onInvalidChange }), children)));
|
|
53
63
|
}
|
|
54
64
|
function registerCheckbox(loader, overrides) {
|
|
55
65
|
utils.registerComponentHelper(
|
|
@@ -117,6 +127,10 @@ function registerCheckbox(loader, overrides) {
|
|
|
117
127
|
onFocusVisibleChange: {
|
|
118
128
|
type: "eventHandler",
|
|
119
129
|
argTypes: [{ name: "isFocusVisible", type: "boolean" }]
|
|
130
|
+
},
|
|
131
|
+
onInvalidChange: {
|
|
132
|
+
type: "eventHandler",
|
|
133
|
+
argTypes: [{ name: "isInvalid", type: "boolean" }]
|
|
120
134
|
}
|
|
121
135
|
}),
|
|
122
136
|
states: {
|
|
@@ -141,6 +155,11 @@ function registerCheckbox(loader, overrides) {
|
|
|
141
155
|
onChangeProp: "onFocusChange",
|
|
142
156
|
variableType: "boolean"
|
|
143
157
|
},
|
|
158
|
+
isInvalid: {
|
|
159
|
+
type: "readonly",
|
|
160
|
+
onChangeProp: "onInvalidChange",
|
|
161
|
+
variableType: "boolean"
|
|
162
|
+
},
|
|
144
163
|
isFocusVisible: {
|
|
145
164
|
type: "readonly",
|
|
146
165
|
onChangeProp: "onFocusVisibleChange",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerCheckbox.cjs.js","sources":["../src/registerCheckbox.tsx"],"sourcesContent":["import React from \"react\";\nimport type { CheckboxProps } from \"react-aria-components\";\nimport { Checkbox } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n ValueObserver,\n} from \"./utils\";\n\ninterface BaseCheckboxProps extends CheckboxProps {\n onPressChange: (isPressed: boolean) => void;\n onFocusVisibleChange: (isFocusVisible: boolean) => void;\n}\n\nexport function BaseCheckbox(props: BaseCheckboxProps) {\n const {
|
|
1
|
+
{"version":3,"file":"registerCheckbox.cjs.js","sources":["../src/registerCheckbox.tsx"],"sourcesContent":["import React from \"react\";\nimport type { CheckboxProps } from \"react-aria-components\";\nimport { Checkbox } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n ValueObserver,\n} from \"./utils\";\n\ninterface BaseCheckboxProps extends CheckboxProps {\n onPressChange: (isPressed: boolean) => void;\n onFocusVisibleChange: (isFocusVisible: boolean) => void;\n onInvalidChange: (isInvalid: boolean) => void;\n}\n\nexport function BaseCheckbox(props: BaseCheckboxProps) {\n const {\n children,\n onPressChange,\n onFocusVisibleChange,\n onInvalidChange,\n ...rest\n } = props;\n\n return (\n <>\n <Checkbox {...rest}>\n {({ isFocusVisible, isPressed, isInvalid }) => (\n <>\n <ValueObserver\n value={isFocusVisible}\n onChange={onFocusVisibleChange}\n />\n <ValueObserver value={isPressed} onChange={onPressChange} />\n <ValueObserver value={isInvalid} onChange={onInvalidChange} />\n {children}\n </>\n )}\n </Checkbox>\n </>\n );\n}\n\nexport function registerCheckbox(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseCheckbox>\n) {\n registerComponentHelper(\n loader,\n BaseCheckbox,\n {\n name: makeComponentName(\"checkbox\"),\n displayName: \"Aria Checkbox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerCheckbox\",\n importName: \"BaseCheckbox\",\n props: {\n ...getCommonInputProps<BaseCheckboxProps>(\"checkbox\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n \"autoFocus\",\n ]),\n value: {\n type: \"string\",\n description:\n \"The value of the input element, used when submitting an HTML form.\",\n },\n isSelected: {\n type: \"boolean\",\n editOnly: true,\n uncontrolledProp: \"defaultSelected\",\n description: \"Whether the checkbox is toggled on\",\n defaultValueHint: false,\n },\n isIndeterminate: {\n displayName: \"Indeterminate\",\n type: \"boolean\",\n description:\n \"This state indicates that the checkbox is neither fully checked nor unchecked. It typically represents a partial selection when dealing with groups of options. Some but not all items in the group are selected, resulting in an indeterminate state for the checkbox.\",\n defaultValueHint: false,\n },\n isInvalid: {\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isSelected\", type: \"boolean\" }],\n },\n onHoverChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isHovered\", type: \"boolean\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n onPressChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isPressed\", type: \"boolean\" }],\n },\n onFocusVisibleChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocusVisible\", type: \"boolean\" }],\n },\n onInvalidChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isInvalid\", type: \"boolean\" }],\n },\n },\n states: {\n isSelected: {\n type: \"writable\",\n valueProp: \"isSelected\",\n onChangeProp: \"onChange\",\n variableType: \"boolean\",\n },\n isHovered: {\n type: \"readonly\",\n onChangeProp: \"onHoverChange\",\n variableType: \"boolean\",\n },\n isPressed: {\n type: \"readonly\",\n onChangeProp: \"onPressChange\",\n variableType: \"boolean\",\n },\n isFocused: {\n type: \"readonly\",\n onChangeProp: \"onFocusChange\",\n variableType: \"boolean\",\n },\n isInvalid: {\n type: \"readonly\",\n onChangeProp: \"onInvalidChange\",\n variableType: \"boolean\",\n },\n isFocusVisible: {\n type: \"readonly\",\n onChangeProp: \"onFocusVisibleChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["React","Checkbox","ValueObserver","registerComponentHelper","makeComponentName","getCommonInputProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,SAAS,aAAa,KAA0B,EAAA;AACrD,EAAA,MAMI,EALF,GAAA,KAAA,EAAA;AAAA,IAAA,QAAA;AAAA,IACA,aAAA;AAAA,IACA,oBAAA;AAAA,IACA,eAAA;AAAA,GAvBJ,GAyBM,EADC,EAAA,IAAA,GAAA,SAAA,CACD,EADC,EAAA;AAAA,IAJH,UAAA;AAAA,IACA,eAAA;AAAA,IACA,sBAAA;AAAA,IACA,iBAAA;AAAA,GAAA,CAAA,CAAA;AAIF,EACE,uBAAAA,sBAAA,CAAA,aAAA,CAAAA,sBAAA,CAAA,QAAA,EAAA,IAAA,kBACGA,sBAAA,CAAA,aAAA,CAAAC,4BAAA,EAAA,cAAA,CAAA,EAAA,EAAa,IACX,CAAA,EAAA,CAAC,EAAE,cAAgB,EAAA,SAAA,EAAW,SAAU,EAAA,qBAErCD,sBAAA,CAAA,aAAA,CAAAA,sBAAA,CAAA,QAAA,EAAA,IAAA,kBAAAA,sBAAA,CAAA,aAAA;AAAA,IAACE,mBAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,cAAA;AAAA,MACP,QAAU,EAAA,oBAAA;AAAA,KAAA;AAAA,qBAEXF,sBAAA,CAAA,aAAA,CAAAE,mBAAA,EAAA,EAAc,KAAO,EAAA,SAAA,EAAW,UAAU,aAAe,E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AAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,iBAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,sBAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
|
|
@@ -4,6 +4,7 @@ import { CodeComponentMetaOverrides, Registerable } from "./utils";
|
|
|
4
4
|
interface BaseCheckboxProps extends CheckboxProps {
|
|
5
5
|
onPressChange: (isPressed: boolean) => void;
|
|
6
6
|
onFocusVisibleChange: (isFocusVisible: boolean) => void;
|
|
7
|
+
onInvalidChange: (isInvalid: boolean) => void;
|
|
7
8
|
}
|
|
8
9
|
export declare function BaseCheckbox(props: BaseCheckboxProps): React.JSX.Element;
|
|
9
10
|
export declare function registerCheckbox(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseCheckbox>): void;
|
|
@@ -36,14 +36,24 @@ var __objRest = (source, exclude) => {
|
|
|
36
36
|
return target;
|
|
37
37
|
};
|
|
38
38
|
function BaseCheckbox(props) {
|
|
39
|
-
const _a = props, {
|
|
40
|
-
|
|
39
|
+
const _a = props, {
|
|
40
|
+
children,
|
|
41
|
+
onPressChange,
|
|
42
|
+
onFocusVisibleChange,
|
|
43
|
+
onInvalidChange
|
|
44
|
+
} = _a, rest = __objRest(_a, [
|
|
45
|
+
"children",
|
|
46
|
+
"onPressChange",
|
|
47
|
+
"onFocusVisibleChange",
|
|
48
|
+
"onInvalidChange"
|
|
49
|
+
]);
|
|
50
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Checkbox, __spreadValues({}, rest), ({ isFocusVisible, isPressed, isInvalid }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
41
51
|
ValueObserver,
|
|
42
52
|
{
|
|
43
53
|
value: isFocusVisible,
|
|
44
54
|
onChange: onFocusVisibleChange
|
|
45
55
|
}
|
|
46
|
-
), /* @__PURE__ */ React.createElement(ValueObserver, { value: isPressed, onChange: onPressChange }), children)));
|
|
56
|
+
), /* @__PURE__ */ React.createElement(ValueObserver, { value: isPressed, onChange: onPressChange }), /* @__PURE__ */ React.createElement(ValueObserver, { value: isInvalid, onChange: onInvalidChange }), children)));
|
|
47
57
|
}
|
|
48
58
|
function registerCheckbox(loader, overrides) {
|
|
49
59
|
registerComponentHelper(
|
|
@@ -111,6 +121,10 @@ function registerCheckbox(loader, overrides) {
|
|
|
111
121
|
onFocusVisibleChange: {
|
|
112
122
|
type: "eventHandler",
|
|
113
123
|
argTypes: [{ name: "isFocusVisible", type: "boolean" }]
|
|
124
|
+
},
|
|
125
|
+
onInvalidChange: {
|
|
126
|
+
type: "eventHandler",
|
|
127
|
+
argTypes: [{ name: "isInvalid", type: "boolean" }]
|
|
114
128
|
}
|
|
115
129
|
}),
|
|
116
130
|
states: {
|
|
@@ -135,6 +149,11 @@ function registerCheckbox(loader, overrides) {
|
|
|
135
149
|
onChangeProp: "onFocusChange",
|
|
136
150
|
variableType: "boolean"
|
|
137
151
|
},
|
|
152
|
+
isInvalid: {
|
|
153
|
+
type: "readonly",
|
|
154
|
+
onChangeProp: "onInvalidChange",
|
|
155
|
+
variableType: "boolean"
|
|
156
|
+
},
|
|
138
157
|
isFocusVisible: {
|
|
139
158
|
type: "readonly",
|
|
140
159
|
onChangeProp: "onFocusVisibleChange",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerCheckbox.esm.js","sources":["../src/registerCheckbox.tsx"],"sourcesContent":["import React from \"react\";\nimport type { CheckboxProps } from \"react-aria-components\";\nimport { Checkbox } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n ValueObserver,\n} from \"./utils\";\n\ninterface BaseCheckboxProps extends CheckboxProps {\n onPressChange: (isPressed: boolean) => void;\n onFocusVisibleChange: (isFocusVisible: boolean) => void;\n}\n\nexport function BaseCheckbox(props: BaseCheckboxProps) {\n const {
|
|
1
|
+
{"version":3,"file":"registerCheckbox.esm.js","sources":["../src/registerCheckbox.tsx"],"sourcesContent":["import React from \"react\";\nimport type { CheckboxProps } from \"react-aria-components\";\nimport { Checkbox } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n ValueObserver,\n} from \"./utils\";\n\ninterface BaseCheckboxProps extends CheckboxProps {\n onPressChange: (isPressed: boolean) => void;\n onFocusVisibleChange: (isFocusVisible: boolean) => void;\n onInvalidChange: (isInvalid: boolean) => void;\n}\n\nexport function BaseCheckbox(props: BaseCheckboxProps) {\n const {\n children,\n onPressChange,\n onFocusVisibleChange,\n onInvalidChange,\n ...rest\n } = props;\n\n return (\n <>\n <Checkbox {...rest}>\n {({ isFocusVisible, isPressed, isInvalid }) => (\n <>\n <ValueObserver\n value={isFocusVisible}\n onChange={onFocusVisibleChange}\n />\n <ValueObserver value={isPressed} onChange={onPressChange} />\n <ValueObserver value={isInvalid} onChange={onInvalidChange} />\n {children}\n </>\n )}\n </Checkbox>\n </>\n );\n}\n\nexport function registerCheckbox(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseCheckbox>\n) {\n registerComponentHelper(\n loader,\n BaseCheckbox,\n {\n name: makeComponentName(\"checkbox\"),\n displayName: \"Aria Checkbox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerCheckbox\",\n importName: \"BaseCheckbox\",\n props: {\n ...getCommonInputProps<BaseCheckboxProps>(\"checkbox\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n \"autoFocus\",\n ]),\n value: {\n type: \"string\",\n description:\n \"The value of the input element, used when submitting an HTML form.\",\n },\n isSelected: {\n type: \"boolean\",\n editOnly: true,\n uncontrolledProp: \"defaultSelected\",\n description: \"Whether the checkbox is toggled on\",\n defaultValueHint: false,\n },\n isIndeterminate: {\n displayName: \"Indeterminate\",\n type: \"boolean\",\n description:\n \"This state indicates that the checkbox is neither fully checked nor unchecked. It typically represents a partial selection when dealing with groups of options. Some but not all items in the group are selected, resulting in an indeterminate state for the checkbox.\",\n defaultValueHint: false,\n },\n isInvalid: {\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isSelected\", type: \"boolean\" }],\n },\n onHoverChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isHovered\", type: \"boolean\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n onPressChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isPressed\", type: \"boolean\" }],\n },\n onFocusVisibleChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocusVisible\", type: \"boolean\" }],\n },\n onInvalidChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isInvalid\", type: \"boolean\" }],\n },\n },\n states: {\n isSelected: {\n type: \"writable\",\n valueProp: \"isSelected\",\n onChangeProp: \"onChange\",\n variableType: \"boolean\",\n },\n isHovered: {\n type: \"readonly\",\n onChangeProp: \"onHoverChange\",\n variableType: \"boolean\",\n },\n isPressed: {\n type: \"readonly\",\n onChangeProp: \"onPressChange\",\n variableType: \"boolean\",\n },\n isFocused: {\n type: \"readonly\",\n onChangeProp: \"onFocusChange\",\n variableType: \"boolean\",\n },\n isInvalid: {\n type: \"readonly\",\n onChangeProp: \"onInvalidChange\",\n variableType: \"boolean\",\n },\n isFocusVisible: {\n type: \"readonly\",\n onChangeProp: \"onFocusVisibleChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,SAAS,aAAa,KAA0B,EAAA;AACrD,EAAA,MAMI,EALF,GAAA,KAAA,EAAA;AAAA,IAAA,QAAA;AAAA,IACA,aAAA;AAAA,IACA,oBAAA;AAAA,IACA,eAAA;AAAA,GAvBJ,GAyBM,EADC,EAAA,IAAA,GAAA,SAAA,CACD,EADC,EAAA;AAAA,IAJH,UAAA;AAAA,IACA,eAAA;AAAA,IACA,sBAAA;AAAA,IACA,iBAAA;AAAA,GAAA,CAAA,CAAA;AAIF,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,cAAA,CAAA,EAAA,EAAa,IACX,CAAA,EAAA,CAAC,EAAE,cAAgB,EAAA,SAAA,EAAW,SAAU,EAAA,qBAErC,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,cAAA;AAAA,M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A,UACX,YAAc,EAAA,UAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,iBAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,sBAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
@@ -55,18 +55,6 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
55
55
|
uncontrolledProp: "defaultValue",
|
|
56
56
|
description: "The current value"
|
|
57
57
|
},
|
|
58
|
-
options: {
|
|
59
|
-
type: "array",
|
|
60
|
-
description: "The options in the radio group",
|
|
61
|
-
itemType: {
|
|
62
|
-
type: "object",
|
|
63
|
-
nameFunc: (item) => item.label,
|
|
64
|
-
fields: {
|
|
65
|
-
label: "string",
|
|
66
|
-
value: "string"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
58
|
isInvalid: {
|
|
71
59
|
displayName: "Invalid",
|
|
72
60
|
type: "boolean",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerCheckboxGroup.cjs.js","sources":["../src/registerCheckboxGroup.tsx"],"sourcesContent":["import type { CheckboxGroupProps } from \"react-aria-components\";\nimport { CheckboxGroup } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { registerCheckbox } from \"./registerCheckbox\";\nimport { registerDescription } from \"./registerDescription\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { registerLabel } from \"./registerLabel\";\nimport {\n CodeComponentMetaOverrides,\n makeChildComponentName,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport const BaseCheckboxGroup = CheckboxGroup;\n\nconst componentName = makeComponentName(\"checkboxGroup\");\n\nexport function registerCheckboxGroup(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseCheckboxGroup>\n) {\n registerComponentHelper(\n loader,\n BaseCheckboxGroup,\n {\n name: componentName,\n displayName: \"Aria Checkbox Group\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerCheckboxGroup\",\n importName: \"BaseCheckboxGroup\",\n props: {\n ...getCommonInputProps<CheckboxGroupProps>(\"checkbox group\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n ]),\n value: {\n type: \"array\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n
|
|
1
|
+
{"version":3,"file":"registerCheckboxGroup.cjs.js","sources":["../src/registerCheckboxGroup.tsx"],"sourcesContent":["import type { CheckboxGroupProps } from \"react-aria-components\";\nimport { CheckboxGroup } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { registerCheckbox } from \"./registerCheckbox\";\nimport { registerDescription } from \"./registerDescription\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { registerLabel } from \"./registerLabel\";\nimport {\n CodeComponentMetaOverrides,\n makeChildComponentName,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport const BaseCheckboxGroup = CheckboxGroup;\n\nconst componentName = makeComponentName(\"checkboxGroup\");\n\nexport function registerCheckboxGroup(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseCheckboxGroup>\n) {\n registerComponentHelper(\n loader,\n BaseCheckboxGroup,\n {\n name: componentName,\n displayName: \"Aria Checkbox Group\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerCheckboxGroup\",\n importName: \"BaseCheckboxGroup\",\n props: {\n ...getCommonInputProps<CheckboxGroupProps>(\"checkbox group\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n ]),\n value: {\n type: \"array\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n isInvalid: {\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"object\" }],\n },\n },\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"array\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n\n const thisName = makeChildComponentName(\n overrides?.parentComponentName,\n componentName\n );\n\n registerFieldError(loader, { parentComponentName: thisName });\n registerCheckbox(loader, { parentComponentName: thisName });\n registerLabel(loader, { parentComponentName: thisName });\n registerDescription(loader, {\n parentComponentName: thisName,\n });\n}\n"],"names":["CheckboxGroup","makeComponentName","registerComponentHelper","getCommonInputProps","makeChildComponentName","registerFieldError","registerCheckbox","registerLabel","registerDescription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,iBAAoB,GAAAA,kCAAA;AAEjC,MAAM,aAAA,GAAgBC,wBAAkB,eAAe,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AA;AAAA,UACd,YAAc,EAAA,OAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AAEA,EAAA,MAAM,QAAW,GAAAC,4BAAA;AAAA,IACf,SAAW,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,mBAAA;AAAA,IACX,aAAA;AAAA,GACF,CAAA;AAEA,EAAAC,qCAAA,CAAmB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC5D,EAAAC,iCAAA,CAAiB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC1D,EAAAC,2BAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAAC,uCAAA,CAAoB,MAAQ,EAAA;AAAA,IAC1B,mBAAqB,EAAA,QAAA;AAAA,GACtB,CAAA,CAAA;AACH;;;;;"}
|
|
@@ -53,18 +53,6 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
53
53
|
uncontrolledProp: "defaultValue",
|
|
54
54
|
description: "The current value"
|
|
55
55
|
},
|
|
56
|
-
options: {
|
|
57
|
-
type: "array",
|
|
58
|
-
description: "The options in the radio group",
|
|
59
|
-
itemType: {
|
|
60
|
-
type: "object",
|
|
61
|
-
nameFunc: (item) => item.label,
|
|
62
|
-
fields: {
|
|
63
|
-
label: "string",
|
|
64
|
-
value: "string"
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
56
|
isInvalid: {
|
|
69
57
|
displayName: "Invalid",
|
|
70
58
|
type: "boolean",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerCheckboxGroup.esm.js","sources":["../src/registerCheckboxGroup.tsx"],"sourcesContent":["import type { CheckboxGroupProps } from \"react-aria-components\";\nimport { CheckboxGroup } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { registerCheckbox } from \"./registerCheckbox\";\nimport { registerDescription } from \"./registerDescription\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { registerLabel } from \"./registerLabel\";\nimport {\n CodeComponentMetaOverrides,\n makeChildComponentName,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport const BaseCheckboxGroup = CheckboxGroup;\n\nconst componentName = makeComponentName(\"checkboxGroup\");\n\nexport function registerCheckboxGroup(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseCheckboxGroup>\n) {\n registerComponentHelper(\n loader,\n BaseCheckboxGroup,\n {\n name: componentName,\n displayName: \"Aria Checkbox Group\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerCheckboxGroup\",\n importName: \"BaseCheckboxGroup\",\n props: {\n ...getCommonInputProps<CheckboxGroupProps>(\"checkbox group\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n ]),\n value: {\n type: \"array\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n
|
|
1
|
+
{"version":3,"file":"registerCheckboxGroup.esm.js","sources":["../src/registerCheckboxGroup.tsx"],"sourcesContent":["import type { CheckboxGroupProps } from \"react-aria-components\";\nimport { CheckboxGroup } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { registerCheckbox } from \"./registerCheckbox\";\nimport { registerDescription } from \"./registerDescription\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { registerLabel } from \"./registerLabel\";\nimport {\n CodeComponentMetaOverrides,\n makeChildComponentName,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport const BaseCheckboxGroup = CheckboxGroup;\n\nconst componentName = makeComponentName(\"checkboxGroup\");\n\nexport function registerCheckboxGroup(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseCheckboxGroup>\n) {\n registerComponentHelper(\n loader,\n BaseCheckboxGroup,\n {\n name: componentName,\n displayName: \"Aria Checkbox Group\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerCheckboxGroup\",\n importName: \"BaseCheckboxGroup\",\n props: {\n ...getCommonInputProps<CheckboxGroupProps>(\"checkbox group\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n ]),\n value: {\n type: \"array\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n isInvalid: {\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"object\" }],\n },\n },\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"array\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n\n const thisName = makeChildComponentName(\n overrides?.parentComponentName,\n componentName\n );\n\n registerFieldError(loader, { parentComponentName: thisName });\n registerCheckbox(loader, { parentComponentName: thisName });\n registerLabel(loader, { parentComponentName: thisName });\n registerDescription(loader, {\n parentComponentName: thisName,\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,iBAAoB,GAAA,cAAA;AAEjC,MAAM,aAAA,GAAgB,kBAAkB,eAAe,CAAA,CAAA;AAEvC,SAAA,qBAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,iBAAA;AAAA,IACA;AAAA,MACE,IAAM,EAAA,aAAA;AAAA,MACN,WAAa,EAAA,qBAAA;AAAA,MACb,UAAY,EAAA,sDAAA;AAAA,MACZ,UAAY,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AAA,mBAAA;AAAA,IACX,aAAA;AAAA,GACF,CAAA;AAEA,EAAA,kBAAA,CAAmB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC5D,EAAA,gBAAA,CAAiB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC1D,EAAA,aAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAA,mBAAA,CAAoB,MAAQ,EAAA;AAAA,IAC1B,mBAAqB,EAAA,QAAA;AAAA,GACtB,CAAA,CAAA;AACH;;;;"}
|
|
@@ -74,18 +74,6 @@ function registerRadioGroup(loader, overrides) {
|
|
|
74
74
|
uncontrolledProp: "defaultValue",
|
|
75
75
|
description: "The current value"
|
|
76
76
|
},
|
|
77
|
-
options: {
|
|
78
|
-
type: "array",
|
|
79
|
-
description: "The options in the radio group",
|
|
80
|
-
itemType: {
|
|
81
|
-
type: "object",
|
|
82
|
-
nameFunc: (item) => item.label,
|
|
83
|
-
fields: {
|
|
84
|
-
label: "string",
|
|
85
|
-
value: "string"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
77
|
isInvalid: {
|
|
90
78
|
displayName: "Invalid",
|
|
91
79
|
type: "boolean",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerRadioGroup.cjs.js","sources":["../src/registerRadioGroup.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\nimport type { RadioGroupProps } from \"react-aria-components\";\nimport { RadioGroup } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { registerDescription } from \"./registerDescription\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { registerLabel } from \"./registerLabel\";\nimport { registerRadio } from \"./registerRadio\";\nimport {\n CodeComponentMetaOverrides,\n makeChildComponentName,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\ninterface BaseRadioGroupProps extends RadioGroupProps {\n children?: ReactNode;\n}\n\nexport function BaseRadioGroup(props: BaseRadioGroupProps) {\n const { children, ...rest } = props;\n\n return (\n <>\n <RadioGroup {...rest}>{children}</RadioGroup>\n </>\n );\n}\n\nconst componentName = makeComponentName(\"radioGroup\");\n\nexport function registerRadioGroup(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseRadioGroup>\n) {\n registerComponentHelper(\n loader,\n BaseRadioGroup,\n {\n name: componentName,\n displayName: \"Aria RadioGroup\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerRadioGroup\",\n importName: \"BaseRadioGroup\",\n props: {\n ...getCommonInputProps<BaseRadioGroupProps>(\"radio group\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n ]),\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n
|
|
1
|
+
{"version":3,"file":"registerRadioGroup.cjs.js","sources":["../src/registerRadioGroup.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\nimport type { RadioGroupProps } from \"react-aria-components\";\nimport { RadioGroup } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { registerDescription } from \"./registerDescription\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { registerLabel } from \"./registerLabel\";\nimport { registerRadio } from \"./registerRadio\";\nimport {\n CodeComponentMetaOverrides,\n makeChildComponentName,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\ninterface BaseRadioGroupProps extends RadioGroupProps {\n children?: ReactNode;\n}\n\nexport function BaseRadioGroup(props: BaseRadioGroupProps) {\n const { children, ...rest } = props;\n\n return (\n <>\n <RadioGroup {...rest}>{children}</RadioGroup>\n </>\n );\n}\n\nconst componentName = makeComponentName(\"radioGroup\");\n\nexport function registerRadioGroup(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseRadioGroup>\n) {\n registerComponentHelper(\n loader,\n BaseRadioGroup,\n {\n name: componentName,\n displayName: \"Aria RadioGroup\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerRadioGroup\",\n importName: \"BaseRadioGroup\",\n props: {\n ...getCommonInputProps<BaseRadioGroupProps>(\"radio group\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n ]),\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n isInvalid: {\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n },\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"array\",\n },\n isFocused: {\n type: \"readonly\",\n onChangeProp: \"onFocusChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n\n const thisName = makeChildComponentName(\n overrides?.parentComponentName,\n componentName\n );\n\n registerFieldError(loader, { parentComponentName: thisName });\n registerRadio(loader, { parentComponentName: thisName });\n registerLabel(loader, { parentComponentName: thisName });\n registerDescription(loader, {\n parentComponentName: thisName,\n });\n}\n"],"names":["React","RadioGroup","makeComponentName","registerComponentHelper","getCommonInputProps","makeChildComponentName","registerFieldError","registerRadio","registerLabel","registerDescription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBO,SAAS,eAAe,KAA4B,EAAA;AACzD,EAAA,MAA8B,YAAt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;"}
|
|
@@ -68,18 +68,6 @@ function registerRadioGroup(loader, overrides) {
|
|
|
68
68
|
uncontrolledProp: "defaultValue",
|
|
69
69
|
description: "The current value"
|
|
70
70
|
},
|
|
71
|
-
options: {
|
|
72
|
-
type: "array",
|
|
73
|
-
description: "The options in the radio group",
|
|
74
|
-
itemType: {
|
|
75
|
-
type: "object",
|
|
76
|
-
nameFunc: (item) => item.label,
|
|
77
|
-
fields: {
|
|
78
|
-
label: "string",
|
|
79
|
-
value: "string"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
71
|
isInvalid: {
|
|
84
72
|
displayName: "Invalid",
|
|
85
73
|
type: "boolean",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerRadioGroup.esm.js","sources":["../src/registerRadioGroup.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\nimport type { RadioGroupProps } from \"react-aria-components\";\nimport { RadioGroup } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { registerDescription } from \"./registerDescription\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { registerLabel } from \"./registerLabel\";\nimport { registerRadio } from \"./registerRadio\";\nimport {\n CodeComponentMetaOverrides,\n makeChildComponentName,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\ninterface BaseRadioGroupProps extends RadioGroupProps {\n children?: ReactNode;\n}\n\nexport function BaseRadioGroup(props: BaseRadioGroupProps) {\n const { children, ...rest } = props;\n\n return (\n <>\n <RadioGroup {...rest}>{children}</RadioGroup>\n </>\n );\n}\n\nconst componentName = makeComponentName(\"radioGroup\");\n\nexport function registerRadioGroup(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseRadioGroup>\n) {\n registerComponentHelper(\n loader,\n BaseRadioGroup,\n {\n name: componentName,\n displayName: \"Aria RadioGroup\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerRadioGroup\",\n importName: \"BaseRadioGroup\",\n props: {\n ...getCommonInputProps<BaseRadioGroupProps>(\"radio group\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n ]),\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n
|
|
1
|
+
{"version":3,"file":"registerRadioGroup.esm.js","sources":["../src/registerRadioGroup.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\nimport type { RadioGroupProps } from \"react-aria-components\";\nimport { RadioGroup } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { registerDescription } from \"./registerDescription\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { registerLabel } from \"./registerLabel\";\nimport { registerRadio } from \"./registerRadio\";\nimport {\n CodeComponentMetaOverrides,\n makeChildComponentName,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\ninterface BaseRadioGroupProps extends RadioGroupProps {\n children?: ReactNode;\n}\n\nexport function BaseRadioGroup(props: BaseRadioGroupProps) {\n const { children, ...rest } = props;\n\n return (\n <>\n <RadioGroup {...rest}>{children}</RadioGroup>\n </>\n );\n}\n\nconst componentName = makeComponentName(\"radioGroup\");\n\nexport function registerRadioGroup(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseRadioGroup>\n) {\n registerComponentHelper(\n loader,\n BaseRadioGroup,\n {\n name: componentName,\n displayName: \"Aria RadioGroup\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerRadioGroup\",\n importName: \"BaseRadioGroup\",\n props: {\n ...getCommonInputProps<BaseRadioGroupProps>(\"radio group\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n ]),\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n isInvalid: {\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n },\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"array\",\n },\n isFocused: {\n type: \"readonly\",\n onChangeProp: \"onFocusChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n\n const thisName = makeChildComponentName(\n overrides?.parentComponentName,\n componentName\n );\n\n registerFieldError(loader, { parentComponentName: thisName });\n registerRadio(loader, { parentComponentName: thisName });\n registerLabel(loader, { parentComponentName: thisName });\n registerDescription(loader, {\n parentComponentName: thisName,\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBO,SAAS,eAAe,KAA4B,EAAA;AACzD,EAAA,MAA8B,YAAtB,EArBV,QAAA,EAAA,GAqBgC,EAAT,EAAA,IAAA,GAAA,SAAA,CAAS,IAAT,CAAb,UAAA,CAAA,CAAA,CAAA;AAER,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAe,EAAA,cAAA,CAAA,EAAA,EAAA,IAAA,CAAA,EAAO,QAAS,CAClC,CAAA,CAAA;AAEJ,CAAA;AAEA,MAAM,aAAA,GAAgB,kBAAkB,YAAY,CAAA,CAAA;AAEpC,SAAA,kBAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,cAAA;AAAA,IACA;AAAA,MACE,IAAM,EAAA,aAAA;AAAA,MACN,WAA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;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AAEA,EAAA,MAAM,QAAW,GAAA,sBAAA;AAAA,IACf,SAAW,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,mBAAA;AAAA,IACX,aAAA;AAAA,GACF,CAAA;AAEA,EAAA,kBAAA,CAAmB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC5D,EAAA,aAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAA,aAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAA,mBAAA,CAAoB,MAAQ,EAAA;AAAA,IAC1B,mBAAqB,EAAA,QAAA;AAAA,GACtB,CAAA,CAAA;AACH;;;;"}
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactAriaComponents = require('react-aria-components');
|
|
5
5
|
var common = require('./common-e74a9214.cjs.js');
|
|
6
|
+
var registerDescription = require('./registerDescription.cjs.js');
|
|
6
7
|
var registerFieldError = require('./registerFieldError.cjs.js');
|
|
7
8
|
var registerInput = require('./registerInput.cjs.js');
|
|
8
9
|
var registerLabel = require('./registerLabel.cjs.js');
|
|
9
|
-
var registerText = require('./registerText.cjs.js');
|
|
10
10
|
var registerTextArea = require('./registerTextArea.cjs.js');
|
|
11
11
|
var utils = require('./utils-1190a0a9.cjs.js');
|
|
12
|
+
require('./registerText.cjs.js');
|
|
12
13
|
require('@plasmicapp/host/registerComponent');
|
|
13
14
|
|
|
14
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -47,13 +48,23 @@ var __objRest = (source, exclude) => {
|
|
|
47
48
|
return target;
|
|
48
49
|
};
|
|
49
50
|
function BaseTextField(props) {
|
|
50
|
-
const _a = props, {
|
|
51
|
+
const _a = props, {
|
|
52
|
+
enableAutoComplete,
|
|
53
|
+
autoComplete,
|
|
54
|
+
children,
|
|
55
|
+
onInvalidChange
|
|
56
|
+
} = _a, rest = __objRest(_a, [
|
|
57
|
+
"enableAutoComplete",
|
|
58
|
+
"autoComplete",
|
|
59
|
+
"children",
|
|
60
|
+
"onInvalidChange"
|
|
61
|
+
]);
|
|
51
62
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
52
63
|
reactAriaComponents.TextField,
|
|
53
64
|
__spreadValues({
|
|
54
65
|
autoComplete: enableAutoComplete ? autoComplete : void 0
|
|
55
66
|
}, rest),
|
|
56
|
-
children
|
|
67
|
+
({ isInvalid }) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(utils.ValueObserver, { value: isInvalid, onChange: onInvalidChange }), children)
|
|
57
68
|
);
|
|
58
69
|
}
|
|
59
70
|
const componentName = utils.makeComponentName("textField");
|
|
@@ -222,6 +233,10 @@ function registerTextField(loader, overrides) {
|
|
|
222
233
|
onFocusChange: {
|
|
223
234
|
type: "eventHandler",
|
|
224
235
|
argTypes: [{ name: "isFocused", type: "boolean" }]
|
|
236
|
+
},
|
|
237
|
+
onInvalidChange: {
|
|
238
|
+
type: "eventHandler",
|
|
239
|
+
argTypes: [{ name: "isInvalid", type: "boolean" }]
|
|
225
240
|
}
|
|
226
241
|
}),
|
|
227
242
|
// NOTE: React-Aria does not support render props for <Input> and <Textarea>, so focusVisible and inputHovered states are not implemented
|
|
@@ -236,6 +251,11 @@ function registerTextField(loader, overrides) {
|
|
|
236
251
|
type: "readonly",
|
|
237
252
|
onChangeProp: "onFocusChange",
|
|
238
253
|
variableType: "boolean"
|
|
254
|
+
},
|
|
255
|
+
isInvalid: {
|
|
256
|
+
type: "readonly",
|
|
257
|
+
onChangeProp: "onInvalidChange",
|
|
258
|
+
variableType: "boolean"
|
|
239
259
|
}
|
|
240
260
|
},
|
|
241
261
|
trapsFocus: true
|
|
@@ -249,12 +269,7 @@ function registerTextField(loader, overrides) {
|
|
|
249
269
|
registerFieldError.registerFieldError(loader, { parentComponentName: thisName });
|
|
250
270
|
registerInput.registerInput(loader, { parentComponentName: thisName });
|
|
251
271
|
registerLabel.registerLabel(loader, { parentComponentName: thisName });
|
|
252
|
-
|
|
253
|
-
parentComponentName: thisName,
|
|
254
|
-
props: {
|
|
255
|
-
slot: { type: "string", readOnly: true, defaultValue: "description" }
|
|
256
|
-
}
|
|
257
|
-
});
|
|
272
|
+
registerDescription.registerDescription(loader, { parentComponentName: thisName });
|
|
258
273
|
registerTextArea.registerTextArea(loader, { parentComponentName: thisName });
|
|
259
274
|
}
|
|
260
275
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerTextField.cjs.js","sources":["../src/registerTextField.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\nimport type { InputProps, TextFieldProps } from \"react-aria-components\";\nimport { TextField } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { registerInput } from \"./registerInput\";\nimport { registerLabel } from \"./registerLabel\";\nimport { registerText } from \"./registerText\";\nimport { registerTextArea } from \"./registerTextArea\";\nimport {\n CodeComponentMetaOverrides,\n makeChildComponentName,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\ninterface BaseTextFieldProps extends TextFieldProps {\n children?: ReactNode;\n label?: ReactNode;\n description?: ReactNode;\n enableAutoComplete?: boolean;\n multiline?: boolean;\n inputProps?: InputProps;\n}\n\nexport function BaseTextField(props: BaseTextFieldProps) {\n const { enableAutoComplete, autoComplete, children, ...rest } = props;\n\n return (\n <TextField\n autoComplete={enableAutoComplete ? autoComplete : undefined}\n {...rest}\n >\n {children}\n </TextField>\n );\n}\n\nconst componentName = makeComponentName(\"textField\");\n\nexport function registerTextField(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseTextField>\n) {\n registerComponentHelper(\n loader,\n BaseTextField,\n {\n name: componentName,\n displayName: \"Aria TextField\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerTextField\",\n importName: \"BaseTextField\",\n // TODO: Support for validate prop\n props: {\n ...getCommonInputProps<BaseTextFieldProps>(\"input\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n ]),\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n isInvalid: {\n // TODO: Not sure if needed\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n customValidationErrors: {\n // TODO: Not sure if needed\n type: \"array\",\n description: \"Errors for custom validation\",\n },\n // validate: {\n // type: \"function\" as const,\n // argNames: [\"value\"],\n // argValues: (_ps: any, ctx: any) => [ctx.data[0]],\n // },\n enableAutoComplete: {\n type: \"boolean\",\n description:\n \"Whether the browser is allowed to automatically complete the input\",\n defaultValueHint: false,\n },\n autoComplete: {\n type: \"choice\",\n hidden: ({ enableAutoComplete }: BaseTextFieldProps) =>\n !enableAutoComplete,\n description: \"Guidance as to the type of data expected in the field\",\n helpText:\n \"For explanations on what each of the values mean, check https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\",\n options: [\n \"name\",\n \"honorific-prefix\",\n \"given-name\",\n \"additional-name\",\n \"family-name\",\n \"honorific-suffix\",\n \"nickname\",\n \"email\",\n \"username\",\n \"new-password\",\n \"current-password\",\n \"one-time-code\",\n \"organization-title\",\n \"organization\",\n \"street-address\",\n \"shipping\",\n \"billing\",\n \"address-line1\",\n \"address-line2\",\n \"address-line3\",\n \"address-level4\",\n \"address-level3\",\n \"address-level2\",\n \"address-level1\",\n \"country\",\n \"country-name\",\n \"postal-code\",\n \"cc-name\",\n \"cc-given-name\",\n \"cc-additional-name\",\n \"cc-family-name\",\n \"cc-number\",\n \"cc-exp\",\n \"cc-exp-month\",\n \"cc-exp-year\",\n \"cc-csc\",\n \"cc-type\",\n \"transaction-currency\",\n \"transaction-amount\",\n \"language\",\n \"bday\",\n \"bday-day\",\n \"bday-month\",\n \"bday-year\",\n \"sex\",\n \"tel\",\n \"tel-country-code\",\n \"tel-national\",\n \"tel-area-code\",\n \"tel-local\",\n \"tel-local-suffix\",\n \"tel-local-prefix\",\n \"tel-extension\",\n \"impp\",\n \"url\",\n \"photo\",\n \"webauthn\",\n ],\n },\n maxLength: {\n type: \"number\",\n description:\n \"The maximum number of characters supported by the input\",\n },\n minLength: {\n type: \"number\",\n description:\n \"The minimum number of characters supported by the input\",\n },\n pattern: {\n type: \"string\",\n description:\n \"Regex pattern that the value of the input must match to be valid\",\n helpText:\n \"For more information about writing Regular Expressions (regex), check out https://regexr.com/\",\n validator: (value) => {\n try {\n new RegExp(value);\n return true;\n } catch (error) {\n return \"Invalid Regex\";\n }\n },\n },\n type: {\n type: \"choice\",\n defaultValueHint: \"text\",\n options: [\"text\", \"search\", \"url\", \"tel\", \"email\", \"password\"],\n },\n inputMode: {\n type: \"choice\",\n description:\n \"hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.\",\n options: [\n \"none\",\n \"text\",\n \"tel\",\n \"url\",\n \"email\",\n \"numeric\",\n \"decimal\",\n \"search\",\n ],\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n },\n // NOTE: React-Aria does not support render props for <Input> and <Textarea>, so focusVisible and inputHovered states are not implemented\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"text\",\n },\n isFocused: {\n type: \"readonly\",\n onChangeProp: \"onFocusChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n\n const thisName = makeChildComponentName(\n overrides?.parentComponentName,\n componentName\n );\n\n registerFieldError(loader, { parentComponentName: thisName });\n registerInput(loader, { parentComponentName: thisName });\n registerLabel(loader, { parentComponentName: thisName });\n registerText(loader, {\n parentComponentName: thisName,\n props: {\n slot: { type: \"string\", readOnly: true, defaultValue: \"description\" },\n },\n });\n registerTextArea(loader, { parentComponentName: thisName });\n}\n"],"names":["React","TextField","makeComponentName","registerComponentHelper","getCommonInputProps","makeChildComponentName","registerFieldError","registerInput","registerLabel","registerText","registerTextArea"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,SAAS,cAAc,KAA2B,EAAA;AACvD,EAAgE,MAAA,EAAA,GAAA,KAAA,EAAxD,EAAoB,kBAAA,EAAA,YAAA,EAAc,QA3B5C,EAAA,GA2BkE,IAAT,IAAS,GAAA,SAAA,CAAA,EAAA,EAAT,CAA/C,oBAAA,EAAoB,cAAc,EAAA,UAAA,CAAA,CAAA,CAAA;AAE1C,EACE,uBAAAA,sBAAA,CAAA,aAAA;AAAA,IAACC,6BAAA;AAAA,IAAA,cAAA,CAAA;AAAA,MACC,YAAA,EAAc,qBAAqB,YAAe,GAAA,KAAA,CAAA;AAAA,KAC9C,EAAA,IAAA,CAAA;AAAA,IAEH,QAAA;AAAA,GACH,CAAA;AAEJ,CAAA;AAEA,MAAM,aAAA,GAAgBC,wBAAkB,WAAW,CAAA,CAAA;AAEnC,SAAA,iBAAA,CACd,QACA,SACA,EAAA;AACA,EAAAC,6BAAA;AAAA,IACE,MAAA;AAAA,IACA,aAAA;AAAA,IACA;AA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;AAAA,UACd,YAAc,EAAA,MAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AAEA,EAAA,MAAM,QAAW,GAAAC,4BAAA;AAAA,IACf,SAAW,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,mBAAA;AAAA,IACX,aAAA;AAAA,GACF,CAAA;AAEA,EAAAC,qCAAA,CAAmB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC5D,EAAAC,2BAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAAC,2BAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAAC,yBAAA,CAAa,MAAQ,EAAA;AAAA,IACnB,mBAAqB,EAAA,QAAA;AAAA,IACrB,KAAO,EAAA;AAAA,MACL,MAAM,EAAE,IAAA,EAAM,UAAU,QAAU,EAAA,IAAA,EAAM,cAAc,aAAc,EAAA;AAAA,KACtE;AAAA,GACD,CAAA,CAAA;AACD,EAAAC,iCAAA,CAAiB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC5D;;;;;"}
|
|
1
|
+
{"version":3,"file":"registerTextField.cjs.js","sources":["../src/registerTextField.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\nimport type { InputProps, TextFieldProps } from \"react-aria-components\";\nimport { TextField } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { registerDescription } from \"./registerDescription\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { registerInput } from \"./registerInput\";\nimport { registerLabel } from \"./registerLabel\";\nimport { registerTextArea } from \"./registerTextArea\";\nimport {\n CodeComponentMetaOverrides,\n makeChildComponentName,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n ValueObserver,\n} from \"./utils\";\n\ninterface BaseTextFieldProps extends TextFieldProps {\n children?: ReactNode;\n label?: ReactNode;\n description?: ReactNode;\n enableAutoComplete?: boolean;\n multiline?: boolean;\n inputProps?: InputProps;\n onInvalidChange?: (isInvalid: boolean) => void;\n}\n\nexport function BaseTextField(props: BaseTextFieldProps) {\n const {\n enableAutoComplete,\n autoComplete,\n children,\n onInvalidChange,\n ...rest\n } = props;\n\n return (\n <TextField\n autoComplete={enableAutoComplete ? autoComplete : undefined}\n {...rest}\n >\n {({ isInvalid }) => (\n <>\n <ValueObserver value={isInvalid} onChange={onInvalidChange} />\n {children as ReactNode}\n </>\n )}\n </TextField>\n );\n}\n\nconst componentName = makeComponentName(\"textField\");\n\nexport function registerTextField(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseTextField>\n) {\n registerComponentHelper(\n loader,\n BaseTextField,\n {\n name: componentName,\n displayName: \"Aria TextField\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerTextField\",\n importName: \"BaseTextField\",\n // TODO: Support for validate prop\n props: {\n ...getCommonInputProps<BaseTextFieldProps>(\"input\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n ]),\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n isInvalid: {\n // TODO: Not sure if needed\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n customValidationErrors: {\n // TODO: Not sure if needed\n type: \"array\",\n description: \"Errors for custom validation\",\n },\n // validate: {\n // type: \"function\" as const,\n // argNames: [\"value\"],\n // argValues: (_ps: any, ctx: any) => [ctx.data[0]],\n // },\n enableAutoComplete: {\n type: \"boolean\",\n description:\n \"Whether the browser is allowed to automatically complete the input\",\n defaultValueHint: false,\n },\n autoComplete: {\n type: \"choice\",\n hidden: ({ enableAutoComplete }: BaseTextFieldProps) =>\n !enableAutoComplete,\n description: \"Guidance as to the type of data expected in the field\",\n helpText:\n \"For explanations on what each of the values mean, check https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\",\n options: [\n \"name\",\n \"honorific-prefix\",\n \"given-name\",\n \"additional-name\",\n \"family-name\",\n \"honorific-suffix\",\n \"nickname\",\n \"email\",\n \"username\",\n \"new-password\",\n \"current-password\",\n \"one-time-code\",\n \"organization-title\",\n \"organization\",\n \"street-address\",\n \"shipping\",\n \"billing\",\n \"address-line1\",\n \"address-line2\",\n \"address-line3\",\n \"address-level4\",\n \"address-level3\",\n \"address-level2\",\n \"address-level1\",\n \"country\",\n \"country-name\",\n \"postal-code\",\n \"cc-name\",\n \"cc-given-name\",\n \"cc-additional-name\",\n \"cc-family-name\",\n \"cc-number\",\n \"cc-exp\",\n \"cc-exp-month\",\n \"cc-exp-year\",\n \"cc-csc\",\n \"cc-type\",\n \"transaction-currency\",\n \"transaction-amount\",\n \"language\",\n \"bday\",\n \"bday-day\",\n \"bday-month\",\n \"bday-year\",\n \"sex\",\n \"tel\",\n \"tel-country-code\",\n \"tel-national\",\n \"tel-area-code\",\n \"tel-local\",\n \"tel-local-suffix\",\n \"tel-local-prefix\",\n \"tel-extension\",\n \"impp\",\n \"url\",\n \"photo\",\n \"webauthn\",\n ],\n },\n maxLength: {\n type: \"number\",\n description:\n \"The maximum number of characters supported by the input\",\n },\n minLength: {\n type: \"number\",\n description:\n \"The minimum number of characters supported by the input\",\n },\n pattern: {\n type: \"string\",\n description:\n \"Regex pattern that the value of the input must match to be valid\",\n helpText:\n \"For more information about writing Regular Expressions (regex), check out https://regexr.com/\",\n validator: (value) => {\n try {\n new RegExp(value);\n return true;\n } catch (error) {\n return \"Invalid Regex\";\n }\n },\n },\n type: {\n type: \"choice\",\n defaultValueHint: \"text\",\n options: [\"text\", \"search\", \"url\", \"tel\", \"email\", \"password\"],\n },\n inputMode: {\n type: \"choice\",\n description:\n \"hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.\",\n options: [\n \"none\",\n \"text\",\n \"tel\",\n \"url\",\n \"email\",\n \"numeric\",\n \"decimal\",\n \"search\",\n ],\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n onInvalidChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isInvalid\", type: \"boolean\" }],\n },\n },\n // NOTE: React-Aria does not support render props for <Input> and <Textarea>, so focusVisible and inputHovered states are not implemented\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"text\",\n },\n isFocused: {\n type: \"readonly\",\n onChangeProp: \"onFocusChange\",\n variableType: \"boolean\",\n },\n isInvalid: {\n type: \"readonly\",\n onChangeProp: \"onInvalidChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n\n const thisName = makeChildComponentName(\n overrides?.parentComponentName,\n componentName\n );\n\n registerFieldError(loader, { parentComponentName: thisName });\n registerInput(loader, { parentComponentName: thisName });\n registerLabel(loader, { parentComponentName: thisName });\n registerDescription(loader, { parentComponentName: thisName });\n registerTextArea(loader, { parentComponentName: thisName });\n}\n"],"names":["React","TextField","ValueObserver","makeComponentName","registerComponentHelper","getCommonInputProps","makeChildComponentName","registerFieldError","registerInput","registerLabel","registerDescription","registerTextArea"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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EAAA,UAAA;AAAA,UACN,YAAc,EAAA,iBAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AAEA,EAAA,MAAM,QAAW,GAAAC,4BAAA;AAAA,IACf,SAAW,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,mBAAA;AAAA,IACX,aAAA;AAAA,GACF,CAAA;AAEA,EAAAC,qCAAA,CAAmB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC5D,EAAAC,2BAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAAC,2BAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAAC,uCAAA,CAAoB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC7D,EAAAC,iCAAA,CAAiB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC5D;;;;;"}
|
|
@@ -8,6 +8,7 @@ interface BaseTextFieldProps extends TextFieldProps {
|
|
|
8
8
|
enableAutoComplete?: boolean;
|
|
9
9
|
multiline?: boolean;
|
|
10
10
|
inputProps?: InputProps;
|
|
11
|
+
onInvalidChange?: (isInvalid: boolean) => void;
|
|
11
12
|
}
|
|
12
13
|
export declare function BaseTextField(props: BaseTextFieldProps): React.JSX.Element;
|
|
13
14
|
export declare function registerTextField(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseTextField>): void;
|