@plasmicpkgs/react-aria 0.0.12 → 0.0.13

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 (52) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/contexts.d.ts +1 -1
  3. package/dist/react-aria.esm.js +897 -189
  4. package/dist/react-aria.esm.js.map +1 -1
  5. package/dist/react-aria.js +895 -187
  6. package/dist/react-aria.js.map +1 -1
  7. package/dist/registerCheckbox.d.ts +10 -0
  8. package/dist/registerCheckboxGroup.d.ts +5 -0
  9. package/dist/registerDescription.d.ts +3 -0
  10. package/dist/registerFieldError.d.ts +19 -0
  11. package/dist/registerLabel.d.ts +2 -3
  12. package/dist/registerRadio.d.ts +10 -0
  13. package/dist/registerRadioGroup.d.ts +9 -0
  14. package/dist/registerText.d.ts +5 -0
  15. package/package.json +2 -2
  16. package/skinny/contexts.d.ts +1 -1
  17. package/skinny/registerCheckbox.cjs.js +158 -0
  18. package/skinny/registerCheckbox.cjs.js.map +1 -0
  19. package/skinny/registerCheckbox.d.ts +10 -0
  20. package/skinny/registerCheckbox.esm.js +151 -0
  21. package/skinny/registerCheckbox.esm.js.map +1 -0
  22. package/skinny/registerCheckboxGroup.cjs.js +113 -0
  23. package/skinny/registerCheckboxGroup.cjs.js.map +1 -0
  24. package/skinny/registerCheckboxGroup.d.ts +5 -0
  25. package/skinny/registerCheckboxGroup.esm.js +110 -0
  26. package/skinny/registerCheckboxGroup.esm.js.map +1 -0
  27. package/skinny/registerDescription.cjs.js +38 -0
  28. package/skinny/registerDescription.cjs.js.map +1 -0
  29. package/skinny/registerDescription.d.ts +3 -0
  30. package/skinny/registerDescription.esm.js +36 -0
  31. package/skinny/registerDescription.esm.js.map +1 -0
  32. package/skinny/registerFieldError.d.ts +19 -0
  33. package/skinny/registerLabel.cjs.js +2 -24
  34. package/skinny/registerLabel.cjs.js.map +1 -1
  35. package/skinny/registerLabel.d.ts +2 -3
  36. package/skinny/registerLabel.esm.js +2 -20
  37. package/skinny/registerLabel.esm.js.map +1 -1
  38. package/skinny/registerRadio.cjs.js +146 -0
  39. package/skinny/registerRadio.cjs.js.map +1 -0
  40. package/skinny/registerRadio.d.ts +10 -0
  41. package/skinny/registerRadio.esm.js +139 -0
  42. package/skinny/registerRadio.esm.js.map +1 -0
  43. package/skinny/registerRadioGroup.cjs.js +142 -0
  44. package/skinny/registerRadioGroup.cjs.js.map +1 -0
  45. package/skinny/registerRadioGroup.d.ts +9 -0
  46. package/skinny/registerRadioGroup.esm.js +135 -0
  47. package/skinny/registerRadioGroup.esm.js.map +1 -0
  48. package/skinny/registerText.cjs.js +69 -0
  49. package/skinny/registerText.cjs.js.map +1 -0
  50. package/skinny/registerText.d.ts +5 -0
  51. package/skinny/registerText.esm.js +62 -0
  52. package/skinny/registerText.esm.js.map +1 -0
@@ -1,9 +1,9 @@
1
1
  import React, { useEffect } from 'react';
2
- import { Button, ComboBox, ComboBoxStateContext, Form, Input, Label, ListBoxItem, ListBox, PopoverContext, Popover, Header, Section, Collection, SelectValue, Select, Switch } from 'react-aria-components';
2
+ import { Button, Checkbox, Text, FieldError, Label, CheckboxGroup, ComboBox, ComboBoxStateContext, Form, Input, ListBoxItem, ListBox, PopoverContext, Popover, Radio, RadioGroup, Header, Section, Collection, SelectValue, Select, Switch } from 'react-aria-components';
3
3
  import registerComponent from '@plasmicapp/host/registerComponent';
4
4
  import { useFilter } from '@react-aria/i18n';
5
5
  import { mergeProps } from '@react-aria/utils';
6
- import { usePlasmicCanvasContext } from '@plasmicapp/host';
6
+ import { usePlasmicCanvasContext, DataProvider } from '@plasmicapp/host';
7
7
 
8
8
  function getCommonInputProps(fieldName, fields) {
9
9
  const commonInputProps = {
@@ -55,25 +55,25 @@ function getCommonInputProps(fieldName, fields) {
55
55
  return filteredProps;
56
56
  }
57
57
 
58
- var __defProp$c = Object.defineProperty;
59
- var __defProps$5 = Object.defineProperties;
60
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
61
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
62
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
63
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
64
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
65
- var __spreadValues$c = (a, b) => {
58
+ var __defProp$i = Object.defineProperty;
59
+ var __defProps$a = Object.defineProperties;
60
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
61
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
62
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
63
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
64
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
65
+ var __spreadValues$i = (a, b) => {
66
66
  for (var prop in b || (b = {}))
67
- if (__hasOwnProp$c.call(b, prop))
68
- __defNormalProp$c(a, prop, b[prop]);
69
- if (__getOwnPropSymbols$c)
70
- for (var prop of __getOwnPropSymbols$c(b)) {
71
- if (__propIsEnum$c.call(b, prop))
72
- __defNormalProp$c(a, prop, b[prop]);
67
+ if (__hasOwnProp$i.call(b, prop))
68
+ __defNormalProp$i(a, prop, b[prop]);
69
+ if (__getOwnPropSymbols$i)
70
+ for (var prop of __getOwnPropSymbols$i(b)) {
71
+ if (__propIsEnum$i.call(b, prop))
72
+ __defNormalProp$i(a, prop, b[prop]);
73
73
  }
74
74
  return a;
75
75
  };
76
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
76
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
77
77
  function ValueObserver({ value, onChange }) {
78
78
  useEffect(() => {
79
79
  onChange(value);
@@ -82,8 +82,8 @@ function ValueObserver({ value, onChange }) {
82
82
  }
83
83
  function registerComponentHelper(loader, component, meta, overrides) {
84
84
  if (overrides) {
85
- meta = __spreadProps$5(__spreadValues$c(__spreadValues$c({}, meta), overrides), {
86
- props: __spreadValues$c(__spreadValues$c({}, meta.props), overrides.props)
85
+ meta = __spreadProps$a(__spreadValues$i(__spreadValues$i({}, meta), overrides), {
86
+ props: __spreadValues$i(__spreadValues$i({}, meta.props), overrides.props)
87
87
  });
88
88
  if (overrides.parentComponentName) {
89
89
  meta.name = makeChildComponentName(
@@ -121,41 +121,41 @@ function withoutNils(array) {
121
121
  return array.filter((x) => x != null);
122
122
  }
123
123
 
124
- var __defProp$b = Object.defineProperty;
125
- var __defProps$4 = Object.defineProperties;
126
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
127
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
128
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
129
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
130
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
131
- var __spreadValues$b = (a, b) => {
124
+ var __defProp$h = Object.defineProperty;
125
+ var __defProps$9 = Object.defineProperties;
126
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
127
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
128
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
129
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
130
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
131
+ var __spreadValues$h = (a, b) => {
132
132
  for (var prop in b || (b = {}))
133
- if (__hasOwnProp$b.call(b, prop))
134
- __defNormalProp$b(a, prop, b[prop]);
135
- if (__getOwnPropSymbols$b)
136
- for (var prop of __getOwnPropSymbols$b(b)) {
137
- if (__propIsEnum$b.call(b, prop))
138
- __defNormalProp$b(a, prop, b[prop]);
133
+ if (__hasOwnProp$h.call(b, prop))
134
+ __defNormalProp$h(a, prop, b[prop]);
135
+ if (__getOwnPropSymbols$h)
136
+ for (var prop of __getOwnPropSymbols$h(b)) {
137
+ if (__propIsEnum$h.call(b, prop))
138
+ __defNormalProp$h(a, prop, b[prop]);
139
139
  }
140
140
  return a;
141
141
  };
142
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
143
- var __objRest$4 = (source, exclude) => {
142
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
143
+ var __objRest$9 = (source, exclude) => {
144
144
  var target = {};
145
145
  for (var prop in source)
146
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
146
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
147
147
  target[prop] = source[prop];
148
- if (source != null && __getOwnPropSymbols$b)
149
- for (var prop of __getOwnPropSymbols$b(source)) {
150
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
148
+ if (source != null && __getOwnPropSymbols$h)
149
+ for (var prop of __getOwnPropSymbols$h(source)) {
150
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
151
151
  target[prop] = source[prop];
152
152
  }
153
153
  return target;
154
154
  };
155
155
  function BaseButton(props) {
156
- const _a = props, { submitsForm, onFocusVisibleChange, resetsForm, children } = _a, rest = __objRest$4(_a, ["submitsForm", "onFocusVisibleChange", "resetsForm", "children"]);
156
+ const _a = props, { submitsForm, onFocusVisibleChange, resetsForm, children } = _a, rest = __objRest$9(_a, ["submitsForm", "onFocusVisibleChange", "resetsForm", "children"]);
157
157
  const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
158
- return /* @__PURE__ */ React.createElement(Button, __spreadValues$b({ type }, rest), ({ isFocusVisible }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
158
+ return /* @__PURE__ */ React.createElement(Button, __spreadValues$h({ type }, rest), ({ isFocusVisible }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
159
159
  ValueObserver,
160
160
  {
161
161
  value: isFocusVisible,
@@ -172,7 +172,7 @@ function registerButton(loader, overrides) {
172
172
  displayName: "BaseButton",
173
173
  importPath: "@plasmicpkgs/react-aria/registerButton",
174
174
  importName: "BaseButton",
175
- props: __spreadProps$4(__spreadValues$b({}, getCommonInputProps("button", [
175
+ props: __spreadProps$9(__spreadValues$h({}, getCommonInputProps("button", [
176
176
  "isDisabled",
177
177
  "aria-label",
178
178
  "children"
@@ -242,6 +242,499 @@ function registerButton(loader, overrides) {
242
242
  );
243
243
  }
244
244
 
245
+ var __defProp$g = Object.defineProperty;
246
+ var __defProps$8 = Object.defineProperties;
247
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
248
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
249
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
250
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
251
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
252
+ var __spreadValues$g = (a, b) => {
253
+ for (var prop in b || (b = {}))
254
+ if (__hasOwnProp$g.call(b, prop))
255
+ __defNormalProp$g(a, prop, b[prop]);
256
+ if (__getOwnPropSymbols$g)
257
+ for (var prop of __getOwnPropSymbols$g(b)) {
258
+ if (__propIsEnum$g.call(b, prop))
259
+ __defNormalProp$g(a, prop, b[prop]);
260
+ }
261
+ return a;
262
+ };
263
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
264
+ var __objRest$8 = (source, exclude) => {
265
+ var target = {};
266
+ for (var prop in source)
267
+ if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
268
+ target[prop] = source[prop];
269
+ if (source != null && __getOwnPropSymbols$g)
270
+ for (var prop of __getOwnPropSymbols$g(source)) {
271
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
272
+ target[prop] = source[prop];
273
+ }
274
+ return target;
275
+ };
276
+ function BaseCheckbox(props) {
277
+ const _a = props, { children, onPressChange, onFocusVisibleChange } = _a, rest = __objRest$8(_a, ["children", "onPressChange", "onFocusVisibleChange"]);
278
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Checkbox, __spreadValues$g({}, rest), ({ isFocusVisible, isPressed }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
279
+ ValueObserver,
280
+ {
281
+ value: isFocusVisible,
282
+ onChange: onFocusVisibleChange
283
+ }
284
+ ), /* @__PURE__ */ React.createElement(ValueObserver, { value: isPressed, onChange: onPressChange }), children)));
285
+ }
286
+ function registerCheckbox(loader, overrides) {
287
+ registerComponentHelper(
288
+ loader,
289
+ BaseCheckbox,
290
+ {
291
+ name: makeComponentName("checkbox"),
292
+ displayName: "BaseCheckbox",
293
+ importPath: "@plasmicpkgs/react-aria/registerCheckbox",
294
+ importName: "BaseCheckbox",
295
+ props: __spreadProps$8(__spreadValues$g({}, getCommonInputProps("checkbox", [
296
+ "name",
297
+ "isDisabled",
298
+ "isReadOnly",
299
+ "aria-label",
300
+ "children",
301
+ "isRequired",
302
+ "autoFocus"
303
+ ])), {
304
+ value: {
305
+ type: "string",
306
+ description: "The value of the input element, used when submitting an HTML form."
307
+ },
308
+ isSelected: {
309
+ type: "boolean",
310
+ editOnly: true,
311
+ uncontrolledProp: "defaultSelected",
312
+ description: "Whether the checkbox is toggled on",
313
+ defaultValueHint: false
314
+ },
315
+ isIndeterminate: {
316
+ displayName: "Indeterminate",
317
+ type: "boolean",
318
+ description: "This state indicates that the checkbox is neither fully checked nor unchecked. It typically represents a partial selection when dealing with groups of options. Some but not all items in the group are selected, resulting in an indeterminate state for the checkbox.",
319
+ defaultValueHint: false
320
+ },
321
+ isInvalid: {
322
+ displayName: "Invalid",
323
+ type: "boolean",
324
+ description: "Whether the input value is invalid",
325
+ defaultValueHint: false
326
+ },
327
+ validationBehavior: {
328
+ type: "choice",
329
+ options: ["native", "aria"],
330
+ 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.",
331
+ defaultValueHint: "native"
332
+ },
333
+ onChange: {
334
+ type: "eventHandler",
335
+ argTypes: [{ name: "isSelected", type: "boolean" }]
336
+ },
337
+ onHoverChange: {
338
+ type: "eventHandler",
339
+ argTypes: [{ name: "isHovered", type: "boolean" }]
340
+ },
341
+ onFocusChange: {
342
+ type: "eventHandler",
343
+ argTypes: [{ name: "isFocused", type: "boolean" }]
344
+ },
345
+ onPressChange: {
346
+ type: "eventHandler",
347
+ argTypes: [{ name: "isPressed", type: "boolean" }]
348
+ },
349
+ onFocusVisibleChange: {
350
+ type: "eventHandler",
351
+ argTypes: [{ name: "isFocusVisible", type: "boolean" }]
352
+ }
353
+ }),
354
+ states: {
355
+ isSelected: {
356
+ type: "writable",
357
+ valueProp: "isSelected",
358
+ onChangeProp: "onChange",
359
+ variableType: "boolean"
360
+ },
361
+ isHovered: {
362
+ type: "readonly",
363
+ onChangeProp: "onHoverChange",
364
+ variableType: "boolean"
365
+ },
366
+ isPressed: {
367
+ type: "readonly",
368
+ onChangeProp: "onPressChange",
369
+ variableType: "boolean"
370
+ },
371
+ isFocused: {
372
+ type: "readonly",
373
+ onChangeProp: "onFocusChange",
374
+ variableType: "boolean"
375
+ },
376
+ isFocusVisible: {
377
+ type: "readonly",
378
+ onChangeProp: "onFocusVisibleChange",
379
+ variableType: "boolean"
380
+ }
381
+ },
382
+ trapsFocus: true
383
+ },
384
+ overrides
385
+ );
386
+ }
387
+
388
+ var __defProp$f = Object.defineProperty;
389
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
390
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
391
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
392
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
393
+ var __spreadValues$f = (a, b) => {
394
+ for (var prop in b || (b = {}))
395
+ if (__hasOwnProp$f.call(b, prop))
396
+ __defNormalProp$f(a, prop, b[prop]);
397
+ if (__getOwnPropSymbols$f)
398
+ for (var prop of __getOwnPropSymbols$f(b)) {
399
+ if (__propIsEnum$f.call(b, prop))
400
+ __defNormalProp$f(a, prop, b[prop]);
401
+ }
402
+ return a;
403
+ };
404
+ var __objRest$7 = (source, exclude) => {
405
+ var target = {};
406
+ for (var prop in source)
407
+ if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
408
+ target[prop] = source[prop];
409
+ if (source != null && __getOwnPropSymbols$f)
410
+ for (var prop of __getOwnPropSymbols$f(source)) {
411
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
412
+ target[prop] = source[prop];
413
+ }
414
+ return target;
415
+ };
416
+ function BaseText(_a) {
417
+ var _b = _a, { children } = _b, rest = __objRest$7(_b, ["children"]);
418
+ return /* @__PURE__ */ React.createElement(Text, __spreadValues$f({}, rest), children);
419
+ }
420
+ function registerText(loader, overrides) {
421
+ registerComponentHelper(
422
+ loader,
423
+ BaseText,
424
+ {
425
+ name: makeComponentName("text"),
426
+ displayName: "BaseText",
427
+ importPath: "@plasmicpkgs/react-aria/registerText",
428
+ importName: "BaseText",
429
+ props: {
430
+ children: {
431
+ type: "slot"
432
+ },
433
+ slot: {
434
+ type: "string"
435
+ }
436
+ },
437
+ trapsFocus: true
438
+ },
439
+ overrides
440
+ );
441
+ }
442
+
443
+ var __defProp$e = Object.defineProperty;
444
+ var __defProps$7 = Object.defineProperties;
445
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
446
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
447
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
448
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
449
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
450
+ var __spreadValues$e = (a, b) => {
451
+ for (var prop in b || (b = {}))
452
+ if (__hasOwnProp$e.call(b, prop))
453
+ __defNormalProp$e(a, prop, b[prop]);
454
+ if (__getOwnPropSymbols$e)
455
+ for (var prop of __getOwnPropSymbols$e(b)) {
456
+ if (__propIsEnum$e.call(b, prop))
457
+ __defNormalProp$e(a, prop, b[prop]);
458
+ }
459
+ return a;
460
+ };
461
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
462
+ function registerDescription(loader, overrides) {
463
+ registerText(loader, __spreadProps$7(__spreadValues$e({}, overrides), {
464
+ displayName: "BaseDescription",
465
+ props: {
466
+ slot: { type: "string", hidden: () => true, defaultValue: "description" }
467
+ }
468
+ }));
469
+ }
470
+
471
+ var __defProp$d = Object.defineProperty;
472
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
473
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
474
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
475
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
476
+ var __spreadValues$d = (a, b) => {
477
+ for (var prop in b || (b = {}))
478
+ if (__hasOwnProp$d.call(b, prop))
479
+ __defNormalProp$d(a, prop, b[prop]);
480
+ if (__getOwnPropSymbols$d)
481
+ for (var prop of __getOwnPropSymbols$d(b)) {
482
+ if (__propIsEnum$d.call(b, prop))
483
+ __defNormalProp$d(a, prop, b[prop]);
484
+ }
485
+ return a;
486
+ };
487
+ var __objRest$6 = (source, exclude) => {
488
+ var target = {};
489
+ for (var prop in source)
490
+ if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
491
+ target[prop] = source[prop];
492
+ if (source != null && __getOwnPropSymbols$d)
493
+ for (var prop of __getOwnPropSymbols$d(source)) {
494
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
495
+ target[prop] = source[prop];
496
+ }
497
+ return target;
498
+ };
499
+ function BaseFieldError(_a) {
500
+ var _b = _a, {
501
+ badInput,
502
+ customError,
503
+ patternMismatch,
504
+ rangeOverflow,
505
+ rangeUnderflow,
506
+ stepMismatch,
507
+ tooLong,
508
+ tooShort,
509
+ typeMismatch,
510
+ valueMissing
511
+ } = _b, rest = __objRest$6(_b, [
512
+ "badInput",
513
+ "customError",
514
+ "patternMismatch",
515
+ "rangeOverflow",
516
+ "rangeUnderflow",
517
+ "stepMismatch",
518
+ "tooLong",
519
+ "tooShort",
520
+ "typeMismatch",
521
+ "valueMissing"
522
+ ]);
523
+ return /* @__PURE__ */ React.createElement(FieldError, __spreadValues$d({}, rest), ({ validationDetails, validationErrors }) => {
524
+ if (validationDetails.badInput && badInput)
525
+ return badInput;
526
+ if (validationDetails.customError && customError)
527
+ return customError;
528
+ if (validationDetails.patternMismatch && patternMismatch)
529
+ return patternMismatch;
530
+ if (validationDetails.rangeOverflow && rangeOverflow)
531
+ return rangeOverflow;
532
+ if (validationDetails.rangeUnderflow && rangeUnderflow)
533
+ return rangeUnderflow;
534
+ if (validationDetails.stepMismatch && stepMismatch)
535
+ return stepMismatch;
536
+ if (validationDetails.tooLong && tooLong)
537
+ return tooLong;
538
+ if (validationDetails.tooShort && tooShort)
539
+ return tooShort;
540
+ if (validationDetails.typeMismatch && typeMismatch)
541
+ return typeMismatch;
542
+ if (validationDetails.valueMissing && valueMissing)
543
+ return valueMissing;
544
+ return validationErrors;
545
+ });
546
+ }
547
+ function PropsDescription() {
548
+ return /* @__PURE__ */ React.createElement("div", { style: { marginBottom: 20 } }, /* @__PURE__ */ React.createElement("p", null, "You can customize the error messages for built-in validations by utilizing the props below."), /* @__PURE__ */ React.createElement("p", null, "For further information on the specific conditions triggering each error, please refer to the", " ", /* @__PURE__ */ React.createElement(
549
+ "a",
550
+ {
551
+ target: "_blank",
552
+ href: "https://developer.mozilla.org/en-US/docs/Web/API/ValidityState#instance_properties"
553
+ },
554
+ "MDN Docs"
555
+ ), "."));
556
+ }
557
+ function registerFieldError(loader, overrides) {
558
+ registerComponentHelper(
559
+ loader,
560
+ BaseFieldError,
561
+ {
562
+ name: makeComponentName("fielderror"),
563
+ displayName: "BaseFieldError",
564
+ importPath: "@plasmicpkgs/react-aria/registerFieldError",
565
+ importName: "BaseFieldError",
566
+ actions: [
567
+ {
568
+ type: "custom-action",
569
+ control: PropsDescription
570
+ }
571
+ ],
572
+ props: {
573
+ badInput: {
574
+ type: "string",
575
+ description: "Error message if the user has provided input that the browser is unable to convert"
576
+ },
577
+ customError: {
578
+ type: "string",
579
+ description: "Error message for custom validations"
580
+ },
581
+ patternMismatch: {
582
+ type: "string",
583
+ description: "Error message if the value does not match the specified pattern"
584
+ },
585
+ rangeOverflow: {
586
+ type: "string",
587
+ description: "Error message if the value is greater than the maximum specified"
588
+ },
589
+ rangeUnderflow: {
590
+ type: "string",
591
+ description: "Error message if the value is less than the minimum specified"
592
+ },
593
+ stepMismatch: {
594
+ type: "string",
595
+ description: "Error message if the value is not evenly divisible by the step value"
596
+ },
597
+ tooLong: {
598
+ type: "string",
599
+ description: "Error message if the value exceeds the specified maximum number of characters"
600
+ },
601
+ tooShort: {
602
+ type: "string",
603
+ description: "Error message if the value fails to meet the specified minimum number of characters"
604
+ },
605
+ typeMismatch: {
606
+ type: "string",
607
+ description: "Error message if the value is not in the required syntax (when type is email or url)"
608
+ },
609
+ valueMissing: {
610
+ type: "string",
611
+ description: "Error message if a required field has no value"
612
+ }
613
+ },
614
+ trapsFocus: true
615
+ },
616
+ overrides
617
+ );
618
+ }
619
+
620
+ const BaseLabel = Label;
621
+ function registerLabel(loader, overrides) {
622
+ registerComponentHelper(
623
+ loader,
624
+ BaseLabel,
625
+ {
626
+ name: makeComponentName("label"),
627
+ displayName: "BaseLabel",
628
+ importPath: "@plasmicpkgs/react-aria/registerLabel",
629
+ importName: "BaseLabel",
630
+ props: {
631
+ children: {
632
+ type: "slot"
633
+ }
634
+ },
635
+ trapsFocus: true
636
+ },
637
+ overrides
638
+ );
639
+ }
640
+
641
+ var __defProp$c = Object.defineProperty;
642
+ var __defProps$6 = Object.defineProperties;
643
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
644
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
645
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
646
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
647
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
648
+ var __spreadValues$c = (a, b) => {
649
+ for (var prop in b || (b = {}))
650
+ if (__hasOwnProp$c.call(b, prop))
651
+ __defNormalProp$c(a, prop, b[prop]);
652
+ if (__getOwnPropSymbols$c)
653
+ for (var prop of __getOwnPropSymbols$c(b)) {
654
+ if (__propIsEnum$c.call(b, prop))
655
+ __defNormalProp$c(a, prop, b[prop]);
656
+ }
657
+ return a;
658
+ };
659
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
660
+ const BaseCheckboxGroup = CheckboxGroup;
661
+ const componentName$1 = makeComponentName("checkboxGroup");
662
+ function registerCheckboxGroup(loader, overrides) {
663
+ registerComponentHelper(
664
+ loader,
665
+ BaseCheckboxGroup,
666
+ {
667
+ name: componentName$1,
668
+ displayName: "BaseCheckboxGroup",
669
+ importPath: "@plasmicpkgs/react-aria/registerCheckboxGroup",
670
+ importName: "BaseCheckboxGroup",
671
+ props: __spreadProps$6(__spreadValues$c({}, getCommonInputProps("checkbox group", [
672
+ "name",
673
+ "isDisabled",
674
+ "isReadOnly",
675
+ "aria-label",
676
+ "children",
677
+ "isRequired"
678
+ ])), {
679
+ value: {
680
+ type: "array",
681
+ editOnly: true,
682
+ uncontrolledProp: "defaultValue",
683
+ description: "The current value"
684
+ },
685
+ options: {
686
+ type: "array",
687
+ description: "The options in the radio group",
688
+ itemType: {
689
+ type: "object",
690
+ nameFunc: (item) => item.label,
691
+ fields: {
692
+ label: "string",
693
+ value: "string"
694
+ }
695
+ }
696
+ },
697
+ isInvalid: {
698
+ displayName: "Invalid",
699
+ type: "boolean",
700
+ description: "Whether the input value is invalid",
701
+ defaultValueHint: false
702
+ },
703
+ validationBehavior: {
704
+ type: "choice",
705
+ options: ["native", "aria"],
706
+ 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.",
707
+ defaultValueHint: "native"
708
+ },
709
+ onChange: {
710
+ type: "eventHandler",
711
+ argTypes: [{ name: "value", type: "object" }]
712
+ }
713
+ }),
714
+ states: {
715
+ value: {
716
+ type: "writable",
717
+ valueProp: "value",
718
+ onChangeProp: "onChange",
719
+ variableType: "array"
720
+ }
721
+ },
722
+ trapsFocus: true
723
+ },
724
+ overrides
725
+ );
726
+ const thisName = makeChildComponentName(
727
+ overrides == null ? void 0 : overrides.parentComponentName,
728
+ componentName$1
729
+ );
730
+ registerFieldError(loader, { parentComponentName: thisName });
731
+ registerCheckbox(loader, { parentComponentName: thisName });
732
+ registerLabel(loader, { parentComponentName: thisName });
733
+ registerDescription(loader, {
734
+ parentComponentName: thisName
735
+ });
736
+ }
737
+
245
738
  React.createContext(void 0);
246
739
  const PlasmicListBoxContext = React.createContext(void 0);
247
740
  const PlasmicPopoverContext = React.createContext(void 0);
@@ -399,25 +892,25 @@ function makeValuePropType() {
399
892
  return type;
400
893
  }
401
894
 
402
- var __defProp$a = Object.defineProperty;
403
- var __defProps$3 = Object.defineProperties;
404
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
405
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
406
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
407
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
408
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
409
- var __spreadValues$a = (a, b) => {
895
+ var __defProp$b = Object.defineProperty;
896
+ var __defProps$5 = Object.defineProperties;
897
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
898
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
899
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
900
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
901
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
902
+ var __spreadValues$b = (a, b) => {
410
903
  for (var prop in b || (b = {}))
411
- if (__hasOwnProp$a.call(b, prop))
412
- __defNormalProp$a(a, prop, b[prop]);
413
- if (__getOwnPropSymbols$a)
414
- for (var prop of __getOwnPropSymbols$a(b)) {
415
- if (__propIsEnum$a.call(b, prop))
416
- __defNormalProp$a(a, prop, b[prop]);
904
+ if (__hasOwnProp$b.call(b, prop))
905
+ __defNormalProp$b(a, prop, b[prop]);
906
+ if (__getOwnPropSymbols$b)
907
+ for (var prop of __getOwnPropSymbols$b(b)) {
908
+ if (__propIsEnum$b.call(b, prop))
909
+ __defNormalProp$b(a, prop, b[prop]);
417
910
  }
418
911
  return a;
419
912
  };
420
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
913
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
421
914
  function BaseComboBox(props) {
422
915
  const {
423
916
  value,
@@ -450,7 +943,7 @@ function BaseComboBox(props) {
450
943
  return withoutNils(
451
944
  options2.map((op) => {
452
945
  if (op.type === "section") {
453
- return __spreadProps$3(__spreadValues$a({}, op), {
946
+ return __spreadProps$5(__spreadValues$b({}, op), {
454
947
  items: op.items ? filterOptions(op.items) : void 0
455
948
  });
456
949
  } else {
@@ -534,7 +1027,7 @@ function BaseComboBox(props) {
534
1027
  ]);
535
1028
  return /* @__PURE__ */ React.createElement(
536
1029
  ComboBox,
537
- __spreadValues$a({
1030
+ __spreadValues$b({
538
1031
  selectedKey: value,
539
1032
  onSelectionChange,
540
1033
  isDisabled,
@@ -673,39 +1166,39 @@ function registerComboBox(loader) {
673
1166
  });
674
1167
  }
675
1168
 
676
- var __defProp$9 = Object.defineProperty;
677
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
678
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
679
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
680
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
681
- var __spreadValues$9 = (a, b) => {
1169
+ var __defProp$a = Object.defineProperty;
1170
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1171
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1172
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1173
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1174
+ var __spreadValues$a = (a, b) => {
682
1175
  for (var prop in b || (b = {}))
683
- if (__hasOwnProp$9.call(b, prop))
684
- __defNormalProp$9(a, prop, b[prop]);
685
- if (__getOwnPropSymbols$9)
686
- for (var prop of __getOwnPropSymbols$9(b)) {
687
- if (__propIsEnum$9.call(b, prop))
688
- __defNormalProp$9(a, prop, b[prop]);
1176
+ if (__hasOwnProp$a.call(b, prop))
1177
+ __defNormalProp$a(a, prop, b[prop]);
1178
+ if (__getOwnPropSymbols$a)
1179
+ for (var prop of __getOwnPropSymbols$a(b)) {
1180
+ if (__propIsEnum$a.call(b, prop))
1181
+ __defNormalProp$a(a, prop, b[prop]);
689
1182
  }
690
1183
  return a;
691
1184
  };
692
- var __objRest$3 = (source, exclude) => {
1185
+ var __objRest$5 = (source, exclude) => {
693
1186
  var target = {};
694
1187
  for (var prop in source)
695
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
1188
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
696
1189
  target[prop] = source[prop];
697
- if (source != null && __getOwnPropSymbols$9)
698
- for (var prop of __getOwnPropSymbols$9(source)) {
699
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
1190
+ if (source != null && __getOwnPropSymbols$a)
1191
+ for (var prop of __getOwnPropSymbols$a(source)) {
1192
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
700
1193
  target[prop] = source[prop];
701
1194
  }
702
1195
  return target;
703
1196
  };
704
1197
  function BaseForm(props) {
705
- const _a = props, { onSubmit, children } = _a, rest = __objRest$3(_a, ["onSubmit", "children"]);
1198
+ const _a = props, { onSubmit, children } = _a, rest = __objRest$5(_a, ["onSubmit", "children"]);
706
1199
  return /* @__PURE__ */ React.createElement(
707
1200
  Form,
708
- __spreadValues$9({
1201
+ __spreadValues$a({
709
1202
  onSubmit: (e) => {
710
1203
  e.preventDefault();
711
1204
  const formData = new FormData(e.currentTarget);
@@ -755,25 +1248,25 @@ function registerForm(loader, overrides) {
755
1248
  );
756
1249
  }
757
1250
 
758
- var __defProp$8 = Object.defineProperty;
759
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
760
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
761
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
762
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
763
- var __spreadValues$8 = (a, b) => {
1251
+ var __defProp$9 = Object.defineProperty;
1252
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1253
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1254
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1255
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1256
+ var __spreadValues$9 = (a, b) => {
764
1257
  for (var prop in b || (b = {}))
765
- if (__hasOwnProp$8.call(b, prop))
766
- __defNormalProp$8(a, prop, b[prop]);
767
- if (__getOwnPropSymbols$8)
768
- for (var prop of __getOwnPropSymbols$8(b)) {
769
- if (__propIsEnum$8.call(b, prop))
770
- __defNormalProp$8(a, prop, b[prop]);
1258
+ if (__hasOwnProp$9.call(b, prop))
1259
+ __defNormalProp$9(a, prop, b[prop]);
1260
+ if (__getOwnPropSymbols$9)
1261
+ for (var prop of __getOwnPropSymbols$9(b)) {
1262
+ if (__propIsEnum$9.call(b, prop))
1263
+ __defNormalProp$9(a, prop, b[prop]);
771
1264
  }
772
1265
  return a;
773
1266
  };
774
1267
  function BaseInput(props) {
775
1268
  const contextProps = React.useContext(PlasmicInputContext);
776
- return /* @__PURE__ */ React.createElement(Input, __spreadValues$8({}, mergeProps(contextProps, props)));
1269
+ return /* @__PURE__ */ React.createElement(Input, __spreadValues$9({}, mergeProps(contextProps, props)));
777
1270
  }
778
1271
  function registerInput(loader, overrides) {
779
1272
  registerComponentHelper(
@@ -817,58 +1310,19 @@ function registerInput(loader, overrides) {
817
1310
  );
818
1311
  }
819
1312
 
820
- var __defProp$7 = Object.defineProperty;
821
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
822
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
823
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
824
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
825
- var __spreadValues$7 = (a, b) => {
826
- for (var prop in b || (b = {}))
827
- if (__hasOwnProp$7.call(b, prop))
828
- __defNormalProp$7(a, prop, b[prop]);
829
- if (__getOwnPropSymbols$7)
830
- for (var prop of __getOwnPropSymbols$7(b)) {
831
- if (__propIsEnum$7.call(b, prop))
832
- __defNormalProp$7(a, prop, b[prop]);
833
- }
834
- return a;
835
- };
836
- function BaseLabel(props) {
837
- return /* @__PURE__ */ React.createElement(Label, __spreadValues$7({}, props));
838
- }
839
- function registerLabel(loader, overrides) {
840
- registerComponentHelper(
841
- loader,
842
- BaseLabel,
843
- {
844
- name: makeComponentName("label"),
845
- displayName: "BaseLabel",
846
- importPath: "@plasmicpkgs/react-aria/registerLabel",
847
- importName: "BaseLabel",
848
- props: {
849
- children: {
850
- type: "slot"
851
- }
852
- },
853
- trapsFocus: true
854
- },
855
- overrides
856
- );
857
- }
858
-
859
- var __defProp$6 = Object.defineProperty;
860
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
861
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
862
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
863
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
864
- var __spreadValues$6 = (a, b) => {
1313
+ var __defProp$8 = Object.defineProperty;
1314
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1315
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1316
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1317
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1318
+ var __spreadValues$8 = (a, b) => {
865
1319
  for (var prop in b || (b = {}))
866
- if (__hasOwnProp$6.call(b, prop))
867
- __defNormalProp$6(a, prop, b[prop]);
868
- if (__getOwnPropSymbols$6)
869
- for (var prop of __getOwnPropSymbols$6(b)) {
870
- if (__propIsEnum$6.call(b, prop))
871
- __defNormalProp$6(a, prop, b[prop]);
1320
+ if (__hasOwnProp$8.call(b, prop))
1321
+ __defNormalProp$8(a, prop, b[prop]);
1322
+ if (__getOwnPropSymbols$8)
1323
+ for (var prop of __getOwnPropSymbols$8(b)) {
1324
+ if (__propIsEnum$8.call(b, prop))
1325
+ __defNormalProp$8(a, prop, b[prop]);
872
1326
  }
873
1327
  return a;
874
1328
  };
@@ -876,7 +1330,7 @@ function BaseListBoxItem(props) {
876
1330
  var _a;
877
1331
  const contextProps = React.useContext(PlasmicItemContext);
878
1332
  const mergedProps = mergeProps(contextProps, props);
879
- return /* @__PURE__ */ React.createElement(ListBoxItem, __spreadValues$6({ id: (_a = mergedProps.key) != null ? _a : void 0 }, mergedProps));
1333
+ return /* @__PURE__ */ React.createElement(ListBoxItem, __spreadValues$8({ id: (_a = mergedProps.key) != null ? _a : void 0 }, mergedProps));
880
1334
  }
881
1335
  function registerListBoxItem(loader, overrides) {
882
1336
  registerComponentHelper(
@@ -912,33 +1366,33 @@ function registerListBoxItem(loader, overrides) {
912
1366
  );
913
1367
  }
914
1368
 
915
- var __defProp$5 = Object.defineProperty;
916
- var __defProps$2 = Object.defineProperties;
917
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
918
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
919
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
920
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
921
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
922
- var __spreadValues$5 = (a, b) => {
1369
+ var __defProp$7 = Object.defineProperty;
1370
+ var __defProps$4 = Object.defineProperties;
1371
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1372
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1373
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1374
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1375
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1376
+ var __spreadValues$7 = (a, b) => {
923
1377
  for (var prop in b || (b = {}))
924
- if (__hasOwnProp$5.call(b, prop))
925
- __defNormalProp$5(a, prop, b[prop]);
926
- if (__getOwnPropSymbols$5)
927
- for (var prop of __getOwnPropSymbols$5(b)) {
928
- if (__propIsEnum$5.call(b, prop))
929
- __defNormalProp$5(a, prop, b[prop]);
1378
+ if (__hasOwnProp$7.call(b, prop))
1379
+ __defNormalProp$7(a, prop, b[prop]);
1380
+ if (__getOwnPropSymbols$7)
1381
+ for (var prop of __getOwnPropSymbols$7(b)) {
1382
+ if (__propIsEnum$7.call(b, prop))
1383
+ __defNormalProp$7(a, prop, b[prop]);
930
1384
  }
931
1385
  return a;
932
1386
  };
933
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
934
- var __objRest$2 = (source, exclude) => {
1387
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
1388
+ var __objRest$4 = (source, exclude) => {
935
1389
  var target = {};
936
1390
  for (var prop in source)
937
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1391
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
938
1392
  target[prop] = source[prop];
939
- if (source != null && __getOwnPropSymbols$5)
940
- for (var prop of __getOwnPropSymbols$5(source)) {
941
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1393
+ if (source != null && __getOwnPropSymbols$7)
1394
+ for (var prop of __getOwnPropSymbols$7(source)) {
1395
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
942
1396
  target[prop] = source[prop];
943
1397
  }
944
1398
  return target;
@@ -987,21 +1441,21 @@ function BaseListBox(props) {
987
1441
  renderItem,
988
1442
  renderSection,
989
1443
  getItemType
990
- } = _a, rest = __objRest$2(_a, [
1444
+ } = _a, rest = __objRest$4(_a, [
991
1445
  "makeItemProps",
992
1446
  "makeSectionProps",
993
1447
  "renderItem",
994
1448
  "renderSection",
995
1449
  "getItemType"
996
1450
  ]);
997
- return /* @__PURE__ */ React.createElement(ListBox, __spreadValues$5({}, mergeProps(contextProps, rest)), (item) => {
1451
+ return /* @__PURE__ */ React.createElement(ListBox, __spreadValues$7({}, mergeProps(contextProps, rest)), (item) => {
998
1452
  if ((getItemType == null ? void 0 : getItemType(item)) === "section") {
999
1453
  const sectionProps = makeSectionProps == null ? void 0 : makeSectionProps(item);
1000
1454
  return /* @__PURE__ */ React.createElement(
1001
1455
  PlasmicSectionContext.Provider,
1002
1456
  {
1003
1457
  key: sectionProps == null ? void 0 : sectionProps.key,
1004
- value: __spreadProps$2(__spreadValues$5({}, sectionProps), { makeItemProps, renderItem })
1458
+ value: __spreadProps$4(__spreadValues$7({}, sectionProps), { makeItemProps, renderItem })
1005
1459
  },
1006
1460
  renderSection == null ? void 0 : renderSection(item)
1007
1461
  );
@@ -1054,39 +1508,39 @@ function registerListBox(loader, overrides) {
1054
1508
  });
1055
1509
  }
1056
1510
 
1057
- var __defProp$4 = Object.defineProperty;
1058
- var __defProps$1 = Object.defineProperties;
1059
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1060
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1061
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1062
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1063
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1064
- var __spreadValues$4 = (a, b) => {
1511
+ var __defProp$6 = Object.defineProperty;
1512
+ var __defProps$3 = Object.defineProperties;
1513
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
1514
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1515
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1516
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1517
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1518
+ var __spreadValues$6 = (a, b) => {
1065
1519
  for (var prop in b || (b = {}))
1066
- if (__hasOwnProp$4.call(b, prop))
1067
- __defNormalProp$4(a, prop, b[prop]);
1068
- if (__getOwnPropSymbols$4)
1069
- for (var prop of __getOwnPropSymbols$4(b)) {
1070
- if (__propIsEnum$4.call(b, prop))
1071
- __defNormalProp$4(a, prop, b[prop]);
1520
+ if (__hasOwnProp$6.call(b, prop))
1521
+ __defNormalProp$6(a, prop, b[prop]);
1522
+ if (__getOwnPropSymbols$6)
1523
+ for (var prop of __getOwnPropSymbols$6(b)) {
1524
+ if (__propIsEnum$6.call(b, prop))
1525
+ __defNormalProp$6(a, prop, b[prop]);
1072
1526
  }
1073
1527
  return a;
1074
1528
  };
1075
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1076
- var __objRest$1 = (source, exclude) => {
1529
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
1530
+ var __objRest$3 = (source, exclude) => {
1077
1531
  var target = {};
1078
1532
  for (var prop in source)
1079
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1533
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1080
1534
  target[prop] = source[prop];
1081
- if (source != null && __getOwnPropSymbols$4)
1082
- for (var prop of __getOwnPropSymbols$4(source)) {
1083
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1535
+ if (source != null && __getOwnPropSymbols$6)
1536
+ for (var prop of __getOwnPropSymbols$6(source)) {
1537
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1084
1538
  target[prop] = source[prop];
1085
1539
  }
1086
1540
  return target;
1087
1541
  };
1088
1542
  function BasePopover(props) {
1089
- const _a = props, restProps = __objRest$1(_a, ["resetClassName"]);
1543
+ const _a = props, restProps = __objRest$3(_a, ["resetClassName"]);
1090
1544
  const isStandalone = !React.useContext(PopoverContext);
1091
1545
  const contextProps = React.useContext(PlasmicPopoverContext);
1092
1546
  const canvas = usePlasmicCanvasContext();
@@ -1097,14 +1551,14 @@ function BasePopover(props) {
1097
1551
  const triggerRef = React.useRef(null);
1098
1552
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(
1099
1553
  Popover,
1100
- __spreadProps$1(__spreadValues$4({}, mergedProps), {
1554
+ __spreadProps$3(__spreadValues$6({}, mergedProps), {
1101
1555
  triggerRef,
1102
1556
  isNonModal: true,
1103
1557
  isOpen: true
1104
1558
  })
1105
1559
  ));
1106
1560
  } else {
1107
- return /* @__PURE__ */ React.createElement(Popover, __spreadProps$1(__spreadValues$4({}, mergedProps), { isNonModal: !!canvas }));
1561
+ return /* @__PURE__ */ React.createElement(Popover, __spreadProps$3(__spreadValues$6({}, mergedProps), { isNonModal: !!canvas }));
1108
1562
  }
1109
1563
  }
1110
1564
  function registerPopover(loader, overrides) {
@@ -1162,6 +1616,257 @@ function registerPopover(loader, overrides) {
1162
1616
  );
1163
1617
  }
1164
1618
 
1619
+ var __defProp$5 = Object.defineProperty;
1620
+ var __defProps$2 = Object.defineProperties;
1621
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
1622
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1623
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1624
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1625
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1626
+ var __spreadValues$5 = (a, b) => {
1627
+ for (var prop in b || (b = {}))
1628
+ if (__hasOwnProp$5.call(b, prop))
1629
+ __defNormalProp$5(a, prop, b[prop]);
1630
+ if (__getOwnPropSymbols$5)
1631
+ for (var prop of __getOwnPropSymbols$5(b)) {
1632
+ if (__propIsEnum$5.call(b, prop))
1633
+ __defNormalProp$5(a, prop, b[prop]);
1634
+ }
1635
+ return a;
1636
+ };
1637
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1638
+ var __objRest$2 = (source, exclude) => {
1639
+ var target = {};
1640
+ for (var prop in source)
1641
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1642
+ target[prop] = source[prop];
1643
+ if (source != null && __getOwnPropSymbols$5)
1644
+ for (var prop of __getOwnPropSymbols$5(source)) {
1645
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1646
+ target[prop] = source[prop];
1647
+ }
1648
+ return target;
1649
+ };
1650
+ function BaseRadio(props) {
1651
+ const _a = props, {
1652
+ children,
1653
+ onPressChange,
1654
+ onFocusVisibleChange,
1655
+ onHoverChange
1656
+ } = _a, rest = __objRest$2(_a, [
1657
+ "children",
1658
+ "onPressChange",
1659
+ "onFocusVisibleChange",
1660
+ "onHoverChange"
1661
+ ]);
1662
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Radio, __spreadValues$5({}, rest), ({ isFocusVisible, isPressed, isHovered }) => (
1663
+ // TODO: Remove DataProvider once Interaction variants are implemented for Code components
1664
+ /* @__PURE__ */ React.createElement(
1665
+ DataProvider,
1666
+ {
1667
+ name: "states",
1668
+ data: { isFocusVisible, isPressed, isHovered }
1669
+ },
1670
+ /* @__PURE__ */ React.createElement(
1671
+ ValueObserver,
1672
+ {
1673
+ value: isFocusVisible,
1674
+ onChange: onFocusVisibleChange
1675
+ }
1676
+ ),
1677
+ /* @__PURE__ */ React.createElement(ValueObserver, { value: isPressed, onChange: onPressChange }),
1678
+ /* @__PURE__ */ React.createElement(ValueObserver, { value: isHovered, onChange: onHoverChange }),
1679
+ children
1680
+ )
1681
+ )));
1682
+ }
1683
+ function registerRadio(loader, overrides) {
1684
+ registerComponentHelper(
1685
+ loader,
1686
+ BaseRadio,
1687
+ {
1688
+ name: makeComponentName("radio"),
1689
+ displayName: "BaseRadio",
1690
+ importPath: "@plasmicpkgs/react-aria/registerRadio",
1691
+ // TODO: Remove DataProvider once Interaction variants are implemented for Code components
1692
+ providesData: true,
1693
+ importName: "BaseRadio",
1694
+ props: __spreadProps$2(__spreadValues$5({}, getCommonInputProps("radio", [
1695
+ "isDisabled",
1696
+ "autoFocus",
1697
+ "aria-label",
1698
+ "children"
1699
+ ])), {
1700
+ value: {
1701
+ type: "string",
1702
+ description: "The value of the input element, used when submitting an HTML form."
1703
+ },
1704
+ onHoverChange: {
1705
+ type: "eventHandler",
1706
+ argTypes: [{ name: "isHovered", type: "boolean" }]
1707
+ },
1708
+ onFocusChange: {
1709
+ type: "eventHandler",
1710
+ argTypes: [{ name: "isFocused", type: "boolean" }]
1711
+ },
1712
+ onPressChange: {
1713
+ type: "eventHandler",
1714
+ argTypes: [{ name: "isPressed", type: "boolean" }]
1715
+ },
1716
+ onFocusVisibleChange: {
1717
+ type: "eventHandler",
1718
+ argTypes: [{ name: "isFocusVisible", type: "boolean" }]
1719
+ }
1720
+ }),
1721
+ states: {
1722
+ isHovered: {
1723
+ type: "readonly",
1724
+ onChangeProp: "onHoverChange",
1725
+ variableType: "boolean"
1726
+ },
1727
+ isPressed: {
1728
+ type: "readonly",
1729
+ onChangeProp: "onPressChange",
1730
+ variableType: "boolean"
1731
+ },
1732
+ isFocused: {
1733
+ type: "readonly",
1734
+ onChangeProp: "onFocusChange",
1735
+ variableType: "boolean"
1736
+ },
1737
+ isFocusVisible: {
1738
+ type: "readonly",
1739
+ onChangeProp: "onFocusVisibleChange",
1740
+ variableType: "boolean"
1741
+ }
1742
+ },
1743
+ trapsFocus: true
1744
+ },
1745
+ overrides
1746
+ );
1747
+ }
1748
+
1749
+ var __defProp$4 = Object.defineProperty;
1750
+ var __defProps$1 = Object.defineProperties;
1751
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1752
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1753
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1754
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1755
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1756
+ var __spreadValues$4 = (a, b) => {
1757
+ for (var prop in b || (b = {}))
1758
+ if (__hasOwnProp$4.call(b, prop))
1759
+ __defNormalProp$4(a, prop, b[prop]);
1760
+ if (__getOwnPropSymbols$4)
1761
+ for (var prop of __getOwnPropSymbols$4(b)) {
1762
+ if (__propIsEnum$4.call(b, prop))
1763
+ __defNormalProp$4(a, prop, b[prop]);
1764
+ }
1765
+ return a;
1766
+ };
1767
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1768
+ var __objRest$1 = (source, exclude) => {
1769
+ var target = {};
1770
+ for (var prop in source)
1771
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1772
+ target[prop] = source[prop];
1773
+ if (source != null && __getOwnPropSymbols$4)
1774
+ for (var prop of __getOwnPropSymbols$4(source)) {
1775
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1776
+ target[prop] = source[prop];
1777
+ }
1778
+ return target;
1779
+ };
1780
+ function BaseRadioGroup(props) {
1781
+ const _a = props, { children } = _a, rest = __objRest$1(_a, ["children"]);
1782
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(RadioGroup, __spreadValues$4({}, rest), children));
1783
+ }
1784
+ const componentName = makeComponentName("radioGroup");
1785
+ function registerRadioGroup(loader, overrides) {
1786
+ registerComponentHelper(
1787
+ loader,
1788
+ BaseRadioGroup,
1789
+ {
1790
+ name: componentName,
1791
+ displayName: "BaseRadioGroup",
1792
+ importPath: "@plasmicpkgs/react-aria/registerRadioGroup",
1793
+ importName: "BaseRadioGroup",
1794
+ props: __spreadProps$1(__spreadValues$4({}, getCommonInputProps("radio group", [
1795
+ "name",
1796
+ "isDisabled",
1797
+ "isReadOnly",
1798
+ "aria-label",
1799
+ "children",
1800
+ "isRequired"
1801
+ ])), {
1802
+ value: {
1803
+ type: "string",
1804
+ editOnly: true,
1805
+ uncontrolledProp: "defaultValue",
1806
+ description: "The current value"
1807
+ },
1808
+ options: {
1809
+ type: "array",
1810
+ description: "The options in the radio group",
1811
+ itemType: {
1812
+ type: "object",
1813
+ nameFunc: (item) => item.label,
1814
+ fields: {
1815
+ label: "string",
1816
+ value: "string"
1817
+ }
1818
+ }
1819
+ },
1820
+ isInvalid: {
1821
+ displayName: "Invalid",
1822
+ type: "boolean",
1823
+ description: "Whether the input value is invalid",
1824
+ defaultValueHint: false
1825
+ },
1826
+ validationBehavior: {
1827
+ type: "choice",
1828
+ options: ["native", "aria"],
1829
+ 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.",
1830
+ defaultValueHint: "native"
1831
+ },
1832
+ onChange: {
1833
+ type: "eventHandler",
1834
+ argTypes: [{ name: "value", type: "string" }]
1835
+ },
1836
+ onFocusChange: {
1837
+ type: "eventHandler",
1838
+ argTypes: [{ name: "isFocused", type: "boolean" }]
1839
+ }
1840
+ }),
1841
+ states: {
1842
+ value: {
1843
+ type: "writable",
1844
+ valueProp: "value",
1845
+ onChangeProp: "onChange",
1846
+ variableType: "array"
1847
+ },
1848
+ isFocused: {
1849
+ type: "readonly",
1850
+ onChangeProp: "onFocusChange",
1851
+ variableType: "boolean"
1852
+ }
1853
+ },
1854
+ trapsFocus: true
1855
+ },
1856
+ overrides
1857
+ );
1858
+ const thisName = makeChildComponentName(
1859
+ overrides == null ? void 0 : overrides.parentComponentName,
1860
+ componentName
1861
+ );
1862
+ registerFieldError(loader, { parentComponentName: thisName });
1863
+ registerRadio(loader, { parentComponentName: thisName });
1864
+ registerLabel(loader, { parentComponentName: thisName });
1865
+ registerDescription(loader, {
1866
+ parentComponentName: thisName
1867
+ });
1868
+ }
1869
+
1165
1870
  var __defProp$3 = Object.defineProperty;
1166
1871
  var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1167
1872
  var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
@@ -1533,6 +2238,9 @@ function registerAll(loader) {
1533
2238
  registerSection(loader);
1534
2239
  registerSwitch(loader);
1535
2240
  registerForm(loader);
2241
+ registerCheckbox(loader);
2242
+ registerCheckboxGroup(loader);
2243
+ registerRadioGroup(loader);
1536
2244
  }
1537
2245
 
1538
2246
  export { registerAll };