@plasmicpkgs/react-aria 0.0.75 → 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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/contexts.d.ts +1 -1
- package/dist/react-aria.esm.js +52 -27
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +52 -27
- package/dist/react-aria.js.map +1 -1
- package/dist/registerPopover.d.ts +6 -2
- package/package.json +2 -2
- package/skinny/{contexts-081d65a0.esm.js → contexts-5cb81c2f.esm.js} +3 -3
- package/skinny/contexts-5cb81c2f.esm.js.map +1 -0
- package/skinny/{contexts-baa37b74.cjs.js → contexts-6d0cb2b1.cjs.js} +3 -3
- package/skinny/contexts-6d0cb2b1.cjs.js.map +1 -0
- package/skinny/contexts.d.ts +1 -1
- package/skinny/registerCheckbox.cjs.js +1 -1
- package/skinny/registerCheckbox.esm.js +1 -1
- package/skinny/registerCheckboxGroup.cjs.js +1 -1
- package/skinny/registerCheckboxGroup.esm.js +1 -1
- package/skinny/registerComboBox.cjs.js +6 -5
- package/skinny/registerComboBox.cjs.js.map +1 -1
- package/skinny/registerComboBox.esm.js +6 -5
- package/skinny/registerComboBox.esm.js.map +1 -1
- package/skinny/registerDialogTrigger.cjs.js +1 -1
- package/skinny/registerDialogTrigger.esm.js +1 -1
- package/skinny/registerInput.cjs.js +1 -1
- package/skinny/registerInput.esm.js +1 -1
- package/skinny/{registerListBox-64bcf3d2.esm.js → registerListBox-25d602fa.esm.js} +3 -5
- package/skinny/registerListBox-25d602fa.esm.js.map +1 -0
- package/skinny/{registerListBox-c2c63064.cjs.js → registerListBox-f4f6beb5.cjs.js} +8 -10
- package/skinny/registerListBox-f4f6beb5.cjs.js.map +1 -0
- package/skinny/registerListBox.cjs.js +2 -3
- package/skinny/registerListBox.cjs.js.map +1 -1
- package/skinny/registerListBox.esm.js +2 -3
- package/skinny/registerListBox.esm.js.map +1 -1
- package/skinny/registerListBoxItem.cjs.js +1 -1
- package/skinny/registerListBoxItem.esm.js +1 -1
- package/skinny/registerModal.cjs.js +1 -1
- package/skinny/registerModal.esm.js +1 -1
- package/skinny/registerPopover.cjs.js +40 -14
- package/skinny/registerPopover.cjs.js.map +1 -1
- package/skinny/registerPopover.d.ts +6 -2
- package/skinny/registerPopover.esm.js +41 -15
- package/skinny/registerPopover.esm.js.map +1 -1
- package/skinny/registerRadio.cjs.js +1 -1
- package/skinny/registerRadio.esm.js +1 -1
- package/skinny/registerRadioGroup.cjs.js +1 -1
- package/skinny/registerRadioGroup.esm.js +1 -1
- package/skinny/registerSection.cjs.js +2 -3
- package/skinny/registerSection.cjs.js.map +1 -1
- package/skinny/registerSection.esm.js +2 -3
- package/skinny/registerSection.esm.js.map +1 -1
- package/skinny/registerSelect.cjs.js +6 -5
- package/skinny/registerSelect.cjs.js.map +1 -1
- package/skinny/registerSelect.esm.js +6 -5
- package/skinny/registerSelect.esm.js.map +1 -1
- package/skinny/registerSlider.cjs.js +1 -2
- package/skinny/registerSlider.cjs.js.map +1 -1
- package/skinny/registerSlider.esm.js +1 -2
- package/skinny/registerSlider.esm.js.map +1 -1
- package/skinny/registerSliderThumb.cjs.js +1 -5
- package/skinny/registerSliderThumb.cjs.js.map +1 -1
- package/skinny/registerSliderThumb.esm.js +1 -5
- package/skinny/registerSliderThumb.esm.js.map +1 -1
- package/skinny/registerSliderTrack.cjs.js +5 -6
- package/skinny/registerSliderTrack.cjs.js.map +1 -1
- package/skinny/registerSliderTrack.esm.js +5 -6
- package/skinny/registerSliderTrack.esm.js.map +1 -1
- package/skinny/registerTextArea.cjs.js +1 -1
- package/skinny/registerTextArea.esm.js +1 -1
- package/skinny/registerTextField.cjs.js +1 -1
- package/skinny/registerTextField.esm.js +1 -1
- package/skinny/contexts-081d65a0.esm.js.map +0 -1
- package/skinny/contexts-baa37b74.cjs.js.map +0 -1
- package/skinny/registerListBox-64bcf3d2.esm.js.map +0 -1
- package/skinny/registerListBox-c2c63064.cjs.js.map +0 -1
package/dist/react-aria.js
CHANGED
|
@@ -648,7 +648,7 @@ const PlasmicRadioGroupContext = React__default.default.createContext(void 0);
|
|
|
648
648
|
const PlasmicDialogTriggerContext = React__default.default.createContext(void 0);
|
|
649
649
|
const PlasmicSliderContext = React__default.default.createContext(void 0);
|
|
650
650
|
React__default.default.createContext(void 0);
|
|
651
|
-
const
|
|
651
|
+
const PlasmicPopoverTriggerContext = React__default.default.createContext(void 0);
|
|
652
652
|
const PlasmicListBoxContext = React__default.default.createContext(void 0);
|
|
653
653
|
React__default.default.createContext(void 0);
|
|
654
654
|
const PlasmicInputContext = React__default.default.createContext(void 0);
|
|
@@ -1780,8 +1780,7 @@ function BaseSection(props) {
|
|
|
1780
1780
|
const _a = props, { header, items } = _a, rest = __objRest$g(_a, ["header", "items"]);
|
|
1781
1781
|
const contextProps = React__default.default.useContext(PlasmicListBoxContext);
|
|
1782
1782
|
const isStandalone = !contextProps;
|
|
1783
|
-
const
|
|
1784
|
-
const section = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Section, __spreadValues$h({}, mergedProps), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Header, null, header), items);
|
|
1783
|
+
const section = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Section, __spreadValues$h({}, rest), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Header, null, header), items);
|
|
1785
1784
|
if (isStandalone) {
|
|
1786
1785
|
return (
|
|
1787
1786
|
// BaseListbox should give section a listbox context (that it can't be used without)
|
|
@@ -2124,14 +2123,24 @@ const POPOVER_VARIANTS = [
|
|
|
2124
2123
|
];
|
|
2125
2124
|
const { variants: variants$a, withObservedValues: withObservedValues$9 } = pickAriaComponentVariants(POPOVER_VARIANTS);
|
|
2126
2125
|
function BasePopover(props) {
|
|
2127
|
-
const _a = props, {
|
|
2126
|
+
const _a = props, {
|
|
2127
|
+
resetClassName,
|
|
2128
|
+
plasmicUpdateVariant,
|
|
2129
|
+
setControlContextData,
|
|
2130
|
+
matchTriggerWidth
|
|
2131
|
+
} = _a, restProps = __objRest$e(_a, [
|
|
2132
|
+
"resetClassName",
|
|
2133
|
+
"plasmicUpdateVariant",
|
|
2134
|
+
"setControlContextData",
|
|
2135
|
+
"matchTriggerWidth"
|
|
2136
|
+
]);
|
|
2128
2137
|
const isStandalone = !React__default.default.useContext(reactAriaComponents.PopoverContext);
|
|
2129
|
-
const
|
|
2138
|
+
const hasTrigger = !!React__default.default.useContext(PlasmicPopoverTriggerContext);
|
|
2130
2139
|
const triggerRef = React__default.default.useRef(null);
|
|
2131
2140
|
const canvasContext = host.usePlasmicCanvasContext();
|
|
2141
|
+
const matchTriggerWidthProp = hasTrigger && matchTriggerWidth;
|
|
2132
2142
|
const _b = utils.mergeProps(
|
|
2133
2143
|
{
|
|
2134
|
-
isOpen: context == null ? void 0 : context.isOpen,
|
|
2135
2144
|
// isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.
|
|
2136
2145
|
// 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.
|
|
2137
2146
|
isNonModal: canvasContext && !canvasContext.interactive
|
|
@@ -2147,16 +2156,27 @@ function BasePopover(props) {
|
|
|
2147
2156
|
isOpen: true
|
|
2148
2157
|
} : null
|
|
2149
2158
|
), { children } = _b, mergedProps = __objRest$e(_b, ["children"]);
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2159
|
+
React.useEffect(() => {
|
|
2160
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
2161
|
+
canMatchTriggerWidth: hasTrigger
|
|
2162
|
+
});
|
|
2163
|
+
}, [hasTrigger, setControlContextData]);
|
|
2164
|
+
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(
|
|
2165
|
+
reactAriaComponents.Popover,
|
|
2166
|
+
__spreadValues$f({
|
|
2167
|
+
style: matchTriggerWidthProp ? { width: `var(--trigger-width)` } : void 0
|
|
2168
|
+
}, mergedProps),
|
|
2169
|
+
({ placement }) => withObservedValues$9(
|
|
2170
|
+
children,
|
|
2171
|
+
{
|
|
2172
|
+
placementTop: placement === "top",
|
|
2173
|
+
placementBottom: placement === "bottom",
|
|
2174
|
+
placementLeft: placement === "left",
|
|
2175
|
+
placementRight: placement === "right"
|
|
2176
|
+
},
|
|
2177
|
+
plasmicUpdateVariant
|
|
2178
|
+
)
|
|
2179
|
+
));
|
|
2160
2180
|
}
|
|
2161
2181
|
const POPOVER_COMPONENT_NAME = makeComponentName("popover");
|
|
2162
2182
|
const POPOVER_ARROW_IMG = {
|
|
@@ -2247,6 +2267,11 @@ function registerPopover(loader, overrides) {
|
|
|
2247
2267
|
},
|
|
2248
2268
|
resetClassName: {
|
|
2249
2269
|
type: "themeResetClass"
|
|
2270
|
+
},
|
|
2271
|
+
matchTriggerWidth: {
|
|
2272
|
+
type: "boolean",
|
|
2273
|
+
defaultValue: true,
|
|
2274
|
+
hidden: (_props, ctx) => !(ctx == null ? void 0 : ctx.canMatchTriggerWidth)
|
|
2250
2275
|
}
|
|
2251
2276
|
},
|
|
2252
2277
|
// 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.
|
|
@@ -2332,7 +2357,7 @@ function BaseComboBox(props) {
|
|
|
2332
2357
|
isDisabled,
|
|
2333
2358
|
className
|
|
2334
2359
|
}, rest),
|
|
2335
|
-
/* @__PURE__ */ React__default.default.createElement(
|
|
2360
|
+
/* @__PURE__ */ React__default.default.createElement(PlasmicPopoverTriggerContext.Provider, { value: true }, /* @__PURE__ */ React__default.default.createElement(
|
|
2336
2361
|
PlasmicListBoxContext.Provider,
|
|
2337
2362
|
{
|
|
2338
2363
|
value: {
|
|
@@ -2442,7 +2467,8 @@ function registerComboBox(loader) {
|
|
|
2442
2467
|
styles: {
|
|
2443
2468
|
backgroundColor: "white",
|
|
2444
2469
|
padding: "10px",
|
|
2445
|
-
overflow: "scroll"
|
|
2470
|
+
overflow: "scroll",
|
|
2471
|
+
width: "unset"
|
|
2446
2472
|
},
|
|
2447
2473
|
props: {
|
|
2448
2474
|
offset: 0,
|
|
@@ -3242,7 +3268,7 @@ function BaseSelect(props) {
|
|
|
3242
3268
|
"aria-label": ariaLabel
|
|
3243
3269
|
}, extractPlasmicDataProps(props)),
|
|
3244
3270
|
/* @__PURE__ */ React__default.default.createElement(SelectAutoOpen, __spreadValues$8({}, props)),
|
|
3245
|
-
/* @__PURE__ */ React__default.default.createElement(
|
|
3271
|
+
/* @__PURE__ */ React__default.default.createElement(PlasmicPopoverTriggerContext.Provider, { value: true }, /* @__PURE__ */ React__default.default.createElement(
|
|
3246
3272
|
PlasmicListBoxContext.Provider,
|
|
3247
3273
|
{
|
|
3248
3274
|
value: {
|
|
@@ -3384,7 +3410,8 @@ function registerSelect(loader) {
|
|
|
3384
3410
|
styles: {
|
|
3385
3411
|
backgroundColor: "white",
|
|
3386
3412
|
padding: "10px",
|
|
3387
|
-
overflow: "scroll"
|
|
3413
|
+
overflow: "scroll",
|
|
3414
|
+
width: "unset"
|
|
3388
3415
|
},
|
|
3389
3416
|
props: {
|
|
3390
3417
|
children: [
|
|
@@ -3557,9 +3584,7 @@ function BaseSliderThumb(_a) {
|
|
|
3557
3584
|
"advanced",
|
|
3558
3585
|
"plasmicUpdateVariant"
|
|
3559
3586
|
]);
|
|
3560
|
-
const
|
|
3561
|
-
const mergedProps = reactAria.mergeProps(context, rest);
|
|
3562
|
-
const thumb = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SliderThumb, __spreadValues$6({}, mergedProps), ({ isDragging, isHovered, isFocused, isFocusVisible, isDisabled }) => withObservedValues$5(
|
|
3587
|
+
const thumb = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SliderThumb, __spreadValues$6({}, rest), ({ isDragging, isHovered, isFocused, isFocusVisible, isDisabled }) => withObservedValues$5(
|
|
3563
3588
|
/* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, advanced ? children : void 0),
|
|
3564
3589
|
{
|
|
3565
3590
|
dragging: isDragging,
|
|
@@ -3673,15 +3698,15 @@ function isMultiValueGuard(value) {
|
|
|
3673
3698
|
function BaseSliderTrack(props) {
|
|
3674
3699
|
const context = React__default.default.useContext(PlasmicSliderContext);
|
|
3675
3700
|
const isStandalone = !context;
|
|
3676
|
-
const
|
|
3677
|
-
const
|
|
3678
|
-
const isMultiValue =
|
|
3701
|
+
const _a = props, { children, progressBar, plasmicUpdateVariant } = _a, rest = __objRest$5(_a, ["children", "progressBar", "plasmicUpdateVariant"]);
|
|
3702
|
+
const thumbsLength = context && isMultiValueGuard(context.value) ? context.value.length : 1;
|
|
3703
|
+
const isMultiValue = thumbsLength > 1;
|
|
3679
3704
|
const { minIndex, maxIndex } = React.useMemo(() => {
|
|
3680
3705
|
if (!context || !Array.isArray(context.value) || context.value.length <= 1) {
|
|
3681
3706
|
return { minIndex: 0, maxIndex: 0 };
|
|
3682
3707
|
}
|
|
3683
3708
|
return findMinMaxIndices(context.value);
|
|
3684
|
-
}, [
|
|
3709
|
+
}, [thumbsLength]);
|
|
3685
3710
|
const thumbs = React.useMemo(() => {
|
|
3686
3711
|
const thumbNodes = flattenChildren__default.default(children);
|
|
3687
3712
|
if (!thumbNodes || thumbNodes.length === 0 || !isDefined(context == null ? void 0 : context.value)) {
|