@plasmicpkgs/react-aria 0.0.42 → 0.0.43
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/common.d.ts +8 -1
- package/dist/contexts.d.ts +0 -1
- package/dist/react-aria.esm.js +638 -465
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +637 -464
- package/dist/react-aria.js.map +1 -1
- package/dist/registerButton.d.ts +1 -1
- package/dist/registerCheckbox.d.ts +3 -4
- package/dist/registerCheckboxGroup.d.ts +2 -2
- package/dist/registerInput.d.ts +12 -5
- package/dist/registerListBox.d.ts +2 -3
- package/dist/registerModal.d.ts +2 -3
- package/dist/registerPopover.d.ts +4 -6
- package/dist/registerRadio.d.ts +3 -5
- package/dist/registerRadioGroup.d.ts +1 -1
- package/dist/registerSliderThumb.d.ts +1 -1
- package/dist/registerSwitch.d.ts +1 -1
- package/dist/registerTextArea.d.ts +11 -5
- package/dist/registerTextField.d.ts +3 -3
- package/dist/utils.d.ts +7 -1
- package/package.json +2 -2
- package/skinny/common-96be13c3.esm.js +341 -0
- package/skinny/common-96be13c3.esm.js.map +1 -0
- package/skinny/common-f51484c1.cjs.js +345 -0
- package/skinny/common-f51484c1.cjs.js.map +1 -0
- package/skinny/common.d.ts +8 -1
- package/skinny/{contexts-7236059e.cjs.js → contexts-3a98471a.cjs.js} +1 -3
- package/skinny/contexts-3a98471a.cjs.js.map +1 -0
- package/skinny/{contexts-21e0d928.esm.js → contexts-87c261f6.esm.js} +2 -3
- package/skinny/contexts-87c261f6.esm.js.map +1 -0
- package/skinny/contexts.d.ts +0 -1
- package/skinny/registerButton.cjs.js +2 -2
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.d.ts +1 -1
- package/skinny/registerButton.esm.js +2 -2
- package/skinny/registerButton.esm.js.map +1 -1
- package/skinny/registerCheckbox.cjs.js +13 -18
- package/skinny/registerCheckbox.cjs.js.map +1 -1
- package/skinny/registerCheckbox.d.ts +3 -4
- package/skinny/registerCheckbox.esm.js +13 -18
- package/skinny/registerCheckbox.esm.js.map +1 -1
- package/skinny/registerCheckboxGroup.cjs.js +5 -5
- package/skinny/registerCheckboxGroup.cjs.js.map +1 -1
- package/skinny/registerCheckboxGroup.d.ts +2 -2
- package/skinny/registerCheckboxGroup.esm.js +5 -5
- package/skinny/registerCheckboxGroup.esm.js.map +1 -1
- package/skinny/registerComboBox.cjs.js +3 -3
- package/skinny/registerComboBox.esm.js +3 -3
- package/skinny/registerDialogTrigger.cjs.js +2 -2
- package/skinny/registerDialogTrigger.esm.js +2 -2
- package/skinny/registerHeader.cjs.js +1 -1
- package/skinny/registerHeader.esm.js +1 -1
- package/skinny/registerInput.cjs.js +76 -16
- package/skinny/registerInput.cjs.js.map +1 -1
- package/skinny/registerInput.d.ts +12 -5
- package/skinny/registerInput.esm.js +76 -17
- package/skinny/registerInput.esm.js.map +1 -1
- package/skinny/{registerListBox-f060da58.cjs.js → registerListBox-44316bb6.cjs.js} +7 -7
- package/skinny/registerListBox-44316bb6.cjs.js.map +1 -0
- package/skinny/{registerListBox-38a08460.esm.js → registerListBox-ccd14a2e.esm.js} +7 -7
- package/skinny/registerListBox-ccd14a2e.esm.js.map +1 -0
- package/skinny/registerListBox.cjs.js +3 -2
- package/skinny/registerListBox.cjs.js.map +1 -1
- package/skinny/registerListBox.d.ts +2 -3
- package/skinny/registerListBox.esm.js +3 -2
- package/skinny/registerListBox.esm.js.map +1 -1
- package/skinny/registerListBoxItem.cjs.js +1 -1
- package/skinny/registerListBoxItem.esm.js +1 -1
- package/skinny/registerModal.cjs.js +5 -4
- package/skinny/registerModal.cjs.js.map +1 -1
- package/skinny/registerModal.d.ts +2 -3
- package/skinny/registerModal.esm.js +5 -4
- package/skinny/registerModal.esm.js.map +1 -1
- package/skinny/registerPopover.cjs.js +23 -24
- package/skinny/registerPopover.cjs.js.map +1 -1
- package/skinny/registerPopover.d.ts +4 -6
- package/skinny/registerPopover.esm.js +24 -25
- package/skinny/registerPopover.esm.js.map +1 -1
- package/skinny/registerRadio.cjs.js +14 -26
- package/skinny/registerRadio.cjs.js.map +1 -1
- package/skinny/registerRadio.d.ts +3 -5
- package/skinny/registerRadio.esm.js +14 -26
- package/skinny/registerRadio.esm.js.map +1 -1
- package/skinny/registerRadioGroup.cjs.js +4 -4
- package/skinny/registerRadioGroup.cjs.js.map +1 -1
- package/skinny/registerRadioGroup.d.ts +1 -1
- package/skinny/registerRadioGroup.esm.js +4 -4
- package/skinny/registerRadioGroup.esm.js.map +1 -1
- package/skinny/registerSection.cjs.js +1 -1
- package/skinny/registerSection.esm.js +1 -1
- package/skinny/registerSelect.cjs.js +3 -3
- package/skinny/registerSelect.esm.js +3 -3
- package/skinny/{registerSlider-58ef7e20.cjs.js → registerSlider-cd08b960.cjs.js} +4 -4
- package/skinny/registerSlider-cd08b960.cjs.js.map +1 -0
- package/skinny/{registerSlider-d74e2330.esm.js → registerSlider-df0fdf82.esm.js} +4 -4
- package/skinny/registerSlider-df0fdf82.esm.js.map +1 -0
- package/skinny/registerSlider.cjs.js +3 -3
- package/skinny/registerSlider.esm.js +3 -3
- package/skinny/registerSliderThumb.cjs.js +3 -3
- package/skinny/registerSliderThumb.cjs.js.map +1 -1
- package/skinny/registerSliderThumb.d.ts +1 -1
- package/skinny/registerSliderThumb.esm.js +3 -3
- package/skinny/registerSliderThumb.esm.js.map +1 -1
- package/skinny/registerSliderTrack.cjs.js +3 -3
- package/skinny/registerSliderTrack.esm.js +3 -3
- package/skinny/registerSwitch.cjs.js +10 -4
- package/skinny/registerSwitch.cjs.js.map +1 -1
- package/skinny/registerSwitch.d.ts +1 -1
- package/skinny/registerSwitch.esm.js +10 -4
- package/skinny/registerSwitch.esm.js.map +1 -1
- package/skinny/registerTextArea.cjs.js +56 -35
- package/skinny/registerTextArea.cjs.js.map +1 -1
- package/skinny/registerTextArea.d.ts +11 -5
- package/skinny/registerTextArea.esm.js +56 -36
- package/skinny/registerTextArea.esm.js.map +1 -1
- package/skinny/registerTextField.cjs.js +34 -215
- package/skinny/registerTextField.cjs.js.map +1 -1
- package/skinny/registerTextField.d.ts +3 -3
- package/skinny/registerTextField.esm.js +34 -215
- package/skinny/registerTextField.esm.js.map +1 -1
- package/skinny/utils-a1785802.esm.js.map +1 -1
- package/skinny/utils-d3708034.cjs.js.map +1 -1
- package/skinny/utils.d.ts +7 -1
- package/skinny/common-52c26d37.esm.js +0 -52
- package/skinny/common-52c26d37.esm.js.map +0 -1
- package/skinny/common-e74a9214.cjs.js +0 -54
- package/skinny/common-e74a9214.cjs.js.map +0 -1
- package/skinny/contexts-21e0d928.esm.js.map +0 -1
- package/skinny/contexts-7236059e.cjs.js.map +0 -1
- package/skinny/registerListBox-38a08460.esm.js.map +0 -1
- package/skinny/registerListBox-f060da58.cjs.js.map +0 -1
- package/skinny/registerSlider-58ef7e20.cjs.js.map +0 -1
- package/skinny/registerSlider-d74e2330.esm.js.map +0 -1
package/dist/react-aria.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, Component, forwardRef, useImperativeHandle, useMemo, useRef } from 'react';
|
|
2
|
-
import { Button,
|
|
2
|
+
import { Button, Checkbox, Text, FieldError, Label, CheckboxGroup, Input, ListBoxItem, ListBox, Header, Section, Collection, PopoverContext, SelectContext, Popover, ComboBox, ComboBoxStateContext, Heading, ModalOverlay, Modal, Dialog, DialogTrigger, Form, Radio, RadioGroup, Select, SelectValue, SliderOutput, SliderThumb, Slider, SliderTrack, Switch, TextArea, TextField } from 'react-aria-components';
|
|
3
3
|
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
4
4
|
import { useFilter } from '@react-aria/i18n';
|
|
5
5
|
import { mergeProps, useTooltipTrigger } from 'react-aria';
|
|
@@ -8,51 +8,400 @@ import { usePlasmicCanvasContext } from '@plasmicapp/host';
|
|
|
8
8
|
import flattenChildren from 'react-keyed-flatten-children';
|
|
9
9
|
import { useTooltipTriggerState } from 'react-stately';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var __defProp$r = Object.defineProperty;
|
|
12
|
+
var __defProps$e = Object.defineProperties;
|
|
13
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
14
|
+
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
15
|
+
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
|
17
|
+
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
|
+
var __spreadValues$r = (a, b) => {
|
|
19
|
+
for (var prop in b || (b = {}))
|
|
20
|
+
if (__hasOwnProp$r.call(b, prop))
|
|
21
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
22
|
+
if (__getOwnPropSymbols$r)
|
|
23
|
+
for (var prop of __getOwnPropSymbols$r(b)) {
|
|
24
|
+
if (__propIsEnum$r.call(b, prop))
|
|
25
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
26
|
+
}
|
|
27
|
+
return a;
|
|
28
|
+
};
|
|
29
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
30
|
+
function registerComponentHelper(loader, component, meta, overrides) {
|
|
31
|
+
if (overrides) {
|
|
32
|
+
meta = __spreadProps$e(__spreadValues$r(__spreadValues$r({}, meta), overrides), {
|
|
33
|
+
props: __spreadValues$r(__spreadValues$r({}, meta.props), overrides.props)
|
|
34
|
+
});
|
|
35
|
+
if (overrides.parentComponentName) {
|
|
36
|
+
meta.name = makeChildComponentName(
|
|
37
|
+
overrides.parentComponentName,
|
|
38
|
+
meta.name
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (loader) {
|
|
43
|
+
loader.registerComponent(component, meta);
|
|
44
|
+
} else {
|
|
45
|
+
registerComponent(component, meta);
|
|
46
|
+
}
|
|
47
|
+
return meta;
|
|
48
|
+
}
|
|
49
|
+
function makeComponentName(name) {
|
|
50
|
+
return `plasmic-react-aria-${name}`;
|
|
51
|
+
}
|
|
52
|
+
function makeChildComponentName(fullParentName, fullChildName) {
|
|
53
|
+
if (!fullParentName) {
|
|
54
|
+
return fullChildName;
|
|
55
|
+
}
|
|
56
|
+
return `${fullParentName}-${fullChildName.replace(
|
|
57
|
+
"plasmic-react-aria-",
|
|
58
|
+
""
|
|
59
|
+
)}`;
|
|
60
|
+
}
|
|
61
|
+
function extractPlasmicDataProps(props) {
|
|
62
|
+
return Object.fromEntries(
|
|
63
|
+
Object.entries(props).filter(([key]) => key.startsWith("data-plasmic-"))
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
function withoutNils(array) {
|
|
67
|
+
return array.filter((x) => x != null);
|
|
68
|
+
}
|
|
69
|
+
function isDefined(thing) {
|
|
70
|
+
return thing !== void 0 && thing !== null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function hasParent(_props, ctx) {
|
|
74
|
+
return isDefined(ctx == null ? void 0 : ctx.parent) === true;
|
|
75
|
+
}
|
|
76
|
+
function isParentReadOnly(_props, ctx) {
|
|
77
|
+
var _a;
|
|
78
|
+
return ((_a = ctx == null ? void 0 : ctx.parent) == null ? void 0 : _a.isReadOnly) === true;
|
|
79
|
+
}
|
|
80
|
+
function isParentDisabled(_props, ctx) {
|
|
81
|
+
var _a;
|
|
82
|
+
return ((_a = ctx == null ? void 0 : ctx.parent) == null ? void 0 : _a.isDisabled) === true;
|
|
83
|
+
}
|
|
84
|
+
function resolveAutoComplete(autoCompleteProp) {
|
|
85
|
+
if (typeof autoCompleteProp === "string") {
|
|
86
|
+
return autoCompleteProp;
|
|
87
|
+
}
|
|
88
|
+
if (!autoCompleteProp || !Array.isArray(autoCompleteProp) || autoCompleteProp.includes("off")) {
|
|
89
|
+
return void 0;
|
|
90
|
+
}
|
|
91
|
+
if (autoCompleteProp.includes("off")) {
|
|
92
|
+
return "off";
|
|
93
|
+
}
|
|
94
|
+
if (autoCompleteProp.includes("on") && autoCompleteProp.length === 1) {
|
|
95
|
+
return "on";
|
|
96
|
+
}
|
|
97
|
+
return autoCompleteProp.filter((x) => x !== "on").join(" ");
|
|
98
|
+
}
|
|
99
|
+
function createNameProp() {
|
|
100
|
+
return {
|
|
101
|
+
type: "string",
|
|
102
|
+
description: "Name for this field if it is part of a form",
|
|
103
|
+
hidden: hasParent,
|
|
104
|
+
advanced: true
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function createDisabledProp(componentName) {
|
|
108
|
+
return {
|
|
109
|
+
displayName: "Disabled",
|
|
110
|
+
type: "boolean",
|
|
111
|
+
description: `Whether the ${componentName} is read-only and unfocusable`,
|
|
112
|
+
defaultValueHint: false,
|
|
113
|
+
hidden: isParentDisabled
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function createReadOnlyProp(componentName) {
|
|
117
|
+
return {
|
|
118
|
+
displayName: "Read only",
|
|
119
|
+
type: "boolean",
|
|
120
|
+
description: `Whether the value of this ${componentName} can be changed by the user. Unlike disabled, read-only does not prevent the user from interacting with the component (such as focus).`,
|
|
121
|
+
defaultValueHint: false,
|
|
122
|
+
advanced: true,
|
|
123
|
+
hidden: isParentReadOnly
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function createRequiredProp(componentName) {
|
|
127
|
+
return {
|
|
128
|
+
displayName: "Required",
|
|
129
|
+
type: "boolean",
|
|
130
|
+
description: `Whether user input is required on the ${componentName} before form submission.`,
|
|
131
|
+
defaultValueHint: false,
|
|
132
|
+
advanced: true,
|
|
133
|
+
hidden: hasParent
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function createAutoFocusProp(componentName) {
|
|
137
|
+
return {
|
|
138
|
+
type: "boolean",
|
|
139
|
+
description: `Whether the ${componentName} should be focused when rendered`,
|
|
140
|
+
defaultValueHint: false,
|
|
141
|
+
advanced: true,
|
|
142
|
+
hidden: hasParent
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function createAriaLabelProp(componentName) {
|
|
146
|
+
return {
|
|
147
|
+
type: "string",
|
|
148
|
+
displayName: "Aria Label",
|
|
149
|
+
description: `Label for this ${componentName}, if no visible label is used, to identify the element to assistive technology`,
|
|
150
|
+
advanced: true,
|
|
151
|
+
hidden: hasParent
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function createChildrenProp() {
|
|
155
|
+
return {
|
|
156
|
+
type: "slot",
|
|
157
|
+
mergeWithParent: true
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function getCommonProps(componentName, propNames) {
|
|
161
|
+
const commonProps = {
|
|
162
|
+
name: createNameProp(),
|
|
163
|
+
disabled: createDisabledProp(componentName),
|
|
164
|
+
isDisabled: createDisabledProp(componentName),
|
|
165
|
+
readOnly: createReadOnlyProp(componentName),
|
|
166
|
+
isReadOnly: createReadOnlyProp(componentName),
|
|
167
|
+
autoFocus: createAutoFocusProp(componentName),
|
|
168
|
+
"aria-label": createAriaLabelProp(componentName),
|
|
169
|
+
required: createRequiredProp(componentName),
|
|
170
|
+
isRequired: createRequiredProp(componentName),
|
|
171
|
+
children: createChildrenProp(),
|
|
172
|
+
// NOTE: The following props are only applicable to inputs, textareas, and text fields
|
|
173
|
+
value: {
|
|
14
174
|
type: "string",
|
|
15
|
-
|
|
175
|
+
editOnly: true,
|
|
176
|
+
displayName: "Default Value",
|
|
177
|
+
uncontrolledProp: "defaultValue",
|
|
178
|
+
description: `The default value of the ${componentName}`,
|
|
179
|
+
hidden: hasParent
|
|
16
180
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
181
|
+
maxLength: {
|
|
182
|
+
type: "number",
|
|
183
|
+
description: "The maximum number of characters supported by the input",
|
|
184
|
+
advanced: true,
|
|
185
|
+
hidden: hasParent
|
|
22
186
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
187
|
+
minLength: {
|
|
188
|
+
type: "number",
|
|
189
|
+
description: "The minimum number of characters supported by the input",
|
|
190
|
+
advanced: true,
|
|
191
|
+
hidden: hasParent
|
|
28
192
|
},
|
|
29
|
-
|
|
30
|
-
type: "boolean",
|
|
31
|
-
description: `Whether the ${fieldName} should be focused when rendered`,
|
|
32
|
-
defaultValueHint: false,
|
|
33
|
-
advanced: true
|
|
34
|
-
},
|
|
35
|
-
"aria-label": {
|
|
193
|
+
pattern: {
|
|
36
194
|
type: "string",
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
195
|
+
description: "Regex pattern that the value of the input must match to be valid",
|
|
196
|
+
helpText: "For more information about writing Regular Expressions (regex), check out https://regexr.com/",
|
|
197
|
+
validator: (value) => {
|
|
198
|
+
try {
|
|
199
|
+
new RegExp(value);
|
|
200
|
+
return true;
|
|
201
|
+
} catch (error) {
|
|
202
|
+
return "Invalid Regex";
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
advanced: true,
|
|
206
|
+
hidden: hasParent
|
|
207
|
+
},
|
|
208
|
+
type: {
|
|
209
|
+
type: "choice",
|
|
210
|
+
defaultValueHint: "text",
|
|
211
|
+
options: ["text", "search", "url", "tel", "email", "password"],
|
|
212
|
+
description: "The type of data that an input field is expected to handle. It influences the input's behavior, validation, and the kind of interface provided to the user.",
|
|
213
|
+
advanced: true,
|
|
214
|
+
hidden: hasParent
|
|
215
|
+
},
|
|
216
|
+
inputMode: {
|
|
217
|
+
type: "choice",
|
|
218
|
+
description: "hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.",
|
|
219
|
+
options: [
|
|
220
|
+
"none",
|
|
221
|
+
"text",
|
|
222
|
+
"tel",
|
|
223
|
+
"url",
|
|
224
|
+
"email",
|
|
225
|
+
"numeric",
|
|
226
|
+
"decimal",
|
|
227
|
+
"search"
|
|
228
|
+
],
|
|
229
|
+
hidden: hasParent
|
|
230
|
+
},
|
|
231
|
+
autoComplete: {
|
|
232
|
+
type: "choice",
|
|
233
|
+
advanced: true,
|
|
234
|
+
multiSelect: true,
|
|
235
|
+
hidden: hasParent,
|
|
236
|
+
description: "Guidance as to the type of data expected in the field",
|
|
237
|
+
helpText: "For explanations on what each of the values mean, check https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values",
|
|
238
|
+
options: [
|
|
239
|
+
"on",
|
|
240
|
+
"off",
|
|
241
|
+
"name",
|
|
242
|
+
"honorific-prefix",
|
|
243
|
+
"given-name",
|
|
244
|
+
"additional-name",
|
|
245
|
+
"family-name",
|
|
246
|
+
"honorific-suffix",
|
|
247
|
+
"nickname",
|
|
248
|
+
"email",
|
|
249
|
+
"username",
|
|
250
|
+
"new-password",
|
|
251
|
+
"current-password",
|
|
252
|
+
"one-time-code",
|
|
253
|
+
"organization-title",
|
|
254
|
+
"organization",
|
|
255
|
+
"street-address",
|
|
256
|
+
"shipping",
|
|
257
|
+
"billing",
|
|
258
|
+
"address-line1",
|
|
259
|
+
"address-line2",
|
|
260
|
+
"address-line3",
|
|
261
|
+
"address-level4",
|
|
262
|
+
"address-level3",
|
|
263
|
+
"address-level2",
|
|
264
|
+
"address-level1",
|
|
265
|
+
"country",
|
|
266
|
+
"country-name",
|
|
267
|
+
"postal-code",
|
|
268
|
+
"cc-name",
|
|
269
|
+
"cc-given-name",
|
|
270
|
+
"cc-additional-name",
|
|
271
|
+
"cc-family-name",
|
|
272
|
+
"cc-number",
|
|
273
|
+
"cc-exp",
|
|
274
|
+
"cc-exp-month",
|
|
275
|
+
"cc-exp-year",
|
|
276
|
+
"cc-csc",
|
|
277
|
+
"cc-type",
|
|
278
|
+
"transaction-currency",
|
|
279
|
+
"transaction-amount",
|
|
280
|
+
"language",
|
|
281
|
+
"bday",
|
|
282
|
+
"bday-day",
|
|
283
|
+
"bday-month",
|
|
284
|
+
"bday-year",
|
|
285
|
+
"sex",
|
|
286
|
+
"tel",
|
|
287
|
+
"tel-country-code",
|
|
288
|
+
"tel-national",
|
|
289
|
+
"tel-area-code",
|
|
290
|
+
"tel-local",
|
|
291
|
+
"tel-local-suffix",
|
|
292
|
+
"tel-local-prefix",
|
|
293
|
+
"tel-extension",
|
|
294
|
+
"impp",
|
|
295
|
+
"url",
|
|
296
|
+
"photo",
|
|
297
|
+
"webauthn"
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
validationBehavior: {
|
|
301
|
+
type: "choice",
|
|
302
|
+
options: ["native", "aria"],
|
|
303
|
+
description: "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.",
|
|
304
|
+
defaultValueHint: "native",
|
|
305
|
+
advanced: true,
|
|
306
|
+
hidden: hasParent
|
|
307
|
+
},
|
|
308
|
+
onChange: {
|
|
309
|
+
type: "eventHandler",
|
|
310
|
+
argTypes: [{ name: "value", type: "string" }],
|
|
311
|
+
hidden: hasParent
|
|
312
|
+
},
|
|
313
|
+
onFocus: {
|
|
314
|
+
type: "eventHandler",
|
|
315
|
+
argTypes: [{ name: "focusEvent", type: "object" }],
|
|
316
|
+
advanced: true,
|
|
317
|
+
hidden: hasParent
|
|
318
|
+
},
|
|
319
|
+
onBlur: {
|
|
320
|
+
type: "eventHandler",
|
|
321
|
+
argTypes: [{ name: "focusEvent", type: "object" }],
|
|
322
|
+
advanced: true,
|
|
323
|
+
hidden: hasParent
|
|
324
|
+
},
|
|
325
|
+
onFocusChange: {
|
|
326
|
+
type: "eventHandler",
|
|
327
|
+
argTypes: [{ name: "isFocused", type: "boolean" }],
|
|
328
|
+
advanced: true,
|
|
329
|
+
hidden: hasParent
|
|
330
|
+
},
|
|
331
|
+
onKeyDown: {
|
|
332
|
+
type: "eventHandler",
|
|
333
|
+
argTypes: [{ name: "keyboardEvent", type: "object" }],
|
|
334
|
+
advanced: true,
|
|
335
|
+
hidden: hasParent
|
|
336
|
+
},
|
|
337
|
+
onKeyUp: {
|
|
338
|
+
type: "eventHandler",
|
|
339
|
+
argTypes: [{ name: "keyboardEvent", type: "object" }],
|
|
340
|
+
advanced: true,
|
|
341
|
+
hidden: hasParent
|
|
342
|
+
},
|
|
343
|
+
onCopy: {
|
|
344
|
+
type: "eventHandler",
|
|
345
|
+
argTypes: [{ name: "clipbordEvent", type: "object" }],
|
|
346
|
+
advanced: true,
|
|
347
|
+
hidden: hasParent
|
|
348
|
+
},
|
|
349
|
+
onCut: {
|
|
350
|
+
type: "eventHandler",
|
|
351
|
+
argTypes: [{ name: "clipbordEvent", type: "object" }],
|
|
352
|
+
advanced: true,
|
|
353
|
+
hidden: hasParent
|
|
354
|
+
},
|
|
355
|
+
onPaste: {
|
|
356
|
+
type: "eventHandler",
|
|
357
|
+
argTypes: [{ name: "clipbordEvent", type: "object" }],
|
|
358
|
+
advanced: true,
|
|
359
|
+
hidden: hasParent
|
|
360
|
+
},
|
|
361
|
+
onCompositionStart: {
|
|
362
|
+
type: "eventHandler",
|
|
363
|
+
argTypes: [{ name: "compositionEvent", type: "object" }],
|
|
364
|
+
advanced: true,
|
|
365
|
+
hidden: hasParent
|
|
366
|
+
},
|
|
367
|
+
onCompositionEnd: {
|
|
368
|
+
type: "eventHandler",
|
|
369
|
+
argTypes: [{ name: "compositionEvent", type: "object" }],
|
|
370
|
+
advanced: true,
|
|
371
|
+
hidden: hasParent
|
|
40
372
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
type: "
|
|
44
|
-
|
|
45
|
-
|
|
373
|
+
onCompositionUpdate: {
|
|
374
|
+
type: "eventHandler",
|
|
375
|
+
argTypes: [{ name: "compositionEvent", type: "object" }],
|
|
376
|
+
advanced: true,
|
|
377
|
+
hidden: hasParent
|
|
46
378
|
},
|
|
47
|
-
|
|
48
|
-
type: "
|
|
49
|
-
|
|
379
|
+
onSelect: {
|
|
380
|
+
type: "eventHandler",
|
|
381
|
+
argTypes: [{ name: "selectionEvent", type: "object" }],
|
|
382
|
+
advanced: true,
|
|
383
|
+
hidden: hasParent
|
|
384
|
+
},
|
|
385
|
+
onBeforeInput: {
|
|
386
|
+
type: "eventHandler",
|
|
387
|
+
argTypes: [{ name: "inputEvent", type: "object" }],
|
|
388
|
+
advanced: true,
|
|
389
|
+
hidden: hasParent
|
|
390
|
+
},
|
|
391
|
+
onInput: {
|
|
392
|
+
type: "eventHandler",
|
|
393
|
+
argTypes: [{ name: "inputEvent", type: "object" }],
|
|
394
|
+
advanced: true,
|
|
395
|
+
hidden: hasParent
|
|
396
|
+
},
|
|
397
|
+
placeholder: {
|
|
398
|
+
type: "string"
|
|
50
399
|
}
|
|
51
400
|
};
|
|
52
401
|
const filteredProps = {};
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
filteredProps[
|
|
402
|
+
propNames.forEach((propName) => {
|
|
403
|
+
if (Object.prototype.hasOwnProperty.call(commonProps, propName)) {
|
|
404
|
+
filteredProps[propName] = commonProps[propName];
|
|
56
405
|
}
|
|
57
406
|
});
|
|
58
407
|
return filteredProps;
|
|
@@ -127,68 +476,6 @@ function pickAriaComponentVariants(keys) {
|
|
|
127
476
|
};
|
|
128
477
|
}
|
|
129
478
|
|
|
130
|
-
var __defProp$r = Object.defineProperty;
|
|
131
|
-
var __defProps$e = Object.defineProperties;
|
|
132
|
-
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
133
|
-
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
134
|
-
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
|
135
|
-
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
|
136
|
-
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
137
|
-
var __spreadValues$r = (a, b) => {
|
|
138
|
-
for (var prop in b || (b = {}))
|
|
139
|
-
if (__hasOwnProp$r.call(b, prop))
|
|
140
|
-
__defNormalProp$r(a, prop, b[prop]);
|
|
141
|
-
if (__getOwnPropSymbols$r)
|
|
142
|
-
for (var prop of __getOwnPropSymbols$r(b)) {
|
|
143
|
-
if (__propIsEnum$r.call(b, prop))
|
|
144
|
-
__defNormalProp$r(a, prop, b[prop]);
|
|
145
|
-
}
|
|
146
|
-
return a;
|
|
147
|
-
};
|
|
148
|
-
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
149
|
-
function registerComponentHelper(loader, component, meta, overrides) {
|
|
150
|
-
if (overrides) {
|
|
151
|
-
meta = __spreadProps$e(__spreadValues$r(__spreadValues$r({}, meta), overrides), {
|
|
152
|
-
props: __spreadValues$r(__spreadValues$r({}, meta.props), overrides.props)
|
|
153
|
-
});
|
|
154
|
-
if (overrides.parentComponentName) {
|
|
155
|
-
meta.name = makeChildComponentName(
|
|
156
|
-
overrides.parentComponentName,
|
|
157
|
-
meta.name
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (loader) {
|
|
162
|
-
loader.registerComponent(component, meta);
|
|
163
|
-
} else {
|
|
164
|
-
registerComponent(component, meta);
|
|
165
|
-
}
|
|
166
|
-
return meta;
|
|
167
|
-
}
|
|
168
|
-
function makeComponentName(name) {
|
|
169
|
-
return `plasmic-react-aria-${name}`;
|
|
170
|
-
}
|
|
171
|
-
function makeChildComponentName(fullParentName, fullChildName) {
|
|
172
|
-
if (!fullParentName) {
|
|
173
|
-
return fullChildName;
|
|
174
|
-
}
|
|
175
|
-
return `${fullParentName}-${fullChildName.replace(
|
|
176
|
-
"plasmic-react-aria-",
|
|
177
|
-
""
|
|
178
|
-
)}`;
|
|
179
|
-
}
|
|
180
|
-
function extractPlasmicDataProps(props) {
|
|
181
|
-
return Object.fromEntries(
|
|
182
|
-
Object.entries(props).filter(([key]) => key.startsWith("data-plasmic-"))
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
function withoutNils(array) {
|
|
186
|
-
return array.filter((x) => x != null);
|
|
187
|
-
}
|
|
188
|
-
function isDefined(thing) {
|
|
189
|
-
return thing !== void 0 && thing !== null;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
479
|
var __defProp$q = Object.defineProperty;
|
|
193
480
|
var __defProps$d = Object.defineProperties;
|
|
194
481
|
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
@@ -273,7 +560,7 @@ function registerButton(loader, overrides) {
|
|
|
273
560
|
padding: "2px 10px",
|
|
274
561
|
cursor: "pointer"
|
|
275
562
|
},
|
|
276
|
-
props: __spreadProps$d(__spreadValues$q({},
|
|
563
|
+
props: __spreadProps$d(__spreadValues$q({}, getCommonProps("button", [
|
|
277
564
|
"isDisabled",
|
|
278
565
|
"aria-label"
|
|
279
566
|
])), {
|
|
@@ -319,37 +606,11 @@ const PlasmicDialogTriggerContext = React.createContext(void 0);
|
|
|
319
606
|
const PlasmicSliderContext = React.createContext(void 0);
|
|
320
607
|
React.createContext(void 0);
|
|
321
608
|
const PlasmicListBoxContext = React.createContext(void 0);
|
|
322
|
-
const PlasmicPopoverContext = React.createContext(void 0);
|
|
323
609
|
const PlasmicItemContext = React.createContext(void 0);
|
|
324
610
|
const PlasmicSectionContext = React.createContext(void 0);
|
|
325
611
|
const PlasmicHeaderContext = React.createContext(void 0);
|
|
326
612
|
const PlasmicInputContext = React.createContext(void 0);
|
|
327
613
|
|
|
328
|
-
const BaseLabel = Label;
|
|
329
|
-
const LABEL_COMPONENT_NAME = makeComponentName("label");
|
|
330
|
-
function registerLabel(loader, overrides) {
|
|
331
|
-
registerComponentHelper(
|
|
332
|
-
loader,
|
|
333
|
-
BaseLabel,
|
|
334
|
-
{
|
|
335
|
-
name: LABEL_COMPONENT_NAME,
|
|
336
|
-
displayName: "Aria Label",
|
|
337
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerLabel",
|
|
338
|
-
importName: "BaseLabel",
|
|
339
|
-
defaultStyles: {
|
|
340
|
-
cursor: "pointer"
|
|
341
|
-
},
|
|
342
|
-
props: {
|
|
343
|
-
children: {
|
|
344
|
-
type: "slot"
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
trapsFocus: true
|
|
348
|
-
},
|
|
349
|
-
overrides
|
|
350
|
-
);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
614
|
var __defProp$p = Object.defineProperty;
|
|
354
615
|
var __defProps$c = Object.defineProperties;
|
|
355
616
|
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
@@ -389,7 +650,8 @@ const CHECKBOX_INTERACTION_VARIANTS = [
|
|
|
389
650
|
"indeterminate",
|
|
390
651
|
"disabled",
|
|
391
652
|
"selected",
|
|
392
|
-
"readonly"
|
|
653
|
+
"readonly",
|
|
654
|
+
"selected"
|
|
393
655
|
];
|
|
394
656
|
const { interactionVariants: interactionVariants$b, withObservedValues: withObservedValues$9 } = pickAriaComponentVariants(
|
|
395
657
|
CHECKBOX_INTERACTION_VARIANTS
|
|
@@ -397,9 +659,8 @@ const { interactionVariants: interactionVariants$b, withObservedValues: withObse
|
|
|
397
659
|
function BaseCheckbox(props) {
|
|
398
660
|
const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$j(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
|
|
399
661
|
const contextProps = React.useContext(PlasmicCheckboxGroupContext);
|
|
400
|
-
const isStandalone = !contextProps;
|
|
401
662
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
402
|
-
|
|
663
|
+
parent: contextProps
|
|
403
664
|
});
|
|
404
665
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Checkbox, __spreadValues$p({}, rest), ({
|
|
405
666
|
isHovered,
|
|
@@ -458,14 +719,8 @@ const makeDefaultCheckboxChildren = ({
|
|
|
458
719
|
}
|
|
459
720
|
},
|
|
460
721
|
{
|
|
461
|
-
type: "
|
|
462
|
-
|
|
463
|
-
props: {
|
|
464
|
-
children: {
|
|
465
|
-
type: "text",
|
|
466
|
-
value: label
|
|
467
|
-
}
|
|
468
|
-
}
|
|
722
|
+
type: "text",
|
|
723
|
+
value: label
|
|
469
724
|
}
|
|
470
725
|
]
|
|
471
726
|
},
|
|
@@ -487,7 +742,7 @@ function registerCheckbox(loader, overrides) {
|
|
|
487
742
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
|
|
488
743
|
importName: "BaseCheckbox",
|
|
489
744
|
interactionVariants: interactionVariants$b,
|
|
490
|
-
props: __spreadProps$c(__spreadValues$p({},
|
|
745
|
+
props: __spreadProps$c(__spreadValues$p({}, getCommonProps("checkbox", [
|
|
491
746
|
"name",
|
|
492
747
|
"isDisabled",
|
|
493
748
|
"isReadOnly",
|
|
@@ -505,13 +760,15 @@ function registerCheckbox(loader, overrides) {
|
|
|
505
760
|
},
|
|
506
761
|
value: {
|
|
507
762
|
type: "string",
|
|
508
|
-
description:
|
|
763
|
+
description: 'The value of the checkbox in "selected" state, used when submitting an HTML form.',
|
|
764
|
+
defaultValueHint: "on"
|
|
509
765
|
},
|
|
510
766
|
isSelected: {
|
|
511
767
|
type: "boolean",
|
|
768
|
+
displayName: "Default Selected",
|
|
512
769
|
editOnly: true,
|
|
513
770
|
uncontrolledProp: "defaultSelected",
|
|
514
|
-
description: "Whether the checkbox
|
|
771
|
+
description: "Whether the checkbox should be selected by default",
|
|
515
772
|
defaultValueHint: false,
|
|
516
773
|
defaultValue: false
|
|
517
774
|
},
|
|
@@ -544,7 +801,7 @@ function registerCheckbox(loader, overrides) {
|
|
|
544
801
|
valueProp: "isSelected",
|
|
545
802
|
onChangeProp: "onChange",
|
|
546
803
|
variableType: "boolean",
|
|
547
|
-
hidden:
|
|
804
|
+
hidden: hasParent
|
|
548
805
|
}
|
|
549
806
|
},
|
|
550
807
|
trapsFocus: true
|
|
@@ -810,6 +1067,31 @@ function registerFieldError(loader, overrides) {
|
|
|
810
1067
|
);
|
|
811
1068
|
}
|
|
812
1069
|
|
|
1070
|
+
const BaseLabel = Label;
|
|
1071
|
+
const LABEL_COMPONENT_NAME = makeComponentName("label");
|
|
1072
|
+
function registerLabel(loader, overrides) {
|
|
1073
|
+
registerComponentHelper(
|
|
1074
|
+
loader,
|
|
1075
|
+
BaseLabel,
|
|
1076
|
+
{
|
|
1077
|
+
name: LABEL_COMPONENT_NAME,
|
|
1078
|
+
displayName: "Aria Label",
|
|
1079
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerLabel",
|
|
1080
|
+
importName: "BaseLabel",
|
|
1081
|
+
defaultStyles: {
|
|
1082
|
+
cursor: "pointer"
|
|
1083
|
+
},
|
|
1084
|
+
props: {
|
|
1085
|
+
children: {
|
|
1086
|
+
type: "slot"
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
trapsFocus: true
|
|
1090
|
+
},
|
|
1091
|
+
overrides
|
|
1092
|
+
);
|
|
1093
|
+
}
|
|
1094
|
+
|
|
813
1095
|
var __defProp$l = Object.defineProperty;
|
|
814
1096
|
var __defProps$a = Object.defineProperties;
|
|
815
1097
|
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
|
@@ -849,8 +1131,8 @@ const { interactionVariants: interactionVariants$a, withObservedValues: withObse
|
|
|
849
1131
|
CHECKBOX_GROUP_INTERACTION_VARIANTS
|
|
850
1132
|
);
|
|
851
1133
|
function BaseCheckboxGroup(props) {
|
|
852
|
-
const _a = props, { children, updateInteractionVariant } = _a
|
|
853
|
-
return /* @__PURE__ */ React.createElement(PlasmicCheckboxGroupContext.Provider, { value:
|
|
1134
|
+
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$g(_a, ["children", "updateInteractionVariant"]);
|
|
1135
|
+
return /* @__PURE__ */ React.createElement(PlasmicCheckboxGroupContext.Provider, { value: rest }, /* @__PURE__ */ React.createElement(CheckboxGroup, __spreadValues$l({}, rest), ({ isDisabled, isReadOnly }) => withObservedValues$8(
|
|
854
1136
|
children,
|
|
855
1137
|
{
|
|
856
1138
|
disabled: isDisabled,
|
|
@@ -879,7 +1161,7 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
879
1161
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckboxGroup",
|
|
880
1162
|
importName: "BaseCheckboxGroup",
|
|
881
1163
|
interactionVariants: interactionVariants$a,
|
|
882
|
-
props: __spreadProps$a(__spreadValues$l({},
|
|
1164
|
+
props: __spreadProps$a(__spreadValues$l({}, getCommonProps("checkbox group", [
|
|
883
1165
|
"name",
|
|
884
1166
|
"isDisabled",
|
|
885
1167
|
"isReadOnly",
|
|
@@ -1195,23 +1477,49 @@ const INPUT_INTERACTION_VARIANTS = [
|
|
|
1195
1477
|
const { interactionVariants: interactionVariants$9 } = pickAriaComponentVariants(
|
|
1196
1478
|
INPUT_INTERACTION_VARIANTS
|
|
1197
1479
|
);
|
|
1480
|
+
const inputHelpers$1 = {
|
|
1481
|
+
states: {
|
|
1482
|
+
value: {
|
|
1483
|
+
onChangeArgsToValue: (e) => {
|
|
1484
|
+
return e.target.value;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
};
|
|
1198
1489
|
function BaseInput(props) {
|
|
1199
1490
|
var _b;
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1202
|
-
|
|
1491
|
+
const _a = props, {
|
|
1492
|
+
updateInteractionVariant,
|
|
1493
|
+
setControlContextData,
|
|
1494
|
+
disabled,
|
|
1495
|
+
autoComplete
|
|
1496
|
+
} = _a, rest = __objRest$f(_a, [
|
|
1497
|
+
"updateInteractionVariant",
|
|
1498
|
+
"setControlContextData",
|
|
1499
|
+
"disabled",
|
|
1500
|
+
"autoComplete"
|
|
1501
|
+
]);
|
|
1502
|
+
const textFieldContext = React.useContext(PlasmicTextFieldContext);
|
|
1503
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
1504
|
+
parent: textFieldContext
|
|
1505
|
+
});
|
|
1203
1506
|
const mergedProps = mergeProps(rest, {
|
|
1204
|
-
|
|
1507
|
+
/**
|
|
1508
|
+
* While react-aria internally does the merging of the disabled prop,
|
|
1509
|
+
* we need to explicity do it here, because react-aria does it behind the scenes,
|
|
1510
|
+
* whereas we need the calculated value of the disabled prop to be able to update the "disabled" interaction variant.
|
|
1511
|
+
* */
|
|
1512
|
+
disabled: (_b = textFieldContext == null ? void 0 : textFieldContext.isDisabled) != null ? _b : disabled
|
|
1205
1513
|
});
|
|
1206
1514
|
useEffect(() => {
|
|
1207
1515
|
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1208
1516
|
disabled: mergedProps.disabled
|
|
1209
1517
|
});
|
|
1210
1518
|
}, [mergedProps.disabled, updateInteractionVariant]);
|
|
1211
|
-
setControlContextData == null ? void 0 : setControlContextData({ isStandalone });
|
|
1212
1519
|
return /* @__PURE__ */ React.createElement(
|
|
1213
1520
|
Input,
|
|
1214
1521
|
__spreadValues$k({
|
|
1522
|
+
autoComplete: resolveAutoComplete(autoComplete),
|
|
1215
1523
|
onHoverChange: (isHovered) => {
|
|
1216
1524
|
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1217
1525
|
hovered: isHovered
|
|
@@ -1248,16 +1556,48 @@ function registerInput(loader, overrides) {
|
|
|
1248
1556
|
borderColor: "black",
|
|
1249
1557
|
padding: "2px 10px"
|
|
1250
1558
|
},
|
|
1251
|
-
props: {
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1559
|
+
props: __spreadValues$k({}, getCommonProps("Input", [
|
|
1560
|
+
"name",
|
|
1561
|
+
"disabled",
|
|
1562
|
+
"readOnly",
|
|
1563
|
+
"autoFocus",
|
|
1564
|
+
"aria-label",
|
|
1565
|
+
"required",
|
|
1566
|
+
"placeholder",
|
|
1567
|
+
"value",
|
|
1568
|
+
"maxLength",
|
|
1569
|
+
"minLength",
|
|
1570
|
+
"pattern",
|
|
1571
|
+
"type",
|
|
1572
|
+
"inputMode",
|
|
1573
|
+
"autoComplete",
|
|
1574
|
+
"onChange",
|
|
1575
|
+
"onFocus",
|
|
1576
|
+
"onBlur",
|
|
1577
|
+
"onKeyDown",
|
|
1578
|
+
"onKeyUp",
|
|
1579
|
+
"onCopy",
|
|
1580
|
+
"onCut",
|
|
1581
|
+
"onPaste",
|
|
1582
|
+
"onCompositionStart",
|
|
1583
|
+
"onCompositionEnd",
|
|
1584
|
+
"onCompositionUpdate",
|
|
1585
|
+
"onSelect",
|
|
1586
|
+
"onBeforeInput",
|
|
1587
|
+
"onInput"
|
|
1588
|
+
])),
|
|
1589
|
+
states: {
|
|
1590
|
+
value: __spreadValues$k({
|
|
1591
|
+
type: "writable",
|
|
1592
|
+
valueProp: "value",
|
|
1593
|
+
onChangeProp: "onChange",
|
|
1594
|
+
variableType: "text"
|
|
1595
|
+
}, inputHelpers$1.states.value)
|
|
1596
|
+
},
|
|
1597
|
+
componentHelpers: {
|
|
1598
|
+
helpers: inputHelpers$1,
|
|
1599
|
+
importName: "inputHelpers",
|
|
1600
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerInput"
|
|
1261
1601
|
},
|
|
1262
1602
|
trapsFocus: true
|
|
1263
1603
|
},
|
|
@@ -1494,18 +1834,17 @@ var __objRest$e = (source, exclude) => {
|
|
|
1494
1834
|
return target;
|
|
1495
1835
|
};
|
|
1496
1836
|
function BaseListBox(props) {
|
|
1497
|
-
var _c;
|
|
1498
1837
|
const contextProps = React.useContext(PlasmicListBoxContext);
|
|
1499
1838
|
const isStandalone = !contextProps;
|
|
1500
|
-
const _a = props, rest = __objRest$e(_a, ["options"]);
|
|
1839
|
+
const _a = props, { options: _rawOptions, setControlContextData } = _a, rest = __objRest$e(_a, ["options", "setControlContextData"]);
|
|
1501
1840
|
const { options } = useStrictOptions(props);
|
|
1502
1841
|
const _b = mergeProps$1(
|
|
1503
1842
|
contextProps,
|
|
1504
1843
|
rest,
|
|
1505
1844
|
isStandalone ? { items: options } : {}
|
|
1506
1845
|
), { renderItem, renderSection } = _b, mergedProps = __objRest$e(_b, ["renderItem", "renderSection"]);
|
|
1507
|
-
|
|
1508
|
-
isStandalone
|
|
1846
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
1847
|
+
parent: isStandalone ? void 0 : {}
|
|
1509
1848
|
});
|
|
1510
1849
|
return /* @__PURE__ */ React.createElement(ListBox, __spreadValues$g({}, mergedProps), (item) => {
|
|
1511
1850
|
var _a2;
|
|
@@ -1551,7 +1890,7 @@ function registerListBox(loader, overrides) {
|
|
|
1551
1890
|
props: {
|
|
1552
1891
|
options: __spreadProps$8(__spreadValues$g({}, makeOptionsPropType()), {
|
|
1553
1892
|
displayName: "Items",
|
|
1554
|
-
hidden:
|
|
1893
|
+
hidden: hasParent
|
|
1555
1894
|
}),
|
|
1556
1895
|
renderItem: {
|
|
1557
1896
|
type: "slot",
|
|
@@ -1614,37 +1953,34 @@ var __objRest$d = (source, exclude) => {
|
|
|
1614
1953
|
}
|
|
1615
1954
|
return target;
|
|
1616
1955
|
};
|
|
1617
|
-
const SHOULD_FLIP_INSIDE_SELECT = false;
|
|
1618
1956
|
function BasePopover(props) {
|
|
1619
1957
|
const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$d(_a, ["resetClassName", "setControlContextData"]);
|
|
1620
1958
|
const isStandalone = !React.useContext(PopoverContext);
|
|
1621
|
-
const contextProps = React.useContext(PlasmicPopoverContext);
|
|
1622
1959
|
const isInsideSelect = !!React.useContext(SelectContext);
|
|
1960
|
+
const triggerRef = React.useRef(null);
|
|
1961
|
+
const isEditMode = !!usePlasmicCanvasContext();
|
|
1962
|
+
const defaultShouldFlip = isInsideSelect ? false : true;
|
|
1623
1963
|
const mergedProps = mergeProps$1(
|
|
1624
|
-
|
|
1964
|
+
{ shouldFlip: defaultShouldFlip },
|
|
1965
|
+
/**
|
|
1966
|
+
* isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies. *
|
|
1967
|
+
*
|
|
1968
|
+
* Setting isNonModal to true in edit mode (canvas) means that the popover will not prevent the user from interacting with the canvas while the popover is open.
|
|
1969
|
+
*/
|
|
1970
|
+
isEditMode ? { isNonModal: true } : null,
|
|
1625
1971
|
restProps,
|
|
1626
|
-
{
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1972
|
+
{ className: `${resetClassName}` },
|
|
1973
|
+
// Override some props if the popover is standalone
|
|
1974
|
+
isStandalone ? {
|
|
1975
|
+
triggerRef,
|
|
1976
|
+
isNonModal: true,
|
|
1977
|
+
isOpen: true
|
|
1978
|
+
} : null
|
|
1630
1979
|
);
|
|
1631
|
-
const isEditMode = !!usePlasmicCanvasContext();
|
|
1632
|
-
const triggerRef = React.useRef(null);
|
|
1633
|
-
const standaloneProps = isStandalone ? {
|
|
1634
|
-
triggerRef,
|
|
1635
|
-
isNonModal: true,
|
|
1636
|
-
isOpen: true
|
|
1637
|
-
} : {};
|
|
1638
1980
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
1639
|
-
|
|
1640
|
-
isInsideSelect
|
|
1981
|
+
defaultShouldFlip
|
|
1641
1982
|
});
|
|
1642
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(
|
|
1643
|
-
Popover,
|
|
1644
|
-
__spreadValues$f(__spreadValues$f({
|
|
1645
|
-
isNonModal: isEditMode ? true : void 0
|
|
1646
|
-
}, mergedProps), standaloneProps)
|
|
1647
|
-
));
|
|
1983
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(Popover, __spreadValues$f({}, mergedProps)));
|
|
1648
1984
|
}
|
|
1649
1985
|
const POPOVER_COMPONENT_NAME = makeComponentName("popover");
|
|
1650
1986
|
const POPOVER_ARROW_IMG = {
|
|
@@ -1718,7 +2054,10 @@ function registerPopover(loader, overrides) {
|
|
|
1718
2054
|
shouldFlip: {
|
|
1719
2055
|
type: "boolean",
|
|
1720
2056
|
description: "Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely.",
|
|
1721
|
-
defaultValueHint: (_ps, ctx) =>
|
|
2057
|
+
defaultValueHint: (_ps, ctx) => {
|
|
2058
|
+
var _a;
|
|
2059
|
+
return (_a = ctx == null ? void 0 : ctx.defaultShouldFlip) != null ? _a : true;
|
|
2060
|
+
}
|
|
1722
2061
|
},
|
|
1723
2062
|
placement: {
|
|
1724
2063
|
type: "choice",
|
|
@@ -2161,7 +2500,7 @@ const BaseModal = forwardRef(
|
|
|
2161
2500
|
isOpen: isStandalone ? isOpen : contextProps.isOpen
|
|
2162
2501
|
});
|
|
2163
2502
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
2164
|
-
isStandalone
|
|
2503
|
+
parent: isStandalone ? void 0 : {}
|
|
2165
2504
|
});
|
|
2166
2505
|
useImperativeHandle(ref, () => ({
|
|
2167
2506
|
close: () => {
|
|
@@ -2271,7 +2610,7 @@ function registerModal(loader, overrides) {
|
|
|
2271
2610
|
uncontrolledProp: "defaultOpen",
|
|
2272
2611
|
defaultValueHint: false,
|
|
2273
2612
|
defaultValue: true,
|
|
2274
|
-
hidden:
|
|
2613
|
+
hidden: hasParent
|
|
2275
2614
|
},
|
|
2276
2615
|
isDismissable: {
|
|
2277
2616
|
type: "boolean",
|
|
@@ -2292,7 +2631,7 @@ function registerModal(loader, overrides) {
|
|
|
2292
2631
|
valueProp: "isOpen",
|
|
2293
2632
|
onChangeProp: "onOpenChange",
|
|
2294
2633
|
variableType: "boolean",
|
|
2295
|
-
hidden:
|
|
2634
|
+
hidden: hasParent
|
|
2296
2635
|
}
|
|
2297
2636
|
},
|
|
2298
2637
|
trapsFocus: true
|
|
@@ -2509,14 +2848,19 @@ const RADIO_INTERACTION_VARIANTS = [
|
|
|
2509
2848
|
"focused",
|
|
2510
2849
|
"focusVisible",
|
|
2511
2850
|
"disabled",
|
|
2512
|
-
"readonly"
|
|
2851
|
+
"readonly",
|
|
2852
|
+
"selected"
|
|
2513
2853
|
];
|
|
2514
2854
|
const { interactionVariants: interactionVariants$8, withObservedValues: withObservedValues$7 } = pickAriaComponentVariants(
|
|
2515
2855
|
RADIO_INTERACTION_VARIANTS
|
|
2516
2856
|
);
|
|
2517
2857
|
function BaseRadio(props) {
|
|
2518
|
-
const _a = props, { children,
|
|
2858
|
+
const _a = props, { children, setControlContextData, updateInteractionVariant } = _a, rest = __objRest$9(_a, ["children", "setControlContextData", "updateInteractionVariant"]);
|
|
2519
2859
|
const contextProps = React.useContext(PlasmicRadioGroupContext);
|
|
2860
|
+
const isStandalone = !contextProps;
|
|
2861
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
2862
|
+
parent: contextProps
|
|
2863
|
+
});
|
|
2520
2864
|
const radio = /* @__PURE__ */ React.createElement(Radio, __spreadValues$a({}, rest), ({
|
|
2521
2865
|
isHovered,
|
|
2522
2866
|
isPressed,
|
|
@@ -2538,11 +2882,10 @@ function BaseRadio(props) {
|
|
|
2538
2882
|
},
|
|
2539
2883
|
updateInteractionVariant
|
|
2540
2884
|
));
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
return /* @__PURE__ */ React.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React.createElement(RadioGroup, null, radio) }, radio);
|
|
2885
|
+
if (isStandalone) {
|
|
2886
|
+
return /* @__PURE__ */ React.createElement(RadioGroup, null, radio);
|
|
2887
|
+
}
|
|
2888
|
+
return radio;
|
|
2546
2889
|
}
|
|
2547
2890
|
const makeDefaultRadioChildren = (label) => ({
|
|
2548
2891
|
type: "hbox",
|
|
@@ -2586,7 +2929,7 @@ function registerRadio(loader, overrides) {
|
|
|
2586
2929
|
importPath: "@plasmicpkgs/react-aria/skinny/registerRadio",
|
|
2587
2930
|
importName: "BaseRadio",
|
|
2588
2931
|
interactionVariants: interactionVariants$8,
|
|
2589
|
-
props: __spreadProps$5(__spreadValues$a({},
|
|
2932
|
+
props: __spreadProps$5(__spreadValues$a({}, getCommonProps("radio", [
|
|
2590
2933
|
"isDisabled",
|
|
2591
2934
|
"autoFocus",
|
|
2592
2935
|
"aria-label"
|
|
@@ -2599,23 +2942,8 @@ function registerRadio(loader, overrides) {
|
|
|
2599
2942
|
value: {
|
|
2600
2943
|
type: "string",
|
|
2601
2944
|
description: "The value of the input element, used when submitting an HTML form."
|
|
2602
|
-
},
|
|
2603
|
-
// Keeping for backwards compatibility reasons
|
|
2604
|
-
onSelectionChange: {
|
|
2605
|
-
type: "eventHandler",
|
|
2606
|
-
argTypes: [{ name: "isSelected", type: "boolean" }],
|
|
2607
|
-
hidden: () => true
|
|
2608
2945
|
}
|
|
2609
2946
|
}),
|
|
2610
|
-
states: {
|
|
2611
|
-
// Keeping for backwards compatibility reasons
|
|
2612
|
-
isSelected: {
|
|
2613
|
-
type: "readonly",
|
|
2614
|
-
onChangeProp: "onSelectionChange",
|
|
2615
|
-
variableType: "boolean",
|
|
2616
|
-
hidden: () => true
|
|
2617
|
-
}
|
|
2618
|
-
},
|
|
2619
2947
|
trapsFocus: true
|
|
2620
2948
|
},
|
|
2621
2949
|
overrides
|
|
@@ -2689,7 +3017,7 @@ function registerRadioGroup(loader, overrides) {
|
|
|
2689
3017
|
importPath: "@plasmicpkgs/react-aria/skinny/registerRadioGroup",
|
|
2690
3018
|
importName: "BaseRadioGroup",
|
|
2691
3019
|
interactionVariants: interactionVariants$7,
|
|
2692
|
-
props: __spreadProps$4(__spreadValues$9({},
|
|
3020
|
+
props: __spreadProps$4(__spreadValues$9({}, getCommonProps("radio group", [
|
|
2693
3021
|
"name",
|
|
2694
3022
|
"isDisabled",
|
|
2695
3023
|
"isReadOnly",
|
|
@@ -2760,6 +3088,7 @@ function registerRadioGroup(loader, overrides) {
|
|
|
2760
3088
|
value: {
|
|
2761
3089
|
type: "string",
|
|
2762
3090
|
editOnly: true,
|
|
3091
|
+
displayName: "Default Value",
|
|
2763
3092
|
uncontrolledProp: "defaultValue",
|
|
2764
3093
|
description: "The current value"
|
|
2765
3094
|
},
|
|
@@ -3220,7 +3549,7 @@ function registerSliderThumb(loader, overrides) {
|
|
|
3220
3549
|
cursor: "pointer"
|
|
3221
3550
|
},
|
|
3222
3551
|
interactionVariants: interactionVariants$5,
|
|
3223
|
-
props: __spreadProps$3(__spreadValues$6({},
|
|
3552
|
+
props: __spreadProps$3(__spreadValues$6({}, getCommonProps("slider thumb", [
|
|
3224
3553
|
"name",
|
|
3225
3554
|
"isDisabled",
|
|
3226
3555
|
"autoFocus"
|
|
@@ -3544,7 +3873,7 @@ function registerSlider(loader, overrides) {
|
|
|
3544
3873
|
defaultStyles: {
|
|
3545
3874
|
width: "300px"
|
|
3546
3875
|
},
|
|
3547
|
-
props: __spreadProps$2(__spreadValues$4({},
|
|
3876
|
+
props: __spreadProps$2(__spreadValues$4({}, getCommonProps("slider", [
|
|
3548
3877
|
"isDisabled",
|
|
3549
3878
|
"name",
|
|
3550
3879
|
"autoFocus",
|
|
@@ -3770,7 +4099,7 @@ function registerSwitch(loader, overrides) {
|
|
|
3770
4099
|
justifyContent: "flex-start",
|
|
3771
4100
|
padding: 0
|
|
3772
4101
|
},
|
|
3773
|
-
props: __spreadProps$1(__spreadValues$3({},
|
|
4102
|
+
props: __spreadProps$1(__spreadValues$3({}, getCommonProps("switch", [
|
|
3774
4103
|
"name",
|
|
3775
4104
|
"isDisabled",
|
|
3776
4105
|
"isReadOnly",
|
|
@@ -3849,10 +4178,16 @@ function registerSwitch(loader, overrides) {
|
|
|
3849
4178
|
]
|
|
3850
4179
|
},
|
|
3851
4180
|
value: {
|
|
4181
|
+
type: "string",
|
|
4182
|
+
description: 'The value of the switch in "selected" state, used when submitting an HTML form.',
|
|
4183
|
+
defaultValueHint: "on"
|
|
4184
|
+
},
|
|
4185
|
+
isSelected: {
|
|
3852
4186
|
type: "boolean",
|
|
3853
4187
|
editOnly: true,
|
|
4188
|
+
displayName: "Default Selected",
|
|
3854
4189
|
uncontrolledProp: "defaultSelected",
|
|
3855
|
-
description: "Whether the switch
|
|
4190
|
+
description: "Whether the switch should be selected by default",
|
|
3856
4191
|
defaultValueHint: false
|
|
3857
4192
|
},
|
|
3858
4193
|
onChange: {
|
|
@@ -3863,7 +4198,7 @@ function registerSwitch(loader, overrides) {
|
|
|
3863
4198
|
states: {
|
|
3864
4199
|
isSelected: {
|
|
3865
4200
|
type: "writable",
|
|
3866
|
-
valueProp: "
|
|
4201
|
+
valueProp: "isSelected",
|
|
3867
4202
|
onChangeProp: "onChange",
|
|
3868
4203
|
variableType: "boolean"
|
|
3869
4204
|
}
|
|
@@ -3910,20 +4245,30 @@ const TEXTAREA_INTERACTION_VARIANTS = [
|
|
|
3910
4245
|
const { interactionVariants: interactionVariants$1 } = pickAriaComponentVariants(
|
|
3911
4246
|
TEXTAREA_INTERACTION_VARIANTS
|
|
3912
4247
|
);
|
|
4248
|
+
const inputHelpers = {
|
|
4249
|
+
states: {
|
|
4250
|
+
value: {
|
|
4251
|
+
onChangeArgsToValue: (e) => {
|
|
4252
|
+
return e.target.value;
|
|
4253
|
+
}
|
|
4254
|
+
}
|
|
4255
|
+
}
|
|
4256
|
+
};
|
|
3913
4257
|
function BaseTextArea(props) {
|
|
3914
4258
|
var _b;
|
|
3915
4259
|
const _a = props, { disabled, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$2(_a, ["disabled", "updateInteractionVariant", "setControlContextData"]);
|
|
3916
|
-
const
|
|
3917
|
-
const isStandalone = !context;
|
|
4260
|
+
const textFieldContext = React.useContext(PlasmicTextFieldContext);
|
|
3918
4261
|
const mergedProps = mergeProps(rest, {
|
|
3919
|
-
disabled: (_b =
|
|
4262
|
+
disabled: (_b = textFieldContext == null ? void 0 : textFieldContext.isDisabled) != null ? _b : disabled
|
|
3920
4263
|
});
|
|
3921
4264
|
useEffect(() => {
|
|
3922
4265
|
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
3923
4266
|
disabled: mergedProps.disabled
|
|
3924
4267
|
});
|
|
3925
4268
|
}, [mergedProps.disabled, updateInteractionVariant]);
|
|
3926
|
-
setControlContextData == null ? void 0 : setControlContextData({
|
|
4269
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
4270
|
+
parent: textFieldContext
|
|
4271
|
+
});
|
|
3927
4272
|
return /* @__PURE__ */ React.createElement(
|
|
3928
4273
|
TextArea,
|
|
3929
4274
|
__spreadValues$2({
|
|
@@ -3955,36 +4300,45 @@ function registerTextArea(loader, overrides) {
|
|
|
3955
4300
|
importPath: "@plasmicpkgs/react-aria/skinny/registerTextArea",
|
|
3956
4301
|
importName: "BaseTextArea",
|
|
3957
4302
|
interactionVariants: interactionVariants$1,
|
|
3958
|
-
props: {
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
4303
|
+
props: __spreadValues$2({}, getCommonProps("Text Area", [
|
|
4304
|
+
"name",
|
|
4305
|
+
"disabled",
|
|
4306
|
+
"readOnly",
|
|
4307
|
+
"autoFocus",
|
|
4308
|
+
"aria-label",
|
|
4309
|
+
"required",
|
|
4310
|
+
"placeholder",
|
|
4311
|
+
"value",
|
|
4312
|
+
"maxLength",
|
|
4313
|
+
"minLength",
|
|
4314
|
+
"inputMode",
|
|
4315
|
+
"onChange",
|
|
4316
|
+
"onFocus",
|
|
4317
|
+
"onBlur",
|
|
4318
|
+
"onKeyDown",
|
|
4319
|
+
"onKeyUp",
|
|
4320
|
+
"onCopy",
|
|
4321
|
+
"onCut",
|
|
4322
|
+
"onPaste",
|
|
4323
|
+
"onCompositionStart",
|
|
4324
|
+
"onCompositionEnd",
|
|
4325
|
+
"onCompositionUpdate",
|
|
4326
|
+
"onSelect",
|
|
4327
|
+
"onBeforeInput",
|
|
4328
|
+
"onInput"
|
|
4329
|
+
])),
|
|
4330
|
+
states: {
|
|
4331
|
+
value: __spreadValues$2({
|
|
4332
|
+
type: "writable",
|
|
4333
|
+
valueProp: "value",
|
|
4334
|
+
onChangeProp: "onChange",
|
|
4335
|
+
variableType: "text"
|
|
4336
|
+
}, inputHelpers.states.value)
|
|
4337
|
+
},
|
|
4338
|
+
componentHelpers: {
|
|
4339
|
+
helpers: inputHelpers,
|
|
4340
|
+
importName: "inputHelpers",
|
|
4341
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerTextArea"
|
|
3988
4342
|
},
|
|
3989
4343
|
trapsFocus: true
|
|
3990
4344
|
},
|
|
@@ -4031,31 +4385,15 @@ const { interactionVariants, withObservedValues } = pickAriaComponentVariants(
|
|
|
4031
4385
|
TEXT_FIELD_INTERACTION_VARIANTS
|
|
4032
4386
|
);
|
|
4033
4387
|
function BaseTextField(props) {
|
|
4034
|
-
const _a = props, {
|
|
4035
|
-
|
|
4036
|
-
autoComplete,
|
|
4388
|
+
const _a = props, { children, updateInteractionVariant, autoComplete } = _a, rest = __objRest$1(_a, ["children", "updateInteractionVariant", "autoComplete"]);
|
|
4389
|
+
return /* @__PURE__ */ React.createElement(PlasmicTextFieldContext.Provider, { value: props }, /* @__PURE__ */ React.createElement(TextField, __spreadValues$1({ autoComplete: resolveAutoComplete(autoComplete) }, rest), ({ isDisabled, isReadOnly }) => withObservedValues(
|
|
4037
4390
|
children,
|
|
4391
|
+
{
|
|
4392
|
+
disabled: isDisabled,
|
|
4393
|
+
readonly: isReadOnly
|
|
4394
|
+
},
|
|
4038
4395
|
updateInteractionVariant
|
|
4039
|
-
|
|
4040
|
-
"enableAutoComplete",
|
|
4041
|
-
"autoComplete",
|
|
4042
|
-
"children",
|
|
4043
|
-
"updateInteractionVariant"
|
|
4044
|
-
]);
|
|
4045
|
-
return /* @__PURE__ */ React.createElement(PlasmicTextFieldContext.Provider, { value: props }, /* @__PURE__ */ React.createElement(
|
|
4046
|
-
TextField,
|
|
4047
|
-
__spreadValues$1({
|
|
4048
|
-
autoComplete: enableAutoComplete ? autoComplete : void 0
|
|
4049
|
-
}, rest),
|
|
4050
|
-
({ isDisabled, isReadOnly }) => withObservedValues(
|
|
4051
|
-
children,
|
|
4052
|
-
{
|
|
4053
|
-
disabled: isDisabled,
|
|
4054
|
-
readonly: isReadOnly
|
|
4055
|
-
},
|
|
4056
|
-
updateInteractionVariant
|
|
4057
|
-
)
|
|
4058
|
-
));
|
|
4396
|
+
)));
|
|
4059
4397
|
}
|
|
4060
4398
|
const TEXT_FIELD_COMPONENT_NAME = makeComponentName("textField");
|
|
4061
4399
|
function registerTextField(loader, overrides) {
|
|
@@ -4069,13 +4407,36 @@ function registerTextField(loader, overrides) {
|
|
|
4069
4407
|
importName: "BaseTextField",
|
|
4070
4408
|
interactionVariants,
|
|
4071
4409
|
// TODO: Support for validate prop
|
|
4072
|
-
props: __spreadProps(__spreadValues$1({},
|
|
4410
|
+
props: __spreadProps(__spreadValues$1({}, getCommonProps("Text Field", [
|
|
4073
4411
|
"name",
|
|
4074
4412
|
"isDisabled",
|
|
4075
4413
|
"isReadOnly",
|
|
4076
4414
|
"autoFocus",
|
|
4077
4415
|
"aria-label",
|
|
4078
|
-
"isRequired"
|
|
4416
|
+
"isRequired",
|
|
4417
|
+
"value",
|
|
4418
|
+
"maxLength",
|
|
4419
|
+
"minLength",
|
|
4420
|
+
"pattern",
|
|
4421
|
+
"type",
|
|
4422
|
+
"inputMode",
|
|
4423
|
+
"validationBehavior",
|
|
4424
|
+
"autoComplete",
|
|
4425
|
+
"onChange",
|
|
4426
|
+
"onFocus",
|
|
4427
|
+
"onBlur",
|
|
4428
|
+
"onFocusChange",
|
|
4429
|
+
"onKeyDown",
|
|
4430
|
+
"onKeyUp",
|
|
4431
|
+
"onCopy",
|
|
4432
|
+
"onCut",
|
|
4433
|
+
"onPaste",
|
|
4434
|
+
"onCompositionStart",
|
|
4435
|
+
"onCompositionEnd",
|
|
4436
|
+
"onCompositionUpdate",
|
|
4437
|
+
"onSelect",
|
|
4438
|
+
"onBeforeInput",
|
|
4439
|
+
"onInput"
|
|
4079
4440
|
])), {
|
|
4080
4441
|
children: {
|
|
4081
4442
|
type: "slot",
|
|
@@ -4119,12 +4480,6 @@ function registerTextField(loader, overrides) {
|
|
|
4119
4480
|
]
|
|
4120
4481
|
}
|
|
4121
4482
|
},
|
|
4122
|
-
value: {
|
|
4123
|
-
type: "string",
|
|
4124
|
-
editOnly: true,
|
|
4125
|
-
uncontrolledProp: "defaultValue",
|
|
4126
|
-
description: "The current value"
|
|
4127
|
-
},
|
|
4128
4483
|
isInvalid: {
|
|
4129
4484
|
// TODO: Not sure if needed
|
|
4130
4485
|
displayName: "Invalid",
|
|
@@ -4136,190 +4491,8 @@ function registerTextField(loader, overrides) {
|
|
|
4136
4491
|
// TODO: Not sure if needed
|
|
4137
4492
|
type: "array",
|
|
4138
4493
|
description: "Errors for custom validation"
|
|
4139
|
-
},
|
|
4140
|
-
// validate: {
|
|
4141
|
-
// type: "function" as const,
|
|
4142
|
-
// argNames: ["value"],
|
|
4143
|
-
// argValues: (_ps: any, ctx: any) => [ctx.data[0]],
|
|
4144
|
-
// },
|
|
4145
|
-
enableAutoComplete: {
|
|
4146
|
-
type: "boolean",
|
|
4147
|
-
description: "Whether the browser is allowed to automatically complete the input",
|
|
4148
|
-
defaultValueHint: false
|
|
4149
|
-
},
|
|
4150
|
-
autoComplete: {
|
|
4151
|
-
type: "choice",
|
|
4152
|
-
hidden: ({ enableAutoComplete }) => !enableAutoComplete,
|
|
4153
|
-
description: "Guidance as to the type of data expected in the field",
|
|
4154
|
-
helpText: "For explanations on what each of the values mean, check https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values",
|
|
4155
|
-
options: [
|
|
4156
|
-
"name",
|
|
4157
|
-
"honorific-prefix",
|
|
4158
|
-
"given-name",
|
|
4159
|
-
"additional-name",
|
|
4160
|
-
"family-name",
|
|
4161
|
-
"honorific-suffix",
|
|
4162
|
-
"nickname",
|
|
4163
|
-
"email",
|
|
4164
|
-
"username",
|
|
4165
|
-
"new-password",
|
|
4166
|
-
"current-password",
|
|
4167
|
-
"one-time-code",
|
|
4168
|
-
"organization-title",
|
|
4169
|
-
"organization",
|
|
4170
|
-
"street-address",
|
|
4171
|
-
"shipping",
|
|
4172
|
-
"billing",
|
|
4173
|
-
"address-line1",
|
|
4174
|
-
"address-line2",
|
|
4175
|
-
"address-line3",
|
|
4176
|
-
"address-level4",
|
|
4177
|
-
"address-level3",
|
|
4178
|
-
"address-level2",
|
|
4179
|
-
"address-level1",
|
|
4180
|
-
"country",
|
|
4181
|
-
"country-name",
|
|
4182
|
-
"postal-code",
|
|
4183
|
-
"cc-name",
|
|
4184
|
-
"cc-given-name",
|
|
4185
|
-
"cc-additional-name",
|
|
4186
|
-
"cc-family-name",
|
|
4187
|
-
"cc-number",
|
|
4188
|
-
"cc-exp",
|
|
4189
|
-
"cc-exp-month",
|
|
4190
|
-
"cc-exp-year",
|
|
4191
|
-
"cc-csc",
|
|
4192
|
-
"cc-type",
|
|
4193
|
-
"transaction-currency",
|
|
4194
|
-
"transaction-amount",
|
|
4195
|
-
"language",
|
|
4196
|
-
"bday",
|
|
4197
|
-
"bday-day",
|
|
4198
|
-
"bday-month",
|
|
4199
|
-
"bday-year",
|
|
4200
|
-
"sex",
|
|
4201
|
-
"tel",
|
|
4202
|
-
"tel-country-code",
|
|
4203
|
-
"tel-national",
|
|
4204
|
-
"tel-area-code",
|
|
4205
|
-
"tel-local",
|
|
4206
|
-
"tel-local-suffix",
|
|
4207
|
-
"tel-local-prefix",
|
|
4208
|
-
"tel-extension",
|
|
4209
|
-
"impp",
|
|
4210
|
-
"url",
|
|
4211
|
-
"photo",
|
|
4212
|
-
"webauthn"
|
|
4213
|
-
]
|
|
4214
|
-
},
|
|
4215
|
-
maxLength: {
|
|
4216
|
-
type: "number",
|
|
4217
|
-
description: "The maximum number of characters supported by the input"
|
|
4218
|
-
},
|
|
4219
|
-
minLength: {
|
|
4220
|
-
type: "number",
|
|
4221
|
-
description: "The minimum number of characters supported by the input"
|
|
4222
|
-
},
|
|
4223
|
-
pattern: {
|
|
4224
|
-
type: "string",
|
|
4225
|
-
description: "Regex pattern that the value of the input must match to be valid",
|
|
4226
|
-
helpText: "For more information about writing Regular Expressions (regex), check out https://regexr.com/",
|
|
4227
|
-
validator: (value) => {
|
|
4228
|
-
try {
|
|
4229
|
-
new RegExp(value);
|
|
4230
|
-
return true;
|
|
4231
|
-
} catch (error) {
|
|
4232
|
-
return "Invalid Regex";
|
|
4233
|
-
}
|
|
4234
|
-
}
|
|
4235
|
-
},
|
|
4236
|
-
type: {
|
|
4237
|
-
type: "choice",
|
|
4238
|
-
defaultValueHint: "text",
|
|
4239
|
-
options: ["text", "search", "url", "tel", "email", "password"]
|
|
4240
|
-
},
|
|
4241
|
-
inputMode: {
|
|
4242
|
-
type: "choice",
|
|
4243
|
-
description: "hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.",
|
|
4244
|
-
options: [
|
|
4245
|
-
"none",
|
|
4246
|
-
"text",
|
|
4247
|
-
"tel",
|
|
4248
|
-
"url",
|
|
4249
|
-
"email",
|
|
4250
|
-
"numeric",
|
|
4251
|
-
"decimal",
|
|
4252
|
-
"search"
|
|
4253
|
-
]
|
|
4254
|
-
},
|
|
4255
|
-
validationBehavior: {
|
|
4256
|
-
type: "choice",
|
|
4257
|
-
options: ["native", "aria"],
|
|
4258
|
-
description: "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.",
|
|
4259
|
-
defaultValueHint: "native"
|
|
4260
|
-
},
|
|
4261
|
-
onChange: {
|
|
4262
|
-
type: "eventHandler",
|
|
4263
|
-
argTypes: [{ name: "value", type: "string" }]
|
|
4264
|
-
},
|
|
4265
|
-
onFocus: {
|
|
4266
|
-
type: "eventHandler",
|
|
4267
|
-
argTypes: [{ name: "focusEvent", type: "object" }]
|
|
4268
|
-
},
|
|
4269
|
-
onBlur: {
|
|
4270
|
-
type: "eventHandler",
|
|
4271
|
-
argTypes: [{ name: "focusEvent", type: "object" }]
|
|
4272
|
-
},
|
|
4273
|
-
onFocusChange: {
|
|
4274
|
-
type: "eventHandler",
|
|
4275
|
-
argTypes: [{ name: "isFocused", type: "boolean" }]
|
|
4276
|
-
},
|
|
4277
|
-
onKeyDown: {
|
|
4278
|
-
type: "eventHandler",
|
|
4279
|
-
argTypes: [{ name: "keyboardEvent", type: "object" }]
|
|
4280
|
-
},
|
|
4281
|
-
onKeyUp: {
|
|
4282
|
-
type: "eventHandler",
|
|
4283
|
-
argTypes: [{ name: "keyboardEvent", type: "object" }]
|
|
4284
|
-
},
|
|
4285
|
-
onCopy: {
|
|
4286
|
-
type: "eventHandler",
|
|
4287
|
-
argTypes: [{ name: "clipbordEvent", type: "object" }]
|
|
4288
|
-
},
|
|
4289
|
-
onCut: {
|
|
4290
|
-
type: "eventHandler",
|
|
4291
|
-
argTypes: [{ name: "clipbordEvent", type: "object" }]
|
|
4292
|
-
},
|
|
4293
|
-
onPaste: {
|
|
4294
|
-
type: "eventHandler",
|
|
4295
|
-
argTypes: [{ name: "clipbordEvent", type: "object" }]
|
|
4296
|
-
},
|
|
4297
|
-
onCompositionStart: {
|
|
4298
|
-
type: "eventHandler",
|
|
4299
|
-
argTypes: [{ name: "compositionEvent", type: "object" }]
|
|
4300
|
-
},
|
|
4301
|
-
onCompositionEnd: {
|
|
4302
|
-
type: "eventHandler",
|
|
4303
|
-
argTypes: [{ name: "compositionEvent", type: "object" }]
|
|
4304
|
-
},
|
|
4305
|
-
onCompositionUpdate: {
|
|
4306
|
-
type: "eventHandler",
|
|
4307
|
-
argTypes: [{ name: "compositionEvent", type: "object" }]
|
|
4308
|
-
},
|
|
4309
|
-
onSelect: {
|
|
4310
|
-
type: "eventHandler",
|
|
4311
|
-
argTypes: [{ name: "selectionEvent", type: "object" }]
|
|
4312
|
-
},
|
|
4313
|
-
onBeforeInput: {
|
|
4314
|
-
type: "eventHandler",
|
|
4315
|
-
argTypes: [{ name: "inputEvent", type: "object" }]
|
|
4316
|
-
},
|
|
4317
|
-
onInput: {
|
|
4318
|
-
type: "eventHandler",
|
|
4319
|
-
argTypes: [{ name: "inputEvent", type: "object" }]
|
|
4320
4494
|
}
|
|
4321
4495
|
}),
|
|
4322
|
-
// NOTE: React-Aria does not support render props for <Input> and <Textarea>, so focusVisible and inputHovered states are not implemented
|
|
4323
4496
|
states: {
|
|
4324
4497
|
value: {
|
|
4325
4498
|
type: "writable",
|