@plasmicpkgs/react-aria 0.0.49 → 0.0.51

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 (163) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/ListBoxItemIdManager.d.ts +13 -0
  3. package/dist/common.d.ts +0 -2
  4. package/dist/contexts.d.ts +4 -5
  5. package/dist/react-aria.esm.js +712 -843
  6. package/dist/react-aria.esm.js.map +1 -1
  7. package/dist/react-aria.js +710 -841
  8. package/dist/react-aria.js.map +1 -1
  9. package/dist/registerComboBox.d.ts +9 -17
  10. package/dist/registerListBox.d.ts +16 -6
  11. package/dist/registerListBoxItem.d.ts +13 -3
  12. package/dist/registerSection.d.ts +2 -4
  13. package/dist/registerSelect.d.ts +9 -18
  14. package/package.json +2 -2
  15. package/skinny/ListBoxItemIdManager.d.ts +13 -0
  16. package/skinny/{common-fa69e9b3.esm.js → common-8ca74873.esm.js} +4 -72
  17. package/skinny/common-8ca74873.esm.js.map +1 -0
  18. package/skinny/{common-bfedaf7d.cjs.js → common-c892c339.cjs.js} +4 -82
  19. package/skinny/common-c892c339.cjs.js.map +1 -0
  20. package/skinny/common.d.ts +0 -2
  21. package/skinny/contexts-0a2977d8.esm.js +15 -0
  22. package/skinny/contexts-0a2977d8.esm.js.map +1 -0
  23. package/skinny/{contexts-0dec6156.cjs.js → contexts-c26d68f8.cjs.js} +3 -9
  24. package/skinny/contexts-c26d68f8.cjs.js.map +1 -0
  25. package/skinny/contexts.d.ts +4 -5
  26. package/skinny/{interaction-variant-utils-abd0c319.esm.js → interaction-variant-utils-1d94d073.esm.js} +2 -2
  27. package/skinny/interaction-variant-utils-1d94d073.esm.js.map +1 -0
  28. package/skinny/{interaction-variant-utils-36f1b397.cjs.js → interaction-variant-utils-9a869063.cjs.js} +2 -2
  29. package/skinny/interaction-variant-utils-9a869063.cjs.js.map +1 -0
  30. package/skinny/registerButton.cjs.js +6 -4
  31. package/skinny/registerButton.cjs.js.map +1 -1
  32. package/skinny/registerButton.esm.js +4 -2
  33. package/skinny/registerButton.esm.js.map +1 -1
  34. package/skinny/registerCheckbox.cjs.js +6 -5
  35. package/skinny/registerCheckbox.cjs.js.map +1 -1
  36. package/skinny/registerCheckbox.esm.js +4 -3
  37. package/skinny/registerCheckbox.esm.js.map +1 -1
  38. package/skinny/registerCheckboxGroup.cjs.js +8 -7
  39. package/skinny/registerCheckboxGroup.cjs.js.map +1 -1
  40. package/skinny/registerCheckboxGroup.esm.js +5 -4
  41. package/skinny/registerCheckboxGroup.esm.js.map +1 -1
  42. package/skinny/registerComboBox.cjs.js +73 -253
  43. package/skinny/registerComboBox.cjs.js.map +1 -1
  44. package/skinny/registerComboBox.d.ts +9 -17
  45. package/skinny/registerComboBox.esm.js +74 -254
  46. package/skinny/registerComboBox.esm.js.map +1 -1
  47. package/skinny/registerDescription.cjs.js +2 -2
  48. package/skinny/registerDescription.cjs.js.map +1 -1
  49. package/skinny/registerDescription.esm.js +1 -1
  50. package/skinny/registerDialogTrigger.cjs.js +6 -5
  51. package/skinny/registerDialogTrigger.cjs.js.map +1 -1
  52. package/skinny/registerDialogTrigger.esm.js +4 -3
  53. package/skinny/registerDialogTrigger.esm.js.map +1 -1
  54. package/skinny/registerFieldError.cjs.js +3 -3
  55. package/skinny/registerFieldError.cjs.js.map +1 -1
  56. package/skinny/registerFieldError.esm.js +1 -1
  57. package/skinny/registerForm.cjs.js +3 -3
  58. package/skinny/registerForm.cjs.js.map +1 -1
  59. package/skinny/registerForm.esm.js +1 -1
  60. package/skinny/registerInput.cjs.js +7 -6
  61. package/skinny/registerInput.cjs.js.map +1 -1
  62. package/skinny/registerInput.esm.js +5 -4
  63. package/skinny/registerInput.esm.js.map +1 -1
  64. package/skinny/registerLabel.cjs.js +3 -3
  65. package/skinny/registerLabel.cjs.js.map +1 -1
  66. package/skinny/registerLabel.esm.js +1 -1
  67. package/skinny/registerListBox-85f61377.esm.js +321 -0
  68. package/skinny/registerListBox-85f61377.esm.js.map +1 -0
  69. package/skinny/registerListBox-96ae5783.cjs.js +331 -0
  70. package/skinny/registerListBox-96ae5783.cjs.js.map +1 -0
  71. package/skinny/registerListBox.cjs.js +7 -7
  72. package/skinny/registerListBox.d.ts +16 -6
  73. package/skinny/registerListBox.esm.js +6 -7
  74. package/skinny/registerListBox.esm.js.map +1 -1
  75. package/skinny/registerListBoxItem.cjs.js +96 -13
  76. package/skinny/registerListBoxItem.cjs.js.map +1 -1
  77. package/skinny/registerListBoxItem.d.ts +13 -3
  78. package/skinny/registerListBoxItem.esm.js +95 -12
  79. package/skinny/registerListBoxItem.esm.js.map +1 -1
  80. package/skinny/registerModal.cjs.js +5 -4
  81. package/skinny/registerModal.cjs.js.map +1 -1
  82. package/skinny/registerModal.esm.js +3 -2
  83. package/skinny/registerModal.esm.js.map +1 -1
  84. package/skinny/registerPopover.cjs.js +5 -6
  85. package/skinny/registerPopover.cjs.js.map +1 -1
  86. package/skinny/registerPopover.esm.js +3 -4
  87. package/skinny/registerPopover.esm.js.map +1 -1
  88. package/skinny/registerRadio.cjs.js +6 -5
  89. package/skinny/registerRadio.cjs.js.map +1 -1
  90. package/skinny/registerRadio.esm.js +4 -3
  91. package/skinny/registerRadio.esm.js.map +1 -1
  92. package/skinny/registerRadioGroup.cjs.js +8 -7
  93. package/skinny/registerRadioGroup.cjs.js.map +1 -1
  94. package/skinny/registerRadioGroup.esm.js +5 -4
  95. package/skinny/registerRadioGroup.esm.js.map +1 -1
  96. package/skinny/registerSection.cjs.js +30 -25
  97. package/skinny/registerSection.cjs.js.map +1 -1
  98. package/skinny/registerSection.d.ts +2 -4
  99. package/skinny/registerSection.esm.js +29 -24
  100. package/skinny/registerSection.esm.js.map +1 -1
  101. package/skinny/registerSelect.cjs.js +65 -88
  102. package/skinny/registerSelect.cjs.js.map +1 -1
  103. package/skinny/registerSelect.d.ts +9 -18
  104. package/skinny/registerSelect.esm.js +61 -84
  105. package/skinny/registerSelect.esm.js.map +1 -1
  106. package/skinny/registerSlider.cjs.js +9 -9
  107. package/skinny/registerSlider.cjs.js.map +1 -1
  108. package/skinny/registerSlider.esm.js +5 -5
  109. package/skinny/registerSliderOutput.cjs.js +4 -4
  110. package/skinny/registerSliderOutput.cjs.js.map +1 -1
  111. package/skinny/registerSliderOutput.esm.js +2 -2
  112. package/skinny/registerSliderThumb.cjs.js +23 -7
  113. package/skinny/registerSliderThumb.cjs.js.map +1 -1
  114. package/skinny/registerSliderThumb.esm.js +21 -5
  115. package/skinny/registerSliderThumb.esm.js.map +1 -1
  116. package/skinny/registerSliderTrack.cjs.js +7 -7
  117. package/skinny/registerSliderTrack.cjs.js.map +1 -1
  118. package/skinny/registerSliderTrack.esm.js +3 -3
  119. package/skinny/registerSwitch.cjs.js +6 -5
  120. package/skinny/registerSwitch.cjs.js.map +1 -1
  121. package/skinny/registerSwitch.esm.js +4 -3
  122. package/skinny/registerSwitch.esm.js.map +1 -1
  123. package/skinny/registerText.cjs.js +3 -3
  124. package/skinny/registerText.cjs.js.map +1 -1
  125. package/skinny/registerText.esm.js +1 -1
  126. package/skinny/registerTextArea.cjs.js +6 -5
  127. package/skinny/registerTextArea.cjs.js.map +1 -1
  128. package/skinny/registerTextArea.esm.js +4 -3
  129. package/skinny/registerTextArea.esm.js.map +1 -1
  130. package/skinny/registerTextField.cjs.js +8 -7
  131. package/skinny/registerTextField.cjs.js.map +1 -1
  132. package/skinny/registerTextField.esm.js +5 -4
  133. package/skinny/registerTextField.esm.js.map +1 -1
  134. package/skinny/registerTooltip.cjs.js +2 -2
  135. package/skinny/registerTooltip.cjs.js.map +1 -1
  136. package/skinny/registerTooltip.esm.js +1 -1
  137. package/skinny/utils-8dbb4d1f.cjs.js +79 -0
  138. package/skinny/utils-8dbb4d1f.cjs.js.map +1 -0
  139. package/skinny/utils-c7662a47.esm.js +69 -0
  140. package/skinny/utils-c7662a47.esm.js.map +1 -0
  141. package/dist/option-utils.d.ts +0 -42
  142. package/dist/registerHeader.d.ts +0 -5
  143. package/skinny/ErrorBoundary-c6b111d3.esm.js +0 -20
  144. package/skinny/ErrorBoundary-c6b111d3.esm.js.map +0 -1
  145. package/skinny/ErrorBoundary-e9b86248.cjs.js +0 -22
  146. package/skinny/ErrorBoundary-e9b86248.cjs.js.map +0 -1
  147. package/skinny/common-bfedaf7d.cjs.js.map +0 -1
  148. package/skinny/common-fa69e9b3.esm.js.map +0 -1
  149. package/skinny/contexts-0dec6156.cjs.js.map +0 -1
  150. package/skinny/contexts-9a8234bf.esm.js +0 -17
  151. package/skinny/contexts-9a8234bf.esm.js.map +0 -1
  152. package/skinny/interaction-variant-utils-36f1b397.cjs.js.map +0 -1
  153. package/skinny/interaction-variant-utils-abd0c319.esm.js.map +0 -1
  154. package/skinny/option-utils.d.ts +0 -42
  155. package/skinny/registerHeader.cjs.js +0 -55
  156. package/skinny/registerHeader.cjs.js.map +0 -1
  157. package/skinny/registerHeader.d.ts +0 -5
  158. package/skinny/registerHeader.esm.js +0 -48
  159. package/skinny/registerHeader.esm.js.map +0 -1
  160. package/skinny/registerListBox-b3f2891a.esm.js +0 -298
  161. package/skinny/registerListBox-b3f2891a.esm.js.map +0 -1
  162. package/skinny/registerListBox-f4801dbd.cjs.js +0 -310
  163. package/skinny/registerListBox-f4801dbd.cjs.js.map +0 -1
@@ -1,40 +1,41 @@
1
- import React, { useEffect, Component, forwardRef, useImperativeHandle, useMemo } from 'react';
2
- import { Button, Checkbox, Text, FieldError, Label, CheckboxGroup, Input, ListBoxItem, ListBox, Header, Section, Collection, PopoverContext, SelectContext, Popover, ComboBox, ComboBoxStateContext, Heading, ModalOverlay, Modal, Dialog, DialogTrigger, Form, Radio, RadioGroup, Select, SelectValue, SliderOutput, SliderThumb, Slider, SliderTrack, Switch, TextArea, TextField } from 'react-aria-components';
1
+ import React, { useEffect, useState, useMemo, forwardRef, useImperativeHandle, Component } from 'react';
2
+ import { Button, Checkbox, Text, FieldError, Label, CheckboxGroup, Input, ListBoxItem, ListBox, Section, Header, PopoverContext, SelectContext, Popover, ComboBox, Heading, ModalOverlay, Modal, Dialog, DialogTrigger, Form, Radio, RadioGroup, Select, SelectValue, SliderOutput, SliderThumb, Slider, SliderTrack, Switch, TextArea, TextField } from 'react-aria-components';
3
3
  import registerComponent from '@plasmicapp/host/registerComponent';
4
- import { useFilter } from '@react-aria/i18n';
5
4
  import { mergeProps, useTooltipTrigger } from 'react-aria';
6
5
  import { mergeProps as mergeProps$1 } from '@react-aria/utils';
7
6
  import { usePlasmicCanvasContext } from '@plasmicapp/host';
8
7
  import flattenChildren from 'react-keyed-flatten-children';
9
8
  import { useTooltipTriggerState } from 'react-stately';
10
9
 
11
- var __defProp$r = Object.defineProperty;
12
- var __defProps$e = Object.defineProperties;
13
- var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
14
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
15
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
16
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
17
- var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18
- var __spreadValues$r = (a, b) => {
10
+ var __defProp$q = Object.defineProperty;
11
+ var __defProps$d = Object.defineProperties;
12
+ var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
13
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
14
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
15
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
16
+ var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17
+ var __spreadValues$q = (a, b) => {
19
18
  for (var prop in b || (b = {}))
20
- if (__hasOwnProp$r.call(b, prop))
21
- __defNormalProp$r(a, prop, b[prop]);
22
- if (__getOwnPropSymbols$r)
23
- for (var prop of __getOwnPropSymbols$r(b)) {
24
- if (__propIsEnum$r.call(b, prop))
25
- __defNormalProp$r(a, prop, b[prop]);
19
+ if (__hasOwnProp$q.call(b, prop))
20
+ __defNormalProp$q(a, prop, b[prop]);
21
+ if (__getOwnPropSymbols$q)
22
+ for (var prop of __getOwnPropSymbols$q(b)) {
23
+ if (__propIsEnum$q.call(b, prop))
24
+ __defNormalProp$q(a, prop, b[prop]);
26
25
  }
27
26
  return a;
28
27
  };
29
- var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
28
+ var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
30
29
  function registerComponentHelper(loader, component, meta, overrides) {
31
30
  var _a;
32
- meta = __spreadProps$e(__spreadValues$r({}, meta), {
33
- defaultStyles: __spreadValues$r(__spreadValues$r({}, defaultStyles), (_a = meta.defaultStyles) != null ? _a : {})
31
+ meta = __spreadProps$d(__spreadValues$q({}, meta), {
32
+ defaultStyles: __spreadValues$q({
33
+ boxSizing: "border-box"
34
+ }, (_a = meta.defaultStyles) != null ? _a : {})
34
35
  });
35
36
  if (overrides) {
36
- meta = __spreadProps$e(__spreadValues$r(__spreadValues$r({}, meta), overrides), {
37
- props: __spreadValues$r(__spreadValues$r({}, meta.props), overrides.props)
37
+ meta = __spreadProps$d(__spreadValues$q(__spreadValues$q({}, meta), overrides), {
38
+ props: __spreadValues$q(__spreadValues$q({}, meta.props), overrides.props)
38
39
  });
39
40
  if (overrides.parentComponentName) {
40
41
  meta.name = makeChildComponentName(
@@ -67,16 +68,10 @@ function extractPlasmicDataProps(props) {
67
68
  Object.entries(props).filter(([key]) => key.startsWith("data-plasmic-"))
68
69
  );
69
70
  }
70
- function withoutNils(array) {
71
- return array.filter((x) => x != null);
72
- }
73
71
  function isDefined(thing) {
74
72
  return thing !== void 0 && thing !== null;
75
73
  }
76
74
 
77
- const defaultStyles = {
78
- boxSizing: "border-box"
79
- };
80
75
  function hasParent(_props, ctx) {
81
76
  return isDefined(ctx == null ? void 0 : ctx.parent) === true;
82
77
  }
@@ -107,6 +102,7 @@ function createNameProp() {
107
102
  return {
108
103
  type: "string",
109
104
  description: "Name for this field if it is part of a form",
105
+ displayName: "Form field key",
110
106
  hidden: hasParent,
111
107
  advanced: true
112
108
  };
@@ -462,7 +458,7 @@ function ChangesObserver({
462
458
  updateInteractionVariant(changes);
463
459
  }
464
460
  }, [changes, updateInteractionVariant]);
465
- return children;
461
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
466
462
  }
467
463
  function realWithObservedValues(children, changes, updateInteractionVariant) {
468
464
  return /* @__PURE__ */ React.createElement(
@@ -483,33 +479,33 @@ function pickAriaComponentVariants(keys) {
483
479
  };
484
480
  }
485
481
 
486
- var __defProp$q = Object.defineProperty;
487
- var __defProps$d = Object.defineProperties;
488
- var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
489
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
490
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
491
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
492
- var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
493
- var __spreadValues$q = (a, b) => {
482
+ var __defProp$p = Object.defineProperty;
483
+ var __defProps$c = Object.defineProperties;
484
+ var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
485
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
486
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
487
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
488
+ var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
489
+ var __spreadValues$p = (a, b) => {
494
490
  for (var prop in b || (b = {}))
495
- if (__hasOwnProp$q.call(b, prop))
496
- __defNormalProp$q(a, prop, b[prop]);
497
- if (__getOwnPropSymbols$q)
498
- for (var prop of __getOwnPropSymbols$q(b)) {
499
- if (__propIsEnum$q.call(b, prop))
500
- __defNormalProp$q(a, prop, b[prop]);
491
+ if (__hasOwnProp$p.call(b, prop))
492
+ __defNormalProp$p(a, prop, b[prop]);
493
+ if (__getOwnPropSymbols$p)
494
+ for (var prop of __getOwnPropSymbols$p(b)) {
495
+ if (__propIsEnum$p.call(b, prop))
496
+ __defNormalProp$p(a, prop, b[prop]);
501
497
  }
502
498
  return a;
503
499
  };
504
- var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
505
- var __objRest$k = (source, exclude) => {
500
+ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
501
+ var __objRest$n = (source, exclude) => {
506
502
  var target = {};
507
503
  for (var prop in source)
508
- if (__hasOwnProp$q.call(source, prop) && exclude.indexOf(prop) < 0)
504
+ if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
509
505
  target[prop] = source[prop];
510
- if (source != null && __getOwnPropSymbols$q)
511
- for (var prop of __getOwnPropSymbols$q(source)) {
512
- if (exclude.indexOf(prop) < 0 && __propIsEnum$q.call(source, prop))
506
+ if (source != null && __getOwnPropSymbols$p)
507
+ for (var prop of __getOwnPropSymbols$p(source)) {
508
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
513
509
  target[prop] = source[prop];
514
510
  }
515
511
  return target;
@@ -521,7 +517,7 @@ const BUTTON_INTERACTION_VARIANTS = [
521
517
  "focusVisible",
522
518
  "disabled"
523
519
  ];
524
- const { interactionVariants: interactionVariants$c, withObservedValues: withObservedValues$a } = pickAriaComponentVariants(
520
+ const { interactionVariants: interactionVariants$d, withObservedValues: withObservedValues$b } = pickAriaComponentVariants(
525
521
  BUTTON_INTERACTION_VARIANTS
526
522
  );
527
523
  function BaseButton(props) {
@@ -530,14 +526,14 @@ function BaseButton(props) {
530
526
  resetsForm,
531
527
  children,
532
528
  updateInteractionVariant
533
- } = _a, rest = __objRest$k(_a, [
529
+ } = _a, rest = __objRest$n(_a, [
534
530
  "submitsForm",
535
531
  "resetsForm",
536
532
  "children",
537
533
  "updateInteractionVariant"
538
534
  ]);
539
535
  const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
540
- return /* @__PURE__ */ React.createElement(Button, __spreadValues$q({ type }, rest), ({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) => withObservedValues$a(
536
+ return /* @__PURE__ */ React.createElement(Button, __spreadValues$p({ type }, rest), ({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) => withObservedValues$b(
541
537
  children,
542
538
  {
543
539
  hovered: isHovered,
@@ -559,7 +555,7 @@ function registerButton(loader, overrides) {
559
555
  displayName: "Aria Button",
560
556
  importPath: "@plasmicpkgs/react-aria/skinny/registerButton",
561
557
  importName: "BaseButton",
562
- interactionVariants: interactionVariants$c,
558
+ interactionVariants: interactionVariants$d,
563
559
  defaultStyles: {
564
560
  borderWidth: "1px",
565
561
  borderStyle: "solid",
@@ -567,7 +563,8 @@ function registerButton(loader, overrides) {
567
563
  padding: "2px 10px",
568
564
  cursor: "pointer"
569
565
  },
570
- props: __spreadProps$d(__spreadValues$q({}, getCommonProps("button", [
566
+ props: __spreadProps$c(__spreadValues$p({}, getCommonProps("button", [
567
+ "autoFocus",
571
568
  "isDisabled",
572
569
  "aria-label"
573
570
  ])), {
@@ -614,38 +611,36 @@ const PlasmicSliderContext = React.createContext(void 0);
614
611
  React.createContext(void 0);
615
612
  const PlasmicPopoverContext = React.createContext(void 0);
616
613
  const PlasmicListBoxContext = React.createContext(void 0);
617
- const PlasmicItemContext = React.createContext(void 0);
618
- const PlasmicSectionContext = React.createContext(void 0);
619
- const PlasmicHeaderContext = React.createContext(void 0);
620
- const PlasmicInputContext = React.createContext(void 0);
614
+ React.createContext(void 0);
615
+ React.createContext(void 0);
621
616
 
622
- var __defProp$p = Object.defineProperty;
623
- var __defProps$c = Object.defineProperties;
624
- var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
625
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
626
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
627
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
628
- var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
629
- var __spreadValues$p = (a, b) => {
617
+ var __defProp$o = Object.defineProperty;
618
+ var __defProps$b = Object.defineProperties;
619
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
620
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
621
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
622
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
623
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
624
+ var __spreadValues$o = (a, b) => {
630
625
  for (var prop in b || (b = {}))
631
- if (__hasOwnProp$p.call(b, prop))
632
- __defNormalProp$p(a, prop, b[prop]);
633
- if (__getOwnPropSymbols$p)
634
- for (var prop of __getOwnPropSymbols$p(b)) {
635
- if (__propIsEnum$p.call(b, prop))
636
- __defNormalProp$p(a, prop, b[prop]);
626
+ if (__hasOwnProp$o.call(b, prop))
627
+ __defNormalProp$o(a, prop, b[prop]);
628
+ if (__getOwnPropSymbols$o)
629
+ for (var prop of __getOwnPropSymbols$o(b)) {
630
+ if (__propIsEnum$o.call(b, prop))
631
+ __defNormalProp$o(a, prop, b[prop]);
637
632
  }
638
633
  return a;
639
634
  };
640
- var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
641
- var __objRest$j = (source, exclude) => {
635
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
636
+ var __objRest$m = (source, exclude) => {
642
637
  var target = {};
643
638
  for (var prop in source)
644
- if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
639
+ if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
645
640
  target[prop] = source[prop];
646
- if (source != null && __getOwnPropSymbols$p)
647
- for (var prop of __getOwnPropSymbols$p(source)) {
648
- if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
641
+ if (source != null && __getOwnPropSymbols$o)
642
+ for (var prop of __getOwnPropSymbols$o(source)) {
643
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
649
644
  target[prop] = source[prop];
650
645
  }
651
646
  return target;
@@ -661,16 +656,16 @@ const CHECKBOX_INTERACTION_VARIANTS = [
661
656
  "readonly",
662
657
  "selected"
663
658
  ];
664
- const { interactionVariants: interactionVariants$b, withObservedValues: withObservedValues$9 } = pickAriaComponentVariants(
659
+ const { interactionVariants: interactionVariants$c, withObservedValues: withObservedValues$a } = pickAriaComponentVariants(
665
660
  CHECKBOX_INTERACTION_VARIANTS
666
661
  );
667
662
  function BaseCheckbox(props) {
668
- const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$j(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
663
+ const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$m(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
669
664
  const contextProps = React.useContext(PlasmicCheckboxGroupContext);
670
665
  setControlContextData == null ? void 0 : setControlContextData({
671
666
  parent: contextProps
672
667
  });
673
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Checkbox, __spreadValues$p({}, rest), ({
668
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Checkbox, __spreadValues$o({}, rest), ({
674
669
  isHovered,
675
670
  isPressed,
676
671
  isFocused,
@@ -679,7 +674,7 @@ function BaseCheckbox(props) {
679
674
  isIndeterminate,
680
675
  isSelected,
681
676
  isReadOnly
682
- }) => withObservedValues$9(
677
+ }) => withObservedValues$a(
683
678
  children,
684
679
  {
685
680
  hovered: isHovered,
@@ -749,8 +744,8 @@ function registerCheckbox(loader, overrides) {
749
744
  displayName: "Aria Checkbox",
750
745
  importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
751
746
  importName: "BaseCheckbox",
752
- interactionVariants: interactionVariants$b,
753
- props: __spreadProps$c(__spreadValues$p({}, getCommonProps("checkbox", [
747
+ interactionVariants: interactionVariants$c,
748
+ props: __spreadProps$b(__spreadValues$o({}, getCommonProps("checkbox", [
754
749
  "name",
755
750
  "isDisabled",
756
751
  "isReadOnly",
@@ -818,37 +813,37 @@ function registerCheckbox(loader, overrides) {
818
813
  );
819
814
  }
820
815
 
821
- var __defProp$o = Object.defineProperty;
822
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
823
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
824
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
825
- var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
826
- var __spreadValues$o = (a, b) => {
816
+ var __defProp$n = Object.defineProperty;
817
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
818
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
819
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
820
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
821
+ var __spreadValues$n = (a, b) => {
827
822
  for (var prop in b || (b = {}))
828
- if (__hasOwnProp$o.call(b, prop))
829
- __defNormalProp$o(a, prop, b[prop]);
830
- if (__getOwnPropSymbols$o)
831
- for (var prop of __getOwnPropSymbols$o(b)) {
832
- if (__propIsEnum$o.call(b, prop))
833
- __defNormalProp$o(a, prop, b[prop]);
823
+ if (__hasOwnProp$n.call(b, prop))
824
+ __defNormalProp$n(a, prop, b[prop]);
825
+ if (__getOwnPropSymbols$n)
826
+ for (var prop of __getOwnPropSymbols$n(b)) {
827
+ if (__propIsEnum$n.call(b, prop))
828
+ __defNormalProp$n(a, prop, b[prop]);
834
829
  }
835
830
  return a;
836
831
  };
837
- var __objRest$i = (source, exclude) => {
832
+ var __objRest$l = (source, exclude) => {
838
833
  var target = {};
839
834
  for (var prop in source)
840
- if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
835
+ if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
841
836
  target[prop] = source[prop];
842
- if (source != null && __getOwnPropSymbols$o)
843
- for (var prop of __getOwnPropSymbols$o(source)) {
844
- if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
837
+ if (source != null && __getOwnPropSymbols$n)
838
+ for (var prop of __getOwnPropSymbols$n(source)) {
839
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
845
840
  target[prop] = source[prop];
846
841
  }
847
842
  return target;
848
843
  };
849
844
  function BaseText(_a) {
850
- var _b = _a, { children } = _b, rest = __objRest$i(_b, ["children"]);
851
- return /* @__PURE__ */ React.createElement(Text, __spreadValues$o({}, rest), children);
845
+ var _b = _a, { children } = _b, rest = __objRest$l(_b, ["children"]);
846
+ return /* @__PURE__ */ React.createElement(Text, __spreadValues$n({}, rest), children);
852
847
  }
853
848
  const TEXT_COMPONENT_NAME = makeComponentName("text");
854
849
  function registerText(loader, overrides) {
@@ -882,28 +877,28 @@ function registerText(loader, overrides) {
882
877
  );
883
878
  }
884
879
 
885
- var __defProp$n = Object.defineProperty;
886
- var __defProps$b = Object.defineProperties;
887
- var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
888
- var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
889
- var __hasOwnProp$n = Object.prototype.hasOwnProperty;
890
- var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
891
- var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
892
- var __spreadValues$n = (a, b) => {
880
+ var __defProp$m = Object.defineProperty;
881
+ var __defProps$a = Object.defineProperties;
882
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
883
+ var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
884
+ var __hasOwnProp$m = Object.prototype.hasOwnProperty;
885
+ var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
886
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
887
+ var __spreadValues$m = (a, b) => {
893
888
  for (var prop in b || (b = {}))
894
- if (__hasOwnProp$n.call(b, prop))
895
- __defNormalProp$n(a, prop, b[prop]);
896
- if (__getOwnPropSymbols$n)
897
- for (var prop of __getOwnPropSymbols$n(b)) {
898
- if (__propIsEnum$n.call(b, prop))
899
- __defNormalProp$n(a, prop, b[prop]);
889
+ if (__hasOwnProp$m.call(b, prop))
890
+ __defNormalProp$m(a, prop, b[prop]);
891
+ if (__getOwnPropSymbols$m)
892
+ for (var prop of __getOwnPropSymbols$m(b)) {
893
+ if (__propIsEnum$m.call(b, prop))
894
+ __defNormalProp$m(a, prop, b[prop]);
900
895
  }
901
896
  return a;
902
897
  };
903
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
898
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
904
899
  const DESCRIPTION_COMPONENT_NAME = makeComponentName("description");
905
900
  function registerDescription(loader, overrides) {
906
- return registerText(loader, __spreadProps$b(__spreadValues$n({}, overrides), {
901
+ return registerText(loader, __spreadProps$a(__spreadValues$m({}, overrides), {
907
902
  name: DESCRIPTION_COMPONENT_NAME,
908
903
  displayName: "Aria Description",
909
904
  props: {
@@ -916,30 +911,30 @@ function registerDescription(loader, overrides) {
916
911
  }));
917
912
  }
918
913
 
919
- var __defProp$m = Object.defineProperty;
920
- var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
921
- var __hasOwnProp$m = Object.prototype.hasOwnProperty;
922
- var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
923
- var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
924
- var __spreadValues$m = (a, b) => {
914
+ var __defProp$l = Object.defineProperty;
915
+ var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
916
+ var __hasOwnProp$l = Object.prototype.hasOwnProperty;
917
+ var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
918
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
919
+ var __spreadValues$l = (a, b) => {
925
920
  for (var prop in b || (b = {}))
926
- if (__hasOwnProp$m.call(b, prop))
927
- __defNormalProp$m(a, prop, b[prop]);
928
- if (__getOwnPropSymbols$m)
929
- for (var prop of __getOwnPropSymbols$m(b)) {
930
- if (__propIsEnum$m.call(b, prop))
931
- __defNormalProp$m(a, prop, b[prop]);
921
+ if (__hasOwnProp$l.call(b, prop))
922
+ __defNormalProp$l(a, prop, b[prop]);
923
+ if (__getOwnPropSymbols$l)
924
+ for (var prop of __getOwnPropSymbols$l(b)) {
925
+ if (__propIsEnum$l.call(b, prop))
926
+ __defNormalProp$l(a, prop, b[prop]);
932
927
  }
933
928
  return a;
934
929
  };
935
- var __objRest$h = (source, exclude) => {
930
+ var __objRest$k = (source, exclude) => {
936
931
  var target = {};
937
932
  for (var prop in source)
938
- if (__hasOwnProp$m.call(source, prop) && exclude.indexOf(prop) < 0)
933
+ if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
939
934
  target[prop] = source[prop];
940
- if (source != null && __getOwnPropSymbols$m)
941
- for (var prop of __getOwnPropSymbols$m(source)) {
942
- if (exclude.indexOf(prop) < 0 && __propIsEnum$m.call(source, prop))
935
+ if (source != null && __getOwnPropSymbols$l)
936
+ for (var prop of __getOwnPropSymbols$l(source)) {
937
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
943
938
  target[prop] = source[prop];
944
939
  }
945
940
  return target;
@@ -956,7 +951,7 @@ function BaseFieldError(_a) {
956
951
  tooShort,
957
952
  typeMismatch,
958
953
  valueMissing
959
- } = _b, rest = __objRest$h(_b, [
954
+ } = _b, rest = __objRest$k(_b, [
960
955
  "badInput",
961
956
  "customError",
962
957
  "patternMismatch",
@@ -968,7 +963,7 @@ function BaseFieldError(_a) {
968
963
  "typeMismatch",
969
964
  "valueMissing"
970
965
  ]);
971
- return /* @__PURE__ */ React.createElement(FieldError, __spreadValues$m({}, rest), ({ validationDetails, validationErrors }) => {
966
+ return /* @__PURE__ */ React.createElement(FieldError, __spreadValues$l({}, rest), ({ validationDetails, validationErrors }) => {
972
967
  if (validationDetails.badInput && badInput) {
973
968
  return badInput;
974
969
  }
@@ -1100,33 +1095,33 @@ function registerLabel(loader, overrides) {
1100
1095
  );
1101
1096
  }
1102
1097
 
1103
- var __defProp$l = Object.defineProperty;
1104
- var __defProps$a = Object.defineProperties;
1105
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
1106
- var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
1107
- var __hasOwnProp$l = Object.prototype.hasOwnProperty;
1108
- var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
1109
- var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1110
- var __spreadValues$l = (a, b) => {
1098
+ var __defProp$k = Object.defineProperty;
1099
+ var __defProps$9 = Object.defineProperties;
1100
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
1101
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
1102
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
1103
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
1104
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1105
+ var __spreadValues$k = (a, b) => {
1111
1106
  for (var prop in b || (b = {}))
1112
- if (__hasOwnProp$l.call(b, prop))
1113
- __defNormalProp$l(a, prop, b[prop]);
1114
- if (__getOwnPropSymbols$l)
1115
- for (var prop of __getOwnPropSymbols$l(b)) {
1116
- if (__propIsEnum$l.call(b, prop))
1117
- __defNormalProp$l(a, prop, b[prop]);
1107
+ if (__hasOwnProp$k.call(b, prop))
1108
+ __defNormalProp$k(a, prop, b[prop]);
1109
+ if (__getOwnPropSymbols$k)
1110
+ for (var prop of __getOwnPropSymbols$k(b)) {
1111
+ if (__propIsEnum$k.call(b, prop))
1112
+ __defNormalProp$k(a, prop, b[prop]);
1118
1113
  }
1119
1114
  return a;
1120
1115
  };
1121
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
1122
- var __objRest$g = (source, exclude) => {
1116
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
1117
+ var __objRest$j = (source, exclude) => {
1123
1118
  var target = {};
1124
1119
  for (var prop in source)
1125
- if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
1120
+ if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
1126
1121
  target[prop] = source[prop];
1127
- if (source != null && __getOwnPropSymbols$l)
1128
- for (var prop of __getOwnPropSymbols$l(source)) {
1129
- if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
1122
+ if (source != null && __getOwnPropSymbols$k)
1123
+ for (var prop of __getOwnPropSymbols$k(source)) {
1124
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
1130
1125
  target[prop] = source[prop];
1131
1126
  }
1132
1127
  return target;
@@ -1135,12 +1130,12 @@ const CHECKBOX_GROUP_INTERACTION_VARIANTS = [
1135
1130
  "disabled",
1136
1131
  "readonly"
1137
1132
  ];
1138
- const { interactionVariants: interactionVariants$a, withObservedValues: withObservedValues$8 } = pickAriaComponentVariants(
1133
+ const { interactionVariants: interactionVariants$b, withObservedValues: withObservedValues$9 } = pickAriaComponentVariants(
1139
1134
  CHECKBOX_GROUP_INTERACTION_VARIANTS
1140
1135
  );
1141
1136
  function BaseCheckboxGroup(props) {
1142
- const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$g(_a, ["children", "updateInteractionVariant"]);
1143
- return /* @__PURE__ */ React.createElement(PlasmicCheckboxGroupContext.Provider, { value: rest }, /* @__PURE__ */ React.createElement(CheckboxGroup, __spreadValues$l({}, rest), ({ isDisabled, isReadOnly }) => withObservedValues$8(
1137
+ const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$j(_a, ["children", "updateInteractionVariant"]);
1138
+ return /* @__PURE__ */ React.createElement(PlasmicCheckboxGroupContext.Provider, { value: rest }, /* @__PURE__ */ React.createElement(CheckboxGroup, __spreadValues$k({}, rest), ({ isDisabled, isReadOnly }) => withObservedValues$9(
1144
1139
  children,
1145
1140
  {
1146
1141
  disabled: isDisabled,
@@ -1168,8 +1163,8 @@ function registerCheckboxGroup(loader, overrides) {
1168
1163
  displayName: "Aria Checkbox Group",
1169
1164
  importPath: "@plasmicpkgs/react-aria/skinny/registerCheckboxGroup",
1170
1165
  importName: "BaseCheckboxGroup",
1171
- interactionVariants: interactionVariants$a,
1172
- props: __spreadProps$a(__spreadValues$l({}, getCommonProps("checkbox group", [
1166
+ interactionVariants: interactionVariants$b,
1167
+ props: __spreadProps$9(__spreadValues$k({}, getCommonProps("checkbox group", [
1173
1168
  "name",
1174
1169
  "isDisabled",
1175
1170
  "isReadOnly",
@@ -1284,195 +1279,80 @@ function registerCheckboxGroup(loader, overrides) {
1284
1279
  );
1285
1280
  }
1286
1281
 
1287
- function useStrictOptions(props) {
1288
- const { options, optionInfo } = props;
1289
- return React.useMemo(() => {
1290
- return deriveStrictOptions({ options, optionInfo });
1291
- }, [options, optionInfo]);
1292
- }
1293
- function deriveStrictOptions(props) {
1294
- var _a;
1295
- const { options, optionInfo } = props;
1296
- let sectionCount = 0;
1297
- const makeStrict = (op) => {
1298
- var _a2, _b, _c, _d, _e, _f;
1299
- if (!op) {
1300
- return void 0;
1301
- } else if (typeof op === "string" || typeof op === "number") {
1302
- const item = {
1303
- id: op
1304
- };
1305
- return item;
1306
- } else if (optionInfo) {
1307
- const info = optionInfo(op);
1308
- if (info.type === "option-group") {
1309
- const section = {
1310
- type: "option-group",
1311
- items: (_c = (_b = (_a2 = info.items) == null ? void 0 : _a2.map) == null ? void 0 : _b.call(_a2, (item) => makeStrict(item))) == null ? void 0 : _c.filter((x) => !!x),
1312
- label: info.label,
1313
- key: `option-group-${sectionCount}`
1314
- };
1315
- sectionCount += 1;
1316
- return section;
1317
- } else {
1318
- let item = info;
1319
- if (!("id" in item)) {
1320
- item = {
1321
- type: "option",
1322
- id: JSON.stringify(item)
1323
- };
1324
- }
1325
- return item;
1326
- }
1327
- } else if (typeof op === "object") {
1328
- if ("items" in op) {
1329
- const section = {
1330
- type: "option-group",
1331
- items: (_f = (_e = (_d = op.items) == null ? void 0 : _d.map) == null ? void 0 : _e.call(_d, (item) => makeStrict(item))) == null ? void 0 : _f.filter((x) => !!x),
1332
- label: op.label,
1333
- key: `option-group-${sectionCount}`
1334
- };
1335
- sectionCount += 1;
1336
- return section;
1337
- } else {
1338
- let item = op;
1339
- if (!("id" in item)) {
1340
- item = {
1341
- type: "option",
1342
- id: JSON.stringify(item)
1343
- };
1344
- }
1345
- return item;
1346
- }
1282
+ class ListBoxItemIdManager {
1283
+ constructor() {
1284
+ this._ids = /* @__PURE__ */ new Set();
1285
+ this._observers = /* @__PURE__ */ new Set();
1286
+ }
1287
+ generateDuplicateId(id, count = 1) {
1288
+ const dupId = `${id} duplicate(${count})`;
1289
+ if (this._ids.has(dupId)) {
1290
+ return this.generateDuplicateId(id, count + 1);
1347
1291
  } else {
1348
- return void 0;
1292
+ return dupId;
1293
+ }
1294
+ }
1295
+ generateMissingId(count = 1) {
1296
+ const missingId = `missing(${count})`;
1297
+ if (this._ids.has(missingId)) {
1298
+ return this.generateMissingId(count + 1);
1299
+ } else {
1300
+ return missingId;
1349
1301
  }
1350
- };
1351
- const strictOptions = (_a = options == null ? void 0 : options.map(makeStrict)) == null ? void 0 : _a.filter((x) => !!x);
1352
- const optionText = (op) => {
1353
- var _a2;
1354
- return (_a2 = op.label) != null ? _a2 : op.id;
1355
- };
1356
- return { options: strictOptions, optionText };
1357
- }
1358
- function flattenOptions(options) {
1359
- if (!options) {
1360
- return [];
1361
- } else {
1362
- return options.flatMap(
1363
- (op) => {
1364
- var _a;
1365
- return op.type === "option-group" ? (_a = op.items) != null ? _a : [] : op;
1366
- }
1367
- );
1368
1302
  }
1369
- }
1370
- function makeOptionsPropType() {
1371
- const type = {
1372
- type: "array",
1373
- itemType: {
1374
- type: "object",
1375
- nameFunc: (item) => item.label || item.id,
1376
- fields: {
1377
- type: {
1378
- type: "choice",
1379
- options: [
1380
- { value: "option", label: "Option" },
1381
- { value: "option-group", label: "Option Group" }
1382
- ],
1383
- defaultValue: "option"
1384
- },
1385
- id: {
1386
- type: "string",
1387
- hidden: (_ps, _ctx, { item }) => item.type !== "option"
1388
- },
1389
- label: "string",
1390
- items: {
1391
- type: "array",
1392
- displayName: "Options",
1393
- hidden: (_ps, _ctx, { item }) => {
1394
- return item.type !== "option-group";
1395
- },
1396
- itemType: {
1397
- type: "object",
1398
- nameFunc: (item) => item.label || item.id,
1399
- fields: {
1400
- id: "string",
1401
- label: "string"
1402
- }
1403
- }
1404
- }
1405
- }
1406
- },
1407
- defaultValue: [
1408
- {
1409
- id: "option1",
1410
- label: "Option 1",
1411
- type: "option"
1412
- },
1413
- {
1414
- id: "option2",
1415
- label: "Option 2",
1416
- type: "option"
1417
- },
1418
- {
1419
- label: "Section 1",
1420
- type: "option-group",
1421
- items: [
1422
- {
1423
- id: "section-1-1",
1424
- label: "Section item 1",
1425
- type: "option"
1426
- },
1427
- {
1428
- id: "section-1-2",
1429
- label: "Section item 2",
1430
- type: "option"
1431
- }
1432
- ]
1433
- }
1434
- ]
1435
- };
1436
- return type;
1437
- }
1438
- function makeValuePropType() {
1439
- const type = {
1440
- type: "choice",
1441
- options: (ps) => {
1442
- const { options, optionText } = deriveStrictOptions(ps);
1443
- return flattenOptions(options).map((op) => ({
1444
- value: op.id,
1445
- label: optionText(op)
1446
- }));
1447
- }
1448
- };
1449
- return type;
1303
+ register(id) {
1304
+ let newId;
1305
+ if (!id) {
1306
+ newId = this.generateMissingId();
1307
+ } else if (this._ids.has(id)) {
1308
+ newId = this.generateDuplicateId(id);
1309
+ } else {
1310
+ newId = id;
1311
+ }
1312
+ this._ids.add(newId);
1313
+ this.notify();
1314
+ return newId;
1315
+ }
1316
+ unregister(id) {
1317
+ this._ids.delete(id);
1318
+ this.notify();
1319
+ }
1320
+ subscribe(observer) {
1321
+ this._observers.add(observer);
1322
+ }
1323
+ // Notify all observers about an event.
1324
+ notify() {
1325
+ this._observers.forEach((observer) => observer(this.ids));
1326
+ }
1327
+ get ids() {
1328
+ return Array.from(this._ids);
1329
+ }
1450
1330
  }
1451
1331
 
1452
- var __defProp$k = Object.defineProperty;
1453
- var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
1454
- var __hasOwnProp$k = Object.prototype.hasOwnProperty;
1455
- var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
1456
- var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1457
- var __spreadValues$k = (a, b) => {
1332
+ var __defProp$j = Object.defineProperty;
1333
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
1334
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
1335
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
1336
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1337
+ var __spreadValues$j = (a, b) => {
1458
1338
  for (var prop in b || (b = {}))
1459
- if (__hasOwnProp$k.call(b, prop))
1460
- __defNormalProp$k(a, prop, b[prop]);
1461
- if (__getOwnPropSymbols$k)
1462
- for (var prop of __getOwnPropSymbols$k(b)) {
1463
- if (__propIsEnum$k.call(b, prop))
1464
- __defNormalProp$k(a, prop, b[prop]);
1339
+ if (__hasOwnProp$j.call(b, prop))
1340
+ __defNormalProp$j(a, prop, b[prop]);
1341
+ if (__getOwnPropSymbols$j)
1342
+ for (var prop of __getOwnPropSymbols$j(b)) {
1343
+ if (__propIsEnum$j.call(b, prop))
1344
+ __defNormalProp$j(a, prop, b[prop]);
1465
1345
  }
1466
1346
  return a;
1467
1347
  };
1468
- var __objRest$f = (source, exclude) => {
1348
+ var __objRest$i = (source, exclude) => {
1469
1349
  var target = {};
1470
1350
  for (var prop in source)
1471
- if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
1351
+ if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
1472
1352
  target[prop] = source[prop];
1473
- if (source != null && __getOwnPropSymbols$k)
1474
- for (var prop of __getOwnPropSymbols$k(source)) {
1475
- if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
1353
+ if (source != null && __getOwnPropSymbols$j)
1354
+ for (var prop of __getOwnPropSymbols$j(source)) {
1355
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
1476
1356
  target[prop] = source[prop];
1477
1357
  }
1478
1358
  return target;
@@ -1482,7 +1362,7 @@ const INPUT_INTERACTION_VARIANTS = [
1482
1362
  "hovered",
1483
1363
  "disabled"
1484
1364
  ];
1485
- const { interactionVariants: interactionVariants$9 } = pickAriaComponentVariants(
1365
+ const { interactionVariants: interactionVariants$a } = pickAriaComponentVariants(
1486
1366
  INPUT_INTERACTION_VARIANTS
1487
1367
  );
1488
1368
  const inputHelpers$1 = {
@@ -1501,7 +1381,7 @@ function BaseInput(props) {
1501
1381
  setControlContextData,
1502
1382
  disabled,
1503
1383
  autoComplete
1504
- } = _a, rest = __objRest$f(_a, [
1384
+ } = _a, rest = __objRest$i(_a, [
1505
1385
  "updateInteractionVariant",
1506
1386
  "setControlContextData",
1507
1387
  "disabled",
@@ -1526,7 +1406,7 @@ function BaseInput(props) {
1526
1406
  }, [mergedProps.disabled, updateInteractionVariant]);
1527
1407
  return /* @__PURE__ */ React.createElement(
1528
1408
  Input,
1529
- __spreadValues$k({
1409
+ __spreadValues$j({
1530
1410
  autoComplete: resolveAutoComplete(autoComplete),
1531
1411
  onHoverChange: (isHovered) => {
1532
1412
  updateInteractionVariant == null ? void 0 : updateInteractionVariant({
@@ -1556,15 +1436,15 @@ function registerInput(loader, overrides) {
1556
1436
  displayName: "Aria Input",
1557
1437
  importPath: "@plasmicpkgs/react-aria/skinny/registerInput",
1558
1438
  importName: "BaseInput",
1559
- interactionVariants: interactionVariants$9,
1439
+ interactionVariants: interactionVariants$a,
1560
1440
  defaultStyles: {
1561
1441
  width: "300px",
1562
1442
  borderWidth: "1px",
1563
1443
  borderStyle: "solid",
1564
1444
  borderColor: "black",
1565
- padding: "2px 10px"
1445
+ padding: "4px 10px"
1566
1446
  },
1567
- props: __spreadValues$k({}, getCommonProps("Input", [
1447
+ props: __spreadValues$j({}, getCommonProps("Input", [
1568
1448
  "name",
1569
1449
  "disabled",
1570
1450
  "readOnly",
@@ -1595,7 +1475,7 @@ function registerInput(loader, overrides) {
1595
1475
  "onInput"
1596
1476
  ])),
1597
1477
  states: {
1598
- value: __spreadValues$k({
1478
+ value: __spreadValues$j({
1599
1479
  type: "writable",
1600
1480
  valueProp: "value",
1601
1481
  onChangeProp: "onChange",
@@ -1613,46 +1493,98 @@ function registerInput(loader, overrides) {
1613
1493
  );
1614
1494
  }
1615
1495
 
1616
- class ErrorBoundary extends Component {
1617
- constructor(props) {
1618
- super(props);
1619
- this.state = { hasError: false };
1620
- }
1621
- static getDerivedStateFromError(_) {
1622
- return { hasError: true };
1623
- }
1624
- render() {
1625
- if (this.state.hasError) {
1626
- return this.props.fallback;
1627
- }
1628
- return this.props.children;
1629
- }
1630
- }
1631
-
1632
- var __defProp$j = Object.defineProperty;
1633
- var __defProps$9 = Object.defineProperties;
1634
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
1635
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
1636
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
1637
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
1638
- var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1639
- var __spreadValues$j = (a, b) => {
1496
+ var __defProp$i = Object.defineProperty;
1497
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
1498
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
1499
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
1500
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1501
+ var __spreadValues$i = (a, b) => {
1640
1502
  for (var prop in b || (b = {}))
1641
- if (__hasOwnProp$j.call(b, prop))
1642
- __defNormalProp$j(a, prop, b[prop]);
1643
- if (__getOwnPropSymbols$j)
1644
- for (var prop of __getOwnPropSymbols$j(b)) {
1645
- if (__propIsEnum$j.call(b, prop))
1646
- __defNormalProp$j(a, prop, b[prop]);
1503
+ if (__hasOwnProp$i.call(b, prop))
1504
+ __defNormalProp$i(a, prop, b[prop]);
1505
+ if (__getOwnPropSymbols$i)
1506
+ for (var prop of __getOwnPropSymbols$i(b)) {
1507
+ if (__propIsEnum$i.call(b, prop))
1508
+ __defNormalProp$i(a, prop, b[prop]);
1647
1509
  }
1648
1510
  return a;
1649
1511
  };
1650
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
1512
+ var __objRest$h = (source, exclude) => {
1513
+ var target = {};
1514
+ for (var prop in source)
1515
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
1516
+ target[prop] = source[prop];
1517
+ if (source != null && __getOwnPropSymbols$i)
1518
+ for (var prop of __getOwnPropSymbols$i(source)) {
1519
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
1520
+ target[prop] = source[prop];
1521
+ }
1522
+ return target;
1523
+ };
1524
+ const LIST_BOX_ITEM_INTERACTION_VARIANTS = [
1525
+ "hovered",
1526
+ "pressed",
1527
+ "focused",
1528
+ "focusVisible",
1529
+ "selected",
1530
+ "disabled"
1531
+ ];
1532
+ const { interactionVariants: interactionVariants$9, withObservedValues: withObservedValues$8 } = pickAriaComponentVariants(
1533
+ LIST_BOX_ITEM_INTERACTION_VARIANTS
1534
+ );
1651
1535
  function BaseListBoxItem(props) {
1652
- const contextProps = React.useContext(PlasmicItemContext);
1653
- const mergedProps = mergeProps$1(contextProps, props);
1654
- const listboxItem = /* @__PURE__ */ React.createElement(ListBoxItem, __spreadProps$9(__spreadValues$j({}, mergedProps), { textValue: contextProps == null ? void 0 : contextProps.label }), mergedProps.children);
1655
- return /* @__PURE__ */ React.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React.createElement(ListBox, null, listboxItem) }, listboxItem);
1536
+ const _a = props, {
1537
+ children,
1538
+ setControlContextData,
1539
+ updateInteractionVariant,
1540
+ id
1541
+ } = _a, rest = __objRest$h(_a, [
1542
+ "children",
1543
+ "setControlContextData",
1544
+ "updateInteractionVariant",
1545
+ "id"
1546
+ ]);
1547
+ const listboxContext = React.useContext(PlasmicListBoxContext);
1548
+ const isStandalone = !listboxContext;
1549
+ const [registeredId, setRegisteredId] = useState();
1550
+ useEffect(() => {
1551
+ if (!listboxContext) {
1552
+ return;
1553
+ }
1554
+ const localId = listboxContext.idManager.register(id);
1555
+ setRegisteredId(localId);
1556
+ return () => {
1557
+ listboxContext.idManager.unregister(localId);
1558
+ setRegisteredId(void 0);
1559
+ };
1560
+ }, [id]);
1561
+ setControlContextData == null ? void 0 : setControlContextData({
1562
+ // this means that a unique id was registered, different from the provided id
1563
+ hasDuplicateId: !isStandalone && id !== registeredId
1564
+ });
1565
+ const listboxItem = /* @__PURE__ */ React.createElement(ListBoxItem, __spreadValues$i({ key: registeredId, id: registeredId }, rest), ({
1566
+ isHovered,
1567
+ isPressed,
1568
+ isFocused,
1569
+ isFocusVisible,
1570
+ isSelected,
1571
+ isDisabled
1572
+ }) => withObservedValues$8(
1573
+ children,
1574
+ {
1575
+ hovered: isHovered,
1576
+ pressed: isPressed,
1577
+ focused: isFocused,
1578
+ focusVisible: isFocusVisible,
1579
+ selected: isSelected,
1580
+ disabled: isDisabled
1581
+ },
1582
+ updateInteractionVariant
1583
+ ));
1584
+ if (isStandalone) {
1585
+ return /* @__PURE__ */ React.createElement(ListBox, { selectionMode: "single" }, listboxItem);
1586
+ }
1587
+ return listboxItem;
1656
1588
  }
1657
1589
  const makeDefaultListBoxItemChildren = (label, description) => ({
1658
1590
  type: "vbox",
@@ -1700,7 +1632,23 @@ function registerListBoxItem(loader, overrides) {
1700
1632
  displayName: "Aria ListBoxItem",
1701
1633
  importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
1702
1634
  importName: "BaseListBoxItem",
1635
+ interactionVariants: interactionVariants$9,
1703
1636
  props: {
1637
+ id: {
1638
+ type: "string",
1639
+ description: "The id of the item",
1640
+ required: true,
1641
+ validator: (_value, _props, ctx) => {
1642
+ if (ctx == null ? void 0 : ctx.hasDuplicateId) {
1643
+ return "Please make sure the id is unique!";
1644
+ }
1645
+ return true;
1646
+ }
1647
+ },
1648
+ textValue: {
1649
+ type: "string",
1650
+ description: "A text representation of the item's contents, used for features like typeahead."
1651
+ },
1704
1652
  children: {
1705
1653
  type: "slot",
1706
1654
  defaultValue: makeDefaultListBoxItemChildren("Item")
@@ -1711,45 +1659,6 @@ function registerListBoxItem(loader, overrides) {
1711
1659
  );
1712
1660
  }
1713
1661
 
1714
- var __defProp$i = Object.defineProperty;
1715
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
1716
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
1717
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
1718
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1719
- var __spreadValues$i = (a, b) => {
1720
- for (var prop in b || (b = {}))
1721
- if (__hasOwnProp$i.call(b, prop))
1722
- __defNormalProp$i(a, prop, b[prop]);
1723
- if (__getOwnPropSymbols$i)
1724
- for (var prop of __getOwnPropSymbols$i(b)) {
1725
- if (__propIsEnum$i.call(b, prop))
1726
- __defNormalProp$i(a, prop, b[prop]);
1727
- }
1728
- return a;
1729
- };
1730
- function BaseHeader(props) {
1731
- const contextProps = React.useContext(PlasmicHeaderContext);
1732
- return /* @__PURE__ */ React.createElement(Header, __spreadValues$i({}, mergeProps$1(contextProps, props)));
1733
- }
1734
- function registerHeader(loader, overrides) {
1735
- return registerComponentHelper(
1736
- loader,
1737
- BaseHeader,
1738
- {
1739
- name: makeComponentName("header"),
1740
- displayName: "Aria Header",
1741
- importPath: "@plasmicpkgs/react-aria/skinny/registerHeader",
1742
- importName: "BaseHeader",
1743
- defaultStyles: {
1744
- fontWeight: "bold",
1745
- fontSize: "20px"
1746
- },
1747
- props: {}
1748
- },
1749
- overrides
1750
- );
1751
- }
1752
-
1753
1662
  var __defProp$h = Object.defineProperty;
1754
1663
  var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
1755
1664
  var __hasOwnProp$h = Object.prototype.hasOwnProperty;
@@ -1766,22 +1675,25 @@ var __spreadValues$h = (a, b) => {
1766
1675
  }
1767
1676
  return a;
1768
1677
  };
1678
+ var __objRest$g = (source, exclude) => {
1679
+ var target = {};
1680
+ for (var prop in source)
1681
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
1682
+ target[prop] = source[prop];
1683
+ if (source != null && __getOwnPropSymbols$h)
1684
+ for (var prop of __getOwnPropSymbols$h(source)) {
1685
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
1686
+ target[prop] = source[prop];
1687
+ }
1688
+ return target;
1689
+ };
1769
1690
  function BaseSection(props) {
1770
- const contextProps = React.useContext(PlasmicSectionContext);
1771
- const mergedProps = mergeProps$1(contextProps, props);
1772
- const { section, renderHeader, key, renderItem } = mergedProps;
1773
- return /* @__PURE__ */ React.createElement(Section, __spreadValues$h({ id: key }, mergedProps), /* @__PURE__ */ React.createElement(PlasmicHeaderContext.Provider, { value: { children: section == null ? void 0 : section.label } }, renderHeader == null ? void 0 : renderHeader(section)), /* @__PURE__ */ React.createElement(Collection, { items: section == null ? void 0 : section.items }, (item) => {
1774
- return /* @__PURE__ */ React.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
1775
- }));
1691
+ const _a = props, { header, items } = _a, rest = __objRest$g(_a, ["header", "items"]);
1692
+ const contextProps = React.useContext(PlasmicListBoxContext);
1693
+ const mergedProps = mergeProps$1(contextProps, rest);
1694
+ return /* @__PURE__ */ React.createElement(Section, __spreadValues$h({}, mergedProps), /* @__PURE__ */ React.createElement(Header, null, header), items);
1776
1695
  }
1777
1696
  function registerSection(loader, overrides) {
1778
- const thisName = makeChildComponentName(
1779
- overrides == null ? void 0 : overrides.parentComponentName,
1780
- makeComponentName("section")
1781
- );
1782
- const headerMeta = registerHeader(loader, {
1783
- parentComponentName: thisName
1784
- });
1785
1697
  return registerComponentHelper(
1786
1698
  loader,
1787
1699
  BaseSection,
@@ -1795,14 +1707,17 @@ function registerSection(loader, overrides) {
1795
1707
  padding: "10px"
1796
1708
  },
1797
1709
  props: {
1798
- renderHeader: {
1710
+ header: {
1799
1711
  type: "slot",
1800
- displayName: "Render section header",
1801
- renderPropParams: ["sectionProps"],
1802
- defaultValue: {
1803
- type: "component",
1804
- name: headerMeta.name
1805
- }
1712
+ defaultValue: [
1713
+ {
1714
+ type: "text",
1715
+ value: "Section Header."
1716
+ }
1717
+ ]
1718
+ },
1719
+ items: {
1720
+ type: "slot"
1806
1721
  }
1807
1722
  }
1808
1723
  },
@@ -1811,8 +1726,6 @@ function registerSection(loader, overrides) {
1811
1726
  }
1812
1727
 
1813
1728
  var __defProp$g = Object.defineProperty;
1814
- var __defProps$8 = Object.defineProperties;
1815
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
1816
1729
  var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
1817
1730
  var __hasOwnProp$g = Object.prototype.hasOwnProperty;
1818
1731
  var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
@@ -1828,8 +1741,7 @@ var __spreadValues$g = (a, b) => {
1828
1741
  }
1829
1742
  return a;
1830
1743
  };
1831
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
1832
- var __objRest$e = (source, exclude) => {
1744
+ var __objRest$f = (source, exclude) => {
1833
1745
  var target = {};
1834
1746
  for (var prop in source)
1835
1747
  if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
@@ -1841,37 +1753,71 @@ var __objRest$e = (source, exclude) => {
1841
1753
  }
1842
1754
  return target;
1843
1755
  };
1844
- function BaseListBox(props) {
1845
- const contextProps = React.useContext(PlasmicListBoxContext);
1846
- const isStandalone = !contextProps;
1847
- const _a = props, { options: _rawOptions, setControlContextData } = _a, rest = __objRest$e(_a, ["options", "setControlContextData"]);
1848
- const { options } = useStrictOptions(props);
1849
- const _b = mergeProps$1(
1850
- contextProps,
1851
- rest,
1852
- isStandalone ? { items: options } : {}
1853
- ), { renderItem, renderSection } = _b, mergedProps = __objRest$e(_b, ["renderItem", "renderSection"]);
1854
- setControlContextData == null ? void 0 : setControlContextData({
1855
- parent: isStandalone ? void 0 : {}
1856
- });
1857
- return /* @__PURE__ */ React.createElement(ListBox, __spreadValues$g({}, mergedProps), (item) => {
1858
- var _a2;
1859
- if (item.type === "option-group") {
1860
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
1861
- PlasmicSectionContext.Provider,
1862
- {
1863
- value: {
1864
- renderItem,
1865
- key: (_a2 = item.key) != null ? _a2 : item.label,
1866
- section: item
1867
- }
1868
- },
1869
- renderSection == null ? void 0 : renderSection(item)
1870
- ));
1871
- } else {
1872
- return /* @__PURE__ */ React.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
1756
+ const listboxHelpers = {
1757
+ states: {
1758
+ selectedKey: {
1759
+ onChangeArgsToValue: (value) => {
1760
+ return Array.from(value)[0];
1761
+ }
1873
1762
  }
1874
- });
1763
+ }
1764
+ };
1765
+ function normalizeSelectedKeys(selectedKeys) {
1766
+ return typeof selectedKeys === "string" && selectedKeys !== "all" ? [selectedKeys] : selectedKeys;
1767
+ }
1768
+ function BaseListBox(props) {
1769
+ const _a = props, {
1770
+ setControlContextData,
1771
+ children,
1772
+ selectedKeys,
1773
+ defaultSelectedKeys
1774
+ } = _a, rest = __objRest$f(_a, [
1775
+ "setControlContextData",
1776
+ "children",
1777
+ "selectedKeys",
1778
+ "defaultSelectedKeys"
1779
+ ]);
1780
+ const context = React.useContext(PlasmicListBoxContext);
1781
+ const isStandalone = !context;
1782
+ const [ids, setIds] = useState([]);
1783
+ const idManager = useMemo(
1784
+ () => {
1785
+ var _a2;
1786
+ return (_a2 = context == null ? void 0 : context.idManager) != null ? _a2 : new ListBoxItemIdManager();
1787
+ },
1788
+ []
1789
+ );
1790
+ useEffect(() => {
1791
+ setControlContextData == null ? void 0 : setControlContextData({
1792
+ itemIds: ids,
1793
+ isStandalone
1794
+ });
1795
+ }, [ids, isStandalone]);
1796
+ useEffect(() => {
1797
+ idManager.subscribe((_ids) => {
1798
+ setIds(_ids);
1799
+ });
1800
+ }, []);
1801
+ const listbox = /* @__PURE__ */ React.createElement(
1802
+ ListBox,
1803
+ __spreadValues$g({
1804
+ selectedKeys: normalizeSelectedKeys(selectedKeys),
1805
+ defaultSelectedKeys: normalizeSelectedKeys(defaultSelectedKeys)
1806
+ }, rest),
1807
+ children
1808
+ );
1809
+ if (isStandalone) {
1810
+ return /* @__PURE__ */ React.createElement(
1811
+ PlasmicListBoxContext.Provider,
1812
+ {
1813
+ value: {
1814
+ idManager
1815
+ }
1816
+ },
1817
+ listbox
1818
+ );
1819
+ }
1820
+ return listbox;
1875
1821
  }
1876
1822
  const LIST_BOX_COMPONENT_NAME = makeComponentName("listbox");
1877
1823
  function registerListBox(loader, overrides) {
@@ -1879,7 +1825,56 @@ function registerListBox(loader, overrides) {
1879
1825
  parentComponentName: LIST_BOX_COMPONENT_NAME
1880
1826
  });
1881
1827
  const sectionMeta = registerSection(loader, {
1882
- parentComponentName: LIST_BOX_COMPONENT_NAME
1828
+ parentComponentName: LIST_BOX_COMPONENT_NAME,
1829
+ props: {
1830
+ items: {
1831
+ type: "slot",
1832
+ defaultValue: [
1833
+ {
1834
+ type: "component",
1835
+ name: listBoxItemMeta.name,
1836
+ props: {
1837
+ id: "section-1-1",
1838
+ textValue: "Section1-Item 1",
1839
+ children: [
1840
+ makeDefaultListBoxItemChildren(
1841
+ "Item 1",
1842
+ "Add dynamic values to make it more interesting"
1843
+ )
1844
+ ]
1845
+ }
1846
+ },
1847
+ {
1848
+ type: "component",
1849
+ name: listBoxItemMeta.name,
1850
+ props: {
1851
+ id: "section-1-2",
1852
+ textValue: "Section1-Item 2",
1853
+ children: [
1854
+ makeDefaultListBoxItemChildren(
1855
+ "Item 2",
1856
+ "Add dynamic values to make it more interesting"
1857
+ )
1858
+ ]
1859
+ }
1860
+ },
1861
+ {
1862
+ type: "component",
1863
+ name: listBoxItemMeta.name,
1864
+ props: {
1865
+ id: "section-1-3",
1866
+ textValue: "Section1-Item 3",
1867
+ children: [
1868
+ makeDefaultListBoxItemChildren(
1869
+ "Item 3",
1870
+ "Add dynamic values to make it more interesting"
1871
+ )
1872
+ ]
1873
+ }
1874
+ }
1875
+ ]
1876
+ }
1877
+ }
1883
1878
  });
1884
1879
  registerComponentHelper(
1885
1880
  loader,
@@ -1896,38 +1891,97 @@ function registerListBox(loader, overrides) {
1896
1891
  borderColor: "black"
1897
1892
  },
1898
1893
  props: {
1899
- options: __spreadProps$8(__spreadValues$g({}, makeOptionsPropType()), {
1900
- displayName: "Items",
1901
- hidden: hasParent
1902
- }),
1903
- renderItem: {
1894
+ children: {
1904
1895
  type: "slot",
1905
- displayName: "Render Item",
1906
- renderPropParams: ["itemProps"],
1907
- defaultValue: {
1908
- type: "component",
1909
- name: listBoxItemMeta.name,
1910
- props: {
1911
- children: makeDefaultListBoxItemChildren(
1912
- "Item (itemProps.label)",
1913
- "Connect with `itemProps` in the data picker to display list box items"
1914
- )
1896
+ displayName: "List Items",
1897
+ allowedComponents: [listBoxItemMeta.name, sectionMeta.name],
1898
+ allowRootWrapper: true,
1899
+ defaultValue: [
1900
+ {
1901
+ type: "component",
1902
+ name: listBoxItemMeta.name,
1903
+ props: {
1904
+ id: "1",
1905
+ textValue: "Item 1",
1906
+ children: [
1907
+ makeDefaultListBoxItemChildren(
1908
+ "Item 1",
1909
+ "Add dynamic values to make it more interesting"
1910
+ )
1911
+ ]
1912
+ }
1913
+ },
1914
+ {
1915
+ type: "component",
1916
+ name: listBoxItemMeta.name,
1917
+ props: {
1918
+ id: "2",
1919
+ textValue: "Item 2",
1920
+ children: [
1921
+ makeDefaultListBoxItemChildren(
1922
+ "Item 2",
1923
+ "Add dynamic values to make it more interesting"
1924
+ )
1925
+ ]
1926
+ }
1927
+ },
1928
+ {
1929
+ type: "component",
1930
+ name: listBoxItemMeta.name,
1931
+ props: {
1932
+ id: "3",
1933
+ textValue: "Item 3",
1934
+ children: [
1935
+ makeDefaultListBoxItemChildren(
1936
+ "Item 3",
1937
+ "Add dynamic values to make it more interesting"
1938
+ )
1939
+ ]
1940
+ }
1941
+ },
1942
+ {
1943
+ type: "component",
1944
+ name: sectionMeta.name
1915
1945
  }
1916
- }
1946
+ ]
1917
1947
  },
1918
- renderSection: {
1919
- type: "slot",
1920
- displayName: "Render Section",
1921
- renderPropParams: ["sectionProps"],
1922
- defaultValue: {
1923
- type: "component",
1924
- name: sectionMeta.name,
1925
- styles: {
1926
- backgroundColor: "#F4FAFF"
1927
- }
1928
- }
1948
+ selectionMode: {
1949
+ type: "choice",
1950
+ description: "The selection mode of the listbox",
1951
+ options: ["none", "single"],
1952
+ defaultValue: "none",
1953
+ hidden: (_props, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
1954
+ },
1955
+ selectedKeys: {
1956
+ type: "choice",
1957
+ description: "The selected keys of the listbox",
1958
+ editOnly: true,
1959
+ uncontrolledProp: "defaultSelectedKeys",
1960
+ displayName: "Initial selected key",
1961
+ options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
1962
+ hidden: (props, ctx) => !(ctx == null ? void 0 : ctx.isStandalone) || props.selectionMode === "none",
1963
+ // We do not support multiple selections yet (Because React Aria select and combobox only support single selections).
1964
+ multiSelect: false
1965
+ },
1966
+ onSelectionChange: {
1967
+ type: "eventHandler",
1968
+ argTypes: [{ name: "itemIds", type: "object" }]
1929
1969
  }
1930
- }
1970
+ },
1971
+ states: {
1972
+ selectedKey: __spreadValues$g({
1973
+ type: "writable",
1974
+ valueProp: "selectedKeys",
1975
+ onChangeProp: "onSelectionChange",
1976
+ variableType: "text"
1977
+ }, listboxHelpers.states.selectedKey)
1978
+ },
1979
+ componentHelpers: {
1980
+ helpers: listboxHelpers,
1981
+ importName: "listboxHelpers",
1982
+ importPath: "@plasmicpkgs/react-aria/skinny/registerListBox"
1983
+ },
1984
+ trapsFocus: true
1931
1985
  },
1932
1986
  overrides
1933
1987
  );
@@ -1949,7 +2003,7 @@ var __spreadValues$f = (a, b) => {
1949
2003
  }
1950
2004
  return a;
1951
2005
  };
1952
- var __objRest$d = (source, exclude) => {
2006
+ var __objRest$e = (source, exclude) => {
1953
2007
  var target = {};
1954
2008
  for (var prop in source)
1955
2009
  if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
@@ -1962,7 +2016,7 @@ var __objRest$d = (source, exclude) => {
1962
2016
  return target;
1963
2017
  };
1964
2018
  function BasePopover(props) {
1965
- const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$d(_a, ["resetClassName", "setControlContextData"]);
2019
+ const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$e(_a, ["resetClassName", "setControlContextData"]);
1966
2020
  const isStandalone = !React.useContext(PopoverContext);
1967
2021
  const context = React.useContext(PlasmicPopoverContext);
1968
2022
  const isInsideSelect = !!React.useContext(SelectContext);
@@ -1995,7 +2049,6 @@ function BasePopover(props) {
1995
2049
  const POPOVER_COMPONENT_NAME = makeComponentName("popover");
1996
2050
  const POPOVER_ARROW_IMG = {
1997
2051
  type: "img",
1998
- // TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/
1999
2052
  src: "https://static1.plasmic.app/arrow-up.svg",
2000
2053
  styles: {
2001
2054
  position: "absolute",
@@ -2059,7 +2112,7 @@ function registerPopover(loader, overrides) {
2059
2112
  type: "number",
2060
2113
  displayName: "Offset",
2061
2114
  description: "Additional offset applied vertically between the popover and its trigger",
2062
- defaultValueHint: 0
2115
+ defaultValueHint: 8
2063
2116
  },
2064
2117
  shouldFlip: {
2065
2118
  type: "boolean",
@@ -2093,8 +2146,8 @@ function registerPopover(loader, overrides) {
2093
2146
  }
2094
2147
 
2095
2148
  var __defProp$e = Object.defineProperty;
2096
- var __defProps$7 = Object.defineProperties;
2097
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
2149
+ var __defProps$8 = Object.defineProperties;
2150
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
2098
2151
  var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
2099
2152
  var __hasOwnProp$e = Object.prototype.hasOwnProperty;
2100
2153
  var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
@@ -2110,226 +2163,77 @@ var __spreadValues$e = (a, b) => {
2110
2163
  }
2111
2164
  return a;
2112
2165
  };
2113
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
2114
- function BaseComboBox(props) {
2115
- const {
2116
- value,
2117
- onChange,
2118
- menuTrigger,
2119
- filterValue,
2120
- onFilterValueChange,
2121
- valueType,
2122
- allowsCustomValue,
2123
- placeholder,
2124
- previewOpen,
2125
- onOpenChange,
2126
- isDisabled,
2127
- className,
2128
- style,
2129
- structure,
2130
- name
2131
- } = props;
2132
- const { options, optionText } = useStrictOptions(props);
2133
- const { contains } = useFilter({ sensitivity: "base" });
2134
- const [showAllOptions, setShowAllOptions] = React.useState(false);
2135
- const filteredOptions = React.useMemo(() => {
2136
- if (!filterValue || filterValue.trim().length === 0) {
2137
- return options;
2138
- }
2139
- if (!options) {
2140
- return options;
2166
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
2167
+ var __objRest$d = (source, exclude) => {
2168
+ var target = {};
2169
+ for (var prop in source)
2170
+ if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
2171
+ target[prop] = source[prop];
2172
+ if (source != null && __getOwnPropSymbols$e)
2173
+ for (var prop of __getOwnPropSymbols$e(source)) {
2174
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
2175
+ target[prop] = source[prop];
2141
2176
  }
2142
- const filterOptions = (opts) => {
2143
- return withoutNils(
2144
- opts.map((op) => {
2145
- if (op.type === "option-group") {
2146
- return __spreadProps$7(__spreadValues$e({}, op), {
2147
- items: op.items ? filterOptions(op.items) : void 0
2148
- });
2149
- } else {
2150
- if (contains(optionText(op), filterValue)) {
2151
- return op;
2152
- } else {
2153
- return void 0;
2154
- }
2155
- }
2156
- })
2157
- );
2158
- };
2159
- return filterOptions(options);
2160
- }, [filterValue, options, contains, optionText]);
2161
- const flattenedOptions = React.useMemo(
2162
- () => flattenOptions(options),
2163
- [options]
2164
- );
2165
- const disabledKeys = flattenedOptions.filter((op) => op.isDisabled).map((op) => op.id);
2166
- const onSelectionChange = React.useCallback(
2167
- (key) => {
2168
- if (key === null) {
2169
- return;
2170
- }
2171
- const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find((op) => op.id === key);
2172
- if (valueType === "text") {
2173
- if (selectedOption) {
2174
- onChange == null ? void 0 : onChange(optionText(selectedOption));
2175
- }
2176
- } else {
2177
- onChange == null ? void 0 : onChange(key);
2178
- }
2179
- if (selectedOption) {
2180
- onFilterValueChange == null ? void 0 : onFilterValueChange(optionText(selectedOption));
2181
- }
2182
- },
2183
- [flattenedOptions, valueType, onChange, optionText, onFilterValueChange]
2184
- );
2185
- const onInputValueChange = React.useCallback(
2186
- (newValue) => {
2187
- onFilterValueChange == null ? void 0 : onFilterValueChange(newValue);
2188
- setShowAllOptions(false);
2189
- if (valueType === "text") {
2190
- if (allowsCustomValue) {
2191
- onChange == null ? void 0 : onChange(newValue);
2192
- } else {
2193
- const matchingOption = flattenedOptions == null ? void 0 : flattenedOptions.find(
2194
- (op) => optionText(op) === newValue
2195
- );
2196
- if (matchingOption) {
2197
- onChange == null ? void 0 : onChange(optionText(matchingOption));
2198
- }
2199
- }
2177
+ return target;
2178
+ };
2179
+ const COMBOBOX_NAME = makeComponentName("combobox");
2180
+ function BaseComboBox(props) {
2181
+ const _a = props, { children, setControlContextData, isOpen } = _a, rest = __objRest$d(_a, ["children", "setControlContextData", "isOpen"]);
2182
+ const idManager = useMemo(() => new ListBoxItemIdManager(), []);
2183
+ useEffect(() => {
2184
+ idManager.subscribe((ids) => {
2185
+ setControlContextData == null ? void 0 : setControlContextData({
2186
+ itemIds: ids
2187
+ });
2188
+ });
2189
+ }, []);
2190
+ return /* @__PURE__ */ React.createElement(ComboBox, __spreadValues$e({}, rest), /* @__PURE__ */ React.createElement(PlasmicPopoverContext.Provider, { value: { isOpen } }, /* @__PURE__ */ React.createElement(
2191
+ PlasmicListBoxContext.Provider,
2192
+ {
2193
+ value: {
2194
+ idManager
2200
2195
  }
2201
2196
  },
2202
- [
2203
- onFilterValueChange,
2204
- onChange,
2205
- flattenedOptions,
2206
- optionText,
2207
- valueType,
2208
- allowsCustomValue
2209
- ]
2210
- );
2211
- const onBlur = React.useCallback(() => {
2212
- if (!allowsCustomValue) {
2213
- const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find(
2214
- (op) => valueType === "text" ? optionText(op) === value : op.id === value
2215
- );
2216
- if (selectedOption) {
2217
- const selectedOptionText = optionText(selectedOption);
2218
- if (selectedOptionText !== filterValue) {
2219
- onFilterValueChange == null ? void 0 : onFilterValueChange(selectedOptionText);
2220
- }
2221
- }
2222
- }
2223
- }, [
2224
- allowsCustomValue,
2225
- flattenedOptions,
2226
- valueType,
2227
- optionText,
2228
- value,
2229
- filterValue,
2230
- onFilterValueChange
2231
- ]);
2232
- return /* @__PURE__ */ React.createElement(
2233
- ComboBox,
2234
- __spreadValues$e({
2235
- selectedKey: value,
2236
- onSelectionChange,
2237
- isDisabled,
2238
- className,
2239
- style,
2240
- items: showAllOptions ? options : filteredOptions,
2241
- menuTrigger,
2242
- inputValue: filterValue,
2243
- onInputChange: onInputValueChange,
2244
- allowsCustomValue,
2245
- disabledKeys,
2246
- onOpenChange: (isOpen, trigger) => {
2247
- if (isOpen && trigger === "manual") {
2248
- setShowAllOptions(true);
2249
- } else {
2250
- setShowAllOptions(false);
2251
- }
2252
- onOpenChange == null ? void 0 : onOpenChange(isOpen);
2253
- },
2254
- onBlur,
2255
- formValue: valueType === "text" ? "text" : "key",
2256
- name
2257
- }, extractPlasmicDataProps(props)),
2258
- /* @__PURE__ */ React.createElement(
2259
- PlasmicListBoxContext.Provider,
2260
- {
2261
- value: {
2262
- getItemType: (option) => option.type === "section" ? "section" : "item"
2263
- }
2264
- },
2265
- /* @__PURE__ */ React.createElement(PlasmicInputContext.Provider, { value: { placeholder } }, structure)
2266
- ),
2267
- /* @__PURE__ */ React.createElement(BaseComboBoxEffects, { previewOpen })
2268
- );
2269
- }
2270
- function BaseComboBoxEffects(props) {
2271
- const { previewOpen } = props;
2272
- const comboBoxState = React.useContext(ComboBoxStateContext);
2273
- const prevPreviewOpenRef = React.useRef(previewOpen);
2274
- React.useEffect(() => {
2275
- if (comboBoxState) {
2276
- if (previewOpen) {
2277
- comboBoxState.open(void 0, "manual");
2278
- } else if (prevPreviewOpenRef.current) {
2279
- comboBoxState.close();
2280
- }
2281
- }
2282
- prevPreviewOpenRef.current = previewOpen;
2283
- }, [previewOpen, comboBoxState, prevPreviewOpenRef]);
2284
- return null;
2197
+ children
2198
+ )));
2285
2199
  }
2286
2200
  function registerComboBox(loader) {
2287
- const rootName = makeComponentName("combobox");
2288
2201
  registerComponentHelper(loader, BaseComboBox, {
2289
- name: rootName,
2202
+ name: COMBOBOX_NAME,
2290
2203
  displayName: "Aria ComboBox",
2291
2204
  importPath: "@plasmicpkgs/react-aria/skinny/registerComboBox",
2292
2205
  importName: "BaseComboBox",
2293
- props: {
2294
- options: makeOptionsPropType(),
2295
- value: makeValuePropType(),
2296
- onChange: {
2297
- type: "eventHandler",
2298
- argTypes: [{ name: "value", type: "string" }]
2299
- },
2300
- filterValue: {
2301
- type: "string"
2302
- },
2303
- onFilterValueChange: {
2304
- type: "eventHandler",
2305
- argTypes: [{ name: "value", type: "string" }]
2306
- },
2307
- isDisabled: {
2308
- type: "boolean"
2309
- },
2310
- valueType: {
2311
- displayName: "`value` Type",
2206
+ props: __spreadProps$8(__spreadValues$e({}, getCommonProps("ComboBox", [
2207
+ "name",
2208
+ "aria-label",
2209
+ "placeholder",
2210
+ "isDisabled"
2211
+ ])), {
2212
+ selectedKey: {
2312
2213
  type: "choice",
2313
- options: [
2314
- { value: "value", label: "By option value" },
2315
- { value: "text", label: "By option text" }
2316
- ],
2317
- defaultValueHint: "value",
2318
- description: "This controls whether `value` and `onChange` are option values or option text. Choosing `text` allows you to optionally allow a custom value that's not in the provided list of options.",
2319
- advanced: true
2214
+ description: "The selected keys of the listbox",
2215
+ editOnly: true,
2216
+ uncontrolledProp: "defaultSelectedKey",
2217
+ displayName: "Initial selected key",
2218
+ options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
2219
+ // React Aria ComboBox do not support multiple comboBoxions yet
2220
+ multiSelect: false
2320
2221
  },
2321
- allowsCustomValue: {
2222
+ isOpen: {
2322
2223
  type: "boolean",
2323
- displayName: "Allows custom value?",
2324
- description: "Allows entering a value that is not one of the options",
2325
- hidden: (ps) => ps.valueType !== "text",
2326
- advanced: true
2224
+ defaultValue: false,
2225
+ // It doesn't make sense to make isOpen prop editable (it's controlled by user interaction and always closed by default), so we keep this prop hidden. We have listed the prop here in the meta only so we can expose a writeable state for it.
2226
+ hidden: () => true
2227
+ },
2228
+ onSelectionChange: {
2229
+ type: "eventHandler",
2230
+ argTypes: [{ name: "selectedKey", type: "string" }]
2327
2231
  },
2328
2232
  onOpenChange: {
2329
2233
  type: "eventHandler",
2330
2234
  argTypes: [{ name: "isOpen", type: "boolean" }]
2331
2235
  },
2332
- structure: {
2236
+ children: {
2333
2237
  type: "slot",
2334
2238
  defaultValue: [
2335
2239
  {
@@ -2353,45 +2257,24 @@ function registerComboBox(loader) {
2353
2257
  },
2354
2258
  {
2355
2259
  type: "hbox",
2356
- styles: {
2357
- width: "stretch",
2358
- borderWidth: "1px",
2359
- borderStyle: "solid",
2360
- borderColor: "black",
2361
- padding: 0,
2362
- position: "relative"
2363
- },
2364
2260
  children: [
2365
2261
  {
2366
2262
  type: "component",
2367
2263
  name: INPUT_COMPONENT_NAME,
2368
2264
  styles: {
2369
- borderWidth: 0,
2370
- width: "100%",
2371
- padding: "2px 30px 2px 10px"
2265
+ width: "100%"
2372
2266
  }
2373
2267
  },
2374
2268
  {
2375
2269
  type: "component",
2376
2270
  name: BUTTON_COMPONENT_NAME,
2377
- styles: {
2378
- borderWidth: 0,
2379
- display: "flex",
2380
- alignItems: "center",
2381
- justifyContent: "center",
2382
- position: "absolute",
2383
- right: "10px",
2384
- top: 0,
2385
- padding: 0,
2386
- height: "100%"
2387
- },
2388
2271
  props: {
2389
2272
  children: {
2390
2273
  type: "img",
2274
+ // TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/
2391
2275
  src: "https://static1.plasmic.app/arrow-up.svg",
2392
2276
  styles: {
2393
- height: "20px",
2394
- width: "20px",
2277
+ width: "15px",
2395
2278
  transform: "rotate(180deg)"
2396
2279
  }
2397
2280
  }
@@ -2404,15 +2287,18 @@ function registerComboBox(loader) {
2404
2287
  name: POPOVER_COMPONENT_NAME,
2405
2288
  styles: {
2406
2289
  backgroundColor: "white",
2407
- width: "300px",
2408
2290
  padding: "10px",
2409
2291
  overflow: "scroll"
2410
2292
  },
2411
2293
  props: {
2294
+ offset: 0,
2412
2295
  children: [
2413
2296
  {
2414
2297
  type: "component",
2415
2298
  name: LIST_BOX_COMPONENT_NAME,
2299
+ props: {
2300
+ selectionMode: "single"
2301
+ },
2416
2302
  styles: {
2417
2303
  borderWidth: 0,
2418
2304
  width: "stretch"
@@ -2424,29 +2310,18 @@ function registerComboBox(loader) {
2424
2310
  ]
2425
2311
  }
2426
2312
  ]
2427
- },
2428
- previewOpen: {
2429
- type: "boolean",
2430
- displayName: "Preview opened?",
2431
- description: "Preview opened state while designing in Plasmic editor",
2432
- editOnly: true
2433
2313
  }
2434
- },
2314
+ }),
2435
2315
  states: {
2436
- value: {
2316
+ selectedKey: {
2437
2317
  type: "writable",
2438
- valueProp: "value",
2439
- onChangeProp: "onChange",
2440
- variableType: "text"
2441
- },
2442
- filterValue: {
2443
- type: "writable",
2444
- valueProp: "filterValue",
2445
- onChangeProp: "onFilterValueChange",
2318
+ valueProp: "selectedKey",
2319
+ onChangeProp: "onSelectionChange",
2446
2320
  variableType: "text"
2447
2321
  },
2448
2322
  isOpen: {
2449
- type: "readonly",
2323
+ type: "writable",
2324
+ valueProp: "isOpen",
2450
2325
  onChangeProp: "onOpenChange",
2451
2326
  variableType: "boolean"
2452
2327
  }
@@ -2455,8 +2330,8 @@ function registerComboBox(loader) {
2455
2330
  }
2456
2331
 
2457
2332
  var __defProp$d = Object.defineProperty;
2458
- var __defProps$6 = Object.defineProperties;
2459
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
2333
+ var __defProps$7 = Object.defineProperties;
2334
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
2460
2335
  var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
2461
2336
  var __hasOwnProp$d = Object.prototype.hasOwnProperty;
2462
2337
  var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
@@ -2472,7 +2347,7 @@ var __spreadValues$d = (a, b) => {
2472
2347
  }
2473
2348
  return a;
2474
2349
  };
2475
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
2350
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
2476
2351
  var __objRest$c = (source, exclude) => {
2477
2352
  var target = {};
2478
2353
  for (var prop in source)
@@ -2526,7 +2401,7 @@ const BaseModal = forwardRef(
2526
2401
  const body = /* @__PURE__ */ React.createElement(React.Fragment, null, heading && /* @__PURE__ */ React.createElement(Heading, { slot: "title" }, heading), children);
2527
2402
  return /* @__PURE__ */ React.createElement(
2528
2403
  ModalOverlay,
2529
- __spreadProps$6(__spreadValues$d({}, mergedProps), {
2404
+ __spreadProps$7(__spreadValues$d({}, mergedProps), {
2530
2405
  className: `${resetClassName} ${modalOverlayClass}`
2531
2406
  }),
2532
2407
  /* @__PURE__ */ React.createElement(Modal, { className }, isCanvas ? body : /* @__PURE__ */ React.createElement(Dialog, null, body))
@@ -2825,8 +2700,8 @@ function registerForm(loader, overrides) {
2825
2700
  }
2826
2701
 
2827
2702
  var __defProp$a = Object.defineProperty;
2828
- var __defProps$5 = Object.defineProperties;
2829
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2703
+ var __defProps$6 = Object.defineProperties;
2704
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
2830
2705
  var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
2831
2706
  var __hasOwnProp$a = Object.prototype.hasOwnProperty;
2832
2707
  var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
@@ -2842,7 +2717,7 @@ var __spreadValues$a = (a, b) => {
2842
2717
  }
2843
2718
  return a;
2844
2719
  };
2845
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2720
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
2846
2721
  var __objRest$9 = (source, exclude) => {
2847
2722
  var target = {};
2848
2723
  for (var prop in source)
@@ -2943,7 +2818,7 @@ function registerRadio(loader, overrides) {
2943
2818
  importPath: "@plasmicpkgs/react-aria/skinny/registerRadio",
2944
2819
  importName: "BaseRadio",
2945
2820
  interactionVariants: interactionVariants$8,
2946
- props: __spreadProps$5(__spreadValues$a({}, getCommonProps("radio", [
2821
+ props: __spreadProps$6(__spreadValues$a({}, getCommonProps("radio", [
2947
2822
  "isDisabled",
2948
2823
  "autoFocus",
2949
2824
  "aria-label"
@@ -2965,8 +2840,8 @@ function registerRadio(loader, overrides) {
2965
2840
  }
2966
2841
 
2967
2842
  var __defProp$9 = Object.defineProperty;
2968
- var __defProps$4 = Object.defineProperties;
2969
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
2843
+ var __defProps$5 = Object.defineProperties;
2844
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2970
2845
  var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
2971
2846
  var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
2972
2847
  var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
@@ -2982,7 +2857,7 @@ var __spreadValues$9 = (a, b) => {
2982
2857
  }
2983
2858
  return a;
2984
2859
  };
2985
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
2860
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2986
2861
  var __objRest$8 = (source, exclude) => {
2987
2862
  var target = {};
2988
2863
  for (var prop in source)
@@ -3031,7 +2906,7 @@ function registerRadioGroup(loader, overrides) {
3031
2906
  importPath: "@plasmicpkgs/react-aria/skinny/registerRadioGroup",
3032
2907
  importName: "BaseRadioGroup",
3033
2908
  interactionVariants: interactionVariants$7,
3034
- props: __spreadProps$4(__spreadValues$9({}, getCommonProps("radio group", [
2909
+ props: __spreadProps$5(__spreadValues$9({}, getCommonProps("radio group", [
3035
2910
  "name",
3036
2911
  "isDisabled",
3037
2912
  "isReadOnly",
@@ -3138,6 +3013,8 @@ function registerRadioGroup(loader, overrides) {
3138
3013
  }
3139
3014
 
3140
3015
  var __defProp$8 = Object.defineProperty;
3016
+ var __defProps$4 = Object.defineProperties;
3017
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
3141
3018
  var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
3142
3019
  var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
3143
3020
  var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
@@ -3153,6 +3030,7 @@ var __spreadValues$8 = (a, b) => {
3153
3030
  }
3154
3031
  return a;
3155
3032
  };
3033
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
3156
3034
  const BaseSelectValue = (props) => {
3157
3035
  const { children, customize } = props;
3158
3036
  return /* @__PURE__ */ React.createElement(SelectValue, null, ({ isPlaceholder, selectedText }) => /* @__PURE__ */ React.createElement(React.Fragment, null, isPlaceholder ? /* @__PURE__ */ React.createElement("span", null, "Select an item") : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", null, customize ? children : selectedText))));
@@ -3160,29 +3038,36 @@ const BaseSelectValue = (props) => {
3160
3038
  const SELECT_NAME = makeComponentName("select");
3161
3039
  function BaseSelect(props) {
3162
3040
  const {
3163
- value,
3164
- onChange,
3041
+ selectedKey,
3042
+ onSelectionChange,
3165
3043
  placeholder,
3166
3044
  previewOpen,
3167
3045
  onOpenChange,
3168
3046
  isDisabled,
3169
3047
  className,
3170
3048
  style,
3171
- structure,
3049
+ children,
3172
3050
  name,
3173
3051
  isOpen,
3052
+ setControlContextData,
3174
3053
  "aria-label": ariaLabel
3175
3054
  } = props;
3176
- const { options } = useStrictOptions(props);
3177
3055
  const isEditMode = !!usePlasmicCanvasContext();
3178
3056
  const openProp = isEditMode && previewOpen ? true : isOpen;
3179
- const disabledKeys = flattenOptions(options).filter((op) => op.isDisabled).map((op) => op.id);
3057
+ let idManager = useMemo(() => new ListBoxItemIdManager(), []);
3058
+ useEffect(() => {
3059
+ idManager.subscribe((ids) => {
3060
+ setControlContextData == null ? void 0 : setControlContextData({
3061
+ itemIds: ids
3062
+ });
3063
+ });
3064
+ }, []);
3180
3065
  return /* @__PURE__ */ React.createElement(
3181
3066
  Select,
3182
3067
  __spreadValues$8({
3183
3068
  placeholder,
3184
- selectedKey: value,
3185
- onSelectionChange: onChange,
3069
+ selectedKey,
3070
+ onSelectionChange,
3186
3071
  onOpenChange,
3187
3072
  isDisabled,
3188
3073
  className,
@@ -3195,11 +3080,10 @@ function BaseSelect(props) {
3195
3080
  PlasmicListBoxContext.Provider,
3196
3081
  {
3197
3082
  value: {
3198
- items: options,
3199
- disabledKeys
3083
+ idManager
3200
3084
  }
3201
3085
  },
3202
- structure
3086
+ children
3203
3087
  ))
3204
3088
  );
3205
3089
  }
@@ -3241,27 +3125,44 @@ function registerSelect(loader) {
3241
3125
  displayName: "Aria Select",
3242
3126
  importPath: "@plasmicpkgs/react-aria/skinny/registerSelect",
3243
3127
  importName: "BaseSelect",
3244
- props: {
3245
- options: makeOptionsPropType(),
3246
- placeholder: {
3247
- type: "string"
3248
- },
3249
- isDisabled: {
3250
- type: "boolean"
3128
+ props: __spreadProps$4(__spreadValues$8({}, getCommonProps("Select", [
3129
+ "name",
3130
+ "aria-label",
3131
+ "placeholder",
3132
+ "isDisabled",
3133
+ "autoFocus"
3134
+ ])), {
3135
+ selectedKey: {
3136
+ type: "choice",
3137
+ description: "The selected keys of the listbox",
3138
+ editOnly: true,
3139
+ uncontrolledProp: "defaultSelectedKey",
3140
+ displayName: "Initial selected key",
3141
+ options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
3142
+ // React Aria Select do not support multiple selections yet
3143
+ multiSelect: false
3251
3144
  },
3252
- value: makeValuePropType(),
3253
- onChange: {
3145
+ onSelectionChange: {
3254
3146
  type: "eventHandler",
3255
3147
  argTypes: [{ name: "value", type: "string" }]
3256
3148
  },
3149
+ disabledKeys: {
3150
+ type: "choice",
3151
+ description: "The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.",
3152
+ options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
3153
+ multiSelect: true,
3154
+ advanced: true
3155
+ },
3257
3156
  previewOpen: {
3258
3157
  type: "boolean",
3259
3158
  displayName: "Preview opened?",
3260
3159
  description: "Preview opened state while designing in Plasmic editor",
3261
- editOnly: true
3160
+ editOnly: true,
3161
+ defaultValue: false
3262
3162
  },
3263
3163
  isOpen: {
3264
3164
  type: "boolean",
3165
+ defaultValue: false,
3265
3166
  // It doesn't make sense to make isOpen prop editable (it's controlled by user interaction and always closed by default), so we keep this prop hidden. We have listed the prop here in the meta only so we can expose a writeable state for it.
3266
3167
  hidden: () => true
3267
3168
  },
@@ -3269,40 +3170,7 @@ function registerSelect(loader) {
3269
3170
  type: "eventHandler",
3270
3171
  argTypes: [{ name: "isOpen", type: "boolean" }]
3271
3172
  },
3272
- // optionValue: {
3273
- // type: "string",
3274
- // displayName: "Field key for an option's value",
3275
- // hidden: (ps) =>
3276
- // !ps.options ||
3277
- // !ps.options[0] ||
3278
- // typeof ps.options[0] === "string" ||
3279
- // "value" in ps.options[0],
3280
- // exprHint:
3281
- // "Return a function that takes in an option object, and returns the key to use",
3282
- // },
3283
- // optionText: {
3284
- // type: "string",
3285
- // displayName: "Field key for an option's text value",
3286
- // hidden: (ps) =>
3287
- // !ps.options ||
3288
- // !ps.options[0] ||
3289
- // typeof ps.options[0] === "string" ||
3290
- // "value" in ps.options[0],
3291
- // exprHint:
3292
- // "Return a function that takes in an option object, and returns the text value to use",
3293
- // },
3294
- // optionDisabled: {
3295
- // type: "string",
3296
- // displayName: "Field key for whether an option is disabled",
3297
- // hidden: (ps) =>
3298
- // !ps.options ||
3299
- // !ps.options[0] ||
3300
- // typeof ps.options[0] === "string" ||
3301
- // "value" in ps.options[0],
3302
- // exprHint:
3303
- // "Return a function that takes in an option object, and returns true if option should be disabled",
3304
- // },
3305
- structure: {
3173
+ children: {
3306
3174
  type: "slot",
3307
3175
  defaultValue: [
3308
3176
  {
@@ -3370,6 +3238,9 @@ function registerSelect(loader) {
3370
3238
  {
3371
3239
  type: "component",
3372
3240
  name: LIST_BOX_COMPONENT_NAME,
3241
+ props: {
3242
+ selectionMode: "single"
3243
+ },
3373
3244
  styles: {
3374
3245
  borderWidth: 0,
3375
3246
  width: "stretch"
@@ -3381,31 +3252,13 @@ function registerSelect(loader) {
3381
3252
  ]
3382
3253
  }
3383
3254
  ]
3384
- },
3385
- // renderOption: {
3386
- // type: "slot",
3387
- // displayName: "Custom render option",
3388
- // renderPropParams: ["item"],
3389
- // hidePlaceholder: true
3390
- // },
3391
- name: {
3392
- type: "string",
3393
- displayName: "Form field key",
3394
- description: "Name of the input, when submitting in an HTML form",
3395
- advanced: true
3396
- },
3397
- "aria-label": {
3398
- type: "string",
3399
- displayName: "ARIA label",
3400
- description: "Label for this input, if no visible label is used",
3401
- advanced: true
3402
3255
  }
3403
- },
3256
+ }),
3404
3257
  states: {
3405
- value: {
3258
+ selectedKey: {
3406
3259
  type: "writable",
3407
- valueProp: "value",
3408
- onChangeProp: "onChange",
3260
+ valueProp: "selectedKey",
3261
+ onChangeProp: "onSelectionChange",
3409
3262
  variableType: "text"
3410
3263
  },
3411
3264
  isOpen: {
@@ -3480,6 +3333,22 @@ function registerSliderOutput(loader, overrides) {
3480
3333
  );
3481
3334
  }
3482
3335
 
3336
+ class ErrorBoundary extends Component {
3337
+ constructor(props) {
3338
+ super(props);
3339
+ this.state = { hasError: false };
3340
+ }
3341
+ static getDerivedStateFromError(_) {
3342
+ return { hasError: true };
3343
+ }
3344
+ render() {
3345
+ if (this.state.hasError) {
3346
+ return this.props.fallback;
3347
+ }
3348
+ return this.props.children;
3349
+ }
3350
+ }
3351
+
3483
3352
  var __defProp$6 = Object.defineProperty;
3484
3353
  var __defProps$3 = Object.defineProperties;
3485
3354
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;