@orangesk/orange-design-system 2.0.0-beta.0 → 2.0.0-beta.1

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 (91) hide show
  1. package/build/components/Accordion/tsconfig.tsbuildinfo +1 -1
  2. package/build/components/Alert/tsconfig.tsbuildinfo +1 -1
  3. package/build/components/AnchorNavigation/tsconfig.tsbuildinfo +1 -1
  4. package/build/components/Bar/tsconfig.tsbuildinfo +1 -1
  5. package/build/components/BlockAction/tsconfig.tsbuildinfo +1 -1
  6. package/build/components/BodyBanner/tsconfig.tsbuildinfo +1 -1
  7. package/build/components/Breadcrumbs/tsconfig.tsbuildinfo +1 -1
  8. package/build/components/Button/tsconfig.tsbuildinfo +1 -1
  9. package/build/components/Buttons/tsconfig.tsbuildinfo +1 -1
  10. package/build/components/Card/tsconfig.tsbuildinfo +1 -1
  11. package/build/components/Carousel/tsconfig.tsbuildinfo +1 -1
  12. package/build/components/CarouselPromotions/tsconfig.tsbuildinfo +1 -1
  13. package/build/components/CartTable/tsconfig.tsbuildinfo +1 -1
  14. package/build/components/Code/tsconfig.tsbuildinfo +1 -1
  15. package/build/components/Container/tsconfig.tsbuildinfo +1 -1
  16. package/build/components/Controls/tsconfig.tsbuildinfo +1 -1
  17. package/build/components/Cover/tsconfig.tsbuildinfo +1 -1
  18. package/build/components/Divider/tsconfig.tsbuildinfo +1 -1
  19. package/build/components/DocumentationSidebar/index.js +1 -1
  20. package/build/components/DocumentationSidebar/tsconfig.tsbuildinfo +1 -1
  21. package/build/components/Dropdown/tsconfig.tsbuildinfo +1 -1
  22. package/build/components/Expander/tsconfig.tsbuildinfo +1 -1
  23. package/build/components/FeatureAccordion/tsconfig.tsbuildinfo +1 -1
  24. package/build/components/Footer/index.js.map +1 -1
  25. package/build/components/Footer/tsconfig.tsbuildinfo +1 -1
  26. package/build/components/Forms/tsconfig.tsbuildinfo +1 -1
  27. package/build/components/Gauge/tsconfig.tsbuildinfo +1 -1
  28. package/build/components/Grid/tsconfig.tsbuildinfo +1 -1
  29. package/build/components/Hero/tsconfig.tsbuildinfo +1 -1
  30. package/build/components/Icon/tsconfig.tsbuildinfo +1 -1
  31. package/build/components/IconList/tsconfig.tsbuildinfo +1 -1
  32. package/build/components/Image/tsconfig.tsbuildinfo +1 -1
  33. package/build/components/Link/tsconfig.tsbuildinfo +1 -1
  34. package/build/components/List/tsconfig.tsbuildinfo +1 -1
  35. package/build/components/Loader/tsconfig.tsbuildinfo +1 -1
  36. package/build/components/Megamenu/style.css +1 -1
  37. package/build/components/Megamenu/style.css.map +1 -1
  38. package/build/components/Megamenu/tsconfig.tsbuildinfo +1 -1
  39. package/build/components/Modal/index.js +3 -3
  40. package/build/components/Modal/index.js.map +1 -1
  41. package/build/components/Modal/tsconfig.tsbuildinfo +1 -1
  42. package/build/components/Pagination/tsconfig.tsbuildinfo +1 -1
  43. package/build/components/Pill/tsconfig.tsbuildinfo +1 -1
  44. package/build/components/Preview/tsconfig.tsbuildinfo +1 -1
  45. package/build/components/Progress/tsconfig.tsbuildinfo +1 -1
  46. package/build/components/PromoBanner/tsconfig.tsbuildinfo +1 -1
  47. package/build/components/PromotionCard/tsconfig.tsbuildinfo +1 -1
  48. package/build/components/Section/index.js.map +1 -1
  49. package/build/components/Section/tsconfig.tsbuildinfo +1 -1
  50. package/build/components/Skeleton/tsconfig.tsbuildinfo +1 -1
  51. package/build/components/SkipLink/tsconfig.tsbuildinfo +1 -1
  52. package/build/components/Stepbar/tsconfig.tsbuildinfo +1 -1
  53. package/build/components/Sticker/tsconfig.tsbuildinfo +1 -1
  54. package/build/components/Table/tsconfig.tsbuildinfo +1 -1
  55. package/build/components/Tabs/tsconfig.tsbuildinfo +1 -1
  56. package/build/components/Tag/tsconfig.tsbuildinfo +1 -1
  57. package/build/components/Testimonial/tsconfig.tsbuildinfo +1 -1
  58. package/build/components/Tile/tsconfig.tsbuildinfo +1 -1
  59. package/build/components/Tooltip/tsconfig.tsbuildinfo +1 -1
  60. package/build/components/index.css +1 -1
  61. package/build/components/index.css.map +1 -1
  62. package/build/components/index.js +4 -4
  63. package/build/components/index.js.map +1 -1
  64. package/build/components/tsconfig.tsbuildinfo +1 -1
  65. package/build/components/types/src/components/Modal/Modal.d.ts +4 -0
  66. package/build/components/types/src/components/Modal/ModalProductFooter.d.ts +10 -0
  67. package/build/components/types/src/components/Modal/index.d.ts +1 -0
  68. package/build/components/types/src/components/Section/Section.d.ts +1 -1
  69. package/build/lib/after-components.css +1 -1
  70. package/build/lib/after-components.css.map +1 -1
  71. package/build/lib/before-components.css +1 -1
  72. package/build/lib/before-components.css.map +1 -1
  73. package/build/lib/components.css +1 -1
  74. package/build/lib/components.css.map +1 -1
  75. package/build/lib/style.css +1 -1
  76. package/build/lib/style.css.map +1 -1
  77. package/package.json +1 -1
  78. package/src/components/Megamenu/styles/config.scss +2 -0
  79. package/src/components/Megamenu/styles/mixins.scss +2 -1
  80. package/src/components/Modal/Modal.tsx +8 -1
  81. package/src/components/Modal/ModalProductFooter.tsx +38 -0
  82. package/src/components/Modal/index.ts +1 -0
  83. package/src/components/Modal/styles/config.scss +7 -0
  84. package/src/components/Modal/styles/mixins.scss +59 -9
  85. package/src/components/Modal/styles/style.scss +12 -0
  86. package/src/components/Modal/tests/Modal.unit.test.js +36 -0
  87. package/src/components/Section/Section.tsx +7 -1
  88. package/src/components/Section/tests/Section.conformance.test.js +7 -1
  89. package/src/components/Section/tests/Section.unit.test.js +28 -1
  90. package/src/styles/tokens/color.scss +4 -0
  91. package/src/styles/utilities/color.scss +14 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orangesk/orange-design-system",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.1",
4
4
  "private": false,
5
5
  "engines": {
6
6
  "node": ">=18.x"
@@ -10,4 +10,6 @@ $megamenu: (
10
10
  overlay-background: rgba(0, 0, 0, 0.5),
11
11
  z-index-overlay: 1000,
12
12
  z-index-sidebar: 1001,
13
+ z-index-header: 998,
14
+ z-index-dropdown-content: 998,
13
15
  );
@@ -41,7 +41,7 @@
41
41
  gap: convert.to-rem(20px);
42
42
  padding: convert.to-rem(15px) convert.to-rem(20px);
43
43
  border-bottom: 1px solid var(--color-border-subtle);
44
- z-index: 998;
44
+ z-index: map.get(config.$megamenu, z-index-header);
45
45
  }
46
46
  }
47
47
 
@@ -300,6 +300,7 @@
300
300
  left: 0;
301
301
  right: 0;
302
302
  width: 100%;
303
+ z-index: map.get(config.$megamenu, z-index-dropdown-content);
303
304
 
304
305
  @include breakpoint.get("lg", "down") {
305
306
  position: static;
@@ -51,6 +51,10 @@ interface ModalProps extends React.HTMLAttributes<HTMLDivElement> {
51
51
  className?: string;
52
52
  /** Color scheme for the modal */
53
53
  colorScheme?: "dark" | "light";
54
+ /** Disables header paddings */
55
+ disableHeaderSpacing?: boolean;
56
+ /** Disables footer paddings */
57
+ disableFooterSpacing?: boolean;
54
58
  }
55
59
 
56
60
  const defaultProps = {
@@ -78,6 +82,8 @@ const Modal: React.FC<ModalProps> = ({
78
82
  renderFooter,
79
83
  fullHeight,
80
84
  colorScheme,
85
+ disableHeaderSpacing,
86
+ disableFooterSpacing,
81
87
  ...other
82
88
  }) => {
83
89
  const [modalRef, instance] = useStatic(ModalStatic);
@@ -125,7 +131,7 @@ const Modal: React.FC<ModalProps> = ({
125
131
  {}
126
132
  <div
127
133
  className={cx(`${CLASS_ROOT}__header`, {
128
- [`${CLASS_ROOT}__header--no-spacing`]: !!renderHeader,
134
+ [`${CLASS_ROOT}__header--no-spacing`]: disableHeaderSpacing,
129
135
  })}
130
136
  >
131
137
  {renderHeader ? (
@@ -145,6 +151,7 @@ const Modal: React.FC<ModalProps> = ({
145
151
  <div
146
152
  className={cx(`${CLASS_ROOT}__footer`, {
147
153
  [`${CLASS_ROOT}__footer--sticky`]: hasStickyFooter,
154
+ [`${CLASS_ROOT}__footer--no-spacing`]: disableFooterSpacing,
148
155
  })}
149
156
  >
150
157
  {renderFooter ? (
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ import cx from "classnames";
3
+
4
+ interface ModalProductFooterProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ image?: React.ReactNode;
6
+ /** Use small spacing */
7
+ space?: "small";
8
+ button?: React.ReactNode;
9
+ }
10
+
11
+ export const CLASS_ROOT = "modal__product";
12
+
13
+ const ModalProductFooter = React.forwardRef<
14
+ HTMLDivElement,
15
+ ModalProductFooterProps
16
+ >(({ className, children, button, image, space, ...other }, ref) => {
17
+ const classes = cx(
18
+ `${CLASS_ROOT}-footer`,
19
+ // {
20
+ // [`${CLASS_ROOT}-footer--space-small`]: space === "small",
21
+ // },
22
+ className,
23
+ );
24
+
25
+ const contentClasses = `${CLASS_ROOT}-footer-content`;
26
+ const buttonClasses = `${CLASS_ROOT}-footer-button`;
27
+
28
+ return (
29
+ <div className={classes} ref={ref} {...other}>
30
+ <div className={contentClasses}>{children}</div>
31
+ <div className={buttonClasses}>{button}</div>
32
+ </div>
33
+ );
34
+ });
35
+
36
+ ModalProductFooter.displayName = "ModalProductFooter";
37
+
38
+ export { ModalProductFooter };
@@ -3,3 +3,4 @@ export { ModalBody } from "./ModalBody";
3
3
  export { ModalTitle } from "./ModalTitle";
4
4
  export { ModalCloseButton } from "./ModalCloseButton";
5
5
  export { ModalProductHeader } from "./ModalProductHeader";
6
+ export { ModalProductFooter } from "./ModalProductFooter";
@@ -39,3 +39,10 @@ $spacing: (
39
39
  ),
40
40
  large: (), // same as default,
41
41
  );
42
+
43
+ $spacing-product-footer: (
44
+ default: (
45
+ default: space.get("medium") space.get("small") convert.to-rem(40px),
46
+ md: space.get("medium") space.get("large") space.get("large") space.get("large"),
47
+ )
48
+ )
@@ -184,21 +184,27 @@
184
184
  > *:last-child {
185
185
  margin-bottom: 0;
186
186
  }
187
+
188
+ .divider {
189
+ padding: 0;
190
+ }
187
191
  }
188
192
 
189
193
  @mixin footer-spacing($size, $sizes: config.$spacing) {
190
194
  $spacing: map.get($sizes, $size);
191
195
 
192
- @each $breakpoint, $space in $spacing {
193
- @include breakpoint.get($breakpoint) {
194
- padding-top: 0;
195
- padding-right: $space;
196
- padding-bottom: $space;
197
- padding-left: $space;
196
+ &:not(.modal__footer--no-spacing) {
197
+ @each $breakpoint, $space in $spacing {
198
+ @include breakpoint.get($breakpoint) {
199
+ padding-top: 0;
200
+ padding-right: $space;
201
+ padding-bottom: $space;
202
+ padding-left: $space;
198
203
 
199
- @at-root {
200
- .modal__body--colorful + .modal__footer {
201
- padding: $space !important;
204
+ @at-root {
205
+ .modal__body--colorful + .modal__footer {
206
+ padding: $space !important;
207
+ }
202
208
  }
203
209
  }
204
210
  }
@@ -227,6 +233,50 @@
227
233
  }
228
234
  }
229
235
 
236
+ @mixin modal-product-footer() {
237
+ display: flex;
238
+ align-items: center;
239
+ gap: convert.to-rem(20px);
240
+
241
+ @include breakpoint.get("md") {
242
+ gap: convert.to-rem(30px);
243
+ }
244
+
245
+ @include breakpoint.get("xs", "down") {
246
+ flex-direction: column;
247
+ }
248
+
249
+ @each $breakpoint, $value in map.get(config.$spacing-product-footer, "default") {
250
+ @include breakpoint.get($breakpoint) {
251
+ padding: $value;
252
+ }
253
+ }
254
+ }
255
+
256
+ @mixin modal-product-footer-content() {
257
+ flex: 1 0 auto;
258
+ display: flex;
259
+ flex-direction: column;
260
+ gap: convert.to-rem(7px);
261
+
262
+ @include breakpoint.get("xs", "down") {
263
+ flex-direction: row-reverse;
264
+ align-items: center;
265
+ width: 100%;
266
+ justify-content: space-between;
267
+ }
268
+ }
269
+
270
+ @mixin modal-product-footer-button() {
271
+ @include breakpoint.get("xs", "down") {
272
+ width: 100%;
273
+
274
+ .btn {
275
+ width: 100%;
276
+ }
277
+ }
278
+ }
279
+
230
280
  @mixin modal-product-image() {
231
281
  object-fit: cover;
232
282
  object-position: left;
@@ -120,4 +120,16 @@
120
120
  .modal__product-header--space-small .modal__product-content {
121
121
  @include mixins.modal-product-header(space.get());
122
122
  }
123
+
124
+ .modal__product-footer {
125
+ @include mixins.modal-product-footer();
126
+ }
127
+
128
+ .modal__product-footer-content {
129
+ @include mixins.modal-product-footer-content();
130
+ }
131
+
132
+ .modal__product-footer-button {
133
+ @include mixins.modal-product-footer-button();
134
+ }
123
135
  }
@@ -75,4 +75,40 @@ describe("rendering Modal", () => {
75
75
  expect(getByTestId("modal-light")).toHaveClass("is-light");
76
76
  });
77
77
  });
78
+ describe("disableHeaderSpacing prop", () => {
79
+ it("should have modal__header--no-spacing class when disableHeaderSpacing is true", () => {
80
+ const { getByTestId } = render(
81
+ <div id="root">
82
+ <Modal
83
+ id="modal-no-header-spacing"
84
+ data-testid="modal-no-header-spacing"
85
+ disableHeaderSpacing
86
+ />
87
+ </div>,
88
+ );
89
+ const child = getByTestId(
90
+ "modal-no-header-spacing",
91
+ ).getElementsByClassName("modal__header--no-spacing");
92
+ expect(child.length).toBe(1);
93
+ expect(child[0]).toHaveClass("modal__header--no-spacing");
94
+ });
95
+ });
96
+ describe("disableFooterSpacing prop", () => {
97
+ it("should have modal__footer--no-spacing class when disableFooterSpacing is true", () => {
98
+ const { getByTestId } = render(
99
+ <div id="root">
100
+ <Modal
101
+ id="modal-no-footer-spacing"
102
+ data-testid="modal-no-footer-spacing"
103
+ disableFooterSpacing
104
+ />
105
+ </div>,
106
+ );
107
+ const child = getByTestId(
108
+ "modal-no-footer-spacing",
109
+ ).getElementsByClassName("modal__footer--no-spacing");
110
+ expect(child.length).toBe(1);
111
+ expect(child[0]).toHaveClass("modal__footer--no-spacing");
112
+ });
113
+ });
78
114
  });
@@ -2,7 +2,13 @@ import React from "react";
2
2
  import cx from "classnames";
3
3
  import { Container } from "../Container";
4
4
 
5
- export type SectionColor = "white" | "gray" | "black" | "orange";
5
+ export type SectionColor =
6
+ | "white"
7
+ | "gray"
8
+ | "black"
9
+ | "orange"
10
+ | "accent1-blog"
11
+ | "accent2-blog";
6
12
  export type SectionSpacing = "default" | "small" | "xsmall";
7
13
 
8
14
  export interface SectionProps {
@@ -198,7 +198,13 @@ describe("Section Conformance Tests", () => {
198
198
  });
199
199
 
200
200
  it("applies color classes correctly", () => {
201
- const colors = ["gray", "black", "orange"];
201
+ const colors = [
202
+ "gray",
203
+ "black",
204
+ "orange",
205
+ "accent1-blog",
206
+ "accent2-blog",
207
+ ];
202
208
  colors.forEach((color) => {
203
209
  const { container } = render(
204
210
  <Section color={color} data-testid="test-section" />,
@@ -196,8 +196,35 @@ describe("Section Component Unit Tests", () => {
196
196
  expect(section).toHaveClass("bg-orange");
197
197
  });
198
198
 
199
+ it("applies correct background class for accent1-blog color", () => {
200
+ const { getByTestId } = render(
201
+ <Section data-testid="test-section" color="accent1-blog" />,
202
+ );
203
+ const section = getByTestId("test-section");
204
+
205
+ expect(section).toHaveClass("section");
206
+ expect(section).toHaveClass("bg-accent1-blog");
207
+ });
208
+
209
+ it("applies correct background class for accent2-blog color", () => {
210
+ const { getByTestId } = render(
211
+ <Section data-testid="test-section" color="accent2-blog" />,
212
+ );
213
+ const section = getByTestId("test-section");
214
+
215
+ expect(section).toHaveClass("section");
216
+ expect(section).toHaveClass("bg-accent2-blog");
217
+ });
218
+
199
219
  it("handles all color variants correctly", () => {
200
- const colors = ["white", "gray", "black", "orange"];
220
+ const colors = [
221
+ "white",
222
+ "gray",
223
+ "black",
224
+ "orange",
225
+ "accent1-blog",
226
+ "accent2-blog",
227
+ ];
201
228
 
202
229
  colors.forEach((color, index) => {
203
230
  const { getByTestId } = render(
@@ -5,6 +5,8 @@ $colors-light: (
5
5
  background-secondary: #f4f4f4,
6
6
  background-contrast: #141414,
7
7
  background-accent: #fff6ed,
8
+ background-accent1-blog: #fff6cc,
9
+ background-accent2-blog: #eee7f7,
8
10
  surface-primary: #ffffff,
9
11
  surface-secondary: #ff7900,
10
12
  surface-tertiary: #f16e00,
@@ -57,6 +59,8 @@ $colors-dark: (
57
59
  background-secondary: #333333,
58
60
  background-contrast: #ffffff,
59
61
  background-accent: #2b1a10,
62
+ background-accent1-blog: #62342d,
63
+ background-accent2-blog: #2b1a10,
60
64
  surface-primary: #141414,
61
65
  surface-secondary: #ff7900,
62
66
  surface-tertiary: #f16e00,
@@ -7,18 +7,22 @@
7
7
  // TODO: replace with new token when available
8
8
  color: color.$black !important;
9
9
  }
10
+
10
11
  .color-orange {
11
12
  // TODO: replace with new token when available
12
13
  color: var(--color-text-accent) !important;
13
14
  }
15
+
14
16
  .color-gray {
15
17
  // TODO: replace with new token when available
16
18
  color: color.$gray-800 !important;
17
19
  }
20
+
18
21
  .color-white {
19
22
  // TODO: replace with new token when available
20
23
  color: color.$white !important;
21
24
  }
25
+
22
26
  .color-blue {
23
27
  color: var(--color-icon-information) !important;
24
28
  }
@@ -113,6 +117,16 @@
113
117
  color: color.$black !important;
114
118
  }
115
119
 
120
+ .bg-accent1-blog {
121
+ background-color: var(--color-background-accent1-blog) !important;
122
+ color: var(--color-text-default) !important;
123
+ }
124
+
125
+ .bg-accent2-blog {
126
+ background-color: var(--color-background-accent2-blog) !important;
127
+ color: var(--color-text-default) !important;
128
+ }
129
+
116
130
  .bg-orange,
117
131
  .bg-orange-dark {
118
132
  &::selection {