@doist/reactist 26.0.0 → 26.1.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 +27 -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 +4 -2
- 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 +11 -1
- 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
|
@@ -581,12 +581,14 @@ function Tooltip({
|
|
|
581
581
|
position = 'top',
|
|
582
582
|
gapSize = 3,
|
|
583
583
|
withArrow = false,
|
|
584
|
+
showTimeout = 500,
|
|
585
|
+
hideTimeout = 100,
|
|
584
586
|
exceptionallySetClassName
|
|
585
587
|
}) {
|
|
586
588
|
const tooltip = react.useTooltipStore({
|
|
587
589
|
placement: position,
|
|
588
|
-
showTimeout
|
|
589
|
-
hideTimeout
|
|
590
|
+
showTimeout,
|
|
591
|
+
hideTimeout
|
|
590
592
|
});
|
|
591
593
|
const isOpen = tooltip.useState('open');
|
|
592
594
|
const child = React__namespace.Children.only(children);
|
|
@@ -808,7 +810,7 @@ function CloseIcon(props) {
|
|
|
808
810
|
}));
|
|
809
811
|
}
|
|
810
812
|
|
|
811
|
-
var modules_6205a58e = {"container":"
|
|
813
|
+
var modules_6205a58e = {"container":"d6be7fe9","content":"ad8ace2f","icon":"ab71a9dc","tone-info":"_043941a6","tone-positive":"f34b89d4","tone-caution":"a069ea07","tone-critical":"e505aabb"};
|
|
812
814
|
|
|
813
815
|
function Alert({
|
|
814
816
|
id,
|
|
@@ -833,10 +835,13 @@ function Alert({
|
|
|
833
835
|
className: modules_6205a58e.icon
|
|
834
836
|
})), /*#__PURE__*/React__namespace.createElement(Column, null, /*#__PURE__*/React__namespace.createElement(Box$1, {
|
|
835
837
|
paddingY: "xsmall",
|
|
836
|
-
paddingRight: onClose != null && closeLabel != null ? undefined : 'small'
|
|
838
|
+
paddingRight: onClose != null && closeLabel != null ? undefined : 'small',
|
|
839
|
+
display: "flex",
|
|
840
|
+
alignItems: "center",
|
|
841
|
+
className: modules_6205a58e.content
|
|
837
842
|
}, children)), onClose != null && closeLabel != null ? /*#__PURE__*/React__namespace.createElement(Column, {
|
|
838
843
|
width: "content"
|
|
839
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
844
|
+
}, /*#__PURE__*/React__namespace.createElement(IconButton, {
|
|
840
845
|
variant: "quaternary",
|
|
841
846
|
size: "small",
|
|
842
847
|
onClick: onClose,
|
|
@@ -2739,7 +2744,7 @@ function TabAwareSlot({
|
|
|
2739
2744
|
const _excluded$4 = ["children", "onItemSelect"],
|
|
2740
2745
|
_excluded2 = ["exceptionallySetClassName"],
|
|
2741
2746
|
_excluded3 = ["render"],
|
|
2742
|
-
_excluded4 = ["exceptionallySetClassName", "modal"],
|
|
2747
|
+
_excluded4 = ["exceptionallySetClassName", "modal", "flip"],
|
|
2743
2748
|
_excluded5 = ["value", "children", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName"],
|
|
2744
2749
|
_excluded6 = ["label", "children", "exceptionallySetClassName"];
|
|
2745
2750
|
const MenuContext = /*#__PURE__*/React__namespace.createContext({
|
|
@@ -2748,6 +2753,9 @@ const MenuContext = /*#__PURE__*/React__namespace.createContext({
|
|
|
2748
2753
|
getAnchorRect: null,
|
|
2749
2754
|
setAnchorRect: () => undefined
|
|
2750
2755
|
});
|
|
2756
|
+
const SubMenuContext = /*#__PURE__*/React__namespace.createContext({
|
|
2757
|
+
isSubMenu: false
|
|
2758
|
+
});
|
|
2751
2759
|
/**
|
|
2752
2760
|
* Wrapper component to control a menu. It does not render anything, only providing the state
|
|
2753
2761
|
* management for the menu components inside it.
|
|
@@ -2840,7 +2848,8 @@ const ContextMenuTrigger = /*#__PURE__*/React__namespace.forwardRef(function Con
|
|
|
2840
2848
|
const MenuList = /*#__PURE__*/React__namespace.forwardRef(function MenuList(_ref4, ref) {
|
|
2841
2849
|
let {
|
|
2842
2850
|
exceptionallySetClassName,
|
|
2843
|
-
modal = true
|
|
2851
|
+
modal = true,
|
|
2852
|
+
flip
|
|
2844
2853
|
} = _ref4,
|
|
2845
2854
|
props = _objectWithoutProperties(_ref4, _excluded4);
|
|
2846
2855
|
|
|
@@ -2853,6 +2862,9 @@ const MenuList = /*#__PURE__*/React__namespace.forwardRef(function MenuList(_ref
|
|
|
2853
2862
|
throw new Error('MenuList must be wrapped in <Menu/>');
|
|
2854
2863
|
}
|
|
2855
2864
|
|
|
2865
|
+
const {
|
|
2866
|
+
isSubMenu
|
|
2867
|
+
} = React__namespace.useContext(SubMenuContext);
|
|
2856
2868
|
const isOpen = menuStore.useState('open');
|
|
2857
2869
|
return isOpen ? /*#__PURE__*/React__namespace.createElement(react.Portal, {
|
|
2858
2870
|
preserveTabOrder: true
|
|
@@ -2863,7 +2875,8 @@ const MenuList = /*#__PURE__*/React__namespace.forwardRef(function MenuList(_ref
|
|
|
2863
2875
|
ref: ref,
|
|
2864
2876
|
className: classNames__default["default"]('reactist_menulist', exceptionallySetClassName),
|
|
2865
2877
|
getAnchorRect: getAnchorRect != null ? getAnchorRect : undefined,
|
|
2866
|
-
modal: modal
|
|
2878
|
+
modal: modal,
|
|
2879
|
+
flip: flip != null ? flip : isSubMenu ? 'bottom' : undefined
|
|
2867
2880
|
}))) : null;
|
|
2868
2881
|
});
|
|
2869
2882
|
/**
|
|
@@ -2954,6 +2967,9 @@ const SubMenu = /*#__PURE__*/React__namespace.forwardRef(function SubMenu({
|
|
|
2954
2967
|
}, [parentMenuHide, parentMenuItemSelect, onItemSelect]);
|
|
2955
2968
|
const [button, list] = React__namespace.Children.toArray(children);
|
|
2956
2969
|
const buttonElement = button;
|
|
2970
|
+
const subMenuContextValue = React__namespace.useMemo(() => ({
|
|
2971
|
+
isSubMenu: true
|
|
2972
|
+
}), []);
|
|
2957
2973
|
return /*#__PURE__*/React__namespace.createElement(Menu, {
|
|
2958
2974
|
onItemSelect: handleSubItemSelect
|
|
2959
2975
|
}, /*#__PURE__*/React__namespace.createElement(react.MenuItem, {
|
|
@@ -2961,7 +2977,9 @@ const SubMenu = /*#__PURE__*/React__namespace.forwardRef(function SubMenu({
|
|
|
2961
2977
|
ref: ref,
|
|
2962
2978
|
hideOnClick: false,
|
|
2963
2979
|
render: buttonElement
|
|
2964
|
-
}, buttonElement.props.children),
|
|
2980
|
+
}, buttonElement.props.children), /*#__PURE__*/React__namespace.createElement(SubMenuContext.Provider, {
|
|
2981
|
+
value: subMenuContextValue
|
|
2982
|
+
}, list));
|
|
2965
2983
|
});
|
|
2966
2984
|
/**
|
|
2967
2985
|
* A way to semantically group some menu items.
|