@orangesk/orange-design-system 2.0.0-beta.7 → 2.0.0-beta.9

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 (67) hide show
  1. package/build/components/index.js +4 -4
  2. package/build/components/index.js.map +1 -1
  3. package/build/components/tsconfig.tsbuildinfo +1 -1
  4. package/build/components/types/index.d.ts +12 -8
  5. package/build/components/types/src/components/AnchorNavigation/AnchorNavigation.d.ts +1 -1
  6. package/build/components/types/src/components/AnchorNavigation/AnchorNavigation.static.d.ts +19 -17
  7. package/build/components/types/src/components/Button/Button.d.ts +1 -0
  8. package/build/components/types/src/components/Card/Card.d.ts +2 -1
  9. package/build/components/types/src/components/Carousel/Carousel.d.ts +4 -0
  10. package/build/components/types/src/components/Carousel/Carousel.static.d.ts +1 -0
  11. package/build/components/types/src/components/Carousel/constants.d.ts +2 -0
  12. package/build/components/types/src/components/Megamenu/constants.d.ts +2 -0
  13. package/build/components/types/src/components/Pill/Pill.d.ts +1 -1
  14. package/build/components/types/src/components/PromoBanner/PromoBanner.d.ts +3 -5
  15. package/build/components/types/src/scripts/index.d.ts +5 -0
  16. package/build/lib/after-components.css +1 -1
  17. package/build/lib/after-components.css.map +1 -1
  18. package/build/lib/before-components.css +1 -1
  19. package/build/lib/before-components.css.map +1 -1
  20. package/build/lib/components.css +1 -1
  21. package/build/lib/components.css.map +1 -1
  22. package/build/lib/megamenu.css +1 -1
  23. package/build/lib/megamenu.css.map +1 -1
  24. package/build/lib/megamenu.js +1 -1
  25. package/build/lib/megamenu.js.map +1 -1
  26. package/build/lib/scripts.js +4 -4
  27. package/build/lib/scripts.js.map +1 -1
  28. package/build/lib/style.css +1 -1
  29. package/build/lib/style.css.map +1 -1
  30. package/build/lib/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +16 -16
  32. package/src/components/AnchorNavigation/AnchorNavigation.static.ts +253 -73
  33. package/src/components/AnchorNavigation/AnchorNavigation.tsx +31 -24
  34. package/src/components/AnchorNavigation/styles/mixins.scss +14 -17
  35. package/src/components/AnchorNavigation/tests/AnchorNavigation.conformance.test.js +67 -0
  36. package/src/components/AnchorNavigation/tests/AnchorNavigation.unit.test.js +163 -0
  37. package/src/components/BlockAction/styles/mixins.scss +0 -6
  38. package/src/components/Button/Button.tsx +2 -0
  39. package/src/components/Button/styles/mixins.scss +5 -0
  40. package/src/components/Button/styles/style.scss +4 -0
  41. package/src/components/Card/Card.tsx +5 -1
  42. package/src/components/Card/styles/style.scss +4 -0
  43. package/src/components/Carousel/Carousel.static.ts +67 -1
  44. package/src/components/Carousel/Carousel.tsx +41 -19
  45. package/src/components/Carousel/constants.ts +2 -0
  46. package/src/components/Carousel/styles/config.scss +1 -2
  47. package/src/components/Carousel/styles/mixins.scss +35 -2
  48. package/src/components/Carousel/styles/style.scss +8 -0
  49. package/src/components/Icon/styles/style.scss +11 -0
  50. package/src/components/Icon/tests/Pictogram.unit.test.js +38 -0
  51. package/src/components/Link/styles/style.scss +1 -1
  52. package/src/components/Link/tests/Link.conformance.test.js +5 -20
  53. package/src/components/Link/tests/Link.unit.test.js +1 -10
  54. package/src/components/Megamenu/Megamenu.static.ts +2 -0
  55. package/src/components/Megamenu/Megamenu.tsx +671 -665
  56. package/src/components/Megamenu/MegamenuBlog.tsx +187 -183
  57. package/src/components/Megamenu/constants.ts +2 -0
  58. package/src/components/Megamenu/styles/mixins.scss +30 -1
  59. package/src/components/Megamenu/styles/style.scss +8 -0
  60. package/src/components/Pill/Pill.tsx +1 -1
  61. package/src/components/Pill/styles/config.scss +4 -0
  62. package/src/components/Preview/PreviewGenerator.tsx +48 -21
  63. package/src/components/PromoBanner/PromoBanner.tsx +14 -26
  64. package/src/components/PromoBanner/styles/mixins.scss +20 -21
  65. package/src/components/PromoBanner/styles/style.scss +0 -6
  66. package/src/styles/base/globals.scss +19 -0
  67. package/src/styles/utilities/color.scss +94 -20
@@ -2,27 +2,22 @@ import React from "react";
2
2
  import cx from "classnames";
3
3
  import { Grid, GridCol } from "../Grid";
4
4
  import { Image } from "../Image";
5
- import { Button } from "../Button";
6
5
 
7
6
  interface PromoBannerProps {
8
7
  colorScheme?: "light" | "dark";
9
8
  className?: string;
10
- title: string;
11
- secondaryTitle?: string;
12
- description: string;
13
- buttonText: string;
14
9
  image?: string;
10
+ alignImage?: "bottom";
11
+ children?: React.ReactNode;
15
12
  }
16
13
 
17
14
  const CLASS_ROOT = "promo-banner";
18
15
  export const PromoBanner = ({
19
- title,
20
- secondaryTitle,
21
- description,
22
- buttonText,
23
16
  image,
24
17
  colorScheme,
25
18
  className,
19
+ alignImage,
20
+ children,
26
21
  }: PromoBannerProps) => {
27
22
  const classes = cx(
28
23
  CLASS_ROOT,
@@ -33,30 +28,23 @@ export const PromoBanner = ({
33
28
  className,
34
29
  );
35
30
  return (
36
- <div className={classes}>
31
+ <div className={cx(classes)}>
37
32
  <Grid>
38
33
  <GridCol
39
- size={{ xs: 12, md: image ? 6 : 8 }}
34
+ size={{ xs: 12, md: image ? 6 : 7 }}
40
35
  className={`${CLASS_ROOT}__item`}
41
36
  >
42
- <h2 className="display-3 thin mb-medium">
43
- <span
44
- className={`${secondaryTitle ? `${CLASS_ROOT}__item-title` : ""}`}
45
- >
46
- {title}
47
- </span>
48
- {secondaryTitle && (
49
- <span className="color-orange ml-small">{secondaryTitle}</span>
50
- )}
51
- </h2>
52
- <p className="mb-large">{description}</p>
53
- <Button type="fill" size="large">
54
- {buttonText}
55
- </Button>
37
+ {children}
56
38
  </GridCol>
57
39
 
58
40
  {image && (
59
- <GridCol size={{ xs: 12, md: 6 }} className={`${CLASS_ROOT}__image`}>
41
+ <GridCol
42
+ size={{ xs: 12, md: 6 }}
43
+ className={cx(
44
+ `${CLASS_ROOT}__image`,
45
+ alignImage === "bottom" && "align-self-bottom",
46
+ )}
47
+ >
60
48
  <Image src={image} alt="" className="mb-none" />
61
49
  </GridCol>
62
50
  )}
@@ -1,34 +1,33 @@
1
+ @use "sass:map" as sassmap;
1
2
  @use "./../../../styles/tools/convert";
3
+ @use "./../../../styles/tools/generate";
2
4
  @use "./../../../styles/tokens/breakpoint";
3
5
  @use "./../../../styles/tokens/space";
4
-
5
- @mixin promo-banner-base() {
6
- background-color: var(--color-background-primary);
7
- color: var(--color-text-default);
8
- padding: space.get("xlarge") convert.to-rem(70px);
9
-
10
- @include breakpoint.get("lg", "down") {
11
- padding: space.get("xlarge") convert.to-rem(20px);
12
- }
13
-
14
- @include breakpoint.get("sm", "down") {
15
- padding: convert.to-rem(30px) space.get("small");
16
- }
17
- }
6
+ @use "./../../Section/styles/mixins" as section;
18
7
 
19
8
  @mixin promo-banner-image() {
20
- text-align: center;
9
+ text-align: end;
21
10
  align-self: center;
11
+
12
+ @include breakpoint.get("md", "down") {
13
+ text-align: center;
14
+ }
22
15
  }
23
16
 
24
17
  @mixin promo-banner-item() {
25
- padding-right: space.get("xlarge") !important;
18
+ padding-top: space.get("xlarge");
19
+ padding-bottom: space.get("xlarge");
26
20
 
27
- @include breakpoint.get("lg", "down") {
28
- padding-right: convert.to-rem(10px) !important;
21
+ @include breakpoint.get("md", "down") {
22
+ padding-top: space.get("large");
23
+ padding-bottom: space.get("medium");
29
24
  }
30
- }
31
25
 
32
- @mixin promo-banner-item-title() {
33
- margin-right: space.get("small") !important;
26
+ display: flex;
27
+ flex-direction: column;
28
+ justify-content: center;
29
+
30
+ > * {
31
+ width: fit-content !important;
32
+ }
34
33
  }
@@ -2,18 +2,12 @@
2
2
 
3
3
  @layer components {
4
4
  .promo-banner {
5
- @include mixins.promo-banner-base;
6
-
7
5
  &__image {
8
6
  @include mixins.promo-banner-image;
9
7
  }
10
8
 
11
9
  &__item {
12
10
  @include mixins.promo-banner-item;
13
-
14
- &-title {
15
- @include mixins.promo-banner-item-title;
16
- }
17
11
  }
18
12
  }
19
13
  }
@@ -28,8 +28,27 @@
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;
51
+ overflow-x: hidden;
33
52
  }
34
53
 
35
54
  html,
@@ -1,39 +1,94 @@
1
1
  @use "../tokens/color";
2
-
3
- // TODO premyslieť, či je potrebné tieto farby nahradiť tokenmi, alebo hardcodovat aby neboli nepredvidatelne
2
+ @use "sass:map";
4
3
 
5
4
  @layer utilities {
5
+ // Background utilities
6
+ @each $name, $value in color.$colors-light {
7
+ @if str-index($name, "background-") == 1 {
8
+ .#{$name} {
9
+ background-color: var(--color-#{$name}) !important;
10
+ }
11
+ }
12
+ }
13
+
14
+ // Surface utilities
15
+ @each $name, $value in color.$colors-light {
16
+ @if str-index($name, "surface-") == 1 {
17
+ .#{$name} {
18
+ background-color: var(--color-#{$name}) !important;
19
+ }
20
+ }
21
+ }
22
+
23
+ // Fill utilities
24
+ @each $name, $value in color.$colors-light {
25
+ @if str-index($name, "fill-") == 1 {
26
+ .#{$name} {
27
+ background-color: var(--color-#{$name}) !important;
28
+ }
29
+ }
30
+ }
31
+
32
+ // Border utilities
33
+ @each $name, $value in color.$colors-light {
34
+ @if str-index($name, "border-") == 1 {
35
+ .#{$name} {
36
+ border-color: var(--color-#{$name}) !important;
37
+ }
38
+ }
39
+ }
40
+
41
+ // Text color utilities
42
+ @each $name, $value in color.$colors-light {
43
+ @if str-index($name, "text-") == 1 {
44
+ .#{$name} {
45
+ color: var(--color-#{$name}) !important;
46
+ }
47
+ }
48
+ }
49
+
50
+ // Icon color utilities
51
+ @each $name, $value in color.$colors-light {
52
+ @if str-index($name, "icon-") == 1 {
53
+ .#{$name} {
54
+ color: var(--color-#{$name}) !important;
55
+ }
56
+ }
57
+ }
58
+
59
+ // Legacy classes - DEPRECATED (add deprecation warnings)
6
60
  .color-black {
7
- // TODO: replace with new token when available
61
+ @warn "Deprecated: Use .text-default instead of .color-black";
8
62
  color: color.$black !important;
9
63
  }
10
64
 
11
65
  .color-orange {
12
- // TODO: replace with new token when available
66
+ @warn "Deprecated: Use .text-accent instead of .color-orange";
13
67
  color: var(--color-text-accent) !important;
14
68
  }
15
69
 
16
70
  .color-gray {
17
- // TODO: replace with new token when available
71
+ @warn "Deprecated: Use .text-secondary instead of .color-gray";
18
72
  color: color.$gray-800 !important;
19
73
  }
20
74
 
21
75
  .color-white {
22
- // TODO: replace with new token when available
76
+ @warn "Deprecated: Use .text-inverse instead of .color-white";
23
77
  color: color.$white !important;
24
78
  }
25
79
 
26
80
  .color-blue {
81
+ @warn "Deprecated: Use .icon-information instead of .color-blue";
27
82
  color: var(--color-icon-information) !important;
28
83
  }
29
84
 
30
85
  .color-danger {
31
- // TODO: replace with new token when available
86
+ @warn "Deprecated: Use .icon-negative instead of .color-danger";
32
87
  color: var(--color-icon-negative) !important;
33
88
  }
34
89
 
35
90
  .bg-white {
36
- // TODO: replace with new token when available
91
+ @warn "Deprecated: Use .background-primary instead of .bg-white";
37
92
  background-color: color.$white !important;
38
93
  color: var(--color-text-default);
39
94
 
@@ -44,10 +99,9 @@
44
99
  }
45
100
 
46
101
  .bg-black {
47
- // TODO: replace with new token when available
48
- // background-color: color.$black !important;
102
+ @warn "Deprecated: Use .background-contrast instead of .bg-black";
49
103
  background-color: #141414 !important;
50
- color: var(--color-text-default);
104
+ color: var(--color-text-inverse);
51
105
 
52
106
  .color-gray,
53
107
  &.color-gray {
@@ -61,79 +115,92 @@
61
115
  }
62
116
 
63
117
  .bg-orange {
118
+ @warn "Deprecated: Use .surface-secondary instead of .bg-orange";
64
119
  background-color: var(--color-surface-secondary) !important;
65
- // TODO: replace with new token when available
66
120
  color: color.$black !important;
67
121
  }
68
122
 
69
123
  .bg-orange-dark {
124
+ @warn "Deprecated: Use .surface-tertiary instead of .bg-orange-dark";
70
125
  background-color: var(--color-surface-tertiary) !important;
71
126
  color: var(--color-text-inverse) !important;
72
127
  }
73
128
 
74
129
  .bg-gray {
130
+ @warn "Deprecated: Use .surface-subtle instead of .bg-gray";
75
131
  background-color: var(--color-surface-subtle) !important;
76
132
  }
77
133
 
134
+ .bg-gray-lighter {
135
+ @warn "Deprecated: Use .background-secondary instead of .bg-gray-lighter";
136
+ background-color: var(--color-background-secondary) !important;
137
+ }
138
+
78
139
  .bg-blue {
140
+ @warn "Deprecated: Use .fill-accent1 instead of .bg-blue";
79
141
  background-color: var(--color-fill-accent1) !important;
80
- // TODO: replace with new token when available
81
142
  color: color.$black !important;
82
143
  }
83
144
 
84
145
  .bg-green {
146
+ @warn "Deprecated: Use .fill-accent2 instead of .bg-green";
85
147
  background-color: var(--color-fill-accent2) !important;
86
- // TODO: replace with new token when available
87
148
  color: color.$black !important;
88
149
  }
89
150
 
90
151
  .bg-pink {
152
+ @warn "Deprecated: Use .fill-accent3 instead of .bg-pink";
91
153
  background-color: var(--color-fill-accent3) !important;
92
- // TODO: replace with new token when available
93
154
  color: color.$black !important;
94
155
  }
95
156
 
96
157
  .bg-violet {
158
+ @warn "Deprecated: Use .fill-accent4 instead of .bg-violet";
97
159
  background-color: var(--color-fill-accent4) !important;
98
- // TODO: replace with new token when available
99
160
  color: color.$black !important;
100
161
  }
101
162
 
102
163
  .bg-yellow {
164
+ @warn "Deprecated: Use .fill-accent5 instead of .bg-yellow";
103
165
  background-color: var(--color-fill-accent5) !important;
104
- // TODO: replace with new token when available
105
166
  color: color.$black !important;
106
167
  }
107
168
 
108
169
  .bg-yellow-lighter {
109
- // TODO: replace with new token when available
170
+ @warn "Deprecated: This class will be removed in future versions";
110
171
  background-color: color.$yellow-lighter !important;
111
172
  color: color.$black !important;
112
173
  }
113
174
 
114
175
  .bg-red {
115
- // TODO: replace with new token when available
176
+ @warn "Deprecated: Use .fill-negative instead of .bg-red";
116
177
  background-color: color.$red !important;
117
178
  color: color.$black !important;
118
179
  }
119
180
 
120
181
  .bg-accent {
182
+ @warn "Deprecated: Use .background-accent instead of .bg-accent";
121
183
  background-color: var(--color-background-accent) !important;
122
184
  color: var(--color-text-default) !important;
123
185
  }
124
186
 
125
187
  .bg-accent1-blog {
188
+ @warn "Deprecated: Use .background-accent1-blog instead of .bg-accent1-blog";
126
189
  background-color: var(--color-background-accent1-blog) !important;
127
190
  color: var(--color-text-default) !important;
128
191
  }
129
192
 
130
193
  .bg-accent2-blog {
194
+ @warn "Deprecated: Use .background-accent2-blog instead of .bg-accent2-blog";
131
195
  background-color: var(--color-background-accent2-blog) !important;
132
196
  color: var(--color-text-default) !important;
133
197
  }
134
198
 
199
+ // Legacy selection styles
135
200
  .bg-orange,
136
- .bg-orange-dark {
201
+ .bg-orange-dark,
202
+ .surface-secondary,
203
+ .surface-tertiary {
137
204
  &::selection {
138
205
  background-color: var(--color-background-contrast);
139
206
  color: var(--color-text-inverse);
@@ -144,7 +211,14 @@
144
211
  color: var(--color-text-default);
145
212
  }
146
213
 
214
+ // Legacy classes - continued
147
215
  .bg-none {
216
+ @warn "Deprecated: Use .background-none instead of .bg-none";
217
+ background: none !important;
218
+ }
219
+
220
+ // Utility for removing background
221
+ .background-none {
148
222
  background: none !important;
149
223
  }
150
224
  }