@plasmicpkgs/react-aria 0.0.35 → 0.0.36
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 +2 -1
- package/dist/react-aria.esm.js +53 -26
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +51 -24
- package/dist/react-aria.js.map +1 -1
- package/dist/registerPopover.d.ts +6 -1
- package/dist/utils.d.ts +1 -0
- package/package.json +2 -2
- package/skinny/contexts-9475faad.esm.js.map +1 -1
- package/skinny/contexts-b21f6b12.cjs.js.map +1 -1
- package/skinny/contexts.d.ts +2 -1
- package/skinny/registerButton.cjs.js +1 -1
- package/skinny/registerButton.esm.js +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 +4 -2
- package/skinny/registerComboBox.cjs.js.map +1 -1
- package/skinny/registerComboBox.esm.js +4 -2
- package/skinny/registerComboBox.esm.js.map +1 -1
- package/skinny/registerDescription.cjs.js +1 -1
- package/skinny/registerDescription.esm.js +1 -1
- package/skinny/registerDialogTrigger.cjs.js +1 -1
- package/skinny/registerDialogTrigger.esm.js +1 -1
- package/skinny/registerFieldError.cjs.js +1 -1
- package/skinny/registerFieldError.esm.js +1 -1
- package/skinny/registerForm.cjs.js +1 -1
- package/skinny/registerForm.esm.js +1 -1
- package/skinny/registerHeader.cjs.js +1 -1
- package/skinny/registerHeader.esm.js +1 -1
- package/skinny/registerInput.cjs.js +1 -1
- package/skinny/registerInput.esm.js +1 -1
- package/skinny/registerLabel.cjs.js +1 -1
- package/skinny/registerLabel.esm.js +1 -1
- package/skinny/{registerListBox-1effa43d.esm.js → registerListBox-cbc7beea.esm.js} +2 -2
- package/skinny/{registerListBox-1effa43d.esm.js.map → registerListBox-cbc7beea.esm.js.map} +1 -1
- package/skinny/{registerListBox-837b90d8.cjs.js → registerListBox-e98e849f.cjs.js} +2 -2
- package/skinny/{registerListBox-837b90d8.cjs.js.map → registerListBox-e98e849f.cjs.js.map} +1 -1
- package/skinny/registerListBox.cjs.js +3 -2
- package/skinny/registerListBox.cjs.js.map +1 -1
- package/skinny/registerListBox.esm.js +3 -2
- package/skinny/registerListBox.esm.js.map +1 -1
- package/skinny/registerListBoxItem.cjs.js +4 -2
- package/skinny/registerListBoxItem.cjs.js.map +1 -1
- package/skinny/registerListBoxItem.esm.js +5 -3
- package/skinny/registerListBoxItem.esm.js.map +1 -1
- package/skinny/registerModal.cjs.js +1 -1
- package/skinny/registerModal.esm.js +1 -1
- package/skinny/registerPopover.cjs.js +30 -6
- package/skinny/registerPopover.cjs.js.map +1 -1
- package/skinny/registerPopover.d.ts +6 -1
- package/skinny/registerPopover.esm.js +31 -7
- 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 +1 -1
- package/skinny/registerSection.esm.js +1 -1
- package/skinny/registerSelect.cjs.js +5 -4
- package/skinny/registerSelect.cjs.js.map +1 -1
- package/skinny/registerSelect.esm.js +5 -4
- package/skinny/registerSelect.esm.js.map +1 -1
- package/skinny/{registerSlider-abe2fcd9.cjs.js → registerSlider-22197722.cjs.js} +2 -2
- package/skinny/{registerSlider-abe2fcd9.cjs.js.map → registerSlider-22197722.cjs.js.map} +1 -1
- package/skinny/{registerSlider-b37e26ac.esm.js → registerSlider-3045cc63.esm.js} +2 -2
- package/skinny/{registerSlider-b37e26ac.esm.js.map → registerSlider-3045cc63.esm.js.map} +1 -1
- package/skinny/registerSlider.cjs.js +2 -2
- package/skinny/registerSlider.esm.js +2 -2
- package/skinny/registerSliderOutput.cjs.js +1 -1
- package/skinny/registerSliderOutput.esm.js +1 -1
- package/skinny/registerSliderThumb.cjs.js +1 -1
- package/skinny/registerSliderThumb.esm.js +1 -1
- package/skinny/registerSliderTrack.cjs.js +2 -2
- package/skinny/registerSliderTrack.esm.js +2 -2
- package/skinny/registerSwitch.cjs.js +1 -1
- package/skinny/registerSwitch.esm.js +1 -1
- package/skinny/registerText.cjs.js +1 -1
- package/skinny/registerText.esm.js +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/registerTooltip.cjs.js +1 -1
- package/skinny/registerTooltip.esm.js +1 -1
- package/skinny/{utils-5051df41.esm.js → utils-a1785802.esm.js} +5 -2
- package/skinny/{utils-5051df41.esm.js.map → utils-a1785802.esm.js.map} +1 -1
- package/skinny/{utils-745db876.cjs.js → utils-d3708034.cjs.js} +5 -1
- package/skinny/{utils-745db876.cjs.js.map → utils-d3708034.cjs.js.map} +1 -1
- package/skinny/utils.d.ts +1 -0
package/dist/contexts.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { StrictItemType } from "./option-utils";
|
|
2
3
|
import type { BaseListBoxProps } from "./registerListBox";
|
|
3
4
|
export declare const PlasmicCheckboxGroupContext: React.Context<import("react-aria-components").CheckboxGroupProps | undefined>;
|
|
4
5
|
export declare const PlasmicRadioGroupContext: React.Context<(import("react-aria-components").RadioGroupProps & React.RefAttributes<HTMLDivElement>) | undefined>;
|
|
@@ -7,7 +8,7 @@ export declare const PlasmicSliderContext: React.Context<import("./registerSlide
|
|
|
7
8
|
export declare const PlasmicLabelContext: React.Context<(import("react-aria-components").LabelProps & React.RefAttributes<HTMLLabelElement>) | undefined>;
|
|
8
9
|
export declare const PlasmicListBoxContext: React.Context<BaseListBoxProps | undefined>;
|
|
9
10
|
export declare const PlasmicPopoverContext: React.Context<import("./registerPopover").BasePopoverProps | undefined>;
|
|
10
|
-
export declare const PlasmicItemContext: React.Context<
|
|
11
|
+
export declare const PlasmicItemContext: React.Context<StrictItemType | undefined>;
|
|
11
12
|
export declare const PlasmicSectionContext: React.Context<import("./registerSection").BaseSectionProps | undefined>;
|
|
12
13
|
export declare const PlasmicHeaderContext: React.Context<(React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>) | undefined>;
|
|
13
14
|
export declare const PlasmicInputContext: React.Context<import("./registerInput").BaseInputProps | undefined>;
|
package/dist/react-aria.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { forwardRef, useImperativeHandle,
|
|
2
|
-
import { Button, Label, Checkbox, Text, FieldError, CheckboxGroup, Input, ListBoxItem, Header, Section, Collection,
|
|
1
|
+
import React, { Component, forwardRef, useImperativeHandle, useMemo, useRef, useEffect } from 'react';
|
|
2
|
+
import { Button, Label, Checkbox, Text, FieldError, CheckboxGroup, Input, ListBoxItem, ListBox, Header, Section, Collection, PopoverContext, SelectContext, Popover, ComboBox, ComboBoxStateContext, Heading, ModalOverlay, Modal, Dialog, DialogTrigger, Form, Radio, RadioGroup, Select, SelectValue, SliderOutput, SliderThumb, Slider, SliderTrack, Switch, TextArea, TextField } from 'react-aria-components';
|
|
3
3
|
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
4
4
|
import { useFilter } from '@react-aria/i18n';
|
|
5
5
|
import { mergeProps } from '@react-aria/utils';
|
|
@@ -169,6 +169,9 @@ function extractPlasmicDataProps(props) {
|
|
|
169
169
|
function withoutNils(array) {
|
|
170
170
|
return array.filter((x) => x != null);
|
|
171
171
|
}
|
|
172
|
+
function isDefined(thing) {
|
|
173
|
+
return thing !== void 0 && thing !== null;
|
|
174
|
+
}
|
|
172
175
|
|
|
173
176
|
var __defProp$p = Object.defineProperty;
|
|
174
177
|
var __defProps$c = Object.defineProperties;
|
|
@@ -1172,6 +1175,22 @@ function registerInput(loader, overrides) {
|
|
|
1172
1175
|
);
|
|
1173
1176
|
}
|
|
1174
1177
|
|
|
1178
|
+
class ErrorBoundary extends Component {
|
|
1179
|
+
constructor(props) {
|
|
1180
|
+
super(props);
|
|
1181
|
+
this.state = { hasError: false };
|
|
1182
|
+
}
|
|
1183
|
+
static getDerivedStateFromError(_) {
|
|
1184
|
+
return { hasError: true };
|
|
1185
|
+
}
|
|
1186
|
+
render() {
|
|
1187
|
+
if (this.state.hasError) {
|
|
1188
|
+
return this.props.fallback;
|
|
1189
|
+
}
|
|
1190
|
+
return this.props.children;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1175
1194
|
var __defProp$i = Object.defineProperty;
|
|
1176
1195
|
var __defProps$8 = Object.defineProperties;
|
|
1177
1196
|
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
@@ -1194,7 +1213,8 @@ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
|
1194
1213
|
function BaseListBoxItem(props) {
|
|
1195
1214
|
const contextProps = React.useContext(PlasmicItemContext);
|
|
1196
1215
|
const mergedProps = mergeProps(contextProps, props);
|
|
1197
|
-
|
|
1216
|
+
const listboxItem = /* @__PURE__ */ React.createElement(ListBoxItem, __spreadProps$8(__spreadValues$i({}, mergedProps), { textValue: contextProps == null ? void 0 : contextProps.label }), mergedProps.children);
|
|
1217
|
+
return /* @__PURE__ */ React.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React.createElement(ListBox, null, listboxItem) }, listboxItem);
|
|
1198
1218
|
}
|
|
1199
1219
|
const makeDefaultListBoxItemChildren = (label, description) => ({
|
|
1200
1220
|
type: "vbox",
|
|
@@ -1504,20 +1524,37 @@ var __objRest$b = (source, exclude) => {
|
|
|
1504
1524
|
}
|
|
1505
1525
|
return target;
|
|
1506
1526
|
};
|
|
1527
|
+
const SHOULD_FLIP_INSIDE_SELECT = false;
|
|
1507
1528
|
function BasePopover(props) {
|
|
1508
|
-
const _a = props, { resetClassName } = _a, restProps = __objRest$b(_a, ["resetClassName"]);
|
|
1529
|
+
const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$b(_a, ["resetClassName", "setControlContextData"]);
|
|
1509
1530
|
const isStandalone = !React.useContext(PopoverContext);
|
|
1510
1531
|
const contextProps = React.useContext(PlasmicPopoverContext);
|
|
1511
|
-
const
|
|
1512
|
-
|
|
1513
|
-
|
|
1532
|
+
const isInsideSelect = !!React.useContext(SelectContext);
|
|
1533
|
+
const mergedProps = mergeProps(
|
|
1534
|
+
contextProps,
|
|
1535
|
+
restProps,
|
|
1536
|
+
{
|
|
1537
|
+
className: `${resetClassName}`
|
|
1538
|
+
},
|
|
1539
|
+
isInsideSelect && !isDefined(restProps.shouldFlip) ? { shouldFlip: SHOULD_FLIP_INSIDE_SELECT } : void 0
|
|
1540
|
+
);
|
|
1541
|
+
const isEditMode = !!usePlasmicCanvasContext();
|
|
1514
1542
|
const triggerRef = React.useRef(null);
|
|
1515
1543
|
const standaloneProps = isStandalone ? {
|
|
1516
1544
|
triggerRef,
|
|
1517
1545
|
isNonModal: true,
|
|
1518
1546
|
isOpen: true
|
|
1519
1547
|
} : {};
|
|
1520
|
-
|
|
1548
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
1549
|
+
isStandalone,
|
|
1550
|
+
isInsideSelect
|
|
1551
|
+
});
|
|
1552
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(
|
|
1553
|
+
Popover,
|
|
1554
|
+
__spreadValues$e(__spreadValues$e({
|
|
1555
|
+
isNonModal: isEditMode ? true : void 0
|
|
1556
|
+
}, mergedProps), standaloneProps)
|
|
1557
|
+
));
|
|
1521
1558
|
}
|
|
1522
1559
|
const POPOVER_COMPONENT_NAME = makeComponentName("popover");
|
|
1523
1560
|
const POPOVER_ARROW_IMG = {
|
|
@@ -1588,9 +1625,15 @@ function registerPopover(loader, overrides) {
|
|
|
1588
1625
|
description: "Additional offset applied vertically between the popover and its trigger",
|
|
1589
1626
|
defaultValueHint: 0
|
|
1590
1627
|
},
|
|
1628
|
+
shouldFlip: {
|
|
1629
|
+
type: "boolean",
|
|
1630
|
+
description: "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.",
|
|
1631
|
+
defaultValueHint: (_ps, ctx) => (ctx == null ? void 0 : ctx.isInsideSelect) ? SHOULD_FLIP_INSIDE_SELECT : true
|
|
1632
|
+
},
|
|
1591
1633
|
placement: {
|
|
1592
1634
|
type: "choice",
|
|
1593
1635
|
description: "Default placement of the popover relative to the trigger, if there is enough space",
|
|
1636
|
+
defaultValueHint: "bottom",
|
|
1594
1637
|
options: [
|
|
1595
1638
|
"bottom",
|
|
1596
1639
|
"bottom left",
|
|
@@ -2338,22 +2381,6 @@ function registerForm(loader, overrides) {
|
|
|
2338
2381
|
);
|
|
2339
2382
|
}
|
|
2340
2383
|
|
|
2341
|
-
class ErrorBoundary extends Component {
|
|
2342
|
-
constructor(props) {
|
|
2343
|
-
super(props);
|
|
2344
|
-
this.state = { hasError: false };
|
|
2345
|
-
}
|
|
2346
|
-
static getDerivedStateFromError(_) {
|
|
2347
|
-
return { hasError: true };
|
|
2348
|
-
}
|
|
2349
|
-
render() {
|
|
2350
|
-
if (this.state.hasError) {
|
|
2351
|
-
return this.props.fallback;
|
|
2352
|
-
}
|
|
2353
|
-
return this.props.children;
|
|
2354
|
-
}
|
|
2355
|
-
}
|
|
2356
|
-
|
|
2357
2384
|
var __defProp$9 = Object.defineProperty;
|
|
2358
2385
|
var __defProps$4 = Object.defineProperties;
|
|
2359
2386
|
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
@@ -2668,7 +2695,7 @@ function BaseSelect(props) {
|
|
|
2668
2695
|
"aria-label": ariaLabel
|
|
2669
2696
|
} = props;
|
|
2670
2697
|
const { options } = useStrictOptions(props);
|
|
2671
|
-
const
|
|
2698
|
+
const isEditMode = !!usePlasmicCanvasContext();
|
|
2672
2699
|
const disabledKeys = flattenOptions(options).filter((op) => op.isDisabled).map((op) => op.id);
|
|
2673
2700
|
return /* @__PURE__ */ React.createElement(
|
|
2674
2701
|
Select,
|
|
@@ -2682,7 +2709,7 @@ function BaseSelect(props) {
|
|
|
2682
2709
|
style,
|
|
2683
2710
|
name,
|
|
2684
2711
|
"aria-label": ariaLabel
|
|
2685
|
-
},
|
|
2712
|
+
}, isEditMode ? { isOpen: previewOpen } : void 0), extractPlasmicDataProps(props)),
|
|
2686
2713
|
/* @__PURE__ */ React.createElement(
|
|
2687
2714
|
PlasmicListBoxContext.Provider,
|
|
2688
2715
|
{
|