@orangesk/orange-design-system 3.3.1 → 3.4.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 (68) 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/FeatureAccordion/style.css +1 -1
  7. package/build/components/FeatureAccordion/style.css.map +1 -1
  8. package/build/components/Footer/style.css +1 -1
  9. package/build/components/Footer/style.css.map +1 -1
  10. package/build/components/Megamenu/style.css +1 -1
  11. package/build/components/Megamenu/style.css.map +1 -1
  12. package/build/components/PromoBanner/style.css +1 -1
  13. package/build/components/PromoBanner/style.css.map +1 -1
  14. package/build/components/index.js +1 -1
  15. package/build/components/index.js.map +1 -1
  16. package/build/components/tsconfig.tsbuildinfo +1 -1
  17. package/build/components/types/index.d.ts +16 -3
  18. package/build/components/types/src/components/Megamenu/Megamenu.d.ts +8 -2
  19. package/build/components/types/src/components/Megamenu/MegamenuBlog.d.ts +1 -1
  20. package/build/components/types/src/components/Megamenu/MyOrangeMobilePanel.d.ts +2 -1
  21. package/build/components/types/src/components/Megamenu/constants.d.ts +19 -2
  22. package/build/components/types/src/components/Megamenu/data.d.ts +8 -0
  23. package/build/components/types/src/components/Megamenu/shared.d.ts +40 -0
  24. package/build/huawei--dark.svg +4 -0
  25. package/build/huawei--white.svg +5 -0
  26. package/build/huawei.svg +4 -0
  27. package/build/images/phones.png +0 -0
  28. package/build/lib/base.css +1 -1
  29. package/build/lib/base.css.map +1 -1
  30. package/build/lib/components.css +1 -1
  31. package/build/lib/components.css.map +1 -1
  32. package/build/lib/footer.css +1 -1
  33. package/build/lib/footer.css.map +1 -1
  34. package/build/lib/megamenu.css +1 -1
  35. package/build/lib/megamenu.css.map +1 -1
  36. package/build/lib/megamenu.js +1 -1
  37. package/build/lib/megamenu.js.map +1 -1
  38. package/build/lib/scripts.js +1 -1
  39. package/build/lib/scripts.js.map +1 -1
  40. package/build/lib/style.css +1 -1
  41. package/build/lib/style.css.map +1 -1
  42. package/build/lib/utilities.css +1 -1
  43. package/build/lib/utilities.css.map +1 -1
  44. package/build/play--dark.svg +7 -0
  45. package/build/play--white.svg +7 -0
  46. package/build/play.svg +7 -0
  47. package/package.json +10 -10
  48. package/src/components/BodyBanner/styles/mixins.scss +6 -0
  49. package/src/components/FeatureAccordion/styles/mixins.scss +6 -0
  50. package/src/components/Megamenu/LogoJeTu.tsx +12 -7
  51. package/src/components/Megamenu/Megamenu.static.ts +1 -1
  52. package/src/components/Megamenu/Megamenu.tsx +420 -316
  53. package/src/components/Megamenu/MegamenuBlog.tsx +90 -123
  54. package/src/components/Megamenu/MyOrangeMobilePanel.tsx +116 -84
  55. package/src/components/Megamenu/constants.ts +19 -2
  56. package/src/components/Megamenu/data.ts +53 -15
  57. package/src/components/Megamenu/shared.tsx +154 -0
  58. package/src/components/Megamenu/styles/mixins.scss +307 -28
  59. package/src/components/Megamenu/styles/style.scss +91 -8
  60. package/src/components/Megamenu/tests/Megamenu.unit.test.jsx +77 -4
  61. package/src/components/PromoBanner/PromoBanner.tsx +0 -2
  62. package/src/components/PromoBanner/styles/mixins.scss +3 -4
  63. package/src/components/PromoBanner/tests/PromoBanner.unit.test.jsx +3 -3
  64. package/src/styles/base/globals.scss +5 -5
  65. package/src/styles/base/styleguide.scss +1 -1
  66. package/src/styles/export/color.js +1 -1
  67. package/src/styles/shame.scss +1 -1
  68. 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 isSticky={false} />);
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,68 @@ 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 orange cart dot by default", () => {
89
+ const { container } = render(<Megamenu notSticky />);
90
+
91
+ const cart = container.querySelector(
92
+ ".megamenu__nav-cart-icon:not([data-items-in-cart])",
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 cart item count", () => {
101
+ const { container } = render(<Megamenu cartItems={3} notSticky />);
102
+
103
+ const cart = container.querySelector(
104
+ ".megamenu__nav-cart-icon[data-items-in-cart]",
105
+ );
106
+
107
+ expect(cart).toHaveAttribute("data-items-in-cart", "3");
108
+ expect(cart?.parentElement).toHaveAttribute(
109
+ "aria-label",
110
+ "Košík, 3 položka",
111
+ );
112
+ expect(cart?.nextElementSibling).toHaveTextContent("3 položka v košíku");
113
+ });
41
114
  });
@@ -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
- @include breakpoint.get("md", "down") {
55
- text-align: center;
56
- padding-top: 0;
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 1x" }}
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 1x, https://example.com/test@2x.jpg 2x",
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 1x, https://example.com/test@2x.jpg 2x",
363
+ "https://example.com/test.jpg, https://example.com/test@2x.jpg 2x",
364
364
  );
365
365
  });
366
366
 
@@ -15,7 +15,7 @@
15
15
  }
16
16
 
17
17
  html:has(
18
- .megamenu.is-sticky:not(.top-hidden)
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.is-sticky:not(.top-hidden)
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.is-sticky:not(.top-hidden)
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.is-sticky.top-hidden),
42
- html:has(.megamenu.is-sticky + .megamenu-spacer--small) {
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
  }
@@ -9,7 +9,7 @@
9
9
 
10
10
  main {
11
11
  min-height: 100vh;
12
- padding-top: var(--header-height, 80px) !important;
12
+ padding-top: var(--header-height, 80px);
13
13
  }
14
14
 
15
15
  .l-debug {
@@ -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": "#2b1a10",
69
+ "dark-surface-accent": "#333333",
70
70
  "dark-fill-primary": "#000000",
71
71
  "dark-fill-secondary": "#ff7900",
72
72
  "dark-fill-tertiary": "#f15e00",
@@ -23,7 +23,7 @@
23
23
  body.has-modal {
24
24
  .mm-header.is-sticky,
25
25
  .megamenu-header.is-sticky,
26
- [data-megamenu].is-sticky:not(.megamenu) {
26
+ [data-megamenu]:not(.non-sticky):not(.megamenu) {
27
27
  padding-right: var(--ods-modal-scrollbar-width, 0px);
28
28
  }
29
29
  }
@@ -68,7 +68,7 @@ $colors-dark: (
68
68
  surface-subtle: #333333,
69
69
  surface-moderate: #595959,
70
70
  surface-contrast: #ffffff,
71
- surface-accent: #2b1a10,
71
+ surface-accent: #333333,
72
72
  fill-primary: #000000,
73
73
  fill-secondary: #ff7900,
74
74
  fill-tertiary: #f15e00,