kamotive_ui 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Icons/IconClose/IconClose10.d.ts +2 -1
- package/dist/Icons/IconClose/IconClose10.js +2 -2
- package/dist/Icons/IconFile/IconFile.d.ts +6 -0
- package/dist/Icons/IconFile/IconFile.js +5 -0
- package/dist/Icons/IconUpload/IconUpload.d.ts +6 -0
- package/dist/Icons/IconUpload/IconUpload.js +5 -0
- package/dist/Icons/index.d.ts +2 -0
- package/dist/Icons/index.js +2 -0
- package/dist/colors.css +5 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +87 -35
- package/dist/components/Button/Button.module.css +101 -49
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +5 -3
- package/dist/components/Checkbox/Checkbox.module.css +0 -11
- package/dist/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +89 -44
- package/dist/components/ColorPicker/ColorPicker.module.css +25 -42
- package/dist/components/Dropdown/Dropdown.d.ts +12 -8
- package/dist/components/Dropdown/Dropdown.js +239 -77
- package/dist/components/Dropdown/Dropdown.module.css +152 -89
- package/dist/components/FileAttach/FileAttach.d.ts +3 -0
- package/dist/components/FileAttach/FileAttach.js +79 -0
- package/dist/components/FileAttach/FileAttach.module.css +36 -0
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +36 -25
- package/dist/components/Input/Input.module.css +92 -45
- package/dist/components/Loader/Loader.d.ts +3 -0
- package/dist/components/Loader/Loader.js +18 -0
- package/dist/components/Loader/Loader.module.css +75 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +5 -4
- package/dist/components/ProgressBar/ProgressBar.module.css +4 -11
- package/dist/components/ProgressLoader/ProgressLoader.d.ts +1 -1
- package/dist/components/ProgressLoader/ProgressLoader.js +3 -2
- package/dist/components/ProgressLoader/ProgressLoader.module.css +2 -11
- package/dist/components/RadioButton/RadioButton.d.ts +1 -1
- package/dist/components/RadioButton/RadioButton.js +5 -3
- package/dist/components/RadioButton/RadioButton.module.css +2 -15
- package/dist/components/SettingTag/SettingTag.d.ts +1 -1
- package/dist/components/SettingTag/SettingTag.js +7 -6
- package/dist/components/SettingTag/SettingTag.module.css +0 -9
- package/dist/components/Snackbar/Snackbar.d.ts +1 -1
- package/dist/components/Snackbar/Snackbar.js +3 -2
- package/dist/components/Snackbar/Snackbar.module.css +1 -9
- package/dist/components/Spinner/Spinner.d.ts +3 -0
- package/dist/components/Spinner/Spinner.js +30 -0
- package/dist/components/Spinner/Spinner.module.css +20 -0
- package/dist/components/Tab/Tab.d.ts +1 -1
- package/dist/components/Tab/Tab.js +7 -4
- package/dist/components/Tab/Tab.module.css +4 -17
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +2 -1
- package/dist/components/Tabs/Tabs.module.css +0 -6
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.js +74 -13
- package/dist/components/Tag/Tag.module.css +89 -74
- package/dist/components/ToggleButton/ToggleButton.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleButton.js +6 -4
- package/dist/components/ToggleButton/ToggleButton.module.css +0 -5
- package/dist/components/Typography/Typography.d.ts +1 -1
- package/dist/components/Typography/Typography.js +3 -2
- package/dist/components/Typography/Typography.module.css +8 -13
- package/dist/components/Typography/enums.d.ts +2 -0
- package/dist/components/Typography/enums.js +2 -0
- package/dist/index.d.ts +11 -7
- package/dist/index.js +10 -7
- package/dist/types/index.d.ts +310 -0
- package/dist/types/index.js +1 -0
- package/package.json +4 -2
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from './Tab.module.css';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
+
;
|
|
5
|
+
import { Typography } from '../Typography/Typography';
|
|
4
6
|
export const Tab = ({ value, onClick, label, selected, disabled = false }) => {
|
|
5
7
|
const handleClick = (e) => {
|
|
6
8
|
if (onClick && value && !disabled) {
|
|
7
9
|
onClick(value);
|
|
8
10
|
}
|
|
9
11
|
};
|
|
10
|
-
return (React.createElement("button", { role: "tab", "aria-selected": selected, "aria-disabled": disabled, value: value, className: classNames(styles
|
|
11
|
-
'selected': selected,
|
|
12
|
-
'disabled': disabled,
|
|
13
|
-
}), onClick: handleClick },
|
|
12
|
+
return (React.createElement("button", { role: "tab", "aria-selected": selected, "aria-disabled": disabled, value: value, className: classNames(styles.tab, {
|
|
13
|
+
[styles['selected']]: selected,
|
|
14
|
+
[styles['disabled']]: disabled,
|
|
15
|
+
}), onClick: handleClick },
|
|
16
|
+
React.createElement(Typography, { variant: selected ? 'Body2-Medium' : "Body2" }, label)));
|
|
14
17
|
};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
.story--wrapper-tab {
|
|
2
|
-
background-color: var(--white);
|
|
3
|
-
padding: 30px;
|
|
4
|
-
border-radius: 10px;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
1
|
.tab {
|
|
8
2
|
width: 126px;
|
|
9
3
|
height: 24px;
|
|
@@ -13,17 +7,6 @@
|
|
|
13
7
|
justify-content: center;
|
|
14
8
|
background-color: var(--tab-extraLight);
|
|
15
9
|
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
10
|
}
|
|
28
11
|
|
|
29
12
|
.selected {
|
|
@@ -33,6 +16,10 @@
|
|
|
33
16
|
background-color: var(--white);
|
|
34
17
|
box-shadow: 0px 2px 1px 0px rgba(0, 0, 0, 0.04);
|
|
35
18
|
}
|
|
19
|
+
.tab:hover {
|
|
20
|
+
background-color: var(--tab-medium);
|
|
21
|
+
border-radius: 7px;
|
|
22
|
+
}
|
|
36
23
|
|
|
37
24
|
.selected:hover {
|
|
38
25
|
background-color: var(--tab-light);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
;
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import styles from './Tabs.module.css';
|
|
3
4
|
export const Tabs = ({ value, onChange, children }) => {
|
|
@@ -9,7 +10,7 @@ export const Tabs = ({ value, onChange, children }) => {
|
|
|
9
10
|
}
|
|
10
11
|
};
|
|
11
12
|
return (React.createElement(React.Fragment, null,
|
|
12
|
-
React.createElement("div", { role: "tablist", className: styles
|
|
13
|
+
React.createElement("div", { role: "tablist", className: styles.tabs }, children === null || children === void 0 ? void 0 : children.map((child, index) => React.cloneElement(child, {
|
|
13
14
|
key: index,
|
|
14
15
|
selected: child.props.value === value,
|
|
15
16
|
disabled: child.props.disabled,
|
|
@@ -1,23 +1,84 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
;
|
|
2
3
|
import styles from './Tag.module.css';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const hexToRgba = (hex, alpha) => {
|
|
6
|
+
//преобразуем в rgba для заднего фона
|
|
7
|
+
const r = parseInt(hex.slice(1, 3), 16);
|
|
8
|
+
const g = parseInt(hex.slice(3, 5), 16);
|
|
9
|
+
const b = parseInt(hex.slice(5, 7), 16);
|
|
10
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
11
|
+
};
|
|
12
|
+
// функция для расчёта относительной яркости
|
|
13
|
+
const getLuminance = (hexColor) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const rgb = (_a = hexColor
|
|
16
|
+
.replace('#', '')
|
|
17
|
+
.match(/.{2}/g)) === null || _a === void 0 ? void 0 : _a.map((c) => parseInt(c, 16) / 255);
|
|
18
|
+
if (!rgb)
|
|
19
|
+
return 0;
|
|
20
|
+
const [r, g, b] = rgb.map((c) => c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4));
|
|
21
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
22
|
+
};
|
|
23
|
+
// функция для проверки контрастности
|
|
24
|
+
const getContrastRatio = (color1, color2) => {
|
|
25
|
+
const lum1 = getLuminance(color1);
|
|
26
|
+
const lum2 = getLuminance(color2);
|
|
27
|
+
return (Math.max(lum1, lum2) + 0.05) / (Math.min(lum1, lum2) + 0.05);
|
|
28
|
+
};
|
|
29
|
+
// проверка и смену цвета текста
|
|
30
|
+
const adjustTextColor = (backgroundColor) => {
|
|
31
|
+
const white = '#ffffff';
|
|
32
|
+
const black = hexToRgba('#000000', 0.4);
|
|
33
|
+
const contrastWithWhite = getContrastRatio(backgroundColor, white);
|
|
34
|
+
return contrastWithWhite < 1.5 ? black : "";
|
|
35
|
+
};
|
|
36
|
+
export const Tag = ({ label, color = 'red', closeButton = false, editable = 'false', onClick, onChange, }) => {
|
|
37
|
+
const [newLabel, setNewLabel] = useState(label);
|
|
38
|
+
const [width, setWidth] = useState(0);
|
|
39
|
+
const measurementDivRef = useRef(null);
|
|
40
|
+
const adjustedColor = adjustTextColor(color) || color;
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (measurementDivRef.current) {
|
|
43
|
+
const textWidth = measurementDivRef.current.clientWidth;
|
|
44
|
+
setWidth(textWidth);
|
|
45
|
+
}
|
|
46
|
+
}, [newLabel]);
|
|
47
|
+
const handleBlur = () => {
|
|
48
|
+
if (onChange) {
|
|
49
|
+
onChange(newLabel);
|
|
50
|
+
}
|
|
11
51
|
};
|
|
12
|
-
return (React.createElement("span", { className: classNames(styles
|
|
52
|
+
return (React.createElement("span", { className: classNames(styles.tag, !color.startsWith('#') && styles[color]), style: color.startsWith('#')
|
|
13
53
|
? {
|
|
14
|
-
color:
|
|
15
|
-
border: `1px solid ${
|
|
54
|
+
color: adjustedColor,
|
|
55
|
+
border: `1px solid ${adjustedColor}`,
|
|
16
56
|
backgroundColor: hexToRgba(color, 0.2),
|
|
17
57
|
}
|
|
18
58
|
: {} },
|
|
19
|
-
|
|
59
|
+
editable ? (React.createElement("div", { style: { position: "relative" } },
|
|
60
|
+
React.createElement("input", { type: "text", placeholder: label, value: newLabel, onChange: (e) => {
|
|
61
|
+
setNewLabel(e.target.value);
|
|
62
|
+
}, onBlur: handleBlur, style: {
|
|
63
|
+
color: (color === null || color === void 0 ? void 0 : color.startsWith('#')) ? adjustedColor : `var(--${color})`,
|
|
64
|
+
'--placeholder-color': (color === null || color === void 0 ? void 0 : color.startsWith('#')) ? adjustedColor : `var(--${color})`,
|
|
65
|
+
width: `${width}px`,
|
|
66
|
+
minWidth: '25px',
|
|
67
|
+
} }),
|
|
68
|
+
React.createElement("div", { ref: measurementDivRef, style: {
|
|
69
|
+
position: 'absolute',
|
|
70
|
+
visibility: 'hidden',
|
|
71
|
+
height: 0,
|
|
72
|
+
whiteSpace: 'pre',
|
|
73
|
+
fontSize: 'inherit',
|
|
74
|
+
fontFamily: 'inherit',
|
|
75
|
+
fontWeight: 'inherit',
|
|
76
|
+
letterSpacing: 'inherit',
|
|
77
|
+
} }, newLabel || 'Item'))) : (React.createElement(React.Fragment, null,
|
|
78
|
+
" ",
|
|
79
|
+
label,
|
|
80
|
+
" ")),
|
|
20
81
|
closeButton && (React.createElement("button", { type: "button", "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", style: color.startsWith('#')
|
|
21
|
-
? { '--close-color':
|
|
82
|
+
? { '--close-color': adjustedColor }
|
|
22
83
|
: { '--close-color': `var(--${color})` }, onClick: onClick }))));
|
|
23
84
|
};
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
.story--wrapper-tag {
|
|
2
|
-
background-color: var(--white);
|
|
3
|
-
padding: 30px;
|
|
4
|
-
border-radius: 10px;
|
|
5
|
-
width: 300px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
.tag {
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
padding: 4px 10px;
|
|
3
|
+
border-radius: 8px;
|
|
11
4
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 10px;
|
|
16
9
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
font-family: 'Raleway';
|
|
11
|
+
font-style: normal;
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
line-height: 14px;
|
|
15
|
+
width: fit-content;
|
|
22
16
|
}
|
|
23
17
|
|
|
24
18
|
.tag .circle {
|
|
@@ -28,118 +22,139 @@
|
|
|
28
22
|
position: relative;
|
|
29
23
|
}
|
|
30
24
|
|
|
31
|
-
.tag button[aria-label=
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
.tag button[aria-label='Закрыть'] {
|
|
26
|
+
background: none;
|
|
27
|
+
border: none;
|
|
28
|
+
padding: 0;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
position: relative;
|
|
31
|
+
width: 8px;
|
|
32
|
+
height: 8px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tag button[aria-label='Закрыть']::before,
|
|
36
|
+
.tag button[aria-label='Закрыть']::after {
|
|
37
|
+
content: '';
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 50%;
|
|
40
|
+
left: 50%;
|
|
41
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
|
42
|
+
height: 1px;
|
|
43
|
+
width: 100%;
|
|
44
|
+
background-color: var(--close-color);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tag button[aria-label='Закрыть']::after {
|
|
48
|
+
transform: translate(-50%, -50%) rotate(-45deg);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.tag input {
|
|
52
|
+
background: none;
|
|
53
|
+
border: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.tag input:hover {
|
|
57
|
+
background: none;
|
|
58
|
+
border: none;
|
|
39
59
|
}
|
|
40
60
|
|
|
41
|
-
.tag
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
top: 50%;
|
|
46
|
-
left: 50%;
|
|
47
|
-
transform: translate(-50%, -50%) rotate(45deg);
|
|
48
|
-
height: 1px;
|
|
49
|
-
width: 100%;
|
|
50
|
-
background-color: var(--close-color);
|
|
61
|
+
.tag input:focus {
|
|
62
|
+
outline: none;
|
|
63
|
+
border: none;
|
|
64
|
+
background-color: none;
|
|
51
65
|
}
|
|
52
66
|
|
|
53
|
-
.tag
|
|
54
|
-
|
|
67
|
+
.tag input::placeholder {
|
|
68
|
+
color: var(--placeholder-color);
|
|
69
|
+
opacity: 0.5;
|
|
55
70
|
}
|
|
56
71
|
|
|
57
72
|
.tag.red {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
73
|
+
color: var(--red);
|
|
74
|
+
background-color: var(--redBackground);
|
|
75
|
+
border: 1px solid var(--red);
|
|
61
76
|
}
|
|
62
77
|
|
|
63
78
|
.tag.red:hover {
|
|
64
|
-
|
|
79
|
+
background-color: var(--redHover);
|
|
65
80
|
}
|
|
66
81
|
|
|
67
82
|
.tag.orange {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
83
|
+
color: var(--orange);
|
|
84
|
+
background-color: var(--orangeBackground);
|
|
85
|
+
border: 1px solid var(--orange);
|
|
71
86
|
}
|
|
72
87
|
|
|
73
88
|
.tag.orange:hover {
|
|
74
|
-
|
|
89
|
+
background-color: var(--orangeHover);
|
|
75
90
|
}
|
|
76
91
|
|
|
77
92
|
.tag.yellow {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
93
|
+
color: var(--yellowText);
|
|
94
|
+
background-color: var(--yellowBackground);
|
|
95
|
+
border: 1px solid var(--yellow);
|
|
81
96
|
}
|
|
82
97
|
|
|
83
98
|
.tag.yellow:hover {
|
|
84
|
-
|
|
99
|
+
background-color: var(--yellowHover);
|
|
85
100
|
}
|
|
86
101
|
|
|
87
102
|
.tag.green {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
103
|
+
color: var(--green);
|
|
104
|
+
background-color: var(--greenBackground);
|
|
105
|
+
border: 1px solid var(--green);
|
|
91
106
|
}
|
|
92
107
|
|
|
93
108
|
.tag.green:hover {
|
|
94
|
-
|
|
109
|
+
background-color: var(--greenHover);
|
|
95
110
|
}
|
|
96
111
|
|
|
97
112
|
.tag.purple {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
113
|
+
color: var(--purple);
|
|
114
|
+
background-color: var(--purpleBackground);
|
|
115
|
+
border: 1px solid var(--purple);
|
|
101
116
|
}
|
|
102
117
|
|
|
103
118
|
.tag.purple:hover {
|
|
104
|
-
|
|
119
|
+
background-color: var(--purpleHover);
|
|
105
120
|
}
|
|
106
121
|
|
|
107
122
|
.tag.indigo {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
123
|
+
color: var(--indigo);
|
|
124
|
+
background-color: var(--indigoBackground);
|
|
125
|
+
border: 1px solid var(--indigo);
|
|
111
126
|
}
|
|
112
127
|
|
|
113
128
|
.tag.indigo:hover {
|
|
114
|
-
|
|
129
|
+
background-color: var(--indigoHover);
|
|
115
130
|
}
|
|
116
131
|
|
|
117
132
|
.tag.blue {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
133
|
+
color: var(--blue);
|
|
134
|
+
background-color: var(--blueBackground);
|
|
135
|
+
border: 1px solid var(--blue);
|
|
121
136
|
}
|
|
122
137
|
|
|
123
138
|
.tag.blue:hover {
|
|
124
|
-
|
|
139
|
+
background-color: var(--blueHover);
|
|
125
140
|
}
|
|
126
141
|
|
|
127
142
|
.tag.teal {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
143
|
+
color: var(--teal);
|
|
144
|
+
background-color: var(--tealBackground);
|
|
145
|
+
border: 1px solid var(--teal);
|
|
131
146
|
}
|
|
132
147
|
|
|
133
148
|
.tag.teal:hover {
|
|
134
|
-
|
|
149
|
+
background-color: var(--tealHover);
|
|
135
150
|
}
|
|
136
151
|
|
|
137
152
|
.tag.pink {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
153
|
+
color: var(--pink);
|
|
154
|
+
background-color: var(--pinkBackground);
|
|
155
|
+
border: 1px solid var(--pink);
|
|
141
156
|
}
|
|
142
157
|
|
|
143
158
|
.tag.pink:hover {
|
|
144
|
-
|
|
159
|
+
background-color: var(--pinkHover);
|
|
145
160
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from './ToggleButton.module.css';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
|
|
4
|
+
;
|
|
5
|
+
import { Typography } from '../Typography/Typography';
|
|
6
|
+
export const ToggleButton = ({ value, onChange, disabled = false, size = 'md', label }) => {
|
|
5
7
|
const handleChange = (e) => {
|
|
6
8
|
if (onChange) {
|
|
7
9
|
onChange(e);
|
|
8
10
|
}
|
|
9
11
|
};
|
|
10
|
-
return (React.createElement("label", { className: styles
|
|
11
|
-
React.createElement("input", { type: "checkbox", checked: value, onChange: handleChange, disabled: disabled, className: classNames(styles
|
|
12
|
-
label));
|
|
12
|
+
return (React.createElement("label", { className: styles.toggle },
|
|
13
|
+
React.createElement("input", { type: "checkbox", checked: value, onChange: handleChange, disabled: disabled, className: classNames(styles.toggleInput, styles[size]) }),
|
|
14
|
+
React.createElement(Typography, { variant: 'Body2' }, label)));
|
|
13
15
|
};
|
|
@@ -12,6 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
;
|
|
14
14
|
import classNames from 'classnames';
|
|
15
|
+
;
|
|
15
16
|
import { ETypographyVariants } from './enums';
|
|
16
17
|
import styles from './Typography.module.css';
|
|
17
18
|
/**
|
|
@@ -19,7 +20,7 @@ import styles from './Typography.module.css';
|
|
|
19
20
|
*/
|
|
20
21
|
export const Typography = (_a) => {
|
|
21
22
|
var { variant = ETypographyVariants.Body1, children, className, color, style } = _a, props = __rest(_a, ["variant", "children", "className", "color", "style"]);
|
|
22
|
-
const variantClass = classNames([`typography--variant-${variant}`], className);
|
|
23
|
+
const variantClass = classNames(styles[`typography--variant-${variant}`], className);
|
|
23
24
|
const combinedStyle = Object.assign({ color }, style);
|
|
24
|
-
return (React.createElement("span", Object.assign({ className:
|
|
25
|
+
return (React.createElement("span", Object.assign({ className: variantClass, style: combinedStyle }, props), children));
|
|
25
26
|
};
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
.story--wrapper-typography{
|
|
3
|
-
background-color: var(--white);
|
|
4
|
-
width: 900px;
|
|
5
|
-
}
|
|
6
|
-
.typography--wrapper-typography {
|
|
7
|
-
display: grid;
|
|
8
|
-
grid-template-columns: 4fr 170px 80px 150px;
|
|
9
|
-
gap: 20px;
|
|
10
|
-
align-items: center;
|
|
11
|
-
height: 60px;
|
|
12
|
-
width: 1100px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
2
|
.typography--variant-Heading1 {
|
|
16
3
|
font-family: var(--font-family-main);
|
|
17
4
|
font-size: var(--font-size-48);
|
|
@@ -188,6 +175,14 @@
|
|
|
188
175
|
letter-spacing: var(--letterSpacing);
|
|
189
176
|
text-decoration: none;
|
|
190
177
|
}
|
|
178
|
+
.typography--variant-Body2-SemiBold{
|
|
179
|
+
font-family: var(--font-family-main);
|
|
180
|
+
font-size: var(--font-size-14);
|
|
181
|
+
font-weight: var(--font-weight-semiBold);
|
|
182
|
+
line-height: var(--lineHeight-14);
|
|
183
|
+
letter-spacing: var(--letterSpacing);
|
|
184
|
+
text-decoration: none;
|
|
185
|
+
}
|
|
191
186
|
.typography--variant-Body2-Bold{
|
|
192
187
|
font-family: var(--font-family-main);
|
|
193
188
|
font-size: var(--font-size-14);
|
|
@@ -11,9 +11,11 @@ export declare enum ETypographyVariants {
|
|
|
11
11
|
'Body-Bold' = "Body-Bold",
|
|
12
12
|
'Body1' = "Body1",
|
|
13
13
|
'Body1-Medium' = "Body1-Medium",
|
|
14
|
+
'Body1-SemiBold' = "Body1-SemiBold",
|
|
14
15
|
'Body1-Bold' = "Body1-Bold",
|
|
15
16
|
'Body2' = "Body2",
|
|
16
17
|
'Body2-Medium' = "Body2-Medium",
|
|
18
|
+
'Body2-SemiBold' = "Body2-SemiBold",
|
|
17
19
|
'Body2-Bold' = "Body2-Bold",
|
|
18
20
|
'Caption' = "Caption",
|
|
19
21
|
'Caption-Medium' = "Caption-Medium",
|
|
@@ -12,9 +12,11 @@ export var ETypographyVariants;
|
|
|
12
12
|
ETypographyVariants["Body-Bold"] = "Body-Bold";
|
|
13
13
|
ETypographyVariants["Body1"] = "Body1";
|
|
14
14
|
ETypographyVariants["Body1-Medium"] = "Body1-Medium";
|
|
15
|
+
ETypographyVariants["Body1-SemiBold"] = "Body1-SemiBold";
|
|
15
16
|
ETypographyVariants["Body1-Bold"] = "Body1-Bold";
|
|
16
17
|
ETypographyVariants["Body2"] = "Body2";
|
|
17
18
|
ETypographyVariants["Body2-Medium"] = "Body2-Medium";
|
|
19
|
+
ETypographyVariants["Body2-SemiBold"] = "Body2-SemiBold";
|
|
18
20
|
ETypographyVariants["Body2-Bold"] = "Body2-Bold";
|
|
19
21
|
ETypographyVariants["Caption"] = "Caption";
|
|
20
22
|
ETypographyVariants["Caption-Medium"] = "Caption-Medium";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
export { Button as Button } from './components/Button/Button';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { Checkbox as Checkbox } from './components/Checkbox/Checkbox';
|
|
3
|
+
export { ColorPicker as ColorPicker } from './components/ColorPicker/ColorPicker';
|
|
4
4
|
export { Dropdown as Dropdown } from './components/Dropdown/Dropdown';
|
|
5
|
+
export { Input as Input } from './components/Input/Input';
|
|
5
6
|
export { ProgressBar as ProgressBar } from './components/ProgressBar/ProgressBar';
|
|
6
7
|
export { ProgressLoader as ProgressLoader } from './components/ProgressLoader/ProgressLoader';
|
|
7
|
-
export { Typography as Typography } from './components/Typography/Typography';
|
|
8
|
-
export { Checkbox as Checkbox } from './components/Checkbox/Checkbox';
|
|
9
8
|
export { RadioButton as RadioButton } from './components/RadioButton/RadioButton';
|
|
10
|
-
export { Tab as Tab } from './components/Tab/Tab';
|
|
11
|
-
export { Tabs as Tabs } from './components/Tabs/Tabs';
|
|
12
9
|
export { SettingTag as SettingTag } from './components/SettingTag/SettingTag';
|
|
13
|
-
export { ColorPicker as ColorPicker } from './components/ColorPicker/ColorPicker';
|
|
14
10
|
export { Snackbar as Snackbar } from './components/Snackbar/Snackbar';
|
|
11
|
+
export { Tab as Tab } from './components/Tab/Tab';
|
|
12
|
+
export { Tabs as Tabs } from './components/Tabs/Tabs';
|
|
13
|
+
export { Tag as Tag } from './components/Tag/Tag';
|
|
15
14
|
export { ToggleButton as ToggleButton } from './components/ToggleButton/ToggleButton';
|
|
15
|
+
export { Typography as Typography } from './components/Typography/Typography';
|
|
16
|
+
export { Loader as Loader } from './components/Loader/Loader';
|
|
17
|
+
export { FileAttach as FileAttach } from './components/FileAttach/FileAttach';
|
|
18
|
+
export { Spinner as Spinner } from './components/Spinner/Spinner';
|
|
19
|
+
export type { ButtonProps, InputProps, TagProps, SettingTagProps, ToggleButtonProps, BaseOptions, TOptions, DropdownProps, TypographyProps, ProgressBarProps, ProgressLoaderProps, RadioProps, TabsProps, ColorPickerProps, SnackbarProps, LoaderProps, FileAttachProps, SpinnerProps } from './types';
|
|
16
20
|
import './fonts.css';
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
export { Button as Button } from './components/Button/Button';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { Checkbox as Checkbox } from './components/Checkbox/Checkbox';
|
|
3
|
+
export { ColorPicker as ColorPicker } from './components/ColorPicker/ColorPicker';
|
|
4
4
|
export { Dropdown as Dropdown } from './components/Dropdown/Dropdown';
|
|
5
|
+
export { Input as Input } from './components/Input/Input';
|
|
5
6
|
export { ProgressBar as ProgressBar } from './components/ProgressBar/ProgressBar';
|
|
6
7
|
export { ProgressLoader as ProgressLoader } from './components/ProgressLoader/ProgressLoader';
|
|
7
|
-
export { Typography as Typography } from './components/Typography/Typography';
|
|
8
|
-
export { Checkbox as Checkbox } from './components/Checkbox/Checkbox';
|
|
9
8
|
export { RadioButton as RadioButton } from './components/RadioButton/RadioButton';
|
|
10
|
-
export { Tab as Tab } from './components/Tab/Tab';
|
|
11
|
-
export { Tabs as Tabs } from './components/Tabs/Tabs';
|
|
12
9
|
export { SettingTag as SettingTag } from './components/SettingTag/SettingTag';
|
|
13
|
-
export { ColorPicker as ColorPicker } from './components/ColorPicker/ColorPicker';
|
|
14
10
|
export { Snackbar as Snackbar } from './components/Snackbar/Snackbar';
|
|
11
|
+
export { Tab as Tab } from './components/Tab/Tab';
|
|
12
|
+
export { Tabs as Tabs } from './components/Tabs/Tabs';
|
|
13
|
+
export { Tag as Tag } from './components/Tag/Tag';
|
|
15
14
|
export { ToggleButton as ToggleButton } from './components/ToggleButton/ToggleButton';
|
|
15
|
+
export { Typography as Typography } from './components/Typography/Typography';
|
|
16
|
+
export { Loader as Loader } from './components/Loader/Loader';
|
|
17
|
+
export { FileAttach as FileAttach } from './components/FileAttach/FileAttach';
|
|
18
|
+
export { Spinner as Spinner } from './components/Spinner/Spinner';
|
|
16
19
|
import './fonts.css';
|