@telefonica/mistica 14.42.0 → 14.43.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 (43) 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/dialog.js +66 -65
  7. package/dist/feedback.css-mistica.js +14 -8
  8. package/dist/feedback.css.d.ts +2 -0
  9. package/dist/feedback.js +56 -49
  10. package/dist/index.d.ts +3 -1
  11. package/dist/index.js +4 -1
  12. package/dist/package-version.js +1 -1
  13. package/dist/popover.css-mistica.js +4 -43
  14. package/dist/popover.css.d.ts +1 -12
  15. package/dist/popover.d.ts +6 -2
  16. package/dist/popover.js +71 -226
  17. package/dist/select.js +176 -172
  18. package/dist/text.css-mistica.js +7 -7
  19. package/dist/text.css.d.ts +0 -1
  20. package/dist/text.js +24 -24
  21. package/dist/theme.d.ts +2 -1
  22. package/dist/theme.js +17 -13
  23. package/dist/tooltip.css-mistica.js +15 -6
  24. package/dist/tooltip.css.d.ts +3 -0
  25. package/dist/tooltip.d.ts +15 -1
  26. package/dist/tooltip.js +213 -140
  27. package/dist-es/carousel.js +193 -176
  28. package/dist-es/cvv-field.js +73 -69
  29. package/dist-es/dialog.js +126 -125
  30. package/dist-es/feedback.css-mistica.js +2 -2
  31. package/dist-es/feedback.js +90 -83
  32. package/dist-es/index.js +1734 -1734
  33. package/dist-es/package-version.js +1 -1
  34. package/dist-es/popover.css-mistica.js +2 -3
  35. package/dist-es/popover.js +75 -191
  36. package/dist-es/select.js +182 -178
  37. package/dist-es/style.css +1 -1
  38. package/dist-es/text.css-mistica.js +3 -3
  39. package/dist-es/text.js +32 -32
  40. package/dist-es/theme.js +16 -12
  41. package/dist-es/tooltip.css-mistica.js +2 -2
  42. package/dist-es/tooltip.js +234 -169
  43. package/package.json +4 -4
@@ -1,2 +1,2 @@
1
- const o = "14.42.0";
1
+ const o = "14.43.0";
2
2
  export { o as PACKAGE_VERSION };
@@ -1,4 +1,3 @@
1
- import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
1
  import "./popover.css.ts.vanilla.css-mistica.js";
3
- var r = "_12igu661 _1y2v1nfgd _1y2v1nfjp _1y2v1nfiz _1y2v1nfj2 _1y2v1nf37", t = 12, _ = "_12igu663 _1y2v1nfgd _1y2v1nf2 _1y2v1nfjj", a = "_12igu669 _1y2v1nfgd _1y2v1nfjs _1y2v1nfkm", i = "_12igu665 _1y2v1nfgd _1y2v1nfh6 _1y2v1nf37 _1y2v1nfiz _1y2v1nfjb", o = "bottom", f = "top", y = 20, e = 16, g = 488, p = "_1y2v1nfgi _1y2v1nfgx _1y2v1nfhm", d = "_12igu667";
4
- export { r as arrow, t as arrowSize, _ as arrowWrapper, a as closeButtonIcon, i as container, o as defaultPositionDesktop, f as defaultPositionMobile, y as distanceToTarget, e as marginLeftRightMobile, g as maxWidthDesktop, p as textAlign, d as textContent };
2
+ var o = "_12igu660";
3
+ export { o as content };
@@ -27,209 +27,93 @@ function _object_spread(target) {
27
27
  }
28
28
  return target;
29
29
  }
30
- function ownKeys(object, enumerableOnly) {
31
- var keys = Object.keys(object);
30
+ function _object_without_properties(source, excluded) {
31
+ if (source == null) return {};
32
+ var target = _object_without_properties_loose(source, excluded);
33
+ var key, i;
32
34
  if (Object.getOwnPropertySymbols) {
33
- var symbols = Object.getOwnPropertySymbols(object);
34
- if (enumerableOnly) {
35
- symbols = symbols.filter(function(sym) {
36
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
37
- });
35
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
36
+ for(i = 0; i < sourceSymbolKeys.length; i++){
37
+ key = sourceSymbolKeys[i];
38
+ if (excluded.indexOf(key) >= 0) continue;
39
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
40
+ target[key] = source[key];
38
41
  }
39
- keys.push.apply(keys, symbols);
40
42
  }
41
- return keys;
43
+ return target;
42
44
  }
43
- function _object_spread_props(target, source) {
44
- source = source != null ? source : {};
45
- if (Object.getOwnPropertyDescriptors) {
46
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
47
- } else {
48
- ownKeys(Object(source)).forEach(function(key) {
49
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
50
- });
45
+ function _object_without_properties_loose(source, excluded) {
46
+ if (source == null) return {};
47
+ var target = {};
48
+ var sourceKeys = Object.keys(source);
49
+ var key, i;
50
+ for(i = 0; i < sourceKeys.length; i++){
51
+ key = sourceKeys[i];
52
+ if (excluded.indexOf(key) >= 0) continue;
53
+ target[key] = source[key];
51
54
  }
52
55
  return target;
53
56
  }
54
- import { jsxs as i, jsx as o } from "react/jsx-runtime";
55
- import * as c from "react";
56
- import M from "./generated/mistica-icons/icon-close-regular.js";
57
- import W from "./icon-button.js";
58
- import { useTheme as E, useScreenSize as P } from "./hooks.js";
59
- import A from "./stack.js";
60
- import u from "./box.js";
61
- import $ from "./inline.js";
62
- import { Text3 as j, Text2 as H } from "./text.js";
63
- import * as X from "./popover.css-mistica.js";
64
- import { container as O, arrowWrapper as _, arrow as q, textAlign as C, textContent as F, closeButtonIcon as G } from "./popover.css-mistica.js";
65
- import { sprinkles as T } from "./sprinkles.css-mistica.js";
66
- import { vars as k } from "./skins/skin-contract.css-mistica.js";
67
- import { getPrefixedDataAttributes as J } from "./utils/dom.js";
68
- const { defaultPositionDesktop: K, defaultPositionMobile: Q, distanceToTarget: m, marginLeftRightMobile: d, maxWidthDesktop: U, arrowSize: L } = X, Z = (t)=>t || U, V = function() {
69
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : K, r = arguments.length > 1 ? arguments[1] : void 0;
70
- return r && (t === "left" || t === "right") ? Q : t;
71
- }, tt = (t, r, e)=>// in iOS, when the webview is rendered offscreen (eg. acccount tab), window.innerWidth value is wrong, it returns strange values like 0 or 80.
72
- t ? (r ? window.screen.width : window.innerWidth) - d * 2 : Z(e), et = (t, r, e, s)=>{
73
- const a = {
74
- right: {
75
- left: e.width + m,
76
- top: e.height / 2,
77
- transform: "translateY(-50%)",
78
- WebkitTransform: "translateY(-50%)"
79
- },
80
- left: {
81
- left: e.left - r - m,
82
- top: e.height / 2,
83
- transform: "translateY(-50%)",
84
- WebkitTransform: "translateY(-50%)"
85
- },
86
- top: {
87
- transform: "translateY(-100%)",
88
- WebkitTransform: "translateY(-100%)",
89
- top: -m,
90
- left: s ? d - e.parentLeft : Math.max(e.width / 2 - r / 2, 0)
91
- },
92
- bottom: {
93
- top: e.height + m,
94
- left: s ? d - e.parentLeft : Math.max(e.width / 2 - r / 2, 0)
95
- }
96
- }[t], f = {
97
- right: {
98
- right: "100%",
99
- top: "50%",
100
- transform: "translateY(-100%) rotate(90deg)",
101
- transformOrigin: "bottom"
102
- },
103
- left: {
104
- left: "100%",
105
- top: "50%",
106
- transform: "translateY(-100%) rotate(-90deg)",
107
- transformOrigin: "bottom"
108
- },
109
- top: {
110
- top: "100%",
111
- left: a.left === 0 ? e.width / 2 : "50%",
112
- transform: "translateX(-50%)"
113
- },
114
- bottom: {
115
- bottom: "100%",
116
- left: a.left === 0 ? e.width / 2 : "50%",
117
- transform: "translateX(-50%) rotate(180deg)"
118
- }
119
- }[t];
120
- return s && (f.left = e.parentLeft + e.width / 2 - d), {
121
- containerStyles: a,
122
- arrowStyles: f
123
- };
124
- }, N = (t)=>t ? {
125
- left: t.offsetLeft,
126
- top: t.offsetTop,
127
- width: t.offsetWidth,
128
- height: t.offsetHeight,
129
- // @ts-expect-error - parentNode must exist
130
- parentLeft: t.parentNode.offsetLeft
131
- } : null, rt = (param)=>{
132
- 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;
133
- const { texts: R, isIos: z, isDarkMode: D } = E(), { isTabletOrSmaller: h } = P(), [x, b] = c.useState(null), p = c.useRef(null);
134
- n = V(n, h);
135
- const y = tt(h, z, a), S = D ? 1 : 0.2;
136
- c.useEffect(()=>{
137
- const l = ()=>{
138
- b(N(p.current));
139
- };
140
- return l(), window.addEventListener("resize", l), ()=>{
141
- window.removeEventListener("resize", l);
142
- };
143
- }, []), c.useEffect(()=>{
144
- b(N(p.current));
145
- }, [
146
- g
57
+ import { jsx as r, jsxs as t } from "react/jsx-runtime";
58
+ import { BaseTooltip as h } from "./tooltip.js";
59
+ import u from "./inline.js";
60
+ import x from "./stack.js";
61
+ import { Text3 as g, Text2 as v } from "./text.js";
62
+ import a from "./box.js";
63
+ import { content as P } from "./popover.css-mistica.js";
64
+ import { vars as y } from "./skins/skin-contract.css-mistica.js";
65
+ const T = (_param)=>{
66
+ 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, [
67
+ "open",
68
+ "isVisible",
69
+ "extra",
70
+ "children",
71
+ "onClose",
72
+ "dataAttributes",
73
+ "trackingEvent",
74
+ "title",
75
+ "description",
76
+ "asset"
147
77
  ]);
148
- let v = null;
149
- if (g && x) {
150
- const { containerStyles: l, arrowStyles: I } = et(n, y, x, h);
151
- v = /* @__PURE__ */ i("div", _object_spread_props(_object_spread({
152
- className: O,
153
- style: _object_spread({
154
- width: y,
155
- boxShadow: `0 2px 4px 0 rgba(0, 0, 0, ${S})`
156
- }, l)
157
- }, J(B, "Popover")), {
78
+ return /* @__PURE__ */ r(h, _object_spread({
79
+ content: /* @__PURE__ */ t(a, {
80
+ className: P,
158
81
  children: [
159
- /* @__PURE__ */ o("div", {
160
- className: _,
161
- style: I,
162
- children: /* @__PURE__ */ o("div", {
163
- className: q,
164
- style: {
165
- width: L,
166
- height: L,
167
- boxSizing: "border-box",
168
- boxShadow: n === "bottom" ? "initial" : `0 0 4px 0 rgba(0, 0, 0, ${S})`
169
- }
170
- })
171
- }),
172
- /* @__PURE__ */ i(u, {
173
- padding: 16,
174
- children: [
175
- /* @__PURE__ */ o(u, {
176
- paddingRight: 24,
177
- className: T({
178
- display: "flex"
179
- }),
180
- children: /* @__PURE__ */ i($, {
181
- space: 16,
82
+ (o || e || n) && /* @__PURE__ */ r(a, {
83
+ paddingRight: 16,
84
+ children: /* @__PURE__ */ t(u, {
85
+ space: 16,
86
+ children: [
87
+ n,
88
+ /* @__PURE__ */ t(x, {
89
+ space: 4,
182
90
  children: [
183
- f,
184
- /* @__PURE__ */ o(u, {
185
- className: C,
186
- children: /* @__PURE__ */ i(A, {
187
- space: 4,
188
- className: F,
189
- children: [
190
- r && /* @__PURE__ */ o(j, {
191
- regular: !0,
192
- children: r
193
- }),
194
- /* @__PURE__ */ o(H, {
195
- regular: !0,
196
- color: k.colors.textSecondary,
197
- children: t
198
- })
199
- ]
200
- })
91
+ o && /* @__PURE__ */ r(g, {
92
+ regular: !0,
93
+ children: o
94
+ }),
95
+ e && /* @__PURE__ */ r(v, {
96
+ regular: !0,
97
+ color: y.colors.textSecondary,
98
+ children: e
201
99
  })
202
100
  ]
203
101
  })
204
- }),
205
- /* @__PURE__ */ o(W, {
206
- className: G,
207
- onPress: ()=>{
208
- e == null || e();
209
- },
210
- trackingEvent: s,
211
- "aria-label": R.modalClose,
212
- children: /* @__PURE__ */ o(M, {
213
- color: k.colors.neutralHigh
214
- })
215
- }),
216
- Y
217
- ]
218
- })
102
+ ]
103
+ })
104
+ }),
105
+ l !== null && l !== void 0 ? l : p
219
106
  ]
220
- }));
221
- }
222
- return /* @__PURE__ */ i("div", {
223
- className: T({
224
- position: "relative"
225
107
  }),
226
- children: [
227
- /* @__PURE__ */ o("div", {
228
- ref: p,
229
- children: w
230
- }),
231
- v
232
- ]
233
- });
234
- }, ut = rt;
235
- export { ut as default };
108
+ centerContent: !1,
109
+ open: m !== null && m !== void 0 ? m : c,
110
+ hasPointerInteractionOnly: !0,
111
+ delay: !1,
112
+ onClose: i,
113
+ trackingEvent: f,
114
+ dataAttributes: _object_spread({
115
+ "component-name": "Popover"
116
+ }, s)
117
+ }, d));
118
+ }, N = T;
119
+ export { N as default };