@ozen-ui/kit 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__inner__/cjs/components/Button/Button.css +14 -12
- package/__inner__/cjs/components/Card/Card.js +1 -1
- package/__inner__/cjs/components/IconButton/IconButton.d.ts +5 -5
- package/__inner__/cjs/components/IconButton/IconButton.js +14 -6
- package/__inner__/cjs/components/Indicator/Indicator.css +1 -0
- package/__inner__/cjs/components/List/List.css +6 -1
- package/__inner__/cjs/components/List/components/ListItem/ListItem.css +1 -1
- package/__inner__/cjs/components/List/components/ListItemButton/ListItemButton.css +11 -11
- package/__inner__/cjs/components/List/components/ListItemButton/ListItemButton.d.ts +3 -0
- package/__inner__/cjs/components/List/components/ListItemButton/ListItemButton.js +2 -1
- package/__inner__/cjs/components/Menu/components/MenuItem/MenuItem.d.ts +0 -2
- package/__inner__/cjs/components/Menu/components/MenuItem/MenuItem.js +1 -1
- package/__inner__/cjs/components/ThemeProvider/_control/Theme_control_ozenDefault.css +16 -0
- package/__inner__/cjs/components/ThemeProvider/_spacing/Theme_spacing_ozenDefault.css +13 -0
- package/__inner__/cjs/components/ThemeProvider/themes/helper.d.ts +2 -0
- package/__inner__/cjs/components/ThemeProvider/themes/helper.js +30 -1
- package/__inner__/cjs/components/ThemeProvider/themes/themeBBusinessDefault.d.ts +2 -0
- package/__inner__/cjs/components/ThemeProvider/themes/themeBBusinessDefault.js +4 -0
- package/__inner__/cjs/components/ThemeProvider/themes/themeOzenDark.d.ts +2 -0
- package/__inner__/cjs/components/ThemeProvider/themes/themeOzenDark.js +4 -0
- package/__inner__/cjs/components/ThemeProvider/themes/themeOzenDefault.d.ts +2 -0
- package/__inner__/cjs/components/ThemeProvider/themes/themeOzenDefault.js +4 -0
- package/__inner__/cjs/components/ThemeProvider/types.d.ts +2 -0
- package/__inner__/cjs/hooks/useBoolean/useBoolean.d.ts +2 -3
- package/__inner__/cjs/hooks/useThemeVars/useThemeVars.d.ts +1 -1
- package/__inner__/esm/components/Button/Button.css +14 -12
- package/__inner__/esm/components/Card/Card.js +1 -1
- package/__inner__/esm/components/IconButton/IconButton.d.ts +5 -5
- package/__inner__/esm/components/IconButton/IconButton.js +14 -6
- package/__inner__/esm/components/Indicator/Indicator.css +1 -0
- package/__inner__/esm/components/List/List.css +6 -1
- package/__inner__/esm/components/List/components/ListItem/ListItem.css +1 -1
- package/__inner__/esm/components/List/components/ListItemButton/ListItemButton.css +11 -11
- package/__inner__/esm/components/List/components/ListItemButton/ListItemButton.d.ts +3 -0
- package/__inner__/esm/components/List/components/ListItemButton/ListItemButton.js +2 -1
- package/__inner__/esm/components/Menu/components/MenuItem/MenuItem.d.ts +0 -2
- package/__inner__/esm/components/Menu/components/MenuItem/MenuItem.js +2 -2
- package/__inner__/esm/components/ThemeProvider/_control/Theme_control_ozenDefault.css +16 -0
- package/__inner__/esm/components/ThemeProvider/_spacing/Theme_spacing_ozenDefault.css +13 -0
- package/__inner__/esm/components/ThemeProvider/themes/helper.d.ts +2 -0
- package/__inner__/esm/components/ThemeProvider/themes/helper.js +29 -0
- package/__inner__/esm/components/ThemeProvider/themes/themeBBusinessDefault.d.ts +2 -0
- package/__inner__/esm/components/ThemeProvider/themes/themeBBusinessDefault.js +4 -0
- package/__inner__/esm/components/ThemeProvider/themes/themeOzenDark.d.ts +2 -0
- package/__inner__/esm/components/ThemeProvider/themes/themeOzenDark.js +4 -0
- package/__inner__/esm/components/ThemeProvider/themes/themeOzenDefault.d.ts +2 -0
- package/__inner__/esm/components/ThemeProvider/themes/themeOzenDefault.js +4 -0
- package/__inner__/esm/components/ThemeProvider/types.d.ts +2 -0
- package/__inner__/esm/hooks/useBoolean/useBoolean.d.ts +2 -3
- package/__inner__/esm/hooks/useThemeVars/useThemeVars.d.ts +1 -1
- package/package.json +1 -1
|
@@ -14,16 +14,18 @@
|
|
|
14
14
|
padding: 0 var(--button-padding-x);
|
|
15
15
|
background-color: var(--button-bg-color);
|
|
16
16
|
border-radius: var(--border-radius-xs);
|
|
17
|
-
transition:
|
|
18
|
-
|
|
17
|
+
transition:
|
|
18
|
+
background-color var(--transition-default),
|
|
19
|
+
border-color var(--transition-default),
|
|
20
|
+
box-shadow var(--transition-default),
|
|
19
21
|
opacity var(--transition-default);
|
|
20
22
|
-webkit-tap-highlight-color: unset;
|
|
21
23
|
position: relative;
|
|
22
24
|
}
|
|
23
25
|
.Button_size_2xs {
|
|
24
|
-
--button-height:
|
|
26
|
+
--button-height: var(--control-height-2xs);
|
|
27
|
+
--button-padding-x: var(--control-padding-xs);
|
|
25
28
|
--button-min-width: 56px;
|
|
26
|
-
--button-padding-x: 12px;
|
|
27
29
|
|
|
28
30
|
font: var(--typography-text-2xs-font);
|
|
29
31
|
|
|
@@ -32,9 +34,9 @@
|
|
|
32
34
|
text-transform: var(--typography-text-2xs-text_transform, none);
|
|
33
35
|
}
|
|
34
36
|
.Button_size_xs {
|
|
35
|
-
--button-height:
|
|
37
|
+
--button-height: var(--control-height-xs);
|
|
38
|
+
--button-padding-x: var(--control-padding-xs);
|
|
36
39
|
--button-min-width: 64px;
|
|
37
|
-
--button-padding-x: 12px;
|
|
38
40
|
|
|
39
41
|
font: var(--typography-text-xs-font);
|
|
40
42
|
|
|
@@ -43,9 +45,9 @@
|
|
|
43
45
|
text-transform: var(--typography-text-xs-text_transform, none);
|
|
44
46
|
}
|
|
45
47
|
.Button_size_s {
|
|
46
|
-
--button-height:
|
|
48
|
+
--button-height: var(--control-height-s);
|
|
49
|
+
--button-padding-x: var(--control-padding-s);
|
|
47
50
|
--button-min-width: 72px;
|
|
48
|
-
--button-padding-x: 16px;
|
|
49
51
|
|
|
50
52
|
font: var(--typography-text-s-font);
|
|
51
53
|
|
|
@@ -54,9 +56,9 @@
|
|
|
54
56
|
text-transform: var(--typography-text-s-text_transform, none);
|
|
55
57
|
}
|
|
56
58
|
.Button_size_m {
|
|
57
|
-
--button-height:
|
|
59
|
+
--button-height: var(--control-height-m);
|
|
60
|
+
--button-padding-x: var(--control-padding-m);
|
|
58
61
|
--button-min-width: 80px;
|
|
59
|
-
--button-padding-x: 20px;
|
|
60
62
|
|
|
61
63
|
font: var(--typography-text-m-font);
|
|
62
64
|
|
|
@@ -65,9 +67,9 @@
|
|
|
65
67
|
text-transform: var(--typography-text-m-text_transform, none);
|
|
66
68
|
}
|
|
67
69
|
.Button_size_l {
|
|
68
|
-
--button-height:
|
|
70
|
+
--button-height: var(--control-height-l);
|
|
71
|
+
--button-padding-x: var(--control-padding-l);
|
|
69
72
|
--button-min-width: 88px;
|
|
70
|
-
--button-padding-x: 24px;
|
|
71
73
|
|
|
72
74
|
font: var(--typography-text-l-font);
|
|
73
75
|
|
|
@@ -28,7 +28,7 @@ exports.Card = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(fu
|
|
|
28
28
|
var _a = props.size, size = _a === void 0 ? 'm' : _a, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.interactive, interactive = _c === void 0 ? false : _c, _d = props.borderWidth, borderWidth = _d === void 0 ? 's' : _d, _e = props.borderVariant, borderVariant = _e === void 0 ? 'solid' : _e, _f = props.borderColor, borderColor = _f === void 0 ? 'standard' : _f, _g = props.backgroundColor, backgroundColor = _g === void 0 ? 'standard' : _g, _h = props.as, Tag = _h === void 0 ? 'div' : _h, className = props.className, children = props.children, other = tslib_1.__rest(props, ["size", "disabled", "interactive", "borderWidth", "borderVariant", "borderColor", "backgroundColor", "as", "className", "children"]);
|
|
29
29
|
var shouldBeInteractive = !disabled && interactive;
|
|
30
30
|
var shouldShowBorder = borderWidth !== 'none';
|
|
31
|
-
return (react_1.default.createElement(Paper_1.Paper, tslib_1.__assign({ as: Tag, radius: matchBorderRadiusPaperToCard[size], background: matchBackgroundColorPaperToCard[backgroundColor] },
|
|
31
|
+
return (react_1.default.createElement(Paper_1.Paper, tslib_1.__assign({ as: Tag, radius: matchBorderRadiusPaperToCard[size], background: matchBackgroundColorPaperToCard[backgroundColor] }, (shouldBeInteractive && { tabIndex: 0 }), { "aria-disabled": disabled }, other, { ref: ref, className: (0, exports.cnCard)(tslib_1.__assign({ size: size, disabled: disabled, interactive: shouldBeInteractive, backgroundColor: backgroundColor, borderWidth: borderWidth }, (shouldShowBorder && {
|
|
32
32
|
borderVariant: borderVariant,
|
|
33
33
|
borderColor: borderColor,
|
|
34
34
|
})), [className]) }), children));
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import './IconButton.css';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import type { ElementType } from 'react';
|
|
4
3
|
import type { IconSize, IconProps } from '@ozen-ui/icons';
|
|
5
4
|
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
6
5
|
import type { PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphicComponentWithRef';
|
|
6
|
+
import type { RenderContentType } from '../../utils/renderContent';
|
|
7
7
|
import { ICON_BUTTON_DEFAULT_TAG } from './constants';
|
|
8
8
|
export declare const iconButtonColorVariant: readonly ["primary", "secondary"];
|
|
9
9
|
export declare const iconButtonVariant: readonly ["contained", "outlined", "ghost", "function", "floating"];
|
|
10
10
|
export type IconButtonVariant = (typeof iconButtonVariant)[number];
|
|
11
11
|
export type IconButtonColorVariant = (typeof iconButtonColorVariant)[number];
|
|
12
|
-
export type
|
|
12
|
+
export type IconButtonIcon = RenderContentType<IconProps & {
|
|
13
13
|
size?: IconSize;
|
|
14
|
-
};
|
|
14
|
+
}>['content'];
|
|
15
15
|
type IconButtonBaseProps = {
|
|
16
16
|
/** Иконка */
|
|
17
|
-
icon:
|
|
17
|
+
icon: IconButtonIcon;
|
|
18
18
|
/** Вариант представления компонента */
|
|
19
19
|
variant?: IconButtonVariant;
|
|
20
20
|
/** Размер */
|
|
@@ -31,9 +31,9 @@ type IconButtonBaseProps = {
|
|
|
31
31
|
loading?: boolean;
|
|
32
32
|
/** Дополнительные CSS-классы */
|
|
33
33
|
className?: string;
|
|
34
|
-
children?: never;
|
|
35
34
|
/** Если {true} делает компонент круглым */
|
|
36
35
|
rounded?: boolean;
|
|
36
|
+
children?: never;
|
|
37
37
|
};
|
|
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;
|
|
@@ -4,11 +4,11 @@ exports.IconButton = exports.cnIconButton = exports.iconButtonVariant = exports.
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
require("./IconButton.css");
|
|
6
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
-
var react_is_1 = require("react-is");
|
|
8
7
|
var useThemeProps_1 = require("../../hooks/useThemeProps");
|
|
9
8
|
var classname_1 = require("../../utils/classname");
|
|
10
9
|
var getIconSizeToFormElement_1 = require("../../utils/getIconSizeToFormElement");
|
|
11
10
|
var polymorphicComponentWithRef_1 = require("../../utils/polymorphicComponentWithRef");
|
|
11
|
+
var renderContent_1 = require("../../utils/renderContent");
|
|
12
12
|
var Loader_1 = require("../Loader");
|
|
13
13
|
var constants_1 = require("./constants");
|
|
14
14
|
exports.iconButtonColorVariant = ['primary', 'secondary'];
|
|
@@ -32,23 +32,31 @@ exports.IconButton = (0, polymorphicComponentWithRef_1.polymorphicComponentWithR
|
|
|
32
32
|
props: inProps,
|
|
33
33
|
name: 'IconButton',
|
|
34
34
|
});
|
|
35
|
-
var _a = props.size, size = _a === void 0 ? constants_1.ICON_BUTTON_DEFAULT_SIZE : _a, _b = props.variant, variant = _b === void 0 ? constants_1.ICON_BUTTON_DEFAULT_VARIANT : _b, _c = props.color, color = _c === void 0 ? constants_1.ICON_BUTTON_DEFAULT_COLOR : _c, _d = props.as, Tag = _d === void 0 ? constants_1.ICON_BUTTON_DEFAULT_TAG : _d, iconColor = props.iconColor, compressed = props.compressed, loading = props.loading, disabled = props.disabled, className = props.className,
|
|
36
|
-
var iconSize = (0, getIconSizeToFormElement_1.getIconSizeToFormElement)(size);
|
|
35
|
+
var _a = props.size, size = _a === void 0 ? constants_1.ICON_BUTTON_DEFAULT_SIZE : _a, _b = props.variant, variant = _b === void 0 ? constants_1.ICON_BUTTON_DEFAULT_VARIANT : _b, _c = props.color, color = _c === void 0 ? constants_1.ICON_BUTTON_DEFAULT_COLOR : _c, _d = props.as, Tag = _d === void 0 ? constants_1.ICON_BUTTON_DEFAULT_TAG : _d, iconColor = props.iconColor, compressed = props.compressed, loading = props.loading, disabled = props.disabled, className = props.className, icon = props.icon, onClick = props.onClick, rounded = props.rounded, other = tslib_1.__rest(props, ["size", "variant", "color", "as", "iconColor", "compressed", "loading", "disabled", "className", "icon", "onClick", "rounded"]);
|
|
37
36
|
var isInteractionPrevented = disabled || loading;
|
|
38
37
|
var handleClick = function (event) {
|
|
39
38
|
if (onClick && !disabled && !loading) {
|
|
40
39
|
onClick(event);
|
|
41
40
|
}
|
|
42
41
|
};
|
|
42
|
+
var renderIcon = function (content) {
|
|
43
|
+
return (0, renderContent_1.renderContent)({
|
|
44
|
+
content: content,
|
|
45
|
+
props: {
|
|
46
|
+
size: (0, getIconSizeToFormElement_1.getIconSizeToFormElement)(size),
|
|
47
|
+
color: iconColor,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
};
|
|
43
51
|
var resolvedChildren = (0, react_1.useMemo)(function () {
|
|
44
52
|
if (loading) {
|
|
45
53
|
return (react_1.default.createElement(Loader_1.Loader, { className: (0, exports.cnIconButton)('Loader'), color: "var(--color-content-disabled)", size: loaderSizeMapper[size] }));
|
|
46
54
|
}
|
|
47
|
-
if (
|
|
48
|
-
return
|
|
55
|
+
if (icon) {
|
|
56
|
+
return renderIcon(icon);
|
|
49
57
|
}
|
|
50
58
|
return null;
|
|
51
|
-
}, [loading, size, iconColor,
|
|
59
|
+
}, [loading, size, iconColor, icon, renderIcon]);
|
|
52
60
|
return (react_1.default.createElement(Tag, tslib_1.__assign({ className: (0, exports.cnIconButton)({
|
|
53
61
|
variant: variant,
|
|
54
62
|
size: size,
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
.List {
|
|
2
|
+
--list-item-color: var(--color-content-primary);
|
|
2
3
|
--list-item-border-radius: var(--border-radius-xs);
|
|
3
|
-
--list-
|
|
4
|
+
--list-item-bg-color: transparent;
|
|
5
|
+
--list-item-bg-color-hover: var(--color-background-main-hover);
|
|
6
|
+
--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);
|
|
4
9
|
--list-pipka-border-radius: 0 var(--border-radius-xs) var(--border-radius-xs)
|
|
5
10
|
0;
|
|
6
11
|
display: flex;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
min-block-size: var(--list-item-min-height);
|
|
5
5
|
padding: var(--list-item-padding);
|
|
6
6
|
border-radius: var(--list-item-border-radius);
|
|
7
|
-
color: var(--
|
|
7
|
+
color: var(--list-item-color);
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
flex-shrink: 0;
|
|
10
10
|
margin: 0 var(--list-gutter);
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
.ListItemButton {
|
|
2
2
|
inline-size: calc(100% - 2 * var(--list-gutter));
|
|
3
|
+
min-block-size: var(--list-item-min-height);
|
|
4
|
+
padding: var(--list-item-padding);
|
|
5
|
+
color: var(--list-item-color);
|
|
6
|
+
border-radius: var(--list-item-border-radius);
|
|
7
|
+
background-color: var(--list-item-bg-color);
|
|
8
|
+
margin: 0 var(--list-gutter);
|
|
9
|
+
transition: background-color var(--transition-default);
|
|
3
10
|
display: flex;
|
|
4
11
|
flex-shrink: 0;
|
|
5
12
|
align-items: center;
|
|
6
13
|
box-sizing: border-box;
|
|
7
|
-
min-block-size: var(--list-item-min-height);
|
|
8
|
-
padding: var(--list-item-padding);
|
|
9
|
-
color: var(--color-content-primary);
|
|
10
14
|
outline: none;
|
|
11
15
|
text-decoration: none;
|
|
12
|
-
border-radius: var(--list-item-border-radius);
|
|
13
|
-
transition: background-color var(--transition-default);
|
|
14
16
|
text-align: start;
|
|
15
|
-
background-color: transparent;
|
|
16
17
|
cursor: pointer;
|
|
17
18
|
overflow: hidden;
|
|
18
19
|
-webkit-tap-highlight-color: transparent;
|
|
19
|
-
margin: 0 var(--list-gutter);
|
|
20
20
|
border: none;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.ListItemButton:hover {
|
|
24
|
-
background-color: var(--
|
|
24
|
+
background-color: var(--list-item-bg-color-hover);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.ListItemButton:active {
|
|
28
|
-
background-color: var(--
|
|
28
|
+
background-color: var(--list-item-bg-color-active);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.ListItemButton:focus {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
.ListItemButton_disabled {
|
|
40
40
|
pointer-events: none;
|
|
41
|
-
color: var(--color-
|
|
41
|
+
color: var(--list-item-bg-color-disabled);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.ListItemButton_disabled .ListItemText-TextPrimary,
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
content: '';
|
|
51
51
|
inline-size: var(--list-pipka-width);
|
|
52
52
|
block-size: var(--list-pipka-height);
|
|
53
|
-
background-color: var(--list-pipka-
|
|
53
|
+
background-color: var(--list-pipka-bg-color);
|
|
54
54
|
border-radius: var(--list-pipka-border-radius);
|
|
55
55
|
position: absolute;
|
|
56
56
|
inset-inline-start: 0;
|
|
@@ -8,6 +8,9 @@ export type ListItemButtonBaseProps = {
|
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
/** Если {true} делает элемент неактивным */
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
/** Если {true} отображает элемент списка как выбранный */
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
/** Идентификатор компонента для тестов */
|
|
11
14
|
'data-testid'?: string;
|
|
12
15
|
};
|
|
13
16
|
export type ListItemButtonProps<As extends ElementType = typeof LIST_ITEM_BUTTON_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<ListItemButtonBaseProps, As>;
|
|
@@ -12,7 +12,7 @@ var constants_1 = require("../../constants");
|
|
|
12
12
|
exports.cnListItemButton = (0, classname_1.cn)('ListItemButton');
|
|
13
13
|
exports.ListItemButton = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (inProps, ref) {
|
|
14
14
|
var props = (0, useThemeProps_1.useThemeProps)({ props: inProps, name: 'ListItemButton' });
|
|
15
|
-
var _a = props.as, Tag = _a === void 0 ? constants_1.LIST_ITEM_BUTTON_DEFAULT_TAG : _a, children = props.children, disabled = props.disabled, className = props.className, onClick = props.onClick, tabIndexProp = props.tabIndex, onKeyDownProp = props.onKeyDown, other = tslib_1.__rest(props, ["as", "children", "disabled", "className", "onClick", "tabIndex", "onKeyDown"]);
|
|
15
|
+
var _a = props.as, Tag = _a === void 0 ? constants_1.LIST_ITEM_BUTTON_DEFAULT_TAG : _a, children = props.children, disabled = props.disabled, className = props.className, onClick = props.onClick, tabIndexProp = props.tabIndex, onKeyDownProp = props.onKeyDown, selected = props.selected, other = tslib_1.__rest(props, ["as", "children", "disabled", "className", "onClick", "tabIndex", "onKeyDown", "selected"]);
|
|
16
16
|
var tabIndex = (0, react_1.useMemo)(function () { return (!disabled ? 0 : -1); }, [disabled]);
|
|
17
17
|
var handleClick = function (event) {
|
|
18
18
|
if (!disabled)
|
|
@@ -44,6 +44,7 @@ exports.ListItemButton = (0, polymorphicComponentWithRef_1.polymorphicComponentW
|
|
|
44
44
|
}, [Tag, handleKeyDown]);
|
|
45
45
|
return (react_1.default.createElement(Tag, tslib_1.__assign({ className: (0, exports.cnListItemButton)({
|
|
46
46
|
disabled: disabled,
|
|
47
|
+
selected: selected,
|
|
47
48
|
}, [className]), onClick: handleClick, tabIndex: tabIndexProp || tabIndex }, additionalTagProps, other, { ref: ref }), children));
|
|
48
49
|
});
|
|
49
50
|
exports.ListItemButton.displayName = 'ListItemButton';
|
|
@@ -4,8 +4,6 @@ import { type ListItemButtonBaseProps } from '../../../List';
|
|
|
4
4
|
import { LIST_ITEM_BUTTON_DEFAULT_TAG } from '../../../List/constants';
|
|
5
5
|
export declare const cnMenuItem: import("@bem-react/classname").ClassNameFormatter;
|
|
6
6
|
export type MenuItemBaseProps = ListItemButtonBaseProps & {
|
|
7
|
-
/** Если {true} отображает элемент меню как выбранный */
|
|
8
|
-
selected?: boolean;
|
|
9
7
|
/** Используется для вычисления лейбла выбранного элемента меню в выпадающих списках */
|
|
10
8
|
label?: string;
|
|
11
9
|
/** Используется для вычисления значения выбранного элемента меню в выпадающих списках */
|
|
@@ -20,6 +20,6 @@ exports.MenuItem = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef
|
|
|
20
20
|
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
21
21
|
}
|
|
22
22
|
}, [autoFocus, disabled]);
|
|
23
|
-
return (react_1.default.createElement(List_1.ListItemButton, tslib_1.__assign({ role: "menuitem", as: Tag, disabled: disabled }, other, { ref: (0, useMultiRef_1.useMultiRef)([ref, innerRef]), className: (0,
|
|
23
|
+
return (react_1.default.createElement(List_1.ListItemButton, tslib_1.__assign({ role: "menuitem", as: Tag, disabled: disabled, selected: selected }, other, { ref: (0, useMultiRef_1.useMultiRef)([ref, innerRef]), className: (0, exports.cnMenuItem)('', [className]), "data-value": value, "data-label": label }), children));
|
|
24
24
|
});
|
|
25
25
|
exports.MenuItem.displayName = 'MenuItem';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.Theme_control_ozenDefault {
|
|
2
|
+
--control-padding-4xs: 2px;
|
|
3
|
+
--control-padding-3xs: 4px;
|
|
4
|
+
--control-padding-2xs: 8px;
|
|
5
|
+
--control-padding-xs: 12px;
|
|
6
|
+
--control-padding-s: 16px;
|
|
7
|
+
--control-padding-m: 20px;
|
|
8
|
+
--control-padding-l: 24px;
|
|
9
|
+
--control-height-4xs: 16px;
|
|
10
|
+
--control-height-3xs: 24px;
|
|
11
|
+
--control-height-2xs: 32px;
|
|
12
|
+
--control-height-xs: 40px;
|
|
13
|
+
--control-height-s: 48px;
|
|
14
|
+
--control-height-m: 56px;
|
|
15
|
+
--control-height-l: 64px;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.Theme_spacing_ozenDefault {
|
|
2
|
+
--spacing-4xs: 2px;
|
|
3
|
+
--spacing-3xs: 4px;
|
|
4
|
+
--spacing-2xs: 8px;
|
|
5
|
+
--spacing-xs: 12px;
|
|
6
|
+
--spacing-s: 16px;
|
|
7
|
+
--spacing-m: 24px;
|
|
8
|
+
--spacing-l: 32px;
|
|
9
|
+
--spacing-xl: 40px;
|
|
10
|
+
--spacing-2xl: 48px;
|
|
11
|
+
--spacing-3xl: 56px;
|
|
12
|
+
--spacing-4xl: 64px;
|
|
13
|
+
}
|
|
@@ -5,5 +5,7 @@ export declare const shadow: readonly ["--shadow-l", "--shadow-m", "--shadow-s"]
|
|
|
5
5
|
export declare const breakpoint: readonly ["--breakpoint-xs", "--breakpoint-s", "--breakpoint-m", "--breakpoint-l"];
|
|
6
6
|
export declare const zIndex: readonly ["--z-index-default", "--z-index-absolute", "--z-index-header", "--z-index-sidebar", "--z-index-modal", "--z-index-popover", "--z-index-snackbar", "--z-index-chat"];
|
|
7
7
|
export declare const space: readonly ["--space-8xl", "--space-7xl", "--space-6xl", "--space-5xl", "--space-4xl", "--space-3xl", "--space-2xl", "--space-xl", "--space-l", "--space-m", "--space-s", "--space-xs"];
|
|
8
|
+
export declare const spacing: readonly ["--spacing-4xs", "--spacing-3xs", "--spacing-2xs", "--spacing-xs", "--spacing-s", "--spacing-m", "--spacing-l", "--spacing-xl", "--spacing-2xl", "--spacing-3xl", "--spacing-4xl"];
|
|
9
|
+
export declare const control: readonly ["--control-padding-4xs", "--control-padding-3xs", "--control-padding-2xs", "--control-padding-xs", "--control-padding-s", "--control-padding-m", "--control-padding-l", "--control-height-4xs", "--control-height-3xs", "--control-height-2xs", "--control-height-xs", "--control-height-s", "--control-height-m", "--control-height-l"];
|
|
8
10
|
export declare const typography: readonly ["--typography-text-xl_1-font", "--typography-text-4xl_1-font", "--typography-text-3xl_1-font", "--typography-text-2xl_1-font", "--typography-heading-4xl-font", "--typography-text-4xl-font", "--typography-heading-3xl-font", "--typography-text-3xl-font", "--typography-heading-2xl-font", "--typography-text-2xl-font", "--typography-heading-xl-font", "--typography-text-xl-font", "--typography-text-l-font", "--typography-text-l_1-font", "--typography-text-m-font", "--typography-text-m_1-font", "--typography-text-s-font", "--typography-text-s_1-font", "--typography-text-xs-font", "--typography-text-xs_1-font", "--typography-text-2xs-font", "--typography-text-2xs_1-font", "--typography-text-3xs-font", "--typography-caption-3xs-font", "--typography-caption-3xs-text_transform", "--typography-caption-3xs-letter_spacing", "--typography-text-3xs_1-font", "--typography-caption-3xs_1-font", "--typography-caption-3xs_1-text_transform", "--typography-caption-3xs_1-letter_spacing"];
|
|
9
11
|
export declare const transition: readonly ["--transition-default", "--transition-slow"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transition = exports.typography = exports.space = exports.zIndex = exports.breakpoint = exports.shadow = exports.borderWidth = exports.borderRadius = exports.color = void 0;
|
|
3
|
+
exports.transition = exports.typography = exports.control = exports.spacing = exports.space = exports.zIndex = exports.breakpoint = exports.shadow = exports.borderWidth = exports.borderRadius = exports.color = void 0;
|
|
4
4
|
exports.color = [
|
|
5
5
|
'--color-content-primary',
|
|
6
6
|
'--color-content-secondary',
|
|
@@ -192,6 +192,35 @@ exports.space = [
|
|
|
192
192
|
'--space-s',
|
|
193
193
|
'--space-xs',
|
|
194
194
|
];
|
|
195
|
+
exports.spacing = [
|
|
196
|
+
'--spacing-4xs',
|
|
197
|
+
'--spacing-3xs',
|
|
198
|
+
'--spacing-2xs',
|
|
199
|
+
'--spacing-xs',
|
|
200
|
+
'--spacing-s',
|
|
201
|
+
'--spacing-m',
|
|
202
|
+
'--spacing-l',
|
|
203
|
+
'--spacing-xl',
|
|
204
|
+
'--spacing-2xl',
|
|
205
|
+
'--spacing-3xl',
|
|
206
|
+
'--spacing-4xl',
|
|
207
|
+
];
|
|
208
|
+
exports.control = [
|
|
209
|
+
'--control-padding-4xs',
|
|
210
|
+
'--control-padding-3xs',
|
|
211
|
+
'--control-padding-2xs',
|
|
212
|
+
'--control-padding-xs',
|
|
213
|
+
'--control-padding-s',
|
|
214
|
+
'--control-padding-m',
|
|
215
|
+
'--control-padding-l',
|
|
216
|
+
'--control-height-4xs',
|
|
217
|
+
'--control-height-3xs',
|
|
218
|
+
'--control-height-2xs',
|
|
219
|
+
'--control-height-xs',
|
|
220
|
+
'--control-height-s',
|
|
221
|
+
'--control-height-m',
|
|
222
|
+
'--control-height-l',
|
|
223
|
+
];
|
|
195
224
|
exports.typography = [
|
|
196
225
|
'--typography-text-xl_1-font',
|
|
197
226
|
'--typography-text-4xl_1-font',
|
|
@@ -4,6 +4,8 @@ import '../_color/Theme_color_bBusinessDefault.css';
|
|
|
4
4
|
import '../_typography/Theme_typography_ozenDefault.css';
|
|
5
5
|
import '../_borderRadius/Theme_borderRadius_ozenDefault.css';
|
|
6
6
|
import '../_space/Theme_space_ozenDefault.css';
|
|
7
|
+
import '../_spacing/Theme_spacing_ozenDefault.css';
|
|
8
|
+
import '../_control/Theme_control_ozenDefault.css';
|
|
7
9
|
import '../_shadow/Theme_shadow_ozenDefault.css';
|
|
8
10
|
import '../_breakpoint/Theme_breakpoint_ozenDefault.css';
|
|
9
11
|
import '../_borderWidth/Theme_borderWidth_ozenDefault.css';
|
|
@@ -6,6 +6,8 @@ require("../_color/Theme_color_bBusinessDefault.css");
|
|
|
6
6
|
require("../_typography/Theme_typography_ozenDefault.css");
|
|
7
7
|
require("../_borderRadius/Theme_borderRadius_ozenDefault.css");
|
|
8
8
|
require("../_space/Theme_space_ozenDefault.css");
|
|
9
|
+
require("../_spacing/Theme_spacing_ozenDefault.css");
|
|
10
|
+
require("../_control/Theme_control_ozenDefault.css");
|
|
9
11
|
require("../_shadow/Theme_shadow_ozenDefault.css");
|
|
10
12
|
require("../_breakpoint/Theme_breakpoint_ozenDefault.css");
|
|
11
13
|
require("../_borderWidth/Theme_borderWidth_ozenDefault.css");
|
|
@@ -15,6 +17,8 @@ exports.themeBBusinessDefault = {
|
|
|
15
17
|
tokens: {
|
|
16
18
|
color: 'bBusinessDefault',
|
|
17
19
|
space: 'ozenDefault',
|
|
20
|
+
spacing: 'ozenDefault',
|
|
21
|
+
control: 'ozenDefault',
|
|
18
22
|
typography: 'ozenDefault',
|
|
19
23
|
borderRadius: 'ozenDefault',
|
|
20
24
|
borderWidth: 'ozenDefault',
|
|
@@ -4,6 +4,8 @@ import '../_color/Theme_color_ozenDark.css';
|
|
|
4
4
|
import '../_typography/Theme_typography_ozenDefault.css';
|
|
5
5
|
import '../_borderRadius/Theme_borderRadius_ozenDefault.css';
|
|
6
6
|
import '../_space/Theme_space_ozenDefault.css';
|
|
7
|
+
import '../_spacing/Theme_spacing_ozenDefault.css';
|
|
8
|
+
import '../_control/Theme_control_ozenDefault.css';
|
|
7
9
|
import '../_shadow/Theme_shadow_ozenDefault.css';
|
|
8
10
|
import '../_breakpoint/Theme_breakpoint_ozenDefault.css';
|
|
9
11
|
import '../_borderWidth/Theme_borderWidth_ozenDefault.css';
|
|
@@ -6,6 +6,8 @@ require("../_color/Theme_color_ozenDark.css");
|
|
|
6
6
|
require("../_typography/Theme_typography_ozenDefault.css");
|
|
7
7
|
require("../_borderRadius/Theme_borderRadius_ozenDefault.css");
|
|
8
8
|
require("../_space/Theme_space_ozenDefault.css");
|
|
9
|
+
require("../_spacing/Theme_spacing_ozenDefault.css");
|
|
10
|
+
require("../_control/Theme_control_ozenDefault.css");
|
|
9
11
|
require("../_shadow/Theme_shadow_ozenDefault.css");
|
|
10
12
|
require("../_breakpoint/Theme_breakpoint_ozenDefault.css");
|
|
11
13
|
require("../_borderWidth/Theme_borderWidth_ozenDefault.css");
|
|
@@ -15,6 +17,8 @@ exports.themeOzenDark = {
|
|
|
15
17
|
tokens: {
|
|
16
18
|
color: 'ozenDark',
|
|
17
19
|
space: 'ozenDefault',
|
|
20
|
+
spacing: 'ozenDefault',
|
|
21
|
+
control: 'ozenDefault',
|
|
18
22
|
typography: 'ozenDefault',
|
|
19
23
|
borderRadius: 'ozenDefault',
|
|
20
24
|
borderWidth: 'ozenDefault',
|
|
@@ -4,6 +4,8 @@ import '../_color/Theme_color_ozenDefault.css';
|
|
|
4
4
|
import '../_typography/Theme_typography_ozenDefault.css';
|
|
5
5
|
import '../_borderRadius/Theme_borderRadius_ozenDefault.css';
|
|
6
6
|
import '../_space/Theme_space_ozenDefault.css';
|
|
7
|
+
import '../_spacing/Theme_spacing_ozenDefault.css';
|
|
8
|
+
import '../_control/Theme_control_ozenDefault.css';
|
|
7
9
|
import '../_shadow/Theme_shadow_ozenDefault.css';
|
|
8
10
|
import '../_breakpoint/Theme_breakpoint_ozenDefault.css';
|
|
9
11
|
import '../_borderWidth/Theme_borderWidth_ozenDefault.css';
|
|
@@ -6,6 +6,8 @@ require("../_color/Theme_color_ozenDefault.css");
|
|
|
6
6
|
require("../_typography/Theme_typography_ozenDefault.css");
|
|
7
7
|
require("../_borderRadius/Theme_borderRadius_ozenDefault.css");
|
|
8
8
|
require("../_space/Theme_space_ozenDefault.css");
|
|
9
|
+
require("../_spacing/Theme_spacing_ozenDefault.css");
|
|
10
|
+
require("../_control/Theme_control_ozenDefault.css");
|
|
9
11
|
require("../_shadow/Theme_shadow_ozenDefault.css");
|
|
10
12
|
require("../_breakpoint/Theme_breakpoint_ozenDefault.css");
|
|
11
13
|
require("../_borderWidth/Theme_borderWidth_ozenDefault.css");
|
|
@@ -15,6 +17,8 @@ exports.themeOzenDefault = {
|
|
|
15
17
|
tokens: {
|
|
16
18
|
color: 'ozenDefault',
|
|
17
19
|
space: 'ozenDefault',
|
|
20
|
+
spacing: 'ozenDefault',
|
|
21
|
+
control: 'ozenDefault',
|
|
18
22
|
typography: 'ozenDefault',
|
|
19
23
|
borderRadius: 'ozenDefault',
|
|
20
24
|
borderWidth: 'ozenDefault',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type UseBooleanControllers = {
|
|
1
|
+
export type UseBooleanControllers = {
|
|
2
2
|
/** Установить значение в {true} */
|
|
3
3
|
on: () => void;
|
|
4
4
|
/** Установить значение в {false} */
|
|
@@ -6,8 +6,7 @@ type UseBooleanControllers = {
|
|
|
6
6
|
/** Перевести значение в противоположное состояние */
|
|
7
7
|
toggle: () => void;
|
|
8
8
|
};
|
|
9
|
-
type UseBooleanReturnValue = [boolean, UseBooleanControllers];
|
|
9
|
+
export type UseBooleanReturnValue = [boolean, UseBooleanControllers];
|
|
10
10
|
export declare function useBoolean(
|
|
11
11
|
/** Значение по умолчанию */
|
|
12
12
|
defaultValue?: boolean): UseBooleanReturnValue;
|
|
13
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { themeHelper } from '../../components/ThemeProvider';
|
|
2
|
-
type VariablesVariant = 'color' | 'breakpoint' | 'zIndex' | 'space' | 'borderRadius' | 'borderWidth' | 'shadow' | 'typography' | 'transition';
|
|
2
|
+
type VariablesVariant = 'color' | 'breakpoint' | 'zIndex' | 'space' | 'spacing' | 'control' | 'borderRadius' | 'borderWidth' | 'shadow' | 'typography' | 'transition';
|
|
3
3
|
export type ThemeVariables = {
|
|
4
4
|
[P in VariablesVariant]: {
|
|
5
5
|
[key in (typeof themeHelper)[P][number]]: string;
|
|
@@ -14,16 +14,18 @@
|
|
|
14
14
|
padding: 0 var(--button-padding-x);
|
|
15
15
|
background-color: var(--button-bg-color);
|
|
16
16
|
border-radius: var(--border-radius-xs);
|
|
17
|
-
transition:
|
|
18
|
-
|
|
17
|
+
transition:
|
|
18
|
+
background-color var(--transition-default),
|
|
19
|
+
border-color var(--transition-default),
|
|
20
|
+
box-shadow var(--transition-default),
|
|
19
21
|
opacity var(--transition-default);
|
|
20
22
|
-webkit-tap-highlight-color: unset;
|
|
21
23
|
position: relative;
|
|
22
24
|
}
|
|
23
25
|
.Button_size_2xs {
|
|
24
|
-
--button-height:
|
|
26
|
+
--button-height: var(--control-height-2xs);
|
|
27
|
+
--button-padding-x: var(--control-padding-xs);
|
|
25
28
|
--button-min-width: 56px;
|
|
26
|
-
--button-padding-x: 12px;
|
|
27
29
|
|
|
28
30
|
font: var(--typography-text-2xs-font);
|
|
29
31
|
|
|
@@ -32,9 +34,9 @@
|
|
|
32
34
|
text-transform: var(--typography-text-2xs-text_transform, none);
|
|
33
35
|
}
|
|
34
36
|
.Button_size_xs {
|
|
35
|
-
--button-height:
|
|
37
|
+
--button-height: var(--control-height-xs);
|
|
38
|
+
--button-padding-x: var(--control-padding-xs);
|
|
36
39
|
--button-min-width: 64px;
|
|
37
|
-
--button-padding-x: 12px;
|
|
38
40
|
|
|
39
41
|
font: var(--typography-text-xs-font);
|
|
40
42
|
|
|
@@ -43,9 +45,9 @@
|
|
|
43
45
|
text-transform: var(--typography-text-xs-text_transform, none);
|
|
44
46
|
}
|
|
45
47
|
.Button_size_s {
|
|
46
|
-
--button-height:
|
|
48
|
+
--button-height: var(--control-height-s);
|
|
49
|
+
--button-padding-x: var(--control-padding-s);
|
|
47
50
|
--button-min-width: 72px;
|
|
48
|
-
--button-padding-x: 16px;
|
|
49
51
|
|
|
50
52
|
font: var(--typography-text-s-font);
|
|
51
53
|
|
|
@@ -54,9 +56,9 @@
|
|
|
54
56
|
text-transform: var(--typography-text-s-text_transform, none);
|
|
55
57
|
}
|
|
56
58
|
.Button_size_m {
|
|
57
|
-
--button-height:
|
|
59
|
+
--button-height: var(--control-height-m);
|
|
60
|
+
--button-padding-x: var(--control-padding-m);
|
|
58
61
|
--button-min-width: 80px;
|
|
59
|
-
--button-padding-x: 20px;
|
|
60
62
|
|
|
61
63
|
font: var(--typography-text-m-font);
|
|
62
64
|
|
|
@@ -65,9 +67,9 @@
|
|
|
65
67
|
text-transform: var(--typography-text-m-text_transform, none);
|
|
66
68
|
}
|
|
67
69
|
.Button_size_l {
|
|
68
|
-
--button-height:
|
|
70
|
+
--button-height: var(--control-height-l);
|
|
71
|
+
--button-padding-x: var(--control-padding-l);
|
|
69
72
|
--button-min-width: 88px;
|
|
70
|
-
--button-padding-x: 24px;
|
|
71
73
|
|
|
72
74
|
font: var(--typography-text-l-font);
|
|
73
75
|
|
|
@@ -25,7 +25,7 @@ export var Card = polymorphicComponentWithRef(function (inProps, ref) {
|
|
|
25
25
|
var _a = props.size, size = _a === void 0 ? 'm' : _a, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.interactive, interactive = _c === void 0 ? false : _c, _d = props.borderWidth, borderWidth = _d === void 0 ? 's' : _d, _e = props.borderVariant, borderVariant = _e === void 0 ? 'solid' : _e, _f = props.borderColor, borderColor = _f === void 0 ? 'standard' : _f, _g = props.backgroundColor, backgroundColor = _g === void 0 ? 'standard' : _g, _h = props.as, Tag = _h === void 0 ? 'div' : _h, className = props.className, children = props.children, other = __rest(props, ["size", "disabled", "interactive", "borderWidth", "borderVariant", "borderColor", "backgroundColor", "as", "className", "children"]);
|
|
26
26
|
var shouldBeInteractive = !disabled && interactive;
|
|
27
27
|
var shouldShowBorder = borderWidth !== 'none';
|
|
28
|
-
return (React.createElement(Paper, __assign({ as: Tag, radius: matchBorderRadiusPaperToCard[size], background: matchBackgroundColorPaperToCard[backgroundColor] },
|
|
28
|
+
return (React.createElement(Paper, __assign({ as: Tag, radius: matchBorderRadiusPaperToCard[size], background: matchBackgroundColorPaperToCard[backgroundColor] }, (shouldBeInteractive && { tabIndex: 0 }), { "aria-disabled": disabled }, other, { ref: ref, className: cnCard(__assign({ size: size, disabled: disabled, interactive: shouldBeInteractive, backgroundColor: backgroundColor, borderWidth: borderWidth }, (shouldShowBorder && {
|
|
29
29
|
borderVariant: borderVariant,
|
|
30
30
|
borderColor: borderColor,
|
|
31
31
|
})), [className]) }), children));
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import './IconButton.css';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import type { ElementType } from 'react';
|
|
4
3
|
import type { IconSize, IconProps } from '@ozen-ui/icons';
|
|
5
4
|
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
6
5
|
import type { PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphicComponentWithRef';
|
|
6
|
+
import type { RenderContentType } from '../../utils/renderContent';
|
|
7
7
|
import { ICON_BUTTON_DEFAULT_TAG } from './constants';
|
|
8
8
|
export declare const iconButtonColorVariant: readonly ["primary", "secondary"];
|
|
9
9
|
export declare const iconButtonVariant: readonly ["contained", "outlined", "ghost", "function", "floating"];
|
|
10
10
|
export type IconButtonVariant = (typeof iconButtonVariant)[number];
|
|
11
11
|
export type IconButtonColorVariant = (typeof iconButtonColorVariant)[number];
|
|
12
|
-
export type
|
|
12
|
+
export type IconButtonIcon = RenderContentType<IconProps & {
|
|
13
13
|
size?: IconSize;
|
|
14
|
-
};
|
|
14
|
+
}>['content'];
|
|
15
15
|
type IconButtonBaseProps = {
|
|
16
16
|
/** Иконка */
|
|
17
|
-
icon:
|
|
17
|
+
icon: IconButtonIcon;
|
|
18
18
|
/** Вариант представления компонента */
|
|
19
19
|
variant?: IconButtonVariant;
|
|
20
20
|
/** Размер */
|
|
@@ -31,9 +31,9 @@ type IconButtonBaseProps = {
|
|
|
31
31
|
loading?: boolean;
|
|
32
32
|
/** Дополнительные CSS-классы */
|
|
33
33
|
className?: string;
|
|
34
|
-
children?: never;
|
|
35
34
|
/** Если {true} делает компонент круглым */
|
|
36
35
|
rounded?: boolean;
|
|
36
|
+
children?: never;
|
|
37
37
|
};
|
|
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;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
2
|
import './IconButton.css';
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
|
-
import { isValidElementType } from 'react-is';
|
|
5
4
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
6
5
|
import { cn } from '../../utils/classname';
|
|
7
6
|
import { getIconSizeToFormElement } from '../../utils/getIconSizeToFormElement';
|
|
8
7
|
import { polymorphicComponentWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
8
|
+
import { renderContent } from '../../utils/renderContent';
|
|
9
9
|
import { Loader } from '../Loader';
|
|
10
10
|
import { ICON_BUTTON_DEFAULT_SIZE, ICON_BUTTON_DEFAULT_VARIANT, ICON_BUTTON_DEFAULT_COLOR, ICON_BUTTON_DEFAULT_TAG, } from './constants';
|
|
11
11
|
export var iconButtonColorVariant = ['primary', 'secondary'];
|
|
@@ -29,23 +29,31 @@ export var IconButton = polymorphicComponentWithRef(function (inProps, ref) {
|
|
|
29
29
|
props: inProps,
|
|
30
30
|
name: 'IconButton',
|
|
31
31
|
});
|
|
32
|
-
var _a = props.size, size = _a === void 0 ? ICON_BUTTON_DEFAULT_SIZE : _a, _b = props.variant, variant = _b === void 0 ? ICON_BUTTON_DEFAULT_VARIANT : _b, _c = props.color, color = _c === void 0 ? ICON_BUTTON_DEFAULT_COLOR : _c, _d = props.as, Tag = _d === void 0 ? ICON_BUTTON_DEFAULT_TAG : _d, iconColor = props.iconColor, compressed = props.compressed, loading = props.loading, disabled = props.disabled, className = props.className,
|
|
33
|
-
var iconSize = getIconSizeToFormElement(size);
|
|
32
|
+
var _a = props.size, size = _a === void 0 ? ICON_BUTTON_DEFAULT_SIZE : _a, _b = props.variant, variant = _b === void 0 ? ICON_BUTTON_DEFAULT_VARIANT : _b, _c = props.color, color = _c === void 0 ? ICON_BUTTON_DEFAULT_COLOR : _c, _d = props.as, Tag = _d === void 0 ? ICON_BUTTON_DEFAULT_TAG : _d, iconColor = props.iconColor, compressed = props.compressed, loading = props.loading, disabled = props.disabled, className = props.className, icon = props.icon, onClick = props.onClick, rounded = props.rounded, other = __rest(props, ["size", "variant", "color", "as", "iconColor", "compressed", "loading", "disabled", "className", "icon", "onClick", "rounded"]);
|
|
34
33
|
var isInteractionPrevented = disabled || loading;
|
|
35
34
|
var handleClick = function (event) {
|
|
36
35
|
if (onClick && !disabled && !loading) {
|
|
37
36
|
onClick(event);
|
|
38
37
|
}
|
|
39
38
|
};
|
|
39
|
+
var renderIcon = function (content) {
|
|
40
|
+
return renderContent({
|
|
41
|
+
content: content,
|
|
42
|
+
props: {
|
|
43
|
+
size: getIconSizeToFormElement(size),
|
|
44
|
+
color: iconColor,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
};
|
|
40
48
|
var resolvedChildren = useMemo(function () {
|
|
41
49
|
if (loading) {
|
|
42
50
|
return (React.createElement(Loader, { className: cnIconButton('Loader'), color: "var(--color-content-disabled)", size: loaderSizeMapper[size] }));
|
|
43
51
|
}
|
|
44
|
-
if (
|
|
45
|
-
return
|
|
52
|
+
if (icon) {
|
|
53
|
+
return renderIcon(icon);
|
|
46
54
|
}
|
|
47
55
|
return null;
|
|
48
|
-
}, [loading, size, iconColor,
|
|
56
|
+
}, [loading, size, iconColor, icon, renderIcon]);
|
|
49
57
|
return (React.createElement(Tag, __assign({ className: cnIconButton({
|
|
50
58
|
variant: variant,
|
|
51
59
|
size: size,
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
.List {
|
|
2
|
+
--list-item-color: var(--color-content-primary);
|
|
2
3
|
--list-item-border-radius: var(--border-radius-xs);
|
|
3
|
-
--list-
|
|
4
|
+
--list-item-bg-color: transparent;
|
|
5
|
+
--list-item-bg-color-hover: var(--color-background-main-hover);
|
|
6
|
+
--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);
|
|
4
9
|
--list-pipka-border-radius: 0 var(--border-radius-xs) var(--border-radius-xs)
|
|
5
10
|
0;
|
|
6
11
|
display: flex;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
min-block-size: var(--list-item-min-height);
|
|
5
5
|
padding: var(--list-item-padding);
|
|
6
6
|
border-radius: var(--list-item-border-radius);
|
|
7
|
-
color: var(--
|
|
7
|
+
color: var(--list-item-color);
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
flex-shrink: 0;
|
|
10
10
|
margin: 0 var(--list-gutter);
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
.ListItemButton {
|
|
2
2
|
inline-size: calc(100% - 2 * var(--list-gutter));
|
|
3
|
+
min-block-size: var(--list-item-min-height);
|
|
4
|
+
padding: var(--list-item-padding);
|
|
5
|
+
color: var(--list-item-color);
|
|
6
|
+
border-radius: var(--list-item-border-radius);
|
|
7
|
+
background-color: var(--list-item-bg-color);
|
|
8
|
+
margin: 0 var(--list-gutter);
|
|
9
|
+
transition: background-color var(--transition-default);
|
|
3
10
|
display: flex;
|
|
4
11
|
flex-shrink: 0;
|
|
5
12
|
align-items: center;
|
|
6
13
|
box-sizing: border-box;
|
|
7
|
-
min-block-size: var(--list-item-min-height);
|
|
8
|
-
padding: var(--list-item-padding);
|
|
9
|
-
color: var(--color-content-primary);
|
|
10
14
|
outline: none;
|
|
11
15
|
text-decoration: none;
|
|
12
|
-
border-radius: var(--list-item-border-radius);
|
|
13
|
-
transition: background-color var(--transition-default);
|
|
14
16
|
text-align: start;
|
|
15
|
-
background-color: transparent;
|
|
16
17
|
cursor: pointer;
|
|
17
18
|
overflow: hidden;
|
|
18
19
|
-webkit-tap-highlight-color: transparent;
|
|
19
|
-
margin: 0 var(--list-gutter);
|
|
20
20
|
border: none;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.ListItemButton:hover {
|
|
24
|
-
background-color: var(--
|
|
24
|
+
background-color: var(--list-item-bg-color-hover);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.ListItemButton:active {
|
|
28
|
-
background-color: var(--
|
|
28
|
+
background-color: var(--list-item-bg-color-active);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.ListItemButton:focus {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
.ListItemButton_disabled {
|
|
40
40
|
pointer-events: none;
|
|
41
|
-
color: var(--color-
|
|
41
|
+
color: var(--list-item-bg-color-disabled);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.ListItemButton_disabled .ListItemText-TextPrimary,
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
content: '';
|
|
51
51
|
inline-size: var(--list-pipka-width);
|
|
52
52
|
block-size: var(--list-pipka-height);
|
|
53
|
-
background-color: var(--list-pipka-
|
|
53
|
+
background-color: var(--list-pipka-bg-color);
|
|
54
54
|
border-radius: var(--list-pipka-border-radius);
|
|
55
55
|
position: absolute;
|
|
56
56
|
inset-inline-start: 0;
|
|
@@ -8,6 +8,9 @@ export type ListItemButtonBaseProps = {
|
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
/** Если {true} делает элемент неактивным */
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
/** Если {true} отображает элемент списка как выбранный */
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
/** Идентификатор компонента для тестов */
|
|
11
14
|
'data-testid'?: string;
|
|
12
15
|
};
|
|
13
16
|
export type ListItemButtonProps<As extends ElementType = typeof LIST_ITEM_BUTTON_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<ListItemButtonBaseProps, As>;
|
|
@@ -9,7 +9,7 @@ import { LIST_ITEM_BUTTON_DEFAULT_TAG } from '../../constants';
|
|
|
9
9
|
export var cnListItemButton = cn('ListItemButton');
|
|
10
10
|
export var ListItemButton = polymorphicComponentWithRef(function (inProps, ref) {
|
|
11
11
|
var props = useThemeProps({ props: inProps, name: 'ListItemButton' });
|
|
12
|
-
var _a = props.as, Tag = _a === void 0 ? LIST_ITEM_BUTTON_DEFAULT_TAG : _a, children = props.children, disabled = props.disabled, className = props.className, onClick = props.onClick, tabIndexProp = props.tabIndex, onKeyDownProp = props.onKeyDown, other = __rest(props, ["as", "children", "disabled", "className", "onClick", "tabIndex", "onKeyDown"]);
|
|
12
|
+
var _a = props.as, Tag = _a === void 0 ? LIST_ITEM_BUTTON_DEFAULT_TAG : _a, children = props.children, disabled = props.disabled, className = props.className, onClick = props.onClick, tabIndexProp = props.tabIndex, onKeyDownProp = props.onKeyDown, selected = props.selected, other = __rest(props, ["as", "children", "disabled", "className", "onClick", "tabIndex", "onKeyDown", "selected"]);
|
|
13
13
|
var tabIndex = useMemo(function () { return (!disabled ? 0 : -1); }, [disabled]);
|
|
14
14
|
var handleClick = function (event) {
|
|
15
15
|
if (!disabled)
|
|
@@ -41,6 +41,7 @@ export var ListItemButton = polymorphicComponentWithRef(function (inProps, ref)
|
|
|
41
41
|
}, [Tag, handleKeyDown]);
|
|
42
42
|
return (React.createElement(Tag, __assign({ className: cnListItemButton({
|
|
43
43
|
disabled: disabled,
|
|
44
|
+
selected: selected,
|
|
44
45
|
}, [className]), onClick: handleClick, tabIndex: tabIndexProp || tabIndex }, additionalTagProps, other, { ref: ref }), children));
|
|
45
46
|
});
|
|
46
47
|
ListItemButton.displayName = 'ListItemButton';
|
|
@@ -4,8 +4,6 @@ import { type ListItemButtonBaseProps } from '../../../List';
|
|
|
4
4
|
import { LIST_ITEM_BUTTON_DEFAULT_TAG } from '../../../List/constants';
|
|
5
5
|
export declare const cnMenuItem: import("@bem-react/classname").ClassNameFormatter;
|
|
6
6
|
export type MenuItemBaseProps = ListItemButtonBaseProps & {
|
|
7
|
-
/** Если {true} отображает элемент меню как выбранный */
|
|
8
|
-
selected?: boolean;
|
|
9
7
|
/** Используется для вычисления лейбла выбранного элемента меню в выпадающих списках */
|
|
10
8
|
label?: string;
|
|
11
9
|
/** Используется для вычисления значения выбранного элемента меню в выпадающих списках */
|
|
@@ -4,7 +4,7 @@ import { useMultiRef } from '../../../../hooks/useMultiRef';
|
|
|
4
4
|
import { useThemeProps } from '../../../../hooks/useThemeProps';
|
|
5
5
|
import { cn } from '../../../../utils/classname';
|
|
6
6
|
import { polymorphicComponentWithRef, } from '../../../../utils/polymorphicComponentWithRef';
|
|
7
|
-
import {
|
|
7
|
+
import { ListItemButton } from '../../../List';
|
|
8
8
|
import { LIST_ITEM_BUTTON_DEFAULT_TAG } from '../../../List/constants';
|
|
9
9
|
export var cnMenuItem = cn('MenuItem');
|
|
10
10
|
export var MenuItem = polymorphicComponentWithRef(function (inProps, ref) {
|
|
@@ -17,6 +17,6 @@ export var MenuItem = polymorphicComponentWithRef(function (inProps, ref) {
|
|
|
17
17
|
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
18
18
|
}
|
|
19
19
|
}, [autoFocus, disabled]);
|
|
20
|
-
return (React.createElement(ListItemButton, __assign({ role: "menuitem", as: Tag, disabled: disabled }, other, { ref: useMultiRef([ref, innerRef]), className:
|
|
20
|
+
return (React.createElement(ListItemButton, __assign({ role: "menuitem", as: Tag, disabled: disabled, selected: selected }, other, { ref: useMultiRef([ref, innerRef]), className: cnMenuItem('', [className]), "data-value": value, "data-label": label }), children));
|
|
21
21
|
});
|
|
22
22
|
MenuItem.displayName = 'MenuItem';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.Theme_control_ozenDefault {
|
|
2
|
+
--control-padding-4xs: 2px;
|
|
3
|
+
--control-padding-3xs: 4px;
|
|
4
|
+
--control-padding-2xs: 8px;
|
|
5
|
+
--control-padding-xs: 12px;
|
|
6
|
+
--control-padding-s: 16px;
|
|
7
|
+
--control-padding-m: 20px;
|
|
8
|
+
--control-padding-l: 24px;
|
|
9
|
+
--control-height-4xs: 16px;
|
|
10
|
+
--control-height-3xs: 24px;
|
|
11
|
+
--control-height-2xs: 32px;
|
|
12
|
+
--control-height-xs: 40px;
|
|
13
|
+
--control-height-s: 48px;
|
|
14
|
+
--control-height-m: 56px;
|
|
15
|
+
--control-height-l: 64px;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.Theme_spacing_ozenDefault {
|
|
2
|
+
--spacing-4xs: 2px;
|
|
3
|
+
--spacing-3xs: 4px;
|
|
4
|
+
--spacing-2xs: 8px;
|
|
5
|
+
--spacing-xs: 12px;
|
|
6
|
+
--spacing-s: 16px;
|
|
7
|
+
--spacing-m: 24px;
|
|
8
|
+
--spacing-l: 32px;
|
|
9
|
+
--spacing-xl: 40px;
|
|
10
|
+
--spacing-2xl: 48px;
|
|
11
|
+
--spacing-3xl: 56px;
|
|
12
|
+
--spacing-4xl: 64px;
|
|
13
|
+
}
|
|
@@ -5,5 +5,7 @@ export declare const shadow: readonly ["--shadow-l", "--shadow-m", "--shadow-s"]
|
|
|
5
5
|
export declare const breakpoint: readonly ["--breakpoint-xs", "--breakpoint-s", "--breakpoint-m", "--breakpoint-l"];
|
|
6
6
|
export declare const zIndex: readonly ["--z-index-default", "--z-index-absolute", "--z-index-header", "--z-index-sidebar", "--z-index-modal", "--z-index-popover", "--z-index-snackbar", "--z-index-chat"];
|
|
7
7
|
export declare const space: readonly ["--space-8xl", "--space-7xl", "--space-6xl", "--space-5xl", "--space-4xl", "--space-3xl", "--space-2xl", "--space-xl", "--space-l", "--space-m", "--space-s", "--space-xs"];
|
|
8
|
+
export declare const spacing: readonly ["--spacing-4xs", "--spacing-3xs", "--spacing-2xs", "--spacing-xs", "--spacing-s", "--spacing-m", "--spacing-l", "--spacing-xl", "--spacing-2xl", "--spacing-3xl", "--spacing-4xl"];
|
|
9
|
+
export declare const control: readonly ["--control-padding-4xs", "--control-padding-3xs", "--control-padding-2xs", "--control-padding-xs", "--control-padding-s", "--control-padding-m", "--control-padding-l", "--control-height-4xs", "--control-height-3xs", "--control-height-2xs", "--control-height-xs", "--control-height-s", "--control-height-m", "--control-height-l"];
|
|
8
10
|
export declare const typography: readonly ["--typography-text-xl_1-font", "--typography-text-4xl_1-font", "--typography-text-3xl_1-font", "--typography-text-2xl_1-font", "--typography-heading-4xl-font", "--typography-text-4xl-font", "--typography-heading-3xl-font", "--typography-text-3xl-font", "--typography-heading-2xl-font", "--typography-text-2xl-font", "--typography-heading-xl-font", "--typography-text-xl-font", "--typography-text-l-font", "--typography-text-l_1-font", "--typography-text-m-font", "--typography-text-m_1-font", "--typography-text-s-font", "--typography-text-s_1-font", "--typography-text-xs-font", "--typography-text-xs_1-font", "--typography-text-2xs-font", "--typography-text-2xs_1-font", "--typography-text-3xs-font", "--typography-caption-3xs-font", "--typography-caption-3xs-text_transform", "--typography-caption-3xs-letter_spacing", "--typography-text-3xs_1-font", "--typography-caption-3xs_1-font", "--typography-caption-3xs_1-text_transform", "--typography-caption-3xs_1-letter_spacing"];
|
|
9
11
|
export declare const transition: readonly ["--transition-default", "--transition-slow"];
|
|
@@ -189,6 +189,35 @@ export var space = [
|
|
|
189
189
|
'--space-s',
|
|
190
190
|
'--space-xs',
|
|
191
191
|
];
|
|
192
|
+
export var spacing = [
|
|
193
|
+
'--spacing-4xs',
|
|
194
|
+
'--spacing-3xs',
|
|
195
|
+
'--spacing-2xs',
|
|
196
|
+
'--spacing-xs',
|
|
197
|
+
'--spacing-s',
|
|
198
|
+
'--spacing-m',
|
|
199
|
+
'--spacing-l',
|
|
200
|
+
'--spacing-xl',
|
|
201
|
+
'--spacing-2xl',
|
|
202
|
+
'--spacing-3xl',
|
|
203
|
+
'--spacing-4xl',
|
|
204
|
+
];
|
|
205
|
+
export var control = [
|
|
206
|
+
'--control-padding-4xs',
|
|
207
|
+
'--control-padding-3xs',
|
|
208
|
+
'--control-padding-2xs',
|
|
209
|
+
'--control-padding-xs',
|
|
210
|
+
'--control-padding-s',
|
|
211
|
+
'--control-padding-m',
|
|
212
|
+
'--control-padding-l',
|
|
213
|
+
'--control-height-4xs',
|
|
214
|
+
'--control-height-3xs',
|
|
215
|
+
'--control-height-2xs',
|
|
216
|
+
'--control-height-xs',
|
|
217
|
+
'--control-height-s',
|
|
218
|
+
'--control-height-m',
|
|
219
|
+
'--control-height-l',
|
|
220
|
+
];
|
|
192
221
|
export var typography = [
|
|
193
222
|
'--typography-text-xl_1-font',
|
|
194
223
|
'--typography-text-4xl_1-font',
|
|
@@ -4,6 +4,8 @@ import '../_color/Theme_color_bBusinessDefault.css';
|
|
|
4
4
|
import '../_typography/Theme_typography_ozenDefault.css';
|
|
5
5
|
import '../_borderRadius/Theme_borderRadius_ozenDefault.css';
|
|
6
6
|
import '../_space/Theme_space_ozenDefault.css';
|
|
7
|
+
import '../_spacing/Theme_spacing_ozenDefault.css';
|
|
8
|
+
import '../_control/Theme_control_ozenDefault.css';
|
|
7
9
|
import '../_shadow/Theme_shadow_ozenDefault.css';
|
|
8
10
|
import '../_breakpoint/Theme_breakpoint_ozenDefault.css';
|
|
9
11
|
import '../_borderWidth/Theme_borderWidth_ozenDefault.css';
|
|
@@ -3,6 +3,8 @@ import '../_color/Theme_color_bBusinessDefault.css';
|
|
|
3
3
|
import '../_typography/Theme_typography_ozenDefault.css';
|
|
4
4
|
import '../_borderRadius/Theme_borderRadius_ozenDefault.css';
|
|
5
5
|
import '../_space/Theme_space_ozenDefault.css';
|
|
6
|
+
import '../_spacing/Theme_spacing_ozenDefault.css';
|
|
7
|
+
import '../_control/Theme_control_ozenDefault.css';
|
|
6
8
|
import '../_shadow/Theme_shadow_ozenDefault.css';
|
|
7
9
|
import '../_breakpoint/Theme_breakpoint_ozenDefault.css';
|
|
8
10
|
import '../_borderWidth/Theme_borderWidth_ozenDefault.css';
|
|
@@ -12,6 +14,8 @@ export var themeBBusinessDefault = {
|
|
|
12
14
|
tokens: {
|
|
13
15
|
color: 'bBusinessDefault',
|
|
14
16
|
space: 'ozenDefault',
|
|
17
|
+
spacing: 'ozenDefault',
|
|
18
|
+
control: 'ozenDefault',
|
|
15
19
|
typography: 'ozenDefault',
|
|
16
20
|
borderRadius: 'ozenDefault',
|
|
17
21
|
borderWidth: 'ozenDefault',
|
|
@@ -4,6 +4,8 @@ import '../_color/Theme_color_ozenDark.css';
|
|
|
4
4
|
import '../_typography/Theme_typography_ozenDefault.css';
|
|
5
5
|
import '../_borderRadius/Theme_borderRadius_ozenDefault.css';
|
|
6
6
|
import '../_space/Theme_space_ozenDefault.css';
|
|
7
|
+
import '../_spacing/Theme_spacing_ozenDefault.css';
|
|
8
|
+
import '../_control/Theme_control_ozenDefault.css';
|
|
7
9
|
import '../_shadow/Theme_shadow_ozenDefault.css';
|
|
8
10
|
import '../_breakpoint/Theme_breakpoint_ozenDefault.css';
|
|
9
11
|
import '../_borderWidth/Theme_borderWidth_ozenDefault.css';
|
|
@@ -3,6 +3,8 @@ import '../_color/Theme_color_ozenDark.css';
|
|
|
3
3
|
import '../_typography/Theme_typography_ozenDefault.css';
|
|
4
4
|
import '../_borderRadius/Theme_borderRadius_ozenDefault.css';
|
|
5
5
|
import '../_space/Theme_space_ozenDefault.css';
|
|
6
|
+
import '../_spacing/Theme_spacing_ozenDefault.css';
|
|
7
|
+
import '../_control/Theme_control_ozenDefault.css';
|
|
6
8
|
import '../_shadow/Theme_shadow_ozenDefault.css';
|
|
7
9
|
import '../_breakpoint/Theme_breakpoint_ozenDefault.css';
|
|
8
10
|
import '../_borderWidth/Theme_borderWidth_ozenDefault.css';
|
|
@@ -12,6 +14,8 @@ export var themeOzenDark = {
|
|
|
12
14
|
tokens: {
|
|
13
15
|
color: 'ozenDark',
|
|
14
16
|
space: 'ozenDefault',
|
|
17
|
+
spacing: 'ozenDefault',
|
|
18
|
+
control: 'ozenDefault',
|
|
15
19
|
typography: 'ozenDefault',
|
|
16
20
|
borderRadius: 'ozenDefault',
|
|
17
21
|
borderWidth: 'ozenDefault',
|
|
@@ -4,6 +4,8 @@ import '../_color/Theme_color_ozenDefault.css';
|
|
|
4
4
|
import '../_typography/Theme_typography_ozenDefault.css';
|
|
5
5
|
import '../_borderRadius/Theme_borderRadius_ozenDefault.css';
|
|
6
6
|
import '../_space/Theme_space_ozenDefault.css';
|
|
7
|
+
import '../_spacing/Theme_spacing_ozenDefault.css';
|
|
8
|
+
import '../_control/Theme_control_ozenDefault.css';
|
|
7
9
|
import '../_shadow/Theme_shadow_ozenDefault.css';
|
|
8
10
|
import '../_breakpoint/Theme_breakpoint_ozenDefault.css';
|
|
9
11
|
import '../_borderWidth/Theme_borderWidth_ozenDefault.css';
|
|
@@ -3,6 +3,8 @@ import '../_color/Theme_color_ozenDefault.css';
|
|
|
3
3
|
import '../_typography/Theme_typography_ozenDefault.css';
|
|
4
4
|
import '../_borderRadius/Theme_borderRadius_ozenDefault.css';
|
|
5
5
|
import '../_space/Theme_space_ozenDefault.css';
|
|
6
|
+
import '../_spacing/Theme_spacing_ozenDefault.css';
|
|
7
|
+
import '../_control/Theme_control_ozenDefault.css';
|
|
6
8
|
import '../_shadow/Theme_shadow_ozenDefault.css';
|
|
7
9
|
import '../_breakpoint/Theme_breakpoint_ozenDefault.css';
|
|
8
10
|
import '../_borderWidth/Theme_borderWidth_ozenDefault.css';
|
|
@@ -12,6 +14,8 @@ export var themeOzenDefault = {
|
|
|
12
14
|
tokens: {
|
|
13
15
|
color: 'ozenDefault',
|
|
14
16
|
space: 'ozenDefault',
|
|
17
|
+
spacing: 'ozenDefault',
|
|
18
|
+
control: 'ozenDefault',
|
|
15
19
|
typography: 'ozenDefault',
|
|
16
20
|
borderRadius: 'ozenDefault',
|
|
17
21
|
borderWidth: 'ozenDefault',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type UseBooleanControllers = {
|
|
1
|
+
export type UseBooleanControllers = {
|
|
2
2
|
/** Установить значение в {true} */
|
|
3
3
|
on: () => void;
|
|
4
4
|
/** Установить значение в {false} */
|
|
@@ -6,8 +6,7 @@ type UseBooleanControllers = {
|
|
|
6
6
|
/** Перевести значение в противоположное состояние */
|
|
7
7
|
toggle: () => void;
|
|
8
8
|
};
|
|
9
|
-
type UseBooleanReturnValue = [boolean, UseBooleanControllers];
|
|
9
|
+
export type UseBooleanReturnValue = [boolean, UseBooleanControllers];
|
|
10
10
|
export declare function useBoolean(
|
|
11
11
|
/** Значение по умолчанию */
|
|
12
12
|
defaultValue?: boolean): UseBooleanReturnValue;
|
|
13
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { themeHelper } from '../../components/ThemeProvider';
|
|
2
|
-
type VariablesVariant = 'color' | 'breakpoint' | 'zIndex' | 'space' | 'borderRadius' | 'borderWidth' | 'shadow' | 'typography' | 'transition';
|
|
2
|
+
type VariablesVariant = 'color' | 'breakpoint' | 'zIndex' | 'space' | 'spacing' | 'control' | 'borderRadius' | 'borderWidth' | 'shadow' | 'typography' | 'transition';
|
|
3
3
|
export type ThemeVariables = {
|
|
4
4
|
[P in VariablesVariant]: {
|
|
5
5
|
[key in (typeof themeHelper)[P][number]]: string;
|