@astral/ui 4.23.0 → 4.24.1
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/components/BottomDrawer/BottomDrawer.js +2 -2
- package/components/BottomDrawer/constants.d.ts +3 -0
- package/components/BottomDrawer/constants.js +4 -0
- package/components/BottomDrawer/index.d.ts +1 -0
- package/components/BottomDrawer/index.js +1 -0
- package/components/BottomDrawer/public.d.ts +1 -0
- package/components/BottomDrawer/public.js +1 -0
- package/components/DashboardContext/DashboardContext.d.ts +2 -1
- package/components/DashboardContext/DashboardContext.js +2 -1
- package/components/DashboardContext/DashboardContextProvider/DashboardContextProvider.js +9 -2
- package/components/DashboardLayout/Header/Header.js +3 -9
- package/components/DashboardLayout/Header/useLogic/useLogic.d.ts +6 -1
- package/components/DashboardLayout/Header/useLogic/useLogic.js +18 -2
- package/components/DashboardSidebar/DashboardSidebar.js +2 -4
- package/components/DashboardSidebar/constants.d.ts +1 -0
- package/components/DashboardSidebar/constants.js +1 -0
- package/components/DashboardSidebar/styles.js +6 -0
- package/components/DashboardSidebar/useLogic/useLogic.d.ts +2 -1
- package/components/DashboardSidebar/useLogic/useLogic.js +10 -3
- package/components/MenuOrganization/MenuOrganization.js +5 -6
- package/components/MenuOrganization/NoData/styles.js +4 -0
- package/components/MenuOrganization/OrganizationButton/constants.d.ts +1 -0
- package/components/MenuOrganization/OrganizationButton/constants.js +1 -0
- package/components/MenuOrganization/OrganizationButton/index.d.ts +1 -0
- package/components/MenuOrganization/OrganizationButton/index.js +1 -0
- package/components/MenuOrganization/OrganizationButton/styles.js +22 -0
- package/components/MenuOrganization/OrganizationItem/styles.d.ts +1 -1
- package/components/MenuOrganization/OrganizationItem/styles.js +9 -0
- package/components/MenuOrganization/OrganizationListSkeleton/styles.js +12 -0
- package/components/MenuOrganization/constants.d.ts +2 -0
- package/components/MenuOrganization/constants.js +2 -0
- package/components/MenuOrganization/styles.d.ts +11 -0
- package/components/MenuOrganization/styles.js +82 -0
- package/components/MenuOrganization/useLogic/useLogic.d.ts +14 -4
- package/components/MenuOrganization/useLogic/useLogic.js +21 -2
- package/components/PageHeader/Title/Title.js +1 -1
- package/components/Popover/Popover.d.ts +1 -1
- package/components/Popover/Popover.js +3 -3
- package/components/placeholders/Placeholder/Placeholder.js +2 -2
- package/components/placeholders/Placeholder/constants.d.ts +4 -0
- package/components/placeholders/Placeholder/constants.js +5 -0
- package/components/placeholders/Placeholder/index.d.ts +1 -0
- package/components/placeholders/Placeholder/index.js +1 -0
- package/components/placeholders/Placeholder/public.d.ts +1 -0
- package/components/placeholders/Placeholder/public.js +1 -0
- package/node/components/BottomDrawer/BottomDrawer.js +1 -1
- package/node/components/BottomDrawer/constants.d.ts +3 -0
- package/node/components/BottomDrawer/constants.js +5 -1
- package/node/components/BottomDrawer/index.d.ts +1 -0
- package/node/components/BottomDrawer/index.js +3 -0
- package/node/components/BottomDrawer/public.d.ts +1 -0
- package/node/components/BottomDrawer/public.js +3 -0
- package/node/components/DashboardContext/DashboardContext.d.ts +2 -1
- package/node/components/DashboardContext/DashboardContext.js +1 -0
- package/node/components/DashboardContext/DashboardContextProvider/DashboardContextProvider.js +8 -1
- package/node/components/DashboardLayout/Header/Header.js +2 -8
- package/node/components/DashboardLayout/Header/useLogic/useLogic.d.ts +6 -1
- package/node/components/DashboardLayout/Header/useLogic/useLogic.js +18 -2
- package/node/components/DashboardSidebar/DashboardSidebar.js +2 -4
- package/node/components/DashboardSidebar/constants.d.ts +1 -0
- package/node/components/DashboardSidebar/constants.js +1 -0
- package/node/components/DashboardSidebar/styles.js +6 -0
- package/node/components/DashboardSidebar/useLogic/useLogic.d.ts +2 -1
- package/node/components/DashboardSidebar/useLogic/useLogic.js +9 -2
- package/node/components/MenuOrganization/MenuOrganization.js +3 -4
- package/node/components/MenuOrganization/NoData/styles.js +4 -0
- package/node/components/MenuOrganization/OrganizationButton/constants.d.ts +1 -0
- package/node/components/MenuOrganization/OrganizationButton/constants.js +4 -0
- package/node/components/MenuOrganization/OrganizationButton/index.d.ts +1 -0
- package/node/components/MenuOrganization/OrganizationButton/index.js +3 -0
- package/node/components/MenuOrganization/OrganizationButton/styles.js +22 -0
- package/node/components/MenuOrganization/OrganizationItem/styles.d.ts +1 -1
- package/node/components/MenuOrganization/OrganizationItem/styles.js +11 -2
- package/node/components/MenuOrganization/OrganizationListSkeleton/styles.js +12 -0
- package/node/components/MenuOrganization/constants.d.ts +2 -0
- package/node/components/MenuOrganization/constants.js +3 -1
- package/node/components/MenuOrganization/styles.d.ts +11 -0
- package/node/components/MenuOrganization/styles.js +87 -5
- package/node/components/MenuOrganization/useLogic/useLogic.d.ts +14 -4
- package/node/components/MenuOrganization/useLogic/useLogic.js +21 -2
- package/node/components/PageHeader/Title/Title.js +1 -1
- package/node/components/Popover/Popover.d.ts +1 -1
- package/node/components/Popover/Popover.js +3 -3
- package/node/components/placeholders/Placeholder/Placeholder.js +1 -1
- package/node/components/placeholders/Placeholder/constants.d.ts +4 -0
- package/node/components/placeholders/Placeholder/constants.js +6 -1
- package/node/components/placeholders/Placeholder/index.d.ts +1 -0
- package/node/components/placeholders/Placeholder/index.js +3 -0
- package/node/components/placeholders/Placeholder/public.d.ts +1 -0
- package/node/components/placeholders/Placeholder/public.js +3 -0
- package/package.json +1 -1
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { useCallback, useContext, useMemo, useState, } from 'react';
|
|
2
2
|
import { DashboardContext } from '../../DashboardContext';
|
|
3
|
+
import { DashboardSidebarContext } from '../../DashboardSidebarProvider';
|
|
3
4
|
import { useHidePersonalData } from '../../personalDataSecurity';
|
|
4
5
|
import { usePopover } from '../../usePopover';
|
|
6
|
+
import { useViewportType } from '../../useViewportType';
|
|
7
|
+
import { classNames } from '../../utils/classNames';
|
|
8
|
+
import { menuOrganizationClassnames } from '../constants';
|
|
5
9
|
export const useLogic = ({ organizations = [], onChangeSearch, onChange, currentOrganizationGroupLabel, currentOrganization, groupBy, onClose, onOpen, isOpen: isOpenPopover, isDisabled, disabledReason, isHidePersonalData, action, isLoading, isError, onRetry, renderItem, renderPreview, }) => {
|
|
6
|
-
const { isLoading: isDashboardLoading } = useContext(DashboardContext);
|
|
10
|
+
const { isLoading: isDashboardLoading, alertHeight } = useContext(DashboardContext);
|
|
7
11
|
const [searchValue, setSearchValue] = useState('');
|
|
8
12
|
const [anchorButtonEl, setAnchorButtonEl] = useState(null);
|
|
13
|
+
const { isPinned } = useContext(DashboardSidebarContext);
|
|
14
|
+
const { isMobile } = useViewportType();
|
|
15
|
+
const { onClick, ...restActionProps } = action || {};
|
|
9
16
|
const buttonRef = useCallback((node) => {
|
|
10
17
|
if (node) {
|
|
11
18
|
setAnchorButtonEl(node);
|
|
@@ -37,6 +44,10 @@ export const useLogic = ({ organizations = [], onChangeSearch, onChange, current
|
|
|
37
44
|
onChange(organization);
|
|
38
45
|
handleClosePopover();
|
|
39
46
|
};
|
|
47
|
+
const handleActionClick = (event) => {
|
|
48
|
+
onClick?.(event);
|
|
49
|
+
handleClosePopover();
|
|
50
|
+
};
|
|
40
51
|
const isShowCurrentOrganization = useMemo(() => {
|
|
41
52
|
return (!searchValue.length || filteredOrganization.includes(currentOrganization));
|
|
42
53
|
}, [currentOrganization, filteredOrganization, searchValue.length]);
|
|
@@ -53,8 +64,13 @@ export const useLogic = ({ organizations = [], onChangeSearch, onChange, current
|
|
|
53
64
|
const renderPreviewWrapper = useMemo(() => renderPreview
|
|
54
65
|
? (organization, params) => renderPreview(organization, params)
|
|
55
66
|
: undefined, [renderPreview]);
|
|
67
|
+
const classnames = useMemo(() => classNames({ [menuOrganizationClassnames.mobileVisible]: isPinned }), [isPinned]);
|
|
56
68
|
return {
|
|
57
|
-
|
|
69
|
+
actionButtonProps: {
|
|
70
|
+
onClick: handleActionClick,
|
|
71
|
+
...restActionProps,
|
|
72
|
+
},
|
|
73
|
+
hasAction: Boolean(action),
|
|
58
74
|
isLoading,
|
|
59
75
|
isError,
|
|
60
76
|
onRetry,
|
|
@@ -92,5 +108,8 @@ export const useLogic = ({ organizations = [], onChangeSearch, onChange, current
|
|
|
92
108
|
hasSearch: isShowSearchField,
|
|
93
109
|
},
|
|
94
110
|
isShowSearchField,
|
|
111
|
+
isMobile,
|
|
112
|
+
classnames,
|
|
113
|
+
alertHeight,
|
|
95
114
|
};
|
|
96
115
|
};
|
|
@@ -6,5 +6,5 @@ export const Title = ({ backButton, title, isLoading, hasDescription, hasBreadcr
|
|
|
6
6
|
if (!title && isLoading) {
|
|
7
7
|
return _jsx(StyledSkeleton, { height: 20, width: 280, variant: "rounded" });
|
|
8
8
|
}
|
|
9
|
-
return (_jsxs(_Fragment, { children: [backButton && (_jsx(BackButton, { ...backButton, variant: "outlined", color: "grey", size: "medium", children: _jsx(ArrowLOutlineMd, {}) })), typeof title === 'string' ? (_jsx(TitleWrapper, { component: "h1", variant: "h3", "$hasDescription": hasDescription, "$hasBreadcrumbs": hasBreadcrumbs, children: _jsx(OverflowTypography, { component: "div", variant: "inherit", children: title }) })) : (_jsx(TitleWrapper, { component: "div", role: "heading", variant: "h3", "aria-level": 1, "$hasDescription": hasDescription, "$hasBreadcrumbs": hasBreadcrumbs, children: title }))] }));
|
|
9
|
+
return (_jsxs(_Fragment, { children: [backButton && (_jsx(BackButton, { ...backButton, variant: "outlined", color: "grey", size: "medium", children: _jsx(ArrowLOutlineMd, {}) })), typeof title === 'string' ? (_jsx(TitleWrapper, { component: "h1", variant: "h3", "$hasDescription": hasDescription || isLoading, "$hasBreadcrumbs": hasBreadcrumbs, children: _jsx(OverflowTypography, { component: "div", variant: "inherit", children: title }) })) : (_jsx(TitleWrapper, { component: "div", role: "heading", variant: "h3", "aria-level": 1, "$hasDescription": hasDescription, "$hasBreadcrumbs": hasBreadcrumbs, children: title }))] }));
|
|
10
10
|
};
|
|
@@ -6,4 +6,4 @@ export type PopoverProps = WithoutEmotionSpecific<MuiPopoverProps> & {
|
|
|
6
6
|
*/
|
|
7
7
|
title?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const Popover: ({ children, onClose, open, title, ...restProps }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const Popover: ({ children, onClose, open, title, className, ...restProps }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { BottomDrawer } from '../BottomDrawer';
|
|
3
3
|
import { useViewportType } from '../useViewportType';
|
|
4
4
|
import { StyledMuiPopover } from './styles';
|
|
5
|
-
export const Popover = ({ children, onClose, open, title, ...restProps }) => {
|
|
5
|
+
export const Popover = ({ children, onClose, open, title, className, ...restProps }) => {
|
|
6
6
|
const { isMobile } = useViewportType();
|
|
7
7
|
if (isMobile) {
|
|
8
|
-
return (_jsx(BottomDrawer, { title: title, onClose: onClose, open: open, children: children }));
|
|
8
|
+
return (_jsx(BottomDrawer, { title: title, onClose: onClose, open: open, className: className, children: children }));
|
|
9
9
|
}
|
|
10
|
-
return (_jsx(StyledMuiPopover, { open: open, onClose: onClose, ...restProps, children: children }));
|
|
10
|
+
return (_jsx(StyledMuiPopover, { open: open, onClose: onClose, className: className, ...restProps, children: children }));
|
|
11
11
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useMemo } from 'react';
|
|
3
3
|
import { ConfigContext } from '../../ConfigProvider';
|
|
4
|
-
import { DESCRIPTION_LEVEL, IMAGE_HEIGHT, IMAGE_WIDTH, TITLE_HEADER_LEVEL, } from './constants';
|
|
4
|
+
import { DESCRIPTION_LEVEL, IMAGE_HEIGHT, IMAGE_WIDTH, placeholderClassnames, TITLE_HEADER_LEVEL, } from './constants';
|
|
5
5
|
import { Image, setDefaultImageStyles, } from './Image';
|
|
6
6
|
import { Description, Footer, InnerContainer, Title, Wrapper } from './styles';
|
|
7
7
|
export const Placeholder = ({ className, title, imgSrc, imgAlt, description, Actions, size = 'small', renderImage, }) => {
|
|
@@ -10,5 +10,5 @@ export const Placeholder = ({ className, title, imgSrc, imgAlt, description, Act
|
|
|
10
10
|
const RenderImage = useMemo(() => (renderImage && setDefaultImageStyles(renderImage)) ||
|
|
11
11
|
(configRenderImage && setDefaultImageStyles(configRenderImage)) ||
|
|
12
12
|
Image, [renderImage, configRenderImage]);
|
|
13
|
-
return (_jsxs(Wrapper, { "$size": size, className: className, children: [_jsxs(InnerContainer, { "$size": size, children: [imgSrc && (_jsx(RenderImage, { src: imgSrc, alt: imgAlt, width: IMAGE_WIDTH[size], height: IMAGE_HEIGHT[size], size: size })), _jsx(Title, { "$size": size, variant: TITLE_HEADER_LEVEL[size], children: title }), description && (_jsx(Description, { "$size": size, component: "div", variant: DESCRIPTION_LEVEL[size], children: description }))] }), Actions && _jsx(Footer, { children: Actions })] }));
|
|
13
|
+
return (_jsxs(Wrapper, { "$size": size, className: className, children: [_jsxs(InnerContainer, { "$size": size, children: [imgSrc && (_jsx(RenderImage, { src: imgSrc, alt: imgAlt, width: IMAGE_WIDTH[size], height: IMAGE_HEIGHT[size], size: size })), _jsx(Title, { className: placeholderClassnames.title, "$size": size, variant: TITLE_HEADER_LEVEL[size], children: title }), description && (_jsx(Description, { "$size": size, component: "div", variant: DESCRIPTION_LEVEL[size], children: description }))] }), Actions && (_jsx(Footer, { className: placeholderClassnames.footer, children: Actions }))] }));
|
|
14
14
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createUIKitClassname } from '../../utils/createUIKitClassname';
|
|
1
2
|
export const SIZE = {
|
|
2
3
|
Small: 'small',
|
|
3
4
|
Medium: 'medium',
|
|
@@ -28,3 +29,7 @@ export const DESCRIPTION_LEVEL = {
|
|
|
28
29
|
[SIZE.Medium]: 'body1',
|
|
29
30
|
[SIZE.Large]: 'subtitle1',
|
|
30
31
|
};
|
|
32
|
+
export const placeholderClassnames = {
|
|
33
|
+
footer: createUIKitClassname('placeholder__footer'),
|
|
34
|
+
title: createUIKitClassname('placeholder__title'),
|
|
35
|
+
};
|
|
@@ -12,6 +12,6 @@ const BottomDrawer = ({ title, drawerHeaderHeight = constants_1.DEFAULT_HEADER_H
|
|
|
12
12
|
onClose(event, 'escapeKeyDown');
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledDrawer, { ...props, anchor: "bottom", onClose: onClose, children: [(0, jsx_runtime_1.jsxs)(styles_1.Header, { drawerHeaderHeight: drawerHeaderHeight, children: [(0, jsx_runtime_1.jsx)(styles_1.HeaderTitle, { variant: "h6", noWrap: true, children: title }), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", onClick: handleClose, size: "large", children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) })] }), (0, jsx_runtime_1.jsx)(styles_1.Body, { children: children })] }));
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledDrawer, { ...props, anchor: "bottom", onClose: onClose, children: [(0, jsx_runtime_1.jsxs)(styles_1.Header, { drawerHeaderHeight: drawerHeaderHeight, children: [(0, jsx_runtime_1.jsx)(styles_1.HeaderTitle, { variant: "h6", noWrap: true, children: title }), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", onClick: handleClose, size: "large", children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) })] }), (0, jsx_runtime_1.jsx)(styles_1.Body, { className: constants_1.bottomDrawerClassnames.content, children: children })] }));
|
|
16
16
|
};
|
|
17
17
|
exports.BottomDrawer = BottomDrawer;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_HEADER_HEIGHT = exports.OFFSET_TOP_SCREEN = void 0;
|
|
3
|
+
exports.bottomDrawerClassnames = exports.DEFAULT_HEADER_HEIGHT = exports.OFFSET_TOP_SCREEN = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../utils/createUIKitClassname");
|
|
4
5
|
exports.OFFSET_TOP_SCREEN = '16px';
|
|
5
6
|
exports.DEFAULT_HEADER_HEIGHT = 56;
|
|
7
|
+
exports.bottomDrawerClassnames = {
|
|
8
|
+
content: (0, createUIKitClassname_1.createUIKitClassname)('bottom-drawer__content'),
|
|
9
|
+
};
|
|
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.bottomDrawerClassnames = void 0;
|
|
17
18
|
__exportStar(require("./BottomDrawer"), exports);
|
|
19
|
+
var constants_1 = require("./constants");
|
|
20
|
+
Object.defineProperty(exports, "bottomDrawerClassnames", { enumerable: true, get: function () { return constants_1.bottomDrawerClassnames; } });
|
|
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.bottomDrawerClassnames = void 0;
|
|
17
18
|
__exportStar(require("./BottomDrawer"), exports);
|
|
19
|
+
var constants_1 = require("./constants");
|
|
20
|
+
Object.defineProperty(exports, "bottomDrawerClassnames", { enumerable: true, get: function () { return constants_1.bottomDrawerClassnames; } });
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
2
|
export type DashboardContextProps = {
|
|
3
3
|
isFocusedMode: boolean;
|
|
4
4
|
setAlertElement?: (element: HTMLElement | null) => void;
|
|
5
5
|
alertHeight: number;
|
|
6
6
|
isLoading: boolean;
|
|
7
|
+
hasMenuOrganizationRef: RefObject<boolean | null>;
|
|
7
8
|
};
|
|
8
9
|
export declare const DashboardContext: import("react").Context<DashboardContextProps>;
|
package/node/components/DashboardContext/DashboardContextProvider/DashboardContextProvider.js
CHANGED
|
@@ -7,6 +7,7 @@ const DashboardContext_1 = require("../DashboardContext");
|
|
|
7
7
|
const DashboardContextProvider = ({ children, isFocusedMode, isLoading, }) => {
|
|
8
8
|
const [alertElement, setAlertElement] = (0, react_1.useState)(null);
|
|
9
9
|
const [alertHeight, setAlertHeight] = (0, react_1.useState)(0);
|
|
10
|
+
const hasMenuOrganizationRef = (0, react_1.useRef)(false);
|
|
10
11
|
(0, react_1.useEffect)(() => {
|
|
11
12
|
if (!alertElement) {
|
|
12
13
|
setAlertHeight(0);
|
|
@@ -21,6 +22,12 @@ const DashboardContextProvider = ({ children, isFocusedMode, isLoading, }) => {
|
|
|
21
22
|
resizeObserver.observe(alertElement);
|
|
22
23
|
return () => resizeObserver.disconnect();
|
|
23
24
|
}, [alertElement]);
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(DashboardContext_1.DashboardContext.Provider, { value: {
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(DashboardContext_1.DashboardContext.Provider, { value: {
|
|
26
|
+
isFocusedMode,
|
|
27
|
+
setAlertElement,
|
|
28
|
+
alertHeight,
|
|
29
|
+
isLoading,
|
|
30
|
+
hasMenuOrganizationRef,
|
|
31
|
+
}, children: children }));
|
|
25
32
|
};
|
|
26
33
|
exports.DashboardContextProvider = DashboardContextProvider;
|
|
@@ -7,11 +7,8 @@ const CrossOutlineMd_1 = require("../../../icons/CrossOutlineMd");
|
|
|
7
7
|
const MenuOnOutlineMd_1 = require("../../../icons/MenuOnOutlineMd");
|
|
8
8
|
const QuitOutlineMd_1 = require("../../../icons/QuitOutlineMd");
|
|
9
9
|
const Button_1 = require("../../Button");
|
|
10
|
-
const DashboardContext_1 = require("../../DashboardContext");
|
|
11
|
-
const DashboardSidebarProvider_1 = require("../../DashboardSidebarProvider");
|
|
12
10
|
const Product_1 = require("../../Product");
|
|
13
11
|
const Profile_1 = require("../../Profile");
|
|
14
|
-
const useViewportType_1 = require("../../useViewportType");
|
|
15
12
|
const getInertProps_1 = require("../../utils/getInertProps");
|
|
16
13
|
const constants_1 = require("./constants");
|
|
17
14
|
const styles_1 = require("./styles");
|
|
@@ -21,9 +18,6 @@ const useLogic_1 = require("./useLogic");
|
|
|
21
18
|
*/
|
|
22
19
|
exports.Header = (0, react_1.forwardRef)((props, ref) => {
|
|
23
20
|
const { productSwitcher: ProductSwitcher, product, profile, menuOrganization, children, } = props;
|
|
24
|
-
const { isShowExitButton, isShowProfile } = (0, useLogic_1.useLogic)(props);
|
|
25
|
-
|
|
26
|
-
const { collapsedIn, onToggleSidebar } = (0, react_1.useContext)(DashboardSidebarProvider_1.DashboardSidebarContext);
|
|
27
|
-
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.HeaderRoot, { ref: ref, "$isFocusedMode": isFocusedMode, ...(0, getInertProps_1.getInertProps)(!isMobile && isFocusedMode), className: constants_1.dashboardLayoutHeaderClassnames.root, children: (0, jsx_runtime_1.jsxs)(styles_1.HeaderContent, { children: [(0, jsx_runtime_1.jsx)(styles_1.MobileSidebarTogglerWrapper, { className: constants_1.dashboardLayoutHeaderClassnames.mobileSidebarButton, children: (0, jsx_runtime_1.jsx)(Button_1.Button, { startIcon: collapsedIn ? (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) : (0, jsx_runtime_1.jsx)(MenuOnOutlineMd_1.MenuOnOutlineMd, {}), variant: "text", onClick: () => onToggleSidebar() }) }), (0, jsx_runtime_1.jsxs)(styles_1.HeaderSection, { children: [ProductSwitcher && ((0, jsx_runtime_1.jsx)(styles_1.ProductSwitcherWrapper, { children: (0, jsx_runtime_1.jsx)(ProductSwitcher, {}) })), (0, jsx_runtime_1.jsx)(Product_1.Product, { ...product })] }), (0, jsx_runtime_1.jsxs)(styles_1.HeaderContentSection, { children: [children, menuOrganization?.(), profile && ((0, jsx_runtime_1.jsx)(styles_1.ProfileWrapper, { "$isShow": isShowProfile, children: (0, jsx_runtime_1.jsx)(Profile_1.Profile, { isLoading: isLoading, ...profile }) })), (0, jsx_runtime_1.jsx)(styles_1.ExitButton, { "$isShow": isShowExitButton, onClick: profile?.exitButton?.onClick, title: "\u0412\u044B\u0445\u043E\u0434", variant: "text", children: (0, jsx_runtime_1.jsx)(QuitOutlineMd_1.QuitOutlineMd, {}) })] })] }) }));
|
|
21
|
+
const { isShowExitButton, isShowProfile, isFocusedMode, isMobile, collapsedIn, onToggleSidebar, isLoading, } = (0, useLogic_1.useLogic)(props);
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.HeaderRoot, { ref: ref, "$isFocusedMode": isFocusedMode, ...(0, getInertProps_1.getInertProps)(!isMobile && isFocusedMode), className: constants_1.dashboardLayoutHeaderClassnames.root, children: (0, jsx_runtime_1.jsxs)(styles_1.HeaderContent, { children: [(0, jsx_runtime_1.jsx)(styles_1.MobileSidebarTogglerWrapper, { className: constants_1.dashboardLayoutHeaderClassnames.mobileSidebarButton, children: (0, jsx_runtime_1.jsx)(Button_1.Button, { startIcon: collapsedIn ? (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) : (0, jsx_runtime_1.jsx)(MenuOnOutlineMd_1.MenuOnOutlineMd, {}), variant: "text", onClick: () => onToggleSidebar(), title: "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0431\u043E\u043A\u043E\u0432\u043E\u0435 \u043C\u0435\u043D\u044E" }) }), (0, jsx_runtime_1.jsxs)(styles_1.HeaderSection, { children: [ProductSwitcher && ((0, jsx_runtime_1.jsx)(styles_1.ProductSwitcherWrapper, { children: (0, jsx_runtime_1.jsx)(ProductSwitcher, {}) })), (0, jsx_runtime_1.jsx)(Product_1.Product, { ...product })] }), (0, jsx_runtime_1.jsxs)(styles_1.HeaderContentSection, { children: [children, menuOrganization?.(), profile && ((0, jsx_runtime_1.jsx)(styles_1.ProfileWrapper, { "$isShow": isShowProfile, children: (0, jsx_runtime_1.jsx)(Profile_1.Profile, { isLoading: isLoading, ...profile }) })), (0, jsx_runtime_1.jsx)(styles_1.ExitButton, { "$isShow": isShowExitButton, onClick: profile?.exitButton?.onClick, title: "\u0412\u044B\u0445\u043E\u0434", variant: "text", children: (0, jsx_runtime_1.jsx)(QuitOutlineMd_1.QuitOutlineMd, {}) })] })] }) }));
|
|
29
23
|
});
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type HeaderProps } from '../types';
|
|
2
|
-
export declare const useLogic: ({ profile }: HeaderProps) => {
|
|
2
|
+
export declare const useLogic: ({ profile, menuOrganization }: HeaderProps) => {
|
|
3
3
|
isShowExitButton: boolean;
|
|
4
4
|
isShowProfile: boolean;
|
|
5
|
+
isMobile: boolean;
|
|
6
|
+
isFocusedMode: boolean;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
collapsedIn: boolean;
|
|
9
|
+
onToggleSidebar: (newValue?: boolean | undefined) => void;
|
|
5
10
|
};
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useLogic = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const DashboardContext_1 = require("../../../DashboardContext");
|
|
6
|
+
const DashboardSidebarProvider_1 = require("../../../DashboardSidebarProvider");
|
|
4
7
|
const useViewportType_1 = require("../../../useViewportType");
|
|
5
|
-
const useLogic = ({ profile }) => {
|
|
8
|
+
const useLogic = ({ profile, menuOrganization }) => {
|
|
9
|
+
const { isFocusedMode, isLoading, hasMenuOrganizationRef } = (0, react_1.useContext)(DashboardContext_1.DashboardContext);
|
|
10
|
+
const { collapsedIn, onToggleSidebar } = (0, react_1.useContext)(DashboardSidebarProvider_1.DashboardSidebarContext);
|
|
11
|
+
(0, react_1.useEffect)(() => {
|
|
12
|
+
hasMenuOrganizationRef.current = Boolean(menuOrganization);
|
|
13
|
+
}, [menuOrganization]);
|
|
6
14
|
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
7
15
|
const hasMenu = Boolean(profile?.menu || profile?.menuList);
|
|
8
16
|
const isShowProfile = (Boolean(profile) && !isMobile) || (hasMenu && isMobile);
|
|
9
17
|
const isShowExitButton = isMobile && !hasMenu && Boolean(profile?.exitButton);
|
|
10
|
-
return {
|
|
18
|
+
return {
|
|
19
|
+
isShowExitButton,
|
|
20
|
+
isShowProfile,
|
|
21
|
+
isMobile,
|
|
22
|
+
isFocusedMode,
|
|
23
|
+
isLoading,
|
|
24
|
+
collapsedIn,
|
|
25
|
+
onToggleSidebar,
|
|
26
|
+
};
|
|
11
27
|
};
|
|
12
28
|
exports.useLogic = useLogic;
|
|
@@ -6,9 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const DashboardSidebarSkeleton_1 = require("../DashboardSidebarSkeleton");
|
|
7
7
|
const NavMenu_1 = require("../NavMenu");
|
|
8
8
|
const PinButton_1 = require("../PinButton");
|
|
9
|
-
const classNames_1 = require("../utils/classNames");
|
|
10
9
|
const getInertProps_1 = require("../utils/getInertProps");
|
|
11
|
-
const constants_1 = require("./constants");
|
|
12
10
|
const SidebarNav_1 = require("./SidebarNav");
|
|
13
11
|
const styles_1 = require("./styles");
|
|
14
12
|
const useLogic_1 = require("./useLogic");
|
|
@@ -16,9 +14,9 @@ const useLogic_1 = require("./useLogic");
|
|
|
16
14
|
* Основной sidebar приложения
|
|
17
15
|
*/
|
|
18
16
|
exports.DashboardSidebar = (0, react_1.forwardRef)((props, ref) => {
|
|
19
|
-
const { isPinned, isMobile, collapsedIn, onTogglePin, onMouseEnter, onMouseLeave, alertHeight,
|
|
17
|
+
const { isPinned, isMobile, collapsedIn, onTogglePin, onMouseEnter, onMouseLeave, alertHeight, classnames, wrapperClassnames, menu, header, isLoading, } = (0, useLogic_1.useLogic)(props);
|
|
20
18
|
if (isLoading) {
|
|
21
19
|
return (0, jsx_runtime_1.jsx)(DashboardSidebarSkeleton_1.DashboardSidebarSkeleton, {});
|
|
22
20
|
}
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { "$isPinned": isPinned, "$alertHeight": alertHeight, children: (0, jsx_runtime_1.jsx)(styles_1.SidebarRoot, { ref: ref, "$isPinned": isPinned, "$collapsedIn": collapsedIn, className:
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { "$isPinned": isPinned, "$alertHeight": alertHeight, className: wrapperClassnames, children: (0, jsx_runtime_1.jsx)(styles_1.SidebarRoot, { ref: ref, "$isPinned": isPinned, "$collapsedIn": collapsedIn, className: classnames, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ...(0, getInertProps_1.getInertProps)(isMobile && !isPinned), children: (0, jsx_runtime_1.jsxs)(styles_1.StyledPaper, { variant: "outlined", children: [(0, jsx_runtime_1.jsxs)(styles_1.SidebarContent, { "$collapsedIn": collapsedIn, "$isPinned": isPinned, "$hasHeader": Boolean(header), children: [header && (0, jsx_runtime_1.jsx)(styles_1.SidebarHeader, { children: header }), (0, jsx_runtime_1.jsx)(SidebarNav_1.SidebarNav, { menu: (0, jsx_runtime_1.jsx)(NavMenu_1.NavMenu, { collapsedIn: collapsedIn, items: menu.items }) })] }), (0, jsx_runtime_1.jsx)(styles_1.Footer, { children: (0, jsx_runtime_1.jsx)(PinButton_1.PinButton, { isPinned: isPinned, collapsedIn: collapsedIn, onClick: onTogglePin }) })] }) }) }));
|
|
24
22
|
});
|
|
@@ -4,4 +4,5 @@ exports.dashboardSidebarClassnames = void 0;
|
|
|
4
4
|
const createUIKitClassname_1 = require("../utils/createUIKitClassname");
|
|
5
5
|
exports.dashboardSidebarClassnames = {
|
|
6
6
|
root: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout-sidebar'),
|
|
7
|
+
hasMenuOrganization: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout-sidebar_has-menu-organization'),
|
|
7
8
|
};
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Footer = exports.SidebarContent = exports.SidebarHeader = exports.SidebarRoot = exports.StyledPaper = exports.Wrapper = void 0;
|
|
4
4
|
const constants_1 = require("../DashboardLayout/constants");
|
|
5
|
+
const OrganizationButton_1 = require("../MenuOrganization/OrganizationButton");
|
|
5
6
|
const Paper_1 = require("../Paper");
|
|
6
7
|
const PinButton_1 = require("../PinButton");
|
|
7
8
|
const styled_1 = require("../styled");
|
|
9
|
+
const constants_2 = require("./constants");
|
|
8
10
|
exports.Wrapper = (0, styled_1.styled)('div', {
|
|
9
11
|
shouldForwardProp: (prop) => !['$isPinned', '$alertHeight'].includes(prop),
|
|
10
12
|
}) `
|
|
@@ -32,6 +34,10 @@ exports.Wrapper = (0, styled_1.styled)('div', {
|
|
|
32
34
|
duration: theme.transitions.duration.standard,
|
|
33
35
|
});
|
|
34
36
|
}};
|
|
37
|
+
|
|
38
|
+
&.${constants_2.dashboardSidebarClassnames.hasMenuOrganization} {
|
|
39
|
+
top: ${({ $alertHeight }) => `calc(${$alertHeight}px + ${constants_1.HEADER_HEIGHT_MOBILE} + ${OrganizationButton_1.MOBILE_BUTTON_HEIGHT}) `};
|
|
40
|
+
}
|
|
35
41
|
}
|
|
36
42
|
`;
|
|
37
43
|
exports.StyledPaper = (0, styled_1.styled)(Paper_1.Paper) `
|
|
@@ -8,7 +8,6 @@ export declare const useLogic: (props: DashboardSidebarProps) => {
|
|
|
8
8
|
onMouseEnter: () => void;
|
|
9
9
|
onMouseLeave: () => void;
|
|
10
10
|
alertHeight: number;
|
|
11
|
-
className: string | undefined;
|
|
12
11
|
menu: {
|
|
13
12
|
items: [key: string, value: {
|
|
14
13
|
icon: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -28,4 +27,6 @@ export declare const useLogic: (props: DashboardSidebarProps) => {
|
|
|
28
27
|
};
|
|
29
28
|
header: import("react").ReactNode;
|
|
30
29
|
isLoading: boolean;
|
|
30
|
+
classnames: string;
|
|
31
|
+
wrapperClassnames: string;
|
|
31
32
|
};
|
|
@@ -8,10 +8,12 @@ const Main_1 = require("../../DashboardLayout/Main");
|
|
|
8
8
|
const DashboardSidebarProvider_1 = require("../../DashboardSidebarProvider");
|
|
9
9
|
const useTheme_1 = require("../../theme/hooks/useTheme");
|
|
10
10
|
const useViewportType_1 = require("../../useViewportType");
|
|
11
|
+
const classNames_1 = require("../../utils/classNames");
|
|
12
|
+
const constants_1 = require("../constants");
|
|
11
13
|
const useLogic = (props) => {
|
|
12
14
|
const { className, menu, header, isLoading } = props;
|
|
13
15
|
const { onToggleSidebar, isPinned, onTogglePin, collapsedIn, setIsPopupOpen, } = (0, react_1.useContext)(DashboardSidebarProvider_1.DashboardSidebarContext);
|
|
14
|
-
const { alertHeight, isLoading: isDashboardLoading } = (0, react_1.useContext)(DashboardContext_1.DashboardContext);
|
|
16
|
+
const { alertHeight, isLoading: isDashboardLoading, hasMenuOrganizationRef, } = (0, react_1.useContext)(DashboardContext_1.DashboardContext);
|
|
15
17
|
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
16
18
|
const hoverTimerRef = (0, react_1.useRef)(null);
|
|
17
19
|
const theme = (0, useTheme_1.useTheme)();
|
|
@@ -81,6 +83,10 @@ const useLogic = (props) => {
|
|
|
81
83
|
}
|
|
82
84
|
};
|
|
83
85
|
}, [collapsedIn, isPinned]);
|
|
86
|
+
const wrapperClassnames = (0, react_1.useMemo)(() => (0, classNames_1.classNames)({
|
|
87
|
+
[constants_1.dashboardSidebarClassnames.hasMenuOrganization]: hasMenuOrganizationRef.current,
|
|
88
|
+
}), [hasMenuOrganizationRef.current]);
|
|
89
|
+
const classnames = (0, classNames_1.classNames)(className, constants_1.dashboardSidebarClassnames.root);
|
|
84
90
|
return {
|
|
85
91
|
isPinned,
|
|
86
92
|
isMobile,
|
|
@@ -89,10 +95,11 @@ const useLogic = (props) => {
|
|
|
89
95
|
onMouseEnter,
|
|
90
96
|
onMouseLeave,
|
|
91
97
|
alertHeight,
|
|
92
|
-
className,
|
|
93
98
|
menu,
|
|
94
99
|
header,
|
|
95
100
|
isLoading: isLoading || isDashboardLoading,
|
|
101
|
+
classnames,
|
|
102
|
+
wrapperClassnames,
|
|
96
103
|
};
|
|
97
104
|
};
|
|
98
105
|
exports.useLogic = useLogic;
|
|
@@ -4,7 +4,6 @@ exports.MenuOrganization = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const Button_1 = require("../Button");
|
|
6
6
|
const ContentState_1 = require("../ContentState");
|
|
7
|
-
const Popover_1 = require("../Popover");
|
|
8
7
|
const SearchField_1 = require("../SearchField");
|
|
9
8
|
const constants_1 = require("./constants");
|
|
10
9
|
const MenuOrganizationSkeleton_1 = require("./MenuOrganizationSkeleton");
|
|
@@ -16,14 +15,14 @@ const styles_1 = require("./styles");
|
|
|
16
15
|
const useLogic_1 = require("./useLogic");
|
|
17
16
|
const MenuOrganization = (props) => {
|
|
18
17
|
const { anchorOrigin = { vertical: 'bottom', horizontal: 'right' }, transformOrigin = { vertical: 'top', horizontal: 'right' }, } = props;
|
|
19
|
-
const {
|
|
18
|
+
const { actionButtonProps, hasAction, isLoading, isError, onRetry, isComponentLoading, isShowOrganizationList, searchProps, popoverProps, organizationListProps, organizationButtonProps, isShowSearchField, isMobile, classnames, alertHeight, } = (0, useLogic_1.useLogic)(props);
|
|
20
19
|
if (isComponentLoading) {
|
|
21
20
|
return (0, jsx_runtime_1.jsx)(MenuOrganizationSkeleton_1.MenuOrganizationSkeleton, {});
|
|
22
21
|
}
|
|
23
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrganizationButton_1.OrganizationButton, { ...organizationButtonProps }), (0, jsx_runtime_1.jsxs)(
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.ButtonWrapper, { className: classnames, "$alertHeight": alertHeight, children: (0, jsx_runtime_1.jsx)(OrganizationButton_1.OrganizationButton, { ...organizationButtonProps }) }), (0, jsx_runtime_1.jsxs)(styles_1.StyledPopover, { ...popoverProps, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, title: constants_1.POPOVER_TITLE, children: [isShowSearchField && ((0, jsx_runtime_1.jsx)(styles_1.SearchWrapper, { children: (0, jsx_runtime_1.jsx)(SearchField_1.SearchField, { fullWidth: true, ...searchProps }) })), (0, jsx_runtime_1.jsx)(styles_1.OrganizationsWrapper, { "$isLoading": isLoading, className: constants_1.menuOrganizationClassnames.root, children: (0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { isLoading: isLoading, isCustom: isError, customState: {
|
|
24
23
|
title: ((0, jsx_runtime_1.jsx)(styles_1.StyledTypography, { children: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435" })),
|
|
25
24
|
Actions: ((0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "light", color: "grey", onClick: onRetry, children: "\u041F\u043E\u043F\u0440\u043E\u0431\u043E\u0432\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430" })),
|
|
26
25
|
className: constants_1.menuOrganizationClassnames.errorPlaceholder,
|
|
27
|
-
}, loadingContent: (0, jsx_runtime_1.jsx)(OrganizationListSkeleton_1.OrganizationListSkeleton, {}), children: isShowOrganizationList ? ((0, jsx_runtime_1.jsx)(OrganizationList_1.OrganizationList, { ...organizationListProps })) : ((0, jsx_runtime_1.jsx)(NoData_1.NoData, {})) }) }),
|
|
26
|
+
}, loadingContent: (0, jsx_runtime_1.jsx)(OrganizationListSkeleton_1.OrganizationListSkeleton, {}), children: isShowOrganizationList ? ((0, jsx_runtime_1.jsx)(OrganizationList_1.OrganizationList, { ...organizationListProps })) : ((0, jsx_runtime_1.jsx)(NoData_1.NoData, {})) }) }), hasAction && ((0, jsx_runtime_1.jsx)(styles_1.ActionWrapper, { children: (0, jsx_runtime_1.jsx)(Button_1.Button, { fullWidth: true, ...actionButtonProps, size: isMobile ? 'large' : 'medium', children: actionButtonProps.text }) }))] })] }));
|
|
28
27
|
};
|
|
29
28
|
exports.MenuOrganization = MenuOrganization;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MOBILE_BUTTON_HEIGHT = "68px";
|
|
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.MOBILE_BUTTON_HEIGHT = void 0;
|
|
17
18
|
__exportStar(require("./OrganizationButton"), exports);
|
|
19
|
+
var constants_1 = require("./constants");
|
|
20
|
+
Object.defineProperty(exports, "MOBILE_BUTTON_HEIGHT", { enumerable: true, get: function () { return constants_1.MOBILE_BUTTON_HEIGHT; } });
|
|
@@ -5,6 +5,7 @@ const Button_1 = require("../../Button");
|
|
|
5
5
|
const Chevron_1 = require("../../Chevron");
|
|
6
6
|
const styled_1 = require("../../styled/styled");
|
|
7
7
|
const Typography_1 = require("../../Typography");
|
|
8
|
+
const constants_1 = require("./constants");
|
|
8
9
|
exports.StyledButton = (0, styled_1.styled)(Button_1.Button) `
|
|
9
10
|
display: flex;
|
|
10
11
|
align-items: center;
|
|
@@ -25,6 +26,27 @@ exports.StyledButton = (0, styled_1.styled)(Button_1.Button) `
|
|
|
25
26
|
|
|
26
27
|
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
27
28
|
}
|
|
29
|
+
|
|
30
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
|
|
33
|
+
max-width: unset;
|
|
34
|
+
height: ${constants_1.MOBILE_BUTTON_HEIGHT};
|
|
35
|
+
padding: ${({ theme }) => theme.spacing(3, 4)};
|
|
36
|
+
|
|
37
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
38
|
+
border-radius: 0;
|
|
39
|
+
|
|
40
|
+
&:hover {
|
|
41
|
+
background-color: initial;
|
|
42
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:active {
|
|
46
|
+
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
47
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
28
50
|
`;
|
|
29
51
|
exports.StyledChevron = (0, styled_1.styled)(Chevron_1.Chevron) `
|
|
30
52
|
width: 24px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const StyledMenuItem: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../..").WithoutEmotionSpecific<Omit<import("@mui/material").MenuItemProps, "component">> & {
|
|
2
|
+
export declare const StyledMenuItem: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../..").WithoutEmotionSpecific<Omit<import("@mui/material/MenuItem").MenuItemProps, "component">> & {
|
|
3
3
|
disabledReason?: string | undefined;
|
|
4
4
|
note?: string | undefined;
|
|
5
5
|
tooltipPlacement?: "bottom" | "left" | "right" | "top" | "bottom-end" | "bottom-start" | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | undefined;
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StyledButton = exports.StyledMenuItem = void 0;
|
|
4
|
+
const MenuItem_1 = require("@mui/material/MenuItem");
|
|
4
5
|
const Button_1 = require("../../Button");
|
|
5
|
-
const
|
|
6
|
+
const MenuItem_2 = require("../../MenuItem");
|
|
6
7
|
const styled_1 = require("../../styled");
|
|
7
|
-
exports.StyledMenuItem = (0, styled_1.styled)(
|
|
8
|
+
exports.StyledMenuItem = (0, styled_1.styled)(MenuItem_2.MenuItem) `
|
|
8
9
|
cursor: ${({ selected }) => (selected ? 'auto' : 'pointer')};
|
|
9
10
|
user-select: ${({ selected }) => (selected ? 'auto' : 'unset')};
|
|
10
11
|
|
|
11
12
|
padding: ${({ theme }) => theme.microSpacing(3, 6)};
|
|
13
|
+
|
|
14
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
15
|
+
padding: ${({ theme }) => theme.microSpacing(5, 6)};
|
|
16
|
+
|
|
17
|
+
&.${MenuItem_1.menuItemClasses.selected} {
|
|
18
|
+
padding: ${({ theme }) => theme.microSpacing(3, 6)};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
12
21
|
`;
|
|
13
22
|
exports.StyledButton = (0, styled_1.styled)(Button_1.Button) `
|
|
14
23
|
justify-content: flex-start;
|
|
@@ -9,6 +9,12 @@ exports.Item = styled_1.styled.div `
|
|
|
9
9
|
|
|
10
10
|
width: 100%;
|
|
11
11
|
padding: ${({ theme }) => theme.spacing(0, 2)};
|
|
12
|
+
|
|
13
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
14
|
+
gap: ${({ theme }) => theme.spacing(3)};
|
|
15
|
+
|
|
16
|
+
padding: ${({ theme }) => theme.spacing(3)};
|
|
17
|
+
}
|
|
12
18
|
`;
|
|
13
19
|
exports.Wrapper = styled_1.styled.div `
|
|
14
20
|
overflow: hidden;
|
|
@@ -18,6 +24,12 @@ exports.Wrapper = styled_1.styled.div `
|
|
|
18
24
|
|
|
19
25
|
width: 100%;
|
|
20
26
|
padding: ${({ theme }) => theme.microSpacing(5, 0)};
|
|
27
|
+
|
|
28
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
29
|
+
gap: ${({ theme }) => theme.spacing(2)};
|
|
30
|
+
|
|
31
|
+
padding: 0;
|
|
32
|
+
}
|
|
21
33
|
`;
|
|
22
34
|
exports.OrganizationInfoWrapper = styled_1.styled.div `
|
|
23
35
|
display: flex;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const DEFAULT_LINK_BUTTON_NAME = "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u0434\u0430\u043D\u043D\u044B\u043C \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438";
|
|
2
|
+
export declare const POPOVER_TITLE = "\u0412\u044B\u0431\u043E\u0440 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438";
|
|
2
3
|
export declare const PLACEHOLDER_HEIGHT = "108px";
|
|
3
4
|
export declare const menuOrganizationClassnames: {
|
|
4
5
|
root: string;
|
|
5
6
|
errorPlaceholder: string;
|
|
7
|
+
mobileVisible: string;
|
|
6
8
|
};
|