@plasmicpkgs/react-aria 0.0.67 → 0.0.68
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 +55 -25
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +55 -25
- package/dist/react-aria.js.map +1 -1
- package/dist/registerPopover.d.ts +5 -1
- package/package.json +2 -2
- 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 +1 -1
- package/skinny/registerComboBox.esm.js +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.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/registerPopover.cjs.js +36 -11
- package/skinny/registerPopover.cjs.js.map +1 -1
- package/skinny/registerPopover.d.ts +5 -1
- package/skinny/registerPopover.esm.js +36 -11
- 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/registerSelect.cjs.js +1 -1
- package/skinny/registerSelect.esm.js +1 -1
- package/skinny/registerSlider.cjs.js +1 -1
- package/skinny/registerSlider.esm.js +1 -1
- 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 +1 -1
- package/skinny/registerSliderTrack.esm.js +1 -1
- package/skinny/registerSwitch.cjs.js +1 -1
- package/skinny/registerSwitch.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.cjs.js.map +1 -1
- package/skinny/registerTooltip.esm.js +1 -1
- package/skinny/registerTooltip.esm.js.map +1 -1
- package/skinny/{variant-utils-5f90385f.esm.js → variant-utils-7c2ea202.esm.js} +7 -1
- package/skinny/variant-utils-7c2ea202.esm.js.map +1 -0
- package/skinny/{variant-utils-6c6ef452.cjs.js → variant-utils-8cb38f8f.cjs.js} +7 -1
- package/skinny/variant-utils-8cb38f8f.cjs.js.map +1 -0
- package/skinny/variant-utils-5f90385f.esm.js.map +0 -1
- package/skinny/variant-utils-6c6ef452.cjs.js.map +0 -1
package/dist/react-aria.esm.js
CHANGED
|
@@ -450,6 +450,12 @@ const ARIA_COMPONENTS_VARIANTS = {
|
|
|
450
450
|
cssSelector: "[data-indeterminate]",
|
|
451
451
|
displayName: "Indeterminate"
|
|
452
452
|
},
|
|
453
|
+
/*
|
|
454
|
+
NOTE: Placement should be managed as variants, not just props.
|
|
455
|
+
When `shouldFlip` is true, the placement prop may not represent the final position
|
|
456
|
+
(e.g., if placement is set to "bottom" but lacks space, the popover/tooltip may flip to "top").
|
|
457
|
+
However, data-selectors will consistently indicate the actual placement of the popover/tooltip.
|
|
458
|
+
*/
|
|
453
459
|
placementLeft: {
|
|
454
460
|
cssSelector: "[data-placement]=left",
|
|
455
461
|
displayName: "Placement (Left)"
|
|
@@ -529,12 +535,12 @@ const BUTTON_VARIANTS = [
|
|
|
529
535
|
"focusVisible",
|
|
530
536
|
"disabled"
|
|
531
537
|
];
|
|
532
|
-
const { variants: variants$
|
|
538
|
+
const { variants: variants$f, withObservedValues: withObservedValues$d } = pickAriaComponentVariants(BUTTON_VARIANTS);
|
|
533
539
|
const BaseButton = React.forwardRef(
|
|
534
540
|
(props, ref) => {
|
|
535
541
|
const _a = props, { submitsForm, resetsForm, children, plasmicUpdateVariant } = _a, rest = __objRest$n(_a, ["submitsForm", "resetsForm", "children", "plasmicUpdateVariant"]);
|
|
536
542
|
const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
|
|
537
|
-
return /* @__PURE__ */ React.createElement(Button, __spreadValues$q({ type, ref }, rest), ({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) => withObservedValues$
|
|
543
|
+
return /* @__PURE__ */ React.createElement(Button, __spreadValues$q({ type, ref }, rest), ({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) => withObservedValues$d(
|
|
538
544
|
children,
|
|
539
545
|
{
|
|
540
546
|
hovered: isHovered,
|
|
@@ -557,7 +563,7 @@ function registerButton(loader, overrides) {
|
|
|
557
563
|
displayName: "Aria Button",
|
|
558
564
|
importPath: "@plasmicpkgs/react-aria/skinny/registerButton",
|
|
559
565
|
importName: "BaseButton",
|
|
560
|
-
variants: variants$
|
|
566
|
+
variants: variants$f,
|
|
561
567
|
defaultStyles: {
|
|
562
568
|
borderWidth: "1px",
|
|
563
569
|
borderStyle: "solid",
|
|
@@ -658,7 +664,7 @@ const CHECKBOX_VARIANTS = [
|
|
|
658
664
|
"readonly",
|
|
659
665
|
"selected"
|
|
660
666
|
];
|
|
661
|
-
const { variants: variants$
|
|
667
|
+
const { variants: variants$e, withObservedValues: withObservedValues$c } = pickAriaComponentVariants(CHECKBOX_VARIANTS);
|
|
662
668
|
function BaseCheckbox(props) {
|
|
663
669
|
const _a = props, { children, plasmicUpdateVariant, setControlContextData } = _a, rest = __objRest$m(_a, ["children", "plasmicUpdateVariant", "setControlContextData"]);
|
|
664
670
|
const contextProps = React.useContext(PlasmicCheckboxGroupContext);
|
|
@@ -674,7 +680,7 @@ function BaseCheckbox(props) {
|
|
|
674
680
|
isIndeterminate,
|
|
675
681
|
isSelected,
|
|
676
682
|
isReadOnly
|
|
677
|
-
}) => withObservedValues$
|
|
683
|
+
}) => withObservedValues$c(
|
|
678
684
|
children,
|
|
679
685
|
{
|
|
680
686
|
hovered: isHovered,
|
|
@@ -744,7 +750,7 @@ function registerCheckbox(loader, overrides) {
|
|
|
744
750
|
displayName: "Aria Checkbox",
|
|
745
751
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
|
|
746
752
|
importName: "BaseCheckbox",
|
|
747
|
-
variants: variants$
|
|
753
|
+
variants: variants$e,
|
|
748
754
|
props: __spreadProps$f(__spreadValues$p({}, getCommonProps("checkbox", [
|
|
749
755
|
"name",
|
|
750
756
|
"isDisabled",
|
|
@@ -1169,12 +1175,12 @@ var __objRest$i = (source, exclude) => {
|
|
|
1169
1175
|
return target;
|
|
1170
1176
|
};
|
|
1171
1177
|
const CHECKBOX_GROUP_VARIANTS = ["disabled", "readonly"];
|
|
1172
|
-
const { variants: variants$
|
|
1178
|
+
const { variants: variants$d, withObservedValues: withObservedValues$b } = pickAriaComponentVariants(
|
|
1173
1179
|
CHECKBOX_GROUP_VARIANTS
|
|
1174
1180
|
);
|
|
1175
1181
|
function BaseCheckboxGroup(props) {
|
|
1176
1182
|
const _a = props, { children, plasmicUpdateVariant } = _a, rest = __objRest$i(_a, ["children", "plasmicUpdateVariant"]);
|
|
1177
|
-
return /* @__PURE__ */ React.createElement(PlasmicCheckboxGroupContext.Provider, { value: rest }, /* @__PURE__ */ React.createElement(CheckboxGroup, __spreadValues$k({}, rest), ({ isDisabled, isReadOnly }) => withObservedValues$
|
|
1183
|
+
return /* @__PURE__ */ React.createElement(PlasmicCheckboxGroupContext.Provider, { value: rest }, /* @__PURE__ */ React.createElement(CheckboxGroup, __spreadValues$k({}, rest), ({ isDisabled, isReadOnly }) => withObservedValues$b(
|
|
1178
1184
|
children,
|
|
1179
1185
|
{
|
|
1180
1186
|
disabled: isDisabled,
|
|
@@ -1202,7 +1208,7 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
1202
1208
|
displayName: "Aria Checkbox Group",
|
|
1203
1209
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckboxGroup",
|
|
1204
1210
|
importName: "BaseCheckboxGroup",
|
|
1205
|
-
variants: variants$
|
|
1211
|
+
variants: variants$d,
|
|
1206
1212
|
props: __spreadProps$b(__spreadValues$k({}, getCommonProps("checkbox group", [
|
|
1207
1213
|
"name",
|
|
1208
1214
|
"isDisabled",
|
|
@@ -1401,7 +1407,7 @@ const INPUT_VARIANTS = [
|
|
|
1401
1407
|
"hovered",
|
|
1402
1408
|
"disabled"
|
|
1403
1409
|
];
|
|
1404
|
-
const { variants: variants$
|
|
1410
|
+
const { variants: variants$c } = pickAriaComponentVariants(INPUT_VARIANTS);
|
|
1405
1411
|
const inputHelpers$1 = {
|
|
1406
1412
|
states: {
|
|
1407
1413
|
value: {
|
|
@@ -1482,7 +1488,7 @@ function registerInput(loader, overrides) {
|
|
|
1482
1488
|
displayName: "Aria Input",
|
|
1483
1489
|
importPath: "@plasmicpkgs/react-aria/skinny/registerInput",
|
|
1484
1490
|
importName: "BaseInput",
|
|
1485
|
-
variants: variants$
|
|
1491
|
+
variants: variants$c,
|
|
1486
1492
|
defaultStyles: {
|
|
1487
1493
|
width: "300px",
|
|
1488
1494
|
borderWidth: "1px",
|
|
@@ -1574,7 +1580,7 @@ const LIST_BOX_ITEM_VARIANTS = [
|
|
|
1574
1580
|
"selected",
|
|
1575
1581
|
"disabled"
|
|
1576
1582
|
];
|
|
1577
|
-
const { variants: variants$
|
|
1583
|
+
const { variants: variants$b, withObservedValues: withObservedValues$a } = pickAriaComponentVariants(
|
|
1578
1584
|
LIST_BOX_ITEM_VARIANTS
|
|
1579
1585
|
);
|
|
1580
1586
|
function BaseListBoxItem(props) {
|
|
@@ -1617,7 +1623,7 @@ function BaseListBoxItem(props) {
|
|
|
1617
1623
|
isFocusVisible,
|
|
1618
1624
|
isSelected,
|
|
1619
1625
|
isDisabled
|
|
1620
|
-
}) => withObservedValues$
|
|
1626
|
+
}) => withObservedValues$a(
|
|
1621
1627
|
children,
|
|
1622
1628
|
{
|
|
1623
1629
|
hovered: isHovered,
|
|
@@ -1680,7 +1686,7 @@ function registerListBoxItem(loader, overrides) {
|
|
|
1680
1686
|
displayName: "Aria ListBoxItem",
|
|
1681
1687
|
importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
|
|
1682
1688
|
importName: "BaseListBoxItem",
|
|
1683
|
-
variants: variants$
|
|
1689
|
+
variants: variants$b,
|
|
1684
1690
|
props: {
|
|
1685
1691
|
id: {
|
|
1686
1692
|
type: "string",
|
|
@@ -2070,14 +2076,29 @@ var __objRest$d = (source, exclude) => {
|
|
|
2070
2076
|
}
|
|
2071
2077
|
return target;
|
|
2072
2078
|
};
|
|
2079
|
+
const POPOVER_VARIANTS = [
|
|
2080
|
+
"placementTop",
|
|
2081
|
+
"placementBottom",
|
|
2082
|
+
"placementLeft",
|
|
2083
|
+
"placementRight"
|
|
2084
|
+
];
|
|
2085
|
+
const { variants: variants$a, withObservedValues: withObservedValues$9 } = pickAriaComponentVariants(POPOVER_VARIANTS);
|
|
2073
2086
|
function BasePopover(props) {
|
|
2074
|
-
var
|
|
2075
|
-
const _a = props, {
|
|
2087
|
+
var _c;
|
|
2088
|
+
const _a = props, {
|
|
2089
|
+
resetClassName,
|
|
2090
|
+
setControlContextData,
|
|
2091
|
+
plasmicUpdateVariant
|
|
2092
|
+
} = _a, restProps = __objRest$d(_a, [
|
|
2093
|
+
"resetClassName",
|
|
2094
|
+
"setControlContextData",
|
|
2095
|
+
"plasmicUpdateVariant"
|
|
2096
|
+
]);
|
|
2076
2097
|
const isStandalone = !React.useContext(PopoverContext);
|
|
2077
2098
|
const context = React.useContext(PlasmicPopoverContext);
|
|
2078
2099
|
const triggerRef = React.useRef(null);
|
|
2079
2100
|
const isEditMode = !!usePlasmicCanvasContext();
|
|
2080
|
-
const
|
|
2101
|
+
const _b = mergeProps$1(
|
|
2081
2102
|
{
|
|
2082
2103
|
isOpen: context == null ? void 0 : context.isOpen,
|
|
2083
2104
|
shouldFlip: context == null ? void 0 : context.defaultShouldFlip
|
|
@@ -2100,11 +2121,20 @@ function BasePopover(props) {
|
|
|
2100
2121
|
* */
|
|
2101
2122
|
isOpen: true
|
|
2102
2123
|
} : null
|
|
2103
|
-
);
|
|
2124
|
+
), { children } = _b, mergedProps = __objRest$d(_b, ["children"]);
|
|
2104
2125
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
2105
|
-
defaultShouldFlip: (
|
|
2126
|
+
defaultShouldFlip: (_c = context == null ? void 0 : context.defaultShouldFlip) != null ? _c : true
|
|
2106
2127
|
});
|
|
2107
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(Popover, __spreadValues$f({}, mergedProps))
|
|
2128
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(Popover, __spreadValues$f({}, mergedProps), ({ placement }) => withObservedValues$9(
|
|
2129
|
+
children,
|
|
2130
|
+
{
|
|
2131
|
+
placementTop: placement === "top",
|
|
2132
|
+
placementBottom: placement === "bottom",
|
|
2133
|
+
placementLeft: placement === "left",
|
|
2134
|
+
placementRight: placement === "right"
|
|
2135
|
+
},
|
|
2136
|
+
plasmicUpdateVariant
|
|
2137
|
+
)));
|
|
2108
2138
|
}
|
|
2109
2139
|
const POPOVER_COMPONENT_NAME = makeComponentName("popover");
|
|
2110
2140
|
const POPOVER_ARROW_IMG = {
|
|
@@ -2128,6 +2158,7 @@ function registerPopover(loader, overrides) {
|
|
|
2128
2158
|
displayName: "Aria Popover",
|
|
2129
2159
|
importPath: "@plasmicpkgs/react-aria/skinny/registerPopover",
|
|
2130
2160
|
importName: "BasePopover",
|
|
2161
|
+
variants: variants$a,
|
|
2131
2162
|
defaultStyles: {
|
|
2132
2163
|
borderWidth: "1px",
|
|
2133
2164
|
borderStyle: "solid",
|
|
@@ -2185,12 +2216,11 @@ function registerPopover(loader, overrides) {
|
|
|
2185
2216
|
description: "Default placement of the popover relative to the trigger, if there is enough space",
|
|
2186
2217
|
defaultValueHint: "bottom",
|
|
2187
2218
|
options: [
|
|
2188
|
-
|
|
2189
|
-
"bottom left",
|
|
2190
|
-
"bottom right",
|
|
2219
|
+
// Not allowing other placement options here because of https://github.com/adobe/react-spectrum/issues/6825
|
|
2191
2220
|
"top",
|
|
2192
|
-
"
|
|
2193
|
-
"
|
|
2221
|
+
"bottom",
|
|
2222
|
+
"left",
|
|
2223
|
+
"right"
|
|
2194
2224
|
]
|
|
2195
2225
|
},
|
|
2196
2226
|
resetClassName: {
|