@plasmicpkgs/react-aria 0.0.113 → 0.0.115
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 +156 -61
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +155 -60
- package/dist/react-aria.js.map +1 -1
- package/dist/registerInput.d.ts +2 -2
- package/dist/registerTextArea.d.ts +2 -2
- package/dist/utils.d.ts +21 -2
- package/package.json +2 -2
- package/skinny/{common-b3b54c72.cjs.js → common-45acb83c.cjs.js} +2 -2
- package/skinny/{common-b3b54c72.cjs.js.map → common-45acb83c.cjs.js.map} +1 -1
- package/skinny/{common-ceebbaea.esm.js → common-616eb178.esm.js} +2 -2
- package/skinny/{common-ceebbaea.esm.js.map → common-616eb178.esm.js.map} +1 -1
- package/skinny/contexts.d.ts +1 -1
- package/skinny/registerButton.cjs.js +2 -2
- package/skinny/registerButton.esm.js +2 -2
- package/skinny/registerButton.stories.cjs.js +2 -2
- package/skinny/registerButton.stories.esm.js +2 -2
- 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/registerCheckboxGroup.stories.cjs.js +2 -2
- package/skinny/registerCheckboxGroup.stories.esm.js +2 -2
- package/skinny/registerComboBox.cjs.js +3 -3
- package/skinny/registerComboBox.esm.js +3 -3
- package/skinny/registerComboBox.stories.cjs.js +3 -3
- package/skinny/registerComboBox.stories.esm.js +3 -3
- package/skinny/registerDescription.cjs.js +2 -2
- package/skinny/registerDescription.esm.js +2 -2
- package/skinny/registerDialog.cjs.js +2 -2
- package/skinny/registerDialog.esm.js +2 -2
- package/skinny/registerDialogTrigger.cjs.js +10 -8
- package/skinny/registerDialogTrigger.cjs.js.map +1 -1
- package/skinny/registerDialogTrigger.esm.js +10 -8
- package/skinny/registerDialogTrigger.esm.js.map +1 -1
- package/skinny/registerDialogTrigger.stories.cjs.js +7 -2
- package/skinny/registerDialogTrigger.stories.cjs.js.map +1 -1
- package/skinny/registerDialogTrigger.stories.esm.js +8 -3
- package/skinny/registerDialogTrigger.stories.esm.js.map +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/registerHeading.cjs.js +2 -2
- package/skinny/registerHeading.esm.js +2 -2
- package/skinny/registerInput.cjs.js +43 -21
- package/skinny/registerInput.cjs.js.map +1 -1
- package/skinny/registerInput.d.ts +2 -2
- package/skinny/registerInput.esm.js +46 -24
- package/skinny/registerInput.esm.js.map +1 -1
- package/skinny/registerLabel.cjs.js +2 -2
- package/skinny/registerLabel.esm.js +2 -2
- package/skinny/{registerListBox-a99736df.cjs.js → registerListBox-040b0374.cjs.js} +3 -3
- package/skinny/{registerListBox-a99736df.cjs.js.map → registerListBox-040b0374.cjs.js.map} +1 -1
- package/skinny/{registerListBox-49626f55.esm.js → registerListBox-21dc99fa.esm.js} +3 -3
- package/skinny/{registerListBox-49626f55.esm.js.map → registerListBox-21dc99fa.esm.js.map} +1 -1
- package/skinny/registerListBox.cjs.js +3 -3
- package/skinny/registerListBox.esm.js +3 -3
- package/skinny/registerListBoxItem.cjs.js +2 -2
- package/skinny/registerListBoxItem.esm.js +2 -2
- package/skinny/registerListbox.stories.cjs.js +3 -3
- package/skinny/registerListbox.stories.esm.js +3 -3
- package/skinny/registerModal.cjs.js +18 -14
- package/skinny/registerModal.cjs.js.map +1 -1
- package/skinny/registerModal.esm.js +19 -15
- package/skinny/registerModal.esm.js.map +1 -1
- package/skinny/registerModal.stories.cjs.js +2 -2
- package/skinny/registerModal.stories.esm.js +2 -2
- package/skinny/registerOverlayArrow.cjs.js +2 -2
- package/skinny/registerOverlayArrow.esm.js +2 -2
- package/skinny/registerPopover.cjs.js +2 -2
- package/skinny/registerPopover.esm.js +2 -2
- package/skinny/registerPopover.stories.cjs.js +2 -2
- package/skinny/registerPopover.stories.esm.js +2 -2
- 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/registerRadioGroup.stories.cjs.js +2 -2
- package/skinny/registerRadioGroup.stories.esm.js +2 -2
- package/skinny/registerSection.cjs.js +3 -3
- package/skinny/registerSection.esm.js +3 -3
- package/skinny/registerSelect.cjs.js +3 -3
- package/skinny/registerSelect.esm.js +3 -3
- package/skinny/registerSelect.stories.cjs.js +3 -3
- package/skinny/registerSelect.stories.esm.js +3 -3
- package/skinny/registerSlider.cjs.js +2 -2
- package/skinny/registerSlider.esm.js +2 -2
- package/skinny/registerSlider.stories.cjs.js +2 -2
- package/skinny/registerSlider.stories.esm.js +2 -2
- package/skinny/registerSliderOutput.cjs.js +2 -2
- package/skinny/registerSliderOutput.esm.js +2 -2
- package/skinny/registerSliderThumb.cjs.js +2 -2
- package/skinny/registerSliderThumb.esm.js +2 -2
- package/skinny/registerSliderTrack.cjs.js +2 -2
- package/skinny/registerSliderTrack.esm.js +2 -2
- package/skinny/registerSwitch.cjs.js +2 -2
- package/skinny/registerSwitch.esm.js +2 -2
- package/skinny/registerSwitch.stories.cjs.js +2 -2
- package/skinny/registerSwitch.stories.esm.js +2 -2
- package/skinny/registerText.cjs.js +2 -2
- package/skinny/registerText.esm.js +2 -2
- package/skinny/registerTextArea.cjs.js +49 -19
- package/skinny/registerTextArea.cjs.js.map +1 -1
- package/skinny/registerTextArea.d.ts +2 -2
- package/skinny/registerTextArea.esm.js +52 -22
- package/skinny/registerTextArea.esm.js.map +1 -1
- package/skinny/registerTextField-common-stories.cjs.js +2 -2
- package/skinny/registerTextField-common-stories.esm.js +2 -2
- package/skinny/registerTextField-input.stories.cjs.js +2 -2
- package/skinny/registerTextField-input.stories.esm.js +2 -2
- package/skinny/registerTextField-textarea.stories.cjs.js +2 -2
- package/skinny/registerTextField-textarea.stories.esm.js +2 -2
- package/skinny/registerTextField.cjs.js +2 -2
- package/skinny/registerTextField.esm.js +2 -2
- package/skinny/registerTooltip.cjs.js +12 -10
- package/skinny/registerTooltip.cjs.js.map +1 -1
- package/skinny/registerTooltip.esm.js +12 -10
- package/skinny/registerTooltip.esm.js.map +1 -1
- package/skinny/registerTooltip.stories.cjs.js +2 -2
- package/skinny/registerTooltip.stories.esm.js +2 -2
- package/skinny/{utils-7d000fa4.cjs.js → utils-fc1ddd7c.cjs.js} +38 -1
- package/skinny/utils-fc1ddd7c.cjs.js.map +1 -0
- package/skinny/{utils-5d1b4c6b.esm.js → utils-fd88ad47.esm.js} +37 -2
- package/skinny/utils-fd88ad47.esm.js.map +1 -0
- package/skinny/utils.d.ts +21 -2
- package/skinny/utils-5d1b4c6b.esm.js.map +0 -1
- package/skinny/utils-7d000fa4.cjs.js.map +0 -1
package/dist/contexts.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export declare const PlasmicListBoxContext: React.Context<{
|
|
|
17
17
|
idManager: OptionsItemIdManager;
|
|
18
18
|
} | undefined>;
|
|
19
19
|
export declare const PlasmicSectionContext: React.Context<import("./registerSection").BaseSectionProps | undefined>;
|
|
20
|
-
export declare const PlasmicInputContext: React.Context<import("./registerInput").BaseInputProps | undefined>;
|
|
20
|
+
export declare const PlasmicInputContext: React.Context<(import("./registerInput").BaseInputProps & React.RefAttributes<HTMLInputElement>) | undefined>;
|
package/dist/react-aria.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { usePlasmicCanvasContext, usePlasmicCanvasComponentInfo, usePlasmicLink } from '@plasmicapp/host';
|
|
2
2
|
import React, { useEffect, useState, useMemo, useCallback, forwardRef, useImperativeHandle, Component, useRef, useId } from 'react';
|
|
3
3
|
import { mergeProps, useLink, useHover, useFocusRing, useButton, useFocusWithin } from 'react-aria';
|
|
4
|
-
import { Button, Checkbox, Text, Label, CheckboxGroup,
|
|
4
|
+
import { Button, Checkbox, Text, Label, CheckboxGroup, useContextProps, InputContext, ListBoxItem, ListBox, Section, Header, PopoverContext, Popover, ComboBox, ComboBoxStateContext, Dialog, ModalOverlay, Modal, DialogTrigger, Heading, TooltipContext, OverlayArrow, Radio, RadioGroup, Select, SelectStateContext, SelectValue, SliderOutput, SliderThumb, Slider, SliderTrack, Switch, TextAreaContext, TextField, Provider, TooltipTriggerStateContext, Tooltip } from 'react-aria-components';
|
|
5
5
|
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
6
6
|
import { mergeProps as mergeProps$1 } from '@react-aria/utils';
|
|
7
7
|
import flattenChildren from 'react-keyed-flatten-children';
|
|
@@ -26,6 +26,33 @@ var __spreadValues$s = (a, b) => {
|
|
|
26
26
|
return a;
|
|
27
27
|
};
|
|
28
28
|
var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
|
|
29
|
+
var __objRest$o = (source, exclude) => {
|
|
30
|
+
var target = {};
|
|
31
|
+
for (var prop in source)
|
|
32
|
+
if (__hasOwnProp$s.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
if (source != null && __getOwnPropSymbols$s)
|
|
35
|
+
for (var prop of __getOwnPropSymbols$s(source)) {
|
|
36
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$s.call(source, prop))
|
|
37
|
+
target[prop] = source[prop];
|
|
38
|
+
}
|
|
39
|
+
return target;
|
|
40
|
+
};
|
|
41
|
+
function useIsOpen({
|
|
42
|
+
triggerSlotName,
|
|
43
|
+
isOpen,
|
|
44
|
+
__plasmic_selection_prop__
|
|
45
|
+
}) {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
const canvasContext = usePlasmicCanvasContext();
|
|
48
|
+
const { isSelected, selectedSlotName } = (_b = (_a = usePlasmicCanvasComponentInfo) == null ? void 0 : _a({ __plasmic_selection_prop__ })) != null ? _b : {};
|
|
49
|
+
if (!canvasContext) {
|
|
50
|
+
return isOpen;
|
|
51
|
+
}
|
|
52
|
+
const isTriggerSlotSelected = isDefined(selectedSlotName) && selectedSlotName === triggerSlotName;
|
|
53
|
+
const isAutoOpenedBySelection = isSelected && !isTriggerSlotSelected;
|
|
54
|
+
return Boolean(isAutoOpenedBySelection || isOpen);
|
|
55
|
+
}
|
|
29
56
|
function useAutoOpen({
|
|
30
57
|
props,
|
|
31
58
|
open,
|
|
@@ -84,6 +111,14 @@ function extractPlasmicDataProps(props) {
|
|
|
84
111
|
function isDefined(thing) {
|
|
85
112
|
return thing !== void 0 && thing !== null;
|
|
86
113
|
}
|
|
114
|
+
function filterHoverProps(props) {
|
|
115
|
+
const _a = props, otherProps = __objRest$o(_a, [
|
|
116
|
+
"onHoverStart",
|
|
117
|
+
"onHoverChange",
|
|
118
|
+
"onHoverEnd"
|
|
119
|
+
]);
|
|
120
|
+
return otherProps;
|
|
121
|
+
}
|
|
87
122
|
|
|
88
123
|
var __defProp$r = Object.defineProperty;
|
|
89
124
|
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
@@ -1525,14 +1560,14 @@ const inputHelpers$1 = {
|
|
|
1525
1560
|
}
|
|
1526
1561
|
}
|
|
1527
1562
|
};
|
|
1528
|
-
function
|
|
1563
|
+
function BaseInput_(props, ref) {
|
|
1529
1564
|
const _a = props, {
|
|
1530
1565
|
plasmicUpdateVariant,
|
|
1531
1566
|
setControlContextData,
|
|
1532
1567
|
autoComplete,
|
|
1533
1568
|
value,
|
|
1534
1569
|
className
|
|
1535
|
-
} = _a,
|
|
1570
|
+
} = _a, restProps = __objRest$i(_a, [
|
|
1536
1571
|
"plasmicUpdateVariant",
|
|
1537
1572
|
"setControlContextData",
|
|
1538
1573
|
"autoComplete",
|
|
@@ -1541,33 +1576,55 @@ function BaseInput(props) {
|
|
|
1541
1576
|
]);
|
|
1542
1577
|
const textFieldContext = React.useContext(PlasmicTextFieldContext);
|
|
1543
1578
|
const context = React.useContext(PlasmicInputContext);
|
|
1579
|
+
const [inputContextProps, inputRef] = useContextProps(
|
|
1580
|
+
restProps,
|
|
1581
|
+
ref,
|
|
1582
|
+
InputContext
|
|
1583
|
+
);
|
|
1584
|
+
const { hoverProps, isHovered } = useHover(props);
|
|
1585
|
+
const { isFocused, isFocusVisible, focusProps } = useFocusRing({
|
|
1586
|
+
isTextInput: true,
|
|
1587
|
+
autoFocus: inputContextProps.autoFocus
|
|
1588
|
+
});
|
|
1589
|
+
const mergedProps = mergeProps(
|
|
1590
|
+
filterHoverProps(inputContextProps),
|
|
1591
|
+
focusProps,
|
|
1592
|
+
hoverProps,
|
|
1593
|
+
{
|
|
1594
|
+
style: COMMON_STYLES,
|
|
1595
|
+
value: (context == null ? void 0 : context.isUncontrolled) ? void 0 : value,
|
|
1596
|
+
autoComplete: resolveAutoComplete(autoComplete),
|
|
1597
|
+
className
|
|
1598
|
+
}
|
|
1599
|
+
);
|
|
1600
|
+
const isDisabled = mergedProps.disabled || false;
|
|
1601
|
+
const isInvalid = !!mergedProps["aria-invalid"] && mergedProps["aria-invalid"] !== "false";
|
|
1544
1602
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
1545
1603
|
parent: textFieldContext
|
|
1546
1604
|
});
|
|
1547
|
-
|
|
1548
|
-
({
|
|
1549
|
-
|
|
1550
|
-
isFocusVisible,
|
|
1551
|
-
isFocused,
|
|
1552
|
-
isHovered
|
|
1553
|
-
}) => {
|
|
1554
|
-
plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
|
|
1605
|
+
useEffect(() => {
|
|
1606
|
+
if (plasmicUpdateVariant) {
|
|
1607
|
+
plasmicUpdateVariant({
|
|
1555
1608
|
disabled: isDisabled,
|
|
1556
1609
|
focused: isFocused,
|
|
1557
1610
|
focusVisible: isFocusVisible,
|
|
1558
1611
|
hovered: isHovered
|
|
1559
1612
|
});
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1613
|
+
}
|
|
1614
|
+
}, [isFocused, isFocusVisible, isHovered, isDisabled, plasmicUpdateVariant]);
|
|
1615
|
+
return /* @__PURE__ */ React.createElement(
|
|
1616
|
+
"input",
|
|
1617
|
+
__spreadProps$g(__spreadValues$k({}, mergedProps), {
|
|
1618
|
+
ref: inputRef,
|
|
1619
|
+
"data-focused": isFocused || void 0,
|
|
1620
|
+
"data-disabled": isDisabled || void 0,
|
|
1621
|
+
"data-hovered": isHovered || void 0,
|
|
1622
|
+
"data-focus-visible": isFocusVisible || void 0,
|
|
1623
|
+
"data-invalid": isInvalid || void 0
|
|
1624
|
+
})
|
|
1563
1625
|
);
|
|
1564
|
-
const mergedProps = mergeProps(rest, {
|
|
1565
|
-
value: (context == null ? void 0 : context.isUncontrolled) ? void 0 : value,
|
|
1566
|
-
autoComplete: resolveAutoComplete(autoComplete),
|
|
1567
|
-
className: classNameProp
|
|
1568
|
-
});
|
|
1569
|
-
return /* @__PURE__ */ React.createElement(Input, __spreadProps$g(__spreadValues$k({}, mergedProps), { style: COMMON_STYLES }));
|
|
1570
1626
|
}
|
|
1627
|
+
const BaseInput = React.forwardRef(BaseInput_);
|
|
1571
1628
|
const INPUT_COMPONENT_NAME = makeComponentName("input");
|
|
1572
1629
|
function registerInput(loader, overrides) {
|
|
1573
1630
|
registerComponentHelper(
|
|
@@ -2630,7 +2687,6 @@ var __objRest$c = (source, exclude) => {
|
|
|
2630
2687
|
};
|
|
2631
2688
|
const BaseModal = forwardRef(
|
|
2632
2689
|
function BaseModalInner(props, ref) {
|
|
2633
|
-
var _b, _c, _d;
|
|
2634
2690
|
const _a = props, {
|
|
2635
2691
|
children,
|
|
2636
2692
|
modalOverlayClass,
|
|
@@ -2638,7 +2694,9 @@ const BaseModal = forwardRef(
|
|
|
2638
2694
|
isOpen,
|
|
2639
2695
|
resetClassName,
|
|
2640
2696
|
setControlContextData,
|
|
2641
|
-
isDismissable
|
|
2697
|
+
isDismissable,
|
|
2698
|
+
defaultOpen,
|
|
2699
|
+
__plasmic_selection_prop__
|
|
2642
2700
|
} = _a, rest = __objRest$c(_a, [
|
|
2643
2701
|
"children",
|
|
2644
2702
|
"modalOverlayClass",
|
|
@@ -2646,22 +2704,24 @@ const BaseModal = forwardRef(
|
|
|
2646
2704
|
"isOpen",
|
|
2647
2705
|
"resetClassName",
|
|
2648
2706
|
"setControlContextData",
|
|
2649
|
-
"isDismissable"
|
|
2707
|
+
"isDismissable",
|
|
2708
|
+
"defaultOpen",
|
|
2709
|
+
"__plasmic_selection_prop__"
|
|
2650
2710
|
]);
|
|
2651
2711
|
const canvasCtx = usePlasmicCanvasContext();
|
|
2652
2712
|
const isEditMode = canvasCtx && canvasCtx.interactive === false;
|
|
2653
|
-
const isSelected = (_d = (_c = (_b = usePlasmicCanvasComponentInfo) == null ? void 0 : _b(props)) == null ? void 0 : _c.isSelected) != null ? _d : false;
|
|
2654
2713
|
const contextProps = React.useContext(PlasmicDialogTriggerContext);
|
|
2655
2714
|
const isStandalone = !contextProps;
|
|
2715
|
+
const isOpen2 = useIsOpen({ isOpen, __plasmic_selection_prop__ });
|
|
2656
2716
|
const mergedProps = mergeProps(rest, {
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2717
|
+
// Since open/defaultOpen props are hidden when the modal is inside dialogTrigger, we also unset them here.
|
|
2718
|
+
isOpen: isStandalone ? isOpen2 : void 0,
|
|
2719
|
+
defaultOpen: isStandalone ? defaultOpen : void 0,
|
|
2720
|
+
// isDismissable on canvas (non-interactive mode) causes the following two issues:
|
|
2721
|
+
// 1. Clicking anywhere inside the modal dismisses it
|
|
2722
|
+
// 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.
|
|
2723
|
+
//
|
|
2724
|
+
// To fix the above issue, we set an interim isDismissable state to false in edit mode, because it only matters in interactive mode.
|
|
2665
2725
|
isDismissable: isEditMode ? false : isDismissable
|
|
2666
2726
|
});
|
|
2667
2727
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
@@ -2767,6 +2827,7 @@ function registerModal(loader, overrides) {
|
|
|
2767
2827
|
type: "boolean",
|
|
2768
2828
|
editOnly: true,
|
|
2769
2829
|
uncontrolledProp: "defaultOpen",
|
|
2830
|
+
// standalone Modals should default to open so that they are visible when inserted
|
|
2770
2831
|
defaultValueHint: true,
|
|
2771
2832
|
defaultValue: true,
|
|
2772
2833
|
hidden: hasParent
|
|
@@ -2845,12 +2906,14 @@ function TriggerWrapper$1({ children, className }) {
|
|
|
2845
2906
|
return /* @__PURE__ */ React.createElement("div", __spreadValues$d({}, mergedProps), children);
|
|
2846
2907
|
}
|
|
2847
2908
|
function BaseDialogTrigger(props) {
|
|
2848
|
-
|
|
2849
|
-
const
|
|
2850
|
-
|
|
2851
|
-
|
|
2909
|
+
const _a = props, { trigger, dialog, isOpen, className, __plasmic_selection_prop__ } = _a, rest = __objRest$b(_a, ["trigger", "dialog", "isOpen", "className", "__plasmic_selection_prop__"]);
|
|
2910
|
+
const isOpen2 = useIsOpen({
|
|
2911
|
+
triggerSlotName: "trigger",
|
|
2912
|
+
isOpen,
|
|
2913
|
+
__plasmic_selection_prop__
|
|
2914
|
+
});
|
|
2852
2915
|
const mergedProps = __spreadProps$b(__spreadValues$d({}, rest), {
|
|
2853
|
-
isOpen:
|
|
2916
|
+
isOpen: isOpen2
|
|
2854
2917
|
});
|
|
2855
2918
|
return /* @__PURE__ */ React.createElement(PlasmicDialogTriggerContext.Provider, { value: mergedProps }, /* @__PURE__ */ React.createElement(DialogTrigger, __spreadValues$d({}, mergedProps), trigger && /* @__PURE__ */ React.createElement(TriggerWrapper$1, { className }, trigger), dialog));
|
|
2856
2919
|
}
|
|
@@ -4603,34 +4666,64 @@ const inputHelpers = {
|
|
|
4603
4666
|
}
|
|
4604
4667
|
}
|
|
4605
4668
|
};
|
|
4606
|
-
function
|
|
4607
|
-
const _a = props, {
|
|
4669
|
+
function BaseTextArea_(props, ref) {
|
|
4670
|
+
const _a = props, {
|
|
4671
|
+
className,
|
|
4672
|
+
plasmicUpdateVariant,
|
|
4673
|
+
setControlContextData
|
|
4674
|
+
} = _a, restProps = __objRest$2(_a, [
|
|
4675
|
+
"className",
|
|
4676
|
+
"plasmicUpdateVariant",
|
|
4677
|
+
"setControlContextData"
|
|
4678
|
+
]);
|
|
4608
4679
|
const textFieldContext = React.useContext(PlasmicTextFieldContext);
|
|
4680
|
+
const [textAreaContextProps, textAreaRef] = useContextProps(
|
|
4681
|
+
restProps,
|
|
4682
|
+
ref,
|
|
4683
|
+
TextAreaContext
|
|
4684
|
+
);
|
|
4685
|
+
const { hoverProps, isHovered } = useHover(textAreaContextProps);
|
|
4686
|
+
const { isFocused, isFocusVisible, focusProps } = useFocusRing({
|
|
4687
|
+
isTextInput: true,
|
|
4688
|
+
autoFocus: textAreaContextProps.autoFocus
|
|
4689
|
+
});
|
|
4690
|
+
const mergedProps = mergeProps(
|
|
4691
|
+
filterHoverProps(textAreaContextProps),
|
|
4692
|
+
focusProps,
|
|
4693
|
+
hoverProps,
|
|
4694
|
+
{
|
|
4695
|
+
style: COMMON_STYLES,
|
|
4696
|
+
className
|
|
4697
|
+
}
|
|
4698
|
+
);
|
|
4699
|
+
const isDisabled = mergedProps.disabled || false;
|
|
4700
|
+
const isInvalid = !!mergedProps["aria-invalid"] && mergedProps["aria-invalid"] !== "false";
|
|
4609
4701
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
4610
4702
|
parent: textFieldContext
|
|
4611
4703
|
});
|
|
4612
|
-
|
|
4613
|
-
({
|
|
4614
|
-
|
|
4615
|
-
isFocusVisible,
|
|
4616
|
-
isFocused,
|
|
4617
|
-
isHovered
|
|
4618
|
-
}) => {
|
|
4619
|
-
plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
|
|
4704
|
+
useEffect(() => {
|
|
4705
|
+
if (plasmicUpdateVariant) {
|
|
4706
|
+
plasmicUpdateVariant({
|
|
4620
4707
|
disabled: isDisabled,
|
|
4621
4708
|
focused: isFocused,
|
|
4622
4709
|
focusVisible: isFocusVisible,
|
|
4623
4710
|
hovered: isHovered
|
|
4624
4711
|
});
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4712
|
+
}
|
|
4713
|
+
}, [isFocused, isFocusVisible, isHovered, isDisabled, plasmicUpdateVariant]);
|
|
4714
|
+
return /* @__PURE__ */ React.createElement(
|
|
4715
|
+
"textarea",
|
|
4716
|
+
__spreadProps$2(__spreadValues$2({}, mergedProps), {
|
|
4717
|
+
ref: textAreaRef,
|
|
4718
|
+
"data-focused": isFocused || void 0,
|
|
4719
|
+
"data-disabled": isDisabled || void 0,
|
|
4720
|
+
"data-hovered": isHovered || void 0,
|
|
4721
|
+
"data-focus-visible": isFocusVisible || void 0,
|
|
4722
|
+
"data-invalid": isInvalid || void 0
|
|
4723
|
+
})
|
|
4628
4724
|
);
|
|
4629
|
-
const mergedProps = mergeProps(rest, {
|
|
4630
|
-
className: classNameProp
|
|
4631
|
-
});
|
|
4632
|
-
return /* @__PURE__ */ React.createElement(TextArea, __spreadProps$2(__spreadValues$2({}, mergedProps), { style: COMMON_STYLES }));
|
|
4633
4725
|
}
|
|
4726
|
+
const BaseTextArea = React.forwardRef(BaseTextArea_);
|
|
4634
4727
|
function registerTextArea(loader, overrides) {
|
|
4635
4728
|
registerComponentHelper(
|
|
4636
4729
|
loader,
|
|
@@ -4916,7 +5009,6 @@ function UncontrolledBaseTooltip(_a) {
|
|
|
4916
5009
|
);
|
|
4917
5010
|
}
|
|
4918
5011
|
function ControlledBaseTooltip(props) {
|
|
4919
|
-
var _a, _b;
|
|
4920
5012
|
const {
|
|
4921
5013
|
children,
|
|
4922
5014
|
isDisabled = false,
|
|
@@ -4933,11 +5025,14 @@ function ControlledBaseTooltip(props) {
|
|
|
4933
5025
|
className,
|
|
4934
5026
|
onOpenChange = () => {
|
|
4935
5027
|
},
|
|
4936
|
-
plasmicUpdateVariant
|
|
5028
|
+
plasmicUpdateVariant,
|
|
5029
|
+
__plasmic_selection_prop__
|
|
4937
5030
|
} = props;
|
|
4938
|
-
const
|
|
4939
|
-
|
|
4940
|
-
|
|
5031
|
+
const isOpen2 = useIsOpen({
|
|
5032
|
+
triggerSlotName: "children",
|
|
5033
|
+
isOpen,
|
|
5034
|
+
__plasmic_selection_prop__
|
|
5035
|
+
});
|
|
4941
5036
|
const ref = useRef(null);
|
|
4942
5037
|
const tooltipId = useId();
|
|
4943
5038
|
const state = useTooltipTriggerState(__spreadProps(__spreadValues({}, props), {
|
|
@@ -4948,7 +5043,7 @@ function ControlledBaseTooltip(props) {
|
|
|
4948
5043
|
{
|
|
4949
5044
|
ref,
|
|
4950
5045
|
className,
|
|
4951
|
-
tooltipId:
|
|
5046
|
+
tooltipId: isOpen2 ? tooltipId : void 0,
|
|
4952
5047
|
isDisabled,
|
|
4953
5048
|
onOpenChange,
|
|
4954
5049
|
triggerOnFocusOnly: trigger === "focus"
|
|
@@ -4959,7 +5054,7 @@ function ControlledBaseTooltip(props) {
|
|
|
4959
5054
|
{
|
|
4960
5055
|
triggerRef: ref,
|
|
4961
5056
|
id: tooltipId,
|
|
4962
|
-
isOpen:
|
|
5057
|
+
isOpen: isOpen2,
|
|
4963
5058
|
offset,
|
|
4964
5059
|
delay,
|
|
4965
5060
|
closeDelay,
|