@telefonica/mistica 10.16.0 → 10.20.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/button.js +24 -8
- package/dist/card.d.ts +10 -1
- package/dist/card.js +29 -29
- 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/header.d.ts +2 -0
- package/dist/header.js.flow +5 -0
- 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 -0
- package/dist/index.js +14 -0
- package/dist/index.js.flow +3 -0
- package/dist/integer-field.js +2 -7
- package/dist/menu.js +34 -27
- 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/skins/blau.d.ts +6 -3
- package/dist/skins/blau.js +34 -5
- package/dist/skins/blau.js.flow +6 -3
- package/dist/skins/movistar.d.ts +21 -11
- package/dist/skins/movistar.js +76 -40
- package/dist/skins/movistar.js.flow +21 -11
- package/dist/skins/o2-classic.d.ts +21 -9
- package/dist/skins/o2-classic.js +64 -26
- package/dist/skins/o2-classic.js.flow +21 -9
- package/dist/skins/o2.d.ts +19 -17
- package/dist/skins/o2.js +68 -40
- package/dist/skins/o2.js.flow +19 -17
- package/dist/skins/telefonica.d.ts +18 -13
- package/dist/skins/telefonica.js +76 -45
- package/dist/skins/telefonica.js.flow +18 -13
- package/dist/skins/types.d.ts +12 -0
- package/dist/skins/types.js.flow +12 -0
- package/dist/skins/vivo.d.ts +9 -4
- package/dist/skins/vivo.js +37 -6
- package/dist/skins/vivo.js.flow +9 -4
- package/dist/tag.d.ts +6 -1
- package/dist/tag.js +133 -24
- package/dist/tag.js.flow +15 -1
- package/dist/text-field-base.d.ts +3 -2
- package/dist/text-field-base.js +8 -8
- package/dist/text-field-base.js.flow +6 -2
- package/dist/text-field.js +2 -7
- package/dist/text.d.ts +4 -0
- package/dist/text.js +13 -6
- package/dist/text.js.flow +10 -0
- 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 +24 -8
- package/dist-es/card.js +30 -30
- 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 +2 -0
- 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/skins/blau.js +36 -5
- package/dist-es/skins/movistar.js +78 -40
- package/dist-es/skins/o2-classic.js +66 -26
- package/dist-es/skins/o2.js +70 -40
- package/dist-es/skins/telefonica.js +78 -45
- package/dist-es/skins/vivo.js +39 -6
- package/dist-es/tag.js +130 -26
- package/dist-es/text-field-base.js +7 -6
- package/dist-es/text-field.js +2 -2
- package/dist-es/text.js +13 -6
- package/dist-es/video.js +123 -0
- package/package.json +1 -1
package/dist-es/skins/vivo.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { applyAlpha } from '../utils/color';
|
|
2
2
|
import { VIVO_SKIN } from './constants';
|
|
3
|
+
// https://github.com/Telefonica/mistica-design/blob/production/tokens/vivo-constants.json
|
|
4
|
+
// https://github.com/Telefonica/mistica-design/blob/production/tokens/vivo-skin-schema.json
|
|
3
5
|
export var palette = {
|
|
4
6
|
vivoPurple: '#660099',
|
|
5
7
|
vivoPurpleDark: '#461E5F',
|
|
@@ -9,16 +11,21 @@ export var palette = {
|
|
|
9
11
|
vivoPurpleLight20: '#E0CCEB',
|
|
10
12
|
vivoPurpleLight10: '#EFE5F4',
|
|
11
13
|
vivoGreen: '#99CC33',
|
|
12
|
-
vivoGreenDark: '#
|
|
13
|
-
|
|
14
|
+
vivoGreenDark: '#225C3D',
|
|
15
|
+
vivoGreenLight30: '#91AE9E',
|
|
16
|
+
vivoGreenLight10: '#EDF8E8',
|
|
14
17
|
vivoBlue: '#00ABDB',
|
|
15
18
|
orange: '#FF9900',
|
|
16
|
-
orangeDark: '#
|
|
17
|
-
|
|
19
|
+
orangeDark: '#972A1D',
|
|
20
|
+
orangeLight10: '#FFEFE1',
|
|
21
|
+
orangeLight40: '#FFB84C',
|
|
18
22
|
pink: '#EB3D7D',
|
|
19
23
|
pepper: '#CC1F59',
|
|
20
24
|
pepperDark: '#B71D63',
|
|
25
|
+
pepperDark80: '#8F2052',
|
|
26
|
+
pepperLight40: '#DB628B',
|
|
21
27
|
pepperLight30: '#F7B1CB',
|
|
28
|
+
pepperLight10: '#FCE4EF',
|
|
22
29
|
grey1: '#F6F6F6',
|
|
23
30
|
grey2: '#EEEEEE',
|
|
24
31
|
grey3: '#DDDDDD',
|
|
@@ -121,7 +128,20 @@ export var getVivoSkin = function() {
|
|
|
121
128
|
textNavigationSearchBarHint: palette.vivoPurpleLight50,
|
|
122
129
|
textNavigationSearchBarText: palette.white,
|
|
123
130
|
textAppBar: palette.grey4,
|
|
124
|
-
textAppBarSelected: palette.vivoPurple
|
|
131
|
+
textAppBarSelected: palette.vivoPurple,
|
|
132
|
+
// TAGS
|
|
133
|
+
tagBackgroundSuccess: palette.vivoGreenLight10,
|
|
134
|
+
tagBackgroundWarning: palette.orangeLight10,
|
|
135
|
+
tagBackgroundError: palette.pepperLight10,
|
|
136
|
+
tagBackgroundPromo: palette.vivoPurpleLight10,
|
|
137
|
+
tagBackgroundActive: palette.vivoPurpleLight10,
|
|
138
|
+
tagBackgroundInactive: palette.grey1,
|
|
139
|
+
textTagSuccess: palette.vivoGreenDark,
|
|
140
|
+
textTagWarning: palette.orangeDark,
|
|
141
|
+
textTagError: palette.pepperDark80,
|
|
142
|
+
textTagPromo: palette.vivoPurple,
|
|
143
|
+
textTagActive: palette.vivoPurple,
|
|
144
|
+
textTagInactive: palette.grey5
|
|
125
145
|
},
|
|
126
146
|
darkModeColors: {
|
|
127
147
|
appBarBackground: palette.darkModeGrey,
|
|
@@ -189,7 +209,20 @@ export var getVivoSkin = function() {
|
|
|
189
209
|
textNavigationSearchBarHint: palette.grey4,
|
|
190
210
|
textNavigationSearchBarText: palette.grey2,
|
|
191
211
|
textAppBar: palette.grey5,
|
|
192
|
-
textAppBarSelected: palette.grey2
|
|
212
|
+
textAppBarSelected: palette.grey2,
|
|
213
|
+
// TAGS
|
|
214
|
+
tagBackgroundSuccess: applyAlpha(palette.white, 0.05),
|
|
215
|
+
tagBackgroundWarning: applyAlpha(palette.white, 0.05),
|
|
216
|
+
tagBackgroundError: applyAlpha(palette.white, 0.05),
|
|
217
|
+
tagBackgroundPromo: applyAlpha(palette.white, 0.05),
|
|
218
|
+
tagBackgroundActive: applyAlpha(palette.white, 0.05),
|
|
219
|
+
tagBackgroundInactive: applyAlpha(palette.white, 0.05),
|
|
220
|
+
textTagSuccess: palette.vivoGreenLight30,
|
|
221
|
+
textTagWarning: palette.orangeLight40,
|
|
222
|
+
textTagError: palette.pepperLight40,
|
|
223
|
+
textTagPromo: palette.vivoPurpleLight50,
|
|
224
|
+
textTagActive: palette.vivoPurpleLight50,
|
|
225
|
+
textTagInactive: palette.grey4
|
|
193
226
|
}
|
|
194
227
|
};
|
|
195
228
|
};
|
package/dist-es/tag.js
CHANGED
|
@@ -1,46 +1,150 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Box from './box';
|
|
2
3
|
import { useTheme } from './hooks';
|
|
3
4
|
import { createUseStyles } from './jss';
|
|
4
5
|
import { Text } from './text';
|
|
5
|
-
import { ThemeVariant } from './theme-variant-context';
|
|
6
|
+
import { ThemeVariant, useIsInverseVariant } from './theme-variant-context';
|
|
7
|
+
import { pxToRem } from './utils/css';
|
|
8
|
+
function _arrayWithHoles(arr) {
|
|
9
|
+
if (Array.isArray(arr)) return arr;
|
|
10
|
+
}
|
|
11
|
+
function _iterableToArrayLimit(arr, i) {
|
|
12
|
+
var _arr = [];
|
|
13
|
+
var _n = true;
|
|
14
|
+
var _d = false;
|
|
15
|
+
var _e = undefined;
|
|
16
|
+
try {
|
|
17
|
+
for(var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true){
|
|
18
|
+
_arr.push(_s.value);
|
|
19
|
+
if (i && _arr.length === i) break;
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
22
|
+
_d = true;
|
|
23
|
+
_e = err;
|
|
24
|
+
} finally{
|
|
25
|
+
try {
|
|
26
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
27
|
+
} finally{
|
|
28
|
+
if (_d) throw _e;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return _arr;
|
|
32
|
+
}
|
|
33
|
+
function _nonIterableRest() {
|
|
34
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
35
|
+
}
|
|
36
|
+
function _slicedToArray(arr, i) {
|
|
37
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
|
38
|
+
}
|
|
6
39
|
var useStyles = createUseStyles(function() {
|
|
7
40
|
return {
|
|
8
41
|
tag: {
|
|
9
|
-
backgroundColor: function(param) {
|
|
10
|
-
var color = param.color;
|
|
11
|
-
return color;
|
|
12
|
-
},
|
|
13
|
-
padding: '2px 8px',
|
|
14
|
-
borderRadius: 2,
|
|
15
|
-
minWidth: 48,
|
|
16
42
|
display: 'inline-flex',
|
|
43
|
+
flexDirection: 'row',
|
|
17
44
|
alignItems: 'center',
|
|
18
|
-
|
|
45
|
+
borderRadius: 50,
|
|
46
|
+
justifyContent: 'center',
|
|
47
|
+
minWidth: 56,
|
|
48
|
+
padding: function(param) {
|
|
49
|
+
var hasIcon = param.hasIcon;
|
|
50
|
+
return "4px 12px 4px ".concat(hasIcon ? 8 : 12, "px");
|
|
51
|
+
},
|
|
52
|
+
// FIXME: remove this style and use an inline style for the icon once WEB-338 gets merged
|
|
53
|
+
'& svg': {
|
|
54
|
+
display: 'block'
|
|
55
|
+
}
|
|
19
56
|
}
|
|
20
57
|
};
|
|
21
58
|
});
|
|
22
59
|
var Tag = function(param) {
|
|
23
|
-
var children = param.children, color = param.color;
|
|
60
|
+
var Icon = param.Icon, children = param.children, _type = param.type, type = _type === void 0 ? 'promo' : _type, color = param.color;
|
|
24
61
|
var classes = useStyles({
|
|
25
|
-
|
|
62
|
+
hasIcon: !!Icon
|
|
26
63
|
});
|
|
27
64
|
var ref = useTheme(), colors = ref.colors, isDarkMode = ref.isDarkMode;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
65
|
+
var isInverse = useIsInverseVariant();
|
|
66
|
+
if (!children) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Legacy implementation
|
|
71
|
+
*
|
|
72
|
+
* @deprecated to be removed in the next major version
|
|
73
|
+
*/ if (color) {
|
|
74
|
+
// Hardcode black text in darkmode because there isn't a black text color constant that we can use in dark mode
|
|
75
|
+
var blackText = isDarkMode ? '#313235' : colors.textPrimary;
|
|
76
|
+
var textColor = color === colors.inverse ? blackText : colors.textPrimaryInverse;
|
|
77
|
+
return(/*#__PURE__*/ _jsx(ThemeVariant, {
|
|
34
78
|
isInverse: false,
|
|
35
|
-
children: /*#__PURE__*/ _jsx(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
79
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
80
|
+
className: classes.tag,
|
|
81
|
+
style: {
|
|
82
|
+
background: color
|
|
83
|
+
},
|
|
84
|
+
children: /*#__PURE__*/ _jsx(Text, {
|
|
85
|
+
color: textColor,
|
|
86
|
+
size: 14,
|
|
87
|
+
lineHeight: 20,
|
|
88
|
+
weight: "medium",
|
|
89
|
+
truncate: true,
|
|
90
|
+
children: children
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
var tagTypeToColors = {
|
|
96
|
+
promo: [
|
|
97
|
+
colors.textTagPromo,
|
|
98
|
+
colors.tagBackgroundPromo
|
|
99
|
+
],
|
|
100
|
+
active: [
|
|
101
|
+
colors.textTagActive,
|
|
102
|
+
colors.tagBackgroundActive
|
|
103
|
+
],
|
|
104
|
+
inactive: [
|
|
105
|
+
colors.textTagInactive,
|
|
106
|
+
colors.tagBackgroundInactive
|
|
107
|
+
],
|
|
108
|
+
success: [
|
|
109
|
+
colors.textTagSuccess,
|
|
110
|
+
colors.tagBackgroundSuccess
|
|
111
|
+
],
|
|
112
|
+
warning: [
|
|
113
|
+
colors.textTagWarning,
|
|
114
|
+
colors.tagBackgroundWarning
|
|
115
|
+
],
|
|
116
|
+
error: [
|
|
117
|
+
colors.textTagError,
|
|
118
|
+
colors.tagBackgroundError
|
|
119
|
+
]
|
|
120
|
+
};
|
|
121
|
+
var _type1 = _slicedToArray(tagTypeToColors[type], 2), textColor = _type1[0], backgroundColor = _type1[1];
|
|
122
|
+
var shouldUseInverseBackground = isInverse && !isDarkMode;
|
|
123
|
+
return(/*#__PURE__*/ _jsxs("span", {
|
|
124
|
+
className: classes.tag,
|
|
125
|
+
style: {
|
|
126
|
+
background: shouldUseInverseBackground ? colors.inverse : backgroundColor
|
|
127
|
+
},
|
|
128
|
+
children: [
|
|
129
|
+
Icon && /*#__PURE__*/ _jsx(Box, {
|
|
130
|
+
paddingRight: 4,
|
|
131
|
+
children: /*#__PURE__*/ _jsx(Icon, {
|
|
132
|
+
color: textColor,
|
|
133
|
+
size: pxToRem(16)
|
|
134
|
+
})
|
|
135
|
+
}),
|
|
136
|
+
/*#__PURE__*/ _jsx(ThemeVariant, {
|
|
137
|
+
isInverse: false,
|
|
138
|
+
children: /*#__PURE__*/ _jsx(Text, {
|
|
139
|
+
color: textColor,
|
|
140
|
+
size: 14,
|
|
141
|
+
lineHeight: 20,
|
|
142
|
+
weight: "medium",
|
|
143
|
+
truncate: true,
|
|
144
|
+
children: children
|
|
145
|
+
})
|
|
42
146
|
})
|
|
43
|
-
|
|
147
|
+
]
|
|
44
148
|
}));
|
|
45
149
|
};
|
|
46
150
|
export default Tag;
|
|
@@ -281,7 +281,7 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
281
281
|
}), _defineProperty(_obj2, "transition", 'opacity 150ms cubic-bezier(0.0, 0, 0.2, 1) 0ms'), _obj2)
|
|
282
282
|
};
|
|
283
283
|
});
|
|
284
|
-
var
|
|
284
|
+
var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
285
285
|
var error = _param.error, helperText = _param.helperText, label = _param.label, inputProps = _param.inputProps, inputRef = _param.inputRef, defaultValue = _param.defaultValue, value = _param.value, onFocus = _param.onFocus, onBlur = _param.onBlur, inputComponent = _param.inputComponent, prefix = _param.prefix, startIcon = _param.startIcon, endIcon = _param.endIcon, endIconOverlay = _param.endIconOverlay, shrinkLabelProp = _param.shrinkLabel, _multiline = _param.multiline, multiline = _multiline === void 0 ? false : _multiline, focus = _param.focus, fieldRef = _param.fieldRef, maxLength = _param.maxLength, idProp = _param.id, autoCompleteProp = _param.autoComplete, fullWidth = _param.fullWidth, rest = _objectWithoutProperties(_param, ["error", "helperText", "label", "inputProps", "inputRef", "defaultValue", "value", "onFocus", "onBlur", "inputComponent", "prefix", "startIcon", "endIcon", "endIconOverlay", "shrinkLabel", "multiline", "focus", "fieldRef", "maxLength", "id",
|
|
286
286
|
"autoComplete", "fullWidth"]);
|
|
287
287
|
var id = useAriaId(idProp);
|
|
@@ -433,6 +433,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
433
433
|
]
|
|
434
434
|
}));
|
|
435
435
|
});
|
|
436
|
+
export { TextFieldBase };
|
|
436
437
|
var useSuggestionsStyles = createUseStyles(function() {
|
|
437
438
|
return {
|
|
438
439
|
menuItem: {
|
|
@@ -465,7 +466,7 @@ var useSuggestionsStyles = createUseStyles(function() {
|
|
|
465
466
|
var Autosuggest = /*#__PURE__*/ React.lazy(function() {
|
|
466
467
|
return import(/* webpackChunkName: "react-autosuggest" */ 'react-autosuggest');
|
|
467
468
|
});
|
|
468
|
-
var
|
|
469
|
+
var TextFieldBaseAutosuggest = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
469
470
|
var getSuggestions = _param.getSuggestions, idProp = _param.id, props = _objectWithoutProperties(_param, ["getSuggestions", "id"
|
|
470
471
|
]);
|
|
471
472
|
var ref1 = _slicedToArray(React.useState([]), 2), suggestions = ref1[0], setSuggestions = ref1[1];
|
|
@@ -478,7 +479,7 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
478
479
|
throw Error('Fields with suggestions must be used in controlled mode');
|
|
479
480
|
}
|
|
480
481
|
return getSuggestions ? /*#__PURE__*/ _jsx(React.Suspense, {
|
|
481
|
-
fallback: /*#__PURE__*/ _jsx(
|
|
482
|
+
fallback: /*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
|
|
482
483
|
}, props, {
|
|
483
484
|
// This label override while loading is needed in acceptance tests because
|
|
484
485
|
// while the test is typing, the component could be remounted.
|
|
@@ -511,7 +512,7 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
511
512
|
}
|
|
512
513
|
}),
|
|
513
514
|
renderInputComponent: function(inputProps) {
|
|
514
|
-
/*#__PURE__*/ return _jsx(
|
|
515
|
+
/*#__PURE__*/ return _jsx(TextFieldBase, _objectSpread({
|
|
515
516
|
}, inputProps, {
|
|
516
517
|
inputRef: combineRefs(inputRef, props.inputRef, ref)
|
|
517
518
|
}));
|
|
@@ -551,10 +552,10 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
551
552
|
}));
|
|
552
553
|
}
|
|
553
554
|
})
|
|
554
|
-
}) : /*#__PURE__*/ _jsx(
|
|
555
|
+
}) : /*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
|
|
555
556
|
}, props, {
|
|
556
557
|
id: id,
|
|
557
558
|
ref: ref
|
|
558
559
|
}));
|
|
559
560
|
});
|
|
560
|
-
export
|
|
561
|
+
export { TextFieldBaseAutosuggest };
|
package/dist-es/text-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 { combineRefs } from './utils/common';
|
|
6
6
|
function _defineProperty(obj, key, value) {
|
|
7
7
|
if (key in obj) {
|
|
@@ -105,7 +105,7 @@ var TextField = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
105
105
|
onChange: onChange,
|
|
106
106
|
onChangeValue: onChangeValue
|
|
107
107
|
});
|
|
108
|
-
return(/*#__PURE__*/ _jsx(
|
|
108
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
109
109
|
}, rest, fieldProps, {
|
|
110
110
|
onClick: onPress,
|
|
111
111
|
inputRef: combineRefs(inputRef, fieldProps.inputRef, ref),
|
package/dist-es/text.js
CHANGED
|
@@ -52,7 +52,7 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
52
52
|
}
|
|
53
53
|
return 'initial';
|
|
54
54
|
};
|
|
55
|
-
var _color,
|
|
55
|
+
var _color, _decoration;
|
|
56
56
|
return {
|
|
57
57
|
text: _defineProperty({
|
|
58
58
|
lineHeight: function(param) {
|
|
@@ -60,8 +60,14 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
60
60
|
return pxToRem(desktopLineHeight);
|
|
61
61
|
},
|
|
62
62
|
textTransform: function(param) {
|
|
63
|
-
var uppercase = param.uppercase;
|
|
64
|
-
|
|
63
|
+
var uppercase = param.uppercase, transform = param.transform;
|
|
64
|
+
if (uppercase) {
|
|
65
|
+
return 'uppercase';
|
|
66
|
+
}
|
|
67
|
+
if (transform) {
|
|
68
|
+
return transform;
|
|
69
|
+
}
|
|
70
|
+
return 'inherit';
|
|
65
71
|
},
|
|
66
72
|
fontSize: function(param) {
|
|
67
73
|
var desktopSize = param.desktopSize;
|
|
@@ -76,7 +82,7 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
76
82
|
return isInverse ? (_color = inverseColorsMap[color]) !== null && _color !== void 0 ? _color : color : color;
|
|
77
83
|
},
|
|
78
84
|
textDecoration: function(p) {
|
|
79
|
-
return (
|
|
85
|
+
return (_decoration = p.decoration) !== null && _decoration !== void 0 ? _decoration : 'inherit';
|
|
80
86
|
},
|
|
81
87
|
letterSpacing: function(param) {
|
|
82
88
|
var letterSpacing = param.letterSpacing;
|
|
@@ -112,7 +118,7 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
112
118
|
};
|
|
113
119
|
});
|
|
114
120
|
export var Text = function(param) {
|
|
115
|
-
var weight = param.weight, color = param.color, textDecoration = param.textDecoration, truncate = param.truncate, uppercase = param.uppercase, wordBreak = param.wordBreak, _as = param.as, as = _as === void 0 ? 'span' : _as, children = param.children, size = param.size, _mobileSize = param.mobileSize, mobileSize = _mobileSize === void 0 ? size : _mobileSize, _desktopSize = param.desktopSize, desktopSize = _desktopSize === void 0 ? size : _desktopSize, lineHeight = param.lineHeight, _mobileLineHeight = param.mobileLineHeight, mobileLineHeight = _mobileLineHeight === void 0 ? lineHeight : _mobileLineHeight, _desktopLineHeight = param.desktopLineHeight, desktopLineHeight = _desktopLineHeight === void 0 ? lineHeight : _desktopLineHeight, letterSpacing = param.letterSpacing, id = param.id, role = param.role, ariaLevel = param['aria-level'];
|
|
121
|
+
var weight = param.weight, color = param.color, textDecoration = param.textDecoration, _decoration = param.decoration, decoration = _decoration === void 0 ? textDecoration : _decoration, truncate = param.truncate, uppercase = param.uppercase, transform = param.transform, wordBreak = param.wordBreak, _as = param.as, as = _as === void 0 ? 'span' : _as, children = param.children, size = param.size, _mobileSize = param.mobileSize, mobileSize = _mobileSize === void 0 ? size : _mobileSize, _desktopSize = param.desktopSize, desktopSize = _desktopSize === void 0 ? size : _desktopSize, lineHeight = param.lineHeight, _mobileLineHeight = param.mobileLineHeight, mobileLineHeight = _mobileLineHeight === void 0 ? lineHeight : _mobileLineHeight, _desktopLineHeight = param.desktopLineHeight, desktopLineHeight = _desktopLineHeight === void 0 ? lineHeight : _desktopLineHeight, letterSpacing = param.letterSpacing, id = param.id, role = param.role, ariaLevel = param['aria-level'];
|
|
116
122
|
var isInverse = useIsInverseVariant();
|
|
117
123
|
var classes = useStyles({
|
|
118
124
|
isInverse: isInverse,
|
|
@@ -122,8 +128,9 @@ export var Text = function(param) {
|
|
|
122
128
|
desktopLineHeight: desktopLineHeight,
|
|
123
129
|
weight: weight,
|
|
124
130
|
color: color,
|
|
125
|
-
|
|
131
|
+
decoration: decoration,
|
|
126
132
|
uppercase: uppercase,
|
|
133
|
+
transform: transform,
|
|
127
134
|
wordBreak: wordBreak,
|
|
128
135
|
letterSpacing: letterSpacing,
|
|
129
136
|
truncate: truncate
|
package/dist-es/video.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useDisableBorderRadius } from './image';
|
|
4
|
+
import { createUseStyles } from './jss';
|
|
5
|
+
import { combineRefs } from './utils/common';
|
|
6
|
+
function _objectWithoutProperties(source, excluded) {
|
|
7
|
+
if (source == null) return {
|
|
8
|
+
};
|
|
9
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
10
|
+
var key, i;
|
|
11
|
+
if (Object.getOwnPropertySymbols) {
|
|
12
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
13
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
14
|
+
key = sourceSymbolKeys[i];
|
|
15
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
16
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
17
|
+
target[key] = source[key];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return target;
|
|
21
|
+
}
|
|
22
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
23
|
+
if (source == null) return {
|
|
24
|
+
};
|
|
25
|
+
var target = {
|
|
26
|
+
};
|
|
27
|
+
var sourceKeys = Object.keys(source);
|
|
28
|
+
var key, i;
|
|
29
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
30
|
+
key = sourceKeys[i];
|
|
31
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
32
|
+
target[key] = source[key];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
}
|
|
36
|
+
export var RATIO = {
|
|
37
|
+
'1:1': 1,
|
|
38
|
+
'16:9': 16 / 9,
|
|
39
|
+
'12:5': 12 / 5
|
|
40
|
+
};
|
|
41
|
+
var useStyles = createUseStyles(function() {
|
|
42
|
+
return {
|
|
43
|
+
video: {
|
|
44
|
+
borderRadius: function(param) {
|
|
45
|
+
var noBorderRadius = param.noBorderRadius;
|
|
46
|
+
return noBorderRadius ? 0 : 4;
|
|
47
|
+
},
|
|
48
|
+
display: 'block',
|
|
49
|
+
maxWidth: '100%',
|
|
50
|
+
maxHeight: '100%',
|
|
51
|
+
objectFit: 'cover',
|
|
52
|
+
aspectRatio: function(param) {
|
|
53
|
+
var aspectRatio = param.aspectRatio;
|
|
54
|
+
return aspectRatio !== null && aspectRatio !== void 0 ? aspectRatio : 'unset';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
/** Transparent 1x1px PNG */ var TRANSPARENT_PIXEL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC';
|
|
60
|
+
var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
61
|
+
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, ["src", "poster", "autoPlay", "muted", "loop", "preload", "aspectRatio"]);
|
|
62
|
+
var noBorderRadius = useDisableBorderRadius();
|
|
63
|
+
var classes = useStyles({
|
|
64
|
+
noBorderRadius: noBorderRadius,
|
|
65
|
+
aspectRatio: !props.width && !props.height ? RATIO[aspectRatio] : undefined
|
|
66
|
+
});
|
|
67
|
+
var videoRef = React.useRef(null);
|
|
68
|
+
React.useEffect(function() {
|
|
69
|
+
var video = videoRef.current;
|
|
70
|
+
if (video && autoPlay && video.paused) {
|
|
71
|
+
video.play();
|
|
72
|
+
}
|
|
73
|
+
}, [
|
|
74
|
+
autoPlay
|
|
75
|
+
]);
|
|
76
|
+
// normalize sources
|
|
77
|
+
var sources = (Array.isArray(src) ? src : [
|
|
78
|
+
src
|
|
79
|
+
]).map(function(source) {
|
|
80
|
+
if (typeof source === 'string') {
|
|
81
|
+
return {
|
|
82
|
+
src: source
|
|
83
|
+
};
|
|
84
|
+
} else {
|
|
85
|
+
return source;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
var width = props.width;
|
|
89
|
+
var height = props.height;
|
|
90
|
+
if (props.width !== undefined && props.height !== undefined) {
|
|
91
|
+
width = props.width;
|
|
92
|
+
height = props.height;
|
|
93
|
+
} else if (props.width !== undefined) {
|
|
94
|
+
height = props.width / RATIO[aspectRatio];
|
|
95
|
+
} else if (props.height !== undefined) {
|
|
96
|
+
width = props.height * RATIO[aspectRatio];
|
|
97
|
+
} else {
|
|
98
|
+
width = '100%';
|
|
99
|
+
}
|
|
100
|
+
return(/*#__PURE__*/ _jsx("video", {
|
|
101
|
+
ref: combineRefs(ref, videoRef),
|
|
102
|
+
playsInline: true,
|
|
103
|
+
disablePictureInPicture: true,
|
|
104
|
+
disableRemotePlayback: true,
|
|
105
|
+
autoPlay: autoPlay,
|
|
106
|
+
muted: muted,
|
|
107
|
+
loop: loop,
|
|
108
|
+
width: width,
|
|
109
|
+
height: height,
|
|
110
|
+
className: classes.video,
|
|
111
|
+
preload: preload,
|
|
112
|
+
// This transparent pixel fallback avoids showing the ugly "play" image in android webviews
|
|
113
|
+
poster: poster || TRANSPARENT_PIXEL,
|
|
114
|
+
children: sources.map(function(param, index) {
|
|
115
|
+
var src = param.src, type = param.type;
|
|
116
|
+
/*#__PURE__*/ return _jsx("source", {
|
|
117
|
+
src: src,
|
|
118
|
+
type: type
|
|
119
|
+
}, index);
|
|
120
|
+
})
|
|
121
|
+
}));
|
|
122
|
+
});
|
|
123
|
+
export default Video;
|