@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.
- package/CHANGELOG.md +7 -0
- package/dist/button.js +16 -26
- package/dist/checkbox.js +11 -7
- package/dist/date-time-picker.js +10 -4
- package/dist/list.d.ts +1 -0
- package/dist/list.js +63 -26
- package/dist/list.js.flow +1 -0
- package/dist/package-version.js +1 -1
- package/dist/radio-button.js +13 -9
- package/dist/select.js +5 -16
- package/dist/skins/blau.js +0 -24
- package/dist/skins/movistar.js +0 -23
- package/dist/skins/o2-classic.js +0 -24
- package/dist/skins/o2.js +0 -23
- package/dist/skins/types.d.ts +0 -12
- package/dist/skins/types.js.flow +0 -12
- package/dist/skins/vivo.js +0 -23
- package/dist/switch-component.js +12 -9
- package/dist/text-field-base.js +3 -17
- package/dist/text-field-components.d.ts +0 -1
- package/dist/text-field-components.js +8 -15
- package/dist/text-field-components.js.flow +0 -1
- package/dist/text-link.d.ts +1 -0
- package/dist/text-link.js +16 -9
- package/dist/text-link.js.flow +1 -0
- package/dist/touchable.js +2 -3
- package/dist-es/button.js +16 -26
- package/dist-es/checkbox.js +11 -7
- package/dist-es/date-time-picker.js +10 -4
- package/dist-es/list.js +63 -26
- package/dist-es/package-version.js +1 -1
- package/dist-es/radio-button.js +13 -9
- package/dist-es/select.js +5 -16
- package/dist-es/skins/blau.js +0 -24
- package/dist-es/skins/movistar.js +0 -23
- package/dist-es/skins/o2-classic.js +0 -24
- package/dist-es/skins/o2.js +0 -23
- package/dist-es/skins/vivo.js +0 -23
- package/dist-es/switch-component.js +12 -9
- package/dist-es/text-field-base.js +3 -17
- package/dist-es/text-field-components.js +8 -15
- package/dist-es/text-link.js +14 -8
- package/dist-es/touchable.js +2 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [10.15.0](https://github.com/Telefonica/mistica-web/compare/v10.14.2...v10.15.0) (2022-01-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **Form fields:** review disabled state ([#386](https://github.com/Telefonica/mistica-web/issues/386)) ([615f90d](https://github.com/Telefonica/mistica-web/commit/615f90de59ec647121f1c8c2cb6c342ace5df396))
|
|
7
|
+
|
|
1
8
|
## [10.14.2](https://github.com/Telefonica/mistica-web/compare/v10.14.1...v10.14.2) (2022-01-03)
|
|
2
9
|
|
|
3
10
|
|
package/dist/button.js
CHANGED
|
@@ -123,7 +123,7 @@ var commonClasses = function commonClasses() {
|
|
|
123
123
|
border: "".concat(BORDER_PX, "px solid transparent"),
|
|
124
124
|
borderRadius: 4,
|
|
125
125
|
overflow: 'hidden',
|
|
126
|
-
'&:hover': {
|
|
126
|
+
'&:hover:not([disabled])': {
|
|
127
127
|
transition: "background-color ".concat(transitionTiming, ", color ").concat(transitionTiming, ", border-color ").concat(transitionTiming)
|
|
128
128
|
}
|
|
129
129
|
},
|
|
@@ -178,6 +178,9 @@ var commonClasses = function commonClasses() {
|
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
180
|
};
|
|
181
|
+
var disabledStyle = {
|
|
182
|
+
opacity: 0.5
|
|
183
|
+
};
|
|
181
184
|
var usePrimaryButtonStyles = (0, _jss).createUseStyles(function(theme) {
|
|
182
185
|
return _objectSpread({
|
|
183
186
|
}, commonClasses(), {
|
|
@@ -187,10 +190,7 @@ var usePrimaryButtonStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
187
190
|
'&:enabled:active': {
|
|
188
191
|
backgroundColor: theme.colors.buttonPrimaryBackgroundSelected
|
|
189
192
|
},
|
|
190
|
-
'&[disabled]:not($isLoading)':
|
|
191
|
-
color: theme.colors.textButtonPrimaryDisabled,
|
|
192
|
-
backgroundColor: theme.colors.buttonPrimaryBackgroundDisabled
|
|
193
|
-
},
|
|
193
|
+
'&[disabled]:not($isLoading)': disabledStyle,
|
|
194
194
|
// 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):
|
|
195
195
|
// - 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
|
|
196
196
|
// - Same behavior if you do long press on the button
|
|
@@ -198,7 +198,7 @@ var usePrimaryButtonStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
198
198
|
// - Make sure that in FF hover still has it's proper styles
|
|
199
199
|
// - Media query with "coarse" (mobile), avoids that in devices that have coarse implemented, focus style doesn't get stuck
|
|
200
200
|
// Must be always declared for Firefox
|
|
201
|
-
'&:hover': {
|
|
201
|
+
'&:hover:not([disabled])': {
|
|
202
202
|
backgroundColor: theme.colors.buttonPrimaryBackgroundHover,
|
|
203
203
|
'@media (pointer: coarse)': {
|
|
204
204
|
// Revert hover background in touch devices
|
|
@@ -213,11 +213,8 @@ var usePrimaryButtonStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
213
213
|
backgroundColor: theme.colors.buttonPrimaryBackgroundSelectedInverse,
|
|
214
214
|
color: theme.colors.textButtonPrimaryInverseSelected
|
|
215
215
|
},
|
|
216
|
-
'&[disabled]:not($isLoading)':
|
|
217
|
-
|
|
218
|
-
color: theme.colors.textButtonPrimaryInverseDisabled
|
|
219
|
-
},
|
|
220
|
-
'&:hover': {
|
|
216
|
+
'&[disabled]:not($isLoading)': disabledStyle,
|
|
217
|
+
'&:hover:not([disabled])': {
|
|
221
218
|
color: theme.colors.textButtonPrimaryInverseSelected,
|
|
222
219
|
backgroundColor: theme.colors.buttonPrimaryBackgroundSelectedInverse,
|
|
223
220
|
'@media (pointer: coarse)': {
|
|
@@ -248,11 +245,8 @@ var useSecondaryButtonStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
248
245
|
}, buttonSecondaryLightStyle(theme), {
|
|
249
246
|
'&:enabled:active': _objectSpread({
|
|
250
247
|
}, buttonSecondaryHoverLightStyle(theme)),
|
|
251
|
-
'&[disabled]:not($isLoading)':
|
|
252
|
-
|
|
253
|
-
borderColor: theme.colors.buttonSecondaryBackgroundDisabled
|
|
254
|
-
},
|
|
255
|
-
'&:hover': _objectSpread({
|
|
248
|
+
'&[disabled]:not($isLoading)': disabledStyle,
|
|
249
|
+
'&:hover:not([disabled])': _objectSpread({
|
|
256
250
|
}, buttonSecondaryHoverLightStyle(theme), {
|
|
257
251
|
'@media (pointer: coarse)': _objectSpread({
|
|
258
252
|
}, buttonSecondaryLightStyle(theme))
|
|
@@ -265,11 +259,8 @@ var useSecondaryButtonStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
265
259
|
borderColor: theme.colors.buttonSecondaryBorderSelectedInverse,
|
|
266
260
|
color: theme.colors.textButtonSecondaryInverseSelected
|
|
267
261
|
},
|
|
268
|
-
'&[disabled]:not($isLoading)':
|
|
269
|
-
|
|
270
|
-
borderColor: theme.colors.buttonSecondaryBorderDisabledInverse
|
|
271
|
-
},
|
|
272
|
-
'&:hover': {
|
|
262
|
+
'&[disabled]:not($isLoading)': disabledStyle,
|
|
263
|
+
'&:hover:not([disabled])': {
|
|
273
264
|
borderColor: theme.colors.buttonSecondaryBorderSelectedInverse,
|
|
274
265
|
color: theme.colors.textButtonSecondaryInverseSelected,
|
|
275
266
|
'@media (pointer: coarse)': {
|
|
@@ -288,10 +279,9 @@ var dangerButtonStyles = function dangerButtonStyles(theme) {
|
|
|
288
279
|
backgroundColor: theme.colors.buttonDangerBackgroundSelected
|
|
289
280
|
},
|
|
290
281
|
'&[disabled]:not($isLoading)': {
|
|
291
|
-
|
|
292
|
-
backgroundColor: theme.colors.buttonDangerBackgroundDisabled
|
|
282
|
+
opacity: 0.5
|
|
293
283
|
},
|
|
294
|
-
'&:hover': {
|
|
284
|
+
'&:hover:not([disabled])': {
|
|
295
285
|
backgroundColor: theme.colors.buttonDangerBackgroundHover,
|
|
296
286
|
'@media (pointer: coarse)': {
|
|
297
287
|
// Revert hover background in touch devices
|
|
@@ -461,7 +451,7 @@ var useButtonLinkStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
461
451
|
'&:enabled:active': {
|
|
462
452
|
backgroundColor: theme.colors.buttonLinkBackgroundSelected
|
|
463
453
|
},
|
|
464
|
-
'&:hover': {
|
|
454
|
+
'&:hover:not([disabled])': {
|
|
465
455
|
backgroundColor: theme.colors.buttonLinkBackgroundSelected,
|
|
466
456
|
'@media (pointer: coarse)': {
|
|
467
457
|
backgroundColor: 'initial'
|
|
@@ -473,7 +463,7 @@ var useButtonLinkStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
473
463
|
'&:enabled:active': {
|
|
474
464
|
backgroundColor: theme.colors.buttonLinkBackgroundSelectedInverse
|
|
475
465
|
},
|
|
476
|
-
'&:hover': {
|
|
466
|
+
'&:hover:not([disabled])': {
|
|
477
467
|
backgroundColor: theme.colors.buttonLinkBackgroundSelectedInverse,
|
|
478
468
|
'@media (pointer: coarse)': {
|
|
479
469
|
backgroundColor: 'initial'
|
package/dist/checkbox.js
CHANGED
|
@@ -130,11 +130,15 @@ var useIconCheckboxStyles = (0, _jss).createUseStyles(function(param) {
|
|
|
130
130
|
},
|
|
131
131
|
checkChecked: {
|
|
132
132
|
transform: 'scale(1, 1)'
|
|
133
|
+
},
|
|
134
|
+
disabled: {
|
|
135
|
+
opacity: 0.5
|
|
133
136
|
}
|
|
134
137
|
};
|
|
135
138
|
});
|
|
139
|
+
var _obj;
|
|
136
140
|
var IconCheckbox = function IconCheckbox(param) {
|
|
137
|
-
var isChecked = param.isChecked;
|
|
141
|
+
var isChecked = param.isChecked, disabled = param.disabled;
|
|
138
142
|
var classes = useIconCheckboxStyles();
|
|
139
143
|
var ref = (0, _hooks).useTheme(), isIos = ref.isIos, colors = ref.colors;
|
|
140
144
|
var icon = isIos ? /*#__PURE__*/ (0, _jsxRuntime).jsx("svg", {
|
|
@@ -159,8 +163,8 @@ var IconCheckbox = function IconCheckbox(param) {
|
|
|
159
163
|
})
|
|
160
164
|
});
|
|
161
165
|
return(/*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
162
|
-
className: (0, _classnames).default(classes.box,
|
|
163
|
-
}, classes.boxChecked, isChecked)),
|
|
166
|
+
className: (0, _classnames).default(classes.box, (_obj = {
|
|
167
|
+
}, _defineProperty(_obj, classes.boxChecked, isChecked), _defineProperty(_obj, classes.disabled, disabled), _obj)),
|
|
164
168
|
children: icon
|
|
165
169
|
}));
|
|
166
170
|
};
|
|
@@ -171,8 +175,7 @@ var useStyles = (0, _jss).createUseStyles(function() {
|
|
|
171
175
|
display: 'inline'
|
|
172
176
|
},
|
|
173
177
|
disabled: {
|
|
174
|
-
opacity: 0.5
|
|
175
|
-
pointerEvents: 'none'
|
|
178
|
+
opacity: 0.5
|
|
176
179
|
}
|
|
177
180
|
};
|
|
178
181
|
});
|
|
@@ -205,6 +208,7 @@ var Checkbox = function Checkbox(props) {
|
|
|
205
208
|
}
|
|
206
209
|
};
|
|
207
210
|
var iconCheckbox = /*#__PURE__*/ (0, _jsxRuntime).jsx(IconCheckbox, {
|
|
211
|
+
disabled: disabled,
|
|
208
212
|
isChecked: value !== null && value !== void 0 ? value : checkedState
|
|
209
213
|
});
|
|
210
214
|
return(// eslint-disable-next-line jsx-a11y/interactive-supports-focus
|
|
@@ -216,8 +220,7 @@ var Checkbox = function Checkbox(props) {
|
|
|
216
220
|
onClick: disabled ? undefined : handleChange,
|
|
217
221
|
tabIndex: disabled ? undefined : 0,
|
|
218
222
|
ref: focusableRef,
|
|
219
|
-
className:
|
|
220
|
-
}, classes.disabled, disabled)),
|
|
223
|
+
className: classes.checkboxContainer,
|
|
221
224
|
"aria-label": ariaLabel,
|
|
222
225
|
"aria-labelledby": ariaLabel ? undefined : labelId,
|
|
223
226
|
"aria-disabled": disabled
|
|
@@ -242,6 +245,7 @@ var Checkbox = function Checkbox(props) {
|
|
|
242
245
|
id: labelId,
|
|
243
246
|
role: hasExternalLabel ? 'presentation' : undefined,
|
|
244
247
|
children: /*#__PURE__*/ (0, _jsxRuntime).jsx("span", {
|
|
248
|
+
className: disabled ? classes.disabled : '',
|
|
245
249
|
children: props.children
|
|
246
250
|
})
|
|
247
251
|
})
|
package/dist/date-time-picker.js
CHANGED
|
@@ -218,7 +218,7 @@ var useStyles = (0, _jss).createUseStyles(function() {
|
|
|
218
218
|
'& .rdtPicker td.rdtDisabled, & .rdtPicker td.rdtDisabled:hover': {
|
|
219
219
|
background: 'none',
|
|
220
220
|
color: '#999999',
|
|
221
|
-
cursor: '
|
|
221
|
+
cursor: 'default'
|
|
222
222
|
},
|
|
223
223
|
'& .rdtPicker td span.rdtOld': {
|
|
224
224
|
color: '#999999'
|
|
@@ -226,7 +226,7 @@ var useStyles = (0, _jss).createUseStyles(function() {
|
|
|
226
226
|
'& .rdtPicker td span.rdtDisabled, & .rdtPicker td span.rdtDisabled:hover': {
|
|
227
227
|
background: 'none',
|
|
228
228
|
color: '#999999',
|
|
229
|
-
cursor: '
|
|
229
|
+
cursor: 'default'
|
|
230
230
|
},
|
|
231
231
|
'& .rdtPicker th': {
|
|
232
232
|
borderBottom: '1px solid #f9f9f9',
|
|
@@ -251,7 +251,7 @@ var useStyles = (0, _jss).createUseStyles(function() {
|
|
|
251
251
|
'& .rdtPicker th.rdtDisabled, & .rdtPicker th.rdtDisabled:hover': {
|
|
252
252
|
background: 'none',
|
|
253
253
|
color: '#999999',
|
|
254
|
-
cursor: '
|
|
254
|
+
cursor: 'default'
|
|
255
255
|
},
|
|
256
256
|
'& .rdtPicker thead tr:first-of-type th': {
|
|
257
257
|
cursor: 'pointer'
|
|
@@ -332,11 +332,16 @@ var DateTimePicker = function DateTimePicker(_param) {
|
|
|
332
332
|
"isValidDate",
|
|
333
333
|
"optional"
|
|
334
334
|
]);
|
|
335
|
-
var ref = _slicedToArray(React.useState(false), 2), showPicker = ref[0],
|
|
335
|
+
var ref = _slicedToArray(React.useState(false), 2), showPicker = ref[0], realSetShowPicker = ref[1];
|
|
336
336
|
var classes = useStyles();
|
|
337
337
|
var ref1 = (0, _hooks).useTheme(), texts = ref1.texts;
|
|
338
338
|
var fieldRef = React.useRef(null);
|
|
339
339
|
var ref2 = (0, _hooks).useElementDimensions(), pickerContainerHeight = ref2.height, pickerContainerRef = ref2.ref;
|
|
340
|
+
var setShowPicker = function setShowPicker(show) {
|
|
341
|
+
if (!rest.disabled) {
|
|
342
|
+
realSetShowPicker(show);
|
|
343
|
+
}
|
|
344
|
+
};
|
|
340
345
|
var getPickerContainerStyles = function getPickerContainerStyles() {
|
|
341
346
|
var ref;
|
|
342
347
|
var ref3 = ((ref = fieldRef.current) === null || ref === void 0 ? void 0 : ref.getBoundingClientRect()) || {
|
|
@@ -391,6 +396,7 @@ var DateTimePicker = function DateTimePicker(_param) {
|
|
|
391
396
|
}));
|
|
392
397
|
}
|
|
393
398
|
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_iconButton.default, {
|
|
399
|
+
disabled: rest.disabled,
|
|
394
400
|
"aria-label": "",
|
|
395
401
|
size: 32,
|
|
396
402
|
onPress: function onPress() {
|
package/dist/list.d.ts
CHANGED
package/dist/list.js
CHANGED
|
@@ -16,7 +16,7 @@ var _hooks = require("./hooks");
|
|
|
16
16
|
var _themeVariantContext = require("./theme-variant-context");
|
|
17
17
|
var _iconChevron = _interopRequireDefault(require("./icons/icon-chevron"));
|
|
18
18
|
var _switchComponent = _interopRequireDefault(require("./switch-component"));
|
|
19
|
-
var _radioButton =
|
|
19
|
+
var _radioButton = _interopRequireWildcard(require("./radio-button"));
|
|
20
20
|
var _checkbox = _interopRequireDefault(require("./checkbox"));
|
|
21
21
|
var _boxed = require("./boxed");
|
|
22
22
|
var _divider = _interopRequireDefault(require("./divider"));
|
|
@@ -113,18 +113,24 @@ function _slicedToArray(arr, i) {
|
|
|
113
113
|
var useStyles = (0, _jss).createUseStyles(function(param) {
|
|
114
114
|
var colors = param.colors, mq = param.mq;
|
|
115
115
|
return {
|
|
116
|
+
disabled: {
|
|
117
|
+
opacity: 0.5
|
|
118
|
+
},
|
|
116
119
|
hover: _defineProperty({
|
|
117
120
|
}, mq.supportsHover, {
|
|
118
121
|
'&:hover': {
|
|
119
122
|
background: function background(param) {
|
|
120
|
-
var isInverse = param.isInverse;
|
|
121
|
-
return isInverse ? 'initial' : colors.backgroundAlternative;
|
|
123
|
+
var isInverse = param.isInverse, disabled = param.disabled;
|
|
124
|
+
return isInverse || disabled ? 'initial' : colors.backgroundAlternative;
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
127
|
}),
|
|
125
128
|
rowContent: {
|
|
126
129
|
width: '100%',
|
|
127
|
-
cursor:
|
|
130
|
+
cursor: function cursor(param) {
|
|
131
|
+
var disabled = param.disabled;
|
|
132
|
+
return disabled ? 'default' : 'pointer';
|
|
133
|
+
}
|
|
128
134
|
},
|
|
129
135
|
hoverDisabled: {
|
|
130
136
|
cursor: 'initial',
|
|
@@ -195,8 +201,9 @@ var useStyles = (0, _jss).createUseStyles(function(param) {
|
|
|
195
201
|
}
|
|
196
202
|
};
|
|
197
203
|
});
|
|
204
|
+
var _obj;
|
|
198
205
|
var Content = function Content(param) {
|
|
199
|
-
var headline = param.headline, title = param.title, titleLinesMax = param.titleLinesMax, subtitle = param.subtitle, subtitleLinesMax = param.subtitleLinesMax, description = param.description, descriptionLinesMax = param.descriptionLinesMax, asset = param.asset, _type = param.type, type = _type === void 0 ? 'basic' : _type, badge = param.badge, right = param.right, extra = param.extra, labelId = param.labelId;
|
|
206
|
+
var headline = param.headline, title = param.title, titleLinesMax = param.titleLinesMax, subtitle = param.subtitle, subtitleLinesMax = param.subtitleLinesMax, description = param.description, descriptionLinesMax = param.descriptionLinesMax, asset = param.asset, _type = param.type, type = _type === void 0 ? 'basic' : _type, badge = param.badge, right = param.right, extra = param.extra, labelId = param.labelId, disabled = param.disabled;
|
|
200
207
|
var isInverse = (0, _themeVariantContext).useIsInverseVariant();
|
|
201
208
|
var classes = useStyles({
|
|
202
209
|
isInverse: isInverse
|
|
@@ -217,7 +224,8 @@ var Content = function Content(param) {
|
|
|
217
224
|
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_box.default, {
|
|
218
225
|
paddingLeft: 16,
|
|
219
226
|
children: /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
220
|
-
className: (0, _classnames).default(classes.center, classes.badge
|
|
227
|
+
className: (0, _classnames).default(classes.center, classes.badge, _defineProperty({
|
|
228
|
+
}, classes.disabled, disabled)),
|
|
221
229
|
children: badge === true ? /*#__PURE__*/ (0, _jsxRuntime).jsx(_badge.default, {
|
|
222
230
|
}) : /*#__PURE__*/ (0, _jsxRuntime).jsx(_badge.default, {
|
|
223
231
|
value: badge
|
|
@@ -225,21 +233,49 @@ var Content = function Content(param) {
|
|
|
225
233
|
})
|
|
226
234
|
}));
|
|
227
235
|
};
|
|
236
|
+
var renderRight = function renderRight() {
|
|
237
|
+
switch(type){
|
|
238
|
+
case 'chevron':
|
|
239
|
+
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_box.default, {
|
|
240
|
+
paddingLeft: 16,
|
|
241
|
+
className: (0, _classnames).default(classes.center, _defineProperty({
|
|
242
|
+
}, classes.disabled, disabled)),
|
|
243
|
+
children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconChevron.default, {
|
|
244
|
+
color: isInverse ? colors.inverse : colors.neutralMedium,
|
|
245
|
+
direction: "right"
|
|
246
|
+
})
|
|
247
|
+
}));
|
|
248
|
+
case 'control':
|
|
249
|
+
return(/*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
250
|
+
className: classes.right,
|
|
251
|
+
children: right
|
|
252
|
+
}));
|
|
253
|
+
case 'custom':
|
|
254
|
+
return(/*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
255
|
+
className: (0, _classnames).default(classes.right, _defineProperty({
|
|
256
|
+
}, classes.disabled, disabled)),
|
|
257
|
+
children: right
|
|
258
|
+
}));
|
|
259
|
+
default:
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
228
263
|
return(/*#__PURE__*/ (0, _jsxRuntime).jsxs(_box.default, {
|
|
229
264
|
paddingY: 16,
|
|
230
265
|
className: classes.content,
|
|
231
266
|
children: [
|
|
232
267
|
asset && /*#__PURE__*/ (0, _jsxRuntime).jsx(_box.default, {
|
|
233
268
|
paddingRight: 16,
|
|
234
|
-
className: (0, _classnames).default(
|
|
235
|
-
}, classes.center, shouldCenter)),
|
|
269
|
+
className: (0, _classnames).default((_obj = {
|
|
270
|
+
}, _defineProperty(_obj, classes.center, shouldCenter), _defineProperty(_obj, classes.disabled, disabled), _obj)),
|
|
236
271
|
children: /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
237
272
|
className: classes.asset,
|
|
238
273
|
children: asset
|
|
239
274
|
})
|
|
240
275
|
}),
|
|
241
276
|
/*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
242
|
-
className: classes.rowBody,
|
|
277
|
+
className: (0, _classnames).default(classes.rowBody, _defineProperty({
|
|
278
|
+
}, classes.disabled, disabled)),
|
|
243
279
|
style: {
|
|
244
280
|
justifyContent: shouldCenter ? 'center' : 'flex-start'
|
|
245
281
|
},
|
|
@@ -284,17 +320,7 @@ var Content = function Content(param) {
|
|
|
284
320
|
})
|
|
285
321
|
}),
|
|
286
322
|
renderBadge(),
|
|
287
|
-
|
|
288
|
-
paddingLeft: 16,
|
|
289
|
-
className: classes.center,
|
|
290
|
-
children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconChevron.default, {
|
|
291
|
-
color: isInverse ? colors.inverse : colors.neutralMedium,
|
|
292
|
-
direction: "right"
|
|
293
|
-
})
|
|
294
|
-
}) : right ? /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
295
|
-
className: classes.right,
|
|
296
|
-
children: right
|
|
297
|
-
}) : null
|
|
323
|
+
renderRight()
|
|
298
324
|
]
|
|
299
325
|
}));
|
|
300
326
|
};
|
|
@@ -324,10 +350,13 @@ var useControlState = function useControlState(param) {
|
|
|
324
350
|
var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
325
351
|
var titleId = (0, _hooks).useAriaId();
|
|
326
352
|
var isInverse = (0, _themeVariantContext).useIsInverseVariant();
|
|
353
|
+
var asset = props.asset, headline = props.headline, title = props.title, titleLinesMax = props.titleLinesMax, subtitle = props.subtitle, subtitleLinesMax = props.subtitleLinesMax, description = props.description, descriptionLinesMax = props.descriptionLinesMax, badge = props.badge, role = props.role, extra = props.extra, dataAttributes = props.dataAttributes;
|
|
354
|
+
var radioContext = (0, _radioButton).useRadioContext();
|
|
355
|
+
var disabled = props.disabled || props.radioValue !== undefined && radioContext.disabled;
|
|
327
356
|
var classes = useStyles({
|
|
328
|
-
isInverse: isInverse
|
|
357
|
+
isInverse: isInverse,
|
|
358
|
+
disabled: disabled
|
|
329
359
|
});
|
|
330
|
-
var asset = props.asset, headline = props.headline, title = props.title, titleLinesMax = props.titleLinesMax, subtitle = props.subtitle, subtitleLinesMax = props.subtitleLinesMax, description = props.description, descriptionLinesMax = props.descriptionLinesMax, badge = props.badge, role = props.role, extra = props.extra, dataAttributes = props.dataAttributes;
|
|
331
360
|
var ref1 = _slicedToArray(useControlState(props.switch || props.checkbox || {
|
|
332
361
|
}), 2), isChecked = ref1[0], toggle = ref1[1];
|
|
333
362
|
var renderContent = function renderContent(param) {
|
|
@@ -345,7 +374,8 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
345
374
|
type: type,
|
|
346
375
|
right: right,
|
|
347
376
|
extra: extra,
|
|
348
|
-
labelId: labelId
|
|
377
|
+
labelId: labelId,
|
|
378
|
+
disabled: disabled
|
|
349
379
|
});
|
|
350
380
|
};
|
|
351
381
|
var renderTouchableContent = function renderTouchableContent(props) {
|
|
@@ -373,6 +403,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
373
403
|
onPress: props.onPress,
|
|
374
404
|
role: role,
|
|
375
405
|
dataAttributes: dataAttributes,
|
|
406
|
+
disabled: disabled,
|
|
376
407
|
children: renderTouchableContent(props)
|
|
377
408
|
}));
|
|
378
409
|
}
|
|
@@ -384,6 +415,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
384
415
|
fullPageOnWebView: props.fullPageOnWebView,
|
|
385
416
|
role: role,
|
|
386
417
|
dataAttributes: dataAttributes,
|
|
418
|
+
disabled: disabled,
|
|
387
419
|
children: renderTouchableContent(props)
|
|
388
420
|
}));
|
|
389
421
|
}
|
|
@@ -395,6 +427,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
395
427
|
newTab: props.newTab,
|
|
396
428
|
role: role,
|
|
397
429
|
dataAttributes: dataAttributes,
|
|
430
|
+
disabled: disabled,
|
|
398
431
|
children: renderTouchableContent(props)
|
|
399
432
|
}));
|
|
400
433
|
}
|
|
@@ -406,19 +439,22 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
406
439
|
className: classes.dualActionContainer,
|
|
407
440
|
children: [
|
|
408
441
|
/*#__PURE__*/ (0, _jsxRuntime).jsx(_touchable.default, {
|
|
442
|
+
disabled: disabled,
|
|
409
443
|
onPress: props.onPress,
|
|
410
444
|
role: role,
|
|
411
445
|
className: (0, _classnames).default(classes.dualActionLeft, classes.hover),
|
|
412
446
|
children: renderContent({
|
|
413
|
-
type: '
|
|
447
|
+
type: 'basic',
|
|
414
448
|
labelId: titleId
|
|
415
449
|
})
|
|
416
450
|
}),
|
|
417
451
|
/*#__PURE__*/ (0, _jsxRuntime).jsx(_touchable.default, {
|
|
452
|
+
disabled: disabled,
|
|
418
453
|
className: classes.dualActionRight,
|
|
419
454
|
onPress: toggle,
|
|
420
455
|
dataAttributes: dataAttributes,
|
|
421
456
|
children: /*#__PURE__*/ (0, _jsxRuntime).jsx(Control, {
|
|
457
|
+
disabled: disabled,
|
|
422
458
|
name: name,
|
|
423
459
|
checked: isChecked,
|
|
424
460
|
"aria-labelledby": titleId,
|
|
@@ -431,6 +467,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
431
467
|
}) : /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
432
468
|
className: (0, _classnames).default(classes.rowContent, classes.hover),
|
|
433
469
|
children: /*#__PURE__*/ (0, _jsxRuntime).jsx(Control, {
|
|
470
|
+
disabled: disabled,
|
|
434
471
|
dataAttributes: dataAttributes,
|
|
435
472
|
name: name,
|
|
436
473
|
checked: isChecked,
|
|
@@ -441,7 +478,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
441
478
|
role: role,
|
|
442
479
|
children: renderContent({
|
|
443
480
|
labelId: labelId,
|
|
444
|
-
type: '
|
|
481
|
+
type: 'control',
|
|
445
482
|
right: /*#__PURE__*/ (0, _jsxRuntime).jsx(_stack.default, {
|
|
446
483
|
space: "around",
|
|
447
484
|
children: control
|
|
@@ -471,7 +508,7 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props, ref5) {
|
|
|
471
508
|
/*#__PURE__*/ return (0, _jsxRuntime).jsx(_box.default, {
|
|
472
509
|
paddingX: 16,
|
|
473
510
|
children: renderContent({
|
|
474
|
-
type: '
|
|
511
|
+
type: 'control',
|
|
475
512
|
right: /*#__PURE__*/ (0, _jsxRuntime).jsx(_stack.default, {
|
|
476
513
|
space: "around",
|
|
477
514
|
children: radio
|
package/dist/list.js.flow
CHANGED
package/dist/package-version.js
CHANGED
package/dist/radio-button.js
CHANGED
|
@@ -137,6 +137,7 @@ var useRadioButtonStyles = (0, _jss).createUseStyles(function(param) {
|
|
|
137
137
|
var colors = param.colors, isIos = param.isIos;
|
|
138
138
|
return {
|
|
139
139
|
outerCircle: {
|
|
140
|
+
cursor: 'pointer',
|
|
140
141
|
flexShrink: 0,
|
|
141
142
|
width: 20,
|
|
142
143
|
height: 20,
|
|
@@ -169,11 +170,11 @@ var useRadioButtonStyles = (0, _jss).createUseStyles(function(param) {
|
|
|
169
170
|
transform: 'scale(1)'
|
|
170
171
|
},
|
|
171
172
|
radioButton: {
|
|
172
|
-
cursor: 'default'
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
cursor: 'default'
|
|
174
|
+
},
|
|
175
|
+
disabled: {
|
|
176
|
+
opacity: 0.5,
|
|
177
|
+
cursor: 'default'
|
|
177
178
|
}
|
|
178
179
|
};
|
|
179
180
|
});
|
|
@@ -192,6 +193,7 @@ var useRadioContext = function useRadioContext() {
|
|
|
192
193
|
return React.useContext(RadioContext);
|
|
193
194
|
};
|
|
194
195
|
exports.useRadioContext = useRadioContext;
|
|
196
|
+
var _obj;
|
|
195
197
|
var RadioButton = function RadioButton(_param) {
|
|
196
198
|
var value = _param.value, id = _param.id, dataAttributes = _param.dataAttributes, rest = _objectWithoutProperties(_param, [
|
|
197
199
|
"value",
|
|
@@ -203,7 +205,6 @@ var RadioButton = function RadioButton(_param) {
|
|
|
203
205
|
var checked = value === selectedValue;
|
|
204
206
|
var tabIndex = focusableValue === value ? 0 : -1;
|
|
205
207
|
var classes = useRadioButtonStyles({
|
|
206
|
-
disabled: disabled,
|
|
207
208
|
checked: checked
|
|
208
209
|
});
|
|
209
210
|
var ref2 = (0, _hooks).useTheme(), isIos = ref2.isIos;
|
|
@@ -230,8 +231,8 @@ var RadioButton = function RadioButton(_param) {
|
|
|
230
231
|
}
|
|
231
232
|
};
|
|
232
233
|
var radio = /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
233
|
-
className: (0, _classnames).default(classes.outerCircle,
|
|
234
|
-
}, classes.outerCircleChecked, checked)),
|
|
234
|
+
className: (0, _classnames).default(classes.outerCircle, (_obj = {
|
|
235
|
+
}, _defineProperty(_obj, classes.outerCircleChecked, checked), _defineProperty(_obj, classes.disabled, disabled), _obj)),
|
|
235
236
|
children: !isIos && /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
236
237
|
className: (0, _classnames).default(classes.innerCircle, _defineProperty({
|
|
237
238
|
}, classes.innerCircleChecked, checked))
|
|
@@ -268,7 +269,10 @@ var RadioButton = function RadioButton(_param) {
|
|
|
268
269
|
/*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text3, {
|
|
269
270
|
regular: true,
|
|
270
271
|
as: "div",
|
|
271
|
-
children:
|
|
272
|
+
children: /*#__PURE__*/ (0, _jsxRuntime).jsx("span", {
|
|
273
|
+
className: disabled ? classes.disabled : '',
|
|
274
|
+
children: rest.children
|
|
275
|
+
})
|
|
272
276
|
})
|
|
273
277
|
]
|
|
274
278
|
})
|
package/dist/select.js
CHANGED
|
@@ -111,10 +111,6 @@ var _obj, _obj1;
|
|
|
111
111
|
var useStyles = (0, _jss).createUseStyles(function(theme) {
|
|
112
112
|
return {
|
|
113
113
|
selectContainer: (_obj = {
|
|
114
|
-
cursor: function cursor(param) {
|
|
115
|
-
var disabled = param.disabled;
|
|
116
|
-
return disabled ? 'auto' : 'pointer';
|
|
117
|
-
},
|
|
118
114
|
position: 'relative',
|
|
119
115
|
outline: 0
|
|
120
116
|
}, _defineProperty(_obj, theme.mq.tabletOrSmaller, {
|
|
@@ -145,24 +141,17 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
145
141
|
width: '100%',
|
|
146
142
|
height: '100%',
|
|
147
143
|
textOverflow: 'ellipsis',
|
|
148
|
-
'&:disabled': {
|
|
149
|
-
color: theme.colors.textDisabled
|
|
150
|
-
},
|
|
151
144
|
appearance: 'none',
|
|
152
145
|
cursor: function cursor(param) {
|
|
153
146
|
var disabled = param.disabled;
|
|
154
|
-
return disabled ? '
|
|
147
|
+
return disabled ? 'default' : 'pointer';
|
|
155
148
|
}
|
|
156
149
|
},
|
|
157
150
|
arrowDown: {
|
|
158
151
|
position: 'absolute',
|
|
159
152
|
right: 16,
|
|
160
153
|
top: 'calc(50% - 10px)',
|
|
161
|
-
pointerEvents: 'none'
|
|
162
|
-
opacity: function opacity(param) {
|
|
163
|
-
var disabled = param.disabled;
|
|
164
|
-
return disabled ? 0.3 : 1;
|
|
165
|
-
}
|
|
154
|
+
pointerEvents: 'none'
|
|
166
155
|
},
|
|
167
156
|
selectText: {
|
|
168
157
|
position: 'absolute',
|
|
@@ -175,9 +164,10 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
175
164
|
return label ? 27 : 17;
|
|
176
165
|
},
|
|
177
166
|
fontSize: 16,
|
|
178
|
-
color:
|
|
167
|
+
color: theme.colors.textPrimary,
|
|
168
|
+
opacity: function opacity(param) {
|
|
179
169
|
var disabled = param.disabled;
|
|
180
|
-
return disabled ?
|
|
170
|
+
return disabled ? 0.5 : 1;
|
|
181
171
|
},
|
|
182
172
|
maxWidth: '100%',
|
|
183
173
|
textOverflow: 'ellipsis',
|
|
@@ -485,7 +475,6 @@ var Select = function Select(param) {
|
|
|
485
475
|
error: error,
|
|
486
476
|
forId: inputId,
|
|
487
477
|
inputState: isFocused ? 'focused' : ((ref15 = value !== null && value !== void 0 ? value : valueState) !== null && ref15 !== void 0 ? ref15 : (ref11 = inputRef.current) === null || ref11 === void 0 ? void 0 : ref11.value) ? 'filled' : 'default',
|
|
488
|
-
disabled: disabled,
|
|
489
478
|
optional: optional,
|
|
490
479
|
children: label
|
|
491
480
|
}),
|