@orangesk/orange-design-system 3.3.1 → 3.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 (87) hide show
  1. package/build/apple--dark.svg +4 -0
  2. package/build/apple--white.svg +5 -0
  3. package/build/apple.svg +4 -0
  4. package/build/components/BodyBanner/style.css +1 -1
  5. package/build/components/BodyBanner/style.css.map +1 -1
  6. package/build/components/Carousel/style.css +1 -1
  7. package/build/components/Carousel/style.css.map +1 -1
  8. package/build/components/FeatureAccordion/style.css +1 -1
  9. package/build/components/FeatureAccordion/style.css.map +1 -1
  10. package/build/components/Footer/style.css +1 -1
  11. package/build/components/Footer/style.css.map +1 -1
  12. package/build/components/Megamenu/style.css +1 -1
  13. package/build/components/Megamenu/style.css.map +1 -1
  14. package/build/components/PromoBanner/style.css +1 -1
  15. package/build/components/PromoBanner/style.css.map +1 -1
  16. package/build/components/Table/style.css +1 -1
  17. package/build/components/Table/style.css.map +1 -1
  18. package/build/components/Tooltip/style.css +1 -1
  19. package/build/components/Tooltip/style.css.map +1 -1
  20. package/build/components/index.js +1 -1
  21. package/build/components/index.js.map +1 -1
  22. package/build/components/tsconfig.tsbuildinfo +1 -1
  23. package/build/components/types/index.d.ts +23 -4
  24. package/build/components/types/src/components/Carousel/Carousel.d.ts +3 -1
  25. package/build/components/types/src/components/Carousel/Carousel.static.d.ts +1 -0
  26. package/build/components/types/src/components/Carousel/constants.d.ts +1 -0
  27. package/build/components/types/src/components/Megamenu/Megamenu.d.ts +12 -2
  28. package/build/components/types/src/components/Megamenu/MegamenuBlog.d.ts +1 -1
  29. package/build/components/types/src/components/Megamenu/MyOrangeMobilePanel.d.ts +3 -1
  30. package/build/components/types/src/components/Megamenu/constants.d.ts +19 -2
  31. package/build/components/types/src/components/Megamenu/data.d.ts +8 -0
  32. package/build/components/types/src/components/Megamenu/shared.d.ts +40 -0
  33. package/build/huawei--dark.svg +4 -0
  34. package/build/huawei--white.svg +5 -0
  35. package/build/huawei.svg +4 -0
  36. package/build/images/phones.png +0 -0
  37. package/build/lib/base.css +1 -1
  38. package/build/lib/base.css.map +1 -1
  39. package/build/lib/components.css +1 -1
  40. package/build/lib/components.css.map +1 -1
  41. package/build/lib/footer.css +1 -1
  42. package/build/lib/footer.css.map +1 -1
  43. package/build/lib/megamenu.css +1 -1
  44. package/build/lib/megamenu.css.map +1 -1
  45. package/build/lib/megamenu.js +1 -1
  46. package/build/lib/megamenu.js.map +1 -1
  47. package/build/lib/scripts.js +1 -1
  48. package/build/lib/scripts.js.map +1 -1
  49. package/build/lib/style.css +1 -1
  50. package/build/lib/style.css.map +1 -1
  51. package/build/lib/utilities.css +1 -1
  52. package/build/lib/utilities.css.map +1 -1
  53. package/build/play--dark.svg +7 -0
  54. package/build/play--white.svg +7 -0
  55. package/build/play.svg +7 -0
  56. package/package.json +15 -15
  57. package/src/components/BodyBanner/styles/mixins.scss +6 -0
  58. package/src/components/Carousel/Carousel.static.ts +25 -9
  59. package/src/components/Carousel/Carousel.tsx +5 -0
  60. package/src/components/Carousel/constants.ts +1 -0
  61. package/src/components/Carousel/styles/style.scss +2 -1
  62. package/src/components/Carousel/tests/Carousel.static.test.jsx +85 -0
  63. package/src/components/Carousel/tests/Carousel.unit.test.jsx +9 -0
  64. package/src/components/FeatureAccordion/styles/mixins.scss +6 -0
  65. package/src/components/Footer/styles/style.scss +2 -0
  66. package/src/components/Megamenu/LogoJeTu.tsx +12 -7
  67. package/src/components/Megamenu/Megamenu.static.ts +1 -1
  68. package/src/components/Megamenu/Megamenu.tsx +432 -316
  69. package/src/components/Megamenu/MegamenuBlog.tsx +90 -123
  70. package/src/components/Megamenu/MyOrangeMobilePanel.tsx +129 -84
  71. package/src/components/Megamenu/constants.ts +19 -2
  72. package/src/components/Megamenu/data.ts +53 -15
  73. package/src/components/Megamenu/shared.tsx +154 -0
  74. package/src/components/Megamenu/styles/mixins.scss +313 -29
  75. package/src/components/Megamenu/styles/style.scss +91 -8
  76. package/src/components/Megamenu/tests/Megamenu.unit.test.jsx +108 -4
  77. package/src/components/PromoBanner/PromoBanner.tsx +0 -2
  78. package/src/components/PromoBanner/styles/mixins.scss +3 -4
  79. package/src/components/PromoBanner/tests/PromoBanner.unit.test.jsx +3 -3
  80. package/src/components/Table/styles/config.scss +1 -0
  81. package/src/components/Table/styles/style.scss +6 -0
  82. package/src/components/Tooltip/styles/style.scss +5 -0
  83. package/src/styles/base/globals.scss +5 -5
  84. package/src/styles/base/styleguide.scss +1 -1
  85. package/src/styles/export/color.js +1 -1
  86. package/src/styles/shame.scss +1 -1
  87. package/src/styles/tokens/color.scss +1 -1
@@ -1,6 +1,5 @@
1
1
  import cx from "classnames";
2
2
  import React from "react";
3
- import { BrandMark } from "./BrandMark";
4
3
  import {
5
4
  CLASS_ACCORDION,
6
5
  CLASS_ACCORDION_BODY,
@@ -13,27 +12,29 @@ import {
13
12
  CLASS_CARD,
14
13
  CLASS_CONTAINER,
15
14
  CLASS_GRID,
15
+ CLASS_HIDE_LG_ONLY,
16
16
  CLASS_HIDE_LG_UP,
17
17
  CLASS_HIDE_MD_DOWN,
18
18
  CLASS_MAIN,
19
- CLASS_MOBILE,
20
19
  CLASS_MOBILE_BODY,
20
+ CLASS_MOBILE_CTA,
21
21
  CLASS_MOBILE_HEADER,
22
- CLASS_MOBILE_OVERLAY,
23
- CLASS_MOBILE_WRAPPER,
24
22
  CLASS_NAV,
25
23
  CLASS_NAV_BUTTON,
26
24
  CLASS_NAV_BUTTON_INDICATOR,
27
25
  CLASS_NAV_CART_ICON,
28
26
  CLASS_NAV_DROPDOWN,
29
27
  CLASS_NAV_ICON,
28
+ CLASS_NAV_ICON_CTA,
30
29
  CLASS_NAV_ITEM,
31
30
  CLASS_NAV_ITEM_LEAD,
32
31
  CLASS_NAV_ITEM_MAIN,
33
32
  CLASS_NAV_LINK,
33
+ CLASS_NAV_LINK_CTA,
34
34
  CLASS_NAV_LINK_LOCALE,
35
- CLASS_NAV_LOGO,
36
35
  CLASS_NAV_MOBILE_LOCALE,
36
+ CLASS_NAV_SELECT,
37
+ CLASS_NAV_SELECT_WRAPPER,
37
38
  CLASS_NAV_SPACE_SMALL,
38
39
  CLASS_NAV_SPACER,
39
40
  CLASS_NAV_VERTICAL,
@@ -46,22 +47,48 @@ import {
46
47
  CLASS_TAG_ORANGE,
47
48
  CLASS_TAG_SMALL,
48
49
  CLASS_TEXT_LARGE,
50
+ CLASS_TILE,
51
+ CLASS_TILE_BODY,
52
+ CLASS_TILE_CONTENT,
53
+ CLASS_TILE_LABEL,
54
+ CLASS_TILES,
49
55
  CLASS_TOP,
50
56
  } from "./constants";
51
- import { MenuItem, MenuSection, menuSections } from "./data";
57
+ import {
58
+ MegamenuTile,
59
+ MenuItem,
60
+ MenuSection,
61
+ megamenuTiles,
62
+ menuSections,
63
+ } from "./data";
52
64
  import { getMegamenuIds } from "./ids";
53
- import { Logo } from "./Logo";
54
65
  import { MegamenuIcon } from "./MegaMenuIcon";
55
66
  import { MegamenuSearchContent } from "./MegamenuSearchContent";
56
67
  import { MyOrangeMobilePanel } from "./MyOrangeMobilePanel";
68
+ import {
69
+ getMegamenuSearchState,
70
+ MegamenuCloseButton,
71
+ MegamenuLogoLink,
72
+ MegamenuMobilePanel,
73
+ MegamenuSearchDropdown,
74
+ } from "./shared";
57
75
 
58
76
  export type MegamenuProps = {
59
77
  className?: string;
60
78
  title?: string;
61
- isSticky?: boolean;
79
+ notSticky?: boolean;
62
80
  searchEmpty?: boolean;
63
81
  searchFilled?: boolean;
64
82
  compactLogoOnly?: boolean;
83
+ isB2B?: boolean;
84
+ /** Controls whether My Orange panel shows logged-in or logged-out content. */
85
+ isLoggedIn?: boolean;
86
+ /** Number of items displayed on the cart badge. Empty cart when omitted or zero. */
87
+ cartItems?: number;
88
+ /** Shows an orange dot for a non-empty cart when item count is unavailable. */
89
+ cartHasItems?: boolean;
90
+ /** Tiles displayed below every desktop and mobile menu section. */
91
+ tiles?: MegamenuTile[];
65
92
  };
66
93
 
67
94
  const renderMenuItems = (items: MenuItem[]) => (
@@ -84,54 +111,71 @@ const renderMenuItems = (items: MenuItem[]) => (
84
111
  </>
85
112
  );
86
113
 
114
+ const renderMenuTiles = (tiles: MegamenuTile[]) => (
115
+ <div className={CLASS_TILES} aria-label="Rýchly prístup">
116
+ {tiles.map((tile, index) => {
117
+ const isActive = tile.isActive ?? index === 0;
118
+
119
+ return (
120
+ <a
121
+ className={cx(CLASS_TILE, { "is-active": isActive })}
122
+ href={tile.href ?? "/"}
123
+ key={tile.label}
124
+ >
125
+ <div className={CLASS_TILE_BODY}>
126
+ <MegamenuIcon
127
+ name={tile.icon}
128
+ width={32}
129
+ height={32}
130
+ aria-hidden="true"
131
+ />
132
+ <span className={CLASS_TILE_CONTENT}>
133
+ <strong className={CLASS_TILE_LABEL}>{tile.label}</strong>
134
+ {tile.tag ? (
135
+ <span
136
+ className={cx(CLASS_TAG, CLASS_TAG_ORANGE, CLASS_TAG_SMALL)}
137
+ >
138
+ {tile.tag}
139
+ </span>
140
+ ) : null}
141
+ </span>
142
+ </div>
143
+ </a>
144
+ );
145
+ })}
146
+ </div>
147
+ );
148
+
87
149
  const renderMenuSectionGrid = (
88
150
  section: MenuSection,
89
151
  idPrefix: string,
90
152
  captionClass: string,
91
153
  mergeColumnsToSingleCard = false,
154
+ tiles: MegamenuTile[] = megamenuTiles,
155
+ tilesBeforeGrid = false,
92
156
  ) => {
93
157
  const featuredHeadingId = `${idPrefix}-${section.id}-${section.featured.id}`;
94
158
 
95
159
  return (
96
- <div className={CLASS_GRID}>
97
- <div className={cx(CLASS_CARD, "is-highlighted")}>
98
- <h3 id={featuredHeadingId} className="sr-only">
99
- {section.featured.heading}
100
- </h3>
101
- <ul
102
- className={CLASS_SUBNAV}
103
- role="group"
104
- aria-labelledby={featuredHeadingId}
105
- >
106
- {renderMenuItems(section.featured.items)}
107
- </ul>
108
- </div>
109
-
110
- {mergeColumnsToSingleCard ? (
111
- <div className={CLASS_CARD}>
112
- {section.columns.flat().map((group) => {
113
- const headingId = `${idPrefix}-${section.id}-${group.id}-heading`;
114
-
115
- return (
116
- <React.Fragment key={group.id}>
117
- <p id={headingId} className={captionClass}>
118
- {group.heading}
119
- </p>
120
- <ul
121
- className={CLASS_SUBNAV}
122
- role="group"
123
- aria-labelledby={headingId}
124
- >
125
- {renderMenuItems(group.items)}
126
- </ul>
127
- </React.Fragment>
128
- );
129
- })}
160
+ <>
161
+ <div className={CLASS_GRID}>
162
+ {tilesBeforeGrid ? renderMenuTiles(tiles) : null}
163
+ <div className={cx(CLASS_CARD, "is-highlighted")}>
164
+ <h3 id={featuredHeadingId} className="sr-only">
165
+ {section.featured.heading}
166
+ </h3>
167
+ <ul
168
+ className={CLASS_SUBNAV}
169
+ role="group"
170
+ aria-labelledby={featuredHeadingId}
171
+ >
172
+ {renderMenuItems(section.featured.items)}
173
+ </ul>
130
174
  </div>
131
- ) : (
132
- section.columns.map((groups, columnIndex) => (
133
- <div className={CLASS_CARD} key={`${section.id}-${columnIndex}`}>
134
- {groups.map((group) => {
175
+
176
+ {mergeColumnsToSingleCard ? (
177
+ <div className={CLASS_CARD}>
178
+ {section.columns.flat().map((group) => {
135
179
  const headingId = `${idPrefix}-${section.id}-${group.id}-heading`;
136
180
 
137
181
  return (
@@ -150,31 +194,60 @@ const renderMenuSectionGrid = (
150
194
  );
151
195
  })}
152
196
  </div>
153
- ))
154
- )}
155
- </div>
197
+ ) : (
198
+ section.columns.map((groups, columnIndex) => (
199
+ <div className={CLASS_CARD} key={`${section.id}-${columnIndex}`}>
200
+ {groups.map((group) => {
201
+ const headingId = `${idPrefix}-${section.id}-${group.id}-heading`;
202
+
203
+ return (
204
+ <React.Fragment key={group.id}>
205
+ <p id={headingId} className={captionClass}>
206
+ {group.heading}
207
+ </p>
208
+ <ul
209
+ className={CLASS_SUBNAV}
210
+ role="group"
211
+ aria-labelledby={headingId}
212
+ >
213
+ {renderMenuItems(group.items)}
214
+ </ul>
215
+ </React.Fragment>
216
+ );
217
+ })}
218
+ </div>
219
+ ))
220
+ )}
221
+ </div>
222
+ {!tilesBeforeGrid ? renderMenuTiles(tiles) : null}
223
+ </>
156
224
  );
157
225
  };
158
226
 
159
227
  export const Megamenu = ({
160
228
  className,
161
229
  title = "Človek",
162
- isSticky = true,
230
+ notSticky = false,
163
231
  searchEmpty,
164
232
  searchFilled,
165
233
  compactLogoOnly = false,
234
+ isB2B = false,
235
+ isLoggedIn = true,
236
+ cartItems,
237
+ cartHasItems = false,
238
+ tiles = megamenuTiles,
166
239
  }: MegamenuProps) => {
167
240
  const ids = getMegamenuIds("main");
168
- const hasSearchEmpty = Boolean(searchEmpty);
169
- const hasSearchFilled = Boolean(searchFilled);
170
- const showSearchState = hasSearchEmpty || hasSearchFilled;
171
- const searchValue = hasSearchEmpty ? "" : hasSearchFilled ? "apple" : "";
241
+ const { hasSearchEmpty, hasSearchFilled, showSearchState, searchValue } =
242
+ getMegamenuSearchState(searchEmpty, searchFilled);
243
+ const hasCartItems = cartItems !== undefined && cartItems > 0;
244
+ const showCartDot = cartHasItems && !hasCartItems;
172
245
 
173
246
  return (
174
247
  <header>
175
248
  <nav
176
249
  className={cx(CLASS_ROOT, className, {
177
- "is-sticky": isSticky,
250
+ "non-sticky": notSticky,
178
251
  })}
179
252
  data-megamenu
180
253
  aria-label="Main navigation"
@@ -199,7 +272,12 @@ export const Megamenu = ({
199
272
  </li>
200
273
  <li className={CLASS_NAV_ITEM}>
201
274
  <a href="/" className={CLASS_NAV_LINK}>
202
- Pre biznis
275
+ Podnikatelia a malé firmy
276
+ </a>
277
+ </li>
278
+ <li className={CLASS_NAV_ITEM}>
279
+ <a href="/" className={CLASS_NAV_LINK}>
280
+ Velké firmy
203
281
  </a>
204
282
  </li>
205
283
 
@@ -235,13 +313,10 @@ export const Megamenu = ({
235
313
  <div className={CLASS_CONTAINER}>
236
314
  <ul className={CLASS_NAV} aria-label="Hlavné menu">
237
315
  <li className={cx(CLASS_NAV_ITEM, CLASS_NAV_ITEM_MAIN)}>
238
- <a
239
- href="/"
240
- className={CLASS_NAV_LOGO}
241
- aria-label={`${title} - Domovská stránka`}
242
- >
243
- {compactLogoOnly ? <Logo /> : <BrandMark />}
244
- </a>
316
+ <MegamenuLogoLink
317
+ compactLogoOnly={compactLogoOnly}
318
+ title={title}
319
+ />
245
320
  </li>
246
321
  {menuSections.map((section) => (
247
322
  <li
@@ -270,6 +345,8 @@ export const Megamenu = ({
270
345
  section,
271
346
  "megamenu",
272
347
  CLASS_CAPTION,
348
+ false,
349
+ tiles,
273
350
  )}
274
351
  </div>
275
352
  </div>
@@ -297,8 +374,29 @@ export const Megamenu = ({
297
374
  Pomoc
298
375
  </a>
299
376
  </li>
377
+ <li
378
+ className={cx(
379
+ CLASS_NAV_ITEM,
380
+ CLASS_NAV_ITEM_MAIN,
381
+ CLASS_HIDE_MD_DOWN,
382
+ )}
383
+ >
384
+ <a href="/" className={CLASS_NAV_LINK_CTA}>
385
+ <MegamenuIcon
386
+ width={16}
387
+ height={16}
388
+ name="rewards"
389
+ className={CLASS_NAV_ICON_CTA}
390
+ aria-hidden="true"
391
+ />
392
+ Prejdite k nám
393
+ </a>
394
+ </li>
300
395
 
301
- <li className={CLASS_NAV_SPACER} aria-hidden="true"></li>
396
+ <li
397
+ className={cx(CLASS_NAV_SPACER, CLASS_HIDE_LG_ONLY)}
398
+ aria-hidden="true"
399
+ ></li>
302
400
 
303
401
  <li className={cx(CLASS_NAV_ITEM, CLASS_HIDE_MD_DOWN)}>
304
402
  <button
@@ -317,41 +415,56 @@ export const Megamenu = ({
317
415
  />
318
416
  </button>
319
417
 
320
- <div
321
- className={cx(CLASS_NAV_DROPDOWN, "is-spaced")}
322
- id={ids.searchDropdownId}
323
- >
324
- <div className={CLASS_CONTAINER}>
325
- <MegamenuSearchContent
326
- inputId={ids.searchInputDesktopId}
327
- inputLabel="Vyhľadávanie v hlavnom menu"
328
- searchValue={searchValue}
329
- hasSearchEmpty={hasSearchEmpty}
330
- hasSearchFilled={hasSearchFilled}
331
- emptyStateLinkHref="/"
332
- />
333
- </div>
334
- </div>
418
+ <MegamenuSearchDropdown
419
+ dropdownId={ids.searchDropdownId}
420
+ inputId={ids.searchInputDesktopId}
421
+ inputLabel="Vyhľadávanie v hlavnom menu"
422
+ searchValue={searchValue}
423
+ hasSearchEmpty={hasSearchEmpty}
424
+ hasSearchFilled={hasSearchFilled}
425
+ emptyStateLinkHref="/"
426
+ />
335
427
  </li>
336
428
  <li className={cx(CLASS_NAV_ITEM)}>
337
429
  <a
338
430
  href="/"
339
431
  className={cx(CLASS_NAV_LINK)}
340
- aria-label="Košík, 1 položka"
432
+ aria-label={
433
+ hasCartItems ? `Košík, ${cartItems} položka` : "Košík"
434
+ }
341
435
  >
342
- <span
343
- className={CLASS_NAV_CART_ICON}
344
- data-items-in-cart="1"
345
- aria-hidden="true"
346
- >
347
- <MegamenuIcon
348
- width={24}
349
- height={24}
350
- name="buy"
436
+ {hasCartItems ? (
437
+ <span
438
+ className={CLASS_NAV_CART_ICON}
439
+ data-items-in-cart={cartItems}
351
440
  aria-hidden="true"
352
- />
353
- </span>
354
- <span className="sr-only">1 položka v košíku</span>
441
+ >
442
+ <MegamenuIcon
443
+ width={24}
444
+ height={24}
445
+ name="buy"
446
+ aria-hidden="true"
447
+ />
448
+ </span>
449
+ ) : (
450
+ <span
451
+ className={CLASS_NAV_CART_ICON}
452
+ data-cart-has-items={showCartDot ? "true" : undefined}
453
+ aria-hidden="true"
454
+ >
455
+ <MegamenuIcon
456
+ width={24}
457
+ height={24}
458
+ name="buy"
459
+ aria-hidden="true"
460
+ />
461
+ </span>
462
+ )}
463
+ {hasCartItems ? (
464
+ <span className="sr-only">
465
+ {cartItems} položka v košíku
466
+ </span>
467
+ ) : null}
355
468
  </a>
356
469
  </li>
357
470
  <li className={CLASS_NAV_ITEM}>
@@ -397,250 +510,253 @@ export const Megamenu = ({
397
510
 
398
511
  {/* MOBILE MENU */}
399
512
 
400
- <div
401
- // className={cx(CLASS_MOBILE, "is-active")}
402
- className={cx(CLASS_MOBILE)}
403
- data-megamenu-mobile-panel="main"
404
- id={ids.mobileMainPanelId}
405
- role="dialog"
406
- aria-modal="true"
407
- aria-labelledby={ids.mobileMainTitleId}
408
- aria-hidden="true"
513
+ <MegamenuMobilePanel
514
+ panelId={ids.mobileMainPanelId}
515
+ titleId={ids.mobileMainTitleId}
516
+ target="main"
517
+ title="Hlavné menu"
518
+ overlayAriaLabel="Zatvoriť menu"
409
519
  >
410
- <span id={ids.mobileMainTitleId} className="sr-only">
411
- Hlavné menu
412
- </span>
413
- <button
414
- aria-label="Zatvoriť menu"
415
- className={CLASS_MOBILE_OVERLAY}
416
- type="button"
417
- />
418
-
419
- <div className={CLASS_MOBILE_WRAPPER}>
420
- <div className={CLASS_MOBILE_HEADER}>
421
- <div className={CLASS_CONTAINER}>
422
- <ul className={cx(CLASS_NAV, CLASS_NAV_SPACE_SMALL)}>
423
- <li className={CLASS_NAV_ITEM}>
424
- <a
425
- href="/"
426
- className={cx(CLASS_NAV_LINK, "is-active")}
427
- aria-current="page"
520
+ <div className={CLASS_MOBILE_HEADER}>
521
+ <div className={CLASS_CONTAINER}>
522
+ <ul className={cx(CLASS_NAV, CLASS_NAV_SPACE_SMALL)}>
523
+ <li className={CLASS_NAV_ITEM}>
524
+ <div
525
+ className={cx(
526
+ CLASS_NAV_BUTTON,
527
+ CLASS_NAV_BUTTON_INDICATOR,
528
+ CLASS_NAV_SELECT_WRAPPER,
529
+ )}
530
+ >
531
+ <select
532
+ className={CLASS_NAV_SELECT}
533
+ defaultValue="/"
534
+ aria-label="Vyberte typ zákazníka"
428
535
  >
429
- Pre vás
430
- </a>
431
- </li>
432
- <li className={CLASS_NAV_ITEM}>
433
- <a href="/" className={CLASS_NAV_LINK}>
434
- Pre biznis
435
- </a>
436
- </li>
536
+ <option value="/">Pre vás</option>
537
+ <option value="/">Podnikatelia a malé firmy</option>
538
+ <option value="/">Velké firmy</option>
539
+ </select>
540
+ </div>
541
+ </li>
437
542
 
438
- <li className={CLASS_NAV_SPACER} aria-hidden="true"></li>
543
+ <li className={CLASS_NAV_SPACER} aria-hidden="true"></li>
439
544
 
440
- <li className={CLASS_NAV_ITEM}>
441
- <button
442
- type="button"
443
- data-megamenu-close-button
444
- data-megamenu-mobile-target="main"
445
- className={CLASS_NAV_BUTTON}
446
- aria-label="Zatvoriť menu"
447
- >
448
- <MegamenuIcon
449
- name="close"
450
- width={20}
451
- height={20}
452
- aria-hidden="true"
453
- />
454
- </button>
455
- </li>
456
- </ul>
457
- </div>
545
+ <li className={CLASS_NAV_ITEM}>
546
+ <MegamenuCloseButton
547
+ ariaLabel="Zatvoriť menu"
548
+ target="main"
549
+ />
550
+ </li>
551
+ </ul>
552
+ </div>
553
+ </div>
554
+ <div className={CLASS_MOBILE_BODY}>
555
+ <div className={CLASS_CONTAINER}>
556
+ <MegamenuSearchContent
557
+ inputId={ids.searchInputMobileId}
558
+ inputLabel="Vyhľadávanie v mobilnom menu"
559
+ searchValue={searchValue}
560
+ hasSearchEmpty={hasSearchEmpty}
561
+ hasSearchFilled={hasSearchFilled}
562
+ />
458
563
  </div>
459
- <div className={CLASS_MOBILE_BODY}>
460
- <div className={CLASS_CONTAINER}>
461
- <MegamenuSearchContent
462
- inputId={ids.searchInputMobileId}
463
- inputLabel="Vyhľadávanie v mobilnom menu"
464
- searchValue={searchValue}
465
- hasSearchEmpty={hasSearchEmpty}
466
- hasSearchFilled={hasSearchFilled}
467
- />
468
564
 
469
- {!showSearchState ? (
470
- <>
471
- <ul className={CLASS_ACCORDION}>
472
- {menuSections.map((section) => {
473
- const accordionId = `mobile-accordion-${section.id}`;
474
- const buttonId = `mobile-${section.id}-button`;
565
+ <div className={CLASS_CONTAINER}>
566
+ {!showSearchState ? (
567
+ <>
568
+ <ul className={CLASS_ACCORDION}>
569
+ {menuSections.map((section) => {
570
+ const accordionId = `mobile-accordion-${section.id}`;
571
+ const buttonId = `mobile-${section.id}-button`;
475
572
 
476
- return (
477
- <li className={CLASS_ACCORDION_ITEM} key={section.id}>
478
- <div className={CLASS_ACCORDION_HEADER}>
479
- <button
480
- type="button"
481
- className={CLASS_ACCORDION_BUTTON}
482
- aria-controls={accordionId}
483
- aria-expanded="false"
484
- data-accordion-toggle
485
- id={buttonId}
486
- >
487
- <span className={CLASS_ACCORDION_TITLE}>
488
- {section.label}
489
- </span>
490
- <MegamenuIcon
491
- name="chevron-right"
492
- width={24}
493
- height={24}
494
- className={CLASS_ACCORDION_ICON}
495
- aria-hidden="true"
496
- />
497
- </button>
498
- </div>
499
- <div
500
- className={CLASS_ACCORDION_BODY}
501
- id={accordionId}
502
- role="region"
503
- aria-labelledby={buttonId}
573
+ return (
574
+ <li className={CLASS_ACCORDION_ITEM} key={section.id}>
575
+ <div className={CLASS_ACCORDION_HEADER}>
576
+ <button
577
+ type="button"
578
+ className={CLASS_ACCORDION_BUTTON}
579
+ aria-controls={accordionId}
580
+ aria-expanded="false"
581
+ data-accordion-toggle
582
+ id={buttonId}
504
583
  >
505
- {renderMenuSectionGrid(
506
- section,
507
- "mobile",
508
- CLASS_CAPTION,
509
- true,
510
- )}
511
- </div>
512
- </li>
513
- );
514
- })}
515
-
516
- <li className={CLASS_ACCORDION_ITEM}>
517
- <div className={CLASS_ACCORDION_HEADER}>
518
- <a href="/" className={CLASS_ACCORDION_BUTTON}>
519
- <span className={CLASS_ACCORDION_TITLE}>Akcie</span>
520
- </a>
521
- </div>
522
- </li>
523
-
524
- <li className={CLASS_ACCORDION_ITEM}>
525
- <div className={CLASS_ACCORDION_HEADER}>
526
- <a href="/" className={CLASS_ACCORDION_BUTTON}>
527
- <span className={CLASS_ACCORDION_TITLE}>Pomoc</span>
528
- </a>
529
- </div>
530
- </li>
531
- </ul>
584
+ <span className={CLASS_ACCORDION_TITLE}>
585
+ {section.label}
586
+ </span>
587
+ <MegamenuIcon
588
+ name="chevron-right"
589
+ width={24}
590
+ height={24}
591
+ className={CLASS_ACCORDION_ICON}
592
+ aria-hidden="true"
593
+ />
594
+ </button>
595
+ </div>
596
+ <div
597
+ className={CLASS_ACCORDION_BODY}
598
+ id={accordionId}
599
+ role="region"
600
+ aria-labelledby={buttonId}
601
+ >
602
+ {renderMenuSectionGrid(
603
+ section,
604
+ "mobile",
605
+ CLASS_CAPTION,
606
+ true,
607
+ tiles,
608
+ true,
609
+ )}
610
+ </div>
611
+ </li>
612
+ );
613
+ })}
532
614
 
533
- <ul
534
- className={cx(
535
- CLASS_NAV,
536
- CLASS_NAV_SPACE_SMALL,
537
- CLASS_NAV_MOBILE_LOCALE,
538
- )}
539
- aria-label="Výber jazyka"
540
- >
541
- <li className={CLASS_NAV_ITEM}>
542
- <a
543
- href="/"
544
- className={cx(
545
- CLASS_NAV_LINK,
546
- CLASS_NAV_LINK_LOCALE,
547
- "is-active",
548
- )}
549
- >
550
- SK
615
+ <li className={CLASS_ACCORDION_ITEM}>
616
+ <div className={CLASS_ACCORDION_HEADER}>
617
+ <a href="/" className={CLASS_ACCORDION_BUTTON}>
618
+ <span className={CLASS_ACCORDION_TITLE}>Akcie</span>
551
619
  </a>
552
- </li>
553
- <li className={CLASS_NAV_ITEM}>
554
- <a
555
- href="/"
556
- className={cx(CLASS_NAV_LINK, CLASS_NAV_LINK_LOCALE)}
557
- >
558
- EN
559
- </a>
560
- </li>
561
- </ul>
562
- </>
563
- ) : null}
564
- </div>
620
+ </div>
621
+ </li>
565
622
 
566
- {!showSearchState ? (
567
- <>
568
- <hr className="mt-none" />
569
- <div className={CLASS_CONTAINER}>
570
- <h3 id="mobile-quick-access-heading" className="sr-only">
571
- Rýchly prístup
572
- </h3>
573
- <ul
574
- className={cx(CLASS_NAV, CLASS_NAV_VERTICAL)}
575
- role="group"
576
- aria-labelledby="mobile-quick-access-heading"
577
- >
578
- <li className={CLASS_NAV_ITEM}>
579
- <button
580
- type="button"
581
- className={CLASS_NAV_BUTTON}
582
- data-megamenu-mobile-toggle
583
- data-megamenu-mobile-target="my-orange"
584
- aria-haspopup="dialog"
585
- aria-expanded="false"
586
- >
587
- <MegamenuIcon
588
- width={24}
589
- height={24}
590
- name="user"
591
- className={CLASS_NAV_ICON}
592
- aria-hidden="true"
593
- />
594
- Môj Orange
595
- </button>
596
- </li>
597
- <li className={CLASS_NAV_ITEM}>
598
- <a href="/" className={CLASS_NAV_BUTTON}>
599
- <MegamenuIcon
600
- width={24}
601
- height={24}
602
- name="call"
603
- className={CLASS_NAV_ICON}
604
- aria-hidden="true"
605
- />
606
- Kontakt
607
- </a>
608
- </li>
609
- <li className={CLASS_NAV_ITEM}>
610
- <a href="/" className={CLASS_NAV_BUTTON}>
611
- <MegamenuIcon
612
- width={24}
613
- height={24}
614
- name="advertising"
615
- className={CLASS_NAV_ICON}
616
- aria-hidden="true"
617
- />
618
- Akcie
623
+ <li className={CLASS_ACCORDION_ITEM}>
624
+ <div className={CLASS_ACCORDION_HEADER}>
625
+ <a href="/" className={CLASS_ACCORDION_BUTTON}>
626
+ <span className={CLASS_ACCORDION_TITLE}>Pomoc</span>
619
627
  </a>
620
- </li>
621
- <li className={CLASS_NAV_ITEM}>
622
- <a href="/" className={CLASS_NAV_BUTTON}>
623
- <MegamenuIcon
624
- width={24}
625
- height={24}
626
- name="newspaper"
627
- className={CLASS_NAV_ICON}
628
- aria-hidden="true"
629
- />
630
- Pomoc
631
- </a>
632
- </li>
633
- </ul>
634
- </div>
628
+ </div>
629
+ </li>
630
+ </ul>
635
631
  </>
636
632
  ) : null}
637
633
  </div>
634
+
635
+ {!showSearchState ? (
636
+ <>
637
+ <div className={CLASS_CONTAINER}>
638
+ <div className={CLASS_MOBILE_CTA}>
639
+ <a href="/" className={CLASS_NAV_LINK_CTA}>
640
+ <MegamenuIcon
641
+ width={16}
642
+ height={16}
643
+ name="rewards"
644
+ className={CLASS_NAV_ICON_CTA}
645
+ aria-hidden="true"
646
+ />
647
+ Prejdite k nám
648
+ </a>
649
+ </div>
650
+ </div>
651
+
652
+ <div className={CLASS_CONTAINER}>
653
+ <h3 id="mobile-quick-access-heading" className="sr-only">
654
+ Rýchly prístup
655
+ </h3>
656
+ <ul
657
+ className={cx(CLASS_NAV, CLASS_NAV_VERTICAL)}
658
+ role="group"
659
+ aria-labelledby="mobile-quick-access-heading"
660
+ >
661
+ <li className={CLASS_NAV_ITEM}>
662
+ <button
663
+ type="button"
664
+ className={CLASS_NAV_BUTTON}
665
+ data-megamenu-mobile-toggle
666
+ data-megamenu-mobile-target="my-orange"
667
+ aria-haspopup="dialog"
668
+ aria-expanded="false"
669
+ >
670
+ <MegamenuIcon
671
+ width={24}
672
+ height={24}
673
+ name="user"
674
+ className={CLASS_NAV_ICON}
675
+ aria-hidden="true"
676
+ />
677
+ Môj Orange
678
+ </button>
679
+ </li>
680
+ <li className={CLASS_NAV_ITEM}>
681
+ <a href="/" className={CLASS_NAV_BUTTON}>
682
+ <MegamenuIcon
683
+ width={24}
684
+ height={24}
685
+ name="call"
686
+ className={CLASS_NAV_ICON}
687
+ aria-hidden="true"
688
+ />
689
+ Kontakt
690
+ </a>
691
+ </li>
692
+ <li className={CLASS_NAV_ITEM}>
693
+ <a href="/" className={CLASS_NAV_BUTTON}>
694
+ <MegamenuIcon
695
+ width={24}
696
+ height={24}
697
+ name="advertising"
698
+ className={CLASS_NAV_ICON}
699
+ aria-hidden="true"
700
+ />
701
+ Akcie
702
+ </a>
703
+ </li>
704
+ <li className={CLASS_NAV_ITEM}>
705
+ <a href="/" className={CLASS_NAV_BUTTON}>
706
+ <MegamenuIcon
707
+ width={24}
708
+ height={24}
709
+ name="newspaper"
710
+ className={CLASS_NAV_ICON}
711
+ aria-hidden="true"
712
+ />
713
+ Pomoc
714
+ </a>
715
+ </li>
716
+ </ul>
717
+ </div>
718
+
719
+ <div className={CLASS_CONTAINER}>
720
+ <ul
721
+ className={cx(
722
+ CLASS_NAV,
723
+ CLASS_NAV_SPACE_SMALL,
724
+ CLASS_NAV_MOBILE_LOCALE,
725
+ )}
726
+ aria-label="Výber jazyka"
727
+ >
728
+ <li className={CLASS_NAV_ITEM}>
729
+ <a
730
+ href="/"
731
+ className={cx(
732
+ CLASS_NAV_LINK,
733
+ CLASS_NAV_LINK_LOCALE,
734
+ "is-active",
735
+ )}
736
+ >
737
+ SK
738
+ </a>
739
+ </li>
740
+ <li className={CLASS_NAV_ITEM}>
741
+ <a
742
+ href="/"
743
+ className={cx(CLASS_NAV_LINK, CLASS_NAV_LINK_LOCALE)}
744
+ >
745
+ EN
746
+ </a>
747
+ </li>
748
+ </ul>
749
+ </div>
750
+ </>
751
+ ) : null}
638
752
  </div>
639
- </div>
753
+ </MegamenuMobilePanel>
640
754
 
641
755
  <MyOrangeMobilePanel
642
756
  panelId={ids.myOrangePanelId}
643
757
  titleId={ids.myOrangeTitleId}
758
+ isB2B={isB2B}
759
+ isLoggedIn={isLoggedIn}
644
760
  />
645
761
 
646
762
  <button