@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.
Files changed (128) hide show
  1. package/README.md +2 -2
  2. package/dist/button-group.d.ts +2 -1
  3. package/dist/button-group.js +36 -5
  4. package/dist/button-group.js.flow +2 -1
  5. package/dist/button-layout.d.ts +2 -1
  6. package/dist/button-layout.js +22 -4
  7. package/dist/button-layout.js.flow +2 -1
  8. package/dist/button.js +114 -35
  9. package/dist/card.d.ts +4 -0
  10. package/dist/card.js +7 -2
  11. package/dist/card.js.flow +4 -0
  12. package/dist/carousel.d.ts +4 -0
  13. package/dist/carousel.js +6 -3
  14. package/dist/carousel.js.flow +6 -0
  15. package/dist/checkbox.js +2 -1
  16. package/dist/dialog.d.ts +21 -4
  17. package/dist/dialog.js +51 -26
  18. package/dist/dialog.js.flow +17 -4
  19. package/dist/generated/mistica-icons/icon-gift-light.js +1 -1
  20. package/dist/generated/mistica-icons/icon-hand-snap-filled.js +1 -1
  21. package/dist/generated/mistica-icons/icon-intranet-light.js +1 -1
  22. package/dist/generated/mistica-icons/icon-photo-camera-filled.js +38 -18
  23. package/dist/generated/mistica-icons/icon-photo-camera-light.js +30 -16
  24. package/dist/generated/mistica-icons/icon-process-loading-filled.js +1 -1
  25. package/dist/generated/mistica-icons/icon-shield-cross-light.js +1 -1
  26. package/dist/generated/mistica-icons/icon-shop-light.js +1 -1
  27. package/dist/generated/mistica-icons/icon-support-agent-premium-regular.js +1 -1
  28. package/dist/generated/mistica-icons/icon-support-agent-regular.js +1 -1
  29. package/dist/generated/mistica-icons/icon-tag-discount-euro-regular.js +1 -1
  30. package/dist/generated/mistica-icons/icon-talk-filled.js +1 -1
  31. package/dist/generated/mistica-icons/icon-tips-and-tricks-regular.js +2 -2
  32. package/dist/generated/mistica-icons/icon-tongue-light.js +1 -1
  33. package/dist/generated/mistica-icons/icon-trash-can-filled.js +1 -1
  34. package/dist/generated/mistica-icons/icon-umbrella-filled.js +1 -1
  35. package/dist/generated/mistica-icons/icon-web-filled.js +1 -1
  36. package/dist/generated/mistica-icons/icon-world-device-filled.d.ts +4 -0
  37. package/dist/generated/mistica-icons/icon-world-device-filled.js +109 -0
  38. package/dist/generated/mistica-icons/icon-world-device-filled.js.flow +6 -0
  39. package/dist/generated/mistica-icons/icon-world-device-light.d.ts +4 -0
  40. package/dist/generated/mistica-icons/icon-world-device-light.js +115 -0
  41. package/dist/generated/mistica-icons/icon-world-device-light.js.flow +6 -0
  42. package/dist/generated/mistica-icons/icon-world-device-regular.d.ts +4 -0
  43. package/dist/generated/mistica-icons/icon-world-device-regular.js +109 -0
  44. package/dist/generated/mistica-icons/icon-world-device-regular.js.flow +6 -0
  45. package/dist/grid-layout.d.ts +16 -0
  46. package/dist/grid-layout.js +96 -35
  47. package/dist/grid-layout.js.flow +33 -1
  48. package/dist/header.d.ts +3 -1
  49. package/dist/header.js +4 -2
  50. package/dist/header.js.flow +7 -1
  51. package/dist/index.d.ts +5 -1
  52. package/dist/index.js +58 -0
  53. package/dist/index.js.flow +11 -1
  54. package/dist/navigation-bar.js +121 -96
  55. package/dist/overscroll-color-context.d.ts +1 -1
  56. package/dist/overscroll-color-context.js +12 -14
  57. package/dist/overscroll-color-context.js.flow +1 -1
  58. package/dist/package-version.js +1 -1
  59. package/dist/popover.d.ts +2 -1
  60. package/dist/popover.js +58 -63
  61. package/dist/popover.js.flow +2 -1
  62. package/dist/skeleton-base.d.ts +9 -0
  63. package/dist/skeleton-base.js +75 -0
  64. package/dist/skeleton-base.js.flow +11 -0
  65. package/dist/skeletons.d.ts +21 -0
  66. package/dist/skeletons.js +232 -0
  67. package/dist/skeletons.js.flow +29 -0
  68. package/dist/skins/blau.js +2 -2
  69. package/dist/skins/movistar.js +1 -1
  70. package/dist/skins/o2-classic.js +1 -1
  71. package/dist/skins/o2.js +1 -1
  72. package/dist/skins/telefonica.js +2 -2
  73. package/dist/skins/utils.d.ts +2 -0
  74. package/dist/skins/utils.js +34 -1
  75. package/dist/skins/utils.js.flow +2 -0
  76. package/dist/skins/vivo.js +1 -1
  77. package/dist/spinner.js +0 -1
  78. package/dist/tabs.d.ts +2 -1
  79. package/dist/tabs.js +22 -4
  80. package/dist/tabs.js.flow +2 -1
  81. package/dist/text-link.js +16 -8
  82. package/dist-es/button-group.js +35 -5
  83. package/dist-es/button-layout.js +21 -4
  84. package/dist-es/button.js +114 -35
  85. package/dist-es/card.js +7 -2
  86. package/dist-es/carousel.js +6 -3
  87. package/dist-es/checkbox.js +2 -1
  88. package/dist-es/dialog.js +51 -25
  89. package/dist-es/generated/mistica-icons/icon-gift-light.js +1 -1
  90. package/dist-es/generated/mistica-icons/icon-hand-snap-filled.js +1 -1
  91. package/dist-es/generated/mistica-icons/icon-intranet-light.js +1 -1
  92. package/dist-es/generated/mistica-icons/icon-photo-camera-filled.js +38 -18
  93. package/dist-es/generated/mistica-icons/icon-photo-camera-light.js +30 -16
  94. package/dist-es/generated/mistica-icons/icon-process-loading-filled.js +1 -1
  95. package/dist-es/generated/mistica-icons/icon-shield-cross-light.js +1 -1
  96. package/dist-es/generated/mistica-icons/icon-shop-light.js +1 -1
  97. package/dist-es/generated/mistica-icons/icon-support-agent-premium-regular.js +1 -1
  98. package/dist-es/generated/mistica-icons/icon-support-agent-regular.js +1 -1
  99. package/dist-es/generated/mistica-icons/icon-tag-discount-euro-regular.js +1 -1
  100. package/dist-es/generated/mistica-icons/icon-talk-filled.js +1 -1
  101. package/dist-es/generated/mistica-icons/icon-tips-and-tricks-regular.js +2 -2
  102. package/dist-es/generated/mistica-icons/icon-tongue-light.js +1 -1
  103. package/dist-es/generated/mistica-icons/icon-trash-can-filled.js +1 -1
  104. package/dist-es/generated/mistica-icons/icon-umbrella-filled.js +1 -1
  105. package/dist-es/generated/mistica-icons/icon-web-filled.js +1 -1
  106. package/dist-es/generated/mistica-icons/icon-world-device-filled.js +85 -0
  107. package/dist-es/generated/mistica-icons/icon-world-device-light.js +91 -0
  108. package/dist-es/generated/mistica-icons/icon-world-device-regular.js +85 -0
  109. package/dist-es/grid-layout.js +95 -35
  110. package/dist-es/header.js +4 -2
  111. package/dist-es/index.js +5 -1
  112. package/dist-es/navigation-bar.js +121 -96
  113. package/dist-es/overscroll-color-context.js +12 -14
  114. package/dist-es/package-version.js +1 -1
  115. package/dist-es/popover.js +59 -64
  116. package/dist-es/skeleton-base.js +43 -0
  117. package/dist-es/skeletons.js +196 -0
  118. package/dist-es/skins/blau.js +2 -2
  119. package/dist-es/skins/movistar.js +1 -1
  120. package/dist-es/skins/o2-classic.js +1 -1
  121. package/dist-es/skins/o2.js +1 -1
  122. package/dist-es/skins/telefonica.js +2 -2
  123. package/dist-es/skins/utils.js +12 -0
  124. package/dist-es/skins/vivo.js +1 -1
  125. package/dist-es/spinner.js +0 -1
  126. package/dist-es/tabs.js +21 -4
  127. package/dist-es/text-link.js +16 -8
  128. package/package.json +2 -2
@@ -36,24 +36,25 @@ function _interopRequireWildcard(obj) {
36
36
  }
37
37
  }
38
38
  var ref = (0, _nestableContext).default(""), Provider = ref.Provider, Getter = ref.Getter, useSetValue = ref.useSetValue;
39
- var shouldRender = (0, _platform).getPlatform() === "ios";
40
- var OverscrollColorProviderNoOp = function OverscrollColorProviderNoOp(param) {
41
- var children = param.children;
42
- return /*#__PURE__*/ (0, _jsxRuntime).jsx(_jsxRuntime.Fragment, {
43
- children: children || null
44
- });
39
+ var shouldRender = function shouldRender() {
40
+ return (0, _platform).getPlatform() === "ios";
45
41
  };
46
- var OverscrollColorProviderComponent = function OverscrollColorProviderComponent(param) {
42
+ var OverscrollColorProvider = function OverscrollColorProvider(param) {
47
43
  var children = param.children;
48
44
  var platformOverrides = (0, _hooks).useTheme().platformOverrides;
49
45
  var isTabletOrSmaller = (0, _hooks).useScreenSize().isTabletOrSmaller;
50
46
  var theme = (0, _hooks).useTheme();
51
- return isTabletOrSmaller ? /*#__PURE__*/ (0, _jsxRuntime).jsx(Provider, {
47
+ if (!shouldRender()) {
48
+ return /*#__PURE__*/ (0, _jsxRuntime).jsx(_jsxRuntime.Fragment, {
49
+ children: children
50
+ });
51
+ }
52
+ return /*#__PURE__*/ (0, _jsxRuntime).jsx(Provider, {
52
53
  children: /*#__PURE__*/ (0, _jsxRuntime).jsx(Getter, {
53
54
  children: function children1(color) {
54
55
  return /*#__PURE__*/ (0, _jsxRuntime).jsxs(_jsxRuntime.Fragment, {
55
56
  children: [
56
- /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
57
+ isTabletOrSmaller ? /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
57
58
  style: {
58
59
  position: "absolute",
59
60
  zIndex: 1,
@@ -64,17 +65,14 @@ var OverscrollColorProviderComponent = function OverscrollColorProviderComponent
64
65
  marginTop: -500,
65
66
  transform: "translate3d(0,0,0)"
66
67
  }
67
- }),
68
+ }) : null,
68
69
  children
69
70
  ]
70
71
  });
71
72
  }
72
73
  })
73
- }) : /*#__PURE__*/ (0, _jsxRuntime).jsx(_jsxRuntime.Fragment, {
74
- children: children
75
74
  });
76
75
  };
77
- var OverscrollColorProvider = shouldRender ? OverscrollColorProviderComponent : OverscrollColorProviderNoOp;
78
76
  exports.OverscrollColorProvider = OverscrollColorProvider;
79
77
  var OverscrollColorComponent = function OverscrollColorComponent() {
80
78
  var isInverseVariant = (0, _themeVariantContext).useIsInverseVariant();
@@ -85,6 +83,6 @@ var OverscrollColorComponent = function OverscrollColorComponent() {
85
83
  var OverscrollColorNoOp = function OverscrollColorNoOp() {
86
84
  return null;
87
85
  };
88
- var OverscrollColor = shouldRender ? OverscrollColorComponent : OverscrollColorNoOp;
86
+ var OverscrollColor = shouldRender() ? OverscrollColorComponent : OverscrollColorNoOp;
89
87
  var _default = OverscrollColor;
90
88
  exports.default = _default;
@@ -4,6 +4,6 @@ import * as React from "react";
4
4
  declare type ProviderProps = {
5
5
  children: React.Node,
6
6
  };
7
- declare export var OverscrollColorProvider: React.ComponentType<ProviderProps>;
7
+ declare export var OverscrollColorProvider: (x: ProviderProps) => React.Node;
8
8
  declare var OverscrollColor: () => null;
9
9
  declare export default typeof OverscrollColor;
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  exports.PACKAGE_VERSION = void 0;
6
- var PACKAGE_VERSION = "12.0.0";
6
+ var PACKAGE_VERSION = "12.2.0";
7
7
  exports.PACKAGE_VERSION = PACKAGE_VERSION;
package/dist/popover.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import type { TrackingEvent } from './utils/types';
3
3
  declare type Position = 'top' | 'bottom' | 'left' | 'right';
4
4
  declare type Props = {
5
- description: string;
5
+ description?: string;
6
6
  target: React.ReactNode;
7
7
  title?: string;
8
8
  asset?: React.ReactNode;
@@ -12,6 +12,7 @@ declare type Props = {
12
12
  trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
13
13
  isVisible?: boolean;
14
14
  children?: void;
15
+ extra?: React.ReactNode;
15
16
  };
16
17
  declare const Popover: React.FC<Props>;
17
18
  export default Popover;
package/dist/popover.js CHANGED
@@ -9,6 +9,10 @@ var _jss = require("./jss");
9
9
  var _iconCloseRegular = _interopRequireDefault(require("./generated/mistica-icons/icon-close-regular"));
10
10
  var _iconButton = _interopRequireDefault(require("./icon-button"));
11
11
  var _hooks = require("./hooks");
12
+ var _stack = _interopRequireDefault(require("./stack"));
13
+ var _box = _interopRequireDefault(require("./box"));
14
+ var _inline = _interopRequireDefault(require("./inline"));
15
+ var _text = require("./text");
12
16
  function _interopRequireDefault(obj) {
13
17
  return obj && obj.__esModule ? obj : {
14
18
  default: obj
@@ -131,7 +135,7 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
131
135
  top: 0,
132
136
  left: "50%",
133
137
  transform: "translate(-50%, -50%) rotate(45deg)",
134
- border: "1px solid ".concat(theme.colors.divider),
138
+ border: "1px solid ".concat(theme.colors.border),
135
139
  borderRadius: 2,
136
140
  boxShadow: function boxShadow(param) {
137
141
  var position = param.position;
@@ -154,46 +158,27 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
154
158
  zIndex: 9,
155
159
  boxShadow: "0 2px 4px 0 rgba(0, 0, 0, ".concat(shadowAlpha, ")"),
156
160
  backgroundColor: theme.colors.backgroundContainer,
157
- border: "1px solid ".concat(theme.colors.divider),
161
+ border: "1px solid ".concat(theme.colors.border),
158
162
  borderRadius: 8
159
163
  },
160
- title: {
161
- marginBottom: 4,
162
- color: theme.colors.textPrimary,
163
- fontWeight: 400,
164
- lineHeight: 1.5,
165
- fontSize: 16
166
- },
167
- boxContainer: {
168
- position: "relative",
164
+ textAlign: {
169
165
  display: "flex",
170
- justifyContent: "space-between"
166
+ alignItems: "center",
167
+ height: "100%"
168
+ },
169
+ boxContent: {
170
+ display: "flex"
171
171
  },
172
172
  textContent: {
173
- display: "flex",
174
- flexDirection: "column",
175
- margin: 16,
176
- marginRight: 8,
177
- justifyContent: "center",
173
+ textAlign: "left",
178
174
  width: "100%",
179
175
  wordBreak: "break-word"
180
176
  },
181
- assetContent: {
182
- width: 40,
183
- minWidth: 40,
184
- height: 40,
185
- margin: 16,
186
- marginRight: 0
187
- },
188
- text: {
189
- color: theme.colors.textSecondary,
190
- textAlign: "left",
191
- lineHeight: 1.42857142,
192
- fontSize: 14
193
- },
194
177
  closeButtonIcon: {
195
- paddingTop: 8,
196
- paddingRight: 8
178
+ position: "absolute",
179
+ top: 8,
180
+ right: 8,
181
+ zIndex: 1
197
182
  }
198
183
  };
199
184
  });
@@ -277,7 +262,7 @@ var getTargetPosition = function getTargetPosition(targetWrapper) {
277
262
  } : null;
278
263
  };
279
264
  var Popover = function Popover(param) {
280
- 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;
265
+ 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;
281
266
  var ref = (0, _hooks).useTheme(), texts = ref.texts, colors = ref.colors, isIos = ref.isIos;
282
267
  var isTabletOrSmaller = (0, _hooks).useScreenSize().isTabletOrSmaller;
283
268
  var ref1 = _slicedToArray(React.useState(null), 2), targetPosition = ref1[0], setTargetPosition = ref1[1];
@@ -318,40 +303,50 @@ var Popover = function Popover(param) {
318
303
  className: classes.arrow
319
304
  })
320
305
  }),
321
- /*#__PURE__*/ (0, _jsxRuntime).jsxs("div", {
322
- className: classes.boxContainer,
306
+ /*#__PURE__*/ (0, _jsxRuntime).jsxs(_box.default, {
307
+ padding: 16,
323
308
  children: [
324
- asset && /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
325
- className: classes.assetContent,
326
- children: asset
327
- }),
328
- /*#__PURE__*/ (0, _jsxRuntime).jsxs("div", {
329
- className: classes.textContent,
330
- children: [
331
- title && /*#__PURE__*/ (0, _jsxRuntime).jsx("span", {
332
- className: classes.title,
333
- children: title
334
- }),
335
- /*#__PURE__*/ (0, _jsxRuntime).jsx("span", {
336
- className: classes.text,
337
- children: description
338
- })
339
- ]
309
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_box.default, {
310
+ paddingRight: 24,
311
+ className: classes.boxContent,
312
+ children: /*#__PURE__*/ (0, _jsxRuntime).jsxs(_inline.default, {
313
+ space: 16,
314
+ children: [
315
+ asset,
316
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_box.default, {
317
+ className: classes.textAlign,
318
+ children: /*#__PURE__*/ (0, _jsxRuntime).jsxs(_stack.default, {
319
+ space: 4,
320
+ className: classes.textContent,
321
+ children: [
322
+ title && /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text3, {
323
+ regular: true,
324
+ children: title
325
+ }),
326
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text2, {
327
+ regular: true,
328
+ color: colors.textSecondary,
329
+ children: description
330
+ })
331
+ ]
332
+ })
333
+ })
334
+ ]
335
+ })
340
336
  }),
341
- /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
337
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconButton.default, {
342
338
  className: classes.closeButtonIcon,
343
- children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconButton.default, {
344
- onPress: function onPress(e) {
345
- onClose === null || onClose === void 0 ? void 0 : onClose();
346
- e.stopPropagation();
347
- },
348
- trackingEvent: trackingEvent,
349
- "aria-label": texts.modalClose,
350
- children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconCloseRegular.default, {
351
- color: colors.neutralHigh
352
- })
339
+ onPress: function onPress(e) {
340
+ onClose === null || onClose === void 0 ? void 0 : onClose();
341
+ e.stopPropagation();
342
+ },
343
+ trackingEvent: trackingEvent,
344
+ "aria-label": texts.modalClose,
345
+ children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconCloseRegular.default, {
346
+ color: colors.neutralHigh
353
347
  })
354
- })
348
+ }),
349
+ extra
355
350
  ]
356
351
  })
357
352
  ]
@@ -4,7 +4,7 @@ import * as React from "react";
4
4
  import type { TrackingEvent } from "./utils/types";
5
5
  declare type Position = "top" | "bottom" | "left" | "right";
6
6
  declare type Props = {
7
- description: string,
7
+ description?: string,
8
8
  target: React.Node,
9
9
  title?: string,
10
10
  asset?: React.Node,
@@ -13,6 +13,7 @@ declare type Props = {
13
13
  width?: number,
14
14
  trackingEvent?: TrackingEvent | $ReadOnlyArray<TrackingEvent>,
15
15
  isVisible?: boolean,
16
+ extra?: React.Node,
16
17
  };
17
18
  declare var Popover: React.ComponentType<Props>;
18
19
  declare export default typeof Popover;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ declare type SkeletonBaseProps = {
3
+ width?: string | number;
4
+ height?: string | number;
5
+ radius?: string | number;
6
+ className?: string;
7
+ };
8
+ declare const SkeletonBase: ({ width, height, radius, className, }: SkeletonBaseProps) => JSX.Element;
9
+ export default SkeletonBase;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.default = void 0;
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ var _themeVariantContext = require("./theme-variant-context");
8
+ var React = _interopRequireWildcard(require("react"));
9
+ var _jss = require("./jss");
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+ function _interopRequireDefault(obj) {
12
+ return obj && obj.__esModule ? obj : {
13
+ default: obj
14
+ };
15
+ }
16
+ function _interopRequireWildcard(obj) {
17
+ if (obj && obj.__esModule) {
18
+ return obj;
19
+ } else {
20
+ var newObj = {};
21
+ if (obj != null) {
22
+ for(var key in obj){
23
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
24
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
25
+ if (desc.get || desc.set) {
26
+ Object.defineProperty(newObj, key, desc);
27
+ } else {
28
+ newObj[key] = obj[key];
29
+ }
30
+ }
31
+ }
32
+ }
33
+ newObj.default = obj;
34
+ return newObj;
35
+ }
36
+ }
37
+ var useSkeletonBaseStyles = (0, _jss).createUseStyles(function(param1) {
38
+ var colors = param1.colors;
39
+ return {
40
+ skeletonBase: {
41
+ borderRadius: function borderRadius(param) {
42
+ var radius = param.radius;
43
+ return radius;
44
+ },
45
+ height: function height(param) {
46
+ var height1 = param.height;
47
+ return height1;
48
+ },
49
+ width: function width(param) {
50
+ var width1 = param.width;
51
+ return width1;
52
+ },
53
+ background: function background(param) {
54
+ var isInverse = param.isInverse;
55
+ return isInverse ? colors.backgroundSkeletonInverse : colors.backgroundSkeleton;
56
+ }
57
+ }
58
+ };
59
+ });
60
+ var SkeletonBase = function SkeletonBase(param) {
61
+ 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;
62
+ var isInverse = (0, _themeVariantContext).useIsInverseVariant();
63
+ var classes = useSkeletonBaseStyles({
64
+ isInverse: isInverse,
65
+ width: width,
66
+ height: height,
67
+ radius: radius
68
+ });
69
+ return /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
70
+ className: (0, _classnames).default(classes.skeletonBase, className),
71
+ "aria-hidden": true
72
+ });
73
+ };
74
+ var _default = SkeletonBase;
75
+ exports.default = _default;
@@ -0,0 +1,11 @@
1
+ // @flow
2
+ import * as React from "react";
3
+
4
+ declare type SkeletonBaseProps = {
5
+ width?: string | number,
6
+ height?: string | number,
7
+ radius?: string | number,
8
+ className?: string,
9
+ };
10
+ declare var SkeletonBase: (x: SkeletonBaseProps) => React.Node;
11
+ declare export default typeof SkeletonBase;
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import type { DataAttributes } from './utils/types';
3
+ declare type SkeletonLineProps = {
4
+ width?: string | number;
5
+ ariaLabel?: string;
6
+ dataAttributes?: DataAttributes;
7
+ };
8
+ export declare const SkeletonLine: ({ width, ariaLabel, dataAttributes }: SkeletonLineProps) => JSX.Element;
9
+ declare type SkeletonTextProps = Omit<SkeletonLineProps, 'width'>;
10
+ export declare const SkeletonText: ({ ariaLabel, dataAttributes }: SkeletonTextProps) => JSX.Element;
11
+ declare type SkeletonCircleProps = Omit<SkeletonLineProps, 'width'> & {
12
+ size?: number | string;
13
+ };
14
+ export declare const SkeletonCircle: ({ ariaLabel, size, dataAttributes }: SkeletonCircleProps) => JSX.Element;
15
+ declare type SkeletonRowProps = SkeletonLineProps;
16
+ export declare const SkeletonRow: ({ width, ariaLabel, dataAttributes }: SkeletonRowProps) => JSX.Element;
17
+ declare type SkeletonRectangleProps = SkeletonLineProps & {
18
+ height: number | string;
19
+ };
20
+ export declare const SkeletonRectangle: ({ width, height, ariaLabel, dataAttributes, }: SkeletonRectangleProps) => JSX.Element;
21
+ export {};
@@ -0,0 +1,232 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.SkeletonRectangle = exports.SkeletonRow = exports.SkeletonCircle = exports.SkeletonText = exports.SkeletonLine = void 0;
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _skeletonBase = _interopRequireDefault(require("./skeleton-base"));
9
+ var _jss = require("./jss");
10
+ var _stack = _interopRequireDefault(require("./stack"));
11
+ var _classnames = _interopRequireDefault(require("classnames"));
12
+ var _dom = require("./utils/dom");
13
+ function _interopRequireDefault(obj) {
14
+ return obj && obj.__esModule ? obj : {
15
+ default: obj
16
+ };
17
+ }
18
+ function _interopRequireWildcard(obj) {
19
+ if (obj && obj.__esModule) {
20
+ return obj;
21
+ } else {
22
+ var newObj = {};
23
+ if (obj != null) {
24
+ for(var key in obj){
25
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
26
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
27
+ if (desc.get || desc.set) {
28
+ Object.defineProperty(newObj, key, desc);
29
+ } else {
30
+ newObj[key] = obj[key];
31
+ }
32
+ }
33
+ }
34
+ }
35
+ newObj.default = obj;
36
+ return newObj;
37
+ }
38
+ }
39
+ function _defineProperty(obj, key, value) {
40
+ if (key in obj) {
41
+ Object.defineProperty(obj, key, {
42
+ value: value,
43
+ enumerable: true,
44
+ configurable: true,
45
+ writable: true
46
+ });
47
+ } else {
48
+ obj[key] = value;
49
+ }
50
+ return obj;
51
+ }
52
+ function _objectSpread(target) {
53
+ var _arguments = arguments, _loop = function(i) {
54
+ var source = _arguments[i] != null ? _arguments[i] : {};
55
+ var ownKeys = Object.keys(source);
56
+ if (typeof Object.getOwnPropertySymbols === "function") {
57
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
58
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
59
+ }));
60
+ }
61
+ ownKeys.forEach(function(key) {
62
+ _defineProperty(target, key, source[key]);
63
+ });
64
+ };
65
+ for(var i = 1; i < arguments.length; i++)_loop(i);
66
+ return target;
67
+ }
68
+ var transition = "1.5s linear";
69
+ var useAnimation = (0, _jss).createUseStyles(function() {
70
+ return {
71
+ animation: {
72
+ animation: "$pulse ".concat(transition, " infinite")
73
+ },
74
+ "@keyframes pulse": {
75
+ "0%": {
76
+ opacity: 1
77
+ },
78
+ "50%": {
79
+ opacity: 0.5
80
+ },
81
+ "100%": {
82
+ opacity: 1
83
+ }
84
+ }
85
+ };
86
+ });
87
+ var useSkeletonStyles = (0, _jss).createUseStyles(function() {
88
+ return {
89
+ wrap: {
90
+ borderRadius: 8,
91
+ height: function height(param) {
92
+ var _height = param.height, height1 = _height === void 0 ? 8 : _height;
93
+ return height1;
94
+ },
95
+ width: function width(param) {
96
+ var _width = param.width, width1 = _width === void 0 ? "100%" : _width;
97
+ return width1;
98
+ }
99
+ }
100
+ };
101
+ });
102
+ var SkeletonLine = function SkeletonLine(param) {
103
+ var _width = param.width, width = _width === void 0 ? "100%" : _width, ariaLabel = param.ariaLabel, dataAttributes = param.dataAttributes;
104
+ var animationClasses = useAnimation();
105
+ var styleClass = useSkeletonStyles({
106
+ width: width
107
+ });
108
+ return /*#__PURE__*/ (0, _jsxRuntime).jsx("div", _objectSpread({
109
+ className: "".concat(animationClasses.animation, " ").concat(styleClass.wrap),
110
+ role: "status",
111
+ "aria-hidden": ariaLabel === undefined,
112
+ "aria-busy": ariaLabel !== undefined,
113
+ "aria-label": ariaLabel
114
+ }, (0, _dom).getPrefixedDataAttributes(dataAttributes), {
115
+ children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_skeletonBase.default, {})
116
+ }));
117
+ };
118
+ exports.SkeletonLine = SkeletonLine;
119
+ var SkeletonText = function SkeletonText(param) {
120
+ var ariaLabel = param.ariaLabel, dataAttributes = param.dataAttributes;
121
+ var animationClasses = useAnimation();
122
+ var styleClass = useSkeletonStyles({
123
+ height: "fit-content"
124
+ });
125
+ return /*#__PURE__*/ (0, _jsxRuntime).jsxs(_stack.default, _objectSpread({
126
+ className: "".concat(animationClasses.animation, " ").concat(styleClass.wrap),
127
+ space: 16,
128
+ role: "status",
129
+ "aria-hidden": ariaLabel === undefined,
130
+ "aria-busy": ariaLabel !== undefined,
131
+ "aria-label": ariaLabel
132
+ }, (0, _dom).getPrefixedDataAttributes(dataAttributes), {
133
+ children: [
134
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_skeletonBase.default, {}),
135
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_skeletonBase.default, {}),
136
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_skeletonBase.default, {
137
+ width: "75%"
138
+ })
139
+ ]
140
+ }));
141
+ };
142
+ exports.SkeletonText = SkeletonText;
143
+ var SkeletonCircle = function SkeletonCircle(param) {
144
+ var ariaLabel = param.ariaLabel, _size = param.size, size = _size === void 0 ? 40 : _size, dataAttributes = param.dataAttributes;
145
+ var animationClasses = useAnimation();
146
+ var styleClass = useSkeletonStyles({
147
+ width: size,
148
+ height: size
149
+ });
150
+ return /*#__PURE__*/ (0, _jsxRuntime).jsx("div", _objectSpread({
151
+ className: (0, _classnames).default(animationClasses.animation, styleClass.wrap),
152
+ role: "status",
153
+ "aria-hidden": ariaLabel === undefined,
154
+ "aria-busy": ariaLabel !== undefined,
155
+ "aria-label": ariaLabel
156
+ }, (0, _dom).getPrefixedDataAttributes(dataAttributes), {
157
+ children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_skeletonBase.default, {
158
+ height: size,
159
+ width: size,
160
+ radius: "50%"
161
+ })
162
+ }));
163
+ };
164
+ exports.SkeletonCircle = SkeletonCircle;
165
+ var useSkeletonRowStyles = (0, _jss).createUseStyles(function() {
166
+ return {
167
+ row: {
168
+ display: "flex",
169
+ alignItems: "center",
170
+ justifyContent: "center"
171
+ },
172
+ circle: {
173
+ flexShrink: 0,
174
+ flexGrow: 0
175
+ },
176
+ line: {
177
+ flexShrink: 1,
178
+ marginLeft: 16
179
+ }
180
+ };
181
+ });
182
+ var SkeletonRow = function SkeletonRow(param) {
183
+ var _width = param.width, width = _width === void 0 ? "100%" : _width, ariaLabel = param.ariaLabel, dataAttributes = param.dataAttributes;
184
+ var animationClasses = useAnimation();
185
+ var styleClass = useSkeletonStyles({
186
+ width: width,
187
+ height: "100%"
188
+ });
189
+ var rowClass = useSkeletonRowStyles();
190
+ return /*#__PURE__*/ (0, _jsxRuntime).jsxs("div", _objectSpread({
191
+ className: (0, _classnames).default(animationClasses.animation, styleClass.wrap, rowClass.row),
192
+ role: "status",
193
+ "aria-hidden": ariaLabel === undefined,
194
+ "aria-busy": ariaLabel !== undefined,
195
+ "aria-label": ariaLabel
196
+ }, (0, _dom).getPrefixedDataAttributes(dataAttributes), {
197
+ children: [
198
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_skeletonBase.default, {
199
+ height: 40,
200
+ width: 40,
201
+ radius: "50%",
202
+ className: rowClass.circle
203
+ }),
204
+ /*#__PURE__*/ (0, _jsxRuntime).jsx(_skeletonBase.default, {
205
+ width: width,
206
+ className: rowClass.line
207
+ })
208
+ ]
209
+ }));
210
+ };
211
+ exports.SkeletonRow = SkeletonRow;
212
+ var SkeletonRectangle = function SkeletonRectangle(param) {
213
+ 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;
214
+ var animationClasses = useAnimation();
215
+ var styleClass = useSkeletonStyles({
216
+ width: width,
217
+ height: "100%"
218
+ });
219
+ return /*#__PURE__*/ (0, _jsxRuntime).jsx("div", _objectSpread({
220
+ className: (0, _classnames).default(animationClasses.animation, styleClass.wrap),
221
+ role: "status",
222
+ "aria-hidden": true,
223
+ "aria-busy": true,
224
+ "aria-label": ariaLabel
225
+ }, (0, _dom).getPrefixedDataAttributes(dataAttributes), {
226
+ children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_skeletonBase.default, {
227
+ height: height,
228
+ width: width
229
+ })
230
+ }));
231
+ };
232
+ exports.SkeletonRectangle = SkeletonRectangle;
@@ -0,0 +1,29 @@
1
+ // @flow
2
+ import * as React from "react";
3
+
4
+ import type { DataAttributes } from "./utils/types";
5
+ declare type SkeletonLineProps = {
6
+ width?: string | number,
7
+ ariaLabel?: string,
8
+ dataAttributes?: DataAttributes,
9
+ };
10
+ declare export var SkeletonLine: (x: SkeletonLineProps) => React.Node;
11
+ declare type SkeletonTextProps = $Diff<SkeletonLineProps, { width: any }>;
12
+ declare export var SkeletonText: (x: SkeletonTextProps) => React.Node;
13
+ declare type SkeletonCircleProps = {
14
+ ...$Diff<SkeletonLineProps, { width: any }>,
15
+ ...{
16
+ size?: number | string,
17
+ },
18
+ };
19
+ declare export var SkeletonCircle: (x: SkeletonCircleProps) => React.Node;
20
+ declare type SkeletonRowProps = SkeletonLineProps;
21
+ declare export var SkeletonRow: (x: SkeletonRowProps) => React.Node;
22
+ declare type SkeletonRectangleProps = {
23
+ ...SkeletonLineProps,
24
+ ...{
25
+ height: number | string,
26
+ },
27
+ };
28
+ declare export var SkeletonRectangle: (x: SkeletonRectangleProps) => React.Node;
29
+ declare export {};