@plasmicpkgs/react-aria 0.0.48 → 0.0.50

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 (165) 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 +726 -847
  6. package/dist/react-aria.esm.js.map +1 -1
  7. package/dist/react-aria.js +724 -845
  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/registerModal.d.ts +1 -0
  13. package/dist/registerSection.d.ts +2 -4
  14. package/dist/registerSelect.d.ts +9 -18
  15. package/package.json +2 -2
  16. package/skinny/ListBoxItemIdManager.d.ts +13 -0
  17. package/skinny/{common-fa69e9b3.esm.js → common-8ca74873.esm.js} +4 -72
  18. package/skinny/common-8ca74873.esm.js.map +1 -0
  19. package/skinny/{common-bfedaf7d.cjs.js → common-c892c339.cjs.js} +4 -82
  20. package/skinny/common-c892c339.cjs.js.map +1 -0
  21. package/skinny/common.d.ts +0 -2
  22. package/skinny/contexts-0a2977d8.esm.js +15 -0
  23. package/skinny/contexts-0a2977d8.esm.js.map +1 -0
  24. package/skinny/{contexts-0dec6156.cjs.js → contexts-c26d68f8.cjs.js} +3 -9
  25. package/skinny/contexts-c26d68f8.cjs.js.map +1 -0
  26. package/skinny/contexts.d.ts +4 -5
  27. package/skinny/{interaction-variant-utils-abd0c319.esm.js → interaction-variant-utils-1d94d073.esm.js} +2 -2
  28. package/skinny/interaction-variant-utils-1d94d073.esm.js.map +1 -0
  29. package/skinny/{interaction-variant-utils-36f1b397.cjs.js → interaction-variant-utils-9a869063.cjs.js} +2 -2
  30. package/skinny/interaction-variant-utils-9a869063.cjs.js.map +1 -0
  31. package/skinny/registerButton.cjs.js +5 -4
  32. package/skinny/registerButton.cjs.js.map +1 -1
  33. package/skinny/registerButton.esm.js +3 -2
  34. package/skinny/registerButton.esm.js.map +1 -1
  35. package/skinny/registerCheckbox.cjs.js +6 -5
  36. package/skinny/registerCheckbox.cjs.js.map +1 -1
  37. package/skinny/registerCheckbox.esm.js +4 -3
  38. package/skinny/registerCheckbox.esm.js.map +1 -1
  39. package/skinny/registerCheckboxGroup.cjs.js +8 -7
  40. package/skinny/registerCheckboxGroup.cjs.js.map +1 -1
  41. package/skinny/registerCheckboxGroup.esm.js +5 -4
  42. package/skinny/registerCheckboxGroup.esm.js.map +1 -1
  43. package/skinny/registerComboBox.cjs.js +73 -253
  44. package/skinny/registerComboBox.cjs.js.map +1 -1
  45. package/skinny/registerComboBox.d.ts +9 -17
  46. package/skinny/registerComboBox.esm.js +74 -254
  47. package/skinny/registerComboBox.esm.js.map +1 -1
  48. package/skinny/registerDescription.cjs.js +2 -2
  49. package/skinny/registerDescription.cjs.js.map +1 -1
  50. package/skinny/registerDescription.esm.js +1 -1
  51. package/skinny/registerDialogTrigger.cjs.js +6 -5
  52. package/skinny/registerDialogTrigger.cjs.js.map +1 -1
  53. package/skinny/registerDialogTrigger.esm.js +4 -3
  54. package/skinny/registerDialogTrigger.esm.js.map +1 -1
  55. package/skinny/registerFieldError.cjs.js +3 -3
  56. package/skinny/registerFieldError.cjs.js.map +1 -1
  57. package/skinny/registerFieldError.esm.js +1 -1
  58. package/skinny/registerForm.cjs.js +3 -3
  59. package/skinny/registerForm.cjs.js.map +1 -1
  60. package/skinny/registerForm.esm.js +1 -1
  61. package/skinny/registerInput.cjs.js +7 -6
  62. package/skinny/registerInput.cjs.js.map +1 -1
  63. package/skinny/registerInput.esm.js +5 -4
  64. package/skinny/registerInput.esm.js.map +1 -1
  65. package/skinny/registerLabel.cjs.js +3 -3
  66. package/skinny/registerLabel.cjs.js.map +1 -1
  67. package/skinny/registerLabel.esm.js +1 -1
  68. package/skinny/registerListBox-85f61377.esm.js +321 -0
  69. package/skinny/registerListBox-85f61377.esm.js.map +1 -0
  70. package/skinny/registerListBox-96ae5783.cjs.js +331 -0
  71. package/skinny/registerListBox-96ae5783.cjs.js.map +1 -0
  72. package/skinny/registerListBox.cjs.js +7 -7
  73. package/skinny/registerListBox.d.ts +16 -6
  74. package/skinny/registerListBox.esm.js +6 -7
  75. package/skinny/registerListBox.esm.js.map +1 -1
  76. package/skinny/registerListBoxItem.cjs.js +96 -13
  77. package/skinny/registerListBoxItem.cjs.js.map +1 -1
  78. package/skinny/registerListBoxItem.d.ts +13 -3
  79. package/skinny/registerListBoxItem.esm.js +95 -12
  80. package/skinny/registerListBoxItem.esm.js.map +1 -1
  81. package/skinny/registerModal.cjs.js +17 -5
  82. package/skinny/registerModal.cjs.js.map +1 -1
  83. package/skinny/registerModal.d.ts +1 -0
  84. package/skinny/registerModal.esm.js +15 -3
  85. package/skinny/registerModal.esm.js.map +1 -1
  86. package/skinny/registerPopover.cjs.js +5 -6
  87. package/skinny/registerPopover.cjs.js.map +1 -1
  88. package/skinny/registerPopover.esm.js +3 -4
  89. package/skinny/registerPopover.esm.js.map +1 -1
  90. package/skinny/registerRadio.cjs.js +6 -5
  91. package/skinny/registerRadio.cjs.js.map +1 -1
  92. package/skinny/registerRadio.esm.js +4 -3
  93. package/skinny/registerRadio.esm.js.map +1 -1
  94. package/skinny/registerRadioGroup.cjs.js +8 -7
  95. package/skinny/registerRadioGroup.cjs.js.map +1 -1
  96. package/skinny/registerRadioGroup.esm.js +5 -4
  97. package/skinny/registerRadioGroup.esm.js.map +1 -1
  98. package/skinny/registerSection.cjs.js +30 -25
  99. package/skinny/registerSection.cjs.js.map +1 -1
  100. package/skinny/registerSection.d.ts +2 -4
  101. package/skinny/registerSection.esm.js +29 -24
  102. package/skinny/registerSection.esm.js.map +1 -1
  103. package/skinny/registerSelect.cjs.js +65 -88
  104. package/skinny/registerSelect.cjs.js.map +1 -1
  105. package/skinny/registerSelect.d.ts +9 -18
  106. package/skinny/registerSelect.esm.js +61 -84
  107. package/skinny/registerSelect.esm.js.map +1 -1
  108. package/skinny/registerSlider.cjs.js +9 -9
  109. package/skinny/registerSlider.cjs.js.map +1 -1
  110. package/skinny/registerSlider.esm.js +5 -5
  111. package/skinny/registerSliderOutput.cjs.js +4 -4
  112. package/skinny/registerSliderOutput.cjs.js.map +1 -1
  113. package/skinny/registerSliderOutput.esm.js +2 -2
  114. package/skinny/registerSliderThumb.cjs.js +23 -7
  115. package/skinny/registerSliderThumb.cjs.js.map +1 -1
  116. package/skinny/registerSliderThumb.esm.js +21 -5
  117. package/skinny/registerSliderThumb.esm.js.map +1 -1
  118. package/skinny/registerSliderTrack.cjs.js +7 -7
  119. package/skinny/registerSliderTrack.cjs.js.map +1 -1
  120. package/skinny/registerSliderTrack.esm.js +3 -3
  121. package/skinny/registerSwitch.cjs.js +6 -5
  122. package/skinny/registerSwitch.cjs.js.map +1 -1
  123. package/skinny/registerSwitch.esm.js +4 -3
  124. package/skinny/registerSwitch.esm.js.map +1 -1
  125. package/skinny/registerText.cjs.js +3 -3
  126. package/skinny/registerText.cjs.js.map +1 -1
  127. package/skinny/registerText.esm.js +1 -1
  128. package/skinny/registerTextArea.cjs.js +6 -5
  129. package/skinny/registerTextArea.cjs.js.map +1 -1
  130. package/skinny/registerTextArea.esm.js +4 -3
  131. package/skinny/registerTextArea.esm.js.map +1 -1
  132. package/skinny/registerTextField.cjs.js +8 -7
  133. package/skinny/registerTextField.cjs.js.map +1 -1
  134. package/skinny/registerTextField.esm.js +5 -4
  135. package/skinny/registerTextField.esm.js.map +1 -1
  136. package/skinny/registerTooltip.cjs.js +2 -2
  137. package/skinny/registerTooltip.cjs.js.map +1 -1
  138. package/skinny/registerTooltip.esm.js +1 -1
  139. package/skinny/utils-8dbb4d1f.cjs.js +79 -0
  140. package/skinny/utils-8dbb4d1f.cjs.js.map +1 -0
  141. package/skinny/utils-c7662a47.esm.js +69 -0
  142. package/skinny/utils-c7662a47.esm.js.map +1 -0
  143. package/dist/option-utils.d.ts +0 -42
  144. package/dist/registerHeader.d.ts +0 -5
  145. package/skinny/ErrorBoundary-c6b111d3.esm.js +0 -20
  146. package/skinny/ErrorBoundary-c6b111d3.esm.js.map +0 -1
  147. package/skinny/ErrorBoundary-e9b86248.cjs.js +0 -22
  148. package/skinny/ErrorBoundary-e9b86248.cjs.js.map +0 -1
  149. package/skinny/common-bfedaf7d.cjs.js.map +0 -1
  150. package/skinny/common-fa69e9b3.esm.js.map +0 -1
  151. package/skinny/contexts-0dec6156.cjs.js.map +0 -1
  152. package/skinny/contexts-9a8234bf.esm.js +0 -17
  153. package/skinny/contexts-9a8234bf.esm.js.map +0 -1
  154. package/skinny/interaction-variant-utils-36f1b397.cjs.js.map +0 -1
  155. package/skinny/interaction-variant-utils-abd0c319.esm.js.map +0 -1
  156. package/skinny/option-utils.d.ts +0 -42
  157. package/skinny/registerHeader.cjs.js +0 -55
  158. package/skinny/registerHeader.cjs.js.map +0 -1
  159. package/skinny/registerHeader.d.ts +0 -5
  160. package/skinny/registerHeader.esm.js +0 -48
  161. package/skinny/registerHeader.esm.js.map +0 -1
  162. package/skinny/registerListBox-b3f2891a.esm.js +0 -298
  163. package/skinny/registerListBox-b3f2891a.esm.js.map +0 -1
  164. package/skinny/registerListBox-f4801dbd.cjs.js +0 -310
  165. 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,7 @@ 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", [
571
567
  "isDisabled",
572
568
  "aria-label"
573
569
  ])), {
@@ -614,38 +610,36 @@ const PlasmicSliderContext = React.createContext(void 0);
614
610
  React.createContext(void 0);
615
611
  const PlasmicPopoverContext = React.createContext(void 0);
616
612
  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);
613
+ React.createContext(void 0);
614
+ React.createContext(void 0);
621
615
 
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) => {
616
+ var __defProp$o = Object.defineProperty;
617
+ var __defProps$b = Object.defineProperties;
618
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
619
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
620
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
621
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
622
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
623
+ var __spreadValues$o = (a, b) => {
630
624
  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]);
625
+ if (__hasOwnProp$o.call(b, prop))
626
+ __defNormalProp$o(a, prop, b[prop]);
627
+ if (__getOwnPropSymbols$o)
628
+ for (var prop of __getOwnPropSymbols$o(b)) {
629
+ if (__propIsEnum$o.call(b, prop))
630
+ __defNormalProp$o(a, prop, b[prop]);
637
631
  }
638
632
  return a;
639
633
  };
640
- var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
641
- var __objRest$j = (source, exclude) => {
634
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
635
+ var __objRest$m = (source, exclude) => {
642
636
  var target = {};
643
637
  for (var prop in source)
644
- if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
638
+ if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
645
639
  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))
640
+ if (source != null && __getOwnPropSymbols$o)
641
+ for (var prop of __getOwnPropSymbols$o(source)) {
642
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
649
643
  target[prop] = source[prop];
650
644
  }
651
645
  return target;
@@ -661,16 +655,16 @@ const CHECKBOX_INTERACTION_VARIANTS = [
661
655
  "readonly",
662
656
  "selected"
663
657
  ];
664
- const { interactionVariants: interactionVariants$b, withObservedValues: withObservedValues$9 } = pickAriaComponentVariants(
658
+ const { interactionVariants: interactionVariants$c, withObservedValues: withObservedValues$a } = pickAriaComponentVariants(
665
659
  CHECKBOX_INTERACTION_VARIANTS
666
660
  );
667
661
  function BaseCheckbox(props) {
668
- const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$j(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
662
+ const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$m(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
669
663
  const contextProps = React.useContext(PlasmicCheckboxGroupContext);
670
664
  setControlContextData == null ? void 0 : setControlContextData({
671
665
  parent: contextProps
672
666
  });
673
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Checkbox, __spreadValues$p({}, rest), ({
667
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Checkbox, __spreadValues$o({}, rest), ({
674
668
  isHovered,
675
669
  isPressed,
676
670
  isFocused,
@@ -679,7 +673,7 @@ function BaseCheckbox(props) {
679
673
  isIndeterminate,
680
674
  isSelected,
681
675
  isReadOnly
682
- }) => withObservedValues$9(
676
+ }) => withObservedValues$a(
683
677
  children,
684
678
  {
685
679
  hovered: isHovered,
@@ -749,8 +743,8 @@ function registerCheckbox(loader, overrides) {
749
743
  displayName: "Aria Checkbox",
750
744
  importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
751
745
  importName: "BaseCheckbox",
752
- interactionVariants: interactionVariants$b,
753
- props: __spreadProps$c(__spreadValues$p({}, getCommonProps("checkbox", [
746
+ interactionVariants: interactionVariants$c,
747
+ props: __spreadProps$b(__spreadValues$o({}, getCommonProps("checkbox", [
754
748
  "name",
755
749
  "isDisabled",
756
750
  "isReadOnly",
@@ -818,37 +812,37 @@ function registerCheckbox(loader, overrides) {
818
812
  );
819
813
  }
820
814
 
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) => {
815
+ var __defProp$n = Object.defineProperty;
816
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
817
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
818
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
819
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
820
+ var __spreadValues$n = (a, b) => {
827
821
  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]);
822
+ if (__hasOwnProp$n.call(b, prop))
823
+ __defNormalProp$n(a, prop, b[prop]);
824
+ if (__getOwnPropSymbols$n)
825
+ for (var prop of __getOwnPropSymbols$n(b)) {
826
+ if (__propIsEnum$n.call(b, prop))
827
+ __defNormalProp$n(a, prop, b[prop]);
834
828
  }
835
829
  return a;
836
830
  };
837
- var __objRest$i = (source, exclude) => {
831
+ var __objRest$l = (source, exclude) => {
838
832
  var target = {};
839
833
  for (var prop in source)
840
- if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
834
+ if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
841
835
  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))
836
+ if (source != null && __getOwnPropSymbols$n)
837
+ for (var prop of __getOwnPropSymbols$n(source)) {
838
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
845
839
  target[prop] = source[prop];
846
840
  }
847
841
  return target;
848
842
  };
849
843
  function BaseText(_a) {
850
- var _b = _a, { children } = _b, rest = __objRest$i(_b, ["children"]);
851
- return /* @__PURE__ */ React.createElement(Text, __spreadValues$o({}, rest), children);
844
+ var _b = _a, { children } = _b, rest = __objRest$l(_b, ["children"]);
845
+ return /* @__PURE__ */ React.createElement(Text, __spreadValues$n({}, rest), children);
852
846
  }
853
847
  const TEXT_COMPONENT_NAME = makeComponentName("text");
854
848
  function registerText(loader, overrides) {
@@ -882,28 +876,28 @@ function registerText(loader, overrides) {
882
876
  );
883
877
  }
884
878
 
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) => {
879
+ var __defProp$m = Object.defineProperty;
880
+ var __defProps$a = Object.defineProperties;
881
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
882
+ var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
883
+ var __hasOwnProp$m = Object.prototype.hasOwnProperty;
884
+ var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
885
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
886
+ var __spreadValues$m = (a, b) => {
893
887
  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]);
888
+ if (__hasOwnProp$m.call(b, prop))
889
+ __defNormalProp$m(a, prop, b[prop]);
890
+ if (__getOwnPropSymbols$m)
891
+ for (var prop of __getOwnPropSymbols$m(b)) {
892
+ if (__propIsEnum$m.call(b, prop))
893
+ __defNormalProp$m(a, prop, b[prop]);
900
894
  }
901
895
  return a;
902
896
  };
903
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
897
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
904
898
  const DESCRIPTION_COMPONENT_NAME = makeComponentName("description");
905
899
  function registerDescription(loader, overrides) {
906
- return registerText(loader, __spreadProps$b(__spreadValues$n({}, overrides), {
900
+ return registerText(loader, __spreadProps$a(__spreadValues$m({}, overrides), {
907
901
  name: DESCRIPTION_COMPONENT_NAME,
908
902
  displayName: "Aria Description",
909
903
  props: {
@@ -916,30 +910,30 @@ function registerDescription(loader, overrides) {
916
910
  }));
917
911
  }
918
912
 
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) => {
913
+ var __defProp$l = Object.defineProperty;
914
+ var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
915
+ var __hasOwnProp$l = Object.prototype.hasOwnProperty;
916
+ var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
917
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
918
+ var __spreadValues$l = (a, b) => {
925
919
  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]);
920
+ if (__hasOwnProp$l.call(b, prop))
921
+ __defNormalProp$l(a, prop, b[prop]);
922
+ if (__getOwnPropSymbols$l)
923
+ for (var prop of __getOwnPropSymbols$l(b)) {
924
+ if (__propIsEnum$l.call(b, prop))
925
+ __defNormalProp$l(a, prop, b[prop]);
932
926
  }
933
927
  return a;
934
928
  };
935
- var __objRest$h = (source, exclude) => {
929
+ var __objRest$k = (source, exclude) => {
936
930
  var target = {};
937
931
  for (var prop in source)
938
- if (__hasOwnProp$m.call(source, prop) && exclude.indexOf(prop) < 0)
932
+ if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
939
933
  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))
934
+ if (source != null && __getOwnPropSymbols$l)
935
+ for (var prop of __getOwnPropSymbols$l(source)) {
936
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
943
937
  target[prop] = source[prop];
944
938
  }
945
939
  return target;
@@ -956,7 +950,7 @@ function BaseFieldError(_a) {
956
950
  tooShort,
957
951
  typeMismatch,
958
952
  valueMissing
959
- } = _b, rest = __objRest$h(_b, [
953
+ } = _b, rest = __objRest$k(_b, [
960
954
  "badInput",
961
955
  "customError",
962
956
  "patternMismatch",
@@ -968,7 +962,7 @@ function BaseFieldError(_a) {
968
962
  "typeMismatch",
969
963
  "valueMissing"
970
964
  ]);
971
- return /* @__PURE__ */ React.createElement(FieldError, __spreadValues$m({}, rest), ({ validationDetails, validationErrors }) => {
965
+ return /* @__PURE__ */ React.createElement(FieldError, __spreadValues$l({}, rest), ({ validationDetails, validationErrors }) => {
972
966
  if (validationDetails.badInput && badInput) {
973
967
  return badInput;
974
968
  }
@@ -1100,33 +1094,33 @@ function registerLabel(loader, overrides) {
1100
1094
  );
1101
1095
  }
1102
1096
 
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) => {
1097
+ var __defProp$k = Object.defineProperty;
1098
+ var __defProps$9 = Object.defineProperties;
1099
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
1100
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
1101
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
1102
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
1103
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1104
+ var __spreadValues$k = (a, b) => {
1111
1105
  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]);
1106
+ if (__hasOwnProp$k.call(b, prop))
1107
+ __defNormalProp$k(a, prop, b[prop]);
1108
+ if (__getOwnPropSymbols$k)
1109
+ for (var prop of __getOwnPropSymbols$k(b)) {
1110
+ if (__propIsEnum$k.call(b, prop))
1111
+ __defNormalProp$k(a, prop, b[prop]);
1118
1112
  }
1119
1113
  return a;
1120
1114
  };
1121
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
1122
- var __objRest$g = (source, exclude) => {
1115
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
1116
+ var __objRest$j = (source, exclude) => {
1123
1117
  var target = {};
1124
1118
  for (var prop in source)
1125
- if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
1119
+ if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
1126
1120
  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))
1121
+ if (source != null && __getOwnPropSymbols$k)
1122
+ for (var prop of __getOwnPropSymbols$k(source)) {
1123
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
1130
1124
  target[prop] = source[prop];
1131
1125
  }
1132
1126
  return target;
@@ -1135,12 +1129,12 @@ const CHECKBOX_GROUP_INTERACTION_VARIANTS = [
1135
1129
  "disabled",
1136
1130
  "readonly"
1137
1131
  ];
1138
- const { interactionVariants: interactionVariants$a, withObservedValues: withObservedValues$8 } = pickAriaComponentVariants(
1132
+ const { interactionVariants: interactionVariants$b, withObservedValues: withObservedValues$9 } = pickAriaComponentVariants(
1139
1133
  CHECKBOX_GROUP_INTERACTION_VARIANTS
1140
1134
  );
1141
1135
  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(
1136
+ const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$j(_a, ["children", "updateInteractionVariant"]);
1137
+ return /* @__PURE__ */ React.createElement(PlasmicCheckboxGroupContext.Provider, { value: rest }, /* @__PURE__ */ React.createElement(CheckboxGroup, __spreadValues$k({}, rest), ({ isDisabled, isReadOnly }) => withObservedValues$9(
1144
1138
  children,
1145
1139
  {
1146
1140
  disabled: isDisabled,
@@ -1168,8 +1162,8 @@ function registerCheckboxGroup(loader, overrides) {
1168
1162
  displayName: "Aria Checkbox Group",
1169
1163
  importPath: "@plasmicpkgs/react-aria/skinny/registerCheckboxGroup",
1170
1164
  importName: "BaseCheckboxGroup",
1171
- interactionVariants: interactionVariants$a,
1172
- props: __spreadProps$a(__spreadValues$l({}, getCommonProps("checkbox group", [
1165
+ interactionVariants: interactionVariants$b,
1166
+ props: __spreadProps$9(__spreadValues$k({}, getCommonProps("checkbox group", [
1173
1167
  "name",
1174
1168
  "isDisabled",
1175
1169
  "isReadOnly",
@@ -1284,195 +1278,80 @@ function registerCheckboxGroup(loader, overrides) {
1284
1278
  );
1285
1279
  }
1286
1280
 
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
- }
1281
+ class ListBoxItemIdManager {
1282
+ constructor() {
1283
+ this._ids = /* @__PURE__ */ new Set();
1284
+ this._observers = /* @__PURE__ */ new Set();
1285
+ }
1286
+ generateDuplicateId(id, count = 1) {
1287
+ const dupId = `${id} duplicate(${count})`;
1288
+ if (this._ids.has(dupId)) {
1289
+ return this.generateDuplicateId(id, count + 1);
1347
1290
  } else {
1348
- return void 0;
1291
+ return dupId;
1349
1292
  }
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
1293
  }
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;
1294
+ generateMissingId(count = 1) {
1295
+ const missingId = `missing(${count})`;
1296
+ if (this._ids.has(missingId)) {
1297
+ return this.generateMissingId(count + 1);
1298
+ } else {
1299
+ return missingId;
1300
+ }
1301
+ }
1302
+ register(id) {
1303
+ let newId;
1304
+ if (!id) {
1305
+ newId = this.generateMissingId();
1306
+ } else if (this._ids.has(id)) {
1307
+ newId = this.generateDuplicateId(id);
1308
+ } else {
1309
+ newId = id;
1310
+ }
1311
+ this._ids.add(newId);
1312
+ this.notify();
1313
+ return newId;
1314
+ }
1315
+ unregister(id) {
1316
+ this._ids.delete(id);
1317
+ this.notify();
1318
+ }
1319
+ subscribe(observer) {
1320
+ this._observers.add(observer);
1321
+ }
1322
+ // Notify all observers about an event.
1323
+ notify() {
1324
+ this._observers.forEach((observer) => observer(this.ids));
1325
+ }
1326
+ get ids() {
1327
+ return Array.from(this._ids);
1328
+ }
1450
1329
  }
1451
1330
 
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) => {
1331
+ var __defProp$j = Object.defineProperty;
1332
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
1333
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
1334
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
1335
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1336
+ var __spreadValues$j = (a, b) => {
1458
1337
  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]);
1338
+ if (__hasOwnProp$j.call(b, prop))
1339
+ __defNormalProp$j(a, prop, b[prop]);
1340
+ if (__getOwnPropSymbols$j)
1341
+ for (var prop of __getOwnPropSymbols$j(b)) {
1342
+ if (__propIsEnum$j.call(b, prop))
1343
+ __defNormalProp$j(a, prop, b[prop]);
1465
1344
  }
1466
1345
  return a;
1467
1346
  };
1468
- var __objRest$f = (source, exclude) => {
1347
+ var __objRest$i = (source, exclude) => {
1469
1348
  var target = {};
1470
1349
  for (var prop in source)
1471
- if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
1350
+ if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
1472
1351
  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))
1352
+ if (source != null && __getOwnPropSymbols$j)
1353
+ for (var prop of __getOwnPropSymbols$j(source)) {
1354
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
1476
1355
  target[prop] = source[prop];
1477
1356
  }
1478
1357
  return target;
@@ -1482,7 +1361,7 @@ const INPUT_INTERACTION_VARIANTS = [
1482
1361
  "hovered",
1483
1362
  "disabled"
1484
1363
  ];
1485
- const { interactionVariants: interactionVariants$9 } = pickAriaComponentVariants(
1364
+ const { interactionVariants: interactionVariants$a } = pickAriaComponentVariants(
1486
1365
  INPUT_INTERACTION_VARIANTS
1487
1366
  );
1488
1367
  const inputHelpers$1 = {
@@ -1501,7 +1380,7 @@ function BaseInput(props) {
1501
1380
  setControlContextData,
1502
1381
  disabled,
1503
1382
  autoComplete
1504
- } = _a, rest = __objRest$f(_a, [
1383
+ } = _a, rest = __objRest$i(_a, [
1505
1384
  "updateInteractionVariant",
1506
1385
  "setControlContextData",
1507
1386
  "disabled",
@@ -1526,7 +1405,7 @@ function BaseInput(props) {
1526
1405
  }, [mergedProps.disabled, updateInteractionVariant]);
1527
1406
  return /* @__PURE__ */ React.createElement(
1528
1407
  Input,
1529
- __spreadValues$k({
1408
+ __spreadValues$j({
1530
1409
  autoComplete: resolveAutoComplete(autoComplete),
1531
1410
  onHoverChange: (isHovered) => {
1532
1411
  updateInteractionVariant == null ? void 0 : updateInteractionVariant({
@@ -1556,15 +1435,15 @@ function registerInput(loader, overrides) {
1556
1435
  displayName: "Aria Input",
1557
1436
  importPath: "@plasmicpkgs/react-aria/skinny/registerInput",
1558
1437
  importName: "BaseInput",
1559
- interactionVariants: interactionVariants$9,
1438
+ interactionVariants: interactionVariants$a,
1560
1439
  defaultStyles: {
1561
1440
  width: "300px",
1562
1441
  borderWidth: "1px",
1563
1442
  borderStyle: "solid",
1564
1443
  borderColor: "black",
1565
- padding: "2px 10px"
1444
+ padding: "4px 10px"
1566
1445
  },
1567
- props: __spreadValues$k({}, getCommonProps("Input", [
1446
+ props: __spreadValues$j({}, getCommonProps("Input", [
1568
1447
  "name",
1569
1448
  "disabled",
1570
1449
  "readOnly",
@@ -1595,7 +1474,7 @@ function registerInput(loader, overrides) {
1595
1474
  "onInput"
1596
1475
  ])),
1597
1476
  states: {
1598
- value: __spreadValues$k({
1477
+ value: __spreadValues$j({
1599
1478
  type: "writable",
1600
1479
  valueProp: "value",
1601
1480
  onChangeProp: "onChange",
@@ -1613,46 +1492,98 @@ function registerInput(loader, overrides) {
1613
1492
  );
1614
1493
  }
1615
1494
 
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) => {
1495
+ var __defProp$i = Object.defineProperty;
1496
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
1497
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
1498
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
1499
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1500
+ var __spreadValues$i = (a, b) => {
1640
1501
  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]);
1502
+ if (__hasOwnProp$i.call(b, prop))
1503
+ __defNormalProp$i(a, prop, b[prop]);
1504
+ if (__getOwnPropSymbols$i)
1505
+ for (var prop of __getOwnPropSymbols$i(b)) {
1506
+ if (__propIsEnum$i.call(b, prop))
1507
+ __defNormalProp$i(a, prop, b[prop]);
1647
1508
  }
1648
1509
  return a;
1649
1510
  };
1650
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
1511
+ var __objRest$h = (source, exclude) => {
1512
+ var target = {};
1513
+ for (var prop in source)
1514
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
1515
+ target[prop] = source[prop];
1516
+ if (source != null && __getOwnPropSymbols$i)
1517
+ for (var prop of __getOwnPropSymbols$i(source)) {
1518
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
1519
+ target[prop] = source[prop];
1520
+ }
1521
+ return target;
1522
+ };
1523
+ const LIST_BOX_ITEM_INTERACTION_VARIANTS = [
1524
+ "hovered",
1525
+ "pressed",
1526
+ "focused",
1527
+ "focusVisible",
1528
+ "selected",
1529
+ "disabled"
1530
+ ];
1531
+ const { interactionVariants: interactionVariants$9, withObservedValues: withObservedValues$8 } = pickAriaComponentVariants(
1532
+ LIST_BOX_ITEM_INTERACTION_VARIANTS
1533
+ );
1651
1534
  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);
1535
+ const _a = props, {
1536
+ children,
1537
+ setControlContextData,
1538
+ updateInteractionVariant,
1539
+ id
1540
+ } = _a, rest = __objRest$h(_a, [
1541
+ "children",
1542
+ "setControlContextData",
1543
+ "updateInteractionVariant",
1544
+ "id"
1545
+ ]);
1546
+ const listboxContext = React.useContext(PlasmicListBoxContext);
1547
+ const isStandalone = !listboxContext;
1548
+ const [registeredId, setRegisteredId] = useState();
1549
+ useEffect(() => {
1550
+ if (!listboxContext) {
1551
+ return;
1552
+ }
1553
+ const localId = listboxContext.idManager.register(id);
1554
+ setRegisteredId(localId);
1555
+ return () => {
1556
+ listboxContext.idManager.unregister(localId);
1557
+ setRegisteredId(void 0);
1558
+ };
1559
+ }, [id]);
1560
+ setControlContextData == null ? void 0 : setControlContextData({
1561
+ // this means that a unique id was registered, different from the provided id
1562
+ hasDuplicateId: !isStandalone && id !== registeredId
1563
+ });
1564
+ const listboxItem = /* @__PURE__ */ React.createElement(ListBoxItem, __spreadValues$i({ key: registeredId, id: registeredId }, rest), ({
1565
+ isHovered,
1566
+ isPressed,
1567
+ isFocused,
1568
+ isFocusVisible,
1569
+ isSelected,
1570
+ isDisabled
1571
+ }) => withObservedValues$8(
1572
+ children,
1573
+ {
1574
+ hovered: isHovered,
1575
+ pressed: isPressed,
1576
+ focused: isFocused,
1577
+ focusVisible: isFocusVisible,
1578
+ selected: isSelected,
1579
+ disabled: isDisabled
1580
+ },
1581
+ updateInteractionVariant
1582
+ ));
1583
+ if (isStandalone) {
1584
+ return /* @__PURE__ */ React.createElement(ListBox, { selectionMode: "single" }, listboxItem);
1585
+ }
1586
+ return listboxItem;
1656
1587
  }
1657
1588
  const makeDefaultListBoxItemChildren = (label, description) => ({
1658
1589
  type: "vbox",
@@ -1700,7 +1631,23 @@ function registerListBoxItem(loader, overrides) {
1700
1631
  displayName: "Aria ListBoxItem",
1701
1632
  importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
1702
1633
  importName: "BaseListBoxItem",
1634
+ interactionVariants: interactionVariants$9,
1703
1635
  props: {
1636
+ id: {
1637
+ type: "string",
1638
+ description: "The id of the item",
1639
+ required: true,
1640
+ validator: (_value, _props, ctx) => {
1641
+ if (ctx == null ? void 0 : ctx.hasDuplicateId) {
1642
+ return "Please make sure the id is unique!";
1643
+ }
1644
+ return true;
1645
+ }
1646
+ },
1647
+ textValue: {
1648
+ type: "string",
1649
+ description: "A text representation of the item's contents, used for features like typeahead."
1650
+ },
1704
1651
  children: {
1705
1652
  type: "slot",
1706
1653
  defaultValue: makeDefaultListBoxItemChildren("Item")
@@ -1711,45 +1658,6 @@ function registerListBoxItem(loader, overrides) {
1711
1658
  );
1712
1659
  }
1713
1660
 
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
1661
  var __defProp$h = Object.defineProperty;
1754
1662
  var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
1755
1663
  var __hasOwnProp$h = Object.prototype.hasOwnProperty;
@@ -1766,22 +1674,25 @@ var __spreadValues$h = (a, b) => {
1766
1674
  }
1767
1675
  return a;
1768
1676
  };
1677
+ var __objRest$g = (source, exclude) => {
1678
+ var target = {};
1679
+ for (var prop in source)
1680
+ if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
1681
+ target[prop] = source[prop];
1682
+ if (source != null && __getOwnPropSymbols$h)
1683
+ for (var prop of __getOwnPropSymbols$h(source)) {
1684
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
1685
+ target[prop] = source[prop];
1686
+ }
1687
+ return target;
1688
+ };
1769
1689
  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
- }));
1690
+ const _a = props, { header, items } = _a, rest = __objRest$g(_a, ["header", "items"]);
1691
+ const contextProps = React.useContext(PlasmicListBoxContext);
1692
+ const mergedProps = mergeProps$1(contextProps, rest);
1693
+ return /* @__PURE__ */ React.createElement(Section, __spreadValues$h({}, mergedProps), /* @__PURE__ */ React.createElement(Header, null, header), items);
1776
1694
  }
1777
1695
  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
1696
  return registerComponentHelper(
1786
1697
  loader,
1787
1698
  BaseSection,
@@ -1795,14 +1706,17 @@ function registerSection(loader, overrides) {
1795
1706
  padding: "10px"
1796
1707
  },
1797
1708
  props: {
1798
- renderHeader: {
1709
+ header: {
1799
1710
  type: "slot",
1800
- displayName: "Render section header",
1801
- renderPropParams: ["sectionProps"],
1802
- defaultValue: {
1803
- type: "component",
1804
- name: headerMeta.name
1805
- }
1711
+ defaultValue: [
1712
+ {
1713
+ type: "text",
1714
+ value: "Section Header."
1715
+ }
1716
+ ]
1717
+ },
1718
+ items: {
1719
+ type: "slot"
1806
1720
  }
1807
1721
  }
1808
1722
  },
@@ -1811,8 +1725,6 @@ function registerSection(loader, overrides) {
1811
1725
  }
1812
1726
 
1813
1727
  var __defProp$g = Object.defineProperty;
1814
- var __defProps$8 = Object.defineProperties;
1815
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
1816
1728
  var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
1817
1729
  var __hasOwnProp$g = Object.prototype.hasOwnProperty;
1818
1730
  var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
@@ -1828,8 +1740,7 @@ var __spreadValues$g = (a, b) => {
1828
1740
  }
1829
1741
  return a;
1830
1742
  };
1831
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
1832
- var __objRest$e = (source, exclude) => {
1743
+ var __objRest$f = (source, exclude) => {
1833
1744
  var target = {};
1834
1745
  for (var prop in source)
1835
1746
  if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
@@ -1841,46 +1752,129 @@ var __objRest$e = (source, exclude) => {
1841
1752
  }
1842
1753
  return target;
1843
1754
  };
1755
+ const listboxHelpers = {
1756
+ states: {
1757
+ selectedKey: {
1758
+ onChangeArgsToValue: (value) => {
1759
+ return Array.from(value)[0];
1760
+ }
1761
+ }
1762
+ }
1763
+ };
1764
+ function normalizeSelectedKeys(selectedKeys) {
1765
+ return typeof selectedKeys === "string" && selectedKeys !== "all" ? [selectedKeys] : selectedKeys;
1766
+ }
1844
1767
  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 : {}
1768
+ const _a = props, {
1769
+ setControlContextData,
1770
+ children,
1771
+ selectedKeys,
1772
+ defaultSelectedKeys
1773
+ } = _a, rest = __objRest$f(_a, [
1774
+ "setControlContextData",
1775
+ "children",
1776
+ "selectedKeys",
1777
+ "defaultSelectedKeys"
1778
+ ]);
1779
+ const context = React.useContext(PlasmicListBoxContext);
1780
+ const isStandalone = !context;
1781
+ const [ids, setIds] = useState([]);
1782
+ const idManager = useMemo(
1783
+ () => {
1784
+ var _a2;
1785
+ return (_a2 = context == null ? void 0 : context.idManager) != null ? _a2 : new ListBoxItemIdManager();
1786
+ },
1787
+ []
1788
+ );
1789
+ useEffect(() => {
1790
+ setControlContextData == null ? void 0 : setControlContextData({
1791
+ itemIds: ids,
1792
+ isStandalone
1793
+ });
1794
+ }, [ids, isStandalone]);
1795
+ useEffect(() => {
1796
+ idManager.subscribe((_ids) => {
1797
+ setIds(_ids);
1798
+ });
1799
+ }, []);
1800
+ const listbox = /* @__PURE__ */ React.createElement(
1801
+ ListBox,
1802
+ __spreadValues$g({
1803
+ selectedKeys: normalizeSelectedKeys(selectedKeys),
1804
+ defaultSelectedKeys: normalizeSelectedKeys(defaultSelectedKeys)
1805
+ }, rest),
1806
+ children
1807
+ );
1808
+ if (isStandalone) {
1809
+ return /* @__PURE__ */ React.createElement(
1810
+ PlasmicListBoxContext.Provider,
1811
+ {
1812
+ value: {
1813
+ idManager
1814
+ }
1815
+ },
1816
+ listbox
1817
+ );
1818
+ }
1819
+ return listbox;
1820
+ }
1821
+ const LIST_BOX_COMPONENT_NAME = makeComponentName("listbox");
1822
+ function registerListBox(loader, overrides) {
1823
+ const listBoxItemMeta = registerListBoxItem(loader, {
1824
+ parentComponentName: LIST_BOX_COMPONENT_NAME
1856
1825
  });
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
1826
+ const sectionMeta = registerSection(loader, {
1827
+ parentComponentName: LIST_BOX_COMPONENT_NAME,
1828
+ props: {
1829
+ items: {
1830
+ type: "slot",
1831
+ defaultValue: [
1832
+ {
1833
+ type: "component",
1834
+ name: listBoxItemMeta.name,
1835
+ props: {
1836
+ id: "section-1-1",
1837
+ textValue: "Section1-Item 1",
1838
+ children: [
1839
+ makeDefaultListBoxItemChildren(
1840
+ "Item 1",
1841
+ "Add dynamic values to make it more interesting"
1842
+ )
1843
+ ]
1844
+ }
1845
+ },
1846
+ {
1847
+ type: "component",
1848
+ name: listBoxItemMeta.name,
1849
+ props: {
1850
+ id: "section-1-2",
1851
+ textValue: "Section1-Item 2",
1852
+ children: [
1853
+ makeDefaultListBoxItemChildren(
1854
+ "Item 2",
1855
+ "Add dynamic values to make it more interesting"
1856
+ )
1857
+ ]
1858
+ }
1859
+ },
1860
+ {
1861
+ type: "component",
1862
+ name: listBoxItemMeta.name,
1863
+ props: {
1864
+ id: "section-1-3",
1865
+ textValue: "Section1-Item 3",
1866
+ children: [
1867
+ makeDefaultListBoxItemChildren(
1868
+ "Item 3",
1869
+ "Add dynamic values to make it more interesting"
1870
+ )
1871
+ ]
1872
+ }
1867
1873
  }
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));
1874
+ ]
1875
+ }
1873
1876
  }
1874
1877
  });
1875
- }
1876
- const LIST_BOX_COMPONENT_NAME = makeComponentName("listbox");
1877
- function registerListBox(loader, overrides) {
1878
- const listBoxItemMeta = registerListBoxItem(loader, {
1879
- parentComponentName: LIST_BOX_COMPONENT_NAME
1880
- });
1881
- const sectionMeta = registerSection(loader, {
1882
- parentComponentName: LIST_BOX_COMPONENT_NAME
1883
- });
1884
1878
  registerComponentHelper(
1885
1879
  loader,
1886
1880
  BaseListBox,
@@ -1896,38 +1890,97 @@ function registerListBox(loader, overrides) {
1896
1890
  borderColor: "black"
1897
1891
  },
1898
1892
  props: {
1899
- options: __spreadProps$8(__spreadValues$g({}, makeOptionsPropType()), {
1900
- displayName: "Items",
1901
- hidden: hasParent
1902
- }),
1903
- renderItem: {
1893
+ children: {
1904
1894
  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
- )
1895
+ displayName: "List Items",
1896
+ allowedComponents: [listBoxItemMeta.name, sectionMeta.name],
1897
+ allowRootWrapper: true,
1898
+ defaultValue: [
1899
+ {
1900
+ type: "component",
1901
+ name: listBoxItemMeta.name,
1902
+ props: {
1903
+ id: "1",
1904
+ textValue: "Item 1",
1905
+ children: [
1906
+ makeDefaultListBoxItemChildren(
1907
+ "Item 1",
1908
+ "Add dynamic values to make it more interesting"
1909
+ )
1910
+ ]
1911
+ }
1912
+ },
1913
+ {
1914
+ type: "component",
1915
+ name: listBoxItemMeta.name,
1916
+ props: {
1917
+ id: "2",
1918
+ textValue: "Item 2",
1919
+ children: [
1920
+ makeDefaultListBoxItemChildren(
1921
+ "Item 2",
1922
+ "Add dynamic values to make it more interesting"
1923
+ )
1924
+ ]
1925
+ }
1926
+ },
1927
+ {
1928
+ type: "component",
1929
+ name: listBoxItemMeta.name,
1930
+ props: {
1931
+ id: "3",
1932
+ textValue: "Item 3",
1933
+ children: [
1934
+ makeDefaultListBoxItemChildren(
1935
+ "Item 3",
1936
+ "Add dynamic values to make it more interesting"
1937
+ )
1938
+ ]
1939
+ }
1940
+ },
1941
+ {
1942
+ type: "component",
1943
+ name: sectionMeta.name
1915
1944
  }
1916
- }
1945
+ ]
1917
1946
  },
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
- }
1947
+ selectionMode: {
1948
+ type: "choice",
1949
+ description: "The selection mode of the listbox",
1950
+ options: ["none", "single"],
1951
+ defaultValue: "none",
1952
+ hidden: (_props, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
1953
+ },
1954
+ selectedKeys: {
1955
+ type: "choice",
1956
+ description: "The selected keys of the listbox",
1957
+ editOnly: true,
1958
+ uncontrolledProp: "defaultSelectedKeys",
1959
+ displayName: "Initial selected key",
1960
+ options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
1961
+ hidden: (props, ctx) => !(ctx == null ? void 0 : ctx.isStandalone) || props.selectionMode === "none",
1962
+ // We do not support multiple selections yet (Because React Aria select and combobox only support single selections).
1963
+ multiSelect: false
1964
+ },
1965
+ onSelectionChange: {
1966
+ type: "eventHandler",
1967
+ argTypes: [{ name: "itemIds", type: "object" }]
1929
1968
  }
1930
- }
1969
+ },
1970
+ states: {
1971
+ selectedKey: __spreadValues$g({
1972
+ type: "writable",
1973
+ valueProp: "selectedKeys",
1974
+ onChangeProp: "onSelectionChange",
1975
+ variableType: "text"
1976
+ }, listboxHelpers.states.selectedKey)
1977
+ },
1978
+ componentHelpers: {
1979
+ helpers: listboxHelpers,
1980
+ importName: "listboxHelpers",
1981
+ importPath: "@plasmicpkgs/react-aria/skinny/registerListBox"
1982
+ },
1983
+ trapsFocus: true
1931
1984
  },
1932
1985
  overrides
1933
1986
  );
@@ -1949,7 +2002,7 @@ var __spreadValues$f = (a, b) => {
1949
2002
  }
1950
2003
  return a;
1951
2004
  };
1952
- var __objRest$d = (source, exclude) => {
2005
+ var __objRest$e = (source, exclude) => {
1953
2006
  var target = {};
1954
2007
  for (var prop in source)
1955
2008
  if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
@@ -1962,7 +2015,7 @@ var __objRest$d = (source, exclude) => {
1962
2015
  return target;
1963
2016
  };
1964
2017
  function BasePopover(props) {
1965
- const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$d(_a, ["resetClassName", "setControlContextData"]);
2018
+ const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$e(_a, ["resetClassName", "setControlContextData"]);
1966
2019
  const isStandalone = !React.useContext(PopoverContext);
1967
2020
  const context = React.useContext(PlasmicPopoverContext);
1968
2021
  const isInsideSelect = !!React.useContext(SelectContext);
@@ -1995,7 +2048,6 @@ function BasePopover(props) {
1995
2048
  const POPOVER_COMPONENT_NAME = makeComponentName("popover");
1996
2049
  const POPOVER_ARROW_IMG = {
1997
2050
  type: "img",
1998
- // TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/
1999
2051
  src: "https://static1.plasmic.app/arrow-up.svg",
2000
2052
  styles: {
2001
2053
  position: "absolute",
@@ -2059,7 +2111,7 @@ function registerPopover(loader, overrides) {
2059
2111
  type: "number",
2060
2112
  displayName: "Offset",
2061
2113
  description: "Additional offset applied vertically between the popover and its trigger",
2062
- defaultValueHint: 0
2114
+ defaultValueHint: 8
2063
2115
  },
2064
2116
  shouldFlip: {
2065
2117
  type: "boolean",
@@ -2093,8 +2145,8 @@ function registerPopover(loader, overrides) {
2093
2145
  }
2094
2146
 
2095
2147
  var __defProp$e = Object.defineProperty;
2096
- var __defProps$7 = Object.defineProperties;
2097
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
2148
+ var __defProps$8 = Object.defineProperties;
2149
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
2098
2150
  var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
2099
2151
  var __hasOwnProp$e = Object.prototype.hasOwnProperty;
2100
2152
  var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
@@ -2110,226 +2162,77 @@ var __spreadValues$e = (a, b) => {
2110
2162
  }
2111
2163
  return a;
2112
2164
  };
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;
2165
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
2166
+ var __objRest$d = (source, exclude) => {
2167
+ var target = {};
2168
+ for (var prop in source)
2169
+ if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
2170
+ target[prop] = source[prop];
2171
+ if (source != null && __getOwnPropSymbols$e)
2172
+ for (var prop of __getOwnPropSymbols$e(source)) {
2173
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
2174
+ target[prop] = source[prop];
2141
2175
  }
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
- }
2176
+ return target;
2177
+ };
2178
+ const COMBOBOX_NAME = makeComponentName("combobox");
2179
+ function BaseComboBox(props) {
2180
+ const _a = props, { children, setControlContextData, isOpen } = _a, rest = __objRest$d(_a, ["children", "setControlContextData", "isOpen"]);
2181
+ const idManager = useMemo(() => new ListBoxItemIdManager(), []);
2182
+ useEffect(() => {
2183
+ idManager.subscribe((ids) => {
2184
+ setControlContextData == null ? void 0 : setControlContextData({
2185
+ itemIds: ids
2186
+ });
2187
+ });
2188
+ }, []);
2189
+ return /* @__PURE__ */ React.createElement(ComboBox, __spreadValues$e({}, rest), /* @__PURE__ */ React.createElement(PlasmicPopoverContext.Provider, { value: { isOpen } }, /* @__PURE__ */ React.createElement(
2190
+ PlasmicListBoxContext.Provider,
2191
+ {
2192
+ value: {
2193
+ idManager
2200
2194
  }
2201
2195
  },
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;
2196
+ children
2197
+ )));
2285
2198
  }
2286
2199
  function registerComboBox(loader) {
2287
- const rootName = makeComponentName("combobox");
2288
2200
  registerComponentHelper(loader, BaseComboBox, {
2289
- name: rootName,
2201
+ name: COMBOBOX_NAME,
2290
2202
  displayName: "Aria ComboBox",
2291
2203
  importPath: "@plasmicpkgs/react-aria/skinny/registerComboBox",
2292
2204
  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",
2205
+ props: __spreadProps$8(__spreadValues$e({}, getCommonProps("ComboBox", [
2206
+ "name",
2207
+ "aria-label",
2208
+ "placeholder",
2209
+ "isDisabled"
2210
+ ])), {
2211
+ selectedKey: {
2312
2212
  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
2213
+ description: "The selected keys of the listbox",
2214
+ editOnly: true,
2215
+ uncontrolledProp: "defaultSelectedKey",
2216
+ displayName: "Initial selected key",
2217
+ options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
2218
+ // React Aria ComboBox do not support multiple comboBoxions yet
2219
+ multiSelect: false
2320
2220
  },
2321
- allowsCustomValue: {
2221
+ isOpen: {
2322
2222
  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
2223
+ defaultValue: false,
2224
+ // 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.
2225
+ hidden: () => true
2226
+ },
2227
+ onSelectionChange: {
2228
+ type: "eventHandler",
2229
+ argTypes: [{ name: "selectedKey", type: "string" }]
2327
2230
  },
2328
2231
  onOpenChange: {
2329
2232
  type: "eventHandler",
2330
2233
  argTypes: [{ name: "isOpen", type: "boolean" }]
2331
2234
  },
2332
- structure: {
2235
+ children: {
2333
2236
  type: "slot",
2334
2237
  defaultValue: [
2335
2238
  {
@@ -2353,45 +2256,24 @@ function registerComboBox(loader) {
2353
2256
  },
2354
2257
  {
2355
2258
  type: "hbox",
2356
- styles: {
2357
- width: "stretch",
2358
- borderWidth: "1px",
2359
- borderStyle: "solid",
2360
- borderColor: "black",
2361
- padding: 0,
2362
- position: "relative"
2363
- },
2364
2259
  children: [
2365
2260
  {
2366
2261
  type: "component",
2367
2262
  name: INPUT_COMPONENT_NAME,
2368
2263
  styles: {
2369
- borderWidth: 0,
2370
- width: "100%",
2371
- padding: "2px 30px 2px 10px"
2264
+ width: "100%"
2372
2265
  }
2373
2266
  },
2374
2267
  {
2375
2268
  type: "component",
2376
2269
  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
2270
  props: {
2389
2271
  children: {
2390
2272
  type: "img",
2273
+ // TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/
2391
2274
  src: "https://static1.plasmic.app/arrow-up.svg",
2392
2275
  styles: {
2393
- height: "20px",
2394
- width: "20px",
2276
+ width: "15px",
2395
2277
  transform: "rotate(180deg)"
2396
2278
  }
2397
2279
  }
@@ -2404,15 +2286,18 @@ function registerComboBox(loader) {
2404
2286
  name: POPOVER_COMPONENT_NAME,
2405
2287
  styles: {
2406
2288
  backgroundColor: "white",
2407
- width: "300px",
2408
2289
  padding: "10px",
2409
2290
  overflow: "scroll"
2410
2291
  },
2411
2292
  props: {
2293
+ offset: 0,
2412
2294
  children: [
2413
2295
  {
2414
2296
  type: "component",
2415
2297
  name: LIST_BOX_COMPONENT_NAME,
2298
+ props: {
2299
+ selectionMode: "single"
2300
+ },
2416
2301
  styles: {
2417
2302
  borderWidth: 0,
2418
2303
  width: "stretch"
@@ -2424,29 +2309,18 @@ function registerComboBox(loader) {
2424
2309
  ]
2425
2310
  }
2426
2311
  ]
2427
- },
2428
- previewOpen: {
2429
- type: "boolean",
2430
- displayName: "Preview opened?",
2431
- description: "Preview opened state while designing in Plasmic editor",
2432
- editOnly: true
2433
2312
  }
2434
- },
2313
+ }),
2435
2314
  states: {
2436
- value: {
2437
- type: "writable",
2438
- valueProp: "value",
2439
- onChangeProp: "onChange",
2440
- variableType: "text"
2441
- },
2442
- filterValue: {
2315
+ selectedKey: {
2443
2316
  type: "writable",
2444
- valueProp: "filterValue",
2445
- onChangeProp: "onFilterValueChange",
2317
+ valueProp: "selectedKey",
2318
+ onChangeProp: "onSelectionChange",
2446
2319
  variableType: "text"
2447
2320
  },
2448
2321
  isOpen: {
2449
- type: "readonly",
2322
+ type: "writable",
2323
+ valueProp: "isOpen",
2450
2324
  onChangeProp: "onOpenChange",
2451
2325
  variableType: "boolean"
2452
2326
  }
@@ -2455,8 +2329,8 @@ function registerComboBox(loader) {
2455
2329
  }
2456
2330
 
2457
2331
  var __defProp$d = Object.defineProperty;
2458
- var __defProps$6 = Object.defineProperties;
2459
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
2332
+ var __defProps$7 = Object.defineProperties;
2333
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
2460
2334
  var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
2461
2335
  var __hasOwnProp$d = Object.prototype.hasOwnProperty;
2462
2336
  var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
@@ -2472,7 +2346,7 @@ var __spreadValues$d = (a, b) => {
2472
2346
  }
2473
2347
  return a;
2474
2348
  };
2475
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
2349
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
2476
2350
  var __objRest$c = (source, exclude) => {
2477
2351
  var target = {};
2478
2352
  for (var prop in source)
@@ -2493,6 +2367,7 @@ const BaseModal = forwardRef(
2493
2367
  modalOverlayClass,
2494
2368
  className,
2495
2369
  isOpen,
2370
+ resetClassName,
2496
2371
  setControlContextData
2497
2372
  } = _a, rest = __objRest$c(_a, [
2498
2373
  "children",
@@ -2500,6 +2375,7 @@ const BaseModal = forwardRef(
2500
2375
  "modalOverlayClass",
2501
2376
  "className",
2502
2377
  "isOpen",
2378
+ "resetClassName",
2503
2379
  "setControlContextData"
2504
2380
  ]);
2505
2381
  const contextProps = React.useContext(PlasmicDialogTriggerContext);
@@ -2522,7 +2398,13 @@ const BaseModal = forwardRef(
2522
2398
  }));
2523
2399
  const isCanvas = usePlasmicCanvasContext();
2524
2400
  const body = /* @__PURE__ */ React.createElement(React.Fragment, null, heading && /* @__PURE__ */ React.createElement(Heading, { slot: "title" }, heading), children);
2525
- return /* @__PURE__ */ React.createElement(ModalOverlay, __spreadProps$6(__spreadValues$d({}, mergedProps), { className: modalOverlayClass }), /* @__PURE__ */ React.createElement(Modal, { className }, isCanvas ? body : /* @__PURE__ */ React.createElement(Dialog, null, body)));
2401
+ return /* @__PURE__ */ React.createElement(
2402
+ ModalOverlay,
2403
+ __spreadProps$7(__spreadValues$d({}, mergedProps), {
2404
+ className: `${resetClassName} ${modalOverlayClass}`
2405
+ }),
2406
+ /* @__PURE__ */ React.createElement(Modal, { className }, isCanvas ? body : /* @__PURE__ */ React.createElement(Dialog, null, body))
2407
+ );
2526
2408
  }
2527
2409
  );
2528
2410
  const MODAL_COMPONENT_NAME = makeComponentName("modal");
@@ -2626,6 +2508,9 @@ function registerModal(loader, overrides) {
2626
2508
  onOpenChange: {
2627
2509
  type: "eventHandler",
2628
2510
  argTypes: [{ name: "isOpen", type: "boolean" }]
2511
+ },
2512
+ resetClassName: {
2513
+ type: "themeResetClass"
2629
2514
  }
2630
2515
  },
2631
2516
  states: {
@@ -2814,8 +2699,8 @@ function registerForm(loader, overrides) {
2814
2699
  }
2815
2700
 
2816
2701
  var __defProp$a = Object.defineProperty;
2817
- var __defProps$5 = Object.defineProperties;
2818
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2702
+ var __defProps$6 = Object.defineProperties;
2703
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
2819
2704
  var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
2820
2705
  var __hasOwnProp$a = Object.prototype.hasOwnProperty;
2821
2706
  var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
@@ -2831,7 +2716,7 @@ var __spreadValues$a = (a, b) => {
2831
2716
  }
2832
2717
  return a;
2833
2718
  };
2834
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2719
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
2835
2720
  var __objRest$9 = (source, exclude) => {
2836
2721
  var target = {};
2837
2722
  for (var prop in source)
@@ -2932,7 +2817,7 @@ function registerRadio(loader, overrides) {
2932
2817
  importPath: "@plasmicpkgs/react-aria/skinny/registerRadio",
2933
2818
  importName: "BaseRadio",
2934
2819
  interactionVariants: interactionVariants$8,
2935
- props: __spreadProps$5(__spreadValues$a({}, getCommonProps("radio", [
2820
+ props: __spreadProps$6(__spreadValues$a({}, getCommonProps("radio", [
2936
2821
  "isDisabled",
2937
2822
  "autoFocus",
2938
2823
  "aria-label"
@@ -2954,8 +2839,8 @@ function registerRadio(loader, overrides) {
2954
2839
  }
2955
2840
 
2956
2841
  var __defProp$9 = Object.defineProperty;
2957
- var __defProps$4 = Object.defineProperties;
2958
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
2842
+ var __defProps$5 = Object.defineProperties;
2843
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2959
2844
  var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
2960
2845
  var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
2961
2846
  var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
@@ -2971,7 +2856,7 @@ var __spreadValues$9 = (a, b) => {
2971
2856
  }
2972
2857
  return a;
2973
2858
  };
2974
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
2859
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2975
2860
  var __objRest$8 = (source, exclude) => {
2976
2861
  var target = {};
2977
2862
  for (var prop in source)
@@ -3020,7 +2905,7 @@ function registerRadioGroup(loader, overrides) {
3020
2905
  importPath: "@plasmicpkgs/react-aria/skinny/registerRadioGroup",
3021
2906
  importName: "BaseRadioGroup",
3022
2907
  interactionVariants: interactionVariants$7,
3023
- props: __spreadProps$4(__spreadValues$9({}, getCommonProps("radio group", [
2908
+ props: __spreadProps$5(__spreadValues$9({}, getCommonProps("radio group", [
3024
2909
  "name",
3025
2910
  "isDisabled",
3026
2911
  "isReadOnly",
@@ -3127,6 +3012,8 @@ function registerRadioGroup(loader, overrides) {
3127
3012
  }
3128
3013
 
3129
3014
  var __defProp$8 = Object.defineProperty;
3015
+ var __defProps$4 = Object.defineProperties;
3016
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
3130
3017
  var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
3131
3018
  var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
3132
3019
  var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
@@ -3142,6 +3029,7 @@ var __spreadValues$8 = (a, b) => {
3142
3029
  }
3143
3030
  return a;
3144
3031
  };
3032
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
3145
3033
  const BaseSelectValue = (props) => {
3146
3034
  const { children, customize } = props;
3147
3035
  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))));
@@ -3149,29 +3037,36 @@ const BaseSelectValue = (props) => {
3149
3037
  const SELECT_NAME = makeComponentName("select");
3150
3038
  function BaseSelect(props) {
3151
3039
  const {
3152
- value,
3153
- onChange,
3040
+ selectedKey,
3041
+ onSelectionChange,
3154
3042
  placeholder,
3155
3043
  previewOpen,
3156
3044
  onOpenChange,
3157
3045
  isDisabled,
3158
3046
  className,
3159
3047
  style,
3160
- structure,
3048
+ children,
3161
3049
  name,
3162
3050
  isOpen,
3051
+ setControlContextData,
3163
3052
  "aria-label": ariaLabel
3164
3053
  } = props;
3165
- const { options } = useStrictOptions(props);
3166
3054
  const isEditMode = !!usePlasmicCanvasContext();
3167
3055
  const openProp = isEditMode && previewOpen ? true : isOpen;
3168
- const disabledKeys = flattenOptions(options).filter((op) => op.isDisabled).map((op) => op.id);
3056
+ let idManager = useMemo(() => new ListBoxItemIdManager(), []);
3057
+ useEffect(() => {
3058
+ idManager.subscribe((ids) => {
3059
+ setControlContextData == null ? void 0 : setControlContextData({
3060
+ itemIds: ids
3061
+ });
3062
+ });
3063
+ }, []);
3169
3064
  return /* @__PURE__ */ React.createElement(
3170
3065
  Select,
3171
3066
  __spreadValues$8({
3172
3067
  placeholder,
3173
- selectedKey: value,
3174
- onSelectionChange: onChange,
3068
+ selectedKey,
3069
+ onSelectionChange,
3175
3070
  onOpenChange,
3176
3071
  isDisabled,
3177
3072
  className,
@@ -3184,11 +3079,10 @@ function BaseSelect(props) {
3184
3079
  PlasmicListBoxContext.Provider,
3185
3080
  {
3186
3081
  value: {
3187
- items: options,
3188
- disabledKeys
3082
+ idManager
3189
3083
  }
3190
3084
  },
3191
- structure
3085
+ children
3192
3086
  ))
3193
3087
  );
3194
3088
  }
@@ -3230,27 +3124,44 @@ function registerSelect(loader) {
3230
3124
  displayName: "Aria Select",
3231
3125
  importPath: "@plasmicpkgs/react-aria/skinny/registerSelect",
3232
3126
  importName: "BaseSelect",
3233
- props: {
3234
- options: makeOptionsPropType(),
3235
- placeholder: {
3236
- type: "string"
3237
- },
3238
- isDisabled: {
3239
- type: "boolean"
3127
+ props: __spreadProps$4(__spreadValues$8({}, getCommonProps("Select", [
3128
+ "name",
3129
+ "aria-label",
3130
+ "placeholder",
3131
+ "isDisabled",
3132
+ "autoFocus"
3133
+ ])), {
3134
+ selectedKey: {
3135
+ type: "choice",
3136
+ description: "The selected keys of the listbox",
3137
+ editOnly: true,
3138
+ uncontrolledProp: "defaultSelectedKey",
3139
+ displayName: "Initial selected key",
3140
+ options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
3141
+ // React Aria Select do not support multiple selections yet
3142
+ multiSelect: false
3240
3143
  },
3241
- value: makeValuePropType(),
3242
- onChange: {
3144
+ onSelectionChange: {
3243
3145
  type: "eventHandler",
3244
3146
  argTypes: [{ name: "value", type: "string" }]
3245
3147
  },
3148
+ disabledKeys: {
3149
+ type: "choice",
3150
+ description: "The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.",
3151
+ options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
3152
+ multiSelect: true,
3153
+ advanced: true
3154
+ },
3246
3155
  previewOpen: {
3247
3156
  type: "boolean",
3248
3157
  displayName: "Preview opened?",
3249
3158
  description: "Preview opened state while designing in Plasmic editor",
3250
- editOnly: true
3159
+ editOnly: true,
3160
+ defaultValue: false
3251
3161
  },
3252
3162
  isOpen: {
3253
3163
  type: "boolean",
3164
+ defaultValue: false,
3254
3165
  // 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.
3255
3166
  hidden: () => true
3256
3167
  },
@@ -3258,40 +3169,7 @@ function registerSelect(loader) {
3258
3169
  type: "eventHandler",
3259
3170
  argTypes: [{ name: "isOpen", type: "boolean" }]
3260
3171
  },
3261
- // optionValue: {
3262
- // type: "string",
3263
- // displayName: "Field key for an option's value",
3264
- // hidden: (ps) =>
3265
- // !ps.options ||
3266
- // !ps.options[0] ||
3267
- // typeof ps.options[0] === "string" ||
3268
- // "value" in ps.options[0],
3269
- // exprHint:
3270
- // "Return a function that takes in an option object, and returns the key to use",
3271
- // },
3272
- // optionText: {
3273
- // type: "string",
3274
- // displayName: "Field key for an option's text 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 text value to use",
3282
- // },
3283
- // optionDisabled: {
3284
- // type: "string",
3285
- // displayName: "Field key for whether an option is disabled",
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 true if option should be disabled",
3293
- // },
3294
- structure: {
3172
+ children: {
3295
3173
  type: "slot",
3296
3174
  defaultValue: [
3297
3175
  {
@@ -3359,6 +3237,9 @@ function registerSelect(loader) {
3359
3237
  {
3360
3238
  type: "component",
3361
3239
  name: LIST_BOX_COMPONENT_NAME,
3240
+ props: {
3241
+ selectionMode: "single"
3242
+ },
3362
3243
  styles: {
3363
3244
  borderWidth: 0,
3364
3245
  width: "stretch"
@@ -3370,31 +3251,13 @@ function registerSelect(loader) {
3370
3251
  ]
3371
3252
  }
3372
3253
  ]
3373
- },
3374
- // renderOption: {
3375
- // type: "slot",
3376
- // displayName: "Custom render option",
3377
- // renderPropParams: ["item"],
3378
- // hidePlaceholder: true
3379
- // },
3380
- name: {
3381
- type: "string",
3382
- displayName: "Form field key",
3383
- description: "Name of the input, when submitting in an HTML form",
3384
- advanced: true
3385
- },
3386
- "aria-label": {
3387
- type: "string",
3388
- displayName: "ARIA label",
3389
- description: "Label for this input, if no visible label is used",
3390
- advanced: true
3391
3254
  }
3392
- },
3255
+ }),
3393
3256
  states: {
3394
- value: {
3257
+ selectedKey: {
3395
3258
  type: "writable",
3396
- valueProp: "value",
3397
- onChangeProp: "onChange",
3259
+ valueProp: "selectedKey",
3260
+ onChangeProp: "onSelectionChange",
3398
3261
  variableType: "text"
3399
3262
  },
3400
3263
  isOpen: {
@@ -3469,6 +3332,22 @@ function registerSliderOutput(loader, overrides) {
3469
3332
  );
3470
3333
  }
3471
3334
 
3335
+ class ErrorBoundary extends Component {
3336
+ constructor(props) {
3337
+ super(props);
3338
+ this.state = { hasError: false };
3339
+ }
3340
+ static getDerivedStateFromError(_) {
3341
+ return { hasError: true };
3342
+ }
3343
+ render() {
3344
+ if (this.state.hasError) {
3345
+ return this.props.fallback;
3346
+ }
3347
+ return this.props.children;
3348
+ }
3349
+ }
3350
+
3472
3351
  var __defProp$6 = Object.defineProperty;
3473
3352
  var __defProps$3 = Object.defineProperties;
3474
3353
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;