@astral/ui 4.31.2 → 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.
Files changed (78) hide show
  1. package/components/ActionGroup/index.d.ts +1 -1
  2. package/components/Button/Button.js +1 -1
  3. package/components/Button/constants.d.ts +1 -0
  4. package/components/Button/constants.js +1 -0
  5. package/components/DashboardLayout/DashboardWrapper/styles.js +1 -1
  6. package/components/DashboardLayout/Header/styles.js +1 -1
  7. package/components/DashboardSidebar/styles.js +1 -1
  8. package/components/DataGridPaginationContainer/styles.js +1 -1
  9. package/components/PageAside/styles.js +4 -1
  10. package/components/PageContent/styles.js +1 -1
  11. package/components/PageHeader/HeaderContent/HeaderContent.js +1 -1
  12. package/components/PageHeader/HeaderContent/styles.js +7 -2
  13. package/components/PageHeader/PageActions/PageActions.d.ts +1 -0
  14. package/components/PageHeader/PageActions/PageActions.js +3 -7
  15. package/components/PageHeader/PageActions/constants.d.ts +3 -0
  16. package/components/PageHeader/PageActions/constants.js +3 -0
  17. package/components/PageHeader/PageActions/styles.d.ts +11 -1
  18. package/components/PageHeader/PageActions/styles.js +39 -4
  19. package/components/PageHeader/PageActions/types.d.ts +4 -0
  20. package/components/PageHeader/PageActions/useLogic/useLogic.d.ts +4 -3
  21. package/components/PageHeader/PageActions/useLogic/useLogic.js +38 -3
  22. package/components/PageHeader/styles.js +1 -1
  23. package/components/PageLayoutFooter/styles.js +5 -1
  24. package/components/PagePinnableAside/styles.js +2 -2
  25. package/components/declaration/mui-material.d.ts +4 -0
  26. package/components/theme/breakpoints.d.ts +10 -1
  27. package/components/theme/breakpoints.js +1 -0
  28. package/hook-form/FormFilters/AllFiltersButton/AllFiltersButton.js +2 -2
  29. package/hook-form/FormFilters/AllFiltersButton/styles.d.ts +3 -0
  30. package/hook-form/FormFilters/AllFiltersButton/styles.js +33 -3
  31. package/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +1 -0
  32. package/hook-form/FormFilters/FormFiltersSkeleton/styles.js +7 -0
  33. package/hook-form/FormFilters/constants.d.ts +1 -0
  34. package/hook-form/FormFilters/constants.js +1 -0
  35. package/hook-form/FormFilters/styles.js +8 -4
  36. package/hook-form/FormFiltersSearchField/FormFiltersSearchField.js +4 -3
  37. package/hook-form/FormFiltersSearchField/constants.d.ts +4 -0
  38. package/hook-form/FormFiltersSearchField/constants.js +5 -0
  39. package/hook-form/FormFiltersSearchField/styles.js +60 -1
  40. package/node/components/ActionGroup/index.d.ts +1 -1
  41. package/node/components/Button/Button.js +1 -1
  42. package/node/components/Button/constants.d.ts +1 -0
  43. package/node/components/Button/constants.js +1 -0
  44. package/node/components/DashboardLayout/DashboardWrapper/styles.js +1 -1
  45. package/node/components/DashboardLayout/Header/styles.js +1 -1
  46. package/node/components/DashboardSidebar/styles.js +1 -1
  47. package/node/components/DataGridPaginationContainer/styles.js +1 -1
  48. package/node/components/PageAside/styles.js +4 -1
  49. package/node/components/PageContent/styles.js +1 -1
  50. package/node/components/PageHeader/HeaderContent/HeaderContent.js +1 -1
  51. package/node/components/PageHeader/HeaderContent/styles.js +7 -2
  52. package/node/components/PageHeader/PageActions/PageActions.d.ts +1 -0
  53. package/node/components/PageHeader/PageActions/PageActions.js +2 -6
  54. package/node/components/PageHeader/PageActions/constants.d.ts +3 -0
  55. package/node/components/PageHeader/PageActions/constants.js +4 -1
  56. package/node/components/PageHeader/PageActions/styles.d.ts +11 -1
  57. package/node/components/PageHeader/PageActions/styles.js +39 -4
  58. package/node/components/PageHeader/PageActions/types.d.ts +4 -0
  59. package/node/components/PageHeader/PageActions/useLogic/useLogic.d.ts +4 -3
  60. package/node/components/PageHeader/PageActions/useLogic/useLogic.js +36 -1
  61. package/node/components/PageHeader/styles.js +1 -1
  62. package/node/components/PageLayoutFooter/styles.js +4 -0
  63. package/node/components/PagePinnableAside/styles.js +2 -2
  64. package/node/components/theme/breakpoints.d.ts +10 -1
  65. package/node/components/theme/breakpoints.js +1 -0
  66. package/node/hook-form/FormFilters/AllFiltersButton/AllFiltersButton.js +1 -1
  67. package/node/hook-form/FormFilters/AllFiltersButton/styles.d.ts +3 -0
  68. package/node/hook-form/FormFilters/AllFiltersButton/styles.js +41 -11
  69. package/node/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +1 -0
  70. package/node/hook-form/FormFilters/FormFiltersSkeleton/styles.js +7 -0
  71. package/node/hook-form/FormFilters/constants.d.ts +1 -0
  72. package/node/hook-form/FormFilters/constants.js +1 -0
  73. package/node/hook-form/FormFilters/styles.js +8 -4
  74. package/node/hook-form/FormFiltersSearchField/FormFiltersSearchField.js +3 -2
  75. package/node/hook-form/FormFiltersSearchField/constants.d.ts +4 -0
  76. package/node/hook-form/FormFiltersSearchField/constants.js +6 -1
  77. package/node/hook-form/FormFiltersSearchField/styles.js +60 -1
  78. package/package.json +1 -1
@@ -2,16 +2,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRefWithGeneric } from '../../components/forwardRefWithGeneric';
3
3
  import { SearchField, } from '../../components/SearchField';
4
4
  import { useFormFieldProps } from '../useFormFieldProps';
5
- import { FORM_FILTERS_SEARCH_FIELD_ID } from './constants';
5
+ import { FORM_FILTERS_SEARCH_FIELD_ID, formFiltersSearchFieldClassnames, } from './constants';
6
6
  import { Wrapper } from './styles';
7
7
  /**
8
- * Адаптер для SearchField
8
+ * Адаптер для SearchField для использования в FormFilters
9
9
  */
10
10
  function FormFiltersSearchFieldInner({ width, ...props }, ref) {
11
11
  const fieldProps = useFormFieldProps({
12
12
  ...props,
13
13
  defaultValue: props.defaultValue || '',
14
14
  });
15
- return (_jsx(Wrapper, { "$width": width, children: _jsx(SearchField, { ...fieldProps, ref: ref, inputProps: { id: FORM_FILTERS_SEARCH_FIELD_ID }, fullWidth: true }) }));
15
+ const hasValue = Boolean(fieldProps.value);
16
+ return (_jsx(Wrapper, { "$width": width, className: hasValue ? formFiltersSearchFieldClassnames.hasValue : '', children: _jsx(SearchField, { ...fieldProps, ref: ref, inputProps: { id: FORM_FILTERS_SEARCH_FIELD_ID }, fullWidth: true }) }));
16
17
  }
17
18
  export const FormFiltersSearchField = forwardRefWithGeneric(FormFiltersSearchFieldInner);
@@ -1 +1,5 @@
1
1
  export declare const FORM_FILTERS_SEARCH_FIELD_ID = "form-filters-search-field";
2
+ export declare const formFiltersSearchFieldClassnames: {
3
+ hasValue: string;
4
+ };
5
+ export declare const DEFAULT_SEARCH_FIELD_WIDTH = "240px";
@@ -1 +1,6 @@
1
+ import { createUIKitClassname } from '../../components/utils/createUIKitClassname';
1
2
  export const FORM_FILTERS_SEARCH_FIELD_ID = 'form-filters-search-field';
3
+ export const formFiltersSearchFieldClassnames = {
4
+ hasValue: createUIKitClassname('form-filters-search-field__has-value'),
5
+ };
6
+ export const DEFAULT_SEARCH_FIELD_WIDTH = '240px';
@@ -1,6 +1,65 @@
1
+ import { formControlClasses } from '@mui/material/FormControl';
2
+ import { inputBaseClasses } from '@mui/material/InputBase';
3
+ import { outlinedInputClasses } from '@mui/material/OutlinedInput';
4
+ import { svgIconClassnames } from '../../components/SvgIcon';
1
5
  import { styled } from '../../components/styled';
6
+ import { DEFAULT_SEARCH_FIELD_WIDTH, formFiltersSearchFieldClassnames, } from './constants';
2
7
  export const Wrapper = styled.div `
3
- min-width: ${({ $width }) => $width || '240px'};
8
+ min-width: ${({ $width }) => $width || DEFAULT_SEARCH_FIELD_WIDTH};
9
+
10
+ ${({ theme }) => theme.breakpoints.between('sm', 'laptop')} {
11
+ overflow: hidden;
12
+
13
+ width: ${({ $width }) => $width || DEFAULT_SEARCH_FIELD_WIDTH};
14
+ min-width: unset;
15
+
16
+ transition: ${({ theme }) => theme.transitions.create(['width', 'padding'], {
17
+ duration: theme.transitions.duration.shorter,
18
+ easing: theme.transitions.easing.easeInOut,
19
+ delay: theme.transitions.duration.shorter,
20
+ })};
21
+
22
+ .${formControlClasses.root} {
23
+ display: flex;
24
+ flex-direction: row-reverse;
25
+
26
+ width: 100%;
27
+ min-width: 32px;
28
+ }
29
+
30
+ .${outlinedInputClasses.root} {
31
+ transition: ${({ theme }) => theme.transitions.create(['width', 'padding'], {
32
+ duration: theme.transitions.duration.shorter,
33
+ easing: theme.transitions.easing.easeInOut,
34
+ delay: theme.transitions.duration.shorter,
35
+ })};
36
+ }
37
+
38
+ .${svgIconClassnames.root} {
39
+ transition: ${({ theme }) => theme.transitions.create(['fill'], {
40
+ duration: theme.transitions.duration.shorter,
41
+ easing: theme.transitions.easing.easeInOut,
42
+ delay: theme.transitions.duration.shorter,
43
+ })};
44
+ }
45
+
46
+ &:not(:hover, :focus-within):not(.${formFiltersSearchFieldClassnames.hasValue}) {
47
+ width: 32px;
48
+
49
+ .${svgIconClassnames.root} {
50
+ fill: ${({ theme }) => theme.palette.grey[800]};
51
+ }
52
+
53
+ .${outlinedInputClasses.root} {
54
+ padding: ${({ theme }) => theme.microSpacing(1, 3)};
55
+ }
56
+
57
+ .${inputBaseClasses.input} {
58
+ width: 0;
59
+ min-width: 0;
60
+ }
61
+ }
62
+ }
4
63
 
5
64
  ${({ theme }) => theme.breakpoints.down('sm')} {
6
65
  width: 100%;
@@ -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';
@@ -13,7 +13,7 @@ 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, {
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, {
17
17
  [constants_1.buttonClassnames.loading]: loading,
18
18
  [constants_1.buttonClassnames.selected]: selected,
19
19
  }), "aria-disabled": loading, children: [loading && ((0, jsx_runtime_1.jsx)(styles_1.StyledLoader, { color: loadingIndicatorColor, size: "small", "$color": color, "$variant": variant, "$isDisabled": disabled })), children] }));
@@ -1,5 +1,6 @@
1
1
  export { buttonClasses } from '@mui/material/Button';
2
2
  export declare const buttonClassnames: {
3
+ root: string;
3
4
  loading: string;
4
5
  selected: string;
5
6
  };
@@ -5,6 +5,7 @@ const createUIKitClassname_1 = require("../utils/createUIKitClassname");
5
5
  var Button_1 = require("@mui/material/Button");
6
6
  Object.defineProperty(exports, "buttonClasses", { enumerable: true, get: function () { return Button_1.buttonClasses; } });
7
7
  exports.buttonClassnames = {
8
+ root: (0, createUIKitClassname_1.createUIKitClassname)('button'),
8
9
  loading: (0, createUIKitClassname_1.createUIKitClassname)('button_loading'),
9
10
  selected: (0, createUIKitClassname_1.createUIKitClassname)('button_selected'),
10
11
  };
@@ -31,7 +31,7 @@ exports.DecorativeHeaderBackground = styled_1.styled.div `
31
31
  });
32
32
  }};
33
33
 
34
- ${({ theme }) => theme.breakpoints.down('lg')} {
34
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
35
35
  height: ${({ $isFocusedMode }) => ($isFocusedMode ? 0 : constants_2.HEADER_HEIGHT_LAPTOP)}
36
36
  }
37
37
 
@@ -31,7 +31,7 @@ exports.HeaderRoot = (0, styled_1.styled)('header', {
31
31
  });
32
32
  }};
33
33
 
34
- ${({ theme }) => theme.breakpoints.down('lg')} {
34
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
35
35
  height: ${constants_4.HEADER_HEIGHT_LAPTOP};
36
36
  }
37
37
 
@@ -142,7 +142,7 @@ exports.Footer = styled_1.styled.footer `
142
142
  display: none;
143
143
  }
144
144
 
145
- ${({ theme }) => theme.breakpoints.down('lg')} {
145
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
146
146
  height: ${constants_1.FOOTER_LAPTOP_HEIGHT};
147
147
  }
148
148
  `;
@@ -27,7 +27,7 @@ exports.PaginationWrapper = styled_1.styled.div `
27
27
  margin: 0 ${({ theme }) => theme.spacing(2)};
28
28
  padding-top: ${({ theme }) => theme.spacing(4)};
29
29
 
30
- ${({ theme }) => theme.breakpoints.down('lg')} {
30
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
31
31
  padding-top: ${({ theme }) => theme.spacing(2)};
32
32
  }
33
33
 
@@ -14,13 +14,16 @@ exports.Wrapper = styled_1.styled.aside `
14
14
  border-top: 1px solid ${({ theme }) => theme.palette.grey[300]};
15
15
  border-left: 1px solid ${({ theme }) => theme.palette.grey[300]};
16
16
 
17
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
18
+ padding: ${({ theme }) => theme.spacing(4)};
19
+ }
20
+
17
21
  ${({ theme }) => theme.breakpoints.down('sm')} {
18
22
  overflow: unset;
19
23
  order: 3;
20
24
 
21
25
  width: unset;
22
26
  margin: ${({ theme }) => theme.spacing(0, 4, 4)};
23
- padding: ${({ theme }) => theme.spacing(4)};
24
27
 
25
28
  background-color: ${({ theme }) => theme.palette.background.default};
26
29
  border-top: 0;
@@ -62,7 +62,7 @@ exports.Content = styled_1.styled.div `
62
62
 
63
63
  padding: ${({ theme, $hasAside }) => getPaddingContent(theme, $hasAside)};
64
64
 
65
- ${({ theme }) => theme.breakpoints.down('lg')} {
65
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
66
66
  padding-right: ${({ theme }) => theme.spacing(4)};
67
67
  padding-left: ${({ theme }) => theme.spacing(4)};
68
68
  }
@@ -16,6 +16,6 @@ const HeaderContent = ({ backButton, description, subheader, breadcrumbs, action
16
16
  }
17
17
  return ((0, jsx_runtime_1.jsx)(styles_1.BreadcrumbsWrapper, { children: Array.isArray(breadcrumbs) ? ((0, jsx_runtime_1.jsx)(Breadcrumbs_1.Breadcrumbs, { children: breadcrumbs })) : (breadcrumbs) }));
18
18
  };
19
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderBreadcrumbs(), (0, jsx_runtime_1.jsx)(styles_1.DesktopTitleWrapper, { children: (0, jsx_runtime_1.jsx)(Title_1.Title, { backButton: backButton, title: title, isLoading: isLoading, hasDescription: Boolean(description), hasBreadcrumbs: Boolean(breadcrumbs) }) }), (0, jsx_runtime_1.jsx)(Description_1.Description, { description: description, isLoading: isLoading }), actions && ((0, jsx_runtime_1.jsx)(PageActions_1.PageActions, { className: (0, classNames_1.classNames)(constants_1.pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, size: "medium", ...actions })), filters && (0, jsx_runtime_1.jsx)(styles_1.PageFilters, { children: filters }), subheader && (0, jsx_runtime_1.jsx)(styles_1.PageSubheader, { children: subheader })] }));
19
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderBreadcrumbs(), (0, jsx_runtime_1.jsx)(styles_1.DesktopTitleWrapper, { children: (0, jsx_runtime_1.jsx)(Title_1.Title, { backButton: backButton, title: title, isLoading: isLoading, hasDescription: Boolean(description), hasBreadcrumbs: Boolean(breadcrumbs) }) }), (0, jsx_runtime_1.jsx)(Description_1.Description, { description: description, isLoading: isLoading }), actions && ((0, jsx_runtime_1.jsx)(PageActions_1.PageActions, { className: (0, classNames_1.classNames)(constants_1.pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, size: "medium", withCollapseOnLaptop: Boolean(filters), ...actions })), filters && (0, jsx_runtime_1.jsx)(styles_1.PageFilters, { children: filters }), subheader && (0, jsx_runtime_1.jsx)(styles_1.PageSubheader, { children: subheader })] }));
20
20
  };
21
21
  exports.HeaderContent = HeaderContent;
@@ -14,7 +14,7 @@ exports.BreadcrumbsWrapper = styled_1.styled.div `
14
14
  `;
15
15
  exports.PageSubheader = styled_1.styled.div `
16
16
  grid-column: 1 / -1;
17
- grid-row: 4;
17
+ grid-row: 5;
18
18
 
19
19
  padding-top: ${({ theme }) => theme.spacing(4)};
20
20
 
@@ -24,7 +24,12 @@ exports.PageSubheader = styled_1.styled.div `
24
24
  `;
25
25
  exports.PageFilters = styled_1.styled.div `
26
26
  grid-column: 1 / -1;
27
- grid-row: 5;
27
+ grid-row: 4;
28
+
29
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
30
+ grid-column: 3;
31
+ grid-row: 1 / 4;
32
+ }
28
33
  `;
29
34
  exports.DesktopTitleWrapper = styled_1.styled.div `
30
35
  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;
@@ -14,14 +14,10 @@ const styles_1 = require("./styles");
14
14
  const useLogic_1 = require("./useLogic");
15
15
  const PageActionsInner = (props, ref) => {
16
16
  const { secondary, secondaryVisible, main, className, isLoading, size = 'medium', spacing = 2, } = props;
17
- const { disabledAction, buttonClassnames, isFocusedMode, handleClick, tooltipTitle, } = (0, useLogic_1.useLogic)({
18
- main,
19
- secondary,
20
- });
21
- const renderSecondaryActions = () => ((0, jsx_runtime_1.jsxs)(styles_1.SecondaryWrapper, { "$spacing": spacing, children: [secondaryVisible && ((0, jsx_runtime_1.jsx)(SecondaryVisibleActions_1.SecondaryVisibleActions, { actions: secondaryVisible, size: size })), secondary && ((0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] }));
17
+ const { disabledAction, buttonClassnames, isFocusedMode, handleClick, tooltipTitle, collapsedActions, classnames, } = (0, useLogic_1.useLogic)(props);
22
18
  if (isLoading) {
23
19
  return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: (0, jsx_runtime_1.jsx)(PageActionSkeleton_1.PageActionSkeleton, { size: size }) }));
24
20
  }
25
- return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, ref: ref, children: (0, jsx_runtime_1.jsxs)(styles_1.ActionWrapper, { "$spacing": spacing, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: tooltipTitle, enterDelay: 400, enterNextDelay: 400, placement: "bottom-end", children: (0, jsx_runtime_1.jsx)(styles_1.FocusModeButton, { className: buttonClassnames, variant: "outlined", onClick: handleClick, "aria-label": tooltipTitle, color: "grey", children: isFocusedMode ? (0, jsx_runtime_1.jsx)(MinimizeOutlineMd_1.MinimizeOutlineMd, {}) : (0, jsx_runtime_1.jsx)(FullSizeOutlineMd_1.FullSizeOutlineMd, {}) }) }), (0, jsx_runtime_1.jsx)(MainActions_1.MainActions, { isDisabled: disabledAction, actions: main, size: size, spacing: spacing }), renderSecondaryActions()] }) }));
21
+ return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, ref: ref, children: (0, jsx_runtime_1.jsxs)(styles_1.ActionWrapper, { "$spacing": spacing, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: tooltipTitle, enterDelay: 400, enterNextDelay: 400, placement: "bottom-end", children: (0, jsx_runtime_1.jsx)(styles_1.FocusModeButton, { className: buttonClassnames, variant: "outlined", onClick: handleClick, "aria-label": tooltipTitle, color: "grey", children: isFocusedMode ? (0, jsx_runtime_1.jsx)(MinimizeOutlineMd_1.MinimizeOutlineMd, {}) : (0, jsx_runtime_1.jsx)(FullSizeOutlineMd_1.FullSizeOutlineMd, {}) }) }), (0, jsx_runtime_1.jsx)(styles_1.MainActionsWrapper, { "$spacing": spacing, className: classnames, children: (0, jsx_runtime_1.jsx)(MainActions_1.MainActions, { isDisabled: disabledAction, actions: main, size: size, spacing: spacing }) }), (0, jsx_runtime_1.jsxs)(styles_1.SecondaryVisibleWrapper, { "$spacing": spacing, className: classnames, children: [secondaryVisible && ((0, jsx_runtime_1.jsx)(SecondaryVisibleActions_1.SecondaryVisibleActions, { actions: secondaryVisible, size: size })), secondary && ((0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] }), collapsedActions.length > 0 && ((0, jsx_runtime_1.jsx)(styles_1.CollapsedActionsWrapper, { className: classnames, children: (0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: collapsedActions, size: size }) }))] }) }));
26
22
  };
27
23
  exports.PageActions = (0, forwardRefWithGeneric_1.forwardRefWithGeneric)(PageActionsInner);
@@ -2,3 +2,6 @@ export declare const focusModeButtonClassnames: {
2
2
  isShowOnDesktop: string;
3
3
  isShowOnLaptop: string;
4
4
  };
5
+ export declare const actionsClassnames: {
6
+ withCollapseOnLaptop: string;
7
+ };
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.focusModeButtonClassnames = void 0;
3
+ exports.actionsClassnames = exports.focusModeButtonClassnames = void 0;
4
4
  const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
5
5
  exports.focusModeButtonClassnames = {
6
6
  isShowOnDesktop: (0, createUIKitClassname_1.createUIKitClassname)('focus-mode-button__show-desktop'),
7
7
  isShowOnLaptop: (0, createUIKitClassname_1.createUIKitClassname)('focus-mode-button__show-laptop'),
8
8
  };
9
+ exports.actionsClassnames = {
10
+ withCollapseOnLaptop: (0, createUIKitClassname_1.createUIKitClassname)('actions_collapse-on-laptop'),
11
+ };
@@ -3,12 +3,22 @@ export declare const Wrapper: import("@emotion/styled/dist/declarations/src/type
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 SecondaryWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
6
+ export declare const MainActionsWrapper: import("@emotion/styled/dist/declarations/src/types").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("@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
+ $spacing: number;
17
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
18
+ export declare const CollapsedActionsWrapper: import("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").StyledComponent<{
13
23
  theme?: import("@emotion/react").Theme | undefined;
14
24
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FocusModeButton = exports.ActionWrapper = exports.SecondaryWrapper = exports.Wrapper = void 0;
3
+ exports.FocusModeButton = exports.ActionWrapper = exports.CollapsedActionsWrapper = exports.SecondaryVisibleWrapper = exports.MainActionsWrapper = exports.Wrapper = void 0;
4
4
  const IconButton_1 = require("../../IconButton");
5
5
  const styled_1 = require("../../styled");
6
6
  const constants_1 = require("./constants");
@@ -10,19 +10,54 @@ exports.Wrapper = styled_1.styled.div `
10
10
  grid-row: 1 / 4;
11
11
  gap: ${({ theme }) => theme.spacing(2)};
12
12
 
13
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
14
+ grid-column: 4;
15
+ }
16
+
13
17
  ${({ theme }) => theme.breakpoints.down('sm')} {
14
18
  display: none;
15
19
  }
16
20
  `;
17
- exports.SecondaryWrapper = (0, styled_1.styled)('div') `
21
+ exports.MainActionsWrapper = styled_1.styled.div `
22
+ display: flex;
23
+ gap: ${({ theme, $spacing }) => theme.spacing($spacing)};
24
+
25
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
26
+ &.${constants_1.actionsClassnames.withCollapseOnLaptop} {
27
+ display: none;
28
+ }
29
+ }
30
+ `;
31
+ exports.SecondaryVisibleWrapper = (0, styled_1.styled)('div') `
18
32
  display: flex;
19
33
  flex-wrap: nowrap;
20
34
  gap: ${({ theme, $spacing }) => theme.spacing($spacing)};
21
35
 
36
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
37
+ &.${constants_1.actionsClassnames.withCollapseOnLaptop} {
38
+ display: none;
39
+ }
40
+ }
41
+
22
42
  ${({ theme }) => theme.breakpoints.down('sm')} {
23
43
  gap: ${({ theme }) => theme.spacing(2)};
24
44
  }
25
45
  `;
46
+ exports.CollapsedActionsWrapper = styled_1.styled.div `
47
+ display: none;
48
+
49
+ margin-left: auto;
50
+
51
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
52
+ &.${constants_1.actionsClassnames.withCollapseOnLaptop} {
53
+ display: flex;
54
+ }
55
+ }
56
+
57
+ ${({ theme }) => theme.breakpoints.down('sm')} {
58
+ display: none;
59
+ }
60
+ `;
26
61
  exports.ActionWrapper = styled_1.styled.div `
27
62
  display: flex;
28
63
  flex-direction: row-reverse;
@@ -35,13 +70,13 @@ exports.ActionWrapper = styled_1.styled.div `
35
70
  exports.FocusModeButton = (0, styled_1.styled)(IconButton_1.IconButton) `
36
71
  display: none;
37
72
 
38
- ${({ theme }) => theme.breakpoints.down('lg')} {
73
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
39
74
  &.${constants_1.focusModeButtonClassnames.isShowOnLaptop} {
40
75
  display: inline-flex;
41
76
  }
42
77
  }
43
78
 
44
- ${({ theme }) => theme.breakpoints.up('lg')} {
79
+ ${({ theme }) => theme.breakpoints.up('laptop')} {
45
80
  &.${constants_1.focusModeButtonClassnames.isShowOnDesktop} {
46
81
  display: inline-flex;
47
82
  }
@@ -11,4 +11,8 @@ export type PageActionsProps<TMainActionComponent extends ElementType = ElementT
11
11
  * Отступ между действиями
12
12
  */
13
13
  spacing?: number;
14
+ /**
15
+ * Если true, отображается кнопка с троеточием на laptop разрешениях
16
+ */
17
+ withCollapseOnLaptop?: boolean;
14
18
  };
@@ -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
- type UseLogicParams<TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType> = Pick<PageActionsProps<TMainActionComponent, TSecondaryActionComponent>, 'main' | 'secondary'>;
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 {};
@@ -7,7 +7,7 @@ const NextFeatureFlagsContext_1 = require("../../../ConfigProvider/NextFeatureFl
7
7
  const DashboardContext_1 = require("../../../DashboardContext");
8
8
  const classNames_1 = require("../../../utils/classNames");
9
9
  const constants_1 = require("../constants");
10
- const useLogic = ({ main, secondary, }) => {
10
+ const useLogic = ({ main, secondary, secondaryVisible, withCollapseOnLaptop = false, }) => {
11
11
  const { showFocusModeButtonOnDesktop, showFocusModeButtonOnLaptop } = (0, react_1.useContext)(NextFeatureFlagsContext_1.NextFeatureFlagsContext);
12
12
  const { setFocusedMode, isFocusedMode } = (0, react_1.useContext)(DashboardContext_1.DashboardContext);
13
13
  const { disabledAction } = (0, ActionGroup_1.useActionsState)({ main, secondary });
@@ -21,12 +21,47 @@ const useLogic = ({ main, secondary, }) => {
21
21
  const tooltipTitle = isFocusedMode
22
22
  ? 'Свернуть и вернуть шапку сервиса'
23
23
  : 'Раскрыть на весь экран';
24
+ // Все действия убираются в кнопку с троеточием на laptop разрешениях
25
+ const getCollapsedActions = (0, react_1.useCallback)(() => {
26
+ const fromMain = main?.flatMap((action) => {
27
+ if ('isNested' in action && action.isNested) {
28
+ return action.actions.map((nested) => ({
29
+ text: nested.text,
30
+ onClick: nested.onClick,
31
+ disabled: disabledAction || ('disabled' in nested && nested.disabled),
32
+ }));
33
+ }
34
+ const { text, onClick, disabled } = action;
35
+ return [{ text, onClick, disabled: disabledAction || disabled }];
36
+ });
37
+ const fromSecondaryVisible = secondaryVisible?.map(({ name, onClick, disabled }) => ({
38
+ text: name,
39
+ onClick,
40
+ disabled: disabledAction || disabled,
41
+ }));
42
+ const fromSecondary = secondary?.map(({ disabled, ...rest }) => ({
43
+ ...rest,
44
+ disabled: disabledAction || disabled,
45
+ }));
46
+ return [
47
+ ...(fromMain || []),
48
+ ...(fromSecondaryVisible || []),
49
+ ...(fromSecondary || []),
50
+ ];
51
+ }, [main, secondary, secondaryVisible, disabledAction]);
52
+ const classnames = (0, react_1.useMemo)(() => {
53
+ return (0, classNames_1.classNames)({
54
+ [constants_1.actionsClassnames.withCollapseOnLaptop]: withCollapseOnLaptop,
55
+ });
56
+ }, [withCollapseOnLaptop]);
24
57
  return {
25
58
  disabledAction,
26
59
  buttonClassnames,
27
60
  isFocusedMode,
28
61
  handleClick,
29
62
  tooltipTitle,
63
+ collapsedActions: getCollapsedActions(),
64
+ classnames,
30
65
  };
31
66
  };
32
67
  exports.useLogic = useLogic;
@@ -13,7 +13,7 @@ exports.Wrapper = styled_1.styled.header `
13
13
 
14
14
  padding: ${({ theme }) => theme.spacing(0, 6)};
15
15
 
16
- ${({ theme }) => theme.breakpoints.down('lg')} {
16
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
17
17
  padding: ${({ theme }) => theme.spacing(0, 4)};
18
18
  }
19
19
 
@@ -17,6 +17,10 @@ exports.Wrapper = styled_1.styled.footer `
17
17
  border-bottom-right-radius: ${({ theme, $hasAside }) => ($hasAside ? 0 : theme.shape.medium)};
18
18
  border-bottom-left-radius: ${({ theme }) => theme.shape.medium};
19
19
 
20
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
21
+ min-height: ${constants_1.FOOTER_LAPTOP_HEIGHT};
22
+ }
23
+
20
24
  ${({ theme }) => theme.breakpoints.down('sm')} {
21
25
  display: none;
22
26
 
@@ -115,7 +115,7 @@ exports.ChildrenWrapper = styled_1.styled.div `
115
115
 
116
116
  padding: ${({ theme }) => theme.spacing(4, 6)};
117
117
 
118
- ${({ theme }) => theme.breakpoints.down('sm')} {
118
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
119
119
  padding: ${({ theme }) => theme.spacing(4)};
120
120
  }
121
121
  `;
@@ -134,7 +134,7 @@ exports.Footer = styled_1.styled.footer `
134
134
  display: none;
135
135
  }
136
136
 
137
- ${({ theme }) => theme.breakpoints.down('lg')} {
137
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
138
138
  height: ${constants_1.FOOTER_LAPTOP_HEIGHT};
139
139
  }
140
140
  `;
@@ -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
+ };
@@ -7,6 +7,7 @@ exports.defaultBreakpoints = {
7
7
  sm: 600,
8
8
  md: 900,
9
9
  lg: 1200,
10
+ laptop: 1370,
10
11
  xl: 1536,
11
12
  },
12
13
  };
@@ -9,6 +9,6 @@ const styles_1 = require("./styles");
9
9
  const useLogic_1 = require("./useLogic");
10
10
  const AllFiltersButton = (props) => {
11
11
  const { allFiltersButtonClassName, counter, onOpenModal } = (0, useLogic_1.useLogic)(props);
12
- return ((0, jsx_runtime_1.jsx)(styles_1.AllFiltersButtonWrapper, { className: allFiltersButtonClassName, children: (0, jsx_runtime_1.jsx)(styles_1.StyledBadge, { color: "error", badgeContent: counter, variant: "dot", children: (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onOpenModal, variant: "outlined", color: "grey", startIcon: (0, jsx_runtime_1.jsx)(Filter2OutlineMd_1.Filter2OutlineMd, {}), endIcon: counter ? (0, jsx_runtime_1.jsx)(styles_1.StyledCounter, { color: "error", content: counter }) : null, className: constants_1.formFiltersClassnames.allFiltersButton, children: "\u0412\u0441\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B" }) }) }));
12
+ return ((0, jsx_runtime_1.jsx)(styles_1.AllFiltersButtonWrapper, { className: allFiltersButtonClassName, children: (0, jsx_runtime_1.jsx)(styles_1.StyledBadge, { color: "error", badgeContent: counter, variant: "dot", children: (0, jsx_runtime_1.jsx)(styles_1.StyledTooltip, { title: "\u0424\u0438\u043B\u044C\u0442\u0440\u044B", enterDelay: 400, enterNextDelay: 400, placement: "bottom-end", children: (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onOpenModal, variant: "outlined", color: "grey", startIcon: (0, jsx_runtime_1.jsx)(Filter2OutlineMd_1.Filter2OutlineMd, {}), endIcon: counter ? (0, jsx_runtime_1.jsx)(styles_1.StyledCounter, { color: "error", content: counter }) : null, className: constants_1.formFiltersClassnames.allFiltersButton, children: "\u0412\u0441\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B" }) }) }) }));
13
13
  };
14
14
  exports.AllFiltersButton = AllFiltersButton;
@@ -3,6 +3,9 @@ export declare const AllFiltersButtonWrapper: import("@emotion/styled/dist/decla
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("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../..").WithoutEmotionSpecific<import("@mui/material/Badge").BadgeProps>, "color"> & {
7
10
  color: import("../../../components/Badge").BadgeColor;
8
11
  withBorder?: boolean | undefined;