@telefonica/mistica 16.4.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 (108) hide show
  1. package/css/mistica.css +1 -1
  2. package/css/vivo-new.css +11 -11
  3. package/dist/accordion.css-mistica.js +16 -13
  4. package/dist/accordion.css.d.ts +1 -0
  5. package/dist/accordion.d.ts +4 -0
  6. package/dist/accordion.js +110 -93
  7. package/dist/callout.js +27 -15
  8. package/dist/card.css-mistica.js +5 -5
  9. package/dist/card.d.ts +9 -1
  10. package/dist/card.js +611 -475
  11. package/dist/community/advanced-data-card.css-mistica.js +14 -11
  12. package/dist/community/advanced-data-card.css.d.ts +1 -0
  13. package/dist/community/advanced-data-card.d.ts +1 -1
  14. package/dist/community/advanced-data-card.js +172 -85
  15. package/dist/cover-hero.css-mistica.js +14 -11
  16. package/dist/cover-hero.css.d.ts +1 -0
  17. package/dist/cover-hero.d.ts +1 -0
  18. package/dist/cover-hero.js +101 -59
  19. package/dist/empty-state.js +24 -15
  20. package/dist/header.css-mistica.js +6 -3
  21. package/dist/header.css.d.ts +1 -0
  22. package/dist/header.d.ts +3 -2
  23. package/dist/header.js +148 -79
  24. package/dist/hero.css-mistica.js +11 -8
  25. package/dist/hero.css.d.ts +1 -0
  26. package/dist/hero.d.ts +2 -1
  27. package/dist/hero.js +102 -68
  28. package/dist/highlighted-card.js +32 -23
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +4 -0
  31. package/dist/maybe-dismissable.js +8 -5
  32. package/dist/meter.d.ts +23 -0
  33. package/dist/meter.js +400 -0
  34. package/dist/mosaic.d.ts +6 -2
  35. package/dist/mosaic.js +50 -48
  36. package/dist/navigation-bar.css-mistica.js +96 -37
  37. package/dist/navigation-bar.css.d.ts +27 -1
  38. package/dist/navigation-bar.d.ts +65 -30
  39. package/dist/navigation-bar.js +818 -193
  40. package/dist/package-version.js +1 -1
  41. package/dist/sheet-common.css-mistica.js +16 -10
  42. package/dist/sheet-common.css.d.ts +3 -1
  43. package/dist/sheet-common.js +78 -70
  44. package/dist/sheet-info.css-mistica.js +15 -4
  45. package/dist/sheet-info.css.d.ts +2 -0
  46. package/dist/sheet-info.d.ts +3 -0
  47. package/dist/sheet-info.js +61 -43
  48. package/dist/sheet-native.js +59 -48
  49. package/dist/sheet-types.d.ts +6 -1
  50. package/dist/sheet-web.js +6 -4
  51. package/dist/skins/blau.js +94 -94
  52. package/dist/skins/movistar.js +94 -94
  53. package/dist/skins/o2-new.js +94 -94
  54. package/dist/skins/o2.js +94 -94
  55. package/dist/skins/telefonica.js +94 -94
  56. package/dist/skins/tu.js +94 -94
  57. package/dist/skins/vivo-new.js +98 -98
  58. package/dist/skins/vivo.js +94 -94
  59. package/dist/text-tokens.d.ts +14 -0
  60. package/dist/text-tokens.js +134 -102
  61. package/dist/theme-context-provider.js +60 -50
  62. package/dist/theme.d.ts +3 -2
  63. package/dist/theme.js +20 -17
  64. package/dist/utils/headings.d.ts +2 -0
  65. package/dist/utils/headings.js +11 -0
  66. package/dist/utils/types.d.ts +1 -0
  67. package/dist-es/accordion.css-mistica.js +7 -7
  68. package/dist-es/accordion.js +140 -123
  69. package/dist-es/callout.js +55 -43
  70. package/dist-es/card.css-mistica.js +2 -2
  71. package/dist-es/card.js +721 -588
  72. package/dist-es/community/advanced-data-card.css-mistica.js +3 -3
  73. package/dist-es/community/advanced-data-card.js +217 -130
  74. package/dist-es/cover-hero.css-mistica.js +3 -3
  75. package/dist-es/cover-hero.js +132 -90
  76. package/dist-es/empty-state.js +40 -31
  77. package/dist-es/header.css-mistica.js +2 -2
  78. package/dist-es/header.js +174 -104
  79. package/dist-es/hero.css-mistica.js +2 -2
  80. package/dist-es/hero.js +150 -115
  81. package/dist-es/highlighted-card.js +36 -27
  82. package/dist-es/index.js +1839 -1838
  83. package/dist-es/maybe-dismissable.js +17 -14
  84. package/dist-es/meter.js +346 -0
  85. package/dist-es/mosaic.js +73 -71
  86. package/dist-es/navigation-bar.css-mistica.js +14 -15
  87. package/dist-es/navigation-bar.js +864 -240
  88. package/dist-es/package-version.js +1 -1
  89. package/dist-es/sheet-common.css-mistica.js +2 -2
  90. package/dist-es/sheet-common.js +124 -116
  91. package/dist-es/sheet-info.css-mistica.js +2 -2
  92. package/dist-es/sheet-info.js +74 -56
  93. package/dist-es/sheet-native.js +59 -48
  94. package/dist-es/sheet-web.js +10 -8
  95. package/dist-es/skins/blau.js +94 -94
  96. package/dist-es/skins/movistar.js +94 -94
  97. package/dist-es/skins/o2-new.js +94 -94
  98. package/dist-es/skins/o2.js +94 -94
  99. package/dist-es/skins/telefonica.js +94 -94
  100. package/dist-es/skins/tu.js +94 -94
  101. package/dist-es/skins/vivo-new.js +98 -98
  102. package/dist-es/skins/vivo.js +94 -94
  103. package/dist-es/style.css +1 -1
  104. package/dist-es/text-tokens.js +72 -52
  105. package/dist-es/theme-context-provider.js +88 -78
  106. package/dist-es/theme.js +20 -20
  107. package/dist-es/utils/headings.js +2 -0
  108. package/package.json +2 -1
@@ -11,26 +11,29 @@ function _export(target, all) {
11
11
  }
12
12
  _export(exports, {
13
13
  FunnelNavigationBar: function() {
14
- return fn;
14
+ return Rt;
15
15
  },
16
16
  MainNavigationBar: function() {
17
- return hn;
17
+ return At;
18
18
  },
19
19
  NavigationBar: function() {
20
- return vn;
20
+ return Dn;
21
21
  },
22
22
  NavigationBarAction: function() {
23
- return Bn;
23
+ return Tt;
24
24
  },
25
25
  NavigationBarActionGroup: function() {
26
- return Nn;
26
+ return xt;
27
+ },
28
+ useMainNavigationBarDesktopMenuState: function() {
29
+ return D;
27
30
  }
28
31
  });
29
32
  const _jsxruntime = require("react/jsx-runtime");
30
33
  const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
31
34
  const _reacttransitiongroup = require("react-transition-group");
32
35
  const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
33
- const _responsivelayout = /*#__PURE__*/ _interop_require_default(require("./responsive-layout.js"));
36
+ const _responsivelayout = /*#__PURE__*/ _interop_require_wildcard(require("./responsive-layout.js"));
34
37
  const _inline = /*#__PURE__*/ _interop_require_default(require("./inline.js"));
35
38
  const _touchable = /*#__PURE__*/ _interop_require_wildcard(require("./touchable.js"));
36
39
  const _text = require("./text.js");
@@ -39,7 +42,6 @@ const _iconmenuregular = /*#__PURE__*/ _interop_require_default(require("./gener
39
42
  const _iconcloseregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-close-regular.js"));
40
43
  const _iconchevronleftregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-chevron-left-regular.js"));
41
44
  const _iconbutton = require("./icon-button.js");
42
- const _negativebox = /*#__PURE__*/ _interop_require_default(require("./negative-box.js"));
43
45
  const _list = require("./list.js");
44
46
  const _themevariantcontext = require("./theme-variant-context.js");
45
47
  const _focustrap = /*#__PURE__*/ _interop_require_default(require("./focus-trap.js"));
@@ -54,6 +56,14 @@ const _stack = /*#__PURE__*/ _interop_require_default(require("./stack.js"));
54
56
  const _box = /*#__PURE__*/ _interop_require_default(require("./box.js"));
55
57
  const _platform = require("./utils/platform.js");
56
58
  const _texttokens = require("./text-tokens.js");
59
+ const _theme = require("./theme.js");
60
+ const _textlink = /*#__PURE__*/ _interop_require_default(require("./text-link.js"));
61
+ const _title = require("./title.js");
62
+ const _button = require("./button.js");
63
+ const _grid = require("./grid.js");
64
+ const _keys = require("./utils/keys.js");
65
+ const _helpers = require("./utils/helpers.js");
66
+ const _negativebox = /*#__PURE__*/ _interop_require_default(require("./negative-box.js"));
57
67
  function _interop_require_default(obj) {
58
68
  return obj && obj.__esModule ? obj : {
59
69
  default: obj
@@ -179,7 +189,20 @@ function _object_without_properties_loose(source, excluded) {
179
189
  }
180
190
  return target;
181
191
  }
182
- const Ge = (param)=>{
192
+ const Tn = 120, Ln = (param)=>{
193
+ let { size: n = 24, color: t = _skincontractcssmistica.vars.colors.neutralHigh, style: i, className: r } = param;
194
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("svg", {
195
+ width: n,
196
+ height: n,
197
+ viewBox: "0 0 8 8",
198
+ style: i,
199
+ className: r,
200
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("path", {
201
+ d: "M6.32595 3.46071L3.03801 0.158595L3.03292 0.153747L3.032 0.152903L3.02931 0.150463L3.02848 0.149738L3.02248 0.144353C2.88533 0.021206 2.71386 -0.0126731 2.56343 0.00394249C2.41648 0.0201739 2.27272 0.0856702 2.16886 0.18711C2.06893 0.281844 2.01209 0.42816 2.00175 0.567065C1.99083 0.71377 2.02925 0.889583 2.16869 1.02392L5.24446 4.00145L2.15859 6.96199L2.15375 6.96708L2.1529 6.968L2.15046 6.97069L2.14974 6.97152L2.14435 6.97752C2.02121 7.11467 1.98733 7.28614 2.00394 7.43657C2.02017 7.58352 2.08567 7.72728 2.18711 7.83114C2.28184 7.93107 2.42816 7.98791 2.56706 7.99825C2.71377 8.00917 2.88958 7.97075 3.02392 7.83132L6.32595 4.5422V4.5422C6.6246 4.24355 6.6246 3.75935 6.32595 3.46071V3.46071Z",
202
+ fill: t
203
+ })
204
+ });
205
+ }, yn = (param)=>{
183
206
  let { isOpen: n } = param;
184
207
  return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
185
208
  className: _navigationbarcssmistica.burgerIconContainer,
@@ -196,192 +219,50 @@ const Ge = (param)=>{
196
219
  })
197
220
  ]
198
221
  });
199
- }, He = 300, O = (param)=>{
200
- let { children: n, topFixed: o, withBorder: t, isMenuOpen: r, variant: a = "default", dataAttributes: s } = param;
201
- const { isDarkMode: c } = (0, _hooks.useTheme)(), d = ()=>a === "inverse" && !c || !t ? _navigationbarcssmistica.navbarBorderColorVariants.noBorder : r ? _navigationbarcssmistica.navbarBorderColorVariants.menuOpen : _navigationbarcssmistica.navbarBorderColorVariants.default, m = {
222
+ }, ee = (param)=>{
223
+ let { children: n, topFixed: t, withBorder: i, isBurgerMenuOpen: r, variant: s = "default", dataAttributes: d } = param;
224
+ const { isDarkMode: c } = (0, _hooks.useTheme)(), u = ()=>s === "inverse" && !c || !i ? _navigationbarcssmistica.navbarBorderColorVariants.noBorder : r ? _navigationbarcssmistica.navbarBorderColorVariants.menuOpen : _navigationbarcssmistica.navbarBorderColorVariants.default, p = {
202
225
  default: _skincontractcssmistica.vars.colors.background,
203
226
  inverse: _skincontractcssmistica.vars.colors.navigationBarBackground,
204
227
  alternative: _skincontractcssmistica.vars.colors.backgroundAlternative,
205
228
  media: _skincontractcssmistica.vars.colors.navigationBarBackground
206
229
  };
207
230
  return /* @__PURE__ */ (0, _jsxruntime.jsx)("header", _object_spread_props(_object_spread({
208
- className: (0, _classnames.default)(d(), {
209
- [_navigationbarcssmistica.topFixed]: o
231
+ className: (0, _classnames.default)(u(), {
232
+ [_navigationbarcssmistica.topFixed]: t
210
233
  }),
211
234
  style: {
212
- background: m[a]
235
+ background: p[s]
213
236
  }
214
- }, (0, _dom.getPrefixedDataAttributes)(s)), {
237
+ }, (0, _dom.getPrefixedDataAttributes)(d)), {
215
238
  children: n
216
239
  }));
217
- }, b = (param)=>{
218
- let { right: n, children: o, desktopOnly: t } = param;
240
+ }, U = /*#__PURE__*/ _react.forwardRef((param, s)=>{
241
+ let { right: n, children: t, desktopOnly: i, expandRightContent: r } = param;
219
242
  return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
243
+ ref: s,
220
244
  className: (0, _classnames.default)(_navigationbarcssmistica.navigationBarContent, {
221
- [_navigationbarcssmistica.desktopOnly]: t
245
+ [_navigationbarcssmistica.desktopOnly]: i
222
246
  }),
223
247
  children: [
224
- o,
248
+ t,
225
249
  n && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
226
- className: _navigationbarcssmistica.navigationBarContentRight,
250
+ className: r ? _navigationbarcssmistica.navigationBarContentRightExpanded : _navigationbarcssmistica.navigationBarContentRight,
227
251
  children: n
228
252
  })
229
253
  ]
230
254
  });
231
- }, hn = (param)=>{
232
- let { sections: n = [], selectedIndex: o, right: t, variant: r = "default", topFixed: a = !0, withBorder: s = !0, burgerMenuExtra: c, logo: d, large: m = !1 } = param;
233
- const { texts: u, isDarkMode: g, t: R } = (0, _hooks.useTheme)(), [l, y] = _react.useState(!1), [E, h] = _react.useState("closed"), L = _react.useId(), J = g ? 1 : 0.2, { isTabletOrSmaller: K } = (0, _hooks.useScreenSize)(), w = (0, _modalcontextprovider.useSetModalState)(), Q = d || /* @__PURE__ */ (0, _jsxruntime.jsx)(_logo.Logo, {
234
- size: {
235
- mobile: 40,
236
- desktop: 48
237
- }
238
- }), D = ()=>/* @__PURE__ */ (0, _jsxruntime.jsx)("nav", {
239
- className: _navigationbarcssmistica.desktopOnly,
240
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
241
- space: 32,
242
- children: n.map((_param, v)=>{
243
- var { title: k } = _param, x = _object_without_properties(_param, [
244
- "title"
245
- ]);
246
- return /* @__PURE__ */ /*#__PURE__*/ (0, _react.createElement)(_touchable.BaseTouchable, _object_spread_props(_object_spread({}, x), {
247
- key: v,
248
- className: (0, _classnames.default)(_navigationbarcssmistica.section, {
249
- [_navigationbarcssmistica.selectedSectionVariantes[r === "inverse" ? "inverse" : "default"]]: v === o
250
- }, _navigationbarcssmistica.textWrapperVariants[r === "inverse" ? "inverse" : "default"])
251
- }), /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
252
- regular: !0,
253
- color: "inherit",
254
- children: k
255
- }));
256
- })
257
- })
258
- }), I = m && n.length > 0, X = ()=>{
259
- y(!0), w({
260
- isModalOpen: !0
261
- });
262
- }, V = ()=>{
263
- y(!1), w({
264
- isModalOpen: !1
265
- });
266
- }, F = E !== "open", G = n.length > 1, H = /* @__PURE__ */ (0, _jsxruntime.jsxs)(_themevariantcontext.ThemeVariant, {
267
- variant: r,
268
- children: [
269
- /* @__PURE__ */ (0, _jsxruntime.jsx)(O, {
270
- topFixed: a,
271
- withBorder: s,
272
- isMenuOpen: l,
273
- variant: r,
274
- dataAttributes: {
275
- "component-name": "MainNavigationBar"
276
- },
277
- children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_responsivelayout.default, {
278
- children: [
279
- /* @__PURE__ */ (0, _jsxruntime.jsx)(b, {
280
- right: t,
281
- children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
282
- className: _navigationbarcssmistica.mainNavbarContent,
283
- children: [
284
- G && /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.default, {
285
- className: _navigationbarcssmistica.burgerMenuButton,
286
- "aria-live": "polite",
287
- "aria-label": l ? u.closeNavigationMenu || R(_texttokens.closeNavigationMenu) : u.openNavigationMenu || R(_texttokens.openNavigationMenu),
288
- "aria-expanded": l,
289
- "aria-controls": L,
290
- onPress: l ? V : X,
291
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(Ge, {
292
- isOpen: l
293
- })
294
- }),
295
- /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
296
- className: _navigationbarcssmistica.logoContainer,
297
- children: Q
298
- }),
299
- !I && D()
300
- ]
301
- })
302
- }),
303
- I && /* @__PURE__ */ (0, _jsxruntime.jsx)(b, {
304
- desktopOnly: !0,
305
- children: D()
306
- })
307
- ]
308
- })
309
- }),
310
- a && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
311
- className: I ? _navigationbarcssmistica.spacerLarge : _navigationbarcssmistica.spacer
312
- })
313
- ]
314
- });
315
- return K ? /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
316
- children: [
317
- /* @__PURE__ */ (0, _jsxruntime.jsx)(_focustrap.default, {
318
- disabled: F,
319
- group: "burger-menu-lock",
320
- children: H
321
- }),
322
- G && /* @__PURE__ */ (0, _jsxruntime.jsx)(_portal.Portal, {
323
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_focustrap.default, {
324
- disabled: F,
325
- group: "burger-menu-lock",
326
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_reacttransitiongroup.Transition, {
327
- onEntering: ()=>{
328
- h("opening");
329
- },
330
- onEntered: ()=>{
331
- h("open");
332
- },
333
- onExiting: ()=>{
334
- h("closing");
335
- },
336
- onExited: ()=>{
337
- h("closed");
338
- },
339
- in: l,
340
- timeout: (0, _platform.isRunningAcceptanceTest)() ? 0 : He,
341
- unmountOnExit: !0,
342
- children: (k)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
343
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)("nav", {
344
- className: (0, _classnames.default)(_navigationbarcssmistica.burgerMenu, _navigationbarcssmistica.burgerMenuTransition[k]),
345
- style: {
346
- boxShadow: E !== "closed" ? `6px 0 4px -4px rgba(0, 0, 0, ${J})` : "none"
347
- },
348
- id: L,
349
- onClick: ()=>{
350
- V();
351
- },
352
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_responsivelayout.default, {
353
- children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
354
- space: 16,
355
- children: [
356
- /* @__PURE__ */ (0, _jsxruntime.jsx)(_negativebox.default, {
357
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_list.RowList, {
358
- children: n.map((x, v)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(_list.Row, _object_spread({}, x), v))
359
- })
360
- }),
361
- c && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
362
- paddingBottom: 16,
363
- children: c
364
- })
365
- ]
366
- })
367
- })
368
- })
369
- })
370
- })
371
- })
372
- })
373
- ]
374
- }) : H;
375
- }, vn = (param)=>{
376
- let { onBack: n, title: o, titleAs: t, right: r, variant: a = "default", topFixed: s = !0, paddingX: c = 0, withBorder: d = !0 } = param;
377
- const { texts: m, t: u } = (0, _hooks.useTheme)(), g = /* @__PURE__ */ (0, _jsxruntime.jsx)(b, {
255
+ }), Dn = (param)=>{
256
+ let { onBack: n, title: t, titleAs: i, right: r, variant: s = "default", topFixed: d = !0, paddingX: c = 0, withBorder: u = !0 } = param;
257
+ const { texts: p, t: a } = (0, _hooks.useTheme)(), f = /* @__PURE__ */ (0, _jsxruntime.jsx)(U, {
378
258
  right: r,
259
+ expandRightContent: !0,
379
260
  children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_inline.default, {
380
261
  space: 24,
381
262
  alignItems: "center",
382
263
  children: [
383
264
  n && /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.IconButton, {
384
- "aria-label": m.backNavigationBar || u(_texttokens.backNavigationBar),
265
+ "aria-label": p.backNavigationBar || a(_texttokens.backNavigationBar),
385
266
  onPress: n,
386
267
  Icon: _iconchevronleftregular.default,
387
268
  bleedLeft: !0,
@@ -390,59 +271,803 @@ const Ge = (param)=>{
390
271
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
391
272
  regular: !0,
392
273
  truncate: !0,
393
- as: t,
394
- children: o
274
+ as: i,
275
+ children: t
395
276
  })
396
277
  ]
397
278
  })
398
279
  });
399
280
  return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_themevariantcontext.ThemeVariant, {
400
- variant: a,
281
+ variant: s,
401
282
  children: [
402
- /* @__PURE__ */ (0, _jsxruntime.jsx)(O, {
403
- topFixed: s,
404
- withBorder: d,
405
- variant: a,
283
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(ee, {
284
+ topFixed: d,
285
+ withBorder: u,
286
+ variant: s,
406
287
  dataAttributes: {
407
288
  "component-name": "NavigationBar"
408
289
  },
409
- children: s ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_responsivelayout.default, {
410
- children: g
290
+ children: d ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_responsivelayout.default, {
291
+ children: f
411
292
  }) : /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
412
293
  style: {
413
294
  padding: `0 ${c}px`,
414
295
  width: "100%"
415
296
  },
416
- children: g
297
+ children: f
417
298
  })
418
299
  }),
419
- s && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
300
+ d && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
420
301
  className: _navigationbarcssmistica.spacer
421
302
  })
422
303
  ]
423
304
  });
424
- }, fn = (param)=>{
425
- let { logo: n, right: o, variant: t = "default", topFixed: r = !0, withBorder: a = !0 } = param;
305
+ }, K = (n, t)=>n.href === void 0 && n.onPress === void 0 && n.to === void 0 ? {
306
+ onPress: t
307
+ } : n.onPress ? {
308
+ onPress: ()=>{
309
+ n.onPress(), t();
310
+ }
311
+ } : _object_spread_props(_object_spread({}, n), {
312
+ onNavigate: ()=>t()
313
+ }), Pn = {
314
+ opening: {
315
+ close: "closing",
316
+ finishOpen: "opened"
317
+ },
318
+ opened: {
319
+ close: "closing"
320
+ },
321
+ closing: {
322
+ open: "opening",
323
+ finishClose: "closed"
324
+ },
325
+ closed: {
326
+ open: "opening"
327
+ }
328
+ }, wn = (n, t)=>Pn[n][t] || n, Hn = (param)=>{
329
+ let { section: n, closeSubMenu: t, closeMenu: i } = param;
330
+ const { texts: r, t: s } = (0, _hooks.useTheme)(), { title: d, menu: c } = n, u = _object_without_properties(n, [
331
+ "title",
332
+ "menu"
333
+ ]), p = (c == null ? void 0 : c.columns) || [], a = c == null ? void 0 : c.content, f = u.href !== void 0 || u.onPress !== void 0 || u.to !== void 0;
334
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_responsivelayout.default, {
335
+ children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
336
+ space: 32,
337
+ children: [
338
+ /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
339
+ space: 16,
340
+ children: [
341
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(Dn, {
342
+ title: r.backNavigationBar || s(_texttokens.backNavigationBar),
343
+ onBack: t,
344
+ topFixed: !1,
345
+ withBorder: !1
346
+ }),
347
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_title.Title3, {
348
+ right: f ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_button.ButtonLink, _object_spread_props(_object_spread({
349
+ small: !0,
350
+ bleedY: !0,
351
+ bleedRight: !0,
352
+ withChevron: !0
353
+ }, K(u, i)), {
354
+ children: r.mainNavigationBarSectionSeeAll || s(_texttokens.mainNavigationBarSectionSeeAll)
355
+ })) : void 0,
356
+ children: d
357
+ })
358
+ ]
359
+ }),
360
+ a ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
361
+ paddingBottom: 16,
362
+ children: typeof a == "function" ? a({
363
+ closeMenu: i
364
+ }) : a
365
+ }) : p.map((m, l)=>/* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
366
+ space: 8,
367
+ children: [
368
+ /* @__PURE__ */ (0, _jsxruntime.jsxs)(_title.Title1, {
369
+ children: [
370
+ " ",
371
+ m.title
372
+ ]
373
+ }),
374
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_negativebox.default, {
375
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_list.RowList, {
376
+ children: m.items.map((_param, h)=>{
377
+ var { title: M } = _param, B = _object_without_properties(_param, [
378
+ "title"
379
+ ]);
380
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_list.Row, _object_spread({
381
+ title: M
382
+ }, K(B, i)), h);
383
+ })
384
+ })
385
+ })
386
+ ]
387
+ }, l))
388
+ ]
389
+ })
390
+ });
391
+ }, _n = (param)=>{
392
+ let { sections: n, extra: t, closeMenu: i, open: r, id: s, disableFocusTrap: d, setDisableFocusTrap: c } = param;
393
+ const { isDarkMode: u, texts: p, t: a } = (0, _hooks.useTheme)(), [f, m] = _react.useState(-1), [l, M] = _react.useState(!1), [B, h] = _react.useReducer(wn, "closed"), k = _react.useRef(null), I = u ? 1 : 0.2, N = (0, _platform.isRunningAcceptanceTest)() ? 0 : _navigationbarcssmistica.BURGER_MENU_ANIMATION_DURATION_MS;
394
+ _react.useEffect(()=>{
395
+ let b;
396
+ return l ? (h("open"), b = setTimeout(()=>h("finishOpen"), N)) : (h("close"), b = setTimeout(()=>h("finishClose"), N)), ()=>clearTimeout(b);
397
+ }, [
398
+ l,
399
+ N
400
+ ]);
401
+ const A = _react.useRef(null);
402
+ return _react.useEffect(()=>{
403
+ var b;
404
+ if (B === "opening") {
405
+ const g = (b = A.current) == null ? void 0 : b.querySelector(`button[aria-label="${p.backNavigationBar || a(_texttokens.backNavigationBar)}"]`);
406
+ g == null || g.focus();
407
+ }
408
+ }, [
409
+ B,
410
+ a,
411
+ p
412
+ ]), /* @__PURE__ */ (0, _jsxruntime.jsx)(_portal.Portal, {
413
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_focustrap.default, {
414
+ disabled: d,
415
+ group: "burger-menu-lock",
416
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_reacttransitiongroup.CSSTransition, {
417
+ onEntered: ()=>c(!1),
418
+ onExiting: ()=>c(!0),
419
+ onExited: ()=>{
420
+ M(!1), m(-1);
421
+ },
422
+ classNames: _navigationbarcssmistica.burgerMenuTransition,
423
+ in: r,
424
+ nodeRef: k,
425
+ timeout: N,
426
+ mountOnEnter: !0,
427
+ unmountOnExit: !0,
428
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("nav", {
429
+ className: _navigationbarcssmistica.burgerMenu,
430
+ style: {
431
+ boxShadow: `6px 0 4px -4px rgba(0, 0, 0, ${I})`
432
+ },
433
+ id: s,
434
+ ref: k,
435
+ children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
436
+ className: _navigationbarcssmistica.burgerMenuContainer,
437
+ children: [
438
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
439
+ className: _navigationbarcssmistica.burgerMenuContentContainer,
440
+ style: {
441
+ transform: `translate(${l ? "-100vw" : "0"})`
442
+ },
443
+ children: B !== "opened" && /* @__PURE__ */ (0, _jsxruntime.jsxs)(_responsivelayout.default, {
444
+ children: [
445
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_responsivelayout.ResetResponsiveLayout, {
446
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_list.RowList, {
447
+ children: n.map((_param, x)=>{
448
+ var { title: b, menu: g } = _param, O = _object_without_properties(_param, [
449
+ "title",
450
+ "menu"
451
+ ]);
452
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_list.Row, _object_spread({
453
+ title: b
454
+ }, g ? {
455
+ onPress: ()=>{
456
+ M(!0), m(x);
457
+ }
458
+ } : K(O, i)), x);
459
+ })
460
+ })
461
+ }),
462
+ t && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
463
+ paddingY: 16,
464
+ children: t
465
+ })
466
+ ]
467
+ })
468
+ }),
469
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
470
+ className: _navigationbarcssmistica.burgerMenuContentContainer,
471
+ ref: A,
472
+ style: {
473
+ transform: `translate(${l ? "0" : "100vw"})`
474
+ },
475
+ children: B !== "closed" && f !== -1 && /* @__PURE__ */ (0, _jsxruntime.jsx)(Hn, {
476
+ section: n[f],
477
+ closeMenu: i,
478
+ closeSubMenu: ()=>M(!1)
479
+ })
480
+ })
481
+ ]
482
+ })
483
+ })
484
+ })
485
+ })
486
+ });
487
+ }, $n = {
488
+ opening: {
489
+ close: "closing",
490
+ finishOpen: "opened"
491
+ },
492
+ opened: {
493
+ close: "closing"
494
+ },
495
+ closing: {
496
+ // If a section was opened while the menu was closing, the menu should be considered as
497
+ // already open. This is useful for example to avoid the new content's fade-in animation
498
+ open: "opened",
499
+ finishClose: "closed"
500
+ },
501
+ closed: {
502
+ open: "opening"
503
+ }
504
+ }, Fn = (n, t)=>$n[n][t] || n, Ce = /*#__PURE__*/ _react.createContext({
505
+ isMenuOpen: !1,
506
+ openedSection: -1,
507
+ menuHeight: "0px",
508
+ menuStatus: "closed",
509
+ openSectionMenu: ()=>{},
510
+ closeMenu: ()=>{},
511
+ setMenuHeight: ()=>{},
512
+ setIsMenuHovered: ()=>{},
513
+ setFocusedItem: ()=>{},
514
+ debouncedOpenSectionMenu: ()=>{},
515
+ cancelDebouncedOpenSectionMenu: ()=>{}
516
+ }), Vn = (param)=>{
517
+ let { children: n, sections: t, isLargeMenu: i } = param;
518
+ const { isTabletOrSmaller: r } = (0, _hooks.useScreenSize)(), [s, d] = _react.useState(!1), [c, u] = _react.useState("0px"), [p, a] = _react.useReducer(Fn, "closed"), [f, m] = _react.useState(-1), [l, M] = _react.useState(), [B, h] = _react.useState(!1), [k, I] = _react.useState(!1), [N, A] = _react.useState(-1), b = _react.useCallback((v)=>{
519
+ var S;
520
+ m(-1), (S = t == null ? void 0 : t[v]) != null && S.menu ? (I(!0), A(v)) : (h(!1), I(!1));
521
+ }, [
522
+ t
523
+ ]), g = _react.useMemo(()=>(0, _helpers.debounce)(b, Tn), [
524
+ b
525
+ ]), O = _react.useCallback(()=>{
526
+ h(!1), I(!1), g.cancel(), m(-1);
527
+ }, [
528
+ g
529
+ ]);
530
+ _react.useEffect(()=>{
531
+ r && O();
532
+ }, [
533
+ r,
534
+ O
535
+ ]), _react.useEffect(()=>{
536
+ !k && !B ? (d(!1), u("0px")) : d(!0);
537
+ }, [
538
+ B,
539
+ k
540
+ ]), _react.useEffect(()=>{
541
+ const v = (0, _platform.isRunningAcceptanceTest)() || !i ? 0 : _navigationbarcssmistica.DESKTOP_MENU_ANIMATION_DURATION_MS;
542
+ let S;
543
+ return s ? (a("open"), S = setTimeout(()=>a("finishOpen"), v)) : (a("close"), S = setTimeout(()=>a("finishClose"), v)), ()=>clearTimeout(S);
544
+ }, [
545
+ s,
546
+ i
547
+ ]), _react.useEffect(()=>{
548
+ p === "closed" && A(-1);
549
+ }, [
550
+ p
551
+ ]);
552
+ const x = _react.useCallback((v)=>{
553
+ (0, _helpers.isEqual)(l, v) || M(v);
554
+ }, [
555
+ l
556
+ ]);
557
+ return _react.useEffect(()=>{
558
+ const v = (E)=>{
559
+ if (l) {
560
+ const R = document.querySelector("[data-navigation-bar-menu-items]"), T = Array.from((R == null ? void 0 : R.querySelectorAll("a,button")) || []), G = T.findIndex((P)=>P.hasAttribute(`data-navigation-bar-menu-item-${l.column}-${l.index}`)), L = E ? G - 1 : G + 1;
561
+ T[(L + T.length) % T.length].focus();
562
+ }
563
+ }, S = (E)=>{
564
+ switch(E.key){
565
+ case _keys.DOWN:
566
+ l && ((0, _dom.cancelEvent)(E), v());
567
+ break;
568
+ case _keys.UP:
569
+ l && ((0, _dom.cancelEvent)(E), v(!0));
570
+ break;
571
+ case _keys.ESC:
572
+ O();
573
+ break;
574
+ }
575
+ };
576
+ return document.addEventListener("keydown", S, !1), ()=>{
577
+ document.removeEventListener("keydown", S, !1);
578
+ };
579
+ }, [
580
+ O,
581
+ l
582
+ ]), _react.useEffect(()=>{
583
+ M(void 0);
584
+ }, [
585
+ N
586
+ ]), /* @__PURE__ */ (0, _jsxruntime.jsx)(Ce.Provider, {
587
+ value: {
588
+ isMenuOpen: s,
589
+ openedSection: N,
590
+ menuHeight: c,
591
+ menuStatus: p,
592
+ openSectionMenu: b,
593
+ debouncedOpenSectionMenu: (v)=>{
594
+ m(v), g(v);
595
+ },
596
+ cancelDebouncedOpenSectionMenu: (v)=>{
597
+ v === f && (g.cancel(), m(-1));
598
+ },
599
+ closeMenu: O,
600
+ setMenuHeight: u,
601
+ setIsMenuHovered: h,
602
+ setFocusedItem: x
603
+ },
604
+ children: n
605
+ });
606
+ }, D = ()=>_react.useContext(Ce), Be = (param)=>{
607
+ let { column: n, columnIndex: t } = param;
608
+ const { setFocusedItem: i, closeMenu: r } = D();
609
+ return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
610
+ space: 24,
611
+ children: [
612
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
613
+ medium: !0,
614
+ color: _skincontractcssmistica.vars.colors.textSecondary,
615
+ transform: "uppercase",
616
+ children: n.title
617
+ }),
618
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_stack.default, {
619
+ space: 16,
620
+ role: "list",
621
+ children: n.items.map((_param, c)=>{
622
+ var { title: s } = _param, d = _object_without_properties(_param, [
623
+ "title"
624
+ ]);
625
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
626
+ onFocus: ()=>i({
627
+ column: t,
628
+ index: c
629
+ }),
630
+ onBlur: ()=>i(void 0),
631
+ role: "listitem",
632
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_textlink.default, _object_spread_props(_object_spread({
633
+ className: _navigationbarcssmistica.desktopMenuColumnItem,
634
+ dataAttributes: {
635
+ [`navigation-bar-menu-item-${t}-${c}`]: "true"
636
+ }
637
+ }, K(d, r)), {
638
+ children: s
639
+ }))
640
+ }, c);
641
+ })
642
+ })
643
+ ]
644
+ });
645
+ }, Gn = (param)=>{
646
+ let { section: n, index: t, isLargeNavigationBar: i } = param;
647
+ var A, b;
648
+ const r = _react.useRef(null), [s, d] = _react.useState(!1), c = (0, _platform.isRunningAcceptanceTest)() ? 0 : _navigationbarcssmistica.DESKTOP_MENU_ANIMATION_DURATION_MS, u = i ? _theme.NAVBAR_HEIGHT_DESKTOP_LARGE : _theme.NAVBAR_HEIGHT_DESKTOP, p = 40, { menuStatus: a, isMenuOpen: f, openedSection: m, closeMenu: l, setIsMenuHovered: M, setMenuHeight: B } = D();
649
+ _react.useEffect(()=>{
650
+ if (r.current && f && (r.current.scrollTop = 0), d(!1), f) {
651
+ const g = setTimeout(()=>d(!0), c);
652
+ return ()=>clearTimeout(g);
653
+ }
654
+ }, [
655
+ f,
656
+ m,
657
+ c
658
+ ]);
659
+ const [h, k] = _react.useState(!0);
660
+ _react.useEffect(()=>{
661
+ if (m === t) if (a === "opening") {
662
+ k(!1);
663
+ const g = requestAnimationFrame(()=>k(!0));
664
+ return ()=>cancelAnimationFrame(g);
665
+ } else k(!0);
666
+ }, [
667
+ a,
668
+ m,
669
+ t
670
+ ]), _react.useEffect(()=>{
671
+ a === "closing" && d(!1);
672
+ }, [
673
+ a
674
+ ]);
675
+ const I = ((A = n.menu) == null ? void 0 : A.columns) || [], N = (b = n == null ? void 0 : n.menu) == null ? void 0 : b.content;
676
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
677
+ className: _navigationbarcssmistica.desktopOnly,
678
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
679
+ variant: "default",
680
+ children: m === t && /* @__PURE__ */ (0, _jsxruntime.jsx)(_responsivelayout.ResetResponsiveLayout, {
681
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
682
+ className: _navigationbarcssmistica.desktopMenuContainer,
683
+ onMouseEnter: ()=>M(!0),
684
+ onMouseLeave: ()=>M(!1),
685
+ style: {
686
+ // disable pointer events when menu is closing
687
+ pointerEvents: a === "closed" || a === "closing" ? "none" : void 0,
688
+ top: u,
689
+ maxHeight: `calc(100vh - ${u}px - ${p}px)`,
690
+ overflowY: s ? "auto" : "hidden"
691
+ },
692
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_responsivelayout.default, {
693
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
694
+ className: (0, _classnames.default)(_navigationbarcssmistica.desktopMenu, {
695
+ [_navigationbarcssmistica.desktopMenuContentFadeIn]: h
696
+ }),
697
+ ref: (g)=>{
698
+ g && f && B(`min(${g.scrollHeight}px, calc(100vh - ${u}px - ${p}px))`);
699
+ },
700
+ children: N ? typeof N == "function" ? N({
701
+ closeMenu: l
702
+ }) : N : /* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.Grid, {
703
+ rows: 1,
704
+ columns: 12,
705
+ gap: [
706
+ 24,
707
+ 40
708
+ ],
709
+ dataAttributes: {
710
+ "navigation-bar-menu-items": "true"
711
+ },
712
+ children: I.map((g, O)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(_grid.GridItem, {
713
+ columnSpan: 2,
714
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(Be, {
715
+ column: g,
716
+ columnIndex: O
717
+ })
718
+ }, O))
719
+ })
720
+ })
721
+ })
722
+ })
723
+ })
724
+ })
725
+ });
726
+ }, Wn = (param)=>{
727
+ let { isLargeNavigationBar: n } = param;
728
+ const t = n ? _theme.NAVBAR_HEIGHT_DESKTOP_LARGE : _theme.NAVBAR_HEIGHT_DESKTOP, { menuHeight: i } = D();
729
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
730
+ className: _navigationbarcssmistica.desktopOnly,
731
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
732
+ className: _navigationbarcssmistica.desktopMenuWrapper,
733
+ style: {
734
+ top: t
735
+ },
736
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
737
+ className: _navigationbarcssmistica.desktopMenuBackgroundContainer,
738
+ style: {
739
+ height: i
740
+ }
741
+ })
742
+ })
743
+ });
744
+ }, Un = (param)=>{
745
+ let { section: n, isLargeNavigationBar: t, leftPosition: i, index: r } = param;
746
+ var l, M;
747
+ const s = t ? _theme.NAVBAR_HEIGHT_DESKTOP_LARGE : _theme.NAVBAR_HEIGHT_DESKTOP, d = 40, c = ((l = n.menu) == null ? void 0 : l.columns) || [], u = (M = n == null ? void 0 : n.menu) == null ? void 0 : M.content, { openedSection: p, menuStatus: a, setIsMenuHovered: f, closeMenu: m } = D();
748
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
749
+ className: _navigationbarcssmistica.desktopOnly,
750
+ children: r === p && /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
751
+ variant: "default",
752
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
753
+ className: _navigationbarcssmistica.desktopSmallMenuContainer,
754
+ onMouseEnter: ()=>f(!0),
755
+ onMouseLeave: ()=>f(!1),
756
+ style: {
757
+ // disable pointer events when menu is closing
758
+ pointerEvents: a === "closed" || a === "closing" ? "none" : void 0,
759
+ top: s,
760
+ left: i,
761
+ maxHeight: `calc(100vh - ${s}px - ${d}px)`
762
+ },
763
+ children: u ? typeof u == "function" ? u({
764
+ closeMenu: m
765
+ }) : u : /* @__PURE__ */ (0, _jsxruntime.jsx)(_stack.default, {
766
+ space: 40,
767
+ dataAttributes: {
768
+ "navigation-bar-menu-items": "true"
769
+ },
770
+ children: c.map((B, h)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(Be, {
771
+ column: B,
772
+ columnIndex: h
773
+ }, h))
774
+ })
775
+ })
776
+ })
777
+ });
778
+ }, Kn = (param)=>{
779
+ let { section: n, index: t, selectedIndex: i, isFirstSection: r, isLastSection: s, navigationBarRef: d, variant: c, isLargeNavigationBar: u, desktopLargeMenu: p } = param;
780
+ const { texts: a, t: f } = (0, _hooks.useTheme)(), { title: m, menu: l } = n, M = _object_without_properties(n, [
781
+ "title",
782
+ "menu"
783
+ ]), B = _react.useRef(null), [h, k] = _react.useState(0), [I, N] = _react.useState(!1), { isMenuOpen: A, openedSection: b, openSectionMenu: g, debouncedOpenSectionMenu: O, cancelDebouncedOpenSectionMenu: x, closeMenu: v } = D(), S = M.href !== void 0 || M.onPress !== void 0 || M.to !== void 0, E = _react.useCallback((L)=>{
784
+ p || k((()=>{
785
+ var te, oe;
786
+ const { left: ne, right: ke } = ((te = B.current) == null ? void 0 : te.getBoundingClientRect()) || {
787
+ left: 0,
788
+ right: 0
789
+ }, Ie = (((oe = d.current) == null ? void 0 : oe.getBoundingClientRect().right) || 0) - _navigationbarcssmistica.DESKTOP_SMALL_MENU_WIDTH;
790
+ return ne <= Ie ? ne : ke - _navigationbarcssmistica.DESKTOP_SMALL_MENU_WIDTH;
791
+ })()), L ? O(t) : g(t);
792
+ }, [
793
+ p,
794
+ t,
795
+ g,
796
+ O,
797
+ d
798
+ ]);
799
+ _react.useEffect(()=>{
800
+ const L = (P)=>{
801
+ switch(P.key){
802
+ case _keys.DOWN:
803
+ I && ((0, _dom.cancelEvent)(P), E());
804
+ break;
805
+ case _keys.UP:
806
+ I && ((0, _dom.cancelEvent)(P), v());
807
+ break;
808
+ }
809
+ };
810
+ return document.addEventListener("keydown", L, !1), ()=>{
811
+ document.removeEventListener("keydown", L, !1);
812
+ };
813
+ }, [
814
+ t,
815
+ I,
816
+ E,
817
+ v,
818
+ l,
819
+ S
820
+ ]);
821
+ const R = A && b === t, T = _react.useCallback(()=>{
822
+ R ? v() : E();
823
+ }, [
824
+ R,
825
+ E,
826
+ v
827
+ ]), G = _react.useCallback((L)=>S ? L : {
828
+ onPress: T
829
+ }, [
830
+ S,
831
+ T
832
+ ]);
833
+ return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
834
+ className: _navigationbarcssmistica.desktopMenuSectionWithArrowWrapper,
835
+ children: [
836
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
837
+ ref: B,
838
+ className: (0, _classnames.default)(_navigationbarcssmistica.desktopMenuSectionContainer, {
839
+ [_navigationbarcssmistica.desktopMenuFirstSection]: r,
840
+ [_navigationbarcssmistica.desktopMenuLastSection]: s
841
+ }),
842
+ onMouseEnter: ()=>E(!0),
843
+ onMouseLeave: ()=>x(t),
844
+ onFocus: ()=>{
845
+ l && !S && N(!0);
846
+ },
847
+ onBlur: ()=>{
848
+ l && !S && N(!1);
849
+ },
850
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, _object_spread_props(_object_spread({}, G(M)), {
851
+ "aria-label": S ? void 0 : `${n.title}, ${a.mainNavigationBarOpenSectionMenu || f(_texttokens.mainNavigationBarOpenSectionMenu)}`,
852
+ "aria-haspopup": !S,
853
+ "aria-expanded": S ? void 0 : R,
854
+ className: (0, _classnames.default)(_navigationbarcssmistica.section, {
855
+ [_navigationbarcssmistica.selectedSectionVariantes[c === "inverse" ? "inverse" : "default"]]: t === i
856
+ }, _navigationbarcssmistica.textWrapperVariants[c === "inverse" ? "inverse" : "default"]),
857
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
858
+ regular: !0,
859
+ color: "inherit",
860
+ children: m
861
+ })
862
+ }))
863
+ }),
864
+ l && /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
865
+ children: [
866
+ S && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
867
+ className: _navigationbarcssmistica.desktopMenuSectionArrowContainer,
868
+ onFocus: ()=>N(!0),
869
+ onBlur: ()=>N(!1),
870
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
871
+ className: _navigationbarcssmistica.desktopMenuSectionArrow,
872
+ "aria-label": `${n.title}, ${a.mainNavigationBarOpenSectionMenu || f(_texttokens.mainNavigationBarOpenSectionMenu)}`,
873
+ "aria-haspopup": !0,
874
+ "aria-expanded": R,
875
+ onPress: ()=>{
876
+ I && T();
877
+ },
878
+ style: {
879
+ pointerEvents: I ? "auto" : "none",
880
+ opacity: I ? 1 : 0,
881
+ // We are using the same chevron as in ButtonLink, and that svg has
882
+ // some extra space on the left that we want to ignore in this case
883
+ marginTop: -2
884
+ },
885
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(Ln, {
886
+ size: 8,
887
+ style: {
888
+ transform: `rotate(${R ? -90 : 90}deg)`
889
+ }
890
+ })
891
+ })
892
+ }),
893
+ p ? /* @__PURE__ */ (0, _jsxruntime.jsx)(Gn, {
894
+ section: n,
895
+ isLargeNavigationBar: u,
896
+ index: t
897
+ }) : /* @__PURE__ */ (0, _jsxruntime.jsx)(Un, {
898
+ section: n,
899
+ isLargeNavigationBar: u,
900
+ leftPosition: h,
901
+ index: t
902
+ })
903
+ ]
904
+ })
905
+ ]
906
+ });
907
+ }, qn = (param)=>{
908
+ let { sections: n, selectedIndex: t, navigationBarRef: i, variant: r, isLargeNavigationBar: s, hasRightContent: d, desktopLargeMenu: c } = param;
909
+ const { openSectionMenu: u, openedSection: p, closeMenu: a } = D();
910
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("nav", {
911
+ className: (0, _classnames.default)(_navigationbarcssmistica.desktopOnly, _navigationbarcssmistica.mainNavBarSectionsContainer),
912
+ style: {
913
+ paddingLeft: s ? 0 : 48,
914
+ paddingRight: !s && d ? 136 : 0
915
+ },
916
+ onMouseEnter: ()=>{
917
+ p !== -1 && u(p);
918
+ },
919
+ onMouseLeave: a,
920
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
921
+ space: 32,
922
+ children: n.map((f, m)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(Kn, {
923
+ index: m,
924
+ selectedIndex: t,
925
+ navigationBarRef: i,
926
+ isFirstSection: m === 0,
927
+ isLastSection: m === n.length - 1,
928
+ variant: r,
929
+ section: f,
930
+ isLargeNavigationBar: s,
931
+ desktopLargeMenu: c
932
+ }, m))
933
+ })
934
+ });
935
+ }, zn = (param)=>{
936
+ let { children: n, isLargeNavigationBar: t, desktopLargeMenu: i } = param;
937
+ const { menuHeight: r } = D(), s = t ? _theme.NAVBAR_HEIGHT_DESKTOP_LARGE : _theme.NAVBAR_HEIGHT_DESKTOP;
938
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
939
+ className: _navigationbarcssmistica.mainNavigationBarContentWrapper,
940
+ style: i ? {
941
+ clipPath: `rect(0 100% calc(${s}px + ${r}) 0)`,
942
+ WebkitClipPath: `rect(0 100% calc(${s}px + ${r}) 0)`
943
+ } : void 0,
944
+ children: n
945
+ });
946
+ }, At = (param)=>{
947
+ let { sections: n = [], selectedIndex: t, right: i, variant: r = "default", topFixed: s = !0, withBorder: d = !0, burgerMenuExtra: c, logo: u, large: p = !1, desktopLargeMenu: a = !1 } = param;
948
+ const { texts: f, t: m } = (0, _hooks.useTheme)(), l = _react.useId(), { isTabletOrSmaller: M } = (0, _hooks.useScreenSize)(), B = u || /* @__PURE__ */ (0, _jsxruntime.jsx)(_logo.Logo, {
949
+ size: {
950
+ mobile: 40,
951
+ desktop: 48
952
+ }
953
+ }), h = p && n.length > 0, [k, I] = _react.useState(!1), [N, A] = _react.useState(!0), b = _react.useRef(null), g = (0, _modalcontextprovider.useSetModalState)(), O = /* @__PURE__ */ (0, _jsxruntime.jsx)(qn, {
954
+ sections: n,
955
+ selectedIndex: t,
956
+ navigationBarRef: b,
957
+ variant: r,
958
+ hasRightContent: !!i,
959
+ isLargeNavigationBar: h,
960
+ desktopLargeMenu: a
961
+ }), x = ()=>{
962
+ I(!0), g({
963
+ isModalOpen: !0
964
+ });
965
+ }, v = ()=>{
966
+ I(!1), g({
967
+ isModalOpen: !1
968
+ });
969
+ }, S = n.length > 1, E = /* @__PURE__ */ (0, _jsxruntime.jsxs)(_themevariantcontext.ThemeVariant, {
970
+ variant: r,
971
+ children: [
972
+ /* @__PURE__ */ (0, _jsxruntime.jsxs)(ee, {
973
+ topFixed: s,
974
+ withBorder: d,
975
+ isBurgerMenuOpen: k,
976
+ variant: r,
977
+ dataAttributes: {
978
+ "component-name": "MainNavigationBar"
979
+ },
980
+ children: [
981
+ a && /* @__PURE__ */ (0, _jsxruntime.jsx)(Wn, {
982
+ isLargeNavigationBar: h
983
+ }),
984
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(zn, {
985
+ isLargeNavigationBar: h,
986
+ desktopLargeMenu: a,
987
+ children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_responsivelayout.default, {
988
+ children: [
989
+ /* @__PURE__ */ (0, _jsxruntime.jsxs)(U, {
990
+ ref: b,
991
+ right: i,
992
+ expandRightContent: h,
993
+ children: [
994
+ S && /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.default, {
995
+ className: _navigationbarcssmistica.burgerMenuButton,
996
+ "aria-live": "polite",
997
+ "aria-label": k ? f.closeNavigationMenu || m(_texttokens.closeNavigationMenu) : f.openNavigationMenu || m(_texttokens.openNavigationMenu),
998
+ "aria-expanded": k,
999
+ "aria-controls": l,
1000
+ onPress: k ? v : x,
1001
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(yn, {
1002
+ isOpen: k
1003
+ })
1004
+ }),
1005
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
1006
+ className: _navigationbarcssmistica.logoContainer,
1007
+ children: B
1008
+ }),
1009
+ !h && O
1010
+ ]
1011
+ }),
1012
+ h && /* @__PURE__ */ (0, _jsxruntime.jsx)(U, {
1013
+ desktopOnly: !0,
1014
+ children: O
1015
+ })
1016
+ ]
1017
+ })
1018
+ })
1019
+ ]
1020
+ }),
1021
+ s && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
1022
+ className: h ? _navigationbarcssmistica.spacerLarge : _navigationbarcssmistica.spacer
1023
+ })
1024
+ ]
1025
+ });
1026
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(Vn, {
1027
+ sections: n,
1028
+ isLargeMenu: a,
1029
+ children: M ? /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
1030
+ children: [
1031
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_focustrap.default, {
1032
+ disabled: N,
1033
+ group: "burger-menu-lock",
1034
+ children: E
1035
+ }),
1036
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_n, {
1037
+ open: k,
1038
+ id: l,
1039
+ sections: n,
1040
+ extra: c,
1041
+ closeMenu: v,
1042
+ disableFocusTrap: N,
1043
+ setDisableFocusTrap: A
1044
+ })
1045
+ ]
1046
+ }) : E
1047
+ });
1048
+ }, Rt = (param)=>{
1049
+ let { logo: n, right: t, variant: i = "default", topFixed: r = !0, withBorder: s = !0 } = param;
426
1050
  return n = n !== null && n !== void 0 ? n : /* @__PURE__ */ (0, _jsxruntime.jsx)(_logo.Logo, {
427
1051
  size: {
428
1052
  mobile: 40,
429
1053
  desktop: 48
430
1054
  }
431
1055
  }), /* @__PURE__ */ (0, _jsxruntime.jsxs)(_themevariantcontext.ThemeVariant, {
432
- variant: t,
1056
+ variant: i,
433
1057
  children: [
434
- /* @__PURE__ */ (0, _jsxruntime.jsx)(O, {
1058
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(ee, {
435
1059
  topFixed: r,
436
- withBorder: a,
437
- variant: t,
1060
+ withBorder: s,
1061
+ variant: i,
438
1062
  dataAttributes: {
439
1063
  "component-name": "FunnelNavigationBar"
440
1064
  },
441
1065
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_responsivelayout.default, {
442
1066
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_gridlayout.default, {
443
1067
  template: "10",
444
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(b, {
445
- right: o,
1068
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(U, {
1069
+ right: t,
1070
+ expandRightContent: !0,
446
1071
  children: n
447
1072
  })
448
1073
  })
@@ -453,7 +1078,7 @@ const Ge = (param)=>{
453
1078
  })
454
1079
  ]
455
1080
  });
456
- }, Nn = (param)=>{
1081
+ }, xt = (param)=>{
457
1082
  let { children: n } = param;
458
1083
  return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
459
1084
  className: _navigationbarcssmistica.lineHeightFix,
@@ -464,13 +1089,13 @@ const Ge = (param)=>{
464
1089
  children: n
465
1090
  })
466
1091
  });
467
- }, Bn = (_param)=>{
468
- var { children: n } = _param, o = _object_without_properties(_param, [
1092
+ }, Tt = (_param)=>{
1093
+ var { children: n } = _param, t = _object_without_properties(_param, [
469
1094
  "children"
470
1095
  ]);
471
- const t = (0, _themevariantcontext.useIsInverseOrMediaVariant)();
472
- return /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, _object_spread_props(_object_spread({}, o), {
473
- className: (0, _classnames.default)(_navigationbarcssmistica.navigationBarAction, _navigationbarcssmistica.lineHeightFix, _navigationbarcssmistica.textWrapperVariants[t ? "inverse" : "default"]),
1096
+ const i = (0, _themevariantcontext.useIsInverseOrMediaVariant)();
1097
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, _object_spread_props(_object_spread({}, t), {
1098
+ className: (0, _classnames.default)(_navigationbarcssmistica.navigationBarAction, _navigationbarcssmistica.lineHeightFix, _navigationbarcssmistica.textWrapperVariants[i ? "inverse" : "default"]),
474
1099
  dataAttributes: {
475
1100
  "component-name": "NavigationBarAction"
476
1101
  },