@ozen-ui/kit 0.41.0 → 0.43.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/README.md +1 -1
- package/__inner__/cjs/components/Accordion/Accordion.css +1 -1
- package/__inner__/cjs/components/Alert/Alert.css +40 -21
- package/__inner__/cjs/components/Alert/Alert.d.ts +3 -1
- package/__inner__/cjs/components/Alert/Alert.js +5 -5
- package/__inner__/cjs/components/Autocomplete/components/AutocompleteRenderRight/AutocompleteRenderRight.js +3 -3
- package/__inner__/cjs/components/Autocomplete/helper.d.ts +2 -0
- package/__inner__/cjs/components/Autocomplete/types.d.ts +2 -2
- package/__inner__/cjs/components/Breadcrumbs/components/BreadcrumbItem.d.ts +1 -1
- package/__inner__/cjs/components/Button/Button.css +7 -1
- package/__inner__/cjs/components/ButtonNext/Button.css +7 -1
- package/__inner__/cjs/components/DataList/DataList.js +3 -1
- package/__inner__/cjs/components/Dialog/Dialog.css +1 -1
- package/__inner__/cjs/components/Dialog/Dialog.d.ts +1 -1
- package/__inner__/cjs/components/Dialog/Dialog.js +3 -3
- package/__inner__/cjs/components/Drawer/Drawer.css +9 -4
- package/__inner__/cjs/components/Drawer/Drawer.d.ts +1 -1
- package/__inner__/cjs/components/Drawer/Drawer.js +4 -4
- package/__inner__/cjs/components/FieldControl/FieldControl.css +6 -6
- package/__inner__/cjs/components/File/File.css +3 -3
- package/__inner__/cjs/components/FilePicker/FilePicker.d.ts +4 -2
- package/__inner__/cjs/components/FilePicker/FilePicker.js +2 -2
- package/__inner__/cjs/components/FilePicker/types.d.ts +4 -1
- package/__inner__/cjs/components/IconButton/IconButton.css +7 -1
- package/__inner__/cjs/components/IconButtonNext/IconButton.css +9 -1
- package/__inner__/cjs/components/IconButtonNext/IconButton.d.ts +1 -2
- package/__inner__/cjs/components/Indicator/Indicator.d.ts +1 -1
- package/__inner__/cjs/components/Input/Input.js +2 -2
- package/__inner__/cjs/components/Input/types.d.ts +3 -0
- package/__inner__/cjs/components/InputNumber/InputNumber.css +3 -3
- package/__inner__/cjs/components/InputNumber/InputNumber.js +5 -5
- package/__inner__/cjs/components/InputNumber/types.d.ts +4 -1
- package/__inner__/cjs/components/List/List.css +13 -9
- package/__inner__/cjs/components/Menu/Menu.d.ts +7 -0
- package/__inner__/cjs/components/Menu/Menu.js +12 -5
- package/__inner__/cjs/components/Menu/constants.d.ts +1 -0
- package/__inner__/cjs/components/Menu/constants.js +4 -0
- package/__inner__/cjs/components/Modal/components/ModalConsumer.js +1 -1
- package/__inner__/cjs/components/Pagination/Pagination.css +9 -9
- package/__inner__/cjs/components/Pagination/Pagination.d.ts +2 -2
- package/__inner__/cjs/components/Pagination/Pagination.js +21 -11
- package/__inner__/cjs/components/Pagination/components/PaginationItem/PaginationItem.css +21 -15
- package/__inner__/cjs/components/Pagination/components/PaginationItem/PaginationItem.js +7 -6
- package/__inner__/cjs/components/Pagination/constants.d.ts +4 -0
- package/__inner__/cjs/components/Pagination/constants.js +5 -1
- package/__inner__/cjs/components/Pagination/helpers/getItemAriaLabel/getItemAriaLabel.js +4 -4
- package/__inner__/cjs/components/Pagination/types.d.ts +6 -3
- package/__inner__/cjs/components/Paper/Paper.css +4 -0
- package/__inner__/cjs/components/Paper/Paper.d.ts +1 -1
- package/__inner__/cjs/components/Paper/Paper.js +1 -1
- package/__inner__/cjs/components/Popover/Popover.js +1 -1
- package/__inner__/cjs/components/SectionMessage/SectionMessage.css +9 -5
- package/__inner__/cjs/components/SectionMessage/SectionMessage.d.ts +1 -1
- package/__inner__/cjs/components/Segment/Segment.css +20 -5
- package/__inner__/cjs/components/Segment/components/SegmentItem.css +17 -14
- package/__inner__/cjs/components/Select/Select.js +2 -2
- package/__inner__/cjs/components/Select/components/SelectInput/SelectInput.js +2 -2
- package/__inner__/cjs/components/Select/components/SelectInput/types.d.ts +5 -1
- package/__inner__/cjs/components/Select/types.d.ts +2 -2
- package/__inner__/cjs/components/Tabs/components/ScrollButton/ScrollButton.css +13 -49
- package/__inner__/cjs/components/Tabs/components/ScrollButton/ScrollButton.d.ts +3 -3
- package/__inner__/cjs/components/Tabs/components/ScrollButton/ScrollButton.js +2 -2
- package/__inner__/cjs/components/Tabs/components/Tab/Tab.css +6 -2
- package/__inner__/cjs/components/Tag/Tag.css +9 -6
- package/__inner__/cjs/components/Textarea/Textarea.js +2 -2
- package/__inner__/cjs/components/Textarea/components/TextareaConsumer.js +2 -2
- package/__inner__/cjs/components/Textarea/types.d.ts +4 -1
- package/__inner__/cjs/components/Tooltip/Tooltip.js +1 -1
- package/__inner__/cjs/locale/locale.js +67 -0
- package/__inner__/cjs/utils/getPaperSizeToFormElement.d.ts +3 -0
- package/__inner__/cjs/utils/getPaperSizeToFormElement.js +12 -0
- package/__inner__/esm/components/Accordion/Accordion.css +1 -1
- package/__inner__/esm/components/Alert/Alert.css +40 -21
- package/__inner__/esm/components/Alert/Alert.d.ts +3 -1
- package/__inner__/esm/components/Alert/Alert.js +5 -5
- package/__inner__/esm/components/Autocomplete/Autocomplete.js +2 -2
- package/__inner__/esm/components/Autocomplete/components/AutocompleteRenderRight/AutocompleteRenderRight.js +1 -1
- package/__inner__/esm/components/Autocomplete/helper.d.ts +2 -0
- package/__inner__/esm/components/Autocomplete/types.d.ts +2 -2
- package/__inner__/esm/components/Breadcrumbs/components/BreadcrumbItem.d.ts +1 -1
- package/__inner__/esm/components/Button/Button.css +7 -1
- package/__inner__/esm/components/ButtonNext/Button.css +7 -1
- package/__inner__/esm/components/DataList/DataList.js +3 -1
- package/__inner__/esm/components/Dialog/Dialog.css +1 -1
- package/__inner__/esm/components/Dialog/Dialog.d.ts +1 -1
- package/__inner__/esm/components/Dialog/Dialog.js +2 -2
- package/__inner__/esm/components/Drawer/Drawer.css +9 -4
- package/__inner__/esm/components/Drawer/Drawer.d.ts +1 -1
- package/__inner__/esm/components/Drawer/Drawer.js +3 -3
- package/__inner__/esm/components/FieldControl/FieldControl.css +6 -6
- package/__inner__/esm/components/File/File.css +3 -3
- package/__inner__/esm/components/FilePicker/FilePicker.d.ts +4 -2
- package/__inner__/esm/components/FilePicker/FilePicker.js +4 -4
- package/__inner__/esm/components/FilePicker/types.d.ts +4 -1
- package/__inner__/esm/components/IconButton/IconButton.css +7 -1
- package/__inner__/esm/components/IconButtonNext/IconButton.css +9 -1
- package/__inner__/esm/components/IconButtonNext/IconButton.d.ts +1 -2
- package/__inner__/esm/components/Indicator/Indicator.d.ts +1 -1
- package/__inner__/esm/components/Input/Input.js +2 -2
- package/__inner__/esm/components/Input/types.d.ts +3 -0
- package/__inner__/esm/components/InputNumber/InputNumber.css +3 -3
- package/__inner__/esm/components/InputNumber/InputNumber.js +6 -6
- package/__inner__/esm/components/InputNumber/types.d.ts +4 -1
- package/__inner__/esm/components/List/List.css +13 -9
- package/__inner__/esm/components/Menu/Menu.d.ts +7 -0
- package/__inner__/esm/components/Menu/Menu.js +12 -5
- package/__inner__/esm/components/Menu/constants.d.ts +1 -0
- package/__inner__/esm/components/Menu/constants.js +1 -0
- package/__inner__/esm/components/Modal/components/ModalConsumer.js +1 -1
- package/__inner__/esm/components/Pagination/Pagination.css +9 -9
- package/__inner__/esm/components/Pagination/Pagination.d.ts +2 -2
- package/__inner__/esm/components/Pagination/Pagination.js +23 -13
- package/__inner__/esm/components/Pagination/components/PaginationItem/PaginationItem.css +21 -15
- package/__inner__/esm/components/Pagination/components/PaginationItem/PaginationItem.js +8 -7
- package/__inner__/esm/components/Pagination/constants.d.ts +4 -0
- package/__inner__/esm/components/Pagination/constants.js +4 -0
- package/__inner__/esm/components/Pagination/helpers/getItemAriaLabel/getItemAriaLabel.js +4 -4
- package/__inner__/esm/components/Pagination/types.d.ts +6 -3
- package/__inner__/esm/components/Paper/Paper.css +4 -0
- package/__inner__/esm/components/Paper/Paper.d.ts +1 -1
- package/__inner__/esm/components/Paper/Paper.js +1 -1
- package/__inner__/esm/components/Popover/Popover.js +1 -1
- package/__inner__/esm/components/SectionMessage/SectionMessage.css +9 -5
- package/__inner__/esm/components/SectionMessage/SectionMessage.d.ts +1 -1
- package/__inner__/esm/components/Segment/Segment.css +20 -5
- package/__inner__/esm/components/Segment/components/SegmentItem.css +17 -14
- package/__inner__/esm/components/Select/Select.js +3 -3
- package/__inner__/esm/components/Select/components/SelectInput/SelectInput.js +2 -2
- package/__inner__/esm/components/Select/components/SelectInput/types.d.ts +5 -1
- package/__inner__/esm/components/Select/types.d.ts +2 -2
- package/__inner__/esm/components/Tabs/components/ScrollButton/ScrollButton.css +13 -49
- package/__inner__/esm/components/Tabs/components/ScrollButton/ScrollButton.d.ts +3 -3
- package/__inner__/esm/components/Tabs/components/ScrollButton/ScrollButton.js +2 -2
- package/__inner__/esm/components/Tabs/components/Tab/Tab.css +6 -2
- package/__inner__/esm/components/Tag/Tag.css +9 -6
- package/__inner__/esm/components/Textarea/Textarea.js +2 -2
- package/__inner__/esm/components/Textarea/components/TextareaConsumer.js +2 -2
- package/__inner__/esm/components/Textarea/types.d.ts +4 -1
- package/__inner__/esm/components/Tooltip/Tooltip.js +1 -1
- package/__inner__/esm/locale/locale.js +67 -0
- package/__inner__/esm/utils/getPaperSizeToFormElement.d.ts +3 -0
- package/__inner__/esm/utils/getPaperSizeToFormElement.js +8 -0
- package/package.json +4 -4
|
@@ -15,10 +15,10 @@ exports.Textarea = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
|
15
15
|
props: inProps,
|
|
16
16
|
name: 'Textarea',
|
|
17
17
|
});
|
|
18
|
-
var _a = props.size, size = _a === void 0 ? constants_1.TEXTAREA_DEFAULT_SIZE : _a, autoFocus = props.autoFocus, maxLength = props.maxLength, expand = props.expand, placeholder = props.placeholder, id = props.id, name = props.name, error = props.error, fullWidth = props.fullWidth, cols = props.cols, rows = props.rows, className = props.className, label = props.label, hint = props.hint, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, required = props.required, disabled = props.disabled, textareaProps = props.textareaProps, labelProps = props.labelProps, labelRef = props.labelRef, textareaRef = props.textareaRef, other = tslib_1.__rest(props, ["size", "autoFocus", "maxLength", "expand", "placeholder", "id", "name", "error", "fullWidth", "cols", "rows", "className", "label", "hint", "value", "defaultValue", "onChange", "required", "disabled", "textareaProps", "labelProps", "labelRef", "textareaRef"]);
|
|
18
|
+
var _a = props.size, size = _a === void 0 ? constants_1.TEXTAREA_DEFAULT_SIZE : _a, autoFocus = props.autoFocus, maxLength = props.maxLength, expand = props.expand, placeholder = props.placeholder, id = props.id, name = props.name, error = props.error, fullWidth = props.fullWidth, cols = props.cols, rows = props.rows, className = props.className, label = props.label, hint = props.hint, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, required = props.required, disabled = props.disabled, textareaProps = props.textareaProps, labelProps = props.labelProps, hintProps = props.hintProps, labelRef = props.labelRef, textareaRef = props.textareaRef, other = tslib_1.__rest(props, ["size", "autoFocus", "maxLength", "expand", "placeholder", "id", "name", "error", "fullWidth", "cols", "rows", "className", "label", "hint", "value", "defaultValue", "onChange", "required", "disabled", "textareaProps", "labelProps", "hintProps", "labelRef", "textareaRef"]);
|
|
19
19
|
return (react_1.default.createElement(FieldControl_1.FieldControl, tslib_1.__assign({ size: size, error: error, disabled: disabled, required: required, fullWidth: fullWidth }, other, { className: (0, exports.cnTextarea)({
|
|
20
20
|
expand: expand,
|
|
21
21
|
}, [className]), ref: ref }),
|
|
22
|
-
react_1.default.createElement(components_1.TextareaConsumer, { autoFocus: autoFocus, maxLength: maxLength, placeholder: placeholder, id: id, name: name, cols: cols, expand: expand, rows: rows, label: label, hint: hint, value: value, defaultValue: defaultValue, onChange: onChange, textareaRef: textareaRef, textareaProps: textareaProps, labelRef: labelRef, labelProps: labelProps })));
|
|
22
|
+
react_1.default.createElement(components_1.TextareaConsumer, { autoFocus: autoFocus, maxLength: maxLength, placeholder: placeholder, id: id, name: name, cols: cols, expand: expand, rows: rows, label: label, hint: hint, value: value, defaultValue: defaultValue, onChange: onChange, textareaRef: textareaRef, textareaProps: textareaProps, labelRef: labelRef, labelProps: labelProps, hintProps: hintProps })));
|
|
23
23
|
});
|
|
24
24
|
exports.Textarea.displayName = 'Textarea';
|
|
@@ -12,7 +12,7 @@ var Fieldset_1 = require("../../Fieldset");
|
|
|
12
12
|
var Textarea_1 = require("../../Textarea");
|
|
13
13
|
var index_1 = require("./index");
|
|
14
14
|
var TextareaConsumer = function (_a) {
|
|
15
|
-
var labelProps = _a.labelProps, labelRef = _a.labelRef, maxLength = _a.maxLength, label = _a.label, id = _a.id, name = _a.name, cols = _a.cols, rows = _a.rows, disabled = _a.disabled, valueProp = _a.value, required = _a.required, defaultValue = _a.defaultValue, placeholder = _a.placeholder, autoFocus = _a.autoFocus, textareaProps = _a.textareaProps, onChange = _a.onChange, textareaRef = _a.textareaRef, expand = _a.expand, hint = _a.hint;
|
|
15
|
+
var labelProps = _a.labelProps, hintProps = _a.hintProps, labelRef = _a.labelRef, maxLength = _a.maxLength, label = _a.label, id = _a.id, name = _a.name, cols = _a.cols, rows = _a.rows, disabled = _a.disabled, valueProp = _a.value, required = _a.required, defaultValue = _a.defaultValue, placeholder = _a.placeholder, autoFocus = _a.autoFocus, textareaProps = _a.textareaProps, onChange = _a.onChange, textareaRef = _a.textareaRef, expand = _a.expand, hint = _a.hint;
|
|
16
16
|
var fieldRef = (0, react_1.useRef)(null);
|
|
17
17
|
var context = (0, FieldControl_1.useFieldControl)();
|
|
18
18
|
var _b = tslib_1.__read(context, 1), value = _b[0].value;
|
|
@@ -29,7 +29,7 @@ var TextareaConsumer = function (_a) {
|
|
|
29
29
|
react_1.default.createElement(FieldLabel_1.FieldLabel, tslib_1.__assign({}, labelProps, { className: (0, Textarea_1.cnTextarea)('Label', [labelProps === null || labelProps === void 0 ? void 0 : labelProps.className]), ref: labelRef || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.ref) }), label),
|
|
30
30
|
react_1.default.createElement(FieldInput_1.FieldInput, tslib_1.__assign({ as: "textarea", id: id, name: name, cols: cols, rows: rows, disabled: disabled, value: valueProp, required: required, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder, autoFocus: autoFocus, onChange: onChange }, textareaProps, { className: (0, Textarea_1.cnTextarea)('Field', {}, [textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.className]), ref: (0, useMultiRef_1.useMultiRef)([textareaRef || (textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.ref), fieldRef]) })),
|
|
31
31
|
react_1.default.createElement(Fieldset_1.Fieldset, null)),
|
|
32
|
-
react_1.default.createElement(FieldHint_1.FieldHint,
|
|
32
|
+
react_1.default.createElement(FieldHint_1.FieldHint, tslib_1.__assign({}, hintProps),
|
|
33
33
|
hint,
|
|
34
34
|
maxLength && react_1.default.createElement(index_1.TextareaCounter, { maxLength: maxLength }))));
|
|
35
35
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentPropsWithRef, Ref } from 'react';
|
|
2
2
|
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
3
3
|
import type { FIELD_CONTROL_DEFAULT_TAG } from '../FieldControl';
|
|
4
|
+
import type { FieldHintProps } from '../FieldHint';
|
|
4
5
|
import type { FieldLabelProps } from '../FieldLabel';
|
|
5
6
|
export type TextareaSizeVariant = FormElementSizeVariant;
|
|
6
7
|
export declare const textareaExpandVariant: readonly ["autoSize", "verticalResize"];
|
|
@@ -61,6 +62,8 @@ export type TextareaProps = Omit<ComponentPropsWithRef<typeof FIELD_CONTROL_DEFA
|
|
|
61
62
|
};
|
|
62
63
|
/** Свойства FieldLabel */
|
|
63
64
|
labelProps?: FieldLabelProps;
|
|
65
|
+
/** Cвойства FieldHint */
|
|
66
|
+
hintProps?: Omit<FieldHintProps, 'children'>;
|
|
64
67
|
/** data-атрибут для тестирования */
|
|
65
68
|
'data-testid'?: string;
|
|
66
69
|
} & TextareaPropsDeprecated;
|
|
@@ -115,7 +115,7 @@ exports.Tooltip = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)
|
|
|
115
115
|
]);
|
|
116
116
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
117
117
|
react_1.default.cloneElement(resolveChildren, composeChildrenProps),
|
|
118
|
-
react_1.default.createElement(Popover_1.Popover, tslib_1.__assign({ anchorRef: anchorRef, strategy: "absolute", as: as, background: variant === 'light' ? 'main' : 'main-inverse', radius: size }, other, { ref: ref, offset: offset, placement: placement, open: openState && !disabled, onClose: handleClose, className: (0, exports.cnTooltip)({ size: size, variant: variant }, [className]), disableInteractive: disableInteractive, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, arrow: arrow, arrowProps: {
|
|
118
|
+
react_1.default.createElement(Popover_1.Popover, tslib_1.__assign({ anchorRef: anchorRef, strategy: "absolute", as: as, background: variant === 'light' ? 'main' : 'main-inverse', radius: size === 'xs' ? 's' : 'l' }, other, { ref: ref, offset: offset, placement: placement, open: openState && !disabled, onClose: handleClose, className: (0, exports.cnTooltip)({ size: size, variant: variant }, [className]), disableInteractive: disableInteractive, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, arrow: arrow, arrowProps: {
|
|
119
119
|
size: size,
|
|
120
120
|
}, disableEnforceFocus: true, disableReturnFocus: true }), label)));
|
|
121
121
|
});
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.enUS = exports.kkKZ = exports.ruRU = void 0;
|
|
4
|
+
var constants_1 = require("../components/Pagination/constants");
|
|
4
5
|
exports.ruRU = {
|
|
5
6
|
defaultProps: {
|
|
7
|
+
Alert: {
|
|
8
|
+
closeText: 'Закрыть',
|
|
9
|
+
},
|
|
6
10
|
Autocomplete: {
|
|
7
11
|
noOptionsText: 'Ничего не найдено',
|
|
8
12
|
closeText: 'Закрыть',
|
|
@@ -31,10 +35,32 @@ exports.ruRU = {
|
|
|
31
35
|
incrementButtonText: 'Увеличить',
|
|
32
36
|
decrementButtonText: 'Уменьшить',
|
|
33
37
|
},
|
|
38
|
+
Pagination: {
|
|
39
|
+
'aria-label': 'Навигация по страницам',
|
|
40
|
+
getItemAriaLabel: function (_a) {
|
|
41
|
+
var page = _a.page, type = _a.type, selected = _a.selected;
|
|
42
|
+
if (type === constants_1.NEXT) {
|
|
43
|
+
return 'Перейти на следующую страницу';
|
|
44
|
+
}
|
|
45
|
+
if (type === constants_1.PREVIOUS) {
|
|
46
|
+
return 'Перейти на предыдущую страницу';
|
|
47
|
+
}
|
|
48
|
+
if (selected) {
|
|
49
|
+
return "\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 ".concat(page);
|
|
50
|
+
}
|
|
51
|
+
if (type === constants_1.PAGE) {
|
|
52
|
+
return "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 ".concat(page);
|
|
53
|
+
}
|
|
54
|
+
return '';
|
|
55
|
+
},
|
|
56
|
+
},
|
|
34
57
|
},
|
|
35
58
|
};
|
|
36
59
|
exports.kkKZ = {
|
|
37
60
|
defaultProps: {
|
|
61
|
+
Alert: {
|
|
62
|
+
closeText: 'Жабу',
|
|
63
|
+
},
|
|
38
64
|
Autocomplete: {
|
|
39
65
|
noOptionsText: 'Ештеңе табылған жоқ',
|
|
40
66
|
closeText: 'Жабу',
|
|
@@ -63,10 +89,32 @@ exports.kkKZ = {
|
|
|
63
89
|
incrementButtonText: 'Үлкейту',
|
|
64
90
|
decrementButtonText: 'Азайту',
|
|
65
91
|
},
|
|
92
|
+
Pagination: {
|
|
93
|
+
'aria-label': 'Беттерді шарлау',
|
|
94
|
+
getItemAriaLabel: function (_a) {
|
|
95
|
+
var page = _a.page, type = _a.type, selected = _a.selected;
|
|
96
|
+
if (type === constants_1.NEXT) {
|
|
97
|
+
return 'Келесі бетке өтіңіз';
|
|
98
|
+
}
|
|
99
|
+
if (type === constants_1.PREVIOUS) {
|
|
100
|
+
return 'Алдыңғы бетке өтіңіз';
|
|
101
|
+
}
|
|
102
|
+
if (selected) {
|
|
103
|
+
return "".concat(page, " \u0431\u0435\u0442");
|
|
104
|
+
}
|
|
105
|
+
if (type === constants_1.PAGE) {
|
|
106
|
+
return "".concat(page, "-\u0431\u0435\u0442\u043A\u0435 \u04E9\u0442\u0456\u04A3\u0456\u0437");
|
|
107
|
+
}
|
|
108
|
+
return '';
|
|
109
|
+
},
|
|
110
|
+
},
|
|
66
111
|
},
|
|
67
112
|
};
|
|
68
113
|
exports.enUS = {
|
|
69
114
|
defaultProps: {
|
|
115
|
+
Alert: {
|
|
116
|
+
closeText: 'Close',
|
|
117
|
+
},
|
|
70
118
|
Autocomplete: {
|
|
71
119
|
noOptionsText: 'No options',
|
|
72
120
|
closeText: 'Close',
|
|
@@ -95,5 +143,24 @@ exports.enUS = {
|
|
|
95
143
|
incrementButtonText: 'Increment',
|
|
96
144
|
decrementButtonText: 'Decrement',
|
|
97
145
|
},
|
|
146
|
+
Pagination: {
|
|
147
|
+
'aria-label': 'Pagination navigation',
|
|
148
|
+
getItemAriaLabel: function (_a) {
|
|
149
|
+
var page = _a.page, type = _a.type, selected = _a.selected;
|
|
150
|
+
if (type === constants_1.NEXT) {
|
|
151
|
+
return 'Go to next page';
|
|
152
|
+
}
|
|
153
|
+
if (type === constants_1.PREVIOUS) {
|
|
154
|
+
return 'Go to previous page';
|
|
155
|
+
}
|
|
156
|
+
if (selected) {
|
|
157
|
+
return "Page ".concat(page);
|
|
158
|
+
}
|
|
159
|
+
if (type === constants_1.PAGE) {
|
|
160
|
+
return "Go to page ".concat(page);
|
|
161
|
+
}
|
|
162
|
+
return '';
|
|
163
|
+
},
|
|
164
|
+
},
|
|
98
165
|
},
|
|
99
166
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPaperSizeToFormElement = void 0;
|
|
4
|
+
var matchPaperSizeToFormElement = {
|
|
5
|
+
'2xs': 's',
|
|
6
|
+
xs: 's',
|
|
7
|
+
s: 'l',
|
|
8
|
+
m: 'l',
|
|
9
|
+
l: 'l',
|
|
10
|
+
};
|
|
11
|
+
var getPaperSizeToFormElement = function (size) { return matchPaperSizeToFormElement === null || matchPaperSizeToFormElement === void 0 ? void 0 : matchPaperSizeToFormElement[size]; };
|
|
12
|
+
exports.getPaperSizeToFormElement = getPaperSizeToFormElement;
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
--accordion-background-color: var(--color-background-main);
|
|
77
77
|
--accordion-summary-hover-color: none;
|
|
78
78
|
--accordion-summary-active-color: none;
|
|
79
|
-
--accordion-border-radius: var(--border-radius-
|
|
79
|
+
--accordion-border-radius: var(--border-radius-xl);
|
|
80
80
|
}
|
|
81
81
|
.AccordionSummary {
|
|
82
82
|
inline-size: 100%;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
/* stylelint-disable */
|
|
2
2
|
.Alert {
|
|
3
|
-
|
|
3
|
+
--alert-status-line-width: 8px;
|
|
4
|
+
--alert-status-line-gutter: var(--control-padding-xs);
|
|
4
5
|
display: flex;
|
|
5
|
-
-moz-column-gap: var(--spacing-2xs);
|
|
6
|
-
column-gap: var(--spacing-2xs);
|
|
7
|
-
align-items: flex-start;
|
|
8
|
-
inline-size: 100%;
|
|
9
6
|
overflow: auto;
|
|
7
|
+
inline-size: 100%;
|
|
8
|
+
position: relative;
|
|
10
9
|
box-sizing: border-box;
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
align-items: flex-start;
|
|
11
|
+
-moz-column-gap: var(--spacing-2xs);
|
|
12
|
+
column-gap: var(--spacing-2xs);
|
|
13
|
+
padding: var(--control-padding-s);
|
|
14
|
+
padding-inline-start: calc(
|
|
15
|
+
var(--control-padding-s) + var(--alert-status-line-width) +
|
|
16
|
+
var(--alert-status-line-gutter)
|
|
17
|
+
);
|
|
13
18
|
|
|
14
19
|
font: var(--typography-text-xs-font);
|
|
15
20
|
|
|
@@ -21,36 +26,36 @@
|
|
|
21
26
|
--alert-title-text-color: var(--color-content-primary);
|
|
22
27
|
--alert-body-text-color: var(--color-content-secondary);
|
|
23
28
|
--alert-icon-color: var(--color-content-primary);
|
|
24
|
-
--alert-close-button-color: var(--color-
|
|
29
|
+
--alert-close-button-color: var(--color-content-primary);
|
|
25
30
|
}
|
|
26
31
|
.Alert_color_dark {
|
|
27
32
|
--alert-title-text-color: var(--color-content-primary-inverse);
|
|
28
|
-
--alert-body-text-color: var(--color-content-
|
|
33
|
+
--alert-body-text-color: var(--color-content-primary-inverse);
|
|
29
34
|
--alert-icon-color: var(--color-content-primary-inverse);
|
|
30
|
-
--alert-close-button-color: var(--color-
|
|
35
|
+
--alert-close-button-color: var(--color-content-action-on);
|
|
31
36
|
}
|
|
32
37
|
.Alert_status_info {
|
|
33
38
|
--alert-icon-color: var(--color-content-info);
|
|
34
|
-
--alert-
|
|
39
|
+
--alert-status-line-color: var(--color-background-info);
|
|
35
40
|
}
|
|
36
41
|
.Alert_status_warning {
|
|
37
42
|
--alert-icon-color: var(--color-content-warning);
|
|
38
|
-
--alert-
|
|
43
|
+
--alert-status-line-color: var(--color-background-warning);
|
|
39
44
|
}
|
|
40
45
|
.Alert_status_success {
|
|
41
46
|
--alert-icon-color: var(--color-content-success);
|
|
42
|
-
--alert-
|
|
47
|
+
--alert-status-line-color: var(--color-background-success);
|
|
43
48
|
}
|
|
44
49
|
.Alert_status_error {
|
|
45
50
|
--alert-icon-color: var(--color-content-error);
|
|
46
|
-
--alert-
|
|
51
|
+
--alert-status-line-color: var(--color-background-error);
|
|
47
52
|
}
|
|
48
53
|
.Alert_hasCloseButton {
|
|
49
|
-
padding-inline-end:
|
|
54
|
+
padding-inline-end: 40px;
|
|
50
55
|
}
|
|
51
56
|
.Alert-Icon {
|
|
52
|
-
padding-block-start: 2px;
|
|
53
57
|
display: flex;
|
|
58
|
+
padding-block-start: 2px;
|
|
54
59
|
color: var(--alert-icon-color);
|
|
55
60
|
}
|
|
56
61
|
.Alert-Title {
|
|
@@ -65,15 +70,29 @@
|
|
|
65
70
|
text-transform: var(--typography-text-s_1-text_transform, none);
|
|
66
71
|
}
|
|
67
72
|
.Alert-Body {
|
|
68
|
-
margin-block-start: var(--spacing-3xs);
|
|
69
73
|
color: var(--alert-body-text-color);
|
|
74
|
+
margin-block-start: var(--spacing-3xs);
|
|
70
75
|
}
|
|
71
76
|
.Alert-Action {
|
|
72
77
|
margin-block-start: var(--spacing-2xs);
|
|
73
78
|
}
|
|
74
|
-
.
|
|
75
|
-
|
|
79
|
+
.Alert::after {
|
|
80
|
+
content: '';
|
|
81
|
+
inset: 0;
|
|
82
|
+
position: absolute;
|
|
83
|
+
margin: var(--alert-status-line-gutter);
|
|
84
|
+
margin-inline-end: 0;
|
|
85
|
+
border-radius: var(--border-radius-s);
|
|
86
|
+
inline-size: var(--alert-status-line-width);
|
|
87
|
+
background-color: var(--alert-status-line-color);
|
|
88
|
+
}
|
|
89
|
+
.ButtonBase.IconButtonNext.Alert-CloseButton {
|
|
90
|
+
--icon-button-font-color: var(--alert-close-button-color);
|
|
91
|
+
--icon-button-font-color-hover: var(--alert-close-button-color);
|
|
92
|
+
--icon-button-font-color-active: var(--alert-close-button-color);
|
|
93
|
+
--icon-button-font-color-focus: var(--alert-close-button-color);
|
|
76
94
|
position: absolute;
|
|
77
|
-
|
|
78
|
-
inset-inline-end:
|
|
95
|
+
margin: var(--spacing-xs);
|
|
96
|
+
inset-inline-end: 0;
|
|
97
|
+
inset-block-start: 0;
|
|
79
98
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './Alert.css';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { HTMLAttributes, ReactElement, ReactNode, MouseEvent } from 'react';
|
|
4
|
-
import type { ButtonProps } from '../
|
|
4
|
+
import type { ButtonProps } from '../ButtonNext';
|
|
5
5
|
export declare const cnAlert: import("@bem-react/classname").ClassNameFormatter;
|
|
6
6
|
export declare const alertStatusVariant: readonly ["success", "error", "warning", "info"];
|
|
7
7
|
export declare const alertColorVariant: readonly ["light", "dark"];
|
|
@@ -35,6 +35,8 @@ type AlertBaseProps = {
|
|
|
35
35
|
action?: ReactElement<ButtonProps> | (({ size, className, }: Pick<ButtonProps, 'size' | 'className'>) => ReactElement);
|
|
36
36
|
/** Дополнительные CSS-классы */
|
|
37
37
|
className?: string;
|
|
38
|
+
/** Текст для кнопки закрытия компонента */
|
|
39
|
+
closeText?: string;
|
|
38
40
|
};
|
|
39
41
|
export type AlertProps = AlertBaseProps & Omit<HTMLAttributes<HTMLDivElement>, 'title'>;
|
|
40
42
|
export declare const Alert: React.ForwardRefExoticComponent<AlertBaseProps & Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -4,7 +4,7 @@ import React, { forwardRef, useMemo } from 'react';
|
|
|
4
4
|
import { CrossIcon, InfoCircleFilledIcon, CheckCircleFilledIcon, WarningTriangleFilledIcon, WarningCircleFilledIcon, } from '@ozen-ui/icons';
|
|
5
5
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
6
6
|
import { cn } from '../../utils/classname';
|
|
7
|
-
import { IconButton } from '../
|
|
7
|
+
import { IconButton } from '../IconButtonNext';
|
|
8
8
|
import { Paper } from '../Paper';
|
|
9
9
|
import { ALERT_DEFAULT_STATUS, ALERT_DEFAULT_SHOW_ICON, ALERT_DEFAULT_COLOR, } from './constants';
|
|
10
10
|
export var cnAlert = cn('Alert');
|
|
@@ -27,7 +27,7 @@ export var Alert = forwardRef(function (inProps, ref) {
|
|
|
27
27
|
props: inProps,
|
|
28
28
|
name: 'Alert',
|
|
29
29
|
});
|
|
30
|
-
var _a = props.status, status = _a === void 0 ? ALERT_DEFAULT_STATUS : _a, _b = props.showIcon, showIcon = _b === void 0 ? ALERT_DEFAULT_SHOW_ICON : _b, _c = props.color, color = _c === void 0 ? ALERT_DEFAULT_COLOR : _c, children = props.children, actionProp = props.action, onClose = props.onClose, title = props.title, className = props.className,
|
|
30
|
+
var _a = props.status, status = _a === void 0 ? ALERT_DEFAULT_STATUS : _a, _b = props.showIcon, showIcon = _b === void 0 ? ALERT_DEFAULT_SHOW_ICON : _b, _c = props.color, color = _c === void 0 ? ALERT_DEFAULT_COLOR : _c, closeText = props.closeText, children = props.children, actionProp = props.action, onClose = props.onClose, title = props.title, className = props.className, other = __rest(props, ["status", "showIcon", "color", "closeText", "children", "action", "onClose", "title", "className"]);
|
|
31
31
|
var action = useMemo(function () {
|
|
32
32
|
var actionProps = {
|
|
33
33
|
size: '2xs',
|
|
@@ -41,14 +41,14 @@ export var Alert = forwardRef(function (inProps, ref) {
|
|
|
41
41
|
}
|
|
42
42
|
return React.cloneElement(actionProp, actionProps);
|
|
43
43
|
}, [actionProp]);
|
|
44
|
-
return (React.createElement(Paper, __assign({
|
|
44
|
+
return (React.createElement(Paper, __assign({ radius: "l", shadow: "m", role: "alert", background: color === 'light' ? 'main' : 'main-inverse' }, other, { className: cnAlert({ status: status, hasCloseButton: !!onClose, color: color }, [
|
|
45
45
|
className,
|
|
46
|
-
])
|
|
46
|
+
]), ref: ref }),
|
|
47
47
|
showIcon && (React.createElement("div", { className: cnAlert('Icon') }, matchStatusToIcon[status])),
|
|
48
48
|
React.createElement("div", { className: cnAlert('Content') },
|
|
49
49
|
React.createElement("div", { className: cnAlert('Title') }, title),
|
|
50
50
|
children && React.createElement("div", { className: cnAlert('Body') }, children),
|
|
51
51
|
action && React.createElement("div", { className: cnAlert('Action') }, action)),
|
|
52
|
-
onClose && (React.createElement(IconButton, { size: "
|
|
52
|
+
onClose && (React.createElement(IconButton, { size: "2xs", color: "secondary", icon: CrossIcon, onClick: onClose, variant: "function", "aria-label": closeText, className: cnAlert('CloseButton') }))));
|
|
53
53
|
});
|
|
54
54
|
Alert.displayName = 'Alert';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign, __read, __rest, __spreadArray } from "tslib";
|
|
2
2
|
import './Autocomplete.css';
|
|
3
|
-
import React, { useEffect, useRef,
|
|
3
|
+
import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { useControlled } from '../../hooks/useControlled';
|
|
5
5
|
import { useMutableRef } from '../../hooks/useMutableRef';
|
|
6
6
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
@@ -9,7 +9,7 @@ import { isKeys } from '../../utils/isKeys';
|
|
|
9
9
|
import { DataList, DataListOption } from '../DataList';
|
|
10
10
|
import { Input } from '../Input';
|
|
11
11
|
import { AutocompleteLoading, AutocompleteNoOptions, AutocompleteRenderRight, } from './components';
|
|
12
|
-
import {
|
|
12
|
+
import { AUTOCOMPLETE_DEFAULT_ALLOW_CUSTOM_VALUE, AUTOCOMPLETE_DEFAULT_AUTOFOCUS, AUTOCOMPLETE_DEFAULT_DISABLE_CLEAR_BUTTON, AUTOCOMPLETE_DEFAULT_DISABLE_CLOSE_ON_SELECT, AUTOCOMPLETE_DEFAULT_DISABLE_SHOW_CHEVRON, AUTOCOMPLETE_DEFAULT_DISABLE_SHOW_EMPTY_OPTIONS_LIST, AUTOCOMPLETE_DEFAULT_DISABLED, AUTOCOMPLETE_DEFAULT_FULLWIDTH, AUTOCOMPLETE_DEFAULT_REQUIRED, AUTOCOMPLETE_DEFAULT_SIZE, } from './constants';
|
|
13
13
|
import { withDefaultGetters } from './helper';
|
|
14
14
|
export var cnAutocomplete = cn('Autocomplete');
|
|
15
15
|
function AutocompleteRender(inProps, ref) {
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { ChevronDownIcon, ChevronUpIcon, CrossIcon } from '@ozen-ui/icons';
|
|
4
4
|
import { useFieldControl } from '../../../FieldControl';
|
|
5
5
|
import { FieldIcon } from '../../../FieldIcon';
|
|
6
|
-
import { IconButton } from '../../../
|
|
6
|
+
import { IconButton } from '../../../IconButtonNext';
|
|
7
7
|
import { cnAutocomplete } from '../../index';
|
|
8
8
|
export var AutocompleteRenderRight = function (_a) {
|
|
9
9
|
var disableClearButton = _a.disableClearButton, disableShowChevron = _a.disableShowChevron, renderRight = _a.renderRight, clearText = _a.clearText, closeText = _a.closeText, openText = _a.openText, disabled = _a.disabled, hasValue = _a.hasValue, onClear = _a.onClear, onOpen = _a.onOpen, open = _a.open, size = _a.size;
|
|
@@ -80,6 +80,7 @@ export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTI
|
|
|
80
80
|
} & {
|
|
81
81
|
'data-testid'?: string | undefined;
|
|
82
82
|
}) | undefined;
|
|
83
|
+
hintProps?: Omit<import("../FieldHint").FieldHintProps, "children"> | undefined;
|
|
83
84
|
} & {
|
|
84
85
|
open?: boolean | undefined;
|
|
85
86
|
defaultOpen?: undefined;
|
|
@@ -176,6 +177,7 @@ export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTI
|
|
|
176
177
|
} & {
|
|
177
178
|
'data-testid'?: string | undefined;
|
|
178
179
|
}) | undefined;
|
|
180
|
+
hintProps?: Omit<import("../FieldHint").FieldHintProps, "children"> | undefined;
|
|
179
181
|
} & {
|
|
180
182
|
open?: undefined;
|
|
181
183
|
defaultOpen?: boolean | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChangeEvent, ReactElement, ReactNode, SyntheticEvent } from 'react';
|
|
2
2
|
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
3
3
|
import type { DataListProps } from '../DataList';
|
|
4
4
|
import type { InputProps } from '../Input';
|
|
@@ -31,7 +31,7 @@ type AutocompleteOpenUncontrolledProps = {
|
|
|
31
31
|
/** Состояние открытие по умолчанию (неконтролируемый компонент) */
|
|
32
32
|
defaultOpen?: boolean;
|
|
33
33
|
};
|
|
34
|
-
type AutocompleteInputProps = Pick<InputProps, 'placeholder' | 'autoFocus' | 'fullWidth' | 'disabled' | 'label' | 'required' | 'style' | 'error' | 'hint' | 'renderLeft' | 'renderRight' | 'className' | 'inputProps' | 'onKeyDown'>;
|
|
34
|
+
type AutocompleteInputProps = Pick<InputProps, 'placeholder' | 'autoFocus' | 'fullWidth' | 'disabled' | 'label' | 'required' | 'style' | 'error' | 'hint' | 'renderLeft' | 'renderRight' | 'className' | 'inputProps' | 'hintProps' | 'onKeyDown'>;
|
|
35
35
|
type AutocompleteDataListProps = Partial<Omit<DataListProps, 'onClose' | 'open' | 'anchorRef' | 'multiple' | 'selected' | 'onSelect'>>;
|
|
36
36
|
export type AutocompleteProps<OPTION = AutocompleteDefaultOption> = {
|
|
37
37
|
/** Список вариантов выбора (опции) */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ElementType } from 'react';
|
|
2
2
|
import type { PolymorphicComponentPropsWithoutRef } from '../../../utils/polymorphicComponentWithRef';
|
|
3
|
-
import type { ButtonProps } from '../../
|
|
3
|
+
import type { ButtonProps } from '../../ButtonNext';
|
|
4
4
|
import { BREADCRUMB_ITEM_DEFAULT_TAG } from '../constants';
|
|
5
5
|
export declare const cnBreadcrumbItem: import("@bem-react/classname").ClassNameFormatter;
|
|
6
6
|
type BreadcrumbItemBaseProps = Pick<ButtonProps, 'disabled' | 'iconLeft' | 'iconRight'>;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
min-inline-size: var(--button-min-width);
|
|
14
14
|
padding: 0 var(--button-padding-x);
|
|
15
15
|
background-color: var(--button-bg-color);
|
|
16
|
-
border-radius: var(--border-radius
|
|
16
|
+
border-radius: var(--button-border-radius);
|
|
17
17
|
transition:
|
|
18
18
|
background-color var(--transition-default),
|
|
19
19
|
border-color var(--transition-default),
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
.Button_size_2xs {
|
|
29
29
|
--button-height: var(--control-height-2xs);
|
|
30
30
|
--button-padding-x: var(--control-padding-xs);
|
|
31
|
+
--button-border-radius: var(--border-radius-m);
|
|
31
32
|
--button-min-width: 56px;
|
|
32
33
|
|
|
33
34
|
font: var(--typography-text-2xs-font);
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
.Button_size_xs {
|
|
40
41
|
--button-height: var(--control-height-xs);
|
|
41
42
|
--button-padding-x: var(--control-padding-xs);
|
|
43
|
+
--button-border-radius: var(--border-radius-m);
|
|
42
44
|
--button-min-width: 64px;
|
|
43
45
|
|
|
44
46
|
font: var(--typography-text-xs-font);
|
|
@@ -50,6 +52,7 @@
|
|
|
50
52
|
.Button_size_s {
|
|
51
53
|
--button-height: var(--control-height-s);
|
|
52
54
|
--button-padding-x: var(--control-padding-s);
|
|
55
|
+
--button-border-radius: var(--border-radius-l);
|
|
53
56
|
--button-min-width: 72px;
|
|
54
57
|
|
|
55
58
|
font: var(--typography-text-s-font);
|
|
@@ -61,6 +64,7 @@
|
|
|
61
64
|
.Button_size_m {
|
|
62
65
|
--button-height: var(--control-height-m);
|
|
63
66
|
--button-padding-x: var(--control-padding-m);
|
|
67
|
+
--button-border-radius: var(--border-radius-l);
|
|
64
68
|
--button-min-width: 80px;
|
|
65
69
|
|
|
66
70
|
font: var(--typography-text-m-font);
|
|
@@ -72,6 +76,7 @@
|
|
|
72
76
|
.Button_size_l {
|
|
73
77
|
--button-height: var(--control-height-l);
|
|
74
78
|
--button-padding-x: var(--control-padding-l);
|
|
79
|
+
--button-border-radius: var(--border-radius-l);
|
|
75
80
|
--button-min-width: 88px;
|
|
76
81
|
|
|
77
82
|
font: var(--typography-text-l-font);
|
|
@@ -166,6 +171,7 @@
|
|
|
166
171
|
--button-height: auto;
|
|
167
172
|
--button-min-width: auto;
|
|
168
173
|
--button-padding-x: 0;
|
|
174
|
+
--button-border-radius: var(--border-radius-xs);
|
|
169
175
|
}
|
|
170
176
|
.Button_variant_function:hover {
|
|
171
177
|
opacity: 0.8;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
min-inline-size: var(--button-min-width);
|
|
14
14
|
padding: 0 var(--button-padding-x);
|
|
15
15
|
background-color: var(--button-bg-color);
|
|
16
|
-
border-radius: var(--border-radius
|
|
16
|
+
border-radius: var(--button-border-radius);
|
|
17
17
|
transition:
|
|
18
18
|
background-color var(--transition-default),
|
|
19
19
|
border-color var(--transition-default),
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
.ButtonNext_size_2xs {
|
|
29
29
|
--button-height: var(--control-height-2xs);
|
|
30
30
|
--button-padding-x: var(--control-padding-xs);
|
|
31
|
+
--button-border-radius: var(--border-radius-m);
|
|
31
32
|
--button-min-width: 56px;
|
|
32
33
|
|
|
33
34
|
font: var(--typography-text-2xs-font);
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
.ButtonNext_size_xs {
|
|
40
41
|
--button-height: var(--control-height-xs);
|
|
41
42
|
--button-padding-x: var(--control-padding-xs);
|
|
43
|
+
--button-border-radius: var(--border-radius-m);
|
|
42
44
|
--button-min-width: 64px;
|
|
43
45
|
|
|
44
46
|
font: var(--typography-text-xs-font);
|
|
@@ -50,6 +52,7 @@
|
|
|
50
52
|
.ButtonNext_size_s {
|
|
51
53
|
--button-height: var(--control-height-s);
|
|
52
54
|
--button-padding-x: var(--control-padding-s);
|
|
55
|
+
--button-border-radius: var(--border-radius-l);
|
|
53
56
|
--button-min-width: 72px;
|
|
54
57
|
|
|
55
58
|
font: var(--typography-text-s-font);
|
|
@@ -61,6 +64,7 @@
|
|
|
61
64
|
.ButtonNext_size_m {
|
|
62
65
|
--button-height: var(--control-height-m);
|
|
63
66
|
--button-padding-x: var(--control-padding-m);
|
|
67
|
+
--button-border-radius: var(--border-radius-l);
|
|
64
68
|
--button-min-width: 80px;
|
|
65
69
|
|
|
66
70
|
font: var(--typography-text-m-font);
|
|
@@ -72,6 +76,7 @@
|
|
|
72
76
|
.ButtonNext_size_l {
|
|
73
77
|
--button-height: var(--control-height-l);
|
|
74
78
|
--button-padding-x: var(--control-padding-l);
|
|
79
|
+
--button-border-radius: var(--border-radius-l);
|
|
75
80
|
--button-min-width: 88px;
|
|
76
81
|
|
|
77
82
|
font: var(--typography-text-l-font);
|
|
@@ -208,6 +213,7 @@
|
|
|
208
213
|
--button-height: auto;
|
|
209
214
|
--button-min-width: auto;
|
|
210
215
|
--button-padding-x: 0;
|
|
216
|
+
--button-border-radius: var(--border-radius-xs);
|
|
211
217
|
}
|
|
212
218
|
.ButtonNext_variant_function.ButtonNext_color_primary,
|
|
213
219
|
.ButtonNext_variant_function.ButtonNext_color_secondary,
|
|
@@ -8,6 +8,7 @@ import { useMultiRef } from '../../hooks/useMultiRef';
|
|
|
8
8
|
import { usePrevious } from '../../hooks/usePrevious';
|
|
9
9
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
10
10
|
import { cn } from '../../utils/classname';
|
|
11
|
+
import { getPaperSizeToFormElement } from '../../utils/getPaperSizeToFormElement';
|
|
11
12
|
import { isKey } from '../../utils/isKey';
|
|
12
13
|
import { polymorphicComponentWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
13
14
|
import { scrollContainerToElement } from '../../utils/scrollContainerToElement';
|
|
@@ -21,6 +22,7 @@ var DataListRender = function (inProps, ref) {
|
|
|
21
22
|
var _a = useThemeProps({ props: inProps, name: 'DataList' }), _b = _a.open, open = _b === void 0 ? DATA_LIST_DEFAULT_OPEN : _b, _c = _a.size, size = _c === void 0 ? DATA_LIST_DEFAULT_SIZE : _c, _d = _a.as, as = _d === void 0 ? DATA_LIST_DEFAULT_TAG : _d, name = _a.name, children = _a.children, anchorRef = _a.anchorRef, selectedProp = _a.selected, defaultSelected = _a.defaultSelected, onClose = _a.onClose, listProps = _a.listProps, className = _a.className, other = __rest(_a, ["open", "size", "as", "name", "children", "anchorRef", "selected", "defaultSelected", "onClose", "listProps", "className"]);
|
|
22
23
|
var dataListRef = useRef(null);
|
|
23
24
|
var listRef = useRef(null);
|
|
25
|
+
var radius = getPaperSizeToFormElement(size);
|
|
24
26
|
var _e = __read(useControlled({
|
|
25
27
|
name: 'DataList',
|
|
26
28
|
defaultValue: defaultSelected,
|
|
@@ -143,7 +145,7 @@ var DataListRender = function (inProps, ref) {
|
|
|
143
145
|
return cloneElement(elementChild, props);
|
|
144
146
|
});
|
|
145
147
|
}, [resolvedChildren, selectedState, focused, onClick]);
|
|
146
|
-
return (React.createElement(Popover, __assign({ as: as, open: open, placement: "bottom-start", strategy: "absolute", disableReturnFocus: true, disableEnforceFocus: true, offset: [0, 4], onClose: onClose, anchorRef: anchorRef, className: cnDataList('', [className]), transitionProps: {
|
|
148
|
+
return (React.createElement(Popover, __assign({ as: as, open: open, placement: "bottom-start", strategy: "absolute", disableReturnFocus: true, disableEnforceFocus: true, offset: [0, 4], onClose: onClose, anchorRef: anchorRef, radius: radius, className: cnDataList('', [className]), transitionProps: {
|
|
147
149
|
classNames: 'DataList-animation',
|
|
148
150
|
} }, other, { ref: useMultiRef([ref, dataListRef]) }),
|
|
149
151
|
React.createElement(List, __assign({ as: "ul", size: size }, listProps, { onMouseDown: handleOnMouseDownList, ref: useMultiRef([listRef, listProps === null || listProps === void 0 ? void 0 : listProps.ref]) }), renderChildren)));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './Dialog.css';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type IconButtonProps } from '../
|
|
3
|
+
import { type IconButtonProps } from '../IconButtonNext';
|
|
4
4
|
import { type ModalProps } from '../Modal';
|
|
5
5
|
export declare const cnDialog: import("@bem-react/classname").ClassNameFormatter;
|
|
6
6
|
export declare const dialogSizeVariant: readonly ["s", "l"];
|
|
@@ -4,7 +4,7 @@ import React, { forwardRef } from 'react';
|
|
|
4
4
|
import { CrossIcon } from '@ozen-ui/icons';
|
|
5
5
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
6
6
|
import { cn } from '../../utils/classname';
|
|
7
|
-
import { IconButton } from '../
|
|
7
|
+
import { IconButton } from '../IconButtonNext';
|
|
8
8
|
import { Modal } from '../Modal';
|
|
9
9
|
import { DIALOG_DEFAULT_HIDE_CLOSE_BUTTON, DIALOG_DEFAULT_SIZE, DIALOG_DEFAULT_VARIANT, } from './constants';
|
|
10
10
|
export var cnDialog = cn('Dialog');
|
|
@@ -21,7 +21,7 @@ export var Dialog = forwardRef(function (inProps, ref) {
|
|
|
21
21
|
});
|
|
22
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
23
|
var _d = closeButtonProps || {}, closeButtonClassName = _d.className, closeButtonRestProps = __rest(_d, ["className"]);
|
|
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' && {
|
|
24
|
+
return (React.createElement(Modal, __assign({}, other, { open: open, onClose: onClose, windowProps: __assign({ role: 'dialog', radius: size === 's' ? 'l' : 'xl' }, windowProps), className: cnDialog({ variant: variant, size: size, hasCloseButton: !hideCloseButton }, [className]), transitionProps: __assign(__assign({}, (variant === 'fullsize' && {
|
|
25
25
|
classNames: cnDialog({ animation: 'fullsize' }),
|
|
26
26
|
})), transitionProps), ref: ref }),
|
|
27
27
|
!hideCloseButton && (React.createElement(IconButton, __assign({ size: iconButtonSizeMapper[size], variant: "ghost", name: "close" }, closeButtonRestProps, { className: cnDialog('CloseButton', [closeButtonClassName]), onClick: onClose, icon: CrossIcon, compressed: true }))),
|