@telefonica/mistica 10.15.0 → 10.19.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 +36 -0
- package/dist/card.d.ts +10 -1
- package/dist/card.js +4 -1
- package/dist/card.js.flow +16 -1
- 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 +2 -2
- 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/icons/icon-success.js +14 -6
- package/dist/image.d.ts +25 -4
- package/dist/image.js +67 -9
- package/dist/image.js.flow +33 -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/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/search-field.js +2 -2
- package/dist/section-title.d.ts +1 -3
- package/dist/section-title.js.flow +1 -2
- package/dist/select.js +2 -2
- package/dist/text-field-base.d.ts +3 -2
- package/dist/text-field-base.js +12 -16
- package/dist/text-field-base.js.flow +6 -2
- 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/video.d.ts +32 -0
- package/dist/video.js +161 -0
- package/dist/video.js.flow +50 -0
- package/dist-es/card.js +4 -1
- 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 +2 -2
- 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/icons/icon-success.js +14 -6
- package/dist-es/image.js +41 -8
- package/dist-es/index.js +3 -1
- package/dist-es/integer-field.js +2 -2
- 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/search-field.js +2 -2
- package/dist-es/select.js +2 -2
- package/dist-es/text-field-base.js +12 -15
- package/dist-es/text-field.js +9 -12
- package/dist-es/video.js +123 -0
- package/package.json +1 -1
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/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,
|
|
@@ -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';
|
|
@@ -367,7 +367,7 @@ var DateTimePicker = function(_param) {
|
|
|
367
367
|
};
|
|
368
368
|
return(/*#__PURE__*/ _jsxs(_Fragment, {
|
|
369
369
|
children: [
|
|
370
|
-
/*#__PURE__*/ _jsx(
|
|
370
|
+
/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
371
371
|
}, rest, {
|
|
372
372
|
style: {
|
|
373
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) {
|
package/dist-es/iban-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 { useRifm } from 'rifm';
|
|
4
4
|
import { useFieldProps } from './form-context';
|
|
5
|
-
import
|
|
5
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
6
6
|
import { createChangeEvent } from './utils/dom';
|
|
7
7
|
import { combineRefs } from './utils/common';
|
|
8
8
|
import { useTheme } from './hooks';
|
|
@@ -246,7 +246,7 @@ var IbanField = function(_param) {
|
|
|
246
246
|
onChange: onChange,
|
|
247
247
|
onChangeValue: onChangeValue
|
|
248
248
|
});
|
|
249
|
-
return(/*#__PURE__*/ _jsx(
|
|
249
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
250
250
|
}, rest, fieldProps, {
|
|
251
251
|
inputComponent: IbanInput
|
|
252
252
|
})));
|
|
@@ -59,21 +59,29 @@ var IconSuccessO2 = function(param) {
|
|
|
59
59
|
children: /*#__PURE__*/ _jsxs("g", {
|
|
60
60
|
className: classnames(_defineProperty({
|
|
61
61
|
}, classes.iconContainer, !color)),
|
|
62
|
-
strokeWidth: "2",
|
|
63
62
|
strokeLinecap: "round",
|
|
64
63
|
strokeLinejoin: "round",
|
|
65
64
|
children: [
|
|
66
65
|
/*#__PURE__*/ _jsx("path", _objectSpread({
|
|
67
66
|
fill: "none",
|
|
67
|
+
strokeWidth: "2",
|
|
68
68
|
stroke: color ? color : undefined,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}, !skipAnimation && mergeProperties(getAnimateDrawLineProps('33', '0.9s', platformOverrides), getAnimateHopInProps('0.9s', platformOverrides)))),
|
|
69
|
+
d: "M45.64 53.84A25.599 25.599 0 0 1 32 57.75C17.78 57.75 6.25 46.22 6.25 32S17.78 6.25 32 6.25 57.75 17.78 57.75 32c0 5.13-1.5 9.92-4.09 13.93"
|
|
70
|
+
}, !skipAnimation && getAnimateDrawLineProps('202', '0.3s', platformOverrides))),
|
|
72
71
|
/*#__PURE__*/ _jsx("path", _objectSpread({
|
|
73
72
|
fill: "none",
|
|
73
|
+
strokeWidth: "2",
|
|
74
|
+
stroke: color ? color : undefined,
|
|
75
|
+
d: "m19.33 30.39 9.88 10.95 18.13-19.23"
|
|
76
|
+
}, !skipAnimation && mergeProperties(getAnimateDrawLineProps('44', '0.6s', platformOverrides), getAnimateHopInProps('0.6', platformOverrides)))),
|
|
77
|
+
/*#__PURE__*/ _jsx("circle", _objectSpread({
|
|
78
|
+
fill: "none",
|
|
79
|
+
strokeWidth: "2",
|
|
74
80
|
stroke: color ? color : undefined,
|
|
75
|
-
|
|
76
|
-
|
|
81
|
+
cx: "50.18",
|
|
82
|
+
cy: "50.1",
|
|
83
|
+
r: ".89"
|
|
84
|
+
}, !skipAnimation && getAnimateDrawLineProps('180', '0.2s', platformOverrides)))
|
|
77
85
|
]
|
|
78
86
|
})
|
|
79
87
|
}));
|
package/dist-es/image.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { createUseStyles } from './jss';
|
|
3
4
|
function _objectWithoutProperties(source, excluded) {
|
|
4
5
|
if (source == null) return {
|
|
@@ -30,38 +31,70 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
30
31
|
}
|
|
31
32
|
return target;
|
|
32
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* This context is used internally to disable the border radius. This is useful for example
|
|
36
|
+
* when using the Image component inside a Card
|
|
37
|
+
*/ var DisableBorderRadiusContext = /*#__PURE__*/ React.createContext(false);
|
|
38
|
+
export var useDisableBorderRadius = function() {
|
|
39
|
+
return React.useContext(DisableBorderRadiusContext);
|
|
40
|
+
};
|
|
41
|
+
export var DisableBorderRadiusProvider = function(param) {
|
|
42
|
+
var children = param.children;
|
|
43
|
+
/*#__PURE__*/ return _jsx(DisableBorderRadiusContext.Provider, {
|
|
44
|
+
value: true,
|
|
45
|
+
children: children
|
|
46
|
+
});
|
|
47
|
+
};
|
|
33
48
|
var useStyles = createUseStyles(function() {
|
|
34
49
|
return {
|
|
35
50
|
image: {
|
|
36
|
-
borderRadius:
|
|
51
|
+
borderRadius: function(param) {
|
|
52
|
+
var noBorderRadius = param.noBorderRadius;
|
|
53
|
+
return noBorderRadius ? 0 : 4;
|
|
54
|
+
},
|
|
37
55
|
display: 'block',
|
|
38
56
|
objectFit: 'cover',
|
|
39
57
|
maxWidth: '100%',
|
|
40
|
-
maxHeight: '100%'
|
|
58
|
+
maxHeight: '100%',
|
|
59
|
+
aspectRatio: function(param) {
|
|
60
|
+
var aspectRatio = param.aspectRatio;
|
|
61
|
+
return aspectRatio !== null && aspectRatio !== void 0 ? aspectRatio : 'unset';
|
|
62
|
+
}
|
|
41
63
|
}
|
|
42
64
|
};
|
|
43
65
|
});
|
|
44
|
-
var RATIO = {
|
|
66
|
+
export var RATIO = {
|
|
45
67
|
'1:1': 1,
|
|
46
68
|
'16:9': 16 / 9,
|
|
47
69
|
'7:10': 7 / 10
|
|
48
70
|
};
|
|
49
|
-
var Image = function(_param) {
|
|
50
|
-
var
|
|
51
|
-
var
|
|
71
|
+
var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
72
|
+
var _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, _alt = _param.alt, alt = _alt === void 0 ? '' : _alt, props = _objectWithoutProperties(_param, ["aspectRatio", "alt"]);
|
|
73
|
+
var noBorderRadius = useDisableBorderRadius();
|
|
74
|
+
var classes = useStyles({
|
|
75
|
+
noBorderRadius: noBorderRadius,
|
|
76
|
+
aspectRatio: !props.width && !props.height ? RATIO[aspectRatio] : undefined
|
|
77
|
+
});
|
|
78
|
+
var url = props.src || props.url;
|
|
52
79
|
var width = props.width;
|
|
53
80
|
var height = props.height;
|
|
54
|
-
if (props.width !== undefined) {
|
|
81
|
+
if (props.width !== undefined && props.height !== undefined) {
|
|
82
|
+
width = props.width;
|
|
83
|
+
height = props.height;
|
|
84
|
+
} else if (props.width !== undefined) {
|
|
55
85
|
height = props.width / RATIO[aspectRatio];
|
|
56
86
|
} else if (props.height !== undefined) {
|
|
57
87
|
width = props.height * RATIO[aspectRatio];
|
|
88
|
+
} else {
|
|
89
|
+
width = '100%';
|
|
58
90
|
}
|
|
59
91
|
return(/*#__PURE__*/ _jsx("img", {
|
|
92
|
+
ref: ref,
|
|
60
93
|
src: url,
|
|
61
94
|
className: classes.image,
|
|
62
95
|
alt: alt,
|
|
63
96
|
width: width,
|
|
64
97
|
height: height
|
|
65
98
|
}));
|
|
66
|
-
};
|
|
99
|
+
});
|
|
67
100
|
export default Image;
|
package/dist-es/index.js
CHANGED
|
@@ -56,10 +56,12 @@ export { default as Callout } from './callout';
|
|
|
56
56
|
export { useModalState } from './modal-context-provider';
|
|
57
57
|
export { NavigationBar, MainNavigationBar, FunnelNavigationBar, NavigationBarActionGroup, NavigationBarAction, NavigationBarLogo } from './navigation-bar';
|
|
58
58
|
export { default as Image } from './image';
|
|
59
|
+
export { default as Video } from './video';
|
|
59
60
|
// Forms
|
|
60
61
|
export { default as Form } from './form';
|
|
61
62
|
export { default as Select } from './select';
|
|
62
63
|
export { default as TextField } from './text-field';
|
|
64
|
+
export { TextFieldBase } from './text-field-base';
|
|
63
65
|
export { default as SearchField } from './search-field';
|
|
64
66
|
export { default as EmailField } from './email-field';
|
|
65
67
|
export { default as PhoneNumberField } from './phone-number-field';
|
|
@@ -75,7 +77,7 @@ export { default as DecimalField } from './decimal-field';
|
|
|
75
77
|
export { default as PasswordField } from './password-field';
|
|
76
78
|
export { default as DoubleField } from './double-field';
|
|
77
79
|
export { default as IbanField } from './iban-field';
|
|
78
|
-
export { useForm } from './form-context';
|
|
80
|
+
export { useForm, useFieldProps } from './form-context';
|
|
79
81
|
// Icons
|
|
80
82
|
// @deprecated use IconCloseRegular instead
|
|
81
83
|
export { default as IconClose } from './icons/icon-close';
|
package/dist-es/integer-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, {
|
|
@@ -110,7 +110,7 @@ var IntegerField = function(_param) {
|
|
|
110
110
|
onChange: onChange,
|
|
111
111
|
onChangeValue: onChangeValue
|
|
112
112
|
});
|
|
113
|
-
return(/*#__PURE__*/ _jsx(
|
|
113
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
114
114
|
}, rest, fieldProps, {
|
|
115
115
|
inputComponent: IntegerInput
|
|
116
116
|
})));
|