@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/dist-es/skins/o2.js
CHANGED
|
@@ -63,40 +63,29 @@ export var getO2Skin = function() {
|
|
|
63
63
|
borderSelected: palette.o2BluePrimary,
|
|
64
64
|
// BUTTONS
|
|
65
65
|
buttonDangerBackground: palette.pepper,
|
|
66
|
-
buttonDangerBackgroundDisabled: palette.pepperLight30,
|
|
67
66
|
buttonDangerBackgroundSelected: palette.pepperDark,
|
|
68
67
|
buttonDangerBackgroundHover: palette.pepperDark,
|
|
69
68
|
buttonLinkBackgroundSelected: palette.o2BluePrimaryLight10,
|
|
70
69
|
buttonLinkBackgroundSelectedInverse: applyAlpha(palette.white, 0.2),
|
|
71
70
|
buttonPrimaryBackground: palette.o2BluePrimary,
|
|
72
|
-
buttonPrimaryBackgroundDisabled: palette.o2BluePrimaryLight10,
|
|
73
|
-
buttonPrimaryBackgroundDisabledInverse: palette.o2BluePrimaryLight50,
|
|
74
71
|
buttonPrimaryBackgroundInverse: palette.white,
|
|
75
72
|
buttonPrimaryBackgroundSelected: palette.o2BluePrimaryDark,
|
|
76
73
|
buttonPrimaryBackgroundHover: palette.o2BluePrimaryDark,
|
|
77
74
|
buttonPrimaryBackgroundSelectedInverse: palette.o2BluePrimaryLight50,
|
|
78
75
|
buttonSecondaryBackground: palette.o2BluePrimary,
|
|
79
|
-
buttonSecondaryBackgroundDisabled: palette.o2BluePrimaryLight10,
|
|
80
76
|
buttonSecondaryBackgroundSelected: palette.o2BluePrimaryDark,
|
|
81
|
-
buttonSecondaryBorderDisabledInverse: palette.o2BluePrimaryLight50,
|
|
82
77
|
buttonSecondaryBorderInverse: palette.white,
|
|
83
78
|
buttonSecondaryBorderSelectedInverse: palette.o2BluePrimaryLight50,
|
|
84
79
|
textButtonPrimary: palette.white,
|
|
85
|
-
textButtonPrimaryDisabled: palette.white,
|
|
86
80
|
textButtonPrimaryInverse: palette.o2BluePrimary,
|
|
87
|
-
textButtonPrimaryInverseDisabled: palette.o2BluePrimaryLight10,
|
|
88
81
|
textButtonPrimaryInverseSelected: palette.o2BluePrimaryDark,
|
|
89
82
|
textButtonSecondary: palette.o2BluePrimary,
|
|
90
|
-
textButtonSecondaryDisabled: palette.o2BluePrimaryLight10,
|
|
91
83
|
textButtonSecondarySelected: palette.o2BluePrimaryDark,
|
|
92
84
|
textButtonSecondaryInverse: palette.white,
|
|
93
|
-
textButtonSecondaryInverseDisabled: palette.o2BluePrimaryLight50,
|
|
94
85
|
textButtonSecondaryInverseSelected: palette.white,
|
|
95
86
|
textLink: palette.o2BluePrimary,
|
|
96
87
|
textLinkInverse: palette.white,
|
|
97
88
|
textLinkDanger: palette.pepper,
|
|
98
|
-
textLinkDangerDisabled: palette.pepperLight30,
|
|
99
|
-
textLinkDisabled: palette.o2BluePrimaryLight50,
|
|
100
89
|
textLinkSnackbar: palette.o2BluePrimaryLight50,
|
|
101
90
|
// CONTROLS
|
|
102
91
|
control: palette.grey3,
|
|
@@ -130,7 +119,6 @@ export var getO2Skin = function() {
|
|
|
130
119
|
textPrimaryInverse: palette.white,
|
|
131
120
|
textSecondary: palette.grey5,
|
|
132
121
|
textSecondaryInverse: palette.white,
|
|
133
|
-
textDisabled: palette.grey4,
|
|
134
122
|
textAmount: palette.o2BluePrimary,
|
|
135
123
|
// STATES
|
|
136
124
|
error: palette.pepper,
|
|
@@ -160,36 +148,26 @@ export var getO2Skin = function() {
|
|
|
160
148
|
border: palette.darkModeGrey,
|
|
161
149
|
borderDark: palette.grey5,
|
|
162
150
|
borderSelected: palette.darkModeO2BluePrimary,
|
|
163
|
-
buttonDangerBackgroundDisabled: applyAlpha(palette.white, 0.05),
|
|
164
151
|
buttonLinkBackgroundSelected: applyAlpha(palette.white, 0.05),
|
|
165
152
|
buttonLinkBackgroundSelectedInverse: applyAlpha(palette.white, 0.05),
|
|
166
153
|
buttonPrimaryBackground: palette.darkModeO2BluePrimary,
|
|
167
|
-
buttonPrimaryBackgroundDisabled: applyAlpha(palette.white, 0.05),
|
|
168
|
-
buttonPrimaryBackgroundDisabledInverse: applyAlpha(palette.white, 0.05),
|
|
169
154
|
buttonPrimaryBackgroundInverse: palette.darkModeO2BluePrimary,
|
|
170
155
|
buttonPrimaryBackgroundSelected: palette.darkModeO2BluePrimaryDark,
|
|
171
156
|
buttonPrimaryBackgroundHover: palette.darkModeO2BluePrimaryDark,
|
|
172
157
|
buttonPrimaryBackgroundSelectedInverse: palette.darkModeO2BluePrimaryDark,
|
|
173
158
|
buttonSecondaryBackground: palette.darkModeO2BluePrimary,
|
|
174
|
-
buttonSecondaryBackgroundDisabled: applyAlpha(palette.white, 0.05),
|
|
175
159
|
buttonSecondaryBackgroundSelected: palette.darkModeO2BluePrimaryDark,
|
|
176
|
-
buttonSecondaryBorderDisabledInverse: applyAlpha(palette.white, 0.05),
|
|
177
160
|
buttonSecondaryBorderInverse: palette.darkModeO2BluePrimary,
|
|
178
161
|
buttonSecondaryBorderSelectedInverse: palette.darkModeO2BluePrimaryDark,
|
|
179
162
|
textButtonPrimary: palette.grey2,
|
|
180
|
-
textButtonPrimaryDisabled: palette.grey5,
|
|
181
163
|
textButtonPrimaryInverse: palette.grey2,
|
|
182
|
-
textButtonPrimaryInverseDisabled: palette.grey5,
|
|
183
164
|
textButtonPrimaryInverseSelected: palette.grey2,
|
|
184
165
|
textButtonSecondary: palette.grey2,
|
|
185
|
-
textButtonSecondaryDisabled: palette.grey5,
|
|
186
166
|
textButtonSecondarySelected: palette.grey4,
|
|
187
167
|
textButtonSecondaryInverse: palette.grey2,
|
|
188
|
-
textButtonSecondaryInverseDisabled: palette.grey5,
|
|
189
168
|
textButtonSecondaryInverseSelected: palette.grey4,
|
|
190
169
|
textLink: palette.o2BluePrimaryLight50,
|
|
191
170
|
textLinkInverse: palette.o2BluePrimaryLight50,
|
|
192
|
-
textLinkDisabled: palette.darkModeGrey6,
|
|
193
171
|
control: palette.darkModeGrey6,
|
|
194
172
|
controlActivated: palette.o2BluePrimaryLight50,
|
|
195
173
|
loadingBar: palette.darkModeO2BluePrimary,
|
|
@@ -213,7 +191,6 @@ export var getO2Skin = function() {
|
|
|
213
191
|
textPrimaryInverse: palette.grey2,
|
|
214
192
|
textSecondary: palette.grey4,
|
|
215
193
|
textSecondaryInverse: palette.grey4,
|
|
216
|
-
textDisabled: palette.grey5,
|
|
217
194
|
textAmount: palette.o2BluePrimaryLight10,
|
|
218
195
|
textNavigationBarPrimary: palette.grey2,
|
|
219
196
|
textNavigationBarSecondary: palette.grey4,
|
package/dist-es/skins/vivo.js
CHANGED
|
@@ -54,40 +54,29 @@ export var getVivoSkin = function() {
|
|
|
54
54
|
borderSelected: palette.vivoPurple,
|
|
55
55
|
// BUTTONS
|
|
56
56
|
buttonDangerBackground: palette.pepper,
|
|
57
|
-
buttonDangerBackgroundDisabled: palette.pepperLight30,
|
|
58
57
|
buttonDangerBackgroundSelected: palette.pepperDark,
|
|
59
58
|
buttonDangerBackgroundHover: palette.pepperDark,
|
|
60
59
|
buttonLinkBackgroundSelected: palette.vivoPurpleLight10,
|
|
61
60
|
buttonLinkBackgroundSelectedInverse: applyAlpha(palette.white, 0.2),
|
|
62
61
|
buttonPrimaryBackground: palette.vivoPurple,
|
|
63
|
-
buttonPrimaryBackgroundDisabled: palette.vivoPurpleLight20,
|
|
64
|
-
buttonPrimaryBackgroundDisabledInverse: palette.vivoPurpleLight50,
|
|
65
62
|
buttonPrimaryBackgroundInverse: palette.white,
|
|
66
63
|
buttonPrimaryBackgroundSelected: palette.vivoPurpleDark,
|
|
67
64
|
buttonPrimaryBackgroundHover: palette.vivoPurpleDark,
|
|
68
65
|
buttonPrimaryBackgroundSelectedInverse: palette.vivoPurpleLight50,
|
|
69
66
|
buttonSecondaryBackground: palette.vivoPurple,
|
|
70
|
-
buttonSecondaryBackgroundDisabled: palette.vivoPurpleLight20,
|
|
71
67
|
buttonSecondaryBackgroundSelected: palette.vivoPurpleDark,
|
|
72
|
-
buttonSecondaryBorderDisabledInverse: palette.vivoPurpleLight50,
|
|
73
68
|
buttonSecondaryBorderInverse: palette.white,
|
|
74
69
|
buttonSecondaryBorderSelectedInverse: palette.vivoPurpleLight50,
|
|
75
70
|
textButtonPrimary: palette.white,
|
|
76
|
-
textButtonPrimaryDisabled: palette.white,
|
|
77
71
|
textButtonPrimaryInverse: palette.vivoPurple,
|
|
78
|
-
textButtonPrimaryInverseDisabled: palette.vivoPurpleLight20,
|
|
79
72
|
textButtonPrimaryInverseSelected: palette.vivoPurple,
|
|
80
73
|
textButtonSecondary: palette.vivoPurple,
|
|
81
|
-
textButtonSecondaryDisabled: palette.vivoPurpleLight20,
|
|
82
74
|
textButtonSecondarySelected: palette.vivoPurpleDark,
|
|
83
75
|
textButtonSecondaryInverse: palette.white,
|
|
84
|
-
textButtonSecondaryInverseDisabled: palette.vivoPurpleLight50,
|
|
85
76
|
textButtonSecondaryInverseSelected: palette.white,
|
|
86
77
|
textLink: palette.vivoPurple,
|
|
87
78
|
textLinkInverse: palette.white,
|
|
88
79
|
textLinkDanger: palette.pepper,
|
|
89
|
-
textLinkDangerDisabled: palette.pepperLight30,
|
|
90
|
-
textLinkDisabled: palette.vivoPurpleLight50,
|
|
91
80
|
textLinkSnackbar: palette.vivoPurpleLight50,
|
|
92
81
|
// CONTROLS
|
|
93
82
|
control: palette.grey3,
|
|
@@ -121,7 +110,6 @@ export var getVivoSkin = function() {
|
|
|
121
110
|
textPrimaryInverse: palette.white,
|
|
122
111
|
textSecondary: palette.grey5,
|
|
123
112
|
textSecondaryInverse: palette.white,
|
|
124
|
-
textDisabled: palette.grey4,
|
|
125
113
|
textAmount: palette.vivoPurple,
|
|
126
114
|
// STATES
|
|
127
115
|
error: palette.pepper,
|
|
@@ -151,36 +139,26 @@ export var getVivoSkin = function() {
|
|
|
151
139
|
border: palette.darkModeGrey,
|
|
152
140
|
borderDark: palette.grey5,
|
|
153
141
|
borderSelected: palette.vivoPurpleLight80,
|
|
154
|
-
buttonDangerBackgroundDisabled: applyAlpha(palette.white, 0.05),
|
|
155
142
|
buttonLinkBackgroundSelected: applyAlpha(palette.white, 0.05),
|
|
156
143
|
buttonLinkBackgroundSelectedInverse: applyAlpha(palette.white, 0.05),
|
|
157
144
|
buttonPrimaryBackground: palette.vivoPurpleLight80,
|
|
158
|
-
buttonPrimaryBackgroundDisabled: applyAlpha(palette.white, 0.05),
|
|
159
|
-
buttonPrimaryBackgroundDisabledInverse: applyAlpha(palette.white, 0.05),
|
|
160
145
|
buttonPrimaryBackgroundInverse: palette.vivoPurpleLight80,
|
|
161
146
|
buttonPrimaryBackgroundSelected: palette.vivoPurpleDark,
|
|
162
147
|
buttonPrimaryBackgroundHover: palette.vivoPurpleDark,
|
|
163
148
|
buttonPrimaryBackgroundSelectedInverse: palette.vivoPurpleDark,
|
|
164
149
|
buttonSecondaryBackground: palette.vivoPurpleLight80,
|
|
165
|
-
buttonSecondaryBackgroundDisabled: applyAlpha(palette.white, 0.05),
|
|
166
150
|
buttonSecondaryBackgroundSelected: palette.vivoPurpleDark,
|
|
167
|
-
buttonSecondaryBorderDisabledInverse: applyAlpha(palette.white, 0.05),
|
|
168
151
|
buttonSecondaryBorderInverse: palette.vivoPurpleLight80,
|
|
169
152
|
buttonSecondaryBorderSelectedInverse: palette.vivoPurpleDark,
|
|
170
153
|
textButtonPrimary: palette.grey2,
|
|
171
|
-
textButtonPrimaryDisabled: palette.grey5,
|
|
172
154
|
textButtonPrimaryInverse: palette.grey2,
|
|
173
|
-
textButtonPrimaryInverseDisabled: palette.grey5,
|
|
174
155
|
textButtonPrimaryInverseSelected: palette.grey2,
|
|
175
156
|
textButtonSecondary: palette.grey2,
|
|
176
|
-
textButtonSecondaryDisabled: palette.grey5,
|
|
177
157
|
textButtonSecondarySelected: palette.grey4,
|
|
178
158
|
textButtonSecondaryInverse: palette.grey2,
|
|
179
|
-
textButtonSecondaryInverseDisabled: palette.grey5,
|
|
180
159
|
textButtonSecondaryInverseSelected: palette.grey4,
|
|
181
160
|
textLink: palette.vivoPurpleLight50,
|
|
182
161
|
textLinkInverse: palette.vivoPurpleLight50,
|
|
183
|
-
textLinkDisabled: palette.darkModeGrey6,
|
|
184
162
|
control: palette.darkModeGrey6,
|
|
185
163
|
controlActivated: palette.vivoPurpleLight80,
|
|
186
164
|
loadingBar: palette.vivoPurpleLight80,
|
|
@@ -205,7 +183,6 @@ export var getVivoSkin = function() {
|
|
|
205
183
|
textPrimaryInverse: palette.grey2,
|
|
206
184
|
textSecondary: palette.grey4,
|
|
207
185
|
textSecondaryInverse: palette.grey4,
|
|
208
|
-
textDisabled: palette.grey5,
|
|
209
186
|
textAmount: palette.vivoPurpleLight50,
|
|
210
187
|
textNavigationBarPrimary: palette.grey2,
|
|
211
188
|
textNavigationBarSecondary: palette.grey4,
|
|
@@ -79,7 +79,8 @@ var useStyles = createUseStyles(function(param) {
|
|
|
79
79
|
return {
|
|
80
80
|
checkbox: {
|
|
81
81
|
display: 'inline-block',
|
|
82
|
-
padding: isIos ? 0 : 4
|
|
82
|
+
padding: isIos ? 0 : 4,
|
|
83
|
+
cursor: 'pointer'
|
|
83
84
|
},
|
|
84
85
|
switchCheckboxContainer: {
|
|
85
86
|
position: 'relative',
|
|
@@ -89,7 +90,6 @@ var useStyles = createUseStyles(function(param) {
|
|
|
89
90
|
switchCheckboxLabel: {
|
|
90
91
|
display: 'block',
|
|
91
92
|
overflow: 'hidden',
|
|
92
|
-
cursor: 'pointer',
|
|
93
93
|
borderRadius: 40,
|
|
94
94
|
'& > *': {
|
|
95
95
|
pointerEvents: 'none'
|
|
@@ -135,8 +135,8 @@ var useStyles = createUseStyles(function(param) {
|
|
|
135
135
|
cursor: 'default'
|
|
136
136
|
},
|
|
137
137
|
disabled: {
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
cursor: 'default',
|
|
139
|
+
opacity: 0.5
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
142
|
});
|
|
@@ -182,7 +182,8 @@ var Switch = function(props) {
|
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
var switchEl = /*#__PURE__*/ _jsx("div", {
|
|
185
|
-
className: classes.checkbox,
|
|
185
|
+
className: classNames(classes.checkbox, _defineProperty({
|
|
186
|
+
}, classes.disabled, disabled)),
|
|
186
187
|
children: /*#__PURE__*/ _jsx("div", {
|
|
187
188
|
className: classes.switchCheckboxContainer,
|
|
188
189
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
@@ -207,8 +208,7 @@ var Switch = function(props) {
|
|
|
207
208
|
onKeyDown: disabled ? undefined : handleKeyDown,
|
|
208
209
|
tabIndex: disabled ? undefined : 0,
|
|
209
210
|
ref: focusableRef,
|
|
210
|
-
className:
|
|
211
|
-
}, classes.disabled, disabled)),
|
|
211
|
+
className: classes.container,
|
|
212
212
|
"aria-disabled": disabled,
|
|
213
213
|
"aria-labelledby": labelId
|
|
214
214
|
}, getPrefixedDataAttributes(props.dataAttributes), {
|
|
@@ -219,11 +219,14 @@ var Switch = function(props) {
|
|
|
219
219
|
alignItems: "center",
|
|
220
220
|
children: [
|
|
221
221
|
switchEl,
|
|
222
|
-
/*#__PURE__*/ _jsx(Text3, {
|
|
222
|
+
props.children && /*#__PURE__*/ _jsx(Text3, {
|
|
223
223
|
regular: true,
|
|
224
224
|
as: "div",
|
|
225
225
|
id: labelId,
|
|
226
|
-
children:
|
|
226
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
227
|
+
className: disabled ? classes.disabled : '',
|
|
228
|
+
children: props.children
|
|
229
|
+
})
|
|
227
230
|
})
|
|
228
231
|
]
|
|
229
232
|
})
|
|
@@ -137,10 +137,6 @@ var commonInputStyles = function(theme) {
|
|
|
137
137
|
opacity: 0.5
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
|
-
'&:disabled': {
|
|
141
|
-
color: theme.colors.textDisabled,
|
|
142
|
-
cursor: 'not-allowed'
|
|
143
|
-
},
|
|
144
140
|
boxShadow: 'none'
|
|
145
141
|
};
|
|
146
142
|
};
|
|
@@ -254,11 +250,7 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
254
250
|
paddingRight: 16,
|
|
255
251
|
display: 'flex',
|
|
256
252
|
alignItems: 'center',
|
|
257
|
-
alignSelf: 'center'
|
|
258
|
-
opacity: function(param) {
|
|
259
|
-
var disabled = param.disabled;
|
|
260
|
-
return disabled ? 0.3 : 1;
|
|
261
|
-
}
|
|
253
|
+
alignSelf: 'center'
|
|
262
254
|
},
|
|
263
255
|
startIcon: {
|
|
264
256
|
pointerEvents: 'none',
|
|
@@ -267,11 +259,7 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
267
259
|
display: 'flex',
|
|
268
260
|
alignItems: 'center',
|
|
269
261
|
height: '100%',
|
|
270
|
-
position: 'absolute'
|
|
271
|
-
opacity: function(param) {
|
|
272
|
-
var disabled = param.disabled;
|
|
273
|
-
return disabled ? 0.3 : 1;
|
|
274
|
-
}
|
|
262
|
+
position: 'absolute'
|
|
275
263
|
},
|
|
276
264
|
prefix: (_obj2 = {
|
|
277
265
|
alignSelf: 'baseline',
|
|
@@ -370,7 +358,6 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
370
358
|
width: "calc(((100% - ".concat(LABEL_LEFT_POSITION + (startIcon ? 48 : LABEL_LEFT_POSITION), "px)) / ").concat(scale, ")"),
|
|
371
359
|
paddingRight: endIcon && !isShrinked ? 36 : 0
|
|
372
360
|
};
|
|
373
|
-
var prefixColor = rest.disabled ? colors.textDisabled : colors.textSecondary;
|
|
374
361
|
return(/*#__PURE__*/ _jsxs(FieldContainer, {
|
|
375
362
|
disabled: rest.disabled,
|
|
376
363
|
helperText: /*#__PURE__*/ _jsx(HelperText, {
|
|
@@ -389,7 +376,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
389
376
|
prefix && /*#__PURE__*/ _jsx("div", {
|
|
390
377
|
className: classes.prefix,
|
|
391
378
|
children: /*#__PURE__*/ _jsx(Text3, {
|
|
392
|
-
color:
|
|
379
|
+
color: colors.textSecondary,
|
|
393
380
|
regular: true,
|
|
394
381
|
children: prefix
|
|
395
382
|
})
|
|
@@ -439,7 +426,6 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
439
426
|
forId: id,
|
|
440
427
|
inputState: inputState,
|
|
441
428
|
shrinkLabel: shrinkLabel,
|
|
442
|
-
disabled: rest.disabled,
|
|
443
429
|
optional: !rest.required,
|
|
444
430
|
children: label
|
|
445
431
|
}),
|
|
@@ -86,10 +86,7 @@ var useLabelStyles = createUseStyles(function(theme) {
|
|
|
86
86
|
fontSize: 18,
|
|
87
87
|
lineHeight: '24px',
|
|
88
88
|
color: function(param) {
|
|
89
|
-
var inputState = param.inputState, error = param.error
|
|
90
|
-
if (inputState === 'default' && disabled) {
|
|
91
|
-
return theme.colors.textDisabled;
|
|
92
|
-
}
|
|
89
|
+
var inputState = param.inputState, error = param.error;
|
|
93
90
|
if (error && inputState !== 'default') {
|
|
94
91
|
return theme.colors.error;
|
|
95
92
|
}
|
|
@@ -125,13 +122,11 @@ var useLabelStyles = createUseStyles(function(theme) {
|
|
|
125
122
|
};
|
|
126
123
|
});
|
|
127
124
|
export var Label = function(param) {
|
|
128
|
-
var shrinkLabel = param.shrinkLabel, forId = param.forId, inputState = param.inputState, error = param.error, children = param.children,
|
|
125
|
+
var shrinkLabel = param.shrinkLabel, forId = param.forId, inputState = param.inputState, error = param.error, children = param.children, style = param.style, optional = param.optional;
|
|
129
126
|
var isShrinked = shrinkLabel || inputState === 'focused' || inputState === 'filled';
|
|
130
127
|
var classes = useLabelStyles({
|
|
131
|
-
isShrinked: isShrinked,
|
|
132
128
|
inputState: inputState,
|
|
133
|
-
error: error
|
|
134
|
-
disabled: disabled
|
|
129
|
+
error: error
|
|
135
130
|
});
|
|
136
131
|
var ref = _slicedToArray(React.useState(''), 2), transitionStyle = ref[0], setTransitionStyle = ref[1];
|
|
137
132
|
var ref1 = useTheme(), texts = ref1.texts;
|
|
@@ -225,6 +220,10 @@ var _obj1, _obj2;
|
|
|
225
220
|
var useFieldContainerStyles = createUseStyles(function(theme) {
|
|
226
221
|
return {
|
|
227
222
|
fieldContainer: (_obj1 = {
|
|
223
|
+
opacity: function(param) {
|
|
224
|
+
var disabled = param.disabled;
|
|
225
|
+
return disabled ? 0.5 : 1;
|
|
226
|
+
},
|
|
228
227
|
display: 'flex',
|
|
229
228
|
flexDirection: 'column',
|
|
230
229
|
minWidth: 96
|
|
@@ -249,13 +248,7 @@ var useFieldContainerStyles = createUseStyles(function(theme) {
|
|
|
249
248
|
var multiline = param.multiline;
|
|
250
249
|
return multiline ? 152 : 56;
|
|
251
250
|
}
|
|
252
|
-
}), _defineProperty(_obj2, "display", 'flex'), _defineProperty(_obj2, "position", 'relative'), _defineProperty(_obj2, "backgroundColor",
|
|
253
|
-
var disabled = param.disabled;
|
|
254
|
-
return disabled ? theme.colors.backgroundAlternative : theme.colors.backgroundContainer;
|
|
255
|
-
}), _defineProperty(_obj2, "cursor", function(param) {
|
|
256
|
-
var disabled = param.disabled;
|
|
257
|
-
return disabled ? 'not-allowed' : 'initial';
|
|
258
|
-
}), _obj2)
|
|
251
|
+
}), _defineProperty(_obj2, "display", 'flex'), _defineProperty(_obj2, "position", 'relative'), _defineProperty(_obj2, "backgroundColor", theme.colors.backgroundContainer), _obj2)
|
|
259
252
|
};
|
|
260
253
|
});
|
|
261
254
|
export var FieldContainer = function(param) {
|
package/dist-es/text-link.js
CHANGED
|
@@ -3,6 +3,7 @@ import { createUseStyles } from './jss';
|
|
|
3
3
|
import Touchable from './touchable';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { useIsInverseVariant } from './theme-variant-context';
|
|
6
|
+
import { useForm } from './form-context';
|
|
6
7
|
function _defineProperty(obj, key, value) {
|
|
7
8
|
if (key in obj) {
|
|
8
9
|
Object.defineProperty(obj, key, {
|
|
@@ -62,19 +63,22 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
62
63
|
}
|
|
63
64
|
return target;
|
|
64
65
|
}
|
|
66
|
+
var _obj;
|
|
65
67
|
var useStyles = createUseStyles(function(theme) {
|
|
66
68
|
return {
|
|
67
|
-
textLink:
|
|
69
|
+
textLink: (_obj = {
|
|
68
70
|
width: 'auto',
|
|
69
71
|
lineHeight: 'inherit',
|
|
70
72
|
display: 'inline-block',
|
|
71
73
|
color: theme.colors.textLink,
|
|
72
74
|
wordBreak: 'break-word'
|
|
73
|
-
}, theme.mq.supportsHover, {
|
|
74
|
-
'&:hover': {
|
|
75
|
+
}, _defineProperty(_obj, theme.mq.supportsHover, {
|
|
76
|
+
'&:hover:not([disabled])': {
|
|
75
77
|
textDecoration: 'underline'
|
|
76
78
|
}
|
|
77
|
-
}),
|
|
79
|
+
}), _defineProperty(_obj, '&[disabled]', {
|
|
80
|
+
opacity: 0.5
|
|
81
|
+
}), _obj),
|
|
78
82
|
inverse: {
|
|
79
83
|
color: theme.colors.textLinkInverse
|
|
80
84
|
},
|
|
@@ -83,15 +87,17 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
83
87
|
}
|
|
84
88
|
};
|
|
85
89
|
});
|
|
86
|
-
var
|
|
90
|
+
var _obj1;
|
|
87
91
|
var TextLink = function(_param) {
|
|
88
|
-
var children = _param.children, _className = _param.className, className = _className === void 0 ? '' : _className, small = _param.small, props = _objectWithoutProperties(_param, ["children", "className", "small"]);
|
|
92
|
+
var children = _param.children, _className = _param.className, className = _className === void 0 ? '' : _className, small = _param.small, disabled = _param.disabled, props = _objectWithoutProperties(_param, ["children", "className", "small", "disabled"]);
|
|
89
93
|
var classes = useStyles();
|
|
90
94
|
var isInverse = useIsInverseVariant();
|
|
95
|
+
var ref = useForm(), formStatus = ref.formStatus;
|
|
91
96
|
return(/*#__PURE__*/ _jsx(Touchable, _objectSpread({
|
|
92
97
|
}, props, {
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
disabled: disabled || formStatus === 'sending',
|
|
99
|
+
className: classnames(classes.textLink, className, (_obj1 = {
|
|
100
|
+
}, _defineProperty(_obj1, classes.small, small), _defineProperty(_obj1, classes.inverse, isInverse), _obj1)),
|
|
95
101
|
children: children
|
|
96
102
|
})));
|
|
97
103
|
};
|
package/dist-es/touchable.js
CHANGED
|
@@ -68,8 +68,7 @@ var useStyles = createUseStyles(function() {
|
|
|
68
68
|
border: 'none'
|
|
69
69
|
},
|
|
70
70
|
'&[disabled]': {
|
|
71
|
-
cursor: '
|
|
72
|
-
pointerEvents: 'none'
|
|
71
|
+
cursor: 'default'
|
|
73
72
|
},
|
|
74
73
|
'&:active, &:hover': {
|
|
75
74
|
textDecoration: 'none'
|
|
@@ -173,7 +172,7 @@ var Touchable = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
173
172
|
"aria-labelledby": props['aria-labelledby'],
|
|
174
173
|
onClick: handleHrefClick,
|
|
175
174
|
onKeyDown: handleKeyDown,
|
|
176
|
-
href: props.disabled ?
|
|
175
|
+
href: props.disabled ? undefined : getHref(),
|
|
177
176
|
target: openNewTab ? '_blank' : undefined,
|
|
178
177
|
rel: openNewTab ? 'noopener noreferrer' : undefined,
|
|
179
178
|
ref: ref,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telefonica/mistica",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.15.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@swc/core": "^1.2.93",
|
|
77
77
|
"@swc/jest": "^0.2.4",
|
|
78
78
|
"@telefonica/acceptance-testing": "^2.5.0",
|
|
79
|
-
"@telefonica/eslint-config": "^1.0.
|
|
79
|
+
"@telefonica/eslint-config": "^1.0.2",
|
|
80
80
|
"@telefonica/prettier-config": "^1.1.0",
|
|
81
81
|
"@telefonica/ts-to-flow": "1.1.5",
|
|
82
82
|
"@testing-library/jest-dom": "^5.12.0",
|