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

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 (112) 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 +25 -7
  5. package/build/components/types/src/components/Card/Card.d.ts +1 -1
  6. package/build/components/types/src/components/Card/CardSection.d.ts +2 -2
  7. package/build/components/types/src/components/Expander/Expander.d.ts +2 -2
  8. package/build/components/types/src/components/Icon/iconSearchTags.d.ts +252 -251
  9. package/build/components/types/src/components/Pill/Pill.d.ts +4 -1
  10. package/build/components/types/src/components/index.d.ts +2 -1
  11. package/build/lib/after-components.css +1 -1
  12. package/build/lib/after-components.css.map +1 -1
  13. package/build/lib/components.css +1 -1
  14. package/build/lib/components.css.map +1 -1
  15. package/build/lib/megamenu.css +1 -1
  16. package/build/lib/megamenu.css.map +1 -1
  17. package/build/lib/style.css +1 -1
  18. package/build/lib/style.css.map +1 -1
  19. package/build/sprite.svg +1 -1
  20. package/package.json +5 -5
  21. package/src/assets/icons/article.svg +7 -0
  22. package/src/assets/icons/pictogram-activation--dark.svg +10 -11
  23. package/src/assets/icons/pictogram-activation-free--dark.svg +4 -5
  24. package/src/assets/icons/pictogram-activation-free.svg +4 -5
  25. package/src/assets/icons/pictogram-activation.svg +10 -11
  26. package/src/assets/icons/pictogram-archive--dark.svg +3 -4
  27. package/src/assets/icons/pictogram-archive.svg +3 -4
  28. package/src/assets/icons/pictogram-calling-minutes--dark.svg +3 -4
  29. package/src/assets/icons/pictogram-calling-minutes.svg +3 -4
  30. package/src/assets/icons/pictogram-canal-plus--dark.svg +3 -4
  31. package/src/assets/icons/pictogram-canal-plus.svg +3 -4
  32. package/src/assets/icons/pictogram-competition-tickets--dark.svg +11 -12
  33. package/src/assets/icons/pictogram-competition-tickets.svg +11 -12
  34. package/src/assets/icons/pictogram-device-discount--dark.svg +7 -6
  35. package/src/assets/icons/pictogram-device-discount.svg +5 -6
  36. package/src/assets/icons/pictogram-discount-general--dark.svg +5 -6
  37. package/src/assets/icons/pictogram-discount-general.svg +5 -6
  38. package/src/assets/icons/pictogram-discount-price--dark.svg +5 -6
  39. package/src/assets/icons/pictogram-discount-price.svg +5 -6
  40. package/src/assets/icons/pictogram-extra-data--dark.svg +6 -7
  41. package/src/assets/icons/pictogram-extra-data.svg +6 -7
  42. package/src/assets/icons/pictogram-free-payment--dark.svg +5 -6
  43. package/src/assets/icons/pictogram-free-payment.svg +3 -6
  44. package/src/assets/icons/pictogram-gift--dark.svg +12 -13
  45. package/src/assets/icons/pictogram-gift-one-benefit--dark.svg +7 -8
  46. package/src/assets/icons/pictogram-gift-one-benefit.svg +7 -8
  47. package/src/assets/icons/pictogram-gift-two-benefits--dark.svg +8 -9
  48. package/src/assets/icons/pictogram-gift-two-benefits.svg +8 -9
  49. package/src/assets/icons/pictogram-gift.svg +3 -4
  50. package/src/assets/icons/pictogram-hbo-max--dark.svg +5 -6
  51. package/src/assets/icons/pictogram-hbo-max.svg +5 -6
  52. package/src/assets/icons/pictogram-infinite-sms--dark.svg +3 -4
  53. package/src/assets/icons/pictogram-infinite-sms.svg +3 -4
  54. package/src/assets/icons/pictogram-installation--dark.svg +4 -5
  55. package/src/assets/icons/pictogram-installation-free--dark.svg +4 -5
  56. package/src/assets/icons/pictogram-installation-free.svg +4 -5
  57. package/src/assets/icons/pictogram-installation.svg +4 -5
  58. package/src/assets/icons/pictogram-max--dark.svg +3 -4
  59. package/src/assets/icons/pictogram-max-canal-plus--dark.svg +5 -6
  60. package/src/assets/icons/pictogram-max-canal-plus.svg +5 -6
  61. package/src/assets/icons/pictogram-max.svg +3 -4
  62. package/src/assets/icons/pictogram-moj-orange-app--dark.svg +3 -4
  63. package/src/assets/icons/pictogram-moj-orange-app.svg +3 -4
  64. package/src/assets/icons/pictogram-movie-storage--dark.svg +4 -5
  65. package/src/assets/icons/pictogram-movie-storage.svg +4 -5
  66. package/src/assets/icons/pictogram-online-protection--dark.svg +3 -4
  67. package/src/assets/icons/pictogram-online-protection.svg +3 -4
  68. package/src/assets/icons/pictogram-random-damage--dark.svg +4 -8
  69. package/src/assets/icons/pictogram-random-damage.svg +4 -8
  70. package/src/assets/icons/pictogram-recycling--dark.svg +7 -8
  71. package/src/assets/icons/pictogram-recycling.svg +14 -15
  72. package/src/assets/icons/pictogram-repair--dark.svg +12 -13
  73. package/src/assets/icons/pictogram-repair.svg +12 -13
  74. package/src/assets/icons/pictogram-roaming--dark.svg +3 -4
  75. package/src/assets/icons/pictogram-roaming-discount--dark.svg +3 -16
  76. package/src/assets/icons/pictogram-roaming-discount.svg +15 -16
  77. package/src/assets/icons/pictogram-roaming.svg +3 -4
  78. package/src/assets/icons/pictogram-skylink--dark.svg +10 -11
  79. package/src/assets/icons/pictogram-skylink-live-tv--dark.svg +7 -8
  80. package/src/assets/icons/pictogram-skylink-live-tv.svg +7 -8
  81. package/src/assets/icons/pictogram-skylink.svg +10 -11
  82. package/src/assets/icons/pictogram-sms--dark.svg +5 -6
  83. package/src/assets/icons/pictogram-sms.svg +5 -6
  84. package/src/assets/icons/pictogram-theft--dark.svg +3 -7
  85. package/src/assets/icons/pictogram-theft.svg +3 -7
  86. package/src/assets/icons/pictogram-three-devices--dark.svg +4 -8
  87. package/src/assets/icons/pictogram-three-devices.svg +4 -8
  88. package/src/assets/icons/pictogram-trust--dark.svg +3 -4
  89. package/src/assets/icons/pictogram-trust.svg +3 -4
  90. package/src/assets/icons/pictogram-water-damage--dark.svg +5 -6
  91. package/src/assets/icons/pictogram-water-damage.svg +5 -6
  92. package/src/components/Accordion/styles/config.scss +4 -4
  93. package/src/components/Accordion/styles/mixins.scss +2 -2
  94. package/src/components/AnchorNavigation/AnchorNavigation.tsx +24 -27
  95. package/src/components/AnchorNavigation/styles/mixins.scss +1 -11
  96. package/src/components/Card/Card.tsx +14 -1
  97. package/src/components/Card/CardSection.tsx +2 -10
  98. package/src/components/Card/styles/config.scss +1 -1
  99. package/src/components/Expander/Expander.tsx +4 -2
  100. package/src/components/Expander/styles/style.scss +7 -0
  101. package/src/components/Icon/iconSearchTags.ts +433 -432
  102. package/src/components/Icon/styles/style.scss +4 -0
  103. package/src/components/Link/styles/style.scss +2 -1
  104. package/src/components/Pill/Pill.tsx +8 -3
  105. package/src/components/Pill/styles/config.scss +18 -2
  106. package/src/components/Pill/styles/style.scss +7 -3
  107. package/src/components/Pill/tests/Pill.conformance.test.js +7 -3
  108. package/src/components/Pill/tests/Pill.unit.test.js +45 -7
  109. package/src/components/Section/styles/config.scss +18 -16
  110. package/src/components/index.ts +2 -0
  111. package/src/styles/utilities/color.scss +5 -0
  112. package/src/styles/utilities/layout.scss +9 -0
@@ -29,6 +29,10 @@
29
29
  }
30
30
  }
31
31
  }
32
+
33
+ &--with-text-end {
34
+ margin-inline-end: convert.to-rem(5px);
35
+ }
32
36
  }
33
37
 
34
38
  use {
@@ -16,7 +16,8 @@
16
16
  .osk-footer a,
17
17
  .mm-header a,
18
18
  .megamenu-header a,
19
- .tag
19
+ .tag,
20
+ small a
20
21
  ),
21
22
  .link {
22
23
  @include mixins.base();
@@ -3,17 +3,22 @@ import cx from "classnames";
3
3
 
4
4
  const CLASS_ROOT = "pill";
5
5
 
6
+ export const pillColors = ["white", "gray", "transparent"] as const;
7
+ export type PillColor = (typeof pillColors)[number];
8
+
6
9
  interface PillProps extends HTMLAttributes<HTMLSpanElement> {
7
10
  className?: string;
8
11
  children?: ReactNode;
9
- colorScheme?: "dark" | "light" | "transparent";
12
+ color?: PillColor;
10
13
  size?: "small" | "medium" | "large" | "xlarge" | "xxlarge";
14
+ colorScheme?: "light" | "dark";
11
15
  }
12
16
 
13
17
  const Pill: React.FC<PillProps> = ({
14
18
  className,
15
19
  children,
16
20
  size,
21
+ color,
17
22
  colorScheme,
18
23
  ...other
19
24
  }) => (
@@ -21,9 +26,9 @@ const Pill: React.FC<PillProps> = ({
21
26
  className={cx(
22
27
  CLASS_ROOT,
23
28
  {
24
- "is-dark": colorScheme === "dark",
29
+ [`${CLASS_ROOT}--${color}`]: color, // Only apply modifier if color is specified
25
30
  "is-light": colorScheme === "light",
26
- "is-transparent": colorScheme === "transparent",
31
+ "is-dark": colorScheme === "dark",
27
32
  [CLASS_ROOT + "--" + size]: size,
28
33
  },
29
34
  className,
@@ -1,10 +1,11 @@
1
1
  @use "../../../styles/tokens/color";
2
2
  @use "../../../styles/tools/convert";
3
+ @use "sass:map";
3
4
 
4
5
  $base: (
5
- background-color: var(--color-surface-contrast),
6
- color: var(--color-text-inverse),
7
6
  font-weight: bold,
7
+ background-color: map.get(color.$colors-dark, border-subtle),
8
+ color: color.$white,
8
9
  );
9
10
 
10
11
  $sizes: (
@@ -20,3 +21,18 @@ $sizes: (
20
21
  xxlarge: convert.to-rem(64px),
21
22
  ),
22
23
  );
24
+
25
+ $colors: (
26
+ "white": (
27
+ background-color: color.$white,
28
+ color: color.$black,
29
+ ),
30
+ "gray": (
31
+ background-color: var(--color-surface-subtle),
32
+ color: var(--color-text-default),
33
+ ),
34
+ "transparent": (
35
+ background-color: rgba(#ffffff, 0.5),
36
+ color: var(--color-text-default),
37
+ ),
38
+ );
@@ -1,15 +1,19 @@
1
1
  @use "../../../styles/tools/generate";
2
2
  @use "./config";
3
3
  @use "./mixins";
4
+ @use "sass:map";
4
5
 
5
6
  @layer components {
6
7
  .pill {
7
8
  @include mixins.base();
8
9
  @include mixins.sizes();
9
10
 
10
- &.is-transparent {
11
- color: var(--color-text-default);
12
- background-color: rgba(#ffffff, 0.5);
11
+ @each $colorName, $colorProps in config.$colors {
12
+ &--#{$colorName} {
13
+ @each $property, $value in $colorProps {
14
+ #{$property}: $value;
15
+ }
16
+ }
13
17
  }
14
18
  }
15
19
  }
@@ -18,15 +18,19 @@ const example = (
18
18
  Max 3 digits please. <Pill>123</Pill>
19
19
  </p>
20
20
  <p>
21
- <Pill colorScheme="transparent">T</Pill>
22
- <Pill colorScheme="dark">D</Pill>
23
- <Pill colorScheme="light">L</Pill>
21
+ <Pill color="transparent">T</Pill>
22
+ <Pill color="black">D</Pill>
23
+ <Pill color="white">L</Pill>
24
24
  </p>
25
25
  <p>
26
26
  <Pill size="small">S</Pill>
27
27
  <Pill size="medium">M</Pill>
28
28
  <Pill size="large">L</Pill>
29
29
  </p>
30
+ <p>
31
+ <Pill colorScheme="light">Light</Pill>
32
+ <Pill colorScheme="dark">Dark</Pill>
33
+ </p>
30
34
  </>
31
35
  );
32
36
 
@@ -35,25 +35,54 @@ describe("rendering Pill", () => {
35
35
  expect(getByTestId("test-id")).toHaveClass("pill--large");
36
36
  });
37
37
 
38
- it("has colorScheme class when colorScheme prop is set", () => {
38
+ it("has default black styling without modifier", () => {
39
+ const { getByTestId } = render(<Pill data-testid="test-id">pill</Pill>);
40
+ expect(getByTestId("test-id")).toHaveClass("pill");
41
+ expect(getByTestId("test-id")).not.toHaveClass("pill--black");
42
+ });
43
+
44
+ it("has white class when color is white", () => {
39
45
  const { getByTestId } = render(
40
- <Pill colorScheme="transparent" data-testid="test-id">
46
+ <Pill color="white" data-testid="test-id">
41
47
  pill
42
48
  </Pill>,
43
49
  );
44
- expect(getByTestId("test-id")).toHaveClass("is-transparent");
50
+ expect(getByTestId("test-id")).toHaveClass("pill--white");
45
51
  });
46
52
 
47
- it("has dark colorScheme class when colorScheme is dark", () => {
53
+ it("has gray class when color is gray", () => {
48
54
  const { getByTestId } = render(
49
- <Pill colorScheme="dark" data-testid="test-id">
55
+ <Pill color="gray" data-testid="test-id">
50
56
  pill
51
57
  </Pill>,
52
58
  );
53
- expect(getByTestId("test-id")).toHaveClass("is-dark");
59
+ expect(getByTestId("test-id")).toHaveClass("pill--gray");
54
60
  });
55
61
 
56
- it("has light colorScheme class when colorScheme is light", () => {
62
+ it("has transparent class when color is transparent", () => {
63
+ const { getByTestId } = render(
64
+ <Pill color="transparent" data-testid="test-id">
65
+ pill
66
+ </Pill>,
67
+ );
68
+ expect(getByTestId("test-id")).toHaveClass("pill--transparent");
69
+ });
70
+
71
+ it("supports all available colors", () => {
72
+ const colors = ["white", "gray", "transparent"];
73
+
74
+ colors.forEach((color) => {
75
+ const { getByTestId } = render(
76
+ <Pill color={color} data-testid={`test-${color}`}>
77
+ {color}
78
+ </Pill>,
79
+ );
80
+
81
+ expect(getByTestId(`test-${color}`)).toHaveClass(`pill--${color}`);
82
+ });
83
+ });
84
+
85
+ it("has is-light class when colorScheme is light", () => {
57
86
  const { getByTestId } = render(
58
87
  <Pill colorScheme="light" data-testid="test-id">
59
88
  pill
@@ -62,6 +91,15 @@ describe("rendering Pill", () => {
62
91
  expect(getByTestId("test-id")).toHaveClass("is-light");
63
92
  });
64
93
 
94
+ it("has is-dark class when colorScheme is dark", () => {
95
+ const { getByTestId } = render(
96
+ <Pill colorScheme="dark" data-testid="test-id">
97
+ pill
98
+ </Pill>,
99
+ );
100
+ expect(getByTestId("test-id")).toHaveClass("is-dark");
101
+ });
102
+
65
103
  it("passes other props", () => {
66
104
  const { getByTestId } = render(<Pill data-testid="test">Pill</Pill>);
67
105
  expect(getByTestId("test")).toBeInTheDocument();
@@ -1,38 +1,40 @@
1
- @use '../../../styles/tokens/space';
2
- @use '../../../styles/tokens/color';
1
+ @use "../../../styles/tokens/space";
2
+ @use "../../../styles/tokens/color";
3
3
 
4
4
  $spacing: (
5
5
  default: (
6
6
  default: (
7
- padding-top: space.get('large'),
8
- padding-bottom: space.get('large'),
7
+ padding-top: space.get("large"),
8
+ padding-bottom: space.get("large"),
9
9
  ),
10
10
  md: (
11
- padding-top: space.get('xlarge'),
12
- padding-bottom: space.get('xlarge'),
13
- )
11
+ padding-top: space.get("xlarge"),
12
+ padding-bottom: space.get("xlarge"),
13
+ ),
14
14
  ),
15
15
  small: (
16
16
  default: (
17
17
  padding-top: space.get(),
18
+ padding-bottom: space.get(),
18
19
  ),
19
20
  md: (
20
- padding-top: space.get('large'),
21
- )
21
+ padding-top: space.get("large"),
22
+ padding-bottom: space.get("large"),
23
+ ),
22
24
  ),
23
25
  xsmall: (
24
26
  default: (
25
- padding-top: space.get('small'),
26
- padding-bottom: space.get('small'),
27
+ padding-top: space.get("small"),
28
+ padding-bottom: space.get("small"),
27
29
  ),
28
30
  md: (
29
- padding-top: space.get('small'),
30
- padding-bottom: space.get('small'),
31
- )
31
+ padding-top: space.get("small"),
32
+ padding-bottom: space.get("small"),
33
+ ),
32
34
  ),
33
35
  );
34
36
 
35
37
  $stuck-image-spacing: (
36
- default: #{space.get('large') * -1},
37
- md: #{space.get('xlarge') * -1},
38
+ default: #{space.get("large") * -1},
39
+ md: #{space.get("xlarge") * -1},
38
40
  );
@@ -1,5 +1,6 @@
1
1
  import { Accordion, AccordionItem } from "./Accordion";
2
2
  import { Alert } from "./Alert";
3
+ import { AnchorNavigation } from "./AnchorNavigation";
3
4
  import { Tag, TagButton } from "./Tag";
4
5
  import { Bar, BarBreak, BarItem } from "./Bar";
5
6
  import {
@@ -94,6 +95,7 @@ export {
94
95
  Accordion,
95
96
  AccordionItem,
96
97
  Alert,
98
+ AnchorNavigation,
97
99
  Autocomplete,
98
100
  Bar,
99
101
  BarBreak,
@@ -117,6 +117,11 @@
117
117
  color: color.$black !important;
118
118
  }
119
119
 
120
+ .bg-accent {
121
+ background-color: var(--color-background-accent) !important;
122
+ color: var(--color-text-default) !important;
123
+ }
124
+
120
125
  .bg-accent1-blog {
121
126
  background-color: var(--color-background-accent1-blog) !important;
122
127
  color: var(--color-text-default) !important;
@@ -151,6 +151,12 @@
151
151
  border: 0;
152
152
  aspect-ratio: 1 / 1;
153
153
  }
154
+
155
+ .aspect-ratio-3-2 {
156
+ max-width: 100%;
157
+ border: 0;
158
+ aspect-ratio: 3 / 2;
159
+ }
154
160
  }
155
161
 
156
162
  @include aspect-ratio-classes;
@@ -171,6 +177,9 @@
171
177
  .d-inline-flex {
172
178
  display: inline-flex;
173
179
  }
180
+ .flex-column {
181
+ flex-direction: column;
182
+ }
174
183
  }
175
184
 
176
185
  @include display-classes;