@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
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
inline-size: 100%;
|
|
8
8
|
max-inline-size: var(--drawer-width);
|
|
9
9
|
block-size: 100%;
|
|
10
|
-
border-radius: var(--drawer-border-radius);
|
|
11
10
|
display: flex;
|
|
12
11
|
flex-direction: column;
|
|
13
12
|
box-sizing: border-box;
|
|
@@ -106,18 +105,24 @@
|
|
|
106
105
|
}
|
|
107
106
|
.Drawer_placement_right {
|
|
108
107
|
--drawer-start-position: 100%;
|
|
109
|
-
--drawer-border-radius: var(--border-radius-m) 0 0 var(--border-radius-m);
|
|
110
108
|
justify-content: flex-end;
|
|
111
109
|
}
|
|
110
|
+
.Drawer_placement_right .Modal-Window {
|
|
111
|
+
border-start-end-radius: 0;
|
|
112
|
+
border-end-end-radius: 0;
|
|
113
|
+
}
|
|
112
114
|
.Drawer_placement_left {
|
|
113
115
|
--drawer-start-position: -100%;
|
|
114
|
-
--drawer-border-radius: 0 var(--border-radius-m) var(--border-radius-m) 0;
|
|
115
116
|
justify-content: flex-start;
|
|
116
117
|
}
|
|
118
|
+
.Drawer_placement_left .Modal-Window {
|
|
119
|
+
border-start-start-radius: 0;
|
|
120
|
+
border-end-start-radius: 0;
|
|
121
|
+
}
|
|
117
122
|
.Drawer_hasCloseButton {
|
|
118
123
|
--drawer-header-item-padding-right: 24px;
|
|
119
124
|
}
|
|
120
|
-
.
|
|
125
|
+
.IconButtonNext.Drawer-CloseButton {
|
|
121
126
|
position: absolute;
|
|
122
127
|
inset-block-start: 8px;
|
|
123
128
|
inset-inline-end: 8px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './Drawer.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 cnDrawer: import("@bem-react/classname").ClassNameFormatter;
|
|
6
6
|
export declare const drawerVariant: readonly ["little", "medium", "large"];
|
|
@@ -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 { DRAWER_DEFAULT_HIDE_CLOSE_BUTTON, DRAWER_DEFAULT_PLACEMENT, DRAWER_DEFAULT_SIZE, DRAWER_DEFAULT_VARIANT, } from './constants';
|
|
10
10
|
export var cnDrawer = cn('Drawer');
|
|
@@ -20,9 +20,9 @@ export var Drawer = forwardRef(function (inProps, ref) {
|
|
|
20
20
|
props: inProps,
|
|
21
21
|
name: 'Drawer',
|
|
22
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"]);
|
|
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, windowProps = props.windowProps, transitionProps = props.transitionProps, closeButtonProps = props.closeButtonProps, other = __rest(props, ["variant", "size", "placement", "hideCloseButton", "open", "onClose", "children", "className", "windowProps", "transitionProps", "closeButtonProps"]);
|
|
24
24
|
var _e = closeButtonProps || {}, closeButtonClassName = _e.className, closeButtonRestProps = __rest(_e, ["className"]);
|
|
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 }),
|
|
25
|
+
return (React.createElement(Modal, __assign({}, other, { open: open, onClose: onClose, windowProps: __assign({ radius: size === 's' ? 'l' : 'xl' }, windowProps), className: cnDrawer({ variant: variant, size: size, placement: placement, hasCloseButton: !hideCloseButton }, [className]), transitionProps: __assign({ classNames: cnDrawer({ animation: true }) }, transitionProps), ref: ref }),
|
|
26
26
|
!hideCloseButton && (React.createElement(IconButton, __assign({ size: iconButtonSizeMapper[size], variant: "ghost", name: "close" }, closeButtonRestProps, { className: cnDrawer('CloseButton', [closeButtonClassName]), onClick: onClose, icon: CrossIcon, compressed: true }))),
|
|
27
27
|
React.createElement("div", { className: cnDrawer('InnerContainer') }, children)));
|
|
28
28
|
});
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
--textfield-input-padding: 8px 0;
|
|
18
18
|
--textfield-input-gap: var(--spacing-2xs);
|
|
19
19
|
--textfield-gutter-x: var(--control-padding-xs);
|
|
20
|
-
--textfield-border-radius: var(--border-radius-
|
|
20
|
+
--textfield-border-radius: var(--border-radius-m);
|
|
21
21
|
--textfield-input-height: var(--control-height-2xs);
|
|
22
22
|
|
|
23
23
|
font: var(--typography-text-2xs-font);
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
--textfield-input-padding: 12px 0;
|
|
31
31
|
--textfield-input-gap: var(--spacing-2xs);
|
|
32
32
|
--textfield-gutter-x: var(--control-padding-xs);
|
|
33
|
-
--textfield-border-radius: var(--border-radius-
|
|
33
|
+
--textfield-border-radius: var(--border-radius-m);
|
|
34
34
|
--textfield-input-height: var(--control-height-xs);
|
|
35
35
|
|
|
36
36
|
font: var(--typography-text-xs-font);
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
--textfield-input-padding: 14px 0;
|
|
44
44
|
--textfield-input-gap: var(--spacing-xs);
|
|
45
45
|
--textfield-gutter-x: var(--control-padding-s);
|
|
46
|
-
--textfield-border-radius: var(--border-radius-
|
|
46
|
+
--textfield-border-radius: var(--border-radius-l);
|
|
47
47
|
--textfield-input-height: var(--control-height-s);
|
|
48
48
|
|
|
49
49
|
font: var(--typography-text-s-font);
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
--textfield-input-padding: 16px 0;
|
|
57
57
|
--textfield-input-gap: var(--spacing-xs);
|
|
58
58
|
--textfield-gutter-x: var(--control-padding-m);
|
|
59
|
-
--textfield-border-radius: var(--border-radius-
|
|
59
|
+
--textfield-border-radius: var(--border-radius-l);
|
|
60
60
|
--textfield-input-height: var(--control-height-m);
|
|
61
61
|
|
|
62
62
|
font: var(--typography-text-m-font);
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
--textfield-input-padding: 18px 0;
|
|
70
70
|
--textfield-input-gap: var(--spacing-s);
|
|
71
71
|
--textfield-gutter-x: var(--control-padding-l);
|
|
72
|
-
--textfield-border-radius: var(--border-radius-
|
|
72
|
+
--textfield-border-radius: var(--border-radius-l);
|
|
73
73
|
--textfield-input-height: var(--control-height-l);
|
|
74
74
|
|
|
75
75
|
font: var(--typography-text-l-font);
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
}
|
|
108
108
|
.FieldControl_focused,
|
|
109
109
|
.FieldControl_focused:hover {
|
|
110
|
-
--textfield-border-width: var(--border-width-
|
|
110
|
+
--textfield-border-width: var(--border-width-s);
|
|
111
111
|
--textfield-border-color: var(--color-border-action);
|
|
112
112
|
--textfield-background-color: var(--color-background-main);
|
|
113
113
|
}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
font: var(--typography-text-s_1-font);
|
|
4
4
|
letter-spacing: var(--typography-text-s_1-letter_spacing, 0);
|
|
5
5
|
text-transform: var(--typography-text-s_1-text_transform, none);
|
|
6
|
-
inline-size: var(--
|
|
7
|
-
block-size: var(--
|
|
6
|
+
inline-size: var(--control-height-xs);
|
|
7
|
+
block-size: var(--control-height-xs);
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
|
-
border-radius: var(--border-radius-
|
|
11
|
+
border-radius: var(--border-radius-m);
|
|
12
12
|
overflow: hidden;
|
|
13
13
|
transition: background-color var(--transition-default);
|
|
14
14
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import './FilePicker.css';
|
|
2
|
+
import type { KeyboardEvent, MouseEvent } from 'react';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
export declare const cnFilePicker: import("@bem-react/classname").ClassNameFormatter;
|
|
4
5
|
export declare const FilePicker: React.ForwardRefExoticComponent<{
|
|
@@ -56,9 +57,10 @@ export declare const FilePicker: React.ForwardRefExoticComponent<{
|
|
|
56
57
|
error?: boolean | undefined;
|
|
57
58
|
disabled?: boolean | undefined;
|
|
58
59
|
labelProps?: import("../FieldLabel").FieldLabelProps | undefined;
|
|
60
|
+
hintProps?: Omit<import("../FieldHint").FieldHintProps, "children"> | undefined;
|
|
59
61
|
renderValue?: import("./types").FilePickerRenderValue | undefined;
|
|
60
62
|
clearText?: string | undefined;
|
|
61
|
-
onClear?: ((e:
|
|
63
|
+
onClear?: ((e: KeyboardEvent<HTMLInputElement> | MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, payload: {
|
|
62
64
|
name?: string | undefined;
|
|
63
65
|
}) => void) | undefined;
|
|
64
66
|
className?: string | undefined;
|
|
@@ -66,7 +68,7 @@ export declare const FilePicker: React.ForwardRefExoticComponent<{
|
|
|
66
68
|
} & {
|
|
67
69
|
labelRef?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
68
70
|
inputRef?: React.Ref<HTMLInputElement> | undefined;
|
|
69
|
-
} & Omit<React.HTMLAttributes<HTMLDivElement>, "name" | "label" | "className" | "id" | "onChange" | "autoFocus" | "disabled" | "accept" | "multiple" | "placeholder" | "required" | "size" | "error" | "fullWidth" | "labelProps" | "data-testid" | "hint" | "renderLeft" | "renderRight" | "inputProps" | "clearText" | "onClear" | "fileList" | "disableTruncate" | "renderValue" | keyof {
|
|
71
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "name" | "label" | "className" | "id" | "onChange" | "autoFocus" | "disabled" | "accept" | "multiple" | "placeholder" | "required" | "size" | "error" | "fullWidth" | "labelProps" | "data-testid" | "hint" | "renderLeft" | "renderRight" | "inputProps" | "hintProps" | "clearText" | "onClear" | "fileList" | "disableTruncate" | "renderValue" | keyof {
|
|
70
72
|
labelRef?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
71
73
|
inputRef?: React.Ref<HTMLInputElement> | undefined;
|
|
72
74
|
}> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign, __read, __rest } from "tslib";
|
|
2
2
|
import './FilePicker.css';
|
|
3
|
-
import React, { forwardRef,
|
|
3
|
+
import React, { forwardRef, useRef, useState } from 'react';
|
|
4
4
|
import { AttachmentIcon, CrossIcon } from '@ozen-ui/icons';
|
|
5
5
|
import { deprecate } from '@ozen-ui/logger';
|
|
6
6
|
import { useMultiRef } from '../../hooks/useMultiRef';
|
|
@@ -13,13 +13,13 @@ import { FieldIcon } from '../FieldIcon';
|
|
|
13
13
|
import { FieldLabel } from '../FieldLabel';
|
|
14
14
|
import { Fieldset } from '../Fieldset';
|
|
15
15
|
import { IconButton } from '../IconButtonNext';
|
|
16
|
-
import {
|
|
16
|
+
import { FILE_PICKER_DEFAULT_DISABLE_TRUNCATE, FILE_PICKER_DEFAULT_DISABLED, FILE_PICKER_DEFAULT_FULL_WIDTH, FILE_PICKER_DEFAULT_MULTIPLE, FILE_PICKER_DEFAULT_REQUIRED, FILE_PICKER_DEFAULT_SIZE, FILE_PICKER_DEFAULT_VALUE_RENDERER, } from './constants';
|
|
17
17
|
export var cnFilePicker = cn('FilePicker');
|
|
18
18
|
export var FilePicker = forwardRef(function (inProps, ref) {
|
|
19
19
|
var _a = useThemeProps({
|
|
20
20
|
props: inProps,
|
|
21
21
|
name: 'FilePicker',
|
|
22
|
-
}), _b = _a.size, size = _b === void 0 ? FILE_PICKER_DEFAULT_SIZE : _b, _c = _a.disabled, disabled = _c === void 0 ? FILE_PICKER_DEFAULT_DISABLED : _c, _d = _a.required, required = _d === void 0 ? FILE_PICKER_DEFAULT_REQUIRED : _d, _e = _a.fullWidth, fullWidth = _e === void 0 ? FILE_PICKER_DEFAULT_FULL_WIDTH : _e, _f = _a.disableTruncate, disableTruncate = _f === void 0 ? FILE_PICKER_DEFAULT_DISABLE_TRUNCATE : _f, _g = _a.multiple, multiple = _g === void 0 ? FILE_PICKER_DEFAULT_MULTIPLE : _g, placeholder = _a.placeholder, clearText = _a.clearText, _h = _a.renderRight, renderRight = _h === void 0 ? AttachmentIcon : _h, renderValueProp = _a.renderValue, onChangeProp = _a.onChange, onClearProp = _a.onClear, inputRef = _a.inputRef, fileList = _a.fileList, accept = _a.accept, id = _a.id, name = _a.name, label = _a.label, autoFocus = _a.autoFocus, error = _a.error, hint = _a.hint, renderLeft = _a.renderLeft, labelProps = _a.labelProps, inputProps = _a.inputProps, labelRef = _a.labelRef, className = _a.className, other = __rest(_a, ["size", "disabled", "required", "fullWidth", "disableTruncate", "multiple", "placeholder", "clearText", "renderRight", "renderValue", "onChange", "onClear", "inputRef", "fileList", "accept", "id", "name", "label", "autoFocus", "error", "hint", "renderLeft", "labelProps", "inputProps", "labelRef", "className"]);
|
|
22
|
+
}), _b = _a.size, size = _b === void 0 ? FILE_PICKER_DEFAULT_SIZE : _b, _c = _a.disabled, disabled = _c === void 0 ? FILE_PICKER_DEFAULT_DISABLED : _c, _d = _a.required, required = _d === void 0 ? FILE_PICKER_DEFAULT_REQUIRED : _d, _e = _a.fullWidth, fullWidth = _e === void 0 ? FILE_PICKER_DEFAULT_FULL_WIDTH : _e, _f = _a.disableTruncate, disableTruncate = _f === void 0 ? FILE_PICKER_DEFAULT_DISABLE_TRUNCATE : _f, _g = _a.multiple, multiple = _g === void 0 ? FILE_PICKER_DEFAULT_MULTIPLE : _g, placeholder = _a.placeholder, clearText = _a.clearText, _h = _a.renderRight, renderRight = _h === void 0 ? AttachmentIcon : _h, renderValueProp = _a.renderValue, onChangeProp = _a.onChange, onClearProp = _a.onClear, inputRef = _a.inputRef, fileList = _a.fileList, accept = _a.accept, id = _a.id, name = _a.name, label = _a.label, autoFocus = _a.autoFocus, error = _a.error, hint = _a.hint, renderLeft = _a.renderLeft, labelProps = _a.labelProps, inputProps = _a.inputProps, hintProps = _a.hintProps, labelRef = _a.labelRef, className = _a.className, other = __rest(_a, ["size", "disabled", "required", "fullWidth", "disableTruncate", "multiple", "placeholder", "clearText", "renderRight", "renderValue", "onChange", "onClear", "inputRef", "fileList", "accept", "id", "name", "label", "autoFocus", "error", "hint", "renderLeft", "labelProps", "inputProps", "hintProps", "labelRef", "className"]);
|
|
23
23
|
if (process.env.NODE_ENV !== 'production' && labelRef) {
|
|
24
24
|
deprecate('Свойство «labelRef» устарело. Для замены используйте «labelProps.ref».');
|
|
25
25
|
}
|
|
@@ -72,6 +72,6 @@ export var FilePicker = forwardRef(function (inProps, ref) {
|
|
|
72
72
|
}) })),
|
|
73
73
|
React.createElement(FieldIcon, { icon: renderRight })),
|
|
74
74
|
React.createElement(Fieldset, null)),
|
|
75
|
-
React.createElement(FieldHint,
|
|
75
|
+
React.createElement(FieldHint, __assign({}, hintProps), hint)));
|
|
76
76
|
});
|
|
77
77
|
FilePicker.displayName = 'FilePicker';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChangeEventHandler, ComponentPropsWithRef, HTMLAttributes, KeyboardEvent, MouseEvent, ReactNode, Ref } from 'react';
|
|
2
2
|
import type { ExtendableProps } from '../../types/ExtendableProps';
|
|
3
3
|
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
4
|
+
import type { FieldHintProps } from '../FieldHint';
|
|
4
5
|
import type { FieldIconProps } from '../FieldIcon';
|
|
5
6
|
import type { FieldLabelProps } from '../FieldLabel';
|
|
6
7
|
export type FilePickerSizeVariant = FormElementSizeVariant;
|
|
@@ -61,6 +62,8 @@ export type FilePickerBaseProps = {
|
|
|
61
62
|
disabled?: boolean;
|
|
62
63
|
/** Свойства FieldLabel */
|
|
63
64
|
labelProps?: FieldLabelProps;
|
|
65
|
+
/** Cвойства FieldHint */
|
|
66
|
+
hintProps?: Omit<FieldHintProps, 'children'>;
|
|
64
67
|
/** Функция */
|
|
65
68
|
renderValue?: FilePickerRenderValue;
|
|
66
69
|
/** Текст для кнопки очистки поля */
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
align-items: center;
|
|
13
13
|
justify-content: center;
|
|
14
14
|
cursor: pointer;
|
|
15
|
-
border-radius: var(--border-radius-xs);
|
|
16
15
|
border: none;
|
|
17
16
|
color: var(--icon-button-font-color);
|
|
18
17
|
background-color: var(--icon-button-bg-color);
|
|
19
18
|
opacity: 1;
|
|
19
|
+
border-radius: var(--icon-button-border-radius);
|
|
20
20
|
transition:
|
|
21
21
|
background-color var(--transition-default),
|
|
22
22
|
box-shadow var(--transition-default),
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
.IconButton_size_2xs {
|
|
29
29
|
--icon-button-size: 32px;
|
|
30
|
+
--icon-button-border-radius: var(--border-radius-m);
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
.IconButton_size_2xs.IconButton_compressed:not(.IconButton_variant_function) {
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
|
|
36
37
|
.IconButton_size_xs {
|
|
37
38
|
--icon-button-size: 40px;
|
|
39
|
+
--icon-button-border-radius: var(--border-radius-m);
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
.IconButton_size_xs.IconButton_compressed:not(.IconButton_variant_function) {
|
|
@@ -43,6 +45,7 @@
|
|
|
43
45
|
|
|
44
46
|
.IconButton_size_s {
|
|
45
47
|
--icon-button-size: 48px;
|
|
48
|
+
--icon-button-border-radius: var(--border-radius-l);
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
.IconButton_size_s.IconButton_compressed:not(.IconButton_variant_function) {
|
|
@@ -51,6 +54,7 @@
|
|
|
51
54
|
|
|
52
55
|
.IconButton_size_m {
|
|
53
56
|
--icon-button-size: 56px;
|
|
57
|
+
--icon-button-border-radius: var(--border-radius-l);
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
.IconButton_size_m.IconButton_compressed:not(.IconButton_variant_function) {
|
|
@@ -59,6 +63,7 @@
|
|
|
59
63
|
|
|
60
64
|
.IconButton_size_l {
|
|
61
65
|
--icon-button-size: 64px;
|
|
66
|
+
--icon-button-border-radius: var(--border-radius-l);
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
.IconButton_size_l.IconButton_compressed:not(.IconButton_variant_function) {
|
|
@@ -116,6 +121,7 @@
|
|
|
116
121
|
|
|
117
122
|
.IconButton_variant_function {
|
|
118
123
|
--icon-button-size: auto;
|
|
124
|
+
--icon-button-border-radius: var(--border-radius-xs);
|
|
119
125
|
}
|
|
120
126
|
|
|
121
127
|
.IconButton_variant_function:hover {
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
align-items: center;
|
|
13
13
|
justify-content: center;
|
|
14
14
|
cursor: pointer;
|
|
15
|
-
border-radius: var(--border-radius-xs);
|
|
16
15
|
border: none;
|
|
17
16
|
color: var(--icon-button-font-color);
|
|
18
17
|
background-color: var(--icon-button-bg-color);
|
|
19
18
|
opacity: 1;
|
|
19
|
+
border-radius: var(--icon-button-border-radius);
|
|
20
20
|
transition:
|
|
21
21
|
background-color var(--transition-default),
|
|
22
22
|
box-shadow var(--transition-default),
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
.IconButtonNext_size_2xs {
|
|
29
29
|
--icon-button-size: 32px;
|
|
30
|
+
--icon-button-border-radius: var(--border-radius-m);
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
.IconButtonNext_size_2xs.IconButtonNext_compressed:not(.IconButtonNext_variant_function) {
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
|
|
36
37
|
.IconButtonNext_size_xs {
|
|
37
38
|
--icon-button-size: 40px;
|
|
39
|
+
--icon-button-border-radius: var(--border-radius-m);
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
.IconButtonNext_size_xs.IconButtonNext_compressed:not(.IconButtonNext_variant_function) {
|
|
@@ -43,6 +45,7 @@
|
|
|
43
45
|
|
|
44
46
|
.IconButtonNext_size_s {
|
|
45
47
|
--icon-button-size: 48px;
|
|
48
|
+
--icon-button-border-radius: var(--border-radius-l);
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
.IconButtonNext_size_s.IconButtonNext_compressed:not(.IconButtonNext_variant_function) {
|
|
@@ -51,6 +54,7 @@
|
|
|
51
54
|
|
|
52
55
|
.IconButtonNext_size_m {
|
|
53
56
|
--icon-button-size: 56px;
|
|
57
|
+
--icon-button-border-radius: var(--border-radius-l);
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
.IconButtonNext_size_m.IconButtonNext_compressed:not(.IconButtonNext_variant_function) {
|
|
@@ -59,6 +63,7 @@
|
|
|
59
63
|
|
|
60
64
|
.IconButtonNext_size_l {
|
|
61
65
|
--icon-button-size: 64px;
|
|
66
|
+
--icon-button-border-radius: var(--border-radius-m);
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
.IconButtonNext_size_l.IconButtonNext_compressed:not(.IconButtonNext_variant_function) {
|
|
@@ -209,6 +214,7 @@
|
|
|
209
214
|
|
|
210
215
|
.IconButtonNext_variant_function {
|
|
211
216
|
--icon-button-size: auto;
|
|
217
|
+
--icon-button-border-radius: var(--border-radius-xs);
|
|
212
218
|
}
|
|
213
219
|
|
|
214
220
|
.IconButtonNext_variant_function.IconButtonNext_color_primary,
|
|
@@ -258,6 +264,7 @@
|
|
|
258
264
|
--icon-button-bg-color: var(--color-background-main);
|
|
259
265
|
--icon-button-bg-color-hover: var(--color-background-main-hover);
|
|
260
266
|
--icon-button-bg-color-active: var(--color-background-main-pressed);
|
|
267
|
+
--icon-button-bg-color-focus: var(--color-background-main);
|
|
261
268
|
--icon-button-font-color: var(--color-content-primary);
|
|
262
269
|
--icon-button-font-color-active: var(--color-content-primary);
|
|
263
270
|
--icon-button-font-color-focus: var(--color-content-primary);
|
|
@@ -325,6 +332,7 @@
|
|
|
325
332
|
.IconButtonNext:focus:not(:focus-visible, :active, :hover) {
|
|
326
333
|
box-shadow: none;
|
|
327
334
|
color: var(--icon-button-font-color);
|
|
335
|
+
background-color: var(--icon-button-bg-color);
|
|
328
336
|
}
|
|
329
337
|
|
|
330
338
|
.IconButtonNext:focus {
|
|
@@ -12,7 +12,7 @@ export type IconButtonColorVariant = (typeof iconButtonColorVariant)[number];
|
|
|
12
12
|
export type IconButtonIcon = RenderContentType<IconProps & {
|
|
13
13
|
size?: IconSize;
|
|
14
14
|
}>['content'];
|
|
15
|
-
type IconButtonBaseProps = {
|
|
15
|
+
export type IconButtonBaseProps = {
|
|
16
16
|
/** Иконка */
|
|
17
17
|
icon: IconButtonIcon;
|
|
18
18
|
/** Вариант представления компонента */
|
|
@@ -38,4 +38,3 @@ type IconButtonBaseProps = {
|
|
|
38
38
|
export type IconButtonProps<As extends ElementType = typeof ICON_BUTTON_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<IconButtonBaseProps, As>;
|
|
39
39
|
export declare const cnIconButton: import("@bem-react/classname").ClassNameFormatter;
|
|
40
40
|
export declare const IconButton: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<IconButtonBaseProps, "button">;
|
|
41
|
-
export {};
|
|
@@ -23,7 +23,7 @@ export declare const Indicator: React.ForwardRefExoticComponent<{
|
|
|
23
23
|
/** Цветовой вариант индикатор
|
|
24
24
|
* @default success
|
|
25
25
|
* */
|
|
26
|
-
variant?: "
|
|
26
|
+
variant?: "error" | "info" | "success" | "warning" | "neutral" | undefined;
|
|
27
27
|
/** Размер
|
|
28
28
|
* @default m
|
|
29
29
|
* */
|
|
@@ -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, 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"]);
|
|
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, hintProps = props.hintProps, 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", "hintProps", "maxLength", "minLength", "inputRef", "labelRef"]);
|
|
22
22
|
var bodyInnerRef = useRef(null);
|
|
23
23
|
var fieldInnerRef = useRef(null);
|
|
24
24
|
/* Хук useEventListener необходим для того, чтобы при нажатии на кнопку мыши
|
|
@@ -45,6 +45,6 @@ export var Input = forwardRef(function (inProps, ref) {
|
|
|
45
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
|
-
React.createElement(FieldHint,
|
|
48
|
+
React.createElement(FieldHint, __assign({}, hintProps), hint)));
|
|
49
49
|
});
|
|
50
50
|
Input.displayName = 'Input';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
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 { FieldIconProps } from '../FieldIcon';
|
|
5
6
|
import type { FieldLabelProps } from '../FieldLabel';
|
|
6
7
|
export declare const inputTypeVariant: readonly ["number", "date", "datetime-local", "time", "text", "tel", "password", "email"];
|
|
@@ -66,6 +67,8 @@ export type InputProps = Omit<ComponentPropsWithRef<typeof FIELD_CONTROL_DEFAULT
|
|
|
66
67
|
labelProps?: FieldLabelProps;
|
|
67
68
|
/** Cвойства Body */
|
|
68
69
|
bodyProps?: ComponentPropsWithRef<'label'>;
|
|
70
|
+
/** Cвойства FieldHint */
|
|
71
|
+
hintProps?: Omit<FieldHintProps, 'children'>;
|
|
69
72
|
/** data-атрибут для тестирования */
|
|
70
73
|
'data-testid'?: string;
|
|
71
74
|
} & InputPropsDeprecated;
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
row-gap: var(--input-number-button-gap);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.
|
|
98
|
-
.
|
|
97
|
+
.IconButtonNext.InputNumber-Increment,
|
|
98
|
+
.IconButtonNext.InputNumber-Decrement {
|
|
99
99
|
inline-size: var(--input-number-button-inline-size);
|
|
100
100
|
block-size: var(--input-number-button-block-size);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
.
|
|
103
|
+
.IconButtonNext.InputNumber-Increment *, .IconButtonNext.InputNumber-Decrement * {
|
|
104
104
|
pointer-events: none;
|
|
105
105
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign, __read, __rest } from "tslib";
|
|
2
2
|
import './InputNumber.css';
|
|
3
|
-
import React, {
|
|
4
|
-
import {
|
|
3
|
+
import React, { forwardRef, useRef, useState } from 'react';
|
|
4
|
+
import { SortDownIcon, SortUpIcon } from '@ozen-ui/icons';
|
|
5
5
|
import { useBoolean } from '../../hooks/useBoolean';
|
|
6
6
|
import { useControlled } from '../../hooks/useControlled';
|
|
7
7
|
import { useEventListener } from '../../hooks/useEventListener';
|
|
@@ -15,8 +15,8 @@ import { FieldIcon } from '../FieldIcon';
|
|
|
15
15
|
import { FieldInput } from '../FieldInput';
|
|
16
16
|
import { FieldLabel } from '../FieldLabel';
|
|
17
17
|
import { Fieldset } from '../Fieldset';
|
|
18
|
-
import { IconButton } from '../
|
|
19
|
-
import {
|
|
18
|
+
import { IconButton } from '../IconButtonNext';
|
|
19
|
+
import { INPUT_NUMBER_DEFAULT_AUTO_FOCUS, INPUT_NUMBER_DEFAULT_DISABLED, INPUT_NUMBER_DEFAULT_ERROR, INPUT_NUMBER_DEFAULT_FULL_WIDTH, INPUT_NUMBER_DEFAULT_MAX, INPUT_NUMBER_DEFAULT_MIN, INPUT_NUMBER_DEFAULT_REQUIRED, INPUT_NUMBER_DEFAULT_SIZE, INPUT_NUMBER_DEFAULT_STEP, INPUT_NUMBER_DEFAULT_VALUE, } from './constants';
|
|
20
20
|
import { getValue, isInputInvalid, isValidValue } from './utils';
|
|
21
21
|
export var cnInputNumber = cn('InputNumber');
|
|
22
22
|
export var InputNumber = forwardRef(function (inProps, ref) {
|
|
@@ -24,7 +24,7 @@ export var InputNumber = forwardRef(function (inProps, ref) {
|
|
|
24
24
|
props: inProps,
|
|
25
25
|
name: 'InputNumber',
|
|
26
26
|
});
|
|
27
|
-
var _a = props.size, size = _a === void 0 ? INPUT_NUMBER_DEFAULT_SIZE : _a, _b = props.step, step = _b === void 0 ? INPUT_NUMBER_DEFAULT_STEP : _b, _c = props.autoFocus, autoFocus = _c === void 0 ? INPUT_NUMBER_DEFAULT_AUTO_FOCUS : _c, _d = props.error, error = _d === void 0 ? INPUT_NUMBER_DEFAULT_ERROR : _d, _e = props.required, required = _e === void 0 ? INPUT_NUMBER_DEFAULT_REQUIRED : _e, _f = props.disabled, disabled = _f === void 0 ? INPUT_NUMBER_DEFAULT_DISABLED : _f, _g = props.fullWidth, fullWidth = _g === void 0 ? INPUT_NUMBER_DEFAULT_FULL_WIDTH : _g, _h = props.defaultValue, defaultValue = _h === void 0 ? INPUT_NUMBER_DEFAULT_VALUE : _h, _j = props.min, min = _j === void 0 ? INPUT_NUMBER_DEFAULT_MIN : _j, _k = props.max, max = _k === void 0 ? INPUT_NUMBER_DEFAULT_MAX : _k, label = props.label, placeholder = props.placeholder, id = props.id, name = props.name, renderLeft = props.renderLeft, renderRight = props.renderRight, hint = props.hint, className = props.className, inputProps = props.inputProps, valueProp = props.value, onChange = props.onChange, labelRef = props.labelRef, labelProps = props.labelProps, bodyProps = props.bodyProps, incrementButtonText = props.incrementButtonText, decrementButtonText = props.decrementButtonText, other = __rest(props, ["size", "step", "autoFocus", "error", "required", "disabled", "fullWidth", "defaultValue", "min", "max", "label", "placeholder", "id", "name", "renderLeft", "renderRight", "hint", "className", "inputProps", "value", "onChange", "labelRef", "labelProps", "bodyProps", "incrementButtonText", "decrementButtonText"]);
|
|
27
|
+
var _a = props.size, size = _a === void 0 ? INPUT_NUMBER_DEFAULT_SIZE : _a, _b = props.step, step = _b === void 0 ? INPUT_NUMBER_DEFAULT_STEP : _b, _c = props.autoFocus, autoFocus = _c === void 0 ? INPUT_NUMBER_DEFAULT_AUTO_FOCUS : _c, _d = props.error, error = _d === void 0 ? INPUT_NUMBER_DEFAULT_ERROR : _d, _e = props.required, required = _e === void 0 ? INPUT_NUMBER_DEFAULT_REQUIRED : _e, _f = props.disabled, disabled = _f === void 0 ? INPUT_NUMBER_DEFAULT_DISABLED : _f, _g = props.fullWidth, fullWidth = _g === void 0 ? INPUT_NUMBER_DEFAULT_FULL_WIDTH : _g, _h = props.defaultValue, defaultValue = _h === void 0 ? INPUT_NUMBER_DEFAULT_VALUE : _h, _j = props.min, min = _j === void 0 ? INPUT_NUMBER_DEFAULT_MIN : _j, _k = props.max, max = _k === void 0 ? INPUT_NUMBER_DEFAULT_MAX : _k, label = props.label, placeholder = props.placeholder, id = props.id, name = props.name, renderLeft = props.renderLeft, renderRight = props.renderRight, hint = props.hint, className = props.className, inputProps = props.inputProps, valueProp = props.value, onChange = props.onChange, labelRef = props.labelRef, labelProps = props.labelProps, bodyProps = props.bodyProps, hintProps = props.hintProps, incrementButtonText = props.incrementButtonText, decrementButtonText = props.decrementButtonText, other = __rest(props, ["size", "step", "autoFocus", "error", "required", "disabled", "fullWidth", "defaultValue", "min", "max", "label", "placeholder", "id", "name", "renderLeft", "renderRight", "hint", "className", "inputProps", "value", "onChange", "labelRef", "labelProps", "bodyProps", "hintProps", "incrementButtonText", "decrementButtonText"]);
|
|
28
28
|
var _l = __read(useBoolean(false), 2), focused = _l[0], _m = _l[1], onFocus = _m.on, offFocus = _m.off;
|
|
29
29
|
var _o = __read(useState(null), 2), timeoutId = _o[0], setTimeoutId = _o[1];
|
|
30
30
|
var _p = __read(useState(null), 2), countDirection = _p[0], setCountDirection = _p[1];
|
|
@@ -137,6 +137,6 @@ export var InputNumber = forwardRef(function (inProps, ref) {
|
|
|
137
137
|
React.createElement(IconButton, { size: size, type: "button", tabIndex: -1, variant: "ghost", icon: SortUpIcon, disabled: disabled, "aria-label": incrementButtonText, className: cnInputNumber('Increment'), onMouseDown: handleMouseDown('increment') }),
|
|
138
138
|
React.createElement(IconButton, { size: size, tabIndex: -1, type: "button", variant: "ghost", icon: SortDownIcon, disabled: disabled, "aria-label": decrementButtonText, className: cnInputNumber('Decrement'), onMouseDown: handleMouseDown('decrement') })),
|
|
139
139
|
React.createElement(Fieldset, { className: cnInputNumber('Fieldset') })),
|
|
140
|
-
React.createElement(FieldHint,
|
|
140
|
+
React.createElement(FieldHint, __assign({}, hintProps), hint)));
|
|
141
141
|
});
|
|
142
142
|
InputNumber.displayName = 'InputNumber';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChangeEvent, ComponentPropsWithRef, HTMLAttributes, MouseEvent, 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
|
type InputNumberPropsDeprecated = {
|
|
@@ -59,6 +60,8 @@ export type InputNumberProps = {
|
|
|
59
60
|
labelProps?: FieldLabelProps;
|
|
60
61
|
/** Cвойства Body */
|
|
61
62
|
bodyProps?: ComponentPropsWithRef<'label'>;
|
|
63
|
+
/** Cвойства FieldHint */
|
|
64
|
+
hintProps?: Omit<FieldHintProps, 'children'>;
|
|
62
65
|
/** Шаг инкремента/декремента */
|
|
63
66
|
step?: number;
|
|
64
67
|
/** Минимально допустимое значение */
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
.List {
|
|
2
|
-
--list-item-color: var(--color-content-primary);
|
|
3
|
-
--list-item-border-radius: var(--border-radius-xs);
|
|
4
2
|
--list-item-bg-color: transparent;
|
|
3
|
+
--list-item-color: var(--color-content-primary);
|
|
4
|
+
--list-pipka-bg-color: var(--color-content-action);
|
|
5
|
+
--list-item-bg-color-disabled: var(--color-content-tertiary);
|
|
5
6
|
--list-item-bg-color-hover: var(--color-background-main-hover);
|
|
6
7
|
--list-item-bg-color-active: var(--color-background-main-pressed);
|
|
7
|
-
--list-item-bg-color-disabled: var(--color-content-tertiary);
|
|
8
|
-
--list-pipka-bg-color: var(--color-content-action);
|
|
9
8
|
--list-pipka-border-radius: 0 var(--border-radius-xs) var(--border-radius-xs)
|
|
10
9
|
0;
|
|
11
10
|
display: flex;
|
|
@@ -30,57 +29,62 @@
|
|
|
30
29
|
|
|
31
30
|
.List_size_2xs {
|
|
32
31
|
--list-gutter: var(--spacing-3xs);
|
|
33
|
-
--list-item-min-height:
|
|
32
|
+
--list-item-min-height: var(--control-height-2xs);
|
|
34
33
|
--list-item-icon-min-width: 16px;
|
|
35
34
|
--list-item-avatar-min-width: 16px;
|
|
36
35
|
--list-item-padding: 0 8px;
|
|
37
36
|
--list-item-children-margin-right: 8px;
|
|
38
37
|
--list-pipka-height: 32px;
|
|
39
38
|
--list-pipka-width: 4px;
|
|
39
|
+
--list-item-border-radius: var(--border-radius-m);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.List_size_xs {
|
|
43
43
|
--list-gutter: var(--spacing-3xs);
|
|
44
|
-
--list-item-min-height:
|
|
44
|
+
--list-item-min-height: var(--control-height-xs);
|
|
45
45
|
--list-item-icon-min-width: 16px;
|
|
46
46
|
--list-item-avatar-min-width: 24px;
|
|
47
47
|
--list-item-padding: 4px 8px;
|
|
48
48
|
--list-item-children-margin-right: 8px;
|
|
49
49
|
--list-pipka-height: 40px;
|
|
50
50
|
--list-pipka-width: 4px;
|
|
51
|
+
--list-item-border-radius: var(--border-radius-m);
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
.List_size_s {
|
|
54
55
|
--list-gutter: var(--spacing-3xs);
|
|
55
|
-
--list-item-min-height:
|
|
56
|
+
--list-item-min-height: var(--control-height-s);
|
|
56
57
|
--list-item-icon-min-width: 16px;
|
|
57
58
|
--list-item-avatar-min-width: 32px;
|
|
58
59
|
--list-item-padding: 6px 12px;
|
|
59
60
|
--list-item-children-margin-right: 12px;
|
|
60
61
|
--list-pipka-height: 40px;
|
|
61
62
|
--list-pipka-width: 4px;
|
|
63
|
+
--list-item-border-radius: var(--border-radius-l);
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
.List_size_m {
|
|
65
67
|
--list-gutter: var(--spacing-2xs);
|
|
66
|
-
--list-item-min-height:
|
|
68
|
+
--list-item-min-height: var(--control-height-m);
|
|
67
69
|
--list-item-icon-min-width: 24px;
|
|
68
70
|
--list-item-avatar-min-width: 40px;
|
|
69
71
|
--list-item-padding: 8px 12px;
|
|
70
72
|
--list-item-children-margin-right: 12px;
|
|
71
73
|
--list-pipka-height: 48px;
|
|
72
74
|
--list-pipka-width: 4px;
|
|
75
|
+
--list-item-border-radius: var(--border-radius-l);
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
.List_size_l {
|
|
76
79
|
--list-gutter: var(--spacing-2xs);
|
|
77
|
-
--list-item-min-height:
|
|
80
|
+
--list-item-min-height: var(--control-height-l);
|
|
78
81
|
--list-item-icon-min-width: 24px;
|
|
79
82
|
--list-item-avatar-min-width: 48px;
|
|
80
83
|
--list-item-padding: 8px 16px;
|
|
81
84
|
--list-item-children-margin-right: 16px;
|
|
82
85
|
--list-pipka-height: 48px;
|
|
83
86
|
--list-pipka-width: 4px;
|
|
87
|
+
--list-item-border-radius: var(--border-radius-l);
|
|
84
88
|
}
|
|
85
89
|
|
|
86
90
|
.List_disablePadding,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './Menu.css';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { RefObject, ComponentPropsWithRef } from 'react';
|
|
4
|
+
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
4
5
|
import { type PopoverBaseProps } from '../Popover';
|
|
5
6
|
import type { PORTAL_DEFAULT_TAG } from '../Portal';
|
|
6
7
|
import { type MenuListProps } from './components';
|
|
@@ -8,6 +9,12 @@ export declare const cnMenu: import("@bem-react/classname").ClassNameFormatter;
|
|
|
8
9
|
export type MenuProps = {
|
|
9
10
|
/** Свойства компонента MenuList */
|
|
10
11
|
menuListProps?: Omit<MenuListProps, 'children'>;
|
|
12
|
+
/**
|
|
13
|
+
* Ссылка на компонент MenuList
|
|
14
|
+
* @deprecated Используйте menuListProps.ref
|
|
15
|
+
* */
|
|
11
16
|
menuListRef?: RefObject<HTMLDivElement>;
|
|
17
|
+
/** Размер компонента */
|
|
18
|
+
size?: FormElementSizeVariant;
|
|
12
19
|
} & Omit<PopoverBaseProps, 'disableEnforceFocus'> & ComponentPropsWithRef<typeof PORTAL_DEFAULT_TAG>;
|
|
13
20
|
export declare const Menu: React.ForwardRefExoticComponent<Omit<MenuProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|