@plasmicpkgs/react-aria 0.0.27 → 0.0.29

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 (138) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/contexts.d.ts +3 -7
  3. package/dist/interaction-variant-utils.d.ts +4 -0
  4. package/dist/option-utils.d.ts +4 -13
  5. package/dist/react-aria.esm.js +1193 -686
  6. package/dist/react-aria.esm.js.map +1 -1
  7. package/dist/react-aria.js +1190 -683
  8. package/dist/react-aria.js.map +1 -1
  9. package/dist/registerDialogTrigger.d.ts +10 -0
  10. package/dist/registerLabel.d.ts +1 -0
  11. package/dist/registerListBox.d.ts +7 -5
  12. package/dist/registerListBoxItem.d.ts +2 -4
  13. package/dist/registerPopover.d.ts +4 -2
  14. package/dist/registerSection.d.ts +1 -3
  15. package/dist/registerSelect.d.ts +1 -1
  16. package/dist/registerSlider.d.ts +14 -0
  17. package/dist/registerSliderOutput.d.ts +5 -0
  18. package/dist/registerSliderThumb.d.ts +13 -0
  19. package/dist/registerSliderTrack.d.ts +14 -0
  20. package/package.json +3 -3
  21. package/skinny/ErrorBoundary-c6b111d3.esm.js +20 -0
  22. package/skinny/ErrorBoundary-c6b111d3.esm.js.map +1 -0
  23. package/skinny/ErrorBoundary-e9b86248.cjs.js +22 -0
  24. package/skinny/ErrorBoundary-e9b86248.cjs.js.map +1 -0
  25. package/skinny/{contexts-49f6c298.esm.js → contexts-8a2a183b.esm.js} +3 -2
  26. package/skinny/contexts-8a2a183b.esm.js.map +1 -0
  27. package/skinny/{contexts-3e42cdf9.cjs.js → contexts-dd0ce341.cjs.js} +3 -1
  28. package/skinny/contexts-dd0ce341.cjs.js.map +1 -0
  29. package/skinny/contexts.d.ts +3 -7
  30. package/skinny/{interaction-variant-utils-80bf1cfd.cjs.js → interaction-variant-utils-244b74fb.cjs.js} +20 -2
  31. package/skinny/interaction-variant-utils-244b74fb.cjs.js.map +1 -0
  32. package/skinny/{interaction-variant-utils-608d984b.esm.js → interaction-variant-utils-c44a9d56.esm.js} +20 -2
  33. package/skinny/interaction-variant-utils-c44a9d56.esm.js.map +1 -0
  34. package/skinny/interaction-variant-utils.d.ts +4 -0
  35. package/skinny/{option-utils-765a1782.esm.js → option-utils-4f037568.esm.js} +22 -22
  36. package/skinny/option-utils-4f037568.esm.js.map +1 -0
  37. package/skinny/{option-utils-0db61f6d.cjs.js → option-utils-5e4e85bd.cjs.js} +22 -22
  38. package/skinny/option-utils-5e4e85bd.cjs.js.map +1 -0
  39. package/skinny/option-utils.d.ts +4 -13
  40. package/skinny/registerButton.cjs.js +5 -1
  41. package/skinny/registerButton.cjs.js.map +1 -1
  42. package/skinny/registerButton.esm.js +5 -1
  43. package/skinny/registerButton.esm.js.map +1 -1
  44. package/skinny/registerCheckbox.cjs.js +1 -1
  45. package/skinny/registerCheckbox.esm.js +1 -1
  46. package/skinny/registerCheckboxGroup.cjs.js +1 -1
  47. package/skinny/registerCheckboxGroup.esm.js +1 -1
  48. package/skinny/registerComboBox.cjs.js +11 -19
  49. package/skinny/registerComboBox.cjs.js.map +1 -1
  50. package/skinny/registerComboBox.esm.js +11 -19
  51. package/skinny/registerComboBox.esm.js.map +1 -1
  52. package/skinny/registerDialogTrigger.cjs.js +88 -0
  53. package/skinny/registerDialogTrigger.cjs.js.map +1 -0
  54. package/skinny/registerDialogTrigger.d.ts +10 -0
  55. package/skinny/registerDialogTrigger.esm.js +81 -0
  56. package/skinny/registerDialogTrigger.esm.js.map +1 -0
  57. package/skinny/registerHeader.cjs.js +1 -1
  58. package/skinny/registerHeader.esm.js +1 -1
  59. package/skinny/registerInput.cjs.js +1 -1
  60. package/skinny/registerInput.esm.js +1 -1
  61. package/skinny/registerLabel.cjs.js +6 -1
  62. package/skinny/registerLabel.cjs.js.map +1 -1
  63. package/skinny/registerLabel.d.ts +1 -0
  64. package/skinny/registerLabel.esm.js +7 -3
  65. package/skinny/registerLabel.esm.js.map +1 -1
  66. package/skinny/registerListBox.cjs.js +30 -74
  67. package/skinny/registerListBox.cjs.js.map +1 -1
  68. package/skinny/registerListBox.d.ts +7 -5
  69. package/skinny/registerListBox.esm.js +30 -74
  70. package/skinny/registerListBox.esm.js.map +1 -1
  71. package/skinny/registerListBoxItem.cjs.js +4 -20
  72. package/skinny/registerListBoxItem.cjs.js.map +1 -1
  73. package/skinny/registerListBoxItem.d.ts +2 -4
  74. package/skinny/registerListBoxItem.esm.js +4 -20
  75. package/skinny/registerListBoxItem.esm.js.map +1 -1
  76. package/skinny/registerPopover.cjs.js +8 -33
  77. package/skinny/registerPopover.cjs.js.map +1 -1
  78. package/skinny/registerPopover.d.ts +4 -2
  79. package/skinny/registerPopover.esm.js +8 -33
  80. package/skinny/registerPopover.esm.js.map +1 -1
  81. package/skinny/registerRadio.cjs.js +3 -18
  82. package/skinny/registerRadio.cjs.js.map +1 -1
  83. package/skinny/registerRadio.esm.js +3 -18
  84. package/skinny/registerRadio.esm.js.map +1 -1
  85. package/skinny/registerRadioGroup.cjs.js +2 -1
  86. package/skinny/registerRadioGroup.cjs.js.map +1 -1
  87. package/skinny/registerRadioGroup.esm.js +2 -1
  88. package/skinny/registerRadioGroup.esm.js.map +1 -1
  89. package/skinny/registerSection.cjs.js +5 -34
  90. package/skinny/registerSection.cjs.js.map +1 -1
  91. package/skinny/registerSection.d.ts +1 -3
  92. package/skinny/registerSection.esm.js +5 -34
  93. package/skinny/registerSection.esm.js.map +1 -1
  94. package/skinny/registerSelect.cjs.js +5 -16
  95. package/skinny/registerSelect.cjs.js.map +1 -1
  96. package/skinny/registerSelect.d.ts +1 -1
  97. package/skinny/registerSelect.esm.js +5 -16
  98. package/skinny/registerSelect.esm.js.map +1 -1
  99. package/skinny/registerSlider-73e80194.cjs.js +437 -0
  100. package/skinny/registerSlider-73e80194.cjs.js.map +1 -0
  101. package/skinny/registerSlider-efdba013.esm.js +425 -0
  102. package/skinny/registerSlider-efdba013.esm.js.map +1 -0
  103. package/skinny/registerSlider.cjs.js +23 -0
  104. package/skinny/registerSlider.cjs.js.map +1 -0
  105. package/skinny/registerSlider.d.ts +14 -0
  106. package/skinny/registerSlider.esm.js +15 -0
  107. package/skinny/registerSlider.esm.js.map +1 -0
  108. package/skinny/registerSliderOutput.cjs.js +30 -0
  109. package/skinny/registerSliderOutput.cjs.js.map +1 -0
  110. package/skinny/registerSliderOutput.d.ts +5 -0
  111. package/skinny/registerSliderOutput.esm.js +26 -0
  112. package/skinny/registerSliderOutput.esm.js.map +1 -0
  113. package/skinny/registerSliderThumb.cjs.js +119 -0
  114. package/skinny/registerSliderThumb.cjs.js.map +1 -0
  115. package/skinny/registerSliderThumb.d.ts +13 -0
  116. package/skinny/registerSliderThumb.esm.js +111 -0
  117. package/skinny/registerSliderThumb.esm.js.map +1 -0
  118. package/skinny/registerSliderTrack.cjs.js +23 -0
  119. package/skinny/registerSliderTrack.cjs.js.map +1 -0
  120. package/skinny/registerSliderTrack.d.ts +14 -0
  121. package/skinny/registerSliderTrack.esm.js +15 -0
  122. package/skinny/registerSliderTrack.esm.js.map +1 -0
  123. package/skinny/registerSwitch.cjs.js +1 -1
  124. package/skinny/registerSwitch.esm.js +1 -1
  125. package/skinny/registerTextArea.cjs.js +1 -1
  126. package/skinny/registerTextArea.esm.js +1 -1
  127. package/skinny/registerTextField.cjs.js +1 -1
  128. package/skinny/registerTextField.esm.js +1 -1
  129. package/skinny/registerTooltip.cjs.js +13 -6
  130. package/skinny/registerTooltip.cjs.js.map +1 -1
  131. package/skinny/registerTooltip.esm.js +13 -6
  132. package/skinny/registerTooltip.esm.js.map +1 -1
  133. package/skinny/contexts-3e42cdf9.cjs.js.map +0 -1
  134. package/skinny/contexts-49f6c298.esm.js.map +0 -1
  135. package/skinny/interaction-variant-utils-608d984b.esm.js.map +0 -1
  136. package/skinny/interaction-variant-utils-80bf1cfd.cjs.js.map +0 -1
  137. package/skinny/option-utils-0db61f6d.cjs.js.map +0 -1
  138. package/skinny/option-utils-765a1782.esm.js.map +0 -1
@@ -1,7 +1,8 @@
1
1
  import { mergeProps } from '@react-aria/utils';
2
2
  import React from 'react';
3
3
  import { ListBox } from 'react-aria-components';
4
- import { P as PlasmicListBoxContext, b as PlasmicSectionContext, c as PlasmicItemContext } from './contexts-49f6c298.esm.js';
4
+ import { P as PlasmicListBoxContext, b as PlasmicSectionContext, c as PlasmicItemContext } from './contexts-8a2a183b.esm.js';
5
+ import { u as useStrictOptions, m as makeOptionsPropType } from './option-utils-4f037568.esm.js';
5
6
  import { registerListBoxItem } from './registerListBoxItem.esm.js';
6
7
  import { r as registerComponentHelper, m as makeComponentName } from './utils-cf2632c9.esm.js';
7
8
  import '@plasmicapp/host/registerComponent';
@@ -37,71 +38,36 @@ var __objRest = (source, exclude) => {
37
38
  }
38
39
  return target;
39
40
  };
40
- const STANDALONE_PROPS = {
41
- getItemType: (item) => item.type,
42
- items: [
43
- { type: "item", value: "op1", label: "Option 1" },
44
- { type: "item", value: "op2", label: "Option 2" },
45
- { type: "item", value: "op3", label: "Option 3" },
46
- {
47
- type: "section",
48
- label: "Section 1",
49
- items: [
50
- { type: "item", value: "s1op1", label: "Section 1 Option 1" },
51
- { type: "item", value: "s1op2", label: "Section 1 Option 2" },
52
- { type: "item", value: "s1op3", label: "Section 1 Option 3" }
53
- ]
54
- },
55
- {
56
- type: "section",
57
- label: "Section 2",
58
- items: [
59
- { type: "item", value: "s2op1", label: "Section 2 Option 1" },
60
- { type: "item", value: "s2op2", label: "Section 2 Option 2" },
61
- { type: "item", value: "s2op3", label: "Section 2 Option 3" }
62
- ]
63
- }
64
- ],
65
- makeItemProps: (item) => ({
66
- key: item.value,
67
- textValue: item.label,
68
- children: item.label
69
- }),
70
- makeSectionProps: (section) => ({
71
- section,
72
- key: section.label
73
- })
74
- };
75
41
  function BaseListBox(props) {
42
+ var _c;
76
43
  const contextProps = React.useContext(PlasmicListBoxContext);
77
44
  const isStandalone = !contextProps;
78
- const _a = mergeProps(contextProps, props, isStandalone ? STANDALONE_PROPS : {}), {
79
- makeItemProps,
80
- makeSectionProps,
81
- renderItem,
82
- renderSection,
83
- getItemType
84
- } = _a, rest = __objRest(_a, [
85
- "makeItemProps",
86
- "makeSectionProps",
87
- "renderItem",
88
- "renderSection",
89
- "getItemType"
90
- ]);
91
- return /* @__PURE__ */ React.createElement(ListBox, __spreadValues({}, mergeProps(contextProps, rest)), (item) => {
92
- if ((getItemType == null ? void 0 : getItemType(item)) === "section") {
93
- const sectionProps = makeSectionProps == null ? void 0 : makeSectionProps(item);
94
- return /* @__PURE__ */ React.createElement(
45
+ const _a = props, rest = __objRest(_a, ["options"]);
46
+ const { options } = useStrictOptions(props);
47
+ const _b = mergeProps(
48
+ contextProps,
49
+ rest,
50
+ isStandalone ? { items: options } : {}
51
+ ), { renderItem, renderSection } = _b, mergedProps = __objRest(_b, ["renderItem", "renderSection"]);
52
+ (_c = props.setControlContextData) == null ? void 0 : _c.call(props, {
53
+ isStandalone
54
+ });
55
+ return /* @__PURE__ */ React.createElement(ListBox, __spreadValues({}, mergedProps), (item) => {
56
+ var _a2;
57
+ if (item.type === "option-group") {
58
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
95
59
  PlasmicSectionContext.Provider,
96
60
  {
97
- key: sectionProps == null ? void 0 : sectionProps.key,
98
- value: __spreadProps(__spreadValues({}, sectionProps), { makeItemProps, renderItem })
61
+ value: {
62
+ renderItem,
63
+ key: (_a2 = item.key) != null ? _a2 : item.label,
64
+ section: item
65
+ }
99
66
  },
100
67
  renderSection == null ? void 0 : renderSection(item)
101
- );
68
+ ));
102
69
  } else {
103
- const itemProps = makeItemProps == null ? void 0 : makeItemProps(item);
104
- return /* @__PURE__ */ React.createElement(PlasmicItemContext.Provider, { key: itemProps == null ? void 0 : itemProps.key, value: itemProps }, renderItem == null ? void 0 : renderItem(item));
70
+ return /* @__PURE__ */ React.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
105
71
  }
106
72
  });
107
73
  }
@@ -115,29 +81,19 @@ function registerListBox(loader, overrides) {
115
81
  importPath: "@plasmicpkgs/react-aria/skinny/registerListBox",
116
82
  importName: "BaseListBox",
117
83
  props: {
84
+ options: __spreadProps(__spreadValues({}, makeOptionsPropType()), {
85
+ displayName: "Items",
86
+ hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
87
+ }),
118
88
  renderItem: {
119
89
  type: "slot",
120
90
  displayName: "Render Item",
121
- renderPropParams: ["item"]
91
+ renderPropParams: ["itemProps"]
122
92
  },
123
93
  renderSection: {
124
94
  type: "slot",
125
95
  displayName: "Render Section",
126
- renderPropParams: ["section"]
127
- },
128
- className: {
129
- type: "class",
130
- displayName: "Additional states",
131
- selectors: [
132
- {
133
- selector: ":self[data-focused]",
134
- label: "Focused"
135
- },
136
- {
137
- selector: ":self[data-focus-visible]",
138
- label: "Focused by keyboard"
139
- }
140
- ]
96
+ renderPropParams: ["sectionProps"]
141
97
  }
142
98
  }
143
99
  },
@@ -1 +1 @@
1
- {"version":3,"file":"registerListBox.esm.js","sources":["../src/registerListBox.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBox } from \"react-aria-components\";\nimport {\n PlasmicItemContext,\n PlasmicListBoxContext,\n PlasmicSectionContext,\n} from \"./contexts\";\nimport {\n registerListBoxItem,\n type BaseListBoxItem,\n} from \"./registerListBoxItem\";\nimport type { BaseSection } from \"./registerSection\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BaseListBoxProps extends React.ComponentProps<typeof ListBox> {\n makeItemProps?: (\n item: any\n ) => Partial<React.ComponentProps<typeof BaseListBoxItem>>;\n makeSectionProps?: (\n section: any\n ) => Partial<React.ComponentProps<typeof BaseSection>>;\n renderItem?: (item: any) => React.ReactNode;\n renderSection?: (section: any) => React.ReactNode;\n getItemType?: (thing: any) => \"item\" | \"section\";\n}\n\nconst STANDALONE_PROPS: Partial<BaseListBoxProps> = {\n getItemType: (item: any) => item.type,\n items: [\n { type: \"item\", value: \"op1\", label: \"Option 1\" },\n { type: \"item\", value: \"op2\", label: \"Option 2\" },\n { type: \"item\", value: \"op3\", label: \"Option 3\" },\n {\n type: \"section\",\n label: \"Section 1\",\n items: [\n { type: \"item\", value: \"s1op1\", label: \"Section 1 Option 1\" },\n { type: \"item\", value: \"s1op2\", label: \"Section 1 Option 2\" },\n { type: \"item\", value: \"s1op3\", label: \"Section 1 Option 3\" },\n ],\n },\n {\n type: \"section\",\n label: \"Section 2\",\n items: [\n { type: \"item\", value: \"s2op1\", label: \"Section 2 Option 1\" },\n { type: \"item\", value: \"s2op2\", label: \"Section 2 Option 2\" },\n { type: \"item\", value: \"s2op3\", label: \"Section 2 Option 3\" },\n ],\n },\n ],\n makeItemProps: (item: any) => ({\n key: item.value,\n textValue: item.label,\n children: item.label,\n }),\n makeSectionProps: (section: any) => ({\n section: section,\n key: section.label,\n }),\n};\n\nexport function BaseListBox(props: BaseListBoxProps) {\n const contextProps = React.useContext(PlasmicListBoxContext);\n const isStandalone: boolean = !contextProps;\n const {\n makeItemProps,\n makeSectionProps,\n renderItem,\n renderSection,\n getItemType,\n ...rest\n } = mergeProps(contextProps, props, isStandalone ? STANDALONE_PROPS : {});\n return (\n <ListBox {...mergeProps(contextProps, rest)}>\n {(item) => {\n if (getItemType?.(item) === \"section\") {\n const sectionProps = makeSectionProps?.(item);\n return (\n <PlasmicSectionContext.Provider\n key={sectionProps?.key}\n value={{ ...sectionProps, makeItemProps, renderItem }}\n >\n {renderSection?.(item)}\n </PlasmicSectionContext.Provider>\n );\n } else {\n const itemProps = makeItemProps?.(item);\n return (\n <PlasmicItemContext.Provider key={itemProps?.key} value={itemProps}>\n {renderItem?.(item)}\n </PlasmicItemContext.Provider>\n );\n }\n }}\n </ListBox>\n );\n}\n\nexport function registerListBox(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBox>\n) {\n registerComponentHelper(\n loader,\n BaseListBox,\n {\n name: makeComponentName(\"listbox\"),\n displayName: \"Aria ListBox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerListBox\",\n importName: \"BaseListBox\",\n props: {\n renderItem: {\n type: \"slot\",\n displayName: \"Render Item\",\n renderPropParams: [\"item\"],\n },\n renderSection: {\n type: \"slot\",\n displayName: \"Render Section\",\n renderPropParams: [\"section\"],\n },\n className: {\n type: \"class\",\n displayName: \"Additional states\",\n selectors: [\n {\n selector: \":self[data-focused]\",\n label: \"Focused\",\n },\n {\n selector: \":self[data-focus-visible]\",\n label: \"Focused by keyboard\",\n },\n ],\n },\n },\n },\n overrides\n );\n\n registerListBoxItem(loader, {\n parentComponentName: makeComponentName(\"listbox\"),\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,gBAA8C,GAAA;AAAA,EAClD,WAAA,EAAa,CAAC,IAAA,KAAc,IAAK,CAAA,IAAA;AAAA,EACjC,KAAO,EAAA;AAAA,IACL,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,KAAA,EAAO,OAAO,UAAW,EAAA;AAAA,IAChD,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,KAAA,EAAO,OAAO,UAAW,EAAA;AAAA,IAChD,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,KAAA,EAAO,OAAO,UAAW,EAAA;AAAA,IAChD;AAAA,MACE,IAAM,EAAA,SAAA;AAAA,MACN,KAAO,EAAA,WAAA;AAAA,MACP,KAAO,EAAA;AAAA,QACL,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,OAAA,EAAS,OAAO,oBAAqB,EAAA;AAAA,QAC5D,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,OAAA,EAAS,OAAO,oBAAqB,EAAA;AAAA,QAC5D,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EA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AAA;AAAA,MACjC,WAAa,EAAA,cAAA;AAAA,MACb,UAAY,EAAA,gDAAA;AAAA,MACZ,UAAY,EAAA,aAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,UAAY,EAAA;AAAA,UACV,IAAM,EAAA,MAAA;AAAA,UACN,WAAa,EAAA,aAAA;AAAA,UACb,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,SAC3B;AAAA,QACA,aAAe,EAAA;AAAA,UACb,IAAM,EAAA,MAAA;AAAA,UACN,WAAa,EAAA,gBAAA;AAAA,UACb,gBAAA,EAAkB,CAAC,SAAS,CAAA;AAAA,SAC9B;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,OAAA;AAAA,UACN,WAAa,EAAA,mBAAA;AAAA,UACb,SAAW,EAAA;AAAA,YACT;AAAA,cACE,QAAU,EAAA,qBAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,2BAAA;AAAA,cACV,KAAO,EAAA,qBAAA;AAAA,aACT;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AAEA,EAAA,mBAAA,CAAoB,MAAQ,EAAA;AAAA,IAC1B,mBAAA,EAAqB,kBAAkB,SAAS,CAAA;AAAA,GACjD,CAAA,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"registerListBox.esm.js","sources":["../src/registerListBox.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBox } from \"react-aria-components\";\nimport {\n PlasmicItemContext,\n PlasmicListBoxContext,\n PlasmicSectionContext,\n} from \"./contexts\";\nimport {\n HasOptions,\n makeOptionsPropType,\n StrictOptionType,\n useStrictOptions,\n} from \"./option-utils\";\nimport { registerListBoxItem } from \"./registerListBoxItem\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\ninterface BaseListBoxControlContextData {\n isStandalone: boolean;\n}\n\nexport interface BaseListBoxProps\n extends React.ComponentProps<typeof ListBox>,\n HasOptions<any> {\n renderItem?: (item: any) => React.ReactNode;\n renderSection?: (section: any) => React.ReactNode;\n getItemType?: (thing: any) => \"item\" | \"section\";\n setControlContextData?: (ctxData: BaseListBoxControlContextData) => void;\n}\n\nexport function BaseListBox(props: BaseListBoxProps) {\n const contextProps = React.useContext(PlasmicListBoxContext);\n const isStandalone: boolean = !contextProps;\n const { options: _rawOptions, ...rest } = props;\n const { options } = useStrictOptions(props);\n const { renderItem, renderSection, ...mergedProps } = mergeProps(\n contextProps,\n rest,\n isStandalone ? { items: options } : {}\n );\n\n // Tell the prop control about whether the listbox is standalone or not, so it can hide/show the items prop\n props.setControlContextData?.({\n isStandalone,\n });\n\n return (\n <ListBox {...mergedProps}>\n {(item: StrictOptionType) => {\n if (item.type === \"option-group\") {\n return (\n <>\n <PlasmicSectionContext.Provider\n value={{\n renderItem,\n key: item.key ?? item.label,\n section: item,\n }}\n >\n {renderSection?.(item)}\n </PlasmicSectionContext.Provider>\n </>\n );\n } else {\n return (\n <PlasmicItemContext.Provider value={item}>\n {renderItem?.(item)}\n </PlasmicItemContext.Provider>\n );\n }\n }}\n </ListBox>\n );\n}\n\nexport function registerListBox(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBox>\n) {\n registerComponentHelper(\n loader,\n BaseListBox,\n {\n name: makeComponentName(\"listbox\"),\n displayName: \"Aria ListBox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerListBox\",\n importName: \"BaseListBox\",\n props: {\n options: {\n ...makeOptionsPropType(),\n displayName: \"Items\",\n hidden: (\n _ps: BaseListBoxProps,\n ctx: BaseListBoxControlContextData | null\n ) => !ctx?.isStandalone,\n },\n renderItem: {\n type: \"slot\",\n displayName: \"Render Item\",\n renderPropParams: [\"itemProps\"],\n },\n renderSection: {\n type: \"slot\",\n displayName: \"Render Section\",\n renderPropParams: [\"sectionProps\"],\n },\n },\n },\n overrides\n );\n\n registerListBoxItem(loader, {\n parentComponentName: makeComponentName(\"listbox\"),\n });\n}\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,SAAS,YAAY,KAAyB,EAAA;AAnCrD,EAAA,IAAA,EAAA,CAAA;AAoCE,EAAM,MAAA,YAAA,GAAe,KAAM,CAAA,UAAA,CAAW,qBAAqB,CAAA,CAAA;AAC3D,EAAA,MAAM,eAAwB,CAAC,YAAA,CAAA;AAC/B,EAAA,MAA0C,YAAT,IAAA,GAAA,SAAA,CAAS,IAAT,CAAzB,SAAA,CAAA,EAAA;AACR,EAAA,MAAM,EAAE,OAAA,EAAY,GAAA,gBAAA,CAAiB,KAAK,CAAA,CAAA;AAC1C,EAAsD,MAAA,EAAA,GAAA,UAAA;AAAA,IACpD,YAAA;AAAA,IACA,IAAA;AAAA,IACA,YAAe,GAAA,EAAE,KAAO,EAAA,OAAA,KAAY,EAAC;AAAA,GACvC,EAJQ,cAAY,aAxCtB,EAAA,GAwCwD,IAAhB,WAAgB,GAAA,SAAA,CAAA,EAAA,EAAhB,CAA9B,YAAY,EAAA,eAAA,CAAA,CAAA,CAAA;AAOpB,EAAA,CAAA,EAAA,GAAA,KAAA,CAAM,0BAAN,IAA8B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,EAAA;AAAA,IAC5B,YAAA;AAAA,GACF,CAAA,CAAA;AAEA,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,cAAA,CAAA,EAAA,EAAY,WACV,CAAA,EAAA,CAAC,IAA2B,KAAA;AArDnC,IAAAA,IAAAA,GAAAA,CAAAA;AAsDQ,IAAI,IAAA,IAAA,CAAK,SAAS,cAAgB,EAAA;AAChC,MAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAA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Aa,EAAA,gBAAA;AAAA,UACb,gBAAA,EAAkB,CAAC,cAAc,CAAA;AAAA,SACnC;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AAEA,EAAA,mBAAA,CAAoB,MAAQ,EAAA;AAAA,IAC1B,mBAAA,EAAqB,kBAAkB,SAAS,CAAA;AAAA,GACjD,CAAA,CAAA;AACH;;;;"}
@@ -3,7 +3,7 @@
3
3
  var utils = require('@react-aria/utils');
4
4
  var React = require('react');
5
5
  var reactAriaComponents = require('react-aria-components');
6
- var contexts = require('./contexts-3e42cdf9.cjs.js');
6
+ var contexts = require('./contexts-dd0ce341.cjs.js');
7
7
  var utils$1 = require('./utils-18b2465b.cjs.js');
8
8
  require('@plasmicapp/host/registerComponent');
9
9
 
@@ -28,10 +28,9 @@ var __spreadValues = (a, b) => {
28
28
  return a;
29
29
  };
30
30
  function BaseListBoxItem(props) {
31
- var _a;
32
31
  const contextProps = React__default.default.useContext(contexts.PlasmicItemContext);
33
32
  const mergedProps = utils.mergeProps(contextProps, props);
34
- return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadValues({ id: (_a = mergedProps.key) != null ? _a : void 0 }, mergedProps));
33
+ return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadValues({}, mergedProps), mergedProps.children);
35
34
  }
36
35
  function registerListBoxItem(loader, overrides) {
37
36
  utils$1.registerComponentHelper(
@@ -43,23 +42,8 @@ function registerListBoxItem(loader, overrides) {
43
42
  importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
44
43
  importName: "BaseListBoxItem",
45
44
  props: {
46
- className: {
47
- type: "class",
48
- displayName: "Additional states",
49
- selectors: [
50
- {
51
- selector: ":self[data-selected]",
52
- label: "Selected"
53
- },
54
- {
55
- selector: ":self[data-focused], :self[data-hovered]",
56
- label: "Focused"
57
- },
58
- {
59
- selector: ":self[data-disabled]",
60
- label: "Disabled"
61
- }
62
- ]
45
+ children: {
46
+ type: "slot"
63
47
  }
64
48
  }
65
49
  },
@@ -1 +1 @@
1
- {"version":3,"file":"registerListBoxItem.cjs.js","sources":["../src/registerListBoxItem.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Key, ListBoxItem } from \"react-aria-components\";\nimport { PlasmicItemContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseListBoxItem(\n props: React.ComponentProps<typeof ListBoxItem> & {\n key?: Key;\n }\n) {\n const contextProps = React.useContext(PlasmicItemContext);\n const mergedProps = mergeProps(contextProps, props);\n return <ListBoxItem id={mergedProps.key ?? undefined} {...mergedProps} />;\n}\n\nexport function registerListBoxItem(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>\n) {\n registerComponentHelper(\n loader,\n BaseListBoxItem,\n {\n name: makeComponentName(\"item\"),\n displayName: \"Aria ListBoxItem\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerListBoxItem\",\n importName: \"BaseListBoxItem\",\n props: {\n className: {\n type: \"class\",\n displayName: \"Additional states\",\n selectors: [\n {\n selector: \":self[data-selected]\",\n label: \"Selected\",\n },\n {\n selector: \":self[data-focused], :self[data-hovered]\",\n label: \"Focused\",\n },\n {\n selector: \":self[data-disabled]\",\n label: \"Disabled\",\n },\n ],\n },\n },\n },\n overrides\n );\n}\n"],"names":["React","PlasmicItemContext","mergeProps","ListBoxItem","registerComponentHelper","makeComponentName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,gBACd,KAGA,EAAA;AAfF,EAAA,IAAA,EAAA,CAAA;AAgBE,EAAM,MAAA,YAAA,GAAeA,sBAAM,CAAA,UAAA,CAAWC,2BAAkB,CAAA,CAAA;AACxD,EAAM,MAAA,WAAA,GAAcC,gBAAW,CAAA,YAAA,EAAc,KAAK,CAAA,CAAA;AAClD,EAAA,4DAAQC,+BAAY,EAAA,cAAA,CAAA,EAAA,EAAA,EAAA,CAAI,iBAAY,GAAZ,KAAA,IAAA,GAAA,EAAA,GAAmB,UAAe,WAAa,CAAA,CAAA,CAAA;AACzE,CAAA;AAEgB,SAAA,mBAAA,CACd,QACA,SACA,EAAA;AACA,EAAAC,+BAAA;AAAA,IACE,MAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAMC,0BAAkB,MAAM,CAAA;AAAA,MAC9B,WAAa,EAAA,kBAAA;AAAA,MACb,UAAY,EAAA,oDAAA;AAAA,MACZ,UAAY,EAAA,iBAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,OAAA;AAAA,UACN,WAAa,EAAA,mBAAA;AAAA,UACb,SAAW,EAAA;AAAA,YACT;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,0CAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
1
+ {"version":3,"file":"registerListBoxItem.cjs.js","sources":["../src/registerListBoxItem.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBoxItem } from \"react-aria-components\";\nimport { PlasmicItemContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseListBoxItem(\n props: React.ComponentProps<typeof ListBoxItem>\n) {\n const contextProps = React.useContext(PlasmicItemContext);\n const mergedProps = mergeProps(contextProps, props);\n return (\n <ListBoxItem {...mergedProps}>\n {mergedProps.children as React.ReactNode}\n </ListBoxItem>\n );\n}\n\nexport function registerListBoxItem(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>\n) {\n registerComponentHelper(\n loader,\n BaseListBoxItem,\n {\n name: makeComponentName(\"item\"),\n displayName: \"Aria ListBoxItem\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerListBoxItem\",\n importName: \"BaseListBoxItem\",\n props: {\n children: {\n type: \"slot\",\n },\n },\n },\n overrides\n );\n}\n"],"names":["React","PlasmicItemContext","mergeProps","ListBoxItem","registerComponentHelper","makeComponentName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,gBACd,KACA,EAAA;AACA,EAAM,MAAA,YAAA,GAAeA,sBAAM,CAAA,UAAA,CAAWC,2BAAkB,CAAA,CAAA;AACxD,EAAM,MAAA,WAAA,GAAcC,gBAAW,CAAA,YAAA,EAAc,KAAK,CAAA,CAAA;AAClD,EAAA,uBACGF,sBAAA,CAAA,aAAA,CAAAG,+BAAA,EAAA,cAAA,CAAA,EAAA,EAAgB,WACd,CAAA,EAAA,WAAA,CAAY,QACf,CAAA,CAAA;AAEJ,CAAA;AAEgB,SAAA,mBAAA,CACd,QACA,SACA,EAAA;AACA,EAAAC,+BAAA;AAAA,IACE,MAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAMC,0BAAkB,MAAM,CAAA;AAAA,MAC9B,WAAa,EAAA,kBAAA;AAAA,MACb,UAAY,EAAA,oDAAA;AAAA,MACZ,UAAY,EAAA,iBAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,SACR;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
@@ -1,7 +1,5 @@
1
1
  import React from "react";
2
- import { Key, ListBoxItem } from "react-aria-components";
2
+ import { ListBoxItem } from "react-aria-components";
3
3
  import { CodeComponentMetaOverrides, Registerable } from "./utils";
4
- export declare function BaseListBoxItem(props: React.ComponentProps<typeof ListBoxItem> & {
5
- key?: Key;
6
- }): React.JSX.Element;
4
+ export declare function BaseListBoxItem(props: React.ComponentProps<typeof ListBoxItem>): React.JSX.Element;
7
5
  export declare function registerListBoxItem(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>): void;
@@ -1,7 +1,7 @@
1
1
  import { mergeProps } from '@react-aria/utils';
2
2
  import React from 'react';
3
3
  import { ListBoxItem } from 'react-aria-components';
4
- import { c as PlasmicItemContext } from './contexts-49f6c298.esm.js';
4
+ import { c as PlasmicItemContext } from './contexts-8a2a183b.esm.js';
5
5
  import { r as registerComponentHelper, m as makeComponentName } from './utils-cf2632c9.esm.js';
6
6
  import '@plasmicapp/host/registerComponent';
7
7
 
@@ -22,10 +22,9 @@ var __spreadValues = (a, b) => {
22
22
  return a;
23
23
  };
24
24
  function BaseListBoxItem(props) {
25
- var _a;
26
25
  const contextProps = React.useContext(PlasmicItemContext);
27
26
  const mergedProps = mergeProps(contextProps, props);
28
- return /* @__PURE__ */ React.createElement(ListBoxItem, __spreadValues({ id: (_a = mergedProps.key) != null ? _a : void 0 }, mergedProps));
27
+ return /* @__PURE__ */ React.createElement(ListBoxItem, __spreadValues({}, mergedProps), mergedProps.children);
29
28
  }
30
29
  function registerListBoxItem(loader, overrides) {
31
30
  registerComponentHelper(
@@ -37,23 +36,8 @@ function registerListBoxItem(loader, overrides) {
37
36
  importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
38
37
  importName: "BaseListBoxItem",
39
38
  props: {
40
- className: {
41
- type: "class",
42
- displayName: "Additional states",
43
- selectors: [
44
- {
45
- selector: ":self[data-selected]",
46
- label: "Selected"
47
- },
48
- {
49
- selector: ":self[data-focused], :self[data-hovered]",
50
- label: "Focused"
51
- },
52
- {
53
- selector: ":self[data-disabled]",
54
- label: "Disabled"
55
- }
56
- ]
39
+ children: {
40
+ type: "slot"
57
41
  }
58
42
  }
59
43
  },
@@ -1 +1 @@
1
- {"version":3,"file":"registerListBoxItem.esm.js","sources":["../src/registerListBoxItem.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Key, ListBoxItem } from \"react-aria-components\";\nimport { PlasmicItemContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseListBoxItem(\n props: React.ComponentProps<typeof ListBoxItem> & {\n key?: Key;\n }\n) {\n const contextProps = React.useContext(PlasmicItemContext);\n const mergedProps = mergeProps(contextProps, props);\n return <ListBoxItem id={mergedProps.key ?? undefined} {...mergedProps} />;\n}\n\nexport function registerListBoxItem(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>\n) {\n registerComponentHelper(\n loader,\n BaseListBoxItem,\n {\n name: makeComponentName(\"item\"),\n displayName: \"Aria ListBoxItem\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerListBoxItem\",\n importName: \"BaseListBoxItem\",\n props: {\n className: {\n type: \"class\",\n displayName: \"Additional states\",\n selectors: [\n {\n selector: \":self[data-selected]\",\n label: \"Selected\",\n },\n {\n selector: \":self[data-focused], :self[data-hovered]\",\n label: \"Focused\",\n },\n {\n selector: \":self[data-disabled]\",\n label: \"Disabled\",\n },\n ],\n },\n },\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,gBACd,KAGA,EAAA;AAfF,EAAA,IAAA,EAAA,CAAA;AAgBE,EAAM,MAAA,YAAA,GAAe,KAAM,CAAA,UAAA,CAAW,kBAAkB,CAAA,CAAA;AACxD,EAAM,MAAA,WAAA,GAAc,UAAW,CAAA,YAAA,EAAc,KAAK,CAAA,CAAA;AAClD,EAAA,2CAAQ,WAAY,EAAA,cAAA,CAAA,EAAA,EAAA,EAAA,CAAI,iBAAY,GAAZ,KAAA,IAAA,GAAA,EAAA,GAAmB,UAAe,WAAa,CAAA,CAAA,CAAA;AACzE,CAAA;AAEgB,SAAA,mBAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,kBAAkB,MAAM,CAAA;AAAA,MAC9B,WAAa,EAAA,kBAAA;AAAA,MACb,UAAY,EAAA,oDAAA;AAAA,MACZ,UAAY,EAAA,iBAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,OAAA;AAAA,UACN,WAAa,EAAA,mBAAA;AAAA,UACb,SAAW,EAAA;AAAA,YACT;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,0CAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"registerListBoxItem.esm.js","sources":["../src/registerListBoxItem.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBoxItem } from \"react-aria-components\";\nimport { PlasmicItemContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseListBoxItem(\n props: React.ComponentProps<typeof ListBoxItem>\n) {\n const contextProps = React.useContext(PlasmicItemContext);\n const mergedProps = mergeProps(contextProps, props);\n return (\n <ListBoxItem {...mergedProps}>\n {mergedProps.children as React.ReactNode}\n </ListBoxItem>\n );\n}\n\nexport function registerListBoxItem(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>\n) {\n registerComponentHelper(\n loader,\n BaseListBoxItem,\n {\n name: makeComponentName(\"item\"),\n displayName: \"Aria ListBoxItem\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerListBoxItem\",\n importName: \"BaseListBoxItem\",\n props: {\n children: {\n type: \"slot\",\n },\n },\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,gBACd,KACA,EAAA;AACA,EAAM,MAAA,YAAA,GAAe,KAAM,CAAA,UAAA,CAAW,kBAAkB,CAAA,CAAA;AACxD,EAAM,MAAA,WAAA,GAAc,UAAW,CAAA,YAAA,EAAc,KAAK,CAAA,CAAA;AAClD,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,cAAA,CAAA,EAAA,EAAgB,WACd,CAAA,EAAA,WAAA,CAAY,QACf,CAAA,CAAA;AAEJ,CAAA;AAEgB,SAAA,mBAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,kBAAkB,MAAM,CAAA;AAAA,MAC9B,WAAa,EAAA,kBAAA;AAAA,MACb,UAAY,EAAA,oDAAA;AAAA,MACZ,UAAY,EAAA,iBAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,SACR;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -1,10 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var host = require('@plasmicapp/host');
4
3
  var utils = require('@react-aria/utils');
5
4
  var React = require('react');
6
5
  var reactAriaComponents = require('react-aria-components');
7
- var contexts = require('./contexts-3e42cdf9.cjs.js');
6
+ var contexts = require('./contexts-dd0ce341.cjs.js');
8
7
  var utils$1 = require('./utils-18b2465b.cjs.js');
9
8
  require('@plasmicapp/host/registerComponent');
10
9
 
@@ -13,8 +12,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
12
  var React__default = /*#__PURE__*/_interopDefault(React);
14
13
 
15
14
  var __defProp = Object.defineProperty;
16
- var __defProps = Object.defineProperties;
17
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
18
15
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
19
16
  var __hasOwnProp = Object.prototype.hasOwnProperty;
20
17
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -30,7 +27,6 @@ var __spreadValues = (a, b) => {
30
27
  }
31
28
  return a;
32
29
  };
33
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
34
30
  var __objRest = (source, exclude) => {
35
31
  var target = {};
36
32
  for (var prop in source)
@@ -47,23 +43,16 @@ function BasePopover(props) {
47
43
  const _a = props, { resetClassName } = _a, restProps = __objRest(_a, ["resetClassName"]);
48
44
  const isStandalone = !React__default.default.useContext(reactAriaComponents.PopoverContext);
49
45
  const contextProps = React__default.default.useContext(contexts.PlasmicPopoverContext);
50
- const canvas = host.usePlasmicCanvasContext();
51
46
  const mergedProps = utils.mergeProps(contextProps, restProps, {
52
47
  className: `${resetClassName}`
53
48
  });
54
- if (isStandalone) {
55
- const triggerRef = React__default.default.useRef(null);
56
- return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React__default.default.createElement(
57
- reactAriaComponents.Popover,
58
- __spreadProps(__spreadValues({}, mergedProps), {
59
- triggerRef,
60
- isNonModal: true,
61
- isOpen: true
62
- })
63
- ));
64
- } else {
65
- return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Popover, __spreadProps(__spreadValues({}, mergedProps), { isNonModal: !!canvas }));
66
- }
49
+ const triggerRef = React__default.default.useRef(null);
50
+ const standaloneProps = isStandalone ? {
51
+ triggerRef,
52
+ isNonModal: true,
53
+ isOpen: true
54
+ } : {};
55
+ return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isStandalone && /* @__PURE__ */ React__default.default.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Popover, __spreadValues(__spreadValues({}, mergedProps), standaloneProps)));
67
56
  }
68
57
  function registerPopover(loader, overrides) {
69
58
  utils$1.registerComponentHelper(
@@ -99,20 +88,6 @@ function registerPopover(loader, overrides) {
99
88
  resetClassName: {
100
89
  type: "themeResetClass"
101
90
  }
102
- // className: {
103
- // type: "class",
104
- // displayName: "Additional states",
105
- // selectors: [
106
- // {
107
- // selector: ":self[data-entering]",
108
- // label: "Entering",
109
- // },
110
- // {
111
- // selector: ":self[data-exiting]",
112
- // label: "Exiting",
113
- // },
114
- // ],
115
- // },
116
91
  },
117
92
  styleSections: true
118
93
  },
@@ -1 +1 @@
1
- {"version":3,"file":"registerPopover.cjs.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BasePopover(props: {\n className?: string;\n resetClassName?: string;\n}) {\n const { resetClassName, ...restProps } = props;\n const isStandalone = !React.useContext(PopoverContext);\n const contextProps = React.useContext(PlasmicPopoverContext);\n const canvas = usePlasmicCanvasContext();\n const mergedProps = mergeProps(contextProps, restProps, {\n className: `${resetClassName}`,\n });\n\n if (isStandalone) {\n const triggerRef = React.useRef<any>(null);\n return (\n <>\n <div ref={triggerRef} />\n <Popover\n {...mergedProps}\n triggerRef={triggerRef}\n isNonModal={true}\n isOpen={true}\n />\n </>\n );\n } else {\n return <Popover {...mergedProps} isNonModal={!!canvas} />;\n }\n}\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: \"plasmic-react-aria-popover\",\n displayName: \"Aria Popover\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerPopover\",\n importName: \"BasePopover\",\n props: {\n children: {\n type: \"slot\",\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 0,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"top\",\n \"top left\",\n \"top right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n // className: {\n // type: \"class\",\n // displayName: \"Additional states\",\n // selectors: [\n // {\n // selector: \":self[data-entering]\",\n // label: \"Entering\",\n // },\n // {\n // selector: \":self[data-exiting]\",\n // label: \"Exiting\",\n // },\n // ],\n // },\n },\n styleSections: true,\n },\n overrides\n );\n}\n"],"names":["React","PopoverContext","PlasmicPopoverContext","usePlasmicCanvasContext","mergeProps","Popover","registerComponentHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,YAAY,KAGzB,EAAA;AACD,EAAA,MAAyC,YAAjC,EAfV,cAAA,EAAA,GAe2C,EAAd,EAAA,SAAA,GAAA,SAAA,CAAc,IAAd,CAAnB,gBAAA,CAAA,CAAA,CAAA;AACR,EAAA,MAAM,YAAe,GAAA,CAACA,sBAAM,CAAA,UAAA,CAAWC,kCAAc,CAAA,CAAA;AACrD,EAAM,MAAA,YAAA,GAAeD,sBAAM,CAAA,UAAA,CAAWE,8BAAqB,CAAA,CAAA;AAC3D,EAAA,MAAM,SAASC,4BAAwB,EAAA,CAAA;AACvC,EAAM,MAAA,WAAA,GAAcC,gBAAW,CAAA,YAAA,EAAc,SAAW,EAAA;AAAA,IACtD,WAAW,CAAG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,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oFAAA;AAAA,UACF,OAAS,EAAA;AAAA,YACP,QAAA;AAAA,YACA,aAAA;AAAA,YACA,cAAA;AAAA,YACA,KAAA;AAAA,YACA,UAAA;AAAA,YACA,WAAA;AAAA,WACF;AAAA,SACF;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAeF;AAAA,MACA,aAAe,EAAA,IAAA;AAAA,KACjB;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
1
+ {"version":3,"file":"registerPopover.cjs.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BasePopoverProps extends React.ComponentProps<typeof Popover> {\n className?: string;\n resetClassName?: string;\n}\n\nexport function BasePopover(props: BasePopoverProps) {\n const { resetClassName, ...restProps } = props;\n const isStandalone = !React.useContext(PopoverContext);\n const contextProps = React.useContext(PlasmicPopoverContext);\n const mergedProps = mergeProps(contextProps, restProps, {\n className: `${resetClassName}`,\n });\n\n const triggerRef = React.useRef<any>(null);\n\n const standaloneProps = isStandalone\n ? {\n triggerRef,\n isNonModal: true,\n isOpen: true,\n }\n : {};\n\n return (\n <>\n {isStandalone && <div ref={triggerRef} />}\n <Popover {...mergedProps} {...standaloneProps} />\n </>\n );\n}\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: \"plasmic-react-aria-popover\",\n displayName: \"Aria Popover\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerPopover\",\n importName: \"BasePopover\",\n props: {\n children: {\n type: \"slot\",\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 0,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"top\",\n \"top left\",\n \"top right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n styleSections: true,\n },\n overrides\n );\n}\n"],"names":["React","PopoverContext","PlasmicPopoverContext","mergeProps","Popover","registerComponentHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,SAAS,YAAY,KAAyB,EAAA;AACnD,EAAA,MAAyC,YAAjC,EAhBV,cAAA,EAAA,GAgB2C,EAAd,EAAA,SAAA,GAAA,SAAA,CAAc,IAAd,CAAnB,gBAAA,CAAA,CAAA,CAAA;AACR,EAAA,MAAM,YAAe,GAAA,CAACA,sBAAM,CAAA,UAAA,CAAWC,kCAAc,CAAA,CAAA;AACrD,EAAM,MAAA,YAAA,GAAeD,sBAAM,CAAA,UAAA,CAAWE,8BAAqB,CAAA,CAAA;AAC3D,EAAM,MAAA,WAAA,GAAcC,gBAAW,CAAA,YAAA,EAAc,SAAW,EAAA;AAAA,IACtD,WAAW,CAAG,EAAA,cAAA,CAAA,CAAA;AAAA,GACf,CAAA,CAAA;AAED,EAAM,MAAA,UAAA,GAAaH,sBAAM,CAAA,MAAA,CAAY,IAAI,CAAA,CAAA;AAEzC,EAAA,MAAM,kBAAkB,YACpB,GAAA;AAAA,IACE,UAAA;AAAA,IACA,UAAY,EAAA,IAAA;AAAA,IACZ,MAAQ,EAAA,IAAA;AAAA,MAEV,EAAC,CAAA;AAEL,EACE,uBAAAA,sBAAA,CAAA,aAAA,CAAAA,sBAAA,CAAA,QAAA,EAAA,IAAA,EACG,YAAgB,oBAAAA,sBAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,GAAA,EAAK,UAAY,EAAA,CAAA,kBACtCA,sBAAA,CAAA,aAAA,CAAAI,2BAAA,EAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EAAY,WAAiB,CAAA,EAAA,eAAA,CAAiB,CACjD,CAAA,CAAA;AAEJ,CAAA;AAEgB,SAAA,eAAA,CACd,QACA,SACA,EAAA;AACA,EAAAC,+BAAA;AAAA,IACE,MAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,MACE,IAAM,EAAA,4BAAA;AAAA,MACN,WAAa,EAAA,cAAA;AAAA,MACb,UAAY,EAAA,gDAAA;AAAA,MACZ,UAAY,EAAA,aAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,SACR;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,IAAM,EAAA,QAAA;AAAA,UACN,WAAa,EAAA,QAAA;AAAA,UACb,WACE,EAAA,0EAAA;AAAA,UACF,gBAAkB,EAAA,CAAA;AAAA,SACpB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oFAAA;AAAA,UACF,OAAS,EAAA;AAAA,YACP,QAAA;AAAA,YACA,aAAA;AAAA,YACA,cAAA;AAAA,YACA,KAAA;AAAA,YACA,UAAA;AAAA,YACA,WAAA;AAAA,WACF;AAAA,SACF;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA,OACF;AAAA,MACA,aAAe,EAAA,IAAA;AAAA,KACjB;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
@@ -1,7 +1,9 @@
1
1
  import React from "react";
2
+ import { Popover } from "react-aria-components";
2
3
  import { CodeComponentMetaOverrides, Registerable } from "./utils";
3
- export declare function BasePopover(props: {
4
+ export interface BasePopoverProps extends React.ComponentProps<typeof Popover> {
4
5
  className?: string;
5
6
  resetClassName?: string;
6
- }): React.JSX.Element;
7
+ }
8
+ export declare function BasePopover(props: BasePopoverProps): React.JSX.Element;
7
9
  export declare function registerPopover(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BasePopover>): void;
@@ -1,14 +1,11 @@
1
- import { usePlasmicCanvasContext } from '@plasmicapp/host';
2
1
  import { mergeProps } from '@react-aria/utils';
3
2
  import React from 'react';
4
3
  import { PopoverContext, Popover } from 'react-aria-components';
5
- import { d as PlasmicPopoverContext } from './contexts-49f6c298.esm.js';
4
+ import { d as PlasmicPopoverContext } from './contexts-8a2a183b.esm.js';
6
5
  import { r as registerComponentHelper } from './utils-cf2632c9.esm.js';
7
6
  import '@plasmicapp/host/registerComponent';
8
7
 
9
8
  var __defProp = Object.defineProperty;
10
- var __defProps = Object.defineProperties;
11
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
12
9
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
13
10
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
11
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -24,7 +21,6 @@ var __spreadValues = (a, b) => {
24
21
  }
25
22
  return a;
26
23
  };
27
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
24
  var __objRest = (source, exclude) => {
29
25
  var target = {};
30
26
  for (var prop in source)
@@ -41,23 +37,16 @@ function BasePopover(props) {
41
37
  const _a = props, { resetClassName } = _a, restProps = __objRest(_a, ["resetClassName"]);
42
38
  const isStandalone = !React.useContext(PopoverContext);
43
39
  const contextProps = React.useContext(PlasmicPopoverContext);
44
- const canvas = usePlasmicCanvasContext();
45
40
  const mergedProps = mergeProps(contextProps, restProps, {
46
41
  className: `${resetClassName}`
47
42
  });
48
- if (isStandalone) {
49
- const triggerRef = React.useRef(null);
50
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(
51
- Popover,
52
- __spreadProps(__spreadValues({}, mergedProps), {
53
- triggerRef,
54
- isNonModal: true,
55
- isOpen: true
56
- })
57
- ));
58
- } else {
59
- return /* @__PURE__ */ React.createElement(Popover, __spreadProps(__spreadValues({}, mergedProps), { isNonModal: !!canvas }));
60
- }
43
+ const triggerRef = React.useRef(null);
44
+ const standaloneProps = isStandalone ? {
45
+ triggerRef,
46
+ isNonModal: true,
47
+ isOpen: true
48
+ } : {};
49
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(Popover, __spreadValues(__spreadValues({}, mergedProps), standaloneProps)));
61
50
  }
62
51
  function registerPopover(loader, overrides) {
63
52
  registerComponentHelper(
@@ -93,20 +82,6 @@ function registerPopover(loader, overrides) {
93
82
  resetClassName: {
94
83
  type: "themeResetClass"
95
84
  }
96
- // className: {
97
- // type: "class",
98
- // displayName: "Additional states",
99
- // selectors: [
100
- // {
101
- // selector: ":self[data-entering]",
102
- // label: "Entering",
103
- // },
104
- // {
105
- // selector: ":self[data-exiting]",
106
- // label: "Exiting",
107
- // },
108
- // ],
109
- // },
110
85
  },
111
86
  styleSections: true
112
87
  },
@@ -1 +1 @@
1
- {"version":3,"file":"registerPopover.esm.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BasePopover(props: {\n className?: string;\n resetClassName?: string;\n}) {\n const { resetClassName, ...restProps } = props;\n const isStandalone = !React.useContext(PopoverContext);\n const contextProps = React.useContext(PlasmicPopoverContext);\n const canvas = usePlasmicCanvasContext();\n const mergedProps = mergeProps(contextProps, restProps, {\n className: `${resetClassName}`,\n });\n\n if (isStandalone) {\n const triggerRef = React.useRef<any>(null);\n return (\n <>\n <div ref={triggerRef} />\n <Popover\n {...mergedProps}\n triggerRef={triggerRef}\n isNonModal={true}\n isOpen={true}\n />\n </>\n );\n } else {\n return <Popover {...mergedProps} isNonModal={!!canvas} />;\n }\n}\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: \"plasmic-react-aria-popover\",\n displayName: \"Aria Popover\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerPopover\",\n importName: \"BasePopover\",\n props: {\n children: {\n type: \"slot\",\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 0,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"top\",\n \"top left\",\n \"top right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n // className: {\n // type: \"class\",\n // displayName: \"Additional states\",\n // selectors: [\n // {\n // selector: \":self[data-entering]\",\n // label: \"Entering\",\n // },\n // {\n // selector: \":self[data-exiting]\",\n // label: \"Exiting\",\n // },\n // ],\n // },\n },\n styleSections: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,YAAY,KAGzB,EAAA;AACD,EAAA,MAAyC,YAAjC,EAfV,cAAA,EAAA,GAe2C,EAAd,EAAA,SAAA,GAAA,SAAA,CAAc,IAAd,CAAnB,gBAAA,CAAA,CAAA,CAAA;AACR,EAAA,MAAM,YAAe,GAAA,CAAC,KAAM,CAAA,UAAA,CAAW,cAAc,CAAA,CAAA;AACrD,EAAM,MAAA,YAAA,GAAe,KAAM,CAAA,UAAA,CAAW,qBAAqB,CAAA,CA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AAA,QAAA;AAAA,UACb,WACE,EAAA,0EAAA;AAAA,UACF,gBAAkB,EAAA,CAAA;AAAA,SACpB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oFAAA;AAAA,UACF,OAAS,EAAA;AAAA,YACP,QAAA;AAAA,YACA,aAAA;AAAA,YACA,cAAA;AAAA,YACA,KAAA;AAAA,YACA,UAAA;AAAA,YACA,WAAA;AAAA,WACF;AAAA,SACF;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAeF;AAAA,MACA,aAAe,EAAA,IAAA;AAAA,KACjB;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"registerPopover.esm.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BasePopoverProps extends React.ComponentProps<typeof Popover> {\n className?: string;\n resetClassName?: string;\n}\n\nexport function BasePopover(props: BasePopoverProps) {\n const { resetClassName, ...restProps } = props;\n const isStandalone = !React.useContext(PopoverContext);\n const contextProps = React.useContext(PlasmicPopoverContext);\n const mergedProps = mergeProps(contextProps, restProps, {\n className: `${resetClassName}`,\n });\n\n const triggerRef = React.useRef<any>(null);\n\n const standaloneProps = isStandalone\n ? {\n triggerRef,\n isNonModal: true,\n isOpen: true,\n }\n : {};\n\n return (\n <>\n {isStandalone && <div ref={triggerRef} />}\n <Popover {...mergedProps} {...standaloneProps} />\n </>\n );\n}\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: \"plasmic-react-aria-popover\",\n displayName: \"Aria Popover\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerPopover\",\n importName: \"BasePopover\",\n props: {\n children: {\n type: \"slot\",\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 0,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"top\",\n \"top left\",\n \"top right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n styleSections: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,SAAS,YAAY,KAAyB,EAAA;AACnD,EAAA,MAAyC,YAAjC,EAhBV,cAAA,EAAA,GAgB2C,EAAd,EAAA,SAAA,GAAA,SAAA,CAAc,IAAd,CAAnB,gBAAA,CAAA,CAAA,CAAA;AACR,EAAA,MAAM,YAAe,GAAA,CAAC,KAAM,CAAA,UAAA,CAAW,cAAc,CAAA,CAAA;AACrD,EAAM,MAAA,YAAA,GAAe,KAAM,CAAA,UAAA,CAAW,qBAAqB,CAAA,CAAA;AAC3D,EAAM,MAAA,WAAA,GAAc,UAAW,CAAA,YAAA,EAAc,SAAW,EAAA;AAAA,IACtD,WAAW,CAAG,EAAA,cAAA,CAAA,CAAA;AAAA,GACf,CAAA,CAAA;AAED,EAAM,MAAA,UAAA,GAAa,KAAM,CAAA,MAAA,CAAY,IAAI,CAAA,CAAA;AAEzC,EAAA,MAAM,kBAAkB,YACpB,GAAA;AAAA,IACE,UAAA;AAAA,IACA,UAAY,EAAA,IAAA;AAAA,IACZ,MAAQ,EAAA,IAAA;AAAA,MAEV,EAAC,CAAA;AAEL,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACG,YAAgB,oBAAA,KAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,GAAA,EAAK,UAAY,EAAA,CAAA,kBACtC,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EAAY,WAAiB,CAAA,EAAA,eAAA,CAAiB,CACjD,CAAA,CAAA;AAEJ,CAAA;AAEgB,SAAA,eAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,MACE,IAAM,EAAA,4BAAA;AAAA,MACN,WAAa,EAAA,cAAA;AAAA,MACb,UAAY,EAAA,gDAAA;AAAA,MACZ,UAAY,EAAA,aAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,SACR;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,IAAM,EAAA,QAAA;AAAA,UACN,WAAa,EAAA,QAAA;AAAA,UACb,WACE,EAAA,0EAAA;AAAA,UACF,gBAAkB,EAAA,CAAA;AAAA,SACpB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oFAAA;AAAA,UACF,OAAS,EAAA;AAAA,YACP,QAAA;AAAA,YACA,aAAA;AAAA,YACA,cAAA;AAAA,YACA,KAAA;AAAA,YACA,UAAA;AAAA,YACA,WAAA;AAAA,WACF;AAAA,SACF;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA,OACF;AAAA,MACA,aAAe,EAAA,IAAA;AAAA,KACjB;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -2,8 +2,9 @@
2
2
 
3
3
  var React = require('react');
4
4
  var reactAriaComponents = require('react-aria-components');
5
+ var ErrorBoundary = require('./ErrorBoundary-e9b86248.cjs.js');
5
6
  var common = require('./common-e74a9214.cjs.js');
6
- var interactionVariantUtils = require('./interaction-variant-utils-80bf1cfd.cjs.js');
7
+ var interactionVariantUtils = require('./interaction-variant-utils-244b74fb.cjs.js');
7
8
  var utils = require('./utils-18b2465b.cjs.js');
8
9
  require('@plasmicapp/host/registerComponent');
9
10
 
@@ -11,22 +12,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
12
 
12
13
  var React__default = /*#__PURE__*/_interopDefault(React);
13
14
 
14
- class ErrorBoundary extends React.Component {
15
- constructor(props) {
16
- super(props);
17
- this.state = { hasError: false };
18
- }
19
- static getDerivedStateFromError(_) {
20
- return { hasError: true };
21
- }
22
- render() {
23
- if (this.state.hasError) {
24
- return this.props.fallback;
25
- }
26
- return this.props.children;
27
- }
28
- }
29
-
30
15
  var __defProp = Object.defineProperty;
31
16
  var __defProps = Object.defineProperties;
32
17
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
@@ -79,7 +64,7 @@ function BaseRadio(props) {
79
64
  },
80
65
  updateInteractionVariant
81
66
  ));
82
- return /* @__PURE__ */ React__default.default.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.RadioGroup, null, radio) }, radio);
67
+ return /* @__PURE__ */ React__default.default.createElement(ErrorBoundary.ErrorBoundary, { fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.RadioGroup, null, radio) }, radio);
83
68
  }
84
69
  function registerRadio(loader, overrides) {
85
70
  utils.registerComponentHelper(
@@ -1 +1 @@
1
- {"version":3,"file":"registerRadio.cjs.js","sources":["../src/ErrorBoundary.tsx","../src/registerRadio.tsx"],"sourcesContent":["import { Component, ReactNode } from \"react\";\n\ninterface ErrorBoundaryProps {\n children: ReactNode;\n fallback: ReactNode;\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n}\n\nclass ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(_: Error): ErrorBoundaryState {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n render() {\n if (this.state.hasError) {\n return this.props.fallback;\n }\n\n return this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n","import React from \"react\";\nimport type { RadioProps } from \"react-aria-components\";\nimport { Radio, RadioGroup } from \"react-aria-components\";\nimport ErrorBoundary from \"./ErrorBoundary\";\nimport { getCommonInputProps } from \"./common\";\nimport {\n UpdateInteractionVariant,\n pickAriaComponentVariants,\n} from \"./interaction-variant-utils\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n makeComponentName,\n registerComponentHelper,\n} from \"./utils\";\n\nconst RADIO_INTERACTION_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n];\n\nexport interface BaseRadioProps extends RadioProps {\n children: React.ReactNode;\n isSelected: boolean;\n // Optional callback to update the interaction variant state\n // as it's only provided if the component is the root of a Studio component\n updateInteractionVariant?: UpdateInteractionVariant<\n typeof RADIO_INTERACTION_VARIANTS\n >;\n}\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n RADIO_INTERACTION_VARIANTS\n);\n\nexport function BaseRadio(props: BaseRadioProps) {\n const { children, updateInteractionVariant, ...rest } = props;\n\n const radio = (\n <Radio {...rest}>\n {({ isHovered, isPressed, isFocused, isFocusVisible }) =>\n withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n },\n updateInteractionVariant\n )\n }\n </Radio>\n );\n\n return (\n <ErrorBoundary fallback={<RadioGroup>{radio}</RadioGroup>}>\n {radio}\n </ErrorBoundary>\n );\n}\n\nexport function registerRadio(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseRadio>\n) {\n registerComponentHelper(\n loader,\n BaseRadio,\n {\n name: makeComponentName(\"radio\"),\n displayName: \"Aria Radio\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerRadio\",\n importName: \"BaseRadio\",\n interactionVariants,\n props: {\n ...getCommonInputProps<BaseRadioProps>(\"radio\", [\n \"isDisabled\",\n \"autoFocus\",\n \"aria-label\",\n \"children\",\n ]),\n value: {\n type: \"string\",\n description:\n \"The value of the input element, used when submitting an HTML form.\",\n },\n onSelectionChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isSelected\", type: \"boolean\" }],\n },\n },\n states: {\n isSelected: {\n type: \"readonly\",\n onChangeProp: \"onSelectionChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["Component","pickAriaComponentVariants","React","Radio","RadioGroup","registerComponentHelper","makeComponentName","getCommonInputProps"],"mappings":";;;;;;;;;;;;;AAWA,MAAM,sBAAsBA,eAAkD,CAAA;AAAA,EAC5E,YAAY,KAA2B,EAAA;AACrC,IAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AACX,IAAK,IAAA,CAAA,KAAA,GAAQ,EAAE,QAAA,EAAU,KAAM,EAAA,CAAA;AAAA,GACjC;AAAA,EAEA,OAAO,yBAAyB,CAA8B,EAAA;AAE5D,IAAO,OAAA,EAAE,UAAU,IAAK,EAAA,CAAA;AAAA,GAC1B;AAAA,EAEA,MAAS,GAAA;AACP,IAAI,IAAA,IAAA,CAAK,MAAM,QAAU,EAAA;AACvB,MAAA,OAAO,KAAK,KAAM,CAAA,QAAA,CAAA;AAAA,KACpB;AAEA,IAAA,OAAO,KAAK,KAAM,CAAA,QAAA,CAAA;AAAA,GACpB;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbA,MAAM,0BAA6B,GAAA;AAAA,EACjC,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AACF,CAAA,CAAA;AAYA,MAAM,EAAE,mBAAqB,EAAA,kBAAA,EAAuB,GAAAC,iDAAA;AAAA,EAClD,0BAAA;AACF,CAAA,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J;AAAA,QACA,iBAAmB,EAAA;AAAA,UACjB,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,YAAc,EAAA,IAAA,EAAM,WAAW,CAAA;AAAA,SACpD;AAAA,OACF,CAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,UAAY,EAAA;AAAA,UACV,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,mBAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
1
+ {"version":3,"file":"registerRadio.cjs.js","sources":["../src/registerRadio.tsx"],"sourcesContent":["import React from \"react\";\nimport type { RadioProps } from \"react-aria-components\";\nimport { Radio, RadioGroup } from \"react-aria-components\";\nimport ErrorBoundary from \"./ErrorBoundary\";\nimport { getCommonInputProps } from \"./common\";\nimport {\n UpdateInteractionVariant,\n pickAriaComponentVariants,\n} from \"./interaction-variant-utils\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n makeComponentName,\n registerComponentHelper,\n} from \"./utils\";\n\nconst RADIO_INTERACTION_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n];\n\nexport interface BaseRadioProps extends RadioProps {\n children: React.ReactNode;\n isSelected: boolean;\n // Optional callback to update the interaction variant state\n // as it's only provided if the component is the root of a Studio component\n updateInteractionVariant?: UpdateInteractionVariant<\n typeof RADIO_INTERACTION_VARIANTS\n >;\n}\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n RADIO_INTERACTION_VARIANTS\n);\n\nexport function BaseRadio(props: BaseRadioProps) {\n const { children, updateInteractionVariant, ...rest } = props;\n\n const radio = (\n <Radio {...rest}>\n {({ isHovered, isPressed, isFocused, isFocusVisible }) =>\n withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n },\n updateInteractionVariant\n )\n }\n </Radio>\n );\n\n return (\n <ErrorBoundary fallback={<RadioGroup>{radio}</RadioGroup>}>\n {radio}\n </ErrorBoundary>\n );\n}\n\nexport function registerRadio(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseRadio>\n) {\n registerComponentHelper(\n loader,\n BaseRadio,\n {\n name: makeComponentName(\"radio\"),\n displayName: \"Aria Radio\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerRadio\",\n importName: \"BaseRadio\",\n interactionVariants,\n props: {\n ...getCommonInputProps<BaseRadioProps>(\"radio\", [\n \"isDisabled\",\n \"autoFocus\",\n \"aria-label\",\n \"children\",\n ]),\n value: {\n type: \"string\",\n description:\n \"The value of the input element, used when submitting an HTML form.\",\n },\n onSelectionChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isSelected\", type: \"boolean\" }],\n },\n },\n states: {\n isSelected: {\n type: \"readonly\",\n onChangeProp: \"onSelectionChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","Radio","ErrorBoundary","RadioGroup","registerComponentHelper","makeComponentName","getCommonInputProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,0BAA6B,GAAA;AAAA,EACjC,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AACF,CAAA,CAAA;AAYA,MAAM,EAAE,mBAAqB,EAAA,kBAAA,EAAuB,GAAAA,iDAAA;AAAA,EAClD,0BAAA;AACF,CAAA,CAAA;AAEO,SAAS,UAAU,KAAuB,EAAA;AAC/C,EAAwD,MAAA,EAAA,GAAA,KAAA,EAAhD,YAAU,wBAtCpB,EAAA,GAsC0D,IAAT,IAAS,GAAA,SAAA,CAAA,EAAA,EAAT,CAAvC,UAAU,EAAA,0BAAA,CAAA,CAAA,CAAA;A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