@plasmicpkgs/react-aria 0.0.41 → 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.
Files changed (134) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/common.d.ts +8 -1
  3. package/dist/contexts.d.ts +0 -1
  4. package/dist/react-aria.esm.js +638 -465
  5. package/dist/react-aria.esm.js.map +1 -1
  6. package/dist/react-aria.js +637 -464
  7. package/dist/react-aria.js.map +1 -1
  8. package/dist/registerButton.d.ts +1 -1
  9. package/dist/registerCheckbox.d.ts +3 -4
  10. package/dist/registerCheckboxGroup.d.ts +2 -2
  11. package/dist/registerInput.d.ts +12 -5
  12. package/dist/registerListBox.d.ts +2 -3
  13. package/dist/registerModal.d.ts +2 -3
  14. package/dist/registerPopover.d.ts +4 -6
  15. package/dist/registerRadio.d.ts +3 -5
  16. package/dist/registerRadioGroup.d.ts +1 -1
  17. package/dist/registerSliderThumb.d.ts +1 -1
  18. package/dist/registerSwitch.d.ts +1 -1
  19. package/dist/registerTextArea.d.ts +11 -5
  20. package/dist/registerTextField.d.ts +3 -3
  21. package/dist/utils.d.ts +7 -1
  22. package/package.json +3 -3
  23. package/skinny/common-96be13c3.esm.js +341 -0
  24. package/skinny/common-96be13c3.esm.js.map +1 -0
  25. package/skinny/common-f51484c1.cjs.js +345 -0
  26. package/skinny/common-f51484c1.cjs.js.map +1 -0
  27. package/skinny/common.d.ts +8 -1
  28. package/skinny/{contexts-7236059e.cjs.js → contexts-3a98471a.cjs.js} +1 -3
  29. package/skinny/contexts-3a98471a.cjs.js.map +1 -0
  30. package/skinny/{contexts-21e0d928.esm.js → contexts-87c261f6.esm.js} +2 -3
  31. package/skinny/contexts-87c261f6.esm.js.map +1 -0
  32. package/skinny/contexts.d.ts +0 -1
  33. package/skinny/registerButton.cjs.js +2 -2
  34. package/skinny/registerButton.cjs.js.map +1 -1
  35. package/skinny/registerButton.d.ts +1 -1
  36. package/skinny/registerButton.esm.js +2 -2
  37. package/skinny/registerButton.esm.js.map +1 -1
  38. package/skinny/registerCheckbox.cjs.js +13 -18
  39. package/skinny/registerCheckbox.cjs.js.map +1 -1
  40. package/skinny/registerCheckbox.d.ts +3 -4
  41. package/skinny/registerCheckbox.esm.js +13 -18
  42. package/skinny/registerCheckbox.esm.js.map +1 -1
  43. package/skinny/registerCheckboxGroup.cjs.js +5 -5
  44. package/skinny/registerCheckboxGroup.cjs.js.map +1 -1
  45. package/skinny/registerCheckboxGroup.d.ts +2 -2
  46. package/skinny/registerCheckboxGroup.esm.js +5 -5
  47. package/skinny/registerCheckboxGroup.esm.js.map +1 -1
  48. package/skinny/registerComboBox.cjs.js +3 -3
  49. package/skinny/registerComboBox.esm.js +3 -3
  50. package/skinny/registerDialogTrigger.cjs.js +2 -2
  51. package/skinny/registerDialogTrigger.esm.js +2 -2
  52. package/skinny/registerHeader.cjs.js +1 -1
  53. package/skinny/registerHeader.esm.js +1 -1
  54. package/skinny/registerInput.cjs.js +76 -16
  55. package/skinny/registerInput.cjs.js.map +1 -1
  56. package/skinny/registerInput.d.ts +12 -5
  57. package/skinny/registerInput.esm.js +76 -17
  58. package/skinny/registerInput.esm.js.map +1 -1
  59. package/skinny/{registerListBox-f060da58.cjs.js → registerListBox-44316bb6.cjs.js} +7 -7
  60. package/skinny/registerListBox-44316bb6.cjs.js.map +1 -0
  61. package/skinny/{registerListBox-38a08460.esm.js → registerListBox-ccd14a2e.esm.js} +7 -7
  62. package/skinny/registerListBox-ccd14a2e.esm.js.map +1 -0
  63. package/skinny/registerListBox.cjs.js +3 -2
  64. package/skinny/registerListBox.cjs.js.map +1 -1
  65. package/skinny/registerListBox.d.ts +2 -3
  66. package/skinny/registerListBox.esm.js +3 -2
  67. package/skinny/registerListBox.esm.js.map +1 -1
  68. package/skinny/registerListBoxItem.cjs.js +1 -1
  69. package/skinny/registerListBoxItem.esm.js +1 -1
  70. package/skinny/registerModal.cjs.js +5 -4
  71. package/skinny/registerModal.cjs.js.map +1 -1
  72. package/skinny/registerModal.d.ts +2 -3
  73. package/skinny/registerModal.esm.js +5 -4
  74. package/skinny/registerModal.esm.js.map +1 -1
  75. package/skinny/registerPopover.cjs.js +23 -24
  76. package/skinny/registerPopover.cjs.js.map +1 -1
  77. package/skinny/registerPopover.d.ts +4 -6
  78. package/skinny/registerPopover.esm.js +24 -25
  79. package/skinny/registerPopover.esm.js.map +1 -1
  80. package/skinny/registerRadio.cjs.js +14 -26
  81. package/skinny/registerRadio.cjs.js.map +1 -1
  82. package/skinny/registerRadio.d.ts +3 -5
  83. package/skinny/registerRadio.esm.js +14 -26
  84. package/skinny/registerRadio.esm.js.map +1 -1
  85. package/skinny/registerRadioGroup.cjs.js +4 -4
  86. package/skinny/registerRadioGroup.cjs.js.map +1 -1
  87. package/skinny/registerRadioGroup.d.ts +1 -1
  88. package/skinny/registerRadioGroup.esm.js +4 -4
  89. package/skinny/registerRadioGroup.esm.js.map +1 -1
  90. package/skinny/registerSection.cjs.js +1 -1
  91. package/skinny/registerSection.esm.js +1 -1
  92. package/skinny/registerSelect.cjs.js +3 -3
  93. package/skinny/registerSelect.esm.js +3 -3
  94. package/skinny/{registerSlider-58ef7e20.cjs.js → registerSlider-cd08b960.cjs.js} +4 -4
  95. package/skinny/registerSlider-cd08b960.cjs.js.map +1 -0
  96. package/skinny/{registerSlider-d74e2330.esm.js → registerSlider-df0fdf82.esm.js} +4 -4
  97. package/skinny/registerSlider-df0fdf82.esm.js.map +1 -0
  98. package/skinny/registerSlider.cjs.js +3 -3
  99. package/skinny/registerSlider.esm.js +3 -3
  100. package/skinny/registerSliderThumb.cjs.js +3 -3
  101. package/skinny/registerSliderThumb.cjs.js.map +1 -1
  102. package/skinny/registerSliderThumb.d.ts +1 -1
  103. package/skinny/registerSliderThumb.esm.js +3 -3
  104. package/skinny/registerSliderThumb.esm.js.map +1 -1
  105. package/skinny/registerSliderTrack.cjs.js +3 -3
  106. package/skinny/registerSliderTrack.esm.js +3 -3
  107. package/skinny/registerSwitch.cjs.js +10 -4
  108. package/skinny/registerSwitch.cjs.js.map +1 -1
  109. package/skinny/registerSwitch.d.ts +1 -1
  110. package/skinny/registerSwitch.esm.js +10 -4
  111. package/skinny/registerSwitch.esm.js.map +1 -1
  112. package/skinny/registerTextArea.cjs.js +56 -35
  113. package/skinny/registerTextArea.cjs.js.map +1 -1
  114. package/skinny/registerTextArea.d.ts +11 -5
  115. package/skinny/registerTextArea.esm.js +56 -36
  116. package/skinny/registerTextArea.esm.js.map +1 -1
  117. package/skinny/registerTextField.cjs.js +34 -215
  118. package/skinny/registerTextField.cjs.js.map +1 -1
  119. package/skinny/registerTextField.d.ts +3 -3
  120. package/skinny/registerTextField.esm.js +34 -215
  121. package/skinny/registerTextField.esm.js.map +1 -1
  122. package/skinny/utils-a1785802.esm.js.map +1 -1
  123. package/skinny/utils-d3708034.cjs.js.map +1 -1
  124. package/skinny/utils.d.ts +7 -1
  125. package/skinny/common-52c26d37.esm.js +0 -52
  126. package/skinny/common-52c26d37.esm.js.map +0 -1
  127. package/skinny/common-e74a9214.cjs.js +0 -54
  128. package/skinny/common-e74a9214.cjs.js.map +0 -1
  129. package/skinny/contexts-21e0d928.esm.js.map +0 -1
  130. package/skinny/contexts-7236059e.cjs.js.map +0 -1
  131. package/skinny/registerListBox-38a08460.esm.js.map +0 -1
  132. package/skinny/registerListBox-f060da58.cjs.js.map +0 -1
  133. package/skinny/registerSlider-58ef7e20.cjs.js.map +0 -1
  134. package/skinny/registerSlider-d74e2330.esm.js.map +0 -1
@@ -16,51 +16,400 @@ var React__default = /*#__PURE__*/_interopDefault(React);
16
16
  var registerComponent__default = /*#__PURE__*/_interopDefault(registerComponent);
17
17
  var flattenChildren__default = /*#__PURE__*/_interopDefault(flattenChildren);
18
18
 
19
- function getCommonInputProps(fieldName, fields) {
20
- const commonInputProps = {
21
- name: {
19
+ var __defProp$r = Object.defineProperty;
20
+ var __defProps$e = Object.defineProperties;
21
+ var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
22
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
23
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
24
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
25
+ var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
26
+ var __spreadValues$r = (a, b) => {
27
+ for (var prop in b || (b = {}))
28
+ if (__hasOwnProp$r.call(b, prop))
29
+ __defNormalProp$r(a, prop, b[prop]);
30
+ if (__getOwnPropSymbols$r)
31
+ for (var prop of __getOwnPropSymbols$r(b)) {
32
+ if (__propIsEnum$r.call(b, prop))
33
+ __defNormalProp$r(a, prop, b[prop]);
34
+ }
35
+ return a;
36
+ };
37
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
38
+ function registerComponentHelper(loader, component, meta, overrides) {
39
+ if (overrides) {
40
+ meta = __spreadProps$e(__spreadValues$r(__spreadValues$r({}, meta), overrides), {
41
+ props: __spreadValues$r(__spreadValues$r({}, meta.props), overrides.props)
42
+ });
43
+ if (overrides.parentComponentName) {
44
+ meta.name = makeChildComponentName(
45
+ overrides.parentComponentName,
46
+ meta.name
47
+ );
48
+ }
49
+ }
50
+ if (loader) {
51
+ loader.registerComponent(component, meta);
52
+ } else {
53
+ registerComponent__default.default(component, meta);
54
+ }
55
+ return meta;
56
+ }
57
+ function makeComponentName(name) {
58
+ return `plasmic-react-aria-${name}`;
59
+ }
60
+ function makeChildComponentName(fullParentName, fullChildName) {
61
+ if (!fullParentName) {
62
+ return fullChildName;
63
+ }
64
+ return `${fullParentName}-${fullChildName.replace(
65
+ "plasmic-react-aria-",
66
+ ""
67
+ )}`;
68
+ }
69
+ function extractPlasmicDataProps(props) {
70
+ return Object.fromEntries(
71
+ Object.entries(props).filter(([key]) => key.startsWith("data-plasmic-"))
72
+ );
73
+ }
74
+ function withoutNils(array) {
75
+ return array.filter((x) => x != null);
76
+ }
77
+ function isDefined(thing) {
78
+ return thing !== void 0 && thing !== null;
79
+ }
80
+
81
+ function hasParent(_props, ctx) {
82
+ return isDefined(ctx == null ? void 0 : ctx.parent) === true;
83
+ }
84
+ function isParentReadOnly(_props, ctx) {
85
+ var _a;
86
+ return ((_a = ctx == null ? void 0 : ctx.parent) == null ? void 0 : _a.isReadOnly) === true;
87
+ }
88
+ function isParentDisabled(_props, ctx) {
89
+ var _a;
90
+ return ((_a = ctx == null ? void 0 : ctx.parent) == null ? void 0 : _a.isDisabled) === true;
91
+ }
92
+ function resolveAutoComplete(autoCompleteProp) {
93
+ if (typeof autoCompleteProp === "string") {
94
+ return autoCompleteProp;
95
+ }
96
+ if (!autoCompleteProp || !Array.isArray(autoCompleteProp) || autoCompleteProp.includes("off")) {
97
+ return void 0;
98
+ }
99
+ if (autoCompleteProp.includes("off")) {
100
+ return "off";
101
+ }
102
+ if (autoCompleteProp.includes("on") && autoCompleteProp.length === 1) {
103
+ return "on";
104
+ }
105
+ return autoCompleteProp.filter((x) => x !== "on").join(" ");
106
+ }
107
+ function createNameProp() {
108
+ return {
109
+ type: "string",
110
+ description: "Name for this field if it is part of a form",
111
+ hidden: hasParent,
112
+ advanced: true
113
+ };
114
+ }
115
+ function createDisabledProp(componentName) {
116
+ return {
117
+ displayName: "Disabled",
118
+ type: "boolean",
119
+ description: `Whether the ${componentName} is read-only and unfocusable`,
120
+ defaultValueHint: false,
121
+ hidden: isParentDisabled
122
+ };
123
+ }
124
+ function createReadOnlyProp(componentName) {
125
+ return {
126
+ displayName: "Read only",
127
+ type: "boolean",
128
+ 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).`,
129
+ defaultValueHint: false,
130
+ advanced: true,
131
+ hidden: isParentReadOnly
132
+ };
133
+ }
134
+ function createRequiredProp(componentName) {
135
+ return {
136
+ displayName: "Required",
137
+ type: "boolean",
138
+ description: `Whether user input is required on the ${componentName} before form submission.`,
139
+ defaultValueHint: false,
140
+ advanced: true,
141
+ hidden: hasParent
142
+ };
143
+ }
144
+ function createAutoFocusProp(componentName) {
145
+ return {
146
+ type: "boolean",
147
+ description: `Whether the ${componentName} should be focused when rendered`,
148
+ defaultValueHint: false,
149
+ advanced: true,
150
+ hidden: hasParent
151
+ };
152
+ }
153
+ function createAriaLabelProp(componentName) {
154
+ return {
155
+ type: "string",
156
+ displayName: "Aria Label",
157
+ description: `Label for this ${componentName}, if no visible label is used, to identify the element to assistive technology`,
158
+ advanced: true,
159
+ hidden: hasParent
160
+ };
161
+ }
162
+ function createChildrenProp() {
163
+ return {
164
+ type: "slot",
165
+ mergeWithParent: true
166
+ };
167
+ }
168
+ function getCommonProps(componentName, propNames) {
169
+ const commonProps = {
170
+ name: createNameProp(),
171
+ disabled: createDisabledProp(componentName),
172
+ isDisabled: createDisabledProp(componentName),
173
+ readOnly: createReadOnlyProp(componentName),
174
+ isReadOnly: createReadOnlyProp(componentName),
175
+ autoFocus: createAutoFocusProp(componentName),
176
+ "aria-label": createAriaLabelProp(componentName),
177
+ required: createRequiredProp(componentName),
178
+ isRequired: createRequiredProp(componentName),
179
+ children: createChildrenProp(),
180
+ // NOTE: The following props are only applicable to inputs, textareas, and text fields
181
+ value: {
22
182
  type: "string",
23
- description: "Name for this field if it is part of a form"
183
+ editOnly: true,
184
+ displayName: "Default Value",
185
+ uncontrolledProp: "defaultValue",
186
+ description: `The default value of the ${componentName}`,
187
+ hidden: hasParent
24
188
  },
25
- isDisabled: {
26
- displayName: "Disabled",
27
- type: "boolean",
28
- description: `Whether the ${fieldName} is read-only and unfocusable`,
29
- defaultValueHint: false
189
+ maxLength: {
190
+ type: "number",
191
+ description: "The maximum number of characters supported by the input",
192
+ advanced: true,
193
+ hidden: hasParent
30
194
  },
31
- isReadOnly: {
32
- displayName: "Read only",
33
- type: "boolean",
34
- description: `Whether the value of this ${fieldName} can be changed by the user`,
35
- defaultValueHint: false
195
+ minLength: {
196
+ type: "number",
197
+ description: "The minimum number of characters supported by the input",
198
+ advanced: true,
199
+ hidden: hasParent
36
200
  },
37
- autoFocus: {
38
- type: "boolean",
39
- description: `Whether the ${fieldName} should be focused when rendered`,
40
- defaultValueHint: false,
41
- advanced: true
42
- },
43
- "aria-label": {
201
+ pattern: {
44
202
  type: "string",
45
- displayName: "Aria Label",
46
- description: `Label for this ${fieldName}, if no visible label is used, to identify the element to assistive technology`,
47
- advanced: true
203
+ description: "Regex pattern that the value of the input must match to be valid",
204
+ helpText: "For more information about writing Regular Expressions (regex), check out https://regexr.com/",
205
+ validator: (value) => {
206
+ try {
207
+ new RegExp(value);
208
+ return true;
209
+ } catch (error) {
210
+ return "Invalid Regex";
211
+ }
212
+ },
213
+ advanced: true,
214
+ hidden: hasParent
215
+ },
216
+ type: {
217
+ type: "choice",
218
+ defaultValueHint: "text",
219
+ options: ["text", "search", "url", "tel", "email", "password"],
220
+ 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.",
221
+ advanced: true,
222
+ hidden: hasParent
223
+ },
224
+ inputMode: {
225
+ type: "choice",
226
+ description: "hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.",
227
+ options: [
228
+ "none",
229
+ "text",
230
+ "tel",
231
+ "url",
232
+ "email",
233
+ "numeric",
234
+ "decimal",
235
+ "search"
236
+ ],
237
+ hidden: hasParent
238
+ },
239
+ autoComplete: {
240
+ type: "choice",
241
+ advanced: true,
242
+ multiSelect: true,
243
+ hidden: hasParent,
244
+ description: "Guidance as to the type of data expected in the field",
245
+ helpText: "For explanations on what each of the values mean, check https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values",
246
+ options: [
247
+ "on",
248
+ "off",
249
+ "name",
250
+ "honorific-prefix",
251
+ "given-name",
252
+ "additional-name",
253
+ "family-name",
254
+ "honorific-suffix",
255
+ "nickname",
256
+ "email",
257
+ "username",
258
+ "new-password",
259
+ "current-password",
260
+ "one-time-code",
261
+ "organization-title",
262
+ "organization",
263
+ "street-address",
264
+ "shipping",
265
+ "billing",
266
+ "address-line1",
267
+ "address-line2",
268
+ "address-line3",
269
+ "address-level4",
270
+ "address-level3",
271
+ "address-level2",
272
+ "address-level1",
273
+ "country",
274
+ "country-name",
275
+ "postal-code",
276
+ "cc-name",
277
+ "cc-given-name",
278
+ "cc-additional-name",
279
+ "cc-family-name",
280
+ "cc-number",
281
+ "cc-exp",
282
+ "cc-exp-month",
283
+ "cc-exp-year",
284
+ "cc-csc",
285
+ "cc-type",
286
+ "transaction-currency",
287
+ "transaction-amount",
288
+ "language",
289
+ "bday",
290
+ "bday-day",
291
+ "bday-month",
292
+ "bday-year",
293
+ "sex",
294
+ "tel",
295
+ "tel-country-code",
296
+ "tel-national",
297
+ "tel-area-code",
298
+ "tel-local",
299
+ "tel-local-suffix",
300
+ "tel-local-prefix",
301
+ "tel-extension",
302
+ "impp",
303
+ "url",
304
+ "photo",
305
+ "webauthn"
306
+ ]
307
+ },
308
+ validationBehavior: {
309
+ type: "choice",
310
+ options: ["native", "aria"],
311
+ 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.",
312
+ defaultValueHint: "native",
313
+ advanced: true,
314
+ hidden: hasParent
315
+ },
316
+ onChange: {
317
+ type: "eventHandler",
318
+ argTypes: [{ name: "value", type: "string" }],
319
+ hidden: hasParent
320
+ },
321
+ onFocus: {
322
+ type: "eventHandler",
323
+ argTypes: [{ name: "focusEvent", type: "object" }],
324
+ advanced: true,
325
+ hidden: hasParent
326
+ },
327
+ onBlur: {
328
+ type: "eventHandler",
329
+ argTypes: [{ name: "focusEvent", type: "object" }],
330
+ advanced: true,
331
+ hidden: hasParent
332
+ },
333
+ onFocusChange: {
334
+ type: "eventHandler",
335
+ argTypes: [{ name: "isFocused", type: "boolean" }],
336
+ advanced: true,
337
+ hidden: hasParent
338
+ },
339
+ onKeyDown: {
340
+ type: "eventHandler",
341
+ argTypes: [{ name: "keyboardEvent", type: "object" }],
342
+ advanced: true,
343
+ hidden: hasParent
344
+ },
345
+ onKeyUp: {
346
+ type: "eventHandler",
347
+ argTypes: [{ name: "keyboardEvent", type: "object" }],
348
+ advanced: true,
349
+ hidden: hasParent
350
+ },
351
+ onCopy: {
352
+ type: "eventHandler",
353
+ argTypes: [{ name: "clipbordEvent", type: "object" }],
354
+ advanced: true,
355
+ hidden: hasParent
356
+ },
357
+ onCut: {
358
+ type: "eventHandler",
359
+ argTypes: [{ name: "clipbordEvent", type: "object" }],
360
+ advanced: true,
361
+ hidden: hasParent
362
+ },
363
+ onPaste: {
364
+ type: "eventHandler",
365
+ argTypes: [{ name: "clipbordEvent", type: "object" }],
366
+ advanced: true,
367
+ hidden: hasParent
368
+ },
369
+ onCompositionStart: {
370
+ type: "eventHandler",
371
+ argTypes: [{ name: "compositionEvent", type: "object" }],
372
+ advanced: true,
373
+ hidden: hasParent
374
+ },
375
+ onCompositionEnd: {
376
+ type: "eventHandler",
377
+ argTypes: [{ name: "compositionEvent", type: "object" }],
378
+ advanced: true,
379
+ hidden: hasParent
48
380
  },
49
- isRequired: {
50
- displayName: "Required",
51
- type: "boolean",
52
- description: `Whether user input is required on the ${fieldName} before form submission.`,
53
- defaultValueHint: false
381
+ onCompositionUpdate: {
382
+ type: "eventHandler",
383
+ argTypes: [{ name: "compositionEvent", type: "object" }],
384
+ advanced: true,
385
+ hidden: hasParent
54
386
  },
55
- children: {
56
- type: "slot",
57
- mergeWithParent: true
387
+ onSelect: {
388
+ type: "eventHandler",
389
+ argTypes: [{ name: "selectionEvent", type: "object" }],
390
+ advanced: true,
391
+ hidden: hasParent
392
+ },
393
+ onBeforeInput: {
394
+ type: "eventHandler",
395
+ argTypes: [{ name: "inputEvent", type: "object" }],
396
+ advanced: true,
397
+ hidden: hasParent
398
+ },
399
+ onInput: {
400
+ type: "eventHandler",
401
+ argTypes: [{ name: "inputEvent", type: "object" }],
402
+ advanced: true,
403
+ hidden: hasParent
404
+ },
405
+ placeholder: {
406
+ type: "string"
58
407
  }
59
408
  };
60
409
  const filteredProps = {};
61
- fields.forEach((field) => {
62
- if (commonInputProps.hasOwnProperty(field)) {
63
- filteredProps[field] = commonInputProps[field];
410
+ propNames.forEach((propName) => {
411
+ if (Object.prototype.hasOwnProperty.call(commonProps, propName)) {
412
+ filteredProps[propName] = commonProps[propName];
64
413
  }
65
414
  });
66
415
  return filteredProps;
@@ -135,68 +484,6 @@ function pickAriaComponentVariants(keys) {
135
484
  };
136
485
  }
137
486
 
138
- var __defProp$r = Object.defineProperty;
139
- var __defProps$e = Object.defineProperties;
140
- var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
141
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
142
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
143
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
144
- var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
145
- var __spreadValues$r = (a, b) => {
146
- for (var prop in b || (b = {}))
147
- if (__hasOwnProp$r.call(b, prop))
148
- __defNormalProp$r(a, prop, b[prop]);
149
- if (__getOwnPropSymbols$r)
150
- for (var prop of __getOwnPropSymbols$r(b)) {
151
- if (__propIsEnum$r.call(b, prop))
152
- __defNormalProp$r(a, prop, b[prop]);
153
- }
154
- return a;
155
- };
156
- var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
157
- function registerComponentHelper(loader, component, meta, overrides) {
158
- if (overrides) {
159
- meta = __spreadProps$e(__spreadValues$r(__spreadValues$r({}, meta), overrides), {
160
- props: __spreadValues$r(__spreadValues$r({}, meta.props), overrides.props)
161
- });
162
- if (overrides.parentComponentName) {
163
- meta.name = makeChildComponentName(
164
- overrides.parentComponentName,
165
- meta.name
166
- );
167
- }
168
- }
169
- if (loader) {
170
- loader.registerComponent(component, meta);
171
- } else {
172
- registerComponent__default.default(component, meta);
173
- }
174
- return meta;
175
- }
176
- function makeComponentName(name) {
177
- return `plasmic-react-aria-${name}`;
178
- }
179
- function makeChildComponentName(fullParentName, fullChildName) {
180
- if (!fullParentName) {
181
- return fullChildName;
182
- }
183
- return `${fullParentName}-${fullChildName.replace(
184
- "plasmic-react-aria-",
185
- ""
186
- )}`;
187
- }
188
- function extractPlasmicDataProps(props) {
189
- return Object.fromEntries(
190
- Object.entries(props).filter(([key]) => key.startsWith("data-plasmic-"))
191
- );
192
- }
193
- function withoutNils(array) {
194
- return array.filter((x) => x != null);
195
- }
196
- function isDefined(thing) {
197
- return thing !== void 0 && thing !== null;
198
- }
199
-
200
487
  var __defProp$q = Object.defineProperty;
201
488
  var __defProps$d = Object.defineProperties;
202
489
  var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
@@ -281,7 +568,7 @@ function registerButton(loader, overrides) {
281
568
  padding: "2px 10px",
282
569
  cursor: "pointer"
283
570
  },
284
- props: __spreadProps$d(__spreadValues$q({}, getCommonInputProps("button", [
571
+ props: __spreadProps$d(__spreadValues$q({}, getCommonProps("button", [
285
572
  "isDisabled",
286
573
  "aria-label"
287
574
  ])), {
@@ -327,37 +614,11 @@ const PlasmicDialogTriggerContext = React__default.default.createContext(void 0)
327
614
  const PlasmicSliderContext = React__default.default.createContext(void 0);
328
615
  React__default.default.createContext(void 0);
329
616
  const PlasmicListBoxContext = React__default.default.createContext(void 0);
330
- const PlasmicPopoverContext = React__default.default.createContext(void 0);
331
617
  const PlasmicItemContext = React__default.default.createContext(void 0);
332
618
  const PlasmicSectionContext = React__default.default.createContext(void 0);
333
619
  const PlasmicHeaderContext = React__default.default.createContext(void 0);
334
620
  const PlasmicInputContext = React__default.default.createContext(void 0);
335
621
 
336
- const BaseLabel = reactAriaComponents.Label;
337
- const LABEL_COMPONENT_NAME = makeComponentName("label");
338
- function registerLabel(loader, overrides) {
339
- registerComponentHelper(
340
- loader,
341
- BaseLabel,
342
- {
343
- name: LABEL_COMPONENT_NAME,
344
- displayName: "Aria Label",
345
- importPath: "@plasmicpkgs/react-aria/skinny/registerLabel",
346
- importName: "BaseLabel",
347
- defaultStyles: {
348
- cursor: "pointer"
349
- },
350
- props: {
351
- children: {
352
- type: "slot"
353
- }
354
- },
355
- trapsFocus: true
356
- },
357
- overrides
358
- );
359
- }
360
-
361
622
  var __defProp$p = Object.defineProperty;
362
623
  var __defProps$c = Object.defineProperties;
363
624
  var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
@@ -397,7 +658,8 @@ const CHECKBOX_INTERACTION_VARIANTS = [
397
658
  "indeterminate",
398
659
  "disabled",
399
660
  "selected",
400
- "readonly"
661
+ "readonly",
662
+ "selected"
401
663
  ];
402
664
  const { interactionVariants: interactionVariants$b, withObservedValues: withObservedValues$9 } = pickAriaComponentVariants(
403
665
  CHECKBOX_INTERACTION_VARIANTS
@@ -405,9 +667,8 @@ const { interactionVariants: interactionVariants$b, withObservedValues: withObse
405
667
  function BaseCheckbox(props) {
406
668
  const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$j(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
407
669
  const contextProps = React__default.default.useContext(PlasmicCheckboxGroupContext);
408
- const isStandalone = !contextProps;
409
670
  setControlContextData == null ? void 0 : setControlContextData({
410
- isStandalone
671
+ parent: contextProps
411
672
  });
412
673
  return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Checkbox, __spreadValues$p({}, rest), ({
413
674
  isHovered,
@@ -466,14 +727,8 @@ const makeDefaultCheckboxChildren = ({
466
727
  }
467
728
  },
468
729
  {
469
- type: "component",
470
- name: LABEL_COMPONENT_NAME,
471
- props: {
472
- children: {
473
- type: "text",
474
- value: label
475
- }
476
- }
730
+ type: "text",
731
+ value: label
477
732
  }
478
733
  ]
479
734
  },
@@ -495,7 +750,7 @@ function registerCheckbox(loader, overrides) {
495
750
  importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
496
751
  importName: "BaseCheckbox",
497
752
  interactionVariants: interactionVariants$b,
498
- props: __spreadProps$c(__spreadValues$p({}, getCommonInputProps("checkbox", [
753
+ props: __spreadProps$c(__spreadValues$p({}, getCommonProps("checkbox", [
499
754
  "name",
500
755
  "isDisabled",
501
756
  "isReadOnly",
@@ -513,13 +768,15 @@ function registerCheckbox(loader, overrides) {
513
768
  },
514
769
  value: {
515
770
  type: "string",
516
- description: "The value of the input element, used when submitting an HTML form."
771
+ description: 'The value of the checkbox in "selected" state, used when submitting an HTML form.',
772
+ defaultValueHint: "on"
517
773
  },
518
774
  isSelected: {
519
775
  type: "boolean",
776
+ displayName: "Default Selected",
520
777
  editOnly: true,
521
778
  uncontrolledProp: "defaultSelected",
522
- description: "Whether the checkbox is toggled on",
779
+ description: "Whether the checkbox should be selected by default",
523
780
  defaultValueHint: false,
524
781
  defaultValue: false
525
782
  },
@@ -552,7 +809,7 @@ function registerCheckbox(loader, overrides) {
552
809
  valueProp: "isSelected",
553
810
  onChangeProp: "onChange",
554
811
  variableType: "boolean",
555
- hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
812
+ hidden: hasParent
556
813
  }
557
814
  },
558
815
  trapsFocus: true
@@ -818,6 +1075,31 @@ function registerFieldError(loader, overrides) {
818
1075
  );
819
1076
  }
820
1077
 
1078
+ const BaseLabel = reactAriaComponents.Label;
1079
+ const LABEL_COMPONENT_NAME = makeComponentName("label");
1080
+ function registerLabel(loader, overrides) {
1081
+ registerComponentHelper(
1082
+ loader,
1083
+ BaseLabel,
1084
+ {
1085
+ name: LABEL_COMPONENT_NAME,
1086
+ displayName: "Aria Label",
1087
+ importPath: "@plasmicpkgs/react-aria/skinny/registerLabel",
1088
+ importName: "BaseLabel",
1089
+ defaultStyles: {
1090
+ cursor: "pointer"
1091
+ },
1092
+ props: {
1093
+ children: {
1094
+ type: "slot"
1095
+ }
1096
+ },
1097
+ trapsFocus: true
1098
+ },
1099
+ overrides
1100
+ );
1101
+ }
1102
+
821
1103
  var __defProp$l = Object.defineProperty;
822
1104
  var __defProps$a = Object.defineProperties;
823
1105
  var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
@@ -857,8 +1139,8 @@ const { interactionVariants: interactionVariants$a, withObservedValues: withObse
857
1139
  CHECKBOX_GROUP_INTERACTION_VARIANTS
858
1140
  );
859
1141
  function BaseCheckboxGroup(props) {
860
- const _a = props, { children, updateInteractionVariant } = _a; __objRest$g(_a, ["children", "updateInteractionVariant"]);
861
- return /* @__PURE__ */ React__default.default.createElement(PlasmicCheckboxGroupContext.Provider, { value: props }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.CheckboxGroup, __spreadValues$l({}, props), ({ isDisabled, isReadOnly }) => withObservedValues$8(
1142
+ const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$g(_a, ["children", "updateInteractionVariant"]);
1143
+ return /* @__PURE__ */ React__default.default.createElement(PlasmicCheckboxGroupContext.Provider, { value: rest }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.CheckboxGroup, __spreadValues$l({}, rest), ({ isDisabled, isReadOnly }) => withObservedValues$8(
862
1144
  children,
863
1145
  {
864
1146
  disabled: isDisabled,
@@ -887,7 +1169,7 @@ function registerCheckboxGroup(loader, overrides) {
887
1169
  importPath: "@plasmicpkgs/react-aria/skinny/registerCheckboxGroup",
888
1170
  importName: "BaseCheckboxGroup",
889
1171
  interactionVariants: interactionVariants$a,
890
- props: __spreadProps$a(__spreadValues$l({}, getCommonInputProps("checkbox group", [
1172
+ props: __spreadProps$a(__spreadValues$l({}, getCommonProps("checkbox group", [
891
1173
  "name",
892
1174
  "isDisabled",
893
1175
  "isReadOnly",
@@ -1203,23 +1485,49 @@ const INPUT_INTERACTION_VARIANTS = [
1203
1485
  const { interactionVariants: interactionVariants$9 } = pickAriaComponentVariants(
1204
1486
  INPUT_INTERACTION_VARIANTS
1205
1487
  );
1488
+ const inputHelpers$1 = {
1489
+ states: {
1490
+ value: {
1491
+ onChangeArgsToValue: (e) => {
1492
+ return e.target.value;
1493
+ }
1494
+ }
1495
+ }
1496
+ };
1206
1497
  function BaseInput(props) {
1207
1498
  var _b;
1208
- const context = React__default.default.useContext(PlasmicTextFieldContext);
1209
- const isStandalone = !context;
1210
- const _a = props, { updateInteractionVariant, setControlContextData, disabled } = _a, rest = __objRest$f(_a, ["updateInteractionVariant", "setControlContextData", "disabled"]);
1499
+ const _a = props, {
1500
+ updateInteractionVariant,
1501
+ setControlContextData,
1502
+ disabled,
1503
+ autoComplete
1504
+ } = _a, rest = __objRest$f(_a, [
1505
+ "updateInteractionVariant",
1506
+ "setControlContextData",
1507
+ "disabled",
1508
+ "autoComplete"
1509
+ ]);
1510
+ const textFieldContext = React__default.default.useContext(PlasmicTextFieldContext);
1511
+ setControlContextData == null ? void 0 : setControlContextData({
1512
+ parent: textFieldContext
1513
+ });
1211
1514
  const mergedProps = reactAria.mergeProps(rest, {
1212
- disabled: (_b = context == null ? void 0 : context.isDisabled) != null ? _b : disabled
1515
+ /**
1516
+ * While react-aria internally does the merging of the disabled prop,
1517
+ * we need to explicity do it here, because react-aria does it behind the scenes,
1518
+ * whereas we need the calculated value of the disabled prop to be able to update the "disabled" interaction variant.
1519
+ * */
1520
+ disabled: (_b = textFieldContext == null ? void 0 : textFieldContext.isDisabled) != null ? _b : disabled
1213
1521
  });
1214
1522
  React.useEffect(() => {
1215
1523
  updateInteractionVariant == null ? void 0 : updateInteractionVariant({
1216
1524
  disabled: mergedProps.disabled
1217
1525
  });
1218
1526
  }, [mergedProps.disabled, updateInteractionVariant]);
1219
- setControlContextData == null ? void 0 : setControlContextData({ isStandalone });
1220
1527
  return /* @__PURE__ */ React__default.default.createElement(
1221
1528
  reactAriaComponents.Input,
1222
1529
  __spreadValues$k({
1530
+ autoComplete: resolveAutoComplete(autoComplete),
1223
1531
  onHoverChange: (isHovered) => {
1224
1532
  updateInteractionVariant == null ? void 0 : updateInteractionVariant({
1225
1533
  hovered: isHovered
@@ -1256,16 +1564,48 @@ function registerInput(loader, overrides) {
1256
1564
  borderColor: "black",
1257
1565
  padding: "2px 10px"
1258
1566
  },
1259
- props: {
1260
- placeholder: {
1261
- type: "string"
1262
- },
1263
- disabled: {
1264
- type: "boolean",
1265
- description: "Whether the input is disabled",
1266
- defaultValueHint: false,
1267
- hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
1268
- }
1567
+ props: __spreadValues$k({}, getCommonProps("Input", [
1568
+ "name",
1569
+ "disabled",
1570
+ "readOnly",
1571
+ "autoFocus",
1572
+ "aria-label",
1573
+ "required",
1574
+ "placeholder",
1575
+ "value",
1576
+ "maxLength",
1577
+ "minLength",
1578
+ "pattern",
1579
+ "type",
1580
+ "inputMode",
1581
+ "autoComplete",
1582
+ "onChange",
1583
+ "onFocus",
1584
+ "onBlur",
1585
+ "onKeyDown",
1586
+ "onKeyUp",
1587
+ "onCopy",
1588
+ "onCut",
1589
+ "onPaste",
1590
+ "onCompositionStart",
1591
+ "onCompositionEnd",
1592
+ "onCompositionUpdate",
1593
+ "onSelect",
1594
+ "onBeforeInput",
1595
+ "onInput"
1596
+ ])),
1597
+ states: {
1598
+ value: __spreadValues$k({
1599
+ type: "writable",
1600
+ valueProp: "value",
1601
+ onChangeProp: "onChange",
1602
+ variableType: "text"
1603
+ }, inputHelpers$1.states.value)
1604
+ },
1605
+ componentHelpers: {
1606
+ helpers: inputHelpers$1,
1607
+ importName: "inputHelpers",
1608
+ importPath: "@plasmicpkgs/react-aria/skinny/registerInput"
1269
1609
  },
1270
1610
  trapsFocus: true
1271
1611
  },
@@ -1502,18 +1842,17 @@ var __objRest$e = (source, exclude) => {
1502
1842
  return target;
1503
1843
  };
1504
1844
  function BaseListBox(props) {
1505
- var _c;
1506
1845
  const contextProps = React__default.default.useContext(PlasmicListBoxContext);
1507
1846
  const isStandalone = !contextProps;
1508
- const _a = props, rest = __objRest$e(_a, ["options"]);
1847
+ const _a = props, { options: _rawOptions, setControlContextData } = _a, rest = __objRest$e(_a, ["options", "setControlContextData"]);
1509
1848
  const { options } = useStrictOptions(props);
1510
1849
  const _b = utils.mergeProps(
1511
1850
  contextProps,
1512
1851
  rest,
1513
1852
  isStandalone ? { items: options } : {}
1514
1853
  ), { renderItem, renderSection } = _b, mergedProps = __objRest$e(_b, ["renderItem", "renderSection"]);
1515
- (_c = props.setControlContextData) == null ? void 0 : _c.call(props, {
1516
- isStandalone
1854
+ setControlContextData == null ? void 0 : setControlContextData({
1855
+ parent: isStandalone ? void 0 : {}
1517
1856
  });
1518
1857
  return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBox, __spreadValues$g({}, mergedProps), (item) => {
1519
1858
  var _a2;
@@ -1559,7 +1898,7 @@ function registerListBox(loader, overrides) {
1559
1898
  props: {
1560
1899
  options: __spreadProps$8(__spreadValues$g({}, makeOptionsPropType()), {
1561
1900
  displayName: "Items",
1562
- hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
1901
+ hidden: hasParent
1563
1902
  }),
1564
1903
  renderItem: {
1565
1904
  type: "slot",
@@ -1622,37 +1961,34 @@ var __objRest$d = (source, exclude) => {
1622
1961
  }
1623
1962
  return target;
1624
1963
  };
1625
- const SHOULD_FLIP_INSIDE_SELECT = false;
1626
1964
  function BasePopover(props) {
1627
1965
  const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$d(_a, ["resetClassName", "setControlContextData"]);
1628
1966
  const isStandalone = !React__default.default.useContext(reactAriaComponents.PopoverContext);
1629
- const contextProps = React__default.default.useContext(PlasmicPopoverContext);
1630
1967
  const isInsideSelect = !!React__default.default.useContext(reactAriaComponents.SelectContext);
1968
+ const triggerRef = React__default.default.useRef(null);
1969
+ const isEditMode = !!host.usePlasmicCanvasContext();
1970
+ const defaultShouldFlip = isInsideSelect ? false : true;
1631
1971
  const mergedProps = utils.mergeProps(
1632
- contextProps,
1972
+ { shouldFlip: defaultShouldFlip },
1973
+ /**
1974
+ * isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies. *
1975
+ *
1976
+ * 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.
1977
+ */
1978
+ isEditMode ? { isNonModal: true } : null,
1633
1979
  restProps,
1634
- {
1635
- className: `${resetClassName}`
1636
- },
1637
- isInsideSelect && !isDefined(restProps.shouldFlip) ? { shouldFlip: SHOULD_FLIP_INSIDE_SELECT } : void 0
1980
+ { className: `${resetClassName}` },
1981
+ // Override some props if the popover is standalone
1982
+ isStandalone ? {
1983
+ triggerRef,
1984
+ isNonModal: true,
1985
+ isOpen: true
1986
+ } : null
1638
1987
  );
1639
- const isEditMode = !!host.usePlasmicCanvasContext();
1640
- const triggerRef = React__default.default.useRef(null);
1641
- const standaloneProps = isStandalone ? {
1642
- triggerRef,
1643
- isNonModal: true,
1644
- isOpen: true
1645
- } : {};
1646
1988
  setControlContextData == null ? void 0 : setControlContextData({
1647
- isStandalone,
1648
- isInsideSelect
1989
+ defaultShouldFlip
1649
1990
  });
1650
- return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isStandalone && /* @__PURE__ */ React__default.default.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React__default.default.createElement(
1651
- reactAriaComponents.Popover,
1652
- __spreadValues$f(__spreadValues$f({
1653
- isNonModal: isEditMode ? true : void 0
1654
- }, mergedProps), standaloneProps)
1655
- ));
1991
+ return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isStandalone && /* @__PURE__ */ React__default.default.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Popover, __spreadValues$f({}, mergedProps)));
1656
1992
  }
1657
1993
  const POPOVER_COMPONENT_NAME = makeComponentName("popover");
1658
1994
  const POPOVER_ARROW_IMG = {
@@ -1726,7 +2062,10 @@ function registerPopover(loader, overrides) {
1726
2062
  shouldFlip: {
1727
2063
  type: "boolean",
1728
2064
  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.",
1729
- defaultValueHint: (_ps, ctx) => (ctx == null ? void 0 : ctx.isInsideSelect) ? SHOULD_FLIP_INSIDE_SELECT : true
2065
+ defaultValueHint: (_ps, ctx) => {
2066
+ var _a;
2067
+ return (_a = ctx == null ? void 0 : ctx.defaultShouldFlip) != null ? _a : true;
2068
+ }
1730
2069
  },
1731
2070
  placement: {
1732
2071
  type: "choice",
@@ -2169,7 +2508,7 @@ const BaseModal = React.forwardRef(
2169
2508
  isOpen: isStandalone ? isOpen : contextProps.isOpen
2170
2509
  });
2171
2510
  setControlContextData == null ? void 0 : setControlContextData({
2172
- isStandalone
2511
+ parent: isStandalone ? void 0 : {}
2173
2512
  });
2174
2513
  React.useImperativeHandle(ref, () => ({
2175
2514
  close: () => {
@@ -2279,7 +2618,7 @@ function registerModal(loader, overrides) {
2279
2618
  uncontrolledProp: "defaultOpen",
2280
2619
  defaultValueHint: false,
2281
2620
  defaultValue: true,
2282
- hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
2621
+ hidden: hasParent
2283
2622
  },
2284
2623
  isDismissable: {
2285
2624
  type: "boolean",
@@ -2300,7 +2639,7 @@ function registerModal(loader, overrides) {
2300
2639
  valueProp: "isOpen",
2301
2640
  onChangeProp: "onOpenChange",
2302
2641
  variableType: "boolean",
2303
- hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
2642
+ hidden: hasParent
2304
2643
  }
2305
2644
  },
2306
2645
  trapsFocus: true
@@ -2517,14 +2856,19 @@ const RADIO_INTERACTION_VARIANTS = [
2517
2856
  "focused",
2518
2857
  "focusVisible",
2519
2858
  "disabled",
2520
- "readonly"
2859
+ "readonly",
2860
+ "selected"
2521
2861
  ];
2522
2862
  const { interactionVariants: interactionVariants$8, withObservedValues: withObservedValues$7 } = pickAriaComponentVariants(
2523
2863
  RADIO_INTERACTION_VARIANTS
2524
2864
  );
2525
2865
  function BaseRadio(props) {
2526
- const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$9(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
2866
+ const _a = props, { children, setControlContextData, updateInteractionVariant } = _a, rest = __objRest$9(_a, ["children", "setControlContextData", "updateInteractionVariant"]);
2527
2867
  const contextProps = React__default.default.useContext(PlasmicRadioGroupContext);
2868
+ const isStandalone = !contextProps;
2869
+ setControlContextData == null ? void 0 : setControlContextData({
2870
+ parent: contextProps
2871
+ });
2528
2872
  const radio = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Radio, __spreadValues$a({}, rest), ({
2529
2873
  isHovered,
2530
2874
  isPressed,
@@ -2546,11 +2890,10 @@ function BaseRadio(props) {
2546
2890
  },
2547
2891
  updateInteractionVariant
2548
2892
  ));
2549
- const isStandalone = !contextProps;
2550
- setControlContextData == null ? void 0 : setControlContextData({
2551
- isStandalone
2552
- });
2553
- return /* @__PURE__ */ React__default.default.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.RadioGroup, null, radio) }, radio);
2893
+ if (isStandalone) {
2894
+ return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.RadioGroup, null, radio);
2895
+ }
2896
+ return radio;
2554
2897
  }
2555
2898
  const makeDefaultRadioChildren = (label) => ({
2556
2899
  type: "hbox",
@@ -2594,7 +2937,7 @@ function registerRadio(loader, overrides) {
2594
2937
  importPath: "@plasmicpkgs/react-aria/skinny/registerRadio",
2595
2938
  importName: "BaseRadio",
2596
2939
  interactionVariants: interactionVariants$8,
2597
- props: __spreadProps$5(__spreadValues$a({}, getCommonInputProps("radio", [
2940
+ props: __spreadProps$5(__spreadValues$a({}, getCommonProps("radio", [
2598
2941
  "isDisabled",
2599
2942
  "autoFocus",
2600
2943
  "aria-label"
@@ -2607,23 +2950,8 @@ function registerRadio(loader, overrides) {
2607
2950
  value: {
2608
2951
  type: "string",
2609
2952
  description: "The value of the input element, used when submitting an HTML form."
2610
- },
2611
- // Keeping for backwards compatibility reasons
2612
- onSelectionChange: {
2613
- type: "eventHandler",
2614
- argTypes: [{ name: "isSelected", type: "boolean" }],
2615
- hidden: () => true
2616
2953
  }
2617
2954
  }),
2618
- states: {
2619
- // Keeping for backwards compatibility reasons
2620
- isSelected: {
2621
- type: "readonly",
2622
- onChangeProp: "onSelectionChange",
2623
- variableType: "boolean",
2624
- hidden: () => true
2625
- }
2626
- },
2627
2955
  trapsFocus: true
2628
2956
  },
2629
2957
  overrides
@@ -2697,7 +3025,7 @@ function registerRadioGroup(loader, overrides) {
2697
3025
  importPath: "@plasmicpkgs/react-aria/skinny/registerRadioGroup",
2698
3026
  importName: "BaseRadioGroup",
2699
3027
  interactionVariants: interactionVariants$7,
2700
- props: __spreadProps$4(__spreadValues$9({}, getCommonInputProps("radio group", [
3028
+ props: __spreadProps$4(__spreadValues$9({}, getCommonProps("radio group", [
2701
3029
  "name",
2702
3030
  "isDisabled",
2703
3031
  "isReadOnly",
@@ -2768,6 +3096,7 @@ function registerRadioGroup(loader, overrides) {
2768
3096
  value: {
2769
3097
  type: "string",
2770
3098
  editOnly: true,
3099
+ displayName: "Default Value",
2771
3100
  uncontrolledProp: "defaultValue",
2772
3101
  description: "The current value"
2773
3102
  },
@@ -3228,7 +3557,7 @@ function registerSliderThumb(loader, overrides) {
3228
3557
  cursor: "pointer"
3229
3558
  },
3230
3559
  interactionVariants: interactionVariants$5,
3231
- props: __spreadProps$3(__spreadValues$6({}, getCommonInputProps("slider thumb", [
3560
+ props: __spreadProps$3(__spreadValues$6({}, getCommonProps("slider thumb", [
3232
3561
  "name",
3233
3562
  "isDisabled",
3234
3563
  "autoFocus"
@@ -3552,7 +3881,7 @@ function registerSlider(loader, overrides) {
3552
3881
  defaultStyles: {
3553
3882
  width: "300px"
3554
3883
  },
3555
- props: __spreadProps$2(__spreadValues$4({}, getCommonInputProps("slider", [
3884
+ props: __spreadProps$2(__spreadValues$4({}, getCommonProps("slider", [
3556
3885
  "isDisabled",
3557
3886
  "name",
3558
3887
  "autoFocus",
@@ -3778,7 +4107,7 @@ function registerSwitch(loader, overrides) {
3778
4107
  justifyContent: "flex-start",
3779
4108
  padding: 0
3780
4109
  },
3781
- props: __spreadProps$1(__spreadValues$3({}, getCommonInputProps("switch", [
4110
+ props: __spreadProps$1(__spreadValues$3({}, getCommonProps("switch", [
3782
4111
  "name",
3783
4112
  "isDisabled",
3784
4113
  "isReadOnly",
@@ -3857,10 +4186,16 @@ function registerSwitch(loader, overrides) {
3857
4186
  ]
3858
4187
  },
3859
4188
  value: {
4189
+ type: "string",
4190
+ description: 'The value of the switch in "selected" state, used when submitting an HTML form.',
4191
+ defaultValueHint: "on"
4192
+ },
4193
+ isSelected: {
3860
4194
  type: "boolean",
3861
4195
  editOnly: true,
4196
+ displayName: "Default Selected",
3862
4197
  uncontrolledProp: "defaultSelected",
3863
- description: "Whether the switch is toggled on",
4198
+ description: "Whether the switch should be selected by default",
3864
4199
  defaultValueHint: false
3865
4200
  },
3866
4201
  onChange: {
@@ -3871,7 +4206,7 @@ function registerSwitch(loader, overrides) {
3871
4206
  states: {
3872
4207
  isSelected: {
3873
4208
  type: "writable",
3874
- valueProp: "value",
4209
+ valueProp: "isSelected",
3875
4210
  onChangeProp: "onChange",
3876
4211
  variableType: "boolean"
3877
4212
  }
@@ -3918,20 +4253,30 @@ const TEXTAREA_INTERACTION_VARIANTS = [
3918
4253
  const { interactionVariants: interactionVariants$1 } = pickAriaComponentVariants(
3919
4254
  TEXTAREA_INTERACTION_VARIANTS
3920
4255
  );
4256
+ const inputHelpers = {
4257
+ states: {
4258
+ value: {
4259
+ onChangeArgsToValue: (e) => {
4260
+ return e.target.value;
4261
+ }
4262
+ }
4263
+ }
4264
+ };
3921
4265
  function BaseTextArea(props) {
3922
4266
  var _b;
3923
4267
  const _a = props, { disabled, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$2(_a, ["disabled", "updateInteractionVariant", "setControlContextData"]);
3924
- const context = React__default.default.useContext(PlasmicTextFieldContext);
3925
- const isStandalone = !context;
4268
+ const textFieldContext = React__default.default.useContext(PlasmicTextFieldContext);
3926
4269
  const mergedProps = reactAria.mergeProps(rest, {
3927
- disabled: (_b = context == null ? void 0 : context.isDisabled) != null ? _b : disabled
4270
+ disabled: (_b = textFieldContext == null ? void 0 : textFieldContext.isDisabled) != null ? _b : disabled
3928
4271
  });
3929
4272
  React.useEffect(() => {
3930
4273
  updateInteractionVariant == null ? void 0 : updateInteractionVariant({
3931
4274
  disabled: mergedProps.disabled
3932
4275
  });
3933
4276
  }, [mergedProps.disabled, updateInteractionVariant]);
3934
- setControlContextData == null ? void 0 : setControlContextData({ isStandalone });
4277
+ setControlContextData == null ? void 0 : setControlContextData({
4278
+ parent: textFieldContext
4279
+ });
3935
4280
  return /* @__PURE__ */ React__default.default.createElement(
3936
4281
  reactAriaComponents.TextArea,
3937
4282
  __spreadValues$2({
@@ -3963,36 +4308,45 @@ function registerTextArea(loader, overrides) {
3963
4308
  importPath: "@plasmicpkgs/react-aria/skinny/registerTextArea",
3964
4309
  importName: "BaseTextArea",
3965
4310
  interactionVariants: interactionVariants$1,
3966
- props: {
3967
- placeholder: {
3968
- type: "string"
3969
- },
3970
- disabled: {
3971
- type: "boolean",
3972
- description: "Whether the input is disabled",
3973
- defaultValueHint: false,
3974
- hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
3975
- },
3976
- onKeyDown: {
3977
- type: "eventHandler",
3978
- argTypes: [{ name: "keyboardEvent", type: "object" }]
3979
- },
3980
- onKeyUp: {
3981
- type: "eventHandler",
3982
- argTypes: [{ name: "keyboardEvent", type: "object" }]
3983
- },
3984
- onCopy: {
3985
- type: "eventHandler",
3986
- argTypes: [{ name: "clipbordEvent", type: "object" }]
3987
- },
3988
- onCut: {
3989
- type: "eventHandler",
3990
- argTypes: [{ name: "clipbordEvent", type: "object" }]
3991
- },
3992
- onPaste: {
3993
- type: "eventHandler",
3994
- argTypes: [{ name: "clipbordEvent", type: "object" }]
3995
- }
4311
+ props: __spreadValues$2({}, getCommonProps("Text Area", [
4312
+ "name",
4313
+ "disabled",
4314
+ "readOnly",
4315
+ "autoFocus",
4316
+ "aria-label",
4317
+ "required",
4318
+ "placeholder",
4319
+ "value",
4320
+ "maxLength",
4321
+ "minLength",
4322
+ "inputMode",
4323
+ "onChange",
4324
+ "onFocus",
4325
+ "onBlur",
4326
+ "onKeyDown",
4327
+ "onKeyUp",
4328
+ "onCopy",
4329
+ "onCut",
4330
+ "onPaste",
4331
+ "onCompositionStart",
4332
+ "onCompositionEnd",
4333
+ "onCompositionUpdate",
4334
+ "onSelect",
4335
+ "onBeforeInput",
4336
+ "onInput"
4337
+ ])),
4338
+ states: {
4339
+ value: __spreadValues$2({
4340
+ type: "writable",
4341
+ valueProp: "value",
4342
+ onChangeProp: "onChange",
4343
+ variableType: "text"
4344
+ }, inputHelpers.states.value)
4345
+ },
4346
+ componentHelpers: {
4347
+ helpers: inputHelpers,
4348
+ importName: "inputHelpers",
4349
+ importPath: "@plasmicpkgs/react-aria/skinny/registerTextArea"
3996
4350
  },
3997
4351
  trapsFocus: true
3998
4352
  },
@@ -4039,31 +4393,15 @@ const { interactionVariants, withObservedValues } = pickAriaComponentVariants(
4039
4393
  TEXT_FIELD_INTERACTION_VARIANTS
4040
4394
  );
4041
4395
  function BaseTextField(props) {
4042
- const _a = props, {
4043
- enableAutoComplete,
4044
- autoComplete,
4396
+ const _a = props, { children, updateInteractionVariant, autoComplete } = _a, rest = __objRest$1(_a, ["children", "updateInteractionVariant", "autoComplete"]);
4397
+ return /* @__PURE__ */ React__default.default.createElement(PlasmicTextFieldContext.Provider, { value: props }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.TextField, __spreadValues$1({ autoComplete: resolveAutoComplete(autoComplete) }, rest), ({ isDisabled, isReadOnly }) => withObservedValues(
4045
4398
  children,
4399
+ {
4400
+ disabled: isDisabled,
4401
+ readonly: isReadOnly
4402
+ },
4046
4403
  updateInteractionVariant
4047
- } = _a, rest = __objRest$1(_a, [
4048
- "enableAutoComplete",
4049
- "autoComplete",
4050
- "children",
4051
- "updateInteractionVariant"
4052
- ]);
4053
- return /* @__PURE__ */ React__default.default.createElement(PlasmicTextFieldContext.Provider, { value: props }, /* @__PURE__ */ React__default.default.createElement(
4054
- reactAriaComponents.TextField,
4055
- __spreadValues$1({
4056
- autoComplete: enableAutoComplete ? autoComplete : void 0
4057
- }, rest),
4058
- ({ isDisabled, isReadOnly }) => withObservedValues(
4059
- children,
4060
- {
4061
- disabled: isDisabled,
4062
- readonly: isReadOnly
4063
- },
4064
- updateInteractionVariant
4065
- )
4066
- ));
4404
+ )));
4067
4405
  }
4068
4406
  const TEXT_FIELD_COMPONENT_NAME = makeComponentName("textField");
4069
4407
  function registerTextField(loader, overrides) {
@@ -4077,13 +4415,36 @@ function registerTextField(loader, overrides) {
4077
4415
  importName: "BaseTextField",
4078
4416
  interactionVariants,
4079
4417
  // TODO: Support for validate prop
4080
- props: __spreadProps(__spreadValues$1({}, getCommonInputProps("input", [
4418
+ props: __spreadProps(__spreadValues$1({}, getCommonProps("Text Field", [
4081
4419
  "name",
4082
4420
  "isDisabled",
4083
4421
  "isReadOnly",
4084
4422
  "autoFocus",
4085
4423
  "aria-label",
4086
- "isRequired"
4424
+ "isRequired",
4425
+ "value",
4426
+ "maxLength",
4427
+ "minLength",
4428
+ "pattern",
4429
+ "type",
4430
+ "inputMode",
4431
+ "validationBehavior",
4432
+ "autoComplete",
4433
+ "onChange",
4434
+ "onFocus",
4435
+ "onBlur",
4436
+ "onFocusChange",
4437
+ "onKeyDown",
4438
+ "onKeyUp",
4439
+ "onCopy",
4440
+ "onCut",
4441
+ "onPaste",
4442
+ "onCompositionStart",
4443
+ "onCompositionEnd",
4444
+ "onCompositionUpdate",
4445
+ "onSelect",
4446
+ "onBeforeInput",
4447
+ "onInput"
4087
4448
  ])), {
4088
4449
  children: {
4089
4450
  type: "slot",
@@ -4127,12 +4488,6 @@ function registerTextField(loader, overrides) {
4127
4488
  ]
4128
4489
  }
4129
4490
  },
4130
- value: {
4131
- type: "string",
4132
- editOnly: true,
4133
- uncontrolledProp: "defaultValue",
4134
- description: "The current value"
4135
- },
4136
4491
  isInvalid: {
4137
4492
  // TODO: Not sure if needed
4138
4493
  displayName: "Invalid",
@@ -4144,190 +4499,8 @@ function registerTextField(loader, overrides) {
4144
4499
  // TODO: Not sure if needed
4145
4500
  type: "array",
4146
4501
  description: "Errors for custom validation"
4147
- },
4148
- // validate: {
4149
- // type: "function" as const,
4150
- // argNames: ["value"],
4151
- // argValues: (_ps: any, ctx: any) => [ctx.data[0]],
4152
- // },
4153
- enableAutoComplete: {
4154
- type: "boolean",
4155
- description: "Whether the browser is allowed to automatically complete the input",
4156
- defaultValueHint: false
4157
- },
4158
- autoComplete: {
4159
- type: "choice",
4160
- hidden: ({ enableAutoComplete }) => !enableAutoComplete,
4161
- description: "Guidance as to the type of data expected in the field",
4162
- helpText: "For explanations on what each of the values mean, check https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values",
4163
- options: [
4164
- "name",
4165
- "honorific-prefix",
4166
- "given-name",
4167
- "additional-name",
4168
- "family-name",
4169
- "honorific-suffix",
4170
- "nickname",
4171
- "email",
4172
- "username",
4173
- "new-password",
4174
- "current-password",
4175
- "one-time-code",
4176
- "organization-title",
4177
- "organization",
4178
- "street-address",
4179
- "shipping",
4180
- "billing",
4181
- "address-line1",
4182
- "address-line2",
4183
- "address-line3",
4184
- "address-level4",
4185
- "address-level3",
4186
- "address-level2",
4187
- "address-level1",
4188
- "country",
4189
- "country-name",
4190
- "postal-code",
4191
- "cc-name",
4192
- "cc-given-name",
4193
- "cc-additional-name",
4194
- "cc-family-name",
4195
- "cc-number",
4196
- "cc-exp",
4197
- "cc-exp-month",
4198
- "cc-exp-year",
4199
- "cc-csc",
4200
- "cc-type",
4201
- "transaction-currency",
4202
- "transaction-amount",
4203
- "language",
4204
- "bday",
4205
- "bday-day",
4206
- "bday-month",
4207
- "bday-year",
4208
- "sex",
4209
- "tel",
4210
- "tel-country-code",
4211
- "tel-national",
4212
- "tel-area-code",
4213
- "tel-local",
4214
- "tel-local-suffix",
4215
- "tel-local-prefix",
4216
- "tel-extension",
4217
- "impp",
4218
- "url",
4219
- "photo",
4220
- "webauthn"
4221
- ]
4222
- },
4223
- maxLength: {
4224
- type: "number",
4225
- description: "The maximum number of characters supported by the input"
4226
- },
4227
- minLength: {
4228
- type: "number",
4229
- description: "The minimum number of characters supported by the input"
4230
- },
4231
- pattern: {
4232
- type: "string",
4233
- description: "Regex pattern that the value of the input must match to be valid",
4234
- helpText: "For more information about writing Regular Expressions (regex), check out https://regexr.com/",
4235
- validator: (value) => {
4236
- try {
4237
- new RegExp(value);
4238
- return true;
4239
- } catch (error) {
4240
- return "Invalid Regex";
4241
- }
4242
- }
4243
- },
4244
- type: {
4245
- type: "choice",
4246
- defaultValueHint: "text",
4247
- options: ["text", "search", "url", "tel", "email", "password"]
4248
- },
4249
- inputMode: {
4250
- type: "choice",
4251
- description: "hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.",
4252
- options: [
4253
- "none",
4254
- "text",
4255
- "tel",
4256
- "url",
4257
- "email",
4258
- "numeric",
4259
- "decimal",
4260
- "search"
4261
- ]
4262
- },
4263
- validationBehavior: {
4264
- type: "choice",
4265
- options: ["native", "aria"],
4266
- 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.",
4267
- defaultValueHint: "native"
4268
- },
4269
- onChange: {
4270
- type: "eventHandler",
4271
- argTypes: [{ name: "value", type: "string" }]
4272
- },
4273
- onFocus: {
4274
- type: "eventHandler",
4275
- argTypes: [{ name: "focusEvent", type: "object" }]
4276
- },
4277
- onBlur: {
4278
- type: "eventHandler",
4279
- argTypes: [{ name: "focusEvent", type: "object" }]
4280
- },
4281
- onFocusChange: {
4282
- type: "eventHandler",
4283
- argTypes: [{ name: "isFocused", type: "boolean" }]
4284
- },
4285
- onKeyDown: {
4286
- type: "eventHandler",
4287
- argTypes: [{ name: "keyboardEvent", type: "object" }]
4288
- },
4289
- onKeyUp: {
4290
- type: "eventHandler",
4291
- argTypes: [{ name: "keyboardEvent", type: "object" }]
4292
- },
4293
- onCopy: {
4294
- type: "eventHandler",
4295
- argTypes: [{ name: "clipbordEvent", type: "object" }]
4296
- },
4297
- onCut: {
4298
- type: "eventHandler",
4299
- argTypes: [{ name: "clipbordEvent", type: "object" }]
4300
- },
4301
- onPaste: {
4302
- type: "eventHandler",
4303
- argTypes: [{ name: "clipbordEvent", type: "object" }]
4304
- },
4305
- onCompositionStart: {
4306
- type: "eventHandler",
4307
- argTypes: [{ name: "compositionEvent", type: "object" }]
4308
- },
4309
- onCompositionEnd: {
4310
- type: "eventHandler",
4311
- argTypes: [{ name: "compositionEvent", type: "object" }]
4312
- },
4313
- onCompositionUpdate: {
4314
- type: "eventHandler",
4315
- argTypes: [{ name: "compositionEvent", type: "object" }]
4316
- },
4317
- onSelect: {
4318
- type: "eventHandler",
4319
- argTypes: [{ name: "selectionEvent", type: "object" }]
4320
- },
4321
- onBeforeInput: {
4322
- type: "eventHandler",
4323
- argTypes: [{ name: "inputEvent", type: "object" }]
4324
- },
4325
- onInput: {
4326
- type: "eventHandler",
4327
- argTypes: [{ name: "inputEvent", type: "object" }]
4328
4502
  }
4329
4503
  }),
4330
- // NOTE: React-Aria does not support render props for <Input> and <Textarea>, so focusVisible and inputHovered states are not implemented
4331
4504
  states: {
4332
4505
  value: {
4333
4506
  type: "writable",