@telefonica/mistica 10.14.2 → 10.15.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/button.js +16 -26
  3. package/dist/checkbox.js +11 -7
  4. package/dist/date-time-picker.js +10 -4
  5. package/dist/list.d.ts +1 -0
  6. package/dist/list.js +63 -26
  7. package/dist/list.js.flow +1 -0
  8. package/dist/package-version.js +1 -1
  9. package/dist/radio-button.js +13 -9
  10. package/dist/select.js +5 -16
  11. package/dist/skins/blau.js +0 -24
  12. package/dist/skins/movistar.js +0 -23
  13. package/dist/skins/o2-classic.js +0 -24
  14. package/dist/skins/o2.js +0 -23
  15. package/dist/skins/types.d.ts +0 -12
  16. package/dist/skins/types.js.flow +0 -12
  17. package/dist/skins/vivo.js +0 -23
  18. package/dist/switch-component.js +12 -9
  19. package/dist/text-field-base.js +3 -17
  20. package/dist/text-field-components.d.ts +0 -1
  21. package/dist/text-field-components.js +8 -15
  22. package/dist/text-field-components.js.flow +0 -1
  23. package/dist/text-link.d.ts +1 -0
  24. package/dist/text-link.js +16 -9
  25. package/dist/text-link.js.flow +1 -0
  26. package/dist/touchable.js +2 -3
  27. package/dist-es/button.js +16 -26
  28. package/dist-es/checkbox.js +11 -7
  29. package/dist-es/date-time-picker.js +10 -4
  30. package/dist-es/list.js +63 -26
  31. package/dist-es/package-version.js +1 -1
  32. package/dist-es/radio-button.js +13 -9
  33. package/dist-es/select.js +5 -16
  34. package/dist-es/skins/blau.js +0 -24
  35. package/dist-es/skins/movistar.js +0 -23
  36. package/dist-es/skins/o2-classic.js +0 -24
  37. package/dist-es/skins/o2.js +0 -23
  38. package/dist-es/skins/vivo.js +0 -23
  39. package/dist-es/switch-component.js +12 -9
  40. package/dist-es/text-field-base.js +3 -17
  41. package/dist-es/text-field-components.js +8 -15
  42. package/dist-es/text-link.js +14 -8
  43. package/dist-es/touchable.js +2 -3
  44. package/package.json +2 -2
@@ -171,10 +171,6 @@ var commonInputStyles = function commonInputStyles(theme) {
171
171
  opacity: 0.5
172
172
  }
173
173
  },
174
- '&:disabled': {
175
- color: theme.colors.textDisabled,
176
- cursor: 'not-allowed'
177
- },
178
174
  boxShadow: 'none'
179
175
  };
180
176
  };
@@ -288,11 +284,7 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
288
284
  paddingRight: 16,
289
285
  display: 'flex',
290
286
  alignItems: 'center',
291
- alignSelf: 'center',
292
- opacity: function opacity(param) {
293
- var disabled = param.disabled;
294
- return disabled ? 0.3 : 1;
295
- }
287
+ alignSelf: 'center'
296
288
  },
297
289
  startIcon: {
298
290
  pointerEvents: 'none',
@@ -301,11 +293,7 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
301
293
  display: 'flex',
302
294
  alignItems: 'center',
303
295
  height: '100%',
304
- position: 'absolute',
305
- opacity: function opacity(param) {
306
- var disabled = param.disabled;
307
- return disabled ? 0.3 : 1;
308
- }
296
+ position: 'absolute'
309
297
  },
310
298
  prefix: (_obj2 = {
311
299
  alignSelf: 'baseline',
@@ -426,7 +414,6 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
426
414
  width: "calc(((100% - ".concat(_textFieldComponents.LABEL_LEFT_POSITION + (startIcon ? 48 : _textFieldComponents.LABEL_LEFT_POSITION), "px)) / ").concat(scale, ")"),
427
415
  paddingRight: endIcon && !isShrinked ? 36 : 0
428
416
  };
429
- var prefixColor = rest.disabled ? colors.textDisabled : colors.textSecondary;
430
417
  return(/*#__PURE__*/ (0, _jsxRuntime).jsxs(_textFieldComponents.FieldContainer, {
431
418
  disabled: rest.disabled,
432
419
  helperText: /*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldComponents.HelperText, {
@@ -445,7 +432,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
445
432
  prefix && /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
446
433
  className: classes.prefix,
447
434
  children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text3, {
448
- color: prefixColor,
435
+ color: colors.textSecondary,
449
436
  regular: true,
450
437
  children: prefix
451
438
  })
@@ -495,7 +482,6 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
495
482
  forId: id,
496
483
  inputState: inputState,
497
484
  shrinkLabel: shrinkLabel,
498
- disabled: rest.disabled,
499
485
  optional: !rest.required,
500
486
  children: label
501
487
  }),
@@ -10,7 +10,6 @@ declare type LabelProps = {
10
10
  inputState: InputState;
11
11
  error?: boolean;
12
12
  children: string;
13
- disabled?: boolean;
14
13
  style?: React.CSSProperties;
15
14
  optional?: boolean;
16
15
  };
@@ -123,10 +123,7 @@ var useLabelStyles = (0, _jss).createUseStyles(function(theme) {
123
123
  fontSize: 18,
124
124
  lineHeight: '24px',
125
125
  color: function color(param) {
126
- var inputState = param.inputState, error = param.error, disabled = param.disabled;
127
- if (inputState === 'default' && disabled) {
128
- return theme.colors.textDisabled;
129
- }
126
+ var inputState = param.inputState, error = param.error;
130
127
  if (error && inputState !== 'default') {
131
128
  return theme.colors.error;
132
129
  }
@@ -162,13 +159,11 @@ var useLabelStyles = (0, _jss).createUseStyles(function(theme) {
162
159
  };
163
160
  });
164
161
  var Label = function Label(param) {
165
- var shrinkLabel = param.shrinkLabel, forId = param.forId, inputState = param.inputState, error = param.error, children = param.children, disabled = param.disabled, style = param.style, optional = param.optional;
162
+ var shrinkLabel = param.shrinkLabel, forId = param.forId, inputState = param.inputState, error = param.error, children = param.children, style = param.style, optional = param.optional;
166
163
  var isShrinked = shrinkLabel || inputState === 'focused' || inputState === 'filled';
167
164
  var classes = useLabelStyles({
168
- isShrinked: isShrinked,
169
165
  inputState: inputState,
170
- error: error,
171
- disabled: disabled
166
+ error: error
172
167
  });
173
168
  var ref = _slicedToArray(React.useState(''), 2), transitionStyle = ref[0], setTransitionStyle = ref[1];
174
169
  var ref1 = (0, _hooks).useTheme(), texts = ref1.texts;
@@ -264,6 +259,10 @@ var _obj1, _obj2;
264
259
  var useFieldContainerStyles = (0, _jss).createUseStyles(function(theme) {
265
260
  return {
266
261
  fieldContainer: (_obj1 = {
262
+ opacity: function opacity(param) {
263
+ var disabled = param.disabled;
264
+ return disabled ? 0.5 : 1;
265
+ },
267
266
  display: 'flex',
268
267
  flexDirection: 'column',
269
268
  minWidth: 96
@@ -288,13 +287,7 @@ var useFieldContainerStyles = (0, _jss).createUseStyles(function(theme) {
288
287
  var multiline = param.multiline;
289
288
  return multiline ? 152 : 56;
290
289
  }
291
- }), _defineProperty(_obj2, "display", 'flex'), _defineProperty(_obj2, "position", 'relative'), _defineProperty(_obj2, "backgroundColor", function(param) {
292
- var disabled = param.disabled;
293
- return disabled ? theme.colors.backgroundAlternative : theme.colors.backgroundContainer;
294
- }), _defineProperty(_obj2, "cursor", function(param) {
295
- var disabled = param.disabled;
296
- return disabled ? 'not-allowed' : 'initial';
297
- }), _obj2)
290
+ }), _defineProperty(_obj2, "display", 'flex'), _defineProperty(_obj2, "position", 'relative'), _defineProperty(_obj2, "backgroundColor", theme.colors.backgroundContainer), _obj2)
298
291
  };
299
292
  });
300
293
  var FieldContainer = function FieldContainer(param) {
@@ -12,7 +12,6 @@ declare type LabelProps = {
12
12
  inputState: InputState,
13
13
  error?: boolean,
14
14
  children: string,
15
- disabled?: boolean,
16
15
  style?: CssStyle,
17
16
  optional?: boolean,
18
17
  };
@@ -8,6 +8,7 @@ interface CommonProps {
8
8
  [className: string]: string;
9
9
  };
10
10
  small?: boolean;
11
+ disabled?: boolean;
11
12
  trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
12
13
  /** "data-" prefix is automatically added. For example, use "testid" instead of "data-testid" */
13
14
  dataAttributes?: DataAttributes;
package/dist/text-link.js CHANGED
@@ -8,6 +8,7 @@ var _jss = require("./jss");
8
8
  var _touchable = _interopRequireDefault(require("./touchable"));
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _themeVariantContext = require("./theme-variant-context");
11
+ var _formContext = require("./form-context");
11
12
  function _interopRequireDefault(obj) {
12
13
  return obj && obj.__esModule ? obj : {
13
14
  default: obj
@@ -73,19 +74,22 @@ function _objectWithoutPropertiesLoose(source, excluded) {
73
74
  }
74
75
  return target;
75
76
  }
77
+ var _obj;
76
78
  var useStyles = (0, _jss).createUseStyles(function(theme) {
77
79
  return {
78
- textLink: _defineProperty({
80
+ textLink: (_obj = {
79
81
  width: 'auto',
80
82
  lineHeight: 'inherit',
81
83
  display: 'inline-block',
82
84
  color: theme.colors.textLink,
83
85
  wordBreak: 'break-word'
84
- }, theme.mq.supportsHover, {
85
- '&:hover': {
86
+ }, _defineProperty(_obj, theme.mq.supportsHover, {
87
+ '&:hover:not([disabled])': {
86
88
  textDecoration: 'underline'
87
89
  }
88
- }),
90
+ }), _defineProperty(_obj, '&[disabled]', {
91
+ opacity: 0.5
92
+ }), _obj),
89
93
  inverse: {
90
94
  color: theme.colors.textLinkInverse
91
95
  },
@@ -94,19 +98,22 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
94
98
  }
95
99
  };
96
100
  });
97
- var _obj;
101
+ var _obj1;
98
102
  var TextLink = function TextLink(_param) {
99
- var children = _param.children, _className = _param.className, className = _className === void 0 ? '' : _className, small = _param.small, props = _objectWithoutProperties(_param, [
103
+ var children = _param.children, _className = _param.className, className = _className === void 0 ? '' : _className, small = _param.small, disabled = _param.disabled, props = _objectWithoutProperties(_param, [
100
104
  "children",
101
105
  "className",
102
- "small"
106
+ "small",
107
+ "disabled"
103
108
  ]);
104
109
  var classes = useStyles();
105
110
  var isInverse = (0, _themeVariantContext).useIsInverseVariant();
111
+ var ref = (0, _formContext).useForm(), formStatus = ref.formStatus;
106
112
  return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_touchable.default, _objectSpread({
107
113
  }, props, {
108
- className: (0, _classnames).default(classes.textLink, className, (_obj = {
109
- }, _defineProperty(_obj, classes.small, small), _defineProperty(_obj, classes.inverse, isInverse), _obj)),
114
+ disabled: disabled || formStatus === 'sending',
115
+ className: (0, _classnames).default(classes.textLink, className, (_obj1 = {
116
+ }, _defineProperty(_obj1, classes.small, small), _defineProperty(_obj1, classes.inverse, isInverse), _obj1)),
110
117
  children: children
111
118
  })));
112
119
  };
@@ -10,6 +10,7 @@ declare type CommonProps = {
10
10
  [className: string]: string,
11
11
  },
12
12
  small?: boolean,
13
+ disabled?: boolean,
13
14
  trackingEvent?: TrackingEvent | $ReadOnlyArray<TrackingEvent>,
14
15
 
15
16
  /**
package/dist/touchable.js CHANGED
@@ -102,8 +102,7 @@ var useStyles = (0, _jss).createUseStyles(function() {
102
102
  border: 'none'
103
103
  },
104
104
  '&[disabled]': {
105
- cursor: 'auto',
106
- pointerEvents: 'none'
105
+ cursor: 'default'
107
106
  },
108
107
  '&:active, &:hover': {
109
108
  textDecoration: 'none'
@@ -207,7 +206,7 @@ var Touchable = /*#__PURE__*/ React.forwardRef(function(props, ref) {
207
206
  "aria-labelledby": props['aria-labelledby'],
208
207
  onClick: handleHrefClick,
209
208
  onKeyDown: handleKeyDown,
210
- href: props.disabled ? '' : getHref(),
209
+ href: props.disabled ? undefined : getHref(),
211
210
  target: openNewTab ? '_blank' : undefined,
212
211
  rel: openNewTab ? 'noopener noreferrer' : undefined,
213
212
  ref: ref,
package/dist-es/button.js CHANGED
@@ -88,7 +88,7 @@ var commonClasses = function() {
88
88
  border: "".concat(BORDER_PX, "px solid transparent"),
89
89
  borderRadius: 4,
90
90
  overflow: 'hidden',
91
- '&:hover': {
91
+ '&:hover:not([disabled])': {
92
92
  transition: "background-color ".concat(transitionTiming, ", color ").concat(transitionTiming, ", border-color ").concat(transitionTiming)
93
93
  }
94
94
  },
@@ -143,6 +143,9 @@ var commonClasses = function() {
143
143
  }
144
144
  };
145
145
  };
146
+ var disabledStyle = {
147
+ opacity: 0.5
148
+ };
146
149
  var usePrimaryButtonStyles = createUseStyles(function(theme) {
147
150
  return _objectSpread({
148
151
  }, commonClasses(), {
@@ -152,10 +155,7 @@ var usePrimaryButtonStyles = createUseStyles(function(theme) {
152
155
  '&:enabled:active': {
153
156
  backgroundColor: theme.colors.buttonPrimaryBackgroundSelected
154
157
  },
155
- '&[disabled]:not($isLoading)': {
156
- color: theme.colors.textButtonPrimaryDisabled,
157
- backgroundColor: theme.colors.buttonPrimaryBackgroundDisabled
158
- },
158
+ '&[disabled]:not($isLoading)': disabledStyle,
159
159
  // Next media queries were added in each button style, because a pair of bugs in mobile devices (related to: https://jira.tuenti.io/jira/browse/APPS-1882):
160
160
  // - When tapping on a button that takes you to next screen and then go back to the previous one, button still have the focus styles
161
161
  // - Same behavior if you do long press on the button
@@ -163,7 +163,7 @@ var usePrimaryButtonStyles = createUseStyles(function(theme) {
163
163
  // - Make sure that in FF hover still has it's proper styles
164
164
  // - Media query with "coarse" (mobile), avoids that in devices that have coarse implemented, focus style doesn't get stuck
165
165
  // Must be always declared for Firefox
166
- '&:hover': {
166
+ '&:hover:not([disabled])': {
167
167
  backgroundColor: theme.colors.buttonPrimaryBackgroundHover,
168
168
  '@media (pointer: coarse)': {
169
169
  // Revert hover background in touch devices
@@ -178,11 +178,8 @@ var usePrimaryButtonStyles = createUseStyles(function(theme) {
178
178
  backgroundColor: theme.colors.buttonPrimaryBackgroundSelectedInverse,
179
179
  color: theme.colors.textButtonPrimaryInverseSelected
180
180
  },
181
- '&[disabled]:not($isLoading)': {
182
- backgroundColor: theme.colors.buttonPrimaryBackgroundDisabledInverse,
183
- color: theme.colors.textButtonPrimaryInverseDisabled
184
- },
185
- '&:hover': {
181
+ '&[disabled]:not($isLoading)': disabledStyle,
182
+ '&:hover:not([disabled])': {
186
183
  color: theme.colors.textButtonPrimaryInverseSelected,
187
184
  backgroundColor: theme.colors.buttonPrimaryBackgroundSelectedInverse,
188
185
  '@media (pointer: coarse)': {
@@ -213,11 +210,8 @@ var useSecondaryButtonStyles = createUseStyles(function(theme) {
213
210
  }, buttonSecondaryLightStyle(theme), {
214
211
  '&:enabled:active': _objectSpread({
215
212
  }, buttonSecondaryHoverLightStyle(theme)),
216
- '&[disabled]:not($isLoading)': {
217
- color: theme.colors.textButtonSecondaryDisabled,
218
- borderColor: theme.colors.buttonSecondaryBackgroundDisabled
219
- },
220
- '&:hover': _objectSpread({
213
+ '&[disabled]:not($isLoading)': disabledStyle,
214
+ '&:hover:not([disabled])': _objectSpread({
221
215
  }, buttonSecondaryHoverLightStyle(theme), {
222
216
  '@media (pointer: coarse)': _objectSpread({
223
217
  }, buttonSecondaryLightStyle(theme))
@@ -230,11 +224,8 @@ var useSecondaryButtonStyles = createUseStyles(function(theme) {
230
224
  borderColor: theme.colors.buttonSecondaryBorderSelectedInverse,
231
225
  color: theme.colors.textButtonSecondaryInverseSelected
232
226
  },
233
- '&[disabled]:not($isLoading)': {
234
- color: theme.colors.textButtonSecondaryInverseDisabled,
235
- borderColor: theme.colors.buttonSecondaryBorderDisabledInverse
236
- },
237
- '&:hover': {
227
+ '&[disabled]:not($isLoading)': disabledStyle,
228
+ '&:hover:not([disabled])': {
238
229
  borderColor: theme.colors.buttonSecondaryBorderSelectedInverse,
239
230
  color: theme.colors.textButtonSecondaryInverseSelected,
240
231
  '@media (pointer: coarse)': {
@@ -253,10 +244,9 @@ var dangerButtonStyles = function(theme) {
253
244
  backgroundColor: theme.colors.buttonDangerBackgroundSelected
254
245
  },
255
246
  '&[disabled]:not($isLoading)': {
256
- color: theme.colors.textButtonPrimaryDisabled,
257
- backgroundColor: theme.colors.buttonDangerBackgroundDisabled
247
+ opacity: 0.5
258
248
  },
259
- '&:hover': {
249
+ '&:hover:not([disabled])': {
260
250
  backgroundColor: theme.colors.buttonDangerBackgroundHover,
261
251
  '@media (pointer: coarse)': {
262
252
  // Revert hover background in touch devices
@@ -426,7 +416,7 @@ var useButtonLinkStyles = createUseStyles(function(theme) {
426
416
  '&:enabled:active': {
427
417
  backgroundColor: theme.colors.buttonLinkBackgroundSelected
428
418
  },
429
- '&:hover': {
419
+ '&:hover:not([disabled])': {
430
420
  backgroundColor: theme.colors.buttonLinkBackgroundSelected,
431
421
  '@media (pointer: coarse)': {
432
422
  backgroundColor: 'initial'
@@ -438,7 +428,7 @@ var useButtonLinkStyles = createUseStyles(function(theme) {
438
428
  '&:enabled:active': {
439
429
  backgroundColor: theme.colors.buttonLinkBackgroundSelectedInverse
440
430
  },
441
- '&:hover': {
431
+ '&:hover:not([disabled])': {
442
432
  backgroundColor: theme.colors.buttonLinkBackgroundSelectedInverse,
443
433
  '@media (pointer: coarse)': {
444
434
  backgroundColor: 'initial'
@@ -96,11 +96,15 @@ var useIconCheckboxStyles = createUseStyles(function(param) {
96
96
  },
97
97
  checkChecked: {
98
98
  transform: 'scale(1, 1)'
99
+ },
100
+ disabled: {
101
+ opacity: 0.5
99
102
  }
100
103
  };
101
104
  });
105
+ var _obj;
102
106
  var IconCheckbox = function(param) {
103
- var isChecked = param.isChecked;
107
+ var isChecked = param.isChecked, disabled = param.disabled;
104
108
  var classes = useIconCheckboxStyles();
105
109
  var ref = useTheme(), isIos = ref.isIos, colors = ref.colors;
106
110
  var icon = isIos ? /*#__PURE__*/ _jsx("svg", {
@@ -125,8 +129,8 @@ var IconCheckbox = function(param) {
125
129
  })
126
130
  });
127
131
  return(/*#__PURE__*/ _jsx("div", {
128
- className: classnames(classes.box, _defineProperty({
129
- }, classes.boxChecked, isChecked)),
132
+ className: classnames(classes.box, (_obj = {
133
+ }, _defineProperty(_obj, classes.boxChecked, isChecked), _defineProperty(_obj, classes.disabled, disabled), _obj)),
130
134
  children: icon
131
135
  }));
132
136
  };
@@ -137,8 +141,7 @@ var useStyles = createUseStyles(function() {
137
141
  display: 'inline'
138
142
  },
139
143
  disabled: {
140
- opacity: 0.5,
141
- pointerEvents: 'none'
144
+ opacity: 0.5
142
145
  }
143
146
  };
144
147
  });
@@ -171,6 +174,7 @@ var Checkbox = function(props) {
171
174
  }
172
175
  };
173
176
  var iconCheckbox = /*#__PURE__*/ _jsx(IconCheckbox, {
177
+ disabled: disabled,
174
178
  isChecked: value !== null && value !== void 0 ? value : checkedState
175
179
  });
176
180
  return(// When the checkbox is disabled, it shouldn't be focusable
@@ -183,8 +187,7 @@ var Checkbox = function(props) {
183
187
  onClick: disabled ? undefined : handleChange,
184
188
  tabIndex: disabled ? undefined : 0,
185
189
  ref: focusableRef,
186
- className: classnames(classes.checkboxContainer, _defineProperty({
187
- }, classes.disabled, disabled)),
190
+ className: classes.checkboxContainer,
188
191
  "aria-label": ariaLabel,
189
192
  "aria-labelledby": ariaLabel ? undefined : labelId,
190
193
  "aria-disabled": disabled
@@ -209,6 +212,7 @@ var Checkbox = function(props) {
209
212
  id: labelId,
210
213
  role: hasExternalLabel ? 'presentation' : undefined,
211
214
  children: /*#__PURE__*/ _jsx("span", {
215
+ className: disabled ? classes.disabled : '',
212
216
  children: props.children
213
217
  })
214
218
  })
@@ -182,7 +182,7 @@ var useStyles = createUseStyles(function() {
182
182
  '& .rdtPicker td.rdtDisabled, & .rdtPicker td.rdtDisabled:hover': {
183
183
  background: 'none',
184
184
  color: '#999999',
185
- cursor: 'not-allowed'
185
+ cursor: 'default'
186
186
  },
187
187
  '& .rdtPicker td span.rdtOld': {
188
188
  color: '#999999'
@@ -190,7 +190,7 @@ var useStyles = createUseStyles(function() {
190
190
  '& .rdtPicker td span.rdtDisabled, & .rdtPicker td span.rdtDisabled:hover': {
191
191
  background: 'none',
192
192
  color: '#999999',
193
- cursor: 'not-allowed'
193
+ cursor: 'default'
194
194
  },
195
195
  '& .rdtPicker th': {
196
196
  borderBottom: '1px solid #f9f9f9',
@@ -215,7 +215,7 @@ var useStyles = createUseStyles(function() {
215
215
  '& .rdtPicker th.rdtDisabled, & .rdtPicker th.rdtDisabled:hover': {
216
216
  background: 'none',
217
217
  color: '#999999',
218
- cursor: 'not-allowed'
218
+ cursor: 'default'
219
219
  },
220
220
  '& .rdtPicker thead tr:first-of-type th': {
221
221
  cursor: 'pointer'
@@ -291,11 +291,16 @@ var useStyles = createUseStyles(function() {
291
291
  });
292
292
  var DateTimePicker = function(_param) {
293
293
  var withTime = _param.withTime, mode = _param.mode, isValidDate = _param.isValidDate, optional = _param.optional, rest = _objectWithoutProperties(_param, ["withTime", "mode", "isValidDate", "optional"]);
294
- var ref = _slicedToArray(React.useState(false), 2), showPicker = ref[0], setShowPicker = ref[1];
294
+ var ref = _slicedToArray(React.useState(false), 2), showPicker = ref[0], realSetShowPicker = ref[1];
295
295
  var classes = useStyles();
296
296
  var ref1 = useTheme(), texts = ref1.texts;
297
297
  var fieldRef = React.useRef(null);
298
298
  var ref2 = useElementDimensions(), pickerContainerHeight = ref2.height, pickerContainerRef = ref2.ref;
299
+ var setShowPicker = function(show) {
300
+ if (!rest.disabled) {
301
+ realSetShowPicker(show);
302
+ }
303
+ };
299
304
  var getPickerContainerStyles = function() {
300
305
  var ref;
301
306
  var ref3 = ((ref = fieldRef.current) === null || ref === void 0 ? void 0 : ref.getBoundingClientRect()) || {
@@ -350,6 +355,7 @@ var DateTimePicker = function(_param) {
350
355
  }));
351
356
  }
352
357
  return(/*#__PURE__*/ _jsx(IconButton, {
358
+ disabled: rest.disabled,
353
359
  "aria-label": "",
354
360
  size: 32,
355
361
  onPress: function() {