@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
|
@@ -13,7 +13,7 @@ import { SELECT_DEFAULT_MULTILINE, SELECT_DEFAULT_SIZE } from '../../constants';
|
|
|
13
13
|
import { cnSelect } from '../../index';
|
|
14
14
|
import { SelectInputConsumer } from '../SelectConsumer';
|
|
15
15
|
export var SelectInput = forwardRef(function (_a, ref) {
|
|
16
|
-
var _b = _a.size, size = _b === void 0 ? SELECT_DEFAULT_SIZE : _b, _c = _a.multiline, multiline = _c === void 0 ? SELECT_DEFAULT_MULTILINE : _c, open = _a.open, label = _a.label, error = _a.error, id = _a.id, name = _a.name, renderLeft = _a.renderLeft, renderRight = _a.renderRight, renderedValue = _a.renderedValue, fullWidth = _a.fullWidth, disabled = _a.disabled, hint = _a.hint, required = _a.required, className = _a.className, inputProps = _a.inputProps, valueProp = _a.value, placeholderProp = _a.placeholder, defaultValue = _a.defaultValue, onFocus = _a.onFocus, onBlur = _a.onBlur, onClick = _a.onClick, onKeyDown = _a.onKeyDown, labelProps = _a.labelProps, fieldProps = _a.fieldProps, labelRef = _a.labelRef, inputRef = _a.inputRef, fieldRef = _a.fieldRef, bodyProps = _a.bodyProps, other = __rest(_a, ["size", "multiline", "open", "label", "error", "id", "name", "renderLeft", "renderRight", "renderedValue", "fullWidth", "disabled", "hint", "required", "className", "inputProps", "value", "placeholder", "defaultValue", "onFocus", "onBlur", "onClick", "onKeyDown", "labelProps", "fieldProps", "labelRef", "inputRef", "fieldRef", "bodyProps"]);
|
|
16
|
+
var _b = _a.size, size = _b === void 0 ? SELECT_DEFAULT_SIZE : _b, _c = _a.multiline, multiline = _c === void 0 ? SELECT_DEFAULT_MULTILINE : _c, open = _a.open, label = _a.label, error = _a.error, id = _a.id, name = _a.name, renderLeft = _a.renderLeft, renderRight = _a.renderRight, renderedValue = _a.renderedValue, fullWidth = _a.fullWidth, disabled = _a.disabled, hint = _a.hint, required = _a.required, className = _a.className, inputProps = _a.inputProps, valueProp = _a.value, placeholderProp = _a.placeholder, defaultValue = _a.defaultValue, onFocus = _a.onFocus, onBlur = _a.onBlur, onClick = _a.onClick, onKeyDown = _a.onKeyDown, labelProps = _a.labelProps, fieldProps = _a.fieldProps, hintProps = _a.hintProps, labelRef = _a.labelRef, inputRef = _a.inputRef, fieldRef = _a.fieldRef, bodyProps = _a.bodyProps, other = __rest(_a, ["size", "multiline", "open", "label", "error", "id", "name", "renderLeft", "renderRight", "renderedValue", "fullWidth", "disabled", "hint", "required", "className", "inputProps", "value", "placeholder", "defaultValue", "onFocus", "onBlur", "onClick", "onKeyDown", "labelProps", "fieldProps", "hintProps", "labelRef", "inputRef", "fieldRef", "bodyProps"]);
|
|
17
17
|
var _d = __read(useBoolean(), 2), focused = _d[0], _e = _d[1], on = _e.on, off = _e.off;
|
|
18
18
|
var filled = !!valueProp || valueProp === 0;
|
|
19
19
|
var handleFocus = useCallback(function (e) {
|
|
@@ -35,6 +35,6 @@ export var SelectInput = forwardRef(function (_a, ref) {
|
|
|
35
35
|
React.createElement(FieldIcon, { icon: renderRight, className: cnSelect('RenderRight') }),
|
|
36
36
|
React.createElement(FieldIcon, { icon: ChevronDownIcon, className: classnames(cnSelect('RenderRight'), cnSelect('DropDownIcon', { open: open })) }),
|
|
37
37
|
React.createElement(Fieldset, { className: cnSelect('Fieldset') })),
|
|
38
|
-
React.createElement(FieldHint,
|
|
38
|
+
React.createElement(FieldHint, __assign({}, hintProps), hint)));
|
|
39
39
|
});
|
|
40
40
|
SelectInput.displayName = 'SelectInput';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode, Ref } from 'react';
|
|
2
2
|
import type { FormElementSizeVariant } from '../../../../types/FormElementSizeVariant';
|
|
3
|
+
import type { FieldHintProps } from '../../../FieldHint';
|
|
3
4
|
import type { FieldIconProps } from '../../../FieldIcon';
|
|
4
5
|
import type { FieldLabelProps } from '../../../FieldLabel';
|
|
5
6
|
export type SelectInputSizeVariant = FormElementSizeVariant;
|
|
6
7
|
type LabelProps = FieldLabelProps;
|
|
8
|
+
type HintProps = FieldHintProps;
|
|
7
9
|
type InputProps = ComponentPropsWithRef<'input'> & {
|
|
8
10
|
'data-testid'?: string;
|
|
9
11
|
};
|
|
@@ -79,6 +81,8 @@ export type SelectInputProps = Omit<ComponentPropsWithRef<'div'>, 'value' | 'def
|
|
|
79
81
|
labelProps?: LabelProps;
|
|
80
82
|
/** Свойства Body */
|
|
81
83
|
bodyProps?: BodyProps;
|
|
84
|
+
/** Cвойства FieldHint */
|
|
85
|
+
hintProps?: Omit<HintProps, 'children'>;
|
|
82
86
|
/** Признак раскрытого списка */
|
|
83
87
|
open?: boolean;
|
|
84
88
|
/** Идентификатор компонента для тестов */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentPropsWithRef, ReactElement, ReactNode, SyntheticEvent } from 'react';
|
|
2
2
|
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
3
3
|
import type { DataListBaseProps, DataListSelected } from '../DataList';
|
|
4
4
|
import type { SelectInputProps } from './components';
|
|
@@ -66,6 +66,6 @@ export type SelectProps<MULTIPLE extends boolean = false> = {
|
|
|
66
66
|
multiple?: MULTIPLE;
|
|
67
67
|
/** Идентификатор компонента для тестов */
|
|
68
68
|
'data-testid'?: string;
|
|
69
|
-
} & Pick<SelectInputProps, 'id' | 'name' | 'label' | 'placeholder' | 'disabled' | 'required' | 'error' | 'hint' | 'fullWidth' | 'renderLeft' | 'renderRight' | 'multiline' | 'inputProps' | 'labelProps' | 'bodyProps' | 'inputRef' | 'labelRef' | 'bodyRef'> & Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'defaultValue'> & SelectPropsDeprecated<MULTIPLE> & (SelectControlledProps<MULTIPLE> | SelectUncontrolledProps<MULTIPLE>) & (SelectOpenControlledProps | SelectOpenUncontrolledProps);
|
|
69
|
+
} & Pick<SelectInputProps, 'id' | 'name' | 'label' | 'placeholder' | 'disabled' | 'required' | 'error' | 'hint' | 'fullWidth' | 'renderLeft' | 'renderRight' | 'multiline' | 'inputProps' | 'labelProps' | 'hintProps' | 'bodyProps' | 'inputRef' | 'labelRef' | 'bodyRef'> & Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'defaultValue'> & SelectPropsDeprecated<MULTIPLE> & (SelectControlledProps<MULTIPLE> | SelectUncontrolledProps<MULTIPLE>) & (SelectOpenControlledProps | SelectOpenUncontrolledProps);
|
|
70
70
|
export type SelectComponent = <MULTIPLE extends boolean = false>(props: SelectProps<MULTIPLE>) => ReactElement | null;
|
|
71
71
|
export {};
|
|
@@ -1,53 +1,17 @@
|
|
|
1
|
-
.ScrollButton {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
align-items: center;
|
|
5
|
-
padding: 12px;
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
z-index: 2;
|
|
8
|
-
border: none;
|
|
9
|
-
cursor: pointer;
|
|
10
|
-
color: var(--color-content-primary);
|
|
11
|
-
box-shadow: var(--shadow-m);
|
|
12
|
-
border-radius: 4px;
|
|
13
|
-
background-color: var(--color-background-main);
|
|
14
|
-
transition: opacity var(--transition-default), box-shadow var(--transition-default);
|
|
1
|
+
.IconButtonNext.ScrollButton {
|
|
2
|
+
position: absolute;
|
|
3
|
+
z-index: calc(var(--z-index-absolute) + 1);
|
|
15
4
|
}
|
|
16
5
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
.IconButtonNext.ScrollButton_direction_left {
|
|
7
|
+
inset-inline-start: 0;
|
|
8
|
+
}
|
|
20
9
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
.IconButtonNext.ScrollButton_direction_right {
|
|
11
|
+
inset-inline-end: 0;
|
|
12
|
+
}
|
|
24
13
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.ScrollButton_size_s, .ScrollButton_size_xs {
|
|
30
|
-
padding: 8px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.ScrollButton:focus {
|
|
34
|
-
outline: 0;
|
|
35
|
-
box-shadow: var(--shadow-outline-focused);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.ScrollButton:focus:not(:focus-visible) {
|
|
39
|
-
box-shadow: var(--shadow-m);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.ScrollButton:hover {
|
|
43
|
-
box-shadow: var(--shadow-l);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.ScrollButton:active {
|
|
47
|
-
box-shadow: var(--shadow-s);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.ScrollButton_invisible {
|
|
51
|
-
pointer-events: none;
|
|
52
|
-
opacity: 0;
|
|
53
|
-
}
|
|
14
|
+
.IconButtonNext.ScrollButton_invisible {
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
opacity: 0;
|
|
17
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './ScrollButton.css';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { Ref
|
|
3
|
+
import type { Ref } from 'react';
|
|
4
|
+
import type { IconButtonProps } from '../../../IconButtonNext';
|
|
4
5
|
import type { TabsSizeVariant } from '../../types';
|
|
5
6
|
export declare const scrollButtonDirectionVariant: readonly ["left", "right"];
|
|
6
7
|
export type ScrollButtonDirectionVariant = (typeof scrollButtonDirectionVariant)[number];
|
|
7
|
-
|
|
8
|
-
interface ScrollButtonProps extends ButtonElProps {
|
|
8
|
+
interface ScrollButtonProps extends Partial<IconButtonProps> {
|
|
9
9
|
direction: ScrollButtonDirectionVariant;
|
|
10
10
|
invisible: boolean;
|
|
11
11
|
children?: never;
|
|
@@ -3,6 +3,7 @@ import './ScrollButton.css';
|
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import { ChevronLeftIcon, ChevronRightIcon } from '@ozen-ui/icons';
|
|
5
5
|
import { cn } from '../../../../utils/classname';
|
|
6
|
+
import { IconButton } from '../../../IconButtonNext';
|
|
6
7
|
export var scrollButtonDirectionVariant = ['left', 'right'];
|
|
7
8
|
export var cnScrollButton = cn('ScrollButton');
|
|
8
9
|
export var iconByDirection = {
|
|
@@ -18,7 +19,6 @@ export var ScrollButton = React.forwardRef(function (_a, ref) {
|
|
|
18
19
|
var ariaLabel = useMemo(function () { return ariaLabelByDirection[direction]; }, [direction]);
|
|
19
20
|
var Icon = useMemo(function () { return iconByDirection[direction]; }, [direction]);
|
|
20
21
|
var tabIndex = invisible ? -1 : 0;
|
|
21
|
-
return (React.createElement("
|
|
22
|
-
React.createElement(Icon, { size: "s" })));
|
|
22
|
+
return (React.createElement(IconButton, __assign({ variant: "floating", size: size, icon: React.createElement(Icon, { size: "s" }), className: cnScrollButton({ invisible: invisible, direction: direction }, [className]), tabIndex: tabIndex, "aria-label": ariaLabel, compressed: true, ref: ref }, other)));
|
|
23
23
|
});
|
|
24
24
|
ScrollButton.displayName = 'ScrollButton';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
max-inline-size: 360px;
|
|
8
8
|
min-inline-size: 90px;
|
|
9
9
|
cursor: pointer;
|
|
10
|
-
border-radius: var(--border-radius
|
|
10
|
+
border-radius: var(--tab-border-radius);
|
|
11
11
|
color: var(--color-content-secondary);
|
|
12
12
|
font-style: normal;
|
|
13
13
|
text-decoration: none;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
.Tab_active {
|
|
36
36
|
cursor: auto;
|
|
37
|
-
border-radius: var(--
|
|
37
|
+
border-radius: var(--tab-border-radius);
|
|
38
38
|
}
|
|
39
39
|
.Tab > svg {
|
|
40
40
|
flex-shrink: 0;
|
|
@@ -94,15 +94,19 @@
|
|
|
94
94
|
text-transform: var(--typography-text-m-text_transform, none);
|
|
95
95
|
}
|
|
96
96
|
.Tab_size_xs {
|
|
97
|
+
--tab-border-radius: var(--border-radius-m);
|
|
97
98
|
padding: 12px;
|
|
98
99
|
}
|
|
99
100
|
.Tab_size_s {
|
|
101
|
+
--tab-border-radius: var(--border-radius-l);
|
|
100
102
|
padding: 14px 16px;
|
|
101
103
|
}
|
|
102
104
|
.Tab_size_m {
|
|
105
|
+
--tab-border-radius: var(--border-radius-l);
|
|
103
106
|
padding: 16px 20px;
|
|
104
107
|
}
|
|
105
108
|
.Tab_size_l {
|
|
109
|
+
--tab-border-radius: var(--border-radius-l);
|
|
106
110
|
padding: 18px 24px;
|
|
107
111
|
}
|
|
108
112
|
.Tab_onlyIcon.Tab_size_2xs {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* stylelint-disable */
|
|
2
2
|
.Tag {
|
|
3
|
-
display: inline-flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
border-radius: var(--border-radius-xs);
|
|
6
|
-
padding: var(--tag-padding);
|
|
7
|
-
gap: var(--spacing-3xs);
|
|
8
|
-
outline: none;
|
|
9
3
|
border: none;
|
|
4
|
+
outline: none;
|
|
5
|
+
align-items: center;
|
|
6
|
+
display: inline-flex;
|
|
10
7
|
text-decoration: none;
|
|
8
|
+
gap: var(--spacing-3xs);
|
|
9
|
+
padding: var(--tag-padding);
|
|
10
|
+
border-radius: var(--tag-border-radius);
|
|
11
11
|
transition:
|
|
12
12
|
box-shadow var(--transition-default),
|
|
13
13
|
background-color var(--transition-default),
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
text-transform: var(--typography-text-3xs-text_transform, none);
|
|
20
20
|
|
|
21
21
|
--tag-padding: 0 4px;
|
|
22
|
+
--tag-border-radius: var(--border-radius-s);
|
|
22
23
|
}
|
|
23
24
|
.Tag_size_xs {
|
|
24
25
|
font: var(--typography-text-xs-font);
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
text-transform: var(--typography-text-xs-text_transform, none);
|
|
27
28
|
|
|
28
29
|
--tag-padding: 4px 8px;
|
|
30
|
+
--tag-border-radius: var(--border-radius-s);
|
|
29
31
|
}
|
|
30
32
|
.Tag_size_s {
|
|
31
33
|
font: var(--typography-text-s-font);
|
|
@@ -33,6 +35,7 @@
|
|
|
33
35
|
text-transform: var(--typography-text-s-text_transform, none);
|
|
34
36
|
|
|
35
37
|
--tag-padding: 6px 12px;
|
|
38
|
+
--tag-border-radius: var(--border-radius-m);
|
|
36
39
|
}
|
|
37
40
|
.Tag_variant_neutral {
|
|
38
41
|
background-color: var(--color-background-secondary);
|
|
@@ -12,10 +12,10 @@ export var Textarea = forwardRef(function (inProps, ref) {
|
|
|
12
12
|
props: inProps,
|
|
13
13
|
name: 'Textarea',
|
|
14
14
|
});
|
|
15
|
-
var _a = props.size, size = _a === void 0 ? 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 = __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"]);
|
|
15
|
+
var _a = props.size, size = _a === void 0 ? 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 = __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"]);
|
|
16
16
|
return (React.createElement(FieldControl, __assign({ size: size, error: error, disabled: disabled, required: required, fullWidth: fullWidth }, other, { className: cnTextarea({
|
|
17
17
|
expand: expand,
|
|
18
18
|
}, [className]), ref: ref }),
|
|
19
|
-
React.createElement(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 })));
|
|
19
|
+
React.createElement(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 })));
|
|
20
20
|
});
|
|
21
21
|
Textarea.displayName = 'Textarea';
|
|
@@ -9,7 +9,7 @@ import { Fieldset } from '../../Fieldset';
|
|
|
9
9
|
import { cnTextarea } from '../../Textarea';
|
|
10
10
|
import { TextareaCounter } from './index';
|
|
11
11
|
export var TextareaConsumer = function (_a) {
|
|
12
|
-
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;
|
|
12
|
+
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;
|
|
13
13
|
var fieldRef = useRef(null);
|
|
14
14
|
var context = useFieldControl();
|
|
15
15
|
var _b = __read(context, 1), value = _b[0].value;
|
|
@@ -26,7 +26,7 @@ export var TextareaConsumer = function (_a) {
|
|
|
26
26
|
React.createElement(FieldLabel, __assign({}, labelProps, { className: cnTextarea('Label', [labelProps === null || labelProps === void 0 ? void 0 : labelProps.className]), ref: labelRef || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.ref) }), label),
|
|
27
27
|
React.createElement(FieldInput, __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: cnTextarea('Field', {}, [textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.className]), ref: useMultiRef([textareaRef || (textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.ref), fieldRef]) })),
|
|
28
28
|
React.createElement(Fieldset, null)),
|
|
29
|
-
React.createElement(FieldHint,
|
|
29
|
+
React.createElement(FieldHint, __assign({}, hintProps),
|
|
30
30
|
hint,
|
|
31
31
|
maxLength && React.createElement(TextareaCounter, { maxLength: maxLength }))));
|
|
32
32
|
};
|
|
@@ -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;
|
|
@@ -112,7 +112,7 @@ export var Tooltip = polymorphicComponentWithRef(function (inProps, ref) {
|
|
|
112
112
|
]);
|
|
113
113
|
return (React.createElement(React.Fragment, null,
|
|
114
114
|
React.cloneElement(resolveChildren, composeChildrenProps),
|
|
115
|
-
React.createElement(Popover, __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: cnTooltip({ size: size, variant: variant }, [className]), disableInteractive: disableInteractive, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, arrow: arrow, arrowProps: {
|
|
115
|
+
React.createElement(Popover, __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: cnTooltip({ size: size, variant: variant }, [className]), disableInteractive: disableInteractive, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, arrow: arrow, arrowProps: {
|
|
116
116
|
size: size,
|
|
117
117
|
}, disableEnforceFocus: true, disableReturnFocus: true }), label)));
|
|
118
118
|
});
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { NEXT, PAGE, PREVIOUS } from '../components/Pagination/constants';
|
|
1
2
|
export var ruRU = {
|
|
2
3
|
defaultProps: {
|
|
4
|
+
Alert: {
|
|
5
|
+
closeText: 'Закрыть',
|
|
6
|
+
},
|
|
3
7
|
Autocomplete: {
|
|
4
8
|
noOptionsText: 'Ничего не найдено',
|
|
5
9
|
closeText: 'Закрыть',
|
|
@@ -28,10 +32,32 @@ export var ruRU = {
|
|
|
28
32
|
incrementButtonText: 'Увеличить',
|
|
29
33
|
decrementButtonText: 'Уменьшить',
|
|
30
34
|
},
|
|
35
|
+
Pagination: {
|
|
36
|
+
'aria-label': 'Навигация по страницам',
|
|
37
|
+
getItemAriaLabel: function (_a) {
|
|
38
|
+
var page = _a.page, type = _a.type, selected = _a.selected;
|
|
39
|
+
if (type === NEXT) {
|
|
40
|
+
return 'Перейти на следующую страницу';
|
|
41
|
+
}
|
|
42
|
+
if (type === PREVIOUS) {
|
|
43
|
+
return 'Перейти на предыдущую страницу';
|
|
44
|
+
}
|
|
45
|
+
if (selected) {
|
|
46
|
+
return "\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 ".concat(page);
|
|
47
|
+
}
|
|
48
|
+
if (type === PAGE) {
|
|
49
|
+
return "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 ".concat(page);
|
|
50
|
+
}
|
|
51
|
+
return '';
|
|
52
|
+
},
|
|
53
|
+
},
|
|
31
54
|
},
|
|
32
55
|
};
|
|
33
56
|
export var kkKZ = {
|
|
34
57
|
defaultProps: {
|
|
58
|
+
Alert: {
|
|
59
|
+
closeText: 'Жабу',
|
|
60
|
+
},
|
|
35
61
|
Autocomplete: {
|
|
36
62
|
noOptionsText: 'Ештеңе табылған жоқ',
|
|
37
63
|
closeText: 'Жабу',
|
|
@@ -60,10 +86,32 @@ export var kkKZ = {
|
|
|
60
86
|
incrementButtonText: 'Үлкейту',
|
|
61
87
|
decrementButtonText: 'Азайту',
|
|
62
88
|
},
|
|
89
|
+
Pagination: {
|
|
90
|
+
'aria-label': 'Беттерді шарлау',
|
|
91
|
+
getItemAriaLabel: function (_a) {
|
|
92
|
+
var page = _a.page, type = _a.type, selected = _a.selected;
|
|
93
|
+
if (type === NEXT) {
|
|
94
|
+
return 'Келесі бетке өтіңіз';
|
|
95
|
+
}
|
|
96
|
+
if (type === PREVIOUS) {
|
|
97
|
+
return 'Алдыңғы бетке өтіңіз';
|
|
98
|
+
}
|
|
99
|
+
if (selected) {
|
|
100
|
+
return "".concat(page, " \u0431\u0435\u0442");
|
|
101
|
+
}
|
|
102
|
+
if (type === PAGE) {
|
|
103
|
+
return "".concat(page, "-\u0431\u0435\u0442\u043A\u0435 \u04E9\u0442\u0456\u04A3\u0456\u0437");
|
|
104
|
+
}
|
|
105
|
+
return '';
|
|
106
|
+
},
|
|
107
|
+
},
|
|
63
108
|
},
|
|
64
109
|
};
|
|
65
110
|
export var enUS = {
|
|
66
111
|
defaultProps: {
|
|
112
|
+
Alert: {
|
|
113
|
+
closeText: 'Close',
|
|
114
|
+
},
|
|
67
115
|
Autocomplete: {
|
|
68
116
|
noOptionsText: 'No options',
|
|
69
117
|
closeText: 'Close',
|
|
@@ -92,5 +140,24 @@ export var enUS = {
|
|
|
92
140
|
incrementButtonText: 'Increment',
|
|
93
141
|
decrementButtonText: 'Decrement',
|
|
94
142
|
},
|
|
143
|
+
Pagination: {
|
|
144
|
+
'aria-label': 'Pagination navigation',
|
|
145
|
+
getItemAriaLabel: function (_a) {
|
|
146
|
+
var page = _a.page, type = _a.type, selected = _a.selected;
|
|
147
|
+
if (type === NEXT) {
|
|
148
|
+
return 'Go to next page';
|
|
149
|
+
}
|
|
150
|
+
if (type === PREVIOUS) {
|
|
151
|
+
return 'Go to previous page';
|
|
152
|
+
}
|
|
153
|
+
if (selected) {
|
|
154
|
+
return "Page ".concat(page);
|
|
155
|
+
}
|
|
156
|
+
if (type === PAGE) {
|
|
157
|
+
return "Go to page ".concat(page);
|
|
158
|
+
}
|
|
159
|
+
return '';
|
|
160
|
+
},
|
|
161
|
+
},
|
|
95
162
|
},
|
|
96
163
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var matchPaperSizeToFormElement = {
|
|
2
|
+
'2xs': 's',
|
|
3
|
+
xs: 's',
|
|
4
|
+
s: 'l',
|
|
5
|
+
m: 'l',
|
|
6
|
+
l: 'l',
|
|
7
|
+
};
|
|
8
|
+
export var getPaperSizeToFormElement = function (size) { return matchPaperSizeToFormElement === null || matchPaperSizeToFormElement === void 0 ? void 0 : matchPaperSizeToFormElement[size]; };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ozen-ui/kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "React component library",
|
|
5
5
|
"files": [
|
|
6
6
|
"*"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"react-popper": "^2.3.0",
|
|
28
28
|
"react-transition-group": "^4.4.5",
|
|
29
29
|
"tslib": "^2.6.2",
|
|
30
|
-
"@ozen-ui/fonts": "0.
|
|
31
|
-
"@ozen-ui/icons": "0.
|
|
32
|
-
"@ozen-ui/logger": "0.
|
|
30
|
+
"@ozen-ui/fonts": "0.43.0",
|
|
31
|
+
"@ozen-ui/icons": "0.43.0",
|
|
32
|
+
"@ozen-ui/logger": "0.43.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": ">=17.0.2 <19.0.0",
|