@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
package/dist-es/header.js CHANGED
@@ -78,164 +78,234 @@ function _object_without_properties_loose(source, excluded) {
78
78
  }
79
79
  return target;
80
80
  }
81
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
81
+ import { jsx as t, jsxs as n, Fragment as k } from "react/jsx-runtime";
82
82
  import u from "./box.js";
83
- import p from "./stack.js";
84
- import g from "./responsive-layout.js";
85
- import k from "./grid-layout.js";
86
- import { useSetOverscrollColor as T } from "./overscroll-color-context.js";
87
- import { Text2 as y, Text3 as f, Text7 as B, Text6 as H } from "./text.js";
88
- import { vars as a } from "./skins/skin-contract.css-mistica.js";
89
- import { hideOnTabletOrSmaller as L, hideOnDesktop as S, breadcrumbs as v } from "./header.css-mistica.js";
90
- import { getPrefixedDataAttributes as C } from "./utils/dom.js";
91
- import { Title3 as R, Title4 as M } from "./title.js";
92
- const P = (param)=>{
93
- let { headline: r, pretitle: e, pretitleAs: t, title: l, titleAs: c = "h2", description: d, dataAttributes: h, small: i = !1 } = param;
94
- return /* @__PURE__ */ o(p, {
83
+ import h from "./stack.js";
84
+ import f from "./responsive-layout.js";
85
+ import T from "./grid-layout.js";
86
+ import { useSetOverscrollColor as x } from "./overscroll-color-context.js";
87
+ import { Text2 as A, Text3 as g, Text7 as C, Text6 as S } from "./text.js";
88
+ import { vars as s } from "./skins/skin-contract.css-mistica.js";
89
+ import { flexColumn as L, hideOnTabletOrSmaller as M, hideOnDesktop as N, breadcrumbs as P } from "./header.css-mistica.js";
90
+ import { getPrefixedDataAttributes as j } from "./utils/dom.js";
91
+ import { Title3 as O, Title4 as R } from "./title.js";
92
+ import { isBiggerHeading as F } from "./utils/headings.js";
93
+ const Z = (param)=>{
94
+ let { headline: o, pretitle: e, pretitleAs: r, title: d, titleAs: a = "h2", description: i, dataAttributes: b, small: c = !1 } = param;
95
+ const l = (()=>{
96
+ if (!e) return null;
97
+ const y = {
98
+ regular: !0,
99
+ color: s.colors.textPrimary,
100
+ as: r,
101
+ dataAttributes: {
102
+ testid: "pretitle"
103
+ }
104
+ };
105
+ if (typeof e == "string") return /* @__PURE__ */ t(g, _object_spread_props(_object_spread({}, y), {
106
+ children: e
107
+ }));
108
+ const { text: B } = e, H = _object_without_properties(e, [
109
+ "text"
110
+ ]);
111
+ return /* @__PURE__ */ t(g, _object_spread_props(_object_spread({}, y, H), {
112
+ children: B
113
+ }));
114
+ })(), p = d ? c ? /* @__PURE__ */ t(O, {
115
+ as: a,
116
+ dataAttributes: {
117
+ testid: "title"
118
+ },
119
+ children: d
120
+ }) : /* @__PURE__ */ t(R, {
121
+ as: a,
122
+ dataAttributes: {
123
+ testid: "title"
124
+ },
125
+ children: d
126
+ }) : void 0, v = o ? // assuming that the headline will always be followed by one of: pretitle, title, description
127
+ /* @__PURE__ */ t("div", {
128
+ style: {
129
+ paddingBottom: 8,
130
+ order: -1
131
+ },
132
+ "data-testid": "headline",
133
+ children: o
134
+ }) : void 0;
135
+ return /* @__PURE__ */ t(h, {
95
136
  space: {
96
137
  mobile: 24,
97
138
  desktop: 32
98
139
  },
99
- dataAttributes: h,
100
- children: (l || e || d) && /* @__PURE__ */ o(u, {
140
+ dataAttributes: _object_spread({
141
+ testid: "Header"
142
+ }, b),
143
+ children: (d || e || i) && /* @__PURE__ */ t(u, {
101
144
  paddingRight: 16,
102
- children: /* @__PURE__ */ s(p, {
103
- space: 8,
145
+ children: /* @__PURE__ */ n("div", {
146
+ className: L,
104
147
  children: [
105
- r,
106
- e && ((n, b)=>{
107
- if (typeof n == "string") return /* @__PURE__ */ o(f, _object_spread_props(_object_spread({
108
- regular: !0
109
- }, b), {
110
- children: n
111
- }));
112
- const { text: N } = n, x = _object_without_properties(n, [
113
- "text"
114
- ]);
115
- return /* @__PURE__ */ o(f, _object_spread_props(_object_spread({
116
- regular: !0
117
- }, b, x), {
118
- children: n.text
119
- }));
120
- })(e, {
121
- color: a.colors.textPrimary,
122
- as: t
148
+ F(a, r) ? /* @__PURE__ */ n(k, {
149
+ children: [
150
+ p && /* @__PURE__ */ t("div", {
151
+ style: {
152
+ paddingBottom: i ? 8 : 0
153
+ },
154
+ children: p
155
+ }),
156
+ v,
157
+ l && /* @__PURE__ */ t("div", {
158
+ style: {
159
+ paddingBottom: e || i ? 8 : 0,
160
+ order: -1
161
+ },
162
+ children: l
163
+ })
164
+ ]
165
+ }) : /* @__PURE__ */ n(k, {
166
+ children: [
167
+ l && /* @__PURE__ */ t("div", {
168
+ style: {
169
+ paddingBottom: d || i ? 8 : 0
170
+ },
171
+ children: l
172
+ }),
173
+ v,
174
+ p && /* @__PURE__ */ t("div", {
175
+ style: {
176
+ paddingBottom: i ? 8 : 0
177
+ },
178
+ children: p
179
+ })
180
+ ]
123
181
  }),
124
- l && (i ? /* @__PURE__ */ o(R, {
125
- as: c,
126
- children: l
127
- }) : /* @__PURE__ */ o(M, {
128
- as: c,
129
- children: l
130
- })),
131
- d && (i ? /* @__PURE__ */ o(y, {
132
- regular: !0,
133
- color: a.colors.textSecondary,
134
- children: d
135
- }) : /* @__PURE__ */ o(f, {
136
- regular: !0,
137
- color: a.colors.textSecondary,
138
- children: d
139
- }))
182
+ i && /* @__PURE__ */ t("div", {
183
+ style: {
184
+ order: 1
185
+ },
186
+ children: c ? /* @__PURE__ */ t(A, {
187
+ regular: !0,
188
+ color: s.colors.textSecondary,
189
+ dataAttributes: {
190
+ testid: "description"
191
+ },
192
+ children: i
193
+ }) : /* @__PURE__ */ t(g, {
194
+ regular: !0,
195
+ color: s.colors.textSecondary,
196
+ dataAttributes: {
197
+ testid: "description"
198
+ },
199
+ children: i
200
+ })
201
+ })
140
202
  ]
141
203
  })
142
204
  })
143
205
  });
144
- }, Q = (param)=>{
145
- let { title: r, titleAs: e = "h1", description: t, button: l } = param;
146
- return /* @__PURE__ */ s(p, {
206
+ }, _ = (param)=>{
207
+ let { title: o, titleAs: e = "h1", description: r, button: d, dataAttributes: a } = param;
208
+ return /* @__PURE__ */ n(h, {
147
209
  space: 32,
210
+ dataAttributes: _object_spread({
211
+ testid: "MainSectionHeader"
212
+ }, a),
148
213
  children: [
149
- /* @__PURE__ */ s(p, {
214
+ /* @__PURE__ */ n(h, {
150
215
  space: {
151
216
  mobile: 12,
152
217
  desktop: 16
153
218
  },
154
219
  children: [
155
- r && /* @__PURE__ */ o(B, {
220
+ o && /* @__PURE__ */ t(C, {
156
221
  as: e,
157
- children: r
222
+ dataAttributes: {
223
+ testid: "title"
224
+ },
225
+ children: o
158
226
  }),
159
- t && /* @__PURE__ */ o(H, {
160
- children: t
227
+ r && /* @__PURE__ */ t(S, {
228
+ dataAttributes: {
229
+ testid: "description"
230
+ },
231
+ children: r
161
232
  })
162
233
  ]
163
234
  }),
164
- l
235
+ d
165
236
  ]
166
237
  });
167
- }, U = (param)=>{
168
- let { isInverse: r = !1, breadcrumbs: e, header: t, extra: l, sideBySideExtraOnDesktop: c = !1, dataAttributes: d, bleed: h = !1, noPaddingY: i = !1 } = param;
169
- const m = h && r && l, n = /* @__PURE__ */ s("div", {
238
+ }, $ = (param)=>{
239
+ let { isInverse: o = !1, breadcrumbs: e, header: r, extra: d, sideBySideExtraOnDesktop: a = !1, dataAttributes: i, bleed: b = !1, noPaddingY: c = !1 } = param;
240
+ const m = b && o && d, l = /* @__PURE__ */ n("div", {
170
241
  children: [
171
- e && /* @__PURE__ */ o("div", {
172
- className: v,
242
+ e && /* @__PURE__ */ t("div", {
243
+ className: P,
173
244
  children: e
174
245
  }),
175
- t
246
+ r
176
247
  ]
177
248
  });
178
- return T(r ? {
179
- topColor: a.colors.backgroundBrandTop
180
- } : {}), /* @__PURE__ */ s("div", _object_spread_props(_object_spread({}, C(_object_spread({
181
- "component-name": "HeaderLayout"
182
- }, d))), {
249
+ return x(o ? {
250
+ topColor: s.colors.backgroundBrandTop
251
+ } : {}), /* @__PURE__ */ n("div", _object_spread_props(_object_spread({}, j(i, "HeaderLayout")), {
183
252
  children: [
184
- /* @__PURE__ */ o(g, {
185
- isInverse: r,
186
- children: /* @__PURE__ */ o(u, {
187
- paddingTop: i ? 0 : {
188
- mobile: t ? 32 : 0,
253
+ /* @__PURE__ */ t(f, {
254
+ variant: o ? "inverse" : void 0,
255
+ children: /* @__PURE__ */ t(u, {
256
+ paddingTop: c ? 0 : {
257
+ mobile: r ? 32 : 0,
189
258
  desktop: e ? 16 : 48
190
259
  },
191
260
  paddingBottom: {
192
- mobile: i && !m ? 0 : 24,
193
- desktop: m && !c ? 32 : i ? 0 : 48
261
+ mobile: c && !m ? 0 : 24,
262
+ desktop: m && !a ? 32 : c ? 0 : 48
194
263
  },
195
- children: c ? /* @__PURE__ */ o(k, {
264
+ children: a ? /* @__PURE__ */ t(T, {
196
265
  template: "6+6",
197
- left: n,
198
- right: /* @__PURE__ */ o("div", {
199
- className: m ? L : "",
200
- children: /* @__PURE__ */ o(u, {
266
+ left: l,
267
+ right: /* @__PURE__ */ t("div", {
268
+ className: m ? M : "",
269
+ children: /* @__PURE__ */ t(u, {
201
270
  paddingTop: {
202
- mobile: t ? 24 : 0,
271
+ mobile: r ? 24 : 0,
203
272
  desktop: 0
204
273
  },
205
- children: l
274
+ children: d
206
275
  })
207
276
  })
208
- }) : /* @__PURE__ */ s(p, {
209
- space: t ? {
277
+ }) : /* @__PURE__ */ n(h, {
278
+ space: r ? {
210
279
  mobile: 24,
211
280
  desktop: 32
212
281
  } : 0,
213
282
  children: [
214
- n,
215
- !m && l
283
+ l,
284
+ !m && d
216
285
  ]
217
286
  })
218
287
  })
219
288
  }),
220
- m && /* @__PURE__ */ o(g, {
221
- className: c ? S : "",
222
- backgroundColor: `linear-gradient(to bottom, ${a.colors.backgroundBrandBottom} 40px, ${a.colors.background} 0%)`,
223
- children: l
289
+ m && /* @__PURE__ */ t(f, {
290
+ className: a ? N : "",
291
+ backgroundColor: `linear-gradient(to bottom, ${s.colors.backgroundBrandBottom} 40px, ${s.colors.background} 0%)`,
292
+ children: d
224
293
  })
225
294
  ]
226
295
  }));
227
- }, V = (param)=>{
228
- let { isInverse: r = !1, children: e, dataAttributes: t } = param;
229
- return T(r ? {
230
- topColor: a.colors.backgroundBrandTop
231
- } : {}), /* @__PURE__ */ o(g, {
232
- isInverse: r,
296
+ }, E = (param)=>{
297
+ let { isInverse: o = !1, children: e, dataAttributes: r } = param;
298
+ return x(o ? {
299
+ topColor: s.colors.backgroundBrandTop
300
+ } : {}), /* @__PURE__ */ t(f, {
301
+ variant: o ? "inverse" : void 0,
233
302
  dataAttributes: _object_spread({
234
- "component-name": "MainSectionHeaderLayout"
235
- }, t),
236
- children: /* @__PURE__ */ o(k, {
303
+ "component-name": "MainSectionHeaderLayout",
304
+ testid: "MainSectionHeaderLayout"
305
+ }, r),
306
+ children: /* @__PURE__ */ t(T, {
237
307
  template: "6+6",
238
- left: /* @__PURE__ */ o(u, {
308
+ left: /* @__PURE__ */ t(u, {
239
309
  paddingTop: {
240
310
  mobile: 12,
241
311
  desktop: 48
@@ -250,4 +320,4 @@ const P = (param)=>{
250
320
  })
251
321
  });
252
322
  };
253
- export { P as Header, U as HeaderLayout, Q as MainSectionHeader, V as MainSectionHeaderLayout };
323
+ export { Z as Header, $ as HeaderLayout, _ as MainSectionHeader, E as MainSectionHeaderLayout };
@@ -1,6 +1,6 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./hero.css.ts.vanilla.css-mistica.js";
3
- var o = "_16rbpto9 _1y2v1nfho _1y2v1nfia _1y2v1nfi4", v = "_16rbpto3 _1y2v1nfho", t = "_1y2v1nfi3 _1y2v1nfis", a = "_16rbpto5", i = "_1y2v1nfhu", _ = "_1y2v1nfis _1y2v1nfho _1y2v1nfi0 _1y2v1nfhu", e = "_16rbptob", y = "_1y2v1nfis", f = "_16rbptoa", p = {
3
+ var v = "_16rbpto9 _1y2v1nfho _1y2v1nfia _1y2v1nfi4", o = "_16rbpto3 _1y2v1nfho", a = "_1y2v1nfi3 _1y2v1nfis", t = "_16rbpto5", _ = "_1y2v1nfhu", i = "_1y2v1nfis _1y2v1nfho _1y2v1nfi0 _1y2v1nfhu", e = "_16rbptob", f = "_1y2v1nfho _1y2v1nfhu", y = "_1y2v1nfis", h = "_16rbptoa", p = {
4
4
  height: "var(--_16rbpto0)"
5
5
  };
6
- export { o as actions, v as container, t as containerDesktop, a as containerMinHeight, i as containerMobile, _ as contentContainer, e as expandedContent, y as hero, f as layout, p as vars };
6
+ export { v as actions, o as container, a as containerDesktop, t as containerMinHeight, _ as containerMobile, i as contentContainer, e as expandedContent, f as flexColumn, y as hero, h as layout, p as vars };