@doist/reactist 12.0.1 → 12.0.4
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 +12 -14
- 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/components/menu/menu.js +3 -2
- package/es/components/menu/menu.js.map +1 -1
- package/es/components/tooltip/tooltip.js +9 -12
- package/es/components/tooltip/tooltip.js.map +1 -1
- package/lib/components/menu/menu.d.ts +2 -1
- package/lib/components/menu/menu.js +1 -1
- package/lib/components/menu/menu.js.map +1 -1
- package/lib/components/tooltip/tooltip.js +1 -1
- package/lib/components/tooltip/tooltip.js.map +1 -1
- package/package.json +1 -1
- package/styles/menu.css +1 -1
- package/styles/reactist.css +1 -1
|
@@ -491,6 +491,8 @@ function Tooltip(_ref) {
|
|
|
491
491
|
|
|
492
492
|
|
|
493
493
|
function handleFocus(event) {
|
|
494
|
+
var _child$props;
|
|
495
|
+
|
|
494
496
|
// If focus is not followed by a key up event, does it mean that it's not
|
|
495
497
|
// an intentional keyboard focus? Not sure but it seems to work.
|
|
496
498
|
// This may be resolved soon in an upcoming version of reakit:
|
|
@@ -508,21 +510,16 @@ function Tooltip(_ref) {
|
|
|
508
510
|
}); // Prevent tooltip.show from being called by TooltipReference
|
|
509
511
|
|
|
510
512
|
event.preventDefault();
|
|
511
|
-
child.props.onFocus == null ? void 0 :
|
|
513
|
+
child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.onFocus == null ? void 0 : _child$props.onFocus(event);
|
|
512
514
|
}
|
|
513
515
|
|
|
514
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(tooltip.TooltipAnchor, {
|
|
515
|
-
state: state
|
|
516
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(tooltip.TooltipAnchor, _objectSpread2(_objectSpread2({
|
|
517
|
+
state: state
|
|
518
|
+
}, child.props), {}, {
|
|
519
|
+
ref: child.ref,
|
|
516
520
|
onFocus: handleFocus
|
|
517
|
-
}, anchorProps => {
|
|
518
|
-
|
|
519
|
-
onFocus,
|
|
520
|
-
onBlur
|
|
521
|
-
} = anchorProps;
|
|
522
|
-
return /*#__PURE__*/React__default.cloneElement(child, _objectSpread2(_objectSpread2(_objectSpread2({}, anchorProps), child.props), {}, {
|
|
523
|
-
onFocus,
|
|
524
|
-
onBlur
|
|
525
|
-
}));
|
|
521
|
+
}), anchorProps => {
|
|
522
|
+
return /*#__PURE__*/React__default.cloneElement(child, anchorProps);
|
|
526
523
|
}), state.visible ? /*#__PURE__*/React__default.createElement(tooltip.Tooltip, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
527
524
|
state: state,
|
|
528
525
|
className: classNames('reactist_tooltip', className)
|
|
@@ -3163,7 +3160,8 @@ const MenuContext = /*#__PURE__*/React.createContext( // Ariakit gives us no mea
|
|
|
3163
3160
|
{});
|
|
3164
3161
|
/**
|
|
3165
3162
|
* Wrapper component to control a menu. It does not render anything, only providing the state
|
|
3166
|
-
* management for the menu components inside it.
|
|
3163
|
+
* management for the menu components inside it. Note that if you are relying on the `[role='menu']`
|
|
3164
|
+
* attribute to style the menu list, it is applied a `menubar` role instead in Safari.
|
|
3167
3165
|
*/
|
|
3168
3166
|
|
|
3169
3167
|
function Menu(_ref) {
|
|
@@ -3176,7 +3174,7 @@ function Menu(_ref) {
|
|
|
3176
3174
|
const state = Ariakit.useMenuState(_objectSpread2({
|
|
3177
3175
|
focusLoop: true,
|
|
3178
3176
|
gutter: 8,
|
|
3179
|
-
shift:
|
|
3177
|
+
shift: 4
|
|
3180
3178
|
}, props));
|
|
3181
3179
|
const handleItemSelect = React.useCallback(function handleItemSelect(value) {
|
|
3182
3180
|
if (onItemSelect) onItemSelect(value);
|