kamotive_ui 13.2.26 → 14.5.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/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +6 -5
- package/dist/components/Button/Button.module.css +2 -1
- package/dist/components/Dialog/Dialog.module.css +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.js +270 -153
- package/dist/components/Dropdown/Dropdown.module.css +105 -33
- package/dist/components/FileLoader/FileLoader.js +105 -106
- package/dist/components/Input/Input.module.css +3 -1
- package/dist/components/TextEditor/TextEditor.js +172 -573
- package/dist/components/TextEditor/TextEditor.module.css +8 -7
- package/dist/types/index.d.ts +25 -11
- package/package.json +5 -1
|
@@ -3,4 +3,4 @@ import { ButtonProps } from '../../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Компонент Button представляет собой кнопку, которую можно настроить с помощью различных параметров (размер, иконки, стили, состояние).
|
|
5
5
|
*/
|
|
6
|
-
export declare const Button: React.
|
|
6
|
+
export declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -5,7 +5,7 @@ import { Typography } from '../Typography/Typography';
|
|
|
5
5
|
/**
|
|
6
6
|
* Компонент Button представляет собой кнопку, которую можно настроить с помощью различных параметров (размер, иконки, стили, состояние).
|
|
7
7
|
*/
|
|
8
|
-
export const Button = ({ label, variant = 'fill', size = 'md', mode, style, condition, icon, disabled = false, onClick, children, error, color, name, type = 'button', form }) => {
|
|
8
|
+
export const Button = React.forwardRef(({ label, variant = 'fill', size = 'md', mode, style, condition, icon, disabled = false, onClick, children, error, color, name, type = 'button', form, className, active, }, ref) => {
|
|
9
9
|
const btnIcon = icon || typeof children === 'object' && children;
|
|
10
10
|
let modeStyle = 'text';
|
|
11
11
|
if (mode) {
|
|
@@ -15,9 +15,10 @@ export const Button = ({ label, variant = 'fill', size = 'md', mode, style, cond
|
|
|
15
15
|
modeStyle = (!label && !children) ? 'icon' : 'default';
|
|
16
16
|
}
|
|
17
17
|
const buttonCondition = error ? 'error' : (condition || 'default');
|
|
18
|
-
const buttonClasses = classNames(styles['button'], styles[`button--${size}`], styles[`button--${modeStyle}`], {
|
|
18
|
+
const buttonClasses = classNames(styles['button'], styles[`button--${size}`], styles[`button--${modeStyle}`], className, {
|
|
19
19
|
[styles[`button--${variant}-${buttonCondition}`]]: buttonCondition && !color,
|
|
20
|
-
[styles[`button--${variant}-custom`]]: color && !error
|
|
20
|
+
[styles[`button--${variant}-custom`]]: color && !error,
|
|
21
|
+
[styles[`button--${variant}-${buttonCondition}--active`]]: active && buttonCondition && !color,
|
|
21
22
|
});
|
|
22
23
|
const iconColorFn = () => {
|
|
23
24
|
if (buttonCondition && !color) {
|
|
@@ -60,7 +61,7 @@ export const Button = ({ label, variant = 'fill', size = 'md', mode, style, cond
|
|
|
60
61
|
return (React.createElement("button", { className: buttonClasses },
|
|
61
62
|
React.createElement(Typography, { variant: "Body1" }, "\u041A\u043D\u043E\u043F\u043A\u0430")));
|
|
62
63
|
}
|
|
63
|
-
return (React.createElement("button", { className: buttonClasses, style: Object.assign(Object.assign({}, style), (color && !error ? {
|
|
64
|
+
return (React.createElement("button", { className: buttonClasses, ref: ref, style: Object.assign(Object.assign({}, style), (color && !error ? {
|
|
64
65
|
'--button-color': color,
|
|
65
66
|
'--button-hover-color': variant === 'fill' || variant === 'link' ? `color-mix(in srgb, ${color} 90%, black)` : `color-mix(in srgb, ${color} 10%, transparent)`,
|
|
66
67
|
'--button-active-color': variant === 'fill' || variant === 'link' ? `color-mix(in srgb, ${color} 80%, black)` : `color-mix(in srgb, ${color} 20%, transparent)`,
|
|
@@ -77,4 +78,4 @@ export const Button = ({ label, variant = 'fill', size = 'md', mode, style, cond
|
|
|
77
78
|
});
|
|
78
79
|
})(),
|
|
79
80
|
(modeStyle === 'text' || modeStyle === 'default') && (React.createElement(Typography, { variant: "Body1" }, label ? label : typeof children === 'string' && children))));
|
|
80
|
-
};
|
|
81
|
+
});
|
|
@@ -200,7 +200,8 @@
|
|
|
200
200
|
color: var(--blue-main);
|
|
201
201
|
border: 1px solid var(--blue-main);
|
|
202
202
|
}
|
|
203
|
-
.button--outline-default:hover
|
|
203
|
+
.button--outline-default:hover,
|
|
204
|
+
.button--outline-default--active {
|
|
204
205
|
background-color: rgba(13, 153, 255, 0.07);
|
|
205
206
|
color: var(--blue-main);
|
|
206
207
|
border: 1px solid var(--blue-main);
|
|
@@ -16,4 +16,4 @@ export interface DropdownListItemProps<T extends BaseOptions> {
|
|
|
16
16
|
isChild?: boolean;
|
|
17
17
|
}
|
|
18
18
|
export declare const DropdownListItem: <T extends BaseOptions>({ item, getOptionLabel, size, selectedItem, variant, onChange, isActive, activeIndex, index, isChild, }: DropdownListItemProps<T>) => React.JSX.Element;
|
|
19
|
-
export declare const Dropdown: <T extends BaseOptions>({ options, id, label, placeholder, required, value, defaultValue, onChange, showLoadMore, loadMore, getOptionLabel, variant, size, style, className, isLeftLabel, isDivider, disabled, readOnly, isOpened, error, helperText, onClick, onBlur, onFocus, onClose, clearable, enableAutocomplete, onSearch, isSearchLoading, noOptionsText, lng, multiple, limitTags, }: DropdownProps<T>) => React.JSX.Element;
|
|
19
|
+
export declare const Dropdown: <T extends BaseOptions>({ options, id, label, placeholder, required, value, defaultValue, onChange, showLoadMore, loadMore, getOptionLabel, variant, size, style, className, isLeftLabel, isDivider, disabled, readOnly, isOpened, error, helperText, onOpen, onClick, onBlur, onFocus, onClose, clearable, enableAutocomplete, onSearch, isOptionsLoading, isSearchLoading, noOptionsText, lng, multiple, limitTags, }: DropdownProps<T>) => React.JSX.Element;
|