@telefonica/mistica 10.14.2 → 10.18.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 +34 -0
- package/dist/button.js +16 -26
- package/dist/card.d.ts +10 -1
- package/dist/card.js +4 -1
- package/dist/card.js.flow +16 -1
- package/dist/checkbox.js +11 -7
- package/dist/credit-card-expiration-field.js +2 -7
- package/dist/credit-card-number-field.js +2 -2
- package/dist/cvv-field.js +2 -2
- package/dist/date-field.js +2 -2
- package/dist/date-time-field.js +2 -2
- package/dist/date-time-picker.js +12 -6
- package/dist/decimal-field.js +2 -7
- package/dist/email-field.js +2 -7
- package/dist/feedback.js +5 -8
- package/dist/iban-field.js +2 -7
- package/dist/image.d.ts +25 -4
- package/dist/image.js +64 -7
- package/dist/image.js.flow +30 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.js +20 -0
- package/dist/index.js.flow +3 -1
- package/dist/integer-field.js +2 -7
- package/dist/list.d.ts +1 -0
- package/dist/list.js +63 -26
- package/dist/list.js.flow +1 -0
- package/dist/menu.d.ts +1 -1
- package/dist/menu.js +34 -27
- package/dist/menu.js.flow +1 -1
- package/dist/month-field.js +2 -2
- package/dist/package-version.js +1 -1
- package/dist/password-field.js +2 -2
- package/dist/phone-number-field.js +2 -7
- package/dist/radio-button.js +13 -9
- package/dist/search-field.js +2 -2
- package/dist/select.js +7 -18
- 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.d.ts +3 -2
- package/dist/text-field-base.js +15 -33
- package/dist/text-field-base.js.flow +6 -2
- 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-field.d.ts +2 -1
- package/dist/text-field.js +10 -16
- package/dist/text-field.js.flow +5 -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/video.d.ts +32 -0
- package/dist/video.js +161 -0
- package/dist/video.js.flow +50 -0
- package/dist-es/button.js +16 -26
- package/dist-es/card.js +4 -1
- package/dist-es/checkbox.js +11 -7
- package/dist-es/credit-card-expiration-field.js +2 -2
- package/dist-es/credit-card-number-field.js +2 -2
- package/dist-es/cvv-field.js +2 -2
- package/dist-es/date-field.js +2 -2
- package/dist-es/date-time-field.js +2 -2
- package/dist-es/date-time-picker.js +12 -6
- package/dist-es/decimal-field.js +2 -2
- package/dist-es/email-field.js +2 -2
- package/dist-es/feedback.js +5 -8
- package/dist-es/iban-field.js +2 -2
- package/dist-es/image.js +38 -6
- package/dist-es/index.js +3 -1
- package/dist-es/integer-field.js +2 -2
- package/dist-es/list.js +63 -26
- package/dist-es/menu.js +35 -28
- package/dist-es/month-field.js +2 -2
- package/dist-es/package-version.js +1 -1
- package/dist-es/password-field.js +2 -2
- package/dist-es/phone-number-field.js +2 -2
- package/dist-es/radio-button.js +13 -9
- package/dist-es/search-field.js +2 -2
- package/dist-es/select.js +7 -18
- 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 +15 -32
- package/dist-es/text-field-components.js +8 -15
- package/dist-es/text-field.js +9 -12
- package/dist-es/text-link.js +14 -8
- package/dist-es/touchable.js +2 -3
- package/dist-es/video.js +123 -0
- package/package.json +2 -2
package/dist/video.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare type AspectRatio = '1:1' | '16:9' | '12:5';
|
|
3
|
+
export declare const RATIO: {
|
|
4
|
+
'1:1': number;
|
|
5
|
+
'16:9': number;
|
|
6
|
+
'12:5': number;
|
|
7
|
+
};
|
|
8
|
+
declare type VideoSource = {
|
|
9
|
+
src: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type VideoProps = {
|
|
13
|
+
/** defaults to 100% when no width and no height are given */
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
/** defaults to 1:1, if both width and height are given, aspectRatio is ignored */
|
|
17
|
+
aspectRatio?: AspectRatio;
|
|
18
|
+
/** accepts multiple sources */
|
|
19
|
+
src: string | Array<string> | VideoSource | Array<VideoSource>;
|
|
20
|
+
/** defaults to true */
|
|
21
|
+
loop?: boolean;
|
|
22
|
+
/** defaults to true */
|
|
23
|
+
muted?: boolean;
|
|
24
|
+
/** defaults to true */
|
|
25
|
+
autoPlay?: boolean;
|
|
26
|
+
poster?: string;
|
|
27
|
+
children?: void;
|
|
28
|
+
/** defaults to none */
|
|
29
|
+
preload?: 'none' | 'metadata' | 'auto';
|
|
30
|
+
};
|
|
31
|
+
declare const Video: React.ForwardRefExoticComponent<VideoProps & React.RefAttributes<HTMLVideoElement>>;
|
|
32
|
+
export default Video;
|
package/dist/video.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.default = exports.RATIO = void 0;
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _image = require("./image");
|
|
9
|
+
var _jss = require("./jss");
|
|
10
|
+
var _common = require("./utils/common");
|
|
11
|
+
function _interopRequireWildcard(obj) {
|
|
12
|
+
if (obj && obj.__esModule) {
|
|
13
|
+
return obj;
|
|
14
|
+
} else {
|
|
15
|
+
var newObj = {
|
|
16
|
+
};
|
|
17
|
+
if (obj != null) {
|
|
18
|
+
for(var key in obj){
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
20
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {
|
|
21
|
+
};
|
|
22
|
+
if (desc.get || desc.set) {
|
|
23
|
+
Object.defineProperty(newObj, key, desc);
|
|
24
|
+
} else {
|
|
25
|
+
newObj[key] = obj[key];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
newObj.default = obj;
|
|
31
|
+
return newObj;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function _objectWithoutProperties(source, excluded) {
|
|
35
|
+
if (source == null) return {
|
|
36
|
+
};
|
|
37
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
38
|
+
var key, i;
|
|
39
|
+
if (Object.getOwnPropertySymbols) {
|
|
40
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
41
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
42
|
+
key = sourceSymbolKeys[i];
|
|
43
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
44
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
45
|
+
target[key] = source[key];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return target;
|
|
49
|
+
}
|
|
50
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
51
|
+
if (source == null) return {
|
|
52
|
+
};
|
|
53
|
+
var target = {
|
|
54
|
+
};
|
|
55
|
+
var sourceKeys = Object.keys(source);
|
|
56
|
+
var key, i;
|
|
57
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
58
|
+
key = sourceKeys[i];
|
|
59
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
60
|
+
target[key] = source[key];
|
|
61
|
+
}
|
|
62
|
+
return target;
|
|
63
|
+
}
|
|
64
|
+
var RATIO = {
|
|
65
|
+
'1:1': 1,
|
|
66
|
+
'16:9': 16 / 9,
|
|
67
|
+
'12:5': 12 / 5
|
|
68
|
+
};
|
|
69
|
+
exports.RATIO = RATIO;
|
|
70
|
+
var useStyles = (0, _jss).createUseStyles(function() {
|
|
71
|
+
return {
|
|
72
|
+
video: {
|
|
73
|
+
borderRadius: function borderRadius(param) {
|
|
74
|
+
var noBorderRadius = param.noBorderRadius;
|
|
75
|
+
return noBorderRadius ? 0 : 4;
|
|
76
|
+
},
|
|
77
|
+
display: 'block',
|
|
78
|
+
maxWidth: '100%',
|
|
79
|
+
maxHeight: '100%',
|
|
80
|
+
objectFit: 'cover',
|
|
81
|
+
aspectRatio: function aspectRatio(param) {
|
|
82
|
+
var aspectRatio1 = param.aspectRatio;
|
|
83
|
+
return aspectRatio1 !== null && aspectRatio1 !== void 0 ? aspectRatio1 : 'unset';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
/** Transparent 1x1px PNG */ var TRANSPARENT_PIXEL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC';
|
|
89
|
+
var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
90
|
+
var src = _param.src, poster = _param.poster, _autoPlay = _param.autoPlay, autoPlay = _autoPlay === void 0 ? true : _autoPlay, _muted = _param.muted, muted = _muted === void 0 ? true : _muted, _loop = _param.loop, loop = _loop === void 0 ? true : _loop, _preload = _param.preload, preload = _preload === void 0 ? 'none' : _preload, _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, props = _objectWithoutProperties(_param, [
|
|
91
|
+
"src",
|
|
92
|
+
"poster",
|
|
93
|
+
"autoPlay",
|
|
94
|
+
"muted",
|
|
95
|
+
"loop",
|
|
96
|
+
"preload",
|
|
97
|
+
"aspectRatio"
|
|
98
|
+
]);
|
|
99
|
+
var noBorderRadius = (0, _image).useDisableBorderRadius();
|
|
100
|
+
var classes = useStyles({
|
|
101
|
+
noBorderRadius: noBorderRadius,
|
|
102
|
+
aspectRatio: !props.width && !props.height ? RATIO[aspectRatio] : undefined
|
|
103
|
+
});
|
|
104
|
+
var videoRef = React.useRef(null);
|
|
105
|
+
React.useEffect(function() {
|
|
106
|
+
var video = videoRef.current;
|
|
107
|
+
if (video && autoPlay && video.paused) {
|
|
108
|
+
video.play();
|
|
109
|
+
}
|
|
110
|
+
}, [
|
|
111
|
+
autoPlay
|
|
112
|
+
]);
|
|
113
|
+
// normalize sources
|
|
114
|
+
var sources = (Array.isArray(src) ? src : [
|
|
115
|
+
src
|
|
116
|
+
]).map(function(source) {
|
|
117
|
+
if (typeof source === 'string') {
|
|
118
|
+
return {
|
|
119
|
+
src: source
|
|
120
|
+
};
|
|
121
|
+
} else {
|
|
122
|
+
return source;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
var width = props.width;
|
|
126
|
+
var height = props.height;
|
|
127
|
+
if (props.width !== undefined && props.height !== undefined) {
|
|
128
|
+
width = props.width;
|
|
129
|
+
height = props.height;
|
|
130
|
+
} else if (props.width !== undefined) {
|
|
131
|
+
height = props.width / RATIO[aspectRatio];
|
|
132
|
+
} else if (props.height !== undefined) {
|
|
133
|
+
width = props.height * RATIO[aspectRatio];
|
|
134
|
+
} else {
|
|
135
|
+
width = '100%';
|
|
136
|
+
}
|
|
137
|
+
return(/*#__PURE__*/ (0, _jsxRuntime).jsx("video", {
|
|
138
|
+
ref: (0, _common).combineRefs(ref, videoRef),
|
|
139
|
+
playsInline: true,
|
|
140
|
+
disablePictureInPicture: true,
|
|
141
|
+
disableRemotePlayback: true,
|
|
142
|
+
autoPlay: autoPlay,
|
|
143
|
+
muted: muted,
|
|
144
|
+
loop: loop,
|
|
145
|
+
width: width,
|
|
146
|
+
height: height,
|
|
147
|
+
className: classes.video,
|
|
148
|
+
preload: preload,
|
|
149
|
+
// This transparent pixel fallback avoids showing the ugly "play" image in android webviews
|
|
150
|
+
poster: poster || TRANSPARENT_PIXEL,
|
|
151
|
+
children: sources.map(function(param, index) {
|
|
152
|
+
var src = param.src, type = param.type;
|
|
153
|
+
/*#__PURE__*/ return (0, _jsxRuntime).jsx("source", {
|
|
154
|
+
src: src,
|
|
155
|
+
type: type
|
|
156
|
+
}, index);
|
|
157
|
+
})
|
|
158
|
+
}));
|
|
159
|
+
});
|
|
160
|
+
var _default = Video;
|
|
161
|
+
exports.default = _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export type AspectRatio = "1:1" | "16:9" | "12:5";
|
|
5
|
+
declare export var RATIO: {
|
|
6
|
+
"1:1": number,
|
|
7
|
+
"16:9": number,
|
|
8
|
+
"12:5": number,
|
|
9
|
+
};
|
|
10
|
+
declare type VideoSource = {
|
|
11
|
+
src: string,
|
|
12
|
+
type?: string,
|
|
13
|
+
};
|
|
14
|
+
export type VideoProps = {
|
|
15
|
+
/**
|
|
16
|
+
* defaults to 100% when no width and no height are given
|
|
17
|
+
*/
|
|
18
|
+
width?: number,
|
|
19
|
+
height?: number,
|
|
20
|
+
/**
|
|
21
|
+
* defaults to 1:1, if both width and height are given, aspectRatio is ignored
|
|
22
|
+
*/
|
|
23
|
+
aspectRatio?: AspectRatio,
|
|
24
|
+
/**
|
|
25
|
+
* accepts multiple sources
|
|
26
|
+
*/
|
|
27
|
+
src: string | Array<string> | VideoSource | Array<VideoSource>,
|
|
28
|
+
/**
|
|
29
|
+
* defaults to true
|
|
30
|
+
*/
|
|
31
|
+
loop?: boolean,
|
|
32
|
+
/**
|
|
33
|
+
* defaults to true
|
|
34
|
+
*/
|
|
35
|
+
muted?: boolean,
|
|
36
|
+
/**
|
|
37
|
+
* defaults to true
|
|
38
|
+
*/
|
|
39
|
+
autoPlay?: boolean,
|
|
40
|
+
poster?: string,
|
|
41
|
+
/**
|
|
42
|
+
* defaults to none
|
|
43
|
+
*/
|
|
44
|
+
preload?: "none" | "metadata" | "auto",
|
|
45
|
+
};
|
|
46
|
+
declare var Video: React.ComponentType<{
|
|
47
|
+
...VideoProps,
|
|
48
|
+
ref?: React.Ref<HTMLVideoElement>,
|
|
49
|
+
}>;
|
|
50
|
+
declare export default typeof Video;
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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'
|
package/dist-es/card.js
CHANGED
|
@@ -8,6 +8,7 @@ import { Text1, Text2, Text4 } from './text';
|
|
|
8
8
|
import { createUseStyles } from './jss';
|
|
9
9
|
import { Boxed } from './boxed';
|
|
10
10
|
import ButtonGroup from './button-group';
|
|
11
|
+
import { DisableBorderRadiusProvider } from './image';
|
|
11
12
|
var useCardContentStyles = createUseStyles(function() {
|
|
12
13
|
return {
|
|
13
14
|
actions: {
|
|
@@ -141,8 +142,10 @@ export var MediaCard = /*#__PURE__*/ React.forwardRef(function(param, ref) {
|
|
|
141
142
|
className: classes.mediaCard,
|
|
142
143
|
"aria-label": ariaLabel,
|
|
143
144
|
children: [
|
|
144
|
-
/*#__PURE__*/ _jsx("div", {
|
|
145
|
+
typeof media.src === 'string' ? /*#__PURE__*/ _jsx("div", {
|
|
145
146
|
className: classes.media
|
|
147
|
+
}) : /*#__PURE__*/ _jsx(DisableBorderRadiusProvider, {
|
|
148
|
+
children: media
|
|
146
149
|
}),
|
|
147
150
|
/*#__PURE__*/ _jsx("div", {
|
|
148
151
|
className: classes.content,
|
package/dist-es/checkbox.js
CHANGED
|
@@ -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,
|
|
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:
|
|
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
|
})
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useForm, useFieldProps } from './form-context';
|
|
4
4
|
import { useTheme } from './hooks';
|
|
5
|
-
import
|
|
5
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
6
6
|
function _arrayWithHoles(arr) {
|
|
7
7
|
if (Array.isArray(arr)) return arr;
|
|
8
8
|
}
|
|
@@ -192,7 +192,7 @@ var CreditCardExpirationField = function(_param) {
|
|
|
192
192
|
onChange: onChange,
|
|
193
193
|
onChangeValue: onChangeValue
|
|
194
194
|
});
|
|
195
|
-
return(/*#__PURE__*/ _jsx(
|
|
195
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
196
196
|
}, rest, fieldProps, {
|
|
197
197
|
onChange: function(event) {
|
|
198
198
|
fieldProps.onChange(event);
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useForm, useFieldProps } from './form-context';
|
|
4
4
|
import { useTheme } from './hooks';
|
|
5
5
|
import { getCreditCardNumberLength, isAmericanExpress, isVisa, isMasterCard, isValidCreditCardNumber } from './utils/credit-card';
|
|
6
|
-
import
|
|
6
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
7
7
|
import IconCreditcard from './icons/icon-creditcard';
|
|
8
8
|
import IconVisa from './icons/icon-visa';
|
|
9
9
|
import IconMastercard from './icons/icon-mastercard';
|
|
@@ -305,7 +305,7 @@ var CreditCardNumberField = function(_param) {
|
|
|
305
305
|
onChangeValue: onChangeValue
|
|
306
306
|
});
|
|
307
307
|
var ref2;
|
|
308
|
-
return(/*#__PURE__*/ _jsx(
|
|
308
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
309
309
|
}, rest, fieldProps, {
|
|
310
310
|
onChange: function(event) {
|
|
311
311
|
fieldProps.onChange(event);
|
package/dist-es/cvv-field.js
CHANGED
|
@@ -7,7 +7,7 @@ import Tooltip from './tooltip';
|
|
|
7
7
|
import IconButton from './icon-button';
|
|
8
8
|
import IcnInfo from './icons/icon-info-cvv';
|
|
9
9
|
import { useFieldProps, useForm } from './form-context';
|
|
10
|
-
import
|
|
10
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
11
11
|
import { IntegerInput } from './integer-field';
|
|
12
12
|
function _defineProperty(obj, key, value) {
|
|
13
13
|
if (key in obj) {
|
|
@@ -152,7 +152,7 @@ var CvvField = function(_param) {
|
|
|
152
152
|
onChange: onChange,
|
|
153
153
|
onChangeValue: onChangeValue
|
|
154
154
|
});
|
|
155
|
-
return(/*#__PURE__*/ _jsx(
|
|
155
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
156
156
|
}, rest, fieldProps, {
|
|
157
157
|
maxLength: maxLength,
|
|
158
158
|
onChange: function(event) {
|
package/dist-es/date-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
import { isInputTypeSupported } from './utils/dom';
|
|
6
6
|
import { isServerSide } from './utils/environment';
|
|
7
7
|
import IconCalendarRegular from './generated/mistica-icons/icon-calendar-regular';
|
|
@@ -118,7 +118,7 @@ var DateField = function(_param) {
|
|
|
118
118
|
onChange: onChange,
|
|
119
119
|
onChangeValue: onChangeValue
|
|
120
120
|
});
|
|
121
|
-
var nativePicker = /*#__PURE__*/ _jsx(
|
|
121
|
+
var nativePicker = /*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
122
122
|
}, rest, fieldProps, {
|
|
123
123
|
min: min ? getLocalDateString(min) : undefined,
|
|
124
124
|
max: max ? getLocalDateString(max) : undefined,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
import { isInputTypeSupported } from './utils/dom';
|
|
6
6
|
import { isServerSide } from './utils/environment';
|
|
7
7
|
import { getLocalDateTimeString } from './utils/time';
|
|
@@ -119,7 +119,7 @@ var FormDateField = function(_param) {
|
|
|
119
119
|
onChange: onChange,
|
|
120
120
|
onChangeValue: onChangeValue
|
|
121
121
|
});
|
|
122
|
-
var nativePicker = /*#__PURE__*/ _jsx(
|
|
122
|
+
var nativePicker = /*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
123
123
|
}, rest, fieldProps, {
|
|
124
124
|
min: min ? getLocalDateTimeString(min) : undefined,
|
|
125
125
|
max: max ? getLocalDateTimeString(max) : undefined,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
4
4
|
import IconCalendarRegular from './generated/mistica-icons/icon-calendar-regular';
|
|
5
5
|
import Datetime from 'react-datetime';
|
|
6
6
|
import Overlay from './overlay';
|
|
@@ -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: '
|
|
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: '
|
|
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: '
|
|
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],
|
|
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() {
|
|
@@ -361,7 +367,7 @@ var DateTimePicker = function(_param) {
|
|
|
361
367
|
};
|
|
362
368
|
return(/*#__PURE__*/ _jsxs(_Fragment, {
|
|
363
369
|
children: [
|
|
364
|
-
/*#__PURE__*/ _jsx(
|
|
370
|
+
/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
365
371
|
}, rest, {
|
|
366
372
|
style: {
|
|
367
373
|
cursor: 'default'
|
package/dist-es/decimal-field.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
4
|
import { useTheme } from './hooks';
|
|
5
|
-
import
|
|
5
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
6
6
|
import { createChangeEvent } from './utils/dom';
|
|
7
7
|
import { useRifm } from 'rifm';
|
|
8
8
|
import { combineRefs } from './utils/common';
|
|
@@ -191,7 +191,7 @@ var DecimalField = function(_param) {
|
|
|
191
191
|
onChange: onChange,
|
|
192
192
|
onChangeValue: onChangeValue
|
|
193
193
|
});
|
|
194
|
-
return(/*#__PURE__*/ _jsx(
|
|
194
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
195
195
|
}, rest, fieldProps, {
|
|
196
196
|
inputComponent: DecimalInput,
|
|
197
197
|
inputProps: {
|
package/dist-es/email-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useFieldProps } from './form-context';
|
|
3
3
|
import { useTheme } from './hooks';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
5
|
function _defineProperty(obj, key, value) {
|
|
6
6
|
if (key in obj) {
|
|
7
7
|
Object.defineProperty(obj, key, {
|
|
@@ -92,7 +92,7 @@ var EmailField = function(_param) {
|
|
|
92
92
|
onChange: onChange,
|
|
93
93
|
onChangeValue: onChangeValue
|
|
94
94
|
});
|
|
95
|
-
return(/*#__PURE__*/ _jsx(
|
|
95
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
96
96
|
}, rest, fieldProps, {
|
|
97
97
|
type: "email",
|
|
98
98
|
inputMode: "email",
|
package/dist-es/feedback.js
CHANGED
|
@@ -420,13 +420,12 @@ export var SuccessFeedbackScreen = function(props) {
|
|
|
420
420
|
};
|
|
421
421
|
var ErrorFeedbackScreen = function(_param) {
|
|
422
422
|
var children = _param.children, errorReference = _param.errorReference, otherProps = _objectWithoutProperties(_param, ["children", "errorReference"]);
|
|
423
|
-
var ref = useTheme(),
|
|
424
|
-
var hasIcon = skinName !== VIVO_SKIN;
|
|
423
|
+
var ref = useTheme(), colors = ref.colors;
|
|
425
424
|
return(/*#__PURE__*/ _jsxs(FeedbackScreen, _objectSpread({
|
|
426
425
|
}, otherProps, {
|
|
427
426
|
hapticFeedback: "error",
|
|
428
|
-
icon:
|
|
429
|
-
})
|
|
427
|
+
icon: /*#__PURE__*/ _jsx(IcnError, {
|
|
428
|
+
}),
|
|
430
429
|
animateText: true,
|
|
431
430
|
children: [
|
|
432
431
|
children,
|
|
@@ -440,12 +439,10 @@ var ErrorFeedbackScreen = function(_param) {
|
|
|
440
439
|
};
|
|
441
440
|
export { ErrorFeedbackScreen };
|
|
442
441
|
export var InfoFeedbackScreen = function(props) {
|
|
443
|
-
var ref = useTheme(), skinName = ref.skinName;
|
|
444
|
-
var hasIcon = skinName !== VIVO_SKIN;
|
|
445
442
|
return(/*#__PURE__*/ _jsx(FeedbackScreen, _objectSpread({
|
|
446
443
|
}, props, {
|
|
447
|
-
icon:
|
|
448
|
-
})
|
|
444
|
+
icon: /*#__PURE__*/ _jsx(IcnInfo, {
|
|
445
|
+
})
|
|
449
446
|
})));
|
|
450
447
|
};
|
|
451
448
|
export var SuccessFeedback = function(param) {
|