@orangesk/orange-design-system 2.0.0-beta.10 → 2.0.0-beta.11

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 (37) 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 +3 -2
  5. package/build/components/types/src/components/PromoBanner/PromoBanner.d.ts +1 -1
  6. package/build/components/types/src/components/Tile/Tile.d.ts +2 -1
  7. package/build/lib/after-components.css +1 -1
  8. package/build/lib/after-components.css.map +1 -1
  9. package/build/lib/before-components.css +1 -1
  10. package/build/lib/before-components.css.map +1 -1
  11. package/build/lib/components.css +1 -1
  12. package/build/lib/components.css.map +1 -1
  13. package/build/lib/megamenu.css +1 -1
  14. package/build/lib/megamenu.css.map +1 -1
  15. package/build/lib/scripts.js +3 -3
  16. package/build/lib/scripts.js.map +1 -1
  17. package/build/lib/style.css +1 -1
  18. package/build/lib/style.css.map +1 -1
  19. package/build/lib/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +9 -9
  21. package/src/components/Accordion/styles/mixins.scss +5 -1
  22. package/src/components/AnchorNavigation/styles/mixins.scss +1 -1
  23. package/src/components/Expander/styles/style.scss +3 -1
  24. package/src/components/PromoBanner/PromoBanner.tsx +19 -2
  25. package/src/components/PromoBanner/styles/mixins.scss +1 -1
  26. package/src/components/PromoBanner/tests/PromoBanner.conformance.test.js +32 -0
  27. package/src/components/PromoBanner/tests/PromoBanner.unit.test.js +52 -0
  28. package/src/components/Table/styles/mixins.scss +3 -4
  29. package/src/components/Tile/CHANGELOG.md +15 -1
  30. package/src/components/Tile/Tile.tsx +11 -3
  31. package/src/components/Tile/styles/config.scss +0 -11
  32. package/src/components/Tile/styles/style.scss +0 -4
  33. package/src/components/Tile/tests/Tile.unit.test.js +10 -3
  34. package/src/styles/base/globals.scss +7 -2
  35. package/src/styles/typography/mixins.scss +18 -0
  36. package/src/styles/typography/style.scss +6 -3
  37. package/src/styles/utilities/text.scss +1 -0
@@ -7,11 +7,10 @@
7
7
  width: 100%;
8
8
  margin-bottom: space.get();
9
9
  color: var(--color-text-default);
10
- background-color: var(--color-background-primary);
11
10
  }
12
11
 
13
12
  @mixin cells {
14
- padding: space.get("small") space.get("small") space.get("small") 0;
13
+ padding: space.get("medium");
15
14
  vertical-align: middle;
16
15
  font-size: inherit;
17
16
  line-height: inherit;
@@ -20,7 +19,7 @@
20
19
  @mixin header-cells {
21
20
  vertical-align: bottom;
22
21
  text-align: left;
23
- border-bottom: config.$fat-border-size solid var(--color-border-strong);
22
+ border-bottom: config.$fat-border-size solid var(--color-border-contrast);
24
23
  font-weight: 700;
25
24
  }
26
25
 
@@ -38,7 +37,7 @@
38
37
  }
39
38
 
40
39
  @mixin rows-first-cell {
41
- padding-left: space.get("small");
40
+ padding-left: 0;
42
41
  }
43
42
 
44
43
  @mixin body-sibling {
@@ -2,11 +2,25 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ### Breaking Changes
6
+
7
+ - **Refactored color prop**: The `color` prop now uses global utility classes instead of component-specific color modifiers:
8
+ - Old: `color="white"` applied `.tile--white` class with custom CSS
9
+ - New: Uses global classes like `surface-primary`, `surface-secondary`, `background-contrast`, etc.
10
+ - Removed `"default"` and `"white"` color options
11
+ - Added support for: `"surface-primary"`, `"surface-secondary"`, `"surface-tertiary"`, `"surface-subtle"`, `"surface-moderate"`, `"surface-contrast"`, `"background-primary"`, `"background-secondary"`, `"background-contrast"`, `"background-accent"`
12
+
13
+ ### Migration Guide
14
+
15
+ - Replace `color="white"` with `color="surface-primary"`
16
+ - Replace any custom styling that relied on `.tile--white` with global surface utility classes
17
+ - The new color system provides consistent styling across all components in the design system
18
+
5
19
  ### Changed
6
20
 
7
21
  - Update `Tile` component documentation and usage examples:
8
22
  - Expanded usage examples in `Tile.mdx` and `/app/components/tile/page.mdx` to demonstrate:
9
- - New color options (including `black`)
23
+ - New color options using global utility classes
10
24
  - Background image and icon support
11
25
  - Alignment options with `hAlign` and `vAlign` props
12
26
  - Block link and action variants
@@ -5,7 +5,12 @@ import { Image } from "../Image";
5
5
  import { Icon } from "../Icon";
6
6
  import { IconProps } from "../Icon/Icon";
7
7
 
8
- export type TileColor = "default" | "white";
8
+ export const tileColors = [
9
+ "surface-primary",
10
+ "surface-subtle",
11
+ "surface-contrast",
12
+ ] as const;
13
+ export type TileColor = (typeof tileColors)[number];
9
14
  export type TileHAlign = "center";
10
15
  export type TileVAlign = "center" | "end" | "space-between";
11
16
 
@@ -35,7 +40,7 @@ const Tile: React.FC<TileProps> = ({
35
40
  backgroundImage,
36
41
  vAlign,
37
42
  hAlign,
38
- color = "default",
43
+ color,
39
44
  space,
40
45
  ...other
41
46
  }) => {
@@ -43,7 +48,10 @@ const Tile: React.FC<TileProps> = ({
43
48
  CLASS_ROOT,
44
49
  {
45
50
  [`${CLASS_ROOT}--${variant}`]: variant,
46
- [`tile--${color}`]: color !== "default",
51
+ ...(color && color !== "surface-contrast" ? { [color]: true } : {}),
52
+ ...(color === "surface-contrast"
53
+ ? { [`${color} text-inverse`]: true }
54
+ : {}),
47
55
  },
48
56
  className,
49
57
  );
@@ -1,17 +1,6 @@
1
1
  @use "../../../styles/tokens/space";
2
2
  @use "../../../styles/tools/convert";
3
3
 
4
- $colors: (
5
- default: (
6
- background-color: transparent,
7
- color: var(--color-text-default),
8
- ),
9
- white: (
10
- background-color: var(--color-surface-primary),
11
- color: var(--color-text-default),
12
- ),
13
- );
14
-
15
4
  $spacing: (
16
5
  xs: convert.to-rem(15px),
17
6
  md: space.get("large"),
@@ -1,5 +1,3 @@
1
- @use "../../../styles/tools/generate";
2
- @use "./config";
3
1
  @use "./mixins";
4
2
 
5
3
  @layer components {
@@ -10,8 +8,6 @@
10
8
  @include mixins.tile-image-aspect;
11
9
  }
12
10
 
13
- @include generate.variants(config.$colors);
14
-
15
11
  &::after {
16
12
  content: "";
17
13
  position: absolute;
@@ -87,11 +87,18 @@ describe("rendering Tile", () => {
87
87
  expect(container.querySelector("img")).toHaveClass("tile__bg");
88
88
  expect(container.querySelector("img")).toHaveClass("test-class");
89
89
  });
90
- it("has class tile--black when color is set to black", () => {
90
+ it("has surface class when color prop is set", () => {
91
91
  const { getByTestId } = render(
92
- <Tile data-testid="test-id" color="black" />,
92
+ <Tile data-testid="test-id" color="surface-secondary" />,
93
93
  );
94
- expect(getByTestId("test-id")).toHaveClass("tile--black");
94
+ expect(getByTestId("test-id")).toHaveClass("surface-secondary");
95
+ });
96
+ it("applies surface-contrast and text-inverse classes when color is surface-contrast", () => {
97
+ const { getByTestId } = render(
98
+ <Tile data-testid="test-id" color="surface-contrast" />,
99
+ );
100
+ expect(getByTestId("test-id")).toHaveClass("surface-contrast");
101
+ expect(getByTestId("test-id")).toHaveClass("text-inverse");
95
102
  });
96
103
  it("applies hAlign and vAlign classes to body", () => {
97
104
  const { getByTestId } = render(
@@ -4,6 +4,8 @@
4
4
 
5
5
  // Consider to add more conditions for light and dark themes
6
6
  :root,
7
+ :host,
8
+ :host(.is-light),
7
9
  .is-light,
8
10
  .bg-white,
9
11
  #root.is-light,
@@ -16,6 +18,7 @@
16
18
  color: var(--color-text-default);
17
19
  }
18
20
 
21
+ :host(.is-dark),
19
22
  .is-dark,
20
23
  .bg-black,
21
24
  #root.is-dark,
@@ -28,13 +31,15 @@
28
31
  color: var(--color-text-default);
29
32
  }
30
33
 
31
- :root {
34
+ :root,
35
+ :host {
32
36
  --extra-scroll-margin: 0;
33
37
  --header-height: 80px;
34
38
  }
35
39
 
36
40
  @media screen and (min-width: 992px) {
37
- :root {
41
+ :root,
42
+ :host {
38
43
  --header-height: 120px;
39
44
  }
40
45
  }
@@ -188,3 +188,21 @@
188
188
  }
189
189
  }
190
190
  }
191
+
192
+ @mixin description-list() {
193
+ @include text-readable;
194
+ @include generate.responsive-css-map(config.$body-text);
195
+ padding-left: 0;
196
+
197
+ dt {
198
+ font-weight: 700;
199
+ }
200
+ dd {
201
+ margin-left: 0;
202
+ margin-bottom: convert.to-rem(20px);
203
+
204
+ &:last-child {
205
+ margin-bottom: 0;
206
+ }
207
+ }
208
+ }
@@ -16,11 +16,14 @@
16
16
  @include readability();
17
17
 
18
18
  ol,
19
- ul,
20
- dl {
19
+ ul {
21
20
  @include list-base();
22
21
  }
23
22
 
23
+ dl {
24
+ @include description-list();
25
+ }
26
+
24
27
  ul {
25
28
  @include ul-list-base();
26
29
  }
@@ -56,4 +59,4 @@ ul {
56
59
 
57
60
  .list--marker-orange {
58
61
  @include list-marker-orange();
59
- }
62
+ }
@@ -28,6 +28,7 @@
28
28
 
29
29
  .underline {
30
30
  text-decoration: underline !important;
31
+ text-underline-offset: 0.1em !important;
31
32
  }
32
33
 
33
34
  small,