@astral/ui 4.101.0 → 4.103.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 (147) hide show
  1. package/components/Alert/styles.js +12 -2
  2. package/components/Autocomplete/styles.js +5 -2
  3. package/components/Breadcrumbs/styles.js +18 -13
  4. package/components/CheckableTag/styles.js +6 -3
  5. package/components/Checkbox/styles.js +10 -7
  6. package/components/Chip/styles.js +11 -6
  7. package/components/CodeField/styles.js +5 -2
  8. package/components/CopyTypography/styles.js +19 -5
  9. package/components/DashboardLayout/Header/styles.js +5 -2
  10. package/components/DashboardSidebarPopover/SidebarPopoverItem/styles.js +5 -2
  11. package/components/DataGrid/Row/styles.js +14 -19
  12. package/components/DataGrid/RowBase/styles.js +10 -17
  13. package/components/DataGridCollapsibleRow/styles.js +5 -2
  14. package/components/Description/Value/styles.js +5 -2
  15. package/components/Dialog/Dialog.d.ts +1 -1
  16. package/components/Dialog/Dialog.js +5 -4
  17. package/components/Dialog/styles.js +8 -0
  18. package/components/Dialog/types.d.ts +5 -0
  19. package/components/Dialog/useLogic/useLogic.d.ts +3 -3
  20. package/components/Dialog/useLogic/useLogic.js +6 -2
  21. package/components/ExpansionPanel/Summary/styles.js +5 -2
  22. package/components/Fab/styles.js +12 -3
  23. package/components/HintPopover/styles.js +2 -1
  24. package/components/InfiniteDataList/styles.js +5 -2
  25. package/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +5 -2
  26. package/components/InputGroup/styles.js +8 -5
  27. package/components/JsonViewer/JsonNode/styles.js +5 -2
  28. package/components/Link/styles.js +11 -6
  29. package/components/ListItem/styles.js +5 -2
  30. package/components/MenuOrganization/OrganizationButton/styles.js +5 -6
  31. package/components/NavMenu/Item/ItemButton/styles.js +14 -7
  32. package/components/NewPopover/NewPopover.js +1 -0
  33. package/components/NewPopover/constants.d.ts +5 -0
  34. package/components/NewPopover/constants.js +6 -1
  35. package/components/NewPopover/styles.js +2 -1
  36. package/components/NewPopover/types.d.ts +1 -1
  37. package/components/NewPopover/useLogic/useLogic.d.ts +2 -2
  38. package/components/NewPopover/useLogic/useLogic.js +12 -12
  39. package/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.d.ts +7 -0
  40. package/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.js +19 -0
  41. package/components/NewPopover/useLogic/utils/getFallbackPlacements/index.d.ts +1 -0
  42. package/components/NewPopover/useLogic/utils/getFallbackPlacements/index.js +1 -0
  43. package/components/NewPopover/useLogic/utils/index.d.ts +4 -0
  44. package/components/NewPopover/useLogic/utils/index.js +4 -0
  45. package/components/NewStepper/Step/styles.js +18 -15
  46. package/components/Notification/NotificationStackContainer/styles.js +5 -2
  47. package/components/Onboarding/types/step.d.ts +1 -1
  48. package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
  49. package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.js +1 -1
  50. package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.d.ts +1 -0
  51. package/components/Onboarding/ui/hooks/useTrackedRect/constants.d.ts +6 -0
  52. package/components/Onboarding/ui/hooks/useTrackedRect/constants.js +6 -0
  53. package/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.js +34 -12
  54. package/components/PageAsideNavigation/PageAsideNavigationItem/styles.js +5 -6
  55. package/components/PageHeader/MobilePageActions/styles.js +0 -4
  56. package/components/Radio/styles.js +7 -4
  57. package/components/RadioCard/styles.js +5 -2
  58. package/components/StaticCalendar/StaticCalendarGridButton/styles.js +8 -5
  59. package/components/Tabs/Tab/styles.js +5 -2
  60. package/components/ToggleButton/styles.js +25 -10
  61. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.js +3 -3
  62. package/components/Tree/TreeItem/styles.js +23 -10
  63. package/components/constants/index.d.ts +1 -0
  64. package/components/constants/index.js +1 -0
  65. package/components/constants/media.d.ts +8 -0
  66. package/components/constants/media.js +8 -0
  67. package/components/theme/components/MuiButton.js +46 -23
  68. package/components/theme/components/MuiListItemButton.js +10 -2
  69. package/components/theme/components/MuiMenuItem.js +5 -2
  70. package/components/theme/components/MuiOutlinedInput.js +15 -12
  71. package/components/theme/components/MuiSwitch.js +14 -9
  72. package/components/theme/components/MuiTableRow.js +11 -3
  73. package/hook-form/FormFilters/FormFiltersDialog/styles.d.ts +1 -0
  74. package/node/components/Alert/styles.js +24 -14
  75. package/node/components/Autocomplete/styles.js +8 -5
  76. package/node/components/Breadcrumbs/styles.js +18 -13
  77. package/node/components/CheckableTag/styles.js +6 -3
  78. package/node/components/Checkbox/styles.js +26 -23
  79. package/node/components/Chip/styles.js +36 -31
  80. package/node/components/CodeField/styles.js +5 -2
  81. package/node/components/CopyTypography/styles.js +22 -8
  82. package/node/components/DashboardLayout/Header/styles.js +35 -32
  83. package/node/components/DashboardSidebarPopover/SidebarPopoverItem/styles.js +7 -4
  84. package/node/components/DataGrid/Row/styles.js +41 -46
  85. package/node/components/DataGrid/RowBase/styles.js +16 -23
  86. package/node/components/DataGridCollapsibleRow/styles.js +11 -8
  87. package/node/components/Description/Value/styles.js +5 -2
  88. package/node/components/Dialog/Dialog.d.ts +1 -1
  89. package/node/components/Dialog/Dialog.js +5 -4
  90. package/node/components/Dialog/styles.js +8 -0
  91. package/node/components/Dialog/types.d.ts +5 -0
  92. package/node/components/Dialog/useLogic/useLogic.d.ts +3 -3
  93. package/node/components/Dialog/useLogic/useLogic.js +6 -2
  94. package/node/components/ExpansionPanel/Summary/styles.js +5 -2
  95. package/node/components/Fab/styles.js +12 -3
  96. package/node/components/HintPopover/styles.js +2 -1
  97. package/node/components/InfiniteDataList/styles.js +7 -4
  98. package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +11 -8
  99. package/node/components/InputGroup/styles.js +8 -5
  100. package/node/components/JsonViewer/JsonNode/styles.js +5 -2
  101. package/node/components/Link/styles.js +13 -8
  102. package/node/components/ListItem/styles.js +10 -7
  103. package/node/components/MenuOrganization/OrganizationButton/styles.js +5 -6
  104. package/node/components/NavMenu/Item/ItemButton/styles.js +16 -9
  105. package/node/components/NewPopover/NewPopover.js +1 -0
  106. package/node/components/NewPopover/constants.d.ts +5 -0
  107. package/node/components/NewPopover/constants.js +7 -2
  108. package/node/components/NewPopover/styles.js +1 -0
  109. package/node/components/NewPopover/types.d.ts +1 -1
  110. package/node/components/NewPopover/useLogic/useLogic.d.ts +2 -2
  111. package/node/components/NewPopover/useLogic/useLogic.js +15 -15
  112. package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.d.ts +7 -0
  113. package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.js +23 -0
  114. package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/index.d.ts +1 -0
  115. package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/index.js +17 -0
  116. package/node/components/NewPopover/useLogic/utils/index.d.ts +4 -0
  117. package/node/components/NewPopover/useLogic/utils/index.js +20 -0
  118. package/node/components/NewStepper/Step/styles.js +68 -65
  119. package/node/components/Notification/NotificationStackContainer/styles.js +57 -54
  120. package/node/components/Onboarding/types/step.d.ts +1 -1
  121. package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
  122. package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.js +1 -1
  123. package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.d.ts +1 -0
  124. package/node/components/Onboarding/ui/hooks/useTrackedRect/constants.d.ts +6 -0
  125. package/node/components/Onboarding/ui/hooks/useTrackedRect/constants.js +9 -0
  126. package/node/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.js +34 -12
  127. package/node/components/PageAsideNavigation/PageAsideNavigationItem/styles.js +12 -13
  128. package/node/components/PageHeader/MobilePageActions/styles.js +0 -4
  129. package/node/components/Radio/styles.js +20 -17
  130. package/node/components/RadioCard/styles.js +7 -4
  131. package/node/components/StaticCalendar/StaticCalendarGridButton/styles.js +8 -5
  132. package/node/components/Tabs/Tab/styles.js +5 -2
  133. package/node/components/ToggleButton/styles.js +27 -12
  134. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.js +3 -3
  135. package/node/components/Tree/TreeItem/styles.js +44 -31
  136. package/node/components/constants/index.d.ts +1 -0
  137. package/node/components/constants/index.js +1 -0
  138. package/node/components/constants/media.d.ts +8 -0
  139. package/node/components/constants/media.js +11 -0
  140. package/node/components/theme/components/MuiButton.js +46 -23
  141. package/node/components/theme/components/MuiListItemButton.js +10 -2
  142. package/node/components/theme/components/MuiMenuItem.js +5 -2
  143. package/node/components/theme/components/MuiOutlinedInput.js +15 -12
  144. package/node/components/theme/components/MuiSwitch.js +14 -9
  145. package/node/components/theme/components/MuiTableRow.js +11 -3
  146. package/node/hook-form/FormFilters/FormFiltersDialog/styles.d.ts +1 -0
  147. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import { HOVER_MEDIA } from '../constants';
1
2
  import { Grid } from '../Grid';
2
3
  import { IconButton } from '../IconButton';
3
4
  import { svgIconClassnames } from '../SvgIcon';
@@ -20,8 +21,17 @@ export const StyledIconButton = styled(IconButton) `
20
21
  margin-top: ${({ theme }) => `calc(${theme.microSpacing(3)} + (20px - 40px) / 2)`};
21
22
  }
22
23
 
23
- &:hover {
24
- background-color: rgb(0 0 0 / 4%);
24
+ ${HOVER_MEDIA} {
25
+ &:hover {
26
+ background-color: rgb(0 0 0 / 4%);
27
+ }
28
+ }
29
+
30
+ /* Переопределяем active на мобильных устройствах для сохранения исходной стилизации */
31
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
32
+ &:active {
33
+ background-color: rgb(0 0 0 / 4%);
34
+ }
25
35
  }
26
36
  `;
27
37
  export const Wrapper = styled.div `
@@ -2,6 +2,7 @@ import MuiAutocomplete, { autocompleteClasses, } from '@mui/material/Autocomplet
2
2
  import { formControlClasses } from '@mui/material/FormControl';
3
3
  import { iconButtonClasses } from '@mui/material/IconButton';
4
4
  import { inputBaseClasses } from '@mui/material/InputBase';
5
+ import { HOVER_MEDIA } from '../constants';
5
6
  import { MenuItem } from '../MenuItem';
6
7
  import { svgIconClassnames } from '../SvgIcon';
7
8
  import { styled } from '../styled';
@@ -22,8 +23,10 @@ export const StyledAutocomplete = styled(MuiAutocomplete) `
22
23
  }`);
23
24
  }}
24
25
 
25
- & .${autocompleteClasses.endAdornment} .${iconButtonClasses.root}:hover {
26
- background-color: ${({ loading, theme }) => (loading ? 'transparent' : theme.palette.grey[100])};
26
+ ${HOVER_MEDIA} {
27
+ & .${autocompleteClasses.endAdornment} .${iconButtonClasses.root}:hover {
28
+ background-color: ${({ loading, theme }) => (loading ? 'transparent' : theme.palette.grey[100])};
29
+ }
27
30
  }
28
31
 
29
32
  &:not(.${autocompleteClassnames.emptyValue}) .${inputBaseClasses.root} {
@@ -1,6 +1,7 @@
1
1
  import Breadcrumbs from '@mui/material/Breadcrumbs';
2
2
  import { buttonBaseClasses } from '@mui/material/ButtonBase';
3
3
  import { linkClasses } from '@mui/material/Link';
4
+ import { HOVER_MEDIA } from '../constants';
4
5
  import { styled } from '../styled';
5
6
  export const StyledBreadcrumbs = styled(Breadcrumbs) `
6
7
  .${buttonBaseClasses.root} {
@@ -14,22 +15,24 @@ export const StyledBreadcrumbs = styled(Breadcrumbs) `
14
15
  outline: 2px solid ${({ theme }) => theme.palette.components.focused};
15
16
  }
16
17
 
17
- &:hover {
18
- &::after {
19
- content: '';
18
+ ${HOVER_MEDIA} {
19
+ &:hover {
20
+ &::after {
21
+ content: '';
20
22
 
21
- position: absolute;
22
- bottom: 3px;
23
- left: ${({ theme }) => theme.microSpacing(3)};
23
+ position: absolute;
24
+ bottom: 3px;
25
+ left: ${({ theme }) => theme.microSpacing(3)};
24
26
 
25
- width: ${({ theme }) => theme.spacing(3)};
26
- height: 1px;
27
+ width: ${({ theme }) => theme.spacing(3)};
28
+ height: 1px;
27
29
 
28
- background-color: currentColor;
30
+ background-color: currentColor;
31
+ }
29
32
  }
30
33
  }
31
34
  }
32
-
35
+
33
36
  .MuiTypography-body1 {
34
37
  color: ${({ theme }) => theme.palette.primary[800]};
35
38
  }
@@ -40,9 +43,11 @@ export const StyledBreadcrumbs = styled(Breadcrumbs) `
40
43
  &:visited {
41
44
  color: ${({ theme }) => theme.palette.grey[700]};
42
45
  }
43
-
44
- &:hover {
45
- color: ${({ theme }) => theme.palette.grey[800]};
46
+
47
+ ${HOVER_MEDIA} {
48
+ &:hover {
49
+ color: ${({ theme }) => theme.palette.grey[800]};
50
+ }
46
51
  }
47
52
  }
48
53
  `;
@@ -1,4 +1,5 @@
1
1
  import { badgeClasses } from '@mui/material/Badge';
2
+ import { HOVER_MEDIA } from '../constants';
2
3
  import { styled } from '../styled';
3
4
  import { Tag, tagClassnames, } from '../Tag';
4
5
  const getHoverBgColor = ({ theme, color, isChecked, variant, disabled, }) => {
@@ -115,21 +116,23 @@ export const StyledTag = styled(Tag, {
115
116
  cursor: pointer;
116
117
  }
117
118
 
118
- &:hover {
119
- background-color: ${({ theme, color, variant, disabled, $isChecked }) => getHoverBgColor({
119
+ ${HOVER_MEDIA} {
120
+ &:hover {
121
+ background-color: ${({ theme, color, variant, disabled, $isChecked }) => getHoverBgColor({
120
122
  theme,
121
123
  color,
122
124
  variant,
123
125
  disabled,
124
126
  isChecked: $isChecked,
125
127
  })};
126
- border: ${({ theme, variant, $isChecked, color }) => getBorder({
128
+ border: ${({ theme, variant, $isChecked, color }) => getBorder({
127
129
  theme,
128
130
  variant,
129
131
  isChecked: $isChecked,
130
132
  tagState: 'hover',
131
133
  color,
132
134
  })};
135
+ }
133
136
  }
134
137
 
135
138
  &:active {
@@ -1,3 +1,4 @@
1
+ import { HOVER_MEDIA } from '../constants';
1
2
  import { styled } from '../styled';
2
3
  import { easeOutBackTransition } from '../styled/mixins';
3
4
  import { CHECKBOX_SIZE, checkboxClassnames, MOBILE_CHECKBOX_SIZE, } from './constants';
@@ -59,17 +60,18 @@ export const Wrapper = styled('span', {
59
60
  opacity: ${({ $isIndeterminate }) => ($isIndeterminate ? 1 : 0)};
60
61
  }
61
62
 
62
- &:hover {
63
- .${checkboxClassnames.icon} {
64
- color: ${({ $isError, theme }) => $isError ? theme.palette.error[700] : theme.palette.primary[700]};
65
- }
63
+ ${HOVER_MEDIA} {
64
+ &:hover {
65
+ .${checkboxClassnames.icon} {
66
+ color: ${({ $isError, theme }) => $isError ? theme.palette.error[700] : theme.palette.primary[700]};
67
+ }
66
68
 
67
- .${checkboxClassnames.outline} {
68
- fill: ${({ theme, $isDisabled, $isChecked, $isIndeterminate }) => !$isDisabled &&
69
+ .${checkboxClassnames.outline} {
70
+ fill: ${({ theme, $isDisabled, $isChecked, $isIndeterminate }) => !$isDisabled &&
69
71
  !$isChecked &&
70
72
  !$isIndeterminate &&
71
73
  theme.palette.background.elementHover};
72
- stroke: ${({ theme, $isDisabled, $isError, $isChecked, $isIndeterminate, }) => getOutlineColor({
74
+ stroke: ${({ theme, $isDisabled, $isError, $isChecked, $isIndeterminate, }) => getOutlineColor({
73
75
  theme,
74
76
  isHover: true,
75
77
  isDisabled: $isDisabled,
@@ -77,6 +79,7 @@ export const Wrapper = styled('span', {
77
79
  isChecked: $isChecked,
78
80
  isIndeterminate: $isIndeterminate,
79
81
  })};
82
+ }
80
83
  }
81
84
  }
82
85
  `;
@@ -1,5 +1,6 @@
1
1
  import { badgeClasses } from '@mui/material/Badge';
2
2
  import { Counter } from '../Counter';
3
+ import { HOVER_MEDIA } from '../constants';
3
4
  import { styled } from '../styled';
4
5
  import { Typography } from '../Typography';
5
6
  import { chipClassnames, chipSize } from './constants';
@@ -21,9 +22,11 @@ export const Wrapper = styled.div `
21
22
  duration: theme.transitions.duration.shortest,
22
23
  })};
23
24
 
24
- &:hover {
25
- background-color: ${({ theme }) => theme.palette.background.elementHover};
26
- border-color: ${({ theme }) => theme.palette.grey[400]};
25
+ ${HOVER_MEDIA} {
26
+ &:hover {
27
+ background-color: ${({ theme }) => theme.palette.background.elementHover};
28
+ border-color: ${({ theme }) => theme.palette.grey[400]};
29
+ }
27
30
  }
28
31
 
29
32
  &:active {
@@ -85,9 +88,11 @@ export const Wrapper = styled.div `
85
88
  background-color: ${({ theme }) => theme.palette.grey[100]};
86
89
  border-color: ${({ theme }) => theme.palette.grey[800]};
87
90
 
88
- &:hover {
89
- background-color: ${({ theme }) => theme.palette.background.elementHover};
90
- border-color: ${({ theme }) => theme.palette.grey[800]};
91
+ ${HOVER_MEDIA} {
92
+ &:hover {
93
+ background-color: ${({ theme }) => theme.palette.background.elementHover};
94
+ border-color: ${({ theme }) => theme.palette.grey[800]};
95
+ }
91
96
  }
92
97
 
93
98
  &:active {
@@ -1,3 +1,4 @@
1
+ import { HOVER_MEDIA } from '../constants';
1
2
  import { FormHelperText as MuiFormHelperText } from '../FormHelperText';
2
3
  import { styled } from '../styled';
3
4
  import { Typography } from '../Typography';
@@ -48,10 +49,12 @@ export const Digit = styled.input `
48
49
  border-radius: ${({ theme }) => theme.shape.medium};
49
50
  outline: none;
50
51
 
51
- &:hover {
52
- background-color: ${({ theme, disabled }) => disabled
52
+ ${HOVER_MEDIA} {
53
+ &:hover {
54
+ background-color: ${({ theme, disabled }) => disabled
53
55
  ? theme.palette.components.disabled
54
56
  : theme.palette.background.elementHover};
57
+ }
55
58
  }
56
59
  `;
57
60
  export const FieldLabel = styled(Typography) `
@@ -1,4 +1,5 @@
1
1
  import { CopyOutlineSm } from '../../icons/CopyOutlineSm';
2
+ import { HOVER_MEDIA, HOVER_NONE_MEDIA } from '../constants';
2
3
  import { styled } from '../styled';
3
4
  import { Typography } from '../Typography';
4
5
  import { copyTypographyClassnames } from './constants';
@@ -9,12 +10,20 @@ export const Wrapper = styled(Typography) `
9
10
  display: flex;
10
11
  flex-wrap: nowrap;
11
12
  align-items: center;
13
+
14
+ ${HOVER_MEDIA} {
15
+ &:hover {
16
+ text-decoration: underline;
17
+
18
+ .${copyTypographyClassnames.showIconOnHover} {
19
+ display: unset;
20
+ }
21
+ }
22
+ }
12
23
 
13
- &:hover {
14
- text-decoration: underline;
15
-
16
- .${copyTypographyClassnames.showIconOnHover} {
17
- display: unset;
24
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
25
+ &:active {
26
+ text-decoration: underline;
18
27
  }
19
28
  }
20
29
  `;
@@ -34,5 +43,10 @@ export const StyledCopyIcon = styled(CopyOutlineSm, {
34
43
 
35
44
  &.${copyTypographyClassnames.showIconOnHover} {
36
45
  display: none;
46
+
47
+ /* На тач-устройствах иконка копирования недостижима наведением — показываем постоянно */
48
+ ${HOVER_NONE_MEDIA} {
49
+ display: unset;
50
+ }
37
51
  }
38
52
  `;
@@ -1,4 +1,5 @@
1
1
  import { buttonClasses } from '@mui/material/Button';
2
+ import { HOVER_MEDIA } from '../../constants';
2
3
  import { dashboardLayoutNotificationListClassnames } from '../../DashboardLayoutNotificationList';
3
4
  import { IconButton } from '../../IconButton';
4
5
  import { menuOrganizationClassnames } from '../../MenuOrganization/constants';
@@ -184,8 +185,10 @@ export const PriorityFeatureWrapper = styled.div `
184
185
 
185
186
  border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
186
187
 
187
- &:hover {
188
- border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
188
+ ${HOVER_MEDIA} {
189
+ &:hover {
190
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
191
+ }
189
192
  }
190
193
 
191
194
  &:active {
@@ -1,3 +1,4 @@
1
+ import { HOVER_MEDIA } from '../../constants';
1
2
  import { styled } from '../../styled';
2
3
  import { sidebarPopoverItemClassnames } from './constants';
3
4
  export const Item = styled.div `
@@ -14,8 +15,10 @@ export const Item = styled.div `
14
15
  });
15
16
  }};
16
17
 
17
- &:hover {
18
- background-color: ${({ theme }) => theme.palette.background.elementHover};
18
+ ${HOVER_MEDIA} {
19
+ &:hover {
20
+ background-color: ${({ theme }) => theme.palette.background.elementHover};
21
+ }
19
22
  }
20
23
 
21
24
  &:active {
@@ -1,4 +1,5 @@
1
1
  import { ChevronROutlineMd } from '../../../icons/ChevronROutlineMd';
2
+ import { HOVER_MEDIA } from '../../constants';
2
3
  import { IconButton } from '../../IconButton';
3
4
  import { styled } from '../../styled';
4
5
  import { Typography } from '../../Typography';
@@ -177,15 +178,17 @@ export const ContentWrapper = styled.div `
177
178
  background-color: ${({ theme }) => theme.palette.primary[100]};
178
179
  }
179
180
 
180
- &:hover {
181
- background-color: ${({ theme }) => theme.palette.background.elementHover};
181
+ ${HOVER_MEDIA} {
182
+ &:hover {
183
+ background-color: ${({ theme }) => theme.palette.background.elementHover};
182
184
 
183
- &.${dataGridRowContentClassnames.active} {
184
- background-color: ${({ theme }) => theme.palette.primary[100]};
185
- }
185
+ &.${dataGridRowContentClassnames.active} {
186
+ background-color: ${({ theme }) => theme.palette.primary[100]};
187
+ }
186
188
 
187
- &.${dataGridRowContentClassnames.hovered} {
188
- cursor: pointer;
189
+ &.${dataGridRowContentClassnames.hovered} {
190
+ cursor: pointer;
191
+ }
189
192
  }
190
193
  }
191
194
 
@@ -204,16 +207,6 @@ export const ContentWrapper = styled.div `
204
207
  &.${dataGridRowContentClassnames.active} {
205
208
  background-color: transparent;
206
209
  }
207
-
208
- &:hover, &.${dataGridRowClassnames.hover} {
209
- cursor: initial;
210
-
211
- background-color: transparent;
212
-
213
- &.${dataGridRowContentClassnames.active} {
214
- background-color: transparent;
215
- }
216
- }
217
210
  }
218
211
  `;
219
212
  export const CellStyled = styled(Cell) `
@@ -246,8 +239,10 @@ export const CollapseButton = styled(IconButton) `
246
239
 
247
240
  color: inherit;
248
241
 
249
- &:hover {
250
- background-color: ${({ theme }) => theme.palette.grey[300]};
242
+ ${HOVER_MEDIA} {
243
+ &:hover {
244
+ background-color: ${({ theme }) => theme.palette.grey[300]};
245
+ }
251
246
  }
252
247
  `;
253
248
  export const ChevronIcon = styled(ChevronROutlineMd, {
@@ -1,3 +1,4 @@
1
+ import { HOVER_MEDIA } from '../../constants';
1
2
  import { styled } from '../../styled';
2
3
  import { ROOT_ACTION_CELL_WIDTH } from '../constants';
3
4
  import { dataGridRowBaseClassnames } from './constants';
@@ -50,15 +51,17 @@ export const ContentWrapper = styled.div `
50
51
  background-color: ${({ theme }) => theme.palette.primary[100]};
51
52
  }
52
53
 
53
- &:hover {
54
- background-color: ${({ theme }) => theme.palette.background.elementHover};
54
+ ${HOVER_MEDIA} {
55
+ &:hover {
56
+ background-color: ${({ theme }) => theme.palette.background.elementHover};
55
57
 
56
- &.${dataGridRowBaseClassnames.active} {
57
- background-color: ${({ theme }) => theme.palette.primary[100]};
58
- }
58
+ &.${dataGridRowBaseClassnames.active} {
59
+ background-color: ${({ theme }) => theme.palette.primary[100]};
60
+ }
59
61
 
60
- &.${dataGridRowBaseClassnames.hovered} {
61
- cursor: pointer;
62
+ &.${dataGridRowBaseClassnames.hovered} {
63
+ cursor: pointer;
64
+ }
62
65
  }
63
66
  }
64
67
 
@@ -68,16 +71,6 @@ export const ContentWrapper = styled.div `
68
71
  &.${dataGridRowBaseClassnames.active} {
69
72
  background-color: transparent;
70
73
  }
71
-
72
- &:hover, &.${dataGridRowBaseClassnames.hovered} {
73
- cursor: initial;
74
-
75
- background-color: transparent;
76
-
77
- &.${dataGridRowBaseClassnames.active} {
78
- background-color: transparent;
79
- }
80
- }
81
74
  }
82
75
  `;
83
76
  export const BottomDrawerContent = styled.div `
@@ -1,5 +1,6 @@
1
1
  import { ChevronROutlineMd } from '../../icons/ChevronROutlineMd';
2
2
  import { buttonClassnames } from '../Button';
3
+ import { HOVER_MEDIA } from '../constants';
3
4
  import { ROOT_ACTION_CELL_WIDTH } from '../DataGrid/constants';
4
5
  import { dataGridRowBaseClassnames, RowBase } from '../DataGrid/RowBase';
5
6
  import { IconButton } from '../IconButton';
@@ -44,8 +45,10 @@ export const CollapseButton = styled(IconButton) `
44
45
 
45
46
  color: inherit;
46
47
 
47
- &:hover {
48
- background-color: ${({ theme }) => theme.palette.grey[300]};
48
+ ${HOVER_MEDIA} {
49
+ &:hover {
50
+ background-color: ${({ theme }) => theme.palette.grey[300]};
51
+ }
49
52
  }
50
53
  `;
51
54
  export const CollapseCell = styled.div `
@@ -1,4 +1,5 @@
1
1
  import { CopyTypography } from '../../CopyTypography';
2
+ import { HOVER_MEDIA } from '../../constants';
2
3
  import { styled } from '../../styled';
3
4
  import { Typography } from '../../Typography';
4
5
  export const StyledTypography = styled(Typography, {
@@ -16,8 +17,10 @@ export const StyledTypography = styled(Typography, {
16
17
  text-align: ${({ $direction }) => $direction !== 'row' ? 'left' : 'right'};
17
18
  }
18
19
 
19
- &:hover {
20
- text-decoration: ${({ $canCopy }) => ($canCopy ? 'underline' : 'none')};
20
+ ${HOVER_MEDIA} {
21
+ &:hover {
22
+ text-decoration: ${({ $canCopy }) => ($canCopy ? 'underline' : 'none')};
23
+ }
21
24
  }
22
25
  `;
23
26
  export const StyledCopyTypography = styled(CopyTypography, {
@@ -1,2 +1,2 @@
1
1
  import type { DialogProps } from './types';
2
- export declare const Dialog: ({ children, title, disableBackdropClick, onClose, size, headerContent, className, classes, ...props }: DialogProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Dialog: ({ children, title, disableBackdropClick, onClose, size, headerContent, className, classes, disableMobileDrawer, ...props }: DialogProps) => import("react/jsx-runtime").JSX.Element;
@@ -13,14 +13,15 @@ const dialogCva = cva(dialogClassnames.root, {
13
13
  },
14
14
  },
15
15
  });
16
- export const Dialog = ({ children, title, disableBackdropClick, onClose, size = 'md', headerContent, className, classes, ...props }) => {
17
- const { handleClose, isMobile, dialogClasses } = useLogic({
16
+ export const Dialog = ({ children, title, disableBackdropClick, onClose, size = 'md', headerContent, className, classes, disableMobileDrawer, ...props }) => {
17
+ const { handleClose, shouldRenderDrawer, dialogClasses } = useLogic({
18
18
  onClose,
19
19
  disableBackdropClick,
20
20
  classes,
21
+ disableMobileDrawer,
21
22
  });
22
- if (isMobile) {
23
- return (_jsx(BottomDrawer, { onClose: handleClose, title: title, headerContent: headerContent, ...props, children: children }));
23
+ if (shouldRenderDrawer) {
24
+ return (_jsx(BottomDrawer, { onClose: handleClose, title: title, headerContent: headerContent, className: className, ...props, children: children }));
24
25
  }
25
26
  return (_jsxs(StyledDialog, { "$size": size, onClose: handleClose, className: cn(dialogCva({ withoutTitle: !title }), className), classes: dialogClasses, ...props, children: [title && (_jsx(DialogTitle, { onClose: onClose, headerContent: headerContent, children: title })), children] }));
26
27
  };
@@ -28,6 +28,14 @@ export const StyledDialog = styled(MuiDialog, {
28
28
  box-shadow: ${({ theme }) => theme.elevation[300]};
29
29
  }
30
30
 
31
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
32
+ .${dialogClassnames.paper} {
33
+ width: calc(100% - ${({ theme }) => theme.spacing(8)});
34
+ min-width: auto;
35
+ margin: ${({ theme }) => theme.spacing(4)};
36
+ }
37
+ }
38
+
31
39
  /* Причина игнора: Не критично для отображения */
32
40
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
33
41
  &:not(:has(.${dialogActionsClassnames.root})) .${dialogContentClassnames.root} {
@@ -20,4 +20,9 @@ export type DialogProps = WithoutEmotionSpecific<Omit<MuiDialogProps, 'title' |
20
20
  * Дополнительный контент хедера
21
21
  */
22
22
  headerContent?: ReactNode;
23
+ /**
24
+ * Отключить BottomDrawer на mobile: диалог остаётся центрированным модальным окном.
25
+ * @default false
26
+ */
27
+ disableMobileDrawer?: boolean;
23
28
  };
@@ -1,9 +1,9 @@
1
1
  import { type MouseEvent } from 'react';
2
2
  import { type DialogProps } from '../types';
3
- type UseLogicParams = Pick<DialogProps, 'onClose' | 'disableBackdropClick' | 'classes'>;
4
- export declare const useLogic: ({ onClose, disableBackdropClick, classes, }: UseLogicParams) => {
3
+ type UseLogicParams = Pick<DialogProps, 'onClose' | 'disableBackdropClick' | 'classes' | 'disableMobileDrawer'>;
4
+ export declare const useLogic: ({ onClose, disableBackdropClick, classes, disableMobileDrawer, }: UseLogicParams) => {
5
5
  handleClose: ((event: MouseEvent<HTMLButtonElement>, reason: 'backdropClick' | 'escapeKeyDown') => void) | undefined;
6
- isMobile: boolean;
6
+ shouldRenderDrawer: boolean;
7
7
  dialogClasses: {
8
8
  root?: string | undefined;
9
9
  scrollPaper?: string | undefined;
@@ -1,7 +1,7 @@
1
1
  import { useViewportType } from '../../useViewportType';
2
2
  import { cn } from '../../utils/cn';
3
3
  import { dialogClassnames } from '../constants';
4
- export const useLogic = ({ onClose, disableBackdropClick, classes, }) => {
4
+ export const useLogic = ({ onClose, disableBackdropClick, classes, disableMobileDrawer, }) => {
5
5
  const { isMobile } = useViewportType();
6
6
  const handleClose = onClose &&
7
7
  ((event, reason) => {
@@ -15,5 +15,9 @@ export const useLogic = ({ onClose, disableBackdropClick, classes, }) => {
15
15
  paper: cn(dialogClassnames.paper, paper),
16
16
  ...restClasses,
17
17
  };
18
- return { handleClose, isMobile, dialogClasses };
18
+ return {
19
+ handleClose,
20
+ shouldRenderDrawer: isMobile && !disableMobileDrawer,
21
+ dialogClasses,
22
+ };
19
23
  };
@@ -1,4 +1,5 @@
1
1
  import { Chevron } from '../../Chevron';
2
+ import { HOVER_MEDIA } from '../../constants';
2
3
  import { styled } from '../../styled';
3
4
  const getBackgroundColor = (theme, isDisabled, isSelected) => {
4
5
  if (isDisabled) {
@@ -28,8 +29,10 @@ export const Wrapper = styled('summary', {
28
29
  duration: theme.transitions.duration.standard,
29
30
  })};
30
31
 
31
- &:hover {
32
- background-color: ${({ theme }) => theme.palette.background.elementHover};
32
+ ${HOVER_MEDIA} {
33
+ &:hover {
34
+ background-color: ${({ theme }) => theme.palette.background.elementHover};
35
+ }
33
36
  }
34
37
 
35
38
  &:focus-visible {
@@ -1,5 +1,6 @@
1
1
  import { buttonBaseClasses } from '@mui/material/ButtonBase';
2
2
  import Fab from '@mui/material/Fab';
3
+ import { HOVER_MEDIA, HOVER_NONE_MEDIA } from '../constants';
3
4
  import { styled } from '../styled';
4
5
  import { FabColors, FabSizes, FabStates } from './enums';
5
6
  const getBgColor = ({ theme, color, fabState, }) => {
@@ -70,10 +71,18 @@ export const StyledFab = styled(Fab, {
70
71
  border-radius: ${({ theme, isSquare }) => isSquare ? theme.shape.medium : '50%'};
71
72
  box-shadow: ${({ theme }) => theme.elevation[200]};
72
73
 
73
- :hover {
74
- color: ${(props) => getColor({ ...props })};
74
+ ${HOVER_MEDIA} {
75
+ :hover {
76
+ color: ${(props) => getColor({ ...props })};
75
77
 
76
- background: ${(props) => getBgColor({ ...props, fabState: FabStates.Hover })};
78
+ background: ${(props) => getBgColor({ ...props, fabState: FabStates.Hover })};
79
+ }
80
+ }
81
+
82
+ ${HOVER_NONE_MEDIA} {
83
+ &:hover {
84
+ background-color: ${(props) => getBgColor({ ...props, fabState: FabStates.Default })};
85
+ }
77
86
  }
78
87
 
79
88
  :active {
@@ -22,7 +22,8 @@ export const Body = styled.div `
22
22
  display: flex;
23
23
  flex-direction: column;
24
24
 
25
- width: min(400px, calc(100vw - ${({ theme }) => theme.spacing(8)}));
25
+ /* Отступ popover от края вьюпорта — иначе поля по краям разъедутся. */
26
+ width: min(400px, calc(100vw - var(--popover-viewport-padding, 16px) * 2));
26
27
  padding: ${({ theme }) => theme.spacing(6)};
27
28
 
28
29
  ${({ theme }) => theme.breakpoints.down('mobile')} {
@@ -1,3 +1,4 @@
1
+ import { HOVER_MEDIA } from '../constants';
1
2
  import { styled } from '../styled';
2
3
  import { infiniteDataListClassnames } from './constants';
3
4
  export const Item = styled.li `
@@ -15,8 +16,10 @@ export const Item = styled.li `
15
16
  duration: theme.transitions.duration.shortest,
16
17
  })};
17
18
 
18
- &:hover {
19
- background-color: ${({ theme }) => theme.palette.background.element};
19
+ ${HOVER_MEDIA} {
20
+ &:hover {
21
+ background-color: ${({ theme }) => theme.palette.background.element};
22
+ }
20
23
  }
21
24
 
22
25
  ${({ theme }) => theme.breakpoints.down('mobile')} {
@@ -1,3 +1,4 @@
1
+ import { HOVER_MEDIA } from '../../constants';
1
2
  import { styled } from '../../styled';
2
3
  import { infiniteTreeListItemClassnames } from './constants';
3
4
  export const Wrapper = styled.div `
@@ -18,8 +19,10 @@ export const Wrapper = styled.div `
18
19
  duration: theme.transitions.duration.shortest,
19
20
  })};
20
21
 
21
- &:hover {
22
- background-color: ${({ theme }) => theme.palette.background.elementHover};
22
+ ${HOVER_MEDIA} {
23
+ &:hover {
24
+ background-color: ${({ theme }) => theme.palette.background.elementHover};
25
+ }
23
26
  }
24
27
 
25
28
  &.${infiniteTreeListItemClassnames.hasNested} {