@telefonica/mistica 15.4.0 → 15.5.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-es/hero.js CHANGED
@@ -78,90 +78,96 @@ function _object_without_properties_loose(source, excluded) {
78
78
  }
79
79
  return target;
80
80
  }
81
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
82
- import * as V from "react";
83
- import s from "classnames";
84
- import { useScreenSize as G } from "./hooks.js";
85
- import { Text3 as B, Text8 as O } from "./text.js";
86
- import W from "./grid-layout.js";
87
- import p from "./box.js";
88
- import w from "./stack.js";
89
- import z from "./button-group.js";
90
- import { vars as $ } from "./skins/skin-contract.css-mistica.js";
91
- import { container as u, containerMobile as E, containerMinHeight as C, contentWrapper as M, containerBackground as S, expandedContent as q, layout as x, contentContainer as A, vars as H, containerDesktop as b, actions as F } from "./hero.css-mistica.js";
92
- import { vars as g } from "./image.css-mistica.js";
93
- import { useSlideshowContext as J } from "./carousel.js";
94
- import { getPrefixedDataAttributes as R } from "./utils/dom.js";
95
- import { sprinkles as D } from "./sprinkles.css-mistica.js";
96
- import { useIsInverseVariant as K } from "./theme-variant-context.js";
97
- import { applyCssVars as I } from "./utils/css.js";
98
- import { InternalResponsiveLayout as Q } from "./responsive-layout.js";
99
- const T = (param)=>{
100
- let { children: r, isInverse: t, isInsideSlideShow: n } = param;
101
- return /* @__PURE__ */ e(Q, {
102
- isInverse: t,
103
- className: x,
104
- innerDivClassName: x,
105
- shouldExpandWhenNested: n ? "desktop" : !0,
106
- backgroundColor: "transparent",
107
- children: r
81
+ import { jsx as r, jsxs as p } from "react/jsx-runtime";
82
+ import * as $ from "react";
83
+ import h from "classnames";
84
+ import { useScreenSize as j } from "./hooks.js";
85
+ import { Text3 as g, Text8 as G } from "./text.js";
86
+ import A from "./grid-layout.js";
87
+ import m from "./box.js";
88
+ import R from "./stack.js";
89
+ import E from "./button-group.js";
90
+ import { vars as i } from "./skins/skin-contract.css-mistica.js";
91
+ import { container as v, containerMobile as V, containerMinHeight as C, expandedContent as _, layout as B, vars as H, containerDesktop as S, actions as z } from "./hero.css-mistica.js";
92
+ import { vars as y } from "./image.css-mistica.js";
93
+ import { useSlideshowContext as K } from "./carousel.js";
94
+ import { getPrefixedDataAttributes as T } from "./utils/dom.js";
95
+ import { sprinkles as O } from "./sprinkles.css-mistica.js";
96
+ import { useIsInverseVariant as M } from "./theme-variant-context.js";
97
+ import { applyCssVars as x } from "./utils/css.js";
98
+ import { ResetResponsiveLayout as U, InternalResponsiveLayout as W } from "./responsive-layout.js";
99
+ const k = {
100
+ default: i.colors.background,
101
+ alternative: i.colors.backgroundAlternative,
102
+ brand: i.colors.backgroundBrand,
103
+ "brand-secondary": i.colors.backgroundBrandSecondary,
104
+ none: "transparent"
105
+ }, w = (param)=>{
106
+ let { children: e, isInverse: o, backgroundColor: a } = param;
107
+ return /* @__PURE__ */ r(W, {
108
+ isInverse: o,
109
+ className: B,
110
+ innerDivClassName: B,
111
+ shouldExpandWhenNested: !0,
112
+ backgroundColor: a !== null && a !== void 0 ? a : "transparent",
113
+ children: e
108
114
  });
109
- }, v = (param)=>{
110
- let { headline: r, title: t, titleAs: n = "h1", pretitle: i, description: l, descriptionLinesMax: o, extra: a, button: c, secondaryButton: f, buttonLink: m } = param;
111
- return /* @__PURE__ */ d("section", {
112
- className: D({
115
+ }, b = (param)=>{
116
+ let { headline: e, title: o, titleAs: a = "h1", pretitle: l, description: c, descriptionLinesMax: t, extra: n, button: d, secondaryButton: f, buttonLink: s } = param;
117
+ return /* @__PURE__ */ p("section", {
118
+ className: O({
113
119
  height: "100%",
114
120
  display: "flex",
115
121
  justifyContent: "space-between",
116
122
  flexDirection: "column"
117
123
  }),
118
124
  children: [
119
- /* @__PURE__ */ d("div", {
125
+ /* @__PURE__ */ p("div", {
120
126
  children: [
121
- /* @__PURE__ */ d(w, {
127
+ /* @__PURE__ */ p(R, {
122
128
  space: 16,
123
129
  children: [
124
- r && r,
125
- /* @__PURE__ */ d(w, {
130
+ e && e,
131
+ /* @__PURE__ */ p(R, {
126
132
  space: 8,
127
133
  children: [
128
- i && /* @__PURE__ */ e(B, {
134
+ l && /* @__PURE__ */ r(g, {
129
135
  as: "p",
130
136
  regular: !0,
131
- children: i
137
+ children: l
132
138
  }),
133
- t && /* @__PURE__ */ e(O, {
134
- as: n,
135
- children: t
139
+ o && /* @__PURE__ */ r(G, {
140
+ as: a,
141
+ children: o
136
142
  })
137
143
  ]
138
144
  }),
139
- l && /* @__PURE__ */ e(B, {
145
+ c && /* @__PURE__ */ r(g, {
140
146
  as: "p",
141
147
  regular: !0,
142
- color: $.colors.textSecondary,
143
- truncate: o,
144
- children: l
148
+ color: i.colors.textSecondary,
149
+ truncate: t,
150
+ children: c
145
151
  })
146
152
  ]
147
153
  }),
148
- a && /* @__PURE__ */ e("div", {
149
- children: a
154
+ n && /* @__PURE__ */ r("div", {
155
+ children: n
150
156
  })
151
157
  ]
152
158
  }),
153
- (c || m) && /* @__PURE__ */ e("div", {
154
- className: F,
155
- children: /* @__PURE__ */ e(z, {
156
- primaryButton: c,
159
+ (d || s) && /* @__PURE__ */ r("div", {
160
+ className: z,
161
+ children: /* @__PURE__ */ r(E, {
162
+ primaryButton: d,
157
163
  secondaryButton: f,
158
- link: m
164
+ link: s
159
165
  })
160
166
  })
161
167
  ]
162
168
  });
163
- }, U = /*#__PURE__*/ V.forwardRef((_param, c)=>{
164
- var { height: r, background: t = "default", media: n, desktopMediaPosition: i = "left", dataAttributes: l, noPaddingY: o } = _param, a = _object_without_properties(_param, [
169
+ }, q = /*#__PURE__*/ $.forwardRef((_param, d)=>{
170
+ var { height: e, background: o = "default", media: a, desktopMediaPosition: l = "left", dataAttributes: c, noPaddingY: t } = _param, n = _object_without_properties(_param, [
165
171
  "height",
166
172
  "background",
167
173
  "media",
@@ -169,80 +175,86 @@ const T = (param)=>{
169
175
  "dataAttributes",
170
176
  "noPaddingY"
171
177
  ]);
172
- const { isTabletOrSmaller: f } = G(), m = J(), y = !!m, h = y && m.withBullets, j = K(), N = t === "none" ? j : t === "brand" || t === "brand-secondary";
173
- if (f) return /* @__PURE__ */ e("div", _object_spread_props(_object_spread({}, R(_object_spread({
174
- "component-name": "Hero"
175
- }, l))), {
176
- ref: c,
177
- style: _object_spread({}, r === "100vh" ? {
178
- maxHeight: "-webkit-fill-available"
179
- } : {}, I({
180
- [H.height]: typeof r == "number" ? `${r}px` : r !== null && r !== void 0 ? r : "100%",
181
- [g.mediaBorderRadius]: "0px"
182
- })),
183
- className: s(u, E, {
184
- [C]: !o
185
- }),
186
- children: /* @__PURE__ */ e(T, {
187
- isInverse: N,
188
- isInsideSlideShow: y,
189
- children: /* @__PURE__ */ d("div", {
190
- className: s(M),
178
+ const { isTabletOrSmaller: f } = j(), s = K(), u = !!(s != null && s.withBullets), D = M(), N = o === "none" ? D : o === "brand" || o === "brand-secondary";
179
+ if (f) return /* @__PURE__ */ r(U, {
180
+ children: /* @__PURE__ */ r("div", {
181
+ style: x({
182
+ [y.mediaBorderRadius]: "0px"
183
+ }),
184
+ children: /* @__PURE__ */ p("div", _object_spread_props(_object_spread({}, T(_object_spread({
185
+ "component-name": "Hero"
186
+ }, c))), {
187
+ ref: d,
188
+ style: _object_spread({}, e === "100vh" ? {
189
+ maxHeight: "-webkit-fill-available"
190
+ } : {}, x({
191
+ [H.height]: typeof e == "number" ? `${e}px` : e !== null && e !== void 0 ? e : "100%",
192
+ [y.mediaBorderRadius]: "0px"
193
+ })),
194
+ className: h(v, V, {
195
+ [C]: !t
196
+ }),
191
197
  children: [
192
- n,
193
- /* @__PURE__ */ e("div", {
194
- className: s(S[t], q),
195
- children: /* @__PURE__ */ e(p, {
196
- paddingTop: 24,
197
- paddingBottom: h ? 48 : o ? 0 : 24,
198
- className: s(x, A),
199
- children: /* @__PURE__ */ e(v, _object_spread({}, a))
198
+ a,
199
+ /* @__PURE__ */ r(w, {
200
+ isInverse: N,
201
+ backgroundColor: k[o],
202
+ children: /* @__PURE__ */ r("div", {
203
+ className: _,
204
+ children: /* @__PURE__ */ r(m, {
205
+ paddingTop: 24,
206
+ paddingBottom: u ? 48 : t ? 0 : 24,
207
+ className: B,
208
+ children: /* @__PURE__ */ r(b, _object_spread({}, n))
209
+ })
200
210
  })
201
211
  })
202
212
  ]
203
- })
213
+ }))
204
214
  })
205
- }));
206
- const k = i === "left" ? n : /* @__PURE__ */ e(p, {
215
+ });
216
+ const I = l === "left" ? a : /* @__PURE__ */ r(m, {
207
217
  paddingRight: 24,
208
- children: /* @__PURE__ */ e(v, _object_spread({}, a))
209
- }), L = i === "right" ? n : /* @__PURE__ */ e(p, {
218
+ children: /* @__PURE__ */ r(b, _object_spread({}, n))
219
+ }), L = l === "right" ? a : /* @__PURE__ */ r(m, {
210
220
  paddingLeft: 24,
211
- children: /* @__PURE__ */ e(v, _object_spread({}, a))
221
+ children: /* @__PURE__ */ r(b, _object_spread({}, n))
212
222
  });
213
- return /* @__PURE__ */ e("div", _object_spread_props(_object_spread({}, R(_object_spread({
223
+ return /* @__PURE__ */ r("div", _object_spread_props(_object_spread({}, T(_object_spread({
214
224
  "component-name": "Hero"
215
- }, l))), {
216
- ref: c,
217
- style: _object_spread({}, r === "100vh" ? {
225
+ }, c))), {
226
+ ref: d,
227
+ style: _object_spread_props(_object_spread({}, e === "100vh" ? {
218
228
  maxHeight: "-webkit-fill-available"
219
- } : {}, I({
220
- [H.height]: typeof r == "number" ? `${r}px` : r !== null && r !== void 0 ? r : "100%",
221
- [g.mediaBorderRadius]: $.borderRadii.container
222
- })),
223
- className: s(D({
229
+ } : {}, x({
230
+ [H.height]: typeof e == "number" ? `${e}px` : e !== null && e !== void 0 ? e : "100%",
231
+ [y.mediaBorderRadius]: i.borderRadii.container
232
+ })), {
233
+ background: k[o]
234
+ }),
235
+ className: O({
224
236
  height: "100%"
225
- }), S[t]),
226
- children: /* @__PURE__ */ e(T, {
237
+ }),
238
+ children: /* @__PURE__ */ r(w, {
227
239
  isInverse: N,
228
- children: /* @__PURE__ */ e(W, {
240
+ children: /* @__PURE__ */ r(A, {
229
241
  template: "6+6",
230
- left: /* @__PURE__ */ e(p, {
231
- paddingTop: o ? 0 : 56,
232
- paddingBottom: o && !h ? 0 : 56,
233
- className: s(u, b, {
234
- [C]: !o
242
+ left: /* @__PURE__ */ r(m, {
243
+ paddingTop: t ? 0 : 56,
244
+ paddingBottom: t && !u ? 0 : 56,
245
+ className: h(v, S, {
246
+ [C]: !t
235
247
  }),
236
- children: k
248
+ children: I
237
249
  }),
238
- right: /* @__PURE__ */ e(p, {
239
- paddingTop: o ? 0 : 56,
240
- paddingBottom: o && !h ? 0 : 56,
241
- className: s(u, b),
250
+ right: /* @__PURE__ */ r(m, {
251
+ paddingTop: t ? 0 : 56,
252
+ paddingBottom: t && !u ? 0 : 56,
253
+ className: h(v, S),
242
254
  children: L
243
255
  })
244
256
  })
245
257
  })
246
258
  }));
247
- }), de = U;
248
- export { de as default };
259
+ }), dr = q;
260
+ export { dr as default };
@@ -1,2 +1,2 @@
1
- const o = "15.4.0";
1
+ const o = "15.5.0";
2
2
  export { o as PACKAGE_VERSION };
@@ -1,7 +1,7 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./responsive-layout.css.ts.vanilla.css-mistica.js";
3
- var e = 16, r = 40, n = 32, v = {
3
+ var e = 16, a = 40, n = 32, t = {
4
4
  inverse: "_1y2v1nf3z",
5
5
  alternative: "_1y2v1nf44"
6
- }, i = "_17lofg74", t = "_17lofg73", _ = "_17lofg7a _1y2v1nfi7", f = "_17lofg75", l = "_17lofg78", p = "_17lofg72 _1y2v1nfi7";
7
- export { e as MOBILE_SIDE_MARGIN, r as SMALL_DESKTOP_SIDE_MARGIN, n as TABLET_SIDE_MARGIN, v as backgroundVariant, i as expandedResponsiveLayoutContainerDesktop, t as expandedResponsiveLayoutContainerMobile, _ as fullWidth, f as fullwidthContainer, l as responsiveLayout, p as responsiveLayoutContainer };
6
+ }, i = "_17lofg77", v = "_17lofg78", _ = "_17lofg7a", f = "_17lofg7f _1y2v1nfi7", l = "_17lofg79", g = "_17lofg73", s = "_17lofg72", M = "_17lofg75", p = "_17lofg74", C = "_17lofg7d", D = "_17lofg76";
7
+ export { e as MOBILE_SIDE_MARGIN, a as SMALL_DESKTOP_SIDE_MARGIN, n as TABLET_SIDE_MARGIN, t as backgroundVariant, i as desktopContainer, v as forcedMarginDesktopContainer, _ as forcedMarginMobileContainer, f as fullWidth, l as mobileContainer, g as resetContainerDesktop, s as resetContainerMobile, M as resetDesktop, p as resetMobile, C as responsiveLayout, D as responsiveLayoutContainer };
@@ -78,38 +78,54 @@ function _object_without_properties_loose(source, excluded) {
78
78
  }
79
79
  return target;
80
80
  }
81
- import { jsx as a } from "react/jsx-runtime";
82
- import r from "classnames";
83
- import { getPrefixedDataAttributes as l } from "./utils/dom.js";
84
- import { fullwidthContainer as c, responsiveLayoutContainer as f, backgroundVariant as y, expandedResponsiveLayoutContainerMobile as L, expandedResponsiveLayoutContainerDesktop as x, fullWidth as R, responsiveLayout as V } from "./responsive-layout.css-mistica.js";
85
- import { useThemeVariant as h, ThemeVariant as b } from "./theme-variant-context.js";
86
- const C = (param)=>{
87
- let { children: n, isInverse: o = !1, variant: p, backgroundColor: s, className: u, fullWidth: e, dataAttributes: d, shouldExpandWhenNested: i = !1, innerDivClassName: m } = param;
88
- const v = h(), t = p || o && "inverse" || void 0;
89
- return /* @__PURE__ */ a(b, {
90
- variant: t !== null && t !== void 0 ? t : v,
91
- children: /* @__PURE__ */ a("div", _object_spread_props(_object_spread({
92
- className: r(e ? c : f, u, t && t !== "default" && y[t], {
93
- [L]: i === !0 && !e,
94
- [x]: i && !e
95
- }),
81
+ import { jsx as t } from "react/jsx-runtime";
82
+ import o from "classnames";
83
+ import { getPrefixedDataAttributes as f } from "./utils/dom.js";
84
+ import { backgroundVariant as v, desktopContainer as p, forcedMarginDesktopContainer as y, mobileContainer as h, forcedMarginMobileContainer as C, responsiveLayoutContainer as L, fullWidth as b, responsiveLayout as R, resetContainerMobile as V, resetContainerDesktop as g, resetMobile as M, resetDesktop as N } from "./responsive-layout.css-mistica.js";
85
+ import { useThemeVariant as x, ThemeVariant as D } from "./theme-variant-context.js";
86
+ const k = (param)=>{
87
+ let { children: a, isInverse: e = !1, variant: r, backgroundColor: s, className: d, fullWidth: i, dataAttributes: m, shouldExpandWhenNested: l = !1, innerDivClassName: c } = param;
88
+ const u = x(), n = r || e && "inverse" || void 0;
89
+ return /* @__PURE__ */ t(D, {
90
+ variant: n !== null && n !== void 0 ? n : u,
91
+ children: /* @__PURE__ */ t("div", _object_spread_props(_object_spread({
92
+ className: o(d, n && n !== "default" && v[n], ...i ? [] : [
93
+ l ? p : y,
94
+ l === !0 ? h : C,
95
+ L
96
+ ]),
96
97
  style: s ? {
97
98
  background: s
98
99
  } : void 0
99
- }, l(d)), {
100
- children: /* @__PURE__ */ a("div", {
101
- className: r(e ? R : V, m),
102
- children: n
100
+ }, f(m)), {
101
+ children: /* @__PURE__ */ t("div", {
102
+ className: o(i ? b : R, c),
103
+ children: a
103
104
  })
104
105
  }))
105
106
  });
106
- }, g = (_param)=>{
107
- var { children: n } = _param, o = _object_without_properties(_param, [
107
+ }, T = (_param)=>{
108
+ var { children: a } = _param, e = _object_without_properties(_param, [
108
109
  "children"
109
110
  ]);
110
- return /* @__PURE__ */ a(C, _object_spread_props(_object_spread({}, o), {
111
+ return /* @__PURE__ */ t(k, _object_spread_props(_object_spread({}, e), {
111
112
  shouldExpandWhenNested: !0,
112
- children: n
113
+ children: a
113
114
  }));
114
- }, w = g;
115
- export { C as InternalResponsiveLayout, w as default };
115
+ }, q = (param)=>{
116
+ let { children: a, skipMobile: e = !1, skipDesktop: r = !1 } = param;
117
+ return /* @__PURE__ */ t("div", {
118
+ className: o({
119
+ [V]: !e,
120
+ [g]: !r
121
+ }),
122
+ children: /* @__PURE__ */ t("div", {
123
+ className: o({
124
+ [M]: !e,
125
+ [N]: !r
126
+ }),
127
+ children: a
128
+ })
129
+ });
130
+ }, w = T;
131
+ export { k as InternalResponsiveLayout, q as ResetResponsiveLayout, w as default };