@doist/reactist 26.0.0 → 26.2.0
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/reactist.cjs.development.js +36 -9
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/alert/alert.js +6 -3
- package/es/alert/alert.js.map +1 -1
- package/es/alert/alert.module.css.js +1 -1
- package/es/menu/menu.js +17 -4
- package/es/menu/menu.js.map +1 -1
- package/es/tooltip/tooltip.js +14 -3
- package/es/tooltip/tooltip.js.map +1 -1
- package/lib/alert/alert.js +1 -1
- package/lib/alert/alert.js.map +1 -1
- package/lib/alert/alert.module.css.js +1 -1
- package/lib/menu/menu.js +1 -1
- package/lib/menu/menu.js.map +1 -1
- package/lib/tooltip/tooltip.d.ts +19 -2
- package/lib/tooltip/tooltip.js +1 -1
- package/lib/tooltip/tooltip.js.map +1 -1
- package/package.json +1 -1
- package/styles/alert.css +1 -1
- package/styles/alert.module.css.css +1 -1
- package/styles/index.css +1 -3
- package/styles/reactist.css +1 -1
|
@@ -575,18 +575,29 @@ function Spinner({
|
|
|
575
575
|
|
|
576
576
|
var modules_95f1407a = {"tooltip":"_487c82cd"};
|
|
577
577
|
|
|
578
|
+
const TooltipContext = /*#__PURE__*/React__namespace.createContext({
|
|
579
|
+
showTimeout: 500,
|
|
580
|
+
hideTimeout: 100
|
|
581
|
+
});
|
|
582
|
+
|
|
578
583
|
function Tooltip({
|
|
579
584
|
children,
|
|
580
585
|
content,
|
|
581
586
|
position = 'top',
|
|
582
587
|
gapSize = 3,
|
|
583
588
|
withArrow = false,
|
|
589
|
+
showTimeout,
|
|
590
|
+
hideTimeout,
|
|
584
591
|
exceptionallySetClassName
|
|
585
592
|
}) {
|
|
593
|
+
const {
|
|
594
|
+
showTimeout: globalShowTimeout,
|
|
595
|
+
hideTimeout: globalHideTimeout
|
|
596
|
+
} = React__namespace.useContext(TooltipContext);
|
|
586
597
|
const tooltip = react.useTooltipStore({
|
|
587
598
|
placement: position,
|
|
588
|
-
showTimeout:
|
|
589
|
-
hideTimeout:
|
|
599
|
+
showTimeout: showTimeout != null ? showTimeout : globalShowTimeout,
|
|
600
|
+
hideTimeout: hideTimeout != null ? hideTimeout : globalHideTimeout
|
|
590
601
|
});
|
|
591
602
|
const isOpen = tooltip.useState('open');
|
|
592
603
|
const child = React__namespace.Children.only(children);
|
|
@@ -808,7 +819,7 @@ function CloseIcon(props) {
|
|
|
808
819
|
}));
|
|
809
820
|
}
|
|
810
821
|
|
|
811
|
-
var modules_6205a58e = {"container":"
|
|
822
|
+
var modules_6205a58e = {"container":"d6be7fe9","content":"ad8ace2f","icon":"ab71a9dc","tone-info":"_043941a6","tone-positive":"f34b89d4","tone-caution":"a069ea07","tone-critical":"e505aabb"};
|
|
812
823
|
|
|
813
824
|
function Alert({
|
|
814
825
|
id,
|
|
@@ -833,10 +844,13 @@ function Alert({
|
|
|
833
844
|
className: modules_6205a58e.icon
|
|
834
845
|
})), /*#__PURE__*/React__namespace.createElement(Column, null, /*#__PURE__*/React__namespace.createElement(Box$1, {
|
|
835
846
|
paddingY: "xsmall",
|
|
836
|
-
paddingRight: onClose != null && closeLabel != null ? undefined : 'small'
|
|
847
|
+
paddingRight: onClose != null && closeLabel != null ? undefined : 'small',
|
|
848
|
+
display: "flex",
|
|
849
|
+
alignItems: "center",
|
|
850
|
+
className: modules_6205a58e.content
|
|
837
851
|
}, children)), onClose != null && closeLabel != null ? /*#__PURE__*/React__namespace.createElement(Column, {
|
|
838
852
|
width: "content"
|
|
839
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
853
|
+
}, /*#__PURE__*/React__namespace.createElement(IconButton, {
|
|
840
854
|
variant: "quaternary",
|
|
841
855
|
size: "small",
|
|
842
856
|
onClick: onClose,
|
|
@@ -2739,7 +2753,7 @@ function TabAwareSlot({
|
|
|
2739
2753
|
const _excluded$4 = ["children", "onItemSelect"],
|
|
2740
2754
|
_excluded2 = ["exceptionallySetClassName"],
|
|
2741
2755
|
_excluded3 = ["render"],
|
|
2742
|
-
_excluded4 = ["exceptionallySetClassName", "modal"],
|
|
2756
|
+
_excluded4 = ["exceptionallySetClassName", "modal", "flip"],
|
|
2743
2757
|
_excluded5 = ["value", "children", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName"],
|
|
2744
2758
|
_excluded6 = ["label", "children", "exceptionallySetClassName"];
|
|
2745
2759
|
const MenuContext = /*#__PURE__*/React__namespace.createContext({
|
|
@@ -2748,6 +2762,9 @@ const MenuContext = /*#__PURE__*/React__namespace.createContext({
|
|
|
2748
2762
|
getAnchorRect: null,
|
|
2749
2763
|
setAnchorRect: () => undefined
|
|
2750
2764
|
});
|
|
2765
|
+
const SubMenuContext = /*#__PURE__*/React__namespace.createContext({
|
|
2766
|
+
isSubMenu: false
|
|
2767
|
+
});
|
|
2751
2768
|
/**
|
|
2752
2769
|
* Wrapper component to control a menu. It does not render anything, only providing the state
|
|
2753
2770
|
* management for the menu components inside it.
|
|
@@ -2840,7 +2857,8 @@ const ContextMenuTrigger = /*#__PURE__*/React__namespace.forwardRef(function Con
|
|
|
2840
2857
|
const MenuList = /*#__PURE__*/React__namespace.forwardRef(function MenuList(_ref4, ref) {
|
|
2841
2858
|
let {
|
|
2842
2859
|
exceptionallySetClassName,
|
|
2843
|
-
modal = true
|
|
2860
|
+
modal = true,
|
|
2861
|
+
flip
|
|
2844
2862
|
} = _ref4,
|
|
2845
2863
|
props = _objectWithoutProperties(_ref4, _excluded4);
|
|
2846
2864
|
|
|
@@ -2853,6 +2871,9 @@ const MenuList = /*#__PURE__*/React__namespace.forwardRef(function MenuList(_ref
|
|
|
2853
2871
|
throw new Error('MenuList must be wrapped in <Menu/>');
|
|
2854
2872
|
}
|
|
2855
2873
|
|
|
2874
|
+
const {
|
|
2875
|
+
isSubMenu
|
|
2876
|
+
} = React__namespace.useContext(SubMenuContext);
|
|
2856
2877
|
const isOpen = menuStore.useState('open');
|
|
2857
2878
|
return isOpen ? /*#__PURE__*/React__namespace.createElement(react.Portal, {
|
|
2858
2879
|
preserveTabOrder: true
|
|
@@ -2863,7 +2884,8 @@ const MenuList = /*#__PURE__*/React__namespace.forwardRef(function MenuList(_ref
|
|
|
2863
2884
|
ref: ref,
|
|
2864
2885
|
className: classNames__default["default"]('reactist_menulist', exceptionallySetClassName),
|
|
2865
2886
|
getAnchorRect: getAnchorRect != null ? getAnchorRect : undefined,
|
|
2866
|
-
modal: modal
|
|
2887
|
+
modal: modal,
|
|
2888
|
+
flip: flip != null ? flip : isSubMenu ? 'bottom' : undefined
|
|
2867
2889
|
}))) : null;
|
|
2868
2890
|
});
|
|
2869
2891
|
/**
|
|
@@ -2954,6 +2976,9 @@ const SubMenu = /*#__PURE__*/React__namespace.forwardRef(function SubMenu({
|
|
|
2954
2976
|
}, [parentMenuHide, parentMenuItemSelect, onItemSelect]);
|
|
2955
2977
|
const [button, list] = React__namespace.Children.toArray(children);
|
|
2956
2978
|
const buttonElement = button;
|
|
2979
|
+
const subMenuContextValue = React__namespace.useMemo(() => ({
|
|
2980
|
+
isSubMenu: true
|
|
2981
|
+
}), []);
|
|
2957
2982
|
return /*#__PURE__*/React__namespace.createElement(Menu, {
|
|
2958
2983
|
onItemSelect: handleSubItemSelect
|
|
2959
2984
|
}, /*#__PURE__*/React__namespace.createElement(react.MenuItem, {
|
|
@@ -2961,7 +2986,9 @@ const SubMenu = /*#__PURE__*/React__namespace.forwardRef(function SubMenu({
|
|
|
2961
2986
|
ref: ref,
|
|
2962
2987
|
hideOnClick: false,
|
|
2963
2988
|
render: buttonElement
|
|
2964
|
-
}, buttonElement.props.children),
|
|
2989
|
+
}, buttonElement.props.children), /*#__PURE__*/React__namespace.createElement(SubMenuContext.Provider, {
|
|
2990
|
+
value: subMenuContextValue
|
|
2991
|
+
}, list));
|
|
2965
2992
|
});
|
|
2966
2993
|
/**
|
|
2967
2994
|
* A way to semantically group some menu items.
|