@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.
- package/build/apple--dark.svg +4 -0
- package/build/apple--white.svg +5 -0
- package/build/apple.svg +4 -0
- package/build/components/BodyBanner/style.css +1 -1
- package/build/components/BodyBanner/style.css.map +1 -1
- package/build/components/Carousel/style.css +1 -1
- package/build/components/Carousel/style.css.map +1 -1
- package/build/components/FeatureAccordion/style.css +1 -1
- package/build/components/FeatureAccordion/style.css.map +1 -1
- package/build/components/Footer/style.css +1 -1
- package/build/components/Footer/style.css.map +1 -1
- package/build/components/Megamenu/style.css +1 -1
- package/build/components/Megamenu/style.css.map +1 -1
- package/build/components/PromoBanner/style.css +1 -1
- package/build/components/PromoBanner/style.css.map +1 -1
- package/build/components/Table/style.css +1 -1
- package/build/components/Table/style.css.map +1 -1
- package/build/components/Tooltip/style.css +1 -1
- package/build/components/Tooltip/style.css.map +1 -1
- package/build/components/index.js +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/tsconfig.tsbuildinfo +1 -1
- package/build/components/types/index.d.ts +23 -4
- package/build/components/types/src/components/Carousel/Carousel.d.ts +3 -1
- package/build/components/types/src/components/Carousel/Carousel.static.d.ts +1 -0
- package/build/components/types/src/components/Carousel/constants.d.ts +1 -0
- package/build/components/types/src/components/Megamenu/Megamenu.d.ts +12 -2
- package/build/components/types/src/components/Megamenu/MegamenuBlog.d.ts +1 -1
- package/build/components/types/src/components/Megamenu/MyOrangeMobilePanel.d.ts +3 -1
- package/build/components/types/src/components/Megamenu/constants.d.ts +19 -2
- package/build/components/types/src/components/Megamenu/data.d.ts +8 -0
- package/build/components/types/src/components/Megamenu/shared.d.ts +40 -0
- package/build/huawei--dark.svg +4 -0
- package/build/huawei--white.svg +5 -0
- package/build/huawei.svg +4 -0
- package/build/images/phones.png +0 -0
- package/build/lib/base.css +1 -1
- package/build/lib/base.css.map +1 -1
- package/build/lib/components.css +1 -1
- package/build/lib/components.css.map +1 -1
- package/build/lib/footer.css +1 -1
- package/build/lib/footer.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 +1 -1
- 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/utilities.css +1 -1
- package/build/lib/utilities.css.map +1 -1
- package/build/play--dark.svg +7 -0
- package/build/play--white.svg +7 -0
- package/build/play.svg +7 -0
- package/package.json +15 -15
- package/src/components/BodyBanner/styles/mixins.scss +6 -0
- package/src/components/Carousel/Carousel.static.ts +25 -9
- package/src/components/Carousel/Carousel.tsx +5 -0
- package/src/components/Carousel/constants.ts +1 -0
- package/src/components/Carousel/styles/style.scss +2 -1
- package/src/components/Carousel/tests/Carousel.static.test.jsx +85 -0
- package/src/components/Carousel/tests/Carousel.unit.test.jsx +9 -0
- package/src/components/FeatureAccordion/styles/mixins.scss +6 -0
- package/src/components/Footer/styles/style.scss +2 -0
- package/src/components/Megamenu/LogoJeTu.tsx +12 -7
- package/src/components/Megamenu/Megamenu.static.ts +1 -1
- package/src/components/Megamenu/Megamenu.tsx +432 -316
- package/src/components/Megamenu/MegamenuBlog.tsx +90 -123
- package/src/components/Megamenu/MyOrangeMobilePanel.tsx +129 -84
- package/src/components/Megamenu/constants.ts +19 -2
- package/src/components/Megamenu/data.ts +53 -15
- package/src/components/Megamenu/shared.tsx +154 -0
- package/src/components/Megamenu/styles/mixins.scss +313 -29
- package/src/components/Megamenu/styles/style.scss +91 -8
- package/src/components/Megamenu/tests/Megamenu.unit.test.jsx +108 -4
- package/src/components/PromoBanner/PromoBanner.tsx +0 -2
- package/src/components/PromoBanner/styles/mixins.scss +3 -4
- package/src/components/PromoBanner/tests/PromoBanner.unit.test.jsx +3 -3
- package/src/components/Table/styles/config.scss +1 -0
- package/src/components/Table/styles/style.scss +6 -0
- package/src/components/Tooltip/styles/style.scss +5 -0
- package/src/styles/base/globals.scss +5 -5
- package/src/styles/base/styleguide.scss +1 -1
- package/src/styles/export/color.js +1 -1
- package/src/styles/shame.scss +1 -1
- package/src/styles/tokens/color.scss +1 -1
|
@@ -4,8 +4,19 @@ import "@testing-library/jest-dom/vitest";
|
|
|
4
4
|
import { Megamenu, MegamenuBlog } from "../";
|
|
5
5
|
|
|
6
6
|
describe("Megamenu logo markup", () => {
|
|
7
|
+
it("is sticky by default and supports disabling stickiness", () => {
|
|
8
|
+
const { container, rerender } = render(<Megamenu />);
|
|
9
|
+
const nav = container.querySelector("[data-megamenu]");
|
|
10
|
+
|
|
11
|
+
expect(nav).not.toHaveClass("non-sticky");
|
|
12
|
+
|
|
13
|
+
rerender(<Megamenu notSticky />);
|
|
14
|
+
|
|
15
|
+
expect(nav).toHaveClass("non-sticky");
|
|
16
|
+
});
|
|
17
|
+
|
|
7
18
|
it("renders brand-mark wrapper for default Megamenu logo swap", () => {
|
|
8
|
-
const { container } = render(<Megamenu
|
|
19
|
+
const { container } = render(<Megamenu notSticky />);
|
|
9
20
|
|
|
10
21
|
const logo = container.querySelector(".megamenu__nav-logo");
|
|
11
22
|
const brandMark = logo?.querySelector(
|
|
@@ -22,9 +33,7 @@ describe("Megamenu logo markup", () => {
|
|
|
22
33
|
});
|
|
23
34
|
|
|
24
35
|
it("keeps compactLogoOnly output without brand-mark wrapper", () => {
|
|
25
|
-
const { container } = render(
|
|
26
|
-
<MegamenuBlog compactLogoOnly isSticky={false} />,
|
|
27
|
-
);
|
|
36
|
+
const { container } = render(<MegamenuBlog compactLogoOnly notSticky />);
|
|
28
37
|
|
|
29
38
|
const logo = container.querySelector(".megamenu__nav-logo");
|
|
30
39
|
|
|
@@ -38,4 +47,99 @@ describe("Megamenu logo markup", () => {
|
|
|
38
47
|
logo?.querySelector("[data-megamenu-logo-compact]"),
|
|
39
48
|
).not.toBeInTheDocument();
|
|
40
49
|
});
|
|
50
|
+
|
|
51
|
+
it("renders desktop CTA link in default megamenu", () => {
|
|
52
|
+
const { container } = render(<Megamenu notSticky />);
|
|
53
|
+
|
|
54
|
+
const cta = container.querySelector(
|
|
55
|
+
".megamenu__nav-item--main .megamenu__nav-link--cta",
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
expect(cta).toBeInTheDocument();
|
|
59
|
+
expect(cta).toHaveTextContent("Prejdite k nám");
|
|
60
|
+
expect(cta.querySelector(".megamenu__nav-icon--cta")).toBeInTheDocument();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("renders mobile CTA before quick-access links", () => {
|
|
64
|
+
const { container } = render(<Megamenu notSticky />);
|
|
65
|
+
|
|
66
|
+
const mobileCta = container.querySelector(".megamenu__mobile-cta");
|
|
67
|
+
const quickAccess = container.querySelector("#mobile-quick-access-heading");
|
|
68
|
+
|
|
69
|
+
expect(mobileCta).toBeInTheDocument();
|
|
70
|
+
expect(mobileCta).toHaveTextContent("Prejdite k nám");
|
|
71
|
+
expect(mobileCta.compareDocumentPosition(quickAccess)).toBe(
|
|
72
|
+
Node.DOCUMENT_POSITION_FOLLOWING,
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("renders quick-access tiles below menu content", () => {
|
|
77
|
+
const { container } = render(<Megamenu notSticky />);
|
|
78
|
+
|
|
79
|
+
expect(container.querySelectorAll(".megamenu__tile")).toHaveLength(18);
|
|
80
|
+
expect(
|
|
81
|
+
container.querySelectorAll(".megamenu__tile .megamenu__tag"),
|
|
82
|
+
).toHaveLength(12);
|
|
83
|
+
expect(
|
|
84
|
+
container.querySelector('.megamenu__tile[href="/"]'),
|
|
85
|
+
).toHaveTextContent("Chcem nové číslo");
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("renders empty cart by default", () => {
|
|
89
|
+
const { container } = render(<Megamenu notSticky />);
|
|
90
|
+
|
|
91
|
+
const cart = container.querySelector(
|
|
92
|
+
".megamenu__nav-cart-icon:not([data-items-in-cart]):not([data-cart-has-items])",
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
expect(cart).toBeInTheDocument();
|
|
96
|
+
expect(cart?.parentElement).toHaveAttribute("aria-label", "Košík");
|
|
97
|
+
expect(cart?.nextElementSibling).not.toBeInTheDocument();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("renders optional orange cart dot", () => {
|
|
101
|
+
const { container } = render(<Megamenu cartHasItems notSticky />);
|
|
102
|
+
|
|
103
|
+
const cart = container.querySelector(
|
|
104
|
+
".megamenu__nav-cart-icon[data-cart-has-items]",
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
expect(cart).toBeInTheDocument();
|
|
108
|
+
expect(cart).toHaveAttribute("data-cart-has-items", "true");
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it("renders logged-out My Orange panel content", () => {
|
|
112
|
+
const { container } = render(<Megamenu isLoggedIn={false} notSticky />);
|
|
113
|
+
|
|
114
|
+
expect(container).toHaveTextContent("Prihlásenie");
|
|
115
|
+
expect(container).not.toHaveTextContent("Odhlásiť");
|
|
116
|
+
expect(container).not.toHaveTextContent("0905 123 456");
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("renders optional cart item count", () => {
|
|
120
|
+
const { container } = render(<Megamenu cartItems={3} notSticky />);
|
|
121
|
+
|
|
122
|
+
const cart = container.querySelector(
|
|
123
|
+
".megamenu__nav-cart-icon[data-items-in-cart]",
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
expect(cart).toHaveAttribute("data-items-in-cart", "3");
|
|
127
|
+
expect(cart?.parentElement).toHaveAttribute(
|
|
128
|
+
"aria-label",
|
|
129
|
+
"Košík, 3 položka",
|
|
130
|
+
);
|
|
131
|
+
expect(cart?.nextElementSibling).toHaveTextContent("3 položka v košíku");
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it("renders empty cart without a badge", () => {
|
|
135
|
+
const { container } = render(<Megamenu cartItems={0} notSticky />);
|
|
136
|
+
|
|
137
|
+
const cart = container.querySelector(
|
|
138
|
+
".megamenu__nav-cart-icon:not([data-items-in-cart])",
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
expect(cart).toBeInTheDocument();
|
|
142
|
+
expect(cart?.parentElement).toHaveAttribute("aria-label", "Košík");
|
|
143
|
+
expect(cart?.nextElementSibling).not.toBeInTheDocument();
|
|
144
|
+
});
|
|
41
145
|
});
|
|
@@ -110,8 +110,6 @@ export const PromoBanner = ({
|
|
|
110
110
|
[`${CLASS_ROOT}__image--bleed-right`]: bleedImage,
|
|
111
111
|
[`${CLASS_ROOT}__image--bleed-sm-down`]: bleedImageSmDown,
|
|
112
112
|
[`align-self-${alignImage}`]: alignImage,
|
|
113
|
-
"pt-none": alignImage === "top",
|
|
114
|
-
"pb-none": alignImage === "bottom",
|
|
115
113
|
"align-center": variant === "vertical",
|
|
116
114
|
},
|
|
117
115
|
imageClassName,
|
|
@@ -51,10 +51,9 @@
|
|
|
51
51
|
text-align: end;
|
|
52
52
|
align-self: center;
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
padding-bottom: 0;
|
|
54
|
+
// Page-builder output may wrap image content in a div.
|
|
55
|
+
> :not(img):not(picture):not(svg) {
|
|
56
|
+
width: 100%;
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
&[class*="grid__col"] {
|
|
@@ -336,7 +336,7 @@ describe("PromoBanner", () => {
|
|
|
336
336
|
it("renders image from object src when image object is provided", () => {
|
|
337
337
|
render(
|
|
338
338
|
<PromoBanner
|
|
339
|
-
image={{ src: "https://example.com/test.jpg", srcSet: "test
|
|
339
|
+
image={{ src: "https://example.com/test.jpg", srcSet: "test" }}
|
|
340
340
|
>
|
|
341
341
|
Content
|
|
342
342
|
</PromoBanner>,
|
|
@@ -351,7 +351,7 @@ describe("PromoBanner", () => {
|
|
|
351
351
|
image={{
|
|
352
352
|
src: "https://example.com/test.jpg",
|
|
353
353
|
srcSet:
|
|
354
|
-
"https://example.com/test.jpg
|
|
354
|
+
"https://example.com/test.jpg, https://example.com/test@2x.jpg 2x",
|
|
355
355
|
}}
|
|
356
356
|
>
|
|
357
357
|
Content
|
|
@@ -360,7 +360,7 @@ describe("PromoBanner", () => {
|
|
|
360
360
|
const image = screen.getByRole("img");
|
|
361
361
|
expect(image).toHaveAttribute(
|
|
362
362
|
"srcSet",
|
|
363
|
-
"https://example.com/test.jpg
|
|
363
|
+
"https://example.com/test.jpg, https://example.com/test@2x.jpg 2x",
|
|
364
364
|
);
|
|
365
365
|
});
|
|
366
366
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use "./mixins";
|
|
2
|
+
@use "./config";
|
|
2
3
|
@use "../../../styles/tokens/breakpoint";
|
|
3
4
|
@use "../../../styles/tools/generate";
|
|
4
5
|
|
|
@@ -39,6 +40,11 @@
|
|
|
39
40
|
@include mixins.odd-row;
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
&--striped.background-secondary tbody tr:nth-of-type(odd),
|
|
44
|
+
.background-secondary &--striped tbody tr:nth-of-type(odd) {
|
|
45
|
+
background-color: config.$striped-color-on-secondary;
|
|
46
|
+
}
|
|
47
|
+
|
|
42
48
|
&--compact {
|
|
43
49
|
@include mixins.compact;
|
|
44
50
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
html:has(
|
|
18
|
-
.megamenu.
|
|
18
|
+
.megamenu:not(.non-sticky):not(.top-hidden)
|
|
19
19
|
.megamenu__nav-logo
|
|
20
20
|
> [data-megamenu-brand-mark]
|
|
21
21
|
+ span
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
html:has(
|
|
27
|
-
.megamenu.
|
|
27
|
+
.megamenu:not(.non-sticky):not(.top-hidden)
|
|
28
28
|
.megamenu__nav-logo
|
|
29
29
|
> [data-megamenu-brand-mark]
|
|
30
30
|
):not(
|
|
31
31
|
:has(
|
|
32
|
-
.megamenu.
|
|
32
|
+
.megamenu:not(.non-sticky):not(.top-hidden)
|
|
33
33
|
.megamenu__nav-logo
|
|
34
34
|
> [data-megamenu-brand-mark]
|
|
35
35
|
+ span
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
--header-height: 147px;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
html:has(.megamenu.
|
|
42
|
-
html:has(.megamenu.
|
|
41
|
+
html:has(.megamenu:not(.non-sticky).top-hidden),
|
|
42
|
+
html:has(.megamenu:not(.non-sticky) + .megamenu-spacer--small) {
|
|
43
43
|
--header-height: 80px;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -66,7 +66,7 @@ export const exports = {
|
|
|
66
66
|
"dark-surface-subtle": "#333333",
|
|
67
67
|
"dark-surface-moderate": "#595959",
|
|
68
68
|
"dark-surface-contrast": "#ffffff",
|
|
69
|
-
"dark-surface-accent": "#
|
|
69
|
+
"dark-surface-accent": "#333333",
|
|
70
70
|
"dark-fill-primary": "#000000",
|
|
71
71
|
"dark-fill-secondary": "#ff7900",
|
|
72
72
|
"dark-fill-tertiary": "#f15e00",
|
package/src/styles/shame.scss
CHANGED