@orangesk/orange-design-system 2.0.0-beta.17 → 2.0.0-beta.18

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 (41) hide show
  1. package/build/components/Grid/style.css +1 -1
  2. package/build/components/Grid/style.css.map +1 -1
  3. package/build/components/Megamenu/style.css +1 -1
  4. package/build/components/Megamenu/style.css.map +1 -1
  5. package/build/components/PromoBanner/style.css +1 -1
  6. package/build/components/PromoBanner/style.css.map +1 -1
  7. package/build/components/index.js +1 -1
  8. package/build/components/index.js.map +1 -1
  9. package/build/components/tsconfig.tsbuildinfo +1 -1
  10. package/build/components/types/index.d.ts +3 -1
  11. package/build/components/types/src/components/Grid/Grid.d.ts +1 -1
  12. package/build/components/types/src/components/Megamenu/Megamenu.d.ts +6 -1
  13. package/build/components/types/src/components/Megamenu/MegamenuBlog.d.ts +2 -1
  14. package/build/components/types/src/components/Megamenu/constants.d.ts +2 -0
  15. package/build/components/types/src/components/Modal/ModalProductHeader.d.ts +2 -0
  16. package/build/lib/base.css +1 -1
  17. package/build/lib/base.css.map +1 -1
  18. package/build/lib/components.css +1 -1
  19. package/build/lib/components.css.map +1 -1
  20. package/build/lib/megamenu.css +1 -1
  21. package/build/lib/megamenu.css.map +1 -1
  22. package/build/lib/megamenu.js.map +1 -1
  23. package/build/lib/style.css +1 -1
  24. package/build/lib/style.css.map +1 -1
  25. package/build/lib/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +2 -2
  27. package/src/components/Grid/Grid.tsx +1 -1
  28. package/src/components/Grid/styles/config.scss +5 -3
  29. package/src/components/Grid/styles/mixins.scss +29 -19
  30. package/src/components/Grid/tests/Grid.unit.test.js +11 -0
  31. package/src/components/Megamenu/Megamenu.tsx +81 -23
  32. package/src/components/Megamenu/MegamenuBlog.tsx +38 -21
  33. package/src/components/Megamenu/constants.ts +2 -0
  34. package/src/components/Megamenu/styles/mixins.scss +19 -1
  35. package/src/components/Megamenu/styles/style.scss +2 -0
  36. package/src/components/Modal/ModalProductHeader.tsx +6 -2
  37. package/src/components/Modal/tests/ModalProductHeader.unit.test.js +12 -0
  38. package/src/components/PromoBanner/PromoBanner.tsx +1 -1
  39. package/src/components/PromoBanner/styles/mixins.scss +5 -0
  40. package/src/styles/typography/mixins.scss +4 -5
  41. package/build/search-index.json +0 -406
@@ -42,9 +42,33 @@ import {
42
42
  CLASS_NAV_SPACE_SMALL,
43
43
  CLASS_NAV_CART_ICON,
44
44
  CLASS_SPACER,
45
+ CLASS_TAG,
46
+ CLASS_TAG_ORANGE,
47
+ CLASS_TAG_SMALL,
48
+ CLASS_LIST_INLINE,
45
49
  } from "./constants";
46
50
 
47
- export const Megamenu = ({ className }: any) => {
51
+ export const list = [
52
+ "Dobitie kreditu",
53
+ "Nedostupnosť služieb",
54
+ "Faktúry",
55
+ "Zdieľanie dát",
56
+ "Prečerpané dáta",
57
+ "Elektronická faktúra",
58
+ "Prvá pomoc internet",
59
+ "Nastavenie zariadení a sim kariet",
60
+ "Pevny internet do domacnosti",
61
+ "Dátový roaming",
62
+ "Nákup online",
63
+ "Telemarketing",
64
+ ];
65
+
66
+ export type MegamenuProps = {
67
+ className?: string;
68
+ searchEmpty?: boolean;
69
+ };
70
+
71
+ export const Megamenu = ({ className, searchEmpty }: MegamenuProps) => {
48
72
  return (
49
73
  <header>
50
74
  <nav
@@ -188,7 +212,16 @@ export const Megamenu = ({ className }: any) => {
188
212
  <a href="#">Chcem nové číslo</a>
189
213
  </li>
190
214
  <li className={CLASS_SUBNAV_ITEM}>
191
- <a href="#">Yoxo paušál</a>
215
+ <a href="#">Yoxo paušál</a>{" "}
216
+ <span
217
+ className={cx(
218
+ CLASS_TAG,
219
+ CLASS_TAG_ORANGE,
220
+ CLASS_TAG_SMALL,
221
+ )}
222
+ >
223
+ Novinka
224
+ </span>
192
225
  </li>
193
226
  </ul>
194
227
 
@@ -365,27 +398,43 @@ export const Megamenu = ({ className }: any) => {
365
398
  type="text"
366
399
  placeholder="Search"
367
400
  name="search-1"
401
+ defaultValue={searchEmpty ? "" : "apple"}
368
402
  />
369
- <ul className={CLASS_SUBNAV}>
370
- <li className={CLASS_SUBNAV_ITEM}>
371
- <a href="#">apple</a>
372
- </li>
373
- <li className={CLASS_SUBNAV_ITEM}>
374
- <a href="#">apple hodinky</a>
375
- </li>
376
- <li className={CLASS_SUBNAV_ITEM}>
377
- <a href="#">apple iphone</a>
378
- </li>
379
- <li className={CLASS_SUBNAV_ITEM}>
380
- <a href="#">apple 16</a>
381
- </li>
382
- <li className={CLASS_SUBNAV_ITEM}>
383
- <a href="#">apple pro</a>
384
- </li>
385
- <li className={CLASS_SUBNAV_ITEM}>
386
- <a href="#">apple watch</a>
387
- </li>
388
- </ul>
403
+ {searchEmpty ? (
404
+ <>
405
+ <p>Najhľadanejši výrazy</p>
406
+ <ul className={CLASS_LIST_INLINE}>
407
+ {list.map((item) => (
408
+ <li key={item}>
409
+ <a href="/" className={cx(CLASS_TAG)}>
410
+ {item}
411
+ </a>
412
+ </li>
413
+ ))}
414
+ </ul>
415
+ </>
416
+ ) : (
417
+ <ul className={CLASS_SUBNAV}>
418
+ <li className={CLASS_SUBNAV_ITEM}>
419
+ <a href="#">apple</a>
420
+ </li>
421
+ <li className={CLASS_SUBNAV_ITEM}>
422
+ <a href="#">apple hodinky</a>
423
+ </li>
424
+ <li className={CLASS_SUBNAV_ITEM}>
425
+ <a href="#">apple iphone</a>
426
+ </li>
427
+ <li className={CLASS_SUBNAV_ITEM}>
428
+ <a href="#">apple 16</a>
429
+ </li>
430
+ <li className={CLASS_SUBNAV_ITEM}>
431
+ <a href="#">apple pro</a>
432
+ </li>
433
+ <li className={CLASS_SUBNAV_ITEM}>
434
+ <a href="#">apple watch</a>
435
+ </li>
436
+ </ul>
437
+ )}
389
438
  </div>
390
439
  </div>
391
440
  </li>
@@ -647,7 +696,16 @@ export const Megamenu = ({ className }: any) => {
647
696
  aria-labelledby="mobile-internet-tv-heading"
648
697
  >
649
698
  <li className={CLASS_SUBNAV_ITEM}>
650
- <a href="#">Ponuka Love</a>
699
+ <a href="#">Ponuka Love</a>{" "}
700
+ <span
701
+ className={cx(
702
+ CLASS_TAG,
703
+ CLASS_TAG_ORANGE,
704
+ CLASS_TAG_SMALL,
705
+ )}
706
+ >
707
+ Novinka
708
+ </span>
651
709
  </li>
652
710
  <li className={CLASS_SUBNAV_ITEM}>
653
711
  <a href="#">Výhodný pár zariadení</a>
@@ -33,9 +33,12 @@ import {
33
33
  CLASS_ACCORDION_ITEM,
34
34
  CLASS_ACCORDION_TITLE,
35
35
  CLASS_SPACER_SMALL,
36
+ CLASS_LIST_INLINE,
37
+ CLASS_TAG,
36
38
  } from "./constants";
39
+ import { list, MegamenuProps } from "./Megamenu";
37
40
 
38
- export const MegamenuBlog = ({ className }: any) => {
41
+ export const MegamenuBlog = ({ className, searchEmpty }: MegamenuProps) => {
39
42
  return (
40
43
  <header>
41
44
  <nav
@@ -113,27 +116,41 @@ export const MegamenuBlog = ({ className }: any) => {
113
116
  type="text"
114
117
  placeholder="Search"
115
118
  name="search-1"
119
+ defaultValue={searchEmpty ? "" : "apple"}
116
120
  />
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>
121
+ {searchEmpty ? (
122
+ <>
123
+ <p>Najhľadanejši výrazy</p>
124
+ <ul className={CLASS_LIST_INLINE}>
125
+ {list.map((item) => (
126
+ <a key={item}>
127
+ <span className={cx(CLASS_TAG)}>{item}</span>
128
+ </a>
129
+ ))}
130
+ </ul>
131
+ </>
132
+ ) : (
133
+ <ul className={CLASS_SUBNAV}>
134
+ <li className={CLASS_SUBNAV_ITEM}>
135
+ <a href="#">apple</a>
136
+ </li>
137
+ <li className={CLASS_SUBNAV_ITEM}>
138
+ <a href="#">apple hodinky</a>
139
+ </li>
140
+ <li className={CLASS_SUBNAV_ITEM}>
141
+ <a href="#">apple iphone</a>
142
+ </li>
143
+ <li className={CLASS_SUBNAV_ITEM}>
144
+ <a href="#">apple 16</a>
145
+ </li>
146
+ <li className={CLASS_SUBNAV_ITEM}>
147
+ <a href="#">apple pro</a>
148
+ </li>
149
+ <li className={CLASS_SUBNAV_ITEM}>
150
+ <a href="#">apple watch</a>
151
+ </li>
152
+ </ul>
153
+ )}
137
154
  </div>
138
155
  </div>
139
156
  </li>
@@ -49,6 +49,8 @@ export const CLASS_INPUT = `${CLASS_ROOT}__input`;
49
49
  export const CLASS_INPUT_SEARCH_ICON_WITH_PLACEHOLDER = `${CLASS_ROOT}__input--search-icon-with-placeholder`;
50
50
 
51
51
  export const CLASS_TAG = `${CLASS_ROOT}__tag`;
52
+ export const CLASS_TAG_ORANGE = `${CLASS_ROOT}__tag--orange`;
53
+ export const CLASS_TAG_SMALL = `${CLASS_ROOT}__tag--small`;
52
54
  export const CLASS_TAG_TRANSPARENT = `${CLASS_ROOT}__tag--transparent`;
53
55
  export const CLASS_TAG_LARGE = `${CLASS_ROOT}__tag--large`;
54
56
 
@@ -206,7 +206,7 @@
206
206
  left: 0;
207
207
  width: 100%;
208
208
  background-color: var(--color-surface-primary);
209
- padding: convert.to-rem(20px) 0;
209
+ padding: convert.to-rem(60px) 0 convert.to-rem(60px) 0;
210
210
  display: none;
211
211
  opacity: 0;
212
212
  z-index: 15;
@@ -353,6 +353,8 @@
353
353
  }
354
354
 
355
355
  @mixin subnav-item {
356
+ display: flex;
357
+ gap: convert.to-rem(10px);
356
358
  margin-bottom: convert.to-rem(10px) !important;
357
359
 
358
360
  &:last-child {
@@ -705,6 +707,22 @@
705
707
  @include tag.color($variant);
706
708
  }
707
709
  }
710
+
711
+ // Interactive styles for button and anchor tags
712
+ &:not(&--transparent):where(button) {
713
+ @include tag.button();
714
+ z-index: 2;
715
+ }
716
+
717
+ &:not(&--transparent):where(a) {
718
+ @include tag.button();
719
+ z-index: 2;
720
+ text-decoration: none !important;
721
+ }
722
+
723
+ &:not(&--transparent) {
724
+ @include tag.buttton-disabled();
725
+ }
708
726
  }
709
727
 
710
728
  @mixin tag-transparent {
@@ -11,10 +11,12 @@
11
11
  }
12
12
 
13
13
  #{config.$class-root},
14
+ .is-light #{config.$class-root},
14
15
  #{config.$class-root}.is-light {
15
16
  @include mixins.light-vars;
16
17
  }
17
18
 
19
+ .is-dark #{config.$class-root},
18
20
  #{config.$class-root}.is-dark {
19
21
  @include mixins.dark-vars;
20
22
  }
@@ -5,6 +5,8 @@ interface ModalProductHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  image?: React.ReactNode;
6
6
  /** Use small spacing */
7
7
  space?: "small";
8
+ /** Optional id for accessibility (e.g., for aria-labelledby) */
9
+ titleId?: string;
8
10
  }
9
11
 
10
12
  export const CLASS_ROOT = "modal__product";
@@ -12,7 +14,7 @@ export const CLASS_ROOT = "modal__product";
12
14
  const ModalProductHeader = React.forwardRef<
13
15
  HTMLDivElement,
14
16
  ModalProductHeaderProps
15
- >(({ className, children, image, space, ...other }, ref) => {
17
+ >(({ className, children, image, space, titleId, ...other }, ref) => {
16
18
  const classes = cx(
17
19
  `${CLASS_ROOT}-header`,
18
20
  {
@@ -25,7 +27,9 @@ const ModalProductHeader = React.forwardRef<
25
27
 
26
28
  return (
27
29
  <div className={classes} ref={ref} {...other}>
28
- <div className={contentClasses}>{children}</div>
30
+ <div className={contentClasses} id={titleId}>
31
+ {children}
32
+ </div>
29
33
  {image}
30
34
  </div>
31
35
  );
@@ -70,4 +70,16 @@ describe("rendering ModalProductHeader", () => {
70
70
  container.querySelector(".modal__product-content"),
71
71
  ).toHaveTextContent("Product Header");
72
72
  });
73
+
74
+ it("has titleId attribute when titleId prop is provided", () => {
75
+ const { container } = render(
76
+ <ModalProductHeader titleId="test-title-id">
77
+ Product Header
78
+ </ModalProductHeader>,
79
+ );
80
+ expect(container.querySelector(".modal__product-content")).toHaveAttribute(
81
+ "id",
82
+ "test-title-id",
83
+ );
84
+ });
73
85
  });
@@ -39,7 +39,7 @@ export const PromoBanner = ({
39
39
  className,
40
40
  );
41
41
  return (
42
- <Grid className={classes}>
42
+ <Grid columnGapSize="large" className={classes}>
43
43
  {variant === "reverse" && image && (
44
44
  <GridCol
45
45
  size={{ xs: 12, md: 6 }}
@@ -29,8 +29,13 @@
29
29
  text-align: end;
30
30
  align-self: center;
31
31
 
32
+ padding-top: space.get("xlarge");
33
+ padding-bottom: space.get("xlarge");
34
+
32
35
  @include breakpoint.get("md", "down") {
33
36
  text-align: center;
37
+ padding-top: 0;
38
+ padding-bottom: 0;
34
39
  }
35
40
  }
36
41
 
@@ -166,13 +166,12 @@
166
166
 
167
167
  @mixin list-inline() {
168
168
  @include list-unstyled();
169
+ gap: space.get("small");
170
+ display: flex;
171
+ flex-wrap: wrap;
169
172
 
170
173
  > li {
171
- display: inline-block;
172
-
173
- &:not(:last-child) {
174
- margin-right: space.get("small");
175
- }
174
+ display: inline-flex;
176
175
  }
177
176
  }
178
177