@telefonica/mistica 14.42.1 → 14.44.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 (45) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.d.ts +0 -2
  3. package/dist/carousel.d.ts +5 -5
  4. package/dist/carousel.js +169 -153
  5. package/dist/cvv-field.js +85 -40
  6. package/dist/feedback.js +36 -36
  7. package/dist/index.d.ts +7 -3
  8. package/dist/index.js +17 -1
  9. package/dist/logo.d.ts +1 -0
  10. package/dist/logo.js +110 -68
  11. package/dist/package-version.js +1 -1
  12. package/dist/popover.css-mistica.js +4 -43
  13. package/dist/popover.css.d.ts +1 -12
  14. package/dist/popover.d.ts +6 -2
  15. package/dist/popover.js +71 -226
  16. package/dist/select.js +176 -172
  17. package/dist/skins/constants.d.ts +1 -0
  18. package/dist/skins/constants.js +4 -1
  19. package/dist/skins/tu.d.ts +47 -0
  20. package/dist/skins/tu.js +362 -0
  21. package/dist/skins/types/index.d.ts +1 -1
  22. package/dist/skins/utils.js +7 -4
  23. package/dist/theme.d.ts +2 -1
  24. package/dist/theme.js +17 -13
  25. package/dist/tooltip.css-mistica.js +15 -6
  26. package/dist/tooltip.css.d.ts +3 -0
  27. package/dist/tooltip.d.ts +15 -1
  28. package/dist/tooltip.js +213 -140
  29. package/dist-es/carousel.js +193 -176
  30. package/dist-es/cvv-field.js +73 -69
  31. package/dist-es/feedback.js +58 -58
  32. package/dist-es/index.js +1744 -1743
  33. package/dist-es/logo.js +128 -89
  34. package/dist-es/package-version.js +1 -1
  35. package/dist-es/popover.css-mistica.js +2 -3
  36. package/dist-es/popover.js +75 -191
  37. package/dist-es/select.js +182 -178
  38. package/dist-es/skins/constants.js +2 -2
  39. package/dist-es/skins/tu.js +345 -0
  40. package/dist-es/skins/utils.js +21 -18
  41. package/dist-es/style.css +1 -1
  42. package/dist-es/theme.js +16 -12
  43. package/dist-es/tooltip.css-mistica.js +2 -2
  44. package/dist-es/tooltip.js +234 -169
  45. package/package.json +4 -4
package/dist/popover.js CHANGED
@@ -6,68 +6,22 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function() {
9
- return ut;
9
+ return N;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
13
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
14
- const _iconcloseregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-close-regular.js"));
15
- const _iconbutton = /*#__PURE__*/ _interop_require_default(require("./icon-button.js"));
16
- const _hooks = require("./hooks.js");
17
- const _stack = /*#__PURE__*/ _interop_require_default(require("./stack.js"));
18
- const _box = /*#__PURE__*/ _interop_require_default(require("./box.js"));
13
+ const _tooltip = require("./tooltip.js");
19
14
  const _inline = /*#__PURE__*/ _interop_require_default(require("./inline.js"));
15
+ const _stack = /*#__PURE__*/ _interop_require_default(require("./stack.js"));
20
16
  const _text = require("./text.js");
21
- const _popovercssmistica = /*#__PURE__*/ _interop_require_wildcard(require("./popover.css-mistica.js"));
22
- const _sprinklescssmistica = require("./sprinkles.css-mistica.js");
17
+ const _box = /*#__PURE__*/ _interop_require_default(require("./box.js"));
18
+ const _popovercssmistica = require("./popover.css-mistica.js");
23
19
  const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
24
- const _dom = require("./utils/dom.js");
25
20
  function _interop_require_default(obj) {
26
21
  return obj && obj.__esModule ? obj : {
27
22
  default: obj
28
23
  };
29
24
  }
30
- function _getRequireWildcardCache(nodeInterop) {
31
- if (typeof WeakMap !== "function") return null;
32
- var cacheBabelInterop = new WeakMap();
33
- var cacheNodeInterop = new WeakMap();
34
- return (_getRequireWildcardCache = function(nodeInterop) {
35
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
36
- })(nodeInterop);
37
- }
38
- function _interop_require_wildcard(obj, nodeInterop) {
39
- if (!nodeInterop && obj && obj.__esModule) {
40
- return obj;
41
- }
42
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
43
- return {
44
- default: obj
45
- };
46
- }
47
- var cache = _getRequireWildcardCache(nodeInterop);
48
- if (cache && cache.has(obj)) {
49
- return cache.get(obj);
50
- }
51
- var newObj = {
52
- __proto__: null
53
- };
54
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
55
- for(var key in obj){
56
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
57
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
58
- if (desc && (desc.get || desc.set)) {
59
- Object.defineProperty(newObj, key, desc);
60
- } else {
61
- newObj[key] = obj[key];
62
- }
63
- }
64
- }
65
- newObj.default = obj;
66
- if (cache) {
67
- cache.set(obj, newObj);
68
- }
69
- return newObj;
70
- }
71
25
  function _define_property(obj, key, value) {
72
26
  if (key in obj) {
73
27
  Object.defineProperty(obj, key, {
@@ -96,193 +50,84 @@ function _object_spread(target) {
96
50
  }
97
51
  return target;
98
52
  }
99
- function ownKeys(object, enumerableOnly) {
100
- var keys = Object.keys(object);
53
+ function _object_without_properties(source, excluded) {
54
+ if (source == null) return {};
55
+ var target = _object_without_properties_loose(source, excluded);
56
+ var key, i;
101
57
  if (Object.getOwnPropertySymbols) {
102
- var symbols = Object.getOwnPropertySymbols(object);
103
- if (enumerableOnly) {
104
- symbols = symbols.filter(function(sym) {
105
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
106
- });
58
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
59
+ for(i = 0; i < sourceSymbolKeys.length; i++){
60
+ key = sourceSymbolKeys[i];
61
+ if (excluded.indexOf(key) >= 0) continue;
62
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
63
+ target[key] = source[key];
107
64
  }
108
- keys.push.apply(keys, symbols);
109
65
  }
110
- return keys;
66
+ return target;
111
67
  }
112
- function _object_spread_props(target, source) {
113
- source = source != null ? source : {};
114
- if (Object.getOwnPropertyDescriptors) {
115
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
116
- } else {
117
- ownKeys(Object(source)).forEach(function(key) {
118
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
119
- });
68
+ function _object_without_properties_loose(source, excluded) {
69
+ if (source == null) return {};
70
+ var target = {};
71
+ var sourceKeys = Object.keys(source);
72
+ var key, i;
73
+ for(i = 0; i < sourceKeys.length; i++){
74
+ key = sourceKeys[i];
75
+ if (excluded.indexOf(key) >= 0) continue;
76
+ target[key] = source[key];
120
77
  }
121
78
  return target;
122
79
  }
123
- const { defaultPositionDesktop: K, defaultPositionMobile: Q, distanceToTarget: m, marginLeftRightMobile: d, maxWidthDesktop: U, arrowSize: L } = _popovercssmistica, Z = (t)=>t || U, V = function() {
124
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : K, r = arguments.length > 1 ? arguments[1] : void 0;
125
- return r && (t === "left" || t === "right") ? Q : t;
126
- }, tt = (t, r, e)=>t ? (r ? window.screen.width : window.innerWidth) - d * 2 : Z(e), et = (t, r, e, s)=>{
127
- const a = {
128
- right: {
129
- left: e.width + m,
130
- top: e.height / 2,
131
- transform: "translateY(-50%)",
132
- WebkitTransform: "translateY(-50%)"
133
- },
134
- left: {
135
- left: e.left - r - m,
136
- top: e.height / 2,
137
- transform: "translateY(-50%)",
138
- WebkitTransform: "translateY(-50%)"
139
- },
140
- top: {
141
- transform: "translateY(-100%)",
142
- WebkitTransform: "translateY(-100%)",
143
- top: -m,
144
- left: s ? d - e.parentLeft : Math.max(e.width / 2 - r / 2, 0)
145
- },
146
- bottom: {
147
- top: e.height + m,
148
- left: s ? d - e.parentLeft : Math.max(e.width / 2 - r / 2, 0)
149
- }
150
- }[t], f = {
151
- right: {
152
- right: "100%",
153
- top: "50%",
154
- transform: "translateY(-100%) rotate(90deg)",
155
- transformOrigin: "bottom"
156
- },
157
- left: {
158
- left: "100%",
159
- top: "50%",
160
- transform: "translateY(-100%) rotate(-90deg)",
161
- transformOrigin: "bottom"
162
- },
163
- top: {
164
- top: "100%",
165
- left: a.left === 0 ? e.width / 2 : "50%",
166
- transform: "translateX(-50%)"
167
- },
168
- bottom: {
169
- bottom: "100%",
170
- left: a.left === 0 ? e.width / 2 : "50%",
171
- transform: "translateX(-50%) rotate(180deg)"
172
- }
173
- }[t];
174
- return s && (f.left = e.parentLeft + e.width / 2 - d), {
175
- containerStyles: a,
176
- arrowStyles: f
177
- };
178
- }, N = (t)=>t ? {
179
- left: t.offsetLeft,
180
- top: t.offsetTop,
181
- width: t.offsetWidth,
182
- height: t.offsetHeight,
183
- // @ts-expect-error - parentNode must exist
184
- parentLeft: t.parentNode.offsetLeft
185
- } : null, rt = (param)=>{
186
- let { description: t, title: r, onClose: e, trackingEvent: s, position: n, width: a, target: w, asset: f, isVisible: g = !0, extra: Y, dataAttributes: B } = param;
187
- const { texts: R, isIos: z, isDarkMode: D } = (0, _hooks.useTheme)(), { isTabletOrSmaller: h } = (0, _hooks.useScreenSize)(), [x, b] = _react.useState(null), p = _react.useRef(null);
188
- n = V(n, h);
189
- const y = tt(h, z, a), S = D ? 1 : 0.2;
190
- _react.useEffect(()=>{
191
- const l = ()=>{
192
- b(N(p.current));
193
- };
194
- return l(), window.addEventListener("resize", l), ()=>{
195
- window.removeEventListener("resize", l);
196
- };
197
- }, []), _react.useEffect(()=>{
198
- b(N(p.current));
199
- }, [
200
- g
80
+ const T = (_param)=>{
81
+ var { open: m, isVisible: c, extra: l, children: p, onClose: i = ()=>{}, dataAttributes: s, trackingEvent: f, title: o, description: e, asset: n } = _param, d = _object_without_properties(_param, [
82
+ "open",
83
+ "isVisible",
84
+ "extra",
85
+ "children",
86
+ "onClose",
87
+ "dataAttributes",
88
+ "trackingEvent",
89
+ "title",
90
+ "description",
91
+ "asset"
201
92
  ]);
202
- let v = null;
203
- if (g && x) {
204
- const { containerStyles: l, arrowStyles: I } = et(n, y, x, h);
205
- v = /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
206
- className: _popovercssmistica.container,
207
- style: _object_spread({
208
- width: y,
209
- boxShadow: `0 2px 4px 0 rgba(0, 0, 0, ${S})`
210
- }, l)
211
- }, (0, _dom.getPrefixedDataAttributes)(B, "Popover")), {
93
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_tooltip.BaseTooltip, _object_spread({
94
+ content: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_box.default, {
95
+ className: _popovercssmistica.content,
212
96
  children: [
213
- /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
214
- className: _popovercssmistica.arrowWrapper,
215
- style: I,
216
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
217
- className: _popovercssmistica.arrow,
218
- style: {
219
- width: L,
220
- height: L,
221
- boxSizing: "border-box",
222
- boxShadow: n === "bottom" ? "initial" : `0 0 4px 0 rgba(0, 0, 0, ${S})`
223
- }
224
- })
225
- }),
226
- /* @__PURE__ */ (0, _jsxruntime.jsxs)(_box.default, {
227
- padding: 16,
228
- children: [
229
- /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
230
- paddingRight: 24,
231
- className: (0, _sprinklescssmistica.sprinkles)({
232
- display: "flex"
233
- }),
234
- children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_inline.default, {
235
- space: 16,
97
+ (o || e || n) && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
98
+ paddingRight: 16,
99
+ children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_inline.default, {
100
+ space: 16,
101
+ children: [
102
+ n,
103
+ /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
104
+ space: 4,
236
105
  children: [
237
- f,
238
- /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
239
- className: _popovercssmistica.textAlign,
240
- children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
241
- space: 4,
242
- className: _popovercssmistica.textContent,
243
- children: [
244
- r && /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
245
- regular: !0,
246
- children: r
247
- }),
248
- /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
249
- regular: !0,
250
- color: _skincontractcssmistica.vars.colors.textSecondary,
251
- children: t
252
- })
253
- ]
254
- })
106
+ o && /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
107
+ regular: !0,
108
+ children: o
109
+ }),
110
+ e && /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
111
+ regular: !0,
112
+ color: _skincontractcssmistica.vars.colors.textSecondary,
113
+ children: e
255
114
  })
256
115
  ]
257
116
  })
258
- }),
259
- /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.default, {
260
- className: _popovercssmistica.closeButtonIcon,
261
- onPress: ()=>{
262
- e == null || e();
263
- },
264
- trackingEvent: s,
265
- "aria-label": R.modalClose,
266
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconcloseregular.default, {
267
- color: _skincontractcssmistica.vars.colors.neutralHigh
268
- })
269
- }),
270
- Y
271
- ]
272
- })
117
+ ]
118
+ })
119
+ }),
120
+ l !== null && l !== void 0 ? l : p
273
121
  ]
274
- }));
275
- }
276
- return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
277
- className: (0, _sprinklescssmistica.sprinkles)({
278
- position: "relative"
279
122
  }),
280
- children: [
281
- /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
282
- ref: p,
283
- children: w
284
- }),
285
- v
286
- ]
287
- });
288
- }, ut = rt;
123
+ centerContent: !1,
124
+ open: m !== null && m !== void 0 ? m : c,
125
+ hasPointerInteractionOnly: !0,
126
+ delay: !1,
127
+ onClose: i,
128
+ trackingEvent: f,
129
+ dataAttributes: _object_spread({
130
+ "component-name": "Popover"
131
+ }, s)
132
+ }, d));
133
+ }, N = T;