@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.
- package/build/components/index.js +4 -4
- package/build/components/index.js.map +1 -1
- package/build/components/tsconfig.tsbuildinfo +1 -1
- package/build/components/types/index.d.ts +25 -7
- package/build/components/types/src/components/Card/Card.d.ts +1 -1
- package/build/components/types/src/components/Card/CardSection.d.ts +2 -2
- package/build/components/types/src/components/Expander/Expander.d.ts +2 -2
- package/build/components/types/src/components/Icon/iconSearchTags.d.ts +252 -251
- package/build/components/types/src/components/Pill/Pill.d.ts +4 -1
- package/build/components/types/src/components/index.d.ts +2 -1
- package/build/lib/after-components.css +1 -1
- package/build/lib/after-components.css.map +1 -1
- package/build/lib/components.css +1 -1
- package/build/lib/components.css.map +1 -1
- package/build/lib/megamenu.css +1 -1
- package/build/lib/megamenu.css.map +1 -1
- package/build/lib/style.css +1 -1
- package/build/lib/style.css.map +1 -1
- package/build/sprite.svg +1 -1
- package/package.json +5 -5
- package/src/assets/icons/article.svg +7 -0
- package/src/assets/icons/pictogram-activation--dark.svg +10 -11
- package/src/assets/icons/pictogram-activation-free--dark.svg +4 -5
- package/src/assets/icons/pictogram-activation-free.svg +4 -5
- package/src/assets/icons/pictogram-activation.svg +10 -11
- package/src/assets/icons/pictogram-archive--dark.svg +3 -4
- package/src/assets/icons/pictogram-archive.svg +3 -4
- package/src/assets/icons/pictogram-calling-minutes--dark.svg +3 -4
- package/src/assets/icons/pictogram-calling-minutes.svg +3 -4
- package/src/assets/icons/pictogram-canal-plus--dark.svg +3 -4
- package/src/assets/icons/pictogram-canal-plus.svg +3 -4
- package/src/assets/icons/pictogram-competition-tickets--dark.svg +11 -12
- package/src/assets/icons/pictogram-competition-tickets.svg +11 -12
- package/src/assets/icons/pictogram-device-discount--dark.svg +7 -6
- package/src/assets/icons/pictogram-device-discount.svg +5 -6
- package/src/assets/icons/pictogram-discount-general--dark.svg +5 -6
- package/src/assets/icons/pictogram-discount-general.svg +5 -6
- package/src/assets/icons/pictogram-discount-price--dark.svg +5 -6
- package/src/assets/icons/pictogram-discount-price.svg +5 -6
- package/src/assets/icons/pictogram-extra-data--dark.svg +6 -7
- package/src/assets/icons/pictogram-extra-data.svg +6 -7
- package/src/assets/icons/pictogram-free-payment--dark.svg +5 -6
- package/src/assets/icons/pictogram-free-payment.svg +3 -6
- package/src/assets/icons/pictogram-gift--dark.svg +12 -13
- package/src/assets/icons/pictogram-gift-one-benefit--dark.svg +7 -8
- package/src/assets/icons/pictogram-gift-one-benefit.svg +7 -8
- package/src/assets/icons/pictogram-gift-two-benefits--dark.svg +8 -9
- package/src/assets/icons/pictogram-gift-two-benefits.svg +8 -9
- package/src/assets/icons/pictogram-gift.svg +3 -4
- package/src/assets/icons/pictogram-hbo-max--dark.svg +5 -6
- package/src/assets/icons/pictogram-hbo-max.svg +5 -6
- package/src/assets/icons/pictogram-infinite-sms--dark.svg +3 -4
- package/src/assets/icons/pictogram-infinite-sms.svg +3 -4
- package/src/assets/icons/pictogram-installation--dark.svg +4 -5
- package/src/assets/icons/pictogram-installation-free--dark.svg +4 -5
- package/src/assets/icons/pictogram-installation-free.svg +4 -5
- package/src/assets/icons/pictogram-installation.svg +4 -5
- package/src/assets/icons/pictogram-max--dark.svg +3 -4
- package/src/assets/icons/pictogram-max-canal-plus--dark.svg +5 -6
- package/src/assets/icons/pictogram-max-canal-plus.svg +5 -6
- package/src/assets/icons/pictogram-max.svg +3 -4
- package/src/assets/icons/pictogram-moj-orange-app--dark.svg +3 -4
- package/src/assets/icons/pictogram-moj-orange-app.svg +3 -4
- package/src/assets/icons/pictogram-movie-storage--dark.svg +4 -5
- package/src/assets/icons/pictogram-movie-storage.svg +4 -5
- package/src/assets/icons/pictogram-online-protection--dark.svg +3 -4
- package/src/assets/icons/pictogram-online-protection.svg +3 -4
- package/src/assets/icons/pictogram-random-damage--dark.svg +4 -8
- package/src/assets/icons/pictogram-random-damage.svg +4 -8
- package/src/assets/icons/pictogram-recycling--dark.svg +7 -8
- package/src/assets/icons/pictogram-recycling.svg +14 -15
- package/src/assets/icons/pictogram-repair--dark.svg +12 -13
- package/src/assets/icons/pictogram-repair.svg +12 -13
- package/src/assets/icons/pictogram-roaming--dark.svg +3 -4
- package/src/assets/icons/pictogram-roaming-discount--dark.svg +3 -16
- package/src/assets/icons/pictogram-roaming-discount.svg +15 -16
- package/src/assets/icons/pictogram-roaming.svg +3 -4
- package/src/assets/icons/pictogram-skylink--dark.svg +10 -11
- package/src/assets/icons/pictogram-skylink-live-tv--dark.svg +7 -8
- package/src/assets/icons/pictogram-skylink-live-tv.svg +7 -8
- package/src/assets/icons/pictogram-skylink.svg +10 -11
- package/src/assets/icons/pictogram-sms--dark.svg +5 -6
- package/src/assets/icons/pictogram-sms.svg +5 -6
- package/src/assets/icons/pictogram-theft--dark.svg +3 -7
- package/src/assets/icons/pictogram-theft.svg +3 -7
- package/src/assets/icons/pictogram-three-devices--dark.svg +4 -8
- package/src/assets/icons/pictogram-three-devices.svg +4 -8
- package/src/assets/icons/pictogram-trust--dark.svg +3 -4
- package/src/assets/icons/pictogram-trust.svg +3 -4
- package/src/assets/icons/pictogram-water-damage--dark.svg +5 -6
- package/src/assets/icons/pictogram-water-damage.svg +5 -6
- package/src/components/Accordion/styles/config.scss +4 -4
- package/src/components/Accordion/styles/mixins.scss +2 -2
- package/src/components/AnchorNavigation/AnchorNavigation.tsx +24 -27
- package/src/components/AnchorNavigation/styles/mixins.scss +1 -11
- package/src/components/Card/Card.tsx +14 -1
- package/src/components/Card/CardSection.tsx +2 -10
- package/src/components/Card/styles/config.scss +1 -1
- package/src/components/Expander/Expander.tsx +4 -2
- package/src/components/Expander/styles/style.scss +7 -0
- package/src/components/Icon/iconSearchTags.ts +433 -432
- package/src/components/Icon/styles/style.scss +4 -0
- package/src/components/Link/styles/style.scss +2 -1
- package/src/components/Pill/Pill.tsx +8 -3
- package/src/components/Pill/styles/config.scss +18 -2
- package/src/components/Pill/styles/style.scss +7 -3
- package/src/components/Pill/tests/Pill.conformance.test.js +7 -3
- package/src/components/Pill/tests/Pill.unit.test.js +45 -7
- package/src/components/Section/styles/config.scss +18 -16
- package/src/components/index.ts +2 -0
- package/src/styles/utilities/color.scss +5 -0
- package/src/styles/utilities/layout.scss +9 -0
|
@@ -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
|
-
|
|
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
|
-
|
|
29
|
+
[`${CLASS_ROOT}--${color}`]: color, // Only apply modifier if color is specified
|
|
25
30
|
"is-light": colorScheme === "light",
|
|
26
|
-
"is-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
22
|
-
<Pill
|
|
23
|
-
<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
|
|
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
|
|
46
|
+
<Pill color="white" data-testid="test-id">
|
|
41
47
|
pill
|
|
42
48
|
</Pill>,
|
|
43
49
|
);
|
|
44
|
-
expect(getByTestId("test-id")).toHaveClass("
|
|
50
|
+
expect(getByTestId("test-id")).toHaveClass("pill--white");
|
|
45
51
|
});
|
|
46
52
|
|
|
47
|
-
it("has
|
|
53
|
+
it("has gray class when color is gray", () => {
|
|
48
54
|
const { getByTestId } = render(
|
|
49
|
-
<Pill
|
|
55
|
+
<Pill color="gray" data-testid="test-id">
|
|
50
56
|
pill
|
|
51
57
|
</Pill>,
|
|
52
58
|
);
|
|
53
|
-
expect(getByTestId("test-id")).toHaveClass("
|
|
59
|
+
expect(getByTestId("test-id")).toHaveClass("pill--gray");
|
|
54
60
|
});
|
|
55
61
|
|
|
56
|
-
it("has
|
|
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
|
|
2
|
-
@use
|
|
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(
|
|
8
|
-
padding-bottom: space.get(
|
|
7
|
+
padding-top: space.get("large"),
|
|
8
|
+
padding-bottom: space.get("large"),
|
|
9
9
|
),
|
|
10
10
|
md: (
|
|
11
|
-
padding-top: space.get(
|
|
12
|
-
padding-bottom: space.get(
|
|
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(
|
|
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(
|
|
26
|
-
padding-bottom: space.get(
|
|
27
|
+
padding-top: space.get("small"),
|
|
28
|
+
padding-bottom: space.get("small"),
|
|
27
29
|
),
|
|
28
30
|
md: (
|
|
29
|
-
padding-top: space.get(
|
|
30
|
-
padding-bottom: space.get(
|
|
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(
|
|
37
|
-
md: #{space.get(
|
|
38
|
+
default: #{space.get("large") * -1},
|
|
39
|
+
md: #{space.get("xlarge") * -1},
|
|
38
40
|
);
|
package/src/components/index.ts
CHANGED
|
@@ -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;
|