colibri-ui 0.7.62 → 0.7.64
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/Button/Button.module.css +35 -7
- package/Button/index.js +2 -3
- package/Checkbox/Checkbox.module.css +7 -7
- package/Icons/Setting.js +40 -0
- package/Icons/index.d.ts +1 -0
- package/Icons/index.js +2 -0
- package/InputRadio/InputRadio.module.css +8 -8
- package/Switch/Switch.module.css +4 -4
- package/Theme/colors/index.d.ts +2 -0
- package/Theme/colors/theme_buenos_aires.d.ts +4 -0
- package/Theme/colors/theme_buenos_aires.js +20 -18
- package/Theme/index.d.ts +104 -16
- package/Theme/themes/buenos_aires.d.ts +79 -0
- package/Theme/themes/buenos_aires.js +80 -1
- package/Theme/themes/default.d.ts +25 -16
- package/Theme/themes/default.js +41 -32
- package/TimeSelect/Label/index.js +23 -0
- package/TimeSelect/helpers.js +28 -0
- package/TimeSelect/index.js +41 -0
- package/Tooltip/Tooltip.module.css +122 -0
- package/Tooltip/index.d.ts +4 -0
- package/Tooltip/index.js +111 -0
- package/Tooltip/index.props.d.ts +13 -0
- package/Tooltip/package.json +6 -0
- package/Typography/index.d.ts +1 -1
- package/base/InputRoot/InputRoot.module.css +5 -5
- package/esm/Button/Button.module.css +35 -7
- package/esm/Button/index.js +2 -3
- package/esm/Checkbox/Checkbox.module.css +7 -7
- package/esm/Icons/Setting.js +32 -0
- package/esm/Icons/index.d.ts +1 -0
- package/esm/Icons/index.js +1 -0
- package/esm/InputRadio/InputRadio.module.css +8 -8
- package/esm/Switch/Switch.module.css +4 -4
- package/esm/Theme/colors/index.d.ts +2 -0
- package/esm/Theme/colors/theme_buenos_aires.d.ts +4 -0
- package/esm/Theme/colors/theme_buenos_aires.js +20 -18
- package/esm/Theme/index.d.ts +104 -16
- package/esm/Theme/themes/buenos_aires.d.ts +79 -0
- package/esm/Theme/themes/buenos_aires.js +80 -1
- package/esm/Theme/themes/default.d.ts +25 -16
- package/esm/Theme/themes/default.js +41 -32
- package/esm/TimeSelect/Label/index.js +15 -0
- package/esm/TimeSelect/helpers.js +24 -0
- package/esm/TimeSelect/index.js +33 -0
- package/esm/Tooltip/Tooltip.module.css +122 -0
- package/esm/Tooltip/index.d.ts +4 -0
- package/esm/Tooltip/index.js +101 -0
- package/esm/Tooltip/index.props.d.ts +13 -0
- package/esm/Typography/index.d.ts +1 -1
- package/esm/base/InputRoot/InputRoot.module.css +5 -5
- package/esm/index.d.ts +4 -0
- package/esm/index.js +5 -0
- package/esm/theme_ba_variables.css +92 -13
- package/esm/theme_default_variables.css +41 -32
- package/index.d.ts +4 -0
- package/index.js +14 -4
- package/package.json +1 -1
- package/theme_ba_variables.css +92 -13
- package/theme_default_variables.css +41 -32
|
@@ -25,7 +25,7 @@ var THEME_DEFAULT = {
|
|
|
25
25
|
"typography-alert": Color.ALERT,
|
|
26
26
|
"typography-success": Color.SUCCESS,
|
|
27
27
|
"typography-secondary": Color.BG_3,
|
|
28
|
-
"button-border-radius": "
|
|
28
|
+
"button-border-radius": "18px",
|
|
29
29
|
"button-primary-color": Color.WHITE,
|
|
30
30
|
"button-primary-background-color": Color.PRIMARY_DEFAULT_4,
|
|
31
31
|
"button-primary-border-color": Color.PRIMARY_DEFAULT_4,
|
|
@@ -35,7 +35,7 @@ var THEME_DEFAULT = {
|
|
|
35
35
|
"button-primary-color-active": Color.WHITE,
|
|
36
36
|
"button-primary-background-color-active": Color.PRIMARY_DEFAULT_5,
|
|
37
37
|
"button-primary-border-color-active": Color.PRIMARY_DEFAULT_5,
|
|
38
|
-
"button-primary-color-disabled": Color.
|
|
38
|
+
"button-primary-color-disabled": Color.BG_4,
|
|
39
39
|
"button-primary-background-color-disabled": Color.PRIMARY_DEFAULT_1,
|
|
40
40
|
"button-primary-border-color-disabled": Color.PRIMARY_DEFAULT_1,
|
|
41
41
|
"button-secondary-color": Color.WHITE,
|
|
@@ -47,21 +47,21 @@ var THEME_DEFAULT = {
|
|
|
47
47
|
"button-secondary-color-active": Color.WHITE,
|
|
48
48
|
"button-secondary-background-color-active": Color.SECONDARY_DEFAULT_5,
|
|
49
49
|
"button-secondary-border-color-active": Color.SECONDARY_DEFAULT_5,
|
|
50
|
-
"button-secondary-color-disabled": Color.
|
|
50
|
+
"button-secondary-color-disabled": Color.BG_4,
|
|
51
51
|
"button-secondary-background-color-disabled": Color.SECONDARY_DEFAULT_1,
|
|
52
52
|
"button-secondary-border-color-disabled": Color.SECONDARY_DEFAULT_1,
|
|
53
|
-
"button-pseudo-color": Color.
|
|
54
|
-
"button-pseudo-background-color": Color.
|
|
55
|
-
"button-pseudo-border-color": Color.
|
|
56
|
-
"button-pseudo-color-hovered": Color.
|
|
57
|
-
"button-pseudo-background-color-hovered": Color.
|
|
58
|
-
"button-pseudo-border-color-hovered": Color.
|
|
59
|
-
"button-pseudo-color-active": Color.
|
|
53
|
+
"button-pseudo-color": Color.BLACK,
|
|
54
|
+
"button-pseudo-background-color": Color.TRETIARY_DEFAULT_1,
|
|
55
|
+
"button-pseudo-border-color": Color.TRETIARY_DEFAULT_1,
|
|
56
|
+
"button-pseudo-color-hovered": Color.BLACK,
|
|
57
|
+
"button-pseudo-background-color-hovered": Color.TRETIARY_DEFAULT_1,
|
|
58
|
+
"button-pseudo-border-color-hovered": Color.TRETIARY_DEFAULT_1,
|
|
59
|
+
"button-pseudo-color-active": Color.BLACK,
|
|
60
60
|
"button-pseudo-background-color-active": Color.TRETIARY_DEFAULT_2,
|
|
61
61
|
"button-pseudo-border-color-active": Color.TRETIARY_DEFAULT_2,
|
|
62
|
-
"button-pseudo-color-disabled": Color.
|
|
63
|
-
"button-pseudo-background-color-disabled": Color.
|
|
64
|
-
"button-pseudo-border-color-disabled": Color.
|
|
62
|
+
"button-pseudo-color-disabled": Color.BG_4,
|
|
63
|
+
"button-pseudo-background-color-disabled": Color.TRETIARY_DEFAULT_1,
|
|
64
|
+
"button-pseudo-border-color-disabled": Color.TRETIARY_DEFAULT_1,
|
|
65
65
|
"button-outline-color": Color.BLACK,
|
|
66
66
|
"button-outline-background-color": Color.WHITE,
|
|
67
67
|
"button-outline-border-color": Color.BG_3,
|
|
@@ -71,30 +71,39 @@ var THEME_DEFAULT = {
|
|
|
71
71
|
"button-outline-color-active": Color.BLACK,
|
|
72
72
|
"button-outline-background-color-active": Color.BG_2,
|
|
73
73
|
"button-outline-border-color-active": Color.BG_3,
|
|
74
|
-
"button-outline-color-disabled": Color.
|
|
75
|
-
"button-outline-background-color-disabled": Color.
|
|
74
|
+
"button-outline-color-disabled": Color.BG_4,
|
|
75
|
+
"button-outline-background-color-disabled": Color.WHITE,
|
|
76
76
|
"button-outline-border-color-disabled": Color.BG_2,
|
|
77
77
|
"button-clear-color": Color.PRIMARY_DEFAULT_4,
|
|
78
|
-
"button-clear-color-hovered": Color.
|
|
78
|
+
"button-clear-color-hovered": Color.PRIMARY_DEFAULT_4,
|
|
79
79
|
"button-clear-color-active": Color.PRIMARY_DEFAULT_5,
|
|
80
|
+
"button-clear-color-disabled": Color.BG_4,
|
|
81
|
+
"button-clear-background-color-disabled": Color.WHITE,
|
|
82
|
+
"button-clear-border-color-disabled": Color.WHITE,
|
|
80
83
|
"input-primary-border-color": Color.BG_3,
|
|
81
84
|
"input-primary-plaseholder-color": Color.BG_2,
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"checkbox-
|
|
86
|
-
"checkbox-
|
|
87
|
-
"checkbox-
|
|
88
|
-
"checkbox-
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"switch-
|
|
85
|
+
"input-primary-border-color-error": Color.ALERT,
|
|
86
|
+
"input-primary-background-color-error": Color.TRETIARY_DEFAULT_2,
|
|
87
|
+
"input-primary-box-shadow-color-error": Color.TRETIARY_DEFAULT_2,
|
|
88
|
+
"checkbox-background-color-checked": Color.PRIMARY_DEFAULT_4,
|
|
89
|
+
"checkbox-background-color-hovered": Color.PRIMARY_DEFAULT_4,
|
|
90
|
+
"checkbox-box-shadow-focused": Color.PRIMARY_DEFAULT_1,
|
|
91
|
+
"checkbox-background-color-active": Color.PRIMARY_DEFAULT_4,
|
|
92
|
+
"checkbox-border-color-active": Color.PRIMARY_DEFAULT_4,
|
|
93
|
+
"checkbox-box-shadow-active": Color.PRIMARY_DEFAULT_4,
|
|
94
|
+
"checkbox-background-color-disabled": Color.PRIMARY_DEFAULT_1,
|
|
95
|
+
"input-radio-background-color-checked": Color.PRIMARY_DEFAULT_4,
|
|
96
|
+
"input-radio-background-color-hovered": Color.PRIMARY_DEFAULT_4,
|
|
97
|
+
"input-radio-box-shadow-focused": Color.PRIMARY_DEFAULT_1,
|
|
98
|
+
"input-radio-background-color-focused": Color.PRIMARY_DEFAULT_1,
|
|
99
|
+
"input-radio-border-color-focused": Color.PRIMARY_DEFAULT_1,
|
|
100
|
+
"switch-background-color": Color.BG_2,
|
|
101
|
+
"switch-border-color": Color.BG_2,
|
|
102
|
+
"switch-background-color-checked": Color.PRIMARY_DEFAULT_5,
|
|
103
|
+
"switch-border-color-checked": Color.PRIMARY_DEFAULT_5,
|
|
104
|
+
"tooltip-background-color": Color.BLACK,
|
|
105
|
+
"tooltip-color": Color.WHITE,
|
|
106
|
+
"tooltip-border-radius": "4px"
|
|
98
107
|
};
|
|
99
108
|
|
|
100
109
|
export { THEME_DEFAULT as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React__default, { useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
var OptionLabel = function OptionLabel(_a) {
|
|
4
|
+
var time = _a.time,
|
|
5
|
+
onClick = _a.onClick,
|
|
6
|
+
onMouseEnter = _a.onMouseEnter;
|
|
7
|
+
var ref = useRef(null);
|
|
8
|
+
return /*#__PURE__*/React__default.createElement("span", {
|
|
9
|
+
onClick: onClick,
|
|
10
|
+
onMouseEnter: onMouseEnter,
|
|
11
|
+
ref: ref
|
|
12
|
+
}, time);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { OptionLabel as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { format, addMinutes } from 'date-fns';
|
|
2
|
+
|
|
3
|
+
var day = new Date();
|
|
4
|
+
day.setHours(24, 0, 0, 0);
|
|
5
|
+
var DEFAULT_TIME = {
|
|
6
|
+
index: 24,
|
|
7
|
+
time: "12:00"
|
|
8
|
+
};
|
|
9
|
+
var formatTime = function formatTime(date) {
|
|
10
|
+
return format(date, "HH:mm");
|
|
11
|
+
};
|
|
12
|
+
var generateSuggest = function generateSuggest(interval) {
|
|
13
|
+
if (interval === void 0) {
|
|
14
|
+
interval = 15;
|
|
15
|
+
}
|
|
16
|
+
return new Array(24 * 60 / interval).fill(null).map(function (_, index) {
|
|
17
|
+
var date = addMinutes(day, index * interval);
|
|
18
|
+
return {
|
|
19
|
+
time: formatTime(date)
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { DEFAULT_TIME, formatTime, generateSuggest };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
|
+
import React__default, { useMemo } from 'react';
|
|
3
|
+
import Select from '../Select/index.js';
|
|
4
|
+
import { generateSuggest } from './helpers.js';
|
|
5
|
+
import OptionLabel from './Label/index.js';
|
|
6
|
+
|
|
7
|
+
var TimeSelect = function TimeSelect(_a) {
|
|
8
|
+
var value = _a.value,
|
|
9
|
+
_b = _a.label,
|
|
10
|
+
label = _b === void 0 ? "Start time" : _b,
|
|
11
|
+
_c = _a.interval,
|
|
12
|
+
interval = _c === void 0 ? 15 : _c,
|
|
13
|
+
onChange = _a.onChange,
|
|
14
|
+
props = __rest(_a, ["value", "label", "interval", "onChange"]);
|
|
15
|
+
var options = useMemo(function () {
|
|
16
|
+
return generateSuggest(interval).map(function (item) {
|
|
17
|
+
return {
|
|
18
|
+
value: item.time,
|
|
19
|
+
label: /*#__PURE__*/React__default.createElement(OptionLabel, {
|
|
20
|
+
time: item.time
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
}, [interval]);
|
|
25
|
+
return /*#__PURE__*/React__default.createElement(Select, __assign({}, props, {
|
|
26
|
+
value: value,
|
|
27
|
+
label: label,
|
|
28
|
+
options: options,
|
|
29
|
+
onChange: onChange
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { TimeSelect as default };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
.root[data-popper-placement=bottom-start] {
|
|
2
|
+
padding-top: 4px;
|
|
3
|
+
}
|
|
4
|
+
.root[data-popper-placement=bottom-start]::before {
|
|
5
|
+
left: 6px;
|
|
6
|
+
top: 0;
|
|
7
|
+
}
|
|
8
|
+
.root[data-popper-placement=bottom-end] {
|
|
9
|
+
padding-top: 4px;
|
|
10
|
+
}
|
|
11
|
+
.root[data-popper-placement=bottom-end]::before {
|
|
12
|
+
right: 6px;
|
|
13
|
+
top: 0;
|
|
14
|
+
}
|
|
15
|
+
.root[data-popper-placement=bottom] {
|
|
16
|
+
padding-top: 4px;
|
|
17
|
+
}
|
|
18
|
+
.root[data-popper-placement=bottom]::before {
|
|
19
|
+
left: 50%;
|
|
20
|
+
top: 0;
|
|
21
|
+
transform: translate(-50%, 0);
|
|
22
|
+
}
|
|
23
|
+
.root[data-popper-placement=right] {
|
|
24
|
+
padding-left: 4px;
|
|
25
|
+
}
|
|
26
|
+
.root[data-popper-placement=right]::before {
|
|
27
|
+
left: -6px;
|
|
28
|
+
top: 50%;
|
|
29
|
+
transform: translate(0, -50%) rotate(-90deg);
|
|
30
|
+
}
|
|
31
|
+
.root[data-popper-placement=right-start] {
|
|
32
|
+
padding-left: 4px;
|
|
33
|
+
}
|
|
34
|
+
.root[data-popper-placement=right-start]::before {
|
|
35
|
+
left: -6px;
|
|
36
|
+
top: 6px;
|
|
37
|
+
transform: rotate(-90deg);
|
|
38
|
+
}
|
|
39
|
+
.root[data-popper-placement=right-end] {
|
|
40
|
+
padding-left: 4px;
|
|
41
|
+
}
|
|
42
|
+
.root[data-popper-placement=right-end]::before {
|
|
43
|
+
bottom: 6px;
|
|
44
|
+
left: -6px;
|
|
45
|
+
transform: rotate(-90deg);
|
|
46
|
+
}
|
|
47
|
+
.root[data-popper-placement=left] {
|
|
48
|
+
padding-right: 4px;
|
|
49
|
+
}
|
|
50
|
+
.root[data-popper-placement=left]::before {
|
|
51
|
+
right: -6px;
|
|
52
|
+
top: 50%;
|
|
53
|
+
transform: translate(0, -50%) rotate(90deg);
|
|
54
|
+
}
|
|
55
|
+
.root[data-popper-placement=left-start] {
|
|
56
|
+
padding-right: 4px;
|
|
57
|
+
}
|
|
58
|
+
.root[data-popper-placement=left-start]::before {
|
|
59
|
+
right: -6px;
|
|
60
|
+
top: 6px;
|
|
61
|
+
transform: rotate(90deg);
|
|
62
|
+
}
|
|
63
|
+
.root[data-popper-placement=left-end] {
|
|
64
|
+
padding-right: 4px;
|
|
65
|
+
}
|
|
66
|
+
.root[data-popper-placement=left-end]::before {
|
|
67
|
+
bottom: 6px;
|
|
68
|
+
right: -6px;
|
|
69
|
+
transform: rotate(90deg);
|
|
70
|
+
}
|
|
71
|
+
.root[data-popper-placement=top] {
|
|
72
|
+
padding-bottom: 4px;
|
|
73
|
+
}
|
|
74
|
+
.root[data-popper-placement=top]::before {
|
|
75
|
+
bottom: 0;
|
|
76
|
+
left: 50%;
|
|
77
|
+
transform: translate(-50%, 0) rotate(180deg);
|
|
78
|
+
}
|
|
79
|
+
.root[data-popper-placement=top-start] {
|
|
80
|
+
padding-bottom: 4px;
|
|
81
|
+
}
|
|
82
|
+
.root[data-popper-placement=top-start]::before {
|
|
83
|
+
bottom: 0;
|
|
84
|
+
left: 6px;
|
|
85
|
+
transform: rotate(180deg);
|
|
86
|
+
}
|
|
87
|
+
.root[data-popper-placement=top-end] {
|
|
88
|
+
padding-bottom: 4px;
|
|
89
|
+
}
|
|
90
|
+
.root[data-popper-placement=top-end]::before {
|
|
91
|
+
bottom: 0;
|
|
92
|
+
right: 6px;
|
|
93
|
+
transform: rotate(180deg);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.tail {
|
|
97
|
+
position: relative;
|
|
98
|
+
}
|
|
99
|
+
.tail::before {
|
|
100
|
+
border-bottom: 5px solid var(--tooltip-background-color);
|
|
101
|
+
border-left: 6px solid transparent;
|
|
102
|
+
border-right: 6px solid transparent;
|
|
103
|
+
content: "";
|
|
104
|
+
height: 0;
|
|
105
|
+
position: absolute;
|
|
106
|
+
width: 0;
|
|
107
|
+
z-index: 3000;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.overlay {
|
|
111
|
+
background-color: var(--tooltip-background-color);
|
|
112
|
+
border-radius: var(--tooltip-border-radius);
|
|
113
|
+
color: var(--tooltip-color);
|
|
114
|
+
font-size: 14px;
|
|
115
|
+
font-style: normal;
|
|
116
|
+
font-weight: 400;
|
|
117
|
+
line-height: 18px;
|
|
118
|
+
max-width: 200px;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
padding: 4px 10px;
|
|
121
|
+
position: relative;
|
|
122
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { __assign } from 'tslib';
|
|
2
|
+
import React__default, { useState, useMemo, Children, useCallback, useEffect } from 'react';
|
|
3
|
+
import { usePopper } from 'react-popper';
|
|
4
|
+
import classNames from 'classnames/bind';
|
|
5
|
+
import Portal from '../Portal/index.js';
|
|
6
|
+
import { on } from '../helpers/on.js';
|
|
7
|
+
import ClickOutside from '../ClickOutside/index.js';
|
|
8
|
+
import styles from './Tooltip.module.css';
|
|
9
|
+
|
|
10
|
+
var clx = classNames.bind(styles);
|
|
11
|
+
var Tooltip = function Tooltip(_a) {
|
|
12
|
+
var children = _a.children,
|
|
13
|
+
zIndex = _a.zIndex,
|
|
14
|
+
content = _a.content,
|
|
15
|
+
_b = _a.withTail,
|
|
16
|
+
withTail = _b === void 0 ? false : _b,
|
|
17
|
+
_c = _a.placement,
|
|
18
|
+
placement = _c === void 0 ? "bottom" : _c,
|
|
19
|
+
_d = _a.strategy,
|
|
20
|
+
strategy = _d === void 0 ? "absolute" : _d;
|
|
21
|
+
var _e = useState(null),
|
|
22
|
+
controlElement = _e[0],
|
|
23
|
+
setControlElement = _e[1];
|
|
24
|
+
var _f = useState(null),
|
|
25
|
+
popperElement = _f[0],
|
|
26
|
+
setPopperElement = _f[1];
|
|
27
|
+
var _g = useState(false),
|
|
28
|
+
visible = _g[0],
|
|
29
|
+
setVisible = _g[1];
|
|
30
|
+
var _h = usePopper(controlElement, popperElement, {
|
|
31
|
+
placement: placement,
|
|
32
|
+
strategy: strategy,
|
|
33
|
+
modifiers: [{
|
|
34
|
+
name: "flip",
|
|
35
|
+
enabled: true
|
|
36
|
+
}, {
|
|
37
|
+
name: "preventOverflow",
|
|
38
|
+
enabled: true
|
|
39
|
+
}]
|
|
40
|
+
}),
|
|
41
|
+
styles = _h.styles,
|
|
42
|
+
attributes = _h.attributes,
|
|
43
|
+
update = _h.update;
|
|
44
|
+
var isNotComponent = typeof children === "string";
|
|
45
|
+
var reference = useMemo(function () {
|
|
46
|
+
return Children.only(isNotComponent ? /*#__PURE__*/React__default.createElement("button", null, children) : children);
|
|
47
|
+
}, [children, isNotComponent]);
|
|
48
|
+
var onToggle = useCallback(function (e) {
|
|
49
|
+
e.stopPropagation();
|
|
50
|
+
setVisible(function (state) {
|
|
51
|
+
return !state;
|
|
52
|
+
});
|
|
53
|
+
}, [setVisible]);
|
|
54
|
+
var onShow = useCallback(function () {
|
|
55
|
+
setVisible(true);
|
|
56
|
+
}, [setVisible]);
|
|
57
|
+
var onHide = useCallback(function () {
|
|
58
|
+
setVisible(false);
|
|
59
|
+
}, [setVisible]);
|
|
60
|
+
var onClickOutside = useCallback(function (e) {
|
|
61
|
+
if (controlElement === null || controlElement === void 0 ? void 0 : controlElement.contains(e.target)) return;
|
|
62
|
+
onHide();
|
|
63
|
+
}, [onHide, controlElement]);
|
|
64
|
+
var onClickOverlay = useCallback(function (e) {
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
onHide();
|
|
67
|
+
}, [onHide]);
|
|
68
|
+
useEffect(function () {
|
|
69
|
+
var unsubscribes = [];
|
|
70
|
+
unsubscribes.push(on(controlElement, "mouseenter", onShow, false));
|
|
71
|
+
unsubscribes.push(on(controlElement, "mouseleave", onHide, false));
|
|
72
|
+
unsubscribes.push(on(popperElement, "mouseenter", onShow, false));
|
|
73
|
+
unsubscribes.push(on(popperElement, "mouseleave", onHide, false));
|
|
74
|
+
return function () {
|
|
75
|
+
return unsubscribes.forEach(function (un) {
|
|
76
|
+
return un();
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
}, [controlElement, popperElement, onToggle, onShow, onHide]);
|
|
80
|
+
useEffect(function () {
|
|
81
|
+
if (update) update();
|
|
82
|
+
}, [update, visible]);
|
|
83
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(reference.type, __assign({
|
|
84
|
+
ref: setControlElement
|
|
85
|
+
}, reference.props)), visible && ( /*#__PURE__*/React__default.createElement(Portal, null, /*#__PURE__*/React__default.createElement(ClickOutside, {
|
|
86
|
+
onClick: onClickOutside
|
|
87
|
+
}, /*#__PURE__*/React__default.createElement("div", __assign({
|
|
88
|
+
className: clx("root", {
|
|
89
|
+
tail: !!withTail
|
|
90
|
+
}),
|
|
91
|
+
ref: setPopperElement,
|
|
92
|
+
style: __assign(__assign({}, styles.popper), {
|
|
93
|
+
zIndex: zIndex
|
|
94
|
+
})
|
|
95
|
+
}, attributes.popper), /*#__PURE__*/React__default.createElement("div", {
|
|
96
|
+
className: clx("overlay"),
|
|
97
|
+
onClick: onClickOverlay
|
|
98
|
+
}, content))))));
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export { Tooltip as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { PositioningStrategy } from "@popperjs/core";
|
|
3
|
+
import type { Placement as PopperPlacement } from "@popperjs/core";
|
|
4
|
+
export type Trigger = "hover";
|
|
5
|
+
export type Placement = Extract<PopperPlacement, "bottom-start" | "bottom" | "bottom-end" | "top-start" | "top" | "top-end" | "right-start" | "right" | "right-end" | "left-start" | "left" | "left-end">;
|
|
6
|
+
export interface ITooltipProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
content: ReactNode;
|
|
9
|
+
zIndex?: number;
|
|
10
|
+
placement?: Placement;
|
|
11
|
+
strategy?: PositioningStrategy;
|
|
12
|
+
withTail?: boolean;
|
|
13
|
+
}
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
pointer-events: none;
|
|
53
53
|
}
|
|
54
54
|
.variant_primary_error {
|
|
55
|
-
background-color: var(--
|
|
56
|
-
border-color: var(--
|
|
55
|
+
background-color: var(--input-primary-background-color-error);
|
|
56
|
+
border-color: var(--input-primary-border-color-error);
|
|
57
57
|
}
|
|
58
58
|
.variant_primary_error:hover {
|
|
59
59
|
background-color: var(--palette-white);
|
|
60
|
-
border-color: var(--
|
|
61
|
-
box-shadow: 0 0 0 2px var(--
|
|
60
|
+
border-color: var(--input-primary-border-color-error);
|
|
61
|
+
box-shadow: 0 0 0 2px var(--input-primary-box-shadow-color-error);
|
|
62
62
|
}
|
|
63
63
|
.variant_primary_error:focus, .variant_primary_error:focus-within {
|
|
64
64
|
background-color: var(--palette-white);
|
|
65
|
-
border-color: var(--
|
|
65
|
+
border-color: var(--input-primary-border-color-error);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.size_s {
|
package/esm/index.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ export { default as Separator } from "./Separator";
|
|
|
19
19
|
export { SkeletonText, SkeletonRect } from "./Skeleton";
|
|
20
20
|
export { default as Switch } from "./Switch";
|
|
21
21
|
export { THEMES } from "./Theme";
|
|
22
|
+
export { default as Tooltip } from "./Tooltip";
|
|
23
|
+
export { default as TimeSelect } from "./TimeSelect";
|
|
22
24
|
export { default as Typography } from "./Typography";
|
|
23
25
|
export { default as useMediaSizes } from "./hooks/useMediaSizes";
|
|
26
|
+
export { default as useOnClickOutside } from "./hooks/useOnClickOutside";
|
|
27
|
+
export { default as useScrollLock } from "./hooks/useScrollLock";
|
|
24
28
|
export * from "./Icons";
|
package/esm/index.js
CHANGED
|
@@ -19,8 +19,12 @@ export { default as Separator } from './Separator/index.js';
|
|
|
19
19
|
export { SkeletonRect, SkeletonText } from './Skeleton/index.js';
|
|
20
20
|
export { default as Switch } from './Switch/index.js';
|
|
21
21
|
export { THEMES } from './Theme/index.js';
|
|
22
|
+
export { default as Tooltip } from './Tooltip/index.js';
|
|
23
|
+
export { default as TimeSelect } from './TimeSelect/index.js';
|
|
22
24
|
export { default as Typography } from './Typography/index.js';
|
|
23
25
|
export { default as useMediaSizes } from './hooks/useMediaSizes/index.js';
|
|
26
|
+
export { default as useOnClickOutside } from './hooks/useOnClickOutside/index.js';
|
|
27
|
+
export { default as useScrollLock } from './hooks/useScrollLock/index.js';
|
|
24
28
|
import './Icons/index.js';
|
|
25
29
|
export { default as ArrowNext } from './Icons/ArrowNext.js';
|
|
26
30
|
export { default as Cart } from './Icons/Cart.js';
|
|
@@ -33,5 +37,6 @@ export { default as Info } from './Icons/Info.js';
|
|
|
33
37
|
export { default as Minus } from './Icons/Minus.js';
|
|
34
38
|
export { default as More } from './Icons/More.js';
|
|
35
39
|
export { default as Plus } from './Icons/Plus.js';
|
|
40
|
+
export { default as Setting } from './Icons/Setting.js';
|
|
36
41
|
export { default as Trash } from './Icons/Trash.js';
|
|
37
42
|
export { default as User } from './Icons/User.js';
|
|
@@ -6,18 +6,97 @@
|
|
|
6
6
|
--palette-bg-3: #dbdbdb;
|
|
7
7
|
--palette-bg-4: #b3b3b3;
|
|
8
8
|
--palette-bg-5: #999;
|
|
9
|
-
--palette-brand-default-1: #
|
|
10
|
-
--palette-brand-default-2: #
|
|
11
|
-
--palette-brand-default-3: #
|
|
12
|
-
--palette-primary-1:
|
|
13
|
-
--palette-primary-2:
|
|
14
|
-
--palette-primary-3:
|
|
15
|
-
--palette-primary-4:
|
|
16
|
-
--palette-primary-5:
|
|
17
|
-
--palette-tretiary-1: #
|
|
18
|
-
--palette-tretiary-2: #
|
|
19
|
-
--palette-tretiary-3: #
|
|
20
|
-
--palette-tretiary-4: #
|
|
21
|
-
--palette-tretiary-5: #
|
|
9
|
+
--palette-brand-default-1: #fcdfe2;
|
|
10
|
+
--palette-brand-default-2: #facdd2;
|
|
11
|
+
--palette-brand-default-3: #F59fa7;
|
|
12
|
+
--palette-primary-1: #ffe695;
|
|
13
|
+
--palette-primary-2: #ffe07b;
|
|
14
|
+
--palette-primary-3: #ffd85a;
|
|
15
|
+
--palette-primary-4: #ffce31;
|
|
16
|
+
--palette-primary-5: #ffc818;
|
|
17
|
+
--palette-tretiary-1: #DFE7FA;
|
|
18
|
+
--palette-tretiary-2: #C0CFF8;
|
|
19
|
+
--palette-tretiary-3: #AFC3F5;
|
|
20
|
+
--palette-tretiary-4: #80A0ED;
|
|
21
|
+
--palette-tretiary-5: #6088ea;
|
|
22
22
|
--palette-alert: #ff564e;
|
|
23
|
+
--button-border-radius: 18px;
|
|
24
|
+
--button-primary-color: #000;
|
|
25
|
+
--button-primary-background-color: #ffce31;
|
|
26
|
+
--button-primary-border-color: #ffce31;
|
|
27
|
+
--button-primary-color-hovered: #000;
|
|
28
|
+
--button-primary-background-color-hovered: #ffce31;
|
|
29
|
+
--button-primary-border-color-hovered: #ffce31;
|
|
30
|
+
--button-primary-color-active: #000;
|
|
31
|
+
--button-primary-background-color-active: #ffc818;
|
|
32
|
+
--button-primary-border-color-active: #ffc818;
|
|
33
|
+
--button-primary-color-disabled: #b3b3b3;
|
|
34
|
+
--button-primary-background-color-disabled: #ffe695;
|
|
35
|
+
--button-primary-border-color-disabled: #ffe695;
|
|
36
|
+
--button-secondary-color: #fff;
|
|
37
|
+
--button-secondary-background-color: #1f1f1f;
|
|
38
|
+
--button-secondary-border-color: #1f1f1f;
|
|
39
|
+
--button-secondary-color-hovered: #fff;
|
|
40
|
+
--button-secondary-background-color-hovered: #1f1f1f;
|
|
41
|
+
--button-secondary-border-color-hovered: #1f1f1f;
|
|
42
|
+
--button-secondary-color-active: #fff;
|
|
43
|
+
--button-secondary-background-color-active: #000;
|
|
44
|
+
--button-secondary-border-color-active: #000;
|
|
45
|
+
--button-secondary-color-disabled: #b3b3b3;
|
|
46
|
+
--button-secondary-background-color-disabled: #f2f2f2;
|
|
47
|
+
--button-secondary-border-color-disabled: #f2f2f2;
|
|
48
|
+
--button-outline-color: #000;
|
|
49
|
+
--button-outline-background-color: #fff;
|
|
50
|
+
--button-outline-border-color: #1f1f1f;
|
|
51
|
+
--button-outline-color-hovered: #000;
|
|
52
|
+
--button-outline-background-color-hovered: #f2f2f2;
|
|
53
|
+
--button-outline-border-color-hovered: #1f1f1f;
|
|
54
|
+
--button-outline-color-active: #000;
|
|
55
|
+
--button-outline-background-color-active: #e6e6e6;
|
|
56
|
+
--button-outline-border-color-active: #1f1f1f;
|
|
57
|
+
--button-outline-color-disabled: #b3b3b3;
|
|
58
|
+
--button-outline-background-color-disabled: #fff;
|
|
59
|
+
--button-outline-border-color-disabled: #e6e6e6;
|
|
60
|
+
--button-pseudo-color: #000;
|
|
61
|
+
--button-pseudo-background-color: #DFE7FA;
|
|
62
|
+
--button-pseudo-border-color: #DFE7FA;
|
|
63
|
+
--button-pseudo-color-hovered: #000;
|
|
64
|
+
--button-pseudo-background-color-hovered: #DFE7FA;
|
|
65
|
+
--button-pseudo-border-color-hovered: #DFE7FA;
|
|
66
|
+
--button-pseudo-color-active: #000;
|
|
67
|
+
--button-pseudo-background-color-active: #C0CFF8;
|
|
68
|
+
--button-pseudo-border-color-active: #C0CFF8;
|
|
69
|
+
--button-pseudo-color-disabled: #b3b3b3;
|
|
70
|
+
--button-pseudo-background-color-disabled: #DFE7FA;
|
|
71
|
+
--button-pseudo-border-color-disabled: #DFE7FA;
|
|
72
|
+
--button-clear-color: #1f1f1f;
|
|
73
|
+
--button-clear-color-hovered: #1f1f1f;
|
|
74
|
+
--button-clear-color-active: #000;
|
|
75
|
+
--button-clear-color-disabled: #b3b3b3;
|
|
76
|
+
--button-clear-background-color-disabled: #fff;
|
|
77
|
+
--button-clear-border-color-disabled: #fff;
|
|
78
|
+
--input-primary-border-color: #dbdbdb;
|
|
79
|
+
--input-primary-plaseholder-color: #e6e6e6;
|
|
80
|
+
--input-primary-border-color-error: #ff564e;
|
|
81
|
+
--input-primary-background-color-error: #FFEAE2;
|
|
82
|
+
--input-primary-box-shadow-color-error: #FFEAE2;
|
|
83
|
+
--checkbox-background-color-checked: #ffce31;
|
|
84
|
+
--checkbox-background-color-hovered: #ffce31;
|
|
85
|
+
--checkbox-box-shadow-focused: #ffe695;
|
|
86
|
+
--checkbox-background-color-active: #ffce31;
|
|
87
|
+
--checkbox-border-color-active: #ffce31;
|
|
88
|
+
--checkbox-box-shadow-active: #ffce31;
|
|
89
|
+
--checkbox-background-color-disabled: #ffe695;
|
|
90
|
+
--input-radio-background-color-checked: #ffce31;
|
|
91
|
+
--input-radio-background-color-hovered: #ffce31;
|
|
92
|
+
--input-radio-box-shadow-focused: #ffe695;
|
|
93
|
+
--input-radio-background-color-focused: #ffe695;
|
|
94
|
+
--input-radio-border-color-focused: #ffe695;
|
|
95
|
+
--switch-background-color: #e6e6e6;
|
|
96
|
+
--switch-border-color: #e6e6e6;
|
|
97
|
+
--switch-background-color-checked: #ffc818;
|
|
98
|
+
--switch-border-color-checked: #ffc818;
|
|
99
|
+
--tooltip-background-color: #333;
|
|
100
|
+
--tooltip-color: #fff;
|
|
101
|
+
--tooltip-border-radius: 4px;
|
|
23
102
|
}
|