@dreamcommerce/aurora 2.6.9-3 → 2.6.9-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/build/cjs/packages/aurora/src/components/tooltip/index.js +4 -1
- package/build/cjs/packages/aurora/src/components/tooltip/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/tooltip/tooltip_constants.js +8 -0
- package/build/cjs/packages/aurora/src/components/tooltip/tooltip_constants.js.map +1 -0
- package/build/cjs/packages/aurora/src/css/slide/main.module.less.js +1 -1
- package/build/esm/packages/aurora/src/components/tooltip/index.js +5 -2
- package/build/esm/packages/aurora/src/components/tooltip/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/tooltip/tooltip_constants.d.ts +1 -0
- package/build/esm/packages/aurora/src/components/tooltip/tooltip_constants.js +4 -0
- package/build/esm/packages/aurora/src/components/tooltip/tooltip_constants.js.map +1 -0
- package/build/esm/packages/aurora/src/css/slide/main.module.less.js +1 -1
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@ var main_module = require('../../css/tooltip/main.module.less.js');
|
|
|
8
8
|
var use_toggle = require('../dropdown/hooks/use_toggle.js');
|
|
9
9
|
var index$1 = require('../dropdown/index.js');
|
|
10
10
|
var css_classes = require('./css_classes.js');
|
|
11
|
+
var tooltip_constants = require('./tooltip_constants.js');
|
|
11
12
|
|
|
12
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
14
|
|
|
@@ -17,11 +18,13 @@ const Tooltip = ({ left, top, disabled, onToggle, children, content }) => {
|
|
|
17
18
|
const wrapperRef = React.useRef(null);
|
|
18
19
|
const [isOpen, toggleDropdown] = use_toggle.useToggle(false, onToggle);
|
|
19
20
|
const value = React__default['default'].useMemo(() => ({ wrapperRef, isOpen, toggleDropdown }), [isOpen, toggleDropdown]);
|
|
21
|
+
const [tooltipTimer, setTooltipTimer] = React.useState();
|
|
20
22
|
const handleOnMouseEnter = () => {
|
|
21
|
-
!isOpen && toggleDropdown();
|
|
23
|
+
!isOpen && setTooltipTimer(Number(setTimeout(() => toggleDropdown(), tooltip_constants.TOOLTIP_TIMEOUT_IN_MS)));
|
|
22
24
|
};
|
|
23
25
|
const handleOnMouseLeave = () => {
|
|
24
26
|
isOpen && toggleDropdown();
|
|
27
|
+
clearTimeout(tooltipTimer);
|
|
25
28
|
};
|
|
26
29
|
return (React__default['default'].createElement(index.DropdownContext.Provider, { value: value },
|
|
27
30
|
React__default['default'].createElement("span", { className: main_module['default'][css_classes.cssTooltip], ref: wrapperRef, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var styleInject_es = require('../../../../../external/style-inject/dist/style-inject.es.js');
|
|
6
6
|
|
|
7
|
-
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n@-webkit-keyframes main-module_directionLeftShow__1VVi1 {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n@keyframes main-module_directionLeftShow__1VVi1 {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n@-webkit-keyframes main-module_directionLeftHide__QSuRw {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n}\n@keyframes main-module_directionLeftHide__QSuRw {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n}\n.main-module_slide__1kcca {\n position: absolute;\n top: 0;\n height: 100%;\n background-color: #fff;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n overflow-y: hidden;\n z-index: 1;\n}\n.main-module_slide__wrapper__3mC8j {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.main-module_slide__header__11UTh {\n width: 100%;\n border-bottom: 2px solid transparent;\n background-color: #fff;\n}\n.main-module_slide__sub-header__7iIPF {\n width: 100%;\n border-bottom: 2px solid transparent;\n background-color: #f3f4f8;\n display: flex;\n align-items: center;\n padding: 1rem
|
|
7
|
+
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n@-webkit-keyframes main-module_directionLeftShow__1VVi1 {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n@keyframes main-module_directionLeftShow__1VVi1 {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n@-webkit-keyframes main-module_directionLeftHide__QSuRw {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n}\n@keyframes main-module_directionLeftHide__QSuRw {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n}\n.main-module_slide__1kcca {\n position: absolute;\n top: 0;\n height: 100%;\n background-color: #fff;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n overflow-y: hidden;\n z-index: 1;\n}\n.main-module_slide__wrapper__3mC8j {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.main-module_slide__header__11UTh {\n width: 100%;\n border-bottom: 2px solid transparent;\n background-color: #fff;\n}\n.main-module_slide__sub-header__7iIPF {\n width: 100%;\n border-bottom: 2px solid transparent;\n background-color: #f3f4f8;\n display: flex;\n align-items: center;\n padding: 1rem;\n}\n.main-module_slide__content__3KeZM {\n flex: 1;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.main-module_slide__footer__3wvMP {\n padding: 0.5rem 1rem 0.5rem 1rem;\n background-color: #f3f4f8;\n border-top: 1px solid #abb4cd;\n box-shadow: 0 1px 5px 0 rgba(171, 180, 205, 0.6);\n}\n.main-module_slide_direction-left__Rg5kV {\n right: 0;\n left: 0;\n -webkit-animation-name: main-module_directionLeftHide__QSuRw;\n animation-name: main-module_directionLeftHide__QSuRw;\n}\n.main-module_slide_direction-left__Rg5kV.main-module_slide_is-open__3twK9 {\n -webkit-animation-name: main-module_directionLeftShow__1VVi1;\n animation-name: main-module_directionLeftShow__1VVi1;\n}\n";
|
|
8
8
|
var cssClasses = {"slide":"main-module_slide__1kcca","slide__wrapper":"main-module_slide__wrapper__3mC8j","slide__header":"main-module_slide__header__11UTh","slide__sub-header":"main-module_slide__sub-header__7iIPF","slide__content":"main-module_slide__content__3KeZM","slide__footer":"main-module_slide__footer__3wvMP","slide_direction-left":"main-module_slide_direction-left__Rg5kV","directionLeftHide":"main-module_directionLeftHide__QSuRw","slide_is-open":"main-module_slide_is-open__3twK9","directionLeftShow":"main-module_directionLeftShow__1VVi1"};
|
|
9
9
|
styleInject_es['default'](css_248z);
|
|
10
10
|
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
2
|
import { DropdownContext } from '../dropdown/context/index.js';
|
|
3
3
|
import cssClasses from '../../css/tooltip/main.module.less.js';
|
|
4
4
|
import { useToggle } from '../dropdown/hooks/use_toggle.js';
|
|
5
5
|
import Dropdown from '../dropdown/index.js';
|
|
6
6
|
import { cssTooltip, cssTooltipContainer } from './css_classes.js';
|
|
7
|
+
import { TOOLTIP_TIMEOUT_IN_MS } from './tooltip_constants.js';
|
|
7
8
|
|
|
8
9
|
const Tooltip = ({ left, top, disabled, onToggle, children, content }) => {
|
|
9
10
|
const wrapperRef = useRef(null);
|
|
10
11
|
const [isOpen, toggleDropdown] = useToggle(false, onToggle);
|
|
11
12
|
const value = React.useMemo(() => ({ wrapperRef, isOpen, toggleDropdown }), [isOpen, toggleDropdown]);
|
|
13
|
+
const [tooltipTimer, setTooltipTimer] = useState();
|
|
12
14
|
const handleOnMouseEnter = () => {
|
|
13
|
-
!isOpen && toggleDropdown();
|
|
15
|
+
!isOpen && setTooltipTimer(Number(setTimeout(() => toggleDropdown(), TOOLTIP_TIMEOUT_IN_MS)));
|
|
14
16
|
};
|
|
15
17
|
const handleOnMouseLeave = () => {
|
|
16
18
|
isOpen && toggleDropdown();
|
|
19
|
+
clearTimeout(tooltipTimer);
|
|
17
20
|
};
|
|
18
21
|
return (React.createElement(DropdownContext.Provider, { value: value },
|
|
19
22
|
React.createElement("span", { className: cssClasses[cssTooltip], ref: wrapperRef, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TOOLTIP_TIMEOUT_IN_MS = 150;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../../../../external/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n@-webkit-keyframes main-module_directionLeftShow__1VVi1 {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n@keyframes main-module_directionLeftShow__1VVi1 {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n@-webkit-keyframes main-module_directionLeftHide__QSuRw {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n}\n@keyframes main-module_directionLeftHide__QSuRw {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n}\n.main-module_slide__1kcca {\n position: absolute;\n top: 0;\n height: 100%;\n background-color: #fff;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n overflow-y: hidden;\n z-index: 1;\n}\n.main-module_slide__wrapper__3mC8j {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.main-module_slide__header__11UTh {\n width: 100%;\n border-bottom: 2px solid transparent;\n background-color: #fff;\n}\n.main-module_slide__sub-header__7iIPF {\n width: 100%;\n border-bottom: 2px solid transparent;\n background-color: #f3f4f8;\n display: flex;\n align-items: center;\n padding: 1rem
|
|
3
|
+
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n@-webkit-keyframes main-module_directionLeftShow__1VVi1 {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n@keyframes main-module_directionLeftShow__1VVi1 {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n@-webkit-keyframes main-module_directionLeftHide__QSuRw {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n}\n@keyframes main-module_directionLeftHide__QSuRw {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n}\n.main-module_slide__1kcca {\n position: absolute;\n top: 0;\n height: 100%;\n background-color: #fff;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n overflow-y: hidden;\n z-index: 1;\n}\n.main-module_slide__wrapper__3mC8j {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.main-module_slide__header__11UTh {\n width: 100%;\n border-bottom: 2px solid transparent;\n background-color: #fff;\n}\n.main-module_slide__sub-header__7iIPF {\n width: 100%;\n border-bottom: 2px solid transparent;\n background-color: #f3f4f8;\n display: flex;\n align-items: center;\n padding: 1rem;\n}\n.main-module_slide__content__3KeZM {\n flex: 1;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.main-module_slide__footer__3wvMP {\n padding: 0.5rem 1rem 0.5rem 1rem;\n background-color: #f3f4f8;\n border-top: 1px solid #abb4cd;\n box-shadow: 0 1px 5px 0 rgba(171, 180, 205, 0.6);\n}\n.main-module_slide_direction-left__Rg5kV {\n right: 0;\n left: 0;\n -webkit-animation-name: main-module_directionLeftHide__QSuRw;\n animation-name: main-module_directionLeftHide__QSuRw;\n}\n.main-module_slide_direction-left__Rg5kV.main-module_slide_is-open__3twK9 {\n -webkit-animation-name: main-module_directionLeftShow__1VVi1;\n animation-name: main-module_directionLeftShow__1VVi1;\n}\n";
|
|
4
4
|
var cssClasses = {"slide":"main-module_slide__1kcca","slide__wrapper":"main-module_slide__wrapper__3mC8j","slide__header":"main-module_slide__header__11UTh","slide__sub-header":"main-module_slide__sub-header__7iIPF","slide__content":"main-module_slide__content__3KeZM","slide__footer":"main-module_slide__footer__3wvMP","slide_direction-left":"main-module_slide_direction-left__Rg5kV","directionLeftHide":"main-module_directionLeftHide__QSuRw","slide_is-open":"main-module_slide_is-open__3twK9","directionLeftShow":"main-module_directionLeftShow__1VVi1"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@dreamcommerce/aurora",
|
|
3
3
|
"packageManager": "yarn@3.2.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "2.6.9-
|
|
5
|
+
"version": "2.6.9-4",
|
|
6
6
|
"description": "aurora",
|
|
7
7
|
"author": "k0ssak",
|
|
8
8
|
"license": "MIT",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"update-visuals": "jest -c .config/jest/jest.config.visual.js --updateSnapshot"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@dreamcommerce/utilities": "^1.9.
|
|
47
|
+
"@dreamcommerce/utilities": "^1.9.1",
|
|
48
48
|
"@shoper/jest_config": "^0.0.0",
|
|
49
49
|
"@shoper/tsconfig": "^0.0.0",
|
|
50
50
|
"@storybook/react": "6.5.7",
|