cozy-ui 120.0.0 → 121.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 +21 -0
- package/dist/cozy-ui.min.css +1 -1
- package/dist/cozy-ui.utils.min.css +1 -1
- package/package.json +2 -8
- package/react/ActionsMenu/Readme.md +0 -19
- package/react/Buttons/Readme.md +1 -0
- package/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +85 -0
- package/react/ToggleButton/Readme.md +60 -0
- package/react/ToggleButton/index.js +24 -1
- package/react/ToggleButtonGroup/Readme.md +79 -17
- package/stylus/cozy-ui/build.styl +2 -0
- package/stylus/utilities/border.styl +8 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkInvertedOverrides.d.ts +79 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkNormalOverrides.d.ts +79 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightInvertedOverrides.d.ts +79 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.d.ts +79 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +79 -0
- package/transpiled/react/MuiCozyTheme/overrides/twake/makeDarkInvertedOverrides.d.ts +79 -0
- package/transpiled/react/MuiCozyTheme/overrides/twake/makeDarkNormalOverrides.d.ts +79 -0
- package/transpiled/react/MuiCozyTheme/overrides/twake/makeLightInvertedOverrides.d.ts +79 -0
- package/transpiled/react/MuiCozyTheme/overrides/twake/makeLightNormalOverrides.d.ts +79 -0
- package/transpiled/react/ToggleButton/index.js +26 -1
|
@@ -69,6 +69,85 @@ export var makeLightNormalOverrides = function makeLightNormalOverrides(theme) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
+
MuiToggleButtonGroup: {
|
|
73
|
+
groupedHorizontal: {
|
|
74
|
+
'&.rounded': {
|
|
75
|
+
marginRight: 12,
|
|
76
|
+
'&:last-child': {
|
|
77
|
+
marginRight: 0
|
|
78
|
+
},
|
|
79
|
+
'&:not(:first-child)': {
|
|
80
|
+
borderTopLeftRadius: 'inherit',
|
|
81
|
+
borderBottomLeftRadius: 'inherit',
|
|
82
|
+
marginLeft: 'inherit',
|
|
83
|
+
borderLeft: 'inherit'
|
|
84
|
+
},
|
|
85
|
+
'&:not(:last-child)': {
|
|
86
|
+
'&.rounded': {
|
|
87
|
+
borderTopRightRadius: 'inherit',
|
|
88
|
+
borderBottomRightRadius: 'inherit'
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
MuiToggleButton: {
|
|
95
|
+
root: {
|
|
96
|
+
borderRadius: 0,
|
|
97
|
+
color: theme.palette.text.secondary,
|
|
98
|
+
border: "1px solid ".concat(theme.palette.border.main),
|
|
99
|
+
padding: 15,
|
|
100
|
+
'&$selected': {
|
|
101
|
+
color: theme.palette.text.primary,
|
|
102
|
+
backgroundColor: 'transparent',
|
|
103
|
+
'&:not($disabled)': {
|
|
104
|
+
'&.customColor': {
|
|
105
|
+
'&-primary': {
|
|
106
|
+
color: theme.palette.primary.main
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
'&$disabled': {
|
|
112
|
+
color: theme.palette.text.disabled
|
|
113
|
+
},
|
|
114
|
+
'&.rounded': {
|
|
115
|
+
border: 0,
|
|
116
|
+
borderRadius: theme.shape.borderRadius,
|
|
117
|
+
padding: '10px 12px',
|
|
118
|
+
'&$selected': {
|
|
119
|
+
backgroundColor: theme.palette.action.selected,
|
|
120
|
+
'&:not($disabled)': {
|
|
121
|
+
'&.customColor': {
|
|
122
|
+
'&-primary': {
|
|
123
|
+
color: theme.palette.text.primary,
|
|
124
|
+
backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),
|
|
125
|
+
'&:hover': {
|
|
126
|
+
textDecoration: 'none',
|
|
127
|
+
backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.activatedOpacity),
|
|
128
|
+
'@media (hover: none)': {
|
|
129
|
+
backgroundColor: 'transparent'
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
sizeSmall: {
|
|
139
|
+
padding: 11,
|
|
140
|
+
'&.rounded': {
|
|
141
|
+
padding: '7px 10px'
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
sizeLarge: {
|
|
145
|
+
padding: 19,
|
|
146
|
+
'&.rounded': {
|
|
147
|
+
padding: 12
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
72
151
|
MuiButton: {
|
|
73
152
|
root: {
|
|
74
153
|
borderRadius: 2,
|
|
@@ -57,6 +57,85 @@ export function makeDarkInvertedTwakeOverrides(theme: any): {
|
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
+
MuiToggleButtonGroup: {
|
|
61
|
+
groupedHorizontal: {
|
|
62
|
+
'&.rounded': {
|
|
63
|
+
marginRight: number;
|
|
64
|
+
'&:last-child': {
|
|
65
|
+
marginRight: number;
|
|
66
|
+
};
|
|
67
|
+
'&:not(:first-child)': {
|
|
68
|
+
borderTopLeftRadius: string;
|
|
69
|
+
borderBottomLeftRadius: string;
|
|
70
|
+
marginLeft: string;
|
|
71
|
+
borderLeft: string;
|
|
72
|
+
};
|
|
73
|
+
'&:not(:last-child)': {
|
|
74
|
+
'&.rounded': {
|
|
75
|
+
borderTopRightRadius: string;
|
|
76
|
+
borderBottomRightRadius: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
MuiToggleButton: {
|
|
83
|
+
root: {
|
|
84
|
+
borderRadius: number;
|
|
85
|
+
color: any;
|
|
86
|
+
border: string;
|
|
87
|
+
padding: number;
|
|
88
|
+
'&$selected': {
|
|
89
|
+
color: any;
|
|
90
|
+
backgroundColor: string;
|
|
91
|
+
'&:not($disabled)': {
|
|
92
|
+
'&.customColor': {
|
|
93
|
+
'&-primary': {
|
|
94
|
+
color: any;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
'&$disabled': {
|
|
100
|
+
color: any;
|
|
101
|
+
};
|
|
102
|
+
'&.rounded': {
|
|
103
|
+
border: number;
|
|
104
|
+
borderRadius: any;
|
|
105
|
+
padding: string;
|
|
106
|
+
'&$selected': {
|
|
107
|
+
backgroundColor: any;
|
|
108
|
+
'&:not($disabled)': {
|
|
109
|
+
'&.customColor': {
|
|
110
|
+
'&-primary': {
|
|
111
|
+
color: any;
|
|
112
|
+
backgroundColor: string;
|
|
113
|
+
'&:hover': {
|
|
114
|
+
textDecoration: string;
|
|
115
|
+
backgroundColor: string;
|
|
116
|
+
'@media (hover: none)': {
|
|
117
|
+
backgroundColor: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
sizeSmall: {
|
|
127
|
+
padding: number;
|
|
128
|
+
'&.rounded': {
|
|
129
|
+
padding: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
sizeLarge: {
|
|
133
|
+
padding: number;
|
|
134
|
+
'&.rounded': {
|
|
135
|
+
padding: number;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
60
139
|
MuiButton: {
|
|
61
140
|
root: {
|
|
62
141
|
borderRadius: number;
|
|
@@ -57,6 +57,85 @@ export function makeDarkNormalTwakeOverrides(theme: any): {
|
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
+
MuiToggleButtonGroup: {
|
|
61
|
+
groupedHorizontal: {
|
|
62
|
+
'&.rounded': {
|
|
63
|
+
marginRight: number;
|
|
64
|
+
'&:last-child': {
|
|
65
|
+
marginRight: number;
|
|
66
|
+
};
|
|
67
|
+
'&:not(:first-child)': {
|
|
68
|
+
borderTopLeftRadius: string;
|
|
69
|
+
borderBottomLeftRadius: string;
|
|
70
|
+
marginLeft: string;
|
|
71
|
+
borderLeft: string;
|
|
72
|
+
};
|
|
73
|
+
'&:not(:last-child)': {
|
|
74
|
+
'&.rounded': {
|
|
75
|
+
borderTopRightRadius: string;
|
|
76
|
+
borderBottomRightRadius: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
MuiToggleButton: {
|
|
83
|
+
root: {
|
|
84
|
+
borderRadius: number;
|
|
85
|
+
color: any;
|
|
86
|
+
border: string;
|
|
87
|
+
padding: number;
|
|
88
|
+
'&$selected': {
|
|
89
|
+
color: any;
|
|
90
|
+
backgroundColor: string;
|
|
91
|
+
'&:not($disabled)': {
|
|
92
|
+
'&.customColor': {
|
|
93
|
+
'&-primary': {
|
|
94
|
+
color: any;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
'&$disabled': {
|
|
100
|
+
color: any;
|
|
101
|
+
};
|
|
102
|
+
'&.rounded': {
|
|
103
|
+
border: number;
|
|
104
|
+
borderRadius: any;
|
|
105
|
+
padding: string;
|
|
106
|
+
'&$selected': {
|
|
107
|
+
backgroundColor: any;
|
|
108
|
+
'&:not($disabled)': {
|
|
109
|
+
'&.customColor': {
|
|
110
|
+
'&-primary': {
|
|
111
|
+
color: any;
|
|
112
|
+
backgroundColor: string;
|
|
113
|
+
'&:hover': {
|
|
114
|
+
textDecoration: string;
|
|
115
|
+
backgroundColor: string;
|
|
116
|
+
'@media (hover: none)': {
|
|
117
|
+
backgroundColor: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
sizeSmall: {
|
|
127
|
+
padding: number;
|
|
128
|
+
'&.rounded': {
|
|
129
|
+
padding: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
sizeLarge: {
|
|
133
|
+
padding: number;
|
|
134
|
+
'&.rounded': {
|
|
135
|
+
padding: number;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
60
139
|
MuiButton: {
|
|
61
140
|
root: {
|
|
62
141
|
borderRadius: number;
|
|
@@ -57,6 +57,85 @@ export function makeLightInvertedTwakeOverrides(theme: any): {
|
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
+
MuiToggleButtonGroup: {
|
|
61
|
+
groupedHorizontal: {
|
|
62
|
+
'&.rounded': {
|
|
63
|
+
marginRight: number;
|
|
64
|
+
'&:last-child': {
|
|
65
|
+
marginRight: number;
|
|
66
|
+
};
|
|
67
|
+
'&:not(:first-child)': {
|
|
68
|
+
borderTopLeftRadius: string;
|
|
69
|
+
borderBottomLeftRadius: string;
|
|
70
|
+
marginLeft: string;
|
|
71
|
+
borderLeft: string;
|
|
72
|
+
};
|
|
73
|
+
'&:not(:last-child)': {
|
|
74
|
+
'&.rounded': {
|
|
75
|
+
borderTopRightRadius: string;
|
|
76
|
+
borderBottomRightRadius: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
MuiToggleButton: {
|
|
83
|
+
root: {
|
|
84
|
+
borderRadius: number;
|
|
85
|
+
color: any;
|
|
86
|
+
border: string;
|
|
87
|
+
padding: number;
|
|
88
|
+
'&$selected': {
|
|
89
|
+
color: any;
|
|
90
|
+
backgroundColor: string;
|
|
91
|
+
'&:not($disabled)': {
|
|
92
|
+
'&.customColor': {
|
|
93
|
+
'&-primary': {
|
|
94
|
+
color: any;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
'&$disabled': {
|
|
100
|
+
color: any;
|
|
101
|
+
};
|
|
102
|
+
'&.rounded': {
|
|
103
|
+
border: number;
|
|
104
|
+
borderRadius: any;
|
|
105
|
+
padding: string;
|
|
106
|
+
'&$selected': {
|
|
107
|
+
backgroundColor: any;
|
|
108
|
+
'&:not($disabled)': {
|
|
109
|
+
'&.customColor': {
|
|
110
|
+
'&-primary': {
|
|
111
|
+
color: any;
|
|
112
|
+
backgroundColor: string;
|
|
113
|
+
'&:hover': {
|
|
114
|
+
textDecoration: string;
|
|
115
|
+
backgroundColor: string;
|
|
116
|
+
'@media (hover: none)': {
|
|
117
|
+
backgroundColor: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
sizeSmall: {
|
|
127
|
+
padding: number;
|
|
128
|
+
'&.rounded': {
|
|
129
|
+
padding: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
sizeLarge: {
|
|
133
|
+
padding: number;
|
|
134
|
+
'&.rounded': {
|
|
135
|
+
padding: number;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
60
139
|
MuiButton: {
|
|
61
140
|
root: {
|
|
62
141
|
borderRadius: number;
|
|
@@ -57,6 +57,85 @@ export function makeLightNormalTwakeOverrides(theme: any): {
|
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
+
MuiToggleButtonGroup: {
|
|
61
|
+
groupedHorizontal: {
|
|
62
|
+
'&.rounded': {
|
|
63
|
+
marginRight: number;
|
|
64
|
+
'&:last-child': {
|
|
65
|
+
marginRight: number;
|
|
66
|
+
};
|
|
67
|
+
'&:not(:first-child)': {
|
|
68
|
+
borderTopLeftRadius: string;
|
|
69
|
+
borderBottomLeftRadius: string;
|
|
70
|
+
marginLeft: string;
|
|
71
|
+
borderLeft: string;
|
|
72
|
+
};
|
|
73
|
+
'&:not(:last-child)': {
|
|
74
|
+
'&.rounded': {
|
|
75
|
+
borderTopRightRadius: string;
|
|
76
|
+
borderBottomRightRadius: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
MuiToggleButton: {
|
|
83
|
+
root: {
|
|
84
|
+
borderRadius: number;
|
|
85
|
+
color: any;
|
|
86
|
+
border: string;
|
|
87
|
+
padding: number;
|
|
88
|
+
'&$selected': {
|
|
89
|
+
color: any;
|
|
90
|
+
backgroundColor: string;
|
|
91
|
+
'&:not($disabled)': {
|
|
92
|
+
'&.customColor': {
|
|
93
|
+
'&-primary': {
|
|
94
|
+
color: any;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
'&$disabled': {
|
|
100
|
+
color: any;
|
|
101
|
+
};
|
|
102
|
+
'&.rounded': {
|
|
103
|
+
border: number;
|
|
104
|
+
borderRadius: any;
|
|
105
|
+
padding: string;
|
|
106
|
+
'&$selected': {
|
|
107
|
+
backgroundColor: any;
|
|
108
|
+
'&:not($disabled)': {
|
|
109
|
+
'&.customColor': {
|
|
110
|
+
'&-primary': {
|
|
111
|
+
color: any;
|
|
112
|
+
backgroundColor: string;
|
|
113
|
+
'&:hover': {
|
|
114
|
+
textDecoration: string;
|
|
115
|
+
backgroundColor: string;
|
|
116
|
+
'@media (hover: none)': {
|
|
117
|
+
backgroundColor: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
sizeSmall: {
|
|
127
|
+
padding: number;
|
|
128
|
+
'&.rounded': {
|
|
129
|
+
padding: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
sizeLarge: {
|
|
133
|
+
padding: number;
|
|
134
|
+
'&.rounded': {
|
|
135
|
+
padding: number;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
60
139
|
MuiButton: {
|
|
61
140
|
root: {
|
|
62
141
|
borderRadius: number;
|
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "rounded", "color"];
|
|
4
|
+
import MuiToggleButton from '@material-ui/lab/ToggleButton';
|
|
5
|
+
import cx from 'classnames';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
var ToggleButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
9
|
+
var className = _ref.className,
|
|
10
|
+
rounded = _ref.rounded,
|
|
11
|
+
color = _ref.color,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
+
|
|
14
|
+
return /*#__PURE__*/React.createElement(MuiToggleButton, _extends({
|
|
15
|
+
ref: ref,
|
|
16
|
+
className: cx(className, {
|
|
17
|
+
rounded: rounded
|
|
18
|
+
}, "customColor-".concat(color))
|
|
19
|
+
}, props));
|
|
20
|
+
});
|
|
21
|
+
ToggleButton.displayName = 'ToggleButton';
|
|
22
|
+
ToggleButton.propTypes = {
|
|
23
|
+
className: PropTypes.string,
|
|
24
|
+
rounded: PropTypes.bool,
|
|
25
|
+
color: PropTypes.string
|
|
26
|
+
};
|
|
2
27
|
export default ToggleButton;
|