@astral/ui 4.37.1 → 4.38.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.
- package/components/Button/Button.js +2 -1
- package/components/Button/constants.d.ts +1 -0
- package/components/Button/constants.js +1 -0
- package/components/NotFoundPage/styles.js +1 -1
- package/components/PageAside/styles.js +2 -3
- package/components/PageContent/PageContentHeader/styles.js +3 -1
- package/components/PageContent/styles.js +8 -0
- package/components/PageHeader/constants.d.ts +1 -0
- package/components/PageHeader/constants.js +1 -0
- package/components/PageHeader/styles.js +12 -0
- package/components/PageHeader/useLogic/useLogic.d.ts +1 -1
- package/components/PageHeader/useLogic/useLogic.js +2 -1
- package/components/PageLayout/PageLayout.js +5 -2
- package/components/PageLayoutContainer/constants.d.ts +1 -0
- package/components/PageLayoutContainer/constants.js +1 -0
- package/components/PageLayoutContainer/styles.js +5 -0
- package/components/PagePinnableAside/styles.js +1 -0
- package/components/theme/components/MuiButton.js +23 -9
- package/hook-form/FormPageLayoutBase/styles.js +4 -3
- package/node/components/Button/Button.js +2 -1
- package/node/components/Button/constants.d.ts +1 -0
- package/node/components/Button/constants.js +1 -0
- package/node/components/NotFoundPage/styles.js +1 -1
- package/node/components/PageAside/styles.js +2 -3
- package/node/components/PageContent/PageContentHeader/styles.js +3 -1
- package/node/components/PageContent/styles.js +13 -5
- package/node/components/PageHeader/constants.d.ts +1 -0
- package/node/components/PageHeader/constants.js +1 -0
- package/node/components/PageHeader/styles.js +12 -0
- package/node/components/PageHeader/useLogic/useLogic.d.ts +1 -1
- package/node/components/PageHeader/useLogic/useLogic.js +2 -1
- package/node/components/PageLayout/PageLayout.js +4 -1
- package/node/components/PageLayoutContainer/constants.d.ts +1 -0
- package/node/components/PageLayoutContainer/constants.js +1 -0
- package/node/components/PageLayoutContainer/styles.js +5 -0
- package/node/components/PagePinnableAside/styles.js +1 -0
- package/node/components/theme/components/MuiButton.js +23 -9
- package/node/hook-form/FormPageLayoutBase/styles.js +4 -3
- package/package.json +1 -1
|
@@ -10,9 +10,10 @@ const UnwrappedButton = (props, ref) => {
|
|
|
10
10
|
const { variant = ButtonVariants.Contained, color = variant === ButtonVariants.Text
|
|
11
11
|
? ButtonColors.Grey
|
|
12
12
|
: ButtonColors.Primary, loading, disabled, children, className, selected, ...restProps } = props;
|
|
13
|
-
return (_jsxs(StyledButton, { variant: variant, ref: ref, color: color, disabled: disabled, selected: selected, ...restProps, className: classNames(className, buttonClassnames.root, {
|
|
13
|
+
return (_jsxs(StyledButton, { variant: variant, ref: ref, color: color, disabled: disabled || loading, selected: selected, ...restProps, className: classNames(className, buttonClassnames.root, {
|
|
14
14
|
[buttonClassnames.loading]: loading,
|
|
15
15
|
[buttonClassnames.selected]: selected,
|
|
16
|
+
[buttonClassnames.disabled]: disabled,
|
|
16
17
|
}), "aria-disabled": loading, children: [loading && (_jsx(StyledLoader, { color: loadingIndicatorColor, size: "small", "$color": color, "$variant": variant, "$isDisabled": disabled })), children] }));
|
|
17
18
|
};
|
|
18
19
|
export const Button = forwardRefWithGeneric(UnwrappedButton);
|
|
@@ -22,9 +22,8 @@ export const Wrapper = styled.aside `
|
|
|
22
22
|
width: unset;
|
|
23
23
|
margin: ${({ theme }) => theme.spacing(0, 4, 4)};
|
|
24
24
|
|
|
25
|
-
background-color: ${({ theme }) => theme.palette.background.default};
|
|
26
|
-
border
|
|
27
|
-
border-left: 0;
|
|
25
|
+
background-color: ${({ theme }) => theme.palette.background.default};
|
|
26
|
+
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
28
27
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
29
28
|
}
|
|
30
29
|
`;
|
|
@@ -8,11 +8,13 @@ export const Wrapper = styled.header `
|
|
|
8
8
|
padding: ${({ theme }) => theme.spacing(4, 6)};
|
|
9
9
|
|
|
10
10
|
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
13
13
|
margin: ${({ theme }) => theme.spacing(0, 4)};
|
|
14
14
|
|
|
15
15
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
16
|
+
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
17
|
+
border-bottom: none;
|
|
16
18
|
border-top-left-radius: ${({ theme }) => theme.shape.medium};
|
|
17
19
|
border-top-right-radius: ${({ theme }) => theme.shape.medium};
|
|
18
20
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cardGridClassnames } from '../CardGridInfinite/constants';
|
|
1
2
|
import { pdfViewerClassnames } from '../PdfViewer';
|
|
2
3
|
import { styled } from '../styled';
|
|
3
4
|
import { PAGE_CONTENT_ANIMATION, pageContentClassnames } from './constants';
|
|
@@ -74,8 +75,15 @@ export const Content = styled.div `
|
|
|
74
75
|
padding: ${({ theme }) => theme.spacing(4, 4, 3)};
|
|
75
76
|
|
|
76
77
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
78
|
+
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
77
79
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
78
80
|
|
|
81
|
+
/* Причина игнора: Не критично для отображения */
|
|
82
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
83
|
+
&:has(.${cardGridClassnames.root}) {
|
|
84
|
+
border: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
79
87
|
&.${pageContentClassnames.contentHasHeader} {
|
|
80
88
|
border-top-left-radius: 0;
|
|
81
89
|
border-top-right-radius: 0;
|
|
@@ -6,5 +6,6 @@ export const pageHeaderClassnames = {
|
|
|
6
6
|
hasTitle: createUIKitClassname('page-header_has-title'),
|
|
7
7
|
filters: createUIKitClassname('page-header__filters'),
|
|
8
8
|
quickFilters: createUIKitClassname('page-header__quick-filters'),
|
|
9
|
+
hasFilters: createUIKitClassname('page-header_has-filters'),
|
|
9
10
|
};
|
|
10
11
|
export const PAGE_HEADER_HEIGHT_MOBILE = '48px';
|
|
@@ -15,6 +15,10 @@ export const Wrapper = styled.header `
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
18
|
+
position: sticky;
|
|
19
|
+
z-index: ${({ theme }) => theme.zIndex.fab};
|
|
20
|
+
top: ${PAGE_HEADER_HEIGHT_MOBILE};
|
|
21
|
+
|
|
18
22
|
display: block;
|
|
19
23
|
|
|
20
24
|
margin-bottom: ${({ theme }) => theme.spacing(4)};
|
|
@@ -31,6 +35,10 @@ export const Wrapper = styled.header `
|
|
|
31
35
|
grid-column: 3;
|
|
32
36
|
grid-row: 1 / -1;
|
|
33
37
|
}
|
|
38
|
+
|
|
39
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
40
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
41
|
+
}
|
|
34
42
|
}
|
|
35
43
|
|
|
36
44
|
.${pageHeaderClassnames.quickFilters} {
|
|
@@ -60,6 +68,10 @@ export const MobileTitleWrapper = styled.div `
|
|
|
60
68
|
order: 1;
|
|
61
69
|
|
|
62
70
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
71
|
+
|
|
72
|
+
&:not(.${pageHeaderClassnames.hasFilters}) {
|
|
73
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
74
|
+
}
|
|
63
75
|
|
|
64
76
|
&.${pageHeaderClassnames.hasTitle} {
|
|
65
77
|
display: flex;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ElementType } from 'react';
|
|
2
2
|
import type { PageHeaderProps } from '../types';
|
|
3
3
|
type UseLogicParams<TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType, TBackButtonComponent extends ElementType = ElementType> = PageHeaderProps<TMainActionComponent, TSecondaryActionComponent, TBackButtonComponent>;
|
|
4
|
-
export declare const useLogic: <TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType, TBackButtonComponent extends ElementType = ElementType>({ shouldUpdateDocumentTitle, title, actions, htmlTitle, backButton, }: UseLogicParams<TMainActionComponent, TSecondaryActionComponent, TBackButtonComponent>) => {
|
|
4
|
+
export declare const useLogic: <TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType, TBackButtonComponent extends ElementType = ElementType>({ shouldUpdateDocumentTitle, title, actions, htmlTitle, backButton, filters, }: UseLogicParams<TMainActionComponent, TSecondaryActionComponent, TBackButtonComponent>) => {
|
|
5
5
|
isShowMobileActions: boolean | undefined;
|
|
6
6
|
isLoading: boolean | undefined;
|
|
7
7
|
mobileTitleActions: import("react").ReactNode;
|
|
@@ -3,7 +3,7 @@ import { PageContext } from '../../PageContext';
|
|
|
3
3
|
import { classNames } from '../../utils/classNames';
|
|
4
4
|
import { pageHeaderClassnames } from '../constants';
|
|
5
5
|
import { usePageTitle } from '../hooks/usePageTitle';
|
|
6
|
-
export const useLogic = ({ shouldUpdateDocumentTitle, title, actions, htmlTitle, backButton, }) => {
|
|
6
|
+
export const useLogic = ({ shouldUpdateDocumentTitle, title, actions, htmlTitle, backButton, filters, }) => {
|
|
7
7
|
//Переопределение Html title на title из параметров
|
|
8
8
|
usePageTitle({ shouldUpdateDocumentTitle, htmlTitle, title });
|
|
9
9
|
const { mobileTitleActions, isLoading } = useContext(PageContext);
|
|
@@ -11,6 +11,7 @@ export const useLogic = ({ shouldUpdateDocumentTitle, title, actions, htmlTitle,
|
|
|
11
11
|
const mobileClassnames = useMemo(() => classNames(pageHeaderClassnames.pageHeaderMobileTitle, {
|
|
12
12
|
[pageHeaderClassnames.hasTitle]: Boolean(title) || isLoading,
|
|
13
13
|
[pageHeaderClassnames.hasBackButton]: Boolean(backButton),
|
|
14
|
+
[pageHeaderClassnames.hasFilters]: Boolean(filters),
|
|
14
15
|
}), [title, backButton, isLoading]);
|
|
15
16
|
return {
|
|
16
17
|
isShowMobileActions,
|
|
@@ -4,14 +4,17 @@ import { PageAside } from '../PageAside';
|
|
|
4
4
|
import { PageContent } from '../PageContent';
|
|
5
5
|
import { PageContextProvider } from '../PageContext';
|
|
6
6
|
import { PageHeader } from '../PageHeader';
|
|
7
|
-
import { PageLayoutContainer } from '../PageLayoutContainer';
|
|
7
|
+
import { PageLayoutContainer, pageLayoutClassnames, } from '../PageLayoutContainer';
|
|
8
8
|
import { LoadingPlaceholder } from '../placeholders/LoadingPlaceholder';
|
|
9
|
+
import { classNames } from '../utils/classNames';
|
|
9
10
|
import { DesktopAlertWrapper, LoaderWrapper, MobileAlertWrapper, } from './styles';
|
|
10
11
|
import { useLogic } from './useLogic';
|
|
11
12
|
export const PageLayout = (props) => {
|
|
12
13
|
const { header, content, aside, footer, className, alert, isLoading } = props;
|
|
13
14
|
const { hasAside, ref } = useLogic(props);
|
|
14
|
-
return (_jsxs(PageContextProvider, { hasAside: hasAside, isLoading: isLoading, children: [alert && _jsx(DesktopAlertWrapper, { children: alert }), _jsxs(PageLayoutContainer, { className: className,
|
|
15
|
+
return (_jsxs(PageContextProvider, { hasAside: hasAside, isLoading: isLoading, children: [alert && _jsx(DesktopAlertWrapper, { children: alert }), _jsxs(PageLayoutContainer, { className: classNames(className, {
|
|
16
|
+
[pageLayoutClassnames.withoutHeader]: !header,
|
|
17
|
+
}), ref: ref, children: [alert && _jsx(MobileAlertWrapper, { children: alert }), isValidElement(header)
|
|
15
18
|
? header
|
|
16
19
|
: header && _jsx(PageHeader, { ...header }), isLoading ? (_jsx(LoaderWrapper, { children: _jsx(LoadingPlaceholder, { title: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445..." }) })) : (_jsxs(_Fragment, { children: [isValidElement(content) ? (content) : (_jsx(PageContent, { ...content, footer: footer })), aside && !isValidElement(aside) && (_jsx(PageAside, { ...aside })), isValidElement(aside) && aside] }))] })] }));
|
|
17
20
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Paper } from '../Paper';
|
|
2
2
|
import { styled } from '../styled';
|
|
3
|
+
import { pageLayoutClassnames } from './constants';
|
|
3
4
|
export const Wrapper = styled.div `
|
|
4
5
|
display: grid;
|
|
5
6
|
grid-row-gap: ${({ theme }) => theme.spacing(4)};
|
|
@@ -39,5 +40,9 @@ export const StylePaper = styled(Paper) `
|
|
|
39
40
|
|
|
40
41
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
41
42
|
border: unset;
|
|
43
|
+
|
|
44
|
+
.${pageLayoutClassnames.withoutHeader} {
|
|
45
|
+
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
46
|
+
}
|
|
42
47
|
}
|
|
43
48
|
`;
|
|
@@ -31,6 +31,7 @@ export const Aside = styled('aside', {
|
|
|
31
31
|
margin: ${({ theme }) => theme.spacing(0, 4, 4)};
|
|
32
32
|
|
|
33
33
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
34
|
+
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
34
35
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
35
36
|
}
|
|
36
37
|
`;
|
|
@@ -441,6 +441,16 @@ export const MuiButton = {
|
|
|
441
441
|
selected,
|
|
442
442
|
disabled,
|
|
443
443
|
}),
|
|
444
|
+
[`&.${buttonClasses.disabled}`]: {
|
|
445
|
+
color: theme.palette.grey['500'],
|
|
446
|
+
backgroundColor: getButtonDisabledBackgroundColor({
|
|
447
|
+
theme,
|
|
448
|
+
variant,
|
|
449
|
+
}),
|
|
450
|
+
pointerEvents: 'none',
|
|
451
|
+
cursor: 'unset',
|
|
452
|
+
border: 'unset',
|
|
453
|
+
},
|
|
444
454
|
[`&.${buttonClassnames.loading}`]: {
|
|
445
455
|
color: 'transparent',
|
|
446
456
|
pointerEvents: 'none',
|
|
@@ -451,18 +461,22 @@ export const MuiButton = {
|
|
|
451
461
|
theme,
|
|
452
462
|
buttonState: ButtonStates.Default,
|
|
453
463
|
}),
|
|
454
|
-
|
|
455
|
-
[`&.${buttonClasses.disabled}`]: {
|
|
456
|
-
color: theme.palette.grey['500'],
|
|
457
|
-
backgroundColor: getButtonDisabledBackgroundColor({
|
|
464
|
+
border: getBorder({
|
|
458
465
|
theme,
|
|
459
466
|
variant,
|
|
467
|
+
color,
|
|
468
|
+
buttonState: ButtonStates.Default,
|
|
469
|
+
selected,
|
|
470
|
+
disabled: false,
|
|
460
471
|
}),
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
472
|
+
[`&.${buttonClassnames.disabled}`]: {
|
|
473
|
+
backgroundColor: getButtonDisabledBackgroundColor({
|
|
474
|
+
theme,
|
|
475
|
+
variant,
|
|
476
|
+
}),
|
|
477
|
+
pointerEvents: 'none',
|
|
478
|
+
cursor: 'unset',
|
|
479
|
+
border: 'unset',
|
|
466
480
|
},
|
|
467
481
|
},
|
|
468
482
|
gap: theme.spacing(2),
|
|
@@ -33,13 +33,14 @@ export const StyledPageContent = styled(PageContent) `
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
36
|
-
margin-bottom: ${({ theme }) => theme.spacing(
|
|
36
|
+
margin-bottom: ${({ theme }) => theme.spacing(20)};
|
|
37
|
+
padding-top: 0;
|
|
37
38
|
|
|
38
39
|
&.${formPageContentClassnames.formPageContentSecondaryActions} {
|
|
39
|
-
margin-bottom: ${({ theme }) => theme.spacing(
|
|
40
|
+
margin-bottom: ${({ theme }) => theme.spacing(32)};
|
|
40
41
|
|
|
41
42
|
&.${formPageContentClassnames.formWizardPageContentActions} {
|
|
42
|
-
margin-bottom: ${({ theme }) => theme.spacing(
|
|
43
|
+
margin-bottom: ${({ theme }) => theme.spacing(50)};
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -13,9 +13,10 @@ const UnwrappedButton = (props, ref) => {
|
|
|
13
13
|
const { variant = enums_1.ButtonVariants.Contained, color = variant === enums_1.ButtonVariants.Text
|
|
14
14
|
? enums_1.ButtonColors.Grey
|
|
15
15
|
: enums_1.ButtonColors.Primary, loading, disabled, children, className, selected, ...restProps } = props;
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledButton, { variant: variant, ref: ref, color: color, disabled: disabled, selected: selected, ...restProps, className: (0, classNames_1.classNames)(className, constants_1.buttonClassnames.root, {
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledButton, { variant: variant, ref: ref, color: color, disabled: disabled || loading, selected: selected, ...restProps, className: (0, classNames_1.classNames)(className, constants_1.buttonClassnames.root, {
|
|
17
17
|
[constants_1.buttonClassnames.loading]: loading,
|
|
18
18
|
[constants_1.buttonClassnames.selected]: selected,
|
|
19
|
+
[constants_1.buttonClassnames.disabled]: disabled,
|
|
19
20
|
}), "aria-disabled": loading, children: [loading && ((0, jsx_runtime_1.jsx)(styles_1.StyledLoader, { color: loadingIndicatorColor, size: "small", "$color": color, "$variant": variant, "$isDisabled": disabled })), children] }));
|
|
20
21
|
};
|
|
21
22
|
exports.Button = (0, forwardRefWithGeneric_1.forwardRefWithGeneric)(UnwrappedButton);
|
|
@@ -8,4 +8,5 @@ exports.buttonClassnames = {
|
|
|
8
8
|
root: (0, createUIKitClassname_1.createUIKitClassname)('button'),
|
|
9
9
|
loading: (0, createUIKitClassname_1.createUIKitClassname)('button_loading'),
|
|
10
10
|
selected: (0, createUIKitClassname_1.createUIKitClassname)('button_selected'),
|
|
11
|
+
disabled: (0, createUIKitClassname_1.createUIKitClassname)('button_disabled'),
|
|
11
12
|
};
|
|
@@ -40,6 +40,6 @@ exports.Image = styled_1.styled.img `
|
|
|
40
40
|
`;
|
|
41
41
|
exports.StyledPageContent = (0, styled_1.styled)(PageContent_1.PageContent) `
|
|
42
42
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
43
|
-
margin: ${({ theme }) => theme.spacing(4)};
|
|
43
|
+
margin-top: ${({ theme }) => theme.spacing(4)};
|
|
44
44
|
}
|
|
45
45
|
`;
|
|
@@ -25,9 +25,8 @@ exports.Wrapper = styled_1.styled.aside `
|
|
|
25
25
|
width: unset;
|
|
26
26
|
margin: ${({ theme }) => theme.spacing(0, 4, 4)};
|
|
27
27
|
|
|
28
|
-
background-color: ${({ theme }) => theme.palette.background.default};
|
|
29
|
-
border
|
|
30
|
-
border-left: 0;
|
|
28
|
+
background-color: ${({ theme }) => theme.palette.background.default};
|
|
29
|
+
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
31
30
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
32
31
|
}
|
|
33
32
|
`;
|
|
@@ -11,11 +11,13 @@ exports.Wrapper = styled_1.styled.header `
|
|
|
11
11
|
padding: ${({ theme }) => theme.spacing(4, 6)};
|
|
12
12
|
|
|
13
13
|
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
16
16
|
margin: ${({ theme }) => theme.spacing(0, 4)};
|
|
17
17
|
|
|
18
18
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
19
|
+
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
20
|
+
border-bottom: none;
|
|
19
21
|
border-top-left-radius: ${({ theme }) => theme.shape.medium};
|
|
20
22
|
border-top-right-radius: ${({ theme }) => theme.shape.medium};
|
|
21
23
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Content = exports.Wrapper = void 0;
|
|
4
|
+
const constants_1 = require("../CardGridInfinite/constants");
|
|
4
5
|
const PdfViewer_1 = require("../PdfViewer");
|
|
5
6
|
const styled_1 = require("../styled");
|
|
6
|
-
const
|
|
7
|
+
const constants_2 = require("./constants");
|
|
7
8
|
const getPaddingContent = (theme, hasAside) => {
|
|
8
9
|
return hasAside ? theme.spacing(4, 6, 4) : theme.spacing(0, 6, 4);
|
|
9
10
|
};
|
|
@@ -31,7 +32,7 @@ exports.Wrapper = (0, styled_1.styled)('article', {
|
|
|
31
32
|
border-top: none;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
@keyframes ${
|
|
35
|
+
@keyframes ${constants_2.PAGE_CONTENT_ANIMATION} {
|
|
35
36
|
0% {
|
|
36
37
|
display: none;
|
|
37
38
|
|
|
@@ -49,8 +50,8 @@ exports.Wrapper = (0, styled_1.styled)('article', {
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
&.${
|
|
53
|
-
animation: ${({ theme }) => `${
|
|
53
|
+
&.${constants_2.pageContentClassnames.animation} > * {
|
|
54
|
+
animation: ${({ theme }) => `${constants_2.PAGE_CONTENT_ANIMATION} ${theme.transitions.duration.complex * 2}ms`};
|
|
54
55
|
}
|
|
55
56
|
`;
|
|
56
57
|
exports.Content = styled_1.styled.div `
|
|
@@ -77,9 +78,16 @@ exports.Content = styled_1.styled.div `
|
|
|
77
78
|
padding: ${({ theme }) => theme.spacing(4, 4, 3)};
|
|
78
79
|
|
|
79
80
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
81
|
+
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
80
82
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
81
83
|
|
|
82
|
-
|
|
84
|
+
/* Причина игнора: Не критично для отображения */
|
|
85
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
86
|
+
&:has(.${constants_1.cardGridClassnames.root}) {
|
|
87
|
+
border: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.${constants_2.pageContentClassnames.contentHasHeader} {
|
|
83
91
|
border-top-left-radius: 0;
|
|
84
92
|
border-top-right-radius: 0;
|
|
85
93
|
}
|
|
@@ -9,5 +9,6 @@ exports.pageHeaderClassnames = {
|
|
|
9
9
|
hasTitle: (0, createUIKitClassname_1.createUIKitClassname)('page-header_has-title'),
|
|
10
10
|
filters: (0, createUIKitClassname_1.createUIKitClassname)('page-header__filters'),
|
|
11
11
|
quickFilters: (0, createUIKitClassname_1.createUIKitClassname)('page-header__quick-filters'),
|
|
12
|
+
hasFilters: (0, createUIKitClassname_1.createUIKitClassname)('page-header_has-filters'),
|
|
12
13
|
};
|
|
13
14
|
exports.PAGE_HEADER_HEIGHT_MOBILE = '48px';
|
|
@@ -18,6 +18,10 @@ exports.Wrapper = styled_1.styled.header `
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
21
|
+
position: sticky;
|
|
22
|
+
z-index: ${({ theme }) => theme.zIndex.fab};
|
|
23
|
+
top: ${constants_1.PAGE_HEADER_HEIGHT_MOBILE};
|
|
24
|
+
|
|
21
25
|
display: block;
|
|
22
26
|
|
|
23
27
|
margin-bottom: ${({ theme }) => theme.spacing(4)};
|
|
@@ -34,6 +38,10 @@ exports.Wrapper = styled_1.styled.header `
|
|
|
34
38
|
grid-column: 3;
|
|
35
39
|
grid-row: 1 / -1;
|
|
36
40
|
}
|
|
41
|
+
|
|
42
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
43
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
44
|
+
}
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
.${constants_1.pageHeaderClassnames.quickFilters} {
|
|
@@ -63,6 +71,10 @@ exports.MobileTitleWrapper = styled_1.styled.div `
|
|
|
63
71
|
order: 1;
|
|
64
72
|
|
|
65
73
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
74
|
+
|
|
75
|
+
&:not(.${constants_1.pageHeaderClassnames.hasFilters}) {
|
|
76
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
77
|
+
}
|
|
66
78
|
|
|
67
79
|
&.${constants_1.pageHeaderClassnames.hasTitle} {
|
|
68
80
|
display: flex;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ElementType } from 'react';
|
|
2
2
|
import type { PageHeaderProps } from '../types';
|
|
3
3
|
type UseLogicParams<TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType, TBackButtonComponent extends ElementType = ElementType> = PageHeaderProps<TMainActionComponent, TSecondaryActionComponent, TBackButtonComponent>;
|
|
4
|
-
export declare const useLogic: <TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType, TBackButtonComponent extends ElementType = ElementType>({ shouldUpdateDocumentTitle, title, actions, htmlTitle, backButton, }: UseLogicParams<TMainActionComponent, TSecondaryActionComponent, TBackButtonComponent>) => {
|
|
4
|
+
export declare const useLogic: <TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType, TBackButtonComponent extends ElementType = ElementType>({ shouldUpdateDocumentTitle, title, actions, htmlTitle, backButton, filters, }: UseLogicParams<TMainActionComponent, TSecondaryActionComponent, TBackButtonComponent>) => {
|
|
5
5
|
isShowMobileActions: boolean | undefined;
|
|
6
6
|
isLoading: boolean | undefined;
|
|
7
7
|
mobileTitleActions: import("react").ReactNode;
|
|
@@ -6,7 +6,7 @@ const PageContext_1 = require("../../PageContext");
|
|
|
6
6
|
const classNames_1 = require("../../utils/classNames");
|
|
7
7
|
const constants_1 = require("../constants");
|
|
8
8
|
const usePageTitle_1 = require("../hooks/usePageTitle");
|
|
9
|
-
const useLogic = ({ shouldUpdateDocumentTitle, title, actions, htmlTitle, backButton, }) => {
|
|
9
|
+
const useLogic = ({ shouldUpdateDocumentTitle, title, actions, htmlTitle, backButton, filters, }) => {
|
|
10
10
|
//Переопределение Html title на title из параметров
|
|
11
11
|
(0, usePageTitle_1.usePageTitle)({ shouldUpdateDocumentTitle, htmlTitle, title });
|
|
12
12
|
const { mobileTitleActions, isLoading } = (0, react_1.useContext)(PageContext_1.PageContext);
|
|
@@ -14,6 +14,7 @@ const useLogic = ({ shouldUpdateDocumentTitle, title, actions, htmlTitle, backBu
|
|
|
14
14
|
const mobileClassnames = (0, react_1.useMemo)(() => (0, classNames_1.classNames)(constants_1.pageHeaderClassnames.pageHeaderMobileTitle, {
|
|
15
15
|
[constants_1.pageHeaderClassnames.hasTitle]: Boolean(title) || isLoading,
|
|
16
16
|
[constants_1.pageHeaderClassnames.hasBackButton]: Boolean(backButton),
|
|
17
|
+
[constants_1.pageHeaderClassnames.hasFilters]: Boolean(filters),
|
|
17
18
|
}), [title, backButton, isLoading]);
|
|
18
19
|
return {
|
|
19
20
|
isShowMobileActions,
|
|
@@ -9,12 +9,15 @@ const PageContext_1 = require("../PageContext");
|
|
|
9
9
|
const PageHeader_1 = require("../PageHeader");
|
|
10
10
|
const PageLayoutContainer_1 = require("../PageLayoutContainer");
|
|
11
11
|
const LoadingPlaceholder_1 = require("../placeholders/LoadingPlaceholder");
|
|
12
|
+
const classNames_1 = require("../utils/classNames");
|
|
12
13
|
const styles_1 = require("./styles");
|
|
13
14
|
const useLogic_1 = require("./useLogic");
|
|
14
15
|
const PageLayout = (props) => {
|
|
15
16
|
const { header, content, aside, footer, className, alert, isLoading } = props;
|
|
16
17
|
const { hasAside, ref } = (0, useLogic_1.useLogic)(props);
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)(PageContext_1.PageContextProvider, { hasAside: hasAside, isLoading: isLoading, children: [alert && (0, jsx_runtime_1.jsx)(styles_1.DesktopAlertWrapper, { children: alert }), (0, jsx_runtime_1.jsxs)(PageLayoutContainer_1.PageLayoutContainer, { className:
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(PageContext_1.PageContextProvider, { hasAside: hasAside, isLoading: isLoading, children: [alert && (0, jsx_runtime_1.jsx)(styles_1.DesktopAlertWrapper, { children: alert }), (0, jsx_runtime_1.jsxs)(PageLayoutContainer_1.PageLayoutContainer, { className: (0, classNames_1.classNames)(className, {
|
|
19
|
+
[PageLayoutContainer_1.pageLayoutClassnames.withoutHeader]: !header,
|
|
20
|
+
}), ref: ref, children: [alert && (0, jsx_runtime_1.jsx)(styles_1.MobileAlertWrapper, { children: alert }), (0, react_1.isValidElement)(header)
|
|
18
21
|
? header
|
|
19
22
|
: header && (0, jsx_runtime_1.jsx)(PageHeader_1.PageHeader, { ...header }), isLoading ? ((0, jsx_runtime_1.jsx)(styles_1.LoaderWrapper, { children: (0, jsx_runtime_1.jsx)(LoadingPlaceholder_1.LoadingPlaceholder, { title: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445..." }) })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, react_1.isValidElement)(content) ? (content) : ((0, jsx_runtime_1.jsx)(PageContent_1.PageContent, { ...content, footer: footer })), aside && !(0, react_1.isValidElement)(aside) && ((0, jsx_runtime_1.jsx)(PageAside_1.PageAside, { ...aside })), (0, react_1.isValidElement)(aside) && aside] }))] })] }));
|
|
20
23
|
};
|
|
@@ -4,4 +4,5 @@ exports.pageLayoutClassnames = void 0;
|
|
|
4
4
|
const createUIKitClassname_1 = require("../utils/createUIKitClassname");
|
|
5
5
|
exports.pageLayoutClassnames = {
|
|
6
6
|
root: (0, createUIKitClassname_1.createUIKitClassname)('page-layout'),
|
|
7
|
+
withoutHeader: (0, createUIKitClassname_1.createUIKitClassname)('page-layout_without-header'),
|
|
7
8
|
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.StylePaper = exports.Wrapper = void 0;
|
|
4
4
|
const Paper_1 = require("../Paper");
|
|
5
5
|
const styled_1 = require("../styled");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
6
7
|
exports.Wrapper = styled_1.styled.div `
|
|
7
8
|
display: grid;
|
|
8
9
|
grid-row-gap: ${({ theme }) => theme.spacing(4)};
|
|
@@ -42,5 +43,9 @@ exports.StylePaper = (0, styled_1.styled)(Paper_1.Paper) `
|
|
|
42
43
|
|
|
43
44
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
44
45
|
border: unset;
|
|
46
|
+
|
|
47
|
+
.${constants_1.pageLayoutClassnames.withoutHeader} {
|
|
48
|
+
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
51
|
`;
|
|
@@ -34,6 +34,7 @@ exports.Aside = (0, styled_1.styled)('aside', {
|
|
|
34
34
|
margin: ${({ theme }) => theme.spacing(0, 4, 4)};
|
|
35
35
|
|
|
36
36
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
37
|
+
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
37
38
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
38
39
|
}
|
|
39
40
|
`;
|
|
@@ -450,6 +450,16 @@ exports.MuiButton = {
|
|
|
450
450
|
selected,
|
|
451
451
|
disabled,
|
|
452
452
|
}),
|
|
453
|
+
[`&.${Button_1.buttonClasses.disabled}`]: {
|
|
454
|
+
color: theme.palette.grey['500'],
|
|
455
|
+
backgroundColor: (0, exports.getButtonDisabledBackgroundColor)({
|
|
456
|
+
theme,
|
|
457
|
+
variant,
|
|
458
|
+
}),
|
|
459
|
+
pointerEvents: 'none',
|
|
460
|
+
cursor: 'unset',
|
|
461
|
+
border: 'unset',
|
|
462
|
+
},
|
|
453
463
|
[`&.${Button_2.buttonClassnames.loading}`]: {
|
|
454
464
|
color: 'transparent',
|
|
455
465
|
pointerEvents: 'none',
|
|
@@ -460,18 +470,22 @@ exports.MuiButton = {
|
|
|
460
470
|
theme,
|
|
461
471
|
buttonState: Button_2.ButtonStates.Default,
|
|
462
472
|
}),
|
|
463
|
-
|
|
464
|
-
[`&.${Button_1.buttonClasses.disabled}`]: {
|
|
465
|
-
color: theme.palette.grey['500'],
|
|
466
|
-
backgroundColor: (0, exports.getButtonDisabledBackgroundColor)({
|
|
473
|
+
border: getBorder({
|
|
467
474
|
theme,
|
|
468
475
|
variant,
|
|
476
|
+
color,
|
|
477
|
+
buttonState: Button_2.ButtonStates.Default,
|
|
478
|
+
selected,
|
|
479
|
+
disabled: false,
|
|
469
480
|
}),
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
481
|
+
[`&.${Button_2.buttonClassnames.disabled}`]: {
|
|
482
|
+
backgroundColor: (0, exports.getButtonDisabledBackgroundColor)({
|
|
483
|
+
theme,
|
|
484
|
+
variant,
|
|
485
|
+
}),
|
|
486
|
+
pointerEvents: 'none',
|
|
487
|
+
cursor: 'unset',
|
|
488
|
+
border: 'unset',
|
|
475
489
|
},
|
|
476
490
|
},
|
|
477
491
|
gap: theme.spacing(2),
|
|
@@ -36,13 +36,14 @@ exports.StyledPageContent = (0, styled_1.styled)(PageContent_1.PageContent) `
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
39
|
-
margin-bottom: ${({ theme }) => theme.spacing(
|
|
39
|
+
margin-bottom: ${({ theme }) => theme.spacing(20)};
|
|
40
|
+
padding-top: 0;
|
|
40
41
|
|
|
41
42
|
&.${constants_1.formPageContentClassnames.formPageContentSecondaryActions} {
|
|
42
|
-
margin-bottom: ${({ theme }) => theme.spacing(
|
|
43
|
+
margin-bottom: ${({ theme }) => theme.spacing(32)};
|
|
43
44
|
|
|
44
45
|
&.${constants_1.formPageContentClassnames.formWizardPageContentActions} {
|
|
45
|
-
margin-bottom: ${({ theme }) => theme.spacing(
|
|
46
|
+
margin-bottom: ${({ theme }) => theme.spacing(50)};
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
}
|