@plasmicpkgs/react-aria 0.0.35 → 0.0.37
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/interaction-variant-utils.d.ts +4 -0
- package/dist/react-aria.esm.js +69 -49
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +67 -47
- package/dist/react-aria.js.map +1 -1
- package/dist/registerPopover.d.ts +6 -1
- package/dist/registerRadio.d.ts +2 -4
- 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/{interaction-variant-utils-c44a9d56.esm.js → interaction-variant-utils-0e04f834.esm.js} +5 -1
- package/skinny/interaction-variant-utils-0e04f834.esm.js.map +1 -0
- package/skinny/{interaction-variant-utils-244b74fb.cjs.js → interaction-variant-utils-d45aa2a2.cjs.js} +5 -1
- package/skinny/interaction-variant-utils-d45aa2a2.cjs.js.map +1 -0
- package/skinny/interaction-variant-utils.d.ts +4 -0
- package/skinny/registerButton.cjs.js +4 -3
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.esm.js +4 -3
- package/skinny/registerButton.esm.js.map +1 -1
- package/skinny/registerCheckbox.cjs.js +2 -2
- package/skinny/registerCheckbox.esm.js +2 -2
- package/skinny/registerCheckboxGroup.cjs.js +2 -2
- package/skinny/registerCheckboxGroup.esm.js +2 -2
- package/skinny/registerComboBox.cjs.js +5 -3
- package/skinny/registerComboBox.cjs.js.map +1 -1
- package/skinny/registerComboBox.esm.js +5 -3
- 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 +2 -2
- package/skinny/registerDialogTrigger.esm.js +2 -2
- 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 +2 -2
- package/skinny/registerInput.esm.js +2 -2
- 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 +8 -24
- package/skinny/registerRadio.cjs.js.map +1 -1
- package/skinny/registerRadio.d.ts +2 -4
- package/skinny/registerRadio.esm.js +8 -24
- package/skinny/registerRadio.esm.js.map +1 -1
- package/skinny/registerRadioGroup.cjs.js +2 -2
- package/skinny/registerRadioGroup.esm.js +2 -2
- package/skinny/registerSection.cjs.js +1 -1
- package/skinny/registerSection.esm.js +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-b37e26ac.esm.js → registerSlider-3d1d372e.esm.js} +3 -3
- package/skinny/{registerSlider-b37e26ac.esm.js.map → registerSlider-3d1d372e.esm.js.map} +1 -1
- package/skinny/{registerSlider-abe2fcd9.cjs.js → registerSlider-7d3a0b39.cjs.js} +3 -3
- package/skinny/{registerSlider-abe2fcd9.cjs.js.map → registerSlider-7d3a0b39.cjs.js.map} +1 -1
- package/skinny/registerSlider.cjs.js +3 -3
- package/skinny/registerSlider.esm.js +3 -3
- package/skinny/registerSliderOutput.cjs.js +1 -1
- package/skinny/registerSliderOutput.esm.js +1 -1
- package/skinny/registerSliderThumb.cjs.js +2 -2
- package/skinny/registerSliderThumb.esm.js +2 -2
- package/skinny/registerSliderTrack.cjs.js +3 -3
- package/skinny/registerSliderTrack.esm.js +3 -3
- package/skinny/registerSwitch.cjs.js +2 -2
- package/skinny/registerSwitch.esm.js +2 -2
- package/skinny/registerText.cjs.js +5 -2
- package/skinny/registerText.cjs.js.map +1 -1
- package/skinny/registerText.esm.js +5 -2
- package/skinny/registerText.esm.js.map +1 -1
- package/skinny/registerTextArea.cjs.js +2 -2
- package/skinny/registerTextArea.esm.js +2 -2
- package/skinny/registerTextField.cjs.js +2 -2
- package/skinny/registerTextField.esm.js +2 -2
- 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/skinny/interaction-variant-utils-244b74fb.cjs.js.map +0 -1
- package/skinny/interaction-variant-utils-c44a9d56.esm.js.map +0 -1
package/dist/react-aria.js
CHANGED
|
@@ -86,6 +86,10 @@ const ARIA_COMPONENTS_INTERACTION_VARIANTS = {
|
|
|
86
86
|
dragging: {
|
|
87
87
|
cssSelector: "[data-dragging]",
|
|
88
88
|
displayName: "Dragging"
|
|
89
|
+
},
|
|
90
|
+
selected: {
|
|
91
|
+
cssSelector: "[data-selected]",
|
|
92
|
+
displayName: "Selected"
|
|
89
93
|
}
|
|
90
94
|
};
|
|
91
95
|
function ChangesObserver({
|
|
@@ -177,6 +181,9 @@ function extractPlasmicDataProps(props) {
|
|
|
177
181
|
function withoutNils(array) {
|
|
178
182
|
return array.filter((x) => x != null);
|
|
179
183
|
}
|
|
184
|
+
function isDefined(thing) {
|
|
185
|
+
return thing !== void 0 && thing !== null;
|
|
186
|
+
}
|
|
180
187
|
|
|
181
188
|
var __defProp$p = Object.defineProperty;
|
|
182
189
|
var __defProps$c = Object.defineProperties;
|
|
@@ -257,7 +264,8 @@ function registerButton(loader, overrides) {
|
|
|
257
264
|
borderWidth: "1px",
|
|
258
265
|
borderStyle: "solid",
|
|
259
266
|
borderColor: "black",
|
|
260
|
-
padding: "2px 10px"
|
|
267
|
+
padding: "2px 10px",
|
|
268
|
+
cursor: "pointer"
|
|
261
269
|
},
|
|
262
270
|
props: __spreadProps$c(__spreadValues$p({}, getCommonInputProps("button", [
|
|
263
271
|
"isDisabled",
|
|
@@ -573,7 +581,10 @@ function registerText(loader, overrides) {
|
|
|
573
581
|
}
|
|
574
582
|
},
|
|
575
583
|
slot: {
|
|
576
|
-
type: "
|
|
584
|
+
type: "choice",
|
|
585
|
+
options: ["label", "description"],
|
|
586
|
+
defaultValueHint: "label",
|
|
587
|
+
defaultValue: "label"
|
|
577
588
|
}
|
|
578
589
|
},
|
|
579
590
|
trapsFocus: true
|
|
@@ -1180,6 +1191,22 @@ function registerInput(loader, overrides) {
|
|
|
1180
1191
|
);
|
|
1181
1192
|
}
|
|
1182
1193
|
|
|
1194
|
+
class ErrorBoundary extends React.Component {
|
|
1195
|
+
constructor(props) {
|
|
1196
|
+
super(props);
|
|
1197
|
+
this.state = { hasError: false };
|
|
1198
|
+
}
|
|
1199
|
+
static getDerivedStateFromError(_) {
|
|
1200
|
+
return { hasError: true };
|
|
1201
|
+
}
|
|
1202
|
+
render() {
|
|
1203
|
+
if (this.state.hasError) {
|
|
1204
|
+
return this.props.fallback;
|
|
1205
|
+
}
|
|
1206
|
+
return this.props.children;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1183
1210
|
var __defProp$i = Object.defineProperty;
|
|
1184
1211
|
var __defProps$8 = Object.defineProperties;
|
|
1185
1212
|
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
@@ -1202,7 +1229,8 @@ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
|
1202
1229
|
function BaseListBoxItem(props) {
|
|
1203
1230
|
const contextProps = React__default.default.useContext(PlasmicItemContext);
|
|
1204
1231
|
const mergedProps = utils.mergeProps(contextProps, props);
|
|
1205
|
-
|
|
1232
|
+
const listboxItem = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadProps$8(__spreadValues$i({}, mergedProps), { textValue: contextProps == null ? void 0 : contextProps.label }), mergedProps.children);
|
|
1233
|
+
return /* @__PURE__ */ React__default.default.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBox, null, listboxItem) }, listboxItem);
|
|
1206
1234
|
}
|
|
1207
1235
|
const makeDefaultListBoxItemChildren = (label, description) => ({
|
|
1208
1236
|
type: "vbox",
|
|
@@ -1512,20 +1540,37 @@ var __objRest$b = (source, exclude) => {
|
|
|
1512
1540
|
}
|
|
1513
1541
|
return target;
|
|
1514
1542
|
};
|
|
1543
|
+
const SHOULD_FLIP_INSIDE_SELECT = false;
|
|
1515
1544
|
function BasePopover(props) {
|
|
1516
|
-
const _a = props, { resetClassName } = _a, restProps = __objRest$b(_a, ["resetClassName"]);
|
|
1545
|
+
const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$b(_a, ["resetClassName", "setControlContextData"]);
|
|
1517
1546
|
const isStandalone = !React__default.default.useContext(reactAriaComponents.PopoverContext);
|
|
1518
1547
|
const contextProps = React__default.default.useContext(PlasmicPopoverContext);
|
|
1519
|
-
const
|
|
1520
|
-
|
|
1521
|
-
|
|
1548
|
+
const isInsideSelect = !!React__default.default.useContext(reactAriaComponents.SelectContext);
|
|
1549
|
+
const mergedProps = utils.mergeProps(
|
|
1550
|
+
contextProps,
|
|
1551
|
+
restProps,
|
|
1552
|
+
{
|
|
1553
|
+
className: `${resetClassName}`
|
|
1554
|
+
},
|
|
1555
|
+
isInsideSelect && !isDefined(restProps.shouldFlip) ? { shouldFlip: SHOULD_FLIP_INSIDE_SELECT } : void 0
|
|
1556
|
+
);
|
|
1557
|
+
const isEditMode = !!host.usePlasmicCanvasContext();
|
|
1522
1558
|
const triggerRef = React__default.default.useRef(null);
|
|
1523
1559
|
const standaloneProps = isStandalone ? {
|
|
1524
1560
|
triggerRef,
|
|
1525
1561
|
isNonModal: true,
|
|
1526
1562
|
isOpen: true
|
|
1527
1563
|
} : {};
|
|
1528
|
-
|
|
1564
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
1565
|
+
isStandalone,
|
|
1566
|
+
isInsideSelect
|
|
1567
|
+
});
|
|
1568
|
+
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(
|
|
1569
|
+
reactAriaComponents.Popover,
|
|
1570
|
+
__spreadValues$e(__spreadValues$e({
|
|
1571
|
+
isNonModal: isEditMode ? true : void 0
|
|
1572
|
+
}, mergedProps), standaloneProps)
|
|
1573
|
+
));
|
|
1529
1574
|
}
|
|
1530
1575
|
const POPOVER_COMPONENT_NAME = makeComponentName("popover");
|
|
1531
1576
|
const POPOVER_ARROW_IMG = {
|
|
@@ -1596,9 +1641,15 @@ function registerPopover(loader, overrides) {
|
|
|
1596
1641
|
description: "Additional offset applied vertically between the popover and its trigger",
|
|
1597
1642
|
defaultValueHint: 0
|
|
1598
1643
|
},
|
|
1644
|
+
shouldFlip: {
|
|
1645
|
+
type: "boolean",
|
|
1646
|
+
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.",
|
|
1647
|
+
defaultValueHint: (_ps, ctx) => (ctx == null ? void 0 : ctx.isInsideSelect) ? SHOULD_FLIP_INSIDE_SELECT : true
|
|
1648
|
+
},
|
|
1599
1649
|
placement: {
|
|
1600
1650
|
type: "choice",
|
|
1601
1651
|
description: "Default placement of the popover relative to the trigger, if there is enough space",
|
|
1652
|
+
defaultValueHint: "bottom",
|
|
1602
1653
|
options: [
|
|
1603
1654
|
"bottom",
|
|
1604
1655
|
"bottom left",
|
|
@@ -2346,22 +2397,6 @@ function registerForm(loader, overrides) {
|
|
|
2346
2397
|
);
|
|
2347
2398
|
}
|
|
2348
2399
|
|
|
2349
|
-
class ErrorBoundary extends React.Component {
|
|
2350
|
-
constructor(props) {
|
|
2351
|
-
super(props);
|
|
2352
|
-
this.state = { hasError: false };
|
|
2353
|
-
}
|
|
2354
|
-
static getDerivedStateFromError(_) {
|
|
2355
|
-
return { hasError: true };
|
|
2356
|
-
}
|
|
2357
|
-
render() {
|
|
2358
|
-
if (this.state.hasError) {
|
|
2359
|
-
return this.props.fallback;
|
|
2360
|
-
}
|
|
2361
|
-
return this.props.children;
|
|
2362
|
-
}
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
2400
|
var __defProp$9 = Object.defineProperty;
|
|
2366
2401
|
var __defProps$4 = Object.defineProperties;
|
|
2367
2402
|
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
@@ -2397,28 +2432,25 @@ const RADIO_INTERACTION_VARIANTS = [
|
|
|
2397
2432
|
"hovered",
|
|
2398
2433
|
"pressed",
|
|
2399
2434
|
"focused",
|
|
2400
|
-
"focusVisible"
|
|
2435
|
+
"focusVisible",
|
|
2436
|
+
"selected"
|
|
2401
2437
|
];
|
|
2402
2438
|
const { interactionVariants: interactionVariants$4, withObservedValues: withObservedValues$3 } = pickAriaComponentVariants(
|
|
2403
2439
|
RADIO_INTERACTION_VARIANTS
|
|
2404
2440
|
);
|
|
2405
2441
|
function BaseRadio(props) {
|
|
2406
|
-
const _a = props, { children, updateInteractionVariant
|
|
2407
|
-
const
|
|
2408
|
-
const radio = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Radio, __spreadValues$9({}, rest), ({ isHovered, isPressed, isFocused, isFocusVisible }) => withObservedValues$3(
|
|
2442
|
+
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$7(_a, ["children", "updateInteractionVariant"]);
|
|
2443
|
+
const radio = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Radio, __spreadValues$9({}, rest), ({ isHovered, isPressed, isFocused, isFocusVisible, isSelected }) => withObservedValues$3(
|
|
2409
2444
|
children,
|
|
2410
2445
|
{
|
|
2411
2446
|
hovered: isHovered,
|
|
2412
2447
|
pressed: isPressed,
|
|
2413
2448
|
focused: isFocused,
|
|
2414
|
-
focusVisible: isFocusVisible
|
|
2449
|
+
focusVisible: isFocusVisible,
|
|
2450
|
+
selected: isSelected
|
|
2415
2451
|
},
|
|
2416
2452
|
updateInteractionVariant
|
|
2417
2453
|
));
|
|
2418
|
-
const isStandalone = !contextProps;
|
|
2419
|
-
setControlContextData == null ? void 0 : setControlContextData({
|
|
2420
|
-
isStandalone
|
|
2421
|
-
});
|
|
2422
2454
|
return /* @__PURE__ */ React__default.default.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.RadioGroup, null, radio) }, radio);
|
|
2423
2455
|
}
|
|
2424
2456
|
const makeDefaultRadioChildren = (label) => ({
|
|
@@ -2476,20 +2508,8 @@ function registerRadio(loader, overrides) {
|
|
|
2476
2508
|
value: {
|
|
2477
2509
|
type: "string",
|
|
2478
2510
|
description: "The value of the input element, used when submitting an HTML form."
|
|
2479
|
-
},
|
|
2480
|
-
onSelectionChange: {
|
|
2481
|
-
type: "eventHandler",
|
|
2482
|
-
argTypes: [{ name: "isSelected", type: "boolean" }]
|
|
2483
2511
|
}
|
|
2484
2512
|
}),
|
|
2485
|
-
states: {
|
|
2486
|
-
isSelected: {
|
|
2487
|
-
type: "readonly",
|
|
2488
|
-
onChangeProp: "onSelectionChange",
|
|
2489
|
-
variableType: "boolean",
|
|
2490
|
-
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
2491
|
-
}
|
|
2492
|
-
},
|
|
2493
2513
|
trapsFocus: true
|
|
2494
2514
|
},
|
|
2495
2515
|
overrides
|
|
@@ -2676,7 +2696,7 @@ function BaseSelect(props) {
|
|
|
2676
2696
|
"aria-label": ariaLabel
|
|
2677
2697
|
} = props;
|
|
2678
2698
|
const { options } = useStrictOptions(props);
|
|
2679
|
-
const
|
|
2699
|
+
const isEditMode = !!host.usePlasmicCanvasContext();
|
|
2680
2700
|
const disabledKeys = flattenOptions(options).filter((op) => op.isDisabled).map((op) => op.id);
|
|
2681
2701
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
2682
2702
|
reactAriaComponents.Select,
|
|
@@ -2690,7 +2710,7 @@ function BaseSelect(props) {
|
|
|
2690
2710
|
style,
|
|
2691
2711
|
name,
|
|
2692
2712
|
"aria-label": ariaLabel
|
|
2693
|
-
},
|
|
2713
|
+
}, isEditMode ? { isOpen: previewOpen } : void 0), extractPlasmicDataProps(props)),
|
|
2694
2714
|
/* @__PURE__ */ React__default.default.createElement(
|
|
2695
2715
|
PlasmicListBoxContext.Provider,
|
|
2696
2716
|
{
|