kamotive_ui 1.2.1 → 1.2.2
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/Icons/ChevronDown/ChevronDown10.js +1 -2
- package/dist/Icons/ChevronUp/ChevronUp10.js +1 -2
- package/dist/Icons/IconAccount/IconAccount10.js +1 -2
- package/dist/Icons/IconAlarm/IconAlarm10.js +1 -2
- package/dist/Icons/IconBank/IconBank10.js +1 -2
- package/dist/Icons/IconBell/IconBell10.js +1 -2
- package/dist/Icons/IconBriefcase/IconBriefcase10.js +1 -2
- package/dist/Icons/IconCalendar/IconCalendar10.js +1 -2
- package/dist/Icons/IconCheck/IconCheck10.js +1 -2
- package/dist/Icons/IconClose/IconClose10.js +1 -2
- package/dist/Icons/IconColorPicker/IconColorPicker10.js +1 -2
- package/dist/Icons/IconError/IconError10.js +1 -2
- package/dist/Icons/IconEyeOff/IconEyeOff10.js +1 -2
- package/dist/Icons/IconInfo/IconInfo10.js +1 -2
- package/dist/Icons/IconSuccess/IconSuccess10.js +1 -2
- package/dist/Icons/IconWarning/IconWarning10.js +1 -2
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button.module.css +13 -16
- package/dist/components/Checkbox/Checkbox.js +2 -2
- package/dist/components/Checkbox/Checkbox.module.css +4 -3
- package/dist/components/ColorPicker/ColorPicker.d.ts +4 -34
- package/dist/components/ColorPicker/ColorPicker.js +15 -13
- package/dist/components/ColorPicker/ColorPicker.module.css +26 -32
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.js +48 -17
- package/dist/components/Dropdown/Dropdown.module.css +1 -1
- package/dist/components/Input/Input.js +15 -15
- package/dist/components/Input/Input.module.css +14 -14
- package/dist/components/ProgressBar/ProgressBar.js +7 -7
- package/dist/components/ProgressBar/ProgressBar.module.css +19 -12
- package/dist/components/ProgressLoader/ProgressLoader.js +5 -5
- package/dist/components/ProgressLoader/ProgressLoader.module.css +3 -3
- package/dist/components/RadioButton/RadioButton.js +2 -2
- package/dist/components/RadioButton/RadioButton.module.css +3 -3
- package/dist/components/SettingTag/SettingTag.js +2 -2
- package/dist/components/SettingTag/SettingTag.module.css +16 -0
- package/dist/components/Snackbar/Snackbar.d.ts +2 -8
- package/dist/components/Snackbar/Snackbar.js +4 -4
- package/dist/components/Snackbar/Snackbar.module.css +11 -2
- package/dist/components/Tab/Tab.js +4 -4
- package/dist/components/Tab/Tab.module.css +45 -0
- package/dist/components/Tabs/Tabs.js +1 -2
- package/dist/components/Tabs/Tabs.module.css +2 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.module.css +24 -25
- package/dist/components/ToggleButton/ToggleButton.js +2 -2
- package/dist/components/ToggleButton/ToggleButton.module.css +10 -10
- package/dist/components/Typography/Typography.js +4 -3
- package/dist/components/Typography/Typography.module.css +5 -5
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
- package/dist/Icons/Icons.module.css +0 -4
|
@@ -5,22 +5,23 @@ import { ChevronDown10 } from '../../Icons/ChevronDown/ChevronDown10';
|
|
|
5
5
|
import { ChevronUp10 } from '../../Icons/ChevronUp/ChevronUp10';
|
|
6
6
|
import { IconCheck10 } from '../../Icons/IconCheck/IconCheck10';
|
|
7
7
|
export const DropdownListItem = ({ item, size = 'md', selectedItem, style, onChange }) => {
|
|
8
|
+
var _a;
|
|
8
9
|
const handleItemClick = (item, disabled) => {
|
|
9
10
|
if (!disabled) {
|
|
10
11
|
onChange(item);
|
|
11
12
|
}
|
|
12
13
|
};
|
|
13
|
-
const itemClassess = classNames(styles[`item-block`], styles[`button--${size}`], {
|
|
14
|
-
const itemBlock = classNames(styles[`item-block`], styles[`item-block-${style}`], { [
|
|
14
|
+
const itemClassess = classNames(styles[`item-block`], styles[`button--${size}`], { 'item-block--selected': (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === (item === null || item === void 0 ? void 0 : item.value) || (typeof selectedItem === 'string' || typeof selectedItem === 'number') && selectedItem === item }, { 'item-block--disabled': item === null || item === void 0 ? void 0 : item.disabled });
|
|
15
|
+
const itemBlock = classNames(styles[`item-block`], styles[`item-block-${style}`], { [`item-block-${style}--selected`]: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === item.value }, { 'item-block--disabled': item.disabled });
|
|
15
16
|
return (React.createElement("div", { className: styles[`item--container`] },
|
|
16
|
-
React.createElement("div", { className: itemClassess, onClick: () => handleItemClick(item, item.disabled) },
|
|
17
|
+
React.createElement("div", { className: styles[itemClassess], onClick: () => handleItemClick(item, item.disabled) },
|
|
17
18
|
React.createElement("div", { className: itemBlock },
|
|
18
19
|
style === 'default' && item.icon && React.cloneElement(item.icon, { strokeWidth: size === 'lg' ? '0.5' : size === 'md' ? '0.3' : '0.0' }),
|
|
19
|
-
React.createElement("div", { className: styles
|
|
20
|
-
React.createElement("span", null, item.value)),
|
|
20
|
+
React.createElement("div", { className: styles["item"] },
|
|
21
|
+
React.createElement("span", null, (item === null || item === void 0 ? void 0 : item.value) || item)),
|
|
21
22
|
(selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === item.value && React.createElement(IconCheck10, { strokeWidth: size === 'lg' ? '0.5' : size === 'md' ? '0.3' : '0.0', htmlColor: '#0D99FF' })),
|
|
22
|
-
item.isDivider && React.createElement("div", { className: styles
|
|
23
|
-
item.children && (React.createElement("div", { className: styles
|
|
23
|
+
item.isDivider && React.createElement("div", { className: styles["divider"] })),
|
|
24
|
+
(item === null || item === void 0 ? void 0 : item.children) && (React.createElement("div", { className: styles["nestedMenu"] }, (_a = item.children) === null || _a === void 0 ? void 0 : _a.map((child, index) => (React.createElement(DropdownListItem, { key: index, item: child, size: size, selectedItem: selectedItem, onChange: onChange })))))));
|
|
24
25
|
};
|
|
25
26
|
export const Dropdown = ({ id, name, label, size = 'md', disabled, className, defaultValue, items, isOpened = false, style = 'default', readOnly = false, isLeftLabel = false }) => {
|
|
26
27
|
const [isOpen, setIsOpen] = useState(isOpened);
|
|
@@ -41,27 +42,57 @@ export const Dropdown = ({ id, name, label, size = 'md', disabled, className, de
|
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
const wrapperClassess = classNames(styles[`dropdown--container`], {
|
|
44
|
-
|
|
45
|
+
'wrapper--left': isLeftLabel,
|
|
45
46
|
});
|
|
46
|
-
const buttonClassess = classNames(styles
|
|
47
|
-
const dropdownClassess = classNames(styles
|
|
48
|
-
|
|
47
|
+
const buttonClassess = classNames(styles['button'], className, styles[`button--${size}`], { 'button-item--selected': (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) && !disabled }, { 'button--readOnly': readOnly }, { 'button--disabled': disabled });
|
|
48
|
+
const dropdownClassess = classNames(styles['dropdown'], className, {
|
|
49
|
+
'dropdown--disabled': disabled,
|
|
49
50
|
});
|
|
50
|
-
const labelClasses = classNames(styles
|
|
51
|
-
|
|
51
|
+
const labelClasses = classNames(styles['label'], { 'label--default': !isLeftLabel,
|
|
52
|
+
'label--left': isLeftLabel,
|
|
52
53
|
});
|
|
54
|
+
const checkItem = (item) => {
|
|
55
|
+
if (typeof item === 'object') {
|
|
56
|
+
if (item.value) {
|
|
57
|
+
return item;
|
|
58
|
+
}
|
|
59
|
+
else if (item.name && !item.value) {
|
|
60
|
+
return Object.assign(Object.assign({}, item), { value: name });
|
|
61
|
+
}
|
|
62
|
+
else if (item.description && !item.value) {
|
|
63
|
+
return Object.assign(Object.assign({}, item), { value: item.description });
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const keys = Object.keys(item);
|
|
67
|
+
if (keys.length) {
|
|
68
|
+
const firstValue = item[keys[0]];
|
|
69
|
+
return Object.assign(Object.assign({}, item), { value: firstValue });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else if (typeof item === 'string' || typeof item === 'number') {
|
|
74
|
+
return { value: item };
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
53
80
|
const getDropdownMenu = () => {
|
|
54
81
|
// const menu = withPortal ? (
|
|
55
82
|
// ReactDOM.createPortal(<DropdownMenu withPortal >{children}</DropdownMenu>, portalContainer)
|
|
56
83
|
// ) : <DropdownMenu>{children}</DropdownMenu>
|
|
57
|
-
const menu = isOpen && React.createElement("div", { className: dropdownClassess }, items
|
|
84
|
+
const menu = isOpen && React.createElement("div", { className: styles[dropdownClassess] }, items === null || items === void 0 ? void 0 : items.map((item, index) => {
|
|
85
|
+
var _a;
|
|
86
|
+
const modifiedItem = checkItem(item);
|
|
87
|
+
return (React.createElement(DropdownListItem, { key: (_a = item === null || item === void 0 ? void 0 : item.key) !== null && _a !== void 0 ? _a : index, item: modifiedItem, size: size, selectedItem: selectedItem, style: style, onChange: onChange }));
|
|
88
|
+
}));
|
|
58
89
|
return isOpen ? menu : null;
|
|
59
90
|
};
|
|
60
91
|
useEffect(() => {
|
|
61
92
|
if (containerRef.current) {
|
|
62
|
-
const textWidth = Math.max(name.length, (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value.length) || 0);
|
|
93
|
+
const textWidth = Math.max(name === null || name === void 0 ? void 0 : name.length, (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value.length) || 0);
|
|
63
94
|
let newWidth;
|
|
64
|
-
if (textWidth === name.length) {
|
|
95
|
+
if (textWidth === (name === null || name === void 0 ? void 0 : name.length)) {
|
|
65
96
|
const inPixel = size === 'sm' ? 11 : size === 'md' ? 12 : 14;
|
|
66
97
|
newWidth = selectedItem ? textWidth * inPixel : textWidth * inPixel;
|
|
67
98
|
}
|
|
@@ -72,7 +103,7 @@ export const Dropdown = ({ id, name, label, size = 'md', disabled, className, de
|
|
|
72
103
|
setContainerWidth(newWidth);
|
|
73
104
|
}
|
|
74
105
|
}, [selectedItem, name, isOpen, size]);
|
|
75
|
-
return (React.createElement("div", { className: wrapperClassess, ref: containerRef, style: { width: containerWidth ? `${containerWidth}px` : 'auto' } },
|
|
106
|
+
return (React.createElement("div", { className: styles[wrapperClassess], ref: containerRef, style: { width: containerWidth ? `${containerWidth}px` : 'auto' } },
|
|
76
107
|
selectedItem && label && (React.createElement("label", { className: labelClasses, htmlFor: id }, label)),
|
|
77
108
|
React.createElement("button", { className: buttonClassess, onClick: readOnly ? undefined : handleToggle, disabled: disabled },
|
|
78
109
|
React.createElement("div", { className: style === 'default' && (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.icon) ? styles[`button--default--item-selected`] : '' },
|
|
@@ -10,28 +10,28 @@ export const Input = ({ id, className, value, label, placeholder, size = 'md', o
|
|
|
10
10
|
onChange(e);
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
-
const wrapperClassess = classNames(styles
|
|
14
|
-
|
|
13
|
+
const wrapperClassess = classNames(styles['wrapper'], {
|
|
14
|
+
'wrapper--left': isLeftLabel,
|
|
15
15
|
});
|
|
16
|
-
const inputWrapperClassess = classNames(styles[
|
|
17
|
-
const inputClassess = classNames(styles
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
const inputWrapperClassess = classNames(styles['wrapper--input']);
|
|
17
|
+
const inputClassess = classNames(styles['inputText'], size, className, {
|
|
18
|
+
'input--error': hasError,
|
|
19
|
+
'readOnly': readOnly,
|
|
20
|
+
'input--withIcon': icon,
|
|
21
|
+
'textarea': multiline,
|
|
22
|
+
'resize': resize,
|
|
23
23
|
});
|
|
24
|
-
const labelClasses = classNames(styles
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const labelClasses = classNames(styles['label'], {
|
|
25
|
+
'label--default': !isLeftLabel,
|
|
26
|
+
'label--left': isLeftLabel,
|
|
27
27
|
});
|
|
28
|
-
const iconClassess = classNames(styles
|
|
29
|
-
|
|
28
|
+
const iconClassess = classNames(styles['icon'], {
|
|
29
|
+
'input--withIcon': multiline,
|
|
30
30
|
});
|
|
31
31
|
return (React.createElement("div", { className: wrapperClassess },
|
|
32
32
|
((value && !isLeftLabel) || isLeftLabel) && (React.createElement("label", { className: labelClasses, htmlFor: id }, label)),
|
|
33
33
|
React.createElement("div", { className: inputWrapperClassess },
|
|
34
34
|
icon && React.createElement("div", { className: iconClassess }, icon),
|
|
35
35
|
multiline ? (React.createElement("textarea", { id: id, className: inputClassess, value: value, placeholder: placeholder, onChange: handleChange, disabled: disabled })) : (React.createElement("input", { id: id, className: inputClassess, value: value, placeholder: placeholder, onChange: handleChange, disabled: disabled, readOnly: readOnly }))),
|
|
36
|
-
hasError && helperText && React.createElement("div", { className:
|
|
36
|
+
hasError && helperText && React.createElement("div", { className: "helperText" }, helperText)));
|
|
37
37
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.story--wrapper {
|
|
1
|
+
.story--wrapper-iput {
|
|
2
2
|
background-color: var(--white);
|
|
3
3
|
padding: 30px;
|
|
4
4
|
border-radius: 10px;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
.wrapper--input {
|
|
22
22
|
position: relative;
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.inputText {
|
|
25
25
|
font-family: 'Raleway';
|
|
26
26
|
font-style: normal;
|
|
27
27
|
font-weight: 400;
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
outline: none;
|
|
36
36
|
border: 1px solid var(--grey-light);
|
|
37
37
|
border-radius: 10px;
|
|
38
|
+
/* width: fit-content; */
|
|
38
39
|
}
|
|
39
40
|
/* Стили при наведении мыши */
|
|
40
41
|
.input:hover {
|
|
@@ -61,17 +62,17 @@
|
|
|
61
62
|
.resize {
|
|
62
63
|
resize: both;
|
|
63
64
|
}
|
|
64
|
-
.lg {
|
|
65
|
-
|
|
66
|
-
height: 25px;
|
|
65
|
+
.inputText.lg {
|
|
66
|
+
height: 40px;
|
|
67
|
+
/* height: 25px; */
|
|
67
68
|
}
|
|
68
|
-
.md {
|
|
69
|
-
|
|
70
|
-
height: 20px;
|
|
69
|
+
.inputText.md {
|
|
70
|
+
height: 35px;
|
|
71
|
+
/* height: 20px; */
|
|
71
72
|
}
|
|
72
|
-
.sm {
|
|
73
|
+
.inputText.sm {
|
|
73
74
|
/* height: 30px; */
|
|
74
|
-
height:
|
|
75
|
+
height: 25px;
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
.filled {
|
|
@@ -163,14 +164,13 @@
|
|
|
163
164
|
/* Стили для Иконок */
|
|
164
165
|
.input--withIcon {
|
|
165
166
|
padding-left: 35px;
|
|
167
|
+
top: 5%;
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
.icon {
|
|
169
171
|
position: absolute;
|
|
170
172
|
z-index: 1;
|
|
171
|
-
top: 25
|
|
173
|
+
top: 25%;;
|
|
172
174
|
left: 10px;
|
|
173
175
|
}
|
|
174
|
-
|
|
175
|
-
top: 5%;
|
|
176
|
-
}
|
|
176
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import styles from './ProgressBar.module.css';
|
|
3
2
|
import { Typography } from '../Typography/Typography';
|
|
3
|
+
import styles from './ProgressBar.module.css';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
/**
|
|
6
6
|
* Компонент ProgressBar отображает прогресс в виде заполненной полосы.
|
|
@@ -8,9 +8,9 @@ import classNames from 'classnames';
|
|
|
8
8
|
export const ProgressBar = ({ value = 0, max = 100, size = 'md', showValue = true, animated = false, }) => {
|
|
9
9
|
const [percent, setPercent] = useState(value);
|
|
10
10
|
const validPercentage = Math.min(Math.max(value, 0), max);
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const progressBarClasses = classNames(styles['progress-bar'], size, {
|
|
12
|
+
'progress-bar--animated': animated,
|
|
13
|
+
'progress-bar--static': !animated,
|
|
14
14
|
});
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
if (animated) {
|
|
@@ -33,9 +33,9 @@ export const ProgressBar = ({ value = 0, max = 100, size = 'md', showValue = tru
|
|
|
33
33
|
setPercent(validPercentage);
|
|
34
34
|
}
|
|
35
35
|
}, [animated, validPercentage]);
|
|
36
|
-
return (React.createElement("div", { className: styles[
|
|
37
|
-
React.createElement("progress", { id: "linear-progress", className:
|
|
38
|
-
React.createElement("label", { htmlFor: "progress", className: styles[
|
|
36
|
+
return (React.createElement("div", { className: styles["progress-bar--wrapper"] },
|
|
37
|
+
React.createElement("progress", { id: "linear-progress", className: progressBarClasses, value: percent, max: max }),
|
|
38
|
+
React.createElement("label", { htmlFor: "progress", className: styles["progress-bar-percentage"] }, showValue && (React.createElement(Typography, { variant: "Subheading3", color: '#9CA0A7', style: { fontWeight: '300' }, className: styles["progress-bar-percentage"] },
|
|
39
39
|
percent,
|
|
40
40
|
"%")))));
|
|
41
41
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.story--wrapper {
|
|
1
|
+
.story--wrapper-progressbar {
|
|
2
2
|
background-color: var(--white);
|
|
3
3
|
padding: 30px;
|
|
4
4
|
border-radius: 10px;
|
|
@@ -11,25 +11,25 @@
|
|
|
11
11
|
}
|
|
12
12
|
.progress-bar--wrapper {
|
|
13
13
|
display: flex;
|
|
14
|
-
|
|
15
|
-
gap: 20px;
|
|
14
|
+
gap: 40px;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
.progress-bar {
|
|
19
18
|
border: none;
|
|
20
19
|
border-radius: 11px;
|
|
20
|
+
width: 330px;
|
|
21
21
|
}
|
|
22
|
-
.sm {
|
|
23
|
-
width:
|
|
24
|
-
height:
|
|
22
|
+
.progress-bar.sm {
|
|
23
|
+
/* width: 20px; */
|
|
24
|
+
height: 4px;
|
|
25
25
|
}
|
|
26
|
-
.md {
|
|
27
|
-
width: 25vw;
|
|
28
|
-
height:
|
|
26
|
+
.progress-bar.md {
|
|
27
|
+
/* width: 25vw; */
|
|
28
|
+
height: 6px;
|
|
29
29
|
}
|
|
30
|
-
.lg {
|
|
31
|
-
width: 30vw;
|
|
32
|
-
height:
|
|
30
|
+
.progress-bar.lg {
|
|
31
|
+
/* width: 30vw; */
|
|
32
|
+
height: 8px;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.progress-bar::-webkit-progress-bar {
|
|
@@ -47,3 +47,10 @@
|
|
|
47
47
|
.progress-bar--static {
|
|
48
48
|
transition: none;
|
|
49
49
|
}
|
|
50
|
+
.progress-bar-percentage {
|
|
51
|
+
/* position: absolute; */
|
|
52
|
+
/* top: 50%; */
|
|
53
|
+
left: 50%;
|
|
54
|
+
transform: translate(-50%, -50%);
|
|
55
|
+
}
|
|
56
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import styles from './ProgressLoader.module.css';
|
|
3
2
|
import { Typography } from '../Typography/Typography';
|
|
3
|
+
import styles from './ProgressLoader.module.css';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
/**
|
|
6
6
|
* Компонент ProgressLoader отображает прогресс загрузки.
|
|
@@ -23,7 +23,7 @@ export const ProgressLoader = ({ value = 0, size = 'xl', showValue = true, anima
|
|
|
23
23
|
const circumference = 2 * Math.PI * radius;
|
|
24
24
|
const dashArray = circumference;
|
|
25
25
|
const dashOffset = circumference * (1 - fillPercentage);
|
|
26
|
-
const progressLoaderWrapperClasses = classNames(styles['progress-loader-wrapper'],
|
|
26
|
+
const progressLoaderWrapperClasses = classNames(styles['progress-loader-wrapper'], size);
|
|
27
27
|
const getTypographySize = () => {
|
|
28
28
|
switch (size) {
|
|
29
29
|
case 'md':
|
|
@@ -54,7 +54,7 @@ export const ProgressLoader = ({ value = 0, size = 'xl', showValue = true, anima
|
|
|
54
54
|
}
|
|
55
55
|
}, [animated, validPercentage]);
|
|
56
56
|
return (React.createElement("div", { className: progressLoaderWrapperClasses, style: { width: spinnerSize, height: spinnerSize } },
|
|
57
|
-
React.createElement("svg", { id: "svg1", viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`, className: styles[
|
|
57
|
+
React.createElement("svg", { id: "svg1", viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`, className: styles["progress-loader"] },
|
|
58
58
|
React.createElement("circle", { cx: center, cy: center, r: radius, stroke: "#e5e5ea", strokeWidth: strokeWidth, fill: "none", style: { strokeLinecap: 'round' } }),
|
|
59
59
|
React.createElement("circle", { cx: center, cy: center, r: radius, stroke: 'var(--blue-main)', strokeWidth: strokeWidth, fill: "none", style: {
|
|
60
60
|
strokeDasharray: `${dashArray}`,
|
|
@@ -64,8 +64,8 @@ export const ProgressLoader = ({ value = 0, size = 'xl', showValue = true, anima
|
|
|
64
64
|
transformOrigin: '50% 50%',
|
|
65
65
|
//transition: animated ? 'stroke-dashoffset 0.5s ease-in-out' : 'none',
|
|
66
66
|
} }, animated && (React.createElement("animate", { attributeName: "stroke-dashoffset", dur: `${animationDuration / 1000}`, values: `${circumference}; ${percent / 100}`, fill: "freeze" })))),
|
|
67
|
-
showValue && size !== 'sm' && (React.createElement("div", { className: styles[
|
|
68
|
-
React.createElement(Typography, { variant: "Subheading2", color: '#9CA0A7', style: { fontSize: getTypographySize(), fontWeight: '300' }, className: styles[
|
|
67
|
+
showValue && size !== 'sm' && (React.createElement("div", { className: styles["progress-percentage"] },
|
|
68
|
+
React.createElement(Typography, { variant: "Subheading2", color: '#9CA0A7', style: { fontSize: getTypographySize(), fontWeight: '300' }, className: styles["progress-percentage"] },
|
|
69
69
|
percent,
|
|
70
70
|
"%")))));
|
|
71
71
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.story--wrapper {
|
|
1
|
+
.story--wrapper-progress-loader {
|
|
2
2
|
background-color: var(--white);
|
|
3
3
|
padding: 30px;
|
|
4
4
|
border-radius: 10px;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
justify-content: center;
|
|
11
11
|
position: relative;
|
|
12
12
|
}
|
|
13
|
-
.progress-
|
|
13
|
+
.progress-loader--default-story {
|
|
14
14
|
display: flex;
|
|
15
15
|
gap: 30px;
|
|
16
16
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
.progress-percentage {
|
|
22
22
|
position: absolute;
|
|
23
|
-
top: 50%;
|
|
23
|
+
/* top: 50%; */
|
|
24
24
|
left: 50%;
|
|
25
25
|
transform: translate(-50%, -50%);
|
|
26
26
|
}
|
|
@@ -7,7 +7,7 @@ export const RadioButton = ({ value, label, checked, onChange, disabled = false,
|
|
|
7
7
|
onChange(e);
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
|
-
return (React.createElement("label", { className: styles
|
|
11
|
-
React.createElement("input", { type: "radio", checked: checked, value: value, onChange: handleChange, disabled: disabled, className: classNames(styles
|
|
10
|
+
return (React.createElement("label", { className: styles["radio"] },
|
|
11
|
+
React.createElement("input", { type: "radio", checked: checked, value: value, onChange: handleChange, disabled: disabled, className: classNames(styles['input'], size) }),
|
|
12
12
|
label));
|
|
13
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.story--wrapper {
|
|
1
|
+
.story--wrapper-radio {
|
|
2
2
|
background-color: var(--white);
|
|
3
3
|
padding: 30px;
|
|
4
4
|
border-radius: 10px;
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
color: var(--text-dark);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.sm {
|
|
21
|
+
.radio.sm {
|
|
22
22
|
width: 12px;
|
|
23
23
|
height: 12px;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.md {
|
|
26
|
+
.radio.md {
|
|
27
27
|
width: 16px;
|
|
28
28
|
height: 16px;
|
|
29
29
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { Tag } from '../Tag/Tag';
|
|
3
3
|
import ColorPicker from '../ColorPicker/ColorPicker';
|
|
4
|
-
import styles from '
|
|
4
|
+
import styles from './SettingTag.module.css';
|
|
5
5
|
export const SettingTag = ({ label, color, onChange }) => {
|
|
6
6
|
const [isHovered, setIsHovered] = useState(false);
|
|
7
7
|
const colorsOptions = ['red', 'orange', 'yellow', 'green', 'purple', 'indigo', 'blue', 'teal', 'pink'];
|
|
8
8
|
return (React.createElement("div", { style: { display: 'flex', gap: '10px', flexDirection: 'row', alignItems: 'center' } },
|
|
9
9
|
React.createElement(Tag, { label: label, color: color }),
|
|
10
|
-
!isHovered ? (React.createElement("div", { className: styles
|
|
10
|
+
!isHovered ? (React.createElement("div", { className: styles['circle'], onMouseEnter: () => setIsHovered(true), style: {
|
|
11
11
|
width: 10,
|
|
12
12
|
height: 10,
|
|
13
13
|
backgroundColor: (color === null || color === void 0 ? void 0 : color.startsWith('#')) ? color : `var(--${color})`,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.story--wrapper-tag {
|
|
2
|
+
background-color: var(--white);
|
|
3
|
+
padding: 30px;
|
|
4
|
+
border-radius: 10px;
|
|
5
|
+
width: 300px;
|
|
6
|
+
height: 300px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
.circle {
|
|
11
|
+
border-radius: 50%;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
transition: transform 0.2s ease;
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { FC
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { SnackbarProps } from 'kamotive_ui';
|
|
2
3
|
/**
|
|
3
4
|
* @description Snackbar компонент для отображения всплывающих уведомлений
|
|
4
5
|
* @component
|
|
@@ -22,11 +23,4 @@ export declare const title: {
|
|
|
22
23
|
warning: string;
|
|
23
24
|
info: string;
|
|
24
25
|
};
|
|
25
|
-
export type SnackbarProps = {
|
|
26
|
-
children: ReactNode;
|
|
27
|
-
type: 'success' | 'error' | 'warning' | 'info';
|
|
28
|
-
icon?: boolean;
|
|
29
|
-
duration: number;
|
|
30
|
-
onClose?: () => void;
|
|
31
|
-
};
|
|
32
26
|
export declare const Snackbar: FC<SnackbarProps>;
|
|
@@ -43,13 +43,13 @@ export const Snackbar = ({ children, type, duration = 10000, icon = true, onClos
|
|
|
43
43
|
};
|
|
44
44
|
if (!isVisible)
|
|
45
45
|
return null;
|
|
46
|
-
const snackbarClasses = classNames(styles['snackbar-wrapper'],
|
|
46
|
+
const snackbarClasses = classNames(styles['snackbar-wrapper'], type ? `snackbar--${type}` : '');
|
|
47
47
|
return (React.createElement("div", { className: snackbarClasses },
|
|
48
|
-
React.createElement("div", { className: styles[
|
|
48
|
+
React.createElement("div", { className: styles['snackbar-textAndIcon'] },
|
|
49
49
|
icon && icons[type],
|
|
50
|
-
React.createElement("div", { className: styles[
|
|
50
|
+
React.createElement("div", { className: styles['snackbar-text'] },
|
|
51
51
|
React.createElement(Typography, { variant: "Body2-Medium", color: 'var(--text-dark)' }, title[type]),
|
|
52
52
|
React.createElement(Typography, { variant: "Caption", color: 'var(--text-btn-light)' }, children))),
|
|
53
|
-
React.createElement("button", { className: styles
|
|
53
|
+
React.createElement("button", { className: styles['button'], onClick: handleClose },
|
|
54
54
|
React.createElement(IconClose10, { htmlColor: 'var(--text-btn-light)' }))));
|
|
55
55
|
};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
.story--wrapper-snackbar {
|
|
2
|
+
background-color: var(--white);
|
|
3
|
+
padding: 30px;
|
|
4
|
+
border-radius: 10px;
|
|
5
|
+
width: 300px;
|
|
6
|
+
height: 300px;
|
|
7
|
+
}
|
|
1
8
|
.snackbar-wrapper {
|
|
2
9
|
display: flex;
|
|
3
10
|
justify-content: space-between;
|
|
@@ -7,7 +14,8 @@
|
|
|
7
14
|
box-sizing: border-box;
|
|
8
15
|
position: relative;
|
|
9
16
|
min-width: 340px;
|
|
10
|
-
max-width:
|
|
17
|
+
max-width: 500px;
|
|
18
|
+
|
|
11
19
|
border-radius: 15px;
|
|
12
20
|
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
|
|
13
21
|
min-height: 48px;
|
|
@@ -23,6 +31,7 @@
|
|
|
23
31
|
.snackbar-text {
|
|
24
32
|
display: flex;
|
|
25
33
|
flex-direction: column;
|
|
34
|
+
width: 100%;
|
|
26
35
|
}
|
|
27
36
|
.snackbar--success {
|
|
28
37
|
background-color: rgba(52, 199, 89, 0.15);
|
|
@@ -41,7 +50,7 @@
|
|
|
41
50
|
border: none;
|
|
42
51
|
background-color: transparent;
|
|
43
52
|
display: flex;
|
|
44
|
-
justify-content:
|
|
53
|
+
justify-content: end;
|
|
45
54
|
align-items: center;
|
|
46
55
|
padding: 5px;
|
|
47
56
|
margin-top: 3px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import styles from '
|
|
2
|
+
import styles from './Tab.module.css';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
export const Tab = ({ value, onClick, label, selected, disabled = false }) => {
|
|
5
5
|
const handleClick = (e) => {
|
|
@@ -7,8 +7,8 @@ export const Tab = ({ value, onClick, label, selected, disabled = false }) => {
|
|
|
7
7
|
onClick(value);
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
|
-
return (React.createElement("button", { role: "tab", "aria-selected": selected, "aria-disabled": disabled, value: value, className: classNames(styles
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
return (React.createElement("button", { role: "tab", "aria-selected": selected, "aria-disabled": disabled, value: value, className: classNames(styles['tab'], {
|
|
11
|
+
'selected': selected,
|
|
12
|
+
'disabled': disabled,
|
|
13
13
|
}), onClick: handleClick }, label));
|
|
14
14
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.story--wrapper-tab {
|
|
2
|
+
background-color: var(--white);
|
|
3
|
+
padding: 30px;
|
|
4
|
+
border-radius: 10px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.tab {
|
|
8
|
+
width: 126px;
|
|
9
|
+
height: 24px;
|
|
10
|
+
padding: 3px 10px;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
background-color: var(--tab-extraLight);
|
|
15
|
+
border: none;
|
|
16
|
+
|
|
17
|
+
font-family: 'Raleway';
|
|
18
|
+
font-style: normal;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
font-size: 13px;
|
|
21
|
+
line-height: 18px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.tab:hover {
|
|
25
|
+
background-color: var(--tab-medium);
|
|
26
|
+
border-radius: 7px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.selected {
|
|
30
|
+
border: 0.5px solid var(--tab-medium);
|
|
31
|
+
border-radius: 7px;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
background-color: var(--white);
|
|
34
|
+
box-shadow: 0px 2px 1px 0px rgba(0, 0, 0, 0.04);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.selected:hover {
|
|
38
|
+
background-color: var(--tab-light);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.tab.disabled {
|
|
42
|
+
cursor: not-allowed;
|
|
43
|
+
color: var(--text-btn);
|
|
44
|
+
background-color: transparent;
|
|
45
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from './Tabs.module.css';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
3
|
export const Tabs = ({ value, onChange, children }) => {
|
|
5
4
|
var _a;
|
|
6
5
|
const selectedTabContent = (_a = children === null || children === void 0 ? void 0 : children.find((child) => child.props.value === value)) === null || _a === void 0 ? void 0 : _a.props.children;
|
|
@@ -10,7 +9,7 @@ export const Tabs = ({ value, onChange, children }) => {
|
|
|
10
9
|
}
|
|
11
10
|
};
|
|
12
11
|
return (React.createElement(React.Fragment, null,
|
|
13
|
-
React.createElement("div", { role: "tablist", className:
|
|
12
|
+
React.createElement("div", { role: "tablist", className: styles['tabs'] }, children === null || children === void 0 ? void 0 : children.map((child, index) => React.cloneElement(child, {
|
|
14
13
|
key: index,
|
|
15
14
|
selected: child.props.value === value,
|
|
16
15
|
disabled: child.props.disabled,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.story--wrapper {
|
|
1
|
+
.story--wrapper-tabs {
|
|
2
2
|
background-color: var(--white);
|
|
3
3
|
padding: 30px;
|
|
4
4
|
border-radius: 10px;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
padding: 2px;
|
|
12
12
|
border-radius: 9px;
|
|
13
13
|
background-color: var(--tab-extraLight);
|
|
14
|
+
width: fit-content;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
.tab {
|
|
@@ -9,7 +9,7 @@ export const Tag = ({ label, color = 'red', closeButton = false, onClick }) => {
|
|
|
9
9
|
const b = parseInt(hex.slice(5, 7), 16);
|
|
10
10
|
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
11
11
|
};
|
|
12
|
-
return (React.createElement("span", { className: classNames(styles
|
|
12
|
+
return (React.createElement("span", { className: classNames(styles['tag'], !color.startsWith('#') ? `${color}` : ''), style: color.startsWith('#')
|
|
13
13
|
? {
|
|
14
14
|
color: color,
|
|
15
15
|
border: `1px solid ${color}`,
|