@astral/ui 4.52.1 → 4.53.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.
Files changed (45) hide show
  1. package/components/DashboardContext/DashboardContext.d.ts +2 -3
  2. package/components/DashboardContext/DashboardContext.js +1 -0
  3. package/components/DashboardContext/DashboardContextProvider/DashboardContextProvider.d.ts +2 -2
  4. package/components/DashboardContext/DashboardContextProvider/DashboardContextProvider.js +2 -1
  5. package/components/DashboardLayout/Container/Container.d.ts +6 -0
  6. package/components/DashboardLayout/Container/Container.js +24 -0
  7. package/components/DashboardLayout/Container/constants.d.ts +6 -0
  8. package/components/DashboardLayout/Container/constants.js +7 -0
  9. package/components/DashboardLayout/Container/index.d.ts +1 -0
  10. package/components/DashboardLayout/Container/index.js +1 -0
  11. package/components/DashboardLayout/Container/styles.d.ts +5 -0
  12. package/components/DashboardLayout/Container/styles.js +55 -0
  13. package/components/DashboardLayout/DashboardLayout.d.ts +1 -1
  14. package/components/DashboardLayout/DashboardLayout.js +2 -2
  15. package/components/DashboardLayout/DashboardWrapper/DashboardWrapper.js +3 -2
  16. package/components/DashboardLayout/DashboardWrapper/constants.d.ts +6 -0
  17. package/components/DashboardLayout/DashboardWrapper/constants.js +7 -0
  18. package/components/DashboardLayout/DashboardWrapper/styles.d.ts +0 -6
  19. package/components/DashboardLayout/DashboardWrapper/styles.js +0 -45
  20. package/components/DashboardLayout/Header/useLogic/useLogic.d.ts +1 -1
  21. package/components/DashboardLayout/types.d.ts +5 -0
  22. package/components/DashboardLayoutSkeleton/DashboardLayoutSkeleton.js +3 -2
  23. package/node/components/DashboardContext/DashboardContext.d.ts +2 -3
  24. package/node/components/DashboardContext/DashboardContext.js +1 -0
  25. package/node/components/DashboardContext/DashboardContextProvider/DashboardContextProvider.d.ts +2 -2
  26. package/node/components/DashboardContext/DashboardContextProvider/DashboardContextProvider.js +2 -1
  27. package/node/components/DashboardLayout/Container/Container.d.ts +6 -0
  28. package/node/components/DashboardLayout/Container/Container.js +28 -0
  29. package/node/components/DashboardLayout/Container/constants.d.ts +6 -0
  30. package/node/components/DashboardLayout/Container/constants.js +10 -0
  31. package/node/components/DashboardLayout/Container/index.d.ts +1 -0
  32. package/node/components/DashboardLayout/Container/index.js +17 -0
  33. package/node/components/DashboardLayout/Container/styles.d.ts +5 -0
  34. package/node/components/DashboardLayout/Container/styles.js +58 -0
  35. package/node/components/DashboardLayout/DashboardLayout.d.ts +1 -1
  36. package/node/components/DashboardLayout/DashboardLayout.js +2 -2
  37. package/node/components/DashboardLayout/DashboardWrapper/DashboardWrapper.js +2 -1
  38. package/node/components/DashboardLayout/DashboardWrapper/constants.d.ts +6 -0
  39. package/node/components/DashboardLayout/DashboardWrapper/constants.js +10 -0
  40. package/node/components/DashboardLayout/DashboardWrapper/styles.d.ts +0 -6
  41. package/node/components/DashboardLayout/DashboardWrapper/styles.js +4 -49
  42. package/node/components/DashboardLayout/Header/useLogic/useLogic.d.ts +1 -1
  43. package/node/components/DashboardLayout/types.d.ts +5 -0
  44. package/node/components/DashboardLayoutSkeleton/DashboardLayoutSkeleton.js +2 -1
  45. package/package.json +1 -1
@@ -1,7 +1,6 @@
1
1
  import { type RefObject } from 'react';
2
- export type DashboardContextProps = {
3
- isFocusedMode: boolean;
4
- mobileHeaderPriorityFeature: 'profile' | 'menuOrg';
2
+ import { type DashboardLayoutProps } from '../DashboardLayout';
3
+ export type DashboardContextProps = Required<Pick<DashboardLayoutProps, 'isFocusedMode' | 'mobileHeaderPriorityFeature' | 'desktopViewMode'>> & {
5
4
  setAlertElement?: (element: HTMLElement | null) => void;
6
5
  alertHeight: number;
7
6
  isLoading: boolean;
@@ -2,6 +2,7 @@ import { createContext, createRef } from 'react';
2
2
  export const DashboardContext = createContext({
3
3
  isFocusedMode: false,
4
4
  mobileHeaderPriorityFeature: 'menuOrg',
5
+ desktopViewMode: 'compact',
5
6
  alertHeight: 0,
6
7
  isLoading: false,
7
8
  hasMenuOrganizationRef: createRef(),
@@ -1,8 +1,8 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type DashboardContextProps } from '../DashboardContext';
3
- type Props = Pick<DashboardContextProps, 'isFocusedMode' | 'mobileHeaderPriorityFeature'> & {
3
+ type Props = Pick<DashboardContextProps, 'isFocusedMode' | 'mobileHeaderPriorityFeature' | 'desktopViewMode'> & {
4
4
  children: ReactNode;
5
5
  isLoading: boolean;
6
6
  };
7
- export declare const DashboardContextProvider: ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const DashboardContextProvider: ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, desktopViewMode, }: Props) => import("react/jsx-runtime").JSX.Element;
8
8
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useRef, useState } from 'react';
3
3
  import { DashboardContext, } from '../DashboardContext';
4
- export const DashboardContextProvider = ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, }) => {
4
+ export const DashboardContextProvider = ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, desktopViewMode, }) => {
5
5
  const [alertElement, setAlertElement] = useState(null);
6
6
  const [alertHeight, setAlertHeight] = useState(0);
7
7
  const [isFocusedModeInternal, setFocusedMode] = useState(isFocusedMode);
@@ -29,6 +29,7 @@ export const DashboardContextProvider = ({ children, isFocusedMode, isLoading, m
29
29
  return (_jsx(DashboardContext.Provider, { value: {
30
30
  isFocusedMode: isFocusedModeInternal,
31
31
  mobileHeaderPriorityFeature,
32
+ desktopViewMode,
32
33
  setAlertElement,
33
34
  alertHeight,
34
35
  isLoading,
@@ -0,0 +1,6 @@
1
+ import { type ReactNode } from 'react';
2
+ type Props = {
3
+ children: ReactNode;
4
+ };
5
+ export declare const Container: ({ children }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext } from 'react';
3
+ import { DashboardContext } from '../../DashboardContext';
4
+ import { cva } from '../../utils/cva';
5
+ import { containerClassnames } from './constants';
6
+ import { Root } from './styles';
7
+ const rootCva = cva(containerClassnames.root, {
8
+ variants: {
9
+ desktopViewMode: {
10
+ compact: containerClassnames.compact,
11
+ wide: containerClassnames.wide,
12
+ },
13
+ isFocusedMode: {
14
+ true: containerClassnames.focusedMode,
15
+ },
16
+ },
17
+ });
18
+ export const Container = ({ children }) => {
19
+ const { isFocusedMode, desktopViewMode } = useContext(DashboardContext);
20
+ return (_jsx(Root, { className: rootCva({
21
+ desktopViewMode,
22
+ isFocusedMode,
23
+ }), children: children }));
24
+ };
@@ -0,0 +1,6 @@
1
+ export declare const containerClassnames: {
2
+ root: string;
3
+ compact: string;
4
+ wide: string;
5
+ focusedMode: string;
6
+ };
@@ -0,0 +1,7 @@
1
+ import { createUIKitClassname } from '../../utils/createUIKitClassname';
2
+ export const containerClassnames = {
3
+ root: createUIKitClassname('dashboard-layout__container'),
4
+ compact: createUIKitClassname('dashboard-layout__container_view-mode_compact'),
5
+ wide: createUIKitClassname('dashboard-layout__container_view-mode_wide'),
6
+ focusedMode: createUIKitClassname('dashboard-layout__container_focused-mode'),
7
+ };
@@ -0,0 +1 @@
1
+ export * from './Container';
@@ -0,0 +1 @@
1
+ export * from './Container';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const Root: import("../../styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,55 @@
1
+ import { dashboardSidebarClassnames } from '../../DashboardSidebar/constants';
2
+ import { styled } from '../../styled';
3
+ import { containerClassnames } from './constants';
4
+ export const Root = styled.div `
5
+ display: grid;
6
+ grid-template-columns: auto 1fr;
7
+ grid-template-rows: auto auto 1fr;
8
+ flex-grow: 1;
9
+
10
+ height: 100vh;
11
+ padding: ${({ theme }) => theme.spacing(0, 4, 4)};
12
+
13
+ transition: ${({ theme }) => {
14
+ return theme.transitions.create(['max-width'], {
15
+ duration: theme.transitions.duration.complex,
16
+ });
17
+ }};
18
+
19
+ /* Причина игнора: Не критично для отображения */
20
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
21
+ &:has(.${dashboardSidebarClassnames.root}) {
22
+ column-gap: ${({ theme }) => theme.spacing(4)};
23
+
24
+ ${({ theme }) => theme.breakpoints.down('sm')} {
25
+ column-gap: 0;
26
+ }
27
+ }
28
+
29
+ /* Причина игнора: Прогрессивное улучшение */
30
+ /* stylelint-disable plugin/no-unsupported-browser-features */
31
+ @supports (height: 100dvh) {
32
+ height: 100dvh;
33
+ }
34
+ /* stylelint-enable plugin/no-unsupported-browser-features */
35
+
36
+ ${({ theme }) => theme.breakpoints.down('sm')} {
37
+ column-gap: 0;
38
+
39
+ min-width: unset;
40
+ max-width: unset;
41
+ padding: 0;
42
+ }
43
+
44
+ &.${containerClassnames.compact} {
45
+ max-width: 1572px;
46
+ }
47
+
48
+ &.${containerClassnames.wide} {
49
+ max-width: 1920px;
50
+ }
51
+
52
+ &.${containerClassnames.focusedMode} {
53
+ max-width: 100%;
54
+ }
55
+ `;
@@ -4,7 +4,7 @@ import { type DashboardLayoutProps } from './types';
4
4
  * Общий Layout приложения
5
5
  */
6
6
  export declare const DashboardLayout: {
7
- ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, }: DashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
7
+ ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, desktopViewMode, }: DashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
8
8
  Header: import("react").ForwardRefExoticComponent<import("./Header").HeaderProps & import("react").RefAttributes<HTMLDivElement>>;
9
9
  Sidebar: import("react").ForwardRefExoticComponent<import("../DashboardSidebar").DashboardSidebarProps & import("react").RefAttributes<HTMLBaseElement>>;
10
10
  Main: import("react").ForwardRefExoticComponent<import("./Main").MainProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -7,8 +7,8 @@ import { Main } from './Main';
7
7
  /**
8
8
  * Общий Layout приложения
9
9
  */
10
- export const DashboardLayout = ({ children, isFocusedMode = false, isLoading = false, mobileHeaderPriorityFeature = 'menuOrg', }) => {
11
- return (_jsx(DashboardContextProvider, { isFocusedMode: isFocusedMode, isLoading: isLoading, mobileHeaderPriorityFeature: mobileHeaderPriorityFeature, children: _jsx(DashboardWrapper, { children: children }) }));
10
+ export const DashboardLayout = ({ children, isFocusedMode = false, isLoading = false, mobileHeaderPriorityFeature = 'menuOrg', desktopViewMode = 'compact', }) => {
11
+ return (_jsx(DashboardContextProvider, { isFocusedMode: isFocusedMode, isLoading: isLoading, desktopViewMode: desktopViewMode, mobileHeaderPriorityFeature: mobileHeaderPriorityFeature, children: _jsx(DashboardWrapper, { children: children }) }));
12
12
  };
13
13
  DashboardLayout.Header = Header;
14
14
  DashboardLayout.Sidebar = DashboardSidebar;
@@ -2,9 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useContext } from 'react';
3
3
  import { DashboardContext } from '../../DashboardContext';
4
4
  import { DashboardSidebarProvider } from '../../DashboardSidebarProvider';
5
+ import { Container } from '../Container';
5
6
  import { dashboardLayoutClassnames } from '../constants';
6
- import { DecorativeHeaderBackground, LayoutContent, Wrapper } from './styles';
7
+ import { DecorativeHeaderBackground, Wrapper } from './styles';
7
8
  export const DashboardWrapper = ({ children }) => {
8
9
  const { isFocusedMode } = useContext(DashboardContext);
9
- return (_jsx(DashboardSidebarProvider, { isFocusedMode: isFocusedMode, children: _jsxs(Wrapper, { className: dashboardLayoutClassnames.root, children: [_jsx(DecorativeHeaderBackground, { role: "presentation", "$isFocusedMode": isFocusedMode }), _jsx(LayoutContent, { "$isFocusedMode": isFocusedMode, children: children })] }) }));
10
+ return (_jsx(DashboardSidebarProvider, { isFocusedMode: isFocusedMode, children: _jsxs(Wrapper, { className: dashboardLayoutClassnames.root, children: [_jsx(DecorativeHeaderBackground, { role: "presentation", "$isFocusedMode": isFocusedMode }), _jsx(Container, { children: children })] }) }));
10
11
  };
@@ -0,0 +1,6 @@
1
+ export declare const dashboardLayoutContainerClassnames: {
2
+ root: string;
3
+ compact: string;
4
+ wide: string;
5
+ focusedMode: string;
6
+ };
@@ -0,0 +1,7 @@
1
+ import { createUIKitClassname } from '../../utils/createUIKitClassname';
2
+ export const dashboardLayoutContainerClassnames = {
3
+ root: createUIKitClassname('dashboard-layout__container'),
4
+ compact: createUIKitClassname('dashboard-layout__container_compact'),
5
+ wide: createUIKitClassname('dashboard-layout__container_wide'),
6
+ focusedMode: createUIKitClassname('dashboard-layout__container_focused-mode'),
7
+ };
@@ -9,9 +9,3 @@ export declare const DecorativeHeaderBackground: import("../../styled").StyledCo
9
9
  } & {
10
10
  $isFocusedMode: boolean;
11
11
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
12
- export declare const LayoutContent: import("../../styled").StyledComponent<{
13
- theme?: import("@emotion/react").Theme | undefined;
14
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
15
- } & {
16
- $isFocusedMode: boolean;
17
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,4 +1,3 @@
1
- import { dashboardSidebarClassnames } from '../../DashboardSidebar/constants';
2
1
  import { styled } from '../../styled';
3
2
  import { HEADER_HEIGHT_DESKTOP, HEADER_HEIGHT_LAPTOP } from '../constants';
4
3
  export const Wrapper = styled('div') `
@@ -36,47 +35,3 @@ export const DecorativeHeaderBackground = styled.div `
36
35
  display: none;
37
36
  }
38
37
  `;
39
- export const LayoutContent = styled('div', {
40
- shouldForwardProp: (prop) => !['$isFocusedMode'].includes(prop),
41
- }) `
42
- display: grid;
43
- grid-template-columns: auto 1fr;
44
- grid-template-rows: auto auto 1fr;
45
- flex-grow: 1;
46
-
47
- /* Максимальная ширина с отступами */
48
- max-width: ${({ $isFocusedMode }) => ($isFocusedMode ? '100%' : '1572px')};
49
- height: 100vh;
50
- padding: ${({ theme }) => theme.spacing(0, 4, 4)};
51
-
52
- transition: ${({ theme }) => {
53
- return theme.transitions.create(['max-width'], {
54
- duration: theme.transitions.duration.complex,
55
- });
56
- }};
57
-
58
- /* Причина игнора: Не критично для отображения */
59
- /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
60
- &:has(.${dashboardSidebarClassnames.root}) {
61
- column-gap: ${({ theme }) => theme.spacing(4)};
62
-
63
- ${({ theme }) => theme.breakpoints.down('sm')} {
64
- column-gap: 0;
65
- }
66
- }
67
-
68
- /* Причина игнора: Прогрессивное улучшение */
69
- /* stylelint-disable plugin/no-unsupported-browser-features */
70
- @supports (height: 100dvh) {
71
- height: 100dvh;
72
- }
73
- /* stylelint-enable plugin/no-unsupported-browser-features */
74
-
75
- ${({ theme }) => theme.breakpoints.down('sm')} {
76
- column-gap: 0;
77
-
78
- min-width: unset;
79
- max-width: unset;
80
- padding: 0;
81
- }
82
- `;
@@ -5,7 +5,7 @@ export declare const useLogic: ({ profile, menuOrganization }: HeaderProps) => {
5
5
  isShowProfile: boolean;
6
6
  isMobile: boolean;
7
7
  isFocusedMode: boolean;
8
- mobileHeaderPriorityFeature: "profile" | "menuOrg";
8
+ mobileHeaderPriorityFeature: "menuOrg" | "profile";
9
9
  isLoading: boolean;
10
10
  collapsedIn: boolean;
11
11
  onToggleSidebar: (newValue?: boolean | undefined) => void;
@@ -15,4 +15,9 @@ export type DashboardLayoutProps = {
15
15
  * Второстепенный будет помещен в sidebar.
16
16
  */
17
17
  mobileHeaderPriorityFeature?: 'profile' | 'menuOrg';
18
+ /**
19
+ * Compact - ширина layout ограничена 1572px. Необходимо для удобного чтения контента, без лишнего растягивания
20
+ * Wide - ширина layout ограничена 1920px. Применяйте, когда в вашем приложении отображается много табличных данных с большим количеством колонок. Пример - админки
21
+ */
22
+ desktopViewMode?: 'wide' | 'compact';
18
23
  };
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Container } from '../DashboardLayout/Container';
2
3
  import { dashboardLayoutClassnames } from '../DashboardLayout/constants';
3
4
  import { DashboardLayout } from '../DashboardLayout/DashboardLayout';
4
- import { DecorativeHeaderBackground, LayoutContent, Wrapper, } from '../DashboardLayout/DashboardWrapper/styles';
5
+ import { DecorativeHeaderBackground, Wrapper, } from '../DashboardLayout/DashboardWrapper/styles';
5
6
  import { Header } from '../DashboardLayout/Header';
6
7
  import { DashboardSidebarSkeleton } from '../DashboardSidebarSkeleton';
7
8
  import { MenuOrganizationSkeleton } from '../MenuOrganization';
@@ -11,7 +12,7 @@ import { Content } from './styles';
11
12
  * Компонент можно использовать для отображения состояния загрузки дашборда
12
13
  */
13
14
  export const DashboardLayoutSkeleton = ({ product, productSwitcher, hasSidebar = true, hasProfile = true, hasMenuOrganization = true, }) => {
14
- return (_jsxs(Wrapper, { className: dashboardLayoutClassnames.root, children: [_jsx(DecorativeHeaderBackground, { role: "presentation", "$isFocusedMode": false }), _jsxs(LayoutContent, { "$isFocusedMode": false, children: [hasSidebar && _jsx(DashboardSidebarSkeleton, {}), _jsx(Header, { productSwitcher: productSwitcher, product: product, menuOrganization: hasMenuOrganization ? () => _jsx(MenuOrganizationSkeleton, {}) : undefined, profile: hasProfile
15
+ return (_jsxs(Wrapper, { className: dashboardLayoutClassnames.root, children: [_jsx(DecorativeHeaderBackground, { role: "presentation", "$isFocusedMode": false }), _jsxs(Container, { children: [hasSidebar && _jsx(DashboardSidebarSkeleton, {}), _jsx(Header, { productSwitcher: productSwitcher, product: product, menuOrganization: hasMenuOrganization ? () => _jsx(MenuOrganizationSkeleton, {}) : undefined, profile: hasProfile
15
16
  ? { displayName: '', isLoading: true, menuList: [] }
16
17
  : undefined }), _jsx(DashboardLayout.Main, { children: _jsx(Content, { children: _jsx(LoadingPlaceholder, { title: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445" }) }) })] })] }));
17
18
  };
@@ -1,7 +1,6 @@
1
1
  import { type RefObject } from 'react';
2
- export type DashboardContextProps = {
3
- isFocusedMode: boolean;
4
- mobileHeaderPriorityFeature: 'profile' | 'menuOrg';
2
+ import { type DashboardLayoutProps } from '../DashboardLayout';
3
+ export type DashboardContextProps = Required<Pick<DashboardLayoutProps, 'isFocusedMode' | 'mobileHeaderPriorityFeature' | 'desktopViewMode'>> & {
5
4
  setAlertElement?: (element: HTMLElement | null) => void;
6
5
  alertHeight: number;
7
6
  isLoading: boolean;
@@ -5,6 +5,7 @@ const react_1 = require("react");
5
5
  exports.DashboardContext = (0, react_1.createContext)({
6
6
  isFocusedMode: false,
7
7
  mobileHeaderPriorityFeature: 'menuOrg',
8
+ desktopViewMode: 'compact',
8
9
  alertHeight: 0,
9
10
  isLoading: false,
10
11
  hasMenuOrganizationRef: (0, react_1.createRef)(),
@@ -1,8 +1,8 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type DashboardContextProps } from '../DashboardContext';
3
- type Props = Pick<DashboardContextProps, 'isFocusedMode' | 'mobileHeaderPriorityFeature'> & {
3
+ type Props = Pick<DashboardContextProps, 'isFocusedMode' | 'mobileHeaderPriorityFeature' | 'desktopViewMode'> & {
4
4
  children: ReactNode;
5
5
  isLoading: boolean;
6
6
  };
7
- export declare const DashboardContextProvider: ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const DashboardContextProvider: ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, desktopViewMode, }: Props) => import("react/jsx-runtime").JSX.Element;
8
8
  export {};
@@ -4,7 +4,7 @@ exports.DashboardContextProvider = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const DashboardContext_1 = require("../DashboardContext");
7
- const DashboardContextProvider = ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, }) => {
7
+ const DashboardContextProvider = ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, desktopViewMode, }) => {
8
8
  const [alertElement, setAlertElement] = (0, react_1.useState)(null);
9
9
  const [alertHeight, setAlertHeight] = (0, react_1.useState)(0);
10
10
  const [isFocusedModeInternal, setFocusedMode] = (0, react_1.useState)(isFocusedMode);
@@ -32,6 +32,7 @@ const DashboardContextProvider = ({ children, isFocusedMode, isLoading, mobileHe
32
32
  return ((0, jsx_runtime_1.jsx)(DashboardContext_1.DashboardContext.Provider, { value: {
33
33
  isFocusedMode: isFocusedModeInternal,
34
34
  mobileHeaderPriorityFeature,
35
+ desktopViewMode,
35
36
  setAlertElement,
36
37
  alertHeight,
37
38
  isLoading,
@@ -0,0 +1,6 @@
1
+ import { type ReactNode } from 'react';
2
+ type Props = {
3
+ children: ReactNode;
4
+ };
5
+ export declare const Container: ({ children }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Container = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const DashboardContext_1 = require("../../DashboardContext");
7
+ const cva_1 = require("../../utils/cva");
8
+ const constants_1 = require("./constants");
9
+ const styles_1 = require("./styles");
10
+ const rootCva = (0, cva_1.cva)(constants_1.containerClassnames.root, {
11
+ variants: {
12
+ desktopViewMode: {
13
+ compact: constants_1.containerClassnames.compact,
14
+ wide: constants_1.containerClassnames.wide,
15
+ },
16
+ isFocusedMode: {
17
+ true: constants_1.containerClassnames.focusedMode,
18
+ },
19
+ },
20
+ });
21
+ const Container = ({ children }) => {
22
+ const { isFocusedMode, desktopViewMode } = (0, react_1.useContext)(DashboardContext_1.DashboardContext);
23
+ return ((0, jsx_runtime_1.jsx)(styles_1.Root, { className: rootCva({
24
+ desktopViewMode,
25
+ isFocusedMode,
26
+ }), children: children }));
27
+ };
28
+ exports.Container = Container;
@@ -0,0 +1,6 @@
1
+ export declare const containerClassnames: {
2
+ root: string;
3
+ compact: string;
4
+ wide: string;
5
+ focusedMode: string;
6
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.containerClassnames = void 0;
4
+ const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
5
+ exports.containerClassnames = {
6
+ root: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout__container'),
7
+ compact: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout__container_view-mode_compact'),
8
+ wide: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout__container_view-mode_wide'),
9
+ focusedMode: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout__container_focused-mode'),
10
+ };
@@ -0,0 +1 @@
1
+ export * from './Container';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Container"), exports);
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const Root: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Root = void 0;
4
+ const constants_1 = require("../../DashboardSidebar/constants");
5
+ const styled_1 = require("../../styled");
6
+ const constants_2 = require("./constants");
7
+ exports.Root = styled_1.styled.div `
8
+ display: grid;
9
+ grid-template-columns: auto 1fr;
10
+ grid-template-rows: auto auto 1fr;
11
+ flex-grow: 1;
12
+
13
+ height: 100vh;
14
+ padding: ${({ theme }) => theme.spacing(0, 4, 4)};
15
+
16
+ transition: ${({ theme }) => {
17
+ return theme.transitions.create(['max-width'], {
18
+ duration: theme.transitions.duration.complex,
19
+ });
20
+ }};
21
+
22
+ /* Причина игнора: Не критично для отображения */
23
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
24
+ &:has(.${constants_1.dashboardSidebarClassnames.root}) {
25
+ column-gap: ${({ theme }) => theme.spacing(4)};
26
+
27
+ ${({ theme }) => theme.breakpoints.down('sm')} {
28
+ column-gap: 0;
29
+ }
30
+ }
31
+
32
+ /* Причина игнора: Прогрессивное улучшение */
33
+ /* stylelint-disable plugin/no-unsupported-browser-features */
34
+ @supports (height: 100dvh) {
35
+ height: 100dvh;
36
+ }
37
+ /* stylelint-enable plugin/no-unsupported-browser-features */
38
+
39
+ ${({ theme }) => theme.breakpoints.down('sm')} {
40
+ column-gap: 0;
41
+
42
+ min-width: unset;
43
+ max-width: unset;
44
+ padding: 0;
45
+ }
46
+
47
+ &.${constants_2.containerClassnames.compact} {
48
+ max-width: 1572px;
49
+ }
50
+
51
+ &.${constants_2.containerClassnames.wide} {
52
+ max-width: 1920px;
53
+ }
54
+
55
+ &.${constants_2.containerClassnames.focusedMode} {
56
+ max-width: 100%;
57
+ }
58
+ `;
@@ -4,7 +4,7 @@ import { type DashboardLayoutProps } from './types';
4
4
  * Общий Layout приложения
5
5
  */
6
6
  export declare const DashboardLayout: {
7
- ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, }: DashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
7
+ ({ children, isFocusedMode, isLoading, mobileHeaderPriorityFeature, desktopViewMode, }: DashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
8
8
  Header: import("react").ForwardRefExoticComponent<import("./Header").HeaderProps & import("react").RefAttributes<HTMLDivElement>>;
9
9
  Sidebar: import("react").ForwardRefExoticComponent<import("../DashboardSidebar").DashboardSidebarProps & import("react").RefAttributes<HTMLBaseElement>>;
10
10
  Main: import("react").ForwardRefExoticComponent<import("./Main").MainProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -10,8 +10,8 @@ const Main_1 = require("./Main");
10
10
  /**
11
11
  * Общий Layout приложения
12
12
  */
13
- const DashboardLayout = ({ children, isFocusedMode = false, isLoading = false, mobileHeaderPriorityFeature = 'menuOrg', }) => {
14
- return ((0, jsx_runtime_1.jsx)(DashboardContext_1.DashboardContextProvider, { isFocusedMode: isFocusedMode, isLoading: isLoading, mobileHeaderPriorityFeature: mobileHeaderPriorityFeature, children: (0, jsx_runtime_1.jsx)(DashboardWrapper_1.DashboardWrapper, { children: children }) }));
13
+ const DashboardLayout = ({ children, isFocusedMode = false, isLoading = false, mobileHeaderPriorityFeature = 'menuOrg', desktopViewMode = 'compact', }) => {
14
+ return ((0, jsx_runtime_1.jsx)(DashboardContext_1.DashboardContextProvider, { isFocusedMode: isFocusedMode, isLoading: isLoading, desktopViewMode: desktopViewMode, mobileHeaderPriorityFeature: mobileHeaderPriorityFeature, children: (0, jsx_runtime_1.jsx)(DashboardWrapper_1.DashboardWrapper, { children: children }) }));
15
15
  };
16
16
  exports.DashboardLayout = DashboardLayout;
17
17
  exports.DashboardLayout.Header = Header_1.Header;
@@ -5,10 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const DashboardContext_1 = require("../../DashboardContext");
7
7
  const DashboardSidebarProvider_1 = require("../../DashboardSidebarProvider");
8
+ const Container_1 = require("../Container");
8
9
  const constants_1 = require("../constants");
9
10
  const styles_1 = require("./styles");
10
11
  const DashboardWrapper = ({ children }) => {
11
12
  const { isFocusedMode } = (0, react_1.useContext)(DashboardContext_1.DashboardContext);
12
- return ((0, jsx_runtime_1.jsx)(DashboardSidebarProvider_1.DashboardSidebarProvider, { isFocusedMode: isFocusedMode, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: constants_1.dashboardLayoutClassnames.root, children: [(0, jsx_runtime_1.jsx)(styles_1.DecorativeHeaderBackground, { role: "presentation", "$isFocusedMode": isFocusedMode }), (0, jsx_runtime_1.jsx)(styles_1.LayoutContent, { "$isFocusedMode": isFocusedMode, children: children })] }) }));
13
+ return ((0, jsx_runtime_1.jsx)(DashboardSidebarProvider_1.DashboardSidebarProvider, { isFocusedMode: isFocusedMode, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: constants_1.dashboardLayoutClassnames.root, children: [(0, jsx_runtime_1.jsx)(styles_1.DecorativeHeaderBackground, { role: "presentation", "$isFocusedMode": isFocusedMode }), (0, jsx_runtime_1.jsx)(Container_1.Container, { children: children })] }) }));
13
14
  };
14
15
  exports.DashboardWrapper = DashboardWrapper;
@@ -0,0 +1,6 @@
1
+ export declare const dashboardLayoutContainerClassnames: {
2
+ root: string;
3
+ compact: string;
4
+ wide: string;
5
+ focusedMode: string;
6
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dashboardLayoutContainerClassnames = void 0;
4
+ const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
5
+ exports.dashboardLayoutContainerClassnames = {
6
+ root: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout__container'),
7
+ compact: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout__container_compact'),
8
+ wide: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout__container_wide'),
9
+ focusedMode: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout__container_focused-mode'),
10
+ };
@@ -9,9 +9,3 @@ export declare const DecorativeHeaderBackground: import("@emotion/styled/dist/de
9
9
  } & {
10
10
  $isFocusedMode: boolean;
11
11
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
12
- export declare const LayoutContent: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
13
- theme?: import("@emotion/react").Theme | undefined;
14
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
15
- } & {
16
- $isFocusedMode: boolean;
17
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LayoutContent = exports.DecorativeHeaderBackground = exports.Wrapper = void 0;
4
- const constants_1 = require("../../DashboardSidebar/constants");
3
+ exports.DecorativeHeaderBackground = exports.Wrapper = void 0;
5
4
  const styled_1 = require("../../styled");
6
- const constants_2 = require("../constants");
5
+ const constants_1 = require("../constants");
7
6
  exports.Wrapper = (0, styled_1.styled)('div') `
8
7
  display: flex;
9
8
  justify-content: center;
@@ -20,7 +19,7 @@ exports.DecorativeHeaderBackground = styled_1.styled.div `
20
19
  left: 0;
21
20
 
22
21
  width: 100%;
23
- height: ${({ $isFocusedMode }) => ($isFocusedMode ? 0 : constants_2.HEADER_HEIGHT_DESKTOP)};
22
+ height: ${({ $isFocusedMode }) => ($isFocusedMode ? 0 : constants_1.HEADER_HEIGHT_DESKTOP)};
24
23
 
25
24
  background-color: ${({ theme }) => theme.palette.background.default};
26
25
  border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
@@ -32,54 +31,10 @@ exports.DecorativeHeaderBackground = styled_1.styled.div `
32
31
  }};
33
32
 
34
33
  ${({ theme }) => theme.breakpoints.down('laptop')} {
35
- height: ${({ $isFocusedMode }) => ($isFocusedMode ? 0 : constants_2.HEADER_HEIGHT_LAPTOP)}
34
+ height: ${({ $isFocusedMode }) => ($isFocusedMode ? 0 : constants_1.HEADER_HEIGHT_LAPTOP)}
36
35
  }
37
36
 
38
37
  ${({ theme }) => theme.breakpoints.down('sm')} {
39
38
  display: none;
40
39
  }
41
40
  `;
42
- exports.LayoutContent = (0, styled_1.styled)('div', {
43
- shouldForwardProp: (prop) => !['$isFocusedMode'].includes(prop),
44
- }) `
45
- display: grid;
46
- grid-template-columns: auto 1fr;
47
- grid-template-rows: auto auto 1fr;
48
- flex-grow: 1;
49
-
50
- /* Максимальная ширина с отступами */
51
- max-width: ${({ $isFocusedMode }) => ($isFocusedMode ? '100%' : '1572px')};
52
- height: 100vh;
53
- padding: ${({ theme }) => theme.spacing(0, 4, 4)};
54
-
55
- transition: ${({ theme }) => {
56
- return theme.transitions.create(['max-width'], {
57
- duration: theme.transitions.duration.complex,
58
- });
59
- }};
60
-
61
- /* Причина игнора: Не критично для отображения */
62
- /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
63
- &:has(.${constants_1.dashboardSidebarClassnames.root}) {
64
- column-gap: ${({ theme }) => theme.spacing(4)};
65
-
66
- ${({ theme }) => theme.breakpoints.down('sm')} {
67
- column-gap: 0;
68
- }
69
- }
70
-
71
- /* Причина игнора: Прогрессивное улучшение */
72
- /* stylelint-disable plugin/no-unsupported-browser-features */
73
- @supports (height: 100dvh) {
74
- height: 100dvh;
75
- }
76
- /* stylelint-enable plugin/no-unsupported-browser-features */
77
-
78
- ${({ theme }) => theme.breakpoints.down('sm')} {
79
- column-gap: 0;
80
-
81
- min-width: unset;
82
- max-width: unset;
83
- padding: 0;
84
- }
85
- `;
@@ -5,7 +5,7 @@ export declare const useLogic: ({ profile, menuOrganization }: HeaderProps) => {
5
5
  isShowProfile: boolean;
6
6
  isMobile: boolean;
7
7
  isFocusedMode: boolean;
8
- mobileHeaderPriorityFeature: "profile" | "menuOrg";
8
+ mobileHeaderPriorityFeature: "menuOrg" | "profile";
9
9
  isLoading: boolean;
10
10
  collapsedIn: boolean;
11
11
  onToggleSidebar: (newValue?: boolean | undefined) => void;
@@ -15,4 +15,9 @@ export type DashboardLayoutProps = {
15
15
  * Второстепенный будет помещен в sidebar.
16
16
  */
17
17
  mobileHeaderPriorityFeature?: 'profile' | 'menuOrg';
18
+ /**
19
+ * Compact - ширина layout ограничена 1572px. Необходимо для удобного чтения контента, без лишнего растягивания
20
+ * Wide - ширина layout ограничена 1920px. Применяйте, когда в вашем приложении отображается много табличных данных с большим количеством колонок. Пример - админки
21
+ */
22
+ desktopViewMode?: 'wide' | 'compact';
18
23
  };
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DashboardLayoutSkeleton = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Container_1 = require("../DashboardLayout/Container");
5
6
  const constants_1 = require("../DashboardLayout/constants");
6
7
  const DashboardLayout_1 = require("../DashboardLayout/DashboardLayout");
7
8
  const styles_1 = require("../DashboardLayout/DashboardWrapper/styles");
@@ -14,7 +15,7 @@ const styles_2 = require("./styles");
14
15
  * Компонент можно использовать для отображения состояния загрузки дашборда
15
16
  */
16
17
  const DashboardLayoutSkeleton = ({ product, productSwitcher, hasSidebar = true, hasProfile = true, hasMenuOrganization = true, }) => {
17
- return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: constants_1.dashboardLayoutClassnames.root, children: [(0, jsx_runtime_1.jsx)(styles_1.DecorativeHeaderBackground, { role: "presentation", "$isFocusedMode": false }), (0, jsx_runtime_1.jsxs)(styles_1.LayoutContent, { "$isFocusedMode": false, children: [hasSidebar && (0, jsx_runtime_1.jsx)(DashboardSidebarSkeleton_1.DashboardSidebarSkeleton, {}), (0, jsx_runtime_1.jsx)(Header_1.Header, { productSwitcher: productSwitcher, product: product, menuOrganization: hasMenuOrganization ? () => (0, jsx_runtime_1.jsx)(MenuOrganization_1.MenuOrganizationSkeleton, {}) : undefined, profile: hasProfile
18
+ return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: constants_1.dashboardLayoutClassnames.root, children: [(0, jsx_runtime_1.jsx)(styles_1.DecorativeHeaderBackground, { role: "presentation", "$isFocusedMode": false }), (0, jsx_runtime_1.jsxs)(Container_1.Container, { children: [hasSidebar && (0, jsx_runtime_1.jsx)(DashboardSidebarSkeleton_1.DashboardSidebarSkeleton, {}), (0, jsx_runtime_1.jsx)(Header_1.Header, { productSwitcher: productSwitcher, product: product, menuOrganization: hasMenuOrganization ? () => (0, jsx_runtime_1.jsx)(MenuOrganization_1.MenuOrganizationSkeleton, {}) : undefined, profile: hasProfile
18
19
  ? { displayName: '', isLoading: true, menuList: [] }
19
20
  : undefined }), (0, jsx_runtime_1.jsx)(DashboardLayout_1.DashboardLayout.Main, { children: (0, jsx_runtime_1.jsx)(styles_2.Content, { children: (0, jsx_runtime_1.jsx)(LoadingPlaceholder_1.LoadingPlaceholder, { title: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445" }) }) })] })] }));
20
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.52.1",
3
+ "version": "4.53.1",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {