colibri-ui 0.7.63 → 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/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/index.d.ts +38 -32
- package/Theme/themes/buenos_aires.d.ts +19 -16
- package/Theme/themes/buenos_aires.js +19 -16
- package/Theme/themes/default.d.ts +19 -16
- package/Theme/themes/default.js +19 -16
- 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/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/index.d.ts +38 -32
- package/esm/Theme/themes/buenos_aires.d.ts +19 -16
- package/esm/Theme/themes/buenos_aires.js +19 -16
- package/esm/Theme/themes/default.d.ts +19 -16
- package/esm/Theme/themes/default.js +19 -16
- 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/index.d.ts +4 -0
- package/esm/index.js +5 -0
- package/esm/theme_ba_variables.css +19 -16
- package/esm/theme_default_variables.css +19 -16
- package/index.d.ts +4 -0
- package/index.js +14 -4
- package/package.json +1 -1
- package/theme_ba_variables.css +19 -16
- package/theme_default_variables.css +19 -16
package/Tooltip/index.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactPopper = require('react-popper');
|
|
8
|
+
var classNames = require('classnames/bind');
|
|
9
|
+
var index = require('../Portal/index.js');
|
|
10
|
+
var on = require('../helpers/on.js');
|
|
11
|
+
var index$1 = require('../ClickOutside/index.js');
|
|
12
|
+
var styles = require('./Tooltip.module.css');
|
|
13
|
+
|
|
14
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
17
|
+
var classNames__default = /*#__PURE__*/_interopDefault(classNames);
|
|
18
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
19
|
+
|
|
20
|
+
var clx = classNames__default.default.bind(styles__default.default);
|
|
21
|
+
var Tooltip = function Tooltip(_a) {
|
|
22
|
+
var children = _a.children,
|
|
23
|
+
zIndex = _a.zIndex,
|
|
24
|
+
content = _a.content,
|
|
25
|
+
_b = _a.withTail,
|
|
26
|
+
withTail = _b === void 0 ? false : _b,
|
|
27
|
+
_c = _a.placement,
|
|
28
|
+
placement = _c === void 0 ? "bottom" : _c,
|
|
29
|
+
_d = _a.strategy,
|
|
30
|
+
strategy = _d === void 0 ? "absolute" : _d;
|
|
31
|
+
var _e = React.useState(null),
|
|
32
|
+
controlElement = _e[0],
|
|
33
|
+
setControlElement = _e[1];
|
|
34
|
+
var _f = React.useState(null),
|
|
35
|
+
popperElement = _f[0],
|
|
36
|
+
setPopperElement = _f[1];
|
|
37
|
+
var _g = React.useState(false),
|
|
38
|
+
visible = _g[0],
|
|
39
|
+
setVisible = _g[1];
|
|
40
|
+
var _h = reactPopper.usePopper(controlElement, popperElement, {
|
|
41
|
+
placement: placement,
|
|
42
|
+
strategy: strategy,
|
|
43
|
+
modifiers: [{
|
|
44
|
+
name: "flip",
|
|
45
|
+
enabled: true
|
|
46
|
+
}, {
|
|
47
|
+
name: "preventOverflow",
|
|
48
|
+
enabled: true
|
|
49
|
+
}]
|
|
50
|
+
}),
|
|
51
|
+
styles = _h.styles,
|
|
52
|
+
attributes = _h.attributes,
|
|
53
|
+
update = _h.update;
|
|
54
|
+
var isNotComponent = typeof children === "string";
|
|
55
|
+
var reference = React.useMemo(function () {
|
|
56
|
+
return React.Children.only(isNotComponent ? /*#__PURE__*/React__default.default.createElement("button", null, children) : children);
|
|
57
|
+
}, [children, isNotComponent]);
|
|
58
|
+
var onToggle = React.useCallback(function (e) {
|
|
59
|
+
e.stopPropagation();
|
|
60
|
+
setVisible(function (state) {
|
|
61
|
+
return !state;
|
|
62
|
+
});
|
|
63
|
+
}, [setVisible]);
|
|
64
|
+
var onShow = React.useCallback(function () {
|
|
65
|
+
setVisible(true);
|
|
66
|
+
}, [setVisible]);
|
|
67
|
+
var onHide = React.useCallback(function () {
|
|
68
|
+
setVisible(false);
|
|
69
|
+
}, [setVisible]);
|
|
70
|
+
var onClickOutside = React.useCallback(function (e) {
|
|
71
|
+
if (controlElement === null || controlElement === void 0 ? void 0 : controlElement.contains(e.target)) return;
|
|
72
|
+
onHide();
|
|
73
|
+
}, [onHide, controlElement]);
|
|
74
|
+
var onClickOverlay = React.useCallback(function (e) {
|
|
75
|
+
e.stopPropagation();
|
|
76
|
+
onHide();
|
|
77
|
+
}, [onHide]);
|
|
78
|
+
React.useEffect(function () {
|
|
79
|
+
var unsubscribes = [];
|
|
80
|
+
unsubscribes.push(on.on(controlElement, "mouseenter", onShow, false));
|
|
81
|
+
unsubscribes.push(on.on(controlElement, "mouseleave", onHide, false));
|
|
82
|
+
unsubscribes.push(on.on(popperElement, "mouseenter", onShow, false));
|
|
83
|
+
unsubscribes.push(on.on(popperElement, "mouseleave", onHide, false));
|
|
84
|
+
return function () {
|
|
85
|
+
return unsubscribes.forEach(function (un) {
|
|
86
|
+
return un();
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
}, [controlElement, popperElement, onToggle, onShow, onHide]);
|
|
90
|
+
React.useEffect(function () {
|
|
91
|
+
if (update) update();
|
|
92
|
+
}, [update, visible]);
|
|
93
|
+
return /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, /*#__PURE__*/React__default.default.createElement(reference.type, tslib.__assign({
|
|
94
|
+
ref: setControlElement
|
|
95
|
+
}, reference.props)), visible && ( /*#__PURE__*/React__default.default.createElement(index.default, null, /*#__PURE__*/React__default.default.createElement(index$1.default, {
|
|
96
|
+
onClick: onClickOutside
|
|
97
|
+
}, /*#__PURE__*/React__default.default.createElement("div", tslib.__assign({
|
|
98
|
+
className: clx("root", {
|
|
99
|
+
tail: !!withTail
|
|
100
|
+
}),
|
|
101
|
+
ref: setPopperElement,
|
|
102
|
+
style: tslib.__assign(tslib.__assign({}, styles.popper), {
|
|
103
|
+
zIndex: zIndex
|
|
104
|
+
})
|
|
105
|
+
}, attributes.popper), /*#__PURE__*/React__default.default.createElement("div", {
|
|
106
|
+
className: clx("overlay"),
|
|
107
|
+
onClick: onClickOverlay
|
|
108
|
+
}, content))))));
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
exports.default = Tooltip;
|
|
@@ -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
|
+
}
|
package/Typography/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.checked {
|
|
38
|
-
background-color: var(--checkbox-
|
|
38
|
+
background-color: var(--checkbox-background-color-checked);
|
|
39
39
|
border: 0;
|
|
40
40
|
}
|
|
41
41
|
.checked::after {
|
|
@@ -73,17 +73,17 @@
|
|
|
73
73
|
border-color: var(--palette-bg-3);
|
|
74
74
|
}
|
|
75
75
|
.control_variant_primary:focus:not(:disabled) + .fake-checkbox {
|
|
76
|
-
box-shadow: 0 0 0 2px var(--checkbox-
|
|
76
|
+
box-shadow: 0 0 0 2px var(--checkbox-box-shadow-focused);
|
|
77
77
|
}
|
|
78
78
|
.control_variant_primary:hover:not(:disabled) + .fake-checkbox {
|
|
79
|
-
background-color: var(--checkbox-
|
|
79
|
+
background-color: var(--checkbox-background-color-hovered);
|
|
80
80
|
}
|
|
81
81
|
.control_variant_primary:active:not(:disabled) + .fake-checkbox {
|
|
82
|
-
background-color: var(--checkbox-
|
|
83
|
-
border-color: var(--checkbox-
|
|
84
|
-
box-shadow: var(--checkbox-
|
|
82
|
+
background-color: var(--checkbox-background-color-active);
|
|
83
|
+
border-color: var(--checkbox-border-color-active);
|
|
84
|
+
box-shadow: var(--checkbox-box-shadow-active);
|
|
85
85
|
}
|
|
86
86
|
.control_variant_primary:disabled + .fake-checkbox {
|
|
87
|
-
background-color: var(--checkbox-
|
|
87
|
+
background-color: var(--checkbox-background-color-disabled);
|
|
88
88
|
z-index: 1;
|
|
89
89
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
var Setting = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
5
|
+
var _b = _a.fill,
|
|
6
|
+
fill = _b === void 0 ? "currentColor" : _b,
|
|
7
|
+
_c = _a.width,
|
|
8
|
+
width = _c === void 0 ? 24 : _c,
|
|
9
|
+
_d = _a.height,
|
|
10
|
+
height = _d === void 0 ? 24 : _d,
|
|
11
|
+
props = __rest(_a, ["fill", "width", "height"]);
|
|
12
|
+
return /*#__PURE__*/React__default.createElement("svg", __assign({
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: width,
|
|
15
|
+
height: height
|
|
16
|
+
}, props, {
|
|
17
|
+
ref: ref,
|
|
18
|
+
fill: "none"
|
|
19
|
+
}), /*#__PURE__*/React__default.createElement("g", {
|
|
20
|
+
clipPath: "url(#a)"
|
|
21
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
22
|
+
fill: fill,
|
|
23
|
+
d: "m8.428 3.287.88 1.198c.27.364.62.675 1.09.801a1.85 1.85 0 0 0 1.414-.188c.39-.226.667-.602.84-1.054l.542-1.385a.75.75 0 0 1 .894-.45l.5.134.5.133a.75.75 0 0 1 .548.84l-.226 1.467c-.072.482-.018.948.209 1.34.237.411.632.731 1.126.864.476.127.938.024 1.36-.158l1.343-.588a.75.75 0 0 1 .95.312l.26.447.26.451a.75.75 0 0 1-.206.98l-1.197.88c-.363.27-.674.619-.8 1.088a1.85 1.85 0 0 0 .188 1.413c.227.39.602.667 1.054.84l1.385.543a.75.75 0 0 1 .45.893l-.135.5-.133.5a.75.75 0 0 1-.837.55l-1.47-.224c-.48-.076-.947-.021-1.34.205-.41.238-.73.632-.863 1.127-.125.47-.03.928.15 1.344l.596 1.36a.75.75 0 0 1-.311.951l-.45.26-.45.26a.75.75 0 0 1-.98-.204l-.846-1.149c-.283-.38-.63-.72-1.12-.852a1.85 1.85 0 0 0-1.414.188c-.39.227-.668.603-.841 1.056l-.542 1.384a.75.75 0 0 1-.892.45l-.502-.134-.5-.134a.75.75 0 0 1-.548-.838l.225-1.467c.074-.483.02-.95-.208-1.344a1.85 1.85 0 0 0-1.126-.862c-.486-.13-.955-.014-1.386.173l-1.32.576a.75.75 0 0 1-.95-.314l-.258-.447-.26-.448a.75.75 0 0 1 .205-.982l1.198-.879v-.001c.363-.27.675-.62.8-1.09a1.85 1.85 0 0 0-.187-1.413c-.226-.39-.602-.667-1.054-.84l-1.385-.543a.75.75 0 0 1-.45-.894l.134-.498.133-.501a.75.75 0 0 1 .839-.549l1.468.225c.482.074.95.02 1.342-.208.41-.238.73-.632.862-1.126.127-.473.026-.933-.154-1.352L6.24 4.552a.75.75 0 0 1 .314-.952L7 3.343l.446-.26a.75.75 0 0 1 .98.204zM10.89 16.14a4.286 4.286 0 1 0 2.219-8.28 4.286 4.286 0 0 0-2.22 8.28"
|
|
24
|
+
})), /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("clipPath", {
|
|
25
|
+
id: "a"
|
|
26
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
27
|
+
fill: "#fff",
|
|
28
|
+
d: "M0 0h24v24H0z"
|
|
29
|
+
}))));
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { Setting as default };
|
package/esm/Icons/index.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export { default as Info } from "./Info";
|
|
|
9
9
|
export { default as Minus } from "./Minus";
|
|
10
10
|
export { default as More } from "./More";
|
|
11
11
|
export { default as Plus } from "./Plus";
|
|
12
|
+
export { default as Setting } from "./Setting";
|
|
12
13
|
export { default as Trash } from "./Trash";
|
|
13
14
|
export { default as User } from "./User";
|
package/esm/Icons/index.js
CHANGED
|
@@ -9,5 +9,6 @@ export { default as Info } from './Info.js';
|
|
|
9
9
|
export { default as Minus } from './Minus.js';
|
|
10
10
|
export { default as More } from './More.js';
|
|
11
11
|
export { default as Plus } from './Plus.js';
|
|
12
|
+
export { default as Setting } from './Setting.js';
|
|
12
13
|
export { default as Trash } from './Trash.js';
|
|
13
14
|
export { default as User } from './User.js';
|
|
@@ -51,26 +51,26 @@
|
|
|
51
51
|
position: absolute;
|
|
52
52
|
}
|
|
53
53
|
.input:not(.input_disabled, .input_error):hover + .icon {
|
|
54
|
-
border-color: var(--
|
|
54
|
+
border-color: var(--input-radio-background-color-hovered);
|
|
55
55
|
}
|
|
56
56
|
.input:not(.input_disabled, .input_error):focus + .icon {
|
|
57
|
-
box-shadow: 0 0 0 2px var(--
|
|
57
|
+
box-shadow: 0 0 0 2px var(--input-radio-box-shadow-focused);
|
|
58
58
|
}
|
|
59
59
|
.input:not(.input_disabled, .input_error):active + .icon {
|
|
60
|
-
background-color: var(--
|
|
61
|
-
border-color: var(--
|
|
62
|
-
box-shadow: 0 0 0 2px var(--
|
|
60
|
+
background-color: var(--input-radio-background-color-focused);
|
|
61
|
+
border-color: var(--input-radio-border-color-focused);
|
|
62
|
+
box-shadow: 0 0 0 2px var(--input-radio-box-shadow-focused);
|
|
63
63
|
}
|
|
64
64
|
.input:not(.input_disabled, .input_error) .input_checked:hover + .icon {
|
|
65
|
-
border-color: var(--
|
|
65
|
+
border-color: var(--input-radio-background-color-hovered);
|
|
66
66
|
}
|
|
67
67
|
.input:not(.input_disabled, .input_error) .input_checked:active + .icon {
|
|
68
68
|
background-color: var(--palette-white);
|
|
69
|
-
border: 4px solid var(--
|
|
69
|
+
border: 4px solid var(--input-radio-background-color-checked);
|
|
70
70
|
}
|
|
71
71
|
.input_checked + .icon {
|
|
72
72
|
background-color: var(--palette-white);
|
|
73
|
-
border: 4px solid var(--
|
|
73
|
+
border: 4px solid var(--input-radio-background-color-checked);
|
|
74
74
|
}
|
|
75
75
|
.input_disabled + .icon {
|
|
76
76
|
border-radius: 50%;
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
width: 40px;
|
|
19
19
|
}
|
|
20
20
|
.wrapper_variant_primary {
|
|
21
|
-
background-color: var(--switch-
|
|
22
|
-
border-color: var(--switch-
|
|
21
|
+
background-color: var(--switch-background-color);
|
|
22
|
+
border-color: var(--switch-border-color);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.base-switch {
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
z-index: 1;
|
|
49
49
|
}
|
|
50
50
|
.checkbox:checked + .wrapper {
|
|
51
|
-
background-color: var(--switch-
|
|
52
|
-
border-color: var(--switch-
|
|
51
|
+
background-color: var(--switch-background-color-checked);
|
|
52
|
+
border-color: var(--switch-border-color-checked);
|
|
53
53
|
}
|
|
54
54
|
.checkbox:checked + .wrapper .base-switch {
|
|
55
55
|
transform: translateX(18px);
|
package/esm/Theme/index.d.ts
CHANGED
|
@@ -84,22 +84,25 @@ export declare const THEMES: {
|
|
|
84
84
|
"input-primary-border-color-error": string;
|
|
85
85
|
"input-primary-background-color-error": string;
|
|
86
86
|
"input-primary-box-shadow-color-error": string;
|
|
87
|
-
"checkbox-
|
|
88
|
-
"checkbox-
|
|
89
|
-
"checkbox-
|
|
90
|
-
"checkbox-
|
|
91
|
-
"checkbox-
|
|
92
|
-
"checkbox-
|
|
93
|
-
"checkbox-
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"switch-
|
|
100
|
-
"switch-
|
|
101
|
-
"switch-
|
|
102
|
-
"switch-
|
|
87
|
+
"checkbox-background-color-checked": string;
|
|
88
|
+
"checkbox-background-color-hovered": string;
|
|
89
|
+
"checkbox-box-shadow-focused": string;
|
|
90
|
+
"checkbox-background-color-active": string;
|
|
91
|
+
"checkbox-border-color-active": string;
|
|
92
|
+
"checkbox-box-shadow-active": string;
|
|
93
|
+
"checkbox-background-color-disabled": string;
|
|
94
|
+
"input-radio-background-color-checked": string;
|
|
95
|
+
"input-radio-background-color-hovered": string;
|
|
96
|
+
"input-radio-box-shadow-focused": string;
|
|
97
|
+
"input-radio-background-color-focused": string;
|
|
98
|
+
"input-radio-border-color-focused": string;
|
|
99
|
+
"switch-background-color": string;
|
|
100
|
+
"switch-border-color": string;
|
|
101
|
+
"switch-background-color-checked": string;
|
|
102
|
+
"switch-border-color-checked": string;
|
|
103
|
+
"tooltip-background-color": string;
|
|
104
|
+
"tooltip-color": string;
|
|
105
|
+
"tooltip-border-radius": string;
|
|
103
106
|
};
|
|
104
107
|
BA: {
|
|
105
108
|
"palette-black": string;
|
|
@@ -183,21 +186,24 @@ export declare const THEMES: {
|
|
|
183
186
|
"input-primary-border-color-error": string;
|
|
184
187
|
"input-primary-background-color-error": string;
|
|
185
188
|
"input-primary-box-shadow-color-error": string;
|
|
186
|
-
"checkbox-
|
|
187
|
-
"checkbox-
|
|
188
|
-
"checkbox-
|
|
189
|
-
"checkbox-
|
|
190
|
-
"checkbox-
|
|
191
|
-
"checkbox-
|
|
192
|
-
"checkbox-
|
|
193
|
-
"
|
|
194
|
-
"
|
|
195
|
-
"
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
"switch-
|
|
199
|
-
"switch-
|
|
200
|
-
"switch-
|
|
201
|
-
"switch-
|
|
189
|
+
"checkbox-background-color-checked": string;
|
|
190
|
+
"checkbox-background-color-hovered": string;
|
|
191
|
+
"checkbox-box-shadow-focused": string;
|
|
192
|
+
"checkbox-background-color-active": string;
|
|
193
|
+
"checkbox-border-color-active": string;
|
|
194
|
+
"checkbox-box-shadow-active": string;
|
|
195
|
+
"checkbox-background-color-disabled": string;
|
|
196
|
+
"input-radio-background-color-checked": string;
|
|
197
|
+
"input-radio-background-color-hovered": string;
|
|
198
|
+
"input-radio-box-shadow-focused": string;
|
|
199
|
+
"input-radio-background-color-focused": string;
|
|
200
|
+
"input-radio-border-color-focused": string;
|
|
201
|
+
"switch-background-color": string;
|
|
202
|
+
"switch-border-color": string;
|
|
203
|
+
"switch-background-color-checked": string;
|
|
204
|
+
"switch-border-color-checked": string;
|
|
205
|
+
"tooltip-background-color": string;
|
|
206
|
+
"tooltip-color": string;
|
|
207
|
+
"tooltip-border-radius": string;
|
|
202
208
|
};
|
|
203
209
|
};
|
|
@@ -80,21 +80,24 @@ declare const _default: {
|
|
|
80
80
|
"input-primary-border-color-error": string;
|
|
81
81
|
"input-primary-background-color-error": string;
|
|
82
82
|
"input-primary-box-shadow-color-error": string;
|
|
83
|
-
"checkbox-
|
|
84
|
-
"checkbox-
|
|
85
|
-
"checkbox-
|
|
86
|
-
"checkbox-
|
|
87
|
-
"checkbox-
|
|
88
|
-
"checkbox-
|
|
89
|
-
"checkbox-
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"switch-
|
|
96
|
-
"switch-
|
|
97
|
-
"switch-
|
|
98
|
-
"switch-
|
|
83
|
+
"checkbox-background-color-checked": string;
|
|
84
|
+
"checkbox-background-color-hovered": string;
|
|
85
|
+
"checkbox-box-shadow-focused": string;
|
|
86
|
+
"checkbox-background-color-active": string;
|
|
87
|
+
"checkbox-border-color-active": string;
|
|
88
|
+
"checkbox-box-shadow-active": string;
|
|
89
|
+
"checkbox-background-color-disabled": string;
|
|
90
|
+
"input-radio-background-color-checked": string;
|
|
91
|
+
"input-radio-background-color-hovered": string;
|
|
92
|
+
"input-radio-box-shadow-focused": string;
|
|
93
|
+
"input-radio-background-color-focused": string;
|
|
94
|
+
"input-radio-border-color-focused": string;
|
|
95
|
+
"switch-background-color": string;
|
|
96
|
+
"switch-border-color": string;
|
|
97
|
+
"switch-background-color-checked": string;
|
|
98
|
+
"switch-border-color-checked": string;
|
|
99
|
+
"tooltip-background-color": string;
|
|
100
|
+
"tooltip-color": string;
|
|
101
|
+
"tooltip-border-radius": string;
|
|
99
102
|
};
|
|
100
103
|
export default _default;
|
|
@@ -82,22 +82,25 @@ var THEME_BA = {
|
|
|
82
82
|
"input-primary-border-color-error": Color.ALERT,
|
|
83
83
|
"input-primary-background-color-error": Color.TRETIARY_DEFAULT_2,
|
|
84
84
|
"input-primary-box-shadow-color-error": Color.TRETIARY_DEFAULT_2,
|
|
85
|
-
"checkbox-
|
|
86
|
-
"checkbox-
|
|
87
|
-
"checkbox-
|
|
88
|
-
"checkbox-
|
|
89
|
-
"checkbox-
|
|
90
|
-
"checkbox-
|
|
91
|
-
"checkbox-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"switch-
|
|
98
|
-
"switch-
|
|
99
|
-
"switch-
|
|
100
|
-
"switch-
|
|
85
|
+
"checkbox-background-color-checked": Color.PRIMARY_BA_4,
|
|
86
|
+
"checkbox-background-color-hovered": Color.PRIMARY_BA_4,
|
|
87
|
+
"checkbox-box-shadow-focused": Color.PRIMARY_BA_1,
|
|
88
|
+
"checkbox-background-color-active": Color.PRIMARY_BA_4,
|
|
89
|
+
"checkbox-border-color-active": Color.PRIMARY_BA_4,
|
|
90
|
+
"checkbox-box-shadow-active": Color.PRIMARY_BA_4,
|
|
91
|
+
"checkbox-background-color-disabled": Color.PRIMARY_BA_1,
|
|
92
|
+
"input-radio-background-color-checked": Color.PRIMARY_BA_4,
|
|
93
|
+
"input-radio-background-color-hovered": Color.PRIMARY_BA_4,
|
|
94
|
+
"input-radio-box-shadow-focused": Color.PRIMARY_BA_1,
|
|
95
|
+
"input-radio-background-color-focused": Color.PRIMARY_BA_1,
|
|
96
|
+
"input-radio-border-color-focused": Color.PRIMARY_BA_1,
|
|
97
|
+
"switch-background-color": Color.BG_2,
|
|
98
|
+
"switch-border-color": Color.BG_2,
|
|
99
|
+
"switch-background-color-checked": Color.PRIMARY_BA_5,
|
|
100
|
+
"switch-border-color-checked": Color.PRIMARY_BA_5,
|
|
101
|
+
"tooltip-background-color": Color.SECONDARY_BA_3,
|
|
102
|
+
"tooltip-color": Color.WHITE,
|
|
103
|
+
"tooltip-border-radius": "4px"
|
|
101
104
|
};
|
|
102
105
|
|
|
103
106
|
export { THEME_BA as default };
|
|
@@ -83,21 +83,24 @@ declare const _default: {
|
|
|
83
83
|
"input-primary-border-color-error": string;
|
|
84
84
|
"input-primary-background-color-error": string;
|
|
85
85
|
"input-primary-box-shadow-color-error": string;
|
|
86
|
-
"checkbox-
|
|
87
|
-
"checkbox-
|
|
88
|
-
"checkbox-
|
|
89
|
-
"checkbox-
|
|
90
|
-
"checkbox-
|
|
91
|
-
"checkbox-
|
|
92
|
-
"checkbox-
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"switch-
|
|
99
|
-
"switch-
|
|
100
|
-
"switch-
|
|
101
|
-
"switch-
|
|
86
|
+
"checkbox-background-color-checked": string;
|
|
87
|
+
"checkbox-background-color-hovered": string;
|
|
88
|
+
"checkbox-box-shadow-focused": string;
|
|
89
|
+
"checkbox-background-color-active": string;
|
|
90
|
+
"checkbox-border-color-active": string;
|
|
91
|
+
"checkbox-box-shadow-active": string;
|
|
92
|
+
"checkbox-background-color-disabled": string;
|
|
93
|
+
"input-radio-background-color-checked": string;
|
|
94
|
+
"input-radio-background-color-hovered": string;
|
|
95
|
+
"input-radio-box-shadow-focused": string;
|
|
96
|
+
"input-radio-background-color-focused": string;
|
|
97
|
+
"input-radio-border-color-focused": string;
|
|
98
|
+
"switch-background-color": string;
|
|
99
|
+
"switch-border-color": string;
|
|
100
|
+
"switch-background-color-checked": string;
|
|
101
|
+
"switch-border-color-checked": string;
|
|
102
|
+
"tooltip-background-color": string;
|
|
103
|
+
"tooltip-color": string;
|
|
104
|
+
"tooltip-border-radius": string;
|
|
102
105
|
};
|
|
103
106
|
export default _default;
|
|
@@ -85,22 +85,25 @@ var THEME_DEFAULT = {
|
|
|
85
85
|
"input-primary-border-color-error": Color.ALERT,
|
|
86
86
|
"input-primary-background-color-error": Color.TRETIARY_DEFAULT_2,
|
|
87
87
|
"input-primary-box-shadow-color-error": Color.TRETIARY_DEFAULT_2,
|
|
88
|
-
"checkbox-
|
|
89
|
-
"checkbox-
|
|
90
|
-
"checkbox-
|
|
91
|
-
"checkbox-
|
|
92
|
-
"checkbox-
|
|
93
|
-
"checkbox-
|
|
94
|
-
"checkbox-
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"switch-
|
|
101
|
-
"switch-
|
|
102
|
-
"switch-
|
|
103
|
-
"switch-
|
|
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"
|
|
104
107
|
};
|
|
105
108
|
|
|
106
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 };
|