@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/callout.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function() {
9
- return or;
9
+ return at;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -84,22 +84,25 @@ function _object_spread_props(target, source) {
84
84
  return target;
85
85
  }
86
86
  const W = (param)=>{
87
- let { title: o, titleAs: c = "h2", description: d, asset: a, onClose: t, closeButtonLabel: p, button: i, secondaryButton: l, buttonLink: m, "aria-label": u, dataAttributes: f, role: h } = param;
88
- const b = (0, _themevariantcontext.useThemeVariant)(), { texts: x, t: g } = (0, _hooks.useTheme)();
87
+ let { title: a, titleAs: c = "h2", description: d, asset: o, onClose: r, closeButtonLabel: u, button: i, secondaryButton: s, buttonLink: l, "aria-label": p, dataAttributes: f, role: h } = param;
88
+ const b = (0, _themevariantcontext.useThemeVariant)(), { texts: x, t: B } = (0, _hooks.useTheme)();
89
89
  return /* @__PURE__ */ (0, _jsxruntime.jsx)("section", _object_spread_props(_object_spread({
90
90
  className: (0, _classnames.default)(_calloutcssmistica.container, _calloutcssmistica.background[b]),
91
91
  style: (0, _css.applyCssVars)({
92
92
  [_imagecssmistica.vars.mediaBorderRadius]: _skincontractcssmistica.vars.borderRadii.mediaSmall
93
93
  }),
94
- "aria-label": u !== null && u !== void 0 ? u : o,
94
+ "aria-label": p !== null && p !== void 0 ? p : a,
95
95
  role: h
96
96
  }, (0, _dom.getPrefixedDataAttributes)(f, "Callout")), {
97
97
  children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_themevariantcontext.ThemeVariant, {
98
98
  isInverse: !1,
99
99
  children: [
100
- a && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
100
+ o && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
101
101
  paddingRight: 16,
102
- children: a
102
+ dataAttributes: {
103
+ testid: "asset"
104
+ },
105
+ children: o
103
106
  }),
104
107
  /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
105
108
  className: _calloutcssmistica.content,
@@ -118,39 +121,48 @@ const W = (param)=>{
118
121
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
119
122
  as: c,
120
123
  regular: !0,
121
- children: o
124
+ dataAttributes: {
125
+ testid: "title"
126
+ },
127
+ children: a
122
128
  }),
123
129
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
124
130
  as: "p",
125
131
  regular: !0,
126
132
  color: _skincontractcssmistica.vars.colors.textSecondary,
133
+ dataAttributes: {
134
+ testid: "description"
135
+ },
127
136
  children: d
128
137
  })
129
138
  ]
130
139
  }),
131
- t && // Create empty div in order to fill space that iconButton occupies.
140
+ r && // Create empty div in order to fill space that iconButton occupies.
132
141
  // Without this, the content's vertical alignment can be affected
133
142
  /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
134
143
  className: _calloutcssmistica.closeButtonContainerSize
135
144
  })
136
145
  ]
137
146
  }),
138
- (i || l || m) && /* @__PURE__ */ (0, _jsxruntime.jsx)(_buttongroup.default, {
147
+ (i || s || l) && /* @__PURE__ */ (0, _jsxruntime.jsx)(_buttongroup.default, {
139
148
  primaryButton: i,
140
- secondaryButton: l,
141
- link: m
149
+ secondaryButton: s,
150
+ link: l
142
151
  })
143
152
  ]
144
153
  }),
145
- t && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
154
+ r && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
146
155
  className: _calloutcssmistica.closeButtonContainer,
147
156
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.IconButton, {
157
+ dataAttributes: {
158
+ testid: "closeButton"
159
+ },
148
160
  small: !0,
149
161
  bleedY: !0,
150
162
  bleedRight: !0,
151
163
  Icon: _iconcloseregular.default,
152
- onPress: t,
153
- "aria-label": p || x.closeButtonLabel || g(_texttokens.closeButtonLabel)
164
+ onPress: r,
165
+ "aria-label": u || x.closeButtonLabel || B(_texttokens.closeButtonLabel)
154
166
  })
155
167
  })
156
168
  ]
@@ -158,4 +170,4 @@ const W = (param)=>{
158
170
  ]
159
171
  })
160
172
  }));
161
- }, or = W;
173
+ }, at = W;
@@ -28,10 +28,10 @@ _export(exports, {
28
28
  return i;
29
29
  },
30
30
  dataCardTopActionsWithoutIcon: function() {
31
- return s;
31
+ return t;
32
32
  },
33
33
  displayCardBackground: function() {
34
- return t;
34
+ return s;
35
35
  },
36
36
  displayCardContainer: function() {
37
37
  return o;
@@ -55,10 +55,10 @@ _export(exports, {
55
55
  return p;
56
56
  },
57
57
  mediaCard: function() {
58
- return c;
58
+ return u;
59
59
  },
60
60
  mediaCardAsset: function() {
61
- return u;
61
+ return c;
62
62
  },
63
63
  mediaCardContent: function() {
64
64
  return m;
@@ -100,7 +100,7 @@ _export(exports, {
100
100
  require("./sprinkles.css.ts.vanilla.css-mistica.js");
101
101
  require("./icon-button.css.ts.vanilla.css-mistica.js");
102
102
  require("./card.css.ts.vanilla.css-mistica.js");
103
- var _ = "_15e54s91 _1y2v1nfho _1y2v1nfia _1y2v1nfi4", y = "_15e54s93 _1y2v1nfho _1y2v1nfhi", e = "_15e54s912", r = "_1y2v1nfho _1y2v1nfia _1y2v1nfi0 _1y2v1nfhu", f = "_15e54s99", i = "_15e54s9m _1y2v1nfae _1y2v1nfbn _1y2v1nf82 _1y2v1nf9b _1y2v1nfho _1y2v1nfia _1y2v1nfhi _1y2v1nfhu _1y2v1nfib", s = "_15e54s913", t = "_15e54s9v", o = "_1y2v1nfib _1y2v1nfis _1y2v1nfho _1y2v1nfhi", d = "_15e54s9s", C = "_1y2v1nf7w _1y2v1nf84", h = "_1y2v1nf82", b = "_1y2v1nfak _1y2v1nfbt _1y2v1nf9b", l = "_15e54s9y _1y2v1nf88", p = "_15e54s914", c = "_1y2v1nfho _1y2v1nfhu _1y2v1nfis _1y2v1nfib _1y2v1nfia", u = "_15e54s9i _1y2v1nfae _1y2v1nfam _1y2v1nf7w _1y2v1nf84", m = "_15e54s9g _1y2v1nfae _1y2v1nfbn _1y2v1nfho _1y2v1nfia _1y2v1nfhi _1y2v1nf7w _1y2v1nf9b _1y2v1nfhu _1y2v1nfi0", O = "_15e54s9k _1y2v1nfho _1y2v1nfia _1y2v1nfhi _1y2v1nfhu _1y2v1nfi0 _1y2v1nf7w _1y2v1nfbn", k = "_1y2v1nfae _1y2v1nfam _1y2v1nfbn _1y2v1nfbv _1y2v1nf9b", w = "_15e54s9o _1y2v1nf7w _1y2v1nf95 _1y2v1nfae _1y2v1nfbn _1y2v1nfho _1y2v1nfhi _1y2v1nfis _1y2v1nfhu _1y2v1nfi0 _1y2v1nfib _1y2v1nfia", W = "_15e54s96", A = "_15e54s9b _15e54s97", M = "_15e54s9c _15e54s97", x = "_15e54s9d _15e54s97", g = "_15e54s95", I = "_15e54s98 _15e54s97", T = "_15e54s9a _15e54s97", B = {
103
+ var _ = "_15e54s91 _1y2v1nfho _1y2v1nfia _1y2v1nfi4", y = "_15e54s93 _1y2v1nfho _1y2v1nfhi", e = "_15e54s912", r = "_1y2v1nfho _1y2v1nfia _1y2v1nfi0 _1y2v1nfhu", f = "_15e54s99", i = "_15e54s9m _1y2v1nfae _1y2v1nfbn _1y2v1nf82 _1y2v1nf9b _1y2v1nfho _1y2v1nfia _1y2v1nfhi _1y2v1nfhu _1y2v1nfib", t = "_15e54s913", s = "_15e54s9v", o = "_1y2v1nfib _1y2v1nfis _1y2v1nfho _1y2v1nfhi", d = "_15e54s9s", C = "_1y2v1nf7w _1y2v1nf84", h = "_1y2v1nf82", b = "_1y2v1nfak _1y2v1nfbt _1y2v1nf9b", l = "_15e54s9y _1y2v1nf88", p = "_1y2v1nfho _1y2v1nfhu", u = "_1y2v1nfho _1y2v1nfhu _1y2v1nfis _1y2v1nfib _1y2v1nfia", c = "_15e54s9i _1y2v1nfae _1y2v1nfam _1y2v1nf7w _1y2v1nf84", m = "_15e54s9g _1y2v1nfae _1y2v1nfbn _1y2v1nfho _1y2v1nfia _1y2v1nfhi _1y2v1nf7w _1y2v1nf9b _1y2v1nfhu _1y2v1nfi0", O = "_15e54s9k _1y2v1nfho _1y2v1nfia _1y2v1nfhi _1y2v1nfhu _1y2v1nfi0 _1y2v1nf7w _1y2v1nfbn", k = "_1y2v1nfae _1y2v1nfam _1y2v1nfbn _1y2v1nfbv _1y2v1nf9b", w = "_15e54s9o _1y2v1nf7w _1y2v1nf95 _1y2v1nfae _1y2v1nfbn _1y2v1nfho _1y2v1nfhi _1y2v1nfis _1y2v1nfhu _1y2v1nfi0 _1y2v1nfib _1y2v1nfia", W = "_15e54s96", A = "_15e54s9b _15e54s97", M = "_15e54s9c _15e54s97", x = "_15e54s9d _15e54s97", g = "_15e54s95", I = "_15e54s98 _15e54s97", T = "_15e54s9a _15e54s97", B = {
104
104
  aspectRatio: "var(--_15e54s910)",
105
105
  topActionsCount: "var(--_15e54s911)"
106
106
  };
package/dist/card.d.ts CHANGED
@@ -2,12 +2,16 @@ import * as React from 'react';
2
2
  import Tag from './tag';
3
3
  import Image from './image';
4
4
  import Video from './video';
5
+ import { type DataAttributes, type HeadingType, type IconProps, type RendersElement, type RendersNullableElement, type TrackingEvent } from './utils/types';
5
6
  import type { Variant } from './theme-variant-context';
6
7
  import type { PressHandler } from './touchable';
7
8
  import type { VideoElement, VideoSource } from './video';
8
9
  import type { ButtonLink, ButtonPrimary, ButtonSecondary } from './button';
9
10
  import type { ExclusifyUnion } from './utils/utility-types';
10
- import type { DataAttributes, HeadingType, IconProps, RendersElement, RendersNullableElement, TrackingEvent } from './utils/types';
11
+ export declare const useInnerText: () => {
12
+ text: string;
13
+ ref: (instance: HTMLElement | null) => void;
14
+ };
11
15
  type BaseIconButtonAction = {
12
16
  Icon: (props: IconProps) => JSX.Element;
13
17
  label: string;
@@ -73,6 +77,7 @@ interface MediaCardBaseProps {
73
77
  asset?: React.ReactElement;
74
78
  headline?: string | RendersNullableElement<typeof Tag>;
75
79
  pretitle?: string;
80
+ pretitleAs?: HeadingType;
76
81
  pretitleLinesMax?: number;
77
82
  title?: string;
78
83
  titleAs?: HeadingType;
@@ -116,6 +121,7 @@ interface DataCardBaseProps {
116
121
  asset?: React.ReactElement;
117
122
  headline?: string | RendersNullableElement<typeof Tag>;
118
123
  pretitle?: string;
124
+ pretitleAs?: HeadingType;
119
125
  pretitleLinesMax?: number;
120
126
  title?: string;
121
127
  titleAs?: HeadingType;
@@ -168,6 +174,7 @@ interface CommonDisplayCardProps {
168
174
  dataAttributes?: DataAttributes;
169
175
  headline?: React.ReactComponentElement<typeof Tag>;
170
176
  pretitle?: string;
177
+ pretitleAs?: HeadingType;
171
178
  pretitleLinesMax?: number;
172
179
  title: string;
173
180
  titleAs?: HeadingType;
@@ -222,6 +229,7 @@ interface PosterCardBaseProps {
222
229
  dataAttributes?: DataAttributes;
223
230
  headline?: string | RendersNullableElement<typeof Tag>;
224
231
  pretitle?: string;
232
+ pretitleAs?: HeadingType;
225
233
  pretitleLinesMax?: number;
226
234
  title?: string;
227
235
  titleAs?: HeadingType;