@ozen-ui/kit 0.84.1 → 0.84.3
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/DataList/entities/index.js +4 -0
- package/__inner__/cjs/components/DataList/entities/size.js +5 -0
- package/__inner__/cjs/components/DataList/index.js +1 -0
- package/__inner__/cjs/components/List/List.css +32 -7
- package/__inner__/cjs/components/List/List.js +2 -2
- package/__inner__/cjs/components/List/components/ListItemButton/ListItemButton.css +5 -1
- package/__inner__/cjs/components/List/components/ListItemText/ListItemText.css +8 -0
- package/__inner__/cjs/components/List/constants.js +2 -1
- package/__inner__/cjs/components/List/entities/color.js +4 -0
- package/__inner__/cjs/components/List/entities/index.js +5 -0
- package/__inner__/cjs/components/List/entities/size.js +5 -0
- package/__inner__/cjs/components/List/index.js +1 -0
- package/__inner__/cjs/components/Menu/Menu.css +1 -0
- package/__inner__/cjs/components/Menu/Menu.js +2 -2
- package/__inner__/cjs/components/Menu/constants.js +2 -1
- package/__inner__/cjs/components/Menu/entities/color.js +5 -0
- package/__inner__/cjs/components/Menu/entities/index.js +5 -0
- package/__inner__/cjs/components/Menu/entities/size.js +5 -0
- package/__inner__/cjs/components/Menu/index.js +1 -0
- package/__inner__/cjs/components/Sidebar/modules/SidebarCollapsibleItem/SidebarCollapsibleItem.css +12 -6
- package/__inner__/cjs/components/Sidebar/modules/SidebarCollapsibleItem/SidebarCollapsibleItem.js +12 -5
- package/__inner__/cjs/components/Sidebar/modules/SidebarHeaderLogo/SidebarHeaderLogo.css +0 -1
- package/__inner__/cjs/components/Sidebar/modules/SidebarHeaderLogo/SidebarHeaderLogo.js +4 -1
- package/__inner__/cjs/components/Sidebar/modules/SidebarItem/SidebarItem.css +1 -2
- package/__inner__/cjs/components/Sidebar/modules/SidebarItem/SidebarItem.js +4 -1
- package/__inner__/cjs/components/Sidebar/modules/SidebarUser/SidebarUser.css +0 -2
- package/__inner__/cjs/components/Sidebar/modules/SidebarUser/SidebarUser.js +3 -0
- package/__inner__/cjs/components/Sidebar/modules/SidebarUserMenu/SidebarUserMenu.css +5 -0
- package/__inner__/cjs/components/Sidebar/modules/SidebarUserMenu/SidebarUserMenu.js +4 -2
- package/__inner__/esm/components/DataList/entities/index.js +1 -0
- package/__inner__/esm/components/DataList/entities/size.js +2 -0
- package/__inner__/esm/components/DataList/index.js +1 -0
- package/__inner__/esm/components/List/List.css +32 -7
- package/__inner__/esm/components/List/List.js +3 -3
- package/__inner__/esm/components/List/components/ListItemButton/ListItemButton.css +5 -1
- package/__inner__/esm/components/List/components/ListItemText/ListItemText.css +8 -0
- package/__inner__/esm/components/List/constants.js +1 -0
- package/__inner__/esm/components/List/entities/color.js +1 -0
- package/__inner__/esm/components/List/entities/index.js +2 -0
- package/__inner__/esm/components/List/entities/size.js +2 -0
- package/__inner__/esm/components/List/index.js +1 -0
- package/__inner__/esm/components/Menu/Menu.css +1 -0
- package/__inner__/esm/components/Menu/Menu.js +3 -3
- package/__inner__/esm/components/Menu/constants.js +1 -0
- package/__inner__/esm/components/Menu/entities/color.js +2 -0
- package/__inner__/esm/components/Menu/entities/index.js +2 -0
- package/__inner__/esm/components/Menu/entities/size.js +2 -0
- package/__inner__/esm/components/Menu/index.js +1 -0
- package/__inner__/esm/components/Sidebar/modules/SidebarCollapsibleItem/SidebarCollapsibleItem.css +12 -6
- package/__inner__/esm/components/Sidebar/modules/SidebarCollapsibleItem/SidebarCollapsibleItem.js +13 -6
- package/__inner__/esm/components/Sidebar/modules/SidebarHeaderLogo/SidebarHeaderLogo.css +0 -1
- package/__inner__/esm/components/Sidebar/modules/SidebarHeaderLogo/SidebarHeaderLogo.js +4 -1
- package/__inner__/esm/components/Sidebar/modules/SidebarItem/SidebarItem.css +1 -2
- package/__inner__/esm/components/Sidebar/modules/SidebarItem/SidebarItem.js +4 -1
- package/__inner__/esm/components/Sidebar/modules/SidebarUser/SidebarUser.css +0 -2
- package/__inner__/esm/components/Sidebar/modules/SidebarUser/SidebarUser.js +3 -0
- package/__inner__/esm/components/Sidebar/modules/SidebarUserMenu/SidebarUserMenu.css +5 -0
- package/__inner__/esm/components/Sidebar/modules/SidebarUserMenu/SidebarUserMenu.js +4 -2
- package/__inner__/types/components/AutocompleteNext/components/AutocompleteDropdown/types.d.ts +1 -1
- package/__inner__/types/components/DataList/entities/index.d.ts +1 -0
- package/__inner__/types/components/DataList/entities/size.d.ts +2 -0
- package/__inner__/types/components/DataList/index.d.ts +1 -0
- package/__inner__/types/components/DataList/types.d.ts +3 -3
- package/__inner__/types/components/List/ListContext.d.ts +4 -1
- package/__inner__/types/components/List/constants.d.ts +1 -0
- package/__inner__/types/components/List/entities/color.d.ts +2 -0
- package/__inner__/types/components/List/entities/index.d.ts +2 -0
- package/__inner__/types/components/List/entities/size.d.ts +2 -0
- package/__inner__/types/components/List/index.d.ts +2 -0
- package/__inner__/types/components/List/types.d.ts +3 -5
- package/__inner__/types/components/Menu/constants.d.ts +1 -0
- package/__inner__/types/components/Menu/entities/color.d.ts +2 -0
- package/__inner__/types/components/Menu/entities/index.d.ts +2 -0
- package/__inner__/types/components/Menu/entities/size.d.ts +2 -0
- package/__inner__/types/components/Menu/index.d.ts +1 -0
- package/__inner__/types/components/Menu/types.d.ts +4 -2
- package/__inner__/types/components/Sidebar/modules/SidebarCollapsibleItem/types.d.ts +5 -0
- package/__inner__/types/components/Sidebar/modules/SidebarUserMenu/types.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./entities"), exports);
|
|
4
5
|
tslib_1.__exportStar(require("./DataList"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./components"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./types"), exports);
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
.List {
|
|
2
2
|
--list-item-bg-color: transparent;
|
|
3
|
-
--list-
|
|
4
|
-
--list-pipka-bg-color: var(--color-content-action);
|
|
5
|
-
--list-item-bg-color-disabled: var(--color-content-tertiary);
|
|
6
|
-
--list-item-bg-color-hover: var(--color-background-main-hover);
|
|
7
|
-
--list-item-bg-color-active: var(--color-background-main-pressed);
|
|
8
|
-
--list-pipka-border-radius: 0 var(--border-radius-xs) var(--border-radius-xs)
|
|
9
|
-
0;
|
|
3
|
+
--list-pipka-border-radius: 0 var(--border-radius-xs) var(--border-radius-xs) 0;
|
|
10
4
|
display: flex;
|
|
11
5
|
flex-direction: column;
|
|
12
6
|
gap: var(--list-gap);
|
|
@@ -14,8 +8,35 @@
|
|
|
14
8
|
margin: 0;
|
|
15
9
|
position: relative;
|
|
16
10
|
outline: none;
|
|
11
|
+
background-color: var(--list-bg-color);
|
|
17
12
|
}
|
|
18
13
|
|
|
14
|
+
.List_color_main {
|
|
15
|
+
--list-bg-color: var(--color-background-main);
|
|
16
|
+
--list-item-color: var(--color-content-primary);
|
|
17
|
+
--list-item-secondary-color: var(--color-content-secondary);
|
|
18
|
+
--list-item-disabled-color: var(--color-content-tertiary);
|
|
19
|
+
--list-pipka-bg-color: var(--color-content-action);
|
|
20
|
+
--list-item-bg-color-disabled: var(--color-content-tertiary);
|
|
21
|
+
--list-item-bg-color-hover: var(--color-background-main-hover);
|
|
22
|
+
--list-item-bg-color-active: var(--color-background-main-pressed);
|
|
23
|
+
--list-item-bg-color-selected: transparent;
|
|
24
|
+
--list-divider-color: var(--color-border-secondary);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.List_color_accent {
|
|
28
|
+
--list-bg-color: var(--color-accent-main);
|
|
29
|
+
--list-item-color: var(--color-content-accent-primary);
|
|
30
|
+
--list-item-secondary-color: var(--color-content-accent-secondary);
|
|
31
|
+
--list-item-disabled-color: var(--color-content-accent-disabled);
|
|
32
|
+
--list-pipka-bg-color: var(--color-content-accent-primary);
|
|
33
|
+
--list-item-bg-color-disabled: var(--color-content-accent-disabled);
|
|
34
|
+
--list-item-bg-color-hover: var(--color-accent-primary-hover);
|
|
35
|
+
--list-item-bg-color-active: var(--color-accent-primary-pressed);
|
|
36
|
+
--list-item-bg-color-selected: var(--color-accent-primary);
|
|
37
|
+
--list-divider-color: var(--color-accent-primary);
|
|
38
|
+
}
|
|
39
|
+
|
|
19
40
|
.List_size_2xs,
|
|
20
41
|
.List_size_xs,
|
|
21
42
|
.List_size_s {
|
|
@@ -91,3 +112,7 @@
|
|
|
91
112
|
.List:empty {
|
|
92
113
|
--list-gutter: 0;
|
|
93
114
|
}
|
|
115
|
+
|
|
116
|
+
.List .Divider {
|
|
117
|
+
--divider-color: var(--list-divider-color);
|
|
118
|
+
}
|
|
@@ -12,8 +12,8 @@ var ListContext_1 = require("./ListContext");
|
|
|
12
12
|
exports.cnList = (0, classname_1.cn)('List');
|
|
13
13
|
exports.List = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (inProps, ref) {
|
|
14
14
|
var props = (0, useThemeProps_1.useThemeProps)({ props: inProps, name: 'List' });
|
|
15
|
-
var _a = props.as, Tag = _a === void 0 ? constants_1.LIST_DEFAULT_TAG : _a, _b = props.size, size = _b === void 0 ? constants_1.LIST_DEFAULT_SIZE : _b, _c = props.disablePadding, disablePadding = _c === void 0 ? constants_1.LIST_DEFAULT_DISABLE_PADDING : _c, children = props.children, className = props.className, other = tslib_1.__rest(props, ["as", "size", "disablePadding", "children", "className"]);
|
|
15
|
+
var _a = props.as, Tag = _a === void 0 ? constants_1.LIST_DEFAULT_TAG : _a, _b = props.size, size = _b === void 0 ? constants_1.LIST_DEFAULT_SIZE : _b, _c = props.disablePadding, disablePadding = _c === void 0 ? constants_1.LIST_DEFAULT_DISABLE_PADDING : _c, children = props.children, className = props.className, _d = props.color, color = _d === void 0 ? constants_1.LIST_DEFAULT_COLOR : _d, other = tslib_1.__rest(props, ["as", "size", "disablePadding", "children", "className", "color"]);
|
|
16
16
|
return (react_1.default.createElement(ListContext_1.ListContext.Provider, { value: { size: size } },
|
|
17
|
-
react_1.default.createElement(Tag, tslib_1.__assign({ className: (0, exports.cnList)({ size: size, disablePadding: disablePadding }, [className]) }, other, { ref: ref }), children)));
|
|
17
|
+
react_1.default.createElement(Tag, tslib_1.__assign({ className: (0, exports.cnList)({ size: size, disablePadding: disablePadding, color: color }, [className]) }, other, { ref: ref }), children)));
|
|
18
18
|
});
|
|
19
19
|
exports.List.displayName = 'List';
|
|
@@ -50,9 +50,13 @@
|
|
|
50
50
|
|
|
51
51
|
.ListItemButton_disabled .ListItemText-TextPrimary,
|
|
52
52
|
.ListItemButton_disabled .ListItemText-TextSecondary {
|
|
53
|
-
color: var(--
|
|
53
|
+
color: var(--list-item-disabled-color);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
.ListItemButton_selected {
|
|
57
|
+
background-color: var(--list-item-bg-color-selected);
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
.ListItemButton_selected::after {
|
|
57
61
|
content: '';
|
|
58
62
|
inline-size: var(--list-pipka-width);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LIST_ITEM_BUTTON_DEFAULT_ALIGN = exports.LIST_ITEM_BUTTON_DEFAULT_TAG = exports.LIST_ITEM_DEFAULT_ALIGN = exports.LIST_ITEM_DEFAULT_TAG = exports.LIST_DEFAULT_TAG = exports.LIST_DEFAULT_DISABLE_PADDING = exports.LIST_DEFAULT_SIZE = void 0;
|
|
3
|
+
exports.LIST_ITEM_BUTTON_DEFAULT_ALIGN = exports.LIST_ITEM_BUTTON_DEFAULT_TAG = exports.LIST_ITEM_DEFAULT_ALIGN = exports.LIST_ITEM_DEFAULT_TAG = exports.LIST_DEFAULT_COLOR = exports.LIST_DEFAULT_TAG = exports.LIST_DEFAULT_DISABLE_PADDING = exports.LIST_DEFAULT_SIZE = void 0;
|
|
4
4
|
exports.LIST_DEFAULT_SIZE = 'm';
|
|
5
5
|
exports.LIST_DEFAULT_DISABLE_PADDING = false;
|
|
6
6
|
exports.LIST_DEFAULT_TAG = 'ul';
|
|
7
|
+
exports.LIST_DEFAULT_COLOR = 'main';
|
|
7
8
|
exports.LIST_ITEM_DEFAULT_TAG = 'li';
|
|
8
9
|
exports.LIST_ITEM_DEFAULT_ALIGN = 'center';
|
|
9
10
|
exports.LIST_ITEM_BUTTON_DEFAULT_TAG = 'div';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useListContext = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./entities"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./List"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./components"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./types"), exports);
|
|
@@ -15,10 +15,10 @@ var constants_1 = require("./constants");
|
|
|
15
15
|
exports.cnMenu = (0, classname_1.cn)('Menu');
|
|
16
16
|
exports.Menu = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
17
17
|
var props = (0, useThemeProps_1.useThemeProps)({ props: inProps, name: 'Menu' });
|
|
18
|
-
var _a = props.size, size = _a === void 0 ? constants_1.MENU_DEFAULT_SIZE : _a, open = props.open, menuListProps = props.menuListProps, menuListRef = props.menuListRef, onClose = props.onClose, children = props.children, className = props.className, other = tslib_1.__rest(props, ["size", "open", "menuListProps", "menuListRef", "onClose", "children", "className"]);
|
|
18
|
+
var _a = props.size, size = _a === void 0 ? constants_1.MENU_DEFAULT_SIZE : _a, open = props.open, menuListProps = props.menuListProps, menuListRef = props.menuListRef, onClose = props.onClose, children = props.children, className = props.className, _b = props.color, color = _b === void 0 ? constants_1.MENU_DEFAULT_COLOR : _b, other = tslib_1.__rest(props, ["size", "open", "menuListProps", "menuListRef", "onClose", "children", "className", "color"]);
|
|
19
19
|
var radius = (0, getPaperSizeToFormElement_1.getPaperSizeToFormElement)(size);
|
|
20
20
|
(0, useDeprecated_1.useDeprecatedProperty)(!!menuListRef, 'menuListRef', 'menuListProps.ref');
|
|
21
21
|
return (react_1.default.createElement(Popover_1.Popover, tslib_1.__assign({ as: Paper_1.Paper, offset: [0, 4], radius: radius }, other, { open: open, onClose: onClose, className: (0, exports.cnMenu)('', [className]), disableEnforceFocus: true, ref: ref }),
|
|
22
|
-
react_1.default.createElement(components_1.MenuContextConsumer, { onClose: onClose, menuListRef: menuListRef, menuListProps: tslib_1.__assign(tslib_1.__assign({ size: size }, menuListProps), { ref: menuListRef || (menuListProps === null || menuListProps === void 0 ? void 0 : menuListProps.ref) }) }, children)));
|
|
22
|
+
react_1.default.createElement(components_1.MenuContextConsumer, { onClose: onClose, menuListRef: menuListRef, menuListProps: tslib_1.__assign(tslib_1.__assign({ size: size, color: color }, menuListProps), { ref: menuListRef || (menuListProps === null || menuListProps === void 0 ? void 0 : menuListProps.ref) }) }, children)));
|
|
23
23
|
});
|
|
24
24
|
exports.Menu.displayName = 'Menu';
|
|
@@ -5,6 +5,7 @@ var tslib_1 = require("tslib");
|
|
|
5
5
|
var List_1 = require("../List");
|
|
6
6
|
Object.defineProperty(exports, "MenuItemText", { enumerable: true, get: function () { return List_1.ListItemText; } });
|
|
7
7
|
Object.defineProperty(exports, "MenuItemIcon", { enumerable: true, get: function () { return List_1.ListItemIcon; } });
|
|
8
|
+
tslib_1.__exportStar(require("./entities"), exports);
|
|
8
9
|
tslib_1.__exportStar(require("./Menu"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./components"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./types"), exports);
|
package/__inner__/cjs/components/Sidebar/modules/SidebarCollapsibleItem/SidebarCollapsibleItem.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
z-index: 0;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.SidebarCollapsibleItem_collapsed .SidebarCollapsibleItem-
|
|
6
|
+
.SidebarCollapsibleItem_collapsed .SidebarCollapsibleItem-ContentWrapper {
|
|
7
7
|
opacity: 0;
|
|
8
8
|
max-inline-size: 0;
|
|
9
9
|
margin-inline-start: 0;
|
|
@@ -14,26 +14,32 @@
|
|
|
14
14
|
z-index: 1;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.SidebarCollapsibleItem-
|
|
17
|
+
.SidebarCollapsibleItem-ContentWrapper {
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-shrink: 0;
|
|
20
20
|
margin-inline-start: var(--sidebar-collapsible-item-gap);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.SidebarCollapsibleItem-Content
|
|
24
|
-
|
|
23
|
+
.SidebarCollapsibleItem-Content {
|
|
24
|
+
box-sizing: border-box;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.SidebarCollapsibleItem_center {
|
|
28
28
|
margin-inline: auto;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.
|
|
31
|
+
.Sidebar_variant_full .SidebarCollapsibleItem-Content, .Sidebar_variant_mini .SidebarCollapsibleItem-Content {
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
inline-size: var(--sidebar-collapsible-item-content-width);
|
|
34
|
+
min-inline-size: var(--sidebar-collapsible-item-content-width);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.SidebarCollapsibleItem_animated .SidebarCollapsibleItem-ContentWrapper {
|
|
32
38
|
transition: var(--transition-default);
|
|
33
39
|
transition-property: opacity, transform, max-inline-size, margin-inline;
|
|
34
40
|
}
|
|
35
41
|
|
|
36
|
-
.SidebarCollapsibleItem_animated.SidebarCollapsibleItem_collapsed .SidebarCollapsibleItem-
|
|
42
|
+
.SidebarCollapsibleItem_animated.SidebarCollapsibleItem_collapsed .SidebarCollapsibleItem-ContentWrapper {
|
|
37
43
|
transform: translateX(calc(var(--sidebar-collapsible-item-gap) * -1));
|
|
38
44
|
transition-duration: 100ms;
|
|
39
45
|
}
|
package/__inner__/cjs/components/Sidebar/modules/SidebarCollapsibleItem/SidebarCollapsibleItem.js
CHANGED
|
@@ -17,8 +17,8 @@ exports.SidebarCollapsibleItem = (0, utils_1.polymorphicComponentWithRef)(functi
|
|
|
17
17
|
props: inProps,
|
|
18
18
|
name: 'SidebarCollapsibleItem',
|
|
19
19
|
});
|
|
20
|
-
var _a = props.as, as = _a === void 0 ? constants_1.SIDEBAR_COLLAPSIBLE_ITEM_DEFAULT_TAG : _a, className = props.className, fixed = props.fixed, classNames = props.classNames, _b = props.justify, justify = _b === void 0 ? constants_1.SIDEBAR_COLLAPSIBLE_ITEM_DEFAULT_JUSTIFY : _b, _c = props.animated, animated = _c === void 0 ? true : _c, children = props.children, collapsed = props.collapsed, _d = props.autoCenter, autoCenter = _d === void 0 ? constants_1.SIDEBAR_COLLAPSIBLE_ITEM_AUTO_CENTER : _d, other = tslib_1.__rest(props, ["as", "className", "fixed", "classNames", "justify", "animated", "children", "collapsed", "autoCenter"]);
|
|
21
|
-
var
|
|
20
|
+
var _a = props.as, as = _a === void 0 ? constants_1.SIDEBAR_COLLAPSIBLE_ITEM_DEFAULT_TAG : _a, className = props.className, fixed = props.fixed, classNames = props.classNames, _b = props.justify, justify = _b === void 0 ? constants_1.SIDEBAR_COLLAPSIBLE_ITEM_DEFAULT_JUSTIFY : _b, _c = props.animated, animated = _c === void 0 ? true : _c, children = props.children, collapsed = props.collapsed, _d = props.autoCenter, autoCenter = _d === void 0 ? constants_1.SIDEBAR_COLLAPSIBLE_ITEM_AUTO_CENTER : _d, contentFullWidth = props.contentFullWidth, other = tslib_1.__rest(props, ["as", "className", "fixed", "classNames", "justify", "animated", "children", "collapsed", "autoCenter", "contentFullWidth"]);
|
|
21
|
+
var _e = (0, SidebarContext_1.useSidebarContext)(), variant = _e.variant, size = _e.size;
|
|
22
22
|
var isCollapsed = collapsed !== null && collapsed !== void 0 ? collapsed : variant === 'mini';
|
|
23
23
|
var internalRef = (0, react_1.useRef)(null);
|
|
24
24
|
var itemRef = (0, useMultiRef_1.useMultiRef)([ref, internalRef]);
|
|
@@ -29,15 +29,22 @@ exports.SidebarCollapsibleItem = (0, utils_1.polymorphicComponentWithRef)(functi
|
|
|
29
29
|
props: { collapsed: isCollapsed },
|
|
30
30
|
})
|
|
31
31
|
: fixed;
|
|
32
|
-
var
|
|
32
|
+
var _f = (0, hooks_1.useSidebarCollapsibleItemAnimation)({
|
|
33
33
|
autoCenter: autoCenter,
|
|
34
34
|
ref: internalRef,
|
|
35
35
|
fixedRef: fixedRef,
|
|
36
36
|
isCollapsed: isCollapsed,
|
|
37
|
-
}), onExit =
|
|
37
|
+
}), onExit = _f.onExit, onEnter = _f.onEnter, onTransitionEnd = _f.onTransitionEnd, hasMarginAutoClass = _f.hasMarginAutoClass;
|
|
38
38
|
return (react_1.default.createElement(react_transition_group_1.CSSTransition, { nodeRef: internalRef, in: isCollapsed, timeout: { enter: 120, exit: 120 }, appear: true, onEnter: onEnter, onExit: onExit, onEntered: onTransitionEnd, onExited: onTransitionEnd },
|
|
39
39
|
react_1.default.createElement(Stack_1.Stack, tslib_1.__assign({}, other, { ref: itemRef, as: as, className: (0, exports.cnSidebarCollapsibleItem)({ collapsed: isCollapsed, animated: animated, center: hasMarginAutoClass }, [className]), justify: justify }),
|
|
40
40
|
react_1.default.createElement("div", { ref: fixedRef, className: (0, exports.cnSidebarCollapsibleItem)('Fixed', [classNames === null || classNames === void 0 ? void 0 : classNames.fixed]) }, fixedRendered),
|
|
41
|
-
react_1.default.createElement("div", { className: (0, exports.cnSidebarCollapsibleItem)('
|
|
41
|
+
react_1.default.createElement("div", { className: (0, exports.cnSidebarCollapsibleItem)('ContentWrapper', [
|
|
42
|
+
classNames === null || classNames === void 0 ? void 0 : classNames.contentWrapper,
|
|
43
|
+
]), style: (0, utils_1.generateCSSVariables)({
|
|
44
|
+
'sidebar-collapsible-item-content-width': "".concat(contentFullWidth[size], "px"),
|
|
45
|
+
}) },
|
|
46
|
+
react_1.default.createElement("div", { className: (0, exports.cnSidebarCollapsibleItem)('Content', [
|
|
47
|
+
classNames === null || classNames === void 0 ? void 0 : classNames.content,
|
|
48
|
+
]) }, children)))));
|
|
42
49
|
});
|
|
43
50
|
exports.SidebarCollapsibleItem.displayName = 'SidebarCollapsibleItem';
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
letter-spacing: var(--typography-text-m_1-letter_spacing, 0);
|
|
21
21
|
text-transform: var(--typography-text-m_1-text_transform, none);
|
|
22
22
|
color: var(--sidebar-content-primary-color);
|
|
23
|
-
white-space: nowrap;
|
|
24
23
|
}
|
|
25
24
|
.SidebarHeaderLogo-Icon {
|
|
26
25
|
background-color: var(--sidebar-header-icon-background);
|
|
@@ -17,6 +17,9 @@ exports.SidebarHeaderLogo = (0, utils_1.polymorphicComponentWithRef)(function (i
|
|
|
17
17
|
});
|
|
18
18
|
var _a = props.as, as = _a === void 0 ? constants_1.SIDEBAR_HEADER_LOGO_DEFAULT_TAG : _a, className = props.className, children = props.children, icon = props.icon, other = tslib_1.__rest(props, ["as", "className", "children", "icon"]);
|
|
19
19
|
var _b = (0, SidebarContext_1.useSidebarContext)(), color = _b.color, variant = _b.variant, size = _b.size;
|
|
20
|
-
return (react_1.default.createElement(SidebarCollapsibleItem_1.SidebarCollapsibleItem, tslib_1.__assign({}, other, { as: as, fixed: react_1.default.createElement(Stack_1.Stack, { className: (0, exports.cnSidebarHeaderLogo)('Icon'), justify: "center", align: "center" }, icon), collapsed: variant !== 'full', classNames: { content: (0, exports.cnSidebarHeaderLogo)('Text') }, ref: ref, className: (0, exports.cnSidebarHeaderLogo)({ color: color, size: size }, [className]), align: "center"
|
|
20
|
+
return (react_1.default.createElement(SidebarCollapsibleItem_1.SidebarCollapsibleItem, tslib_1.__assign({}, other, { as: as, fixed: react_1.default.createElement(Stack_1.Stack, { className: (0, exports.cnSidebarHeaderLogo)('Icon'), justify: "center", align: "center" }, icon), collapsed: variant !== 'full', classNames: { content: (0, exports.cnSidebarHeaderLogo)('Text') }, ref: ref, className: (0, exports.cnSidebarHeaderLogo)({ color: color, size: size }, [className]), align: "center", contentFullWidth: {
|
|
21
|
+
s: 184,
|
|
22
|
+
m: 200,
|
|
23
|
+
} }), children));
|
|
21
24
|
});
|
|
22
25
|
exports.SidebarHeaderLogo.displayName = 'SidebarHeaderLogo';
|
|
@@ -54,7 +54,10 @@ exports.SidebarItem = (0, utils_1.polymorphicComponentWithRef)(function (inProps
|
|
|
54
54
|
react_1.default.createElement(SidebarCollapsibleItem_1.SidebarCollapsibleItem, tslib_1.__assign({}, other, { as: as, onClick: function (event) {
|
|
55
55
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
56
56
|
setIsOpenSubItems(!isOpenSubitems);
|
|
57
|
-
}, collapsed: isCollapsed, className: (0, exports.cnSidebarItem)('Item'),
|
|
57
|
+
}, collapsed: isCollapsed, className: (0, exports.cnSidebarItem)('Item'), contentFullWidth: {
|
|
58
|
+
s: 180,
|
|
59
|
+
m: 196,
|
|
60
|
+
}, autoCenter: false, fixed: function (props) {
|
|
58
61
|
var badge = (0, utils_1.isFunction)(badgeProp)
|
|
59
62
|
? badgeProp({ collapsed: props.collapsed })
|
|
60
63
|
: badgeProp;
|
|
@@ -27,6 +27,9 @@ exports.SidebarUser = (0, utils_1.polymorphicComponentWithRef)(function (inProps
|
|
|
27
27
|
} })), collapsed: isCollapsed, classNames: {
|
|
28
28
|
content: (0, exports.cnSidebarUser)('Content'),
|
|
29
29
|
fixed: (0, exports.cnSidebarUser)('Fixed'),
|
|
30
|
+
}, contentFullWidth: {
|
|
31
|
+
s: 184,
|
|
32
|
+
m: 200,
|
|
30
33
|
} }),
|
|
31
34
|
react_1.default.createElement(Stack_1.Stack, { direction: "column", className: (0, exports.cnSidebarUser)('Info') },
|
|
32
35
|
react_1.default.createElement(Typography_1.Typography, { variant: "text-s", as: "span", className: (0, exports.cnSidebarUser)('Name') }, name),
|
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
.SidebarUserMenu-Button_open .SidebarUserMenu-Chevron {
|
|
32
32
|
transform: rotate(180deg);
|
|
33
33
|
}
|
|
34
|
+
.SidebarUserMenu-Button .SidebarUserMenu-LabelWrapper {
|
|
35
|
+
overflow: initial;
|
|
36
|
+
text-overflow: initial;
|
|
37
|
+
white-space: initial;
|
|
38
|
+
}
|
|
34
39
|
.SidebarUserMenu-Label {
|
|
35
40
|
display: -webkit-box;
|
|
36
41
|
-webkit-box-orient: block-axis;
|
|
@@ -40,9 +40,11 @@ exports.SidebarUserMenu = (0, utils_1.polymorphicComponentWithRef)(function (inP
|
|
|
40
40
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
41
41
|
}, style: (0, utils_1.generateCSSVariables)({
|
|
42
42
|
'sidebar-user-menu-ellipsis': maxLines.toString(),
|
|
43
|
-
}), className: (0, exports.cnSidebarUserMenu)('Button', { color: color, open: isOpen, manyLines: isManyLines }, [className]),
|
|
43
|
+
}), className: (0, exports.cnSidebarUserMenu)('Button', { color: color, open: isOpen, manyLines: isManyLines }, [className]), labelProps: {
|
|
44
|
+
className: (0, exports.cnSidebarUserMenu)('LabelWrapper'),
|
|
45
|
+
}, size: "2xs", iconRight: react_1.default.createElement(icons_1.ChevronDownSmallIcon, { className: (0, exports.cnSidebarUserMenu)('Chevron') }) }),
|
|
44
46
|
react_1.default.createElement(Typography_1.Typography, { variant: labelVariant, className: (0, exports.cnSidebarUserMenu)('Label'), color: "inherit", as: "span" }, label)),
|
|
45
|
-
react_1.default.createElement(Menu_1.Menu, tslib_1.__assign({ placement: "right-end" }, menuProps, { size: (_a = menuProps === null || menuProps === void 0 ? void 0 : menuProps.size) !== null && _a !== void 0 ? _a : constants_1.SIDEBAR_USER_MENU_DEFAULT_MENU_SIZE,
|
|
47
|
+
react_1.default.createElement(Menu_1.Menu, tslib_1.__assign({ placement: "right-end", anchorRef: buttonRef, color: color }, menuProps, { size: (_a = menuProps === null || menuProps === void 0 ? void 0 : menuProps.size) !== null && _a !== void 0 ? _a : constants_1.SIDEBAR_USER_MENU_DEFAULT_MENU_SIZE, open: isOpen, className: (0, exports.cnSidebarUserMenu)('Menu', [menuProps === null || menuProps === void 0 ? void 0 : menuProps.className]), onClose: function () {
|
|
46
48
|
var _a;
|
|
47
49
|
setIsOpen(false);
|
|
48
50
|
(_a = menuProps === null || menuProps === void 0 ? void 0 : menuProps.onClose) === null || _a === void 0 ? void 0 : _a.call(menuProps);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './size';
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
.List {
|
|
2
2
|
--list-item-bg-color: transparent;
|
|
3
|
-
--list-
|
|
4
|
-
--list-pipka-bg-color: var(--color-content-action);
|
|
5
|
-
--list-item-bg-color-disabled: var(--color-content-tertiary);
|
|
6
|
-
--list-item-bg-color-hover: var(--color-background-main-hover);
|
|
7
|
-
--list-item-bg-color-active: var(--color-background-main-pressed);
|
|
8
|
-
--list-pipka-border-radius: 0 var(--border-radius-xs) var(--border-radius-xs)
|
|
9
|
-
0;
|
|
3
|
+
--list-pipka-border-radius: 0 var(--border-radius-xs) var(--border-radius-xs) 0;
|
|
10
4
|
display: flex;
|
|
11
5
|
flex-direction: column;
|
|
12
6
|
gap: var(--list-gap);
|
|
@@ -14,8 +8,35 @@
|
|
|
14
8
|
margin: 0;
|
|
15
9
|
position: relative;
|
|
16
10
|
outline: none;
|
|
11
|
+
background-color: var(--list-bg-color);
|
|
17
12
|
}
|
|
18
13
|
|
|
14
|
+
.List_color_main {
|
|
15
|
+
--list-bg-color: var(--color-background-main);
|
|
16
|
+
--list-item-color: var(--color-content-primary);
|
|
17
|
+
--list-item-secondary-color: var(--color-content-secondary);
|
|
18
|
+
--list-item-disabled-color: var(--color-content-tertiary);
|
|
19
|
+
--list-pipka-bg-color: var(--color-content-action);
|
|
20
|
+
--list-item-bg-color-disabled: var(--color-content-tertiary);
|
|
21
|
+
--list-item-bg-color-hover: var(--color-background-main-hover);
|
|
22
|
+
--list-item-bg-color-active: var(--color-background-main-pressed);
|
|
23
|
+
--list-item-bg-color-selected: transparent;
|
|
24
|
+
--list-divider-color: var(--color-border-secondary);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.List_color_accent {
|
|
28
|
+
--list-bg-color: var(--color-accent-main);
|
|
29
|
+
--list-item-color: var(--color-content-accent-primary);
|
|
30
|
+
--list-item-secondary-color: var(--color-content-accent-secondary);
|
|
31
|
+
--list-item-disabled-color: var(--color-content-accent-disabled);
|
|
32
|
+
--list-pipka-bg-color: var(--color-content-accent-primary);
|
|
33
|
+
--list-item-bg-color-disabled: var(--color-content-accent-disabled);
|
|
34
|
+
--list-item-bg-color-hover: var(--color-accent-primary-hover);
|
|
35
|
+
--list-item-bg-color-active: var(--color-accent-primary-pressed);
|
|
36
|
+
--list-item-bg-color-selected: var(--color-accent-primary);
|
|
37
|
+
--list-divider-color: var(--color-accent-primary);
|
|
38
|
+
}
|
|
39
|
+
|
|
19
40
|
.List_size_2xs,
|
|
20
41
|
.List_size_xs,
|
|
21
42
|
.List_size_s {
|
|
@@ -91,3 +112,7 @@
|
|
|
91
112
|
.List:empty {
|
|
92
113
|
--list-gutter: 0;
|
|
93
114
|
}
|
|
115
|
+
|
|
116
|
+
.List .Divider {
|
|
117
|
+
--divider-color: var(--list-divider-color);
|
|
118
|
+
}
|
|
@@ -4,13 +4,13 @@ import React from 'react';
|
|
|
4
4
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
5
5
|
import { cn } from '../../utils/classname';
|
|
6
6
|
import { polymorphicComponentWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
7
|
-
import { LIST_DEFAULT_SIZE, LIST_DEFAULT_TAG, LIST_DEFAULT_DISABLE_PADDING, } from './constants';
|
|
7
|
+
import { LIST_DEFAULT_SIZE, LIST_DEFAULT_TAG, LIST_DEFAULT_DISABLE_PADDING, LIST_DEFAULT_COLOR, } from './constants';
|
|
8
8
|
import { ListContext } from './ListContext';
|
|
9
9
|
export var cnList = cn('List');
|
|
10
10
|
export var List = polymorphicComponentWithRef(function (inProps, ref) {
|
|
11
11
|
var props = useThemeProps({ props: inProps, name: 'List' });
|
|
12
|
-
var _a = props.as, Tag = _a === void 0 ? LIST_DEFAULT_TAG : _a, _b = props.size, size = _b === void 0 ? LIST_DEFAULT_SIZE : _b, _c = props.disablePadding, disablePadding = _c === void 0 ? LIST_DEFAULT_DISABLE_PADDING : _c, children = props.children, className = props.className, other = __rest(props, ["as", "size", "disablePadding", "children", "className"]);
|
|
12
|
+
var _a = props.as, Tag = _a === void 0 ? LIST_DEFAULT_TAG : _a, _b = props.size, size = _b === void 0 ? LIST_DEFAULT_SIZE : _b, _c = props.disablePadding, disablePadding = _c === void 0 ? LIST_DEFAULT_DISABLE_PADDING : _c, children = props.children, className = props.className, _d = props.color, color = _d === void 0 ? LIST_DEFAULT_COLOR : _d, other = __rest(props, ["as", "size", "disablePadding", "children", "className", "color"]);
|
|
13
13
|
return (React.createElement(ListContext.Provider, { value: { size: size } },
|
|
14
|
-
React.createElement(Tag, __assign({ className: cnList({ size: size, disablePadding: disablePadding }, [className]) }, other, { ref: ref }), children)));
|
|
14
|
+
React.createElement(Tag, __assign({ className: cnList({ size: size, disablePadding: disablePadding, color: color }, [className]) }, other, { ref: ref }), children)));
|
|
15
15
|
});
|
|
16
16
|
List.displayName = 'List';
|
|
@@ -50,9 +50,13 @@
|
|
|
50
50
|
|
|
51
51
|
.ListItemButton_disabled .ListItemText-TextPrimary,
|
|
52
52
|
.ListItemButton_disabled .ListItemText-TextSecondary {
|
|
53
|
-
color: var(--
|
|
53
|
+
color: var(--list-item-disabled-color);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
.ListItemButton_selected {
|
|
57
|
+
background-color: var(--list-item-bg-color-selected);
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
.ListItemButton_selected::after {
|
|
57
61
|
content: '';
|
|
58
62
|
inline-size: var(--list-pipka-width);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export var LIST_DEFAULT_SIZE = 'm';
|
|
2
2
|
export var LIST_DEFAULT_DISABLE_PADDING = false;
|
|
3
3
|
export var LIST_DEFAULT_TAG = 'ul';
|
|
4
|
+
export var LIST_DEFAULT_COLOR = 'main';
|
|
4
5
|
export var LIST_ITEM_DEFAULT_TAG = 'li';
|
|
5
6
|
export var LIST_ITEM_DEFAULT_ALIGN = 'center';
|
|
6
7
|
export var LIST_ITEM_BUTTON_DEFAULT_TAG = 'div';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var listColorVariant = ['main', 'accent'];
|
|
@@ -8,14 +8,14 @@ import { getPaperSizeToFormElement } from '../../utils/getPaperSizeToFormElement
|
|
|
8
8
|
import { Paper } from '../Paper';
|
|
9
9
|
import { Popover } from '../Popover';
|
|
10
10
|
import { MenuContextConsumer } from './components';
|
|
11
|
-
import { MENU_DEFAULT_SIZE } from './constants';
|
|
11
|
+
import { MENU_DEFAULT_COLOR, MENU_DEFAULT_SIZE } from './constants';
|
|
12
12
|
export var cnMenu = cn('Menu');
|
|
13
13
|
export var Menu = forwardRef(function (inProps, ref) {
|
|
14
14
|
var props = useThemeProps({ props: inProps, name: 'Menu' });
|
|
15
|
-
var _a = props.size, size = _a === void 0 ? MENU_DEFAULT_SIZE : _a, open = props.open, menuListProps = props.menuListProps, menuListRef = props.menuListRef, onClose = props.onClose, children = props.children, className = props.className, other = __rest(props, ["size", "open", "menuListProps", "menuListRef", "onClose", "children", "className"]);
|
|
15
|
+
var _a = props.size, size = _a === void 0 ? MENU_DEFAULT_SIZE : _a, open = props.open, menuListProps = props.menuListProps, menuListRef = props.menuListRef, onClose = props.onClose, children = props.children, className = props.className, _b = props.color, color = _b === void 0 ? MENU_DEFAULT_COLOR : _b, other = __rest(props, ["size", "open", "menuListProps", "menuListRef", "onClose", "children", "className", "color"]);
|
|
16
16
|
var radius = getPaperSizeToFormElement(size);
|
|
17
17
|
useDeprecatedProperty(!!menuListRef, 'menuListRef', 'menuListProps.ref');
|
|
18
18
|
return (React.createElement(Popover, __assign({ as: Paper, offset: [0, 4], radius: radius }, other, { open: open, onClose: onClose, className: cnMenu('', [className]), disableEnforceFocus: true, ref: ref }),
|
|
19
|
-
React.createElement(MenuContextConsumer, { onClose: onClose, menuListRef: menuListRef, menuListProps: __assign(__assign({ size: size }, menuListProps), { ref: menuListRef || (menuListProps === null || menuListProps === void 0 ? void 0 : menuListProps.ref) }) }, children)));
|
|
19
|
+
React.createElement(MenuContextConsumer, { onClose: onClose, menuListRef: menuListRef, menuListProps: __assign(__assign({ size: size, color: color }, menuListProps), { ref: menuListRef || (menuListProps === null || menuListProps === void 0 ? void 0 : menuListProps.ref) }) }, children)));
|
|
20
20
|
});
|
|
21
21
|
Menu.displayName = 'Menu';
|
package/__inner__/esm/components/Sidebar/modules/SidebarCollapsibleItem/SidebarCollapsibleItem.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
z-index: 0;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.SidebarCollapsibleItem_collapsed .SidebarCollapsibleItem-
|
|
6
|
+
.SidebarCollapsibleItem_collapsed .SidebarCollapsibleItem-ContentWrapper {
|
|
7
7
|
opacity: 0;
|
|
8
8
|
max-inline-size: 0;
|
|
9
9
|
margin-inline-start: 0;
|
|
@@ -14,26 +14,32 @@
|
|
|
14
14
|
z-index: 1;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.SidebarCollapsibleItem-
|
|
17
|
+
.SidebarCollapsibleItem-ContentWrapper {
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-shrink: 0;
|
|
20
20
|
margin-inline-start: var(--sidebar-collapsible-item-gap);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.SidebarCollapsibleItem-Content
|
|
24
|
-
|
|
23
|
+
.SidebarCollapsibleItem-Content {
|
|
24
|
+
box-sizing: border-box;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.SidebarCollapsibleItem_center {
|
|
28
28
|
margin-inline: auto;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.
|
|
31
|
+
.Sidebar_variant_full .SidebarCollapsibleItem-Content, .Sidebar_variant_mini .SidebarCollapsibleItem-Content {
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
inline-size: var(--sidebar-collapsible-item-content-width);
|
|
34
|
+
min-inline-size: var(--sidebar-collapsible-item-content-width);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.SidebarCollapsibleItem_animated .SidebarCollapsibleItem-ContentWrapper {
|
|
32
38
|
transition: var(--transition-default);
|
|
33
39
|
transition-property: opacity, transform, max-inline-size, margin-inline;
|
|
34
40
|
}
|
|
35
41
|
|
|
36
|
-
.SidebarCollapsibleItem_animated.SidebarCollapsibleItem_collapsed .SidebarCollapsibleItem-
|
|
42
|
+
.SidebarCollapsibleItem_animated.SidebarCollapsibleItem_collapsed .SidebarCollapsibleItem-ContentWrapper {
|
|
37
43
|
transform: translateX(calc(var(--sidebar-collapsible-item-gap) * -1));
|
|
38
44
|
transition-duration: 100ms;
|
|
39
45
|
}
|
package/__inner__/esm/components/Sidebar/modules/SidebarCollapsibleItem/SidebarCollapsibleItem.js
CHANGED
|
@@ -3,7 +3,7 @@ import React, { useRef } from 'react';
|
|
|
3
3
|
import { CSSTransition } from 'react-transition-group';
|
|
4
4
|
import { useMultiRef } from '../../../../hooks/useMultiRef';
|
|
5
5
|
import { useThemeProps } from '../../../../hooks/useThemeProps';
|
|
6
|
-
import { cn, isFunction, polymorphicComponentWithRef, renderContent, } from '../../../../utils';
|
|
6
|
+
import { cn, generateCSSVariables, isFunction, polymorphicComponentWithRef, renderContent, } from '../../../../utils';
|
|
7
7
|
import { Stack } from '../../../Stack';
|
|
8
8
|
import { useSidebarContext } from '../../SidebarContext';
|
|
9
9
|
import { SIDEBAR_COLLAPSIBLE_ITEM_DEFAULT_TAG, SIDEBAR_COLLAPSIBLE_ITEM_DEFAULT_JUSTIFY, SIDEBAR_COLLAPSIBLE_ITEM_AUTO_CENTER, } from './constants';
|
|
@@ -14,8 +14,8 @@ export var SidebarCollapsibleItem = polymorphicComponentWithRef(function (inProp
|
|
|
14
14
|
props: inProps,
|
|
15
15
|
name: 'SidebarCollapsibleItem',
|
|
16
16
|
});
|
|
17
|
-
var _a = props.as, as = _a === void 0 ? SIDEBAR_COLLAPSIBLE_ITEM_DEFAULT_TAG : _a, className = props.className, fixed = props.fixed, classNames = props.classNames, _b = props.justify, justify = _b === void 0 ? SIDEBAR_COLLAPSIBLE_ITEM_DEFAULT_JUSTIFY : _b, _c = props.animated, animated = _c === void 0 ? true : _c, children = props.children, collapsed = props.collapsed, _d = props.autoCenter, autoCenter = _d === void 0 ? SIDEBAR_COLLAPSIBLE_ITEM_AUTO_CENTER : _d, other = __rest(props, ["as", "className", "fixed", "classNames", "justify", "animated", "children", "collapsed", "autoCenter"]);
|
|
18
|
-
var
|
|
17
|
+
var _a = props.as, as = _a === void 0 ? SIDEBAR_COLLAPSIBLE_ITEM_DEFAULT_TAG : _a, className = props.className, fixed = props.fixed, classNames = props.classNames, _b = props.justify, justify = _b === void 0 ? SIDEBAR_COLLAPSIBLE_ITEM_DEFAULT_JUSTIFY : _b, _c = props.animated, animated = _c === void 0 ? true : _c, children = props.children, collapsed = props.collapsed, _d = props.autoCenter, autoCenter = _d === void 0 ? SIDEBAR_COLLAPSIBLE_ITEM_AUTO_CENTER : _d, contentFullWidth = props.contentFullWidth, other = __rest(props, ["as", "className", "fixed", "classNames", "justify", "animated", "children", "collapsed", "autoCenter", "contentFullWidth"]);
|
|
18
|
+
var _e = useSidebarContext(), variant = _e.variant, size = _e.size;
|
|
19
19
|
var isCollapsed = collapsed !== null && collapsed !== void 0 ? collapsed : variant === 'mini';
|
|
20
20
|
var internalRef = useRef(null);
|
|
21
21
|
var itemRef = useMultiRef([ref, internalRef]);
|
|
@@ -26,15 +26,22 @@ export var SidebarCollapsibleItem = polymorphicComponentWithRef(function (inProp
|
|
|
26
26
|
props: { collapsed: isCollapsed },
|
|
27
27
|
})
|
|
28
28
|
: fixed;
|
|
29
|
-
var
|
|
29
|
+
var _f = useSidebarCollapsibleItemAnimation({
|
|
30
30
|
autoCenter: autoCenter,
|
|
31
31
|
ref: internalRef,
|
|
32
32
|
fixedRef: fixedRef,
|
|
33
33
|
isCollapsed: isCollapsed,
|
|
34
|
-
}), onExit =
|
|
34
|
+
}), onExit = _f.onExit, onEnter = _f.onEnter, onTransitionEnd = _f.onTransitionEnd, hasMarginAutoClass = _f.hasMarginAutoClass;
|
|
35
35
|
return (React.createElement(CSSTransition, { nodeRef: internalRef, in: isCollapsed, timeout: { enter: 120, exit: 120 }, appear: true, onEnter: onEnter, onExit: onExit, onEntered: onTransitionEnd, onExited: onTransitionEnd },
|
|
36
36
|
React.createElement(Stack, __assign({}, other, { ref: itemRef, as: as, className: cnSidebarCollapsibleItem({ collapsed: isCollapsed, animated: animated, center: hasMarginAutoClass }, [className]), justify: justify }),
|
|
37
37
|
React.createElement("div", { ref: fixedRef, className: cnSidebarCollapsibleItem('Fixed', [classNames === null || classNames === void 0 ? void 0 : classNames.fixed]) }, fixedRendered),
|
|
38
|
-
React.createElement("div", { className: cnSidebarCollapsibleItem('
|
|
38
|
+
React.createElement("div", { className: cnSidebarCollapsibleItem('ContentWrapper', [
|
|
39
|
+
classNames === null || classNames === void 0 ? void 0 : classNames.contentWrapper,
|
|
40
|
+
]), style: generateCSSVariables({
|
|
41
|
+
'sidebar-collapsible-item-content-width': "".concat(contentFullWidth[size], "px"),
|
|
42
|
+
}) },
|
|
43
|
+
React.createElement("div", { className: cnSidebarCollapsibleItem('Content', [
|
|
44
|
+
classNames === null || classNames === void 0 ? void 0 : classNames.content,
|
|
45
|
+
]) }, children)))));
|
|
39
46
|
});
|
|
40
47
|
SidebarCollapsibleItem.displayName = 'SidebarCollapsibleItem';
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
letter-spacing: var(--typography-text-m_1-letter_spacing, 0);
|
|
21
21
|
text-transform: var(--typography-text-m_1-text_transform, none);
|
|
22
22
|
color: var(--sidebar-content-primary-color);
|
|
23
|
-
white-space: nowrap;
|
|
24
23
|
}
|
|
25
24
|
.SidebarHeaderLogo-Icon {
|
|
26
25
|
background-color: var(--sidebar-header-icon-background);
|
|
@@ -14,6 +14,9 @@ export var SidebarHeaderLogo = polymorphicComponentWithRef(function (inProps, re
|
|
|
14
14
|
});
|
|
15
15
|
var _a = props.as, as = _a === void 0 ? SIDEBAR_HEADER_LOGO_DEFAULT_TAG : _a, className = props.className, children = props.children, icon = props.icon, other = __rest(props, ["as", "className", "children", "icon"]);
|
|
16
16
|
var _b = useSidebarContext(), color = _b.color, variant = _b.variant, size = _b.size;
|
|
17
|
-
return (React.createElement(SidebarCollapsibleItem, __assign({}, other, { as: as, fixed: React.createElement(Stack, { className: cnSidebarHeaderLogo('Icon'), justify: "center", align: "center" }, icon), collapsed: variant !== 'full', classNames: { content: cnSidebarHeaderLogo('Text') }, ref: ref, className: cnSidebarHeaderLogo({ color: color, size: size }, [className]), align: "center"
|
|
17
|
+
return (React.createElement(SidebarCollapsibleItem, __assign({}, other, { as: as, fixed: React.createElement(Stack, { className: cnSidebarHeaderLogo('Icon'), justify: "center", align: "center" }, icon), collapsed: variant !== 'full', classNames: { content: cnSidebarHeaderLogo('Text') }, ref: ref, className: cnSidebarHeaderLogo({ color: color, size: size }, [className]), align: "center", contentFullWidth: {
|
|
18
|
+
s: 184,
|
|
19
|
+
m: 200,
|
|
20
|
+
} }), children));
|
|
18
21
|
});
|
|
19
22
|
SidebarHeaderLogo.displayName = 'SidebarHeaderLogo';
|
|
@@ -51,7 +51,10 @@ export var SidebarItem = polymorphicComponentWithRef(function (inProps, ref) {
|
|
|
51
51
|
React.createElement(SidebarCollapsibleItem, __assign({}, other, { as: as, onClick: function (event) {
|
|
52
52
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
53
53
|
setIsOpenSubItems(!isOpenSubitems);
|
|
54
|
-
}, collapsed: isCollapsed, className: cnSidebarItem('Item'),
|
|
54
|
+
}, collapsed: isCollapsed, className: cnSidebarItem('Item'), contentFullWidth: {
|
|
55
|
+
s: 180,
|
|
56
|
+
m: 196,
|
|
57
|
+
}, autoCenter: false, fixed: function (props) {
|
|
55
58
|
var badge = isFunction(badgeProp)
|
|
56
59
|
? badgeProp({ collapsed: props.collapsed })
|
|
57
60
|
: badgeProp;
|
|
@@ -24,6 +24,9 @@ export var SidebarUser = polymorphicComponentWithRef(function (inProps, ref) {
|
|
|
24
24
|
} })), collapsed: isCollapsed, classNames: {
|
|
25
25
|
content: cnSidebarUser('Content'),
|
|
26
26
|
fixed: cnSidebarUser('Fixed'),
|
|
27
|
+
}, contentFullWidth: {
|
|
28
|
+
s: 184,
|
|
29
|
+
m: 200,
|
|
27
30
|
} }),
|
|
28
31
|
React.createElement(Stack, { direction: "column", className: cnSidebarUser('Info') },
|
|
29
32
|
React.createElement(Typography, { variant: "text-s", as: "span", className: cnSidebarUser('Name') }, name),
|
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
.SidebarUserMenu-Button_open .SidebarUserMenu-Chevron {
|
|
32
32
|
transform: rotate(180deg);
|
|
33
33
|
}
|
|
34
|
+
.SidebarUserMenu-Button .SidebarUserMenu-LabelWrapper {
|
|
35
|
+
overflow: initial;
|
|
36
|
+
text-overflow: initial;
|
|
37
|
+
white-space: initial;
|
|
38
|
+
}
|
|
34
39
|
.SidebarUserMenu-Label {
|
|
35
40
|
display: -webkit-box;
|
|
36
41
|
-webkit-box-orient: block-axis;
|
|
@@ -37,9 +37,11 @@ export var SidebarUserMenu = polymorphicComponentWithRef(function (inProps, ref)
|
|
|
37
37
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
38
38
|
}, style: generateCSSVariables({
|
|
39
39
|
'sidebar-user-menu-ellipsis': maxLines.toString(),
|
|
40
|
-
}), className: cnSidebarUserMenu('Button', { color: color, open: isOpen, manyLines: isManyLines }, [className]),
|
|
40
|
+
}), className: cnSidebarUserMenu('Button', { color: color, open: isOpen, manyLines: isManyLines }, [className]), labelProps: {
|
|
41
|
+
className: cnSidebarUserMenu('LabelWrapper'),
|
|
42
|
+
}, size: "2xs", iconRight: React.createElement(ChevronDownSmallIcon, { className: cnSidebarUserMenu('Chevron') }) }),
|
|
41
43
|
React.createElement(Typography, { variant: labelVariant, className: cnSidebarUserMenu('Label'), color: "inherit", as: "span" }, label)),
|
|
42
|
-
React.createElement(Menu, __assign({ placement: "right-end" }, menuProps, { size: (_a = menuProps === null || menuProps === void 0 ? void 0 : menuProps.size) !== null && _a !== void 0 ? _a : SIDEBAR_USER_MENU_DEFAULT_MENU_SIZE,
|
|
44
|
+
React.createElement(Menu, __assign({ placement: "right-end", anchorRef: buttonRef, color: color }, menuProps, { size: (_a = menuProps === null || menuProps === void 0 ? void 0 : menuProps.size) !== null && _a !== void 0 ? _a : SIDEBAR_USER_MENU_DEFAULT_MENU_SIZE, open: isOpen, className: cnSidebarUserMenu('Menu', [menuProps === null || menuProps === void 0 ? void 0 : menuProps.className]), onClose: function () {
|
|
43
45
|
var _a;
|
|
44
46
|
setIsOpen(false);
|
|
45
47
|
(_a = menuProps === null || menuProps === void 0 ? void 0 : menuProps.onClose) === null || _a === void 0 ? void 0 : _a.call(menuProps);
|
package/__inner__/types/components/AutocompleteNext/components/AutocompleteDropdown/types.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export type AutocompleteDropdownProps<OPTION = AutocompleteDefaultOption, MULTIP
|
|
|
37
37
|
/** Свойства компонента Popover */
|
|
38
38
|
popoverProps?: Partial<Omit<PopoverProps, 'children' | 'open' | 'anchorRef' | 'onClose' | 'className'>>;
|
|
39
39
|
/** Свойства компонента List */
|
|
40
|
-
listProps?: Partial<Omit<ListProps, 'children'>>;
|
|
40
|
+
listProps?: Partial<Omit<ListProps, 'children' | 'color'>>;
|
|
41
41
|
loading?: boolean;
|
|
42
42
|
hasOptions?: boolean;
|
|
43
43
|
'data-testid'?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './size';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ReactNode, ElementType, SyntheticEvent } from 'react';
|
|
2
2
|
import type React from 'react';
|
|
3
|
-
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
4
3
|
import type { WithDisplayName } from '../../types/react';
|
|
5
4
|
import type { PolymorphicComponentPropsWithRef, PolymorphicComponentRef } from '../../utils/polymorphicComponentWithRef';
|
|
6
5
|
import type { ListProps } from '../List';
|
|
7
6
|
import type { PopoverBaseProps } from '../Popover';
|
|
8
7
|
import type { DATA_LIST_DEFAULT_TAG } from './constants';
|
|
8
|
+
import type { DataListSizeVariant } from './entities';
|
|
9
9
|
export type DataListValue = string | number;
|
|
10
10
|
export type DataListSelected<MULTIPLE extends boolean> = (MULTIPLE extends true ? DataListValue[] : DataListValue) | undefined;
|
|
11
11
|
export type DataListPayload<MULTIPLE extends boolean> = {
|
|
@@ -25,7 +25,7 @@ export type DataListBaseProps<MULTIPLE extends boolean = false> = {
|
|
|
25
25
|
/** Дополнительные CSS-классы */
|
|
26
26
|
className?: string;
|
|
27
27
|
/** Размер компонента */
|
|
28
|
-
size?:
|
|
28
|
+
size?: DataListSizeVariant;
|
|
29
29
|
/** Выбранная или выбранные опции */
|
|
30
30
|
selected?: DataListSelected<MULTIPLE>;
|
|
31
31
|
/** Выбранная опция по умолчанию */
|
|
@@ -33,7 +33,7 @@ export type DataListBaseProps<MULTIPLE extends boolean = false> = {
|
|
|
33
33
|
/** Функция обратного вызова для выбора значения */
|
|
34
34
|
onSelect?: DataListOnSelect<MULTIPLE>;
|
|
35
35
|
/** Свойства компонента List */
|
|
36
|
-
listProps?: ListProps
|
|
36
|
+
listProps?: Omit<ListProps, 'color'>;
|
|
37
37
|
} & Omit<PopoverBaseProps, 'onSelect'>;
|
|
38
38
|
export type DataListRef = PolymorphicComponentRef<typeof DATA_LIST_DEFAULT_TAG>;
|
|
39
39
|
export type DataListProps<As extends ElementType = typeof DATA_LIST_DEFAULT_TAG, MULTIPLE extends boolean = false> = PolymorphicComponentPropsWithRef<DataListBaseProps<MULTIPLE>, As>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ListSizeVariant } from './entities';
|
|
3
|
+
export type ListContextValue = {
|
|
4
|
+
size: ListSizeVariant;
|
|
5
|
+
};
|
|
3
6
|
export declare const ListContext: React.Context<ListContextValue>;
|
|
4
7
|
export declare const useListContext: () => ListContextValue;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const LIST_DEFAULT_SIZE = "m";
|
|
2
2
|
export declare const LIST_DEFAULT_DISABLE_PADDING = false;
|
|
3
3
|
export declare const LIST_DEFAULT_TAG = "ul";
|
|
4
|
+
export declare const LIST_DEFAULT_COLOR = "main";
|
|
4
5
|
export declare const LIST_ITEM_DEFAULT_TAG = "li";
|
|
5
6
|
export declare const LIST_ITEM_DEFAULT_ALIGN = "center";
|
|
6
7
|
export declare const LIST_ITEM_BUTTON_DEFAULT_TAG = "div";
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import type { ElementType, ReactNode } from 'react';
|
|
2
|
-
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
3
2
|
import type { PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
4
3
|
import type { LIST_DEFAULT_TAG } from './constants';
|
|
5
|
-
|
|
6
|
-
export type ListContextValue = {
|
|
7
|
-
size: ListSizeVariant;
|
|
8
|
-
};
|
|
4
|
+
import type { ListColorVariant, ListSizeVariant } from './entities';
|
|
9
5
|
export type ListBaseProps = {
|
|
10
6
|
/** Содержимое компонента */
|
|
11
7
|
children?: ReactNode;
|
|
12
8
|
/** Размер компонента */
|
|
13
9
|
size?: ListSizeVariant;
|
|
10
|
+
/** Цвет компонента */
|
|
11
|
+
color?: ListColorVariant;
|
|
14
12
|
/** Если `true` отключает боковые отступы */
|
|
15
13
|
disablePadding?: boolean;
|
|
16
14
|
/** Идентификатор компонента для тестов */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ComponentRef, RefObject } from 'react';
|
|
2
2
|
import type { ExtendableComponentPropsWithRef } from '../../types/ExtendableComponentPropsWithRef';
|
|
3
|
-
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
4
3
|
import type { PopoverBaseProps } from '../Popover';
|
|
5
4
|
import type { MenuListProps } from './components';
|
|
5
|
+
import type { MenuColorVariant, MenuSizeVariant } from './entities';
|
|
6
6
|
export type MenuRef = ComponentRef<'div'>;
|
|
7
7
|
export type MenuProps = ExtendableComponentPropsWithRef<{
|
|
8
8
|
/** Свойства компонента MenuList */
|
|
@@ -13,5 +13,7 @@ export type MenuProps = ExtendableComponentPropsWithRef<{
|
|
|
13
13
|
* */
|
|
14
14
|
menuListRef?: RefObject<HTMLDivElement>;
|
|
15
15
|
/** Размер компонента */
|
|
16
|
-
size?:
|
|
16
|
+
size?: MenuSizeVariant;
|
|
17
|
+
/** Цвет компонента */
|
|
18
|
+
color?: MenuColorVariant;
|
|
17
19
|
} & Omit<PopoverBaseProps, 'disableEnforceFocus'>, 'div'>;
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import type { ComponentRef, ElementType, ReactNode } from 'react';
|
|
2
2
|
import type { PolymorphicComponentPropsWithRef, RenderContentType } from '../../../../utils';
|
|
3
3
|
import type { StackBaseProps } from '../../../Stack';
|
|
4
|
+
import type { SidebarSizeVariant } from '../../entities';
|
|
4
5
|
import type { SIDEBAR_COLLAPSIBLE_ITEM_DEFAULT_TAG } from './constants';
|
|
5
6
|
export type SidebarCollapsibleItemClassNames = {
|
|
6
7
|
content?: string;
|
|
8
|
+
contentWrapper?: string;
|
|
7
9
|
fixed?: string;
|
|
8
10
|
};
|
|
9
11
|
export type SidebarCollapsibleItemFixedProps = {
|
|
10
12
|
collapsed: boolean;
|
|
11
13
|
};
|
|
12
14
|
export type SidebarCollapsibleItemFixed = RenderContentType<SidebarCollapsibleItemFixedProps>['content'];
|
|
15
|
+
export type SidebarCollapsibleItemContentFullWidth = Record<SidebarSizeVariant, number>;
|
|
13
16
|
export type SidebarCollapsibleItemBaseProps = {
|
|
14
17
|
/** Фиксированная часть */
|
|
15
18
|
fixed: SidebarCollapsibleItemFixed;
|
|
19
|
+
/** Полная ширина контента для full-варианта */
|
|
20
|
+
contentFullWidth: SidebarCollapsibleItemContentFullWidth;
|
|
16
21
|
/** Кастомный класс */
|
|
17
22
|
className?: string;
|
|
18
23
|
/** Кастомный классы блоков */
|
|
@@ -19,7 +19,7 @@ export type SidebarUserMenuBaseProps = {
|
|
|
19
19
|
open: boolean;
|
|
20
20
|
}) => void;
|
|
21
21
|
/** Свойства компонента Menu */
|
|
22
|
-
menuProps?: Omit<MenuProps, '
|
|
22
|
+
menuProps?: Omit<MenuProps, 'open'>;
|
|
23
23
|
/** Максимальное количество строк */
|
|
24
24
|
maxLines?: number;
|
|
25
25
|
/** Идентификатор компонента для тестов */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ozen-ui/kit",
|
|
3
|
-
"version": "0.84.
|
|
3
|
+
"version": "0.84.3",
|
|
4
4
|
"description": "React component library",
|
|
5
5
|
"files": [
|
|
6
6
|
"*"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"react-popper": "^2.3.0",
|
|
30
30
|
"react-transition-group": "^4.4.5",
|
|
31
31
|
"tslib": "^2.6.3",
|
|
32
|
-
"@ozen-ui/
|
|
33
|
-
"@ozen-ui/
|
|
34
|
-
"@ozen-ui/icons": "0.84.
|
|
32
|
+
"@ozen-ui/logger": "0.84.3",
|
|
33
|
+
"@ozen-ui/fonts": "0.84.3",
|
|
34
|
+
"@ozen-ui/icons": "0.84.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/lodash.isequal": "^4.5.0"
|