kamotive_ui 1.2.2 → 1.2.3
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/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +3 -6
- package/dist/components/Button/Button.module.css +0 -11
- 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 +12 -11
- package/dist/components/ColorPicker/ColorPicker.module.css +25 -42
- package/dist/components/Dropdown/Dropdown.d.ts +12 -8
- package/dist/components/Dropdown/Dropdown.js +230 -77
- package/dist/components/Dropdown/Dropdown.module.css +152 -89
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +26 -25
- package/dist/components/Input/Input.module.css +92 -45
- package/dist/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +4 -3
- 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 +2 -1
- 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/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 +2 -1
- package/dist/components/Tag/Tag.module.css +68 -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 +8 -7
- package/dist/index.js +7 -7
- package/dist/types/index.d.ts +261 -0
- package/dist/types/index.js +1 -0
- package/package.json +2 -1
|
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { Typography } from '../Typography/Typography';
|
|
3
3
|
import styles from './ProgressLoader.module.css';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
+
;
|
|
5
6
|
/**
|
|
6
7
|
* Компонент ProgressLoader отображает прогресс загрузки.
|
|
7
8
|
*/
|
|
@@ -23,7 +24,7 @@ export const ProgressLoader = ({ value = 0, size = 'xl', showValue = true, anima
|
|
|
23
24
|
const circumference = 2 * Math.PI * radius;
|
|
24
25
|
const dashArray = circumference;
|
|
25
26
|
const dashOffset = circumference * (1 - fillPercentage);
|
|
26
|
-
const progressLoaderWrapperClasses = classNames(styles['progress-loader-wrapper'], size);
|
|
27
|
+
const progressLoaderWrapperClasses = classNames(styles['progress-loader-wrapper'], styles[size]);
|
|
27
28
|
const getTypographySize = () => {
|
|
28
29
|
switch (size) {
|
|
29
30
|
case 'md':
|
|
@@ -65,7 +66,7 @@ export const ProgressLoader = ({ value = 0, size = 'xl', showValue = true, anima
|
|
|
65
66
|
//transition: animated ? 'stroke-dashoffset 0.5s ease-in-out' : 'none',
|
|
66
67
|
} }, animated && (React.createElement("animate", { attributeName: "stroke-dashoffset", dur: `${animationDuration / 1000}`, values: `${circumference}; ${percent / 100}`, fill: "freeze" })))),
|
|
67
68
|
showValue && size !== 'sm' && (React.createElement("div", { className: styles["progress-percentage"] },
|
|
68
|
-
React.createElement(Typography, { variant: "Subheading2", color: '#9CA0A7', style: { fontSize: getTypographySize(), fontWeight: '300' }
|
|
69
|
+
React.createElement(Typography, { variant: "Subheading2", color: '#9CA0A7', style: { fontSize: getTypographySize(), fontWeight: '300' } },
|
|
69
70
|
percent,
|
|
70
71
|
"%")))));
|
|
71
72
|
};
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
.story--wrapper-progress-loader {
|
|
2
|
-
background-color: var(--white);
|
|
3
|
-
padding: 30px;
|
|
4
|
-
border-radius: 10px;
|
|
5
|
-
width: 900px;
|
|
6
|
-
}
|
|
7
1
|
.progress-loader-wrapper {
|
|
8
2
|
display: flex;
|
|
9
3
|
align-items: center;
|
|
10
4
|
justify-content: center;
|
|
11
5
|
position: relative;
|
|
12
6
|
}
|
|
13
|
-
|
|
14
|
-
display: flex;
|
|
15
|
-
gap: 30px;
|
|
16
|
-
}
|
|
7
|
+
|
|
17
8
|
.progress-loader {
|
|
18
9
|
width: 100px;
|
|
19
10
|
height: 100px;
|
|
20
11
|
}
|
|
21
12
|
.progress-percentage {
|
|
22
13
|
position: absolute;
|
|
23
|
-
|
|
14
|
+
top: 50%;
|
|
24
15
|
left: 50%;
|
|
25
16
|
transform: translate(-50%, -50%);
|
|
26
17
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from './RadioButton.module.css';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
+
;
|
|
5
|
+
import { Typography } from '../Typography/Typography';
|
|
4
6
|
export const RadioButton = ({ value, label, checked, onChange, disabled = false, size = 'sm' }) => {
|
|
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: "radio", checked: checked, value: value, onChange: handleChange, disabled: disabled, className: classNames(styles
|
|
12
|
-
label));
|
|
12
|
+
return (React.createElement("label", { className: styles.radio },
|
|
13
|
+
React.createElement("input", { type: "radio", checked: checked, value: value, onChange: handleChange, disabled: disabled, className: classNames(styles.input, styles[size]) }),
|
|
14
|
+
React.createElement(Typography, { variant: 'Body2' }, label)));
|
|
13
15
|
};
|
|
@@ -1,29 +1,17 @@
|
|
|
1
|
-
.story--wrapper-radio {
|
|
2
|
-
background-color: var(--white);
|
|
3
|
-
padding: 30px;
|
|
4
|
-
border-radius: 10px;
|
|
5
|
-
}
|
|
6
1
|
|
|
7
2
|
.radio {
|
|
8
3
|
display: flex;
|
|
9
4
|
align-items: center;
|
|
10
5
|
justify-content: left;
|
|
11
6
|
gap: 5px;
|
|
12
|
-
|
|
13
|
-
font-family: 'Raleway';
|
|
14
|
-
font-style: normal;
|
|
15
|
-
font-weight: 400;
|
|
16
|
-
font-size: 14px;
|
|
17
|
-
line-height: 16px;
|
|
18
|
-
color: var(--text-dark);
|
|
19
7
|
}
|
|
20
8
|
|
|
21
|
-
.radio.sm {
|
|
9
|
+
.input[type="radio"].sm {
|
|
22
10
|
width: 12px;
|
|
23
11
|
height: 12px;
|
|
24
12
|
}
|
|
25
13
|
|
|
26
|
-
.radio.md {
|
|
14
|
+
.input[type="radio"].md {
|
|
27
15
|
width: 16px;
|
|
28
16
|
height: 16px;
|
|
29
17
|
}
|
|
@@ -33,7 +21,6 @@
|
|
|
33
21
|
appearance: none;
|
|
34
22
|
display: inline-block;
|
|
35
23
|
padding: 6px;
|
|
36
|
-
|
|
37
24
|
border: 1px solid var(--icons-active);
|
|
38
25
|
border-radius: 50%;
|
|
39
26
|
background-color: var(--white);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { Tag } from '../Tag/Tag';
|
|
3
3
|
import ColorPicker from '../ColorPicker/ColorPicker';
|
|
4
|
+
;
|
|
4
5
|
import styles from './SettingTag.module.css';
|
|
5
6
|
export const SettingTag = ({ label, color, onChange }) => {
|
|
6
7
|
const [isHovered, setIsHovered] = useState(false);
|
|
7
8
|
const colorsOptions = ['red', 'orange', 'yellow', 'green', 'purple', 'indigo', 'blue', 'teal', 'pink'];
|
|
8
9
|
return (React.createElement("div", { style: { display: 'flex', gap: '10px', flexDirection: 'row', alignItems: 'center' } },
|
|
9
10
|
React.createElement(Tag, { label: label, color: color }),
|
|
10
|
-
!isHovered ? (React.createElement("div", { className: styles
|
|
11
|
+
!isHovered ? (React.createElement("div", { className: styles.circle, onMouseEnter: () => setIsHovered(true), style: {
|
|
11
12
|
width: 10,
|
|
12
13
|
height: 10,
|
|
13
14
|
backgroundColor: (color === null || color === void 0 ? void 0 : color.startsWith('#')) ? color : `var(--${color})`,
|
|
@@ -3,6 +3,7 @@ import { IconClose10, IconError10, IconInfo10, IconSuccess10, IconWarning10 } fr
|
|
|
3
3
|
import { Typography } from '../Typography/Typography';
|
|
4
4
|
import styles from './Snackbar.module.css';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
+
;
|
|
6
7
|
/**
|
|
7
8
|
* @description Snackbar компонент для отображения всплывающих уведомлений
|
|
8
9
|
* @component
|
|
@@ -43,13 +44,13 @@ export const Snackbar = ({ children, type, duration = 10000, icon = true, onClos
|
|
|
43
44
|
};
|
|
44
45
|
if (!isVisible)
|
|
45
46
|
return null;
|
|
46
|
-
const snackbarClasses = classNames(styles['snackbar-wrapper'],
|
|
47
|
+
const snackbarClasses = classNames(styles['snackbar-wrapper'], styles[`snackbar--${type}`]);
|
|
47
48
|
return (React.createElement("div", { className: snackbarClasses },
|
|
48
49
|
React.createElement("div", { className: styles['snackbar-textAndIcon'] },
|
|
49
50
|
icon && icons[type],
|
|
50
51
|
React.createElement("div", { className: styles['snackbar-text'] },
|
|
51
52
|
React.createElement(Typography, { variant: "Body2-Medium", color: 'var(--text-dark)' }, title[type]),
|
|
52
53
|
React.createElement(Typography, { variant: "Caption", color: 'var(--text-btn-light)' }, children))),
|
|
53
|
-
React.createElement("button", { className: styles
|
|
54
|
+
React.createElement("button", { className: styles.button, onClick: handleClose },
|
|
54
55
|
React.createElement(IconClose10, { htmlColor: 'var(--text-btn-light)' }))));
|
|
55
56
|
};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
.story--wrapper-snackbar {
|
|
2
|
-
background-color: var(--white);
|
|
3
|
-
padding: 30px;
|
|
4
|
-
border-radius: 10px;
|
|
5
|
-
width: 300px;
|
|
6
|
-
height: 300px;
|
|
7
|
-
}
|
|
8
1
|
.snackbar-wrapper {
|
|
9
2
|
display: flex;
|
|
10
3
|
justify-content: space-between;
|
|
@@ -17,8 +10,7 @@
|
|
|
17
10
|
max-width: 500px;
|
|
18
11
|
|
|
19
12
|
border-radius: 15px;
|
|
20
|
-
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1)
|
|
21
|
-
min-height: 48px;
|
|
13
|
+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1)
|
|
22
14
|
}
|
|
23
15
|
.snackbar-textAndIcon {
|
|
24
16
|
gap: 10px;
|
|
@@ -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,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
;
|
|
2
3
|
import styles from './Tag.module.css';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
export const Tag = ({ label, color = 'red', closeButton = false, onClick }) => {
|
|
@@ -9,7 +10,7 @@ export const Tag = ({ label, color = 'red', closeButton = false, onClick }) => {
|
|
|
9
10
|
const b = parseInt(hex.slice(5, 7), 16);
|
|
10
11
|
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
11
12
|
};
|
|
12
|
-
return (React.createElement("span", { className: classNames(styles
|
|
13
|
+
return (React.createElement("span", { className: classNames(styles.tag, !color.startsWith('#') && styles[color]), style: color.startsWith('#')
|
|
13
14
|
? {
|
|
14
15
|
color: color,
|
|
15
16
|
border: `1px solid ${color}`,
|
|
@@ -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,118 @@
|
|
|
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;
|
|
39
33
|
}
|
|
40
34
|
|
|
41
|
-
.tag button[aria-label=
|
|
42
|
-
.tag button[aria-label=
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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);
|
|
51
45
|
}
|
|
52
46
|
|
|
53
|
-
.tag button[aria-label=
|
|
54
|
-
|
|
47
|
+
.tag button[aria-label='Закрыть']::after {
|
|
48
|
+
transform: translate(-50%, -50%) rotate(-45deg);
|
|
55
49
|
}
|
|
56
50
|
|
|
57
51
|
.tag.red {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
color: var(--red);
|
|
53
|
+
background-color: var(--redBackground);
|
|
54
|
+
border: 1px solid var(--red);
|
|
61
55
|
}
|
|
62
56
|
|
|
63
57
|
.tag.red:hover {
|
|
64
|
-
|
|
58
|
+
background-color: var(--redHover);
|
|
65
59
|
}
|
|
66
60
|
|
|
67
61
|
.tag.orange {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
color: var(--orange);
|
|
63
|
+
background-color: var(--orangeBackground);
|
|
64
|
+
border: 1px solid var(--orange);
|
|
71
65
|
}
|
|
72
66
|
|
|
73
67
|
.tag.orange:hover {
|
|
74
|
-
|
|
68
|
+
background-color: var(--orangeHover);
|
|
75
69
|
}
|
|
76
70
|
|
|
77
71
|
.tag.yellow {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
color: var(--yellowText);
|
|
73
|
+
background-color: var(--yellowBackground);
|
|
74
|
+
border: 1px solid var(--yellow);
|
|
81
75
|
}
|
|
82
76
|
|
|
83
77
|
.tag.yellow:hover {
|
|
84
|
-
|
|
78
|
+
background-color: var(--yellowHover);
|
|
85
79
|
}
|
|
86
80
|
|
|
87
81
|
.tag.green {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
82
|
+
color: var(--green);
|
|
83
|
+
background-color: var(--greenBackground);
|
|
84
|
+
border: 1px solid var(--green);
|
|
91
85
|
}
|
|
92
86
|
|
|
93
87
|
.tag.green:hover {
|
|
94
|
-
|
|
88
|
+
background-color: var(--greenHover);
|
|
95
89
|
}
|
|
96
90
|
|
|
97
91
|
.tag.purple {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
color: var(--purple);
|
|
93
|
+
background-color: var(--purpleBackground);
|
|
94
|
+
border: 1px solid var(--purple);
|
|
101
95
|
}
|
|
102
96
|
|
|
103
97
|
.tag.purple:hover {
|
|
104
|
-
|
|
98
|
+
background-color: var(--purpleHover);
|
|
105
99
|
}
|
|
106
100
|
|
|
107
101
|
.tag.indigo {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
102
|
+
color: var(--indigo);
|
|
103
|
+
background-color: var(--indigoBackground);
|
|
104
|
+
border: 1px solid var(--indigo);
|
|
111
105
|
}
|
|
112
106
|
|
|
113
107
|
.tag.indigo:hover {
|
|
114
|
-
|
|
108
|
+
background-color: var(--indigoHover);
|
|
115
109
|
}
|
|
116
110
|
|
|
117
111
|
.tag.blue {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
color: var(--blue);
|
|
113
|
+
background-color: var(--blueBackground);
|
|
114
|
+
border: 1px solid var(--blue);
|
|
121
115
|
}
|
|
122
116
|
|
|
123
117
|
.tag.blue:hover {
|
|
124
|
-
|
|
118
|
+
background-color: var(--blueHover);
|
|
125
119
|
}
|
|
126
120
|
|
|
127
121
|
.tag.teal {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
color: var(--teal);
|
|
123
|
+
background-color: var(--tealBackground);
|
|
124
|
+
border: 1px solid var(--teal);
|
|
131
125
|
}
|
|
132
126
|
|
|
133
127
|
.tag.teal:hover {
|
|
134
|
-
|
|
128
|
+
background-color: var(--tealHover);
|
|
135
129
|
}
|
|
136
130
|
|
|
137
131
|
.tag.pink {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
132
|
+
color: var(--pink);
|
|
133
|
+
background-color: var(--pinkBackground);
|
|
134
|
+
border: 1px solid var(--pink);
|
|
141
135
|
}
|
|
142
136
|
|
|
143
137
|
.tag.pink:hover {
|
|
144
|
-
|
|
138
|
+
background-color: var(--pinkHover);
|
|
145
139
|
}
|
|
@@ -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",
|