@astral/ui 4.22.2 → 4.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/components/BottomDrawer/BottomDrawer.js +2 -2
  2. package/components/BottomDrawer/constants.d.ts +3 -0
  3. package/components/BottomDrawer/constants.js +4 -0
  4. package/components/BottomDrawer/index.d.ts +1 -0
  5. package/components/BottomDrawer/index.js +1 -0
  6. package/components/BottomDrawer/public.d.ts +1 -0
  7. package/components/BottomDrawer/public.js +1 -0
  8. package/components/BulletList/BulletList.d.ts +4 -0
  9. package/components/BulletList/BulletList.js +9 -3
  10. package/components/BulletList/constants.d.ts +4 -0
  11. package/components/BulletList/constants.js +5 -0
  12. package/components/BulletList/styles.d.ts +5 -1
  13. package/components/BulletList/styles.js +9 -1
  14. package/components/DashboardContext/DashboardContext.d.ts +2 -1
  15. package/components/DashboardContext/DashboardContext.js +2 -1
  16. package/components/DashboardContext/DashboardContextProvider/DashboardContextProvider.js +9 -2
  17. package/components/DashboardLayout/Header/Header.js +3 -9
  18. package/components/DashboardLayout/Header/useLogic/useLogic.d.ts +6 -1
  19. package/components/DashboardLayout/Header/useLogic/useLogic.js +18 -2
  20. package/components/DashboardSidebar/DashboardSidebar.js +2 -4
  21. package/components/DashboardSidebar/constants.d.ts +1 -0
  22. package/components/DashboardSidebar/constants.js +1 -0
  23. package/components/DashboardSidebar/styles.js +6 -0
  24. package/components/DashboardSidebar/useLogic/useLogic.d.ts +2 -1
  25. package/components/DashboardSidebar/useLogic/useLogic.js +10 -3
  26. package/components/MenuOrganization/MenuOrganization.js +5 -6
  27. package/components/MenuOrganization/NoData/styles.js +4 -0
  28. package/components/MenuOrganization/OrganizationButton/constants.d.ts +1 -0
  29. package/components/MenuOrganization/OrganizationButton/constants.js +1 -0
  30. package/components/MenuOrganization/OrganizationButton/index.d.ts +1 -0
  31. package/components/MenuOrganization/OrganizationButton/index.js +1 -0
  32. package/components/MenuOrganization/OrganizationButton/styles.js +22 -0
  33. package/components/MenuOrganization/OrganizationItem/styles.d.ts +1 -1
  34. package/components/MenuOrganization/OrganizationItem/styles.js +9 -0
  35. package/components/MenuOrganization/OrganizationListSkeleton/styles.js +12 -0
  36. package/components/MenuOrganization/constants.d.ts +2 -0
  37. package/components/MenuOrganization/constants.js +2 -0
  38. package/components/MenuOrganization/styles.d.ts +11 -0
  39. package/components/MenuOrganization/styles.js +82 -0
  40. package/components/MenuOrganization/useLogic/useLogic.d.ts +14 -4
  41. package/components/MenuOrganization/useLogic/useLogic.js +21 -2
  42. package/components/Popover/Popover.d.ts +1 -1
  43. package/components/Popover/Popover.js +3 -3
  44. package/components/placeholders/Placeholder/Placeholder.js +2 -2
  45. package/components/placeholders/Placeholder/constants.d.ts +4 -0
  46. package/components/placeholders/Placeholder/constants.js +5 -0
  47. package/components/placeholders/Placeholder/index.d.ts +1 -0
  48. package/components/placeholders/Placeholder/index.js +1 -0
  49. package/components/placeholders/Placeholder/public.d.ts +1 -0
  50. package/components/placeholders/Placeholder/public.js +1 -0
  51. package/node/components/BottomDrawer/BottomDrawer.js +1 -1
  52. package/node/components/BottomDrawer/constants.d.ts +3 -0
  53. package/node/components/BottomDrawer/constants.js +5 -1
  54. package/node/components/BottomDrawer/index.d.ts +1 -0
  55. package/node/components/BottomDrawer/index.js +3 -0
  56. package/node/components/BottomDrawer/public.d.ts +1 -0
  57. package/node/components/BottomDrawer/public.js +3 -0
  58. package/node/components/BulletList/BulletList.d.ts +4 -0
  59. package/node/components/BulletList/BulletList.js +8 -2
  60. package/node/components/BulletList/constants.d.ts +4 -0
  61. package/node/components/BulletList/constants.js +8 -0
  62. package/node/components/BulletList/styles.d.ts +5 -1
  63. package/node/components/BulletList/styles.js +10 -2
  64. package/node/components/DashboardContext/DashboardContext.d.ts +2 -1
  65. package/node/components/DashboardContext/DashboardContext.js +1 -0
  66. package/node/components/DashboardContext/DashboardContextProvider/DashboardContextProvider.js +8 -1
  67. package/node/components/DashboardLayout/Header/Header.js +2 -8
  68. package/node/components/DashboardLayout/Header/useLogic/useLogic.d.ts +6 -1
  69. package/node/components/DashboardLayout/Header/useLogic/useLogic.js +18 -2
  70. package/node/components/DashboardSidebar/DashboardSidebar.js +2 -4
  71. package/node/components/DashboardSidebar/constants.d.ts +1 -0
  72. package/node/components/DashboardSidebar/constants.js +1 -0
  73. package/node/components/DashboardSidebar/styles.js +6 -0
  74. package/node/components/DashboardSidebar/useLogic/useLogic.d.ts +2 -1
  75. package/node/components/DashboardSidebar/useLogic/useLogic.js +9 -2
  76. package/node/components/MenuOrganization/MenuOrganization.js +3 -4
  77. package/node/components/MenuOrganization/NoData/styles.js +4 -0
  78. package/node/components/MenuOrganization/OrganizationButton/constants.d.ts +1 -0
  79. package/node/components/MenuOrganization/OrganizationButton/constants.js +4 -0
  80. package/node/components/MenuOrganization/OrganizationButton/index.d.ts +1 -0
  81. package/node/components/MenuOrganization/OrganizationButton/index.js +3 -0
  82. package/node/components/MenuOrganization/OrganizationButton/styles.js +22 -0
  83. package/node/components/MenuOrganization/OrganizationItem/styles.d.ts +1 -1
  84. package/node/components/MenuOrganization/OrganizationItem/styles.js +11 -2
  85. package/node/components/MenuOrganization/OrganizationListSkeleton/styles.js +12 -0
  86. package/node/components/MenuOrganization/constants.d.ts +2 -0
  87. package/node/components/MenuOrganization/constants.js +3 -1
  88. package/node/components/MenuOrganization/styles.d.ts +11 -0
  89. package/node/components/MenuOrganization/styles.js +87 -5
  90. package/node/components/MenuOrganization/useLogic/useLogic.d.ts +14 -4
  91. package/node/components/MenuOrganization/useLogic/useLogic.js +21 -2
  92. package/node/components/Popover/Popover.d.ts +1 -1
  93. package/node/components/Popover/Popover.js +3 -3
  94. package/node/components/placeholders/Placeholder/Placeholder.js +1 -1
  95. package/node/components/placeholders/Placeholder/constants.d.ts +4 -0
  96. package/node/components/placeholders/Placeholder/constants.js +6 -1
  97. package/node/components/placeholders/Placeholder/index.d.ts +1 -0
  98. package/node/components/placeholders/Placeholder/index.js +3 -0
  99. package/node/components/placeholders/Placeholder/public.d.ts +1 -0
  100. package/node/components/placeholders/Placeholder/public.js +3 -0
  101. package/package.json +1 -1
@@ -1,4 +1,10 @@
1
+ import { bottomDrawerClassnames } from '../BottomDrawer';
2
+ import { OFFSET_TOP_SCREEN } from '../BottomDrawer/constants';
3
+ import { HEADER_HEIGHT_MOBILE } from '../DashboardLayout/constants';
1
4
  import { Grid } from '../Grid';
5
+ import { Popover } from '../Popover';
6
+ import { loadingPlaceholderClassnames } from '../placeholders/LoadingPlaceholder';
7
+ import { placeholderClassnames } from '../placeholders/Placeholder';
2
8
  import { styled } from '../styled';
3
9
  import { Typography } from '../Typography';
4
10
  import { menuOrganizationClassnames, PLACEHOLDER_HEIGHT } from './constants';
@@ -6,12 +12,21 @@ export const ActionWrapper = styled.div `
6
12
  padding: ${({ theme }) => theme.spacing(2)};
7
13
 
8
14
  border-top: 1px solid ${({ theme }) => theme.palette.grey[300]};
15
+
16
+ ${({ theme }) => theme.breakpoints.down('sm')} {
17
+ padding: ${({ theme }) => theme.spacing(4)};
18
+ }
9
19
  `;
10
20
  export const SearchWrapper = styled.div `
11
21
  max-width: 300px;
12
22
  padding: ${({ theme }) => theme.spacing(2, 3)};
13
23
 
14
24
  border-bottom: ${({ theme }) => `1px solid ${theme.palette.grey['300']}`};
25
+
26
+ ${({ theme }) => theme.breakpoints.down('sm')} {
27
+ max-width: unset;
28
+ padding: ${({ theme }) => theme.spacing(3, 4)};
29
+ }
15
30
  `;
16
31
  export const OrganizationsWrapper = styled.div `
17
32
  overflow-y: auto;
@@ -25,6 +40,7 @@ export const OrganizationsWrapper = styled.div `
25
40
  max-height: 328px;
26
41
 
27
42
  & .${menuOrganizationClassnames.errorPlaceholder} {
43
+ display: flex;
28
44
  gap: ${({ theme }) => theme.spacing(1)};
29
45
 
30
46
  height: ${PLACEHOLDER_HEIGHT};
@@ -32,6 +48,27 @@ export const OrganizationsWrapper = styled.div `
32
48
 
33
49
  ${({ theme }) => theme.breakpoints.down('sm')} {
34
50
  width: 100%;
51
+ height: 100%;
52
+ max-height: unset;
53
+
54
+ & .${loadingPlaceholderClassnames.root} {
55
+ justify-content: unset;
56
+ }
57
+
58
+ & .${menuOrganizationClassnames.errorPlaceholder} {
59
+ gap: ${({ theme }) => theme.spacing(6)};
60
+ justify-content: center;
61
+
62
+ height: 100%;
63
+
64
+ & .${placeholderClassnames.title} {
65
+ margin-bottom: unset;
66
+ }
67
+
68
+ & .${placeholderClassnames.footer} {
69
+ margin-top: unset;
70
+ }
71
+ }
35
72
  }
36
73
  `;
37
74
  export const OrganizationData = styled(Grid) `
@@ -43,3 +80,48 @@ export const OrganizationData = styled(Grid) `
43
80
  export const StyledTypography = styled(Typography) `
44
81
  color: ${({ theme }) => theme.palette.grey[600]};
45
82
  `;
83
+ export const ButtonWrapper = styled.div `
84
+ ${({ theme }) => theme.breakpoints.down('sm')} {
85
+ position: absolute;
86
+ z-index: ${({ theme }) => theme.zIndex.appBar - 1};
87
+ top: ${({ $alertHeight }) => `calc(${$alertHeight}px + ${HEADER_HEIGHT_MOBILE}) `};
88
+ left: 0;
89
+
90
+ /* Необходимо для анимации компонента вместе с sidebar */
91
+ transform: translateX(-100vw);
92
+
93
+ display: flex;
94
+ flex-direction: column;
95
+
96
+ width: 100vw;
97
+
98
+ background-color: ${({ theme }) => theme.palette.background.default};
99
+
100
+ transition: ${({ theme }) => {
101
+ return theme.transitions.create(['transform'], {
102
+ duration: theme.transitions.duration.standard,
103
+ });
104
+ }};
105
+
106
+ &.${menuOrganizationClassnames.mobileVisible} {
107
+ transform: translateX(0);
108
+ }
109
+ }
110
+ `;
111
+ export const StyledPopover = styled(Popover) `
112
+
113
+ ${({ theme }) => theme.breakpoints.down('sm')} {
114
+ & .${bottomDrawerClassnames.content} {
115
+ display: flex;
116
+ flex-direction: column;
117
+
118
+ height: calc(100vh - ${OFFSET_TOP_SCREEN});
119
+
120
+ @supports (height: 100dvh) {
121
+ height: calc(100dvh - ${OFFSET_TOP_SCREEN});
122
+ }
123
+
124
+ }
125
+ }
126
+
127
+ `;
@@ -1,10 +1,17 @@
1
- import { type ChangeEvent, type SyntheticEvent } from 'react';
1
+ import { type ChangeEvent, type MouseEvent, type SyntheticEvent } from 'react';
2
2
  import { type MenuOrganizationProps, type Organization } from '../types';
3
3
  type UseLogicParams<TData extends Organization & Record<string, unknown>> = MenuOrganizationProps<TData>;
4
4
  export declare const useLogic: <TData extends Organization & Record<string, unknown>>({ organizations, onChangeSearch, onChange, currentOrganizationGroupLabel, currentOrganization, groupBy, onClose, onOpen, isOpen: isOpenPopover, isDisabled, disabledReason, isHidePersonalData, action, isLoading, isError, onRetry, renderItem, renderPreview, }: UseLogicParams<TData>) => {
5
- action: ({
6
- text: string;
7
- } & Pick<import("../..").ButtonProps, "onClick" | "component" | "href" | "variant" | "endIcon" | "startIcon">) | undefined;
5
+ actionButtonProps: {
6
+ text?: string | undefined;
7
+ component?: import("react").ElementType | undefined;
8
+ href?: string | undefined;
9
+ variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
10
+ endIcon?: import("react").ReactNode;
11
+ startIcon?: import("react").ReactNode;
12
+ onClick: (event: MouseEvent<HTMLButtonElement>) => void;
13
+ };
14
+ hasAction: boolean;
8
15
  isLoading: boolean | undefined;
9
16
  isError: boolean | undefined;
10
17
  onRetry: () => void;
@@ -53,5 +60,8 @@ export declare const useLogic: <TData extends Organization & Record<string, unkn
53
60
  hasSearch: boolean;
54
61
  };
55
62
  isShowSearchField: boolean;
63
+ isMobile: boolean;
64
+ classnames: string;
65
+ alertHeight: number;
56
66
  };
57
67
  export {};
@@ -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
- action,
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,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
  };
@@ -15,3 +15,7 @@ export declare const TITLE_HEADER_LEVEL: {
15
15
  export declare const DESCRIPTION_LEVEL: {
16
16
  readonly [x: string]: "subtitle1" | "body1";
17
17
  };
18
+ export declare const placeholderClassnames: {
19
+ footer: string;
20
+ title: string;
21
+ };
@@ -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
+ };
@@ -1,3 +1,4 @@
1
1
  export * from './Image';
2
2
  export * from './Placeholder';
3
3
  export * from './types';
4
+ export { placeholderClassnames } from './constants';
@@ -1,3 +1,4 @@
1
1
  export * from './Image';
2
2
  export * from './Placeholder';
3
3
  export * from './types';
4
+ export { placeholderClassnames } from './constants';
@@ -1,2 +1,3 @@
1
+ export { placeholderClassnames } from './constants';
1
2
  export * from './Placeholder';
2
3
  export * from './types';
@@ -1,2 +1,3 @@
1
+ export { placeholderClassnames } from './constants';
1
2
  export * from './Placeholder';
2
3
  export * from './types';
@@ -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,2 +1,5 @@
1
1
  export declare const OFFSET_TOP_SCREEN = "16px";
2
2
  export declare const DEFAULT_HEADER_HEIGHT = 56;
3
+ export declare const bottomDrawerClassnames: {
4
+ content: string;
5
+ };
@@ -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
+ };
@@ -1 +1,2 @@
1
1
  export * from './BottomDrawer';
2
+ export { bottomDrawerClassnames } from './constants';
@@ -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 +1,2 @@
1
1
  export * from './BottomDrawer';
2
+ export { bottomDrawerClassnames } from './constants';
@@ -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,6 +1,10 @@
1
1
  import { type PropsWithChildren } from 'react';
2
2
  export type BulletListProps = PropsWithChildren<{
3
3
  className?: string;
4
+ /**
5
+ * Флаг для скрытия точек у первых элементов списка каждой строки.
6
+ */
7
+ hideFirstBullet?: boolean;
4
8
  }>;
5
9
  /**
6
10
  * Список элементов с маркерами
@@ -2,12 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BulletList = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const classNames_1 = require("../utils/classNames");
7
+ const constants_1 = require("./constants");
5
8
  const styles_1 = require("./styles");
6
9
  /**
7
10
  * Список элементов с маркерами
8
11
  */
9
12
  const BulletList = (props) => {
10
- const { children, ...restProps } = props;
11
- return (0, jsx_runtime_1.jsx)(styles_1.Wrapper, { ...restProps, children: children });
13
+ const { children, hideFirstBullet, className } = props;
14
+ const classnames = (0, react_1.useMemo)(() => (0, classNames_1.classNames)(className, constants_1.bulletListClassnames.root, {
15
+ [constants_1.bulletListClassnames.hideFirstBullet]: hideFirstBullet,
16
+ }), [hideFirstBullet]);
17
+ return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: (0, jsx_runtime_1.jsx)(styles_1.List, { className: classnames, children: children }) }));
12
18
  };
13
19
  exports.BulletList = BulletList;
@@ -0,0 +1,4 @@
1
+ export declare const bulletListClassnames: {
2
+ root: string;
3
+ hideFirstBullet: string;
4
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bulletListClassnames = void 0;
4
+ const createUIKitClassname_1 = require("../utils/createUIKitClassname");
5
+ exports.bulletListClassnames = {
6
+ root: (0, createUIKitClassname_1.createUIKitClassname)('bullet-list'),
7
+ hideFirstBullet: (0, createUIKitClassname_1.createUIKitClassname)('bullet-list_hide-first-bullets'),
8
+ };
@@ -1,5 +1,9 @@
1
1
  /// <reference types="react" />
2
- export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
2
+ export declare const List: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
4
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
6
+ export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,8 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Wrapper = void 0;
3
+ exports.Wrapper = exports.List = void 0;
4
4
  const styled_1 = require("../styled");
5
5
  const mixins_1 = require("../styled/mixins");
6
- exports.Wrapper = (0, styled_1.styled)('ul') `
6
+ const constants_1 = require("./constants");
7
+ exports.List = styled_1.styled.ul `
7
8
  ${mixins_1.listContainer};
9
+
10
+ &.${constants_1.bulletListClassnames.hideFirstBullet} {
11
+ margin-left: -${({ theme }) => theme.spacing(5)};
12
+ }
13
+ `;
14
+ exports.Wrapper = styled_1.styled.div `
15
+ overflow: hidden;
8
16
  `;
@@ -1,8 +1,9 @@
1
- /// <reference types="react" />
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>;
@@ -6,4 +6,5 @@ exports.DashboardContext = (0, react_1.createContext)({
6
6
  isFocusedMode: false,
7
7
  alertHeight: 0,
8
8
  isLoading: false,
9
+ hasMenuOrganizationRef: (0, react_1.createRef)(),
9
10
  });
@@ -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: { isFocusedMode, setAlertElement, alertHeight, isLoading }, children: children }));
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
- const { isFocusedMode, isLoading } = (0, react_1.useContext)(DashboardContext_1.DashboardContext);
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 { isShowExitButton, isShowProfile };
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, className, menu, header, isLoading, } = (0, useLogic_1.useLogic)(props);
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: (0, classNames_1.classNames)(className, constants_1.dashboardSidebarClassnames.root), 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 }) })] }) }) }));
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
  });
@@ -1,3 +1,4 @@
1
1
  export declare const dashboardSidebarClassnames: {
2
2
  root: string;
3
+ hasMenuOrganization: string;
3
4
  };
@@ -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
  };