@astral/ui 4.101.0 → 4.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Alert/styles.js +12 -2
- package/components/Autocomplete/styles.js +5 -2
- package/components/Breadcrumbs/styles.js +18 -13
- package/components/CheckableTag/styles.js +6 -3
- package/components/Checkbox/styles.js +10 -7
- package/components/Chip/styles.js +11 -6
- package/components/CodeField/styles.js +5 -2
- package/components/CopyTypography/styles.js +19 -5
- package/components/DashboardLayout/Header/styles.js +5 -2
- package/components/DashboardSidebarPopover/SidebarPopoverItem/styles.js +5 -2
- package/components/DataGrid/Row/styles.js +14 -19
- package/components/DataGrid/RowBase/styles.js +10 -17
- package/components/DataGridCollapsibleRow/styles.js +5 -2
- package/components/Description/Value/styles.js +5 -2
- package/components/ExpansionPanel/Summary/styles.js +5 -2
- package/components/Fab/styles.js +12 -3
- package/components/InfiniteDataList/styles.js +5 -2
- package/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +5 -2
- package/components/InputGroup/styles.js +8 -5
- package/components/JsonViewer/JsonNode/styles.js +5 -2
- package/components/Link/styles.js +11 -6
- package/components/ListItem/styles.js +5 -2
- package/components/MenuOrganization/OrganizationButton/styles.js +5 -6
- package/components/NavMenu/Item/ItemButton/styles.js +14 -7
- package/components/NewStepper/Step/styles.js +18 -15
- package/components/Notification/NotificationStackContainer/styles.js +5 -2
- package/components/PageAsideNavigation/PageAsideNavigationItem/styles.js +5 -6
- package/components/PageHeader/MobilePageActions/styles.js +0 -4
- package/components/Radio/styles.js +7 -4
- package/components/RadioCard/styles.js +5 -2
- package/components/StaticCalendar/StaticCalendarGridButton/styles.js +8 -5
- package/components/Tabs/Tab/styles.js +5 -2
- package/components/ToggleButton/styles.js +25 -10
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.js +3 -3
- package/components/Tree/TreeItem/styles.js +23 -10
- package/components/constants/index.d.ts +1 -0
- package/components/constants/index.js +1 -0
- package/components/constants/media.d.ts +8 -0
- package/components/constants/media.js +8 -0
- package/components/theme/components/MuiButton.js +46 -23
- package/components/theme/components/MuiListItemButton.js +10 -2
- package/components/theme/components/MuiMenuItem.js +5 -2
- package/components/theme/components/MuiOutlinedInput.js +15 -12
- package/components/theme/components/MuiSwitch.js +14 -9
- package/components/theme/components/MuiTableRow.js +11 -3
- package/node/components/Alert/styles.js +24 -14
- package/node/components/Autocomplete/styles.js +8 -5
- package/node/components/Breadcrumbs/styles.js +18 -13
- package/node/components/CheckableTag/styles.js +6 -3
- package/node/components/Checkbox/styles.js +26 -23
- package/node/components/Chip/styles.js +36 -31
- package/node/components/CodeField/styles.js +5 -2
- package/node/components/CopyTypography/styles.js +22 -8
- package/node/components/DashboardLayout/Header/styles.js +35 -32
- package/node/components/DashboardSidebarPopover/SidebarPopoverItem/styles.js +7 -4
- package/node/components/DataGrid/Row/styles.js +41 -46
- package/node/components/DataGrid/RowBase/styles.js +16 -23
- package/node/components/DataGridCollapsibleRow/styles.js +11 -8
- package/node/components/Description/Value/styles.js +5 -2
- package/node/components/ExpansionPanel/Summary/styles.js +5 -2
- package/node/components/Fab/styles.js +12 -3
- package/node/components/InfiniteDataList/styles.js +7 -4
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +11 -8
- package/node/components/InputGroup/styles.js +8 -5
- package/node/components/JsonViewer/JsonNode/styles.js +5 -2
- package/node/components/Link/styles.js +13 -8
- package/node/components/ListItem/styles.js +10 -7
- package/node/components/MenuOrganization/OrganizationButton/styles.js +5 -6
- package/node/components/NavMenu/Item/ItemButton/styles.js +16 -9
- package/node/components/NewStepper/Step/styles.js +68 -65
- package/node/components/Notification/NotificationStackContainer/styles.js +57 -54
- package/node/components/PageAsideNavigation/PageAsideNavigationItem/styles.js +12 -13
- package/node/components/PageHeader/MobilePageActions/styles.js +0 -4
- package/node/components/Radio/styles.js +20 -17
- package/node/components/RadioCard/styles.js +7 -4
- package/node/components/StaticCalendar/StaticCalendarGridButton/styles.js +8 -5
- package/node/components/Tabs/Tab/styles.js +5 -2
- package/node/components/ToggleButton/styles.js +27 -12
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.js +3 -3
- package/node/components/Tree/TreeItem/styles.js +44 -31
- package/node/components/constants/index.d.ts +1 -0
- package/node/components/constants/index.js +1 -0
- package/node/components/constants/media.d.ts +8 -0
- package/node/components/constants/media.js +11 -0
- package/node/components/theme/components/MuiButton.js +46 -23
- package/node/components/theme/components/MuiListItemButton.js +10 -2
- package/node/components/theme/components/MuiMenuItem.js +5 -2
- package/node/components/theme/components/MuiOutlinedInput.js +15 -12
- package/node/components/theme/components/MuiSwitch.js +14 -9
- package/node/components/theme/components/MuiTableRow.js +11 -3
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Button } from '../../Button';
|
|
2
2
|
import { Chevron } from '../../Chevron';
|
|
3
|
+
import { HOVER_MEDIA } from '../../constants';
|
|
3
4
|
import { styled } from '../../styled/styled';
|
|
4
5
|
import { Typography } from '../../Typography';
|
|
5
6
|
export const StyledButton = styled(Button) `
|
|
@@ -13,8 +14,10 @@ export const StyledButton = styled(Button) `
|
|
|
13
14
|
|
|
14
15
|
text-align: left;
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
${HOVER_MEDIA} {
|
|
18
|
+
&:hover {
|
|
19
|
+
background-color: ${({ theme }) => theme.palette.background.elementHover};
|
|
20
|
+
}
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
&:active {
|
|
@@ -32,10 +35,6 @@ export const StyledButton = styled(Button) `
|
|
|
32
35
|
|
|
33
36
|
border-radius: 0;
|
|
34
37
|
|
|
35
|
-
&:hover {
|
|
36
|
-
background-color: initial;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
38
|
&:active {
|
|
40
39
|
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
41
40
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { listItemButtonClasses } from '@mui/material/ListItemButton';
|
|
2
2
|
import { ChevronDOutlineMd } from '../../../../icons/ChevronDOutlineMd';
|
|
3
3
|
import { PageDotOutlineMd } from '../../../../icons/PageDotOutlineMd';
|
|
4
|
+
import { HOVER_MEDIA } from '../../../constants';
|
|
4
5
|
import { ListItemButton } from '../../../ListItemButton';
|
|
5
6
|
import { ListItemIcon } from '../../../ListItemIcon';
|
|
6
7
|
import { OverflowTypography } from '../../../OverflowTypography';
|
|
@@ -33,23 +34,29 @@ export const StyledListItemButton = styled(ListItemButton) `
|
|
|
33
34
|
border-left: 3px solid ${({ theme }) => theme.palette.primary[800]};
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
${HOVER_MEDIA} {
|
|
38
|
+
&:hover {
|
|
39
|
+
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
40
|
+
}
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
&.${navMenuItemButtonClassnames.hasGroup} {
|
|
41
44
|
background-color: inherit;
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
${HOVER_MEDIA} {
|
|
47
|
+
&:hover {
|
|
48
|
+
background-color: inherit;
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
${HOVER_MEDIA} {
|
|
55
|
+
&:hover {
|
|
56
|
+
color: ${({ theme }) => theme.palette.primary['800']};
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
background-color: inherit;
|
|
59
|
+
}
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
&:active {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NextOutlineMd } from '../../../icons/NextOutlineMd';
|
|
2
2
|
import { Button } from '../../Button';
|
|
3
|
+
import { HOVER_MEDIA } from '../../constants';
|
|
3
4
|
import { styled } from '../../styled';
|
|
4
5
|
import { typographyClassnames } from '../../Typography/constants';
|
|
5
6
|
import { STEPPER_ORDER_COUNTER_NAME } from '../constants';
|
|
@@ -271,26 +272,28 @@ export const StyledButton = styled(Button) `
|
|
|
271
272
|
height: auto;
|
|
272
273
|
}
|
|
273
274
|
|
|
274
|
-
|
|
275
|
-
|
|
275
|
+
${HOVER_MEDIA} {
|
|
276
|
+
&:hover {
|
|
277
|
+
background: transparent;
|
|
276
278
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
279
|
+
& .${stepClassnames.label} {
|
|
280
|
+
color: ${({ theme }) => theme.palette.grey[700]};
|
|
281
|
+
}
|
|
280
282
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
+
& .${stepIconClassnames.root} {
|
|
284
|
+
color: ${({ theme }) => theme.palette.primary[700]};
|
|
283
285
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
286
|
+
&.${stepIconClassnames.success} {
|
|
287
|
+
color: ${({ theme }) => theme.palette.success[700]};
|
|
288
|
+
}
|
|
287
289
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
290
|
+
&.${stepIconClassnames.error} {
|
|
291
|
+
color: ${({ theme }) => theme.palette.error[700]};
|
|
292
|
+
}
|
|
291
293
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
+
&.${stepIconClassnames.warning} {
|
|
295
|
+
color: ${({ theme }) => theme.palette.warning[700]};
|
|
296
|
+
}
|
|
294
297
|
}
|
|
295
298
|
}
|
|
296
299
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ToastContainer } from 'react-toastify-next';
|
|
2
2
|
import { Button } from '../../Button';
|
|
3
|
+
import { HOVER_MEDIA } from '../../constants';
|
|
3
4
|
import { keyframes, styled } from '../../styled';
|
|
4
5
|
import { NOTIFY_HEIGHT, NOTIFY_HEIGHT_MOBILE, NOTIFY_NO_TRANSITION_ATTR, NotificationVariantTypes, notifyClassnames, } from '../constants';
|
|
5
6
|
const fade = keyframes `
|
|
@@ -485,8 +486,10 @@ export const CloseButton = styled(Button) `
|
|
|
485
486
|
|
|
486
487
|
animation: ${fade} 500ms linear;
|
|
487
488
|
|
|
488
|
-
|
|
489
|
-
|
|
489
|
+
${HOVER_MEDIA} {
|
|
490
|
+
&:hover {
|
|
491
|
+
box-shadow: ${({ theme }) => theme.elevation[300]};
|
|
492
|
+
}
|
|
490
493
|
}
|
|
491
494
|
|
|
492
495
|
&.${notifyClassnames.closeButtonAnimationOut} {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HOVER_MEDIA } from '../../constants';
|
|
1
2
|
import { svgIconClassnames } from '../../SvgIcon/constants';
|
|
2
3
|
import { styled } from '../../styled';
|
|
3
4
|
import { pageAsideNavigationItemClassnames } from './constants';
|
|
@@ -33,8 +34,10 @@ export const Wrapper = styled.li `
|
|
|
33
34
|
color: ${({ theme }) => theme.palette.grey[800]};
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
${HOVER_MEDIA} {
|
|
38
|
+
&:hover {
|
|
39
|
+
color: ${({ theme }) => theme.palette.primary[800]};
|
|
40
|
+
}
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
&:active {
|
|
@@ -73,10 +76,6 @@ export const Wrapper = styled.li `
|
|
|
73
76
|
transition: ${({ theme }) => theme.transitions.create(['border-color', 'background-color'], {
|
|
74
77
|
duration: theme.transitions.duration.shortest,
|
|
75
78
|
})};
|
|
76
|
-
|
|
77
|
-
&:hover {
|
|
78
|
-
color: ${({ theme }) => theme.palette.grey[800]};
|
|
79
|
-
}
|
|
80
79
|
|
|
81
80
|
&:active {
|
|
82
81
|
color: ${({ theme }) => theme.palette.grey[800]};
|
|
@@ -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 { MOBILE_RADIO_SIZE, RADIO_SIZE, radioClassnames } from './constants';
|
|
@@ -58,22 +59,24 @@ export const Wrapper = styled('span', {
|
|
|
58
59
|
${easeOutBackTransition};
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
${HOVER_MEDIA} {
|
|
63
|
+
&:hover {
|
|
64
|
+
.${radioClassnames.outerCircle} {
|
|
65
|
+
fill: ${({ theme, $isDisabled, $isError, $isChecked }) => getFillColor({
|
|
64
66
|
theme,
|
|
65
67
|
isHover: true,
|
|
66
68
|
isDisabled: $isDisabled,
|
|
67
69
|
isError: $isError,
|
|
68
70
|
isChecked: $isChecked,
|
|
69
71
|
})};
|
|
70
|
-
|
|
72
|
+
stroke: ${({ theme, $isDisabled, $isError, $isChecked }) => getOutlineColor({
|
|
71
73
|
theme,
|
|
72
74
|
isHover: true,
|
|
73
75
|
isDisabled: $isDisabled,
|
|
74
76
|
isError: $isError,
|
|
75
77
|
isChecked: $isChecked,
|
|
76
78
|
})};
|
|
79
|
+
}
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
82
|
`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HOVER_MEDIA } from '../constants';
|
|
1
2
|
import { Radio, radioClassnames } from '../Radio';
|
|
2
3
|
import { styled } from '../styled';
|
|
3
4
|
import { radioCardClassnames } from './constants';
|
|
@@ -63,10 +64,12 @@ export const Wrapper = styled.label `
|
|
|
63
64
|
cursor: default;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
${HOVER_MEDIA} {
|
|
68
|
+
&:hover {
|
|
69
|
+
background-color: ${({ theme, $isDisabled }) => $isDisabled
|
|
68
70
|
? theme.palette.background.element
|
|
69
71
|
: theme.palette.background.elementHover};
|
|
72
|
+
}
|
|
70
73
|
}
|
|
71
74
|
`;
|
|
72
75
|
export const Content = styled.div `
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buttonClasses } from '@mui/material/Button';
|
|
2
|
+
import { HOVER_MEDIA } from '../../constants';
|
|
2
3
|
import { styled } from '../../styled';
|
|
3
4
|
import { StaticCalendarButton } from '../StaticCalendarButton';
|
|
4
5
|
import { getBgColor, getLeftBorderRadius, getRightBorderRadius, getTextColor, } from './utils';
|
|
@@ -53,11 +54,13 @@ export const StaticCalendarGridButton = styled(StaticCalendarButton, {
|
|
|
53
54
|
background-color: currentColor;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
${HOVER_MEDIA} {
|
|
58
|
+
&:hover {
|
|
59
|
+
border-radius: ${(props) => getLeftBorderRadius({ isHovered: true, ...props })}
|
|
60
|
+
${(props) => getRightBorderRadius({ isHovered: true, ...props })}
|
|
61
|
+
${(props) => getRightBorderRadius({ isHovered: true, ...props })}
|
|
62
|
+
${(props) => getLeftBorderRadius({ isHovered: true, ...props })};
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
&,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Tab from '@mui/material/Tab';
|
|
2
|
+
import { HOVER_MEDIA } from '../../constants';
|
|
2
3
|
import { styled } from '../../styled';
|
|
3
4
|
export const StyledTab = styled(Tab) `
|
|
4
5
|
min-height: 36px;
|
|
@@ -13,8 +14,10 @@ export const StyledTab = styled(Tab) `
|
|
|
13
14
|
margin-right: 0;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
${HOVER_MEDIA} {
|
|
18
|
+
&:hover {
|
|
19
|
+
color: ${({ theme }) => theme.palette.primary[800]};
|
|
20
|
+
}
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
&:active {
|
|
@@ -2,6 +2,7 @@ import { buttonBaseClasses } from '@mui/material/ButtonBase';
|
|
|
2
2
|
import MuiToggleButton, { toggleButtonClasses, } from '@mui/material/ToggleButton';
|
|
3
3
|
import { toggleButtonGroupClasses } from '@mui/material/ToggleButtonGroup';
|
|
4
4
|
import { buttonClasses } from '../Button';
|
|
5
|
+
import { HOVER_MEDIA, HOVER_NONE_MEDIA } from '../constants';
|
|
5
6
|
import { css, styled } from '../styled';
|
|
6
7
|
import { SIZES } from './constants';
|
|
7
8
|
const getSize = (size) => {
|
|
@@ -64,23 +65,33 @@ export const StyledToggleButton = styled(MuiToggleButton, {
|
|
|
64
65
|
|
|
65
66
|
${({ theme, $color, disabled, $variant }) => toggleButtonColorStyle({ theme, color: $color, disabled, variant: $variant })}
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
${HOVER_MEDIA} {
|
|
69
|
+
&:hover {
|
|
70
|
+
${({ theme, $color, disabled }) => toggleButtonColorStyle({ theme, color: $color, disabled, state: 'hover' })};
|
|
71
|
+
}
|
|
69
72
|
}
|
|
70
|
-
|
|
73
|
+
|
|
71
74
|
&:active {
|
|
72
75
|
z-index: 3;
|
|
73
76
|
|
|
74
77
|
${({ theme, $color, disabled }) => toggleButtonColorStyle({ theme, color: $color, disabled, state: 'active' })};
|
|
75
78
|
}
|
|
76
|
-
|
|
79
|
+
|
|
77
80
|
&.${toggleButtonClasses.selected} {
|
|
78
81
|
z-index: 2;
|
|
79
82
|
|
|
80
83
|
${({ theme, $color, disabled }) => toggleButtonColorStyle({ theme, color: $color, disabled, selected: true })}
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
${HOVER_MEDIA} {
|
|
86
|
+
&:hover {
|
|
87
|
+
${({ theme, $color, disabled }) => toggleButtonColorStyle({ theme, color: $color, selected: true, disabled, state: 'hover' })};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
${HOVER_NONE_MEDIA} {
|
|
92
|
+
&:hover {
|
|
93
|
+
${({ theme, $color, disabled }) => toggleButtonColorStyle({ theme, color: $color, selected: true, disabled, state: 'default' })};
|
|
94
|
+
}
|
|
84
95
|
}
|
|
85
96
|
|
|
86
97
|
&:active {
|
|
@@ -97,8 +108,10 @@ export const StyledToggleButton = styled(MuiToggleButton, {
|
|
|
97
108
|
&.${buttonBaseClasses.root}.${toggleButtonGroupClasses.grouped}:not(:first-of-type) {
|
|
98
109
|
border-left-color: ${({ theme, $color }) => getBorderColor({ theme, color: $color })};
|
|
99
110
|
|
|
100
|
-
|
|
101
|
-
|
|
111
|
+
${HOVER_MEDIA} {
|
|
112
|
+
&:hover {
|
|
113
|
+
border-left-color: ${({ theme, $color }) => getBorderColor({ theme, color: $color, state: 'hover' })};
|
|
114
|
+
}
|
|
102
115
|
}
|
|
103
116
|
|
|
104
117
|
&:active {
|
|
@@ -108,13 +121,15 @@ export const StyledToggleButton = styled(MuiToggleButton, {
|
|
|
108
121
|
&.${toggleButtonClasses.selected} {
|
|
109
122
|
border-left-color: ${({ theme, $color }) => getBorderColor({ theme, color: $color, isSelected: true })};
|
|
110
123
|
|
|
111
|
-
|
|
112
|
-
|
|
124
|
+
${HOVER_MEDIA} {
|
|
125
|
+
&:hover {
|
|
126
|
+
border-left-color: ${({ theme, $color }) => getBorderColor({
|
|
113
127
|
theme,
|
|
114
128
|
color: $color,
|
|
115
129
|
isSelected: true,
|
|
116
130
|
state: 'hover',
|
|
117
131
|
})};
|
|
132
|
+
}
|
|
118
133
|
}
|
|
119
134
|
|
|
120
135
|
&:active {
|
|
@@ -106,10 +106,10 @@ export const BackButton = styled(IconButton) `
|
|
|
106
106
|
width: ${COLLAPSE_BUTTON_WIDTH};
|
|
107
107
|
height: ${COLLAPSE_BUTTON_WIDTH};
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
&:
|
|
109
|
+
|
|
110
|
+
&:active {
|
|
111
111
|
background-color: transparent;
|
|
112
|
-
}
|
|
112
|
+
}
|
|
113
113
|
}
|
|
114
114
|
`;
|
|
115
115
|
export const ParentContent = styled.div `
|
|
@@ -2,6 +2,7 @@ import { typographyClasses } from '@mui/material/Typography';
|
|
|
2
2
|
import { ChevronROutlineMd } from '../../../icons/ChevronROutlineMd';
|
|
3
3
|
import { buttonClasses } from '../../Button';
|
|
4
4
|
import { Collapse } from '../../Collapse';
|
|
5
|
+
import { HOVER_MEDIA } from '../../constants';
|
|
5
6
|
import { descriptionClassnames } from '../../Description';
|
|
6
7
|
import { IconButton } from '../../IconButton';
|
|
7
8
|
import { OverflowTypography } from '../../OverflowTypography';
|
|
@@ -66,14 +67,22 @@ export const ItemContent = styled('div') `
|
|
|
66
67
|
duration: theme.transitions.duration.shortest,
|
|
67
68
|
})};
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
${HOVER_MEDIA} {
|
|
71
|
+
&:hover {
|
|
72
|
+
background-color: ${({ theme }) => theme.palette.background.elementHover};
|
|
73
|
+
}
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
&.${treeClassnames.selected} {
|
|
74
77
|
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
75
78
|
|
|
76
|
-
|
|
79
|
+
${HOVER_MEDIA} {
|
|
80
|
+
&:hover {
|
|
81
|
+
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&:focus {
|
|
77
86
|
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
78
87
|
}
|
|
79
88
|
}
|
|
@@ -83,7 +92,13 @@ export const ItemContent = styled('div') `
|
|
|
83
92
|
|
|
84
93
|
color: ${({ theme }) => theme.palette.text.disabled};
|
|
85
94
|
|
|
86
|
-
|
|
95
|
+
${HOVER_MEDIA} {
|
|
96
|
+
&:hover {
|
|
97
|
+
background-color: transparent;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&:focus {
|
|
87
102
|
background-color: transparent;
|
|
88
103
|
}
|
|
89
104
|
}
|
|
@@ -137,8 +152,10 @@ export const CollapseButton = styled(IconButton) `
|
|
|
137
152
|
height: ${COLLAPSE_BUTTON_WIDTH};
|
|
138
153
|
}
|
|
139
154
|
|
|
140
|
-
|
|
141
|
-
|
|
155
|
+
${HOVER_MEDIA} {
|
|
156
|
+
&:hover {
|
|
157
|
+
background-color: ${({ theme }) => theme.palette.grey[300]};
|
|
158
|
+
}
|
|
142
159
|
}
|
|
143
160
|
|
|
144
161
|
&.${treeClassnames.open} .${svgIconClassnames.root} {
|
|
@@ -167,10 +184,6 @@ export const CollapseButton = styled(IconButton) `
|
|
|
167
184
|
width: ${MOBILE_COLLAPSE_BUTTON_WIDTH};
|
|
168
185
|
height: auto;
|
|
169
186
|
}
|
|
170
|
-
|
|
171
|
-
&:hover {
|
|
172
|
-
background-color: transparent;
|
|
173
|
-
}
|
|
174
187
|
}
|
|
175
188
|
`;
|
|
176
189
|
export const ChevronIcon = styled(ChevronROutlineMd) `
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Медиа-выражение проверяющее что устройство поддерживает hover и является точным указателем
|
|
3
|
+
*/
|
|
4
|
+
export declare const HOVER_MEDIA = "@media (hover: hover) and (pointer: fine)";
|
|
5
|
+
/**
|
|
6
|
+
* Медиа-выражение проверяющее что устройство не поддерживает hover
|
|
7
|
+
*/
|
|
8
|
+
export declare const HOVER_NONE_MEDIA = "@media (hover: none)";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Медиа-выражение проверяющее что устройство поддерживает hover и является точным указателем
|
|
3
|
+
*/
|
|
4
|
+
export const HOVER_MEDIA = '@media (hover: hover) and (pointer: fine)';
|
|
5
|
+
/**
|
|
6
|
+
* Медиа-выражение проверяющее что устройство не поддерживает hover
|
|
7
|
+
*/
|
|
8
|
+
export const HOVER_NONE_MEDIA = '@media (hover: none)';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { buttonClasses } from '@mui/material/Button';
|
|
2
2
|
import { ButtonSizes, ButtonStates, ButtonVariants, buttonClassnames, } from '../../Button';
|
|
3
|
+
import { HOVER_MEDIA, HOVER_NONE_MEDIA } from '../../constants';
|
|
3
4
|
import { svgIconClassnames } from '../../SvgIcon';
|
|
4
5
|
/**
|
|
5
6
|
* Вспомогательная утилита для получения значения из values
|
|
@@ -366,29 +367,51 @@ export const MuiButton = {
|
|
|
366
367
|
buttonState: ButtonStates.Default,
|
|
367
368
|
}),
|
|
368
369
|
borderRadius: theme.shape.medium,
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
370
|
+
// Переопределяем media наследованное от Mui
|
|
371
|
+
[HOVER_NONE_MEDIA]: {
|
|
372
|
+
'&:hover': {
|
|
373
|
+
backgroundColor: getButtonBackgroundColor({
|
|
374
|
+
selected,
|
|
375
|
+
color,
|
|
376
|
+
variant,
|
|
377
|
+
theme,
|
|
378
|
+
buttonState: ButtonStates.Default,
|
|
379
|
+
}),
|
|
380
|
+
boxShadow: 'unset',
|
|
381
|
+
border: getBorder({
|
|
382
|
+
theme,
|
|
383
|
+
variant,
|
|
384
|
+
color,
|
|
385
|
+
buttonState: ButtonStates.Default,
|
|
386
|
+
selected,
|
|
387
|
+
}),
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
[HOVER_MEDIA]: {
|
|
391
|
+
'&:hover': {
|
|
392
|
+
color: getButtonColor({
|
|
393
|
+
selected,
|
|
394
|
+
theme,
|
|
395
|
+
variant,
|
|
396
|
+
color,
|
|
397
|
+
buttonState: ButtonStates.Hover,
|
|
398
|
+
}),
|
|
399
|
+
backgroundColor: getButtonBackgroundColor({
|
|
400
|
+
selected,
|
|
401
|
+
color,
|
|
402
|
+
variant,
|
|
403
|
+
theme,
|
|
404
|
+
buttonState: ButtonStates.Hover,
|
|
405
|
+
}),
|
|
406
|
+
boxShadow: 'none',
|
|
407
|
+
border: getBorder({
|
|
408
|
+
theme,
|
|
409
|
+
variant,
|
|
410
|
+
color,
|
|
411
|
+
buttonState: ButtonStates.Hover,
|
|
412
|
+
selected,
|
|
413
|
+
}),
|
|
414
|
+
},
|
|
392
415
|
},
|
|
393
416
|
'&:active': {
|
|
394
417
|
color: getButtonColor({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HOVER_MEDIA, HOVER_NONE_MEDIA } from '../../constants';
|
|
1
2
|
export const MuiListItemButton = {
|
|
2
3
|
styleOverrides: {
|
|
3
4
|
root({ theme }) {
|
|
@@ -6,9 +7,16 @@ export const MuiListItemButton = {
|
|
|
6
7
|
'&.Mui-selected': {
|
|
7
8
|
color: theme.palette.primary[800],
|
|
8
9
|
backgroundColor: theme.palette.grey[200],
|
|
10
|
+
[HOVER_NONE_MEDIA]: {
|
|
11
|
+
'&:hover': {
|
|
12
|
+
backgroundColor: theme.palette.grey[200],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
9
15
|
},
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
[HOVER_MEDIA]: {
|
|
17
|
+
'&:hover': {
|
|
18
|
+
backgroundColor: theme.palette.background.elementHover,
|
|
19
|
+
},
|
|
12
20
|
},
|
|
13
21
|
};
|
|
14
22
|
},
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { menuItemClasses } from '@mui/material/MenuItem';
|
|
2
|
+
import { HOVER_MEDIA } from '../../constants';
|
|
2
3
|
export const MuiMenuItem = {
|
|
3
4
|
styleOverrides: {
|
|
4
5
|
root({ theme }) {
|
|
5
6
|
return {
|
|
6
7
|
padding: theme.spacing(2, 2, 2, 3),
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
[HOVER_MEDIA]: {
|
|
9
|
+
'&:hover': {
|
|
10
|
+
backgroundColor: theme.palette.background.elementHover,
|
|
11
|
+
},
|
|
9
12
|
},
|
|
10
13
|
[`&.${menuItemClasses.selected}`]: {
|
|
11
14
|
background: `linear-gradient(90deg, ${theme.palette.primary.main} 0, ${theme.palette.primary.main} 3px, ${theme.palette.primary['100']} 3px)`,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HOVER_MEDIA } from '../../constants';
|
|
1
2
|
export const MuiOutlinedInput = {
|
|
2
3
|
defaultProps: {
|
|
3
4
|
notched: false,
|
|
@@ -10,28 +11,30 @@ export const MuiOutlinedInput = {
|
|
|
10
11
|
color: theme.palette.grey[900],
|
|
11
12
|
background: theme.palette.background.element,
|
|
12
13
|
padding: theme.microSpacing(1, 0),
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
[HOVER_MEDIA]: {
|
|
15
|
+
'&:hover': {
|
|
16
|
+
background: theme.palette.background.elementHover,
|
|
17
|
+
},
|
|
18
|
+
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
19
|
+
borderColor: theme.palette.grey[800],
|
|
20
|
+
transition: theme.transitions.create(['border-color'], {
|
|
21
|
+
easing: theme.transitions.easing.easeIn,
|
|
22
|
+
duration: theme.transitions.duration.shortest,
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
25
|
+
'&.Mui-error:hover:not(.Mui-focused) .MuiOutlinedInput-notchedOutline': {
|
|
26
|
+
borderColor: theme.palette.error[900],
|
|
27
|
+
},
|
|
15
28
|
},
|
|
16
29
|
'&.Mui-disabled': {
|
|
17
30
|
backgroundColor: theme.palette.components.disabled,
|
|
18
31
|
},
|
|
19
|
-
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
20
|
-
borderColor: theme.palette.grey[800],
|
|
21
|
-
transition: theme.transitions.create(['border-color'], {
|
|
22
|
-
easing: theme.transitions.easing.easeIn,
|
|
23
|
-
duration: theme.transitions.duration.shortest,
|
|
24
|
-
}),
|
|
25
|
-
},
|
|
26
32
|
'&.Mui-disabled .MuiOutlinedInput-notchedOutline': {
|
|
27
33
|
border: 'none',
|
|
28
34
|
},
|
|
29
35
|
'&.Mui-error .MuiOutlinedInput-notchedOutline': {
|
|
30
36
|
borderColor: theme.palette.error.dark,
|
|
31
37
|
},
|
|
32
|
-
'&.Mui-error:hover:not(.Mui-focused) .MuiOutlinedInput-notchedOutline': {
|
|
33
|
-
borderColor: theme.palette.error[900],
|
|
34
|
-
},
|
|
35
38
|
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
|
|
36
39
|
borderColor: theme.palette.primary[700],
|
|
37
40
|
transition: 'none',
|