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.
@@ -1,4 +1,7 @@
1
1
  @require '../settings/shadows'
2
2
 
3
+ .u-elevation-0
4
+ @extend $elevation-0
5
+
3
6
  .u-elevation-1
4
7
  @extend $elevation-1
@@ -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
- paddingLeft: function paddingLeft(_ref3) {
75
- var icon = _ref3.icon;
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(_ref4) {
89
- var icon = _ref4.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 (_ref5, ref) {
141
+ var SearchBar = /*#__PURE__*/forwardRef(function (_ref6, ref) {
132
142
  var _cx, _componentsProps$inpu;
133
143
 
134
- var placeholderProp = _ref5.placeholder,
135
- icon = _ref5.icon,
136
- size = _ref5.size,
137
- type = _ref5.type,
138
- labelProp = _ref5.label,
139
- componentsProps = _ref5.componentsProps,
140
- disabledClear = _ref5.disabledClear,
141
- disabledFocus = _ref5.disabledFocus,
142
- className = _ref5.className,
143
- defaultValue = _ref5.defaultValue,
144
- value = _ref5.value,
145
- elevation = _ref5.elevation,
146
- disabled = _ref5.disabled,
147
- onChange = _ref5.onChange,
148
- onClear = _ref5.onClear,
149
- onFocus = _ref5.onFocus,
150
- onBlur = _ref5.onBlur,
151
- props = _objectWithoutProperties(_ref5, _excluded);
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 ? 1 : 0,
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: true,
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.bool,
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,