@selfcommunity/react-theme-default 1.2.3 → 1.2.4-alpha.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.
@@ -45,13 +45,21 @@ const Component = {
45
45
  transition: theme.transitions.create(['background-color', 'box-shadow'], {
46
46
  duration: theme.transitions.duration.short
47
47
  }),
48
- backgroundColor: selected ? theme.palette.grey[100] : theme.palette.background.paper,
48
+ backgroundColor: selected
49
+ ? (0, material_1.getContrastRatio)(theme.palette.background.paper, theme.palette.common.white) > 4.5
50
+ ? theme.palette.background.paper
51
+ : theme.palette.grey[100]
52
+ : theme.palette.background.paper,
49
53
  '&:hover': {
50
54
  backgroundColor: (0, material_1.getContrastRatio)(theme.palette.background.paper, theme.palette.common.white) > 4.5 ? undefined : theme.palette.grey[50],
51
55
  border: (0, material_1.getContrastRatio)(theme.palette.background.paper, theme.palette.common.white) > 4.5 ? `2px solid ${theme.palette.primary.main}` : undefined,
52
56
  boxShadow: theme.shadows[2]
53
57
  },
54
- border: `1px solid ${theme.palette.divider}`,
58
+ border: selected
59
+ ? (0, material_1.getContrastRatio)(theme.palette.background.paper, theme.palette.common.white) > 4.5
60
+ ? `2px solid ${theme.palette.primary.main}`
61
+ : `1px solid ${theme.palette.divider}`
62
+ : `1px solid ${theme.palette.divider}`,
55
63
  [`& > div`]: {
56
64
  display: 'flex',
57
65
  justifyContent: 'space-between',
@@ -43,13 +43,21 @@ const Component = {
43
43
  transition: theme.transitions.create(['background-color', 'box-shadow'], {
44
44
  duration: theme.transitions.duration.short
45
45
  }),
46
- backgroundColor: selected ? theme.palette.grey[100] : theme.palette.background.paper,
46
+ backgroundColor: selected
47
+ ? getContrastRatio(theme.palette.background.paper, theme.palette.common.white) > 4.5
48
+ ? theme.palette.background.paper
49
+ : theme.palette.grey[100]
50
+ : theme.palette.background.paper,
47
51
  '&:hover': {
48
52
  backgroundColor: getContrastRatio(theme.palette.background.paper, theme.palette.common.white) > 4.5 ? undefined : theme.palette.grey[50],
49
53
  border: getContrastRatio(theme.palette.background.paper, theme.palette.common.white) > 4.5 ? `2px solid ${theme.palette.primary.main}` : undefined,
50
54
  boxShadow: theme.shadows[2]
51
55
  },
52
- border: `1px solid ${theme.palette.divider}`,
56
+ border: selected
57
+ ? getContrastRatio(theme.palette.background.paper, theme.palette.common.white) > 4.5
58
+ ? `2px solid ${theme.palette.primary.main}`
59
+ : `1px solid ${theme.palette.divider}`
60
+ : `1px solid ${theme.palette.divider}`,
53
61
  [`& > div`]: {
54
62
  display: 'flex',
55
63
  justifyContent: 'space-between',