@orangesk/orange-design-system 2.0.0-beta.30 → 2.0.0-beta.32

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 (82) hide show
  1. package/README.md +7 -7
  2. package/build/appstore.svg +31 -0
  3. package/build/components/Breadcrumbs/style.css +1 -1
  4. package/build/components/Breadcrumbs/style.css.map +1 -1
  5. package/build/components/Carousel/style.css +1 -1
  6. package/build/components/Carousel/style.css.map +1 -1
  7. package/build/components/Footer/style.css +1 -1
  8. package/build/components/Footer/style.css.map +1 -1
  9. package/build/components/Megamenu/style.css +1 -1
  10. package/build/components/Megamenu/style.css.map +1 -1
  11. package/build/components/Preview/style.css +1 -1
  12. package/build/components/Preview/style.css.map +1 -1
  13. package/build/components/PromoBanner/style.css +1 -1
  14. package/build/components/PromoBanner/style.css.map +1 -1
  15. package/build/components/index.js +1 -1
  16. package/build/components/index.js.map +1 -1
  17. package/build/components/tsconfig.tsbuildinfo +1 -1
  18. package/build/components/types/index.d.ts +17 -2
  19. package/build/components/types/src/components/Carousel/Carousel.static.d.ts +1 -11
  20. package/build/components/types/src/components/Footer/Footer.static.d.ts +21 -0
  21. package/build/components/types/src/components/Footer/constants.d.ts +12 -2
  22. package/build/components/types/src/components/Footer/data.d.ts +5 -0
  23. package/build/components/types/src/components/Footer/static.d.ts +21 -0
  24. package/build/components/types/src/components/Megamenu/Megamenu.d.ts +4 -2
  25. package/build/components/types/src/components/Megamenu/Megamenu.static.d.ts +16 -5
  26. package/build/components/types/src/components/Megamenu/MegamenuBlog.d.ts +1 -1
  27. package/build/components/types/src/components/Megamenu/MegamenuSearchContent.d.ts +10 -0
  28. package/build/components/types/src/components/Megamenu/MyOrangeMobilePanel.d.ts +6 -0
  29. package/build/components/types/src/components/Megamenu/constants.d.ts +15 -0
  30. package/build/components/types/src/components/Megamenu/data.d.ts +21 -0
  31. package/build/components/types/src/components/Megamenu/ids.d.ts +11 -0
  32. package/build/components/types/src/components/PromoBanner/PromoBanner.d.ts +5 -1
  33. package/build/components/types/src/components/index.d.ts +2 -1
  34. package/build/googleplay.svg +52 -0
  35. package/build/lib/base.css.map +1 -1
  36. package/build/lib/components.css +1 -1
  37. package/build/lib/components.css.map +1 -1
  38. package/build/lib/footer.css +1 -1
  39. package/build/lib/footer.css.map +1 -1
  40. package/build/lib/footer.js +2 -0
  41. package/build/lib/footer.js.map +1 -0
  42. package/build/lib/megamenu.css +1 -1
  43. package/build/lib/megamenu.css.map +1 -1
  44. package/build/lib/megamenu.js +1 -1
  45. package/build/lib/megamenu.js.map +1 -1
  46. package/build/lib/scripts.js +1 -1
  47. package/build/lib/scripts.js.map +1 -1
  48. package/build/lib/style.css +1 -1
  49. package/build/lib/style.css.map +1 -1
  50. package/build/lib/tsconfig.tsbuildinfo +1 -1
  51. package/build/lib/utilities.css +1 -1
  52. package/build/lib/utilities.css.map +1 -1
  53. package/build/search-index.json +8 -4
  54. package/package.json +12 -12
  55. package/src/components/Breadcrumbs/styles/mixins.scss +6 -1
  56. package/src/components/Carousel/Carousel.static.ts +60 -89
  57. package/src/components/Carousel/styles/mixins.scss +4 -12
  58. package/src/components/Footer/Footer.static.ts +130 -0
  59. package/src/components/Footer/Footer.tsx +142 -62
  60. package/src/components/Footer/constants.ts +12 -2
  61. package/src/components/Footer/data.ts +13 -0
  62. package/src/components/Footer/static.ts +59 -0
  63. package/src/components/Footer/styles/mixins.scss +122 -18
  64. package/src/components/Footer/styles/style.scss +63 -4
  65. package/src/components/Footer/tests/Footer.unit.test.js +2 -2
  66. package/src/components/Megamenu/Megamenu.static.ts +200 -90
  67. package/src/components/Megamenu/Megamenu.tsx +363 -615
  68. package/src/components/Megamenu/MegamenuBlog.tsx +192 -73
  69. package/src/components/Megamenu/MegamenuSearchContent.tsx +74 -0
  70. package/src/components/Megamenu/MyOrangeMobilePanel.tsx +127 -0
  71. package/src/components/Megamenu/constants.ts +15 -0
  72. package/src/components/Megamenu/data.ts +231 -0
  73. package/src/components/Megamenu/ids.ts +35 -0
  74. package/src/components/Megamenu/styles/mixins.scss +223 -16
  75. package/src/components/Megamenu/styles/style.scss +64 -0
  76. package/src/components/Preview/styles/style.scss +2 -1
  77. package/src/components/PromoBanner/PromoBanner.tsx +12 -1
  78. package/src/components/PromoBanner/styles/mixins.scss +31 -7
  79. package/src/components/PromoBanner/styles/style.scss +41 -0
  80. package/src/components/PromoBanner/tests/PromoBanner.unit.test.js +44 -0
  81. package/src/components/index.ts +3 -0
  82. package/src/styles/utilities/horizontal-scroll.scss +28 -11
@@ -0,0 +1,59 @@
1
+ import Footer from "./Footer.static";
2
+ import moduleFactory, {
3
+ initModulesWithin,
4
+ destroyModulesWithin,
5
+ } from "../../scripts/lib/moduleFactory";
6
+ import "./styles/style.scss";
7
+
8
+ export const customFooterModuleSelectorPairs = [
9
+ {
10
+ Module: Footer,
11
+ name: "Footer",
12
+ selector: "[data-footer]",
13
+ },
14
+ ];
15
+
16
+ declare global {
17
+ interface Window {
18
+ ODSFooter: {
19
+ Footer: typeof Footer;
20
+ instances: Footer[];
21
+ init: () => void;
22
+ destroy: () => void;
23
+ initModulesWithin: (container: any) => {};
24
+ destroyModulesWithin: (
25
+ container: any,
26
+ removeOrphanedNodes?: boolean | undefined,
27
+ ) => {};
28
+ };
29
+ }
30
+ }
31
+
32
+ window.ODSFooter = window.ODSFooter || {
33
+ Footer,
34
+ instances: [],
35
+ init: () => {
36
+ window.ODSFooter.instances = moduleFactory(Footer, "[data-footer]");
37
+ },
38
+ destroy: () => {
39
+ window.ODSFooter.instances.forEach((instance) => {
40
+ if (instance && typeof instance.destroy === "function") {
41
+ instance.destroy();
42
+ }
43
+ });
44
+ window.ODSFooter.instances = [];
45
+ },
46
+ initModulesWithin,
47
+ destroyModulesWithin,
48
+ };
49
+
50
+ if (document.readyState === "loading") {
51
+ document.addEventListener("DOMContentLoaded", () => {
52
+ window.ODSFooter.init();
53
+ });
54
+ } else {
55
+ window.ODSFooter.init();
56
+ }
57
+
58
+ export { Footer };
59
+ export default Footer;
@@ -7,6 +7,7 @@
7
7
  @use "../../../styles/tools/generate";
8
8
  @use "../../../styles/tools/visibility" as visibility;
9
9
  @use "../../Container/styles/mixins" as container;
10
+ @use "../../Accordion/styles/mixins" as accordionMixins;
10
11
  @use "../../../styles/typography/mixins" as typography;
11
12
  @use "../../../styles/typography/config" as typographyConfig;
12
13
 
@@ -48,8 +49,6 @@
48
49
 
49
50
  * {
50
51
  box-sizing: border-box;
51
- letter-spacing: convert.to-rem(-0.1px);
52
- line-height: convert.to-rem(18px);
53
52
  }
54
53
 
55
54
  ::selection {
@@ -62,17 +61,18 @@
62
61
  margin-bottom: convert.to-rem(30px);
63
62
  border: 0;
64
63
  border-top: 1px solid var(--color-border-subtle);
65
- }
66
64
 
67
- p,
68
- ul {
69
- font-size: convert.to-rem(14px);
70
- line-height: convert.to-rem(17.5px);
65
+ @include breakpoint.get("xs", "down") {
66
+ margin-top: convert.to-rem(15px);
67
+ margin-bottom: convert.to-rem(15px);
68
+ }
71
69
  }
72
70
  }
73
71
 
74
72
  @mixin base {
75
73
  font-size: 1rem;
74
+ letter-spacing: convert.to-rem(-0.1px);
75
+ line-height: convert.to-rem(18px);
76
76
  color: var(--color-text-default);
77
77
  background-color: var(--color-surface-primary);
78
78
  box-sizing: border-box;
@@ -82,6 +82,12 @@
82
82
  @include breakpoint.get("md", "down") {
83
83
  padding: convert.to-rem(30px) 0;
84
84
  }
85
+
86
+ :where(p),
87
+ :where(ul) {
88
+ font-size: convert.to-rem(14px);
89
+ line-height: convert.to-rem(17.5px);
90
+ }
85
91
  }
86
92
 
87
93
  @mixin container {
@@ -91,19 +97,23 @@
91
97
  margin-bottom: 0;
92
98
  }
93
99
 
94
- @mixin grid {
100
+ @mixin menu {
95
101
  display: grid;
96
- gap: convert.to-rem(30px);
97
- row-gap: convert.to-rem(40px);
102
+ row-gap: convert.to-rem(30px);
98
103
  grid-template-columns: repeat(1, 1fr);
99
104
 
105
+ @include breakpoint.get("xs", "down") {
106
+ row-gap: 0;
107
+ margin-bottom: convert.to-rem(30px);
108
+ }
109
+
100
110
  @include breakpoint.get("sm") {
101
111
  grid-template-columns: repeat(2, 1fr);
102
112
  }
103
113
 
104
114
  @include breakpoint.get("md") {
105
115
  grid-template-columns: repeat(3, 1fr);
106
- gap: convert.to-rem(15px);
116
+ gap: convert.to-rem(20px);
107
117
  row-gap: convert.to-rem(20px);
108
118
  }
109
119
 
@@ -114,15 +124,28 @@
114
124
  }
115
125
  }
116
126
 
117
- @mixin logo {
118
- display: inline-flex;
119
- margin-bottom: convert.to-rem(60px);
127
+ @mixin menu-section {
128
+ @include breakpoint.get("xs", "down") {
129
+ @include accordionMixins.item;
120
130
 
121
- @include breakpoint.get("md", "down") {
122
- margin-bottom: convert.to-rem(30px);
131
+ &:first-child {
132
+ border-top: 0;
133
+ }
134
+
135
+ &:last-child {
136
+ border-bottom: 1px solid var(--color-border-strong);
137
+ }
138
+
139
+ .footer__list {
140
+ margin-top: convert.to-rem(10px) !important;
141
+ }
123
142
  }
124
143
  }
125
144
 
145
+ @mixin logo {
146
+ display: inline-flex;
147
+ }
148
+
126
149
  @mixin title {
127
150
  @include generate.responsive-css-map(map.get(typographyConfig.$headings, 5));
128
151
  margin-top: 0;
@@ -135,6 +158,46 @@
135
158
  }
136
159
  }
137
160
 
161
+ @mixin accordion-toggle {
162
+ margin: 0;
163
+ margin-bottom: convert.to-rem(30px);
164
+ padding: 0;
165
+ border: 0;
166
+ width: 100%;
167
+ text-align: left;
168
+ background: transparent;
169
+
170
+ @include breakpoint.get("sm") {
171
+ display: block;
172
+ pointer-events: none;
173
+ }
174
+
175
+ @include breakpoint.get("xs", "down") {
176
+ @include accordionMixins.button-base;
177
+ gap: convert.to-rem(12px);
178
+ padding: convert.to-rem(15px) 0;
179
+ margin-bottom: 0;
180
+
181
+ .footer__title {
182
+ margin: 0;
183
+ }
184
+ }
185
+ }
186
+
187
+ @mixin accordion-icon {
188
+ @include accordionMixins.icon;
189
+
190
+ @include breakpoint.get("sm") {
191
+ display: none;
192
+ }
193
+ }
194
+
195
+ @mixin accordion-list {
196
+ @include breakpoint.get("xs", "down") {
197
+ @include accordionMixins.body;
198
+ }
199
+ }
200
+
138
201
  @mixin list {
139
202
  @include typography.list-unstyled;
140
203
 
@@ -143,22 +206,62 @@
143
206
  }
144
207
  }
145
208
 
209
+ @mixin list-space-small {
210
+ gap: convert.to-rem(10px);
211
+ }
212
+
146
213
  @mixin list-inline {
147
214
  display: flex;
148
215
  flex-wrap: wrap;
149
- gap: convert.to-rem(10px);
216
+ gap: convert.to-rem(20px);
217
+ row-gap: convert.to-rem(10px);
150
218
 
151
219
  li {
152
220
  margin: 0;
153
221
  }
154
222
  }
155
223
 
156
- @mixin socials {
224
+ @mixin list-stack-sm-down {
225
+ @include breakpoint.get("sm", "down") {
226
+ flex-direction: column;
227
+ align-items: flex-start;
228
+ gap: convert.to-rem(10px);
229
+ }
230
+ }
231
+
232
+ @mixin list-break-sm-down() {
233
+ display: none;
234
+ flex-basis: 100%;
235
+ width: 100%;
236
+ height: 0;
237
+ margin: 0 !important;
238
+ padding: 0 !important;
239
+ list-style: none;
240
+
241
+ @include breakpoint.get("sm", "down") {
242
+ display: block;
243
+ }
244
+ }
245
+
246
+ @mixin list-item-lead {
247
+ margin-right: convert.to-rem(10px) !important;
248
+
249
+ @include breakpoint.get("sm", "down") {
250
+ margin-right: 0 !important;
251
+ }
252
+ }
253
+
254
+ @mixin bar {
157
255
  display: flex;
158
256
  gap: space.get();
159
257
  justify-content: space-between;
160
258
  align-items: center;
161
259
  flex-wrap: wrap;
260
+
261
+ @include breakpoint.get("sm", "down") {
262
+ flex-direction: column;
263
+ align-items: flex-start;
264
+ }
162
265
  }
163
266
 
164
267
  @mixin bottom {
@@ -175,6 +278,7 @@
175
278
 
176
279
  @mixin bottom-copyright {
177
280
  text-align: right;
281
+ @include generate.css-map(map.get(typographyConfig.$caption, "small"));
178
282
 
179
283
  @include breakpoint.get("md", "down") {
180
284
  text-align: inherit;
@@ -1,5 +1,7 @@
1
1
  @use "./config";
2
2
  @use "./mixins";
3
+ @use "../../../styles/tools/convert";
4
+ @use "../../../styles/tokens/breakpoint";
3
5
  @use "../../Megamenu/styles/mixins" as megamenuMixins;
4
6
 
5
7
  #{config.$class-root} {
@@ -22,8 +24,12 @@
22
24
  @include mixins.container;
23
25
  }
24
26
 
25
- &__grid {
26
- @include mixins.grid;
27
+ &__menu {
28
+ @include mixins.menu;
29
+ }
30
+
31
+ &__menu-section {
32
+ @include mixins.menu-section;
27
33
  }
28
34
 
29
35
  &__logo {
@@ -34,6 +40,31 @@
34
40
  @include mixins.title;
35
41
  }
36
42
 
43
+ &__accordion-toggle {
44
+ @include mixins.accordion-toggle;
45
+ }
46
+
47
+ &__accordion-icon {
48
+ @include mixins.accordion-icon;
49
+ transition: none;
50
+ }
51
+
52
+ &__divider {
53
+ &--hide-xs-down {
54
+ @include breakpoint.get("xs", "down") {
55
+ display: none;
56
+ }
57
+ }
58
+ }
59
+
60
+ [data-footer-toggle][aria-expanded="false"] > &__accordion-icon {
61
+ transform: rotate(0deg);
62
+ }
63
+
64
+ [data-footer-toggle][aria-expanded="true"] > &__accordion-icon {
65
+ transform: rotate(180deg);
66
+ }
67
+
37
68
  &__list {
38
69
  @include mixins.list;
39
70
 
@@ -41,14 +72,42 @@
41
72
  @include mixins.list-inline;
42
73
  align-items: center;
43
74
  }
75
+
76
+ &-break--sm-down {
77
+ @include mixins.list-break-sm-down;
78
+ }
79
+
80
+ &--space-small {
81
+ @include mixins.list-space-small;
82
+ }
83
+
84
+ &--stack-sm-down {
85
+ @include mixins.list-stack-sm-down;
86
+ }
87
+ }
88
+
89
+ &__menu-section > &__list {
90
+ @include mixins.accordion-list;
44
91
  }
45
92
 
46
- &__socials {
47
- @include mixins.socials;
93
+ &__list-item--lead {
94
+ @include mixins.list-item-lead;
95
+ }
96
+
97
+ &__bar {
98
+ @include mixins.bar;
48
99
  }
49
100
 
50
101
  &__bottom {
51
102
  @include mixins.bottom;
52
103
  @include mixins.bottom-copyright;
53
104
  }
105
+
106
+ &--mb-xlarge {
107
+ margin-bottom: convert.to-rem(60px);
108
+
109
+ @include breakpoint.get("md", "down") {
110
+ margin-bottom: convert.to-rem(30px);
111
+ }
112
+ }
54
113
  }
@@ -73,12 +73,12 @@ describe("Footer", () => {
73
73
  const { container } = render(<Footer />);
74
74
  const footer = container.querySelector("footer");
75
75
  const container_ = footer?.querySelector(".footer__container");
76
- const grid = container_?.querySelector(".footer__grid");
76
+ const menu = container_?.querySelector(".footer__menu");
77
77
  const bottom = container_?.querySelector(".footer__bottom");
78
78
 
79
79
  expect(footer).toBeInTheDocument();
80
80
  expect(container_).toBeInTheDocument();
81
- expect(grid).toBeInTheDocument();
81
+ expect(menu).toBeInTheDocument();
82
82
  expect(bottom).toBeInTheDocument();
83
83
  });
84
84