kamotive_ui 2.3.26 → 3.6.26
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/components/AttachedFilesPreview/AttachedFilesPreview.d.ts +1 -0
- package/dist/components/AttachedFilesPreview/AttachedFilesPreview.js +4 -4
- package/dist/components/Breadcrumb/Breadcrumb.js +4 -4
- package/dist/components/Breadcrumbs/Breadcrumbs.js +10 -4
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +11 -10
- package/dist/components/Button/Button.module.css +2 -1
- package/dist/components/Checkbox/Checkbox.js +4 -4
- package/dist/components/ColorPicker/ColorPicker.js +9 -8
- package/dist/components/Comment/Comment.js +13 -13
- package/dist/components/DateInput/DateInput.js +20 -19
- package/dist/components/Dialog/Dialog.js +5 -5
- package/dist/components/Dropdown/Dropdown.d.ts +3 -2
- package/dist/components/Dropdown/Dropdown.js +142 -53
- package/dist/components/Dropdown/Dropdown.module.css +25 -4
- package/dist/components/FileAttach/FileAttach.js +4 -4
- package/dist/components/FileItem/FileItem.js +8 -8
- package/dist/components/FileListAttached/FileListAtta/321/201hed.js +5 -5
- package/dist/components/FileLoader/FileLoader.js +119 -119
- package/dist/components/IconButton/IconButton.js +5 -2
- package/dist/components/Input/Input.js +6 -6
- package/dist/components/Link/Link.js +5 -5
- package/dist/components/List/List.js +13 -11
- package/dist/components/ListItem/ListItem.js +8 -8
- package/dist/components/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/ProgressLoader/ProgressLoader.js +4 -4
- package/dist/components/RadioButton/RadioButton.js +4 -4
- package/dist/components/SettingTag/SettingTag.js +4 -4
- package/dist/components/Snackbar/Snackbar.js +7 -7
- package/dist/components/Spinner/Spinner.js +3 -3
- package/dist/components/Tab/Tab.js +3 -3
- package/dist/components/TableFilterSidebar/TableFilterSidebar.js +11 -11
- package/dist/components/Tabs/Tabs.js +14 -8
- package/dist/components/Tag/Tag.js +7 -7
- package/dist/components/TextEditor/TextEditor.js +179 -578
- package/dist/components/TextEditor/TextEditor.module.css +8 -7
- package/dist/components/ToggleButton/ToggleButton.js +4 -4
- package/dist/components/Tooltip/Tooltip.js +4 -4
- package/dist/components/Typography/Typography.js +2 -2
- package/dist/fonts/Montserrat-Bold.woff2 +0 -0
- package/dist/fonts/Montserrat-Italic.woff2 +0 -0
- package/dist/fonts/Montserrat-Light.woff2 +0 -0
- package/dist/fonts/Montserrat-Medium.woff2 +0 -0
- package/dist/fonts/Montserrat-MediumItalic.woff2 +0 -0
- package/dist/fonts/Montserrat-Regular.woff2 +0 -0
- package/dist/fonts/Montserrat-SemiBold.woff2 +0 -0
- package/dist/fonts/Montserrat-SemiBoldItalic.woff2 +0 -0
- package/dist/fonts/OpenSans-Bold.woff2 +0 -0
- package/dist/fonts/OpenSans-BoldItalic.woff2 +0 -0
- package/dist/fonts/OpenSans-Italic.woff2 +0 -0
- package/dist/fonts/OpenSans-Italic_1.woff2 +0 -0
- package/dist/fonts/OpenSans-Light.woff2 +0 -0
- package/dist/fonts/OpenSans-LightItalic.woff2 +0 -0
- package/dist/fonts/OpenSans-Medium.woff2 +0 -0
- package/dist/fonts/OpenSans-MediumItalic.woff2 +0 -0
- package/dist/fonts/OpenSans-Regular.woff2 +0 -0
- package/dist/fonts/OpenSans-Regular_1.woff2 +0 -0
- package/dist/fonts/OpenSans-SemiBold.woff2 +0 -0
- package/dist/fonts/OpenSans-SemiBoldItalic.woff2 +0 -0
- package/dist/fonts.scss +144 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/types/global.d.ts +26 -0
- package/dist/types/index.d.ts +56 -14
- package/dist/types/pell.d.ts +29 -0
- package/dist/{colors.css → variables.scss} +34 -0
- package/package.json +6 -1
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -66
- package/dist/components/Checkbox/Checkbox.stories.js +0 -75
- package/dist/fonts.css +0 -37
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import styles from './Tab.module.css';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { Typography } from '../Typography/Typography';
|
|
5
|
-
export const Tab = ({ value, onClick, onMouseEnter, label, selected, disabled = false, style, className }) => {
|
|
5
|
+
export const Tab = ({ value, onClick, onMouseEnter, label, selected, disabled = false, style, className, testId = "default" }) => {
|
|
6
6
|
const handleClick = (e) => {
|
|
7
7
|
if (onClick && value && !disabled) {
|
|
8
8
|
onClick(value);
|
|
@@ -12,6 +12,6 @@ export const Tab = ({ value, onClick, onMouseEnter, label, selected, disabled =
|
|
|
12
12
|
[styles.selected]: selected,
|
|
13
13
|
[styles.disabled]: disabled,
|
|
14
14
|
[className || '']: className,
|
|
15
|
-
}), onClick: handleClick, onMouseEnter: onMouseEnter, style: style },
|
|
16
|
-
React.createElement(Typography, { variant: selected ? 'Body1-SemiBold' : 'Body1' }, label)));
|
|
15
|
+
}), onClick: handleClick, onMouseEnter: onMouseEnter, style: style, "data-test-id": `${testId}-tab` },
|
|
16
|
+
React.createElement(Typography, { variant: selected ? 'Body1-SemiBold' : 'Body1', testId: `${testId}-tab` }, label)));
|
|
17
17
|
};
|
|
@@ -6,7 +6,7 @@ import { IconButton } from '../IconButton/IconButton';
|
|
|
6
6
|
import { IconClose } from '../../Icons/IconClose/IconClose';
|
|
7
7
|
import { Typography } from '../Typography/Typography';
|
|
8
8
|
import { Button } from '../Button/Button';
|
|
9
|
-
export const TableFilterSidebar = ({ open, onClose, children, lng = 'ru', onReset, onApply, isResetDisabled, isApplyDisabled, style, className, isLoading, width = '340px', zIndex = 10000, top = 0, right = 0, }) => {
|
|
9
|
+
export const TableFilterSidebar = ({ open, onClose, children, lng = 'ru', onReset, onApply, isResetDisabled, isApplyDisabled, style, className, isLoading, width = '340px', zIndex = 10000, top = 0, right = 0, testId = 'default' }) => {
|
|
10
10
|
if (!open)
|
|
11
11
|
return null;
|
|
12
12
|
const childrenArray = React.Children.toArray(children);
|
|
@@ -18,22 +18,22 @@ export const TableFilterSidebar = ({ open, onClose, children, lng = 'ru', onRese
|
|
|
18
18
|
const isGrid = columnsCount > 1;
|
|
19
19
|
return (React.createElement(React.Fragment, null,
|
|
20
20
|
React.createElement("div", { className: styles.overlay, onClick: onClose, style: { zIndex } }),
|
|
21
|
-
React.createElement("aside", { className: classNames(styles.sidebar, open && styles.open, className), style: Object.assign({ width: sidebarWidth, gap: `${gap + 5}px`, zIndex: zIndex + 1, top: `${top}px`, right: `${right}px` }, style) },
|
|
22
|
-
React.createElement("div", { className: styles.header },
|
|
23
|
-
React.createElement(Typography, { variant: 'Body1-SemiBold', style: { color: 'var(--text-dark)' } },
|
|
21
|
+
React.createElement("aside", { className: classNames(styles.sidebar, open && styles.open, className), style: Object.assign({ width: sidebarWidth, gap: `${gap + 5}px`, zIndex: zIndex + 1, top: `${top}px`, right: `${right}px` }, style), "data-test-id": `${testId}-filter-modal` },
|
|
22
|
+
React.createElement("div", { className: styles.header, "data-test-id": `${testId}-filter-header` },
|
|
23
|
+
React.createElement(Typography, { variant: 'Body1-SemiBold', style: { color: 'var(--text-dark)' }, testId: `${testId}-filter` },
|
|
24
24
|
lng === 'ru' ? 'Фильтры' : 'Filters',
|
|
25
25
|
" "),
|
|
26
|
-
React.createElement(IconButton, { title: lng === 'ru' ? 'Закрыть' : 'Close', onClick: onClose, icon: React.createElement(IconClose, null), color: "var(--icons-grey)", className: styles.closeBtn })),
|
|
27
|
-
React.createElement("div", { className: styles.content }, isLoading ? (React.createElement("div", { className: styles.loaderWrapper },
|
|
28
|
-
React.createElement(Spinner,
|
|
26
|
+
React.createElement(IconButton, { title: lng === 'ru' ? 'Закрыть' : 'Close', onClick: onClose, icon: React.createElement(IconClose, null), color: "var(--icons-grey)", className: styles.closeBtn, testId: `${testId}-filter` })),
|
|
27
|
+
React.createElement("div", { className: styles.content, "data-test-id": `${testId}-filter-content` }, isLoading ? (React.createElement("div", { className: styles.loaderWrapper },
|
|
28
|
+
React.createElement(Spinner, { testId: `${testId}-filter` }))) : (React.createElement("div", { style: {
|
|
29
29
|
display: 'grid',
|
|
30
30
|
gap: `${gap}px ${gap + 10}px`,
|
|
31
31
|
gridTemplateColumns: `repeat(${columnsCount}, minmax(0, 1fr))`
|
|
32
|
-
} }, childrenArray.map((child, index) => (React.createElement("div", { key: index, style: {
|
|
32
|
+
}, "data-test-id": `${testId}-filters-list` }, childrenArray.map((child, index) => (React.createElement("div", { key: index, style: {
|
|
33
33
|
minWidth: 0,
|
|
34
34
|
width: '100%',
|
|
35
|
-
} }, child)))))),
|
|
35
|
+
}, "data-test-id": `${testId}-filter-item-${index}` }, child)))))),
|
|
36
36
|
React.createElement("div", { className: styles.buttons },
|
|
37
|
-
onReset && React.createElement(Button, { label: lng === 'ru' ? 'Сбросить' : 'Reset', variant: 'outline', onClick: onReset, disabled: isResetDisabled || isLoading }),
|
|
38
|
-
onApply && React.createElement(Button, { label: lng === 'ru' ? 'Применить' : 'Apply', onClick: onApply, disabled: isApplyDisabled || isLoading })))));
|
|
37
|
+
onReset && React.createElement(Button, { label: lng === 'ru' ? 'Сбросить' : 'Reset', variant: 'outline', onClick: onReset, disabled: isResetDisabled || isLoading, testId: `${testId}-filter-reset` }),
|
|
38
|
+
onApply && React.createElement(Button, { label: lng === 'ru' ? 'Применить' : 'Apply', onClick: onApply, disabled: isApplyDisabled || isLoading, testId: `${testId}-filter-apply` })))));
|
|
39
39
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
;
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styles from './Tabs.module.css';
|
|
4
|
-
export const Tabs = ({ value, onChange, children, style, className }) => {
|
|
4
|
+
export const Tabs = ({ value, onChange, children, style, className, testId = 'default' }) => {
|
|
5
5
|
var _a;
|
|
6
6
|
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;
|
|
7
7
|
const handleTabChange = (newValue) => {
|
|
@@ -10,11 +10,17 @@ export const Tabs = ({ value, onChange, children, style, className }) => {
|
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
return (React.createElement(React.Fragment, null,
|
|
13
|
-
React.createElement("div", { role: "tablist", className: styles.tabs + ' ' + (className || ''), style: style }, children === null || children === void 0 ? void 0 : children.map((child, index) =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
React.createElement("div", { role: "tablist", className: styles.tabs + ' ' + (className || ''), style: style, "data-test-id": `${testId}-tablist` }, children === null || children === void 0 ? void 0 : children.map((child, index) => {
|
|
14
|
+
const tabSlug = child.props.value
|
|
15
|
+
? String(child.props.value).toLowerCase().trim().replace(/\s+/g, '-')
|
|
16
|
+
: `item-${index}`;
|
|
17
|
+
return React.cloneElement(child, {
|
|
18
|
+
key: index,
|
|
19
|
+
selected: child.props.value === value,
|
|
20
|
+
disabled: child.props.disabled,
|
|
21
|
+
onClick: () => handleTabChange(child.props.value),
|
|
22
|
+
testId: child.props.testId || `${testId}-tabs-${tabSlug}`
|
|
23
|
+
});
|
|
24
|
+
})),
|
|
25
|
+
React.createElement("div", { role: "tabpanel", "aria-labelledby": value, "data-test-id": `${testId}-tabpanel` }, selectedTabContent)));
|
|
20
26
|
};
|
|
@@ -33,7 +33,7 @@ const adjustTextColor = (backgroundColor) => {
|
|
|
33
33
|
const contrastWithWhite = getContrastRatio(backgroundColor, white);
|
|
34
34
|
return contrastWithWhite < 1.5 ? black : "";
|
|
35
35
|
};
|
|
36
|
-
export const Tag = ({ label, color = 'red', closeButton = false, editable = false, onClick, onChange, }) => {
|
|
36
|
+
export const Tag = ({ label, color = 'red', closeButton = false, editable = false, onClick, onChange, testId = 'default' }) => {
|
|
37
37
|
const [newLabel, setNewLabel] = useState(label);
|
|
38
38
|
const [width, setWidth] = useState(0);
|
|
39
39
|
const measurementDivRef = useRef(null);
|
|
@@ -55,16 +55,16 @@ export const Tag = ({ label, color = 'red', closeButton = false, editable = fals
|
|
|
55
55
|
border: `1px solid ${adjustedColor}`,
|
|
56
56
|
backgroundColor: hexToRgba(color, 0.2),
|
|
57
57
|
}
|
|
58
|
-
: {} },
|
|
59
|
-
editable ? (React.createElement("div", { style: { position: "relative" } },
|
|
60
|
-
React.createElement("input", { type: "text", placeholder: label, value: newLabel, onChange: (e) => {
|
|
58
|
+
: {}, "data-test-id": `${testId}-tag` },
|
|
59
|
+
editable ? (React.createElement("div", { style: { position: "relative" }, "data-test-id": `${testId}-tag-edit` },
|
|
60
|
+
React.createElement("input", { type: "text", name: 'input', placeholder: label, value: newLabel, onChange: (e) => {
|
|
61
61
|
setNewLabel(e.target.value);
|
|
62
62
|
}, onBlur: handleBlur, style: {
|
|
63
63
|
color: (color === null || color === void 0 ? void 0 : color.startsWith('#')) ? adjustedColor : `var(--${color})`,
|
|
64
64
|
'--placeholder-color': (color === null || color === void 0 ? void 0 : color.startsWith('#')) ? adjustedColor : `var(--${color})`,
|
|
65
65
|
width: `${width}px`,
|
|
66
66
|
minWidth: '25px',
|
|
67
|
-
} }),
|
|
67
|
+
}, "data-test-id": `${testId}-tag-edit-input` }),
|
|
68
68
|
React.createElement("div", { ref: measurementDivRef, style: {
|
|
69
69
|
position: 'absolute',
|
|
70
70
|
visibility: 'hidden',
|
|
@@ -74,11 +74,11 @@ export const Tag = ({ label, color = 'red', closeButton = false, editable = fals
|
|
|
74
74
|
fontFamily: 'inherit',
|
|
75
75
|
fontWeight: 'inherit',
|
|
76
76
|
letterSpacing: 'inherit',
|
|
77
|
-
} }, newLabel || 'Item'))) : (React.createElement(React.Fragment, null,
|
|
77
|
+
}, "data-test-id": `${testId}-tag-edit-label` }, newLabel || 'Item'))) : (React.createElement(React.Fragment, null,
|
|
78
78
|
" ",
|
|
79
79
|
label,
|
|
80
80
|
" ")),
|
|
81
81
|
closeButton && (React.createElement("button", { type: "button", "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", style: color.startsWith('#')
|
|
82
82
|
? { '--close-color': adjustedColor }
|
|
83
|
-
: { '--close-color': `var(--${color})` }, onClick: onClick }))));
|
|
83
|
+
: { '--close-color': `var(--${color})` }, onClick: onClick, "data-test-id": `${testId}-close-button` }))));
|
|
84
84
|
};
|