cozy-ui 121.8.0 → 122.0.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 +24 -0
- package/dist/cozy-ui.min.css +2 -2
- package/dist/cozy-ui.utils.min.css +1 -1
- package/package.json +1 -1
- package/react/SearchBar/Readme.md +11 -3
- package/react/SearchBar/index.jsx +11 -3
- package/stylus/settings/shadows.styl +3 -0
- package/stylus/utilities/bgcolor.styl +3 -0
- package/stylus/utilities/elevation.styl +3 -0
- package/transpiled/react/SearchBar/index.js +36 -26
|
@@ -32,6 +32,12 @@ var sizeToPixel = {
|
|
|
32
32
|
large: 56,
|
|
33
33
|
auto: 'auto'
|
|
34
34
|
};
|
|
35
|
+
var fontSizeToPixel = {
|
|
36
|
+
small: 14,
|
|
37
|
+
medium: 16,
|
|
38
|
+
large: 16,
|
|
39
|
+
auto: 16
|
|
40
|
+
};
|
|
35
41
|
var radiusBySize = {
|
|
36
42
|
small: 20,
|
|
37
43
|
medium: 24,
|
|
@@ -71,8 +77,12 @@ var useStyles = makeStyles(function (theme) {
|
|
|
71
77
|
},
|
|
72
78
|
inputBase: {
|
|
73
79
|
flex: 1,
|
|
74
|
-
|
|
75
|
-
var
|
|
80
|
+
fontSize: function fontSize(_ref3) {
|
|
81
|
+
var size = _ref3.size;
|
|
82
|
+
return isTwakeTheme() ? fontSizeToPixel[size] : 16;
|
|
83
|
+
},
|
|
84
|
+
paddingLeft: function paddingLeft(_ref4) {
|
|
85
|
+
var icon = _ref4.icon;
|
|
76
86
|
return !icon && '1rem';
|
|
77
87
|
}
|
|
78
88
|
},
|
|
@@ -85,8 +95,8 @@ var useStyles = makeStyles(function (theme) {
|
|
|
85
95
|
typography: {
|
|
86
96
|
color: 'currentColor',
|
|
87
97
|
opacity: 0.42,
|
|
88
|
-
paddingLeft: function paddingLeft(
|
|
89
|
-
var icon =
|
|
98
|
+
paddingLeft: function paddingLeft(_ref5) {
|
|
99
|
+
var icon = _ref5.icon;
|
|
90
100
|
return !icon && '1rem';
|
|
91
101
|
}
|
|
92
102
|
},
|
|
@@ -128,27 +138,27 @@ var useStyles = makeStyles(function (theme) {
|
|
|
128
138
|
}
|
|
129
139
|
};
|
|
130
140
|
});
|
|
131
|
-
var SearchBar = /*#__PURE__*/forwardRef(function (
|
|
141
|
+
var SearchBar = /*#__PURE__*/forwardRef(function (_ref6, ref) {
|
|
132
142
|
var _cx, _componentsProps$inpu;
|
|
133
143
|
|
|
134
|
-
var placeholderProp =
|
|
135
|
-
icon =
|
|
136
|
-
size =
|
|
137
|
-
type =
|
|
138
|
-
labelProp =
|
|
139
|
-
componentsProps =
|
|
140
|
-
disabledClear =
|
|
141
|
-
disabledFocus =
|
|
142
|
-
className =
|
|
143
|
-
defaultValue =
|
|
144
|
-
value =
|
|
145
|
-
elevation =
|
|
146
|
-
disabled =
|
|
147
|
-
onChange =
|
|
148
|
-
onClear =
|
|
149
|
-
onFocus =
|
|
150
|
-
onBlur =
|
|
151
|
-
props = _objectWithoutProperties(
|
|
144
|
+
var placeholderProp = _ref6.placeholder,
|
|
145
|
+
icon = _ref6.icon,
|
|
146
|
+
size = _ref6.size,
|
|
147
|
+
type = _ref6.type,
|
|
148
|
+
labelProp = _ref6.label,
|
|
149
|
+
componentsProps = _ref6.componentsProps,
|
|
150
|
+
disabledClear = _ref6.disabledClear,
|
|
151
|
+
disabledFocus = _ref6.disabledFocus,
|
|
152
|
+
className = _ref6.className,
|
|
153
|
+
defaultValue = _ref6.defaultValue,
|
|
154
|
+
value = _ref6.value,
|
|
155
|
+
elevation = _ref6.elevation,
|
|
156
|
+
disabled = _ref6.disabled,
|
|
157
|
+
onChange = _ref6.onChange,
|
|
158
|
+
onClear = _ref6.onClear,
|
|
159
|
+
onFocus = _ref6.onFocus,
|
|
160
|
+
onBlur = _ref6.onBlur,
|
|
161
|
+
props = _objectWithoutProperties(_ref6, _excluded);
|
|
152
162
|
|
|
153
163
|
var _useI18n = useI18n(),
|
|
154
164
|
t = _useI18n.t;
|
|
@@ -211,7 +221,7 @@ var SearchBar = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
211
221
|
|
|
212
222
|
return /*#__PURE__*/React.createElement(Paper, _extends({
|
|
213
223
|
component: "form",
|
|
214
|
-
elevation: elevation
|
|
224
|
+
elevation: elevation,
|
|
215
225
|
className: cx(className, classes.root, (_cx = {}, _defineProperty(_cx, classes.flat, !elevation), _defineProperty(_cx, classes.elevation, elevation), _defineProperty(_cx, classes.focused, isFocused && !disabledFocus), _defineProperty(_cx, classes.disabled, disabled), _cx)),
|
|
216
226
|
ref: ref
|
|
217
227
|
}, props), type === 'button' ? /*#__PURE__*/React.createElement(ButtonBase, {
|
|
@@ -246,7 +256,7 @@ var SearchBar = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
246
256
|
});
|
|
247
257
|
SearchBar.displayName = 'SearchBar';
|
|
248
258
|
SearchBar.defaultProps = {
|
|
249
|
-
elevation:
|
|
259
|
+
elevation: 1,
|
|
250
260
|
icon: MagnifierIcon,
|
|
251
261
|
size: 'small',
|
|
252
262
|
type: 'search',
|
|
@@ -275,7 +285,7 @@ SearchBar.propTypes = {
|
|
|
275
285
|
defaultValue: PropTypes.string,
|
|
276
286
|
disabledClear: PropTypes.bool,
|
|
277
287
|
disabledFocus: PropTypes.bool,
|
|
278
|
-
elevation: PropTypes.
|
|
288
|
+
elevation: PropTypes.number,
|
|
279
289
|
placeholder: PropTypes.string,
|
|
280
290
|
label: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object]),
|
|
281
291
|
disabled: PropTypes.bool,
|