@orangesk/orange-design-system 2.2.0 → 3.0.0
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/Accordion/style.css +1 -1
- package/build/components/Accordion/style.css.map +1 -1
- package/build/components/Card/style.css +1 -1
- package/build/components/Card/style.css.map +1 -1
- package/build/components/CarouselHero/style.css +1 -1
- package/build/components/CarouselHero/style.css.map +1 -1
- package/build/components/Cover/style.css +1 -1
- package/build/components/Cover/style.css.map +1 -1
- package/build/components/FeatureAccordion/style.css +1 -1
- package/build/components/FeatureAccordion/style.css.map +1 -1
- package/build/components/Footer/style.css +1 -1
- package/build/components/Footer/style.css.map +1 -1
- package/build/components/IconList/style.css +1 -1
- package/build/components/IconList/style.css.map +1 -1
- package/build/components/Megamenu/style.css +1 -1
- package/build/components/Megamenu/style.css.map +1 -1
- package/build/components/PromoBanner/style.css +1 -1
- package/build/components/PromoBanner/style.css.map +1 -1
- package/build/components/Timeline/style.css +2 -0
- package/build/components/Timeline/style.css.map +1 -0
- package/build/components/index.js +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/tsconfig.tsbuildinfo +1 -1
- package/build/components/types/index.d.ts +30 -2
- package/build/components/types/src/components/FeatureAccordion/FeatureAccordion.d.ts +3 -0
- package/build/components/types/src/components/FeatureAccordion/FeatureAccordion.static.d.ts +0 -3
- package/build/components/types/src/components/FeatureAccordion/FeatureAccordionItem.d.ts +2 -1
- package/build/components/types/src/components/Timeline/Timeline.d.ts +13 -0
- package/build/components/types/src/components/Timeline/index.d.ts +2 -0
- package/build/components/types/src/components/index.d.ts +2 -1
- package/build/lib/base.css +1 -1
- package/build/lib/base.css.map +1 -1
- package/build/lib/components.css +1 -1
- package/build/lib/components.css.map +1 -1
- package/build/lib/footer.css +1 -1
- package/build/lib/footer.css.map +1 -1
- package/build/lib/megamenu.css +1 -1
- package/build/lib/megamenu.css.map +1 -1
- package/build/lib/scripts.js +1 -1
- package/build/lib/scripts.js.map +1 -1
- package/build/lib/style.css +1 -1
- package/build/lib/style.css.map +1 -1
- package/build/search-index.json +7 -3
- package/build/sprite.svg +1 -1
- package/package.json +8 -8
- package/src/assets/icons/pictogram-disney--dark.svg +5 -14
- package/src/assets/icons/pictogram-disney.svg +5 -9
- package/src/assets/icons/pictogram-tariffs--dark.svg +4 -8
- package/src/assets/icons/pictogram-tariffs.svg +4 -8
- package/src/components/Accordion/styles/mixins.scss +2 -4
- package/src/components/Card/styles/mixins.scss +2 -0
- package/src/components/CarouselHero/styles/mixins.scss +0 -2
- package/src/components/Cover/styles/mixins.scss +2 -0
- package/src/components/FeatureAccordion/FeatureAccordion.static.ts +3 -71
- package/src/components/FeatureAccordion/FeatureAccordion.tsx +23 -59
- package/src/components/FeatureAccordion/FeatureAccordionItem.tsx +9 -14
- package/src/components/FeatureAccordion/styles/mixins.scss +67 -23
- package/src/components/FeatureAccordion/tests/FeatureAccordion.unit.test.jsx +9 -0
- package/src/components/IconList/styles/mixins.scss +2 -1
- package/src/components/PromoBanner/styles/mixins.scss +2 -0
- package/src/components/Timeline/Timeline.tsx +60 -0
- package/src/components/Timeline/index.ts +2 -0
- package/src/components/Timeline/styles/config.scss +25 -0
- package/src/components/Timeline/styles/mixins.scss +102 -0
- package/src/components/Timeline/styles/style.scss +60 -0
- package/src/components/Timeline/tests/Timeline.conformance.test.jsx +29 -0
- package/src/components/Timeline/tests/Timeline.unit.test.jsx +89 -0
- package/src/components/index.ts +2 -0
- package/src/styles/typography/mixins.scss +3 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
@use "./config";
|
|
2
|
+
@use "../../../styles/tools/generate";
|
|
3
|
+
@use "../../../styles/tools/convert";
|
|
4
|
+
@use "../../../styles/tokens/breakpoint";
|
|
5
|
+
@use "../../../styles/tokens/space";
|
|
6
|
+
|
|
7
|
+
@mixin timeline() {
|
|
8
|
+
list-style: none;
|
|
9
|
+
margin: 0 0 space.get("large") 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@mixin item() {
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: config.$number-column-width minmax(0, 1fr);
|
|
16
|
+
column-gap: convert.to-rem(10px);
|
|
17
|
+
align-items: stretch;
|
|
18
|
+
padding-bottom: config.$item-spacing-bottom;
|
|
19
|
+
|
|
20
|
+
@include breakpoint.get("md") {
|
|
21
|
+
column-gap: convert.to-rem(20px);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@mixin item-last-child() {
|
|
26
|
+
padding-bottom: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@mixin number-column() {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
align-items: center;
|
|
33
|
+
width: config.$number-column-width;
|
|
34
|
+
grid-column: 1;
|
|
35
|
+
grid-row: 1 / span 3;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@mixin number() {
|
|
39
|
+
@include generate.responsive-css-map(config.$headline);
|
|
40
|
+
color: var(--color-text-accent);
|
|
41
|
+
display: block;
|
|
42
|
+
text-align: center;
|
|
43
|
+
margin: 0;
|
|
44
|
+
margin-top: config.$label-space;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@mixin number-first-item() {
|
|
48
|
+
margin-top: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@mixin line() {
|
|
52
|
+
flex: 1 1 auto;
|
|
53
|
+
width: config.$line-width;
|
|
54
|
+
background-color: var(--color-border-strong);
|
|
55
|
+
margin-bottom: convert.to-rem(-30px);
|
|
56
|
+
margin-top: config.$line-indent;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@mixin label() {
|
|
60
|
+
@include generate.responsive-css-map(config.$caption);
|
|
61
|
+
color: var(--color-text-default);
|
|
62
|
+
height: config.$label-slot-height;
|
|
63
|
+
min-height: config.$label-slot-height;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
margin: 0;
|
|
67
|
+
grid-column: 2;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@mixin label-spaced() {
|
|
71
|
+
margin-bottom: config.$label-gap;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@mixin empty-label() {
|
|
75
|
+
height: 0;
|
|
76
|
+
min-height: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@mixin headline() {
|
|
80
|
+
@include generate.responsive-css-map(config.$headline);
|
|
81
|
+
color: var(--color-text-default);
|
|
82
|
+
margin: 0 0 space.get("small");
|
|
83
|
+
grid-column: 2;
|
|
84
|
+
max-width: config.$content-max-width;
|
|
85
|
+
min-width: 0;
|
|
86
|
+
|
|
87
|
+
> :last-child {
|
|
88
|
+
margin-bottom: 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@mixin description() {
|
|
93
|
+
@include generate.responsive-css-map(config.$body);
|
|
94
|
+
color: var(--color-text-default);
|
|
95
|
+
grid-column: 2;
|
|
96
|
+
max-width: config.$content-max-width;
|
|
97
|
+
min-width: 0;
|
|
98
|
+
|
|
99
|
+
> :last-child {
|
|
100
|
+
margin-bottom: 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@use "./config";
|
|
2
|
+
@use "./mixins";
|
|
3
|
+
|
|
4
|
+
@layer components {
|
|
5
|
+
.timeline {
|
|
6
|
+
@include mixins.timeline();
|
|
7
|
+
|
|
8
|
+
&__item {
|
|
9
|
+
@include mixins.item();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&__item:last-child {
|
|
13
|
+
@include mixins.item-last-child();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__number-column {
|
|
17
|
+
@include mixins.number-column();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&__number {
|
|
21
|
+
@include mixins.number();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&__line {
|
|
25
|
+
@include mixins.line();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&__label {
|
|
29
|
+
@include mixins.label();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__item:not(:first-child) &__label {
|
|
33
|
+
@include mixins.label-spaced();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&__item:first-child &__number {
|
|
37
|
+
@include mixins.number-first-item();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&__item:first-child:has(.timeline__label:not(:empty)) &__number {
|
|
41
|
+
margin-top: config.$label-space;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&__item:first-child:has(.timeline__label:not(:empty)) &__label {
|
|
45
|
+
@include mixins.label-spaced();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&__item:first-child &__label:empty {
|
|
49
|
+
@include mixins.empty-label();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&__headline {
|
|
53
|
+
@include mixins.headline();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&__description {
|
|
57
|
+
@include mixins.description();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { render } from "@testing-library/react";
|
|
2
|
+
import { axe } from "vitest-axe";
|
|
3
|
+
|
|
4
|
+
import { Timeline } from "../";
|
|
5
|
+
|
|
6
|
+
const example = (
|
|
7
|
+
<Timeline
|
|
8
|
+
items={[
|
|
9
|
+
{
|
|
10
|
+
title: "Lorem ipsum dolor",
|
|
11
|
+
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
title: "Dolor sit amet",
|
|
15
|
+
description: "Sed do eiusmod tempor incididunt ut labore.",
|
|
16
|
+
},
|
|
17
|
+
]}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
it("is valid html", () => {
|
|
22
|
+
const { container } = render(example);
|
|
23
|
+
expect(container).toHTMLValidate();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("is accessible", async () => {
|
|
27
|
+
const { container } = render(example);
|
|
28
|
+
expect(await axe(container)).toHaveNoViolations();
|
|
29
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { render } from "@testing-library/react";
|
|
2
|
+
|
|
3
|
+
import { Timeline } from "../Timeline";
|
|
4
|
+
|
|
5
|
+
const items = [
|
|
6
|
+
{
|
|
7
|
+
title: "First item",
|
|
8
|
+
description: "First description",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
title: "Second item",
|
|
12
|
+
description: "Second description",
|
|
13
|
+
label: "June 2026",
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
describe("rendering Timeline", () => {
|
|
18
|
+
it("has default class timeline", () => {
|
|
19
|
+
const { getByTestId } = render(
|
|
20
|
+
<Timeline data-testid="test-id" items={items} />,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
expect(getByTestId("test-id")).toHaveClass("timeline");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("renders item for each timeline entry", () => {
|
|
27
|
+
const { container } = render(<Timeline items={items} />);
|
|
28
|
+
|
|
29
|
+
expect(container.getElementsByClassName("timeline__item")).toHaveLength(2);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("renders connector only for non-last items", () => {
|
|
33
|
+
const { container } = render(<Timeline items={items} />);
|
|
34
|
+
const renderedItems = container.getElementsByClassName("timeline__item");
|
|
35
|
+
|
|
36
|
+
expect(
|
|
37
|
+
renderedItems[0].getElementsByClassName("timeline__line"),
|
|
38
|
+
).toHaveLength(1);
|
|
39
|
+
expect(
|
|
40
|
+
renderedItems[1].getElementsByClassName("timeline__line"),
|
|
41
|
+
).toHaveLength(0);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("has additional class when className is set", () => {
|
|
45
|
+
const { getByTestId } = render(
|
|
46
|
+
<Timeline data-testid="test-id" items={items} className="test-class" />,
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
expect(getByTestId("test-id")).toHaveClass("timeline");
|
|
50
|
+
expect(getByTestId("test-id")).toHaveClass("test-class");
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("renders label slots for all items and visible text only for labeled items", () => {
|
|
54
|
+
const { container, getByText } = render(<Timeline items={items} />);
|
|
55
|
+
const renderedLabels = container.getElementsByClassName("timeline__label");
|
|
56
|
+
|
|
57
|
+
expect(renderedLabels).toHaveLength(2);
|
|
58
|
+
expect(getByText("June 2026")).toBeInTheDocument();
|
|
59
|
+
expect(renderedLabels[0].textContent).toBe("");
|
|
60
|
+
expect(renderedLabels[1].textContent).toBe("June 2026");
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("uses start prop for visible numbering", () => {
|
|
64
|
+
const { container } = render(<Timeline items={items} start={4} />);
|
|
65
|
+
const renderedNumbers =
|
|
66
|
+
container.getElementsByClassName("timeline__number");
|
|
67
|
+
|
|
68
|
+
expect(renderedNumbers[0].textContent).toBe("4");
|
|
69
|
+
expect(renderedNumbers[1].textContent).toBe("5");
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("renders `h3` headlines by default", () => {
|
|
73
|
+
const { container } = render(<Timeline items={items} />);
|
|
74
|
+
const renderedHeadlines = container.querySelectorAll(
|
|
75
|
+
"h3.timeline__headline",
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
expect(renderedHeadlines).toHaveLength(2);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("renders custom headline tag when titleTag is set", () => {
|
|
82
|
+
const { container } = render(<Timeline items={items} titleTag="h4" />);
|
|
83
|
+
const renderedHeadlines = container.querySelectorAll(
|
|
84
|
+
"h4.timeline__headline",
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
expect(renderedHeadlines).toHaveLength(2);
|
|
88
|
+
});
|
|
89
|
+
});
|
package/src/components/index.ts
CHANGED
|
@@ -92,6 +92,7 @@ import { Tab, TabPanel, Tabs } from "./Tabs";
|
|
|
92
92
|
import { Tag, TagButton } from "./Tag";
|
|
93
93
|
import { Testimonial } from "./Testimonial";
|
|
94
94
|
import { Tile } from "./Tile";
|
|
95
|
+
import { Timeline } from "./Timeline";
|
|
95
96
|
import { InfoTooltip, Tooltip } from "./Tooltip";
|
|
96
97
|
|
|
97
98
|
export {
|
|
@@ -196,5 +197,6 @@ export {
|
|
|
196
197
|
TextArea,
|
|
197
198
|
TextInput,
|
|
198
199
|
Tile,
|
|
200
|
+
Timeline,
|
|
199
201
|
Tooltip,
|
|
200
202
|
};
|
|
@@ -129,9 +129,11 @@
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
@mixin list-spacing($space, $config: config.$list-spacing) {
|
|
132
|
-
> *:where(li) {
|
|
132
|
+
> *:where(li):not(:last-child) {
|
|
133
133
|
margin-bottom: map.get($config, $space);
|
|
134
|
+
}
|
|
134
135
|
|
|
136
|
+
> *:where(li) {
|
|
135
137
|
> *:where(ul, ol) {
|
|
136
138
|
margin-top: map.get($config, $space);
|
|
137
139
|
}
|