@plasmicpkgs/react-aria 0.0.76 → 0.0.77

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 (60) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/contexts.d.ts +1 -1
  3. package/dist/react-aria.esm.js +46 -18
  4. package/dist/react-aria.esm.js.map +1 -1
  5. package/dist/react-aria.js +46 -18
  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/{contexts-081d65a0.esm.js → contexts-5cb81c2f.esm.js} +3 -3
  10. package/skinny/contexts-5cb81c2f.esm.js.map +1 -0
  11. package/skinny/{contexts-baa37b74.cjs.js → contexts-6d0cb2b1.cjs.js} +3 -3
  12. package/skinny/contexts-6d0cb2b1.cjs.js.map +1 -0
  13. package/skinny/contexts.d.ts +1 -1
  14. package/skinny/registerCheckbox.cjs.js +1 -1
  15. package/skinny/registerCheckbox.esm.js +1 -1
  16. package/skinny/registerCheckboxGroup.cjs.js +1 -1
  17. package/skinny/registerCheckboxGroup.esm.js +1 -1
  18. package/skinny/registerComboBox.cjs.js +5 -4
  19. package/skinny/registerComboBox.cjs.js.map +1 -1
  20. package/skinny/registerComboBox.esm.js +5 -4
  21. package/skinny/registerComboBox.esm.js.map +1 -1
  22. package/skinny/registerDialogTrigger.cjs.js +1 -1
  23. package/skinny/registerDialogTrigger.esm.js +1 -1
  24. package/skinny/registerInput.cjs.js +1 -1
  25. package/skinny/registerInput.esm.js +1 -1
  26. package/skinny/{registerListBox-32d2fae3.esm.js → registerListBox-25d602fa.esm.js} +2 -2
  27. package/skinny/{registerListBox-32d2fae3.esm.js.map → registerListBox-25d602fa.esm.js.map} +1 -1
  28. package/skinny/{registerListBox-3d146fe7.cjs.js → registerListBox-f4f6beb5.cjs.js} +2 -2
  29. package/skinny/{registerListBox-3d146fe7.cjs.js.map → registerListBox-f4f6beb5.cjs.js.map} +1 -1
  30. package/skinny/registerListBox.cjs.js +2 -2
  31. package/skinny/registerListBox.esm.js +2 -2
  32. package/skinny/registerListBoxItem.cjs.js +1 -1
  33. package/skinny/registerListBoxItem.esm.js +1 -1
  34. package/skinny/registerModal.cjs.js +1 -1
  35. package/skinny/registerModal.esm.js +1 -1
  36. package/skinny/registerPopover.cjs.js +40 -14
  37. package/skinny/registerPopover.cjs.js.map +1 -1
  38. package/skinny/registerPopover.d.ts +6 -2
  39. package/skinny/registerPopover.esm.js +41 -15
  40. package/skinny/registerPopover.esm.js.map +1 -1
  41. package/skinny/registerRadio.cjs.js +1 -1
  42. package/skinny/registerRadio.esm.js +1 -1
  43. package/skinny/registerRadioGroup.cjs.js +1 -1
  44. package/skinny/registerRadioGroup.esm.js +1 -1
  45. package/skinny/registerSection.cjs.js +2 -2
  46. package/skinny/registerSection.esm.js +2 -2
  47. package/skinny/registerSelect.cjs.js +5 -4
  48. package/skinny/registerSelect.cjs.js.map +1 -1
  49. package/skinny/registerSelect.esm.js +5 -4
  50. package/skinny/registerSelect.esm.js.map +1 -1
  51. package/skinny/registerSlider.cjs.js +1 -1
  52. package/skinny/registerSlider.esm.js +1 -1
  53. package/skinny/registerSliderTrack.cjs.js +1 -1
  54. package/skinny/registerSliderTrack.esm.js +1 -1
  55. package/skinny/registerTextArea.cjs.js +1 -1
  56. package/skinny/registerTextArea.esm.js +1 -1
  57. package/skinny/registerTextField.cjs.js +1 -1
  58. package/skinny/registerTextField.esm.js +1 -1
  59. package/skinny/contexts-081d65a0.esm.js.map +0 -1
  60. package/skinny/contexts-baa37b74.cjs.js.map +0 -1
@@ -8,7 +8,7 @@ export declare const PlasmicDialogTriggerContext: React.Context<import("./regist
8
8
  export type PlasmicSliderContextType<T extends number | number[]> = React.ComponentProps<typeof BaseSlider<T>> | undefined;
9
9
  export declare const PlasmicSliderContext: React.Context<PlasmicSliderContextType<number | number[]>>;
10
10
  export declare const PlasmicLabelContext: React.Context<import("react-aria-components").LabelProps | undefined>;
11
- export declare const PlasmicPopoverContext: React.Context<import("./registerPopover").BasePopoverProps | undefined>;
11
+ export declare const PlasmicPopoverTriggerContext: React.Context<boolean | undefined>;
12
12
  export declare const PlasmicListBoxContext: React.Context<{
13
13
  idManager: ListBoxItemIdManager;
14
14
  } | undefined>;
@@ -640,7 +640,7 @@ const PlasmicRadioGroupContext = React.createContext(void 0);
640
640
  const PlasmicDialogTriggerContext = React.createContext(void 0);
641
641
  const PlasmicSliderContext = React.createContext(void 0);
642
642
  React.createContext(void 0);
643
- const PlasmicPopoverContext = React.createContext(void 0);
643
+ const PlasmicPopoverTriggerContext = React.createContext(void 0);
644
644
  const PlasmicListBoxContext = React.createContext(void 0);
645
645
  React.createContext(void 0);
646
646
  const PlasmicInputContext = React.createContext(void 0);
@@ -2115,14 +2115,24 @@ const POPOVER_VARIANTS = [
2115
2115
  ];
2116
2116
  const { variants: variants$a, withObservedValues: withObservedValues$9 } = pickAriaComponentVariants(POPOVER_VARIANTS);
2117
2117
  function BasePopover(props) {
2118
- const _a = props, { resetClassName, plasmicUpdateVariant } = _a, restProps = __objRest$e(_a, ["resetClassName", "plasmicUpdateVariant"]);
2118
+ const _a = props, {
2119
+ resetClassName,
2120
+ plasmicUpdateVariant,
2121
+ setControlContextData,
2122
+ matchTriggerWidth
2123
+ } = _a, restProps = __objRest$e(_a, [
2124
+ "resetClassName",
2125
+ "plasmicUpdateVariant",
2126
+ "setControlContextData",
2127
+ "matchTriggerWidth"
2128
+ ]);
2119
2129
  const isStandalone = !React.useContext(PopoverContext);
2120
- const context = React.useContext(PlasmicPopoverContext);
2130
+ const hasTrigger = !!React.useContext(PlasmicPopoverTriggerContext);
2121
2131
  const triggerRef = React.useRef(null);
2122
2132
  const canvasContext = usePlasmicCanvasContext();
2133
+ const matchTriggerWidthProp = hasTrigger && matchTriggerWidth;
2123
2134
  const _b = mergeProps$1(
2124
2135
  {
2125
- isOpen: context == null ? void 0 : context.isOpen,
2126
2136
  // isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.
2127
2137
  // 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.
2128
2138
  isNonModal: canvasContext && !canvasContext.interactive
@@ -2138,16 +2148,27 @@ function BasePopover(props) {
2138
2148
  isOpen: true
2139
2149
  } : null
2140
2150
  ), { children } = _b, mergedProps = __objRest$e(_b, ["children"]);
2141
- return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(Popover, __spreadValues$f({}, mergedProps), ({ placement }) => withObservedValues$9(
2142
- children,
2143
- {
2144
- placementTop: placement === "top",
2145
- placementBottom: placement === "bottom",
2146
- placementLeft: placement === "left",
2147
- placementRight: placement === "right"
2148
- },
2149
- plasmicUpdateVariant
2150
- )));
2151
+ useEffect(() => {
2152
+ setControlContextData == null ? void 0 : setControlContextData({
2153
+ canMatchTriggerWidth: hasTrigger
2154
+ });
2155
+ }, [hasTrigger, setControlContextData]);
2156
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(
2157
+ Popover,
2158
+ __spreadValues$f({
2159
+ style: matchTriggerWidthProp ? { width: `var(--trigger-width)` } : void 0
2160
+ }, mergedProps),
2161
+ ({ placement }) => withObservedValues$9(
2162
+ children,
2163
+ {
2164
+ placementTop: placement === "top",
2165
+ placementBottom: placement === "bottom",
2166
+ placementLeft: placement === "left",
2167
+ placementRight: placement === "right"
2168
+ },
2169
+ plasmicUpdateVariant
2170
+ )
2171
+ ));
2151
2172
  }
2152
2173
  const POPOVER_COMPONENT_NAME = makeComponentName("popover");
2153
2174
  const POPOVER_ARROW_IMG = {
@@ -2238,6 +2259,11 @@ function registerPopover(loader, overrides) {
2238
2259
  },
2239
2260
  resetClassName: {
2240
2261
  type: "themeResetClass"
2262
+ },
2263
+ matchTriggerWidth: {
2264
+ type: "boolean",
2265
+ defaultValue: true,
2266
+ hidden: (_props, ctx) => !(ctx == null ? void 0 : ctx.canMatchTriggerWidth)
2241
2267
  }
2242
2268
  },
2243
2269
  // 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.
@@ -2323,7 +2349,7 @@ function BaseComboBox(props) {
2323
2349
  isDisabled,
2324
2350
  className
2325
2351
  }, rest),
2326
- /* @__PURE__ */ React.createElement(PlasmicPopoverContext.Provider, { value: {} }, /* @__PURE__ */ React.createElement(
2352
+ /* @__PURE__ */ React.createElement(PlasmicPopoverTriggerContext.Provider, { value: true }, /* @__PURE__ */ React.createElement(
2327
2353
  PlasmicListBoxContext.Provider,
2328
2354
  {
2329
2355
  value: {
@@ -2433,7 +2459,8 @@ function registerComboBox(loader) {
2433
2459
  styles: {
2434
2460
  backgroundColor: "white",
2435
2461
  padding: "10px",
2436
- overflow: "scroll"
2462
+ overflow: "scroll",
2463
+ width: "unset"
2437
2464
  },
2438
2465
  props: {
2439
2466
  offset: 0,
@@ -3233,7 +3260,7 @@ function BaseSelect(props) {
3233
3260
  "aria-label": ariaLabel
3234
3261
  }, extractPlasmicDataProps(props)),
3235
3262
  /* @__PURE__ */ React.createElement(SelectAutoOpen, __spreadValues$8({}, props)),
3236
- /* @__PURE__ */ React.createElement(PlasmicPopoverContext.Provider, { value: {} }, /* @__PURE__ */ React.createElement(
3263
+ /* @__PURE__ */ React.createElement(PlasmicPopoverTriggerContext.Provider, { value: true }, /* @__PURE__ */ React.createElement(
3237
3264
  PlasmicListBoxContext.Provider,
3238
3265
  {
3239
3266
  value: {
@@ -3375,7 +3402,8 @@ function registerSelect(loader) {
3375
3402
  styles: {
3376
3403
  backgroundColor: "white",
3377
3404
  padding: "10px",
3378
- overflow: "scroll"
3405
+ overflow: "scroll",
3406
+ width: "unset"
3379
3407
  },
3380
3408
  props: {
3381
3409
  children: [