@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
@@ -5,6 +5,29 @@ export type MenuItem = {
5
5
  tag?: string;
6
6
  };
7
7
 
8
+ export type MegamenuTile = {
9
+ label: string;
10
+ href?: string;
11
+ icon: string;
12
+ tag?: string;
13
+ isActive?: boolean;
14
+ };
15
+
16
+ export const megamenuTiles: MegamenuTile[] = [
17
+ {
18
+ label: "Chcem nové číslo",
19
+ icon: "sim",
20
+ tag: "1 mesiac zadarmo",
21
+ isActive: true,
22
+ },
23
+ {
24
+ label: "Chcem preniesť číslo",
25
+ icon: "showroom-mobile-pro",
26
+ tag: "1 mesiac zadarmo",
27
+ },
28
+ { label: "Chcem zmeniť paušál", icon: "showroom-mobile-pro" },
29
+ ];
30
+
8
31
  type MenuGroup = {
9
32
  id: string;
10
33
  heading: string;
@@ -26,9 +49,10 @@ export const menuSections: MenuSection[] = [
26
49
  id: "odporucane-sluzby",
27
50
  heading: "Odporúčané služby",
28
51
  items: [
29
- { label: "Paušály", isLarge: true },
30
- { label: "Prima Voľba", isLarge: true },
52
+ { label: "Super paušály", isLarge: true },
53
+ { label: "Predplatené karty", isLarge: true },
31
54
  { label: "Roaming", isLarge: true },
55
+ { label: "Love", isLarge: true },
32
56
  ],
33
57
  },
34
58
  columns: [
@@ -38,8 +62,9 @@ export const menuSections: MenuSection[] = [
38
62
  heading: "Paušály",
39
63
  items: [
40
64
  { label: "Prehľad paušálov" },
41
- { label: "Chcem nové číslo" },
42
- { label: "Yoxo paušál", tag: "Novinka" },
65
+ { label: "Super paušály", tag: "Novinka" },
66
+ { label: "Yoxo paušál" },
67
+ { label: "Paušalík" },
43
68
  ],
44
69
  },
45
70
  {
@@ -51,14 +76,26 @@ export const menuSections: MenuSection[] = [
51
76
  { label: "FunFón" },
52
77
  ],
53
78
  },
79
+ ],
80
+ [
54
81
  {
55
82
  id: "zahranicie",
56
83
  heading: "Zahraničie",
57
84
  items: [
58
85
  { label: "Roaming" },
59
- { label: "Cestovateľské balíky" },
86
+ { label: "Roamingové balíky" },
60
87
  { label: "Volania do zahraničia" },
61
- { label: "Regulovaný roaming" },
88
+ { label: "Regulovaný roaming v EÚ" },
89
+ { label: "Cestovné poistenie" },
90
+ ],
91
+ },
92
+ {
93
+ id: "doplnkove-sluzby",
94
+ heading: "Doplnkové služby",
95
+ items: [
96
+ { label: "eWatch", tag: "Novinka" },
97
+ { label: "eSIM" },
98
+ { label: "Poistenie zariadení" },
62
99
  ],
63
100
  },
64
101
  ],
@@ -68,13 +105,10 @@ export const menuSections: MenuSection[] = [
68
105
  heading: "Ste náš zákazník?",
69
106
  items: [
70
107
  { label: "Chcem zmeniť paušál" },
108
+ { label: "Chcem predĺžiť služby" },
71
109
  { label: "Dobiť kredit" },
72
- { label: "Predĺžiť služby" },
73
- { label: "Chcem nový telefón" },
74
- { label: "Navzájom zadarmo" },
75
- { label: "Orange Svojim" },
76
110
  { label: "Odporučte Orange" },
77
- { label: "Ostatné služby" },
111
+ { label: "Navzájom zadarmo" },
78
112
  ],
79
113
  },
80
114
  ],
@@ -105,6 +139,8 @@ export const menuSections: MenuSection[] = [
105
139
  { label: "Domáca linka k internetu" },
106
140
  ],
107
141
  },
142
+ ],
143
+ [
108
144
  {
109
145
  id: "televizia",
110
146
  heading: "Televízia",
@@ -115,6 +151,8 @@ export const menuSections: MenuSection[] = [
115
151
  { label: "Novinky na Orange TV" },
116
152
  ],
117
153
  },
154
+ ],
155
+ [
118
156
  {
119
157
  id: "internet-televizia",
120
158
  heading: "Internet + televízia",
@@ -125,8 +163,6 @@ export const menuSections: MenuSection[] = [
125
163
  { label: "Regulovaný roaming" },
126
164
  ],
127
165
  },
128
- ],
129
- [
130
166
  {
131
167
  id: "nase-sluzby",
132
168
  heading: "Ste náš zákazník?",
@@ -168,6 +204,8 @@ export const menuSections: MenuSection[] = [
168
204
  { label: "Oppo" },
169
205
  ],
170
206
  },
207
+ ],
208
+ [
171
209
  {
172
210
  id: "tablety-a-notebooky",
173
211
  heading: "Tablety a notebooky",
@@ -179,6 +217,8 @@ export const menuSections: MenuSection[] = [
179
217
  { label: "Asus" },
180
218
  ],
181
219
  },
220
+ ],
221
+ [
182
222
  {
183
223
  id: "sikovne-zariadenia",
184
224
  heading: "Šikovné zariadenia",
@@ -189,8 +229,6 @@ export const menuSections: MenuSection[] = [
189
229
  { label: "Herné konzoly" },
190
230
  ],
191
231
  },
192
- ],
193
- [
194
232
  {
195
233
  id: "orange-akcie",
196
234
  heading: "Orange akcie",
@@ -0,0 +1,154 @@
1
+ import cx from "classnames";
2
+ import React from "react";
3
+ import { BrandMark } from "./BrandMark";
4
+ import {
5
+ CLASS_CONTAINER,
6
+ CLASS_MOBILE,
7
+ CLASS_MOBILE_OVERLAY,
8
+ CLASS_MOBILE_WRAPPER,
9
+ CLASS_NAV_BUTTON,
10
+ CLASS_NAV_DROPDOWN,
11
+ CLASS_NAV_LOGO,
12
+ } from "./constants";
13
+ import { Logo } from "./Logo";
14
+ import { MegamenuIcon } from "./MegaMenuIcon";
15
+ import { MegamenuSearchContent } from "./MegamenuSearchContent";
16
+
17
+ export type MegamenuSearchState = {
18
+ hasSearchEmpty: boolean;
19
+ hasSearchFilled: boolean;
20
+ showSearchState: boolean;
21
+ searchValue: string;
22
+ };
23
+
24
+ type MegamenuLogoLinkProps = {
25
+ compactLogoOnly?: boolean;
26
+ href?: string;
27
+ title: string;
28
+ children?: React.ReactNode;
29
+ };
30
+
31
+ type MegamenuSearchDropdownProps = {
32
+ dropdownId: string;
33
+ inputId: string;
34
+ inputLabel: string;
35
+ searchValue: string;
36
+ hasSearchEmpty: boolean;
37
+ hasSearchFilled: boolean;
38
+ emptyStateLinkHref?: string;
39
+ };
40
+
41
+ type MegamenuCloseButtonProps = {
42
+ ariaLabel: string;
43
+ target: string;
44
+ };
45
+
46
+ type MegamenuMobilePanelProps = {
47
+ titleId: string;
48
+ panelId?: string;
49
+ target: string;
50
+ title: React.ReactNode;
51
+ overlayAriaLabel: string;
52
+ children: React.ReactNode;
53
+ };
54
+
55
+ export const getMegamenuSearchState = (
56
+ searchEmpty?: boolean,
57
+ searchFilled?: boolean,
58
+ ): MegamenuSearchState => {
59
+ const hasSearchEmpty = Boolean(searchEmpty);
60
+ const hasSearchFilled = Boolean(searchFilled);
61
+
62
+ return {
63
+ hasSearchEmpty,
64
+ hasSearchFilled,
65
+ showSearchState: hasSearchEmpty || hasSearchFilled,
66
+ searchValue: hasSearchEmpty ? "" : hasSearchFilled ? "apple" : "",
67
+ };
68
+ };
69
+
70
+ export const MegamenuLogoLink = ({
71
+ compactLogoOnly = false,
72
+ href = "/",
73
+ title,
74
+ children,
75
+ }: MegamenuLogoLinkProps) => (
76
+ <a
77
+ href={href}
78
+ className={CLASS_NAV_LOGO}
79
+ aria-label={`${title} - Domovská stránka`}
80
+ >
81
+ {compactLogoOnly ? <Logo /> : <BrandMark />}
82
+ {children}
83
+ </a>
84
+ );
85
+
86
+ export const MegamenuSearchDropdown = ({
87
+ dropdownId,
88
+ inputId,
89
+ inputLabel,
90
+ searchValue,
91
+ hasSearchEmpty,
92
+ hasSearchFilled,
93
+ emptyStateLinkHref,
94
+ }: MegamenuSearchDropdownProps) => (
95
+ <div className={cx(CLASS_NAV_DROPDOWN, "is-spaced")} id={dropdownId}>
96
+ <div className={CLASS_CONTAINER}>
97
+ <MegamenuSearchContent
98
+ inputId={inputId}
99
+ inputLabel={inputLabel}
100
+ searchValue={searchValue}
101
+ hasSearchEmpty={hasSearchEmpty}
102
+ hasSearchFilled={hasSearchFilled}
103
+ emptyStateLinkHref={emptyStateLinkHref}
104
+ />
105
+ </div>
106
+ </div>
107
+ );
108
+
109
+ export const MegamenuCloseButton = ({
110
+ ariaLabel,
111
+ target,
112
+ }: MegamenuCloseButtonProps) => (
113
+ <button
114
+ type="button"
115
+ data-megamenu-close-button
116
+ data-megamenu-mobile-target={target}
117
+ className={CLASS_NAV_BUTTON}
118
+ aria-label={ariaLabel}
119
+ >
120
+ <MegamenuIcon name="close" width={20} height={20} aria-hidden="true" />
121
+ </button>
122
+ );
123
+
124
+ export const MegamenuMobilePanel = ({
125
+ titleId,
126
+ panelId,
127
+ target,
128
+ title,
129
+ overlayAriaLabel,
130
+ children,
131
+ }: MegamenuMobilePanelProps) => (
132
+ <div
133
+ className={CLASS_MOBILE}
134
+ data-megamenu-mobile-panel={target}
135
+ id={panelId}
136
+ role="dialog"
137
+ aria-modal="true"
138
+ aria-labelledby={titleId}
139
+ aria-hidden="true"
140
+ >
141
+ <span id={titleId} className="sr-only">
142
+ {title}
143
+ </span>
144
+ <button
145
+ aria-label={overlayAriaLabel}
146
+ className={CLASS_MOBILE_OVERLAY}
147
+ type="button"
148
+ data-megamenu-close-button
149
+ data-megamenu-mobile-target={target}
150
+ />
151
+
152
+ <div className={CLASS_MOBILE_WRAPPER}>{children}</div>
153
+ </div>
154
+ );