@astral/ui 4.91.1 → 4.92.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 (29) hide show
  1. package/components/DashboardLayout/Header/styles.js +8 -0
  2. package/components/DashboardLayout/Main/styles.js +8 -0
  3. package/components/HintPopover/types.d.ts +1 -1
  4. package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/HighlightStep.js +2 -2
  5. package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.d.ts +1 -2
  6. package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.js +4 -10
  7. package/components/PageContent/styles.js +1 -1
  8. package/components/PageHeader/HeaderContent/styles.js +12 -0
  9. package/components/PageHeader/styles.js +16 -4
  10. package/components/PageLayout/styles.js +14 -2
  11. package/node/components/DashboardLayout/Header/styles.js +8 -0
  12. package/node/components/DashboardLayout/Main/styles.js +8 -0
  13. package/node/components/HintPopover/types.d.ts +1 -1
  14. package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/HighlightStep.js +2 -2
  15. package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.d.ts +1 -2
  16. package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.js +3 -9
  17. package/node/components/PageContent/styles.js +11 -11
  18. package/node/components/PageHeader/HeaderContent/styles.js +12 -0
  19. package/node/components/PageHeader/styles.js +16 -4
  20. package/node/components/PageLayout/styles.js +14 -2
  21. package/package.json +1 -1
  22. package/components/Onboarding/ui/hooks/useFocusTrap/index.d.ts +0 -1
  23. package/components/Onboarding/ui/hooks/useFocusTrap/index.js +0 -1
  24. package/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.d.ts +0 -6
  25. package/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.js +0 -33
  26. package/node/components/Onboarding/ui/hooks/useFocusTrap/index.d.ts +0 -1
  27. package/node/components/Onboarding/ui/hooks/useFocusTrap/index.js +0 -5
  28. package/node/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.d.ts +0 -6
  29. package/node/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.js +0 -37
@@ -95,6 +95,10 @@ export const HeaderContentSection = styled(HeaderSection) `
95
95
  }
96
96
  `;
97
97
  export const ProductSwitcherWrapper = styled.div `
98
+ &:empty {
99
+ display: none;
100
+ }
101
+
98
102
  ${({ theme }) => theme.breakpoints.down('sm')} {
99
103
  display: none;
100
104
  }
@@ -131,6 +135,10 @@ export const HeaderContent = styled.div `
131
135
  * Обертка для элементов которые должны быть в мобильном хедере или помещены в sidebar.
132
136
  */
133
137
  export const PriorityFeatureWrapper = styled.div `
138
+ &&:empty {
139
+ display: none;
140
+ }
141
+
134
142
  ${({ theme }) => theme.breakpoints.down('sm')} {
135
143
  display: flex;
136
144
  justify-content: flex-end;
@@ -21,8 +21,16 @@ export const AlertWrapper = styled.div `
21
21
  }
22
22
  `;
23
23
  export const AlertContainer = styled.div `
24
+ display: flex;
25
+ flex-direction: column;
26
+ gap: ${({ theme }) => theme.spacing(2)};
27
+
24
28
  margin-bottom: ${({ theme }) => theme.spacing(4)};
25
29
 
30
+ &:empty {
31
+ display: none;
32
+ }
33
+
26
34
  ${({ theme }) => theme.breakpoints.down('sm')} {
27
35
  margin: ${({ theme }) => theme.spacing(3, 4, 1)};
28
36
  }
@@ -18,7 +18,7 @@ export type HintPopoverProps = Omit<NewPopoverProps, 'hasArrow' | 'disableMobile
18
18
  */
19
19
  action?: ReactNode;
20
20
  /**
21
- * Ref на узел контента — для фокус-трапа/определения кликов у потребителя.
21
+ * Ref на узел контента — для focus-trap/определения кликов у потребителя.
22
22
  */
23
23
  contentRef?: Ref<HTMLDivElement>;
24
24
  };
@@ -9,10 +9,10 @@ import { useLogic } from './useLogic';
9
9
  export const HighlightStep = ({ activeStep, isClosing, geometry, }) => {
10
10
  const { step } = activeStep;
11
11
  const { anchorEl } = geometry;
12
- const { isOpen, shouldShowPopover, setPopoverNode, handleClose } = useLogic(activeStep, isClosing, geometry);
12
+ const { isOpen, shouldShowPopover, handleClose } = useLogic(activeStep, isClosing, geometry);
13
13
  // Без якоря popover не рисуем.
14
14
  if (!anchorEl) {
15
15
  return null;
16
16
  }
17
- return (_jsx(_Fragment, { children: shouldShowPopover && (_jsx(StepPopover, { variant: "light", isOpen: isOpen, disableAutoFocus: true, anchorEl: anchorEl, placement: step.position, onClose: handleClose, contentRef: setPopoverNode, title: step.title, action: _jsx(StepFooter, { activeStep: activeStep }), children: step.content && (_jsx(Typography, { component: "div", variant: "body1", color: "grey", colorIntensity: "900", children: step.content })) })) }));
17
+ return (_jsx(_Fragment, { children: shouldShowPopover && (_jsx(StepPopover, { variant: "light", isOpen: isOpen, disableAutoFocus: true, anchorEl: anchorEl, placement: step.position, onClose: handleClose, title: step.title, action: _jsx(StepFooter, { activeStep: activeStep }), children: step.content && (_jsx(Typography, { component: "div", variant: "body1", color: "grey", colorIntensity: "900", children: step.content })) })) }));
18
18
  };
@@ -3,10 +3,9 @@ import { type OverlayGeometry } from '../../../useLogic';
3
3
  export type UseLogicResult = {
4
4
  isOpen: boolean;
5
5
  shouldShowPopover: boolean;
6
- setPopoverNode: (node: HTMLElement | null) => void;
7
6
  handleClose: () => void;
8
7
  };
9
8
  /**
10
- * Логика highlight-шага: задержка popover, фокус-трап, закрытие.
9
+ * Логика highlight-шага: задержка popover, закрытие.
11
10
  */
12
11
  export declare const useLogic: (activeStep: ActiveStepState, isClosing: boolean, geometry: OverlayGeometry) => UseLogicResult;
@@ -1,12 +1,11 @@
1
- import { useCallback, useEffect, useMemo, useState } from 'react';
1
+ import { useCallback, useEffect, useState } from 'react';
2
2
  import { useTheme } from '../../../../../../theme/hooks/useTheme';
3
- import { useFocusTrap } from '../../../../hooks/useFocusTrap';
4
3
  /**
5
- * Логика highlight-шага: задержка popover, фокус-трап, закрытие.
4
+ * Логика highlight-шага: задержка popover, закрытие.
6
5
  */
7
6
  export const useLogic = (activeStep, isClosing, geometry) => {
8
- const { isInteractive, isConfirming } = activeStep;
9
- const { anchorEl, element, isTransitioning } = geometry;
7
+ const { isConfirming } = activeStep;
8
+ const { anchorEl, isTransitioning } = geometry;
10
9
  const theme = useTheme();
11
10
  const isOpen = !isClosing;
12
11
  // Задержка до появления popover после готовности hole.
@@ -19,10 +18,6 @@ export const useLogic = (activeStep, isClosing, geometry) => {
19
18
  const timer = setTimeout(() => setIsEntered(true), theme.transitions.duration.shortest);
20
19
  return () => clearTimeout(timer);
21
20
  }, [isEntered, isHoleReady]);
22
- const [popoverNode, setPopoverNode] = useState(null);
23
- const trapNodes = useMemo(() => [popoverNode, isInteractive ? element : null], [popoverNode, isInteractive, element]);
24
- // Трап выключен при закрытии/подтверждении.
25
- useFocusTrap(trapNodes, isOpen && !isConfirming);
26
21
  const handleClose = useCallback(() => {
27
22
  activeStep.requestClose();
28
23
  }, [activeStep]);
@@ -31,7 +26,6 @@ export const useLogic = (activeStep, isClosing, geometry) => {
31
26
  return {
32
27
  isOpen,
33
28
  shouldShowPopover,
34
- setPopoverNode,
35
29
  handleClose,
36
30
  };
37
31
  };
@@ -1,5 +1,5 @@
1
1
  import { selfContainedClassname } from '../constants';
2
- import { pdfViewerClassnames } from '../PdfViewer';
2
+ import { pdfViewerClassnames } from '../PdfViewer/constants';
3
3
  import { styled } from '../styled';
4
4
  import { PAGE_CONTENT_ANIMATION, pageContentClassnames } from './constants';
5
5
  export const Wrapper = styled('article', {
@@ -6,6 +6,10 @@ export const BreadcrumbsWrapper = styled.div `
6
6
 
7
7
  margin-bottom: ${({ theme }) => theme.spacing(1)};
8
8
 
9
+ &:empty {
10
+ display: none;
11
+ }
12
+
9
13
  ${({ theme }) => theme.breakpoints.down('sm')} {
10
14
  display: none;
11
15
  }
@@ -16,6 +20,10 @@ export const TabsWrapper = styled.div `
16
20
 
17
21
  padding-top: ${({ theme }) => theme.spacing(4)};
18
22
 
23
+ &:empty {
24
+ display: none;
25
+ }
26
+
19
27
  ${({ theme }) => theme.breakpoints.down('sm')} {
20
28
  padding: ${({ theme }) => theme.spacing(0, 0, 4, 0)};
21
29
 
@@ -30,6 +38,10 @@ export const PageSubheader = styled.div `
30
38
 
31
39
  padding-top: ${({ theme }) => theme.spacing(4)};
32
40
 
41
+ &:empty {
42
+ display: none;
43
+ }
44
+
33
45
  ${({ theme }) => theme.breakpoints.down('sm')} {
34
46
  padding: ${({ theme }) => theme.spacing(0, 4, 4, 4)};
35
47
  }
@@ -31,8 +31,20 @@ export const Wrapper = styled.header `
31
31
 
32
32
  background-color: ${({ theme }) => theme.palette.background.default};
33
33
 
34
- &.${pageHeaderClassnames.hasSubheader}, &.${pageHeaderClassnames.hasFilters} {
35
- border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
34
+ /*
35
+ * Два правила, а не список через запятую: невалидный :has()
36
+ * отбросил бы и границу под фильтрами.
37
+ */
38
+ &.${pageHeaderClassnames.hasFilters} {
39
+ border-bottom: 1px solid
40
+ ${({ theme }) => theme.palette.components.border.default};
41
+ }
42
+
43
+ /* Причина игнора: прогрессивное улучшение */
44
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
45
+ &:has(.${pageHeaderClassnames.subheader}:not(:empty)) {
46
+ border-bottom: 1px solid
47
+ ${({ theme }) => theme.palette.components.border.default};
36
48
  }
37
49
  }
38
50
 
@@ -78,8 +90,8 @@ export const MobileTitleWrapper = styled.div `
78
90
  /* stylelint-disable plugin/no-unsupported-browser-features */
79
91
  &:not(:has(+ .${pageHeaderClassnames.root} :is(
80
92
  .${pageHeaderClassnames.filters},
81
- .${pageHeaderClassnames.subheader},
82
- .${pageAsideClassnames.mobileNavigation}
93
+ .${pageHeaderClassnames.subheader}:not(:empty),
94
+ .${pageAsideClassnames.mobileNavigation}:not(:empty)
83
95
  ))) {
84
96
  border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
85
97
  }
@@ -2,18 +2,30 @@ import { styled } from '../styled';
2
2
  export const MobileAlertWrapper = styled.div `
3
3
  display: none;
4
4
  ${({ theme }) => theme.breakpoints.down('sm')} {
5
- display: block;
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: ${({ theme }) => theme.spacing(2)};
6
8
 
7
9
  margin: ${({ theme }) => theme.spacing(3, 4, 0, 4)};
8
10
 
9
11
  background-color: ${({ theme }) => theme.palette.background.default};
12
+
13
+ &:empty {
14
+ display: none;
15
+ }
10
16
  }
11
17
  `;
12
18
  export const DesktopAlertWrapper = styled.div `
13
- display: block;
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: ${({ theme }) => theme.spacing(2)};
14
22
 
15
23
  margin-bottom: ${({ theme }) => theme.spacing(4)};
16
24
 
25
+ &:empty {
26
+ display: none;
27
+ }
28
+
17
29
  ${({ theme }) => theme.breakpoints.down('sm')} {
18
30
  display: none;
19
31
  }
@@ -98,6 +98,10 @@ exports.HeaderContentSection = (0, styled_1.styled)(exports.HeaderSection) `
98
98
  }
99
99
  `;
100
100
  exports.ProductSwitcherWrapper = styled_1.styled.div `
101
+ &:empty {
102
+ display: none;
103
+ }
104
+
101
105
  ${({ theme }) => theme.breakpoints.down('sm')} {
102
106
  display: none;
103
107
  }
@@ -134,6 +138,10 @@ exports.HeaderContent = styled_1.styled.div `
134
138
  * Обертка для элементов которые должны быть в мобильном хедере или помещены в sidebar.
135
139
  */
136
140
  exports.PriorityFeatureWrapper = styled_1.styled.div `
141
+ &&:empty {
142
+ display: none;
143
+ }
144
+
137
145
  ${({ theme }) => theme.breakpoints.down('sm')} {
138
146
  display: flex;
139
147
  justify-content: flex-end;
@@ -24,8 +24,16 @@ exports.AlertWrapper = styled_1.styled.div `
24
24
  }
25
25
  `;
26
26
  exports.AlertContainer = styled_1.styled.div `
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: ${({ theme }) => theme.spacing(2)};
30
+
27
31
  margin-bottom: ${({ theme }) => theme.spacing(4)};
28
32
 
33
+ &:empty {
34
+ display: none;
35
+ }
36
+
29
37
  ${({ theme }) => theme.breakpoints.down('sm')} {
30
38
  margin: ${({ theme }) => theme.spacing(3, 4, 1)};
31
39
  }
@@ -18,7 +18,7 @@ export type HintPopoverProps = Omit<NewPopoverProps, 'hasArrow' | 'disableMobile
18
18
  */
19
19
  action?: ReactNode;
20
20
  /**
21
- * Ref на узел контента — для фокус-трапа/определения кликов у потребителя.
21
+ * Ref на узел контента — для focus-trap/определения кликов у потребителя.
22
22
  */
23
23
  contentRef?: Ref<HTMLDivElement>;
24
24
  };
@@ -12,11 +12,11 @@ const useLogic_1 = require("./useLogic");
12
12
  const HighlightStep = ({ activeStep, isClosing, geometry, }) => {
13
13
  const { step } = activeStep;
14
14
  const { anchorEl } = geometry;
15
- const { isOpen, shouldShowPopover, setPopoverNode, handleClose } = (0, useLogic_1.useLogic)(activeStep, isClosing, geometry);
15
+ const { isOpen, shouldShowPopover, handleClose } = (0, useLogic_1.useLogic)(activeStep, isClosing, geometry);
16
16
  // Без якоря popover не рисуем.
17
17
  if (!anchorEl) {
18
18
  return null;
19
19
  }
20
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: shouldShowPopover && ((0, jsx_runtime_1.jsx)(styles_1.StepPopover, { variant: "light", isOpen: isOpen, disableAutoFocus: true, anchorEl: anchorEl, placement: step.position, onClose: handleClose, contentRef: setPopoverNode, title: step.title, action: (0, jsx_runtime_1.jsx)(StepFooter_1.StepFooter, { activeStep: activeStep }), children: step.content && ((0, jsx_runtime_1.jsx)(Typography_1.Typography, { component: "div", variant: "body1", color: "grey", colorIntensity: "900", children: step.content })) })) }));
20
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: shouldShowPopover && ((0, jsx_runtime_1.jsx)(styles_1.StepPopover, { variant: "light", isOpen: isOpen, disableAutoFocus: true, anchorEl: anchorEl, placement: step.position, onClose: handleClose, title: step.title, action: (0, jsx_runtime_1.jsx)(StepFooter_1.StepFooter, { activeStep: activeStep }), children: step.content && ((0, jsx_runtime_1.jsx)(Typography_1.Typography, { component: "div", variant: "body1", color: "grey", colorIntensity: "900", children: step.content })) })) }));
21
21
  };
22
22
  exports.HighlightStep = HighlightStep;
@@ -3,10 +3,9 @@ import { type OverlayGeometry } from '../../../useLogic';
3
3
  export type UseLogicResult = {
4
4
  isOpen: boolean;
5
5
  shouldShowPopover: boolean;
6
- setPopoverNode: (node: HTMLElement | null) => void;
7
6
  handleClose: () => void;
8
7
  };
9
8
  /**
10
- * Логика highlight-шага: задержка popover, фокус-трап, закрытие.
9
+ * Логика highlight-шага: задержка popover, закрытие.
11
10
  */
12
11
  export declare const useLogic: (activeStep: ActiveStepState, isClosing: boolean, geometry: OverlayGeometry) => UseLogicResult;
@@ -3,13 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLogic = void 0;
4
4
  const react_1 = require("react");
5
5
  const useTheme_1 = require("../../../../../../theme/hooks/useTheme");
6
- const useFocusTrap_1 = require("../../../../hooks/useFocusTrap");
7
6
  /**
8
- * Логика highlight-шага: задержка popover, фокус-трап, закрытие.
7
+ * Логика highlight-шага: задержка popover, закрытие.
9
8
  */
10
9
  const useLogic = (activeStep, isClosing, geometry) => {
11
- const { isInteractive, isConfirming } = activeStep;
12
- const { anchorEl, element, isTransitioning } = geometry;
10
+ const { isConfirming } = activeStep;
11
+ const { anchorEl, isTransitioning } = geometry;
13
12
  const theme = (0, useTheme_1.useTheme)();
14
13
  const isOpen = !isClosing;
15
14
  // Задержка до появления popover после готовности hole.
@@ -22,10 +21,6 @@ const useLogic = (activeStep, isClosing, geometry) => {
22
21
  const timer = setTimeout(() => setIsEntered(true), theme.transitions.duration.shortest);
23
22
  return () => clearTimeout(timer);
24
23
  }, [isEntered, isHoleReady]);
25
- const [popoverNode, setPopoverNode] = (0, react_1.useState)(null);
26
- const trapNodes = (0, react_1.useMemo)(() => [popoverNode, isInteractive ? element : null], [popoverNode, isInteractive, element]);
27
- // Трап выключен при закрытии/подтверждении.
28
- (0, useFocusTrap_1.useFocusTrap)(trapNodes, isOpen && !isConfirming);
29
24
  const handleClose = (0, react_1.useCallback)(() => {
30
25
  activeStep.requestClose();
31
26
  }, [activeStep]);
@@ -34,7 +29,6 @@ const useLogic = (activeStep, isClosing, geometry) => {
34
29
  return {
35
30
  isOpen,
36
31
  shouldShowPopover,
37
- setPopoverNode,
38
32
  handleClose,
39
33
  };
40
34
  };
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Content = exports.Wrapper = void 0;
4
4
  const constants_1 = require("../constants");
5
- const PdfViewer_1 = require("../PdfViewer");
5
+ const constants_2 = require("../PdfViewer/constants");
6
6
  const styled_1 = require("../styled");
7
- const constants_2 = require("./constants");
7
+ const constants_3 = require("./constants");
8
8
  exports.Wrapper = (0, styled_1.styled)('article', {
9
9
  shouldForwardProp: (prop) => !['$isFullHeight', '$isSeparatorShown'].includes(prop),
10
10
  }) `
@@ -31,7 +31,7 @@ exports.Wrapper = (0, styled_1.styled)('article', {
31
31
  border-top: none;
32
32
  }
33
33
 
34
- @keyframes ${constants_2.PAGE_CONTENT_ANIMATION} {
34
+ @keyframes ${constants_3.PAGE_CONTENT_ANIMATION} {
35
35
  0% {
36
36
  display: none;
37
37
 
@@ -49,8 +49,8 @@ exports.Wrapper = (0, styled_1.styled)('article', {
49
49
  }
50
50
  }
51
51
 
52
- &.${constants_2.pageContentClassnames.animation} > * {
53
- animation: ${({ theme }) => `${constants_2.PAGE_CONTENT_ANIMATION} ${theme.transitions.duration.complex * 2}ms`};
52
+ &.${constants_3.pageContentClassnames.animation} > * {
53
+ animation: ${({ theme }) => `${constants_3.PAGE_CONTENT_ANIMATION} ${theme.transitions.duration.complex * 2}ms`};
54
54
  }
55
55
  `;
56
56
  exports.Content = styled_1.styled.div `
@@ -62,7 +62,7 @@ exports.Content = styled_1.styled.div `
62
62
 
63
63
  padding: ${({ theme }) => theme.spacing(0, 6, 4)};
64
64
 
65
- &.${constants_2.pageContentClassnames.contentHasHeader}, &.${constants_2.pageContentClassnames.hasAside} {
65
+ &.${constants_3.pageContentClassnames.contentHasHeader}, &.${constants_3.pageContentClassnames.hasAside} {
66
66
  padding: ${({ theme }) => theme.spacing(4, 6, 4)};
67
67
  }
68
68
 
@@ -71,7 +71,7 @@ exports.Content = styled_1.styled.div `
71
71
  padding-bottom: ${({ theme }) => theme.spacing(3)};
72
72
  padding-left: ${({ theme }) => theme.spacing(4)};
73
73
 
74
- &.${constants_2.pageContentClassnames.contentHasHeader}, &.${constants_2.pageContentClassnames.hasAside} {
74
+ &.${constants_3.pageContentClassnames.contentHasHeader}, &.${constants_3.pageContentClassnames.hasAside} {
75
75
  padding: ${({ theme }) => theme.spacing(4, 4, 3)};
76
76
  }
77
77
  }
@@ -88,14 +88,14 @@ exports.Content = styled_1.styled.div `
88
88
  border: 1px solid ${({ theme }) => theme.palette.components.border.default};
89
89
  border-radius: ${({ theme }) => theme.shape.medium};
90
90
 
91
- &.${constants_2.pageContentClassnames.contentHasHeader} {
91
+ &.${constants_3.pageContentClassnames.contentHasHeader} {
92
92
  border-top-left-radius: 0;
93
93
  border-top-right-radius: 0;
94
94
  }
95
95
 
96
96
  /* Причина игнора: Не критично для отображения */
97
97
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
98
- &.${constants_2.pageContentClassnames.isUnconstrained}, &:has(> .${constants_1.selfContainedClassname}) {
98
+ &.${constants_3.pageContentClassnames.isUnconstrained}, &:has(> .${constants_1.selfContainedClassname}) {
99
99
  margin: 0;
100
100
  padding: 0;
101
101
 
@@ -107,7 +107,7 @@ exports.Content = styled_1.styled.div `
107
107
 
108
108
  /* Причина игнора: Не критично для отображения */
109
109
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
110
- &:has(.${PdfViewer_1.pdfViewerClassnames.document}.${PdfViewer_1.pdfViewerClassnames.zoom}) {
110
+ &:has(.${constants_2.pdfViewerClassnames.document}.${constants_2.pdfViewerClassnames.zoom}) {
111
111
  scroll-behavior: auto;
112
112
  scrollbar-gutter: auto;
113
113
 
@@ -123,7 +123,7 @@ exports.Content = styled_1.styled.div `
123
123
  }
124
124
 
125
125
  ${({ theme }) => theme.breakpoints.down('sm')} {
126
- &&.${constants_2.pageContentClassnames.withPdfViewer} {
126
+ &&.${constants_3.pageContentClassnames.withPdfViewer} {
127
127
  margin: 0;
128
128
  padding-top: 0;
129
129
  padding-right: 0;
@@ -9,6 +9,10 @@ exports.BreadcrumbsWrapper = styled_1.styled.div `
9
9
 
10
10
  margin-bottom: ${({ theme }) => theme.spacing(1)};
11
11
 
12
+ &:empty {
13
+ display: none;
14
+ }
15
+
12
16
  ${({ theme }) => theme.breakpoints.down('sm')} {
13
17
  display: none;
14
18
  }
@@ -19,6 +23,10 @@ exports.TabsWrapper = styled_1.styled.div `
19
23
 
20
24
  padding-top: ${({ theme }) => theme.spacing(4)};
21
25
 
26
+ &:empty {
27
+ display: none;
28
+ }
29
+
22
30
  ${({ theme }) => theme.breakpoints.down('sm')} {
23
31
  padding: ${({ theme }) => theme.spacing(0, 0, 4, 0)};
24
32
 
@@ -33,6 +41,10 @@ exports.PageSubheader = styled_1.styled.div `
33
41
 
34
42
  padding-top: ${({ theme }) => theme.spacing(4)};
35
43
 
44
+ &:empty {
45
+ display: none;
46
+ }
47
+
36
48
  ${({ theme }) => theme.breakpoints.down('sm')} {
37
49
  padding: ${({ theme }) => theme.spacing(0, 4, 4, 4)};
38
50
  }
@@ -34,8 +34,20 @@ exports.Wrapper = styled_1.styled.header `
34
34
 
35
35
  background-color: ${({ theme }) => theme.palette.background.default};
36
36
 
37
- &.${constants_2.pageHeaderClassnames.hasSubheader}, &.${constants_2.pageHeaderClassnames.hasFilters} {
38
- border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
37
+ /*
38
+ * Два правила, а не список через запятую: невалидный :has()
39
+ * отбросил бы и границу под фильтрами.
40
+ */
41
+ &.${constants_2.pageHeaderClassnames.hasFilters} {
42
+ border-bottom: 1px solid
43
+ ${({ theme }) => theme.palette.components.border.default};
44
+ }
45
+
46
+ /* Причина игнора: прогрессивное улучшение */
47
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
48
+ &:has(.${constants_2.pageHeaderClassnames.subheader}:not(:empty)) {
49
+ border-bottom: 1px solid
50
+ ${({ theme }) => theme.palette.components.border.default};
39
51
  }
40
52
  }
41
53
 
@@ -81,8 +93,8 @@ exports.MobileTitleWrapper = styled_1.styled.div `
81
93
  /* stylelint-disable plugin/no-unsupported-browser-features */
82
94
  &:not(:has(+ .${constants_2.pageHeaderClassnames.root} :is(
83
95
  .${constants_2.pageHeaderClassnames.filters},
84
- .${constants_2.pageHeaderClassnames.subheader},
85
- .${constants_1.pageAsideClassnames.mobileNavigation}
96
+ .${constants_2.pageHeaderClassnames.subheader}:not(:empty),
97
+ .${constants_1.pageAsideClassnames.mobileNavigation}:not(:empty)
86
98
  ))) {
87
99
  border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
88
100
  }
@@ -5,18 +5,30 @@ const styled_1 = require("../styled");
5
5
  exports.MobileAlertWrapper = styled_1.styled.div `
6
6
  display: none;
7
7
  ${({ theme }) => theme.breakpoints.down('sm')} {
8
- display: block;
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: ${({ theme }) => theme.spacing(2)};
9
11
 
10
12
  margin: ${({ theme }) => theme.spacing(3, 4, 0, 4)};
11
13
 
12
14
  background-color: ${({ theme }) => theme.palette.background.default};
15
+
16
+ &:empty {
17
+ display: none;
18
+ }
13
19
  }
14
20
  `;
15
21
  exports.DesktopAlertWrapper = styled_1.styled.div `
16
- display: block;
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: ${({ theme }) => theme.spacing(2)};
17
25
 
18
26
  margin-bottom: ${({ theme }) => theme.spacing(4)};
19
27
 
28
+ &:empty {
29
+ display: none;
30
+ }
31
+
20
32
  ${({ theme }) => theme.breakpoints.down('sm')} {
21
33
  display: none;
22
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.91.1",
3
+ "version": "4.92.0",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- export { useFocusTrap } from './useFocusTrap';
@@ -1 +0,0 @@
1
- export { useFocusTrap } from './useFocusTrap';
@@ -1,6 +0,0 @@
1
- /**
2
- * Мульти-контейнерный фокус-трап для highlight-шага.
3
- * @param nodes контейнеры
4
- * @param isActive включение трапа
5
- */
6
- export declare const useFocusTrap: (nodes: (HTMLElement | null)[], isActive?: boolean) => void;
@@ -1,33 +0,0 @@
1
- import { createFocusTrap } from 'focus-trap';
2
- import { useEffect } from 'react';
3
- /**
4
- * Мульти-контейнерный фокус-трап для highlight-шага.
5
- * @param nodes контейнеры
6
- * @param isActive включение трапа
7
- */
8
- export const useFocusTrap = (nodes, isActive = true) => {
9
- useEffect(() => {
10
- const containers = nodes.filter((node) => node !== null);
11
- if (!isActive || containers.length === 0) {
12
- return;
13
- }
14
- const trap = createFocusTrap(containers, {
15
- escapeDeactivates: false,
16
- clickOutsideDeactivates: false,
17
- allowOutsideClick: true,
18
- returnFocusOnDeactivate: false,
19
- fallbackFocus: containers[0],
20
- initialFocus: () => containers[0],
21
- });
22
- try {
23
- trap.activate();
24
- }
25
- catch {
26
- // Нет фокусируемых узлов.
27
- return;
28
- }
29
- return () => {
30
- trap.deactivate();
31
- };
32
- }, [nodes, isActive]);
33
- };
@@ -1 +0,0 @@
1
- export { useFocusTrap } from './useFocusTrap';
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useFocusTrap = void 0;
4
- var useFocusTrap_1 = require("./useFocusTrap");
5
- Object.defineProperty(exports, "useFocusTrap", { enumerable: true, get: function () { return useFocusTrap_1.useFocusTrap; } });
@@ -1,6 +0,0 @@
1
- /**
2
- * Мульти-контейнерный фокус-трап для highlight-шага.
3
- * @param nodes контейнеры
4
- * @param isActive включение трапа
5
- */
6
- export declare const useFocusTrap: (nodes: (HTMLElement | null)[], isActive?: boolean) => void;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useFocusTrap = void 0;
4
- const focus_trap_1 = require("focus-trap");
5
- const react_1 = require("react");
6
- /**
7
- * Мульти-контейнерный фокус-трап для highlight-шага.
8
- * @param nodes контейнеры
9
- * @param isActive включение трапа
10
- */
11
- const useFocusTrap = (nodes, isActive = true) => {
12
- (0, react_1.useEffect)(() => {
13
- const containers = nodes.filter((node) => node !== null);
14
- if (!isActive || containers.length === 0) {
15
- return;
16
- }
17
- const trap = (0, focus_trap_1.createFocusTrap)(containers, {
18
- escapeDeactivates: false,
19
- clickOutsideDeactivates: false,
20
- allowOutsideClick: true,
21
- returnFocusOnDeactivate: false,
22
- fallbackFocus: containers[0],
23
- initialFocus: () => containers[0],
24
- });
25
- try {
26
- trap.activate();
27
- }
28
- catch {
29
- // Нет фокусируемых узлов.
30
- return;
31
- }
32
- return () => {
33
- trap.deactivate();
34
- };
35
- }, [nodes, isActive]);
36
- };
37
- exports.useFocusTrap = useFocusTrap;