@orangesk/orange-design-system 3.11.0 → 3.13.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/Carousel/style.css +1 -1
- package/build/components/Carousel/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/index.js +1 -1
- package/build/components/index.js.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/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/package.json +20 -21
- package/src/assets/icons/age-rating-3.svg +0 -0
- package/src/assets/icons/assistent.svg +0 -0
- package/src/assets/icons/boxes.svg +0 -0
- package/src/assets/icons/business-lounge.svg +0 -0
- package/src/assets/icons/calendar-30.svg +0 -0
- package/src/assets/icons/calendar-month.svg +0 -0
- package/src/assets/icons/communication-settings.svg +0 -0
- package/src/assets/icons/cookies.svg +0 -0
- package/src/assets/icons/currency-euro.svg +0 -0
- package/src/assets/icons/data-services.svg +0 -0
- package/src/assets/icons/device-mobile-package.svg +0 -0
- package/src/assets/icons/futher-education.svg +0 -0
- package/src/assets/icons/modifier-delete.svg +0 -0
- package/src/assets/icons/orange-experts-orange-business-consultant.svg +0 -0
- package/src/assets/icons/orange-messenger.svg +0 -0
- package/src/assets/icons/orange-reflect.svg +0 -0
- package/src/assets/icons/personal-smartphone-trainer.svg +0 -0
- package/src/assets/icons/unlimited-calls.svg +0 -0
- package/src/components/Carousel/styles/mixins.scss +8 -7
- package/src/components/Carousel/tests/Carousel.interactions.test.ts +133 -0
- package/src/components/Megamenu/styles/mixins.scss +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orangesk/orange-design-system",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.x"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@cloudfour/transition-hidden-element": "^2.0.2",
|
|
29
29
|
"@mdx-js/loader": "^3.1.1",
|
|
30
30
|
"@mdx-js/react": "^3.1.1",
|
|
31
|
-
"@next/mdx": "16.4.
|
|
31
|
+
"@next/mdx": "16.4.3",
|
|
32
32
|
"@orangesk/accessible-autocomplete": "3.2.2",
|
|
33
33
|
"@popperjs/core": "^2.11.8",
|
|
34
34
|
"@types/mdx": "^2.0.14",
|
|
@@ -37,42 +37,41 @@
|
|
|
37
37
|
"daypickr": "^0.3.4",
|
|
38
38
|
"diff2html": "^3.4.56",
|
|
39
39
|
"dompurify": "^3.4.17",
|
|
40
|
-
"html-react-parser": "6.1.
|
|
40
|
+
"html-react-parser": "6.1.9",
|
|
41
41
|
"lorem-ipsum": "3.0.0",
|
|
42
42
|
"minisearch": "7.2.0",
|
|
43
|
-
"next": "16.4.
|
|
43
|
+
"next": "16.4.3",
|
|
44
44
|
"normalize.css": "^8.0.1",
|
|
45
45
|
"nouislider": "^15.8.1",
|
|
46
46
|
"prism-react-renderer": "^2.4.1",
|
|
47
|
-
"
|
|
48
|
-
"react": "^19.3.
|
|
49
|
-
"react-dom": "^19.3.0",
|
|
47
|
+
"react": "^19.3.1",
|
|
48
|
+
"react-dom": "^19.3.1",
|
|
50
49
|
"react-element-to-jsx-string": "18.0.0",
|
|
51
|
-
"react-is": "^19.3.
|
|
50
|
+
"react-is": "^19.3.1",
|
|
52
51
|
"rehype-autolink-headings": "^7.1.0",
|
|
53
52
|
"rehype-slug": "^6.0.0",
|
|
54
53
|
"remark-gemoji": "^8.0.0",
|
|
55
54
|
"remark-gfm": "^4.0.1",
|
|
56
55
|
"swiper": "14.3.0",
|
|
57
|
-
"tabbable": "^6.5.
|
|
56
|
+
"tabbable": "^6.5.1",
|
|
58
57
|
"unescape-html": "^1.1.0",
|
|
59
58
|
"wnumb": "^1.2.0"
|
|
60
59
|
},
|
|
61
60
|
"devDependencies": {
|
|
62
|
-
"@babel/core": "8.0.
|
|
61
|
+
"@babel/core": "8.0.9",
|
|
63
62
|
"@babel/preset-env": "8.0.7",
|
|
64
63
|
"@babel/preset-react": "8.0.1",
|
|
65
64
|
"@babel/preset-typescript": "8.0.7",
|
|
66
65
|
"@biomejs/biome": "latest",
|
|
67
|
-
"@rollup/plugin-alias": "6.0.
|
|
66
|
+
"@rollup/plugin-alias": "6.0.1",
|
|
68
67
|
"@rollup/plugin-babel": "7.1.0",
|
|
69
68
|
"@rollup/plugin-commonjs": "29.0.3",
|
|
70
69
|
"@rollup/plugin-json": "^6.1.0",
|
|
71
70
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
72
|
-
"@rollup/plugin-terser": "1.0.
|
|
73
|
-
"@rollup/plugin-typescript": "^12.3.
|
|
71
|
+
"@rollup/plugin-terser": "1.0.2",
|
|
72
|
+
"@rollup/plugin-typescript": "^12.3.1",
|
|
74
73
|
"@rollup/plugin-url": "^8.0.2",
|
|
75
|
-
"@rollup/rollup-darwin-arm64": "^4.
|
|
74
|
+
"@rollup/rollup-darwin-arm64": "^4.65.0",
|
|
76
75
|
"@testing-library/dom": "^10.4.2",
|
|
77
76
|
"@testing-library/jest-dom": "7.0.1",
|
|
78
77
|
"@testing-library/react": "^16.3.3",
|
|
@@ -82,25 +81,25 @@
|
|
|
82
81
|
"@types/react-dom": "19.3.0",
|
|
83
82
|
"@types/wnumb": "^1.2.3",
|
|
84
83
|
"@vitejs/plugin-react": "6.1.2",
|
|
85
|
-
"@vitest/coverage-v8": "5.0.
|
|
86
|
-
"@vitest/ui": "5.0.
|
|
84
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
85
|
+
"@vitest/ui": "5.0.5",
|
|
87
86
|
"canvas": "^3.2.3",
|
|
88
87
|
"fs-extra": "^11.4.1",
|
|
89
88
|
"glob": "13.0.6",
|
|
90
|
-
"html-validate": "11.
|
|
89
|
+
"html-validate": "11.17.0",
|
|
91
90
|
"husky": "^9.1.7",
|
|
92
91
|
"identity-obj-proxy": "^3.0.0",
|
|
93
|
-
"jsdom": "30.1.
|
|
92
|
+
"jsdom": "30.1.3",
|
|
94
93
|
"lint-staged": "17.6.0",
|
|
95
94
|
"prettier": "^3.9.10",
|
|
96
|
-
"rollup": "^4.
|
|
95
|
+
"rollup": "^4.65.0",
|
|
97
96
|
"rollup-plugin-copy": "^3.5.0",
|
|
98
97
|
"rollup-plugin-dts": "^6.5.1",
|
|
99
98
|
"rollup-plugin-postcss": "^4.0.2",
|
|
100
|
-
"sass": "^1.
|
|
99
|
+
"sass": "^1.106.1",
|
|
101
100
|
"svg-sprite": "^2.0.4",
|
|
102
101
|
"typescript": "6.0.3",
|
|
103
|
-
"vitest": "5.0.
|
|
102
|
+
"vitest": "5.0.5",
|
|
104
103
|
"vitest-axe": "^0.1.0"
|
|
105
104
|
},
|
|
106
105
|
"lint-staged": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -35,13 +35,6 @@
|
|
|
35
35
|
min-width: 0;
|
|
36
36
|
width: 100%;
|
|
37
37
|
max-width: 100%;
|
|
38
|
-
margin-bottom: convert.to-rem(30px);
|
|
39
|
-
|
|
40
|
-
.carousel--scrollbar & {
|
|
41
|
-
@include breakpoint.get("md", "down") {
|
|
42
|
-
margin-bottom: convert.to-rem(20px);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
38
|
|
|
46
39
|
&.is-draggable {
|
|
47
40
|
user-select: none;
|
|
@@ -56,6 +49,7 @@
|
|
|
56
49
|
}
|
|
57
50
|
|
|
58
51
|
@mixin navigation {
|
|
52
|
+
margin-top: convert.to-rem(30px);
|
|
59
53
|
display: grid;
|
|
60
54
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
61
55
|
align-items: center;
|
|
@@ -217,8 +211,15 @@
|
|
|
217
211
|
}
|
|
218
212
|
|
|
219
213
|
@mixin scrollbar-base {
|
|
214
|
+
margin-top: convert.to-rem(30px);
|
|
220
215
|
position: relative;
|
|
221
216
|
overflow: visible;
|
|
217
|
+
|
|
218
|
+
.carousel--scrollbar & {
|
|
219
|
+
@include breakpoint.get("md", "down") {
|
|
220
|
+
margin-top: convert.to-rem(20px);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
222
223
|
}
|
|
223
224
|
|
|
224
225
|
@mixin scrollbar-horizontal {
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import CarouselHero from "../../CarouselHero/CarouselHero.static";
|
|
3
|
+
import CarouselPromotions from "../../CarouselPromotions/CarouselPromotions.static";
|
|
4
|
+
import Carousel from "../Carousel.static";
|
|
5
|
+
|
|
6
|
+
describe.each(
|
|
7
|
+
[
|
|
8
|
+
{ name: "Carousel", Module: Carousel, prefix: "carousel" },
|
|
9
|
+
{ name: "CarouselHero", Module: CarouselHero, prefix: "carousel-hero" },
|
|
10
|
+
{
|
|
11
|
+
name: "CarouselPromotions",
|
|
12
|
+
Module: CarouselPromotions,
|
|
13
|
+
prefix: "carousel-promotions",
|
|
14
|
+
},
|
|
15
|
+
].flatMap((component) =>
|
|
16
|
+
["defaults", "data attribute", "constructor"].map((source) => ({
|
|
17
|
+
...component,
|
|
18
|
+
source,
|
|
19
|
+
editorMode: source !== "defaults",
|
|
20
|
+
})),
|
|
21
|
+
),
|
|
22
|
+
)(
|
|
23
|
+
"$name pointer interactions with real Swiper ($source)",
|
|
24
|
+
({ Module, prefix, source, editorMode }) => {
|
|
25
|
+
let carousel: Carousel | CarouselHero | CarouselPromotions;
|
|
26
|
+
let icon: SVGElement;
|
|
27
|
+
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
vi.useFakeTimers();
|
|
30
|
+
document.body.innerHTML = `<div class="${prefix}" data-${prefix}>
|
|
31
|
+
<div class="${prefix}__viewport-wrapper"><div class="${prefix}__viewport"><div class="${prefix}__track">
|
|
32
|
+
<div class="${prefix}__slide"><a href="#card"><svg><path d="M0 0h10v10z" /></svg></a></div>
|
|
33
|
+
<div class="${prefix}__slide">Second</div><div class="${prefix}__slide">Third</div>
|
|
34
|
+
</div></div></div>
|
|
35
|
+
</div>`;
|
|
36
|
+
const element = document.body.firstElementChild as HTMLElement;
|
|
37
|
+
for (const node of [
|
|
38
|
+
element,
|
|
39
|
+
element.querySelector(`.${prefix}__viewport`)!,
|
|
40
|
+
]) {
|
|
41
|
+
Object.defineProperty(node, "clientWidth", { value: 600 });
|
|
42
|
+
Object.defineProperty(node, "clientHeight", { value: 200 });
|
|
43
|
+
}
|
|
44
|
+
const editorOptions = {
|
|
45
|
+
touchStartPreventDefault: false,
|
|
46
|
+
preventClicksPropagation: false,
|
|
47
|
+
};
|
|
48
|
+
if (source === "data attribute") {
|
|
49
|
+
element.setAttribute(
|
|
50
|
+
"data-swiper-options",
|
|
51
|
+
JSON.stringify(editorOptions),
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
carousel = new Module(element, {
|
|
55
|
+
loop: false,
|
|
56
|
+
breakpoints: {},
|
|
57
|
+
...(source === "constructor" ? editorOptions : {}),
|
|
58
|
+
});
|
|
59
|
+
vi.advanceTimersByTime(100);
|
|
60
|
+
icon = element.querySelector("path")!;
|
|
61
|
+
expect(carousel.instance.enabled).toBe(true);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
afterEach(() => {
|
|
65
|
+
carousel?.destroy();
|
|
66
|
+
vi.clearAllTimers();
|
|
67
|
+
vi.useRealTimers();
|
|
68
|
+
document.body.innerHTML = "";
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
function pointer(type: string, x: number, pointerType = "mouse") {
|
|
72
|
+
const event = new MouseEvent(type, {
|
|
73
|
+
bubbles: true,
|
|
74
|
+
cancelable: true,
|
|
75
|
+
clientX: x,
|
|
76
|
+
clientY: 20,
|
|
77
|
+
button: 0,
|
|
78
|
+
});
|
|
79
|
+
Object.assign(event, { pointerId: 1, pointerType });
|
|
80
|
+
icon.dispatchEvent(event);
|
|
81
|
+
return event;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
it.each(["mouse", "touch", "pen"])(
|
|
85
|
+
"applies the configured pointerdown behavior for %s",
|
|
86
|
+
(pointerType) => {
|
|
87
|
+
const onPointerDown = vi.fn();
|
|
88
|
+
carousel.element.addEventListener("pointerdown", onPointerDown);
|
|
89
|
+
const event = pointer("pointerdown", 400, pointerType);
|
|
90
|
+
expect(onPointerDown).toHaveBeenCalledOnce();
|
|
91
|
+
expect(event.defaultPrevented).toBe(!editorMode);
|
|
92
|
+
},
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
it("delivers an ordinary icon click without canceling it", () => {
|
|
96
|
+
const onClick = vi.fn();
|
|
97
|
+
carousel.element.addEventListener("click", onClick);
|
|
98
|
+
pointer("pointerdown", 400);
|
|
99
|
+
pointer("pointerup", 400);
|
|
100
|
+
const click = new MouseEvent("click", {
|
|
101
|
+
bubbles: true,
|
|
102
|
+
cancelable: true,
|
|
103
|
+
});
|
|
104
|
+
icon.dispatchEvent(click);
|
|
105
|
+
expect(onClick).toHaveBeenCalledOnce();
|
|
106
|
+
expect(click.defaultPrevented).toBe(false);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("keeps swipe navigation and link protection with configured click propagation", () => {
|
|
110
|
+
const onIconClick = vi.fn();
|
|
111
|
+
const onClick = vi.fn();
|
|
112
|
+
icon.addEventListener("click", onIconClick);
|
|
113
|
+
carousel.element.addEventListener("click", onClick);
|
|
114
|
+
// The initial translation is zero; jsdom cannot parse CSS transforms with DOMMatrixReadOnly.
|
|
115
|
+
carousel.instance.wrapperEl.style.transform = "none";
|
|
116
|
+
pointer("pointerdown", 400);
|
|
117
|
+
pointer("pointermove", 350);
|
|
118
|
+
pointer("pointermove", 100);
|
|
119
|
+
pointer("pointerup", 100);
|
|
120
|
+
expect(carousel.instance.activeIndex).toBe(1);
|
|
121
|
+
expect(carousel.instance.animating).toBe(true);
|
|
122
|
+
|
|
123
|
+
const click = new MouseEvent("click", {
|
|
124
|
+
bubbles: true,
|
|
125
|
+
cancelable: true,
|
|
126
|
+
});
|
|
127
|
+
icon.dispatchEvent(click);
|
|
128
|
+
expect(onIconClick).toHaveBeenCalledTimes(editorMode ? 1 : 0);
|
|
129
|
+
expect(onClick).toHaveBeenCalledTimes(editorMode ? 1 : 0);
|
|
130
|
+
expect(click.defaultPrevented).toBe(true);
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
);
|