cozy-ui 97.0.0 → 97.1.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/CHANGELOG.md +13 -0
- package/package.json +1 -1
- package/react/Alert/Readme.md +11 -4
- package/react/Alert/index.jsx +8 -3
- package/react/MuiCozyTheme/helpers.js +30 -44
- package/react/MuiCozyTheme/makeInvertedOverrides.js +0 -13
- package/react/MuiCozyTheme/makeOverrides.js +6 -2
- package/react/MuiCozyTheme/makePalette.js +1 -0
- package/react/PointerAlert/Readme.md +143 -0
- package/react/PointerAlert/index.jsx +93 -0
- package/react/__snapshots__/examples.spec.jsx.snap +44 -44
- package/react/index.js +1 -0
- package/transpiled/react/Alert/index.js +6 -3
- package/transpiled/react/MuiCozyTheme/helpers.js +33 -38
- package/transpiled/react/MuiCozyTheme/makeInvertedOverrides.js +0 -13
- package/transpiled/react/MuiCozyTheme/makeOverrides.js +6 -2
- package/transpiled/react/MuiCozyTheme/makePalette.js +1 -0
- package/transpiled/react/PointerAlert/index.js +121 -0
- package/transpiled/react/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# [97.1.0](https://github.com/cozy/cozy-ui/compare/v97.0.0...v97.1.0) (2023-11-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **Alert:** Adjust colors ([29a3b80](https://github.com/cozy/cozy-ui/commit/29a3b80))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **MuiPalette:** Add `theme.palette.background.contrastOpacity` ([a09926b](https://github.com/cozy/cozy-ui/commit/a09926b))
|
|
12
|
+
* **PointerAlert:** Add this new component based on Alert ([9d73f68](https://github.com/cozy/cozy-ui/commit/9d73f68))
|
|
13
|
+
|
|
1
14
|
# [97.0.0](https://github.com/cozy/cozy-ui/compare/v96.2.0...v97.0.0) (2023-11-28)
|
|
2
15
|
|
|
3
16
|
|
package/package.json
CHANGED
package/react/Alert/Readme.md
CHANGED
|
@@ -17,6 +17,7 @@ const initialVariants = [{
|
|
|
17
17
|
square: false,
|
|
18
18
|
actionOne: false,
|
|
19
19
|
actionTwo: false,
|
|
20
|
+
filled: false,
|
|
20
21
|
close: false
|
|
21
22
|
}]
|
|
22
23
|
|
|
@@ -26,6 +27,7 @@ const initialVariants = [{
|
|
|
26
27
|
{variant => (
|
|
27
28
|
<Alert
|
|
28
29
|
color={variant.color ? "#EFA82D" : undefined}
|
|
30
|
+
variant={variant.filled ? 'filled' : undefined}
|
|
29
31
|
block={variant.block}
|
|
30
32
|
square={variant.square}
|
|
31
33
|
icon={variant.noIcon ? false : variant.largeIcon ? <Icon icon={DeviceLaptopIcon} color="var(--errorColor)" size={32} /> : undefined}
|
|
@@ -81,7 +83,7 @@ const makeButtonColor = color => ['primary', 'secondary'].includes(color) ? unde
|
|
|
81
83
|
)}
|
|
82
84
|
onClose={variant.close ? () => {} : undefined}
|
|
83
85
|
>
|
|
84
|
-
{variant.title && <AlertTitle>{color
|
|
86
|
+
{variant.title && <AlertTitle>{color}</AlertTitle>}
|
|
85
87
|
This is a {color} alert
|
|
86
88
|
</Alert>
|
|
87
89
|
</div>
|
|
@@ -97,11 +99,16 @@ const makeButtonColor = color => ['primary', 'secondary'].includes(color) ? unde
|
|
|
97
99
|
severity={color}
|
|
98
100
|
block={variant.block}
|
|
99
101
|
action={variant.close ? undefined : (
|
|
100
|
-
<Button
|
|
102
|
+
<Button
|
|
103
|
+
variant='text'
|
|
104
|
+
style={{ color: `var(--${color}ContrastTextColor)` }}
|
|
105
|
+
size="small"
|
|
106
|
+
label="ACTION"
|
|
107
|
+
/>
|
|
101
108
|
)}
|
|
102
109
|
onClose={variant.close ? () => {} : undefined}
|
|
103
110
|
>
|
|
104
|
-
{variant.title && <AlertTitle>{color
|
|
111
|
+
{variant.title && <AlertTitle>{color}</AlertTitle>}
|
|
105
112
|
This is a {color} alert
|
|
106
113
|
</Alert>
|
|
107
114
|
</div>
|
|
@@ -121,7 +128,7 @@ const makeButtonColor = color => ['primary', 'secondary'].includes(color) ? unde
|
|
|
121
128
|
)}
|
|
122
129
|
onClose={variant.close ? () => {} : undefined}
|
|
123
130
|
>
|
|
124
|
-
{variant.title && <AlertTitle>{color
|
|
131
|
+
{variant.title && <AlertTitle>{color}</AlertTitle>}
|
|
125
132
|
This is a {color} alert
|
|
126
133
|
</Alert>
|
|
127
134
|
</div>
|
package/react/Alert/index.jsx
CHANGED
|
@@ -57,6 +57,7 @@ const Alert = forwardRef(
|
|
|
57
57
|
},
|
|
58
58
|
ref
|
|
59
59
|
) => {
|
|
60
|
+
// as primary and secondary doesn't exist on Mui Alert, we force success severity for those
|
|
60
61
|
const madeSeverity = ['primary', 'secondary'].includes(severity)
|
|
61
62
|
? 'success'
|
|
62
63
|
: severity
|
|
@@ -70,7 +71,7 @@ const Alert = forwardRef(
|
|
|
70
71
|
style={{ backgroundColor: color, borderRadius: square && 0 }}
|
|
71
72
|
className={cx(
|
|
72
73
|
className,
|
|
73
|
-
`
|
|
74
|
+
`cozyStyles-${severity}-${variant}`,
|
|
74
75
|
{ block },
|
|
75
76
|
{ action: Boolean(action) }
|
|
76
77
|
)}
|
|
@@ -90,7 +91,7 @@ const Alert = forwardRef(
|
|
|
90
91
|
|
|
91
92
|
Alert.displayName = 'Alert'
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
export const AlertPropTypes = {
|
|
94
95
|
className: PropTypes.string,
|
|
95
96
|
icon: PropTypes.oneOfType([PropTypes.element, PropTypes.bool]),
|
|
96
97
|
severity: PropTypes.oneOf([
|
|
@@ -107,11 +108,15 @@ Alert.propTypes = {
|
|
|
107
108
|
variant: PropTypes.oneOf(['standard', 'outlined', 'filled'])
|
|
108
109
|
}
|
|
109
110
|
|
|
110
|
-
|
|
111
|
+
export const AlertDefaultProps = {
|
|
111
112
|
severity: 'primary',
|
|
112
113
|
block: false,
|
|
113
114
|
square: false,
|
|
114
115
|
variant: 'standard'
|
|
115
116
|
}
|
|
116
117
|
|
|
118
|
+
Alert.propTypes = AlertPropTypes
|
|
119
|
+
|
|
120
|
+
Alert.defaultProps = AlertDefaultProps
|
|
121
|
+
|
|
117
122
|
export default Alert
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
import { alpha
|
|
1
|
+
import { alpha } from '../styles'
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export const makeAlertBackgroundColor = ({ theme, severity }) => ({
|
|
4
|
+
standard: alpha(
|
|
5
|
+
theme.palette[severity].main,
|
|
6
|
+
theme.palette.background.contrastOpacity
|
|
7
|
+
),
|
|
8
|
+
outlined: theme.palette[severity].main,
|
|
9
|
+
filled: theme.palette[severity].main
|
|
10
|
+
})
|
|
8
11
|
|
|
12
|
+
export const makeAlertColor = (theme, severity) => {
|
|
9
13
|
// same approach as Mui, see https://github.com/mui/material-ui/blob/v4.x/packages/material-ui-lab/src/Alert/Alert.js#L28
|
|
10
14
|
return {
|
|
11
15
|
'&-standard': {
|
|
12
|
-
color:
|
|
13
|
-
backgroundColor:
|
|
16
|
+
color: theme.palette.text.primary,
|
|
17
|
+
backgroundColor: makeAlertBackgroundColor({ theme, severity }).standard,
|
|
14
18
|
'& $icon': {
|
|
15
|
-
color:
|
|
19
|
+
color:
|
|
20
|
+
severity === 'secondary'
|
|
21
|
+
? theme.palette.text.primary
|
|
22
|
+
: theme.palette[severity].main
|
|
16
23
|
},
|
|
17
24
|
'& $action': {
|
|
18
25
|
'& button[title="Close"]': {
|
|
@@ -21,45 +28,24 @@ export const makeAlertColor = (theme, color) => {
|
|
|
21
28
|
}
|
|
22
29
|
},
|
|
23
30
|
'&-outlined': {
|
|
24
|
-
color:
|
|
25
|
-
border: `1px solid ${
|
|
31
|
+
color: theme.palette.text.primary,
|
|
32
|
+
border: `1px solid ${
|
|
33
|
+
makeAlertBackgroundColor({ theme, severity }).outlined
|
|
34
|
+
}`,
|
|
26
35
|
'& $icon': {
|
|
27
|
-
color:
|
|
36
|
+
color:
|
|
37
|
+
severity === 'secondary'
|
|
38
|
+
? theme.palette.text.primary
|
|
39
|
+
: theme.palette[severity].main
|
|
28
40
|
}
|
|
29
41
|
},
|
|
30
42
|
'&-filled': {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const makeAlertInvertedColor = (theme, color) => {
|
|
40
|
-
return {
|
|
41
|
-
'&-standard': {
|
|
42
|
-
color: theme.palette.primary.main,
|
|
43
|
-
backgroundColor: theme.palette.background.default,
|
|
44
|
-
'& $icon': {
|
|
45
|
-
color: theme.palette[color].main
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
'&-outlined': {
|
|
49
|
-
color: theme.palette.primary.main,
|
|
50
|
-
border: `1px solid ${theme.palette.primary.main}`,
|
|
51
|
-
'& $icon': {
|
|
52
|
-
color: theme.palette[color].main
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
'&-filled': {
|
|
56
|
-
color: theme.palette[color].contrastText,
|
|
57
|
-
backgroundColor:
|
|
58
|
-
color === 'secondary'
|
|
59
|
-
? theme.palette.grey[200]
|
|
60
|
-
: theme.palette[color].main,
|
|
61
|
-
'& $icon': {
|
|
62
|
-
color: theme.palette[color].contrastText
|
|
43
|
+
color: theme.palette[severity].contrastText,
|
|
44
|
+
backgroundColor: makeAlertBackgroundColor({ theme, severity }).filled,
|
|
45
|
+
'& $action': {
|
|
46
|
+
'& button[title="Close"]': {
|
|
47
|
+
color: theme.palette[severity].contrastText
|
|
48
|
+
}
|
|
63
49
|
}
|
|
64
50
|
}
|
|
65
51
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import merge from 'lodash/merge'
|
|
2
2
|
|
|
3
|
-
import { makeAlertInvertedColor } from './helpers'
|
|
4
3
|
import { makeOverrides } from './makeOverrides'
|
|
5
4
|
|
|
6
5
|
export const makeInvertedOverrides = invertedTheme => {
|
|
@@ -28,18 +27,6 @@ export const makeInvertedOverrides = invertedTheme => {
|
|
|
28
27
|
backgroundColor: 'rgba(255,255,255,0.2)'
|
|
29
28
|
}
|
|
30
29
|
},
|
|
31
|
-
MuiAlert: {
|
|
32
|
-
root: {
|
|
33
|
-
'&.cozyAlert': {
|
|
34
|
-
'&-primary': makeAlertInvertedColor(invertedTheme, 'primary'),
|
|
35
|
-
'&-secondary': makeAlertInvertedColor(invertedTheme, 'secondary'),
|
|
36
|
-
'&-success': makeAlertInvertedColor(invertedTheme, 'success'),
|
|
37
|
-
'&-error': makeAlertInvertedColor(invertedTheme, 'error'),
|
|
38
|
-
'&-warning': makeAlertInvertedColor(invertedTheme, 'warning'),
|
|
39
|
-
'&-info': makeAlertInvertedColor(invertedTheme, 'info')
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
30
|
MuiSnackbarContent: {
|
|
44
31
|
root: {
|
|
45
32
|
backgroundColor: invertedTheme.palette.grey[200]
|
|
@@ -760,9 +760,13 @@ export const makeOverrides = theme => ({
|
|
|
760
760
|
MuiAlert: {
|
|
761
761
|
root: {
|
|
762
762
|
padding: '8px 16px',
|
|
763
|
-
'&.
|
|
763
|
+
'&.cozyStyles': {
|
|
764
764
|
'&-primary': makeAlertColor(theme, 'primary'),
|
|
765
|
-
'&-secondary': makeAlertColor(theme, 'secondary')
|
|
765
|
+
'&-secondary': makeAlertColor(theme, 'secondary'),
|
|
766
|
+
'&-success': makeAlertColor(theme, 'success'),
|
|
767
|
+
'&-error': makeAlertColor(theme, 'error'),
|
|
768
|
+
'&-warning': makeAlertColor(theme, 'warning'),
|
|
769
|
+
'&-info': makeAlertColor(theme, 'info')
|
|
766
770
|
},
|
|
767
771
|
'& $icon': {
|
|
768
772
|
paddingTop: '9px'
|
|
@@ -124,6 +124,7 @@ export const makePalette = type => {
|
|
|
124
124
|
default: getCssValue('defaultBackgroundColor'),
|
|
125
125
|
paper: getCssValue('paperBackgroundColor'),
|
|
126
126
|
contrast: getCssValue('contrastBackgroundColor'),
|
|
127
|
+
contrastOpacity: type === 'dark' ? 0.24 : 0.12,
|
|
127
128
|
selected: '#F5FAFF' // deprecated, should be removed. Use action.selected instead
|
|
128
129
|
}
|
|
129
130
|
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
Displays a Alert with an Arrow pointing to a direction (top, right, bottom, left). It is essentially based on Alert so it inherits its props and defaultProps.
|
|
2
|
+
|
|
3
|
+
### Basic usage
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
import PointerAlert from 'cozy-ui/transpiled/react/PointerAlert'
|
|
7
|
+
|
|
8
|
+
<PointerAlert direction="bottom" severity="primary">
|
|
9
|
+
Your PointerAlert content
|
|
10
|
+
</PointerAlert>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Demo
|
|
14
|
+
|
|
15
|
+
```jsx
|
|
16
|
+
import PointerAlert from 'cozy-ui/transpiled/react/PointerAlert'
|
|
17
|
+
import AlertTitle from 'cozy-ui/transpiled/react/AlertTitle'
|
|
18
|
+
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
19
|
+
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
20
|
+
import Variants from 'cozy-ui/docs/components/Variants'
|
|
21
|
+
import DeviceLaptopIcon from 'cozy-ui/transpiled/react/Icons/DeviceLaptop'
|
|
22
|
+
import DownloadIcon from 'cozy-ui/transpiled/react/Icons/Download'
|
|
23
|
+
|
|
24
|
+
const initialVariants = [{
|
|
25
|
+
longText: false,
|
|
26
|
+
title: false,
|
|
27
|
+
block: true,
|
|
28
|
+
color: false,
|
|
29
|
+
largeIcon: false,
|
|
30
|
+
noIcon: false,
|
|
31
|
+
square: false,
|
|
32
|
+
actionOne: true,
|
|
33
|
+
actionTwo: false,
|
|
34
|
+
close: false
|
|
35
|
+
}]
|
|
36
|
+
|
|
37
|
+
const directions = ['top', 'bottom', 'left', 'right']
|
|
38
|
+
|
|
39
|
+
;
|
|
40
|
+
|
|
41
|
+
<Variants initialVariants={initialVariants} screenshotAllVariants>
|
|
42
|
+
{variant => (
|
|
43
|
+
<>
|
|
44
|
+
{directions.map(direction =>
|
|
45
|
+
<div className="u-mb-1" key={direction}>
|
|
46
|
+
<PointerAlert
|
|
47
|
+
direction={direction}
|
|
48
|
+
color={variant.color ? "#EFA82D" : undefined}
|
|
49
|
+
block={variant.block}
|
|
50
|
+
square={variant.square}
|
|
51
|
+
icon={variant.noIcon ? false : variant.largeIcon ? <Icon icon={DeviceLaptopIcon} color="var(--errorColor)" size={32} /> : undefined}
|
|
52
|
+
action={(variant.actionOne || variant.actionTwo) ?
|
|
53
|
+
<>
|
|
54
|
+
{variant.actionOne &&
|
|
55
|
+
<Button variant="text" size="small" label="Download" startIcon={<Icon icon={DownloadIcon} />} />
|
|
56
|
+
}
|
|
57
|
+
{variant.actionTwo &&
|
|
58
|
+
<Button variant="text" size="small" label="No, thanks!" />
|
|
59
|
+
}
|
|
60
|
+
</>
|
|
61
|
+
: undefined
|
|
62
|
+
}
|
|
63
|
+
onClose={variant.close ? () => {} : undefined}
|
|
64
|
+
>
|
|
65
|
+
{variant.title && <AlertTitle>This is the title</AlertTitle>}
|
|
66
|
+
{variant.longText
|
|
67
|
+
? content.ada.short
|
|
68
|
+
: "Get Cozy Drive for Desktop and synchronise your files safely to make them accessible at all times."
|
|
69
|
+
}
|
|
70
|
+
</PointerAlert>
|
|
71
|
+
</div>
|
|
72
|
+
)}
|
|
73
|
+
</>
|
|
74
|
+
)}
|
|
75
|
+
</Variants>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Colors
|
|
79
|
+
|
|
80
|
+
```jsx
|
|
81
|
+
import Alert from 'cozy-ui/transpiled/react/Alert'
|
|
82
|
+
import AlertTitle from 'cozy-ui/transpiled/react/AlertTitle'
|
|
83
|
+
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
84
|
+
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
85
|
+
|
|
86
|
+
const colors = ['primary', 'secondary','success', 'error', 'warning', 'info']
|
|
87
|
+
|
|
88
|
+
const makeButtonColor = color => ['primary', 'secondary'].includes(color) ? undefined : color
|
|
89
|
+
|
|
90
|
+
;
|
|
91
|
+
|
|
92
|
+
<>
|
|
93
|
+
{colors.map(color =>
|
|
94
|
+
<div className="u-mb-1" key={color}>
|
|
95
|
+
<PointerAlert
|
|
96
|
+
severity={color}
|
|
97
|
+
action={<Button variant="text" size="small" color={makeButtonColor(color)} label="ACTION" />}
|
|
98
|
+
>
|
|
99
|
+
<AlertTitle>{color}</AlertTitle>
|
|
100
|
+
This is a {color} alert
|
|
101
|
+
</PointerAlert>
|
|
102
|
+
</div>
|
|
103
|
+
)}
|
|
104
|
+
|
|
105
|
+
<hr />
|
|
106
|
+
<Typography variant="h4" paragraph>Filled variant</Typography>
|
|
107
|
+
|
|
108
|
+
{colors.map(color =>
|
|
109
|
+
<div className="u-mb-1" key={color}>
|
|
110
|
+
<PointerAlert
|
|
111
|
+
variant="filled"
|
|
112
|
+
severity={color}
|
|
113
|
+
action={
|
|
114
|
+
<Button
|
|
115
|
+
variant='text'
|
|
116
|
+
style={{ color: `var(--${color}ContrastTextColor)` }}
|
|
117
|
+
size="small"
|
|
118
|
+
label="ACTION"
|
|
119
|
+
/>}
|
|
120
|
+
>
|
|
121
|
+
<AlertTitle>{color}</AlertTitle>
|
|
122
|
+
This is a {color} alert
|
|
123
|
+
</PointerAlert>
|
|
124
|
+
</div>
|
|
125
|
+
)}
|
|
126
|
+
|
|
127
|
+
<hr />
|
|
128
|
+
<Typography variant="h4" paragraph>Outlined variant</Typography>
|
|
129
|
+
|
|
130
|
+
{colors.map(color =>
|
|
131
|
+
<div className="u-mb-1" key={color}>
|
|
132
|
+
<PointerAlert
|
|
133
|
+
variant="outlined"
|
|
134
|
+
severity={color}
|
|
135
|
+
action={<Button variant="text" size="small" color={makeButtonColor(color)} label="ACTION" />}
|
|
136
|
+
>
|
|
137
|
+
<AlertTitle>{color.toUpperCase()}</AlertTitle>
|
|
138
|
+
This is a {color} alert
|
|
139
|
+
</PointerAlert>
|
|
140
|
+
</div>
|
|
141
|
+
)}
|
|
142
|
+
</>
|
|
143
|
+
```
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
3
|
+
import cx from 'classnames'
|
|
4
|
+
|
|
5
|
+
import { makeStyles } from '../styles'
|
|
6
|
+
import { makeAlertBackgroundColor } from '../MuiCozyTheme/helpers'
|
|
7
|
+
import { AlertPropTypes, AlertDefaultProps } from '../Alert'
|
|
8
|
+
|
|
9
|
+
import Alert from '../Alert'
|
|
10
|
+
|
|
11
|
+
const useStyles = makeStyles(theme => ({
|
|
12
|
+
top: {
|
|
13
|
+
// create the arrow
|
|
14
|
+
borderLeft: '0.75rem solid transparent',
|
|
15
|
+
borderRight: '0.75rem solid transparent',
|
|
16
|
+
borderBottom: ({ variant, severity }) =>
|
|
17
|
+
`0.75rem solid ${makeAlertBackgroundColor({ theme, severity })[variant]}`,
|
|
18
|
+
// position the arrow
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
top: '-0.75rem',
|
|
21
|
+
left: '50%',
|
|
22
|
+
marginLeft: '-0.75rem'
|
|
23
|
+
},
|
|
24
|
+
bottom: {
|
|
25
|
+
// create the arrow
|
|
26
|
+
borderLeft: '0.75rem solid transparent',
|
|
27
|
+
borderRight: '0.75rem solid transparent',
|
|
28
|
+
borderTop: ({ variant, severity }) =>
|
|
29
|
+
`0.75rem solid ${makeAlertBackgroundColor({ theme, severity })[variant]}`,
|
|
30
|
+
// position the arrow
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
bottom: '-0.75rem',
|
|
33
|
+
left: '50%',
|
|
34
|
+
marginLeft: '-0.75rem'
|
|
35
|
+
},
|
|
36
|
+
left: {
|
|
37
|
+
// create the arrow
|
|
38
|
+
borderTop: '0.75rem solid transparent',
|
|
39
|
+
borderBottom: '0.75rem solid transparent',
|
|
40
|
+
borderRight: ({ variant, severity }) =>
|
|
41
|
+
`0.75rem solid ${makeAlertBackgroundColor({ theme, severity })[variant]}`,
|
|
42
|
+
// position the arrow
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
left: '-0.75rem',
|
|
45
|
+
top: '50%',
|
|
46
|
+
marginTop: '-0.75rem'
|
|
47
|
+
},
|
|
48
|
+
right: {
|
|
49
|
+
// create the arrow
|
|
50
|
+
borderTop: '0.75rem solid transparent',
|
|
51
|
+
borderBottom: '0.75rem solid transparent',
|
|
52
|
+
borderLeft: ({ variant, severity }) =>
|
|
53
|
+
`0.75rem solid ${makeAlertBackgroundColor({ theme, severity })[variant]}`,
|
|
54
|
+
// position the arrow
|
|
55
|
+
position: 'absolute',
|
|
56
|
+
right: '-0.75rem',
|
|
57
|
+
top: '50%',
|
|
58
|
+
marginTop: '-0.75rem'
|
|
59
|
+
}
|
|
60
|
+
}))
|
|
61
|
+
|
|
62
|
+
const PointerAlert = forwardRef(
|
|
63
|
+
({ className, severity, children, variant, direction, ...props }, ref) => {
|
|
64
|
+
const styles = useStyles({ variant, severity })
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<Alert
|
|
68
|
+
ref={ref}
|
|
69
|
+
className={cx(className, 'u-pos-relative')}
|
|
70
|
+
variant={variant}
|
|
71
|
+
severity={severity}
|
|
72
|
+
{...props}
|
|
73
|
+
>
|
|
74
|
+
{children}
|
|
75
|
+
<span className={styles[direction]}></span>
|
|
76
|
+
</Alert>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
PointerAlert.displayName = 'PointerAlert'
|
|
82
|
+
|
|
83
|
+
PointerAlert.propTypes = {
|
|
84
|
+
...AlertPropTypes,
|
|
85
|
+
direction: PropTypes.oneOf(['top', 'right', 'bottom', 'left'])
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
PointerAlert.defaultProps = {
|
|
89
|
+
...AlertDefaultProps,
|
|
90
|
+
direction: 'bottom'
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export default PointerAlert
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
exports[`Alert should render examples: Alert 1`] = `
|
|
4
4
|
"<div data-testid=\\"mountNode\\">
|
|
5
5
|
<div class=\\"MuiPaper-root u-p-1 u-mb-1 MuiPaper-elevation1\\">
|
|
6
|
-
<h5 class=\\"MuiTypography-root u-mb-1 MuiTypography-h5 MuiTypography-colorTextPrimary\\">Variant selector</h5><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"LONGTEXT\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">LONGTEXT</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"TITLE\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">TITLE</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"BLOCK\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">BLOCK</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"COLOR\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">COLOR</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"LARGEICON\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">LARGEICON</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"NOICON\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">NOICON</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"SQUARE\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">SQUARE</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"ACTIONONE\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">ACTIONONE</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"ACTIONTWO\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">ACTIONTWO</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"CLOSE\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">CLOSE</span></label>
|
|
6
|
+
<h5 class=\\"MuiTypography-root u-mb-1 MuiTypography-h5 MuiTypography-colorTextPrimary\\">Variant selector</h5><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"LONGTEXT\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">LONGTEXT</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"TITLE\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">TITLE</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"BLOCK\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">BLOCK</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"COLOR\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">COLOR</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"LARGEICON\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">LARGEICON</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"NOICON\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">NOICON</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"SQUARE\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">SQUARE</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"ACTIONONE\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">ACTIONONE</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"ACTIONTWO\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">ACTIONTWO</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"FILLED\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">FILLED</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"CLOSE\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">CLOSE</span></label>
|
|
7
7
|
</div>
|
|
8
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardSuccess
|
|
8
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardSuccess cozyStyles-primary-standard MuiPaper-elevation0\\" role=\\"alert\\">
|
|
9
9
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
10
10
|
<defs>
|
|
11
11
|
<path id=\\"info_svg__a\\" d=\\"M8 16A8 8 0 118 0a8 8 0 010 16zM7 4a1 1 0 102 0 1 1 0 10-2 0zm1 2H6v2h1v4a1 1 0 001 1h2v-2H9V7a1 1 0 00-1-1z\\"></path>
|
|
@@ -23,7 +23,7 @@ exports[`Alert should render examples: Alert 2`] = `
|
|
|
23
23
|
<h5 class=\\"MuiTypography-root u-mb-1 MuiTypography-h5 MuiTypography-colorTextPrimary\\">Variant selector</h5><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-checked-2 Mui-checked MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"TITLE\\" aria-checked=\\"\\" value=\\"\\" checked=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">TITLE</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"BLOCK\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">BLOCK</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-label=\\"CLOSE\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">CLOSE</span></label>
|
|
24
24
|
</div>
|
|
25
25
|
<div class=\\"u-mb-1\\">
|
|
26
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardSuccess
|
|
26
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardSuccess cozyStyles-primary-standard action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
27
27
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
28
28
|
<defs>
|
|
29
29
|
<path id=\\"info_svg__a\\" d=\\"M8 16A8 8 0 118 0a8 8 0 010 16zM7 4a1 1 0 102 0 1 1 0 10-2 0zm1 2H6v2h1v4a1 1 0 001 1h2v-2H9V7a1 1 0 00-1-1z\\"></path>
|
|
@@ -31,13 +31,13 @@ exports[`Alert should render examples: Alert 2`] = `
|
|
|
31
31
|
<use fill-rule=\\"evenodd\\" xlink:href=\\"#info_svg__a\\"></use>
|
|
32
32
|
</svg></div>
|
|
33
33
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-7\\">
|
|
34
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
34
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">primary</div>This is a primary alert
|
|
35
35
|
</div>
|
|
36
36
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-primary MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
39
|
<div class=\\"u-mb-1\\">
|
|
40
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardSuccess
|
|
40
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardSuccess cozyStyles-secondary-standard action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
41
41
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
42
42
|
<defs>
|
|
43
43
|
<path id=\\"info_svg__a\\" d=\\"M8 16A8 8 0 118 0a8 8 0 010 16zM7 4a1 1 0 102 0 1 1 0 10-2 0zm1 2H6v2h1v4a1 1 0 001 1h2v-2H9V7a1 1 0 00-1-1z\\"></path>
|
|
@@ -45,46 +45,46 @@ exports[`Alert should render examples: Alert 2`] = `
|
|
|
45
45
|
<use fill-rule=\\"evenodd\\" xlink:href=\\"#info_svg__a\\"></use>
|
|
46
46
|
</svg></div>
|
|
47
47
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-8\\">
|
|
48
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
48
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">secondary</div>This is a secondary alert
|
|
49
49
|
</div>
|
|
50
50
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-primary MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
51
51
|
</div>
|
|
52
52
|
</div>
|
|
53
53
|
<div class=\\"u-mb-1\\">
|
|
54
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardSuccess
|
|
54
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardSuccess cozyStyles-success-standard action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
55
55
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 48 48\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
56
56
|
<path fill-rule=\\"evenodd\\" d=\\"M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zM13.414 24.586a2 2 0 00-2.828 2.828l7 7a2 2 0 002.828 0l15-15a2 2 0 00-2.828-2.828L19 30.172l-5.586-5.586z\\"></path>
|
|
57
57
|
</svg></div>
|
|
58
58
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-9\\">
|
|
59
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
59
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">success</div>This is a success alert
|
|
60
60
|
</div>
|
|
61
61
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-success MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
64
64
|
<div class=\\"u-mb-1\\">
|
|
65
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardError
|
|
65
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardError cozyStyles-error-standard action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
66
66
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
67
67
|
<path fill-rule=\\"evenodd\\" d=\\"M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 9.75C7.30964 9.75 6.75 10.3096 6.75 11C6.75 11.6904 7.30964 12.25 8 12.25C8.69036 12.25 9.25 11.6904 9.25 11C9.25 10.3096 8.69036 9.75 8 9.75ZM8 4C7.48716 4 7.06449 4.38604 7.00673 4.88338L7 5V8C7 8.55228 7.44772 9 8 9C8.51284 9 8.93551 8.61396 8.99327 8.11662L9 8V5C9 4.44772 8.55228 4 8 4Z\\"></path>
|
|
68
68
|
</svg></div>
|
|
69
69
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-10\\">
|
|
70
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
70
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">error</div>This is a error alert
|
|
71
71
|
</div>
|
|
72
72
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-error MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|
|
75
75
|
<div class=\\"u-mb-1\\">
|
|
76
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardWarning
|
|
76
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardWarning cozyStyles-warning-standard action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
77
77
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
78
78
|
<path fill-rule=\\"evenodd\\" d=\\"M7.022 1.736c.543-.959 1.428-.95 1.966 0l6.532 11.529c.543.958.094 1.735-1.016 1.735h-13C.399 15-.051 14.215.487 13.265l6.535-11.53zM7.004 13c0-.552.443-1 1-1 .552 0 1 .444 1 1 0 .553-.444 1-1 1-.553 0-1-.444-1-1zm0-7.997a.999.999 0 011-1.003c.552 0 1 .438 1 1.003v4.994a.999.999 0 01-1 1.003c-.553 0-1-.438-1-1.003V5.003z\\"></path>
|
|
79
79
|
</svg></div>
|
|
80
80
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-11\\">
|
|
81
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
81
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">warning</div>This is a warning alert
|
|
82
82
|
</div>
|
|
83
83
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-warning MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
|
86
86
|
<div class=\\"u-mb-1\\">
|
|
87
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardInfo
|
|
87
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-standardInfo cozyStyles-info-standard action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
88
88
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
89
89
|
<defs>
|
|
90
90
|
<path id=\\"info_svg__a\\" d=\\"M8 16A8 8 0 118 0a8 8 0 010 16zM7 4a1 1 0 102 0 1 1 0 10-2 0zm1 2H6v2h1v4a1 1 0 001 1h2v-2H9V7a1 1 0 00-1-1z\\"></path>
|
|
@@ -92,7 +92,7 @@ exports[`Alert should render examples: Alert 2`] = `
|
|
|
92
92
|
<use fill-rule=\\"evenodd\\" xlink:href=\\"#info_svg__a\\"></use>
|
|
93
93
|
</svg></div>
|
|
94
94
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-12\\">
|
|
95
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
95
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">info</div>This is a info alert
|
|
96
96
|
</div>
|
|
97
97
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-info MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
98
98
|
</div>
|
|
@@ -100,7 +100,7 @@ exports[`Alert should render examples: Alert 2`] = `
|
|
|
100
100
|
<hr>
|
|
101
101
|
<p class=\\"MuiTypography-root MuiTypography-h4 MuiTypography-colorTextPrimary MuiTypography-paragraph\\">Filled variant</p>
|
|
102
102
|
<div class=\\"u-mb-1\\">
|
|
103
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledSuccess
|
|
103
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledSuccess cozyStyles-primary-filled action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
104
104
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
105
105
|
<defs>
|
|
106
106
|
<path id=\\"info_svg__a\\" d=\\"M8 16A8 8 0 118 0a8 8 0 010 16zM7 4a1 1 0 102 0 1 1 0 10-2 0zm1 2H6v2h1v4a1 1 0 001 1h2v-2H9V7a1 1 0 00-1-1z\\"></path>
|
|
@@ -108,13 +108,13 @@ exports[`Alert should render examples: Alert 2`] = `
|
|
|
108
108
|
<use fill-rule=\\"evenodd\\" xlink:href=\\"#info_svg__a\\"></use>
|
|
109
109
|
</svg></div>
|
|
110
110
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-13\\">
|
|
111
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
111
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">primary</div>This is a primary alert
|
|
112
112
|
</div>
|
|
113
|
-
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-
|
|
113
|
+
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-primary MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
114
114
|
</div>
|
|
115
115
|
</div>
|
|
116
116
|
<div class=\\"u-mb-1\\">
|
|
117
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledSuccess
|
|
117
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledSuccess cozyStyles-secondary-filled action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
118
118
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
119
119
|
<defs>
|
|
120
120
|
<path id=\\"info_svg__a\\" d=\\"M8 16A8 8 0 118 0a8 8 0 010 16zM7 4a1 1 0 102 0 1 1 0 10-2 0zm1 2H6v2h1v4a1 1 0 001 1h2v-2H9V7a1 1 0 00-1-1z\\"></path>
|
|
@@ -122,46 +122,46 @@ exports[`Alert should render examples: Alert 2`] = `
|
|
|
122
122
|
<use fill-rule=\\"evenodd\\" xlink:href=\\"#info_svg__a\\"></use>
|
|
123
123
|
</svg></div>
|
|
124
124
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-14\\">
|
|
125
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
125
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">secondary</div>This is a secondary alert
|
|
126
126
|
</div>
|
|
127
|
-
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-
|
|
127
|
+
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-primary MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
128
128
|
</div>
|
|
129
129
|
</div>
|
|
130
130
|
<div class=\\"u-mb-1\\">
|
|
131
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledSuccess
|
|
131
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledSuccess cozyStyles-success-filled action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
132
132
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 48 48\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
133
133
|
<path fill-rule=\\"evenodd\\" d=\\"M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zM13.414 24.586a2 2 0 00-2.828 2.828l7 7a2 2 0 002.828 0l15-15a2 2 0 00-2.828-2.828L19 30.172l-5.586-5.586z\\"></path>
|
|
134
134
|
</svg></div>
|
|
135
135
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-15\\">
|
|
136
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
136
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">success</div>This is a success alert
|
|
137
137
|
</div>
|
|
138
|
-
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-
|
|
138
|
+
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-primary MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
139
139
|
</div>
|
|
140
140
|
</div>
|
|
141
141
|
<div class=\\"u-mb-1\\">
|
|
142
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledError
|
|
142
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledError cozyStyles-error-filled action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
143
143
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
144
144
|
<path fill-rule=\\"evenodd\\" d=\\"M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 9.75C7.30964 9.75 6.75 10.3096 6.75 11C6.75 11.6904 7.30964 12.25 8 12.25C8.69036 12.25 9.25 11.6904 9.25 11C9.25 10.3096 8.69036 9.75 8 9.75ZM8 4C7.48716 4 7.06449 4.38604 7.00673 4.88338L7 5V8C7 8.55228 7.44772 9 8 9C8.51284 9 8.93551 8.61396 8.99327 8.11662L9 8V5C9 4.44772 8.55228 4 8 4Z\\"></path>
|
|
145
145
|
</svg></div>
|
|
146
146
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-16\\">
|
|
147
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
147
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">error</div>This is a error alert
|
|
148
148
|
</div>
|
|
149
|
-
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-
|
|
149
|
+
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-primary MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
150
150
|
</div>
|
|
151
151
|
</div>
|
|
152
152
|
<div class=\\"u-mb-1\\">
|
|
153
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledWarning
|
|
153
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledWarning cozyStyles-warning-filled action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
154
154
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
155
155
|
<path fill-rule=\\"evenodd\\" d=\\"M7.022 1.736c.543-.959 1.428-.95 1.966 0l6.532 11.529c.543.958.094 1.735-1.016 1.735h-13C.399 15-.051 14.215.487 13.265l6.535-11.53zM7.004 13c0-.552.443-1 1-1 .552 0 1 .444 1 1 0 .553-.444 1-1 1-.553 0-1-.444-1-1zm0-7.997a.999.999 0 011-1.003c.552 0 1 .438 1 1.003v4.994a.999.999 0 01-1 1.003c-.553 0-1-.438-1-1.003V5.003z\\"></path>
|
|
156
156
|
</svg></div>
|
|
157
157
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-17\\">
|
|
158
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
158
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">warning</div>This is a warning alert
|
|
159
159
|
</div>
|
|
160
|
-
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-
|
|
160
|
+
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-primary MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
161
161
|
</div>
|
|
162
162
|
</div>
|
|
163
163
|
<div class=\\"u-mb-1\\">
|
|
164
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledInfo
|
|
164
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-filledInfo cozyStyles-info-filled action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
165
165
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
166
166
|
<defs>
|
|
167
167
|
<path id=\\"info_svg__a\\" d=\\"M8 16A8 8 0 118 0a8 8 0 010 16zM7 4a1 1 0 102 0 1 1 0 10-2 0zm1 2H6v2h1v4a1 1 0 001 1h2v-2H9V7a1 1 0 00-1-1z\\"></path>
|
|
@@ -169,15 +169,15 @@ exports[`Alert should render examples: Alert 2`] = `
|
|
|
169
169
|
<use fill-rule=\\"evenodd\\" xlink:href=\\"#info_svg__a\\"></use>
|
|
170
170
|
</svg></div>
|
|
171
171
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-18\\">
|
|
172
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
172
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">info</div>This is a info alert
|
|
173
173
|
</div>
|
|
174
|
-
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-
|
|
174
|
+
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-primary MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
175
175
|
</div>
|
|
176
176
|
</div>
|
|
177
177
|
<hr>
|
|
178
178
|
<p class=\\"MuiTypography-root MuiTypography-h4 MuiTypography-colorTextPrimary MuiTypography-paragraph\\">Outlined variant</p>
|
|
179
179
|
<div class=\\"u-mb-1\\">
|
|
180
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedSuccess
|
|
180
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedSuccess cozyStyles-primary-outlined action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
181
181
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
182
182
|
<defs>
|
|
183
183
|
<path id=\\"info_svg__a\\" d=\\"M8 16A8 8 0 118 0a8 8 0 010 16zM7 4a1 1 0 102 0 1 1 0 10-2 0zm1 2H6v2h1v4a1 1 0 001 1h2v-2H9V7a1 1 0 00-1-1z\\"></path>
|
|
@@ -185,13 +185,13 @@ exports[`Alert should render examples: Alert 2`] = `
|
|
|
185
185
|
<use fill-rule=\\"evenodd\\" xlink:href=\\"#info_svg__a\\"></use>
|
|
186
186
|
</svg></div>
|
|
187
187
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-19\\">
|
|
188
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
188
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">primary</div>This is a primary alert
|
|
189
189
|
</div>
|
|
190
190
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-primary MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
191
191
|
</div>
|
|
192
192
|
</div>
|
|
193
193
|
<div class=\\"u-mb-1\\">
|
|
194
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedSuccess
|
|
194
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedSuccess cozyStyles-secondary-outlined action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
195
195
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
196
196
|
<defs>
|
|
197
197
|
<path id=\\"info_svg__a\\" d=\\"M8 16A8 8 0 118 0a8 8 0 010 16zM7 4a1 1 0 102 0 1 1 0 10-2 0zm1 2H6v2h1v4a1 1 0 001 1h2v-2H9V7a1 1 0 00-1-1z\\"></path>
|
|
@@ -199,46 +199,46 @@ exports[`Alert should render examples: Alert 2`] = `
|
|
|
199
199
|
<use fill-rule=\\"evenodd\\" xlink:href=\\"#info_svg__a\\"></use>
|
|
200
200
|
</svg></div>
|
|
201
201
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-20\\">
|
|
202
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
202
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">secondary</div>This is a secondary alert
|
|
203
203
|
</div>
|
|
204
204
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-primary MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
205
205
|
</div>
|
|
206
206
|
</div>
|
|
207
207
|
<div class=\\"u-mb-1\\">
|
|
208
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedSuccess
|
|
208
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedSuccess cozyStyles-success-outlined action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
209
209
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 48 48\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
210
210
|
<path fill-rule=\\"evenodd\\" d=\\"M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zM13.414 24.586a2 2 0 00-2.828 2.828l7 7a2 2 0 002.828 0l15-15a2 2 0 00-2.828-2.828L19 30.172l-5.586-5.586z\\"></path>
|
|
211
211
|
</svg></div>
|
|
212
212
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-21\\">
|
|
213
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
213
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">success</div>This is a success alert
|
|
214
214
|
</div>
|
|
215
215
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-success MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
216
216
|
</div>
|
|
217
217
|
</div>
|
|
218
218
|
<div class=\\"u-mb-1\\">
|
|
219
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedError
|
|
219
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedError cozyStyles-error-outlined action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
220
220
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
221
221
|
<path fill-rule=\\"evenodd\\" d=\\"M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 9.75C7.30964 9.75 6.75 10.3096 6.75 11C6.75 11.6904 7.30964 12.25 8 12.25C8.69036 12.25 9.25 11.6904 9.25 11C9.25 10.3096 8.69036 9.75 8 9.75ZM8 4C7.48716 4 7.06449 4.38604 7.00673 4.88338L7 5V8C7 8.55228 7.44772 9 8 9C8.51284 9 8.93551 8.61396 8.99327 8.11662L9 8V5C9 4.44772 8.55228 4 8 4Z\\"></path>
|
|
222
222
|
</svg></div>
|
|
223
223
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-22\\">
|
|
224
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
224
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">error</div>This is a error alert
|
|
225
225
|
</div>
|
|
226
226
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-error MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
227
227
|
</div>
|
|
228
228
|
</div>
|
|
229
229
|
<div class=\\"u-mb-1\\">
|
|
230
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedWarning
|
|
230
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedWarning cozyStyles-warning-outlined action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
231
231
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
232
232
|
<path fill-rule=\\"evenodd\\" d=\\"M7.022 1.736c.543-.959 1.428-.95 1.966 0l6.532 11.529c.543.958.094 1.735-1.016 1.735h-13C.399 15-.051 14.215.487 13.265l6.535-11.53zM7.004 13c0-.552.443-1 1-1 .552 0 1 .444 1 1 0 .553-.444 1-1 1-.553 0-1-.444-1-1zm0-7.997a.999.999 0 011-1.003c.552 0 1 .438 1 1.003v4.994a.999.999 0 01-1 1.003c-.553 0-1-.438-1-1.003V5.003z\\"></path>
|
|
233
233
|
</svg></div>
|
|
234
234
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-23\\">
|
|
235
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
235
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">warning</div>This is a warning alert
|
|
236
236
|
</div>
|
|
237
237
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-warning MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
238
238
|
</div>
|
|
239
239
|
</div>
|
|
240
240
|
<div class=\\"u-mb-1\\">
|
|
241
|
-
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedInfo
|
|
241
|
+
<div class=\\"MuiPaper-root MuiAlert-root MuiAlert-outlinedInfo cozyStyles-info-outlined action MuiPaper-elevation0\\" role=\\"alert\\">
|
|
242
242
|
<div class=\\"MuiAlert-icon\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
243
243
|
<defs>
|
|
244
244
|
<path id=\\"info_svg__a\\" d=\\"M8 16A8 8 0 118 0a8 8 0 010 16zM7 4a1 1 0 102 0 1 1 0 10-2 0zm1 2H6v2h1v4a1 1 0 001 1h2v-2H9V7a1 1 0 00-1-1z\\"></path>
|
|
@@ -246,7 +246,7 @@ exports[`Alert should render examples: Alert 2`] = `
|
|
|
246
246
|
<use fill-rule=\\"evenodd\\" xlink:href=\\"#info_svg__a\\"></use>
|
|
247
247
|
</svg></div>
|
|
248
248
|
<div class=\\"MuiAlert-message makeStyles-message-5 makeStyles-message-24\\">
|
|
249
|
-
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">
|
|
249
|
+
<div class=\\"MuiTypography-root MuiAlertTitle-root MuiTypography-body1 MuiTypography-gutterBottom\\">info</div>This is a info alert
|
|
250
250
|
</div>
|
|
251
251
|
<div class=\\"MuiAlert-action\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text customColor-info MuiButton-textPrimary MuiButton-textSizeSmall MuiButton-sizeSmall MuiButton-disableElevation\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">ACTION</span></button></div>
|
|
252
252
|
</div>
|
package/react/index.js
CHANGED
|
@@ -113,6 +113,7 @@ export { default as DropdownText } from './DropdownText'
|
|
|
113
113
|
export { default as CircleButton } from './CircleButton'
|
|
114
114
|
export { default as Alert } from './Alert'
|
|
115
115
|
export { default as AlertTitle } from './AlertTitle'
|
|
116
|
+
export { default as PointerAlert } from './PointerAlert'
|
|
116
117
|
export { default as Tabs } from './Tabs'
|
|
117
118
|
export { default as Tab } from './Tab'
|
|
118
119
|
export { default as CircularChart } from './CircularChart'
|
|
@@ -63,6 +63,7 @@ var Alert = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
63
63
|
children = _ref2.children,
|
|
64
64
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
65
65
|
|
|
66
|
+
// as primary and secondary doesn't exist on Mui Alert, we force success severity for those
|
|
66
67
|
var madeSeverity = ['primary', 'secondary'].includes(severity) ? 'success' : severity;
|
|
67
68
|
var madeIcon = makeIcon(icon, severity);
|
|
68
69
|
var iconSize = (icon === null || icon === void 0 ? void 0 : (_icon$props = icon.props) === null || _icon$props === void 0 ? void 0 : _icon$props.size) || DEFAULT_ICON_SIZE;
|
|
@@ -76,7 +77,7 @@ var Alert = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
76
77
|
backgroundColor: color,
|
|
77
78
|
borderRadius: square && 0
|
|
78
79
|
},
|
|
79
|
-
className: cx(className, "
|
|
80
|
+
className: cx(className, "cozyStyles-".concat(severity, "-").concat(variant), {
|
|
80
81
|
block: block
|
|
81
82
|
}, {
|
|
82
83
|
action: Boolean(action)
|
|
@@ -90,7 +91,7 @@ var Alert = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
90
91
|
}, props), children);
|
|
91
92
|
});
|
|
92
93
|
Alert.displayName = 'Alert';
|
|
93
|
-
|
|
94
|
+
export var AlertPropTypes = {
|
|
94
95
|
className: PropTypes.string,
|
|
95
96
|
icon: PropTypes.oneOfType([PropTypes.element, PropTypes.bool]),
|
|
96
97
|
severity: PropTypes.oneOf(['primary', 'secondary', 'success', 'error', 'warning', 'info']),
|
|
@@ -99,10 +100,12 @@ Alert.propTypes = {
|
|
|
99
100
|
square: PropTypes.bool,
|
|
100
101
|
variant: PropTypes.oneOf(['standard', 'outlined', 'filled'])
|
|
101
102
|
};
|
|
102
|
-
|
|
103
|
+
export var AlertDefaultProps = {
|
|
103
104
|
severity: 'primary',
|
|
104
105
|
block: false,
|
|
105
106
|
square: false,
|
|
106
107
|
variant: 'standard'
|
|
107
108
|
};
|
|
109
|
+
Alert.propTypes = AlertPropTypes;
|
|
110
|
+
Alert.defaultProps = AlertDefaultProps;
|
|
108
111
|
export default Alert;
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import { alpha
|
|
2
|
-
export var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { alpha } from "cozy-ui/transpiled/react/styles";
|
|
2
|
+
export var makeAlertBackgroundColor = function makeAlertBackgroundColor(_ref) {
|
|
3
|
+
var theme = _ref.theme,
|
|
4
|
+
severity = _ref.severity;
|
|
5
|
+
return {
|
|
6
|
+
standard: alpha(theme.palette[severity].main, theme.palette.background.contrastOpacity),
|
|
7
|
+
outlined: theme.palette[severity].main,
|
|
8
|
+
filled: theme.palette[severity].main
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export var makeAlertColor = function makeAlertColor(theme, severity) {
|
|
12
|
+
// same approach as Mui, see https://github.com/mui/material-ui/blob/v4.x/packages/material-ui-lab/src/Alert/Alert.js#L28
|
|
8
13
|
return {
|
|
9
14
|
'&-standard': {
|
|
10
|
-
color:
|
|
11
|
-
backgroundColor:
|
|
15
|
+
color: theme.palette.text.primary,
|
|
16
|
+
backgroundColor: makeAlertBackgroundColor({
|
|
17
|
+
theme: theme,
|
|
18
|
+
severity: severity
|
|
19
|
+
}).standard,
|
|
12
20
|
'& $icon': {
|
|
13
|
-
color:
|
|
21
|
+
color: severity === 'secondary' ? theme.palette.text.primary : theme.palette[severity].main
|
|
14
22
|
},
|
|
15
23
|
'& $action': {
|
|
16
24
|
'& button[title="Close"]': {
|
|
@@ -19,38 +27,25 @@ export var makeAlertColor = function makeAlertColor(theme, color) {
|
|
|
19
27
|
}
|
|
20
28
|
},
|
|
21
29
|
'&-outlined': {
|
|
22
|
-
color:
|
|
23
|
-
border: "1px solid ".concat(
|
|
30
|
+
color: theme.palette.text.primary,
|
|
31
|
+
border: "1px solid ".concat(makeAlertBackgroundColor({
|
|
32
|
+
theme: theme,
|
|
33
|
+
severity: severity
|
|
34
|
+
}).outlined),
|
|
24
35
|
'& $icon': {
|
|
25
|
-
color:
|
|
36
|
+
color: severity === 'secondary' ? theme.palette.text.primary : theme.palette[severity].main
|
|
26
37
|
}
|
|
27
38
|
},
|
|
28
39
|
'&-filled': {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'& $icon': {
|
|
39
|
-
color: theme.palette[color].main
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
'&-outlined': {
|
|
43
|
-
color: theme.palette.primary.main,
|
|
44
|
-
border: "1px solid ".concat(theme.palette.primary.main),
|
|
45
|
-
'& $icon': {
|
|
46
|
-
color: theme.palette[color].main
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
'&-filled': {
|
|
50
|
-
color: theme.palette[color].contrastText,
|
|
51
|
-
backgroundColor: color === 'secondary' ? theme.palette.grey[200] : theme.palette[color].main,
|
|
52
|
-
'& $icon': {
|
|
53
|
-
color: theme.palette[color].contrastText
|
|
40
|
+
color: theme.palette[severity].contrastText,
|
|
41
|
+
backgroundColor: makeAlertBackgroundColor({
|
|
42
|
+
theme: theme,
|
|
43
|
+
severity: severity
|
|
44
|
+
}).filled,
|
|
45
|
+
'& $action': {
|
|
46
|
+
'& button[title="Close"]': {
|
|
47
|
+
color: theme.palette[severity].contrastText
|
|
48
|
+
}
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
|
-
import { makeAlertInvertedColor } from "cozy-ui/transpiled/react/MuiCozyTheme/helpers";
|
|
3
2
|
import { makeOverrides } from "cozy-ui/transpiled/react/MuiCozyTheme/makeOverrides";
|
|
4
3
|
export var makeInvertedOverrides = function makeInvertedOverrides(invertedTheme) {
|
|
5
4
|
var makeOverridesForInvertedTheme = function makeOverridesForInvertedTheme(invertedTheme) {
|
|
@@ -27,18 +26,6 @@ export var makeInvertedOverrides = function makeInvertedOverrides(invertedTheme)
|
|
|
27
26
|
backgroundColor: 'rgba(255,255,255,0.2)'
|
|
28
27
|
}
|
|
29
28
|
},
|
|
30
|
-
MuiAlert: {
|
|
31
|
-
root: {
|
|
32
|
-
'&.cozyAlert': {
|
|
33
|
-
'&-primary': makeAlertInvertedColor(invertedTheme, 'primary'),
|
|
34
|
-
'&-secondary': makeAlertInvertedColor(invertedTheme, 'secondary'),
|
|
35
|
-
'&-success': makeAlertInvertedColor(invertedTheme, 'success'),
|
|
36
|
-
'&-error': makeAlertInvertedColor(invertedTheme, 'error'),
|
|
37
|
-
'&-warning': makeAlertInvertedColor(invertedTheme, 'warning'),
|
|
38
|
-
'&-info': makeAlertInvertedColor(invertedTheme, 'info')
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
29
|
MuiSnackbarContent: {
|
|
43
30
|
root: {
|
|
44
31
|
backgroundColor: invertedTheme.palette.grey[200]
|
|
@@ -710,9 +710,13 @@ export var makeOverrides = function makeOverrides(theme) {
|
|
|
710
710
|
MuiAlert: {
|
|
711
711
|
root: {
|
|
712
712
|
padding: '8px 16px',
|
|
713
|
-
'&.
|
|
713
|
+
'&.cozyStyles': {
|
|
714
714
|
'&-primary': makeAlertColor(theme, 'primary'),
|
|
715
|
-
'&-secondary': makeAlertColor(theme, 'secondary')
|
|
715
|
+
'&-secondary': makeAlertColor(theme, 'secondary'),
|
|
716
|
+
'&-success': makeAlertColor(theme, 'success'),
|
|
717
|
+
'&-error': makeAlertColor(theme, 'error'),
|
|
718
|
+
'&-warning': makeAlertColor(theme, 'warning'),
|
|
719
|
+
'&-info': makeAlertColor(theme, 'info')
|
|
716
720
|
},
|
|
717
721
|
'& $icon': {
|
|
718
722
|
paddingTop: '9px'
|
|
@@ -116,6 +116,7 @@ export var makePalette = function makePalette(type) {
|
|
|
116
116
|
default: getCssValue('defaultBackgroundColor'),
|
|
117
117
|
paper: getCssValue('paperBackgroundColor'),
|
|
118
118
|
contrast: getCssValue('contrastBackgroundColor'),
|
|
119
|
+
contrastOpacity: type === 'dark' ? 0.24 : 0.12,
|
|
119
120
|
selected: '#F5FAFF' // deprecated, should be removed. Use action.selected instead
|
|
120
121
|
|
|
121
122
|
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["className", "severity", "children", "variant", "direction"];
|
|
5
|
+
|
|
6
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
|
+
|
|
8
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
|
+
|
|
10
|
+
import React, { forwardRef } from 'react';
|
|
11
|
+
import PropTypes from 'prop-types';
|
|
12
|
+
import cx from 'classnames';
|
|
13
|
+
import { makeStyles } from "cozy-ui/transpiled/react/styles";
|
|
14
|
+
import { makeAlertBackgroundColor } from "cozy-ui/transpiled/react/MuiCozyTheme/helpers";
|
|
15
|
+
import { AlertPropTypes, AlertDefaultProps } from "cozy-ui/transpiled/react/Alert";
|
|
16
|
+
import Alert from "cozy-ui/transpiled/react/Alert";
|
|
17
|
+
var useStyles = makeStyles(function (theme) {
|
|
18
|
+
return {
|
|
19
|
+
top: {
|
|
20
|
+
// create the arrow
|
|
21
|
+
borderLeft: '0.75rem solid transparent',
|
|
22
|
+
borderRight: '0.75rem solid transparent',
|
|
23
|
+
borderBottom: function borderBottom(_ref) {
|
|
24
|
+
var variant = _ref.variant,
|
|
25
|
+
severity = _ref.severity;
|
|
26
|
+
return "0.75rem solid ".concat(makeAlertBackgroundColor({
|
|
27
|
+
theme: theme,
|
|
28
|
+
severity: severity
|
|
29
|
+
})[variant]);
|
|
30
|
+
},
|
|
31
|
+
// position the arrow
|
|
32
|
+
position: 'absolute',
|
|
33
|
+
top: '-0.75rem',
|
|
34
|
+
left: '50%',
|
|
35
|
+
marginLeft: '-0.75rem'
|
|
36
|
+
},
|
|
37
|
+
bottom: {
|
|
38
|
+
// create the arrow
|
|
39
|
+
borderLeft: '0.75rem solid transparent',
|
|
40
|
+
borderRight: '0.75rem solid transparent',
|
|
41
|
+
borderTop: function borderTop(_ref2) {
|
|
42
|
+
var variant = _ref2.variant,
|
|
43
|
+
severity = _ref2.severity;
|
|
44
|
+
return "0.75rem solid ".concat(makeAlertBackgroundColor({
|
|
45
|
+
theme: theme,
|
|
46
|
+
severity: severity
|
|
47
|
+
})[variant]);
|
|
48
|
+
},
|
|
49
|
+
// position the arrow
|
|
50
|
+
position: 'absolute',
|
|
51
|
+
bottom: '-0.75rem',
|
|
52
|
+
left: '50%',
|
|
53
|
+
marginLeft: '-0.75rem'
|
|
54
|
+
},
|
|
55
|
+
left: {
|
|
56
|
+
// create the arrow
|
|
57
|
+
borderTop: '0.75rem solid transparent',
|
|
58
|
+
borderBottom: '0.75rem solid transparent',
|
|
59
|
+
borderRight: function borderRight(_ref3) {
|
|
60
|
+
var variant = _ref3.variant,
|
|
61
|
+
severity = _ref3.severity;
|
|
62
|
+
return "0.75rem solid ".concat(makeAlertBackgroundColor({
|
|
63
|
+
theme: theme,
|
|
64
|
+
severity: severity
|
|
65
|
+
})[variant]);
|
|
66
|
+
},
|
|
67
|
+
// position the arrow
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
left: '-0.75rem',
|
|
70
|
+
top: '50%',
|
|
71
|
+
marginTop: '-0.75rem'
|
|
72
|
+
},
|
|
73
|
+
right: {
|
|
74
|
+
// create the arrow
|
|
75
|
+
borderTop: '0.75rem solid transparent',
|
|
76
|
+
borderBottom: '0.75rem solid transparent',
|
|
77
|
+
borderLeft: function borderLeft(_ref4) {
|
|
78
|
+
var variant = _ref4.variant,
|
|
79
|
+
severity = _ref4.severity;
|
|
80
|
+
return "0.75rem solid ".concat(makeAlertBackgroundColor({
|
|
81
|
+
theme: theme,
|
|
82
|
+
severity: severity
|
|
83
|
+
})[variant]);
|
|
84
|
+
},
|
|
85
|
+
// position the arrow
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
right: '-0.75rem',
|
|
88
|
+
top: '50%',
|
|
89
|
+
marginTop: '-0.75rem'
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
var PointerAlert = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
94
|
+
var className = _ref5.className,
|
|
95
|
+
severity = _ref5.severity,
|
|
96
|
+
children = _ref5.children,
|
|
97
|
+
variant = _ref5.variant,
|
|
98
|
+
direction = _ref5.direction,
|
|
99
|
+
props = _objectWithoutProperties(_ref5, _excluded);
|
|
100
|
+
|
|
101
|
+
var styles = useStyles({
|
|
102
|
+
variant: variant,
|
|
103
|
+
severity: severity
|
|
104
|
+
});
|
|
105
|
+
return /*#__PURE__*/React.createElement(Alert, _extends({
|
|
106
|
+
ref: ref,
|
|
107
|
+
className: cx(className, 'u-pos-relative'),
|
|
108
|
+
variant: variant,
|
|
109
|
+
severity: severity
|
|
110
|
+
}, props), children, /*#__PURE__*/React.createElement("span", {
|
|
111
|
+
className: styles[direction]
|
|
112
|
+
}));
|
|
113
|
+
});
|
|
114
|
+
PointerAlert.displayName = 'PointerAlert';
|
|
115
|
+
PointerAlert.propTypes = _objectSpread(_objectSpread({}, AlertPropTypes), {}, {
|
|
116
|
+
direction: PropTypes.oneOf(['top', 'right', 'bottom', 'left'])
|
|
117
|
+
});
|
|
118
|
+
PointerAlert.defaultProps = _objectSpread(_objectSpread({}, AlertDefaultProps), {}, {
|
|
119
|
+
direction: 'bottom'
|
|
120
|
+
});
|
|
121
|
+
export default PointerAlert;
|
|
@@ -87,6 +87,7 @@ export { default as DropdownText } from './DropdownText';
|
|
|
87
87
|
export { default as CircleButton } from './CircleButton';
|
|
88
88
|
export { default as Alert } from './Alert';
|
|
89
89
|
export { default as AlertTitle } from './AlertTitle';
|
|
90
|
+
export { default as PointerAlert } from './PointerAlert';
|
|
90
91
|
export { default as Tabs } from './Tabs';
|
|
91
92
|
export { default as Tab } from './Tab';
|
|
92
93
|
export { default as CircularChart } from './CircularChart';
|