@telefonica/mistica 15.3.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.
Files changed (254) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.css-mistica.js +5 -5
  3. package/dist/accordion.d.ts +3 -3
  4. package/dist/accordion.js +75 -71
  5. package/dist/avatar.css-mistica.js +3 -3
  6. package/dist/avatar.js +1 -1
  7. package/dist/badge.css-mistica.js +4 -4
  8. package/dist/box.d.ts +1 -0
  9. package/dist/box.js +11 -10
  10. package/dist/boxed.css-mistica.js +1 -1
  11. package/dist/button-group.css-mistica.js +1 -1
  12. package/dist/button-layout.css-mistica.js +10 -10
  13. package/dist/button.css-mistica.js +31 -31
  14. package/dist/button.js +59 -46
  15. package/dist/callout.css-mistica.js +1 -1
  16. package/dist/card.css-mistica.js +19 -16
  17. package/dist/card.css.d.ts +1 -0
  18. package/dist/card.d.ts +7 -5
  19. package/dist/card.js +376 -351
  20. package/dist/carousel.css-mistica.js +18 -18
  21. package/dist/carousel.d.ts +3 -4
  22. package/dist/carousel.js +167 -169
  23. package/dist/checkbox.css-mistica.js +10 -10
  24. package/dist/chip.css-mistica.js +15 -9
  25. package/dist/chip.css.d.ts +2 -0
  26. package/dist/chip.js +49 -47
  27. package/dist/circle.css-mistica.js +1 -1
  28. package/dist/community/advanced-data-card.css-mistica.js +20 -17
  29. package/dist/community/advanced-data-card.css.d.ts +1 -0
  30. package/dist/community/advanced-data-card.d.ts +2 -2
  31. package/dist/community/advanced-data-card.js +26 -25
  32. package/dist/community/blocks.css-mistica.js +1 -1
  33. package/dist/community/blocks.js +10 -8
  34. package/dist/counter.css-mistica.js +9 -9
  35. package/dist/credit-card-number-field.css-mistica.js +6 -6
  36. package/dist/dialog.css-mistica.js +9 -9
  37. package/dist/dialog.js +96 -94
  38. package/dist/double-field.css-mistica.js +4 -4
  39. package/dist/empty-state-card.css-mistica.js +4 -4
  40. package/dist/empty-state.css-mistica.js +6 -6
  41. package/dist/feedback.css-mistica.js +6 -6
  42. package/dist/feedback.d.ts +1 -1
  43. package/dist/feedback.js +87 -99
  44. package/dist/fixed-footer-layout.css-mistica.js +13 -7
  45. package/dist/fixed-footer-layout.css.d.ts +2 -0
  46. package/dist/fixed-footer-layout.d.ts +1 -1
  47. package/dist/fixed-footer-layout.js +79 -88
  48. package/dist/fixed-to-top.d.ts +1 -0
  49. package/dist/fixed-to-top.js +9 -6
  50. package/dist/generated/mistica-icons/icon-ethernet-filled.d.ts +4 -0
  51. package/dist/generated/mistica-icons/icon-ethernet-filled.js +111 -0
  52. package/dist/generated/mistica-icons/icon-ethernet-light.d.ts +4 -0
  53. package/dist/generated/mistica-icons/icon-ethernet-light.js +111 -0
  54. package/dist/generated/mistica-icons/icon-ethernet-regular.d.ts +4 -0
  55. package/dist/generated/mistica-icons/icon-ethernet-regular.js +111 -0
  56. package/dist/generated/mistica-icons/icon-routine-filled.d.ts +4 -0
  57. package/dist/generated/mistica-icons/icon-routine-filled.js +111 -0
  58. package/dist/generated/mistica-icons/icon-routine-light.d.ts +4 -0
  59. package/dist/generated/mistica-icons/icon-routine-light.js +111 -0
  60. package/dist/generated/mistica-icons/icon-routine-regular.d.ts +4 -0
  61. package/dist/generated/mistica-icons/icon-routine-regular.js +111 -0
  62. package/dist/header.css-mistica.js +1 -1
  63. package/dist/hero.css-mistica.js +8 -9
  64. package/dist/hero.css.d.ts +1 -1
  65. package/dist/hero.d.ts +1 -1
  66. package/dist/hero.js +99 -100
  67. package/dist/highlighted-card.css-mistica.js +6 -6
  68. package/dist/hooks.d.ts +2 -0
  69. package/dist/hooks.js +39 -44
  70. package/dist/horizontal-scroll.css-mistica.js +1 -1
  71. package/dist/icon-button.css-mistica.js +7 -7
  72. package/dist/icons/icon-error.js +2 -0
  73. package/dist/icons/icon-info.js +2 -0
  74. package/dist/icons/icon-success-vivo-new.js +1 -0
  75. package/dist/icons/icon-success-vivo.js +9 -8
  76. package/dist/image.css-mistica.js +3 -3
  77. package/dist/image.d.ts +1 -0
  78. package/dist/image.js +51 -49
  79. package/dist/index.d.ts +6 -0
  80. package/dist/index.js +24 -0
  81. package/dist/list.css-mistica.js +13 -13
  82. package/dist/list.d.ts +3 -0
  83. package/dist/list.js +261 -217
  84. package/dist/loading-bar.css-mistica.js +5 -5
  85. package/dist/loading-screen.css-mistica.js +8 -8
  86. package/dist/loading-screen.d.ts +1 -1
  87. package/dist/logo.js +40 -27
  88. package/dist/maybe-dismissable.css-mistica.js +1 -1
  89. package/dist/menu.css-mistica.js +3 -3
  90. package/dist/navigation-bar.css-mistica.js +19 -19
  91. package/dist/navigation-breadcrumbs.css-mistica.js +5 -5
  92. package/dist/overscroll-color-context.d.ts +1 -0
  93. package/dist/overscroll-color-context.js +15 -12
  94. package/dist/package-version.js +1 -1
  95. package/dist/pin-field.css-mistica.js +5 -5
  96. package/dist/progress-bar.css-mistica.js +3 -3
  97. package/dist/radio-button.css-mistica.js +10 -10
  98. package/dist/radio-button.d.ts +2 -0
  99. package/dist/radio-button.js +68 -66
  100. package/dist/responsive-layout.css-mistica.js +29 -14
  101. package/dist/responsive-layout.css.d.ts +8 -3
  102. package/dist/responsive-layout.d.ts +5 -0
  103. package/dist/responsive-layout.js +36 -17
  104. package/dist/screen-reader-only.css-mistica.js +2 -2
  105. package/dist/select.css-mistica.js +10 -10
  106. package/dist/sheet.css-mistica.js +9 -9
  107. package/dist/sheet.d.ts +8 -8
  108. package/dist/skeletons.css-mistica.js +4 -4
  109. package/dist/skins/blau.js +11 -1
  110. package/dist/skins/movistar.js +11 -1
  111. package/dist/skins/o2-new.d.ts +0 -1
  112. package/dist/skins/o2-new.js +17 -8
  113. package/dist/skins/o2.js +11 -1
  114. package/dist/skins/skin-contract.css-mistica.js +268 -258
  115. package/dist/skins/skin-contract.css.d.ts +10 -0
  116. package/dist/skins/telefonica.js +11 -1
  117. package/dist/skins/tu.js +11 -1
  118. package/dist/skins/types/colors.d.ts +5 -0
  119. package/dist/skins/vivo-new.js +11 -1
  120. package/dist/skins/vivo.js +11 -1
  121. package/dist/slider.css-mistica.js +9 -9
  122. package/dist/slider.d.ts +1 -1
  123. package/dist/snackbar.css-mistica.js +15 -15
  124. package/dist/spinner.css-mistica.js +3 -3
  125. package/dist/sprinkles.css-mistica.js +833 -803
  126. package/dist/stacking-group.css-mistica.js +2 -2
  127. package/dist/stepper.css-mistica.js +9 -9
  128. package/dist/switch-component.css-mistica.js +21 -21
  129. package/dist/switch-component.d.ts +2 -0
  130. package/dist/switch-component.js +28 -27
  131. package/dist/tabs.css-mistica.js +10 -10
  132. package/dist/tag.css-mistica.js +2 -2
  133. package/dist/text-field-base.css-mistica.js +16 -16
  134. package/dist/text-field-components.css-mistica.js +9 -9
  135. package/dist/text-field-components.js +8 -8
  136. package/dist/text-link.css-mistica.js +3 -3
  137. package/dist/text.js +70 -70
  138. package/dist/theme-context-provider.d.ts +1 -0
  139. package/dist/theme-context-provider.js +47 -43
  140. package/dist/theme.d.ts +2 -1
  141. package/dist/tooltip.css-mistica.js +4 -4
  142. package/dist/touchable.css-mistica.js +2 -2
  143. package/dist/utils/aspect-ratio-support.css-mistica.js +3 -3
  144. package/dist/video.css-mistica.js +1 -1
  145. package/dist/video.js +1 -1
  146. package/dist-es/accordion.css-mistica.js +3 -3
  147. package/dist-es/accordion.js +87 -83
  148. package/dist-es/avatar.css-mistica.js +2 -2
  149. package/dist-es/avatar.js +1 -1
  150. package/dist-es/badge.css-mistica.js +2 -2
  151. package/dist-es/box.js +13 -12
  152. package/dist-es/boxed.css-mistica.js +1 -1
  153. package/dist-es/button-group.css-mistica.js +1 -1
  154. package/dist-es/button-layout.css-mistica.js +6 -6
  155. package/dist-es/button.css-mistica.js +18 -18
  156. package/dist-es/button.js +77 -64
  157. package/dist-es/callout.css-mistica.js +1 -1
  158. package/dist-es/card.css-mistica.js +2 -2
  159. package/dist-es/card.js +491 -466
  160. package/dist-es/carousel.css-mistica.js +2 -2
  161. package/dist-es/carousel.js +166 -165
  162. package/dist-es/checkbox.css-mistica.js +6 -6
  163. package/dist-es/chip.css-mistica.js +8 -8
  164. package/dist-es/chip.js +75 -72
  165. package/dist-es/circle.css-mistica.js +1 -1
  166. package/dist-es/community/advanced-data-card.css-mistica.js +7 -7
  167. package/dist-es/community/advanced-data-card.js +70 -69
  168. package/dist-es/community/blocks.css-mistica.js +1 -1
  169. package/dist-es/community/blocks.js +16 -14
  170. package/dist-es/counter.css-mistica.js +2 -2
  171. package/dist-es/credit-card-number-field.css-mistica.js +4 -4
  172. package/dist-es/dialog.css-mistica.js +5 -5
  173. package/dist-es/dialog.js +114 -112
  174. package/dist-es/double-field.css-mistica.js +4 -4
  175. package/dist-es/empty-state-card.css-mistica.js +2 -2
  176. package/dist-es/empty-state.css-mistica.js +3 -3
  177. package/dist-es/feedback.css-mistica.js +2 -2
  178. package/dist-es/feedback.js +119 -131
  179. package/dist-es/fixed-footer-layout.css-mistica.js +3 -3
  180. package/dist-es/fixed-footer-layout.js +98 -107
  181. package/dist-es/fixed-to-top.js +8 -8
  182. package/dist-es/generated/mistica-icons/icon-ethernet-filled.js +102 -0
  183. package/dist-es/generated/mistica-icons/icon-ethernet-light.js +102 -0
  184. package/dist-es/generated/mistica-icons/icon-ethernet-regular.js +102 -0
  185. package/dist-es/generated/mistica-icons/icon-routine-filled.js +102 -0
  186. package/dist-es/generated/mistica-icons/icon-routine-light.js +102 -0
  187. package/dist-es/generated/mistica-icons/icon-routine-regular.js +102 -0
  188. package/dist-es/header.css-mistica.js +1 -1
  189. package/dist-es/hero.css-mistica.js +2 -3
  190. package/dist-es/hero.js +121 -122
  191. package/dist-es/highlighted-card.css-mistica.js +5 -5
  192. package/dist-es/hooks.js +41 -40
  193. package/dist-es/horizontal-scroll.css-mistica.js +1 -1
  194. package/dist-es/icon-button.css-mistica.js +7 -7
  195. package/dist-es/icons/icon-error.js +29 -27
  196. package/dist-es/icons/icon-info.js +2 -0
  197. package/dist-es/icons/icon-success-vivo-new.js +1 -0
  198. package/dist-es/icons/icon-success-vivo.js +9 -8
  199. package/dist-es/image.css-mistica.js +2 -2
  200. package/dist-es/image.js +70 -68
  201. package/dist-es/index.js +1088 -1082
  202. package/dist-es/list.css-mistica.js +2 -2
  203. package/dist-es/list.js +342 -298
  204. package/dist-es/loading-bar.css-mistica.js +2 -2
  205. package/dist-es/loading-screen.css-mistica.js +3 -3
  206. package/dist-es/logo.js +93 -80
  207. package/dist-es/maybe-dismissable.css-mistica.js +1 -1
  208. package/dist-es/menu.css-mistica.js +2 -2
  209. package/dist-es/navigation-bar.css-mistica.js +9 -9
  210. package/dist-es/navigation-breadcrumbs.css-mistica.js +2 -2
  211. package/dist-es/overscroll-color-context.js +12 -12
  212. package/dist-es/package-version.js +1 -1
  213. package/dist-es/pin-field.css-mistica.js +2 -2
  214. package/dist-es/progress-bar.css-mistica.js +2 -2
  215. package/dist-es/radio-button.css-mistica.js +6 -6
  216. package/dist-es/radio-button.js +70 -68
  217. package/dist-es/responsive-layout.css-mistica.js +5 -5
  218. package/dist-es/responsive-layout.js +41 -25
  219. package/dist-es/screen-reader-only.css-mistica.js +2 -2
  220. package/dist-es/select.css-mistica.js +9 -9
  221. package/dist-es/sheet.css-mistica.js +2 -2
  222. package/dist-es/skeletons.css-mistica.js +2 -2
  223. package/dist-es/skins/blau.js +11 -1
  224. package/dist-es/skins/movistar.js +13 -3
  225. package/dist-es/skins/o2-new.js +17 -8
  226. package/dist-es/skins/o2.js +11 -1
  227. package/dist-es/skins/skin-contract.css-mistica.js +268 -258
  228. package/dist-es/skins/telefonica.js +11 -1
  229. package/dist-es/skins/tu.js +13 -3
  230. package/dist-es/skins/vivo-new.js +13 -3
  231. package/dist-es/skins/vivo.js +13 -3
  232. package/dist-es/slider.css-mistica.js +2 -2
  233. package/dist-es/snackbar.css-mistica.js +5 -5
  234. package/dist-es/spinner.css-mistica.js +2 -2
  235. package/dist-es/sprinkles.css-mistica.js +833 -803
  236. package/dist-es/stacking-group.css-mistica.js +2 -2
  237. package/dist-es/stepper.css-mistica.js +2 -2
  238. package/dist-es/style.css +1 -1
  239. package/dist-es/switch-component.css-mistica.js +19 -19
  240. package/dist-es/switch-component.js +32 -31
  241. package/dist-es/tabs.css-mistica.js +7 -7
  242. package/dist-es/tag.css-mistica.js +2 -2
  243. package/dist-es/text-field-base.css-mistica.js +2 -2
  244. package/dist-es/text-field-components.css-mistica.js +2 -2
  245. package/dist-es/text-field-components.js +15 -15
  246. package/dist-es/text-link.css-mistica.js +3 -3
  247. package/dist-es/text.js +76 -76
  248. package/dist-es/theme-context-provider.js +88 -84
  249. package/dist-es/tooltip.css-mistica.js +2 -2
  250. package/dist-es/touchable.css-mistica.js +2 -2
  251. package/dist-es/utils/aspect-ratio-support.css-mistica.js +3 -3
  252. package/dist-es/video.css-mistica.js +1 -1
  253. package/dist-es/video.js +1 -1
  254. package/package.json +1 -1
package/dist-es/hero.js CHANGED
@@ -79,37 +79,43 @@ function _object_without_properties_loose(source, excluded) {
79
79
  return target;
80
80
  }
81
81
  import { jsx as r, jsxs as p } from "react/jsx-runtime";
82
- import * as T from "react";
83
- import u from "classnames";
82
+ import * as $ from "react";
83
+ import h from "classnames";
84
84
  import { useScreenSize as j } from "./hooks.js";
85
- import { Text3 as b, Text8 as G } from "./text.js";
86
- import $ from "./grid-layout.js";
85
+ import { Text3 as g, Text8 as G } from "./text.js";
86
+ import A from "./grid-layout.js";
87
87
  import m from "./box.js";
88
- import N from "./stack.js";
89
- import A from "./button-group.js";
88
+ import R from "./stack.js";
89
+ import E from "./button-group.js";
90
90
  import { vars as i } from "./skins/skin-contract.css-mistica.js";
91
- import { container as v, containerMobile as V, containerMinHeight as C, mediaContainer as z, layout as y, containerDesktop as B, actions as E, vars as R } from "./hero.css-mistica.js";
92
- import { vars as S } from "./image.css-mistica.js";
93
- import { useIsInsideSlideshowContext as K } from "./carousel.js";
94
- import { getPrefixedDataAttributes as k } from "./utils/dom.js";
95
- import { sprinkles as w } from "./sprinkles.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
96
  import { useIsInverseVariant as M } from "./theme-variant-context.js";
97
- import { applyCssVars as h } from "./utils/css.js";
98
- import { InternalResponsiveLayout as U } from "./responsive-layout.js";
99
- const H = (param)=>{
100
- let { children: o, isInverse: e, isInsideSlideShow: a } = param;
101
- return /* @__PURE__ */ r(U, {
102
- isInverse: e,
103
- className: y,
104
- innerDivClassName: y,
105
- shouldExpandWhenNested: a ? "desktop" : !0,
106
- backgroundColor: "transparent",
107
- children: o
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
- }, g = (param)=>{
110
- let { headline: o, title: e, titleAs: a = "h1", pretitle: s, description: l, descriptionLinesMax: n, extra: t, button: c, secondaryButton: f, buttonLink: d } = param;
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;
111
117
  return /* @__PURE__ */ p("section", {
112
- className: w({
118
+ className: O({
113
119
  height: "100%",
114
120
  display: "flex",
115
121
  justifyContent: "space-between",
@@ -118,56 +124,50 @@ const H = (param)=>{
118
124
  children: [
119
125
  /* @__PURE__ */ p("div", {
120
126
  children: [
121
- /* @__PURE__ */ p(N, {
127
+ /* @__PURE__ */ p(R, {
122
128
  space: 16,
123
129
  children: [
124
- o && o,
125
- /* @__PURE__ */ p(N, {
130
+ e && e,
131
+ /* @__PURE__ */ p(R, {
126
132
  space: 8,
127
133
  children: [
128
- s && /* @__PURE__ */ r(b, {
134
+ l && /* @__PURE__ */ r(g, {
129
135
  as: "p",
130
136
  regular: !0,
131
- children: s
137
+ children: l
132
138
  }),
133
- e && /* @__PURE__ */ r(G, {
139
+ o && /* @__PURE__ */ r(G, {
134
140
  as: a,
135
- children: e
141
+ children: o
136
142
  })
137
143
  ]
138
144
  }),
139
- l && /* @__PURE__ */ r(b, {
145
+ c && /* @__PURE__ */ r(g, {
140
146
  as: "p",
141
147
  regular: !0,
142
148
  color: i.colors.textSecondary,
143
- truncate: n,
144
- children: l
149
+ truncate: t,
150
+ children: c
145
151
  })
146
152
  ]
147
153
  }),
148
- t && /* @__PURE__ */ r("div", {
149
- children: t
154
+ n && /* @__PURE__ */ r("div", {
155
+ children: n
150
156
  })
151
157
  ]
152
158
  }),
153
- (c || d) && /* @__PURE__ */ r("div", {
154
- className: E,
155
- children: /* @__PURE__ */ r(A, {
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: d
164
+ link: s
159
165
  })
160
166
  })
161
167
  ]
162
168
  });
163
- }, I = {
164
- default: i.colors.background,
165
- alternative: i.colors.backgroundAlternative,
166
- brand: i.colors.backgroundBrand,
167
- "brand-secondary": i.colors.backgroundBrandSecondary,
168
- none: "transparent"
169
- }, W = /*#__PURE__*/ T.forwardRef((_param, c)=>{
170
- var { height: o, background: e = "default", media: a, desktopMediaPosition: s = "left", dataAttributes: l, noPaddingY: n } = _param, t = _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, [
171
171
  "height",
172
172
  "background",
173
173
  "media",
@@ -175,87 +175,86 @@ const H = (param)=>{
175
175
  "dataAttributes",
176
176
  "noPaddingY"
177
177
  ]);
178
- const { isTabletOrSmaller: f } = j(), d = K(), D = M(), x = e === "none" ? D : e === "brand" || e === "brand-secondary";
179
- if (f) return /* @__PURE__ */ r("div", {
180
- style: h({
181
- [S.mediaBorderRadius]: "0px"
182
- }),
183
- children: /* @__PURE__ */ r("div", _object_spread_props(_object_spread({}, k(_object_spread({
184
- "component-name": "Hero"
185
- }, l))), {
186
- ref: c,
187
- style: _object_spread({
188
- backgroundColor: I[e]
189
- }, o === "100vh" ? {
190
- maxHeight: "-webkit-fill-available"
191
- } : {}, h({
192
- [R.height]: o !== null && o !== void 0 ? o : "100%"
193
- })),
194
- className: u(v, V, {
195
- [C]: !n
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"
196
183
  }),
197
- children: /* @__PURE__ */ p(H, {
198
- isInverse: x,
199
- isInsideSlideShow: d,
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
+ }),
200
197
  children: [
201
- /* @__PURE__ */ r("div", {
202
- className: z,
203
- children: a
204
- }),
205
- /* @__PURE__ */ r(m, {
206
- paddingTop: 24,
207
- paddingBottom: d ? 48 : n ? 0 : 24,
208
- className: y,
209
- children: /* @__PURE__ */ r(g, _object_spread({}, t))
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
+ })
210
+ })
210
211
  })
211
212
  ]
212
- })
213
- }))
213
+ }))
214
+ })
214
215
  });
215
- const O = s === "left" ? a : /* @__PURE__ */ r(m, {
216
+ const I = l === "left" ? a : /* @__PURE__ */ r(m, {
216
217
  paddingRight: 24,
217
- children: /* @__PURE__ */ r(g, _object_spread({}, t))
218
- }), L = s === "right" ? a : /* @__PURE__ */ r(m, {
218
+ children: /* @__PURE__ */ r(b, _object_spread({}, n))
219
+ }), L = l === "right" ? a : /* @__PURE__ */ r(m, {
219
220
  paddingLeft: 24,
220
- children: /* @__PURE__ */ r(g, _object_spread({}, t))
221
+ children: /* @__PURE__ */ r(b, _object_spread({}, n))
221
222
  });
222
- return /* @__PURE__ */ r("div", {
223
- style: h({
224
- [S.mediaBorderRadius]: i.borderRadii.container
223
+ return /* @__PURE__ */ r("div", _object_spread_props(_object_spread({}, T(_object_spread({
224
+ "component-name": "Hero"
225
+ }, c))), {
226
+ ref: d,
227
+ style: _object_spread_props(_object_spread({}, e === "100vh" ? {
228
+ maxHeight: "-webkit-fill-available"
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]
225
234
  }),
226
- children: /* @__PURE__ */ r("div", _object_spread_props(_object_spread({}, k(_object_spread({
227
- "component-name": "Hero"
228
- }, l))), {
229
- ref: c,
230
- style: _object_spread({
231
- backgroundColor: I[e]
232
- }, o === "100vh" ? {
233
- maxHeight: "-webkit-fill-available"
234
- } : {}, h({
235
- [R.height]: o !== null && o !== void 0 ? o : "100%"
236
- })),
237
- className: w({
238
- height: "100%"
239
- }),
240
- children: /* @__PURE__ */ r(H, {
241
- isInverse: x,
242
- children: /* @__PURE__ */ r($, {
243
- template: "6+6",
244
- left: /* @__PURE__ */ r(m, {
245
- paddingY: n ? 0 : 56,
246
- className: u(v, B, {
247
- [C]: !n
248
- }),
249
- children: O
235
+ className: O({
236
+ height: "100%"
237
+ }),
238
+ children: /* @__PURE__ */ r(w, {
239
+ isInverse: N,
240
+ children: /* @__PURE__ */ r(A, {
241
+ template: "6+6",
242
+ left: /* @__PURE__ */ r(m, {
243
+ paddingTop: t ? 0 : 56,
244
+ paddingBottom: t && !u ? 0 : 56,
245
+ className: h(v, S, {
246
+ [C]: !t
250
247
  }),
251
- right: /* @__PURE__ */ r(m, {
252
- paddingY: n ? 0 : 56,
253
- className: u(v, B),
254
- children: L
255
- })
248
+ children: I
249
+ }),
250
+ right: /* @__PURE__ */ r(m, {
251
+ paddingTop: t ? 0 : 56,
252
+ paddingBottom: t && !u ? 0 : 56,
253
+ className: h(v, S),
254
+ children: L
256
255
  })
257
256
  })
258
- }))
259
- });
260
- }), lr = W;
261
- export { lr as default };
257
+ })
258
+ }));
259
+ }), dr = q;
260
+ export { dr as default };
@@ -1,7 +1,7 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./highlighted-card.css.ts.vanilla.css-mistica.js";
3
- var f = "wrb8722 _1y2v1nfha _1y2v1nfhf _1y2v1nfhm _1y2v1nfhs", y = "wrb8725 _1y2v1nfha", _ = {
4
- withImage: "wrb8728 wrb8727 _1y2v1nfha _1y2v1nfhg _1y2v1nfho _1y2v1nf7o _1y2v1nf8x _1y2v1nfa0",
5
- withoutImage: "wrb8729 wrb8727 _1y2v1nfha _1y2v1nfhg _1y2v1nfho _1y2v1nf7o _1y2v1nf8x _1y2v1nfa0"
6
- }, a = "_1y2v1nf73 _1y2v1nf8c _1y2v1nf9l _1y2v1nfau _1y2v1nfha _1y2v1nfhs _1y2v1nfjs _1y2v1nfhx _1y2v1nf72";
7
- export { f as container, y as imageContent, _ as textContainerVariant, a as touchableContainer };
3
+ var y = "wrb8722 _1y2v1nfhk _1y2v1nfhp _1y2v1nfhw _1y2v1nfi2", f = "wrb8725 _1y2v1nfhk", _ = {
4
+ withImage: "wrb8728 wrb8727 _1y2v1nfhk _1y2v1nfhq _1y2v1nfhy _1y2v1nf7y _1y2v1nf97 _1y2v1nfaa",
5
+ withoutImage: "wrb8729 wrb8727 _1y2v1nfhk _1y2v1nfhq _1y2v1nfhy _1y2v1nf7y _1y2v1nf97 _1y2v1nfaa"
6
+ }, a = "_1y2v1nf7d _1y2v1nf8m _1y2v1nf9v _1y2v1nfb4 _1y2v1nfhk _1y2v1nfi2 _1y2v1nfk2 _1y2v1nfi7 _1y2v1nf7c";
7
+ export { y as container, f as imageContent, _ as textContainerVariant, a as touchableContainer };
package/dist-es/hooks.js CHANGED
@@ -1,30 +1,30 @@
1
1
  import * as r from "react";
2
- import S from "./theme-context.js";
3
- import b from "./screen-size-context.js";
4
- import y from "./aria-id-getter-context.js";
5
- import { listenResize as W } from "./utils/dom.js";
2
+ import b from "./theme-context.js";
3
+ import y from "./screen-size-context.js";
4
+ import W from "./aria-id-getter-context.js";
5
+ import { listenResize as x } from "./utils/dom.js";
6
6
  import { isClientSide as h } from "./utils/environment.js";
7
- import { isEqual as v } from "./utils/helpers.js";
8
- const x = ()=>{
9
- const t = r.useContext(S);
7
+ import { isEqual as E } from "./utils/helpers.js";
8
+ const H = ()=>{
9
+ const t = r.useContext(b);
10
10
  if (!t) throw Error("To use @telefonica/mistica components you must instantiate <ThemeContextProvider> as their parent.");
11
11
  return t;
12
12
  };
13
- let l = "", w = 0, a = 0;
14
- const A = (t)=>{
13
+ let a = "", m = 0, w = 0;
14
+ const L = (t)=>{
15
15
  r.useEffect(()=>{
16
16
  if (t) {
17
17
  const n = document.scrollingElement || document.documentElement, e = ()=>{
18
18
  var i;
19
19
  var _ref, _ref1;
20
- if (a++, !(a > 1) && (w = (_ref = n == null ? void 0 : n.scrollTop) !== null && _ref !== void 0 ? _ref : 0, l = (_ref1 = (i = document.body) == null ? void 0 : i.style.cssText) !== null && _ref1 !== void 0 ? _ref1 : "", document.body)) {
20
+ if (w++, !(w > 1) && (m = (_ref = n == null ? void 0 : n.scrollTop) !== null && _ref !== void 0 ? _ref : 0, a = (_ref1 = (i = document.body) == null ? void 0 : i.style.cssText) !== null && _ref1 !== void 0 ? _ref1 : "", document.body)) {
21
21
  var _ref2;
22
22
  const o = window.innerWidth > ((_ref2 = n == null ? void 0 : n.clientWidth) !== null && _ref2 !== void 0 ? _ref2 : window.innerWidth) ? "scroll" : "hidden";
23
- document.body.style.cssText = l + (l.endsWith(";") ? "" : ";") + [
23
+ document.body.style.cssText = a + (a.endsWith(";") ? "" : ";") + [
24
24
  "overflow: hidden;",
25
25
  `overflow-y: ${o};`,
26
26
  "position: fixed;",
27
- `top: ${-w}px;`,
27
+ `top: ${-m}px;`,
28
28
  "left: 0px;",
29
29
  "right: 0px;",
30
30
  "bottom: 0px;",
@@ -32,7 +32,7 @@ const A = (t)=>{
32
32
  ].join("");
33
33
  }
34
34
  }, s = ()=>{
35
- a--, !(a > 0) && (document.body && (document.body.style.cssText = l), n && (n.scrollTop = w));
35
+ w--, !(w > 0) && (document.body && (document.body.style.cssText = a), n && (n.scrollTop = m));
36
36
  };
37
37
  return e(), s;
38
38
  }
@@ -40,14 +40,14 @@ const A = (t)=>{
40
40
  }, [
41
41
  t
42
42
  ]);
43
- }, L = ()=>r.useContext(b), M = ()=>{
43
+ }, M = ()=>r.useContext(y), q = ()=>{
44
44
  const [t, n] = r.useState(0), [e, s] = r.useState(0), [i, c] = r.useState(null), o = r.useCallback((d)=>{
45
45
  if (!d) {
46
46
  n(0), s(0);
47
47
  return;
48
48
  }
49
- const { width: m, height: g } = d[0].contentRect;
50
- n(m), s(g);
49
+ const { width: f, height: l } = d[0].contentRect;
50
+ n(f), s(l);
51
51
  }, []), u = r.useCallback((d)=>{
52
52
  c(d);
53
53
  }, []);
@@ -56,7 +56,7 @@ const A = (t)=>{
56
56
  n(0), s(0);
57
57
  return;
58
58
  }
59
- return W(i, o);
59
+ return x(i, o);
60
60
  }, [
61
61
  i,
62
62
  o
@@ -65,45 +65,46 @@ const A = (t)=>{
65
65
  height: e,
66
66
  ref: u
67
67
  };
68
- }, q = (t)=>{
69
- const { useId: n } = x();
68
+ }, D = (t)=>{
69
+ const { useId: n } = H();
70
70
  if (n) {
71
71
  const e = n();
72
72
  return t || e;
73
73
  } else {
74
- const e = r.useContext(y);
74
+ const e = r.useContext(W);
75
75
  return r.useRef(t || e()).current;
76
76
  }
77
- }, f = ()=>{
78
- const [t, n] = r.useState(h() ? window.innerHeight : 1200), [e, s] = r.useState(h() ? window.innerWidth : 800), [i, c] = r.useState(h() ? window.screen.availHeight : 1200), [o, u] = r.useState(h() ? window.screen.availWidth : 800);
77
+ }, v = ()=>{
78
+ var l;
79
+ const [t, n] = r.useState(h() ? window.innerHeight : 1200), [e, s] = r.useState(h() ? window.innerWidth : 800), [i, c] = r.useState(h() ? window.screen.availHeight : 1200), [o, u] = r.useState(h() ? window.screen.availWidth : 800), [d, f] = r.useState(h() ? ((l = window.visualViewport) == null ? void 0 : l.height) || window.screen.availHeight : 1200);
79
80
  return r.useEffect(()=>{
80
- const d = ()=>{
81
- n(window.innerHeight), s(window.innerWidth), c(window.screen.availHeight), u(window.screen.availWidth);
81
+ const g = ()=>{
82
+ var S;
83
+ n(window.innerHeight), s(window.innerWidth), c(window.screen.availHeight), u(window.screen.availWidth), f(((S = window.visualViewport) == null ? void 0 : S.height) || window.screen.availHeight);
82
84
  };
83
- return window.addEventListener("resize", d), ()=>{
84
- window.removeEventListener("resize", d);
85
+ return window.addEventListener("resize", g), ()=>{
86
+ window.removeEventListener("resize", g);
85
87
  };
86
88
  }, []), r.useMemo(()=>({
87
89
  height: t,
88
90
  width: e,
89
91
  screenHeight: i,
90
- screenWidth: o
92
+ screenWidth: o,
93
+ visualHeight: d
91
94
  }), [
92
95
  t,
93
96
  e,
94
97
  i,
95
- o
98
+ o,
99
+ d
96
100
  ]);
97
- }, D = ()=>{
98
- const { height: t } = f();
101
+ }, k = ()=>{
102
+ const { height: t } = v();
99
103
  return t;
100
104
  }, F = ()=>{
101
- const { width: t } = f();
102
- return t;
103
- }, V = ()=>{
104
- const { screenHeight: t } = f();
105
+ const { width: t } = v();
105
106
  return t;
106
- }, k = ()=>h() && window.top !== window.self, $ = h() ? r.useLayoutEffect : r.useEffect, E = (t, n, e)=>{
107
+ }, $ = h() ? r.useLayoutEffect : r.useEffect, I = (t, n, e)=>{
107
108
  const [s, i] = r.useState(n);
108
109
  return r.useEffect(()=>{
109
110
  if (!t.current) return;
@@ -124,7 +125,7 @@ const A = (t)=>{
124
125
  e == null ? void 0 : e.rootMargin,
125
126
  e == null ? void 0 : e.threshold
126
127
  ]), s;
127
- }, I = (t)=>{
128
+ }, T = (t)=>{
128
129
  const { top: n, right: e, bottom: s, left: i, width: c, height: o, x: u, y: d } = t.getBoundingClientRect();
129
130
  return {
130
131
  top: n,
@@ -138,13 +139,13 @@ const A = (t)=>{
138
139
  };
139
140
  }, j = function(t) {
140
141
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
141
- const [s, i] = r.useState(), c = E(t, !1);
142
+ const [s, i] = r.useState(), c = I(t, !1);
142
143
  return r.useEffect(()=>{
143
144
  let o;
144
145
  const u = ()=>{
145
146
  if (t.current && (c || e)) {
146
- const d = I(t.current);
147
- v(s, d) || i(d), n && (o = requestAnimationFrame(u));
147
+ const d = T(t.current);
148
+ E(s, d) || i(d), n && (o = requestAnimationFrame(u));
148
149
  } else i(void 0);
149
150
  };
150
151
  return o = requestAnimationFrame(u), ()=>{
@@ -158,4 +159,4 @@ const A = (t)=>{
158
159
  e
159
160
  ]), s;
160
161
  };
161
- export { q as useAriaId, j as useBoundingRect, A as useDisableBodyScroll, M as useElementDimensions, E as useIsInViewport, k as useIsWithinIFrame, $ as useIsomorphicLayoutEffect, V as useScreenHeight, L as useScreenSize, x as useTheme, D as useWindowHeight, f as useWindowSize, F as useWindowWidth };
162
+ export { D as useAriaId, j as useBoundingRect, L as useDisableBodyScroll, q as useElementDimensions, I as useIsInViewport, $ as useIsomorphicLayoutEffect, M as useScreenSize, H as useTheme, k as useWindowHeight, v as useWindowSize, F as useWindowWidth };
@@ -1,5 +1,5 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./responsive-layout.css.ts.vanilla.css-mistica.js";
3
3
  import "./horizontal-scroll.css.ts.vanilla.css-mistica.js";
4
- var m = "_1gl3gmv2", v = "_1gl3gmv1 _1y2v1nfha";
4
+ var m = "_1gl3gmv2", v = "_1gl3gmv1 _1y2v1nfhk";
5
5
  export { m as noScrollbar, v as scroll };
@@ -10,9 +10,9 @@ var a = {
10
10
  default: "yqt1oe1a",
11
11
  small: "yqt1oe1b"
12
12
  }, o = {
13
- default: "yqt1oe12 _1y2v1nf73 _1y2v1nf8c _1y2v1nf9l _1y2v1nfau _1y2v1nfjs _1y2v1nf72 _1y2v1nfha _1y2v1nfhp _1y2v1nfhj",
14
- small: "yqt1oe13 _1y2v1nf73 _1y2v1nf8c _1y2v1nf9l _1y2v1nfau _1y2v1nfjs _1y2v1nf72 _1y2v1nfha _1y2v1nfhp _1y2v1nfhj"
15
- }, y = "yqt1oe1m _1y2v1nfhe", v = "yqt1oey", l = "yqt1oe1i _1y2v1nfh4 _1y2v1nfhb", f = {
13
+ default: "yqt1oe12 _1y2v1nf7d _1y2v1nf8m _1y2v1nf9v _1y2v1nfb4 _1y2v1nfk2 _1y2v1nf7c _1y2v1nfhk _1y2v1nfhz _1y2v1nfht",
14
+ small: "yqt1oe13 _1y2v1nf7d _1y2v1nf8m _1y2v1nf9v _1y2v1nfb4 _1y2v1nfk2 _1y2v1nf7c _1y2v1nfhk _1y2v1nfhz _1y2v1nfht"
15
+ }, y = "yqt1oe1m _1y2v1nfho", v = "yqt1oey", l = "yqt1oe1i _1y2v1nfhe _1y2v1nfhl", f = {
16
16
  "brand-solid-default": "yqt1oe4",
17
17
  "brand-solid-inverse": "yqt1oe5",
18
18
  "brand-solid-alternative": "yqt1oe6",
@@ -44,13 +44,13 @@ var a = {
44
44
  "neutral-media": "yqt1oew",
45
45
  "danger-media": "yqt1oex"
46
46
  }, d = {
47
- default: "yqt1oe1e yqt1oe1d _1y2v1nfjt _1y2v1nfha _1y2v1nfhp _1y2v1nfhj _1y2v1nfkb _1y2v1nfh4",
48
- small: "yqt1oe1f yqt1oe1d _1y2v1nfjt _1y2v1nfha _1y2v1nfhp _1y2v1nfhj _1y2v1nfkb _1y2v1nfh4"
47
+ default: "yqt1oe1e yqt1oe1d _1y2v1nfk3 _1y2v1nfhk _1y2v1nfhz _1y2v1nfht _1y2v1nfkl _1y2v1nfhe",
48
+ small: "yqt1oe1f yqt1oe1d _1y2v1nfk3 _1y2v1nfhk _1y2v1nfhz _1y2v1nfht _1y2v1nfkl _1y2v1nfhe"
49
49
  }, i = {
50
50
  default: "calc(1.5rem + 24px)",
51
51
  small: "calc(1.25rem + 12px)"
52
52
  }, q = {
53
53
  default: "1.5rem",
54
54
  small: "1.25rem"
55
- }, s = "yqt1oez", _ = "yqt1oe15", u = "yqt1oe1g", m = "yqt1oe10", p = "yqt1oe1k _1y2v1nfh5";
56
- export { a as bleedLeft, n as bleedRight, r as bleedY, o as buttonContainer, y as deprecatedIconButtonBase, v as disabled, l as icon, f as iconButtonTokens, d as iconContainer, i as iconContainerSize, q as iconSize, s as isLoading, _ as minimumInteractiveArea, u as overlay, m as overlayContainer, p as spinner };
55
+ }, s = "yqt1oez", _ = "yqt1oe15", u = "yqt1oe1g", m = "yqt1oe10", h = "yqt1oe1k _1y2v1nfhf";
56
+ export { a as bleedLeft, n as bleedRight, r as bleedY, o as buttonContainer, y as deprecatedIconButtonBase, v as disabled, l as icon, f as iconButtonTokens, d as iconContainer, i as iconContainerSize, q as iconSize, s as isLoading, _ as minimumInteractiveArea, u as overlay, m as overlayContainer, h as spinner };