@telefonica/mistica 15.5.0 → 15.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.
package/dist/chip.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 ie;
9
+ return oe;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -120,62 +120,62 @@ function _object_spread_props(target, source) {
120
120
  }
121
121
  return target;
122
122
  }
123
- const G = (e)=>{
124
- const { Icon: d, children: w, id: T, dataAttributes: m, active: h, badge: i, onClose: u } = e, { texts: p, isDarkMode: N, textPresets: R } = (0, _hooks.useTheme)(), f = (0, _themevariantcontext.useThemeVariant)() === "alternative", g = d ? {
123
+ const J = (t)=>{
124
+ const { Icon: c, children: T, id: k, dataAttributes: l, active: d, badge: r, onClose: m } = t, { texts: I, isDarkMode: B, textPresets: N } = (0, _hooks.useTheme)(), h = (0, _themevariantcontext.useThemeVariant)() === "alternative", p = c ? {
125
125
  mobile: 16,
126
126
  desktop: 8
127
127
  } : {
128
128
  mobile: 20,
129
129
  desktop: 12
130
- }, E = {
130
+ }, w = {
131
131
  mobile: 20,
132
132
  desktop: 12
133
- }, A = {
133
+ }, b = {
134
134
  mobile: 16,
135
135
  desktop: 8
136
- }, I = ()=>i ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
137
- children: i === !0 ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_badge.default, {}) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_badge.default, {
138
- value: i
136
+ }, y = ()=>r ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
137
+ children: r === !0 ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_badge.default, {}) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_badge.default, {
138
+ value: r
139
139
  })
140
- }) : null, v = /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
140
+ }) : null, u = /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
141
141
  children: [
142
- d && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
142
+ c && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
143
143
  paddingRight: 4,
144
- className: h ? _chipcssmistica.iconActive : _chipcssmistica.icon,
145
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(d, {
144
+ className: d ? _chipcssmistica.iconActive : _chipcssmistica.icon,
145
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(c, {
146
146
  color: "currentColor",
147
147
  size: (0, _css.pxToRem)(16)
148
148
  })
149
149
  }),
150
150
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
151
- paddingRight: i ? 8 : u ? 4 : 0,
151
+ paddingRight: r ? 8 : m ? 4 : 0,
152
152
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
153
- id: T,
154
- weight: R.indicator.weight,
153
+ id: k,
154
+ weight: N.indicator.weight,
155
155
  truncate: 1,
156
156
  color: "currentColor",
157
- children: w
157
+ children: T
158
158
  })
159
159
  })
160
160
  ]
161
161
  });
162
- if (i) return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_box.default, _object_spread_props(_object_spread({
163
- className: (0, _classnames.default)(f ? _chipcssmistica.chipVariants.overAlternative : _chipcssmistica.chipVariants.default, _chipcssmistica.chipWrapper),
164
- paddingLeft: g,
165
- paddingRight: A
166
- }, (0, _dom.getPrefixedDataAttributes)(m, "Chip")), {
162
+ if (r) return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_box.default, _object_spread_props(_object_spread({
163
+ className: (0, _classnames.default)(h ? _chipcssmistica.chipVariants.overAlternative : _chipcssmistica.chipVariants.default, _chipcssmistica.chipWrapper),
164
+ paddingLeft: p,
165
+ paddingRight: b
166
+ }, (0, _dom.getPrefixedDataAttributes)(l, "Chip")), {
167
167
  children: [
168
- v,
169
- I()
168
+ u,
169
+ y()
170
170
  ]
171
171
  }));
172
- if (u) return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_box.default, _object_spread_props(_object_spread({
173
- className: (0, _classnames.default)(f ? _chipcssmistica.chipVariants.overAlternative : _chipcssmistica.chipVariants.default, _chipcssmistica.chipWrapper),
174
- paddingLeft: g,
175
- paddingRight: A
176
- }, (0, _dom.getPrefixedDataAttributes)(m, "Chip")), {
172
+ if (m) return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_box.default, _object_spread_props(_object_spread({
173
+ className: (0, _classnames.default)(h ? _chipcssmistica.chipVariants.overAlternative : _chipcssmistica.chipVariants.default, _chipcssmistica.chipWrapper),
174
+ paddingLeft: p,
175
+ paddingRight: b
176
+ }, (0, _dom.getPrefixedDataAttributes)(l, "Chip")), {
177
177
  children: [
178
- v,
178
+ u,
179
179
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.default, {
180
180
  style: {
181
181
  display: "flex",
@@ -184,8 +184,8 @@ const G = (e)=>{
184
184
  width: (0, _css.pxToRem)(24),
185
185
  height: (0, _css.pxToRem)(24)
186
186
  },
187
- "aria-label": p.closeButtonLabel,
188
- onPress: ()=>u(),
187
+ "aria-label": I.closeButtonLabel,
188
+ onPress: ()=>m(),
189
189
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconcloseregular.default, {
190
190
  size: (0, _css.pxToRem)(16),
191
191
  color: _skincontractcssmistica.vars.colors.neutralMedium
@@ -193,36 +193,20 @@ const G = (e)=>{
193
193
  })
194
194
  ]
195
195
  }));
196
- const B = h !== void 0 || e.href || e.onPress || e.to, o = _object_spread({
196
+ const f = t.href || t.onPress || t.to, P = d !== void 0 || f, v = _object_spread({
197
197
  "component-name": "Chip"
198
- }, m), c = (V)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
199
- className: (0, _classnames.default)(_chipcssmistica.chipVariants[h ? "active" : f ? "overAlternative" : "default"], e.href || e.onPress || e.to ? _chipcssmistica.wrappedContent : _chipcssmistica.chipWrapper, {
200
- [_chipcssmistica.chipInteractiveVariants[N ? "dark" : "light"]]: B
198
+ }, l), C = (j)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
199
+ className: (0, _classnames.default)(_chipcssmistica.chipVariants[d ? "active" : h ? "overAlternative" : "default"], f ? _chipcssmistica.wrappedContent : _chipcssmistica.chipWrapper, {
200
+ [_chipcssmistica.chipInteractiveVariants[B ? "dark" : "light"]]: P
201
201
  }),
202
- paddingLeft: g,
203
- paddingRight: E,
204
- dataAttributes: V,
205
- children: v
202
+ paddingLeft: p,
203
+ paddingRight: w,
204
+ dataAttributes: j,
205
+ children: u
206
206
  });
207
- return e.onPress ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
207
+ return f ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, _object_spread_props(_object_spread({}, t), {
208
208
  className: (0, _classnames.default)(_chipcssmistica.chipWrapper, _chipcssmistica.button),
209
- trackingEvent: e.trackingEvent,
210
- onPress: e.onPress,
211
- dataAttributes: o,
212
- children: c()
213
- }) : e.to ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
214
- trackingEvent: e.trackingEvent,
215
- to: e.to,
216
- fullPageOnWebView: e.fullPageOnWebView,
217
- dataAttributes: o,
218
- className: _chipcssmistica.chipWrapper,
219
- children: c()
220
- }) : e.href ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
221
- trackingEvent: e.trackingEvent,
222
- href: e.href,
223
- newTab: e.newTab,
224
- dataAttributes: o,
225
- className: _chipcssmistica.chipWrapper,
226
- children: c()
227
- }) : c(o);
228
- }, ie = G;
209
+ dataAttributes: v,
210
+ children: C()
211
+ })) : C(v);
212
+ }, oe = J;
@@ -10,13 +10,13 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  actions: function() {
13
- return v;
13
+ return n;
14
14
  },
15
15
  actionsVariants: function() {
16
- return _;
16
+ return v;
17
17
  },
18
18
  adjustButtonLink: function() {
19
- return n;
19
+ return _;
20
20
  },
21
21
  button: function() {
22
22
  return t;
@@ -46,28 +46,25 @@ _export(exports, {
46
46
  return b;
47
47
  },
48
48
  minHeight: function() {
49
- return c;
50
- },
51
- minHeightBox: function() {
52
49
  return d;
53
50
  },
54
51
  paddingX: function() {
55
- return m;
52
+ return c;
56
53
  },
57
54
  topActionsWithoutIcon: function() {
58
55
  return l;
59
56
  },
60
57
  touchableArea: function() {
61
- return p;
58
+ return m;
62
59
  },
63
60
  touchableCardOverlay: function() {
64
- return s;
61
+ return p;
65
62
  },
66
63
  touchableContainer: function() {
67
- return g;
64
+ return s;
68
65
  },
69
66
  vars: function() {
70
- return j;
67
+ return g;
71
68
  },
72
69
  zindex: function() {
73
70
  return k;
@@ -76,9 +73,9 @@ _export(exports, {
76
73
  require("../sprinkles.css.ts.vanilla.css-mistica.js");
77
74
  require("../icon-button.css.ts.vanilla.css-mistica.js");
78
75
  require("./advanced-data-card.css.ts.vanilla.css-mistica.js");
79
- var v = "_1x00fru3 _1x00fru1 _1y2v1nfaa _1y2v1nfbj _1y2v1nfhk _1y2v1nfi6 _1y2v1nfhw _1y2v1nf97", _ = {
80
- default: "_1x00frul",
81
- mobile: "_1x00frum"
82
- }, n = "_1x00frus", t = "_1x00fruo", u = "_1x00frup _1x00fruo", o = "_1x00fru9 _1x00fru1 _1y2v1nfaa _1y2v1nfbj _1y2v1nf7m _1y2v1nf97", i = "_1x00frue _1y2v1nfhe _1y2v1nfhk _1y2v1nfi6 _1y2v1nfhq _1y2v1nfi7 _1y2v1nfio _1x00frub", x = "_1x00fruj", y = "_1x00frur _1y2v1nfhk _1y2v1nfhp", e = "_1y2v1nfhk _1y2v1nfi6 _1y2v1nfhz _1y2v1nfjt", h = "_1x00frun", b = "_1x00frut", c = "_1x00frub", d = "_1x00fruc", m = "_1x00fru1 _1y2v1nfaa _1y2v1nfbj", l = "_1x00fruv", p = "_1x00fru4", s = "_1x00fru7", g = "_1x00fru5", j = {
83
- topActionsCount: "var(--_1x00fruu)"
76
+ var n = "_1x00fru3 _1x00fru1 _1y2v1nfaa _1y2v1nfbj _1y2v1nfhk _1y2v1nfhw _1y2v1nf97", v = {
77
+ default: "_1x00fruk",
78
+ mobile: "_1x00frul"
79
+ }, _ = "_1x00frur", t = "_1x00frun", u = "_1x00fruo _1x00frun", o = "_1x00fru9 _1x00fru1 _1y2v1nfaa _1y2v1nfbj _1y2v1nf7m _1y2v1nf97", i = "_1x00frud _1y2v1nfhe _1y2v1nfhk _1y2v1nfi6 _1y2v1nfhq _1y2v1nfi7 _1y2v1nfio _1x00frub", x = "_1x00frui", y = "_1x00fruq _1y2v1nfhk _1y2v1nfhp", e = "_1y2v1nfhk _1y2v1nfi6 _1y2v1nfhz _1y2v1nfjt", h = "_1x00frum", b = "_1x00frus", d = "_1x00frub", c = "_1x00fru1 _1y2v1nfaa _1y2v1nfbj", l = "_1x00fruu", m = "_1x00fru4", p = "_1x00fru7", s = "_1x00fru5", g = {
80
+ topActionsCount: "var(--_1x00frut)"
84
81
  }, k = "_1x00frua";
@@ -7,7 +7,6 @@ export declare const touchableCardOverlay: string;
7
7
  export declare const cardContentStyle: string;
8
8
  export declare const zindex: string;
9
9
  export declare const minHeight: string;
10
- export declare const minHeightBox: string;
11
10
  export declare const dataCard: string;
12
11
  export declare const cardActionIconButton: string;
13
12
  export declare const cardAction: string;
@@ -11,10 +11,10 @@ function _export(target, all) {
11
11
  }
12
12
  _export(exports, {
13
13
  AdvancedDataCard: function() {
14
- return Ce;
14
+ return xe;
15
15
  },
16
16
  default: function() {
17
- return Ee;
17
+ return We;
18
18
  }
19
19
  });
20
20
  const _jsxruntime = require("react/jsx-runtime");
@@ -160,8 +160,8 @@ function _object_without_properties_loose(source, excluded) {
160
160
  }
161
161
  return target;
162
162
  }
163
- const xe = (_param)=>{
164
- var { headline: a, pretitle: i, pretitleAs: n = "p", pretitleLinesMax: p, title: d, titleAs: c = "h3", titleLinesMax: l, subtitle: m, subtitleLinesMax: o, description: r, descriptionLinesMax: u, ariaLabel: y } = _param, s = _object_without_properties(_param, [
163
+ const ye = (_param)=>{
164
+ var { headline: a, pretitle: i, pretitleAs: n = "p", pretitleLinesMax: p, title: d, titleAs: c = "h3", titleLinesMax: l, subtitle: m, subtitleLinesMax: o, description: r, descriptionLinesMax: u, ariaLabel: x } = _param, s = _object_without_properties(_param, [
165
165
  "headline",
166
166
  "pretitle",
167
167
  "pretitleAs",
@@ -185,7 +185,7 @@ const xe = (_param)=>{
185
185
  maybe: !0,
186
186
  className: (0, _classnames.default)(_advanceddatacardcssmistica.touchableArea)
187
187
  }, s), {
188
- "aria-label": y,
188
+ "aria-label": x,
189
189
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {})
190
190
  })),
191
191
  i && /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
@@ -225,7 +225,7 @@ const xe = (_param)=>{
225
225
  })
226
226
  ]
227
227
  });
228
- }, ye = (param)=>{
228
+ }, Ne = (param)=>{
229
229
  let { button: a, footerImage: i, footerText: n, footerTextLinesMax: p, buttonLink: d } = param;
230
230
  const c = !!a, l = !!i, m = !!n, o = !!d, r = c && (l || m) && o, u = o && !r ? "178px" : "";
231
231
  return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
@@ -280,8 +280,8 @@ const xe = (_param)=>{
280
280
  })
281
281
  ]
282
282
  });
283
- }, Ce = /*#__PURE__*/ _react.forwardRef((_param, E)=>{
284
- var { stackingGroup: a, headline: i, pretitle: n, pretitleAs: p, pretitleLinesMax: d, title: c, titleAs: l, titleLinesMax: m, subtitle: o, subtitleLinesMax: r, description: u, descriptionLinesMax: y, extra: s, extraDividerPadding: C = 24, button: B, footerImage: R, footerText: S, footerTextLinesMax: V, buttonLink: D, dataAttributes: W, actions: g, "aria-label": w, onClose: F } = _param, f = _object_without_properties(_param, [
283
+ }, xe = /*#__PURE__*/ _react.forwardRef((_param, E)=>{
284
+ var { stackingGroup: a, headline: i, pretitle: n, pretitleAs: p, pretitleLinesMax: d, title: c, titleAs: l, titleLinesMax: m, subtitle: o, subtitleLinesMax: r, description: u, descriptionLinesMax: x, extra: s, extraDividerPadding: C = 24, button: A, footerImage: T, footerText: B, footerTextLinesMax: V, buttonLink: R, dataAttributes: W, actions: g, "aria-label": S, onClose: D } = _param, f = _object_without_properties(_param, [
285
285
  "stackingGroup",
286
286
  "headline",
287
287
  "pretitle",
@@ -307,12 +307,12 @@ const xe = (_param)=>{
307
307
  "onClose"
308
308
  ]);
309
309
  const G = !!f.href || !!f.onPress || !!f.to, L = {
310
- button: B,
311
- footerImage: R,
312
- footerText: S,
310
+ button: A,
311
+ footerImage: T,
312
+ footerText: B,
313
313
  footerTextLinesMax: V,
314
- buttonLink: D
315
- }, b = !!B || !!R || !!S || !!D, A = !!(s != null && s.length), M = ((g == null ? void 0 : g.length) || 0) + (F ? 1 : 0);
314
+ buttonLink: R
315
+ }, w = !!A || !!T || !!B || !!R, F = !!(s != null && s.length), M = ((g == null ? void 0 : g.length) || 0) + (D ? 1 : 0);
316
316
  return /* @__PURE__ */ (0, _jsxruntime.jsx)("section", _object_spread_props(_object_spread({
317
317
  className: (0, _sprinklescssmistica.sprinkles)({
318
318
  position: "relative",
@@ -320,7 +320,7 @@ const xe = (_param)=>{
320
320
  })
321
321
  }, (0, _dom.getPrefixedDataAttributes)(W, "AdvancedDataCard")), {
322
322
  ref: E,
323
- "aria-label": w,
323
+ "aria-label": S,
324
324
  children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_boxed.Boxed, {
325
325
  className: _advanceddatacardcssmistica.dataCard,
326
326
  children: [
@@ -331,10 +331,9 @@ const xe = (_param)=>{
331
331
  className: _advanceddatacardcssmistica.touchableCardOverlay
332
332
  }),
333
333
  /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
334
- className: (0, _classnames.default)(_advanceddatacardcssmistica.cardContentStyle, !b && !A ? _advanceddatacardcssmistica.minHeight : ""),
334
+ className: (0, _classnames.default)(_advanceddatacardcssmistica.cardContentStyle, !w && !F ? _advanceddatacardcssmistica.minHeight : ""),
335
335
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
336
336
  paddingTop: 8,
337
- className: !b && !A ? "" : _advanceddatacardcssmistica.minHeightBox,
338
337
  children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_inline.default, {
339
338
  space: 0,
340
339
  children: [
@@ -342,7 +341,7 @@ const xe = (_param)=>{
342
341
  space: 8,
343
342
  children: [
344
343
  a,
345
- /* @__PURE__ */ (0, _jsxruntime.jsx)(xe, _object_spread({
344
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(ye, _object_spread({
346
345
  headline: i,
347
346
  pretitle: n,
348
347
  pretitleAs: p,
@@ -353,8 +352,8 @@ const xe = (_param)=>{
353
352
  subtitle: o,
354
353
  subtitleLinesMax: r,
355
354
  description: u,
356
- descriptionLinesMax: y,
357
- ariaLabel: w
355
+ descriptionLinesMax: x,
356
+ ariaLabel: S
358
357
  }, f))
359
358
  ]
360
359
  }),
@@ -373,33 +372,33 @@ const xe = (_param)=>{
373
372
  flexGrow: 1
374
373
  }
375
374
  }),
376
- A && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
375
+ F && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
377
376
  paddingTop: 16,
378
377
  paddingBottom: 24,
379
378
  width: "100%",
380
379
  className: _advanceddatacardcssmistica.zindex,
381
- children: s.map((O, H)=>/* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
380
+ children: s.map((O, I)=>/* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
382
381
  children: [
383
382
  /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
384
383
  className: _advanceddatacardcssmistica.paddingX,
385
384
  children: O
386
385
  }),
387
- H + 1 !== s.length && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
386
+ I + 1 !== s.length && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
388
387
  paddingY: C,
389
388
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_divider.default, {})
390
389
  })
391
390
  ]
392
- }, H))
391
+ }, I))
393
392
  }),
394
393
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_card.CardActionsGroup, {
395
394
  actions: g,
396
- onClose: F,
395
+ onClose: D,
397
396
  padding: 15
398
397
  })
399
398
  ]
400
399
  }),
401
- b && /* @__PURE__ */ (0, _jsxruntime.jsx)(ye, _object_spread({}, L))
400
+ w && /* @__PURE__ */ (0, _jsxruntime.jsx)(Ne, _object_spread({}, L))
402
401
  ]
403
402
  })
404
403
  }));
405
- }), Ee = Ce;
404
+ }), We = xe;
@@ -1,4 +1,6 @@
1
1
  import * as React from 'react';
2
+ import type { ExclusifyUnion } from './utils/utility-types';
3
+ import type { TouchableComponentProps } from './touchable';
2
4
  import type { ButtonLink, NullableButtonElement } from './button';
3
5
  import type { DataAttributes, RendersNullableElement, TrackingEvent } from './utils/types';
4
6
  type TextProps = {
@@ -25,42 +27,10 @@ type CommonProps = TextProps & {
25
27
  width?: string | number;
26
28
  dataAttributes?: DataAttributes;
27
29
  };
28
- type BasicProps = CommonProps & {
29
- button?: undefined;
30
- onPress?: undefined;
31
- to?: undefined;
32
- href?: undefined;
33
- };
34
30
  type ButtonProps = CommonProps & {
35
- button?: NullableButtonElement | RendersNullableElement<typeof ButtonLink>;
36
- onPress?: undefined;
37
- to?: undefined;
38
- href?: undefined;
39
- };
40
- type HrefProps = CommonProps & {
41
- href?: string;
42
- newTab?: boolean;
43
- onPress?: undefined;
44
- to?: undefined;
45
- button?: undefined;
46
- fullPageOnWebView?: undefined;
47
- };
48
- type ToProps = CommonProps & {
49
- to?: string;
50
- fullPageOnWebView?: boolean;
51
- href?: undefined;
52
- onPress?: undefined;
53
- button?: undefined;
54
- newTab?: undefined;
55
- };
56
- type OnPressProps = CommonProps & {
57
- onPress?: () => void;
58
- href?: undefined;
59
- to?: undefined;
60
- button?: undefined;
61
- newTab?: undefined;
62
- fullPageOnWebView?: undefined;
31
+ button: NullableButtonElement | RendersNullableElement<typeof ButtonLink> | undefined;
63
32
  };
64
- type Props = BasicProps | ButtonProps | HrefProps | ToProps | OnPressProps;
33
+ type TouchableCardProps = TouchableComponentProps<CommonProps>;
34
+ type Props = ExclusifyUnion<ButtonProps | TouchableCardProps>;
65
35
  declare const HighlightedCard: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
66
36
  export default HighlightedCard;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function() {
9
- return U;
9
+ return K;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -145,22 +145,32 @@ function _object_without_properties_loose(source, excluded) {
145
145
  }
146
146
  return target;
147
147
  }
148
- const S = /*#__PURE__*/ _react.forwardRef((e, t)=>{
149
- var _e_isInverse;
150
- const { title: s, description: n, imageUrl: a, imageFit: r, titleAs: u = "h3" } = e, f = (0, _themevariantcontext.useIsInverseVariant)(), b = (_e_isInverse = e.isInverse) !== null && _e_isInverse !== void 0 ? _e_isInverse : f, d = (0, _maybedismissable.useIsDismissable)(), { textPresets: v } = (0, _hooks.useTheme)(), o = /* @__PURE__ */ (0, _jsxruntime.jsxs)(_boxed.Boxed, {
151
- ref: t,
152
- isInverse: b,
148
+ const A = /*#__PURE__*/ _react.forwardRef((n, e)=>{
149
+ var _n_isInverse;
150
+ const { title: s, description: r, imageUrl: a, imageFit: o, titleAs: g = "h3", width: m, dataAttributes: b, titleLinesMax: f, descriptionLinesMax: v } = n, t = _object_without_properties(n, [
151
+ "title",
152
+ "description",
153
+ "imageUrl",
154
+ "imageFit",
155
+ "titleAs",
156
+ "width",
157
+ "dataAttributes",
158
+ "titleLinesMax",
159
+ "descriptionLinesMax"
160
+ ]), x = (0, _themevariantcontext.useIsInverseVariant)(), p = (_n_isInverse = n.isInverse) !== null && _n_isInverse !== void 0 ? _n_isInverse : x, d = (0, _maybedismissable.useIsDismissable)(), { textPresets: I } = (0, _hooks.useTheme)(), c = /* @__PURE__ */ (0, _jsxruntime.jsxs)(_boxed.Boxed, {
161
+ ref: e,
162
+ isInverse: p,
153
163
  className: _highlightedcardcssmistica.container,
154
164
  dataAttributes: _object_spread({
155
165
  "component-name": "HighlightedCard"
156
- }, e.dataAttributes),
157
- width: e.width ? `${e.width}px` : "100%",
166
+ }, b),
167
+ width: m ? `${m}px` : "100%",
158
168
  minHeight: "100%",
159
169
  children: [
160
170
  /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
161
171
  role: d ? void 0 : "region",
162
172
  className: _highlightedcardcssmistica.textContainerVariant[a ? "withImage" : "withoutImage"],
163
- "aria-label": d ? void 0 : e["aria-label"],
173
+ "aria-label": d ? void 0 : t["aria-label"],
164
174
  children: [
165
175
  /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
166
176
  space: 8,
@@ -170,23 +180,23 @@ const S = /*#__PURE__*/ _react.forwardRef((e, t)=>{
170
180
  mobileLineHeight: "24px",
171
181
  desktopSize: 20,
172
182
  desktopLineHeight: "28px",
173
- truncate: e.titleLinesMax,
174
- weight: v.cardTitle.weight,
175
- as: u,
183
+ truncate: f,
184
+ weight: I.cardTitle.weight,
185
+ as: g,
176
186
  hyphens: "auto",
177
187
  children: s
178
188
  }),
179
- !!n && /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
189
+ !!r && /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
180
190
  regular: !0,
181
191
  color: _skincontractcssmistica.vars.colors.textSecondary,
182
- truncate: e.descriptionLinesMax,
192
+ truncate: v,
183
193
  as: "p",
184
194
  hyphens: "auto",
185
- children: n
195
+ children: r
186
196
  })
187
197
  ]
188
198
  }),
189
- e.button && /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
199
+ t.button && /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
190
200
  children: [
191
201
  /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
192
202
  style: {
@@ -194,7 +204,7 @@ const S = /*#__PURE__*/ _react.forwardRef((e, t)=>{
194
204
  flexGrow: 1
195
205
  }
196
206
  }),
197
- e.button
207
+ t.button
198
208
  ]
199
209
  })
200
210
  ]
@@ -204,45 +214,31 @@ const S = /*#__PURE__*/ _react.forwardRef((e, t)=>{
204
214
  style: {
205
215
  backgroundImage: `url(${a})`,
206
216
  backgroundRepeat: "no-repeat",
207
- backgroundSize: r === "fit" ? "contain" : "cover",
208
- backgroundPosition: r === "fit" ? "bottom right" : `center ${r === "fill-center" ? "center" : "right"}`
217
+ backgroundSize: o === "fit" ? "contain" : "cover",
218
+ backgroundPosition: o === "fit" ? "bottom right" : `center ${o === "fill-center" ? "center" : "right"}`
209
219
  }
210
220
  })
211
221
  ]
212
222
  });
213
- return e.button ? o : e.onPress ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
214
- onPress: e.onPress,
215
- trackingEvent: e.trackingEvent,
216
- className: _highlightedcardcssmistica.touchableContainer,
217
- children: o
218
- }) : e.to ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
219
- to: e.to,
220
- trackingEvent: e.trackingEvent,
221
- fullPageOnWebView: e.fullPageOnWebView,
223
+ return t.button ? c : t.onPress || t.to || t.href ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, _object_spread_props(_object_spread({}, t), {
222
224
  className: _highlightedcardcssmistica.touchableContainer,
223
- children: o
224
- }) : e.href ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
225
- trackingEvent: e.trackingEvent,
226
- href: e.href,
227
- newTab: e.newTab,
228
- className: _highlightedcardcssmistica.touchableContainer,
229
- children: o
230
- }) : o;
231
- }), L = /*#__PURE__*/ _react.forwardRef((_param, s)=>{
232
- var { "aria-label": e } = _param, t = _object_without_properties(_param, [
225
+ children: c
226
+ })) : c;
227
+ }), D = /*#__PURE__*/ _react.forwardRef((_param, s)=>{
228
+ var { "aria-label": n } = _param, e = _object_without_properties(_param, [
233
229
  "aria-label"
234
230
  ]);
235
- var _t_isInverse;
236
- const n = e || t.title || t.description, a = (0, _themevariantcontext.useIsInverseVariant)(), r = (_t_isInverse = t.isInverse) !== null && _t_isInverse !== void 0 ? _t_isInverse : a;
231
+ var _e_isInverse;
232
+ const r = n || e.title || e.description, a = (0, _themevariantcontext.useIsInverseVariant)(), o = (_e_isInverse = e.isInverse) !== null && _e_isInverse !== void 0 ? _e_isInverse : a;
237
233
  return /* @__PURE__ */ (0, _jsxruntime.jsx)(_maybedismissable.default, {
238
- onClose: t.onClose,
239
- "aria-label": n,
240
- width: t.width,
241
- isOverMedia: !!t.imageUrl,
242
- isInverse: r,
243
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(S, _object_spread_props(_object_spread({}, t), {
244
- "aria-label": n,
234
+ onClose: e.onClose,
235
+ "aria-label": r,
236
+ width: e.width,
237
+ isOverMedia: !!e.imageUrl,
238
+ isInverse: o,
239
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(A, _object_spread_props(_object_spread({}, e), {
240
+ "aria-label": r,
245
241
  ref: s
246
242
  }))
247
243
  });
248
- }), U = L;
244
+ }), K = D;