@plasmicpkgs/react-aria 0.0.76 → 0.0.78

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 (98) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/contexts.d.ts +1 -1
  3. package/dist/react-aria.esm.js +55 -27
  4. package/dist/react-aria.esm.js.map +1 -1
  5. package/dist/react-aria.js +55 -27
  6. package/dist/react-aria.js.map +1 -1
  7. package/dist/registerPopover.d.ts +6 -2
  8. package/package.json +2 -2
  9. package/skinny/{common-70efdf8a.esm.js → common-1a6affb0.esm.js} +2 -2
  10. package/skinny/{common-70efdf8a.esm.js.map → common-1a6affb0.esm.js.map} +1 -1
  11. package/skinny/{common-f6de262a.cjs.js → common-4b974d89.cjs.js} +2 -2
  12. package/skinny/{common-f6de262a.cjs.js.map → common-4b974d89.cjs.js.map} +1 -1
  13. package/skinny/{contexts-081d65a0.esm.js → contexts-5cb81c2f.esm.js} +3 -3
  14. package/skinny/contexts-5cb81c2f.esm.js.map +1 -0
  15. package/skinny/{contexts-baa37b74.cjs.js → contexts-6d0cb2b1.cjs.js} +3 -3
  16. package/skinny/contexts-6d0cb2b1.cjs.js.map +1 -0
  17. package/skinny/contexts.d.ts +1 -1
  18. package/skinny/registerButton.cjs.js +2 -2
  19. package/skinny/registerButton.esm.js +2 -2
  20. package/skinny/registerCheckbox.cjs.js +3 -3
  21. package/skinny/registerCheckbox.esm.js +3 -3
  22. package/skinny/registerCheckboxGroup.cjs.js +3 -3
  23. package/skinny/registerCheckboxGroup.esm.js +3 -3
  24. package/skinny/registerComboBox.cjs.js +7 -6
  25. package/skinny/registerComboBox.cjs.js.map +1 -1
  26. package/skinny/registerComboBox.esm.js +7 -6
  27. package/skinny/registerComboBox.esm.js.map +1 -1
  28. package/skinny/registerDescription.cjs.js +1 -1
  29. package/skinny/registerDescription.esm.js +1 -1
  30. package/skinny/registerDialogTrigger.cjs.js +6 -6
  31. package/skinny/registerDialogTrigger.cjs.js.map +1 -1
  32. package/skinny/registerDialogTrigger.esm.js +6 -6
  33. package/skinny/registerDialogTrigger.esm.js.map +1 -1
  34. package/skinny/registerFieldError.cjs.js +1 -1
  35. package/skinny/registerFieldError.esm.js +1 -1
  36. package/skinny/registerForm.cjs.js +1 -1
  37. package/skinny/registerForm.esm.js +1 -1
  38. package/skinny/registerHeading.cjs.js +1 -1
  39. package/skinny/registerHeading.esm.js +1 -1
  40. package/skinny/registerInput.cjs.js +3 -3
  41. package/skinny/registerInput.esm.js +3 -3
  42. package/skinny/registerLabel.cjs.js +1 -1
  43. package/skinny/registerLabel.esm.js +1 -1
  44. package/skinny/{registerListBox-3d146fe7.cjs.js → registerListBox-b47231d8.cjs.js} +3 -3
  45. package/skinny/{registerListBox-3d146fe7.cjs.js.map → registerListBox-b47231d8.cjs.js.map} +1 -1
  46. package/skinny/{registerListBox-32d2fae3.esm.js → registerListBox-d5efc5da.esm.js} +3 -3
  47. package/skinny/{registerListBox-32d2fae3.esm.js.map → registerListBox-d5efc5da.esm.js.map} +1 -1
  48. package/skinny/registerListBox.cjs.js +3 -3
  49. package/skinny/registerListBox.esm.js +3 -3
  50. package/skinny/registerListBoxItem.cjs.js +2 -2
  51. package/skinny/registerListBoxItem.esm.js +2 -2
  52. package/skinny/registerModal.cjs.js +5 -5
  53. package/skinny/registerModal.cjs.js.map +1 -1
  54. package/skinny/registerModal.esm.js +5 -5
  55. package/skinny/registerModal.esm.js.map +1 -1
  56. package/skinny/registerPopover.cjs.js +41 -15
  57. package/skinny/registerPopover.cjs.js.map +1 -1
  58. package/skinny/registerPopover.d.ts +6 -2
  59. package/skinny/registerPopover.esm.js +42 -16
  60. package/skinny/registerPopover.esm.js.map +1 -1
  61. package/skinny/registerRadio.cjs.js +3 -3
  62. package/skinny/registerRadio.esm.js +3 -3
  63. package/skinny/registerRadioGroup.cjs.js +3 -3
  64. package/skinny/registerRadioGroup.esm.js +3 -3
  65. package/skinny/registerSection.cjs.js +3 -3
  66. package/skinny/registerSection.esm.js +3 -3
  67. package/skinny/registerSelect.cjs.js +7 -6
  68. package/skinny/registerSelect.cjs.js.map +1 -1
  69. package/skinny/registerSelect.esm.js +7 -6
  70. package/skinny/registerSelect.esm.js.map +1 -1
  71. package/skinny/registerSlider.cjs.js +3 -3
  72. package/skinny/registerSlider.esm.js +3 -3
  73. package/skinny/registerSliderOutput.cjs.js +1 -1
  74. package/skinny/registerSliderOutput.esm.js +1 -1
  75. package/skinny/registerSliderThumb.cjs.js +2 -2
  76. package/skinny/registerSliderThumb.esm.js +2 -2
  77. package/skinny/registerSliderTrack.cjs.js +2 -2
  78. package/skinny/registerSliderTrack.esm.js +2 -2
  79. package/skinny/registerSwitch.cjs.js +2 -2
  80. package/skinny/registerSwitch.esm.js +2 -2
  81. package/skinny/registerText.cjs.js +1 -1
  82. package/skinny/registerText.esm.js +1 -1
  83. package/skinny/registerTextArea.cjs.js +3 -3
  84. package/skinny/registerTextArea.esm.js +3 -3
  85. package/skinny/registerTextField.cjs.js +3 -3
  86. package/skinny/registerTextField.esm.js +3 -3
  87. package/skinny/registerTooltip.cjs.js +3 -3
  88. package/skinny/registerTooltip.cjs.js.map +1 -1
  89. package/skinny/registerTooltip.esm.js +3 -3
  90. package/skinny/registerTooltip.esm.js.map +1 -1
  91. package/skinny/{utils-25448fbd.esm.js → utils-41b3d43b.esm.js} +3 -3
  92. package/skinny/utils-41b3d43b.esm.js.map +1 -0
  93. package/skinny/{utils-3e796b18.cjs.js → utils-d1c8094f.cjs.js} +3 -3
  94. package/skinny/utils-d1c8094f.cjs.js.map +1 -0
  95. package/skinny/contexts-081d65a0.esm.js.map +0 -1
  96. package/skinny/contexts-baa37b74.cjs.js.map +0 -1
  97. package/skinny/utils-25448fbd.esm.js.map +0 -1
  98. package/skinny/utils-3e796b18.cjs.js.map +0 -1
@@ -2,10 +2,10 @@
2
2
 
3
3
  var React = require('react');
4
4
  var reactAriaComponents = require('react-aria-components');
5
- var contexts = require('./contexts-baa37b74.cjs.js');
5
+ var contexts = require('./contexts-6d0cb2b1.cjs.js');
6
6
  var registerDescription = require('./registerDescription.cjs.js');
7
7
  var registerText = require('./registerText.cjs.js');
8
- var utils = require('./utils-3e796b18.cjs.js');
8
+ var utils = require('./utils-d1c8094f.cjs.js');
9
9
  var variantUtils = require('./variant-utils-8cb38f8f.cjs.js');
10
10
  require('@plasmicapp/host');
11
11
  require('@plasmicapp/host/registerComponent');
@@ -1,9 +1,9 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { ListBoxItem, ListBox } from 'react-aria-components';
3
- import { b as PlasmicListBoxContext } from './contexts-081d65a0.esm.js';
3
+ import { b as PlasmicListBoxContext } from './contexts-5cb81c2f.esm.js';
4
4
  import { DESCRIPTION_COMPONENT_NAME } from './registerDescription.esm.js';
5
5
  import { TEXT_COMPONENT_NAME } from './registerText.esm.js';
6
- import { r as registerComponentHelper, a as makeComponentName } from './utils-25448fbd.esm.js';
6
+ import { r as registerComponentHelper, a as makeComponentName } from './utils-41b3d43b.esm.js';
7
7
  import { p as pickAriaComponentVariants } from './variant-utils-7c2ea202.esm.js';
8
8
  import '@plasmicapp/host';
9
9
  import '@plasmicapp/host/registerComponent';
@@ -4,10 +4,10 @@ var host = require('@plasmicapp/host');
4
4
  var React = require('react');
5
5
  var reactAria = require('react-aria');
6
6
  var reactAriaComponents = require('react-aria-components');
7
- var common = require('./common-f6de262a.cjs.js');
8
- var contexts = require('./contexts-baa37b74.cjs.js');
7
+ var common = require('./common-4b974d89.cjs.js');
8
+ var contexts = require('./contexts-6d0cb2b1.cjs.js');
9
9
  var registerHeading = require('./registerHeading.cjs.js');
10
- var utils = require('./utils-3e796b18.cjs.js');
10
+ var utils = require('./utils-d1c8094f.cjs.js');
11
11
  require('@plasmicapp/host/registerComponent');
12
12
 
13
13
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -50,7 +50,7 @@ const INLINE_STYLES = {
50
50
  };
51
51
  const BaseModal = React.forwardRef(
52
52
  function _BaseModal(props, ref) {
53
- var _b;
53
+ var _b, _c, _d;
54
54
  const _a = props, {
55
55
  children,
56
56
  modalOverlayClass,
@@ -68,7 +68,7 @@ const BaseModal = React.forwardRef(
68
68
  "setControlContextData",
69
69
  "isDismissable"
70
70
  ]);
71
- const { isSelected } = (_b = host.usePlasmicCanvasComponentInfo(props)) != null ? _b : {};
71
+ const isSelected = (_d = (_c = (_b = host.usePlasmicCanvasComponentInfo) == null ? void 0 : _b(props)) == null ? void 0 : _c.isSelected) != null ? _d : false;
72
72
  const contextProps = React__default.default.useContext(contexts.PlasmicDialogTriggerContext);
73
73
  const isStandalone = !contextProps;
74
74
  const mergedProps = reactAria.mergeProps(contextProps, rest, {
@@ -1 +1 @@
1
- {"version":3,"file":"registerModal.cjs.js","sources":["../src/registerModal.tsx"],"sourcesContent":["import {\n usePlasmicCanvasComponentInfo,\n usePlasmicCanvasContext,\n} from \"@plasmicapp/host\";\nimport React, { forwardRef, useImperativeHandle } from \"react\";\nimport { mergeProps } from \"react-aria\";\nimport {\n Dialog,\n Modal,\n ModalOverlay,\n ModalOverlayProps,\n} from \"react-aria-components\";\nimport { hasParent } from \"./common\";\nimport { PlasmicDialogTriggerContext } from \"./contexts\";\nimport { HEADING_COMPONENT_NAME } from \"./registerHeading\";\nimport {\n CodeComponentMetaOverrides,\n HasControlContextData,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BaseModalProps\n extends ModalOverlayProps,\n HasControlContextData {\n heading: React.ReactNode;\n modalOverlayClass: string;\n resetClassName?: string;\n children?: React.ReactNode;\n}\n\nexport interface BaseModalActions {\n close(): void;\n open(): void;\n}\n\nconst INLINE_STYLES = {\n outline: \"none\",\n};\n\nexport const BaseModal = forwardRef<BaseModalActions, BaseModalProps>(\n function _BaseModal(props, ref) {\n const {\n children,\n modalOverlayClass,\n className,\n isOpen,\n resetClassName,\n setControlContextData,\n isDismissable,\n ...rest\n } = props;\n\n const { isSelected } = usePlasmicCanvasComponentInfo(props) ?? {};\n\n const contextProps = React.useContext(PlasmicDialogTriggerContext);\n const isStandalone = !contextProps;\n const mergedProps = mergeProps(contextProps, rest, {\n isOpen: isStandalone ? isSelected || isOpen : contextProps.isOpen,\n /*\n isDismissable on canvas (non-interactive mode) causes the following two issues:\n 1. Clicking anywhere inside the modal dismisses it\n 2. If the modal is auto-opened due to selection in outline tab, the modal stays open despite issue #1, but the text elements inside the modal are no longer selectable, and therefore the text or headings inside the modal are not editable.\n\n To fix the above issue, we set an interim isDismissable state to false while the modal is auto-open (`isSelected` is true).\n Also note that `isSelected` can only be true in canvas (non-interactive mode), so we can safely (temporarily) set `isDismissable` to false in this case, because it only matters in interactive mode.\n */\n isDismissable: isSelected ? false : isDismissable,\n });\n\n setControlContextData?.({\n parent: isStandalone ? undefined : {},\n });\n\n // Expose close operation using useImperativeHandle\n useImperativeHandle(ref, () => ({\n close: () => {\n mergedProps.onOpenChange?.(false);\n },\n open: () => {\n mergedProps.onOpenChange?.(true);\n },\n }));\n\n const isCanvas = usePlasmicCanvasContext();\n\n {\n /* <Dialog> cannot be used in canvas, because while the dialog is open on the canvas, the focus is trapped inside it, so any Studio modals like the Color Picker modal would glitch due to focus jumping back and forth */\n }\n const bodyInCanvas = <div style={INLINE_STYLES}>{children}</div>;\n\n const bodyInPreview = <Dialog style={INLINE_STYLES}>{children}</Dialog>;\n\n return (\n <ModalOverlay\n {...mergedProps}\n className={`${resetClassName} ${modalOverlayClass}`}\n >\n <Modal className={className}>\n {isCanvas ? bodyInCanvas : bodyInPreview}\n </Modal>\n </ModalOverlay>\n );\n }\n);\n\nexport const MODAL_COMPONENT_NAME = makeComponentName(\"modal\");\n\nexport function registerModal(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseModal>\n) {\n registerComponentHelper(\n loader,\n BaseModal,\n {\n name: MODAL_COMPONENT_NAME,\n displayName: \"Aria Modal\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerModal\",\n importName: \"BaseModal\",\n styleSections: true,\n defaultStyles: {\n // centering the modal on the page by default\n position: \"fixed\",\n top: \"10%\",\n left: \"50%\",\n width: \"50%\",\n transform: \"translateX(-50%)\",\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"20px\",\n maxWidth: \"300px\",\n backgroundColor: \"#FDE3C3\",\n },\n refActions: {\n open: {\n description: \"Open the modal\",\n argTypes: [],\n },\n close: {\n description: \"Close the modal\",\n argTypes: [],\n },\n },\n props: {\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: {\n type: \"vbox\",\n styles: {\n width: \"stretch\",\n padding: 0,\n gap: \"10px\",\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n },\n children: [\n {\n type: \"component\",\n name: HEADING_COMPONENT_NAME,\n },\n {\n type: \"text\",\n value: \"This is a Modal!\",\n },\n {\n type: \"text\",\n value: \"You can put anything you can imagine here!\",\n styles: {\n fontWeight: 500,\n },\n },\n {\n type: \"text\",\n value:\n \"Use it in a `Aria Dialog Trigger` component to trigger it on a button click!\",\n },\n ],\n },\n },\n modalOverlayClass: {\n type: \"class\",\n displayName: \"Modal Overlay\",\n },\n isOpen: {\n type: \"boolean\",\n editOnly: true,\n uncontrolledProp: \"defaultOpen\",\n defaultValueHint: true,\n defaultValue: true,\n hidden: hasParent,\n },\n isDismissable: {\n type: \"boolean\",\n description:\n \"Whether to close the modal when the user interacts outside it.\",\n },\n isKeyboardDismissDisabled: {\n type: \"boolean\",\n description:\n \"Whether pressing the escape key to close the modal should be disabled.\",\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n states: {\n isOpen: {\n type: \"writable\",\n valueProp: \"isOpen\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n hidden: hasParent,\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["forwardRef","React","PlasmicDialogTriggerContext","mergeProps","useImperativeHandle","_a","usePlasmicCanvasContext","Dialog","ModalOverlay","Modal","makeComponentName","registerComponentHelper","HEADING_COMPONENT_NAME","hasParent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAM,aAAgB,GAAA;AAAA,EACpB,OAAS,EAAA,MAAA;AACX,CAAA,CAAA;AAEO,MAAM,SAAY,GAAAA,gBAAA;AAAA,EACvB,SAAS,UAAW,CAAA,KAAA,EAAO,GAAK,EAAA;AA1ClC,IAAA,IAAA,EAAA,CAAA;AA2CI,IAAA,MASI,EARF,GAAA,KAAA,EAAA;AAAA,MAAA,QAAA;AAAA,MACA,iBAAA;AAAA,MACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,cAAA;AAAA,MACA,qBAAA;AAAA,MACA,aAAA;AAAA,KAlDN,GAoDQ,EADC,EAAA,IAAA,GAAA,SAAA,CACD,EADC,EAAA;AAAA,MAPH,UAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,gBAAA;AAAA,MACA,uBAAA;AAAA,MACA,eAAA;AAAA,KAAA,CAAA,CAAA;AAIF,IAAA,MAAM,EAAE,UAAW,EAAA,GAAA,CAAI,wCAA8B,KAAK,CAAA,KAAnC,YAAwC,EAAC,CAAA;AAEhE,IAAM,MAAA,YAAA,GAAeC,sBAAM,CAAA,UAAA,CAAWC,oCAA2B,CAAA,CAAA;AACjE,IAAA,MAAM,eAAe,CAAC,YAAA,CAAA;AACtB,IAAM,MAAA,WAAA,GAAcC,oBAAW,CAAA,YAAA,EAAc,IAAM,EAAA;AAAA,MACjD,MAAQ,EAAA,YAAA,GAAe,UAAc,IAAA,MAAA,GAAS,YAAa,CAAA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAS3D,aAAA,EAAe,aAAa,KAAQ,GAAA,aAAA;AAAA,KACrC,CAAA,CAAA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Q,EAAA;AAAA,QACN,MAAQ,EAAA;AAAA,UACN,IAAM,EAAA,UAAA;AAAA,UACN,SAAW,EAAA,QAAA;AAAA,UACX,YAAc,EAAA,cAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,UACd,MAAQ,EAAAA,gBAAA;AAAA,SACV;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;;"}
1
+ {"version":3,"file":"registerModal.cjs.js","sources":["../src/registerModal.tsx"],"sourcesContent":["import {\n usePlasmicCanvasComponentInfo,\n usePlasmicCanvasContext,\n} from \"@plasmicapp/host\";\nimport React, { forwardRef, useImperativeHandle } from \"react\";\nimport { mergeProps } from \"react-aria\";\nimport {\n Dialog,\n Modal,\n ModalOverlay,\n ModalOverlayProps,\n} from \"react-aria-components\";\nimport { hasParent } from \"./common\";\nimport { PlasmicDialogTriggerContext } from \"./contexts\";\nimport { HEADING_COMPONENT_NAME } from \"./registerHeading\";\nimport {\n CodeComponentMetaOverrides,\n HasControlContextData,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BaseModalProps\n extends ModalOverlayProps,\n HasControlContextData {\n heading: React.ReactNode;\n modalOverlayClass: string;\n resetClassName?: string;\n children?: React.ReactNode;\n}\n\nexport interface BaseModalActions {\n close(): void;\n open(): void;\n}\n\nconst INLINE_STYLES = {\n outline: \"none\",\n};\n\nexport const BaseModal = forwardRef<BaseModalActions, BaseModalProps>(\n function _BaseModal(props, ref) {\n const {\n children,\n modalOverlayClass,\n className,\n isOpen,\n resetClassName,\n setControlContextData,\n isDismissable,\n ...rest\n } = props;\n\n const isSelected =\n usePlasmicCanvasComponentInfo?.(props)?.isSelected ?? false;\n\n const contextProps = React.useContext(PlasmicDialogTriggerContext);\n const isStandalone = !contextProps;\n const mergedProps = mergeProps(contextProps, rest, {\n isOpen: isStandalone ? isSelected || isOpen : contextProps.isOpen,\n /*\n isDismissable on canvas (non-interactive mode) causes the following two issues:\n 1. Clicking anywhere inside the modal dismisses it\n 2. If the modal is auto-opened due to selection in outline tab, the modal stays open despite issue #1, but the text elements inside the modal are no longer selectable, and therefore the text or headings inside the modal are not editable.\n\n To fix the above issue, we set an interim isDismissable state to false while the modal is auto-open (`isSelected` is true).\n Also note that `isSelected` can only be true in canvas (non-interactive mode), so we can safely (temporarily) set `isDismissable` to false in this case, because it only matters in interactive mode.\n */\n isDismissable: isSelected ? false : isDismissable,\n });\n\n setControlContextData?.({\n parent: isStandalone ? undefined : {},\n });\n\n // Expose close operation using useImperativeHandle\n useImperativeHandle(ref, () => ({\n close: () => {\n mergedProps.onOpenChange?.(false);\n },\n open: () => {\n mergedProps.onOpenChange?.(true);\n },\n }));\n\n const isCanvas = usePlasmicCanvasContext();\n\n {\n /* <Dialog> cannot be used in canvas, because while the dialog is open on the canvas, the focus is trapped inside it, so any Studio modals like the Color Picker modal would glitch due to focus jumping back and forth */\n }\n const bodyInCanvas = <div style={INLINE_STYLES}>{children}</div>;\n\n const bodyInPreview = <Dialog style={INLINE_STYLES}>{children}</Dialog>;\n\n return (\n <ModalOverlay\n {...mergedProps}\n className={`${resetClassName} ${modalOverlayClass}`}\n >\n <Modal className={className}>\n {isCanvas ? bodyInCanvas : bodyInPreview}\n </Modal>\n </ModalOverlay>\n );\n }\n);\n\nexport const MODAL_COMPONENT_NAME = makeComponentName(\"modal\");\n\nexport function registerModal(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseModal>\n) {\n registerComponentHelper(\n loader,\n BaseModal,\n {\n name: MODAL_COMPONENT_NAME,\n displayName: \"Aria Modal\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerModal\",\n importName: \"BaseModal\",\n styleSections: true,\n defaultStyles: {\n // centering the modal on the page by default\n position: \"fixed\",\n top: \"10%\",\n left: \"50%\",\n width: \"50%\",\n transform: \"translateX(-50%)\",\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"20px\",\n maxWidth: \"300px\",\n backgroundColor: \"#FDE3C3\",\n },\n refActions: {\n open: {\n description: \"Open the modal\",\n argTypes: [],\n },\n close: {\n description: \"Close the modal\",\n argTypes: [],\n },\n },\n props: {\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: {\n type: \"vbox\",\n styles: {\n width: \"stretch\",\n padding: 0,\n gap: \"10px\",\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n },\n children: [\n {\n type: \"component\",\n name: HEADING_COMPONENT_NAME,\n },\n {\n type: \"text\",\n value: \"This is a Modal!\",\n },\n {\n type: \"text\",\n value: \"You can put anything you can imagine here!\",\n styles: {\n fontWeight: 500,\n },\n },\n {\n type: \"text\",\n value:\n \"Use it in a `Aria Dialog Trigger` component to trigger it on a button click!\",\n },\n ],\n },\n },\n modalOverlayClass: {\n type: \"class\",\n displayName: \"Modal Overlay\",\n },\n isOpen: {\n type: \"boolean\",\n editOnly: true,\n uncontrolledProp: \"defaultOpen\",\n defaultValueHint: true,\n defaultValue: true,\n hidden: hasParent,\n },\n isDismissable: {\n type: \"boolean\",\n description:\n \"Whether to close the modal when the user interacts outside it.\",\n },\n isKeyboardDismissDisabled: {\n type: \"boolean\",\n description:\n \"Whether pressing the escape key to close the modal should be disabled.\",\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n states: {\n isOpen: {\n type: \"writable\",\n valueProp: \"isOpen\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n hidden: hasParent,\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["forwardRef","usePlasmicCanvasComponentInfo","React","PlasmicDialogTriggerContext","mergeProps","useImperativeHandle","_a","usePlasmicCanvasContext","Dialog","ModalOverlay","Modal","makeComponentName","registerComponentHelper","HEADING_COMPONENT_NAME","hasParent"],"mappings":";;;;;;;;;;;;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AAA;AAAA,SACR;AAAA,OACF;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,MAAQ,EAAA;AAAA,UACN,IAAM,EAAA,UAAA;AAAA,UACN,SAAW,EAAA,QAAA;AAAA,UACX,YAAc,EAAA,cAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,UACd,MAAQ,EAAAA,gBAAA;AAAA,SACV;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;;"}
@@ -2,10 +2,10 @@ import { usePlasmicCanvasComponentInfo, usePlasmicCanvasContext } from '@plasmic
2
2
  import React, { forwardRef, useImperativeHandle } from 'react';
3
3
  import { mergeProps } from 'react-aria';
4
4
  import { ModalOverlay, Modal, Dialog } from 'react-aria-components';
5
- import { h as hasParent } from './common-70efdf8a.esm.js';
6
- import { d as PlasmicDialogTriggerContext } from './contexts-081d65a0.esm.js';
5
+ import { h as hasParent } from './common-1a6affb0.esm.js';
6
+ import { d as PlasmicDialogTriggerContext } from './contexts-5cb81c2f.esm.js';
7
7
  import { HEADING_COMPONENT_NAME } from './registerHeading.esm.js';
8
- import { a as makeComponentName, r as registerComponentHelper } from './utils-25448fbd.esm.js';
8
+ import { a as makeComponentName, r as registerComponentHelper } from './utils-41b3d43b.esm.js';
9
9
  import '@plasmicapp/host/registerComponent';
10
10
 
11
11
  var __defProp = Object.defineProperty;
@@ -44,7 +44,7 @@ const INLINE_STYLES = {
44
44
  };
45
45
  const BaseModal = forwardRef(
46
46
  function _BaseModal(props, ref) {
47
- var _b;
47
+ var _b, _c, _d;
48
48
  const _a = props, {
49
49
  children,
50
50
  modalOverlayClass,
@@ -62,7 +62,7 @@ const BaseModal = forwardRef(
62
62
  "setControlContextData",
63
63
  "isDismissable"
64
64
  ]);
65
- const { isSelected } = (_b = usePlasmicCanvasComponentInfo(props)) != null ? _b : {};
65
+ const isSelected = (_d = (_c = (_b = usePlasmicCanvasComponentInfo) == null ? void 0 : _b(props)) == null ? void 0 : _c.isSelected) != null ? _d : false;
66
66
  const contextProps = React.useContext(PlasmicDialogTriggerContext);
67
67
  const isStandalone = !contextProps;
68
68
  const mergedProps = mergeProps(contextProps, rest, {
@@ -1 +1 @@
1
- {"version":3,"file":"registerModal.esm.js","sources":["../src/registerModal.tsx"],"sourcesContent":["import {\n usePlasmicCanvasComponentInfo,\n usePlasmicCanvasContext,\n} from \"@plasmicapp/host\";\nimport React, { forwardRef, useImperativeHandle } from \"react\";\nimport { mergeProps } from \"react-aria\";\nimport {\n Dialog,\n Modal,\n ModalOverlay,\n ModalOverlayProps,\n} from \"react-aria-components\";\nimport { hasParent } from \"./common\";\nimport { PlasmicDialogTriggerContext } from \"./contexts\";\nimport { HEADING_COMPONENT_NAME } from \"./registerHeading\";\nimport {\n CodeComponentMetaOverrides,\n HasControlContextData,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BaseModalProps\n extends ModalOverlayProps,\n HasControlContextData {\n heading: React.ReactNode;\n modalOverlayClass: string;\n resetClassName?: string;\n children?: React.ReactNode;\n}\n\nexport interface BaseModalActions {\n close(): void;\n open(): void;\n}\n\nconst INLINE_STYLES = {\n outline: \"none\",\n};\n\nexport const BaseModal = forwardRef<BaseModalActions, BaseModalProps>(\n function _BaseModal(props, ref) {\n const {\n children,\n modalOverlayClass,\n className,\n isOpen,\n resetClassName,\n setControlContextData,\n isDismissable,\n ...rest\n } = props;\n\n const { isSelected } = usePlasmicCanvasComponentInfo(props) ?? {};\n\n const contextProps = React.useContext(PlasmicDialogTriggerContext);\n const isStandalone = !contextProps;\n const mergedProps = mergeProps(contextProps, rest, {\n isOpen: isStandalone ? isSelected || isOpen : contextProps.isOpen,\n /*\n isDismissable on canvas (non-interactive mode) causes the following two issues:\n 1. Clicking anywhere inside the modal dismisses it\n 2. If the modal is auto-opened due to selection in outline tab, the modal stays open despite issue #1, but the text elements inside the modal are no longer selectable, and therefore the text or headings inside the modal are not editable.\n\n To fix the above issue, we set an interim isDismissable state to false while the modal is auto-open (`isSelected` is true).\n Also note that `isSelected` can only be true in canvas (non-interactive mode), so we can safely (temporarily) set `isDismissable` to false in this case, because it only matters in interactive mode.\n */\n isDismissable: isSelected ? false : isDismissable,\n });\n\n setControlContextData?.({\n parent: isStandalone ? undefined : {},\n });\n\n // Expose close operation using useImperativeHandle\n useImperativeHandle(ref, () => ({\n close: () => {\n mergedProps.onOpenChange?.(false);\n },\n open: () => {\n mergedProps.onOpenChange?.(true);\n },\n }));\n\n const isCanvas = usePlasmicCanvasContext();\n\n {\n /* <Dialog> cannot be used in canvas, because while the dialog is open on the canvas, the focus is trapped inside it, so any Studio modals like the Color Picker modal would glitch due to focus jumping back and forth */\n }\n const bodyInCanvas = <div style={INLINE_STYLES}>{children}</div>;\n\n const bodyInPreview = <Dialog style={INLINE_STYLES}>{children}</Dialog>;\n\n return (\n <ModalOverlay\n {...mergedProps}\n className={`${resetClassName} ${modalOverlayClass}`}\n >\n <Modal className={className}>\n {isCanvas ? bodyInCanvas : bodyInPreview}\n </Modal>\n </ModalOverlay>\n );\n }\n);\n\nexport const MODAL_COMPONENT_NAME = makeComponentName(\"modal\");\n\nexport function registerModal(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseModal>\n) {\n registerComponentHelper(\n loader,\n BaseModal,\n {\n name: MODAL_COMPONENT_NAME,\n displayName: \"Aria Modal\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerModal\",\n importName: \"BaseModal\",\n styleSections: true,\n defaultStyles: {\n // centering the modal on the page by default\n position: \"fixed\",\n top: \"10%\",\n left: \"50%\",\n width: \"50%\",\n transform: \"translateX(-50%)\",\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"20px\",\n maxWidth: \"300px\",\n backgroundColor: \"#FDE3C3\",\n },\n refActions: {\n open: {\n description: \"Open the modal\",\n argTypes: [],\n },\n close: {\n description: \"Close the modal\",\n argTypes: [],\n },\n },\n props: {\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: {\n type: \"vbox\",\n styles: {\n width: \"stretch\",\n padding: 0,\n gap: \"10px\",\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n },\n children: [\n {\n type: \"component\",\n name: HEADING_COMPONENT_NAME,\n },\n {\n type: \"text\",\n value: \"This is a Modal!\",\n },\n {\n type: \"text\",\n value: \"You can put anything you can imagine here!\",\n styles: {\n fontWeight: 500,\n },\n },\n {\n type: \"text\",\n value:\n \"Use it in a `Aria Dialog Trigger` component to trigger it on a button click!\",\n },\n ],\n },\n },\n modalOverlayClass: {\n type: \"class\",\n displayName: \"Modal Overlay\",\n },\n isOpen: {\n type: \"boolean\",\n editOnly: true,\n uncontrolledProp: \"defaultOpen\",\n defaultValueHint: true,\n defaultValue: true,\n hidden: hasParent,\n },\n isDismissable: {\n type: \"boolean\",\n description:\n \"Whether to close the modal when the user interacts outside it.\",\n },\n isKeyboardDismissDisabled: {\n type: \"boolean\",\n description:\n \"Whether pressing the escape key to close the modal should be disabled.\",\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n states: {\n isOpen: {\n type: \"writable\",\n valueProp: \"isOpen\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n hidden: hasParent,\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAM,aAAgB,GAAA;AAAA,EACpB,OAAS,EAAA,MAAA;AACX,CAAA,CAAA;AAEO,MAAM,SAAY,GAAA,UAAA;AAAA,EACvB,SAAS,UAAW,CAAA,KAAA,EAAO,GAAK,EAAA;AA1ClC,IAAA,IAAA,EAAA,CAAA;AA2CI,IAAA,MASI,EARF,GAAA,KAAA,EAAA;AAAA,MAAA,QAAA;AAAA,MACA,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;AAAA,aACF;AAAA,WACF;AAAA,SACF;AAAA,QACA,iBAAmB,EAAA;AAAA,UACjB,IAAM,EAAA,OAAA;AAAA,UACN,WAAa,EAAA,eAAA;AAAA,SACf;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,IAAM,EAAA,SAAA;AAAA,UACN,QAAU,EAAA,IAAA;AAAA,UACV,gBAAkB,EAAA,aAAA;AAAA,UAClB,gBAAkB,EAAA,IAAA;AAAA,UAClB,YAAc,EAAA,IAAA;AAAA,UACd,MAAQ,EAAA,SAAA;AAAA,SACV;AAAA,QACA,aAAe,EAAA;AAAA,UACb,IAAM,EAAA,SAAA;AAAA,UACN,WACE,EAAA,gEAAA;AAAA,SACJ;AAAA,QACA,yBAA2B,EAAA;AAAA,UACzB,IAAM,EAAA,SAAA;AAAA,UACN,WACE,EAAA,wEAAA;AAAA,SACJ;AAAA,QACA,YAAc,EAAA;AAAA,UACZ,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,QAAU,EAAA,IAAA,EAAM,WAAW,CAAA;AAAA,SAChD;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA,OACF;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,MAAQ,EAAA;AAAA,UACN,IAAM,EAAA,UAAA;AAAA,UACN,SAAW,EAAA,QAAA;AAAA,UACX,YAAc,EAAA,cAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,UACd,MAAQ,EAAA,SAAA;AAAA,SACV;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"registerModal.esm.js","sources":["../src/registerModal.tsx"],"sourcesContent":["import {\n usePlasmicCanvasComponentInfo,\n usePlasmicCanvasContext,\n} from \"@plasmicapp/host\";\nimport React, { forwardRef, useImperativeHandle } from \"react\";\nimport { mergeProps } from \"react-aria\";\nimport {\n Dialog,\n Modal,\n ModalOverlay,\n ModalOverlayProps,\n} from \"react-aria-components\";\nimport { hasParent } from \"./common\";\nimport { PlasmicDialogTriggerContext } from \"./contexts\";\nimport { HEADING_COMPONENT_NAME } from \"./registerHeading\";\nimport {\n CodeComponentMetaOverrides,\n HasControlContextData,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BaseModalProps\n extends ModalOverlayProps,\n HasControlContextData {\n heading: React.ReactNode;\n modalOverlayClass: string;\n resetClassName?: string;\n children?: React.ReactNode;\n}\n\nexport interface BaseModalActions {\n close(): void;\n open(): void;\n}\n\nconst INLINE_STYLES = {\n outline: \"none\",\n};\n\nexport const BaseModal = forwardRef<BaseModalActions, BaseModalProps>(\n function _BaseModal(props, ref) {\n const {\n children,\n modalOverlayClass,\n className,\n isOpen,\n resetClassName,\n setControlContextData,\n isDismissable,\n ...rest\n } = props;\n\n const isSelected =\n usePlasmicCanvasComponentInfo?.(props)?.isSelected ?? false;\n\n const contextProps = React.useContext(PlasmicDialogTriggerContext);\n const isStandalone = !contextProps;\n const mergedProps = mergeProps(contextProps, rest, {\n isOpen: isStandalone ? isSelected || isOpen : contextProps.isOpen,\n /*\n isDismissable on canvas (non-interactive mode) causes the following two issues:\n 1. Clicking anywhere inside the modal dismisses it\n 2. If the modal is auto-opened due to selection in outline tab, the modal stays open despite issue #1, but the text elements inside the modal are no longer selectable, and therefore the text or headings inside the modal are not editable.\n\n To fix the above issue, we set an interim isDismissable state to false while the modal is auto-open (`isSelected` is true).\n Also note that `isSelected` can only be true in canvas (non-interactive mode), so we can safely (temporarily) set `isDismissable` to false in this case, because it only matters in interactive mode.\n */\n isDismissable: isSelected ? false : isDismissable,\n });\n\n setControlContextData?.({\n parent: isStandalone ? undefined : {},\n });\n\n // Expose close operation using useImperativeHandle\n useImperativeHandle(ref, () => ({\n close: () => {\n mergedProps.onOpenChange?.(false);\n },\n open: () => {\n mergedProps.onOpenChange?.(true);\n },\n }));\n\n const isCanvas = usePlasmicCanvasContext();\n\n {\n /* <Dialog> cannot be used in canvas, because while the dialog is open on the canvas, the focus is trapped inside it, so any Studio modals like the Color Picker modal would glitch due to focus jumping back and forth */\n }\n const bodyInCanvas = <div style={INLINE_STYLES}>{children}</div>;\n\n const bodyInPreview = <Dialog style={INLINE_STYLES}>{children}</Dialog>;\n\n return (\n <ModalOverlay\n {...mergedProps}\n className={`${resetClassName} ${modalOverlayClass}`}\n >\n <Modal className={className}>\n {isCanvas ? bodyInCanvas : bodyInPreview}\n </Modal>\n </ModalOverlay>\n );\n }\n);\n\nexport const MODAL_COMPONENT_NAME = makeComponentName(\"modal\");\n\nexport function registerModal(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseModal>\n) {\n registerComponentHelper(\n loader,\n BaseModal,\n {\n name: MODAL_COMPONENT_NAME,\n displayName: \"Aria Modal\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerModal\",\n importName: \"BaseModal\",\n styleSections: true,\n defaultStyles: {\n // centering the modal on the page by default\n position: \"fixed\",\n top: \"10%\",\n left: \"50%\",\n width: \"50%\",\n transform: \"translateX(-50%)\",\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"20px\",\n maxWidth: \"300px\",\n backgroundColor: \"#FDE3C3\",\n },\n refActions: {\n open: {\n description: \"Open the modal\",\n argTypes: [],\n },\n close: {\n description: \"Close the modal\",\n argTypes: [],\n },\n },\n props: {\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: {\n type: \"vbox\",\n styles: {\n width: \"stretch\",\n padding: 0,\n gap: \"10px\",\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n },\n children: [\n {\n type: \"component\",\n name: HEADING_COMPONENT_NAME,\n },\n {\n type: \"text\",\n value: \"This is a Modal!\",\n },\n {\n type: \"text\",\n value: \"You can put anything you can imagine here!\",\n styles: {\n fontWeight: 500,\n },\n },\n {\n type: \"text\",\n value:\n \"Use it in a `Aria Dialog Trigger` component to trigger it on a button click!\",\n },\n ],\n },\n },\n modalOverlayClass: {\n type: \"class\",\n displayName: \"Modal Overlay\",\n },\n isOpen: {\n type: \"boolean\",\n editOnly: true,\n uncontrolledProp: \"defaultOpen\",\n defaultValueHint: true,\n defaultValue: true,\n hidden: hasParent,\n },\n isDismissable: {\n type: \"boolean\",\n description:\n \"Whether to close the modal when the user interacts outside it.\",\n },\n isKeyboardDismissDisabled: {\n type: \"boolean\",\n description:\n \"Whether pressing the escape key to close the modal should be disabled.\",\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n states: {\n isOpen: {\n type: \"writable\",\n valueProp: \"isOpen\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n hidden: hasParent,\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAM,aAAgB,GAAA;AAAA,EACpB,OAAS,EAAA,MAAA;AACX,CAAA,CAAA;AAEO,MAAM,SAAY,GAAA,UAAA;AAAA,EACvB,SAAS,UAAW,CAAA,KAAA,EAAO,GAAK,EAAA;AA1ClC,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AA2CI,IAAA,MASI,EARF,GAAA,KAAA,EAAA;AAAA,MAAA,QAAA;AAAA,MACA,iBAAA;AAAA,MACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,cAAA;AAAA,MACA,qBAAA;AAAA,MACA,aAAA;AAAA,KAlDN,GAoDQ,EADC,EAAA,IAAA,GAAA,SAAA,CACD,EADC,EAAA;AAAA,MAPH,UAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,gBAAA;AAAA,MACA,uBAAA;AAAA,MACA,eAAA;AAAA,KAAA,CAAA,CAAA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;AAAA,UACN,IAAM,EAAA,SAAA;AAAA,UACN,QAAU,EAAA,IAAA;AAAA,UACV,gBAAkB,EAAA,aAAA;AAAA,UAClB,gBAAkB,EAAA,IAAA;AAAA,UAClB,YAAc,EAAA,IAAA;AAAA,UACd,MAAQ,EAAA,SAAA;AAAA,SACV;AAAA,QACA,aAAe,EAAA;AAAA,UACb,IAAM,EAAA,SAAA;AAAA,UACN,WACE,EAAA,gEAAA;AAAA,SACJ;AAAA,QACA,yBAA2B,EAAA;AAAA,UACzB,IAAM,EAAA,SAAA;AAAA,UACN,WACE,EAAA,wEAAA;AAAA,SACJ;AAAA,QACA,YAAc,EAAA;AAAA,UACZ,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,QAAU,EAAA,IAAA,EAAM,WAAW,CAAA;AAAA,SAChD;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA,OACF;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,MAAQ,EAAA;AAAA,UACN,IAAM,EAAA,UAAA;AAAA,UACN,SAAW,EAAA,QAAA;AAAA,UACX,YAAc,EAAA,cAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,UACd,MAAQ,EAAA,SAAA;AAAA,SACV;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -4,8 +4,8 @@ var host = require('@plasmicapp/host');
4
4
  var utils = require('@react-aria/utils');
5
5
  var React = require('react');
6
6
  var reactAriaComponents = require('react-aria-components');
7
- var contexts = require('./contexts-baa37b74.cjs.js');
8
- var utils$1 = require('./utils-3e796b18.cjs.js');
7
+ var contexts = require('./contexts-6d0cb2b1.cjs.js');
8
+ var utils$1 = require('./utils-d1c8094f.cjs.js');
9
9
  var variantUtils = require('./variant-utils-8cb38f8f.cjs.js');
10
10
  require('@plasmicapp/host/registerComponent');
11
11
 
@@ -49,14 +49,24 @@ const POPOVER_VARIANTS = [
49
49
  ];
50
50
  const { variants, withObservedValues } = variantUtils.pickAriaComponentVariants(POPOVER_VARIANTS);
51
51
  function BasePopover(props) {
52
- const _a = props, { resetClassName, plasmicUpdateVariant } = _a, restProps = __objRest(_a, ["resetClassName", "plasmicUpdateVariant"]);
52
+ const _a = props, {
53
+ resetClassName,
54
+ plasmicUpdateVariant,
55
+ setControlContextData,
56
+ matchTriggerWidth
57
+ } = _a, restProps = __objRest(_a, [
58
+ "resetClassName",
59
+ "plasmicUpdateVariant",
60
+ "setControlContextData",
61
+ "matchTriggerWidth"
62
+ ]);
53
63
  const isStandalone = !React__default.default.useContext(reactAriaComponents.PopoverContext);
54
- const context = React__default.default.useContext(contexts.PlasmicPopoverContext);
64
+ const hasTrigger = !!React__default.default.useContext(contexts.PlasmicPopoverTriggerContext);
55
65
  const triggerRef = React__default.default.useRef(null);
56
66
  const canvasContext = host.usePlasmicCanvasContext();
67
+ const matchTriggerWidthProp = hasTrigger && matchTriggerWidth;
57
68
  const _b = utils.mergeProps(
58
69
  {
59
- isOpen: context == null ? void 0 : context.isOpen,
60
70
  // isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.
61
71
  // Setting isNonModal to true in edit mode (canvas) means that the popover will not prevent the user from interacting with the canvas while the popover is open.
62
72
  isNonModal: canvasContext && !canvasContext.interactive
@@ -72,16 +82,27 @@ function BasePopover(props) {
72
82
  isOpen: true
73
83
  } : null
74
84
  ), { children } = _b, mergedProps = __objRest(_b, ["children"]);
75
- 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({}, mergedProps), ({ placement }) => withObservedValues(
76
- children,
77
- {
78
- placementTop: placement === "top",
79
- placementBottom: placement === "bottom",
80
- placementLeft: placement === "left",
81
- placementRight: placement === "right"
82
- },
83
- plasmicUpdateVariant
84
- )));
85
+ React.useEffect(() => {
86
+ setControlContextData == null ? void 0 : setControlContextData({
87
+ canMatchTriggerWidth: hasTrigger
88
+ });
89
+ }, [hasTrigger, setControlContextData]);
90
+ 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(
91
+ reactAriaComponents.Popover,
92
+ __spreadValues({
93
+ style: matchTriggerWidthProp ? { width: `var(--trigger-width)` } : void 0
94
+ }, mergedProps),
95
+ ({ placement }) => withObservedValues(
96
+ children,
97
+ {
98
+ placementTop: placement === "top",
99
+ placementBottom: placement === "bottom",
100
+ placementLeft: placement === "left",
101
+ placementRight: placement === "right"
102
+ },
103
+ plasmicUpdateVariant
104
+ )
105
+ ));
85
106
  }
86
107
  const POPOVER_COMPONENT_NAME = utils$1.makeComponentName("popover");
87
108
  const POPOVER_ARROW_IMG = {
@@ -172,6 +193,11 @@ function registerPopover(loader, overrides) {
172
193
  },
173
194
  resetClassName: {
174
195
  type: "themeResetClass"
196
+ },
197
+ matchTriggerWidth: {
198
+ type: "boolean",
199
+ defaultValue: true,
200
+ hidden: (_props, ctx) => !(ctx == null ? void 0 : ctx.canMatchTriggerWidth)
175
201
  }
176
202
  },
177
203
  // No isOpen state for popover, because we assume that its open state is always going to be controlled by a parent like Select, Combobox, DialogTrigger, etc.
@@ -1 +1 @@
1
- {"version":3,"file":"registerPopover.cjs.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { PlasmicElement, 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 makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\nimport { pickAriaComponentVariants, WithVariants } from \"./variant-utils\";\n\n/*\n NOTE: Placement should be managed as variants, not just props.\n When `shouldFlip` is true, the placement prop may not represent the final position\n (e.g., if placement is set to \"bottom\" but lacks space, the popover may flip to \"top\").\n However, data-selectors will consistently indicate the actual placement of the popover.\n */\nconst POPOVER_VARIANTS = [\n \"placementTop\" as const,\n \"placementBottom\" as const,\n \"placementLeft\" as const,\n \"placementRight\" as const,\n];\n\nconst { variants, withObservedValues } =\n pickAriaComponentVariants(POPOVER_VARIANTS);\n\nexport interface BasePopoverProps\n extends React.ComponentProps<typeof Popover>,\n WithVariants<typeof POPOVER_VARIANTS> {\n className?: string;\n resetClassName?: string;\n children?: React.ReactNode;\n}\n\nexport function BasePopover(props: BasePopoverProps) {\n const { resetClassName, plasmicUpdateVariant, ...restProps } = props;\n // Popover can be inside DialogTrigger, Select, Combobox, etc. So we can't just use a particular context like DialogTrigger (like we do in Modal) to decide if it is standalone\n const isStandalone = !React.useContext(PopoverContext);\n const context = React.useContext(PlasmicPopoverContext);\n const triggerRef = React.useRef<any>(null);\n const canvasContext = usePlasmicCanvasContext();\n const { children, ...mergedProps } = mergeProps(\n {\n isOpen: context?.isOpen,\n // isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.\n // Setting isNonModal to true in edit mode (canvas) means that the popover will not prevent the user from interacting with the canvas while the popover is open.\n isNonModal: canvasContext && !canvasContext.interactive,\n },\n restProps,\n { className: `${resetClassName}` },\n // Override some props if the popover is standalone\n isStandalone\n ? {\n triggerRef,\n isNonModal: true,\n // Always true, because we assume that popover is always going to be controlled by a parent like Select, Combobox, DialogTrigger, etc, and its only really standalone in component view\n // In component view, we never want to start with an empty artboard, so isOpen has to be true\n isOpen: true,\n }\n : null\n );\n\n return (\n <>\n {isStandalone && <div ref={triggerRef} />}\n <Popover {...mergedProps}>\n {({ placement }) =>\n withObservedValues(\n children,\n {\n placementTop: placement === \"top\",\n placementBottom: placement === \"bottom\",\n placementLeft: placement === \"left\",\n placementRight: placement === \"right\",\n },\n plasmicUpdateVariant\n )\n }\n </Popover>\n </>\n );\n}\n\nexport const POPOVER_COMPONENT_NAME = makeComponentName(\"popover\");\nexport const POPOVER_ARROW_IMG: PlasmicElement = {\n type: \"img\",\n src: \"https://static1.plasmic.app/arrow-up.svg\",\n styles: {\n position: \"absolute\",\n top: \"-14px\",\n // center the arrow horizontally on the popover\n left: \"50%\",\n transform: \"translateX(-50%)\",\n width: \"15px\",\n },\n};\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: POPOVER_COMPONENT_NAME,\n displayName: \"Aria Popover\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerPopover\",\n importName: \"BasePopover\",\n variants,\n defaultStyles: {\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"20px\",\n width: \"300px\",\n backgroundColor: \"#FDE3C3\",\n },\n props: {\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: [\n POPOVER_ARROW_IMG,\n {\n type: \"vbox\",\n styles: {\n width: \"stretch\",\n padding: 0,\n rowGap: \"10px\",\n },\n children: [\n {\n type: \"text\",\n value: \"This is a Popover!\",\n },\n {\n type: \"text\",\n value: \"You can put anything you can imagine here!\",\n styles: {\n fontWeight: 500,\n },\n },\n {\n type: \"text\",\n value:\n \"Use it in a `Aria Dialog Trigger` component to trigger it on a button click!\",\n },\n ],\n },\n ],\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 8,\n },\n shouldFlip: {\n type: \"boolean\",\n description:\n \"Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely.\",\n defaultValueHint: true,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n defaultValueHint: \"bottom\",\n options: [\n // Not allowing other placement options here because of https://github.com/adobe/react-spectrum/issues/6825\n \"top\",\n \"bottom\",\n \"left\",\n \"right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n // No isOpen state for popover, because we assume that its open state is always going to be controlled by a parent like Select, Combobox, DialogTrigger, etc.\n styleSections: true,\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","PopoverContext","PlasmicPopoverContext","usePlasmicCanvasContext","mergeProps","Popover","makeComponentName","registerComponentHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,gBAAmB,GAAA;AAAA,EACvB,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AACF,CAAA,CAAA;AAEA,MAAM,EAAE,QAAA,EAAU,kBAAmB,EAAA,GACnCA,uCAA0B,gBAAgB,CAAA,CAAA;AAUrC,SAAS,YAAY,KAAyB,EAAA;AACnD,EAA+D,MAAA,EAAA,GAAA,KAAA,EAAvD,kBAAgB,oBAtC1B,EAAA,GAsCiE,IAAd,SAAc,GAAA,SAAA,CAAA,EAAA,EAAd,CAAzC,gBAAgB,EAAA,sBAAA,CAAA,CAAA,CAAA;AAExB,EAAA,MAAM,YAAe,GAAA,CAACC,sBAAM,CAAA,UAAA,CAAWC,kCAAc,CAAA,CAAA;AACrD,EAAM,MAAA,OAAA,GAAUD,sBAAM,CAAA,UAAA,CAAWE,8BAAqB,CAAA,CAAA;AACtD,EAAM,MAAA,UAAA,GAAaF,sBAAM,CAAA,MAAA,CAAY,IAAI,CAAA,CAAA;AACzC,EAAA,MAAM,gBAAgBG,4BAAwB,EAAA,CAAA;AAC9C,EAAqC,MAAA,EAAA,GAAAC,gBAAA;AAAA,IACnC;AAAA,MACE,QAAQ,OAAS,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,OAAA,CAAA,MAAA;AAAA;AAAA;AAAA,MAGjB,UAAA,EAAY,aAAiB,IAAA,CAAC,aAAc,CAAA,WAAA;AAAA,K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A;AAAA,UACb,WACE,EAAA,0EAAA;AAAA,UACF,gBAAkB,EAAA,CAAA;AAAA,SACpB;AAAA,QACA,UAAY,EAAA;AAAA,UACV,IAAM,EAAA,SAAA;AAAA,UACN,WACE,EAAA,oJAAA;AAAA,UACF,gBAAkB,EAAA,IAAA;AAAA,SACpB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oFAAA;AAAA,UACF,gBAAkB,EAAA,QAAA;AAAA,UAClB,OAAS,EAAA;AAAA;AAAA,YAEP,KAAA;AAAA,YACA,QAAA;AAAA,YACA,MAAA;AAAA,YACA,OAAA;AAAA,WACF;AAAA,SACF;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA,OACF;AAAA;AAAA,MAEA,aAAe,EAAA,IAAA;AAAA,MACf,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;;;"}
1
+ {"version":3,"file":"registerPopover.cjs.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { PlasmicElement, usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport { mergeProps } from \"@react-aria/utils\";\nimport React, { useEffect } from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverTriggerContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n HasControlContextData,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\nimport { pickAriaComponentVariants, WithVariants } from \"./variant-utils\";\n\n/*\n NOTE: Placement should be managed as variants, not just props.\n When `shouldFlip` is true, the placement prop may not represent the final position\n (e.g., if placement is set to \"bottom\" but lacks space, the popover may flip to \"top\").\n However, data-selectors will consistently indicate the actual placement of the popover.\n */\nconst POPOVER_VARIANTS = [\n \"placementTop\" as const,\n \"placementBottom\" as const,\n \"placementLeft\" as const,\n \"placementRight\" as const,\n];\n\nconst { variants, withObservedValues } =\n pickAriaComponentVariants(POPOVER_VARIANTS);\n\nexport interface BasePopoverControlContextData {\n canMatchTriggerWidth?: boolean;\n}\nexport interface BasePopoverProps\n extends React.ComponentProps<typeof Popover>,\n WithVariants<typeof POPOVER_VARIANTS>,\n HasControlContextData<BasePopoverControlContextData> {\n className?: string;\n resetClassName?: string;\n children?: React.ReactNode;\n matchTriggerWidth?: boolean;\n}\n\nexport function BasePopover(props: BasePopoverProps) {\n const {\n resetClassName,\n plasmicUpdateVariant,\n setControlContextData,\n matchTriggerWidth,\n ...restProps\n } = props;\n // Popover can be inside DialogTrigger, Select, Combobox, etc. So we can't just use a particular context like DialogTrigger (like we do in Modal) to decide if it is standalone\n const isStandalone = !React.useContext(PopoverContext);\n const hasTrigger = !!React.useContext(PlasmicPopoverTriggerContext);\n const triggerRef = React.useRef<any>(null);\n const canvasContext = usePlasmicCanvasContext();\n const matchTriggerWidthProp = hasTrigger && matchTriggerWidth;\n const { children, ...mergedProps } = mergeProps(\n {\n // isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.\n // Setting isNonModal to true in edit mode (canvas) means that the popover will not prevent the user from interacting with the canvas while the popover is open.\n isNonModal: canvasContext && !canvasContext.interactive,\n },\n restProps,\n { className: `${resetClassName}` },\n // Override some props if the popover is standalone\n isStandalone\n ? {\n triggerRef,\n isNonModal: true,\n // Always true, because we assume that popover is always going to be controlled by a parent like Select, Combobox, DialogTrigger, etc, and its only really standalone in component view\n // In component view, we never want to start with an empty artboard, so isOpen has to be true\n isOpen: true,\n }\n : null\n );\n\n useEffect(() => {\n setControlContextData?.({\n canMatchTriggerWidth: hasTrigger,\n });\n }, [hasTrigger, setControlContextData]);\n\n return (\n <>\n {isStandalone && <div ref={triggerRef} />}\n <Popover\n // more about `--trigger-width` here: https://react-spectrum.adobe.com/react-aria/Select.html#popover-1\n style={\n matchTriggerWidthProp ? { width: `var(--trigger-width)` } : undefined\n }\n {...mergedProps}\n >\n {({ placement }) =>\n withObservedValues(\n children,\n {\n placementTop: placement === \"top\",\n placementBottom: placement === \"bottom\",\n placementLeft: placement === \"left\",\n placementRight: placement === \"right\",\n },\n plasmicUpdateVariant\n )\n }\n </Popover>\n </>\n );\n}\n\nexport const POPOVER_COMPONENT_NAME = makeComponentName(\"popover\");\nexport const POPOVER_ARROW_IMG: PlasmicElement = {\n type: \"img\",\n src: \"https://static1.plasmic.app/arrow-up.svg\",\n styles: {\n position: \"absolute\",\n top: \"-14px\",\n // center the arrow horizontally on the popover\n left: \"50%\",\n transform: \"translateX(-50%)\",\n width: \"15px\",\n },\n};\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: POPOVER_COMPONENT_NAME,\n displayName: \"Aria Popover\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerPopover\",\n importName: \"BasePopover\",\n variants,\n defaultStyles: {\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"20px\",\n width: \"300px\",\n backgroundColor: \"#FDE3C3\",\n },\n props: {\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: [\n POPOVER_ARROW_IMG,\n {\n type: \"vbox\",\n styles: {\n width: \"stretch\",\n padding: 0,\n rowGap: \"10px\",\n },\n children: [\n {\n type: \"text\",\n value: \"This is a Popover!\",\n },\n {\n type: \"text\",\n value: \"You can put anything you can imagine here!\",\n styles: {\n fontWeight: 500,\n },\n },\n {\n type: \"text\",\n value:\n \"Use it in a `Aria Dialog Trigger` component to trigger it on a button click!\",\n },\n ],\n },\n ],\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 8,\n },\n shouldFlip: {\n type: \"boolean\",\n description:\n \"Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely.\",\n defaultValueHint: true,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n defaultValueHint: \"bottom\",\n options: [\n // Not allowing other placement options here because of https://github.com/adobe/react-spectrum/issues/6825\n \"top\",\n \"bottom\",\n \"left\",\n \"right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n matchTriggerWidth: {\n type: \"boolean\",\n defaultValue: true,\n hidden: (_props, ctx) => !ctx?.canMatchTriggerWidth,\n },\n },\n // No isOpen state for popover, because we assume that its open state is always going to be controlled by a parent like Select, Combobox, DialogTrigger, etc.\n styleSections: true,\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","PopoverContext","PlasmicPopoverTriggerContext","usePlasmicCanvasContext","mergeProps","useEffect","Popover","makeComponentName","registerComponentHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,gBAAmB,GAAA;AAAA,EACvB,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AACF,CAAA,CAAA;AAEA,MAAM,EAAE,QAAA,EAAU,kBAAmB,EAAA,GACnCA,uCAA0B,gBAAgB,CAAA,CAAA;AAerC,SAAS,YAAY,KAAyB,EAAA;AACnD,EAAA,MAMI,EALF,GAAA,KAAA,EAAA;AAAA,IAAA,cAAA;AAAA,IACA,oBAAA;AAAA,IACA,qBAAA;AAAA,IACA,iBAAA;AAAA,GAhDJ,GAkDM,EADC,EAAA,SAAA,GAAA,SAAA,CACD,EADC,EAAA;AAAA,IAJH,gBAAA;AAAA,IACA,sBAAA;AAAA,IACA,uBAAA;AAAA,IACA,mBAAA;AAAA,GAAA,CAAA,CAAA;AAIF,EAAA,MAAM,YAAe,GAAA,CAACC,sBAAM,CAAA,UAAA,CAAWC,kCAAc,CAAA,CAAA;AACrD,EAAA,MAAM,UAAa,GAAA,CAAC,CAACD,sBAAA,CAAM,WAAWE,qCAA4B,CAAA,CAAA;AAClE,EAAM,MAAA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CAAA,GAAA,GAAA,CAAA,oBAAA,CAAA;AAAA,SACjC;AAAA,OACF;AAAA;AAAA,MAEA,aAAe,EAAA,IAAA;AAAA,MACf,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;;;"}
@@ -1,13 +1,17 @@
1
1
  import { PlasmicElement } from "@plasmicapp/host";
2
2
  import React from "react";
3
3
  import { Popover } from "react-aria-components";
4
- import { CodeComponentMetaOverrides, Registerable } from "./utils";
4
+ import { CodeComponentMetaOverrides, HasControlContextData, Registerable } from "./utils";
5
5
  import { WithVariants } from "./variant-utils";
6
6
  declare const POPOVER_VARIANTS: ("placementLeft" | "placementRight" | "placementTop" | "placementBottom")[];
7
- export interface BasePopoverProps extends React.ComponentProps<typeof Popover>, WithVariants<typeof POPOVER_VARIANTS> {
7
+ export interface BasePopoverControlContextData {
8
+ canMatchTriggerWidth?: boolean;
9
+ }
10
+ export interface BasePopoverProps extends React.ComponentProps<typeof Popover>, WithVariants<typeof POPOVER_VARIANTS>, HasControlContextData<BasePopoverControlContextData> {
8
11
  className?: string;
9
12
  resetClassName?: string;
10
13
  children?: React.ReactNode;
14
+ matchTriggerWidth?: boolean;
11
15
  }
12
16
  export declare function BasePopover(props: BasePopoverProps): React.JSX.Element;
13
17
  export declare const POPOVER_COMPONENT_NAME: string;
@@ -1,9 +1,9 @@
1
1
  import { usePlasmicCanvasContext } from '@plasmicapp/host';
2
2
  import { mergeProps } from '@react-aria/utils';
3
- import React from 'react';
3
+ import React, { useEffect } from 'react';
4
4
  import { PopoverContext, Popover } from 'react-aria-components';
5
- import { a as PlasmicPopoverContext } from './contexts-081d65a0.esm.js';
6
- import { a as makeComponentName, r as registerComponentHelper } from './utils-25448fbd.esm.js';
5
+ import { a as PlasmicPopoverTriggerContext } from './contexts-5cb81c2f.esm.js';
6
+ import { a as makeComponentName, r as registerComponentHelper } from './utils-41b3d43b.esm.js';
7
7
  import { p as pickAriaComponentVariants } from './variant-utils-7c2ea202.esm.js';
8
8
  import '@plasmicapp/host/registerComponent';
9
9
 
@@ -43,14 +43,24 @@ const POPOVER_VARIANTS = [
43
43
  ];
44
44
  const { variants, withObservedValues } = pickAriaComponentVariants(POPOVER_VARIANTS);
45
45
  function BasePopover(props) {
46
- const _a = props, { resetClassName, plasmicUpdateVariant } = _a, restProps = __objRest(_a, ["resetClassName", "plasmicUpdateVariant"]);
46
+ const _a = props, {
47
+ resetClassName,
48
+ plasmicUpdateVariant,
49
+ setControlContextData,
50
+ matchTriggerWidth
51
+ } = _a, restProps = __objRest(_a, [
52
+ "resetClassName",
53
+ "plasmicUpdateVariant",
54
+ "setControlContextData",
55
+ "matchTriggerWidth"
56
+ ]);
47
57
  const isStandalone = !React.useContext(PopoverContext);
48
- const context = React.useContext(PlasmicPopoverContext);
58
+ const hasTrigger = !!React.useContext(PlasmicPopoverTriggerContext);
49
59
  const triggerRef = React.useRef(null);
50
60
  const canvasContext = usePlasmicCanvasContext();
61
+ const matchTriggerWidthProp = hasTrigger && matchTriggerWidth;
51
62
  const _b = mergeProps(
52
63
  {
53
- isOpen: context == null ? void 0 : context.isOpen,
54
64
  // isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.
55
65
  // Setting isNonModal to true in edit mode (canvas) means that the popover will not prevent the user from interacting with the canvas while the popover is open.
56
66
  isNonModal: canvasContext && !canvasContext.interactive
@@ -66,16 +76,27 @@ function BasePopover(props) {
66
76
  isOpen: true
67
77
  } : null
68
78
  ), { children } = _b, mergedProps = __objRest(_b, ["children"]);
69
- return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(Popover, __spreadValues({}, mergedProps), ({ placement }) => withObservedValues(
70
- children,
71
- {
72
- placementTop: placement === "top",
73
- placementBottom: placement === "bottom",
74
- placementLeft: placement === "left",
75
- placementRight: placement === "right"
76
- },
77
- plasmicUpdateVariant
78
- )));
79
+ useEffect(() => {
80
+ setControlContextData == null ? void 0 : setControlContextData({
81
+ canMatchTriggerWidth: hasTrigger
82
+ });
83
+ }, [hasTrigger, setControlContextData]);
84
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(
85
+ Popover,
86
+ __spreadValues({
87
+ style: matchTriggerWidthProp ? { width: `var(--trigger-width)` } : void 0
88
+ }, mergedProps),
89
+ ({ placement }) => withObservedValues(
90
+ children,
91
+ {
92
+ placementTop: placement === "top",
93
+ placementBottom: placement === "bottom",
94
+ placementLeft: placement === "left",
95
+ placementRight: placement === "right"
96
+ },
97
+ plasmicUpdateVariant
98
+ )
99
+ ));
79
100
  }
80
101
  const POPOVER_COMPONENT_NAME = makeComponentName("popover");
81
102
  const POPOVER_ARROW_IMG = {
@@ -166,6 +187,11 @@ function registerPopover(loader, overrides) {
166
187
  },
167
188
  resetClassName: {
168
189
  type: "themeResetClass"
190
+ },
191
+ matchTriggerWidth: {
192
+ type: "boolean",
193
+ defaultValue: true,
194
+ hidden: (_props, ctx) => !(ctx == null ? void 0 : ctx.canMatchTriggerWidth)
169
195
  }
170
196
  },
171
197
  // No isOpen state for popover, because we assume that its open state is always going to be controlled by a parent like Select, Combobox, DialogTrigger, etc.
@@ -1 +1 @@
1
- {"version":3,"file":"registerPopover.esm.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { PlasmicElement, 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 makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\nimport { pickAriaComponentVariants, WithVariants } from \"./variant-utils\";\n\n/*\n NOTE: Placement should be managed as variants, not just props.\n When `shouldFlip` is true, the placement prop may not represent the final position\n (e.g., if placement is set to \"bottom\" but lacks space, the popover may flip to \"top\").\n However, data-selectors will consistently indicate the actual placement of the popover.\n */\nconst POPOVER_VARIANTS = [\n \"placementTop\" as const,\n \"placementBottom\" as const,\n \"placementLeft\" as const,\n \"placementRight\" as const,\n];\n\nconst { variants, withObservedValues } =\n pickAriaComponentVariants(POPOVER_VARIANTS);\n\nexport interface BasePopoverProps\n extends React.ComponentProps<typeof Popover>,\n WithVariants<typeof POPOVER_VARIANTS> {\n className?: string;\n resetClassName?: string;\n children?: React.ReactNode;\n}\n\nexport function BasePopover(props: BasePopoverProps) {\n const { resetClassName, plasmicUpdateVariant, ...restProps } = props;\n // Popover can be inside DialogTrigger, Select, Combobox, etc. So we can't just use a particular context like DialogTrigger (like we do in Modal) to decide if it is standalone\n const isStandalone = !React.useContext(PopoverContext);\n const context = React.useContext(PlasmicPopoverContext);\n const triggerRef = React.useRef<any>(null);\n const canvasContext = usePlasmicCanvasContext();\n const { children, ...mergedProps } = mergeProps(\n {\n isOpen: context?.isOpen,\n // isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.\n // Setting isNonModal to true in edit mode (canvas) means that the popover will not prevent the user from interacting with the canvas while the popover is open.\n isNonModal: canvasContext && !canvasContext.interactive,\n },\n restProps,\n { className: `${resetClassName}` },\n // Override some props if the popover is standalone\n isStandalone\n ? {\n triggerRef,\n isNonModal: true,\n // Always true, because we assume that popover is always going to be controlled by a parent like Select, Combobox, DialogTrigger, etc, and its only really standalone in component view\n // In component view, we never want to start with an empty artboard, so isOpen has to be true\n isOpen: true,\n }\n : null\n );\n\n return (\n <>\n {isStandalone && <div ref={triggerRef} />}\n <Popover {...mergedProps}>\n {({ placement }) =>\n withObservedValues(\n children,\n {\n placementTop: placement === \"top\",\n placementBottom: placement === \"bottom\",\n placementLeft: placement === \"left\",\n placementRight: placement === \"right\",\n },\n plasmicUpdateVariant\n )\n }\n </Popover>\n </>\n );\n}\n\nexport const POPOVER_COMPONENT_NAME = makeComponentName(\"popover\");\nexport const POPOVER_ARROW_IMG: PlasmicElement = {\n type: \"img\",\n src: \"https://static1.plasmic.app/arrow-up.svg\",\n styles: {\n position: \"absolute\",\n top: \"-14px\",\n // center the arrow horizontally on the popover\n left: \"50%\",\n transform: \"translateX(-50%)\",\n width: \"15px\",\n },\n};\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: POPOVER_COMPONENT_NAME,\n displayName: \"Aria Popover\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerPopover\",\n importName: \"BasePopover\",\n variants,\n defaultStyles: {\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"20px\",\n width: \"300px\",\n backgroundColor: \"#FDE3C3\",\n },\n props: {\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: [\n POPOVER_ARROW_IMG,\n {\n type: \"vbox\",\n styles: {\n width: \"stretch\",\n padding: 0,\n rowGap: \"10px\",\n },\n children: [\n {\n type: \"text\",\n value: \"This is a Popover!\",\n },\n {\n type: \"text\",\n value: \"You can put anything you can imagine here!\",\n styles: {\n fontWeight: 500,\n },\n },\n {\n type: \"text\",\n value:\n \"Use it in a `Aria Dialog Trigger` component to trigger it on a button click!\",\n },\n ],\n },\n ],\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 8,\n },\n shouldFlip: {\n type: \"boolean\",\n description:\n \"Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely.\",\n defaultValueHint: true,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n defaultValueHint: \"bottom\",\n options: [\n // Not allowing other placement options here because of https://github.com/adobe/react-spectrum/issues/6825\n \"top\",\n \"bottom\",\n \"left\",\n \"right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n // No isOpen state for popover, because we assume that its open state is always going to be controlled by a parent like Select, Combobox, DialogTrigger, etc.\n styleSections: true,\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,gBAAmB,GAAA;AAAA,EACvB,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AACF,CAAA,CAAA;AAEA,MAAM,EAAE,QAAA,EAAU,kBAAmB,EAAA,GACnC,0BAA0B,gBAAgB,CAAA,CAAA;AAUrC,SAAS,YAAY,KAAyB,EAAA;AACnD,EAA+D,MAAA,EAAA,GAAA,KAAA,EAAvD,kBAAgB,oBAtC1B,EAAA,GAsCiE,IAAd,SAAc,GAAA,SAAA,CAAA,EAAA,EAAd,CAAzC,gBAAgB,EAAA,sBAAA,CAAA,CAAA,CAAA;AAExB,EAAA,MAAM,YAAe,GAAA,CAAC,KAAM,CAAA,UAAA,CAAW,cAAc,CAAA,CAAA;AACrD,EAAM,MAAA,OAAA,GAAU,KAAM,CAAA,UAAA,CAAW,qBAAqB,CAAA,CAAA;AACtD,EAAM,MAAA,UAAA,GAAa,KAAM,CAAA,MAAA,CAAY,IAAI,CAAA,CAAA;AACzC,EAAA,MAAM,gBAAgB,uBAAwB,EAAA,CAAA;AAC9C,EAAqC,MAAA,EAAA,GAAA,UAAA;AAAA,IACnC;AAAA,MACE,QAAQ,OAAS,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,OAAA,CAAA,MAAA;AAAA;AAAA;AAAA,MAGjB,UAAA,EAAY,aAAiB,IAAA,CAAC,aAAc,CAAA,WAAA;AAAA,KAC9C;AAAA,IACA,SAAA;AAAA,IACA,EAAE,SAAW,EAAA,CAAA,EAAG,cAAiB,CAAA,CAAA,EAAA;AAAA;AAAA,IAEjC,YACI,GAAA;AAAA,MACE,UAAA;AAAA,MACA,UAAY,EAAA,IAAA;AAAA;A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AAAA,SACpB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oFAAA;AAAA,UACF,gBAAkB,EAAA,QAAA;AAAA,UAClB,OAAS,EAAA;AAAA;AAAA,YAEP,KAAA;AAAA,YACA,QAAA;AAAA,YACA,MAAA;AAAA,YACA,OAAA;AAAA,WACF;AAAA,SACF;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA,OACF;AAAA;AAAA,MAEA,aAAe,EAAA,IAAA;AAAA,MACf,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"registerPopover.esm.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { PlasmicElement, usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport { mergeProps } from \"@react-aria/utils\";\nimport React, { useEffect } from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverTriggerContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n HasControlContextData,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\nimport { pickAriaComponentVariants, WithVariants } from \"./variant-utils\";\n\n/*\n NOTE: Placement should be managed as variants, not just props.\n When `shouldFlip` is true, the placement prop may not represent the final position\n (e.g., if placement is set to \"bottom\" but lacks space, the popover may flip to \"top\").\n However, data-selectors will consistently indicate the actual placement of the popover.\n */\nconst POPOVER_VARIANTS = [\n \"placementTop\" as const,\n \"placementBottom\" as const,\n \"placementLeft\" as const,\n \"placementRight\" as const,\n];\n\nconst { variants, withObservedValues } =\n pickAriaComponentVariants(POPOVER_VARIANTS);\n\nexport interface BasePopoverControlContextData {\n canMatchTriggerWidth?: boolean;\n}\nexport interface BasePopoverProps\n extends React.ComponentProps<typeof Popover>,\n WithVariants<typeof POPOVER_VARIANTS>,\n HasControlContextData<BasePopoverControlContextData> {\n className?: string;\n resetClassName?: string;\n children?: React.ReactNode;\n matchTriggerWidth?: boolean;\n}\n\nexport function BasePopover(props: BasePopoverProps) {\n const {\n resetClassName,\n plasmicUpdateVariant,\n setControlContextData,\n matchTriggerWidth,\n ...restProps\n } = props;\n // Popover can be inside DialogTrigger, Select, Combobox, etc. So we can't just use a particular context like DialogTrigger (like we do in Modal) to decide if it is standalone\n const isStandalone = !React.useContext(PopoverContext);\n const hasTrigger = !!React.useContext(PlasmicPopoverTriggerContext);\n const triggerRef = React.useRef<any>(null);\n const canvasContext = usePlasmicCanvasContext();\n const matchTriggerWidthProp = hasTrigger && matchTriggerWidth;\n const { children, ...mergedProps } = mergeProps(\n {\n // isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.\n // Setting isNonModal to true in edit mode (canvas) means that the popover will not prevent the user from interacting with the canvas while the popover is open.\n isNonModal: canvasContext && !canvasContext.interactive,\n },\n restProps,\n { className: `${resetClassName}` },\n // Override some props if the popover is standalone\n isStandalone\n ? {\n triggerRef,\n isNonModal: true,\n // Always true, because we assume that popover is always going to be controlled by a parent like Select, Combobox, DialogTrigger, etc, and its only really standalone in component view\n // In component view, we never want to start with an empty artboard, so isOpen has to be true\n isOpen: true,\n }\n : null\n );\n\n useEffect(() => {\n setControlContextData?.({\n canMatchTriggerWidth: hasTrigger,\n });\n }, [hasTrigger, setControlContextData]);\n\n return (\n <>\n {isStandalone && <div ref={triggerRef} />}\n <Popover\n // more about `--trigger-width` here: https://react-spectrum.adobe.com/react-aria/Select.html#popover-1\n style={\n matchTriggerWidthProp ? { width: `var(--trigger-width)` } : undefined\n }\n {...mergedProps}\n >\n {({ placement }) =>\n withObservedValues(\n children,\n {\n placementTop: placement === \"top\",\n placementBottom: placement === \"bottom\",\n placementLeft: placement === \"left\",\n placementRight: placement === \"right\",\n },\n plasmicUpdateVariant\n )\n }\n </Popover>\n </>\n );\n}\n\nexport const POPOVER_COMPONENT_NAME = makeComponentName(\"popover\");\nexport const POPOVER_ARROW_IMG: PlasmicElement = {\n type: \"img\",\n src: \"https://static1.plasmic.app/arrow-up.svg\",\n styles: {\n position: \"absolute\",\n top: \"-14px\",\n // center the arrow horizontally on the popover\n left: \"50%\",\n transform: \"translateX(-50%)\",\n width: \"15px\",\n },\n};\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: POPOVER_COMPONENT_NAME,\n displayName: \"Aria Popover\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerPopover\",\n importName: \"BasePopover\",\n variants,\n defaultStyles: {\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"20px\",\n width: \"300px\",\n backgroundColor: \"#FDE3C3\",\n },\n props: {\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: [\n POPOVER_ARROW_IMG,\n {\n type: \"vbox\",\n styles: {\n width: \"stretch\",\n padding: 0,\n rowGap: \"10px\",\n },\n children: [\n {\n type: \"text\",\n value: \"This is a Popover!\",\n },\n {\n type: \"text\",\n value: \"You can put anything you can imagine here!\",\n styles: {\n fontWeight: 500,\n },\n },\n {\n type: \"text\",\n value:\n \"Use it in a `Aria Dialog Trigger` component to trigger it on a button click!\",\n },\n ],\n },\n ],\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 8,\n },\n shouldFlip: {\n type: \"boolean\",\n description:\n \"Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely.\",\n defaultValueHint: true,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n defaultValueHint: \"bottom\",\n options: [\n // Not allowing other placement options here because of https://github.com/adobe/react-spectrum/issues/6825\n \"top\",\n \"bottom\",\n \"left\",\n \"right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n matchTriggerWidth: {\n type: \"boolean\",\n defaultValue: true,\n hidden: (_props, ctx) => !ctx?.canMatchTriggerWidth,\n },\n },\n // No isOpen state for popover, because we assume that its open state is always going to be controlled by a parent like Select, Combobox, DialogTrigger, etc.\n styleSections: true,\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,gBAAmB,GAAA;AAAA,EACvB,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AACF,CAAA,CAAA;AAEA,MAAM,EAAE,QAAA,EAAU,kBAAmB,EAAA,GACnC,0BAA0B,gBAAgB,CAAA,CAAA;AAerC,SAAS,YAAY,KAAyB,EAAA;AACnD,EAAA,MAMI,EALF,GAAA,KAAA,EAAA;AAAA,IAAA,cAAA;AAAA,IACA,oBAAA;AAAA,IACA,qBAAA;AAAA,IACA,iBAAA;AAAA,GAhDJ,GAkDM,EADC,EAAA,SAAA,GAAA,SAAA,CACD,EADC,EAAA;AAAA,IAJH,gBAAA;AAAA,IACA,sBAAA;AAAA,IACA,uBAAA;AAAA,IACA,mBAAA;AAAA,GAAA,CAAA,CAAA;AAIF,EAAA,MAAM,YAAe,GAAA,CAAC,KAAM,CAAA,UAAA,CAAW,cAAc,CAAA,CAAA;AACrD,EAAA,MAAM,UAAa,GAAA,CAAC,CAAC,KAAA,CAAM,WAAW,4BAA4B,CAAA,CAAA;AAClE,EAAM,MAAA,UAAA,GAAa,KAAM,CAAA,MAAA,CAAY,IAAI,CAAA,CAAA;AACzC,EAAA,MAAM,gBAAgB,uBAAwB,EAAA,CAAA;AAC9C,EAAA,MAAM,wBAAwB,UAAc,IAAA,iBAAA,CAAA;AAC5C,EAAqC,MAAA,EAAA,GAAA,UAAA;AAAA,IACnC;AAAA;AAAA;AAAA,MAGE,UAAA,EAAY,aAAiB,IAAA,CAAC,aAAc,CAAA,WAAA;AAAA,KAC9C;AAAA,IACA,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A,GAAA;AAAA,mBACd;AAAA,iBACF;AAAA,gBACA;AAAA,kBACE,IAAM,EAAA,MAAA;AAAA,kBACN,KACE,EAAA,8EAAA;AAAA,iBACJ;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA,SACF;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,UAAY,EAAA;AAAA,UACV,IAAM,EAAA,SAAA;AAAA,UACN,WACE,EAAA,oJAAA;AAAA,UACF,gBAAkB,EAAA,IAAA;AAAA,SACpB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oFAAA;AAAA,UACF,gBAAkB,EAAA,QAAA;AAAA,UAClB,OAAS,EAAA;AAAA;AAAA,YAEP,KAAA;AAAA,YACA,QAAA;AAAA,YACA,MAAA;AAAA,YACA,OAAA;AAAA,WACF;AAAA,SACF;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA,QACA,iBAAmB,EAAA;AAAA,UACjB,IAAM,EAAA,SAAA;AAAA,UACN,YAAc,EAAA,IAAA;AAAA,UACd,MAAQ,EAAA,CAAC,MAAQ,EAAA,GAAA,KAAQ,EAAC,GAAK,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,GAAA,CAAA,oBAAA,CAAA;AAAA,SACjC;AAAA,OACF;AAAA;AAAA,MAEA,aAAe,EAAA,IAAA;AAAA,MACf,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -2,10 +2,10 @@
2
2
 
3
3
  var React = require('react');
4
4
  var reactAriaComponents = require('react-aria-components');
5
- var common = require('./common-f6de262a.cjs.js');
6
- var contexts = require('./contexts-baa37b74.cjs.js');
5
+ var common = require('./common-4b974d89.cjs.js');
6
+ var contexts = require('./contexts-6d0cb2b1.cjs.js');
7
7
  var registerLabel = require('./registerLabel.cjs.js');
8
- var utils = require('./utils-3e796b18.cjs.js');
8
+ var utils = require('./utils-d1c8094f.cjs.js');
9
9
  var variantUtils = require('./variant-utils-8cb38f8f.cjs.js');
10
10
  require('@plasmicapp/host');
11
11
  require('@plasmicapp/host/registerComponent');
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { Radio, RadioGroup } from 'react-aria-components';
3
- import { g as getCommonProps } from './common-70efdf8a.esm.js';
4
- import { e as PlasmicRadioGroupContext } from './contexts-081d65a0.esm.js';
3
+ import { g as getCommonProps } from './common-1a6affb0.esm.js';
4
+ import { e as PlasmicRadioGroupContext } from './contexts-5cb81c2f.esm.js';
5
5
  import { LABEL_COMPONENT_NAME } from './registerLabel.esm.js';
6
- import { r as registerComponentHelper, a as makeComponentName } from './utils-25448fbd.esm.js';
6
+ import { r as registerComponentHelper, a as makeComponentName } from './utils-41b3d43b.esm.js';
7
7
  import { p as pickAriaComponentVariants } from './variant-utils-7c2ea202.esm.js';
8
8
  import '@plasmicapp/host';
9
9
  import '@plasmicapp/host/registerComponent';
@@ -2,13 +2,13 @@
2
2
 
3
3
  var React = require('react');
4
4
  var reactAriaComponents = require('react-aria-components');
5
- var common = require('./common-f6de262a.cjs.js');
6
- var contexts = require('./contexts-baa37b74.cjs.js');
5
+ var common = require('./common-4b974d89.cjs.js');
6
+ var contexts = require('./contexts-6d0cb2b1.cjs.js');
7
7
  var registerDescription = require('./registerDescription.cjs.js');
8
8
  var registerFieldError = require('./registerFieldError.cjs.js');
9
9
  var registerLabel = require('./registerLabel.cjs.js');
10
10
  var registerRadio = require('./registerRadio.cjs.js');
11
- var utils = require('./utils-3e796b18.cjs.js');
11
+ var utils = require('./utils-d1c8094f.cjs.js');
12
12
  var variantUtils = require('./variant-utils-8cb38f8f.cjs.js');
13
13
  require('./registerText.cjs.js');
14
14
  require('@plasmicapp/host');
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import { RadioGroup } from 'react-aria-components';
3
- import { g as getCommonProps } from './common-70efdf8a.esm.js';
4
- import { e as PlasmicRadioGroupContext } from './contexts-081d65a0.esm.js';
3
+ import { g as getCommonProps } from './common-1a6affb0.esm.js';
4
+ import { e as PlasmicRadioGroupContext } from './contexts-5cb81c2f.esm.js';
5
5
  import { DESCRIPTION_COMPONENT_NAME } from './registerDescription.esm.js';
6
6
  import { registerFieldError } from './registerFieldError.esm.js';
7
7
  import { registerLabel, LABEL_COMPONENT_NAME } from './registerLabel.esm.js';
8
8
  import { registerRadio, makeDefaultRadioChildren } from './registerRadio.esm.js';
9
- import { m as makeChildComponentName, r as registerComponentHelper, a as makeComponentName } from './utils-25448fbd.esm.js';
9
+ import { m as makeChildComponentName, r as registerComponentHelper, a as makeComponentName } from './utils-41b3d43b.esm.js';
10
10
  import { p as pickAriaComponentVariants } from './variant-utils-7c2ea202.esm.js';
11
11
  import './registerText.esm.js';
12
12
  import '@plasmicapp/host';
@@ -2,9 +2,9 @@
2
2
 
3
3
  require('react');
4
4
  require('react-aria-components');
5
- require('./contexts-baa37b74.cjs.js');
6
- var registerSection = require('./registerListBox-3d146fe7.cjs.js');
7
- require('./utils-3e796b18.cjs.js');
5
+ require('./contexts-6d0cb2b1.cjs.js');
6
+ var registerSection = require('./registerListBox-b47231d8.cjs.js');
7
+ require('./utils-d1c8094f.cjs.js');
8
8
  require('./registerListBoxItem.cjs.js');
9
9
  require('./registerDescription.cjs.js');
10
10
  require('./registerText.cjs.js');