@plasmicpkgs/react-aria 0.0.82 → 0.0.84
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/react-aria.esm.js +42 -40
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +42 -40
- package/dist/react-aria.js.map +1 -1
- package/package.json +2 -2
- package/skinny/{common-4b974d89.cjs.js → common-1e5dba7d.cjs.js} +2 -2
- package/skinny/common-1e5dba7d.cjs.js.map +1 -0
- package/skinny/{common-1a6affb0.esm.js → common-a8f4a4b1.esm.js} +2 -2
- package/skinny/common-a8f4a4b1.esm.js.map +1 -0
- package/skinny/registerButton.cjs.js +22 -30
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.esm.js +22 -30
- 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 +3 -3
- package/skinny/registerComboBox.esm.js +3 -3
- package/skinny/registerDialogTrigger.cjs.js +2 -2
- package/skinny/registerDialogTrigger.esm.js +2 -2
- package/skinny/registerInput.cjs.js +2 -2
- package/skinny/registerInput.esm.js +2 -2
- package/skinny/registerListBox.cjs.js +1 -1
- package/skinny/registerListBox.esm.js +1 -1
- package/skinny/registerListBoxItem.cjs.js +1 -1
- package/skinny/registerListBoxItem.esm.js +1 -1
- package/skinny/registerModal.cjs.js +7 -7
- package/skinny/registerModal.cjs.js.map +1 -1
- package/skinny/registerModal.esm.js +8 -8
- package/skinny/registerModal.esm.js.map +1 -1
- package/skinny/registerPopover.cjs.js +1 -1
- package/skinny/registerPopover.esm.js +1 -1
- package/skinny/registerRadio.cjs.js +2 -2
- package/skinny/registerRadio.esm.js +2 -2
- 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 +14 -4
- package/skinny/registerSelect.cjs.js.map +1 -1
- package/skinny/registerSelect.esm.js +14 -4
- package/skinny/registerSelect.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 +2 -2
- package/skinny/registerSliderThumb.esm.js +2 -2
- package/skinny/registerSliderTrack.cjs.js +1 -1
- package/skinny/registerSliderTrack.esm.js +1 -1
- package/skinny/registerSwitch.cjs.js +2 -2
- package/skinny/registerSwitch.esm.js +2 -2
- 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/{variant-utils-8cb38f8f.cjs.js → variant-utils-0ad70db8.cjs.js} +5 -5
- package/skinny/{variant-utils-8cb38f8f.cjs.js.map → variant-utils-0ad70db8.cjs.js.map} +1 -1
- package/skinny/{variant-utils-7c2ea202.esm.js → variant-utils-4405ebb0.esm.js} +5 -5
- package/skinny/{variant-utils-7c2ea202.esm.js.map → variant-utils-4405ebb0.esm.js.map} +1 -1
- package/skinny/common-1a6affb0.esm.js.map +0 -1
- package/skinny/common-4b974d89.cjs.js.map +0 -1
package/dist/react-aria.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var host = require('@plasmicapp/host');
|
|
4
3
|
var React = require('react');
|
|
5
4
|
var reactAria = require('react-aria');
|
|
6
5
|
var reactAriaComponents = require('react-aria-components');
|
|
6
|
+
var host = require('@plasmicapp/host');
|
|
7
7
|
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
8
8
|
var utils = require('@react-aria/utils');
|
|
9
9
|
var flattenChildren = require('react-keyed-flatten-children');
|
|
@@ -179,7 +179,7 @@ function createAriaLabelProp(componentName) {
|
|
|
179
179
|
return {
|
|
180
180
|
type: "string",
|
|
181
181
|
displayName: "ARIA label",
|
|
182
|
-
description: `
|
|
182
|
+
description: `Assistive technology uses this if there is no visible label for this ${componentName}`,
|
|
183
183
|
advanced: true,
|
|
184
184
|
hidden: hasParent
|
|
185
185
|
};
|
|
@@ -484,19 +484,19 @@ const ARIA_COMPONENTS_VARIANTS = {
|
|
|
484
484
|
However, data-selectors will consistently indicate the actual placement of the popover/tooltip.
|
|
485
485
|
*/
|
|
486
486
|
placementLeft: {
|
|
487
|
-
cssSelector: "[data-placement
|
|
487
|
+
cssSelector: "[data-placement=left]",
|
|
488
488
|
displayName: "Placement (Left)"
|
|
489
489
|
},
|
|
490
490
|
placementRight: {
|
|
491
|
-
cssSelector: "[data-placement
|
|
491
|
+
cssSelector: "[data-placement=right]",
|
|
492
492
|
displayName: "Placement (Right)"
|
|
493
493
|
},
|
|
494
494
|
placementTop: {
|
|
495
|
-
cssSelector: "[data-placement
|
|
495
|
+
cssSelector: "[data-placement=top]",
|
|
496
496
|
displayName: "Placement (Top)"
|
|
497
497
|
},
|
|
498
498
|
placementBottom: {
|
|
499
|
-
cssSelector: "[data-placement
|
|
499
|
+
cssSelector: "[data-placement=bottom]",
|
|
500
500
|
displayName: "Placement (Bottom)"
|
|
501
501
|
}
|
|
502
502
|
};
|
|
@@ -563,33 +563,25 @@ const BUTTON_VARIANTS = [
|
|
|
563
563
|
"disabled"
|
|
564
564
|
];
|
|
565
565
|
const { variants: variants$f, withObservedValues: withObservedValues$d } = pickAriaComponentVariants(BUTTON_VARIANTS);
|
|
566
|
-
const BaseButton = React__default.default.forwardRef(
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
focused: isFocused,
|
|
586
|
-
focusVisible: isFocusVisible,
|
|
587
|
-
disabled: isDisabled
|
|
588
|
-
},
|
|
589
|
-
plasmicUpdateVariant
|
|
590
|
-
));
|
|
591
|
-
}
|
|
592
|
-
);
|
|
566
|
+
const BaseButton = React__default.default.forwardRef(function BaseButtonInner(props, ref) {
|
|
567
|
+
const _a = props, { submitsForm, resetsForm, children, plasmicUpdateVariant } = _a, rest = __objRest$m(_a, ["submitsForm", "resetsForm", "children", "plasmicUpdateVariant"]);
|
|
568
|
+
const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
|
|
569
|
+
const mergedProps = reactAria.mergeProps(rest, {
|
|
570
|
+
type,
|
|
571
|
+
ref
|
|
572
|
+
});
|
|
573
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues$p({}, mergedProps), ({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) => withObservedValues$d(
|
|
574
|
+
children,
|
|
575
|
+
{
|
|
576
|
+
hovered: isHovered,
|
|
577
|
+
pressed: isPressed,
|
|
578
|
+
focused: isFocused,
|
|
579
|
+
focusVisible: isFocusVisible,
|
|
580
|
+
disabled: isDisabled
|
|
581
|
+
},
|
|
582
|
+
plasmicUpdateVariant
|
|
583
|
+
));
|
|
584
|
+
});
|
|
593
585
|
const BUTTON_COMPONENT_NAME = makeComponentName("button");
|
|
594
586
|
function registerButton(loader, overrides) {
|
|
595
587
|
registerComponentHelper(
|
|
@@ -2467,7 +2459,7 @@ const INLINE_STYLES = {
|
|
|
2467
2459
|
outline: "none"
|
|
2468
2460
|
};
|
|
2469
2461
|
const BaseModal = React.forwardRef(
|
|
2470
|
-
function
|
|
2462
|
+
function BaseModalInner(props, ref) {
|
|
2471
2463
|
var _b, _c, _d;
|
|
2472
2464
|
const _a = props, {
|
|
2473
2465
|
children,
|
|
@@ -2486,6 +2478,8 @@ const BaseModal = React.forwardRef(
|
|
|
2486
2478
|
"setControlContextData",
|
|
2487
2479
|
"isDismissable"
|
|
2488
2480
|
]);
|
|
2481
|
+
const canvasCtx = host.usePlasmicCanvasContext();
|
|
2482
|
+
const isEditMode = canvasCtx && canvasCtx.interactive === false;
|
|
2489
2483
|
const isSelected = (_d = (_c = (_b = host.usePlasmicCanvasComponentInfo) == null ? void 0 : _b(props)) == null ? void 0 : _c.isSelected) != null ? _d : false;
|
|
2490
2484
|
const contextProps = React__default.default.useContext(PlasmicDialogTriggerContext);
|
|
2491
2485
|
const isStandalone = !contextProps;
|
|
@@ -2496,10 +2490,9 @@ const BaseModal = React.forwardRef(
|
|
|
2496
2490
|
1. Clicking anywhere inside the modal dismisses it
|
|
2497
2491
|
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.
|
|
2498
2492
|
|
|
2499
|
-
To fix the above issue, we set an interim isDismissable state to false
|
|
2500
|
-
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.
|
|
2493
|
+
To fix the above issue, we set an interim isDismissable state to false in edit mode, because it only matters in interactive mode.
|
|
2501
2494
|
*/
|
|
2502
|
-
isDismissable:
|
|
2495
|
+
isDismissable: isEditMode ? false : isDismissable
|
|
2503
2496
|
});
|
|
2504
2497
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
2505
2498
|
parent: isStandalone ? void 0 : {}
|
|
@@ -2514,7 +2507,6 @@ const BaseModal = React.forwardRef(
|
|
|
2514
2507
|
(_a2 = mergedProps.onOpenChange) == null ? void 0 : _a2.call(mergedProps, true);
|
|
2515
2508
|
}
|
|
2516
2509
|
}));
|
|
2517
|
-
const isCanvas = host.usePlasmicCanvasContext();
|
|
2518
2510
|
const bodyInCanvas = /* @__PURE__ */ React__default.default.createElement("div", { style: INLINE_STYLES }, children);
|
|
2519
2511
|
const bodyInPreview = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Dialog, { style: INLINE_STYLES }, children);
|
|
2520
2512
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
@@ -2522,7 +2514,7 @@ const BaseModal = React.forwardRef(
|
|
|
2522
2514
|
__spreadProps$8(__spreadValues$c({}, mergedProps), {
|
|
2523
2515
|
className: `${resetClassName} ${modalOverlayClass}`
|
|
2524
2516
|
}),
|
|
2525
|
-
/* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Modal, { className },
|
|
2517
|
+
/* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Modal, { className }, canvasCtx ? bodyInCanvas : bodyInPreview)
|
|
2526
2518
|
);
|
|
2527
2519
|
}
|
|
2528
2520
|
);
|
|
@@ -3065,7 +3057,17 @@ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
|
3065
3057
|
function SelectAutoOpen(props) {
|
|
3066
3058
|
var _a;
|
|
3067
3059
|
const { open, close } = (_a = React__default.default.useContext(reactAriaComponents.SelectStateContext)) != null ? _a : {};
|
|
3068
|
-
useAutoOpen({
|
|
3060
|
+
useAutoOpen({
|
|
3061
|
+
props,
|
|
3062
|
+
open: () => {
|
|
3063
|
+
open == null ? void 0 : open();
|
|
3064
|
+
setTimeout(() => {
|
|
3065
|
+
var _a2, _b;
|
|
3066
|
+
(_b = (_a2 = window.parent.document.activeElement) == null ? void 0 : _a2.blur) == null ? void 0 : _b.call(_a2);
|
|
3067
|
+
});
|
|
3068
|
+
},
|
|
3069
|
+
close
|
|
3070
|
+
});
|
|
3069
3071
|
return null;
|
|
3070
3072
|
}
|
|
3071
3073
|
const BaseSelectValue = (props) => {
|