@telefonica/mistica 16.5.0 → 16.6.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/callout.js +27 -15
  3. package/dist/card.css-mistica.js +5 -5
  4. package/dist/card.d.ts +9 -1
  5. package/dist/card.js +611 -475
  6. package/dist/community/advanced-data-card.css-mistica.js +14 -11
  7. package/dist/community/advanced-data-card.css.d.ts +1 -0
  8. package/dist/community/advanced-data-card.d.ts +1 -1
  9. package/dist/community/advanced-data-card.js +172 -85
  10. package/dist/cover-hero.css-mistica.js +14 -11
  11. package/dist/cover-hero.css.d.ts +1 -0
  12. package/dist/cover-hero.d.ts +1 -0
  13. package/dist/cover-hero.js +101 -59
  14. package/dist/empty-state.js +24 -15
  15. package/dist/header.css-mistica.js +6 -3
  16. package/dist/header.css.d.ts +1 -0
  17. package/dist/header.d.ts +3 -2
  18. package/dist/header.js +148 -79
  19. package/dist/hero.css-mistica.js +11 -8
  20. package/dist/hero.css.d.ts +1 -0
  21. package/dist/hero.d.ts +2 -1
  22. package/dist/hero.js +102 -68
  23. package/dist/highlighted-card.js +32 -23
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.js +4 -0
  26. package/dist/maybe-dismissable.js +8 -5
  27. package/dist/meter.d.ts +23 -0
  28. package/dist/meter.js +400 -0
  29. package/dist/package-version.js +1 -1
  30. package/dist/sheet-common.css-mistica.js +16 -10
  31. package/dist/sheet-common.css.d.ts +3 -1
  32. package/dist/sheet-common.js +78 -70
  33. package/dist/sheet-info.css-mistica.js +15 -4
  34. package/dist/sheet-info.css.d.ts +2 -0
  35. package/dist/sheet-info.d.ts +3 -0
  36. package/dist/sheet-info.js +61 -43
  37. package/dist/sheet-native.js +59 -48
  38. package/dist/sheet-types.d.ts +6 -1
  39. package/dist/sheet-web.js +6 -4
  40. package/dist/text-tokens.d.ts +10 -0
  41. package/dist/text-tokens.js +54 -38
  42. package/dist/theme-context-provider.js +60 -50
  43. package/dist/theme.d.ts +3 -2
  44. package/dist/utils/headings.d.ts +2 -0
  45. package/dist/utils/headings.js +11 -0
  46. package/dist/utils/types.d.ts +1 -0
  47. package/dist-es/callout.js +55 -43
  48. package/dist-es/card.css-mistica.js +2 -2
  49. package/dist-es/card.js +721 -588
  50. package/dist-es/community/advanced-data-card.css-mistica.js +3 -3
  51. package/dist-es/community/advanced-data-card.js +217 -130
  52. package/dist-es/cover-hero.css-mistica.js +3 -3
  53. package/dist-es/cover-hero.js +132 -90
  54. package/dist-es/empty-state.js +40 -31
  55. package/dist-es/header.css-mistica.js +2 -2
  56. package/dist-es/header.js +174 -104
  57. package/dist-es/hero.css-mistica.js +2 -2
  58. package/dist-es/hero.js +150 -115
  59. package/dist-es/highlighted-card.js +36 -27
  60. package/dist-es/index.js +1839 -1838
  61. package/dist-es/maybe-dismissable.js +17 -14
  62. package/dist-es/meter.js +346 -0
  63. package/dist-es/package-version.js +1 -1
  64. package/dist-es/sheet-common.css-mistica.js +2 -2
  65. package/dist-es/sheet-common.js +124 -116
  66. package/dist-es/sheet-info.css-mistica.js +2 -2
  67. package/dist-es/sheet-info.js +74 -56
  68. package/dist-es/sheet-native.js +59 -48
  69. package/dist-es/sheet-web.js +10 -8
  70. package/dist-es/style.css +1 -1
  71. package/dist-es/text-tokens.js +30 -20
  72. package/dist-es/theme-context-provider.js +88 -78
  73. package/dist-es/utils/headings.js +2 -0
  74. package/package.json +2 -1
@@ -77,31 +77,33 @@ function _object_without_properties_loose(source, excluded) {
77
77
  }
78
78
  return target;
79
79
  }
80
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
81
- import * as z from "react";
82
- import D from "./responsive-layout.js";
83
- import v from "./box.js";
84
- import I from "./button-group.js";
85
- import s from "./stack.js";
86
- import { Text3 as g, Text8 as q } from "./text.js";
80
+ import { jsxs as r, jsx as t, Fragment as H } from "react/jsx-runtime";
81
+ import * as J from "react";
82
+ import K from "./responsive-layout.js";
83
+ import N from "./box.js";
84
+ import O from "./button-group.js";
85
+ import S from "./stack.js";
86
+ import { Text3 as A, Text8 as Q } from "./text.js";
87
87
  import { vars as n } from "./skins/skin-contract.css-mistica.js";
88
- import { mainContent as F, sixColumns as x, coverHeroContainer as J, minHeight as K, withAspectRatio as O, coverHero as Q, centered as U, hasSideExtra as W, sideExtra as X, vars as Y } from "./cover-hero.css-mistica.js";
89
- import k from "classnames";
90
- import { applyCssVars as Z } from "./utils/css.js";
91
- import { vars as _ } from "./image.css-mistica.js";
92
- import C from "./grid-layout.js";
93
- import { CoverHeroMedia as E } from "./cover-hero-media.js";
94
- import { getPrefixedDataAttributes as P } from "./utils/dom.js";
95
- const $ = (e)=>!e || e === "auto" ? 0 : typeof e == "number" ? e : ({
88
+ import { mainContent as U, flexColumn as W, sixColumns as u, coverHeroContainer as X, minHeight as Y, withAspectRatio as Z, coverHero as _, centered as E, hasSideExtra as P, sideExtra as $, vars as tt } from "./cover-hero.css-mistica.js";
89
+ import w from "classnames";
90
+ import { applyCssVars as et } from "./utils/css.js";
91
+ import { vars as rt } from "./image.css-mistica.js";
92
+ import T from "./grid-layout.js";
93
+ import { CoverHeroMedia as ot } from "./cover-hero-media.js";
94
+ import { getPrefixedDataAttributes as it } from "./utils/dom.js";
95
+ import { isBiggerHeading as at } from "./utils/headings.js";
96
+ const nt = (e)=>!e || e === "auto" ? 0 : typeof e == "number" ? e : ({
96
97
  "1:1": 1,
97
98
  "16:9": 16 / 9,
98
99
  "7:10": 7 / 10,
99
100
  "4:3": 9 / 10
100
- })[e], rr = /*#__PURE__*/ z.forwardRef((_param, R)=>{
101
- var { headline: e, pretitle: d, pretitleLinesMax: H, title: y, titleLinesMax: B, titleAs: N = "h1", description: u, descriptionLinesMax: S, extra: w, sideExtra: o, button: A, secondaryButton: T, buttonLink: j, minHeight: G, aspectRatio: c = "auto", variant: p, centered: t, noPaddingY: f, dataAttributes: L, "aria-label": M } = _param, l = _object_without_properties(_param, [
101
+ })[e], dt = /*#__PURE__*/ J.forwardRef((_param, I)=>{
102
+ var { headline: e, pretitle: p, pretitleLinesMax: j, pretitleAs: h, title: d, titleLinesMax: G, titleAs: f = "h1", description: v, descriptionLinesMax: L, extra: b, sideExtra: o, button: M, secondaryButton: R, buttonLink: V, minHeight: z, aspectRatio: c = "auto", variant: g, centered: i, noPaddingY: x, dataAttributes: D, "aria-label": F } = _param, s = _object_without_properties(_param, [
102
103
  "headline",
103
104
  "pretitle",
104
105
  "pretitleLinesMax",
106
+ "pretitleAs",
105
107
  "title",
106
108
  "titleLinesMax",
107
109
  "titleAs",
@@ -120,115 +122,155 @@ const $ = (e)=>!e || e === "auto" ? 0 : typeof e == "number" ? e : ({
120
122
  "dataAttributes",
121
123
  "aria-label"
122
124
  ]);
123
- const a = l.backgroundVideo || l.backgroundImage, V = a ? "none" : l.background || ({
125
+ const a = s.backgroundVideo || s.backgroundImage, q = a ? "none" : s.background || ({
124
126
  default: n.colors.background,
125
127
  inverse: n.colors.backgroundBrand,
126
128
  alternative: n.colors.backgroundAlternative,
127
129
  media: "none"
128
- })[p !== null && p !== void 0 ? p : "default"], m = a ? "0 0 15px rgba(0, 0, 0, 0.4)" : void 0, h = /* @__PURE__ */ i("div", {
129
- className: F,
130
+ })[g !== null && g !== void 0 ? g : "default"], m = a ? "0 0 15px rgba(0, 0, 0, 0.4)" : void 0, l = p ? /* @__PURE__ */ t(A, {
131
+ regular: !0,
132
+ as: h,
133
+ truncate: j,
134
+ textShadow: m,
135
+ dataAttributes: {
136
+ testid: "pretitle"
137
+ },
138
+ children: p
139
+ }) : void 0, k = d ? /* @__PURE__ */ t(Q, {
140
+ as: f,
141
+ truncate: G,
142
+ textShadow: m,
143
+ dataAttributes: {
144
+ testid: "title"
145
+ },
146
+ children: d
147
+ }) : void 0, C = e ? /* @__PURE__ */ t("div", {
148
+ style: {
149
+ order: -1
150
+ },
151
+ children: /* @__PURE__ */ t(N, {
152
+ dataAttributes: {
153
+ testid: "headline"
154
+ },
155
+ paddingBottom: {
156
+ desktop: 8,
157
+ tablet: 8,
158
+ mobile: 16
159
+ },
160
+ children: e
161
+ })
162
+ }) : void 0, y = /* @__PURE__ */ r("div", {
163
+ className: U,
130
164
  children: [
131
- e && /* @__PURE__ */ r(v, {
132
- paddingBottom: {
133
- desktop: 8,
134
- tablet: 8,
135
- mobile: 16
136
- },
137
- children: e
138
- }),
139
- /* @__PURE__ */ i(s, {
165
+ /* @__PURE__ */ r(S, {
140
166
  space: 16,
141
167
  children: [
142
- /* @__PURE__ */ i(s, {
143
- space: 8,
144
- children: [
145
- d && /* @__PURE__ */ r("div", {
146
- className: x,
147
- children: /* @__PURE__ */ r(g, {
148
- regular: !0,
149
- truncate: H,
150
- textShadow: m,
151
- children: d
168
+ /* @__PURE__ */ t("div", {
169
+ className: W,
170
+ children: at(f, h) ? /* @__PURE__ */ r(H, {
171
+ children: [
172
+ k,
173
+ C,
174
+ l && /* @__PURE__ */ t("div", {
175
+ className: u,
176
+ style: {
177
+ paddingBottom: d ? 8 : 0,
178
+ order: -1
179
+ },
180
+ children: l
152
181
  })
153
- }),
154
- /* @__PURE__ */ r(q, {
155
- as: N,
156
- truncate: B,
157
- textShadow: m,
158
- children: y
159
- })
160
- ]
182
+ ]
183
+ }) : /* @__PURE__ */ r(H, {
184
+ children: [
185
+ l && /* @__PURE__ */ t("div", {
186
+ className: u,
187
+ style: {
188
+ paddingBottom: d ? 8 : 0
189
+ },
190
+ children: l
191
+ }),
192
+ C,
193
+ k
194
+ ]
195
+ })
161
196
  }),
162
- u && /* @__PURE__ */ r("div", {
163
- className: x,
164
- children: /* @__PURE__ */ r(g, {
197
+ v && /* @__PURE__ */ t("div", {
198
+ className: u,
199
+ children: /* @__PURE__ */ t(A, {
165
200
  as: "p",
166
201
  regular: !0,
167
- truncate: S,
202
+ truncate: L,
168
203
  color: a ? n.colors.textPrimary : n.colors.textSecondary,
169
204
  textShadow: m,
170
- children: u
205
+ dataAttributes: {
206
+ testid: "description"
207
+ },
208
+ children: v
171
209
  })
172
210
  })
173
211
  ]
174
212
  }),
175
- w
213
+ b && /* @__PURE__ */ t("div", {
214
+ "data-testid": "slot",
215
+ children: b
216
+ })
176
217
  ]
177
- }), b = c && c !== "auto";
178
- return /* @__PURE__ */ r("section", _object_spread_props(_object_spread({}, P(L, "CoverHero")), {
179
- "aria-label": M,
180
- ref: R,
181
- className: k(J, {
182
- [K]: !f,
183
- [O]: b
218
+ }), B = c && c !== "auto";
219
+ return /* @__PURE__ */ t("section", _object_spread_props(_object_spread({}, it(D, "CoverHero")), {
220
+ "aria-label": F,
221
+ ref: I,
222
+ className: w(X, {
223
+ [Y]: !x,
224
+ [Z]: B
184
225
  }),
185
226
  style: _object_spread({
186
- minHeight: b ? "auto" : G,
227
+ minHeight: B ? "auto" : z,
187
228
  boxSizing: "border-box",
188
- background: V
189
- }, Z({
190
- [Y.aspectRatio]: String($(c)),
191
- [_.mediaBorderRadius]: "0px"
229
+ background: q
230
+ }, et({
231
+ [tt.aspectRatio]: String(nt(c)),
232
+ [rt.mediaBorderRadius]: "0px"
192
233
  })),
193
- children: /* @__PURE__ */ i("div", {
194
- className: k(Q, {
195
- [U]: t,
196
- [W]: o
234
+ children: /* @__PURE__ */ r("div", {
235
+ className: w(_, {
236
+ [E]: i,
237
+ [P]: o
197
238
  }),
198
239
  children: [
199
- a ? /* @__PURE__ */ r(E, _object_spread({}, l)) : null,
200
- /* @__PURE__ */ r(D, {
201
- variant: a ? "media" : p,
202
- children: /* @__PURE__ */ r(v, {
203
- paddingY: f ? 0 : {
240
+ a ? /* @__PURE__ */ t(ot, _object_spread({}, s)) : null,
241
+ /* @__PURE__ */ t(K, {
242
+ variant: a ? "media" : g,
243
+ children: /* @__PURE__ */ t(N, {
244
+ paddingY: x ? 0 : {
204
245
  desktop: 56,
205
246
  tablet: 56,
206
247
  mobile: 24
207
248
  },
208
- children: /* @__PURE__ */ i(s, {
249
+ children: /* @__PURE__ */ r(S, {
209
250
  space: 24,
210
251
  children: [
211
- t && !o ? /* @__PURE__ */ r(C, {
252
+ i && !o ? /* @__PURE__ */ t(T, {
212
253
  template: "8",
213
- children: h
214
- }) : /* @__PURE__ */ r(C, {
254
+ children: y
255
+ }) : /* @__PURE__ */ t(T, {
215
256
  template: "8+4",
216
257
  collapseBreakpoint: "mobile",
217
- left: h,
218
- right: /* @__PURE__ */ r("div", {
219
- className: X,
258
+ left: y,
259
+ right: /* @__PURE__ */ t("div", {
260
+ className: $,
261
+ "data-testid": "sideSlot",
220
262
  children: o
221
263
  })
222
264
  }),
223
- /* @__PURE__ */ r(I, {
265
+ /* @__PURE__ */ t(O, {
224
266
  align: {
225
- mobile: t ? "center" : "left",
226
- tablet: t && !o ? "center" : "left",
227
- desktop: t && !o ? "center" : "left"
267
+ mobile: i ? "center" : "left",
268
+ tablet: i && !o ? "center" : "left",
269
+ desktop: i && !o ? "center" : "left"
228
270
  },
229
- primaryButton: A,
230
- secondaryButton: T,
231
- link: j
271
+ primaryButton: M,
272
+ secondaryButton: R,
273
+ link: V
232
274
  })
233
275
  ]
234
276
  })
@@ -237,5 +279,5 @@ const $ = (e)=>!e || e === "auto" ? 0 : typeof e == "number" ? e : ({
237
279
  ]
238
280
  })
239
281
  }));
240
- }), hr = rr;
241
- export { hr as default };
282
+ }), Bt = dt;
283
+ export { Bt as default };
@@ -51,86 +51,95 @@ function _object_spread_props(target, source) {
51
51
  }
52
52
  return target;
53
53
  }
54
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
54
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
55
55
  import x from "classnames";
56
56
  import { useIsInverseOrMediaVariant as k } from "./theme-variant-context.js";
57
57
  import { ButtonPrimary as B } from "./button.js";
58
58
  import { useTheme as C } from "./hooks.js";
59
59
  import n from "./stack.js";
60
60
  import { Text6 as I, Text3 as N } from "./text.js";
61
- import S from "./button-group.js";
62
- import { container as b, inverseBorder as E, border as T, vars as V, contentVariants as c, assetContainer as $, largeImageContainer as j, largeImage as A, smallImage as D } from "./empty-state.css-mistica.js";
63
- import { vars as a } from "./skins/skin-contract.css-mistica.js";
61
+ import b from "./button-group.js";
62
+ import { container as S, inverseBorder as A, border as E, vars as T, contentVariants as c, assetContainer as V, largeImageContainer as $, largeImage as j, smallImage as D } from "./empty-state.css-mistica.js";
63
+ import { vars as t } from "./skins/skin-contract.css-mistica.js";
64
64
  import { AspectRatioContainer as M } from "./utils/aspect-ratio-support.js";
65
65
  import { getPrefixedDataAttributes as P } from "./utils/dom.js";
66
66
  import { applyCssVars as R } from "./utils/css.js";
67
67
  const w = (param)=>{
68
- let { title: l, titleAs: d = "h1", description: p, button: e, buttonLink: f, largeImageUrl: o, imageUrl: i, asset: m, "aria-label": h, dataAttributes: v } = param;
69
- const { isDarkMode: g } = C(), t = k(), u = i ? /* @__PURE__ */ r("img", {
68
+ let { title: l, titleAs: d = "h1", description: p, button: r, buttonLink: f, largeImageUrl: a, imageUrl: o, asset: m, "aria-label": g, dataAttributes: u } = param;
69
+ const { isDarkMode: h } = C(), s = k(), v = o ? /* @__PURE__ */ e("img", {
70
+ "data-testid": "image",
70
71
  className: D,
71
72
  alt: "",
72
- src: i
73
- }) : void 0, y = _object_spread_props(_object_spread({}, (e == null ? void 0 : e.type) === B ? {
74
- primaryButton: e
73
+ src: o
74
+ }) : void 0, y = _object_spread_props(_object_spread({}, (r == null ? void 0 : r.type) === B ? {
75
+ primaryButton: r
75
76
  } : {
76
- secondaryButton: e
77
+ secondaryButton: r
77
78
  }), {
78
79
  link: f
79
80
  });
80
- return /* @__PURE__ */ s("div", _object_spread_props(_object_spread({
81
- className: x(b, t ? E : T),
81
+ return /* @__PURE__ */ i("div", _object_spread_props(_object_spread({
82
+ className: x(S, s ? A : E),
82
83
  style: R({
83
- [V.backgroundColor]: t && !g ? a.colors.backgroundBrand : a.colors.backgroundContainer
84
+ [T.backgroundColor]: s && !h ? t.colors.backgroundBrand : t.colors.backgroundContainer
84
85
  }),
85
- "aria-label": h,
86
+ "aria-label": g,
86
87
  role: "region"
87
- }, P(v, "EmptyState")), {
88
+ }, P(u, "EmptyState")), {
88
89
  children: [
89
- /* @__PURE__ */ r("div", {
90
+ /* @__PURE__ */ e("div", {
90
91
  style: {
91
92
  flex: 1
92
93
  },
93
- children: /* @__PURE__ */ s(n, {
94
+ children: /* @__PURE__ */ i(n, {
94
95
  space: 24,
95
- className: o ? c.largeImage : c.default,
96
+ className: a ? c.largeImage : c.default,
96
97
  children: [
97
- u !== null && u !== void 0 ? u : m && /* @__PURE__ */ r("div", {
98
- className: $,
98
+ v !== null && v !== void 0 ? v : m && /* @__PURE__ */ e("div", {
99
+ "data-testid": "asset",
100
+ className: V,
99
101
  children: m
100
102
  }),
101
- /* @__PURE__ */ s(n, {
103
+ /* @__PURE__ */ i(n, {
102
104
  space: 16,
103
105
  children: [
104
- /* @__PURE__ */ r(I, {
106
+ /* @__PURE__ */ e(I, {
105
107
  as: d,
108
+ dataAttributes: {
109
+ testid: "title"
110
+ },
106
111
  children: l
107
112
  }),
108
- /* @__PURE__ */ r(N, {
113
+ /* @__PURE__ */ e(N, {
109
114
  regular: !0,
110
115
  as: "p",
111
- color: t ? a.colors.inverse : a.colors.textSecondary,
116
+ color: s ? t.colors.inverse : t.colors.textSecondary,
117
+ dataAttributes: {
118
+ testid: "description"
119
+ },
112
120
  children: p
113
121
  })
114
122
  ]
115
123
  }),
116
- /* @__PURE__ */ r(S, _object_spread({}, y))
124
+ /* @__PURE__ */ e(b, _object_spread({}, y))
117
125
  ]
118
126
  })
119
127
  }),
120
- /* @__PURE__ */ r("div", {
128
+ /* @__PURE__ */ e("div", {
121
129
  style: {
122
130
  flex: 1,
123
131
  position: "relative"
124
132
  },
125
- children: o && /* @__PURE__ */ r(M, {
133
+ children: a && /* @__PURE__ */ e(M, {
126
134
  aspectRatio: 16 / 9,
127
- className: j,
135
+ className: $,
128
136
  height: "100%",
129
137
  width: "100%",
130
- children: /* @__PURE__ */ r("div", {
131
- className: A,
138
+ children: /* @__PURE__ */ e("div", {
139
+ "data-testid": "image",
140
+ className: j,
132
141
  style: {
133
- backgroundImage: `url(${o})`
142
+ backgroundImage: `url(${a})`
134
143
  }
135
144
  })
136
145
  })
@@ -1,4 +1,4 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./header.css.ts.vanilla.css-mistica.js";
3
- var t = "mtk7e90 _1y2v1nf9g", m = "mtk7e93", a = "mtk7e90";
4
- export { t as breadcrumbs, m as hideOnDesktop, a as hideOnTabletOrSmaller };
3
+ var m = "mtk7e90 _1y2v1nf9g", t = "_1y2v1nfho _1y2v1nfhu", a = "mtk7e93", v = "mtk7e90";
4
+ export { m as breadcrumbs, t as flexColumn, a as hideOnDesktop, v as hideOnTabletOrSmaller };