@telefonica/mistica 12.0.0 → 12.2.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/README.md +2 -2
- package/dist/button-group.d.ts +2 -1
- package/dist/button-group.js +36 -5
- package/dist/button-group.js.flow +2 -1
- package/dist/button-layout.d.ts +2 -1
- package/dist/button-layout.js +22 -4
- package/dist/button-layout.js.flow +2 -1
- package/dist/button.js +114 -35
- package/dist/card.d.ts +4 -0
- package/dist/card.js +7 -2
- package/dist/card.js.flow +4 -0
- package/dist/carousel.d.ts +4 -0
- package/dist/carousel.js +6 -3
- package/dist/carousel.js.flow +6 -0
- package/dist/checkbox.js +2 -1
- package/dist/dialog.d.ts +21 -4
- package/dist/dialog.js +51 -26
- package/dist/dialog.js.flow +17 -4
- package/dist/generated/mistica-icons/icon-gift-light.js +1 -1
- package/dist/generated/mistica-icons/icon-hand-snap-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-intranet-light.js +1 -1
- package/dist/generated/mistica-icons/icon-photo-camera-filled.js +38 -18
- package/dist/generated/mistica-icons/icon-photo-camera-light.js +30 -16
- package/dist/generated/mistica-icons/icon-process-loading-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-shield-cross-light.js +1 -1
- package/dist/generated/mistica-icons/icon-shop-light.js +1 -1
- package/dist/generated/mistica-icons/icon-support-agent-premium-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-support-agent-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-tag-discount-euro-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-talk-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-tips-and-tricks-regular.js +2 -2
- package/dist/generated/mistica-icons/icon-tongue-light.js +1 -1
- package/dist/generated/mistica-icons/icon-trash-can-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-umbrella-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-web-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-world-device-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-world-device-filled.js +109 -0
- package/dist/generated/mistica-icons/icon-world-device-filled.js.flow +6 -0
- package/dist/generated/mistica-icons/icon-world-device-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-world-device-light.js +115 -0
- package/dist/generated/mistica-icons/icon-world-device-light.js.flow +6 -0
- package/dist/generated/mistica-icons/icon-world-device-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-world-device-regular.js +109 -0
- package/dist/generated/mistica-icons/icon-world-device-regular.js.flow +6 -0
- package/dist/grid-layout.d.ts +16 -0
- package/dist/grid-layout.js +96 -35
- package/dist/grid-layout.js.flow +33 -1
- package/dist/header.d.ts +3 -1
- package/dist/header.js +4 -2
- package/dist/header.js.flow +7 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +58 -0
- package/dist/index.js.flow +11 -1
- package/dist/navigation-bar.js +121 -96
- package/dist/overscroll-color-context.d.ts +1 -1
- package/dist/overscroll-color-context.js +12 -14
- package/dist/overscroll-color-context.js.flow +1 -1
- package/dist/package-version.js +1 -1
- package/dist/popover.d.ts +2 -1
- package/dist/popover.js +58 -63
- package/dist/popover.js.flow +2 -1
- package/dist/skeleton-base.d.ts +9 -0
- package/dist/skeleton-base.js +75 -0
- package/dist/skeleton-base.js.flow +11 -0
- package/dist/skeletons.d.ts +21 -0
- package/dist/skeletons.js +232 -0
- package/dist/skeletons.js.flow +29 -0
- package/dist/skins/blau.js +2 -2
- package/dist/skins/movistar.js +1 -1
- package/dist/skins/o2-classic.js +1 -1
- package/dist/skins/o2.js +1 -1
- package/dist/skins/telefonica.js +2 -2
- package/dist/skins/utils.d.ts +2 -0
- package/dist/skins/utils.js +34 -1
- package/dist/skins/utils.js.flow +2 -0
- package/dist/skins/vivo.js +1 -1
- package/dist/spinner.js +0 -1
- package/dist/tabs.d.ts +2 -1
- package/dist/tabs.js +22 -4
- package/dist/tabs.js.flow +2 -1
- package/dist/text-link.js +16 -8
- package/dist-es/button-group.js +35 -5
- package/dist-es/button-layout.js +21 -4
- package/dist-es/button.js +114 -35
- package/dist-es/card.js +7 -2
- package/dist-es/carousel.js +6 -3
- package/dist-es/checkbox.js +2 -1
- package/dist-es/dialog.js +51 -25
- package/dist-es/generated/mistica-icons/icon-gift-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-hand-snap-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-intranet-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-photo-camera-filled.js +38 -18
- package/dist-es/generated/mistica-icons/icon-photo-camera-light.js +30 -16
- package/dist-es/generated/mistica-icons/icon-process-loading-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-shield-cross-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-shop-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-support-agent-premium-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-support-agent-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-tag-discount-euro-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-talk-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-tips-and-tricks-regular.js +2 -2
- package/dist-es/generated/mistica-icons/icon-tongue-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-trash-can-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-umbrella-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-web-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-world-device-filled.js +85 -0
- package/dist-es/generated/mistica-icons/icon-world-device-light.js +91 -0
- package/dist-es/generated/mistica-icons/icon-world-device-regular.js +85 -0
- package/dist-es/grid-layout.js +95 -35
- package/dist-es/header.js +4 -2
- package/dist-es/index.js +5 -1
- package/dist-es/navigation-bar.js +121 -96
- package/dist-es/overscroll-color-context.js +12 -14
- package/dist-es/package-version.js +1 -1
- package/dist-es/popover.js +59 -64
- package/dist-es/skeleton-base.js +43 -0
- package/dist-es/skeletons.js +196 -0
- package/dist-es/skins/blau.js +2 -2
- package/dist-es/skins/movistar.js +1 -1
- package/dist-es/skins/o2-classic.js +1 -1
- package/dist-es/skins/o2.js +1 -1
- package/dist-es/skins/telefonica.js +2 -2
- package/dist-es/skins/utils.js +12 -0
- package/dist-es/skins/vivo.js +1 -1
- package/dist-es/spinner.js +0 -1
- package/dist-es/tabs.js +21 -4
- package/dist-es/text-link.js +16 -8
- package/package.json +2 -2
|
@@ -5,24 +5,25 @@ import { useTheme, useScreenSize } from "./hooks";
|
|
|
5
5
|
import createNestableContext from "./nestable-context";
|
|
6
6
|
import { isInsideNovumNativeApp, getPlatform } from "./utils/platform";
|
|
7
7
|
var ref = createNestableContext(""), Provider = ref.Provider, Getter = ref.Getter, useSetValue = ref.useSetValue;
|
|
8
|
-
var shouldRender =
|
|
9
|
-
|
|
10
|
-
var children = param.children;
|
|
11
|
-
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
12
|
-
children: children || null
|
|
13
|
-
});
|
|
8
|
+
var shouldRender = function() {
|
|
9
|
+
return getPlatform() === "ios";
|
|
14
10
|
};
|
|
15
|
-
var
|
|
11
|
+
export var OverscrollColorProvider = function(param) {
|
|
16
12
|
var children = param.children;
|
|
17
13
|
var platformOverrides = useTheme().platformOverrides;
|
|
18
14
|
var isTabletOrSmaller = useScreenSize().isTabletOrSmaller;
|
|
19
15
|
var theme = useTheme();
|
|
20
|
-
|
|
16
|
+
if (!shouldRender()) {
|
|
17
|
+
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
18
|
+
children: children
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return /*#__PURE__*/ _jsx(Provider, {
|
|
21
22
|
children: /*#__PURE__*/ _jsx(Getter, {
|
|
22
23
|
children: function(color) {
|
|
23
24
|
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
24
25
|
children: [
|
|
25
|
-
/*#__PURE__*/ _jsx("div", {
|
|
26
|
+
isTabletOrSmaller ? /*#__PURE__*/ _jsx("div", {
|
|
26
27
|
style: {
|
|
27
28
|
position: "absolute",
|
|
28
29
|
zIndex: 1,
|
|
@@ -33,17 +34,14 @@ var OverscrollColorProviderComponent = function(param) {
|
|
|
33
34
|
marginTop: -500,
|
|
34
35
|
transform: "translate3d(0,0,0)"
|
|
35
36
|
}
|
|
36
|
-
}),
|
|
37
|
+
}) : null,
|
|
37
38
|
children
|
|
38
39
|
]
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
})
|
|
42
|
-
}) : /*#__PURE__*/ _jsx(_Fragment, {
|
|
43
|
-
children: children
|
|
44
43
|
});
|
|
45
44
|
};
|
|
46
|
-
export var OverscrollColorProvider = shouldRender ? OverscrollColorProviderComponent : OverscrollColorProviderNoOp;
|
|
47
45
|
var OverscrollColorComponent = function() {
|
|
48
46
|
var isInverseVariant = useIsInverseVariant();
|
|
49
47
|
var theme = useTheme();
|
|
@@ -53,5 +51,5 @@ var OverscrollColorComponent = function() {
|
|
|
53
51
|
var OverscrollColorNoOp = function() {
|
|
54
52
|
return null;
|
|
55
53
|
};
|
|
56
|
-
var OverscrollColor = shouldRender ? OverscrollColorComponent : OverscrollColorNoOp;
|
|
54
|
+
var OverscrollColor = shouldRender() ? OverscrollColorComponent : OverscrollColorNoOp;
|
|
57
55
|
export default OverscrollColor;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
|
|
2
|
-
export var PACKAGE_VERSION = "12.
|
|
2
|
+
export var PACKAGE_VERSION = "12.2.0";
|
package/dist-es/popover.js
CHANGED
|
@@ -75,9 +75,13 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
75
75
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
76
76
|
import * as React from "react";
|
|
77
77
|
import { createUseStyles } from "./jss";
|
|
78
|
-
import
|
|
78
|
+
import IconCloseRegular from "./generated/mistica-icons/icon-close-regular";
|
|
79
79
|
import IconButton from "./icon-button";
|
|
80
80
|
import { useTheme, useScreenSize } from "./hooks";
|
|
81
|
+
import Stack from "./stack";
|
|
82
|
+
import Box from "./box";
|
|
83
|
+
import Inline from "./inline";
|
|
84
|
+
import { Text3, Text2 } from "./text";
|
|
81
85
|
// Zeplin definition:
|
|
82
86
|
// https://app.zeplin.io/project/5c9b6f097168bc065782b5c3/screen/5d15d87e46571573089f2863
|
|
83
87
|
var defaultPositionDesktop = "bottom";
|
|
@@ -99,7 +103,7 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
99
103
|
top: 0,
|
|
100
104
|
left: "50%",
|
|
101
105
|
transform: "translate(-50%, -50%) rotate(45deg)",
|
|
102
|
-
border: "1px solid ".concat(theme.colors.
|
|
106
|
+
border: "1px solid ".concat(theme.colors.border),
|
|
103
107
|
borderRadius: 2,
|
|
104
108
|
boxShadow: function(param) {
|
|
105
109
|
var position = param.position;
|
|
@@ -122,46 +126,27 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
122
126
|
zIndex: 9,
|
|
123
127
|
boxShadow: "0 2px 4px 0 rgba(0, 0, 0, ".concat(shadowAlpha, ")"),
|
|
124
128
|
backgroundColor: theme.colors.backgroundContainer,
|
|
125
|
-
border: "1px solid ".concat(theme.colors.
|
|
129
|
+
border: "1px solid ".concat(theme.colors.border),
|
|
126
130
|
borderRadius: 8
|
|
127
131
|
},
|
|
128
|
-
|
|
129
|
-
marginBottom: 4,
|
|
130
|
-
color: theme.colors.textPrimary,
|
|
131
|
-
fontWeight: 400,
|
|
132
|
-
lineHeight: 1.5,
|
|
133
|
-
fontSize: 16
|
|
134
|
-
},
|
|
135
|
-
boxContainer: {
|
|
136
|
-
position: "relative",
|
|
132
|
+
textAlign: {
|
|
137
133
|
display: "flex",
|
|
138
|
-
|
|
134
|
+
alignItems: "center",
|
|
135
|
+
height: "100%"
|
|
136
|
+
},
|
|
137
|
+
boxContent: {
|
|
138
|
+
display: "flex"
|
|
139
139
|
},
|
|
140
140
|
textContent: {
|
|
141
|
-
|
|
142
|
-
flexDirection: "column",
|
|
143
|
-
margin: 16,
|
|
144
|
-
marginRight: 8,
|
|
145
|
-
justifyContent: "center",
|
|
141
|
+
textAlign: "left",
|
|
146
142
|
width: "100%",
|
|
147
143
|
wordBreak: "break-word"
|
|
148
144
|
},
|
|
149
|
-
assetContent: {
|
|
150
|
-
width: 40,
|
|
151
|
-
minWidth: 40,
|
|
152
|
-
height: 40,
|
|
153
|
-
margin: 16,
|
|
154
|
-
marginRight: 0
|
|
155
|
-
},
|
|
156
|
-
text: {
|
|
157
|
-
color: theme.colors.textSecondary,
|
|
158
|
-
textAlign: "left",
|
|
159
|
-
lineHeight: 1.42857142,
|
|
160
|
-
fontSize: 14
|
|
161
|
-
},
|
|
162
145
|
closeButtonIcon: {
|
|
163
|
-
|
|
164
|
-
|
|
146
|
+
position: "absolute",
|
|
147
|
+
top: 8,
|
|
148
|
+
right: 8,
|
|
149
|
+
zIndex: 1
|
|
165
150
|
}
|
|
166
151
|
};
|
|
167
152
|
});
|
|
@@ -246,7 +231,7 @@ var getTargetPosition = function(targetWrapper) {
|
|
|
246
231
|
} : null;
|
|
247
232
|
};
|
|
248
233
|
var Popover = function(param) {
|
|
249
|
-
var description = param.description, title = param.title, onClose = param.onClose, trackingEvent = param.trackingEvent, position = param.position, width = param.width, target = param.target, asset = param.asset, _isVisible = param.isVisible, isVisible = _isVisible === void 0 ? true : _isVisible;
|
|
234
|
+
var description = param.description, title = param.title, onClose = param.onClose, trackingEvent = param.trackingEvent, position = param.position, width = param.width, target = param.target, asset = param.asset, _isVisible = param.isVisible, isVisible = _isVisible === void 0 ? true : _isVisible, extra = param.extra;
|
|
250
235
|
var ref = useTheme(), texts = ref.texts, colors = ref.colors, isIos = ref.isIos;
|
|
251
236
|
var isTabletOrSmaller = useScreenSize().isTabletOrSmaller;
|
|
252
237
|
var ref1 = _slicedToArray(React.useState(null), 2), targetPosition = ref1[0], setTargetPosition = ref1[1];
|
|
@@ -287,40 +272,50 @@ var Popover = function(param) {
|
|
|
287
272
|
className: classes.arrow
|
|
288
273
|
})
|
|
289
274
|
}),
|
|
290
|
-
/*#__PURE__*/ _jsxs(
|
|
291
|
-
|
|
275
|
+
/*#__PURE__*/ _jsxs(Box, {
|
|
276
|
+
padding: 16,
|
|
292
277
|
children: [
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
278
|
+
/*#__PURE__*/ _jsx(Box, {
|
|
279
|
+
paddingRight: 24,
|
|
280
|
+
className: classes.boxContent,
|
|
281
|
+
children: /*#__PURE__*/ _jsxs(Inline, {
|
|
282
|
+
space: 16,
|
|
283
|
+
children: [
|
|
284
|
+
asset,
|
|
285
|
+
/*#__PURE__*/ _jsx(Box, {
|
|
286
|
+
className: classes.textAlign,
|
|
287
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
288
|
+
space: 4,
|
|
289
|
+
className: classes.textContent,
|
|
290
|
+
children: [
|
|
291
|
+
title && /*#__PURE__*/ _jsx(Text3, {
|
|
292
|
+
regular: true,
|
|
293
|
+
children: title
|
|
294
|
+
}),
|
|
295
|
+
/*#__PURE__*/ _jsx(Text2, {
|
|
296
|
+
regular: true,
|
|
297
|
+
color: colors.textSecondary,
|
|
298
|
+
children: description
|
|
299
|
+
})
|
|
300
|
+
]
|
|
301
|
+
})
|
|
302
|
+
})
|
|
303
|
+
]
|
|
304
|
+
})
|
|
309
305
|
}),
|
|
310
|
-
/*#__PURE__*/ _jsx(
|
|
306
|
+
/*#__PURE__*/ _jsx(IconButton, {
|
|
311
307
|
className: classes.closeButtonIcon,
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
color: colors.neutralHigh
|
|
321
|
-
})
|
|
308
|
+
onPress: function(e) {
|
|
309
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
310
|
+
e.stopPropagation();
|
|
311
|
+
},
|
|
312
|
+
trackingEvent: trackingEvent,
|
|
313
|
+
"aria-label": texts.modalClose,
|
|
314
|
+
children: /*#__PURE__*/ _jsx(IconCloseRegular, {
|
|
315
|
+
color: colors.neutralHigh
|
|
322
316
|
})
|
|
323
|
-
})
|
|
317
|
+
}),
|
|
318
|
+
extra
|
|
324
319
|
]
|
|
325
320
|
})
|
|
326
321
|
]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useIsInverseVariant } from "./theme-variant-context";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { createUseStyles } from "./jss";
|
|
5
|
+
import classnames from "classnames";
|
|
6
|
+
var useSkeletonBaseStyles = createUseStyles(function(param1) {
|
|
7
|
+
var colors = param1.colors;
|
|
8
|
+
return {
|
|
9
|
+
skeletonBase: {
|
|
10
|
+
borderRadius: function(param) {
|
|
11
|
+
var radius = param.radius;
|
|
12
|
+
return radius;
|
|
13
|
+
},
|
|
14
|
+
height: function(param) {
|
|
15
|
+
var height = param.height;
|
|
16
|
+
return height;
|
|
17
|
+
},
|
|
18
|
+
width: function(param) {
|
|
19
|
+
var width = param.width;
|
|
20
|
+
return width;
|
|
21
|
+
},
|
|
22
|
+
background: function(param) {
|
|
23
|
+
var isInverse = param.isInverse;
|
|
24
|
+
return isInverse ? colors.backgroundSkeletonInverse : colors.backgroundSkeleton;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
var SkeletonBase = function(param) {
|
|
30
|
+
var _width = param.width, width = _width === void 0 ? "100%" : _width, _height = param.height, height = _height === void 0 ? 8 : _height, _radius = param.radius, radius = _radius === void 0 ? 8 : _radius, className = param.className;
|
|
31
|
+
var isInverse = useIsInverseVariant();
|
|
32
|
+
var classes = useSkeletonBaseStyles({
|
|
33
|
+
isInverse: isInverse,
|
|
34
|
+
width: width,
|
|
35
|
+
height: height,
|
|
36
|
+
radius: radius
|
|
37
|
+
});
|
|
38
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
39
|
+
className: classnames(classes.skeletonBase, className),
|
|
40
|
+
"aria-hidden": true
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
export default SkeletonBase;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _objectSpread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_defineProperty(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
+
// https://www.figma.com/file/w7E0mmB92eio0zHw7h9iS2/%5BREADY%5D-Skeletons-Specs?node-id=986%3A1161
|
|
31
|
+
import * as React from "react";
|
|
32
|
+
import SkeletonBase from "./skeleton-base";
|
|
33
|
+
import { createUseStyles } from "./jss";
|
|
34
|
+
import Stack from "./stack";
|
|
35
|
+
import classNames from "classnames";
|
|
36
|
+
import { getPrefixedDataAttributes } from "./utils/dom";
|
|
37
|
+
var transition = "1.5s linear";
|
|
38
|
+
var useAnimation = createUseStyles(function() {
|
|
39
|
+
return {
|
|
40
|
+
animation: {
|
|
41
|
+
animation: "$pulse ".concat(transition, " infinite")
|
|
42
|
+
},
|
|
43
|
+
"@keyframes pulse": {
|
|
44
|
+
"0%": {
|
|
45
|
+
opacity: 1
|
|
46
|
+
},
|
|
47
|
+
"50%": {
|
|
48
|
+
opacity: 0.5
|
|
49
|
+
},
|
|
50
|
+
"100%": {
|
|
51
|
+
opacity: 1
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
var useSkeletonStyles = createUseStyles(function() {
|
|
57
|
+
return {
|
|
58
|
+
wrap: {
|
|
59
|
+
borderRadius: 8,
|
|
60
|
+
height: function(param) {
|
|
61
|
+
var _height = param.height, height = _height === void 0 ? 8 : _height;
|
|
62
|
+
return height;
|
|
63
|
+
},
|
|
64
|
+
width: function(param) {
|
|
65
|
+
var _width = param.width, width = _width === void 0 ? "100%" : _width;
|
|
66
|
+
return width;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
export var SkeletonLine = function(param) {
|
|
72
|
+
var _width = param.width, width = _width === void 0 ? "100%" : _width, ariaLabel = param.ariaLabel, dataAttributes = param.dataAttributes;
|
|
73
|
+
var animationClasses = useAnimation();
|
|
74
|
+
var styleClass = useSkeletonStyles({
|
|
75
|
+
width: width
|
|
76
|
+
});
|
|
77
|
+
return /*#__PURE__*/ _jsx("div", _objectSpread({
|
|
78
|
+
className: "".concat(animationClasses.animation, " ").concat(styleClass.wrap),
|
|
79
|
+
role: "status",
|
|
80
|
+
"aria-hidden": ariaLabel === undefined,
|
|
81
|
+
"aria-busy": ariaLabel !== undefined,
|
|
82
|
+
"aria-label": ariaLabel
|
|
83
|
+
}, getPrefixedDataAttributes(dataAttributes), {
|
|
84
|
+
children: /*#__PURE__*/ _jsx(SkeletonBase, {})
|
|
85
|
+
}));
|
|
86
|
+
};
|
|
87
|
+
export var SkeletonText = function(param) {
|
|
88
|
+
var ariaLabel = param.ariaLabel, dataAttributes = param.dataAttributes;
|
|
89
|
+
var animationClasses = useAnimation();
|
|
90
|
+
var styleClass = useSkeletonStyles({
|
|
91
|
+
height: "fit-content"
|
|
92
|
+
});
|
|
93
|
+
return /*#__PURE__*/ _jsxs(Stack, _objectSpread({
|
|
94
|
+
className: "".concat(animationClasses.animation, " ").concat(styleClass.wrap),
|
|
95
|
+
space: 16,
|
|
96
|
+
role: "status",
|
|
97
|
+
"aria-hidden": ariaLabel === undefined,
|
|
98
|
+
"aria-busy": ariaLabel !== undefined,
|
|
99
|
+
"aria-label": ariaLabel
|
|
100
|
+
}, getPrefixedDataAttributes(dataAttributes), {
|
|
101
|
+
children: [
|
|
102
|
+
/*#__PURE__*/ _jsx(SkeletonBase, {}),
|
|
103
|
+
/*#__PURE__*/ _jsx(SkeletonBase, {}),
|
|
104
|
+
/*#__PURE__*/ _jsx(SkeletonBase, {
|
|
105
|
+
width: "75%"
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
}));
|
|
109
|
+
};
|
|
110
|
+
export var SkeletonCircle = function(param) {
|
|
111
|
+
var ariaLabel = param.ariaLabel, _size = param.size, size = _size === void 0 ? 40 : _size, dataAttributes = param.dataAttributes;
|
|
112
|
+
var animationClasses = useAnimation();
|
|
113
|
+
var styleClass = useSkeletonStyles({
|
|
114
|
+
width: size,
|
|
115
|
+
height: size
|
|
116
|
+
});
|
|
117
|
+
return /*#__PURE__*/ _jsx("div", _objectSpread({
|
|
118
|
+
className: classNames(animationClasses.animation, styleClass.wrap),
|
|
119
|
+
role: "status",
|
|
120
|
+
"aria-hidden": ariaLabel === undefined,
|
|
121
|
+
"aria-busy": ariaLabel !== undefined,
|
|
122
|
+
"aria-label": ariaLabel
|
|
123
|
+
}, getPrefixedDataAttributes(dataAttributes), {
|
|
124
|
+
children: /*#__PURE__*/ _jsx(SkeletonBase, {
|
|
125
|
+
height: size,
|
|
126
|
+
width: size,
|
|
127
|
+
radius: "50%"
|
|
128
|
+
})
|
|
129
|
+
}));
|
|
130
|
+
};
|
|
131
|
+
var useSkeletonRowStyles = createUseStyles(function() {
|
|
132
|
+
return {
|
|
133
|
+
row: {
|
|
134
|
+
display: "flex",
|
|
135
|
+
alignItems: "center",
|
|
136
|
+
justifyContent: "center"
|
|
137
|
+
},
|
|
138
|
+
circle: {
|
|
139
|
+
flexShrink: 0,
|
|
140
|
+
flexGrow: 0
|
|
141
|
+
},
|
|
142
|
+
line: {
|
|
143
|
+
flexShrink: 1,
|
|
144
|
+
marginLeft: 16
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
export var SkeletonRow = function(param) {
|
|
149
|
+
var _width = param.width, width = _width === void 0 ? "100%" : _width, ariaLabel = param.ariaLabel, dataAttributes = param.dataAttributes;
|
|
150
|
+
var animationClasses = useAnimation();
|
|
151
|
+
var styleClass = useSkeletonStyles({
|
|
152
|
+
width: width,
|
|
153
|
+
height: "100%"
|
|
154
|
+
});
|
|
155
|
+
var rowClass = useSkeletonRowStyles();
|
|
156
|
+
return /*#__PURE__*/ _jsxs("div", _objectSpread({
|
|
157
|
+
className: classNames(animationClasses.animation, styleClass.wrap, rowClass.row),
|
|
158
|
+
role: "status",
|
|
159
|
+
"aria-hidden": ariaLabel === undefined,
|
|
160
|
+
"aria-busy": ariaLabel !== undefined,
|
|
161
|
+
"aria-label": ariaLabel
|
|
162
|
+
}, getPrefixedDataAttributes(dataAttributes), {
|
|
163
|
+
children: [
|
|
164
|
+
/*#__PURE__*/ _jsx(SkeletonBase, {
|
|
165
|
+
height: 40,
|
|
166
|
+
width: 40,
|
|
167
|
+
radius: "50%",
|
|
168
|
+
className: rowClass.circle
|
|
169
|
+
}),
|
|
170
|
+
/*#__PURE__*/ _jsx(SkeletonBase, {
|
|
171
|
+
width: width,
|
|
172
|
+
className: rowClass.line
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
}));
|
|
176
|
+
};
|
|
177
|
+
export var SkeletonRectangle = function(param) {
|
|
178
|
+
var _width = param.width, width = _width === void 0 ? "100%" : _width, _height = param.height, height = _height === void 0 ? "100%" : _height, ariaLabel = param.ariaLabel, dataAttributes = param.dataAttributes;
|
|
179
|
+
var animationClasses = useAnimation();
|
|
180
|
+
var styleClass = useSkeletonStyles({
|
|
181
|
+
width: width,
|
|
182
|
+
height: "100%"
|
|
183
|
+
});
|
|
184
|
+
return /*#__PURE__*/ _jsx("div", _objectSpread({
|
|
185
|
+
className: classNames(animationClasses.animation, styleClass.wrap),
|
|
186
|
+
role: "status",
|
|
187
|
+
"aria-hidden": true,
|
|
188
|
+
"aria-busy": true,
|
|
189
|
+
"aria-label": ariaLabel
|
|
190
|
+
}, getPrefixedDataAttributes(dataAttributes), {
|
|
191
|
+
children: /*#__PURE__*/ _jsx(SkeletonBase, {
|
|
192
|
+
height: height,
|
|
193
|
+
width: width
|
|
194
|
+
})
|
|
195
|
+
}));
|
|
196
|
+
};
|
package/dist-es/skins/blau.js
CHANGED
|
@@ -53,7 +53,7 @@ export var getBlauSkin = function() {
|
|
|
53
53
|
backgroundBrand: palette.blauBluePrimary,
|
|
54
54
|
backgroundOverlay: applyAlpha(palette.blauBlueSecondary, 0.75),
|
|
55
55
|
backgroundSkeleton: palette.grey2,
|
|
56
|
-
backgroundSkeletonInverse: palette.white,
|
|
56
|
+
backgroundSkeletonInverse: applyAlpha(palette.white, 0.2),
|
|
57
57
|
navigationBarBackground: palette.blauBluePrimary,
|
|
58
58
|
backgroundAlternative: palette.blauBluePrimary20,
|
|
59
59
|
backgroundFeedbackBottom: palette.blauBluePrimary,
|
|
@@ -174,7 +174,7 @@ export var getBlauSkin = function() {
|
|
|
174
174
|
textLink: palette.blauPurple30,
|
|
175
175
|
textLinkInverse: palette.blauPurple30,
|
|
176
176
|
// CONTROLS
|
|
177
|
-
control: palette.
|
|
177
|
+
control: palette.darkModeGrey6,
|
|
178
178
|
loadingBar: palette.blauBluePrimary,
|
|
179
179
|
loadingBarBackground: palette.darkModeGrey,
|
|
180
180
|
toggleAndroidInactive: palette.grey5,
|
|
@@ -56,7 +56,7 @@ export var getMovistarSkin = function(variant) {
|
|
|
56
56
|
backgroundContainer: palette.white,
|
|
57
57
|
backgroundBrand: palette.movistarBlue,
|
|
58
58
|
backgroundOverlay: applyAlpha(palette.grey6, 0.6),
|
|
59
|
-
backgroundSkeleton: palette.
|
|
59
|
+
backgroundSkeleton: palette.grey2,
|
|
60
60
|
backgroundSkeletonInverse: palette.movistarBlue55,
|
|
61
61
|
navigationBarBackground: palette.movistarBlue,
|
|
62
62
|
backgroundAlternative: palette.grey1,
|
|
@@ -64,7 +64,7 @@ export var getO2ClassicSkin = function() {
|
|
|
64
64
|
backgroundContainer: palette.white,
|
|
65
65
|
backgroundBrand: "linear-gradient(to bottom, ".concat(palette.o2Blue, ", ").concat(palette.o2GradientSecond, " 51%, ").concat(palette.o2GradientThird, " 72%, ").concat(palette.o2GradientFourth, ")"),
|
|
66
66
|
backgroundOverlay: applyAlpha(palette.grey6, 0.6),
|
|
67
|
-
backgroundSkeleton: palette.
|
|
67
|
+
backgroundSkeleton: palette.grey2,
|
|
68
68
|
backgroundSkeletonInverse: applyAlpha(palette.white, 0.2),
|
|
69
69
|
navigationBarBackground: palette.o2Blue,
|
|
70
70
|
backgroundAlternative: palette.grey1,
|
package/dist-es/skins/o2.js
CHANGED
|
@@ -54,7 +54,7 @@ export var getO2Skin = function() {
|
|
|
54
54
|
backgroundContainer: palette.white,
|
|
55
55
|
backgroundBrand: palette.o2BluePrimary,
|
|
56
56
|
backgroundOverlay: applyAlpha(palette.grey6, 0.6),
|
|
57
|
-
backgroundSkeleton: palette.
|
|
57
|
+
backgroundSkeleton: palette.grey2,
|
|
58
58
|
backgroundSkeletonInverse: applyAlpha(palette.white, 0.2),
|
|
59
59
|
navigationBarBackground: palette.o2BluePrimary,
|
|
60
60
|
backgroundAlternative: palette.grey1,
|
|
@@ -50,7 +50,7 @@ export var getTelefonicaSkin = function() {
|
|
|
50
50
|
backgroundContainer: palette.white,
|
|
51
51
|
backgroundBrand: palette.telefonicaBlue,
|
|
52
52
|
backgroundOverlay: applyAlpha(palette.grey6, 0.6),
|
|
53
|
-
backgroundSkeleton: palette.
|
|
53
|
+
backgroundSkeleton: palette.grey2,
|
|
54
54
|
backgroundSkeletonInverse: palette.telefonicaBlue70,
|
|
55
55
|
navigationBarBackground: palette.telefonicaBlue,
|
|
56
56
|
backgroundAlternative: palette.grey1,
|
|
@@ -173,7 +173,7 @@ export var getTelefonicaSkin = function() {
|
|
|
173
173
|
textButtonSecondaryInverseSelected: palette.grey4,
|
|
174
174
|
textLink: palette.telefonicaBlue,
|
|
175
175
|
textLinkInverse: palette.telefonicaBlue,
|
|
176
|
-
control: palette.
|
|
176
|
+
control: palette.darkModeGrey6,
|
|
177
177
|
controlActivated: palette.telefonicaBlue,
|
|
178
178
|
loadingBar: palette.telefonicaBlue,
|
|
179
179
|
loadingBarBackground: applyAlpha(palette.white, 0.05),
|
package/dist-es/skins/utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { BLAU_SKIN, TELEFONICA_SKIN, VIVO_SKIN, O2_SKIN, O2_CLASSIC_SKIN, MOVISTAR_SKIN } from "./constants";
|
|
2
3
|
import { getBlauSkin } from "./blau";
|
|
3
4
|
import { getTelefonicaSkin } from "./telefonica";
|
|
@@ -26,3 +27,14 @@ export var getSkinByName = function(name, variant) {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
};
|
|
30
|
+
// copied/adapted from https://github.com/gregberge/react-flatten-children/blob/master/src/index.tsx
|
|
31
|
+
export var flattenChildren = function(children) {
|
|
32
|
+
var childrenArray = React.Children.toArray(children);
|
|
33
|
+
return childrenArray.reduce(function(flatChildren, child) {
|
|
34
|
+
if (child.type === React.Fragment) {
|
|
35
|
+
return flatChildren.concat(flattenChildren(child.props.children));
|
|
36
|
+
}
|
|
37
|
+
flatChildren.push(child);
|
|
38
|
+
return flatChildren;
|
|
39
|
+
}, []);
|
|
40
|
+
};
|
package/dist-es/skins/vivo.js
CHANGED
|
@@ -48,7 +48,7 @@ export var getVivoSkin = function() {
|
|
|
48
48
|
backgroundContainer: palette.white,
|
|
49
49
|
backgroundBrand: palette.vivoPurple,
|
|
50
50
|
backgroundOverlay: applyAlpha(palette.grey6, 0.6),
|
|
51
|
-
backgroundSkeleton: palette.
|
|
51
|
+
backgroundSkeleton: palette.grey2,
|
|
52
52
|
backgroundSkeletonInverse: applyAlpha(palette.white, 0.2),
|
|
53
53
|
backgroundFeedbackBottom: palette.vivoPurple,
|
|
54
54
|
navigationBarBackground: palette.vivoPurple,
|
package/dist-es/spinner.js
CHANGED
package/dist-es/tabs.js
CHANGED
|
@@ -46,6 +46,21 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
46
46
|
function _nonIterableRest() {
|
|
47
47
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
48
48
|
}
|
|
49
|
+
function _objectSpread(target) {
|
|
50
|
+
for(var i = 1; i < arguments.length; i++){
|
|
51
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
52
|
+
var ownKeys = Object.keys(source);
|
|
53
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
54
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
55
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
ownKeys.forEach(function(key) {
|
|
59
|
+
_defineProperty(target, key, source[key]);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return target;
|
|
63
|
+
}
|
|
49
64
|
function _slicedToArray(arr, i) {
|
|
50
65
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
51
66
|
}
|
|
@@ -67,6 +82,7 @@ import { useAriaId, useElementDimensions } from "./hooks";
|
|
|
67
82
|
import { Text3 } from "./text";
|
|
68
83
|
import { pxToRem } from "./utils/css";
|
|
69
84
|
import { isRunningAcceptanceTest } from "./utils/platform";
|
|
85
|
+
import { getPrefixedDataAttributes } from "./utils/dom";
|
|
70
86
|
var TAB_MAX_WIDTH = 284;
|
|
71
87
|
var TAB_HEIGHT = 56;
|
|
72
88
|
var LINE_ANIMATION_DURATION_MS = isRunningAcceptanceTest() ? 0 : 300;
|
|
@@ -158,7 +174,7 @@ var useStyles = createUseStyles(function(param1) {
|
|
|
158
174
|
};
|
|
159
175
|
});
|
|
160
176
|
var Tabs = function(param2) {
|
|
161
|
-
var selectedIndex = param2.selectedIndex, onChange = param2.onChange, tabs = param2.tabs;
|
|
177
|
+
var selectedIndex = param2.selectedIndex, onChange = param2.onChange, tabs = param2.tabs, dataAttributes = param2.dataAttributes;
|
|
162
178
|
var id = useAriaId();
|
|
163
179
|
var ref = useElementDimensions(), width = ref.width, ref1 = ref.ref;
|
|
164
180
|
var animatedLineRef = React.useRef(null);
|
|
@@ -194,11 +210,12 @@ var Tabs = function(param2) {
|
|
|
194
210
|
}, LINE_ANIMATION_DURATION_MS);
|
|
195
211
|
}
|
|
196
212
|
};
|
|
197
|
-
return /*#__PURE__*/ _jsx("div", {
|
|
213
|
+
return /*#__PURE__*/ _jsx("div", _objectSpread({
|
|
198
214
|
id: id,
|
|
199
215
|
role: "tablist",
|
|
200
216
|
ref: ref1,
|
|
201
|
-
className: classes.outerBorder
|
|
217
|
+
className: classes.outerBorder
|
|
218
|
+
}, getPrefixedDataAttributes(dataAttributes), {
|
|
202
219
|
children: /*#__PURE__*/ _jsx(ResponsiveLayout, {
|
|
203
220
|
fullWidth: true,
|
|
204
221
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
@@ -250,6 +267,6 @@ var Tabs = function(param2) {
|
|
|
250
267
|
]
|
|
251
268
|
})
|
|
252
269
|
})
|
|
253
|
-
});
|
|
270
|
+
}));
|
|
254
271
|
};
|
|
255
272
|
export default Tabs;
|