@ozen-ui/kit 0.84.1 → 0.84.2
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/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 +3 -1
- 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 +3 -1
- package/__inner__/types/components/Sidebar/modules/SidebarCollapsibleItem/types.d.ts +5 -0
- package/package.json +4 -4
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,7 +40,9 @@ 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
47
|
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, anchorRef: buttonRef, open: isOpen, className: (0, exports.cnSidebarUserMenu)('Menu', [menuProps === null || menuProps === void 0 ? void 0 : menuProps.className]), onClose: function () {
|
|
46
48
|
var _a;
|
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,7 +37,9 @@ 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
44
|
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, anchorRef: buttonRef, open: isOpen, className: cnSidebarUserMenu('Menu', [menuProps === null || menuProps === void 0 ? void 0 : menuProps.className]), onClose: function () {
|
|
43
45
|
var _a;
|
|
@@ -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
|
/** Кастомный классы блоков */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ozen-ui/kit",
|
|
3
|
-
"version": "0.84.
|
|
3
|
+
"version": "0.84.2",
|
|
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/fonts": "0.84.
|
|
33
|
-
"@ozen-ui/logger": "0.84.
|
|
34
|
-
"@ozen-ui/icons": "0.84.
|
|
32
|
+
"@ozen-ui/fonts": "0.84.2",
|
|
33
|
+
"@ozen-ui/logger": "0.84.2",
|
|
34
|
+
"@ozen-ui/icons": "0.84.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/lodash.isequal": "^4.5.0"
|