@telefonica/mistica 10.0.1 → 10.3.1

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/button-fixed-footer-layout.d.ts +2 -2
  3. package/dist/button-layout.d.ts +2 -2
  4. package/dist/button.d.ts +1 -1
  5. package/dist/callout.d.ts +4 -3
  6. package/dist/card.d.ts +9 -7
  7. package/dist/circle.d.ts +1 -1
  8. package/dist/dialog.d.ts +1 -1
  9. package/dist/double-field.d.ts +11 -1
  10. package/dist/double-field.js.flow +20 -20
  11. package/dist/empty-state-card.d.ts +1 -1
  12. package/dist/empty-state-card.js.flow +0 -1
  13. package/dist/empty-state.d.ts +1 -1
  14. package/dist/empty-state.js.flow +0 -1
  15. package/dist/feedback-screen.d.ts +4 -3
  16. package/dist/header.d.ts +7 -5
  17. package/dist/highlighted-card.d.ts +2 -2
  18. package/dist/icon-button.js +4 -6
  19. package/dist/list.js +9 -14
  20. package/dist/navigation-bar.d.ts +16 -4
  21. package/dist/navigation-bar.js +123 -88
  22. package/dist/navigation-bar.js.flow +20 -4
  23. package/dist/navigation-breadcrumbs.d.ts +1 -1
  24. package/dist/navigation-breadcrumbs.js.flow +1 -1
  25. package/dist/password-field.js +16 -8
  26. package/dist/radio-button.d.ts +1 -1
  27. package/dist/section-title.d.ts +2 -1
  28. package/dist/select.js +74 -65
  29. package/dist/skins/movistar.js +1 -1
  30. package/dist/skins/o2-classic.js +1 -1
  31. package/dist/skins/o2.js +1 -1
  32. package/dist/skins/telefonica.js +1 -1
  33. package/dist/skins/vivo.js +1 -1
  34. package/dist/switch-component.d.ts +1 -1
  35. package/dist/tabs.js +10 -8
  36. package/dist/tag.d.ts +2 -2
  37. package/dist/tag.js.flow +2 -2
  38. package/dist/text-field-base.js +80 -50
  39. package/dist/text-field-components.d.ts +1 -0
  40. package/dist/text-field-components.js +18 -9
  41. package/dist/text-field-components.js.flow +1 -0
  42. package/dist/text-link.d.ts +2 -2
  43. package/dist/text-link.js +20 -23
  44. package/dist/text-link.js.flow +2 -2
  45. package/dist/theme-context-provider.js +2 -2
  46. package/dist/theme.d.ts +2 -0
  47. package/dist/theme.js +8 -4
  48. package/dist/theme.js.flow +2 -0
  49. package/dist/utils/media-queries.d.ts +1 -0
  50. package/dist/utils/media-queries.js +6 -1
  51. package/dist/utils/media-queries.js.flow +1 -0
  52. package/dist-es/icon-button.js +4 -5
  53. package/dist-es/list.js +9 -14
  54. package/dist-es/navigation-bar.js +122 -88
  55. package/dist-es/password-field.js +16 -8
  56. package/dist-es/select.js +74 -65
  57. package/dist-es/skins/movistar.js +1 -1
  58. package/dist-es/skins/o2-classic.js +1 -1
  59. package/dist-es/skins/o2.js +1 -1
  60. package/dist-es/skins/telefonica.js +1 -1
  61. package/dist-es/skins/vivo.js +1 -1
  62. package/dist-es/tabs.js +10 -8
  63. package/dist-es/text-field-base.js +80 -50
  64. package/dist-es/text-field-components.js +18 -9
  65. package/dist-es/text-link.js +7 -10
  66. package/dist-es/theme-context-provider.js +2 -2
  67. package/dist-es/theme.js +8 -4
  68. package/dist-es/utils/media-queries.js +6 -1
  69. package/package.json +2 -1
package/dist/select.js CHANGED
@@ -132,7 +132,7 @@ function _defineProperty(obj, key, value) {
132
132
  }
133
133
 
134
134
  var useStyles = (0, _jss.createUseStyles)(function (theme) {
135
- var _selectContainer;
135
+ var _selectContainer, _menuItem;
136
136
 
137
137
  return {
138
138
  selectContainer: (_selectContainer = {
@@ -152,7 +152,8 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
152
152
  }), _selectContainer),
153
153
  select: {
154
154
  fontFamily: 'inherit',
155
- backgroundColor: theme.colors.backgroundContainer,
155
+ backgroundColor: 'transparent',
156
+ // FieldContainer gives the correct background color
156
157
  paddingTop: function paddingTop(_ref3) {
157
158
  var label = _ref3.label;
158
159
  return label ? 24 : 16;
@@ -171,51 +172,60 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
171
172
  height: '100%',
172
173
  textOverflow: 'ellipsis',
173
174
  '&:disabled': {
174
- color: theme.colors.border
175
+ color: theme.colors.textDisabled
175
176
  },
176
177
  appearance: 'none',
177
178
  cursor: function cursor(_ref5) {
178
179
  var disabled = _ref5.disabled;
179
- return disabled ? 'initial' : 'pointer';
180
+ return disabled ? 'inherit' : 'pointer';
180
181
  }
181
182
  },
182
183
  arrowDown: {
183
184
  position: 'absolute',
184
185
  right: 16,
185
186
  top: 'calc(50% - 12px)',
186
- pointerEvents: 'none'
187
+ pointerEvents: 'none',
188
+ opacity: function opacity(_ref6) {
189
+ var disabled = _ref6.disabled;
190
+ return disabled ? 0.3 : 1;
191
+ }
187
192
  },
188
193
  selectText: {
189
194
  position: 'absolute',
190
195
  pointerEvents: 'none',
191
- left: 12,
192
- top: function top(_ref6) {
193
- var label = _ref6.label;
196
+ left: 12 + 1,
197
+ // 12 for select paddingLeft and +1 for border
198
+ right: 48 + 1,
199
+ // 48 for icon and +1 for border
200
+ overflow: 'hidden',
201
+ top: function top(_ref7) {
202
+ var label = _ref7.label;
194
203
  return label ? 27 : 17;
195
204
  },
196
205
  fontSize: 16,
197
- color: function color(_ref7) {
198
- var disabled = _ref7.disabled;
206
+ color: function color(_ref8) {
207
+ var disabled = _ref8.disabled;
199
208
  return disabled ? theme.colors.textDisabled : theme.colors.textPrimary;
200
209
  },
201
210
  maxWidth: '100%',
202
- textOverflow: 'ellipsis'
211
+ textOverflow: 'ellipsis',
212
+ whiteSpace: 'nowrap'
203
213
  },
204
214
  optionsContainer: {
205
215
  margin: 0,
206
216
  padding: 0,
207
217
  listStyleType: 'none',
208
218
  position: 'absolute',
209
- top: function top(_ref8) {
210
- var optionsComputedProps = _ref8.optionsComputedProps;
219
+ top: function top(_ref9) {
220
+ var optionsComputedProps = _ref9.optionsComputedProps;
211
221
  return optionsComputedProps.top;
212
222
  },
213
- left: function left(_ref9) {
214
- var optionsComputedProps = _ref9.optionsComputedProps;
223
+ left: function left(_ref10) {
224
+ var optionsComputedProps = _ref10.optionsComputedProps;
215
225
  return optionsComputedProps.left;
216
226
  },
217
- width: function width(_ref10) {
218
- var optionsComputedProps = _ref10.optionsComputedProps;
227
+ minWidth: function minWidth(_ref11) {
228
+ var optionsComputedProps = _ref11.optionsComputedProps;
219
229
  return optionsComputedProps.width;
220
230
  },
221
231
  borderRadius: 4,
@@ -223,23 +233,23 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
223
233
  backgroundColor: theme.colors.backgroundContainer,
224
234
  paddingTop: 8,
225
235
  paddingBottom: 8,
226
- transformOrigin: function transformOrigin(_ref11) {
227
- var optionsComputedProps = _ref11.optionsComputedProps;
236
+ transformOrigin: function transformOrigin(_ref12) {
237
+ var optionsComputedProps = _ref12.optionsComputedProps;
228
238
  return optionsComputedProps.transformOrigin;
229
239
  },
230
240
  transition: 'opacity .03s linear,transform .12s cubic-bezier(0,0,.2,1) .15s',
231
- opacity: function opacity(_ref12) {
232
- var animateShowOptions = _ref12.animateShowOptions;
241
+ opacity: function opacity(_ref13) {
242
+ var animateShowOptions = _ref13.animateShowOptions;
233
243
  return animateShowOptions ? 1 : 0;
234
244
  },
235
- transform: function transform(_ref13) {
236
- var animateShowOptions = _ref13.animateShowOptions;
245
+ transform: function transform(_ref14) {
246
+ var animateShowOptions = _ref14.animateShowOptions;
237
247
  return animateShowOptions ? 'scale(1)' : 'scale(0)';
238
248
  },
239
- maxHeight: function maxHeight(_ref14) {
249
+ maxHeight: function maxHeight(_ref15) {
240
250
  var _optionsComputedProps;
241
251
 
242
- var optionsComputedProps = _ref14.optionsComputedProps;
252
+ var optionsComputedProps = _ref15.optionsComputedProps;
243
253
  return (_optionsComputedProps = optionsComputedProps.maxHeight) !== null && _optionsComputedProps !== void 0 ? _optionsComputedProps : '416px';
244
254
  },
245
255
  overflowY: 'auto'
@@ -247,40 +257,38 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
247
257
  menuItemSelected: {
248
258
  backgroundColor: 'rgba(0, 0, 0, 0.14)'
249
259
  },
250
- menuItem: {
260
+ menuItem: (_menuItem = {
251
261
  color: theme.colors.textPrimary,
252
262
  lineHeight: 1.5,
253
263
  padding: '6px 16px',
254
264
  height: 48,
255
- transition: 'background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',
265
+ transition: 'background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms'
266
+ }, _defineProperty(_menuItem, theme.mq.supportsHover, {
256
267
  '&:hover': {
257
268
  backgroundColor: 'rgba(0, 0, 0, 0.08)'
258
- },
259
- display: 'flex',
260
- alignItems: 'center',
261
- cursor: 'pointer'
262
- }
269
+ }
270
+ }), _defineProperty(_menuItem, "display", 'flex'), _defineProperty(_menuItem, "alignItems", 'center'), _defineProperty(_menuItem, "cursor", 'pointer'), _menuItem)
263
271
  };
264
272
  });
265
273
 
266
- var Select = function Select(_ref15) {
267
- var _ref19, _inputRef$current;
268
-
269
- var id = _ref15.id,
270
- label = _ref15.label,
271
- helperTextProp = _ref15.helperText,
272
- valueProp = _ref15.value,
273
- onChangeValueProp = _ref15.onChangeValue,
274
- name = _ref15.name,
275
- fullWidth = _ref15.fullWidth,
276
- options = _ref15.options,
277
- optional = _ref15.optional,
278
- disabledProp = _ref15.disabled,
279
- errorProp = _ref15.error,
280
- _onBlur = _ref15.onBlur,
281
- _ref15$autoFocus = _ref15.autoFocus,
282
- autoFocus = _ref15$autoFocus === void 0 ? false : _ref15$autoFocus,
283
- native = _ref15.native;
274
+ var Select = function Select(_ref16) {
275
+ var _ref20, _inputRef$current;
276
+
277
+ var id = _ref16.id,
278
+ label = _ref16.label,
279
+ helperTextProp = _ref16.helperText,
280
+ valueProp = _ref16.value,
281
+ onChangeValueProp = _ref16.onChangeValue,
282
+ name = _ref16.name,
283
+ fullWidth = _ref16.fullWidth,
284
+ options = _ref16.options,
285
+ optional = _ref16.optional,
286
+ disabledProp = _ref16.disabled,
287
+ errorProp = _ref16.error,
288
+ _onBlur = _ref16.onBlur,
289
+ _ref16$autoFocus = _ref16.autoFocus,
290
+ autoFocus = _ref16$autoFocus === void 0 ? false : _ref16$autoFocus,
291
+ native = _ref16.native;
284
292
  var inputRef = React.useRef(null);
285
293
  var focusableRef = React.useRef(null);
286
294
  var fieldRef = React.useRef(null);
@@ -483,8 +491,8 @@ var Select = function Select(_ref15) {
483
491
  var _options$value, _options;
484
492
 
485
493
  (0, _dom.cancelEvent)(e);
486
- var newTentativeValueState = (_options$value = (_options = options[options.findIndex(function (_ref16) {
487
- var value = _ref16.value;
494
+ var newTentativeValueState = (_options$value = (_options = options[options.findIndex(function (_ref17) {
495
+ var value = _ref17.value;
488
496
  return value === tentativeValueState;
489
497
  }) + operand]) === null || _options === void 0 ? void 0 : _options.value) !== null && _options$value !== void 0 ? _options$value : tentativeValueState;
490
498
  setTentativeValueState(newTentativeValueState);
@@ -505,8 +513,8 @@ var Select = function Select(_ref15) {
505
513
  if (e.keyCode === _keyCodes.ENTER || e.keyCode === _keyCodes.SPACE) {
506
514
  (0, _dom.cancelEvent)(e);
507
515
 
508
- if (options.findIndex(function (_ref17) {
509
- var value = _ref17.value;
516
+ if (options.findIndex(function (_ref18) {
517
+ var value = _ref18.value;
510
518
  return value === tentativeValueState;
511
519
  }) !== -1 && tentativeValueState !== valueState) {
512
520
  setValue(tentativeValueState);
@@ -544,8 +552,8 @@ var Select = function Select(_ref15) {
544
552
  var getOptionText = function getOptionText(val) {
545
553
  var _options$find;
546
554
 
547
- return val ? (_options$find = options.find(function (_ref18) {
548
- var value = _ref18.value;
555
+ return val ? (_options$find = options.find(function (_ref19) {
556
+ var value = _ref19.value;
549
557
  return value === val;
550
558
  })) === null || _options$find === void 0 ? void 0 : _options$find.text : '';
551
559
  };
@@ -570,6 +578,7 @@ var Select = function Select(_ref15) {
570
578
  }
571
579
  };
572
580
  return shouldUseNative ? /*#__PURE__*/React.createElement(_textFieldComponents.FieldContainer, {
581
+ disabled: disabled,
573
582
  helperText: /*#__PURE__*/React.createElement(_textFieldComponents.HelperText, {
574
583
  error: error,
575
584
  leftText: helperText
@@ -579,7 +588,7 @@ var Select = function Select(_ref15) {
579
588
  }, label && /*#__PURE__*/React.createElement(_textFieldComponents.Label, {
580
589
  error: error,
581
590
  forId: inputId,
582
- inputState: isFocused ? 'focused' : ((_ref19 = value !== null && value !== void 0 ? value : valueState) !== null && _ref19 !== void 0 ? _ref19 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value) ? 'filled' : 'default',
591
+ inputState: isFocused ? 'focused' : ((_ref20 = value !== null && value !== void 0 ? value : valueState) !== null && _ref20 !== void 0 ? _ref20 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value) ? 'filled' : 'default',
583
592
  disabled: disabled,
584
593
  optional: optional
585
594
  }, label), /*#__PURE__*/React.createElement("select", {
@@ -612,8 +621,8 @@ var Select = function Select(_ref15) {
612
621
  // Without this fix, the label is invisible when disabled
613
622
  opacity: 1
614
623
  }
615
- }, options.every(function (_ref20) {
616
- var value = _ref20.value;
624
+ }, options.every(function (_ref21) {
625
+ var value = _ref21.value;
617
626
  return !!value;
618
627
  }) &&
619
628
  /*#__PURE__*/
@@ -624,9 +633,9 @@ var Select = function Select(_ref15) {
624
633
  style: {
625
634
  display: 'none'
626
635
  }
627
- }), options.map(function (_ref21) {
628
- var val = _ref21.value,
629
- text = _ref21.text;
636
+ }), options.map(function (_ref22) {
637
+ var val = _ref22.value,
638
+ text = _ref22.text;
630
639
  return /*#__PURE__*/React.createElement("option", {
631
640
  key: val,
632
641
  value: val
@@ -670,9 +679,9 @@ var Select = function Select(_ref15) {
670
679
  className: classes.optionsContainer,
671
680
  role: "listbox",
672
681
  ref: optionsMenuRef
673
- }, options.map(function (_ref22) {
674
- var val = _ref22.value,
675
- text = _ref22.text;
682
+ }, options.map(function (_ref23) {
683
+ var val = _ref23.value,
684
+ text = _ref23.text;
676
685
  return /*#__PURE__*/React.createElement("li", {
677
686
  role: "option",
678
687
  "aria-selected": val === (valueState !== null && valueState !== void 0 ? valueState : value),
@@ -138,7 +138,7 @@ var getMovistarSkin = function getMovistarSkin(variant) {
138
138
  textPrimaryInverse: palette.white,
139
139
  textSecondary: palette.grey5,
140
140
  textSecondaryInverse: palette.white,
141
- textDisabled: palette.grey3,
141
+ textDisabled: palette.grey4,
142
142
  textAmount: palette.movistarBlue,
143
143
  // STATES
144
144
  error: palette.pepper,
@@ -144,7 +144,7 @@ var getO2ClassicSkin = function getO2ClassicSkin() {
144
144
  textPrimaryInverse: palette.white,
145
145
  textSecondary: palette.grey5,
146
146
  textSecondaryInverse: palette.white,
147
- textDisabled: palette.grey3,
147
+ textDisabled: palette.grey4,
148
148
  textAmount: palette.o2SkyBlue,
149
149
  // STATES
150
150
  error: palette.pepper,
package/dist/skins/o2.js CHANGED
@@ -144,7 +144,7 @@ var getO2Skin = function getO2Skin() {
144
144
  textPrimaryInverse: palette.white,
145
145
  textSecondary: palette.grey5,
146
146
  textSecondaryInverse: palette.white,
147
- textDisabled: palette.grey3,
147
+ textDisabled: palette.grey4,
148
148
  textAmount: palette.o2BluePrimary,
149
149
  // STATES
150
150
  error: palette.pepper,
@@ -138,7 +138,7 @@ var getTelefonicaSkin = function getTelefonicaSkin() {
138
138
  textPrimaryInverse: palette.white,
139
139
  textSecondary: palette.grey5,
140
140
  textSecondaryInverse: palette.white,
141
- textDisabled: palette.grey3,
141
+ textDisabled: palette.grey4,
142
142
  textAmount: palette.telefonicaBlue,
143
143
  // STATES
144
144
  error: palette.coral,
@@ -132,7 +132,7 @@ var getVivoSkin = function getVivoSkin() {
132
132
  textPrimaryInverse: palette.white,
133
133
  textSecondary: palette.grey5,
134
134
  textSecondaryInverse: palette.white,
135
- textDisabled: palette.grey3,
135
+ textDisabled: palette.grey4,
136
136
  textAmount: palette.vivoPurple,
137
137
  // STATES
138
138
  error: palette.pepper,
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { DataAttributes } from './utils/types';
3
- declare type RenderSwitch = (switchElement: React.ReactElement<any>, labelId: string) => React.ReactNode;
3
+ declare type RenderSwitch = (switchElement: React.ReactElement, labelId: string) => React.ReactNode;
4
4
  declare type PropsRender = {
5
5
  name: string;
6
6
  defaultChecked?: boolean;
package/dist/tabs.js CHANGED
@@ -111,6 +111,8 @@ var TAB_MAX_WIDTH = 284;
111
111
  var TAB_HEIGHT = 56;
112
112
  var LINE_ANIMATION_DURATION_MS = (0, _platform.isRunningAcceptanceTest)() ? 0 : 300;
113
113
  var useStyles = (0, _jss.createUseStyles)(function (_ref) {
114
+ var _tab;
115
+
114
116
  var colors = _ref.colors,
115
117
  mq = _ref.mq;
116
118
  return {
@@ -138,7 +140,7 @@ var useStyles = (0, _jss.createUseStyles)(function (_ref) {
138
140
  height: TAB_HEIGHT,
139
141
  display: 'flex'
140
142
  },
141
- tab: _defineProperty({
143
+ tab: (_tab = {
142
144
  flex: '1 0 80px',
143
145
  display: 'inline-flex',
144
146
  alignItems: 'center',
@@ -160,19 +162,19 @@ var useStyles = (0, _jss.createUseStyles)(function (_ref) {
160
162
  }
161
163
 
162
164
  return TAB_MAX_WIDTH;
163
- },
165
+ }
166
+ }, _defineProperty(_tab, mq.supportsHover, {
164
167
  '&:hover': {
165
168
  color: colors.textPrimary
166
- },
167
- fallbacks: {
168
- maxWidth: TAB_MAX_WIDTH // max() is not supported by all browsers
169
-
170
169
  }
171
- }, mq.desktopOrBigger, {
170
+ }), _defineProperty(_tab, "fallbacks", {
171
+ maxWidth: TAB_MAX_WIDTH // max() is not supported by all browsers
172
+
173
+ }), _defineProperty(_tab, mq.desktopOrBigger, {
172
174
  flex: '0 1 208px',
173
175
  padding: "16px 32px",
174
176
  maxWidth: TAB_MAX_WIDTH
175
- }),
177
+ }), _tab),
176
178
  tabWithIcon: _defineProperty({
177
179
  flexBasis: 112
178
180
  }, mq.desktopOrBigger, {
package/dist/tag.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- declare type Props = {
2
+ export declare type TagProps = {
3
3
  children: string;
4
4
  color: string;
5
5
  };
6
- declare const Tag: React.FC<Props>;
6
+ declare const Tag: React.FC<TagProps>;
7
7
  export default Tag;
package/dist/tag.js.flow CHANGED
@@ -1,9 +1,9 @@
1
1
  // @flow
2
2
 
3
3
  import * as React from "react";
4
- declare type Props = {
4
+ export type TagProps = {
5
5
  children: string,
6
6
  color: string,
7
7
  };
8
- declare var Tag: React.ComponentType<Props>;
8
+ declare var Tag: React.ComponentType<TagProps>;
9
9
  declare export default typeof Tag;
@@ -244,7 +244,8 @@ var commonInputStyles = function commonInputStyles(theme) {
244
244
  }
245
245
  },
246
246
  '&:disabled': {
247
- color: theme.colors.border
247
+ color: theme.colors.textDisabled,
248
+ cursor: 'not-allowed'
248
249
  },
249
250
  boxShadow: 'none' // reset FF red shadow styles for required inputs
250
251
 
@@ -342,7 +343,11 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
342
343
  paddingLeft: 8,
343
344
  paddingRight: 16,
344
345
  display: 'flex',
345
- alignItems: 'center'
346
+ alignItems: 'center',
347
+ opacity: function opacity(_ref8) {
348
+ var disabled = _ref8.disabled;
349
+ return disabled ? 0.3 : 1;
350
+ }
346
351
  },
347
352
  startIcon: {
348
353
  pointerEvents: 'none',
@@ -352,24 +357,31 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
352
357
  display: 'flex',
353
358
  alignItems: 'center',
354
359
  height: '100%',
355
- position: 'absolute'
360
+ position: 'absolute',
361
+ opacity: function opacity(_ref9) {
362
+ var disabled = _ref9.disabled;
363
+ return disabled ? 0.3 : 1;
364
+ }
356
365
  },
357
366
  prefix: {
358
- paddingTop: function paddingTop(_ref8) {
359
- var hasLabel = _ref8.hasLabel;
367
+ paddingTop: function paddingTop(_ref10) {
368
+ var hasLabel = _ref10.hasLabel;
360
369
  return hasLabel ? 25 : 16;
361
370
  },
362
- paddingBottom: function paddingBottom(_ref9) {
363
- var hasLabel = _ref9.hasLabel;
371
+ paddingBottom: function paddingBottom(_ref11) {
372
+ var hasLabel = _ref11.hasLabel;
364
373
  return hasLabel ? 8 : 16;
365
374
  },
366
375
  paddingLeft: 12,
367
376
  paddingRight: 16,
368
377
  display: 'flex',
369
378
  alignItems: 'center',
370
- color: theme.colors.textSecondary,
371
- opacity: function opacity(_ref10) {
372
- var inputState = _ref10.inputState;
379
+ color: function color(_ref12) {
380
+ var disabled = _ref12.disabled;
381
+ return disabled ? theme.colors.textDisabled : theme.colors.textSecondary;
382
+ },
383
+ opacity: function opacity(_ref13) {
384
+ var inputState = _ref13.inputState;
373
385
  return inputState === 'default' ? 0 : 1;
374
386
  },
375
387
  transition: 'opacity 150ms cubic-bezier(0.0, 0, 0.2, 1) 0ms'
@@ -381,33 +393,33 @@ var fixAutoComplete = function fixAutoComplete(platformOverrides, autoComplete)
381
393
  return autoComplete === 'off' && (0, _platform.isChrome)(platformOverrides) ? 'nope' : autoComplete;
382
394
  };
383
395
 
384
- var TextFieldBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
396
+ var TextFieldBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
385
397
  var _defaultValue$length;
386
398
 
387
- var error = _ref11.error,
388
- helperText = _ref11.helperText,
389
- label = _ref11.label,
390
- inputProps = _ref11.inputProps,
391
- inputRef = _ref11.inputRef,
392
- defaultValue = _ref11.defaultValue,
393
- value = _ref11.value,
394
- _onFocus = _ref11.onFocus,
395
- _onBlur = _ref11.onBlur,
396
- inputComponent = _ref11.inputComponent,
397
- prefix = _ref11.prefix,
398
- startIcon = _ref11.startIcon,
399
- endIcon = _ref11.endIcon,
400
- endIconOverlay = _ref11.endIconOverlay,
401
- shrinkLabelProp = _ref11.shrinkLabel,
402
- _ref11$multiline = _ref11.multiline,
403
- multiline = _ref11$multiline === void 0 ? false : _ref11$multiline,
404
- focus = _ref11.focus,
405
- fieldRef = _ref11.fieldRef,
406
- maxLength = _ref11.maxLength,
407
- idProp = _ref11.id,
408
- autoCompleteProp = _ref11.autoComplete,
409
- fullWidth = _ref11.fullWidth,
410
- rest = _objectWithoutProperties(_ref11, _excluded);
399
+ var error = _ref14.error,
400
+ helperText = _ref14.helperText,
401
+ label = _ref14.label,
402
+ inputProps = _ref14.inputProps,
403
+ inputRef = _ref14.inputRef,
404
+ defaultValue = _ref14.defaultValue,
405
+ value = _ref14.value,
406
+ _onFocus = _ref14.onFocus,
407
+ _onBlur = _ref14.onBlur,
408
+ inputComponent = _ref14.inputComponent,
409
+ prefix = _ref14.prefix,
410
+ startIcon = _ref14.startIcon,
411
+ endIcon = _ref14.endIcon,
412
+ endIconOverlay = _ref14.endIconOverlay,
413
+ shrinkLabelProp = _ref14.shrinkLabel,
414
+ _ref14$multiline = _ref14.multiline,
415
+ multiline = _ref14$multiline === void 0 ? false : _ref14$multiline,
416
+ focus = _ref14.focus,
417
+ fieldRef = _ref14.fieldRef,
418
+ maxLength = _ref14.maxLength,
419
+ idProp = _ref14.id,
420
+ autoCompleteProp = _ref14.autoComplete,
421
+ fullWidth = _ref14.fullWidth,
422
+ rest = _objectWithoutProperties(_ref14, _excluded);
411
423
 
412
424
  var id = (0, _hooks.useAriaId)(idProp);
413
425
 
@@ -437,7 +449,8 @@ var TextFieldBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref11, ref
437
449
  hasLabel: hasLabel,
438
450
  prefix: prefix,
439
451
  multiline: multiline,
440
- type: rest.type
452
+ type: rest.type,
453
+ disabled: rest.disabled
441
454
  });
442
455
  React.useEffect(function () {
443
456
  if (inputState !== 'focused' && value !== null && value !== void 0 && value.length) {
@@ -476,7 +489,27 @@ var TextFieldBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref11, ref
476
489
  autoComplete: fixAutoComplete(platformOverrides, autoCompleteProp)
477
490
  }, inputProps);
478
491
 
492
+ var labelStyle = {};
493
+ var isShrinked = shrinkLabel || inputState === 'focused' || inputState === 'filled';
494
+
495
+ if (startIcon) {
496
+ labelStyle = isShrinked ? {
497
+ left: 48,
498
+ right: 0,
499
+ width: 'auto'
500
+ } : {
501
+ left: 48,
502
+ right: 12,
503
+ width: 'auto'
504
+ };
505
+ } else if (endIcon && !isShrinked) {
506
+ labelStyle = {
507
+ paddingRight: 36
508
+ };
509
+ }
510
+
479
511
  return /*#__PURE__*/React.createElement(_textFieldComponents.FieldContainer, {
512
+ disabled: rest.disabled,
480
513
  helperText: /*#__PURE__*/React.createElement(_textFieldComponents.HelperText, {
481
514
  error: error,
482
515
  leftText: helperText,
@@ -522,10 +555,7 @@ var TextFieldBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref11, ref
522
555
  }, error && {
523
556
  'aria-invalid': true
524
557
  })), label && /*#__PURE__*/React.createElement(_textFieldComponents.Label, {
525
- style: startIcon ? {
526
- marginLeft: 48,
527
- left: 0
528
- } : {},
558
+ style: labelStyle,
529
559
  error: error,
530
560
  forId: id,
531
561
  inputState: inputState,
@@ -572,10 +602,10 @@ var Autosuggest = /*#__PURE__*/React.lazy(function () {
572
602
  /* webpackChunkName: "react-autosuggest" */
573
603
  'react-autosuggest');
574
604
  });
575
- var TextFieldBase = /*#__PURE__*/React.forwardRef(function (_ref12, ref) {
576
- var getSuggestions = _ref12.getSuggestions,
577
- idProp = _ref12.id,
578
- props = _objectWithoutProperties(_ref12, _excluded2);
605
+ var TextFieldBase = /*#__PURE__*/React.forwardRef(function (_ref15, ref) {
606
+ var getSuggestions = _ref15.getSuggestions,
607
+ idProp = _ref15.id,
608
+ props = _objectWithoutProperties(_ref15, _excluded2);
579
609
 
580
610
  var _React$useState5 = React.useState([]),
581
611
  _React$useState6 = _slicedToArray(_React$useState5, 2),
@@ -612,10 +642,10 @@ var TextFieldBase = /*#__PURE__*/React.forwardRef(function (_ref12, ref) {
612
642
  id: id,
613
643
  autoComplete: fixAutoComplete(platformOverrides, 'off'),
614
644
  // @ts-expect-error Autosuggest expects slightly different types
615
- onChange: function onChange(e, _ref13) {
645
+ onChange: function onChange(e, _ref16) {
616
646
  var _props$onChange2;
617
647
 
618
- var newValue = _ref13.newValue; // hack to mutate event value
648
+ var newValue = _ref16.newValue; // hack to mutate event value
619
649
 
620
650
  e.target = _objectSpread(_objectSpread({}, e.target), {}, {
621
651
  value: newValue
@@ -632,8 +662,8 @@ var TextFieldBase = /*#__PURE__*/React.forwardRef(function (_ref12, ref) {
632
662
  }));
633
663
  },
634
664
  suggestions: suggestions,
635
- onSuggestionsFetchRequested: function onSuggestionsFetchRequested(_ref14) {
636
- var value = _ref14.value;
665
+ onSuggestionsFetchRequested: function onSuggestionsFetchRequested(_ref17) {
666
+ var value = _ref17.value;
637
667
  return setSuggestions(getSuggestions(value));
638
668
  },
639
669
  onSuggestionsClearRequested: function onSuggestionsClearRequested() {
@@ -642,8 +672,8 @@ var TextFieldBase = /*#__PURE__*/React.forwardRef(function (_ref12, ref) {
642
672
  getSuggestionValue: function getSuggestionValue(suggestion) {
643
673
  return suggestion;
644
674
  },
645
- renderSuggestion: function renderSuggestion(suggestion, _ref15) {
646
- var isHighlighted = _ref15.isHighlighted;
675
+ renderSuggestion: function renderSuggestion(suggestion, _ref18) {
676
+ var isHighlighted = _ref18.isHighlighted;
647
677
  return /*#__PURE__*/React.createElement("div", {
648
678
  role: "menuitem",
649
679
  className: (0, _classnames.default)(classes.menuItem, _defineProperty({}, classes.menuItemSelected, isHighlighted))
@@ -21,6 +21,7 @@ declare type HelperTextProps = {
21
21
  export declare const HelperText: React.FC<HelperTextProps>;
22
22
  declare type FieldContainerProps = {
23
23
  multiline?: boolean;
24
+ disabled?: boolean;
24
25
  children: React.ReactNode;
25
26
  helperText?: React.ReactNode;
26
27
  className?: string;