@ozen-ui/kit 0.34.3 → 0.35.0
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/__inner__/cjs/components/Autocomplete/helper.d.ts +2 -2
- package/__inner__/cjs/components/Container/Container.css +2 -4
- package/__inner__/cjs/components/Dialog/Dialog.css +1 -4
- package/__inner__/cjs/components/Dialog/Dialog.d.ts +1 -1
- package/__inner__/cjs/components/Dialog/Dialog.js +11 -5
- package/__inner__/cjs/components/Dialog/constants.d.ts +3 -0
- package/__inner__/cjs/components/Dialog/constants.js +6 -0
- package/__inner__/cjs/components/Drawer/Drawer.d.ts +1 -1
- package/__inner__/cjs/components/Drawer/Drawer.js +11 -5
- package/__inner__/cjs/components/Drawer/constants.d.ts +4 -0
- package/__inner__/cjs/components/Drawer/constants.js +7 -0
- package/__inner__/cjs/components/Fieldset/Fieldset.css +1 -4
- package/__inner__/cjs/components/Input/Input.js +2 -2
- package/__inner__/cjs/components/ThemeProvider/types.d.ts +4 -0
- package/__inner__/cjs/locale/locale.js +30 -0
- package/__inner__/esm/components/Autocomplete/helper.d.ts +2 -2
- package/__inner__/esm/components/Container/Container.css +2 -4
- package/__inner__/esm/components/Dialog/Dialog.css +1 -4
- package/__inner__/esm/components/Dialog/Dialog.d.ts +1 -1
- package/__inner__/esm/components/Dialog/Dialog.js +11 -5
- package/__inner__/esm/components/Dialog/constants.d.ts +3 -0
- package/__inner__/esm/components/Dialog/constants.js +3 -0
- package/__inner__/esm/components/Drawer/Drawer.d.ts +1 -1
- package/__inner__/esm/components/Drawer/Drawer.js +11 -5
- package/__inner__/esm/components/Drawer/constants.d.ts +4 -0
- package/__inner__/esm/components/Drawer/constants.js +4 -0
- package/__inner__/esm/components/Fieldset/Fieldset.css +1 -4
- package/__inner__/esm/components/Input/Input.js +2 -2
- package/__inner__/esm/components/ThemeProvider/types.d.ts +4 -0
- package/__inner__/esm/locale/locale.js +30 -0
- package/package.json +1 -1
|
@@ -37,8 +37,8 @@ export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTI
|
|
|
37
37
|
className?: string | undefined;
|
|
38
38
|
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
39
39
|
autoFocus?: boolean | undefined;
|
|
40
|
-
placeholder?: string | undefined;
|
|
41
40
|
disabled?: boolean | undefined;
|
|
41
|
+
placeholder?: string | undefined;
|
|
42
42
|
required?: boolean | undefined;
|
|
43
43
|
error?: boolean | undefined;
|
|
44
44
|
fullWidth?: boolean | undefined;
|
|
@@ -133,8 +133,8 @@ export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTI
|
|
|
133
133
|
className?: string | undefined;
|
|
134
134
|
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
135
135
|
autoFocus?: boolean | undefined;
|
|
136
|
-
placeholder?: string | undefined;
|
|
137
136
|
disabled?: boolean | undefined;
|
|
137
|
+
placeholder?: string | undefined;
|
|
138
138
|
required?: boolean | undefined;
|
|
139
139
|
error?: boolean | undefined;
|
|
140
140
|
fullWidth?: boolean | undefined;
|
|
@@ -7,12 +7,10 @@
|
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
}
|
|
9
9
|
.Container_position_start {
|
|
10
|
-
margin-inline
|
|
11
|
-
margin-inline-end: auto;
|
|
10
|
+
margin-inline: 0 auto;
|
|
12
11
|
}
|
|
13
12
|
.Container_position_center {
|
|
14
|
-
margin-inline
|
|
15
|
-
margin-inline-end: auto;
|
|
13
|
+
margin-inline: auto auto;
|
|
16
14
|
}
|
|
17
15
|
.Container_maxWidth_s {
|
|
18
16
|
max-inline-size: var(--breakpoint-s);
|
|
@@ -68,10 +68,7 @@
|
|
|
68
68
|
.Dialog_variant_fullsize .Modal-Window {
|
|
69
69
|
inline-size: 100%;
|
|
70
70
|
max-block-size: 100%;
|
|
71
|
-
inset
|
|
72
|
-
inset-inline-end: 0;
|
|
73
|
-
inset-inline-start: 0;
|
|
74
|
-
inset-block-end: 0;
|
|
71
|
+
inset: 0;
|
|
75
72
|
margin: 0;
|
|
76
73
|
border-radius: 0;
|
|
77
74
|
transform: translate(0, 0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import './Dialog.css';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { type IconButtonProps } from '../IconButton';
|
|
3
4
|
import { type ModalProps } from '../Modal';
|
|
4
|
-
import './Dialog.css';
|
|
5
5
|
export declare const cnDialog: import("@bem-react/classname").ClassNameFormatter;
|
|
6
6
|
export declare const dialogSizeVariant: readonly ["s", "l"];
|
|
7
7
|
export declare const dialogVariant: readonly ["small", "medium", "large", "fullsize"];
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Dialog = exports.dialogVariant = exports.dialogSizeVariant = exports.cnDialog = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
+
require("./Dialog.css");
|
|
5
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
7
|
var icons_1 = require("@ozen-ui/icons");
|
|
8
|
+
var useThemeProps_1 = require("../../hooks/useThemeProps");
|
|
7
9
|
var classname_1 = require("../../utils/classname");
|
|
8
10
|
var IconButton_1 = require("../IconButton");
|
|
9
11
|
var Modal_1 = require("../Modal");
|
|
10
|
-
require("./
|
|
12
|
+
var constants_1 = require("./constants");
|
|
11
13
|
exports.cnDialog = (0, classname_1.cn)('Dialog');
|
|
12
14
|
exports.dialogSizeVariant = ['s', 'l'];
|
|
13
15
|
exports.dialogVariant = ['small', 'medium', 'large', 'fullsize'];
|
|
@@ -15,13 +17,17 @@ var iconButtonSizeMapper = {
|
|
|
15
17
|
l: 'm',
|
|
16
18
|
s: 's',
|
|
17
19
|
};
|
|
18
|
-
exports.Dialog = (0, react_1.forwardRef)(function (
|
|
19
|
-
var
|
|
20
|
-
|
|
20
|
+
exports.Dialog = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
21
|
+
var props = (0, useThemeProps_1.useThemeProps)({
|
|
22
|
+
props: inProps,
|
|
23
|
+
name: 'Dialog',
|
|
24
|
+
});
|
|
25
|
+
var _a = props.variant, variant = _a === void 0 ? constants_1.DIALOG_DEFAULT_VARIANT : _a, _b = props.size, size = _b === void 0 ? constants_1.DIALOG_DEFAULT_SIZE : _b, _c = props.hideCloseButton, hideCloseButton = _c === void 0 ? constants_1.DIALOG_DEFAULT_HIDE_CLOSE_BUTTON : _c, open = props.open, onClose = props.onClose, children = props.children, className = props.className, windowProps = props.windowProps, closeButtonProps = props.closeButtonProps, transitionProps = props.transitionProps, other = tslib_1.__rest(props, ["variant", "size", "hideCloseButton", "open", "onClose", "children", "className", "windowProps", "closeButtonProps", "transitionProps"]);
|
|
26
|
+
var _d = closeButtonProps || {}, closeButtonClassName = _d.className, closeButtonRestProps = tslib_1.__rest(_d, ["className"]);
|
|
21
27
|
return (react_1.default.createElement(Modal_1.Modal, tslib_1.__assign({}, other, { open: open, onClose: onClose, windowProps: tslib_1.__assign({ role: 'dialog' }, windowProps), className: (0, exports.cnDialog)({ variant: variant, size: size, hasCloseButton: !hideCloseButton }, [className]), transitionProps: tslib_1.__assign(tslib_1.__assign({}, (variant === 'fullsize' && {
|
|
22
28
|
classNames: (0, exports.cnDialog)({ animation: 'fullsize' }),
|
|
23
29
|
})), transitionProps), ref: ref }),
|
|
24
|
-
!hideCloseButton && (react_1.default.createElement(IconButton_1.IconButton, tslib_1.__assign({ size: iconButtonSizeMapper[size], variant: "ghost", name: "close"
|
|
30
|
+
!hideCloseButton && (react_1.default.createElement(IconButton_1.IconButton, tslib_1.__assign({ size: iconButtonSizeMapper[size], variant: "ghost", name: "close" }, closeButtonRestProps, { className: (0, exports.cnDialog)('CloseButton', [closeButtonClassName]), onClick: onClose, icon: icons_1.CloseIcon, compressed: true }))),
|
|
25
31
|
react_1.default.createElement("div", { className: (0, exports.cnDialog)('InnerContainer') }, children)));
|
|
26
32
|
});
|
|
27
33
|
exports.Dialog.displayName = 'Dialog';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DIALOG_DEFAULT_HIDE_CLOSE_BUTTON = exports.DIALOG_DEFAULT_SIZE = exports.DIALOG_DEFAULT_VARIANT = void 0;
|
|
4
|
+
exports.DIALOG_DEFAULT_VARIANT = 'medium';
|
|
5
|
+
exports.DIALOG_DEFAULT_SIZE = 'l';
|
|
6
|
+
exports.DIALOG_DEFAULT_HIDE_CLOSE_BUTTON = false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import './Drawer.css';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { type IconButtonProps } from '../IconButton';
|
|
3
4
|
import { type ModalProps } from '../Modal';
|
|
4
|
-
import './Drawer.css';
|
|
5
5
|
export declare const cnDrawer: import("@bem-react/classname").ClassNameFormatter;
|
|
6
6
|
export declare const drawerVariant: readonly ["little", "medium", "large"];
|
|
7
7
|
export declare const drawerSizeVariant: readonly ["s", "l"];
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Drawer = exports.drawerPlacementVariant = exports.drawerSizeVariant = exports.drawerVariant = exports.cnDrawer = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
+
require("./Drawer.css");
|
|
5
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
7
|
var icons_1 = require("@ozen-ui/icons");
|
|
8
|
+
var useThemeProps_1 = require("../../hooks/useThemeProps");
|
|
7
9
|
var classname_1 = require("../../utils/classname");
|
|
8
10
|
var IconButton_1 = require("../IconButton");
|
|
9
11
|
var Modal_1 = require("../Modal");
|
|
10
|
-
require("./
|
|
12
|
+
var constants_1 = require("./constants");
|
|
11
13
|
exports.cnDrawer = (0, classname_1.cn)('Drawer');
|
|
12
14
|
exports.drawerVariant = ['little', 'medium', 'large'];
|
|
13
15
|
exports.drawerSizeVariant = ['s', 'l'];
|
|
@@ -16,11 +18,15 @@ var iconButtonSizeMapper = {
|
|
|
16
18
|
l: 'm',
|
|
17
19
|
s: 's',
|
|
18
20
|
};
|
|
19
|
-
exports.Drawer = (0, react_1.forwardRef)(function (
|
|
20
|
-
var
|
|
21
|
-
|
|
21
|
+
exports.Drawer = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
22
|
+
var props = (0, useThemeProps_1.useThemeProps)({
|
|
23
|
+
props: inProps,
|
|
24
|
+
name: 'Drawer',
|
|
25
|
+
});
|
|
26
|
+
var _a = props.variant, variant = _a === void 0 ? constants_1.DRAWER_DEFAULT_VARIANT : _a, _b = props.size, size = _b === void 0 ? constants_1.DRAWER_DEFAULT_SIZE : _b, _c = props.placement, placement = _c === void 0 ? constants_1.DRAWER_DEFAULT_PLACEMENT : _c, _d = props.hideCloseButton, hideCloseButton = _d === void 0 ? constants_1.DRAWER_DEFAULT_HIDE_CLOSE_BUTTON : _d, open = props.open, onClose = props.onClose, children = props.children, className = props.className, transitionProps = props.transitionProps, closeButtonProps = props.closeButtonProps, other = tslib_1.__rest(props, ["variant", "size", "placement", "hideCloseButton", "open", "onClose", "children", "className", "transitionProps", "closeButtonProps"]);
|
|
27
|
+
var _e = closeButtonProps || {}, closeButtonClassName = _e.className, closeButtonRestProps = tslib_1.__rest(_e, ["className"]);
|
|
22
28
|
return (react_1.default.createElement(Modal_1.Modal, tslib_1.__assign({}, other, { open: open, onClose: onClose, className: (0, exports.cnDrawer)({ variant: variant, size: size, placement: placement, hasCloseButton: !hideCloseButton }, [className]), transitionProps: tslib_1.__assign({ classNames: (0, exports.cnDrawer)({ animation: true }) }, transitionProps), ref: ref }),
|
|
23
|
-
!hideCloseButton && (react_1.default.createElement(IconButton_1.IconButton, tslib_1.__assign({ size: iconButtonSizeMapper[size], variant: "ghost", name: "close"
|
|
29
|
+
!hideCloseButton && (react_1.default.createElement(IconButton_1.IconButton, tslib_1.__assign({ size: iconButtonSizeMapper[size], variant: "ghost", name: "close" }, closeButtonRestProps, { className: (0, exports.cnDrawer)('CloseButton', [closeButtonClassName]), onClick: onClose, icon: icons_1.CloseIcon, compressed: true }))),
|
|
24
30
|
react_1.default.createElement("div", { className: (0, exports.cnDrawer)('InnerContainer') }, children)));
|
|
25
31
|
});
|
|
26
32
|
exports.Drawer.displayName = 'Drawer';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DRAWER_DEFAULT_HIDE_CLOSE_BUTTON = exports.DRAWER_DEFAULT_PLACEMENT = exports.DRAWER_DEFAULT_SIZE = exports.DRAWER_DEFAULT_VARIANT = void 0;
|
|
4
|
+
exports.DRAWER_DEFAULT_VARIANT = 'medium';
|
|
5
|
+
exports.DRAWER_DEFAULT_SIZE = 'l';
|
|
6
|
+
exports.DRAWER_DEFAULT_PLACEMENT = 'right';
|
|
7
|
+
exports.DRAWER_DEFAULT_HIDE_CLOSE_BUTTON = false;
|
|
@@ -21,7 +21,7 @@ exports.Input = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
|
21
21
|
props: inProps,
|
|
22
22
|
name: 'Input',
|
|
23
23
|
});
|
|
24
|
-
var _a = props.size, size = _a === void 0 ? constants_1.INPUT_DEFAULT_SIZE : _a, label = props.label, error = props.error, autoFocus = props.autoFocus, placeholder = props.placeholder, id = props.id, name = props.name, type = props.type, renderLeft = props.renderLeft, renderRight = props.renderRight, fullWidth = props.fullWidth, disabled = props.disabled, hint = props.hint, required = props.required, className = props.className, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, inputProps = props.inputProps, bodyProps = props.bodyProps, labelProps = props.labelProps, inputRef = props.inputRef, labelRef = props.labelRef, other = tslib_1.__rest(props, ["size", "label", "error", "autoFocus", "placeholder", "id", "name", "type", "renderLeft", "renderRight", "fullWidth", "disabled", "hint", "required", "className", "value", "defaultValue", "onChange", "inputProps", "bodyProps", "labelProps", "inputRef", "labelRef"]);
|
|
24
|
+
var _a = props.size, size = _a === void 0 ? constants_1.INPUT_DEFAULT_SIZE : _a, label = props.label, error = props.error, autoFocus = props.autoFocus, placeholder = props.placeholder, id = props.id, name = props.name, type = props.type, renderLeft = props.renderLeft, renderRight = props.renderRight, fullWidth = props.fullWidth, disabled = props.disabled, hint = props.hint, required = props.required, className = props.className, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, inputProps = props.inputProps, bodyProps = props.bodyProps, labelProps = props.labelProps, maxLength = props.maxLength, minLength = props.minLength, inputRef = props.inputRef, labelRef = props.labelRef, other = tslib_1.__rest(props, ["size", "label", "error", "autoFocus", "placeholder", "id", "name", "type", "renderLeft", "renderRight", "fullWidth", "disabled", "hint", "required", "className", "value", "defaultValue", "onChange", "inputProps", "bodyProps", "labelProps", "maxLength", "minLength", "inputRef", "labelRef"]);
|
|
25
25
|
var bodyInnerRef = (0, react_1.useRef)(null);
|
|
26
26
|
var fieldInnerRef = (0, react_1.useRef)(null);
|
|
27
27
|
/* Хук useEventListener необходим для того, чтобы при нажатии на кнопку мыши
|
|
@@ -45,7 +45,7 @@ exports.Input = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
|
45
45
|
react_1.default.createElement(FieldIcon_1.FieldIcon, { icon: renderLeft }),
|
|
46
46
|
react_1.default.createElement("div", { className: (0, exports.cnInput)('FieldContainer') },
|
|
47
47
|
react_1.default.createElement(FieldLabel_1.FieldLabel, tslib_1.__assign({}, labelProps, { ref: labelRef || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.ref), className: labelProps === null || labelProps === void 0 ? void 0 : labelProps.className }), label),
|
|
48
|
-
react_1.default.createElement(FieldInput_1.FieldInput, tslib_1.__assign({ id: id, name: name, autoFocus: autoFocus, value: value, type: type, defaultValue: defaultValue, placeholder: placeholder, onChange: onChange }, inputProps, { className: (0, exports.cnInput)('Field', [inputProps === null || inputProps === void 0 ? void 0 : inputProps.className]), ref: (0, useMultiRef_1.useMultiRef)([inputRef || (inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref), fieldInnerRef]) }))),
|
|
48
|
+
react_1.default.createElement(FieldInput_1.FieldInput, tslib_1.__assign({ id: id, name: name, autoFocus: autoFocus, value: value, type: type, defaultValue: defaultValue, placeholder: placeholder, onChange: onChange, maxLength: maxLength, minLength: minLength }, inputProps, { className: (0, exports.cnInput)('Field', [inputProps === null || inputProps === void 0 ? void 0 : inputProps.className]), ref: (0, useMultiRef_1.useMultiRef)([inputRef || (inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref), fieldInnerRef]) }))),
|
|
49
49
|
react_1.default.createElement(FieldIcon_1.FieldIcon, { icon: renderRight }),
|
|
50
50
|
react_1.default.createElement(Fieldset_1.Fieldset, null)),
|
|
51
51
|
react_1.default.createElement(FieldHint_1.FieldHint, null, hint)));
|
|
@@ -13,7 +13,9 @@ import type { ChipProps as ChiPropsNext } from '../ChipNext';
|
|
|
13
13
|
import type { CollapseProps } from '../Collapse';
|
|
14
14
|
import type { ContainerProps } from '../Container';
|
|
15
15
|
import type { DataListProps } from '../DataList';
|
|
16
|
+
import type { DialogProps } from '../Dialog';
|
|
16
17
|
import type { DividerProps } from '../Divider';
|
|
18
|
+
import type { DrawerProps } from '../Drawer';
|
|
17
19
|
import type { FieldControlProps } from '../FieldControl';
|
|
18
20
|
import type { FileProps } from '../File';
|
|
19
21
|
import type { FilePickerProps } from '../FilePicker';
|
|
@@ -78,7 +80,9 @@ export type Theme = {
|
|
|
78
80
|
Collapse?: Partial<CollapseProps>;
|
|
79
81
|
Container?: Partial<ContainerProps>;
|
|
80
82
|
DataList?: Partial<DataListProps>;
|
|
83
|
+
Dialog?: Partial<DialogProps>;
|
|
81
84
|
Divider?: Partial<DividerProps>;
|
|
85
|
+
Drawer?: Partial<DrawerProps>;
|
|
82
86
|
FieldControl?: Partial<FieldControlProps>;
|
|
83
87
|
File?: Partial<FileProps>;
|
|
84
88
|
FilePicker?: Partial<FilePickerProps>;
|
|
@@ -10,6 +10,16 @@ exports.ruRU = {
|
|
|
10
10
|
clearText: 'Очистить',
|
|
11
11
|
loadingText: 'Загрузка…',
|
|
12
12
|
},
|
|
13
|
+
Dialog: {
|
|
14
|
+
closeButtonProps: {
|
|
15
|
+
'aria-label': 'Закрыть',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
Drawer: {
|
|
19
|
+
closeButtonProps: {
|
|
20
|
+
'aria-label': 'Закрыть',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
13
23
|
Loader: {
|
|
14
24
|
'aria-label': 'Загрузка',
|
|
15
25
|
},
|
|
@@ -32,6 +42,16 @@ exports.kkKZ = {
|
|
|
32
42
|
clearText: 'Тазалау',
|
|
33
43
|
loadingText: 'Жүктеу…',
|
|
34
44
|
},
|
|
45
|
+
Dialog: {
|
|
46
|
+
closeButtonProps: {
|
|
47
|
+
'aria-label': 'Жабу',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
Drawer: {
|
|
51
|
+
closeButtonProps: {
|
|
52
|
+
'aria-label': 'Жабу',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
35
55
|
Loader: {
|
|
36
56
|
'aria-label': 'Жүктеу',
|
|
37
57
|
},
|
|
@@ -54,6 +74,16 @@ exports.enUS = {
|
|
|
54
74
|
clearText: 'Clear',
|
|
55
75
|
loadingText: 'Loading…',
|
|
56
76
|
},
|
|
77
|
+
Dialog: {
|
|
78
|
+
closeButtonProps: {
|
|
79
|
+
'aria-label': 'Close',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
Drawer: {
|
|
83
|
+
closeButtonProps: {
|
|
84
|
+
'aria-label': 'Close',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
57
87
|
Loader: {
|
|
58
88
|
'aria-label': 'Loading',
|
|
59
89
|
},
|
|
@@ -37,8 +37,8 @@ export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTI
|
|
|
37
37
|
className?: string | undefined;
|
|
38
38
|
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
39
39
|
autoFocus?: boolean | undefined;
|
|
40
|
-
placeholder?: string | undefined;
|
|
41
40
|
disabled?: boolean | undefined;
|
|
41
|
+
placeholder?: string | undefined;
|
|
42
42
|
required?: boolean | undefined;
|
|
43
43
|
error?: boolean | undefined;
|
|
44
44
|
fullWidth?: boolean | undefined;
|
|
@@ -133,8 +133,8 @@ export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTI
|
|
|
133
133
|
className?: string | undefined;
|
|
134
134
|
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
135
135
|
autoFocus?: boolean | undefined;
|
|
136
|
-
placeholder?: string | undefined;
|
|
137
136
|
disabled?: boolean | undefined;
|
|
137
|
+
placeholder?: string | undefined;
|
|
138
138
|
required?: boolean | undefined;
|
|
139
139
|
error?: boolean | undefined;
|
|
140
140
|
fullWidth?: boolean | undefined;
|
|
@@ -7,12 +7,10 @@
|
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
}
|
|
9
9
|
.Container_position_start {
|
|
10
|
-
margin-inline
|
|
11
|
-
margin-inline-end: auto;
|
|
10
|
+
margin-inline: 0 auto;
|
|
12
11
|
}
|
|
13
12
|
.Container_position_center {
|
|
14
|
-
margin-inline
|
|
15
|
-
margin-inline-end: auto;
|
|
13
|
+
margin-inline: auto auto;
|
|
16
14
|
}
|
|
17
15
|
.Container_maxWidth_s {
|
|
18
16
|
max-inline-size: var(--breakpoint-s);
|
|
@@ -68,10 +68,7 @@
|
|
|
68
68
|
.Dialog_variant_fullsize .Modal-Window {
|
|
69
69
|
inline-size: 100%;
|
|
70
70
|
max-block-size: 100%;
|
|
71
|
-
inset
|
|
72
|
-
inset-inline-end: 0;
|
|
73
|
-
inset-inline-start: 0;
|
|
74
|
-
inset-block-end: 0;
|
|
71
|
+
inset: 0;
|
|
75
72
|
margin: 0;
|
|
76
73
|
border-radius: 0;
|
|
77
74
|
transform: translate(0, 0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import './Dialog.css';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { type IconButtonProps } from '../IconButton';
|
|
3
4
|
import { type ModalProps } from '../Modal';
|
|
4
|
-
import './Dialog.css';
|
|
5
5
|
export declare const cnDialog: import("@bem-react/classname").ClassNameFormatter;
|
|
6
6
|
export declare const dialogSizeVariant: readonly ["s", "l"];
|
|
7
7
|
export declare const dialogVariant: readonly ["small", "medium", "large", "fullsize"];
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
|
+
import './Dialog.css';
|
|
2
3
|
import React, { forwardRef } from 'react';
|
|
3
4
|
import { CloseIcon } from '@ozen-ui/icons';
|
|
5
|
+
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
4
6
|
import { cn } from '../../utils/classname';
|
|
5
7
|
import { IconButton } from '../IconButton';
|
|
6
8
|
import { Modal } from '../Modal';
|
|
7
|
-
import './
|
|
9
|
+
import { DIALOG_DEFAULT_HIDE_CLOSE_BUTTON, DIALOG_DEFAULT_SIZE, DIALOG_DEFAULT_VARIANT, } from './constants';
|
|
8
10
|
export var cnDialog = cn('Dialog');
|
|
9
11
|
export var dialogSizeVariant = ['s', 'l'];
|
|
10
12
|
export var dialogVariant = ['small', 'medium', 'large', 'fullsize'];
|
|
@@ -12,13 +14,17 @@ var iconButtonSizeMapper = {
|
|
|
12
14
|
l: 'm',
|
|
13
15
|
s: 's',
|
|
14
16
|
};
|
|
15
|
-
export var Dialog = forwardRef(function (
|
|
16
|
-
var
|
|
17
|
-
|
|
17
|
+
export var Dialog = forwardRef(function (inProps, ref) {
|
|
18
|
+
var props = useThemeProps({
|
|
19
|
+
props: inProps,
|
|
20
|
+
name: 'Dialog',
|
|
21
|
+
});
|
|
22
|
+
var _a = props.variant, variant = _a === void 0 ? DIALOG_DEFAULT_VARIANT : _a, _b = props.size, size = _b === void 0 ? DIALOG_DEFAULT_SIZE : _b, _c = props.hideCloseButton, hideCloseButton = _c === void 0 ? DIALOG_DEFAULT_HIDE_CLOSE_BUTTON : _c, open = props.open, onClose = props.onClose, children = props.children, className = props.className, windowProps = props.windowProps, closeButtonProps = props.closeButtonProps, transitionProps = props.transitionProps, other = __rest(props, ["variant", "size", "hideCloseButton", "open", "onClose", "children", "className", "windowProps", "closeButtonProps", "transitionProps"]);
|
|
23
|
+
var _d = closeButtonProps || {}, closeButtonClassName = _d.className, closeButtonRestProps = __rest(_d, ["className"]);
|
|
18
24
|
return (React.createElement(Modal, __assign({}, other, { open: open, onClose: onClose, windowProps: __assign({ role: 'dialog' }, windowProps), className: cnDialog({ variant: variant, size: size, hasCloseButton: !hideCloseButton }, [className]), transitionProps: __assign(__assign({}, (variant === 'fullsize' && {
|
|
19
25
|
classNames: cnDialog({ animation: 'fullsize' }),
|
|
20
26
|
})), transitionProps), ref: ref }),
|
|
21
|
-
!hideCloseButton && (React.createElement(IconButton, __assign({ size: iconButtonSizeMapper[size], variant: "ghost", name: "close"
|
|
27
|
+
!hideCloseButton && (React.createElement(IconButton, __assign({ size: iconButtonSizeMapper[size], variant: "ghost", name: "close" }, closeButtonRestProps, { className: cnDialog('CloseButton', [closeButtonClassName]), onClick: onClose, icon: CloseIcon, compressed: true }))),
|
|
22
28
|
React.createElement("div", { className: cnDialog('InnerContainer') }, children)));
|
|
23
29
|
});
|
|
24
30
|
Dialog.displayName = 'Dialog';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import './Drawer.css';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { type IconButtonProps } from '../IconButton';
|
|
3
4
|
import { type ModalProps } from '../Modal';
|
|
4
|
-
import './Drawer.css';
|
|
5
5
|
export declare const cnDrawer: import("@bem-react/classname").ClassNameFormatter;
|
|
6
6
|
export declare const drawerVariant: readonly ["little", "medium", "large"];
|
|
7
7
|
export declare const drawerSizeVariant: readonly ["s", "l"];
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
|
+
import './Drawer.css';
|
|
2
3
|
import React, { forwardRef } from 'react';
|
|
3
4
|
import { CloseIcon } from '@ozen-ui/icons';
|
|
5
|
+
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
4
6
|
import { cn } from '../../utils/classname';
|
|
5
7
|
import { IconButton } from '../IconButton';
|
|
6
8
|
import { Modal } from '../Modal';
|
|
7
|
-
import './
|
|
9
|
+
import { DRAWER_DEFAULT_HIDE_CLOSE_BUTTON, DRAWER_DEFAULT_PLACEMENT, DRAWER_DEFAULT_SIZE, DRAWER_DEFAULT_VARIANT, } from './constants';
|
|
8
10
|
export var cnDrawer = cn('Drawer');
|
|
9
11
|
export var drawerVariant = ['little', 'medium', 'large'];
|
|
10
12
|
export var drawerSizeVariant = ['s', 'l'];
|
|
@@ -13,11 +15,15 @@ var iconButtonSizeMapper = {
|
|
|
13
15
|
l: 'm',
|
|
14
16
|
s: 's',
|
|
15
17
|
};
|
|
16
|
-
export var Drawer = forwardRef(function (
|
|
17
|
-
var
|
|
18
|
-
|
|
18
|
+
export var Drawer = forwardRef(function (inProps, ref) {
|
|
19
|
+
var props = useThemeProps({
|
|
20
|
+
props: inProps,
|
|
21
|
+
name: 'Drawer',
|
|
22
|
+
});
|
|
23
|
+
var _a = props.variant, variant = _a === void 0 ? DRAWER_DEFAULT_VARIANT : _a, _b = props.size, size = _b === void 0 ? DRAWER_DEFAULT_SIZE : _b, _c = props.placement, placement = _c === void 0 ? DRAWER_DEFAULT_PLACEMENT : _c, _d = props.hideCloseButton, hideCloseButton = _d === void 0 ? DRAWER_DEFAULT_HIDE_CLOSE_BUTTON : _d, open = props.open, onClose = props.onClose, children = props.children, className = props.className, transitionProps = props.transitionProps, closeButtonProps = props.closeButtonProps, other = __rest(props, ["variant", "size", "placement", "hideCloseButton", "open", "onClose", "children", "className", "transitionProps", "closeButtonProps"]);
|
|
24
|
+
var _e = closeButtonProps || {}, closeButtonClassName = _e.className, closeButtonRestProps = __rest(_e, ["className"]);
|
|
19
25
|
return (React.createElement(Modal, __assign({}, other, { open: open, onClose: onClose, className: cnDrawer({ variant: variant, size: size, placement: placement, hasCloseButton: !hideCloseButton }, [className]), transitionProps: __assign({ classNames: cnDrawer({ animation: true }) }, transitionProps), ref: ref }),
|
|
20
|
-
!hideCloseButton && (React.createElement(IconButton, __assign({ size: iconButtonSizeMapper[size], variant: "ghost", name: "close"
|
|
26
|
+
!hideCloseButton && (React.createElement(IconButton, __assign({ size: iconButtonSizeMapper[size], variant: "ghost", name: "close" }, closeButtonRestProps, { className: cnDrawer('CloseButton', [closeButtonClassName]), onClick: onClose, icon: CloseIcon, compressed: true }))),
|
|
21
27
|
React.createElement("div", { className: cnDrawer('InnerContainer') }, children)));
|
|
22
28
|
});
|
|
23
29
|
Drawer.displayName = 'Drawer';
|
|
@@ -18,7 +18,7 @@ export var Input = forwardRef(function (inProps, ref) {
|
|
|
18
18
|
props: inProps,
|
|
19
19
|
name: 'Input',
|
|
20
20
|
});
|
|
21
|
-
var _a = props.size, size = _a === void 0 ? INPUT_DEFAULT_SIZE : _a, label = props.label, error = props.error, autoFocus = props.autoFocus, placeholder = props.placeholder, id = props.id, name = props.name, type = props.type, renderLeft = props.renderLeft, renderRight = props.renderRight, fullWidth = props.fullWidth, disabled = props.disabled, hint = props.hint, required = props.required, className = props.className, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, inputProps = props.inputProps, bodyProps = props.bodyProps, labelProps = props.labelProps, inputRef = props.inputRef, labelRef = props.labelRef, other = __rest(props, ["size", "label", "error", "autoFocus", "placeholder", "id", "name", "type", "renderLeft", "renderRight", "fullWidth", "disabled", "hint", "required", "className", "value", "defaultValue", "onChange", "inputProps", "bodyProps", "labelProps", "inputRef", "labelRef"]);
|
|
21
|
+
var _a = props.size, size = _a === void 0 ? INPUT_DEFAULT_SIZE : _a, label = props.label, error = props.error, autoFocus = props.autoFocus, placeholder = props.placeholder, id = props.id, name = props.name, type = props.type, renderLeft = props.renderLeft, renderRight = props.renderRight, fullWidth = props.fullWidth, disabled = props.disabled, hint = props.hint, required = props.required, className = props.className, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, inputProps = props.inputProps, bodyProps = props.bodyProps, labelProps = props.labelProps, maxLength = props.maxLength, minLength = props.minLength, inputRef = props.inputRef, labelRef = props.labelRef, other = __rest(props, ["size", "label", "error", "autoFocus", "placeholder", "id", "name", "type", "renderLeft", "renderRight", "fullWidth", "disabled", "hint", "required", "className", "value", "defaultValue", "onChange", "inputProps", "bodyProps", "labelProps", "maxLength", "minLength", "inputRef", "labelRef"]);
|
|
22
22
|
var bodyInnerRef = useRef(null);
|
|
23
23
|
var fieldInnerRef = useRef(null);
|
|
24
24
|
/* Хук useEventListener необходим для того, чтобы при нажатии на кнопку мыши
|
|
@@ -42,7 +42,7 @@ export var Input = forwardRef(function (inProps, ref) {
|
|
|
42
42
|
React.createElement(FieldIcon, { icon: renderLeft }),
|
|
43
43
|
React.createElement("div", { className: cnInput('FieldContainer') },
|
|
44
44
|
React.createElement(FieldLabel, __assign({}, labelProps, { ref: labelRef || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.ref), className: labelProps === null || labelProps === void 0 ? void 0 : labelProps.className }), label),
|
|
45
|
-
React.createElement(FieldInput, __assign({ id: id, name: name, autoFocus: autoFocus, value: value, type: type, defaultValue: defaultValue, placeholder: placeholder, onChange: onChange }, inputProps, { className: cnInput('Field', [inputProps === null || inputProps === void 0 ? void 0 : inputProps.className]), ref: useMultiRef([inputRef || (inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref), fieldInnerRef]) }))),
|
|
45
|
+
React.createElement(FieldInput, __assign({ id: id, name: name, autoFocus: autoFocus, value: value, type: type, defaultValue: defaultValue, placeholder: placeholder, onChange: onChange, maxLength: maxLength, minLength: minLength }, inputProps, { className: cnInput('Field', [inputProps === null || inputProps === void 0 ? void 0 : inputProps.className]), ref: useMultiRef([inputRef || (inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref), fieldInnerRef]) }))),
|
|
46
46
|
React.createElement(FieldIcon, { icon: renderRight }),
|
|
47
47
|
React.createElement(Fieldset, null)),
|
|
48
48
|
React.createElement(FieldHint, null, hint)));
|
|
@@ -13,7 +13,9 @@ import type { ChipProps as ChiPropsNext } from '../ChipNext';
|
|
|
13
13
|
import type { CollapseProps } from '../Collapse';
|
|
14
14
|
import type { ContainerProps } from '../Container';
|
|
15
15
|
import type { DataListProps } from '../DataList';
|
|
16
|
+
import type { DialogProps } from '../Dialog';
|
|
16
17
|
import type { DividerProps } from '../Divider';
|
|
18
|
+
import type { DrawerProps } from '../Drawer';
|
|
17
19
|
import type { FieldControlProps } from '../FieldControl';
|
|
18
20
|
import type { FileProps } from '../File';
|
|
19
21
|
import type { FilePickerProps } from '../FilePicker';
|
|
@@ -78,7 +80,9 @@ export type Theme = {
|
|
|
78
80
|
Collapse?: Partial<CollapseProps>;
|
|
79
81
|
Container?: Partial<ContainerProps>;
|
|
80
82
|
DataList?: Partial<DataListProps>;
|
|
83
|
+
Dialog?: Partial<DialogProps>;
|
|
81
84
|
Divider?: Partial<DividerProps>;
|
|
85
|
+
Drawer?: Partial<DrawerProps>;
|
|
82
86
|
FieldControl?: Partial<FieldControlProps>;
|
|
83
87
|
File?: Partial<FileProps>;
|
|
84
88
|
FilePicker?: Partial<FilePickerProps>;
|
|
@@ -7,6 +7,16 @@ export var ruRU = {
|
|
|
7
7
|
clearText: 'Очистить',
|
|
8
8
|
loadingText: 'Загрузка…',
|
|
9
9
|
},
|
|
10
|
+
Dialog: {
|
|
11
|
+
closeButtonProps: {
|
|
12
|
+
'aria-label': 'Закрыть',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
Drawer: {
|
|
16
|
+
closeButtonProps: {
|
|
17
|
+
'aria-label': 'Закрыть',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
10
20
|
Loader: {
|
|
11
21
|
'aria-label': 'Загрузка',
|
|
12
22
|
},
|
|
@@ -29,6 +39,16 @@ export var kkKZ = {
|
|
|
29
39
|
clearText: 'Тазалау',
|
|
30
40
|
loadingText: 'Жүктеу…',
|
|
31
41
|
},
|
|
42
|
+
Dialog: {
|
|
43
|
+
closeButtonProps: {
|
|
44
|
+
'aria-label': 'Жабу',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
Drawer: {
|
|
48
|
+
closeButtonProps: {
|
|
49
|
+
'aria-label': 'Жабу',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
32
52
|
Loader: {
|
|
33
53
|
'aria-label': 'Жүктеу',
|
|
34
54
|
},
|
|
@@ -51,6 +71,16 @@ export var enUS = {
|
|
|
51
71
|
clearText: 'Clear',
|
|
52
72
|
loadingText: 'Loading…',
|
|
53
73
|
},
|
|
74
|
+
Dialog: {
|
|
75
|
+
closeButtonProps: {
|
|
76
|
+
'aria-label': 'Close',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
Drawer: {
|
|
80
|
+
closeButtonProps: {
|
|
81
|
+
'aria-label': 'Close',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
54
84
|
Loader: {
|
|
55
85
|
'aria-label': 'Loading',
|
|
56
86
|
},
|