@orangesk/orange-design-system 2.0.0-beta.7 → 2.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/index.js +4 -4
- package/build/components/index.js.map +1 -1
- package/build/components/tsconfig.tsbuildinfo +1 -1
- package/build/components/types/index.d.ts +2 -2
- package/build/components/types/src/components/AnchorNavigation/AnchorNavigation.d.ts +1 -1
- package/build/components/types/src/components/AnchorNavigation/AnchorNavigation.static.d.ts +19 -17
- package/build/components/types/src/components/Card/Card.d.ts +1 -1
- package/build/components/types/src/components/Megamenu/constants.d.ts +2 -0
- package/build/components/types/src/scripts/index.d.ts +5 -0
- package/build/lib/after-components.css +1 -1
- package/build/lib/after-components.css.map +1 -1
- package/build/lib/before-components.css +1 -1
- package/build/lib/before-components.css.map +1 -1
- package/build/lib/components.css +1 -1
- package/build/lib/components.css.map +1 -1
- package/build/lib/megamenu.css +1 -1
- package/build/lib/megamenu.css.map +1 -1
- package/build/lib/megamenu.js +1 -1
- package/build/lib/megamenu.js.map +1 -1
- package/build/lib/scripts.js +4 -4
- package/build/lib/scripts.js.map +1 -1
- package/build/lib/style.css +1 -1
- package/build/lib/style.css.map +1 -1
- package/build/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/components/AnchorNavigation/AnchorNavigation.static.ts +253 -73
- package/src/components/AnchorNavigation/AnchorNavigation.tsx +31 -24
- package/src/components/AnchorNavigation/styles/mixins.scss +14 -17
- package/src/components/AnchorNavigation/tests/AnchorNavigation.conformance.test.js +67 -0
- package/src/components/AnchorNavigation/tests/AnchorNavigation.unit.test.js +163 -0
- package/src/components/BlockAction/styles/mixins.scss +0 -6
- package/src/components/Card/Card.tsx +1 -0
- package/src/components/Link/styles/style.scss +1 -1
- package/src/components/Link/tests/Link.conformance.test.js +5 -20
- package/src/components/Link/tests/Link.unit.test.js +1 -10
- package/src/components/Megamenu/Megamenu.static.ts +2 -0
- package/src/components/Megamenu/Megamenu.tsx +671 -665
- package/src/components/Megamenu/MegamenuBlog.tsx +187 -183
- package/src/components/Megamenu/constants.ts +2 -0
- package/src/components/Megamenu/styles/mixins.scss +30 -1
- package/src/components/Megamenu/styles/style.scss +8 -0
- package/src/styles/base/globals.scss +18 -0
- package/src/styles/utilities/color.scss +4 -0
|
@@ -32,143 +32,145 @@ import {
|
|
|
32
32
|
CLASS_ACCORDION_HEADER,
|
|
33
33
|
CLASS_ACCORDION_ITEM,
|
|
34
34
|
CLASS_ACCORDION_TITLE,
|
|
35
|
+
CLASS_SPACER_SMALL,
|
|
35
36
|
} from "./constants";
|
|
36
37
|
|
|
37
38
|
export const MegamenuBlog = ({ className }: any) => {
|
|
38
39
|
return (
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<div className={
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<svg
|
|
57
|
-
viewBox="0 0 40 40"
|
|
58
|
-
fill="none"
|
|
59
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
60
|
-
aria-hidden="true"
|
|
40
|
+
<header>
|
|
41
|
+
<nav
|
|
42
|
+
className={cx(CLASS_ROOT, className)}
|
|
43
|
+
data-megamenu
|
|
44
|
+
aria-label="Main navigation"
|
|
45
|
+
>
|
|
46
|
+
<div className={CLASS_MAIN}>
|
|
47
|
+
<div className={CLASS_CONTAINER}>
|
|
48
|
+
<h2 id="menu-title" className="sr-only">
|
|
49
|
+
Hlavné menu
|
|
50
|
+
</h2>
|
|
51
|
+
<ul className={CLASS_NAV} aria-labelledby="menu-title">
|
|
52
|
+
<li className={cx(CLASS_NAV_ITEM, CLASS_NAV_ITEM_MAIN)}>
|
|
53
|
+
<a
|
|
54
|
+
href="#"
|
|
55
|
+
className={CLASS_NAV_LOGO}
|
|
56
|
+
aria-label="Domovská stránka"
|
|
61
57
|
>
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
)}
|
|
78
|
-
>
|
|
79
|
-
<a href="#" className={cx(CLASS_NAV_LINK)}>
|
|
80
|
-
Naspať na Orange
|
|
81
|
-
</a>
|
|
82
|
-
</li>
|
|
83
|
-
|
|
84
|
-
<li className={CLASS_NAV_SPACER} aria-hidden="true"></li>
|
|
58
|
+
<svg
|
|
59
|
+
viewBox="0 0 40 40"
|
|
60
|
+
fill="none"
|
|
61
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
62
|
+
aria-hidden="true"
|
|
63
|
+
>
|
|
64
|
+
<path d="M40 0H0V40H40V0Z" fill="#FF7900" />
|
|
65
|
+
<path
|
|
66
|
+
d="M34.2897 28.57H5.71973V34.28H34.2897V28.57Z"
|
|
67
|
+
fill="white"
|
|
68
|
+
/>
|
|
69
|
+
</svg>
|
|
70
|
+
<span>Človek</span>
|
|
71
|
+
</a>
|
|
72
|
+
</li>
|
|
85
73
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
aria-expanded="false"
|
|
93
|
-
aria-haspopup="true"
|
|
74
|
+
<li
|
|
75
|
+
className={cx(
|
|
76
|
+
CLASS_NAV_ITEM,
|
|
77
|
+
CLASS_NAV_ITEM_MAIN,
|
|
78
|
+
CLASS_HIDE_MD_DOWN,
|
|
79
|
+
)}
|
|
94
80
|
>
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
</button>
|
|
81
|
+
<a href="#" className={cx(CLASS_NAV_LINK)}>
|
|
82
|
+
Naspať na Orange
|
|
83
|
+
</a>
|
|
84
|
+
</li>
|
|
85
|
+
|
|
86
|
+
<li className={CLASS_NAV_SPACER} aria-hidden="true"></li>
|
|
102
87
|
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
88
|
+
<li className={cx(CLASS_NAV_ITEM, CLASS_HIDE_MD_DOWN)}>
|
|
89
|
+
<button
|
|
90
|
+
type="button"
|
|
91
|
+
className={CLASS_NAV_BUTTON}
|
|
92
|
+
aria-label="Vyhľadávanie"
|
|
93
|
+
aria-controls="megamenu-search"
|
|
94
|
+
aria-expanded="false"
|
|
95
|
+
aria-haspopup="true"
|
|
96
|
+
>
|
|
97
|
+
<MegamenuIcon
|
|
98
|
+
width={24}
|
|
99
|
+
height={24}
|
|
100
|
+
name="search"
|
|
101
|
+
aria-hidden="true"
|
|
114
102
|
/>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
103
|
+
</button>
|
|
104
|
+
|
|
105
|
+
<div className={CLASS_NAV_DROPDOWN} id="megamenu-search">
|
|
106
|
+
<div className={CLASS_CONTAINER}>
|
|
107
|
+
<input
|
|
108
|
+
className={cx(
|
|
109
|
+
CLASS_INPUT,
|
|
110
|
+
CLASS_INPUT_SEARCH_ICON_WITH_PLACEHOLDER,
|
|
111
|
+
)}
|
|
112
|
+
id="search-1"
|
|
113
|
+
type="text"
|
|
114
|
+
placeholder="Search"
|
|
115
|
+
name="search-1"
|
|
116
|
+
/>
|
|
117
|
+
<ul className={CLASS_SUBNAV}>
|
|
118
|
+
<li className={CLASS_SUBNAV_ITEM}>
|
|
119
|
+
<a href="#">apple</a>
|
|
120
|
+
</li>
|
|
121
|
+
<li className={CLASS_SUBNAV_ITEM}>
|
|
122
|
+
<a href="#">apple hodinky</a>
|
|
123
|
+
</li>
|
|
124
|
+
<li className={CLASS_SUBNAV_ITEM}>
|
|
125
|
+
<a href="#">apple iphone</a>
|
|
126
|
+
</li>
|
|
127
|
+
<li className={CLASS_SUBNAV_ITEM}>
|
|
128
|
+
<a href="#">apple 16</a>
|
|
129
|
+
</li>
|
|
130
|
+
<li className={CLASS_SUBNAV_ITEM}>
|
|
131
|
+
<a href="#">apple pro</a>
|
|
132
|
+
</li>
|
|
133
|
+
<li className={CLASS_SUBNAV_ITEM}>
|
|
134
|
+
<a href="#">apple watch</a>
|
|
135
|
+
</li>
|
|
136
|
+
</ul>
|
|
137
|
+
</div>
|
|
135
138
|
</div>
|
|
136
|
-
</
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
</
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
</
|
|
165
|
-
</
|
|
166
|
-
</
|
|
139
|
+
</li>
|
|
140
|
+
<li className={CLASS_NAV_ITEM}>
|
|
141
|
+
<a href="#" className={CLASS_NAV_LINK}>
|
|
142
|
+
<MegamenuIcon
|
|
143
|
+
width={24}
|
|
144
|
+
height={24}
|
|
145
|
+
name="user"
|
|
146
|
+
className={CLASS_NAV_ICON}
|
|
147
|
+
aria-hidden="true"
|
|
148
|
+
/>
|
|
149
|
+
Môj Orange
|
|
150
|
+
</a>
|
|
151
|
+
</li>
|
|
152
|
+
<li className={cx(CLASS_NAV_ITEM, CLASS_HIDE_LG_UP)}>
|
|
153
|
+
<button
|
|
154
|
+
type="button"
|
|
155
|
+
className={CLASS_NAV_BUTTON}
|
|
156
|
+
aria-label="Otvoriť menu"
|
|
157
|
+
aria-haspopup="true"
|
|
158
|
+
aria-expanded="false"
|
|
159
|
+
>
|
|
160
|
+
<MegamenuIcon
|
|
161
|
+
width={24}
|
|
162
|
+
height={24}
|
|
163
|
+
name="menu"
|
|
164
|
+
aria-hidden="true"
|
|
165
|
+
/>
|
|
166
|
+
</button>
|
|
167
|
+
</li>
|
|
168
|
+
</ul>
|
|
169
|
+
</div>
|
|
167
170
|
</div>
|
|
168
|
-
</div>
|
|
169
171
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
{/* This is not needed, but I'll keep it here if anyone changes his mind to has it as part of megamenu */}
|
|
173
|
+
{/* <div className={cx(CLASS_SUBMAIN, CLASS_HIDE_MD_DOWN)}>
|
|
172
174
|
<div className={CLASS_CONTAINER}>
|
|
173
175
|
<ul className={cx(CLASS_LIST_INLINE, CLASS_ALIGN_CENTER)}>
|
|
174
176
|
<li>
|
|
@@ -235,71 +237,73 @@ export const MegamenuBlog = ({ className }: any) => {
|
|
|
235
237
|
</div>
|
|
236
238
|
</div> */}
|
|
237
239
|
|
|
238
|
-
|
|
240
|
+
{/* MOBILE MENU */}
|
|
239
241
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
242
|
+
<div
|
|
243
|
+
// className={cx(CLASS_MOBILE, "is-active")}
|
|
244
|
+
className={cx(CLASS_MOBILE)}
|
|
245
|
+
role="dialog"
|
|
246
|
+
aria-modal="true"
|
|
247
|
+
aria-labelledby="mobile-menu-title"
|
|
248
|
+
>
|
|
249
|
+
<h2 id="mobile-menu-title" className="sr-only">
|
|
250
|
+
Hlavné menu
|
|
251
|
+
</h2>
|
|
252
|
+
<button
|
|
253
|
+
aria-label="Zatvoriť menu"
|
|
254
|
+
className={CLASS_MOBILE_OVERLAY}
|
|
255
|
+
type="button"
|
|
256
|
+
/>
|
|
255
257
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
<div className={CLASS_MOBILE_WRAPPER}>
|
|
259
|
+
<div className={CLASS_MOBILE_HEADER}>
|
|
260
|
+
<div className={CLASS_CONTAINER}>
|
|
261
|
+
<ul className={cx(CLASS_NAV, CLASS_NAV_SPACE_SMALL)}>
|
|
262
|
+
<li className={CLASS_NAV_SPACER} aria-hidden="true"></li>
|
|
261
263
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
264
|
+
<li className={CLASS_NAV_ITEM}>
|
|
265
|
+
<button
|
|
266
|
+
type="button"
|
|
267
|
+
data-megamenu-close-button
|
|
268
|
+
className={CLASS_NAV_BUTTON}
|
|
269
|
+
aria-label="Zatvoriť menu"
|
|
270
|
+
>
|
|
271
|
+
<MegamenuIcon
|
|
272
|
+
name="close"
|
|
273
|
+
width={20}
|
|
274
|
+
height={20}
|
|
275
|
+
aria-hidden="true"
|
|
276
|
+
/>
|
|
277
|
+
</button>
|
|
278
|
+
</li>
|
|
279
|
+
</ul>
|
|
280
|
+
</div>
|
|
278
281
|
</div>
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
</
|
|
289
|
-
</
|
|
290
|
-
</
|
|
291
|
-
</
|
|
292
|
-
</
|
|
282
|
+
<div className={CLASS_MOBILE_BODY}>
|
|
283
|
+
<div className={CLASS_CONTAINER}>
|
|
284
|
+
<ul className={CLASS_ACCORDION}>
|
|
285
|
+
<li className={CLASS_ACCORDION_ITEM}>
|
|
286
|
+
<div className={CLASS_ACCORDION_HEADER}>
|
|
287
|
+
<a href="#" className={CLASS_ACCORDION_BUTTON}>
|
|
288
|
+
<span className={CLASS_ACCORDION_TITLE}>
|
|
289
|
+
Naspať na Orange
|
|
290
|
+
</span>
|
|
291
|
+
</a>
|
|
292
|
+
</div>
|
|
293
|
+
</li>
|
|
294
|
+
</ul>
|
|
295
|
+
</div>
|
|
293
296
|
</div>
|
|
294
297
|
</div>
|
|
295
298
|
</div>
|
|
296
|
-
</div>
|
|
297
299
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
<button
|
|
301
|
+
aria-label="Zatvoriť dropdown menu"
|
|
302
|
+
className={CLASS_OVERLAY}
|
|
303
|
+
type="button"
|
|
304
|
+
/>
|
|
305
|
+
</nav>
|
|
306
|
+
<div className={CLASS_SPACER_SMALL} aria-hidden="true" />
|
|
307
|
+
</header>
|
|
304
308
|
);
|
|
305
309
|
};
|
|
@@ -22,6 +22,8 @@ export const CLASS_NAV_DROPDOWN = `${CLASS_ROOT}__nav-dropdown`;
|
|
|
22
22
|
export const CLASS_SUBNAV = `${CLASS_ROOT}__subnav`;
|
|
23
23
|
export const CLASS_SUBNAV_ITEM = `${CLASS_ROOT}__subnav-item`;
|
|
24
24
|
export const CLASS_OVERLAY = `${CLASS_ROOT}__overlay`;
|
|
25
|
+
export const CLASS_SPACER = `${CLASS_ROOT}-spacer`;
|
|
26
|
+
export const CLASS_SPACER_SMALL = `${CLASS_ROOT}-spacer--small`;
|
|
25
27
|
|
|
26
28
|
export const CLASS_TEXT_LARGE = `${CLASS_ROOT}__text--large`;
|
|
27
29
|
export const CLASS_HIDE_MD_DOWN = `${CLASS_ROOT}--hide-md-down`;
|
|
@@ -140,6 +140,19 @@
|
|
|
140
140
|
~ #{config.$class-root}__main {
|
|
141
141
|
transform: translateY(-#{convert.to-rem(40px)});
|
|
142
142
|
}
|
|
143
|
+
|
|
144
|
+
// When top is hidden, reduce the overall container height by the top bar height
|
|
145
|
+
#{config.$class-root}__top[data-hide-when-sticky="true"].is-hidden {
|
|
146
|
+
height: #{convert.to-rem(40px)};
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Adjust container height when top is hidden
|
|
152
|
+
&.top-hidden {
|
|
153
|
+
@include breakpoint.get("lg") {
|
|
154
|
+
height: #{convert.to-rem(80px)} !important;
|
|
155
|
+
}
|
|
143
156
|
}
|
|
144
157
|
}
|
|
145
158
|
}
|
|
@@ -239,7 +252,7 @@
|
|
|
239
252
|
@mixin nav-link {
|
|
240
253
|
display: flex;
|
|
241
254
|
font-weight: 700;
|
|
242
|
-
font-size: convert.to-rem(16px);
|
|
255
|
+
font-size: convert.to-rem(16px) !important;
|
|
243
256
|
align-items: center;
|
|
244
257
|
color: var(--color-text-default);
|
|
245
258
|
text-decoration: none;
|
|
@@ -571,6 +584,22 @@
|
|
|
571
584
|
}
|
|
572
585
|
}
|
|
573
586
|
|
|
587
|
+
@mixin spacer {
|
|
588
|
+
height: convert.to-rem(118px);
|
|
589
|
+
|
|
590
|
+
@include breakpoint.get("md", "down") {
|
|
591
|
+
height: convert.to-rem(58px);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
@mixin spacer-small {
|
|
596
|
+
height: convert.to-rem(78px);
|
|
597
|
+
|
|
598
|
+
@include breakpoint.get("md", "down") {
|
|
599
|
+
height: convert.to-rem(58px);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
574
603
|
@mixin accordion {
|
|
575
604
|
@include accordion.base;
|
|
576
605
|
margin-bottom: convert.to-rem(20px);
|
|
@@ -28,8 +28,26 @@
|
|
|
28
28
|
color: var(--color-text-default);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
:root {
|
|
32
|
+
--extra-scroll-margin: 0;
|
|
33
|
+
--header-height: 80px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media screen and (min-width: 992px) {
|
|
37
|
+
:root {
|
|
38
|
+
--header-height: 120px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:target {
|
|
43
|
+
scroll-margin-top: calc(
|
|
44
|
+
var(--header-height) + var(--extra-scroll-margin) - 1px
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
31
48
|
html {
|
|
32
49
|
font-size: base.$font-size;
|
|
50
|
+
scroll-padding-top: unset;
|
|
33
51
|
}
|
|
34
52
|
|
|
35
53
|
html,
|
|
@@ -75,6 +75,10 @@
|
|
|
75
75
|
background-color: var(--color-surface-subtle) !important;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
.bg-gray-lighter {
|
|
79
|
+
background-color: var(--color-background-secondary) !important;
|
|
80
|
+
}
|
|
81
|
+
|
|
78
82
|
.bg-blue {
|
|
79
83
|
background-color: var(--color-fill-accent1) !important;
|
|
80
84
|
// TODO: replace with new token when available
|