@astral/ui 4.31.1 → 4.32.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/ActionGroup/index.d.ts +1 -1
- package/components/Button/Button.js +1 -1
- package/components/Button/constants.d.ts +1 -0
- package/components/Button/constants.js +1 -0
- package/components/DashboardLayout/DashboardWrapper/styles.js +1 -1
- package/components/DashboardLayout/Header/styles.js +1 -1
- package/components/DashboardSidebar/styles.js +1 -1
- package/components/DataGridPaginationContainer/styles.js +1 -1
- package/components/PageAside/styles.js +4 -1
- package/components/PageContent/styles.js +1 -1
- package/components/PageHeader/HeaderContent/HeaderContent.js +1 -1
- package/components/PageHeader/HeaderContent/styles.js +7 -2
- package/components/PageHeader/PageActions/PageActions.d.ts +1 -0
- package/components/PageHeader/PageActions/PageActions.js +3 -7
- package/components/PageHeader/PageActions/constants.d.ts +3 -0
- package/components/PageHeader/PageActions/constants.js +3 -0
- package/components/PageHeader/PageActions/styles.d.ts +11 -1
- package/components/PageHeader/PageActions/styles.js +39 -4
- package/components/PageHeader/PageActions/types.d.ts +4 -0
- package/components/PageHeader/PageActions/useLogic/useLogic.d.ts +4 -3
- package/components/PageHeader/PageActions/useLogic/useLogic.js +38 -3
- package/components/PageHeader/styles.js +1 -1
- package/components/PageLayoutContainer/styles.js +0 -4
- package/components/PageLayoutFooter/styles.js +5 -1
- package/components/PagePinnableAside/styles.js +2 -2
- package/components/declaration/mui-material.d.ts +4 -0
- package/components/theme/breakpoints.d.ts +10 -1
- package/components/theme/breakpoints.js +1 -0
- package/hook-form/FormFilters/AllFiltersButton/AllFiltersButton.js +2 -2
- package/hook-form/FormFilters/AllFiltersButton/styles.d.ts +3 -0
- package/hook-form/FormFilters/AllFiltersButton/styles.js +33 -3
- package/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +1 -0
- package/hook-form/FormFilters/FormFiltersSkeleton/styles.js +7 -0
- package/hook-form/FormFilters/constants.d.ts +1 -0
- package/hook-form/FormFilters/constants.js +1 -0
- package/hook-form/FormFilters/styles.js +8 -4
- package/hook-form/FormFiltersSearchField/FormFiltersSearchField.js +4 -3
- package/hook-form/FormFiltersSearchField/constants.d.ts +4 -0
- package/hook-form/FormFiltersSearchField/constants.js +5 -0
- package/hook-form/FormFiltersSearchField/styles.js +60 -1
- package/node/components/ActionGroup/index.d.ts +1 -1
- package/node/components/Button/Button.js +1 -1
- package/node/components/Button/constants.d.ts +1 -0
- package/node/components/Button/constants.js +1 -0
- package/node/components/DashboardLayout/DashboardWrapper/styles.js +1 -1
- package/node/components/DashboardLayout/Header/styles.js +1 -1
- package/node/components/DashboardSidebar/styles.js +1 -1
- package/node/components/DataGridPaginationContainer/styles.js +1 -1
- package/node/components/PageAside/styles.js +4 -1
- package/node/components/PageContent/styles.js +1 -1
- package/node/components/PageHeader/HeaderContent/HeaderContent.js +1 -1
- package/node/components/PageHeader/HeaderContent/styles.js +7 -2
- package/node/components/PageHeader/PageActions/PageActions.d.ts +1 -0
- package/node/components/PageHeader/PageActions/PageActions.js +2 -6
- package/node/components/PageHeader/PageActions/constants.d.ts +3 -0
- package/node/components/PageHeader/PageActions/constants.js +4 -1
- package/node/components/PageHeader/PageActions/styles.d.ts +11 -1
- package/node/components/PageHeader/PageActions/styles.js +39 -4
- package/node/components/PageHeader/PageActions/types.d.ts +4 -0
- package/node/components/PageHeader/PageActions/useLogic/useLogic.d.ts +4 -3
- package/node/components/PageHeader/PageActions/useLogic/useLogic.js +36 -1
- package/node/components/PageHeader/styles.js +1 -1
- package/node/components/PageLayoutContainer/styles.js +0 -4
- package/node/components/PageLayoutFooter/styles.js +4 -0
- package/node/components/PagePinnableAside/styles.js +2 -2
- package/node/components/theme/breakpoints.d.ts +10 -1
- package/node/components/theme/breakpoints.js +1 -0
- package/node/hook-form/FormFilters/AllFiltersButton/AllFiltersButton.js +1 -1
- package/node/hook-form/FormFilters/AllFiltersButton/styles.d.ts +3 -0
- package/node/hook-form/FormFilters/AllFiltersButton/styles.js +41 -11
- package/node/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +1 -0
- package/node/hook-form/FormFilters/FormFiltersSkeleton/styles.js +7 -0
- package/node/hook-form/FormFilters/constants.d.ts +1 -0
- package/node/hook-form/FormFilters/constants.js +1 -0
- package/node/hook-form/FormFilters/styles.js +8 -4
- package/node/hook-form/FormFiltersSearchField/FormFiltersSearchField.js +3 -2
- package/node/hook-form/FormFiltersSearchField/constants.d.ts +4 -0
- package/node/hook-form/FormFiltersSearchField/constants.js +6 -1
- package/node/hook-form/FormFiltersSearchField/styles.js +60 -1
- package/package.json +1 -1
|
@@ -3,4 +3,4 @@ export * from './hooks';
|
|
|
3
3
|
export { MainActions, useMainActions } from './MainActions';
|
|
4
4
|
export { SecondaryActions } from './SecondaryActions';
|
|
5
5
|
export { SecondaryVisibleActions } from './SecondaryVisibleActions';
|
|
6
|
-
export type { ActionGroupProps, MainAction, MainActionsProps, SecondaryActionProps, SecondaryVisibleActionProps, } from './types';
|
|
6
|
+
export type { ActionGroupProps, MainAction, MainActionsProps, SecondaryAction, SecondaryActionProps, SecondaryVisibleAction, SecondaryVisibleActionProps, } from './types';
|
|
@@ -10,7 +10,7 @@ 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, {
|
|
13
|
+
return (_jsxs(StyledButton, { variant: variant, ref: ref, color: color, disabled: disabled, selected: selected, ...restProps, className: classNames(className, buttonClassnames.root, {
|
|
14
14
|
[buttonClassnames.loading]: loading,
|
|
15
15
|
[buttonClassnames.selected]: selected,
|
|
16
16
|
}), "aria-disabled": loading, children: [loading && (_jsx(StyledLoader, { color: loadingIndicatorColor, size: "small", "$color": color, "$variant": variant, "$isDisabled": disabled })), children] }));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createUIKitClassname } from '../utils/createUIKitClassname';
|
|
2
2
|
export { buttonClasses } from '@mui/material/Button';
|
|
3
3
|
export const buttonClassnames = {
|
|
4
|
+
root: createUIKitClassname('button'),
|
|
4
5
|
loading: createUIKitClassname('button_loading'),
|
|
5
6
|
selected: createUIKitClassname('button_selected'),
|
|
6
7
|
};
|
|
@@ -28,7 +28,7 @@ export const DecorativeHeaderBackground = styled.div `
|
|
|
28
28
|
});
|
|
29
29
|
}};
|
|
30
30
|
|
|
31
|
-
${({ theme }) => theme.breakpoints.down('
|
|
31
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
32
32
|
height: ${({ $isFocusedMode }) => ($isFocusedMode ? 0 : HEADER_HEIGHT_LAPTOP)}
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -24,7 +24,7 @@ export const PaginationWrapper = styled.div `
|
|
|
24
24
|
margin: 0 ${({ theme }) => theme.spacing(2)};
|
|
25
25
|
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
26
26
|
|
|
27
|
-
${({ theme }) => theme.breakpoints.down('
|
|
27
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
28
28
|
padding-top: ${({ theme }) => theme.spacing(2)};
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -11,13 +11,16 @@ export const Wrapper = styled.aside `
|
|
|
11
11
|
border-top: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
12
12
|
border-left: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
13
13
|
|
|
14
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
15
|
+
padding: ${({ theme }) => theme.spacing(4)};
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
15
19
|
overflow: unset;
|
|
16
20
|
order: 3;
|
|
17
21
|
|
|
18
22
|
width: unset;
|
|
19
23
|
margin: ${({ theme }) => theme.spacing(0, 4, 4)};
|
|
20
|
-
padding: ${({ theme }) => theme.spacing(4)};
|
|
21
24
|
|
|
22
25
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
23
26
|
border-top: 0;
|
|
@@ -59,7 +59,7 @@ export const Content = styled.div `
|
|
|
59
59
|
|
|
60
60
|
padding: ${({ theme, $hasAside }) => getPaddingContent(theme, $hasAside)};
|
|
61
61
|
|
|
62
|
-
${({ theme }) => theme.breakpoints.down('
|
|
62
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
63
63
|
padding-right: ${({ theme }) => theme.spacing(4)};
|
|
64
64
|
padding-left: ${({ theme }) => theme.spacing(4)};
|
|
65
65
|
}
|
|
@@ -13,5 +13,5 @@ export const HeaderContent = ({ backButton, description, subheader, breadcrumbs,
|
|
|
13
13
|
}
|
|
14
14
|
return (_jsx(BreadcrumbsWrapper, { children: Array.isArray(breadcrumbs) ? (_jsx(Breadcrumbs, { children: breadcrumbs })) : (breadcrumbs) }));
|
|
15
15
|
};
|
|
16
|
-
return (_jsxs(_Fragment, { children: [renderBreadcrumbs(), _jsx(DesktopTitleWrapper, { children: _jsx(Title, { backButton: backButton, title: title, isLoading: isLoading, hasDescription: Boolean(description), hasBreadcrumbs: Boolean(breadcrumbs) }) }), _jsx(Description, { description: description, isLoading: isLoading }), actions && (_jsx(PageActions, { className: classNames(pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, size: "medium", ...actions })), filters && _jsx(PageFilters, { children: filters }), subheader && _jsx(PageSubheader, { children: subheader })] }));
|
|
16
|
+
return (_jsxs(_Fragment, { children: [renderBreadcrumbs(), _jsx(DesktopTitleWrapper, { children: _jsx(Title, { backButton: backButton, title: title, isLoading: isLoading, hasDescription: Boolean(description), hasBreadcrumbs: Boolean(breadcrumbs) }) }), _jsx(Description, { description: description, isLoading: isLoading }), actions && (_jsx(PageActions, { className: classNames(pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, size: "medium", withCollapseOnLaptop: Boolean(filters), ...actions })), filters && _jsx(PageFilters, { children: filters }), subheader && _jsx(PageSubheader, { children: subheader })] }));
|
|
17
17
|
};
|
|
@@ -11,7 +11,7 @@ export const BreadcrumbsWrapper = styled.div `
|
|
|
11
11
|
`;
|
|
12
12
|
export const PageSubheader = styled.div `
|
|
13
13
|
grid-column: 1 / -1;
|
|
14
|
-
grid-row:
|
|
14
|
+
grid-row: 5;
|
|
15
15
|
|
|
16
16
|
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
17
17
|
|
|
@@ -21,7 +21,12 @@ export const PageSubheader = styled.div `
|
|
|
21
21
|
`;
|
|
22
22
|
export const PageFilters = styled.div `
|
|
23
23
|
grid-column: 1 / -1;
|
|
24
|
-
grid-row:
|
|
24
|
+
grid-row: 4;
|
|
25
|
+
|
|
26
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
27
|
+
grid-column: 3;
|
|
28
|
+
grid-row: 1 / 4;
|
|
29
|
+
}
|
|
25
30
|
`;
|
|
26
31
|
export const DesktopTitleWrapper = styled.div `
|
|
27
32
|
display: contents;
|
|
@@ -3,4 +3,5 @@ export declare const PageActions: <TMainActionComponent extends ElementType = El
|
|
|
3
3
|
isLoading?: boolean | undefined;
|
|
4
4
|
size?: "large" | "medium" | undefined;
|
|
5
5
|
spacing?: number | undefined;
|
|
6
|
+
withCollapseOnLaptop?: boolean | undefined;
|
|
6
7
|
} & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
|
|
@@ -7,18 +7,14 @@ import { MainActions } from './MainActions';
|
|
|
7
7
|
import { PageActionSkeleton } from './PageActionSkeleton';
|
|
8
8
|
import { SecondaryActions } from './SecondaryActions';
|
|
9
9
|
import { SecondaryVisibleActions } from './SecondaryVisibleActions';
|
|
10
|
-
import { ActionWrapper, FocusModeButton,
|
|
10
|
+
import { ActionWrapper, CollapsedActionsWrapper, FocusModeButton, MainActionsWrapper, SecondaryVisibleWrapper, Wrapper, } from './styles';
|
|
11
11
|
import { useLogic } from './useLogic';
|
|
12
12
|
const PageActionsInner = (props, ref) => {
|
|
13
13
|
const { secondary, secondaryVisible, main, className, isLoading, size = 'medium', spacing = 2, } = props;
|
|
14
|
-
const { disabledAction, buttonClassnames, isFocusedMode, handleClick, tooltipTitle, } = useLogic(
|
|
15
|
-
main,
|
|
16
|
-
secondary,
|
|
17
|
-
});
|
|
18
|
-
const renderSecondaryActions = () => (_jsxs(SecondaryWrapper, { "$spacing": spacing, children: [secondaryVisible && (_jsx(SecondaryVisibleActions, { actions: secondaryVisible, size: size })), secondary && (_jsx(SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] }));
|
|
14
|
+
const { disabledAction, buttonClassnames, isFocusedMode, handleClick, tooltipTitle, collapsedActions, classnames, } = useLogic(props);
|
|
19
15
|
if (isLoading) {
|
|
20
16
|
return (_jsx(Wrapper, { children: _jsx(PageActionSkeleton, { size: size }) }));
|
|
21
17
|
}
|
|
22
|
-
return (_jsx(Wrapper, { className: className, ref: ref, children: _jsxs(ActionWrapper, { "$spacing": spacing, children: [_jsx(Tooltip, { title: tooltipTitle, enterDelay: 400, enterNextDelay: 400, placement: "bottom-end", children: _jsx(FocusModeButton, { className: buttonClassnames, variant: "outlined", onClick: handleClick, "aria-label": tooltipTitle, color: "grey", children: isFocusedMode ? _jsx(MinimizeOutlineMd, {}) : _jsx(FullSizeOutlineMd, {}) }) }), _jsx(MainActions, { isDisabled: disabledAction, actions: main, size: size, spacing: spacing }),
|
|
18
|
+
return (_jsx(Wrapper, { className: className, ref: ref, children: _jsxs(ActionWrapper, { "$spacing": spacing, children: [_jsx(Tooltip, { title: tooltipTitle, enterDelay: 400, enterNextDelay: 400, placement: "bottom-end", children: _jsx(FocusModeButton, { className: buttonClassnames, variant: "outlined", onClick: handleClick, "aria-label": tooltipTitle, color: "grey", children: isFocusedMode ? _jsx(MinimizeOutlineMd, {}) : _jsx(FullSizeOutlineMd, {}) }) }), _jsx(MainActionsWrapper, { "$spacing": spacing, className: classnames, children: _jsx(MainActions, { isDisabled: disabledAction, actions: main, size: size, spacing: spacing }) }), _jsxs(SecondaryVisibleWrapper, { "$spacing": spacing, className: classnames, children: [secondaryVisible && (_jsx(SecondaryVisibleActions, { actions: secondaryVisible, size: size })), secondary && (_jsx(SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] }), collapsedActions.length > 0 && (_jsx(CollapsedActionsWrapper, { className: classnames, children: _jsx(SecondaryActions, { isDisabled: disabledAction, actions: collapsedActions, size: size }) }))] }) }));
|
|
23
19
|
};
|
|
24
20
|
export const PageActions = forwardRefWithGeneric(PageActionsInner);
|
|
@@ -3,3 +3,6 @@ export const focusModeButtonClassnames = {
|
|
|
3
3
|
isShowOnDesktop: createUIKitClassname('focus-mode-button__show-desktop'),
|
|
4
4
|
isShowOnLaptop: createUIKitClassname('focus-mode-button__show-laptop'),
|
|
5
5
|
};
|
|
6
|
+
export const actionsClassnames = {
|
|
7
|
+
withCollapseOnLaptop: createUIKitClassname('actions_collapse-on-laptop'),
|
|
8
|
+
};
|
|
@@ -3,12 +3,22 @@ export declare const Wrapper: import("../../styled").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<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const MainActionsWrapper: import("../../styled").StyledComponent<{
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
9
|
} & {
|
|
10
10
|
$spacing: number;
|
|
11
11
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export declare const SecondaryVisibleWrapper: import("../../styled").StyledComponent<{
|
|
13
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
14
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
$spacing: number;
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
18
|
+
export declare const CollapsedActionsWrapper: import("../../styled").StyledComponent<{
|
|
19
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
22
|
export declare const ActionWrapper: import("../../styled").StyledComponent<{
|
|
13
23
|
theme?: import("@emotion/react").Theme | undefined;
|
|
14
24
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
@@ -1,25 +1,60 @@
|
|
|
1
1
|
import { IconButton } from '../../IconButton';
|
|
2
2
|
import { styled } from '../../styled';
|
|
3
|
-
import { focusModeButtonClassnames } from './constants';
|
|
3
|
+
import { actionsClassnames, focusModeButtonClassnames } from './constants';
|
|
4
4
|
export const Wrapper = styled.div `
|
|
5
5
|
display: flex;
|
|
6
6
|
grid-column: 3;
|
|
7
7
|
grid-row: 1 / 4;
|
|
8
8
|
gap: ${({ theme }) => theme.spacing(2)};
|
|
9
9
|
|
|
10
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
11
|
+
grid-column: 4;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
11
15
|
display: none;
|
|
12
16
|
}
|
|
13
17
|
`;
|
|
14
|
-
export const
|
|
18
|
+
export const MainActionsWrapper = styled.div `
|
|
19
|
+
display: flex;
|
|
20
|
+
gap: ${({ theme, $spacing }) => theme.spacing($spacing)};
|
|
21
|
+
|
|
22
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
23
|
+
&.${actionsClassnames.withCollapseOnLaptop} {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
export const SecondaryVisibleWrapper = styled('div') `
|
|
15
29
|
display: flex;
|
|
16
30
|
flex-wrap: nowrap;
|
|
17
31
|
gap: ${({ theme, $spacing }) => theme.spacing($spacing)};
|
|
18
32
|
|
|
33
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
34
|
+
&.${actionsClassnames.withCollapseOnLaptop} {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
19
39
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
20
40
|
gap: ${({ theme }) => theme.spacing(2)};
|
|
21
41
|
}
|
|
22
42
|
`;
|
|
43
|
+
export const CollapsedActionsWrapper = styled.div `
|
|
44
|
+
display: none;
|
|
45
|
+
|
|
46
|
+
margin-left: auto;
|
|
47
|
+
|
|
48
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
49
|
+
&.${actionsClassnames.withCollapseOnLaptop} {
|
|
50
|
+
display: flex;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
23
58
|
export const ActionWrapper = styled.div `
|
|
24
59
|
display: flex;
|
|
25
60
|
flex-direction: row-reverse;
|
|
@@ -32,13 +67,13 @@ export const ActionWrapper = styled.div `
|
|
|
32
67
|
export const FocusModeButton = styled(IconButton) `
|
|
33
68
|
display: none;
|
|
34
69
|
|
|
35
|
-
${({ theme }) => theme.breakpoints.down('
|
|
70
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
36
71
|
&.${focusModeButtonClassnames.isShowOnLaptop} {
|
|
37
72
|
display: inline-flex;
|
|
38
73
|
}
|
|
39
74
|
}
|
|
40
75
|
|
|
41
|
-
${({ theme }) => theme.breakpoints.up('
|
|
76
|
+
${({ theme }) => theme.breakpoints.up('laptop')} {
|
|
42
77
|
&.${focusModeButtonClassnames.isShowOnDesktop} {
|
|
43
78
|
display: inline-flex;
|
|
44
79
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type ElementType } from 'react';
|
|
2
|
+
import { type SecondaryAction } from '../../../ActionGroup';
|
|
2
3
|
import type { PageActionsProps } from '../types';
|
|
3
|
-
|
|
4
|
-
export declare const useLogic: <TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType>({ main, secondary, }: UseLogicParams<TMainActionComponent, TSecondaryActionComponent>) => {
|
|
4
|
+
export declare const useLogic: <TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType>({ main, secondary, secondaryVisible, withCollapseOnLaptop, }: PageActionsProps<TMainActionComponent, TSecondaryActionComponent>) => {
|
|
5
5
|
disabledAction: boolean;
|
|
6
6
|
buttonClassnames: string;
|
|
7
7
|
isFocusedMode: boolean;
|
|
8
8
|
handleClick: () => void;
|
|
9
9
|
tooltipTitle: string;
|
|
10
|
+
collapsedActions: SecondaryAction<TSecondaryActionComponent>[];
|
|
11
|
+
classnames: string;
|
|
10
12
|
};
|
|
11
|
-
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useContext, useMemo } from 'react';
|
|
1
|
+
import { useCallback, useContext, useMemo } from 'react';
|
|
2
2
|
import { useActionsState } from '../../../ActionGroup';
|
|
3
3
|
import { NextFeatureFlagsContext } from '../../../ConfigProvider/NextFeatureFlagsContext';
|
|
4
4
|
import { DashboardContext } from '../../../DashboardContext';
|
|
5
5
|
import { classNames } from '../../../utils/classNames';
|
|
6
|
-
import { focusModeButtonClassnames } from '../constants';
|
|
7
|
-
export const useLogic = ({ main, secondary, }) => {
|
|
6
|
+
import { actionsClassnames, focusModeButtonClassnames } from '../constants';
|
|
7
|
+
export const useLogic = ({ main, secondary, secondaryVisible, withCollapseOnLaptop = false, }) => {
|
|
8
8
|
const { showFocusModeButtonOnDesktop, showFocusModeButtonOnLaptop } = useContext(NextFeatureFlagsContext);
|
|
9
9
|
const { setFocusedMode, isFocusedMode } = useContext(DashboardContext);
|
|
10
10
|
const { disabledAction } = useActionsState({ main, secondary });
|
|
@@ -18,11 +18,46 @@ export const useLogic = ({ main, secondary, }) => {
|
|
|
18
18
|
const tooltipTitle = isFocusedMode
|
|
19
19
|
? 'Свернуть и вернуть шапку сервиса'
|
|
20
20
|
: 'Раскрыть на весь экран';
|
|
21
|
+
// Все действия убираются в кнопку с троеточием на laptop разрешениях
|
|
22
|
+
const getCollapsedActions = useCallback(() => {
|
|
23
|
+
const fromMain = main?.flatMap((action) => {
|
|
24
|
+
if ('isNested' in action && action.isNested) {
|
|
25
|
+
return action.actions.map((nested) => ({
|
|
26
|
+
text: nested.text,
|
|
27
|
+
onClick: nested.onClick,
|
|
28
|
+
disabled: disabledAction || ('disabled' in nested && nested.disabled),
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
const { text, onClick, disabled } = action;
|
|
32
|
+
return [{ text, onClick, disabled: disabledAction || disabled }];
|
|
33
|
+
});
|
|
34
|
+
const fromSecondaryVisible = secondaryVisible?.map(({ name, onClick, disabled }) => ({
|
|
35
|
+
text: name,
|
|
36
|
+
onClick,
|
|
37
|
+
disabled: disabledAction || disabled,
|
|
38
|
+
}));
|
|
39
|
+
const fromSecondary = secondary?.map(({ disabled, ...rest }) => ({
|
|
40
|
+
...rest,
|
|
41
|
+
disabled: disabledAction || disabled,
|
|
42
|
+
}));
|
|
43
|
+
return [
|
|
44
|
+
...(fromMain || []),
|
|
45
|
+
...(fromSecondaryVisible || []),
|
|
46
|
+
...(fromSecondary || []),
|
|
47
|
+
];
|
|
48
|
+
}, [main, secondary, secondaryVisible, disabledAction]);
|
|
49
|
+
const classnames = useMemo(() => {
|
|
50
|
+
return classNames({
|
|
51
|
+
[actionsClassnames.withCollapseOnLaptop]: withCollapseOnLaptop,
|
|
52
|
+
});
|
|
53
|
+
}, [withCollapseOnLaptop]);
|
|
21
54
|
return {
|
|
22
55
|
disabledAction,
|
|
23
56
|
buttonClassnames,
|
|
24
57
|
isFocusedMode,
|
|
25
58
|
handleClick,
|
|
26
59
|
tooltipTitle,
|
|
60
|
+
collapsedActions: getCollapsedActions(),
|
|
61
|
+
classnames,
|
|
27
62
|
};
|
|
28
63
|
};
|
|
@@ -10,7 +10,7 @@ export const Wrapper = styled.header `
|
|
|
10
10
|
|
|
11
11
|
padding: ${({ theme }) => theme.spacing(0, 6)};
|
|
12
12
|
|
|
13
|
-
${({ theme }) => theme.breakpoints.down('
|
|
13
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
14
14
|
padding: ${({ theme }) => theme.spacing(0, 4)};
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -13,10 +13,6 @@ export const Wrapper = styled.div `
|
|
|
13
13
|
|
|
14
14
|
background-color: ${({ theme }) => theme.palette.common.white};
|
|
15
15
|
|
|
16
|
-
${({ theme }) => theme.breakpoints.down('lg')} {
|
|
17
|
-
grid-row-gap: 0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
16
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
21
17
|
scroll-behavior: smooth;
|
|
22
18
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FOOTER_DESKTOP_HEIGHT } from '../constants';
|
|
1
|
+
import { FOOTER_DESKTOP_HEIGHT, FOOTER_LAPTOP_HEIGHT } from '../constants';
|
|
2
2
|
import { styled } from '../styled';
|
|
3
3
|
export const Wrapper = styled.footer `
|
|
4
4
|
display: flex;
|
|
@@ -14,6 +14,10 @@ export const Wrapper = styled.footer `
|
|
|
14
14
|
border-bottom-right-radius: ${({ theme, $hasAside }) => ($hasAside ? 0 : theme.shape.medium)};
|
|
15
15
|
border-bottom-left-radius: ${({ theme }) => theme.shape.medium};
|
|
16
16
|
|
|
17
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
18
|
+
min-height: ${FOOTER_LAPTOP_HEIGHT};
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
18
22
|
display: none;
|
|
19
23
|
|
|
@@ -112,7 +112,7 @@ export const ChildrenWrapper = styled.div `
|
|
|
112
112
|
|
|
113
113
|
padding: ${({ theme }) => theme.spacing(4, 6)};
|
|
114
114
|
|
|
115
|
-
${({ theme }) => theme.breakpoints.down('
|
|
115
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
116
116
|
padding: ${({ theme }) => theme.spacing(4)};
|
|
117
117
|
}
|
|
118
118
|
`;
|
|
@@ -131,7 +131,7 @@ export const Footer = styled.footer `
|
|
|
131
131
|
display: none;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
${({ theme }) => theme.breakpoints.down('
|
|
134
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
135
135
|
height: ${FOOTER_LAPTOP_HEIGHT};
|
|
136
136
|
}
|
|
137
137
|
`;
|
|
@@ -9,6 +9,10 @@ import {
|
|
|
9
9
|
} from '../theme/types';
|
|
10
10
|
|
|
11
11
|
declare module '@mui/material/styles' {
|
|
12
|
+
interface BreakpointOverrides {
|
|
13
|
+
laptop: true;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
export interface Theme
|
|
13
17
|
extends Omit<MuiTheme, 'shadows' | 'palette' | 'shape' | 'typography'> {
|
|
14
18
|
elevation: Elevation;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import type { BreakpointsOptions } from '@mui/material/styles';
|
|
2
|
-
export declare const defaultBreakpoints: BreakpointsOptions
|
|
2
|
+
export declare const defaultBreakpoints: BreakpointsOptions & {
|
|
3
|
+
values: {
|
|
4
|
+
xs: number;
|
|
5
|
+
sm: number;
|
|
6
|
+
md: number;
|
|
7
|
+
lg: number;
|
|
8
|
+
laptop: number;
|
|
9
|
+
xl: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Button } from '../../../components/Button';
|
|
3
3
|
import { Filter2OutlineMd } from '../../../icons/Filter2OutlineMd';
|
|
4
4
|
import { formFiltersClassnames } from '../constants';
|
|
5
|
-
import { AllFiltersButtonWrapper, StyledBadge, StyledCounter } from './styles';
|
|
5
|
+
import { AllFiltersButtonWrapper, StyledBadge, StyledCounter, StyledTooltip, } from './styles';
|
|
6
6
|
import { useLogic } from './useLogic';
|
|
7
7
|
export const AllFiltersButton = (props) => {
|
|
8
8
|
const { allFiltersButtonClassName, counter, onOpenModal } = useLogic(props);
|
|
9
|
-
return (_jsx(AllFiltersButtonWrapper, { className: allFiltersButtonClassName, children: _jsx(StyledBadge, { color: "error", badgeContent: counter, variant: "dot", children: _jsx(Button, { onClick: onOpenModal, variant: "outlined", color: "grey", startIcon: _jsx(Filter2OutlineMd, {}), endIcon: counter ? _jsx(StyledCounter, { color: "error", content: counter }) : null, className: formFiltersClassnames.allFiltersButton, children: "\u0412\u0441\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B" }) }) }));
|
|
9
|
+
return (_jsx(AllFiltersButtonWrapper, { className: allFiltersButtonClassName, children: _jsx(StyledBadge, { color: "error", badgeContent: counter, variant: "dot", children: _jsx(StyledTooltip, { title: "\u0424\u0438\u043B\u044C\u0442\u0440\u044B", enterDelay: 400, enterNextDelay: 400, placement: "bottom-end", children: _jsx(Button, { onClick: onOpenModal, variant: "outlined", color: "grey", startIcon: _jsx(Filter2OutlineMd, {}), endIcon: counter ? _jsx(StyledCounter, { color: "error", content: counter }) : null, className: formFiltersClassnames.allFiltersButton, children: "\u0412\u0441\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B" }) }) }) }));
|
|
10
10
|
};
|
|
@@ -3,6 +3,9 @@ export declare const AllFiltersButtonWrapper: import("../../../components/styled
|
|
|
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<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const StyledTooltip: import("../../../components/styled").StyledComponent<Omit<import("../../../components/Tooltip").TooltipProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
}, {}, {}>;
|
|
6
9
|
export declare const StyledBadge: import("../../../components/styled").StyledComponent<Omit<import("../../..").WithoutEmotionSpecific<import("@mui/material/Badge").BadgeProps>, "color"> & {
|
|
7
10
|
color: import("../../../components/Badge").BadgeColor;
|
|
8
11
|
withBorder?: boolean | undefined;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { badgeClasses } from '@mui/material/Badge';
|
|
2
|
+
import { tooltipClasses } from '@mui/material/Tooltip';
|
|
2
3
|
import { Badge } from '../../../components/Badge';
|
|
4
|
+
import { buttonClassnames } from '../../../components/Button/constants';
|
|
3
5
|
import { Counter } from '../../../components/Counter';
|
|
4
6
|
import { styled } from '../../../components/styled';
|
|
7
|
+
import { Tooltip } from '../../../components/Tooltip';
|
|
5
8
|
import { formFiltersClassnames } from '../constants';
|
|
6
9
|
export const AllFiltersButtonWrapper = styled.div `
|
|
7
10
|
display: none;
|
|
@@ -12,6 +15,22 @@ export const AllFiltersButtonWrapper = styled.div `
|
|
|
12
15
|
display: flex;
|
|
13
16
|
}
|
|
14
17
|
|
|
18
|
+
${({ theme }) => theme.breakpoints.between('sm', 'laptop')} {
|
|
19
|
+
&.${formFiltersClassnames.showAllFiltersButtonOnLaptop} {
|
|
20
|
+
display: flex;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${formFiltersClassnames.allFiltersButton} {
|
|
24
|
+
padding: ${({ theme }) => theme.microSpacing(0, 3)};
|
|
25
|
+
|
|
26
|
+
font-size: 0;
|
|
27
|
+
|
|
28
|
+
&.${buttonClassnames.root} {
|
|
29
|
+
gap: 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
15
34
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
16
35
|
margin-right: 0;
|
|
17
36
|
&.${formFiltersClassnames.showAllFiltersButtonOnMobile} {
|
|
@@ -38,16 +57,27 @@ export const AllFiltersButtonWrapper = styled.div `
|
|
|
38
57
|
}
|
|
39
58
|
}
|
|
40
59
|
`;
|
|
60
|
+
export const StyledTooltip = styled(Tooltip) `
|
|
61
|
+
& .${tooltipClasses.tooltip} {
|
|
62
|
+
${({ theme }) => theme.breakpoints.up('laptop')} {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
41
67
|
export const StyledBadge = styled(Badge) `
|
|
42
|
-
width: 100%;
|
|
68
|
+
width: 100%;
|
|
69
|
+
|
|
43
70
|
.${badgeClasses.dot} {
|
|
44
|
-
|
|
71
|
+
top: ${({ theme }) => theme.spacing(1)};
|
|
72
|
+
right: ${({ theme }) => theme.spacing(1)};
|
|
73
|
+
|
|
74
|
+
${({ theme }) => theme.breakpoints.up('laptop')} {
|
|
45
75
|
display: none;
|
|
46
76
|
}
|
|
47
77
|
}
|
|
48
78
|
`;
|
|
49
79
|
export const StyledCounter = styled(Counter) `
|
|
50
|
-
${({ theme }) => theme.breakpoints.down('
|
|
80
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
51
81
|
display: none;
|
|
52
82
|
}
|
|
53
83
|
`;
|
|
@@ -20,6 +20,7 @@ export const useLogic = ({ form, onOpenModal, hasMainFilters, hasSecondaryFilter
|
|
|
20
20
|
const allFiltersButtonClassName = useMemo(() => {
|
|
21
21
|
return classNames({
|
|
22
22
|
[formFiltersClassnames.showAllFiltersButtonOnDesktop]: hasSecondaryFilters,
|
|
23
|
+
[formFiltersClassnames.showAllFiltersButtonOnLaptop]: hasMainFilters || hasSecondaryFilters,
|
|
23
24
|
[formFiltersClassnames.showAllFiltersButtonOnMobile]: hasMainFilters || hasSecondaryFilters,
|
|
24
25
|
[formFiltersClassnames.withSearch]: hasSearch,
|
|
25
26
|
[formFiltersClassnames.withoutSearch]: !hasSearch,
|
|
@@ -7,6 +7,13 @@ export const SkeletonWrapper = styled.div `
|
|
|
7
7
|
|
|
8
8
|
margin-top: ${({ theme }) => theme.spacing(4)};
|
|
9
9
|
|
|
10
|
+
${({ theme }) => theme.breakpoints.between('sm', 'laptop')} {
|
|
11
|
+
grid-template-columns: 72px 0 0 0;
|
|
12
|
+
gap: 0;
|
|
13
|
+
|
|
14
|
+
margin: ${({ theme }) => theme.spacing(0, 2, 0)};
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
.${skeletonClasses.root} {
|
|
11
18
|
height: 32px;
|
|
12
19
|
}
|
|
@@ -4,6 +4,7 @@ export const formFiltersClassnames = {
|
|
|
4
4
|
submitButton: createUIKitClassname('form-filters__submit-button'),
|
|
5
5
|
allFiltersButton: createUIKitClassname('form-filters__all-filters-button'),
|
|
6
6
|
showAllFiltersButtonOnDesktop: createUIKitClassname('form-filters_show-all-filters-button_desktop'),
|
|
7
|
+
showAllFiltersButtonOnLaptop: createUIKitClassname('form-filters_show-all-filters-button_laptop'),
|
|
7
8
|
showAllFiltersButtonOnMobile: createUIKitClassname('form-filters_show-all-filters-button_mobile'),
|
|
8
9
|
withSearch: createUIKitClassname('form-filters_with-search'),
|
|
9
10
|
withoutSearch: createUIKitClassname('form-filters_without-search'),
|
|
@@ -13,9 +13,13 @@ export const Wrapper = styled.div `
|
|
|
13
13
|
.${formLabelClasses.root} {
|
|
14
14
|
display: none;
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
18
|
+
margin-top: 0;
|
|
19
|
+
padding-right: ${({ theme }) => theme.spacing(2)};
|
|
20
|
+
}
|
|
16
21
|
|
|
17
22
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
18
|
-
margin-top: 0;
|
|
19
23
|
padding: ${({ theme }) => theme.spacing(1, 4, 5, 4)};
|
|
20
24
|
|
|
21
25
|
font-size: 0;
|
|
@@ -37,14 +41,14 @@ export const MainFiltersWrapper = styled.div `
|
|
|
37
41
|
|
|
38
42
|
width: 100%;
|
|
39
43
|
|
|
40
|
-
${({ theme }) => theme.breakpoints.down('
|
|
44
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
41
45
|
display: none;
|
|
42
46
|
}
|
|
43
47
|
`;
|
|
44
48
|
export const SubmitButtonWrapper = styled.div `
|
|
45
49
|
white-space: nowrap;
|
|
46
50
|
|
|
47
|
-
${({ theme }) => theme.breakpoints.down('
|
|
48
|
-
display:
|
|
51
|
+
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
52
|
+
display: none;
|
|
49
53
|
}
|
|
50
54
|
`;
|