@marigold/components 4.1.4 → 4.1.5
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/index.d.ts +21 -17
- package/dist/index.js +134 -119
- package/dist/index.mjs +146 -124
- package/package.json +9 -6
package/dist/index.mjs
CHANGED
|
@@ -660,7 +660,8 @@ var Modal = forwardRef3(
|
|
|
660
660
|
restoreFocus: true,
|
|
661
661
|
autoFocus: true
|
|
662
662
|
}, /* @__PURE__ */ React17.createElement(Underlay, {
|
|
663
|
-
...underlayProps
|
|
663
|
+
...underlayProps,
|
|
664
|
+
variant: "modal"
|
|
664
665
|
}), /* @__PURE__ */ React17.createElement("div", {
|
|
665
666
|
style: {
|
|
666
667
|
display: "flex",
|
|
@@ -680,59 +681,102 @@ var Modal = forwardRef3(
|
|
|
680
681
|
);
|
|
681
682
|
|
|
682
683
|
// src/Overlay/Overlay.tsx
|
|
683
|
-
import React18 from "react";
|
|
684
|
-
import {
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
684
|
+
import React18, { useRef } from "react";
|
|
685
|
+
import { Transition } from "react-transition-group";
|
|
686
|
+
import {
|
|
687
|
+
Overlay as ReactAriaOverlay
|
|
688
|
+
} from "@react-aria/overlays";
|
|
689
|
+
var duration = 300;
|
|
690
|
+
var defaultStyle = {
|
|
691
|
+
transition: `opacity ${duration}ms ease-in-out`,
|
|
692
|
+
opacity: 0
|
|
693
|
+
};
|
|
694
|
+
var transitionStyles = {
|
|
695
|
+
entering: { opacity: 1 },
|
|
696
|
+
entered: { opacity: 1 },
|
|
697
|
+
exiting: { opacity: 0 },
|
|
698
|
+
exited: { opacity: 0 },
|
|
699
|
+
unmounted: { opacity: 0 }
|
|
700
|
+
};
|
|
701
|
+
var Overlay = ({ children, container, open }) => {
|
|
702
|
+
const nodeRef = useRef(null);
|
|
703
|
+
let mountOverlay = open;
|
|
704
|
+
if (!mountOverlay) {
|
|
692
705
|
return null;
|
|
693
706
|
}
|
|
694
|
-
return /* @__PURE__ */ React18.createElement(
|
|
707
|
+
return /* @__PURE__ */ React18.createElement(ReactAriaOverlay, {
|
|
695
708
|
portalContainer: container
|
|
696
|
-
}, /* @__PURE__ */ React18.createElement(
|
|
697
|
-
|
|
698
|
-
|
|
709
|
+
}, /* @__PURE__ */ React18.createElement(Transition, {
|
|
710
|
+
nodeRef,
|
|
711
|
+
timeout: duration,
|
|
712
|
+
in: open,
|
|
713
|
+
appear: true
|
|
714
|
+
}, (state) => /* @__PURE__ */ React18.createElement("div", {
|
|
715
|
+
ref: nodeRef,
|
|
716
|
+
"data-testid": "overlay",
|
|
717
|
+
style: {
|
|
718
|
+
...defaultStyle,
|
|
719
|
+
...transitionStyles[state]
|
|
720
|
+
}
|
|
721
|
+
}, children)));
|
|
699
722
|
};
|
|
700
723
|
|
|
701
724
|
// src/Overlay/Popover.tsx
|
|
702
|
-
import React19, { forwardRef as forwardRef4
|
|
703
|
-
import {
|
|
704
|
-
|
|
725
|
+
import React19, { forwardRef as forwardRef4 } from "react";
|
|
726
|
+
import {
|
|
727
|
+
DismissButton,
|
|
728
|
+
usePopover
|
|
729
|
+
} from "@react-aria/overlays";
|
|
730
|
+
import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
|
|
731
|
+
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
|
705
732
|
var Popover = forwardRef4(
|
|
733
|
+
(props, ref) => {
|
|
734
|
+
const popoverRef = useObjectRef4(ref);
|
|
735
|
+
let { children, state, ...otherProps } = props;
|
|
736
|
+
return /* @__PURE__ */ React19.createElement(Overlay, {
|
|
737
|
+
open: state.isOpen,
|
|
738
|
+
...otherProps
|
|
739
|
+
}, /* @__PURE__ */ React19.createElement(PopoverWrapper, {
|
|
740
|
+
ref: popoverRef,
|
|
741
|
+
...props
|
|
742
|
+
}, children));
|
|
743
|
+
}
|
|
744
|
+
);
|
|
745
|
+
var PopoverWrapper = forwardRef4(
|
|
706
746
|
({
|
|
707
747
|
children,
|
|
708
|
-
|
|
709
|
-
|
|
748
|
+
isNonModal,
|
|
749
|
+
state,
|
|
710
750
|
keyboardDismissDisabled,
|
|
711
|
-
shouldCloseOnBlur,
|
|
712
|
-
minWidth = 0,
|
|
713
751
|
...props
|
|
714
752
|
}, ref) => {
|
|
715
|
-
const
|
|
716
|
-
const popoverRef = ref || fallbackRef;
|
|
717
|
-
const { overlayProps } = useOverlay2(
|
|
753
|
+
const { popoverProps, underlayProps } = usePopover(
|
|
718
754
|
{
|
|
719
|
-
|
|
720
|
-
|
|
755
|
+
...props,
|
|
756
|
+
isNonModal,
|
|
721
757
|
isKeyboardDismissDisabled: keyboardDismissDisabled,
|
|
722
|
-
|
|
723
|
-
|
|
758
|
+
popoverRef: ref,
|
|
759
|
+
placement: "bottom left"
|
|
724
760
|
},
|
|
725
|
-
|
|
761
|
+
state
|
|
726
762
|
);
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
}, /* @__PURE__ */ React19.createElement(
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
763
|
+
return /* @__PURE__ */ React19.createElement(FocusScope2, {
|
|
764
|
+
restoreFocus: true
|
|
765
|
+
}, !isNonModal && /* @__PURE__ */ React19.createElement(Underlay, {
|
|
766
|
+
...underlayProps
|
|
767
|
+
}), /* @__PURE__ */ React19.createElement("div", {
|
|
768
|
+
...popoverProps,
|
|
769
|
+
style: {
|
|
770
|
+
...popoverProps.style,
|
|
771
|
+
minWidth: props.triggerRef.current ? props.triggerRef.current.offsetWidth : void 0
|
|
772
|
+
},
|
|
773
|
+
ref,
|
|
774
|
+
role: "presentation"
|
|
775
|
+
}, !isNonModal && /* @__PURE__ */ React19.createElement(DismissButton, {
|
|
776
|
+
onDismiss: state.close
|
|
777
|
+
}), children, /* @__PURE__ */ React19.createElement(DismissButton, {
|
|
778
|
+
onDismiss: state.close
|
|
779
|
+
})));
|
|
736
780
|
}
|
|
737
781
|
);
|
|
738
782
|
|
|
@@ -942,7 +986,7 @@ var Input = forwardRef5(
|
|
|
942
986
|
import React27, { forwardRef as forwardRef6 } from "react";
|
|
943
987
|
import { useLink } from "@react-aria/link";
|
|
944
988
|
import { useComponentStyles as useComponentStyles16 } from "@marigold/system";
|
|
945
|
-
import { useObjectRef as
|
|
989
|
+
import { useObjectRef as useObjectRef5 } from "@react-aria/utils";
|
|
946
990
|
var Link = forwardRef6(
|
|
947
991
|
({
|
|
948
992
|
as = "a",
|
|
@@ -954,7 +998,7 @@ var Link = forwardRef6(
|
|
|
954
998
|
onPressStart,
|
|
955
999
|
...props
|
|
956
1000
|
}, ref) => {
|
|
957
|
-
const linkRef =
|
|
1001
|
+
const linkRef = useObjectRef5(ref);
|
|
958
1002
|
const { linkProps } = useLink(
|
|
959
1003
|
{
|
|
960
1004
|
...props,
|
|
@@ -1024,9 +1068,8 @@ List.Item = ListItem;
|
|
|
1024
1068
|
|
|
1025
1069
|
// src/Menu/Menu.tsx
|
|
1026
1070
|
import React32, { useRef as useRef6 } from "react";
|
|
1027
|
-
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
|
1028
1071
|
import { useMenu } from "@react-aria/menu";
|
|
1029
|
-
import { DismissButton } from "@react-aria/overlays";
|
|
1072
|
+
import { DismissButton as DismissButton2 } from "@react-aria/overlays";
|
|
1030
1073
|
import { Item } from "@react-stately/collections";
|
|
1031
1074
|
import { useTreeState } from "@react-stately/tree";
|
|
1032
1075
|
import {
|
|
@@ -1035,7 +1078,10 @@ import {
|
|
|
1035
1078
|
} from "@marigold/system";
|
|
1036
1079
|
|
|
1037
1080
|
// src/Menu/Context.ts
|
|
1038
|
-
import {
|
|
1081
|
+
import {
|
|
1082
|
+
createContext as createContext4,
|
|
1083
|
+
useContext as useContext4
|
|
1084
|
+
} from "react";
|
|
1039
1085
|
var MenuContext = createContext4({});
|
|
1040
1086
|
var useMenuContext = () => useContext4(MenuContext);
|
|
1041
1087
|
|
|
@@ -1043,26 +1089,21 @@ var useMenuContext = () => useContext4(MenuContext);
|
|
|
1043
1089
|
import React30, { useRef as useRef4 } from "react";
|
|
1044
1090
|
import { useMenuTriggerState } from "@react-stately/menu";
|
|
1045
1091
|
import { useMenuTrigger } from "@react-aria/menu";
|
|
1046
|
-
import { useOverlayPosition } from "@react-aria/overlays";
|
|
1047
1092
|
import { PressResponder as PressResponder2 } from "@react-aria/interactions";
|
|
1093
|
+
import { useObjectRef as useObjectRef6 } from "@react-aria/utils";
|
|
1048
1094
|
var MenuTrigger = ({ disabled, children }) => {
|
|
1049
1095
|
const [menuTrigger, menu] = React30.Children.toArray(children);
|
|
1050
1096
|
const menuTriggerRef = useRef4(null);
|
|
1051
|
-
const
|
|
1097
|
+
const menuRef = useObjectRef6();
|
|
1052
1098
|
const state = useMenuTriggerState({});
|
|
1053
1099
|
const { menuTriggerProps, menuProps } = useMenuTrigger(
|
|
1054
1100
|
{ trigger: "press", isDisabled: disabled },
|
|
1055
1101
|
state,
|
|
1056
1102
|
menuTriggerRef
|
|
1057
1103
|
);
|
|
1058
|
-
const { overlayProps: positionProps } = useOverlayPosition({
|
|
1059
|
-
targetRef: menuTriggerRef,
|
|
1060
|
-
overlayRef,
|
|
1061
|
-
isOpen: state.isOpen,
|
|
1062
|
-
placement: "bottom left"
|
|
1063
|
-
});
|
|
1064
1104
|
const menuContext = {
|
|
1065
1105
|
...menuProps,
|
|
1106
|
+
ref: menuRef,
|
|
1066
1107
|
open: state.isOpen,
|
|
1067
1108
|
onClose: state.close,
|
|
1068
1109
|
autoFocus: state.focusStrategy
|
|
@@ -1074,13 +1115,9 @@ var MenuTrigger = ({ disabled, children }) => {
|
|
|
1074
1115
|
ref: menuTriggerRef,
|
|
1075
1116
|
isPressed: state.isOpen
|
|
1076
1117
|
}, menuTrigger), /* @__PURE__ */ React30.createElement(Popover, {
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
shouldCloseOnBlur: true,
|
|
1081
|
-
ref: overlayRef,
|
|
1082
|
-
minWidth: menuTriggerRef.current ? menuTriggerRef.current.offsetWidth : void 0,
|
|
1083
|
-
...positionProps
|
|
1118
|
+
triggerRef: menuTriggerRef,
|
|
1119
|
+
scrollRef: menuRef,
|
|
1120
|
+
state
|
|
1084
1121
|
}, menu));
|
|
1085
1122
|
};
|
|
1086
1123
|
|
|
@@ -1088,7 +1125,7 @@ var MenuTrigger = ({ disabled, children }) => {
|
|
|
1088
1125
|
import React31, { useRef as useRef5 } from "react";
|
|
1089
1126
|
import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
|
|
1090
1127
|
import { useMenuItem } from "@react-aria/menu";
|
|
1091
|
-
import { mergeProps as
|
|
1128
|
+
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
|
1092
1129
|
import { Box as Box16, useStateProps as useStateProps3 } from "@marigold/system";
|
|
1093
1130
|
var MenuItem = ({ item, state, onAction, css }) => {
|
|
1094
1131
|
const ref = useRef5(null);
|
|
@@ -1115,26 +1152,26 @@ var MenuItem = ({ item, state, onAction, css }) => {
|
|
|
1115
1152
|
}
|
|
1116
1153
|
},
|
|
1117
1154
|
css,
|
|
1118
|
-
...
|
|
1155
|
+
...mergeProps3(menuItemProps, focusProps),
|
|
1119
1156
|
...stateProps
|
|
1120
1157
|
}, item.rendered);
|
|
1121
1158
|
};
|
|
1122
1159
|
|
|
1123
1160
|
// src/Menu/Menu.tsx
|
|
1161
|
+
import { useSyncRef } from "@react-aria/utils";
|
|
1124
1162
|
var Menu = ({ variant, size, ...props }) => {
|
|
1125
|
-
const menuContext = useMenuContext();
|
|
1163
|
+
const { ref: scrollRef, ...menuContext } = useMenuContext();
|
|
1126
1164
|
const ownProps = { ...props, ...menuContext };
|
|
1127
1165
|
const ref = useRef6(null);
|
|
1128
1166
|
const state = useTreeState({ ...ownProps, selectionMode: "none" });
|
|
1129
1167
|
const { menuProps } = useMenu(ownProps, state, ref);
|
|
1168
|
+
useSyncRef({ ref: scrollRef }, ref);
|
|
1130
1169
|
const styles = useComponentStyles18(
|
|
1131
1170
|
"Menu",
|
|
1132
1171
|
{ variant, size },
|
|
1133
1172
|
{ parts: ["container", "item"] }
|
|
1134
1173
|
);
|
|
1135
|
-
return /* @__PURE__ */ React32.createElement(
|
|
1136
|
-
restoreFocus: true
|
|
1137
|
-
}, /* @__PURE__ */ React32.createElement("div", null, /* @__PURE__ */ React32.createElement(DismissButton, {
|
|
1174
|
+
return /* @__PURE__ */ React32.createElement("div", null, /* @__PURE__ */ React32.createElement(DismissButton2, {
|
|
1138
1175
|
onDismiss: ownProps.onClose
|
|
1139
1176
|
}), /* @__PURE__ */ React32.createElement(Box17, {
|
|
1140
1177
|
as: "ul",
|
|
@@ -1152,9 +1189,9 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
1152
1189
|
state,
|
|
1153
1190
|
onAction: props.onSelect,
|
|
1154
1191
|
css: styles.item
|
|
1155
|
-
}))), /* @__PURE__ */ React32.createElement(
|
|
1192
|
+
}))), /* @__PURE__ */ React32.createElement(DismissButton2, {
|
|
1156
1193
|
onDismiss: ownProps.onClose
|
|
1157
|
-
}))
|
|
1194
|
+
}));
|
|
1158
1195
|
};
|
|
1159
1196
|
Menu.Trigger = MenuTrigger;
|
|
1160
1197
|
Menu.Item = Item;
|
|
@@ -1207,7 +1244,7 @@ import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
|
|
|
1207
1244
|
import { useHover as useHover4 } from "@react-aria/interactions";
|
|
1208
1245
|
import { useLocale } from "@react-aria/i18n";
|
|
1209
1246
|
import { useNumberField } from "@react-aria/numberfield";
|
|
1210
|
-
import { mergeProps as
|
|
1247
|
+
import { mergeProps as mergeProps5, useObjectRef as useObjectRef7 } from "@react-aria/utils";
|
|
1211
1248
|
import { useNumberFieldState } from "@react-stately/numberfield";
|
|
1212
1249
|
import {
|
|
1213
1250
|
Box as Box21,
|
|
@@ -1305,7 +1342,7 @@ var FieldBase = ({
|
|
|
1305
1342
|
import React36, { useRef as useRef7 } from "react";
|
|
1306
1343
|
import { useButton as useButton3 } from "@react-aria/button";
|
|
1307
1344
|
import { useHover as useHover3 } from "@react-aria/interactions";
|
|
1308
|
-
import { mergeProps as
|
|
1345
|
+
import { mergeProps as mergeProps4 } from "@react-aria/utils";
|
|
1309
1346
|
import { Box as Box20, useStateProps as useStateProps4 } from "@marigold/system";
|
|
1310
1347
|
var Plus = () => /* @__PURE__ */ React36.createElement(Box20, {
|
|
1311
1348
|
as: "svg",
|
|
@@ -1348,7 +1385,7 @@ var StepButton = ({ direction, css, ...props }) => {
|
|
|
1348
1385
|
cursor: props.isDisabled ? "not-allowed" : "pointer"
|
|
1349
1386
|
},
|
|
1350
1387
|
css,
|
|
1351
|
-
...
|
|
1388
|
+
...mergeProps4(buttonProps, hoverProps),
|
|
1352
1389
|
...stateProps
|
|
1353
1390
|
}, /* @__PURE__ */ React36.createElement(Icon3, null));
|
|
1354
1391
|
};
|
|
@@ -1375,7 +1412,7 @@ var NumberField = forwardRef7(
|
|
|
1375
1412
|
};
|
|
1376
1413
|
const showStepper = !hideStepper;
|
|
1377
1414
|
const { locale } = useLocale();
|
|
1378
|
-
const inputRef =
|
|
1415
|
+
const inputRef = useObjectRef7(ref);
|
|
1379
1416
|
const state = useNumberFieldState({ ...props, locale });
|
|
1380
1417
|
const {
|
|
1381
1418
|
labelProps,
|
|
@@ -1428,7 +1465,7 @@ var NumberField = forwardRef7(
|
|
|
1428
1465
|
}
|
|
1429
1466
|
},
|
|
1430
1467
|
css: styles.group,
|
|
1431
|
-
...
|
|
1468
|
+
...mergeProps5(groupProps, focusProps, hoverProps),
|
|
1432
1469
|
...stateProps
|
|
1433
1470
|
}, showStepper && /* @__PURE__ */ React37.createElement(StepButton, {
|
|
1434
1471
|
direction: "down",
|
|
@@ -1491,7 +1528,7 @@ import React40, {
|
|
|
1491
1528
|
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
1492
1529
|
import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
|
|
1493
1530
|
import { useRadio } from "@react-aria/radio";
|
|
1494
|
-
import { useObjectRef as
|
|
1531
|
+
import { useObjectRef as useObjectRef8 } from "@react-aria/utils";
|
|
1495
1532
|
import {
|
|
1496
1533
|
Box as Box23,
|
|
1497
1534
|
useComponentStyles as useComponentStyles24,
|
|
@@ -1595,7 +1632,7 @@ var Radio = forwardRef8(
|
|
|
1595
1632
|
width: groupWidth,
|
|
1596
1633
|
...state
|
|
1597
1634
|
} = useRadioGroupContext();
|
|
1598
|
-
const inputRef =
|
|
1635
|
+
const inputRef = useObjectRef8(ref);
|
|
1599
1636
|
const { inputProps } = useRadio(
|
|
1600
1637
|
{ isDisabled: disabled, ...props },
|
|
1601
1638
|
state,
|
|
@@ -1661,13 +1698,12 @@ import React44, {
|
|
|
1661
1698
|
useRef as useRef9
|
|
1662
1699
|
} from "react";
|
|
1663
1700
|
import { useButton as useButton4 } from "@react-aria/button";
|
|
1664
|
-
import {
|
|
1701
|
+
import { useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
1665
1702
|
import { useLocalizedStringFormatter } from "@react-aria/i18n";
|
|
1666
|
-
import { DismissButton as DismissButton2, useOverlayPosition as useOverlayPosition2 } from "@react-aria/overlays";
|
|
1667
1703
|
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
1668
1704
|
import { useSelectState } from "@react-stately/select";
|
|
1669
1705
|
import { Item as Item2, Section } from "@react-stately/collections";
|
|
1670
|
-
import { mergeProps as
|
|
1706
|
+
import { mergeProps as mergeProps6, useObjectRef as useObjectRef10 } from "@react-aria/utils";
|
|
1671
1707
|
import {
|
|
1672
1708
|
Box as Box27,
|
|
1673
1709
|
useComponentStyles as useComponentStyles26,
|
|
@@ -1676,7 +1712,7 @@ import {
|
|
|
1676
1712
|
|
|
1677
1713
|
// src/ListBox/ListBox.tsx
|
|
1678
1714
|
import React43, { forwardRef as forwardRef9 } from "react";
|
|
1679
|
-
import { useObjectRef as
|
|
1715
|
+
import { useObjectRef as useObjectRef9 } from "@react-aria/utils";
|
|
1680
1716
|
import {
|
|
1681
1717
|
Box as Box26,
|
|
1682
1718
|
useComponentStyles as useComponentStyles25
|
|
@@ -1750,7 +1786,7 @@ var ListBoxSection = ({ section, state }) => {
|
|
|
1750
1786
|
// src/ListBox/ListBox.tsx
|
|
1751
1787
|
var ListBox = forwardRef9(
|
|
1752
1788
|
({ state, variant, size, ...props }, ref) => {
|
|
1753
|
-
const innerRef =
|
|
1789
|
+
const innerRef = useObjectRef9(ref);
|
|
1754
1790
|
const { listBoxProps } = useListBox(props, state, innerRef);
|
|
1755
1791
|
const styles = useComponentStyles25(
|
|
1756
1792
|
"ListBox",
|
|
@@ -1807,7 +1843,6 @@ var Chevron = ({ css }) => /* @__PURE__ */ React44.createElement(Box27, {
|
|
|
1807
1843
|
var Select = forwardRef10(
|
|
1808
1844
|
({ variant, size, width, open, disabled, required, error, ...rest }, ref) => {
|
|
1809
1845
|
const formatMessage = useLocalizedStringFormatter(messages);
|
|
1810
|
-
const buttonRef = useObjectRef8(ref);
|
|
1811
1846
|
const props = {
|
|
1812
1847
|
isOpen: open,
|
|
1813
1848
|
isDisabled: disabled,
|
|
@@ -1817,6 +1852,8 @@ var Select = forwardRef10(
|
|
|
1817
1852
|
...rest
|
|
1818
1853
|
};
|
|
1819
1854
|
const state = useSelectState(props);
|
|
1855
|
+
const buttonRef = useObjectRef10(ref);
|
|
1856
|
+
const listboxRef = useRef9(null);
|
|
1820
1857
|
const {
|
|
1821
1858
|
labelProps,
|
|
1822
1859
|
triggerProps,
|
|
@@ -1830,13 +1867,6 @@ var Select = forwardRef10(
|
|
|
1830
1867
|
buttonRef
|
|
1831
1868
|
);
|
|
1832
1869
|
const { focusProps, isFocusVisible } = useFocusRing6();
|
|
1833
|
-
const overlayRef = useRef9(null);
|
|
1834
|
-
const { overlayProps: positionProps } = useOverlayPosition2({
|
|
1835
|
-
targetRef: buttonRef,
|
|
1836
|
-
overlayRef,
|
|
1837
|
-
isOpen: state.isOpen,
|
|
1838
|
-
placement: "bottom left"
|
|
1839
|
-
});
|
|
1840
1870
|
const styles = useComponentStyles26(
|
|
1841
1871
|
"Select",
|
|
1842
1872
|
{ variant, size },
|
|
@@ -1879,7 +1909,7 @@ var Select = forwardRef10(
|
|
|
1879
1909
|
},
|
|
1880
1910
|
css: styles.button,
|
|
1881
1911
|
ref: buttonRef,
|
|
1882
|
-
...
|
|
1912
|
+
...mergeProps6(buttonProps, focusProps),
|
|
1883
1913
|
...stateProps
|
|
1884
1914
|
}, /* @__PURE__ */ React44.createElement(Box27, {
|
|
1885
1915
|
css: {
|
|
@@ -1890,25 +1920,16 @@ var Select = forwardRef10(
|
|
|
1890
1920
|
}, state.selectedItem ? state.selectedItem.rendered : props.placeholder), /* @__PURE__ */ React44.createElement(Chevron, {
|
|
1891
1921
|
css: styles.icon
|
|
1892
1922
|
})), /* @__PURE__ */ React44.createElement(Popover, {
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
ref: overlayRef,
|
|
1899
|
-
...positionProps
|
|
1900
|
-
}, /* @__PURE__ */ React44.createElement(FocusScope3, {
|
|
1901
|
-
restoreFocus: true
|
|
1902
|
-
}, /* @__PURE__ */ React44.createElement(DismissButton2, {
|
|
1903
|
-
onDismiss: state.close
|
|
1904
|
-
}), /* @__PURE__ */ React44.createElement(ListBox, {
|
|
1923
|
+
state,
|
|
1924
|
+
triggerRef: buttonRef,
|
|
1925
|
+
scrollRef: listboxRef
|
|
1926
|
+
}, /* @__PURE__ */ React44.createElement(ListBox, {
|
|
1927
|
+
ref: listboxRef,
|
|
1905
1928
|
state,
|
|
1906
1929
|
variant,
|
|
1907
1930
|
size,
|
|
1908
1931
|
...menuProps
|
|
1909
|
-
})
|
|
1910
|
-
onDismiss: state.close
|
|
1911
|
-
}))));
|
|
1932
|
+
})));
|
|
1912
1933
|
}
|
|
1913
1934
|
);
|
|
1914
1935
|
Select.Option = Item2;
|
|
@@ -1919,13 +1940,13 @@ import React46, { forwardRef as forwardRef11 } from "react";
|
|
|
1919
1940
|
import { useSlider } from "@react-aria/slider";
|
|
1920
1941
|
import { useSliderState } from "@react-stately/slider";
|
|
1921
1942
|
import { useNumberFormatter } from "@react-aria/i18n";
|
|
1922
|
-
import { useObjectRef as
|
|
1943
|
+
import { useObjectRef as useObjectRef11 } from "@react-aria/utils";
|
|
1923
1944
|
import { useComponentStyles as useComponentStyles27 } from "@marigold/system";
|
|
1924
1945
|
|
|
1925
1946
|
// src/Slider/Thumb.tsx
|
|
1926
1947
|
import React45, { useEffect } from "react";
|
|
1927
1948
|
import { useSliderThumb } from "@react-aria/slider";
|
|
1928
|
-
import { mergeProps as
|
|
1949
|
+
import { mergeProps as mergeProps7 } from "@react-aria/utils";
|
|
1929
1950
|
import { useStateProps as useStateProps9 } from "@marigold/system";
|
|
1930
1951
|
|
|
1931
1952
|
// src/VisuallyHidden/VisuallyHidden.tsx
|
|
@@ -1963,7 +1984,7 @@ var Thumb = ({ state, trackRef, styles, ...props }) => {
|
|
|
1963
1984
|
as: "input",
|
|
1964
1985
|
type: "range",
|
|
1965
1986
|
ref: inputRef,
|
|
1966
|
-
...
|
|
1987
|
+
...mergeProps7(inputProps, focusProps)
|
|
1967
1988
|
})));
|
|
1968
1989
|
};
|
|
1969
1990
|
|
|
@@ -1971,7 +1992,7 @@ var Thumb = ({ state, trackRef, styles, ...props }) => {
|
|
|
1971
1992
|
var Slider = forwardRef11(
|
|
1972
1993
|
({ variant, size, width = "100%", ...props }, ref) => {
|
|
1973
1994
|
const { formatOptions } = props;
|
|
1974
|
-
const trackRef =
|
|
1995
|
+
const trackRef = useObjectRef11(ref);
|
|
1975
1996
|
const numberFormatter = useNumberFormatter(formatOptions);
|
|
1976
1997
|
const state = useSliderState({ ...props, numberFormatter });
|
|
1977
1998
|
const { groupProps, trackProps, labelProps, outputProps } = useSlider(
|
|
@@ -2076,7 +2097,7 @@ var Stack = ({
|
|
|
2076
2097
|
import React49, { forwardRef as forwardRef12 } from "react";
|
|
2077
2098
|
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
2078
2099
|
import { useSwitch } from "@react-aria/switch";
|
|
2079
|
-
import { useObjectRef as
|
|
2100
|
+
import { useObjectRef as useObjectRef12 } from "@react-aria/utils";
|
|
2080
2101
|
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
2081
2102
|
import {
|
|
2082
2103
|
useComponentStyles as useComponentStyles28,
|
|
@@ -2093,7 +2114,7 @@ var Switch = forwardRef12(
|
|
|
2093
2114
|
defaultChecked,
|
|
2094
2115
|
...rest
|
|
2095
2116
|
}, ref) => {
|
|
2096
|
-
const inputRef =
|
|
2117
|
+
const inputRef = useObjectRef12(ref);
|
|
2097
2118
|
const props = {
|
|
2098
2119
|
isSelected: checked,
|
|
2099
2120
|
isDisabled: disabled,
|
|
@@ -2212,7 +2233,7 @@ var TableBody = ({ children }) => {
|
|
|
2212
2233
|
import React51, { useRef as useRef10 } from "react";
|
|
2213
2234
|
import { useTableCell } from "@react-aria/table";
|
|
2214
2235
|
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
2215
|
-
import { mergeProps as
|
|
2236
|
+
import { mergeProps as mergeProps8 } from "@react-aria/utils";
|
|
2216
2237
|
import { Box as Box29, useStateProps as useStateProps11 } from "@marigold/system";
|
|
2217
2238
|
var TableCell = ({ cell }) => {
|
|
2218
2239
|
const ref = useRef10(null);
|
|
@@ -2236,7 +2257,7 @@ var TableCell = ({ cell }) => {
|
|
|
2236
2257
|
as: "td",
|
|
2237
2258
|
ref,
|
|
2238
2259
|
css: styles.cell,
|
|
2239
|
-
...
|
|
2260
|
+
...mergeProps8(cellProps, focusProps),
|
|
2240
2261
|
...stateProps
|
|
2241
2262
|
}, cell.rendered);
|
|
2242
2263
|
};
|
|
@@ -2245,7 +2266,7 @@ var TableCell = ({ cell }) => {
|
|
|
2245
2266
|
import React52, { useRef as useRef11 } from "react";
|
|
2246
2267
|
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
2247
2268
|
import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
|
|
2248
|
-
import { mergeProps as
|
|
2269
|
+
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
2249
2270
|
import { Box as Box30, useStateProps as useStateProps12 } from "@marigold/system";
|
|
2250
2271
|
|
|
2251
2272
|
// src/Table/utils.ts
|
|
@@ -2294,7 +2315,7 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2294
2315
|
lineHeight: 1
|
|
2295
2316
|
},
|
|
2296
2317
|
css: styles.cell,
|
|
2297
|
-
...
|
|
2318
|
+
...mergeProps9(gridCellProps, focusProps),
|
|
2298
2319
|
...stateProps
|
|
2299
2320
|
}, /* @__PURE__ */ React52.createElement(Checkbox, {
|
|
2300
2321
|
...checkboxProps
|
|
@@ -2306,7 +2327,7 @@ import React53, { useRef as useRef12 } from "react";
|
|
|
2306
2327
|
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
2307
2328
|
import { useHover as useHover6 } from "@react-aria/interactions";
|
|
2308
2329
|
import { useTableColumnHeader } from "@react-aria/table";
|
|
2309
|
-
import { mergeProps as
|
|
2330
|
+
import { mergeProps as mergeProps10 } from "@react-aria/utils";
|
|
2310
2331
|
import { Box as Box31, useStateProps as useStateProps13 } from "@marigold/system";
|
|
2311
2332
|
var SortIndicator = ({
|
|
2312
2333
|
direction = "ascending",
|
|
@@ -2344,7 +2365,7 @@ var TableColumnHeader = ({ column }) => {
|
|
|
2344
2365
|
ref,
|
|
2345
2366
|
__baseCSS: { cursor: "default" },
|
|
2346
2367
|
css: styles.header,
|
|
2347
|
-
...
|
|
2368
|
+
...mergeProps10(columnHeaderProps, hoverProps, focusProps),
|
|
2348
2369
|
...stateProps
|
|
2349
2370
|
}, column.rendered, column.props.allowsSorting && /* @__PURE__ */ React53.createElement(SortIndicator, {
|
|
2350
2371
|
direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
|
|
@@ -2380,7 +2401,7 @@ import React56, { useRef as useRef14 } from "react";
|
|
|
2380
2401
|
import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
|
|
2381
2402
|
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
2382
2403
|
import { useTableRow } from "@react-aria/table";
|
|
2383
|
-
import { mergeProps as
|
|
2404
|
+
import { mergeProps as mergeProps11 } from "@react-aria/utils";
|
|
2384
2405
|
import { Box as Box32, useStateProps as useStateProps14 } from "@marigold/system";
|
|
2385
2406
|
var TableRow = ({ children, row }) => {
|
|
2386
2407
|
const ref = useRef14(null);
|
|
@@ -2412,7 +2433,7 @@ var TableRow = ({ children, row }) => {
|
|
|
2412
2433
|
cursor: !interactive ? "text" : disabled ? "default" : "pointer"
|
|
2413
2434
|
},
|
|
2414
2435
|
css: styles.row,
|
|
2415
|
-
...
|
|
2436
|
+
...mergeProps11(rowProps, focusProps, hoverProps),
|
|
2416
2437
|
...stateProps
|
|
2417
2438
|
}, children);
|
|
2418
2439
|
};
|
|
@@ -2425,7 +2446,7 @@ import {
|
|
|
2425
2446
|
useTableColumnHeader as useTableColumnHeader2,
|
|
2426
2447
|
useTableSelectAllCheckbox
|
|
2427
2448
|
} from "@react-aria/table";
|
|
2428
|
-
import { mergeProps as
|
|
2449
|
+
import { mergeProps as mergeProps12 } from "@react-aria/utils";
|
|
2429
2450
|
import { Box as Box33, useStateProps as useStateProps15 } from "@marigold/system";
|
|
2430
2451
|
var TableSelectAllCell = ({ column }) => {
|
|
2431
2452
|
const ref = useRef15(null);
|
|
@@ -2453,7 +2474,7 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
2453
2474
|
lineHeight: 1
|
|
2454
2475
|
},
|
|
2455
2476
|
css: styles.header,
|
|
2456
|
-
...
|
|
2477
|
+
...mergeProps12(columnHeaderProps, hoverProps, focusProps),
|
|
2457
2478
|
...stateProps
|
|
2458
2479
|
}, /* @__PURE__ */ React57.createElement(Checkbox, {
|
|
2459
2480
|
...checkboxProps
|
|
@@ -2569,7 +2590,7 @@ import React60, { forwardRef as forwardRef13 } from "react";
|
|
|
2569
2590
|
import { useHover as useHover9 } from "@react-aria/interactions";
|
|
2570
2591
|
import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
|
|
2571
2592
|
import { useTextField } from "@react-aria/textfield";
|
|
2572
|
-
import { useObjectRef as
|
|
2593
|
+
import { useObjectRef as useObjectRef13 } from "@react-aria/utils";
|
|
2573
2594
|
import {
|
|
2574
2595
|
Box as Box36,
|
|
2575
2596
|
useComponentStyles as useComponentStyles31,
|
|
@@ -2588,7 +2609,7 @@ var TextArea = forwardRef13(
|
|
|
2588
2609
|
...props
|
|
2589
2610
|
}, ref) => {
|
|
2590
2611
|
const { label, description, errorMessage } = props;
|
|
2591
|
-
const textAreaRef =
|
|
2612
|
+
const textAreaRef = useObjectRef13(ref);
|
|
2592
2613
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField(
|
|
2593
2614
|
{
|
|
2594
2615
|
inputElementType: "textarea",
|
|
@@ -2641,12 +2662,12 @@ import React61, { forwardRef as forwardRef14 } from "react";
|
|
|
2641
2662
|
import { useHover as useHover10 } from "@react-aria/interactions";
|
|
2642
2663
|
import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
|
|
2643
2664
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
2644
|
-
import { useObjectRef as
|
|
2665
|
+
import { useObjectRef as useObjectRef14 } from "@react-aria/utils";
|
|
2645
2666
|
import { useStateProps as useStateProps17 } from "@marigold/system";
|
|
2646
2667
|
var TextField = forwardRef14(
|
|
2647
2668
|
({ variant, size, width, disabled, required, readOnly, error, ...props }, ref) => {
|
|
2648
2669
|
const { label, description, errorMessage, autoFocus } = props;
|
|
2649
|
-
const inputRef =
|
|
2670
|
+
const inputRef = useObjectRef14(ref);
|
|
2650
2671
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2(
|
|
2651
2672
|
{
|
|
2652
2673
|
isDisabled: disabled,
|
|
@@ -2738,7 +2759,7 @@ var useTooltipContext = () => useContext8(TooltipContext);
|
|
|
2738
2759
|
// src/Tooltip/TooltipTrigger.tsx
|
|
2739
2760
|
import React63, { useRef as useRef17 } from "react";
|
|
2740
2761
|
import { FocusableProvider } from "@react-aria/focus";
|
|
2741
|
-
import { useOverlayPosition
|
|
2762
|
+
import { useOverlayPosition } from "@react-aria/overlays";
|
|
2742
2763
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
2743
2764
|
import { useTooltipTriggerState } from "@react-stately/tooltip";
|
|
2744
2765
|
var TooltipTrigger = ({
|
|
@@ -2769,7 +2790,7 @@ var TooltipTrigger = ({
|
|
|
2769
2790
|
overlayProps: positionProps,
|
|
2770
2791
|
placement: overlayPlacement,
|
|
2771
2792
|
arrowProps
|
|
2772
|
-
} =
|
|
2793
|
+
} = useOverlayPosition({
|
|
2773
2794
|
placement: props.placement,
|
|
2774
2795
|
targetRef: tooltipTriggerRef,
|
|
2775
2796
|
offset: props.offset,
|
|
@@ -2978,6 +2999,7 @@ export {
|
|
|
2978
2999
|
MarigoldProvider,
|
|
2979
3000
|
Menu,
|
|
2980
3001
|
Message,
|
|
3002
|
+
Modal,
|
|
2981
3003
|
NumberField,
|
|
2982
3004
|
Overlay,
|
|
2983
3005
|
Popover,
|