@telefonica/mistica 15.17.0 → 15.19.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 (74) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/button.css-mistica.js +61 -52
  3. package/dist/button.css.d.ts +33 -17
  4. package/dist/button.d.ts +9 -46
  5. package/dist/button.js +188 -237
  6. package/dist/callout.d.ts +1 -0
  7. package/dist/callout.js +10 -10
  8. package/dist/card.d.ts +6 -1
  9. package/dist/card.js +375 -365
  10. package/dist/chip.d.ts +1 -0
  11. package/dist/chip.js +15 -15
  12. package/dist/dialog.d.ts +1 -0
  13. package/dist/dialog.js +18 -17
  14. package/dist/feedback.js +58 -52
  15. package/dist/inline.css-mistica.js +11 -8
  16. package/dist/inline.css.d.ts +1 -0
  17. package/dist/inline.js +12 -12
  18. package/dist/logo-blau.d.ts +4 -0
  19. package/dist/logo-blau.js +74 -0
  20. package/dist/logo-common.d.ts +9 -0
  21. package/dist/logo-common.js +21 -0
  22. package/dist/logo-movistar.d.ts +4 -0
  23. package/dist/logo-movistar.js +99 -0
  24. package/dist/logo-o2-new.d.ts +4 -0
  25. package/dist/logo-o2-new.js +29 -0
  26. package/dist/logo-o2.d.ts +4 -0
  27. package/dist/logo-o2.js +29 -0
  28. package/dist/logo-telefonica.d.ts +4 -0
  29. package/dist/logo-telefonica.js +197 -0
  30. package/dist/logo-tu.d.ts +4 -0
  31. package/dist/logo-tu.js +28 -0
  32. package/dist/logo-vivo.d.ts +4 -0
  33. package/dist/logo-vivo.js +81 -0
  34. package/dist/logo.d.ts +10 -10
  35. package/dist/logo.js +174 -534
  36. package/dist/navigation-bar.d.ts +7 -0
  37. package/dist/navigation-bar.js +99 -91
  38. package/dist/package-version.js +1 -1
  39. package/dist/popover.d.ts +1 -0
  40. package/dist/popover.js +9 -7
  41. package/dist/snackbar-context.js +23 -22
  42. package/dist/snackbar.d.ts +1 -0
  43. package/dist/snackbar.js +51 -47
  44. package/dist/text.d.ts +1 -0
  45. package/dist/text.js +133 -109
  46. package/dist/tooltip.d.ts +1 -0
  47. package/dist/tooltip.js +110 -110
  48. package/dist-es/button.css-mistica.js +36 -18
  49. package/dist-es/button.js +219 -268
  50. package/dist-es/callout.js +38 -38
  51. package/dist-es/card.js +492 -482
  52. package/dist-es/chip.js +25 -25
  53. package/dist-es/dialog.js +22 -21
  54. package/dist-es/feedback.js +96 -89
  55. package/dist-es/inline.css-mistica.js +3 -3
  56. package/dist-es/inline.js +23 -23
  57. package/dist-es/logo-blau.js +65 -0
  58. package/dist-es/logo-common.js +12 -0
  59. package/dist-es/logo-movistar.js +90 -0
  60. package/dist-es/logo-o2-new.js +20 -0
  61. package/dist-es/logo-o2.js +20 -0
  62. package/dist-es/logo-telefonica.js +188 -0
  63. package/dist-es/logo-tu.js +19 -0
  64. package/dist-es/logo-vivo.js +72 -0
  65. package/dist-es/logo.js +132 -533
  66. package/dist-es/navigation-bar.js +163 -155
  67. package/dist-es/package-version.js +1 -1
  68. package/dist-es/popover.js +26 -24
  69. package/dist-es/snackbar-context.js +25 -24
  70. package/dist-es/snackbar.js +81 -77
  71. package/dist-es/style.css +1 -1
  72. package/dist-es/text.js +143 -119
  73. package/dist-es/tooltip.js +149 -149
  74. package/package.json +1 -1
package/dist-es/text.js CHANGED
@@ -78,100 +78,124 @@ function _object_without_properties_loose(source, excluded) {
78
78
  }
79
79
  return target;
80
80
  }
81
- import { jsx as n, Fragment as A, jsxs as I } from "react/jsx-runtime";
82
- import * as u from "react";
83
- import K from "classnames";
84
- import { useIsInverseVariant as M } from "./theme-variant-context.js";
85
- import { applyCssVars as v, pxToRem as c } from "./utils/css.js";
86
- import { getPrefixedDataAttributes as q } from "./utils/dom.js";
81
+ import { jsx as n, Fragment as A, jsxs as V } from "react/jsx-runtime";
82
+ import * as T from "react";
83
+ import M from "classnames";
84
+ import { useIsInverseVariant as q } from "./theme-variant-context.js";
85
+ import { applyCssVars as y, pxToRem as u } from "./utils/css.js";
86
+ import { getPrefixedDataAttributes as G } from "./utils/dom.js";
87
87
  import { useTheme as m } from "./hooks.js";
88
- import { vars as a } from "./skins/skin-contract.css-mistica.js";
89
- import { text as G, withWordBreak as J, withoutWordBreak as Q, truncate as U, truncateToOneLine as X, vars as p } from "./text.css-mistica.js";
90
- import { VIVO_NEW_SKIN as Y } from "./skins/constants.js";
91
- import Z from "./screen-reader-only.js";
92
- const $ = {
88
+ import { vars as x } from "./skins/skin-contract.css-mistica.js";
89
+ import { text as J, withWordBreak as Q, withoutWordBreak as U, truncate as X, truncateToOneLine as Y, vars as c } from "./text.css-mistica.js";
90
+ import { VIVO_NEW_SKIN as Z } from "./skins/constants.js";
91
+ import $ from "./screen-reader-only.js";
92
+ const ee = {
93
93
  light: 300,
94
94
  regular: 400,
95
95
  medium: 500,
96
96
  bold: 700
97
- }, ee = (e)=>e === !0 ? 1 : e || "initial", d = "Ħ", te = /* @__PURE__ */ I(A, {
97
+ }, te = (e)=>e === !0 ? 1 : e || "initial", g = "Ħ", ie = /* @__PURE__ */ V(A, {
98
98
  children: [
99
99
  /* @__PURE__ */ n("span", {
100
100
  "aria-hidden": !0,
101
- children: d
101
+ children: g
102
102
  }),
103
- /* @__PURE__ */ n(Z, {
103
+ /* @__PURE__ */ n($, {
104
104
  children: /* @__PURE__ */ n("span", {
105
105
  children: "Vivo"
106
106
  })
107
107
  })
108
108
  ]
109
- }), ie = (e)=>u.Children.map(e, (t)=>typeof t != "string" || !t.includes(d) ? t : /* @__PURE__ */ n(A, {
110
- children: t.split(d).map((i, r)=>/* @__PURE__ */ I(u.Fragment, {
111
- children: [
112
- r > 0 && te,
113
- i
114
- ]
115
- }, r))
116
- })), o = (param)=>{
117
- let { weight: e, color: t = a.colors.textPrimary, decoration: i, truncate: r, transform: g, wordBreak: b = !0, hyphens: T = "auto", as: S = "span", children: l, size: f, mobileSize: k = f, desktopSize: H = f, lineHeight: L, mobileLineHeight: w = L, desktopLineHeight: z = L, letterSpacing: P, textAlign: V, textShadow: y, id: C, role: W, "aria-level": R, dataAttributes: N } = param;
118
- const { skinName: E } = m(), F = M(), O = ee(r), _ = {
119
- [a.colors.textPrimary]: a.colors.textPrimaryInverse,
120
- [a.colors.textSecondary]: a.colors.textSecondaryInverse,
121
- [a.colors.textLink]: a.colors.textLinkInverse,
122
- [a.colors.textError]: a.colors.textErrorInverse
109
+ }), re = (param)=>{
110
+ let { children: e, ariaLabel: i, as: t } = param;
111
+ return typeof t == "string" && [
112
+ "h1",
113
+ "h2",
114
+ "h3",
115
+ "h4",
116
+ "h5",
117
+ "h6"
118
+ ].includes(t) && typeof e == "string" && e.includes(g) ? {
119
+ ariaLabel: e.replace(new RegExp(g, "g"), "Vivo"),
120
+ children: /* @__PURE__ */ n("span", {
121
+ "aria-hidden": !0,
122
+ children: e
123
+ })
124
+ } : {
125
+ children: T.Children.map(e, (r)=>typeof r != "string" || !r.includes(g) ? r : /* @__PURE__ */ n(A, {
126
+ children: r.split(g).map((p, l)=>/* @__PURE__ */ V(T.Fragment, {
127
+ children: [
128
+ l > 0 && ie,
129
+ p
130
+ ]
131
+ }, l))
132
+ })),
133
+ ariaLabel: i
134
+ };
135
+ }, o = (param)=>{
136
+ let { weight: e, color: i = x.colors.textPrimary, decoration: t, truncate: r, transform: p, wordBreak: l = !0, hyphens: S = "auto", as: b = "span", children: h, size: k, mobileSize: w = k, desktopSize: H = k, lineHeight: z, mobileLineHeight: L = z, desktopLineHeight: v = z, letterSpacing: I, textAlign: P, textShadow: C, id: R, role: W, "aria-level": E, "aria-label": f, dataAttributes: N } = param;
137
+ const { skinName: F } = m(), O = q(), _ = te(r), j = {
138
+ [x.colors.textPrimary]: x.colors.textPrimaryInverse,
139
+ [x.colors.textSecondary]: x.colors.textSecondaryInverse,
140
+ [x.colors.textLink]: x.colors.textLinkInverse,
141
+ [x.colors.textError]: x.colors.textErrorInverse
123
142
  };
124
- if (!l && l !== 0) return null;
125
- const j = K(G, b ? J : Q, {
126
- [U]: r,
127
- [X]: r === 1 || r === !0
128
- }), D = v({
129
- [p.mobileSize]: k ? c(k) : "inherit",
130
- [p.mobileLineHeight]: w ? c(w) : "inherit",
131
- [p.desktopSize]: H ? c(H) : "inherit",
132
- [p.desktopLineHeight]: z ? c(z) : "inherit"
133
- }), B = r ? v({
134
- [p.lineClamp]: String(O)
143
+ if (!h && h !== 0) return null;
144
+ const D = M(J, l ? Q : U, {
145
+ [X]: r,
146
+ [Y]: r === 1 || r === !0
147
+ }), B = y({
148
+ [c.mobileSize]: w ? u(w) : "inherit",
149
+ [c.mobileLineHeight]: L ? u(L) : "inherit",
150
+ [c.desktopSize]: H ? u(H) : "inherit",
151
+ [c.desktopLineHeight]: v ? u(v) : "inherit"
152
+ }), K = r ? y({
153
+ [c.lineClamp]: String(_)
135
154
  }) : {};
136
- var __t;
137
- return /*#__PURE__*/ u.createElement(S, _object_spread_props(_object_spread({
138
- className: j,
139
- id: C,
155
+ var _j_i;
156
+ return F === Z && ({ ariaLabel: f, children: h } = re({
157
+ children: h,
158
+ ariaLabel: f,
159
+ as: b
160
+ })), /*#__PURE__*/ T.createElement(b, _object_spread_props(_object_spread({
161
+ className: D,
162
+ id: R,
140
163
  role: W,
141
- "aria-level": R
142
- }, q(N, "Text")), {
143
- style: _object_spread_props(_object_spread({}, D, B), {
144
- hyphens: T,
145
- WebkitHyphens: T,
146
- letterSpacing: P,
147
- fontWeight: e ? $[e] : "inherit",
148
- textTransform: g || "inherit",
149
- textDecoration: i !== null && i !== void 0 ? i : "inherit",
150
- overflowWrap: b ? "anywhere" : "inherit",
151
- color: F ? (__t = _[t]) !== null && __t !== void 0 ? __t : t : t,
152
- textAlign: V,
153
- textShadow: y,
164
+ "aria-level": E,
165
+ "aria-label": f
166
+ }, G(N, "Text")), {
167
+ style: _object_spread_props(_object_spread({}, B, K), {
168
+ hyphens: S,
169
+ WebkitHyphens: S,
170
+ letterSpacing: I,
171
+ fontWeight: e ? ee[e] : "inherit",
172
+ textTransform: p || "inherit",
173
+ textDecoration: t !== null && t !== void 0 ? t : "inherit",
174
+ overflowWrap: l ? "anywhere" : "inherit",
175
+ color: O ? (_j_i = j[i]) !== null && _j_i !== void 0 ? _j_i : i : i,
176
+ textAlign: P,
177
+ textShadow: C,
154
178
  // When rendering as <pre/>, spaces are preserved and we don't want to remove them
155
- whiteSpace: S === "pre" ? void 0 : "pre-line"
179
+ whiteSpace: b === "pre" ? void 0 : "pre-line"
156
180
  })
157
- }), E === Y ? ie(l) : l);
158
- }, h = (e)=>{
181
+ }), h);
182
+ }, d = (e)=>{
159
183
  if (e.light) return "light";
160
184
  if (e.regular) return "regular";
161
185
  if (e.medium) return "medium";
162
186
  if (e.weight) return e.weight;
163
187
  }, s = (param)=>{
164
- let { forceMobileSizes: e, mobileSize: t, mobileLineHeight: i, desktopSize: r, desktopLineHeight: g } = param;
188
+ let { forceMobileSizes: e, mobileSize: i, mobileLineHeight: t, desktopSize: r, desktopLineHeight: p } = param;
165
189
  return e ? {
166
- size: t,
167
- lineHeight: i
190
+ size: i,
191
+ lineHeight: t
168
192
  } : {
169
- mobileSize: t,
170
- mobileLineHeight: i,
193
+ mobileSize: i,
194
+ mobileLineHeight: t,
171
195
  desktopSize: r,
172
- desktopLineHeight: g
196
+ desktopLineHeight: p
173
197
  };
174
- }, x = {
198
+ }, a = {
175
199
  text1: {
176
200
  mobileSize: 12,
177
201
  mobileLineHeight: "16px",
@@ -232,141 +256,141 @@ const $ = {
232
256
  desktopSize: 64,
233
257
  desktopLineHeight: "72px"
234
258
  }
235
- }, he = (_param)=>{
236
- var { dataAttributes: e, forceMobileSizes: t } = _param, i = _object_without_properties(_param, [
259
+ }, ge = (_param)=>{
260
+ var { dataAttributes: e, forceMobileSizes: i } = _param, t = _object_without_properties(_param, [
237
261
  "dataAttributes",
238
262
  "forceMobileSizes"
239
263
  ]);
240
264
  const { textPresets: r } = m();
241
265
  return /* @__PURE__ */ n(o, _object_spread(_object_spread_props(_object_spread({}, s(_object_spread({
242
- forceMobileSizes: t
243
- }, x.text10))), {
266
+ forceMobileSizes: i
267
+ }, a.text10))), {
244
268
  weight: r.text10.weight,
245
269
  dataAttributes: _object_spread({
246
270
  "component-name": "Text10"
247
271
  }, e)
248
- }), i));
249
- }, ge = (_param)=>{
250
- var { dataAttributes: e, forceMobileSizes: t } = _param, i = _object_without_properties(_param, [
272
+ }), t));
273
+ }, ue = (_param)=>{
274
+ var { dataAttributes: e, forceMobileSizes: i } = _param, t = _object_without_properties(_param, [
251
275
  "dataAttributes",
252
276
  "forceMobileSizes"
253
277
  ]);
254
278
  const { textPresets: r } = m();
255
279
  return /* @__PURE__ */ n(o, _object_spread(_object_spread_props(_object_spread({}, s(_object_spread({
256
- forceMobileSizes: t
257
- }, x.text9))), {
280
+ forceMobileSizes: i
281
+ }, a.text9))), {
258
282
  weight: r.text9.weight,
259
283
  dataAttributes: _object_spread({
260
284
  "component-name": "Text9"
261
285
  }, e)
262
- }), i));
263
- }, ue = (_param)=>{
264
- var { dataAttributes: e, forceMobileSizes: t } = _param, i = _object_without_properties(_param, [
286
+ }), t));
287
+ }, de = (_param)=>{
288
+ var { dataAttributes: e, forceMobileSizes: i } = _param, t = _object_without_properties(_param, [
265
289
  "dataAttributes",
266
290
  "forceMobileSizes"
267
291
  ]);
268
292
  const { textPresets: r } = m();
269
293
  return /* @__PURE__ */ n(o, _object_spread(_object_spread_props(_object_spread({}, s(_object_spread({
270
- forceMobileSizes: t
271
- }, x.text8))), {
294
+ forceMobileSizes: i
295
+ }, a.text8))), {
272
296
  weight: r.text8.weight,
273
297
  dataAttributes: _object_spread({
274
298
  "component-name": "Text8"
275
299
  }, e)
276
- }), i));
277
- }, de = (_param)=>{
278
- var { dataAttributes: e, forceMobileSizes: t } = _param, i = _object_without_properties(_param, [
300
+ }), t));
301
+ }, be = (_param)=>{
302
+ var { dataAttributes: e, forceMobileSizes: i } = _param, t = _object_without_properties(_param, [
279
303
  "dataAttributes",
280
304
  "forceMobileSizes"
281
305
  ]);
282
306
  const { textPresets: r } = m();
283
307
  return /* @__PURE__ */ n(o, _object_spread(_object_spread_props(_object_spread({}, s(_object_spread({
284
- forceMobileSizes: t
285
- }, x.text7))), {
308
+ forceMobileSizes: i
309
+ }, a.text7))), {
286
310
  weight: r.text7.weight,
287
311
  dataAttributes: _object_spread({
288
312
  "component-name": "Text7"
289
313
  }, e)
290
- }), i));
291
- }, be = (_param)=>{
292
- var { dataAttributes: e, forceMobileSizes: t } = _param, i = _object_without_properties(_param, [
314
+ }), t));
315
+ }, fe = (_param)=>{
316
+ var { dataAttributes: e, forceMobileSizes: i } = _param, t = _object_without_properties(_param, [
293
317
  "dataAttributes",
294
318
  "forceMobileSizes"
295
319
  ]);
296
320
  const { textPresets: r } = m();
297
321
  return /* @__PURE__ */ n(o, _object_spread(_object_spread_props(_object_spread({}, s(_object_spread({
298
- forceMobileSizes: t
299
- }, x.text6))), {
322
+ forceMobileSizes: i
323
+ }, a.text6))), {
300
324
  weight: r.text6.weight,
301
325
  dataAttributes: _object_spread({
302
326
  "component-name": "Text6"
303
327
  }, e)
304
- }), i));
328
+ }), t));
305
329
  }, Te = (_param)=>{
306
- var { dataAttributes: e, forceMobileSizes: t } = _param, i = _object_without_properties(_param, [
330
+ var { dataAttributes: e, forceMobileSizes: i } = _param, t = _object_without_properties(_param, [
307
331
  "dataAttributes",
308
332
  "forceMobileSizes"
309
333
  ]);
310
334
  const { textPresets: r } = m();
311
335
  return /* @__PURE__ */ n(o, _object_spread(_object_spread_props(_object_spread({}, s(_object_spread({
312
- forceMobileSizes: t
313
- }, x.text5))), {
336
+ forceMobileSizes: i
337
+ }, a.text5))), {
314
338
  weight: r.text5.weight,
315
339
  dataAttributes: _object_spread({
316
340
  "component-name": "Text5"
317
341
  }, e)
318
- }), i));
342
+ }), t));
319
343
  }, Se = (_param)=>{
320
- var { dataAttributes: e, forceMobileSizes: t } = _param, i = _object_without_properties(_param, [
344
+ var { dataAttributes: e, forceMobileSizes: i } = _param, t = _object_without_properties(_param, [
321
345
  "dataAttributes",
322
346
  "forceMobileSizes"
323
347
  ]);
324
348
  return /* @__PURE__ */ n(o, _object_spread(_object_spread_props(_object_spread({}, s(_object_spread({
325
- forceMobileSizes: t
326
- }, x.text4))), {
327
- weight: h(i),
349
+ forceMobileSizes: i
350
+ }, a.text4))), {
351
+ weight: d(t),
328
352
  dataAttributes: _object_spread({
329
353
  "component-name": "Text4"
330
354
  }, e)
331
- }), i));
332
- }, fe = (_param)=>{
333
- var { dataAttributes: e, forceMobileSizes: t } = _param, i = _object_without_properties(_param, [
355
+ }), t));
356
+ }, ke = (_param)=>{
357
+ var { dataAttributes: e, forceMobileSizes: i } = _param, t = _object_without_properties(_param, [
334
358
  "dataAttributes",
335
359
  "forceMobileSizes"
336
360
  ]);
337
361
  return /* @__PURE__ */ n(o, _object_spread(_object_spread_props(_object_spread({}, s(_object_spread({
338
- forceMobileSizes: t
339
- }, x.text3))), {
340
- weight: h(i),
362
+ forceMobileSizes: i
363
+ }, a.text3))), {
364
+ weight: d(t),
341
365
  dataAttributes: _object_spread({
342
366
  "component-name": "Text3"
343
367
  }, e)
344
- }), i));
345
- }, ke = (_param)=>{
346
- var { dataAttributes: e, forceMobileSizes: t } = _param, i = _object_without_properties(_param, [
368
+ }), t));
369
+ }, we = (_param)=>{
370
+ var { dataAttributes: e, forceMobileSizes: i } = _param, t = _object_without_properties(_param, [
347
371
  "dataAttributes",
348
372
  "forceMobileSizes"
349
373
  ]);
350
374
  return /* @__PURE__ */ n(o, _object_spread(_object_spread_props(_object_spread({}, s(_object_spread({
351
- forceMobileSizes: t
352
- }, x.text2))), {
353
- weight: h(i),
375
+ forceMobileSizes: i
376
+ }, a.text2))), {
377
+ weight: d(t),
354
378
  dataAttributes: _object_spread({
355
379
  "component-name": "Text2"
356
380
  }, e)
357
- }), i));
381
+ }), t));
358
382
  }, He = (_param)=>{
359
- var { dataAttributes: e, forceMobileSizes: t } = _param, i = _object_without_properties(_param, [
383
+ var { dataAttributes: e, forceMobileSizes: i } = _param, t = _object_without_properties(_param, [
360
384
  "dataAttributes",
361
385
  "forceMobileSizes"
362
386
  ]);
363
387
  return /* @__PURE__ */ n(o, _object_spread(_object_spread_props(_object_spread({}, s(_object_spread({
364
- forceMobileSizes: t
365
- }, x.text1))), {
366
- weight: h(i),
388
+ forceMobileSizes: i
389
+ }, a.text1))), {
390
+ weight: d(t),
367
391
  dataAttributes: _object_spread({
368
392
  "component-name": "Text1"
369
393
  }, e)
370
- }), i));
371
- }, Le = o;
372
- export { o as Text, He as Text1, he as Text10, ke as Text2, fe as Text3, Se as Text4, Te as Text5, be as Text6, de as Text7, ue as Text8, ge as Text9, Le as default, $ as mapToWeight, x as textProps };
394
+ }), t));
395
+ }, ze = o;
396
+ export { o as Text, He as Text1, ge as Text10, we as Text2, ke as Text3, Se as Text4, Te as Text5, fe as Text6, be as Text7, de as Text8, ue as Text9, ze as default, ee as mapToWeight, a as textProps };