@orangesk/orange-design-system 3.6.1 → 3.6.2
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/BodyBanner/style.css +1 -1
- package/build/components/BodyBanner/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/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 +12 -12
- package/src/components/BodyBanner/styles/mixins.scss +7 -5
- package/src/components/Countdown/Countdown.shared.ts +5 -3
- package/src/components/Countdown/Countdown.static.ts +1 -1
- package/src/components/Countdown/tests/Countdown.static.test.jsx +19 -0
- package/src/components/Countdown/tests/CountdownTag.static.test.jsx +29 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orangesk/orange-design-system",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.x"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@cloudfour/transition-hidden-element": "^2.0.2",
|
|
28
28
|
"@mdx-js/loader": "^3.1.1",
|
|
29
29
|
"@mdx-js/react": "^3.1.1",
|
|
30
|
-
"@next/mdx": "16.3.
|
|
30
|
+
"@next/mdx": "16.3.4",
|
|
31
31
|
"@orangesk/accessible-autocomplete": "3.2.2",
|
|
32
32
|
"@popperjs/core": "^2.11.8",
|
|
33
33
|
"@types/mdx": "^2.0.14",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"html-react-parser": "6.1.7",
|
|
40
40
|
"lorem-ipsum": "3.0.0",
|
|
41
41
|
"minisearch": "7.2.0",
|
|
42
|
-
"next": "16.3.
|
|
42
|
+
"next": "16.3.4",
|
|
43
43
|
"normalize.css": "^8.0.1",
|
|
44
44
|
"nouislider": "^15.8.1",
|
|
45
45
|
"prism-react-renderer": "^2.4.1",
|
|
46
|
-
"query-string": "^9.5.
|
|
46
|
+
"query-string": "^9.5.1",
|
|
47
47
|
"react": "^19.2.8",
|
|
48
48
|
"react-dom": "^19.2.8",
|
|
49
49
|
"react-element-to-jsx-string": "^17.0.1",
|
|
@@ -71,16 +71,16 @@
|
|
|
71
71
|
"@rollup/plugin-terser": "1.0.0",
|
|
72
72
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
73
73
|
"@rollup/plugin-url": "^8.0.2",
|
|
74
|
-
"@rollup/rollup-darwin-arm64": "^4.63.
|
|
74
|
+
"@rollup/rollup-darwin-arm64": "^4.63.1",
|
|
75
75
|
"@testing-library/dom": "^10.4.1",
|
|
76
76
|
"@testing-library/jest-dom": "7.0.1",
|
|
77
|
-
"@testing-library/react": "^16.3.
|
|
78
|
-
"@testing-library/user-event": "^14.6.
|
|
79
|
-
"@types/node": "26.4.
|
|
77
|
+
"@testing-library/react": "^16.3.3",
|
|
78
|
+
"@testing-library/user-event": "^14.6.7",
|
|
79
|
+
"@types/node": "26.4.1",
|
|
80
80
|
"@types/react": "19.2.18",
|
|
81
81
|
"@types/react-dom": "19.2.5",
|
|
82
82
|
"@types/wnumb": "^1.2.3",
|
|
83
|
-
"@vitejs/plugin-react": "6.1.
|
|
83
|
+
"@vitejs/plugin-react": "6.1.1",
|
|
84
84
|
"@vitest/browser": "^4.1.11",
|
|
85
85
|
"@vitest/browser-playwright": "^4.1.11",
|
|
86
86
|
"@vitest/coverage-v8": "^4.1.11",
|
|
@@ -88,14 +88,14 @@
|
|
|
88
88
|
"canvas": "^3.2.3",
|
|
89
89
|
"fs-extra": "^11.4.0",
|
|
90
90
|
"glob": "13.0.6",
|
|
91
|
-
"html-validate": "11.
|
|
91
|
+
"html-validate": "11.12.0",
|
|
92
92
|
"husky": "^9.1.7",
|
|
93
93
|
"identity-obj-proxy": "^3.0.0",
|
|
94
94
|
"jsdom": "30.0.1",
|
|
95
|
-
"lint-staged": "17.
|
|
95
|
+
"lint-staged": "17.4.1",
|
|
96
96
|
"playwright": "^1.62.1",
|
|
97
97
|
"prettier": "^3.9.6",
|
|
98
|
-
"rollup": "^4.63.
|
|
98
|
+
"rollup": "^4.63.1",
|
|
99
99
|
"rollup-plugin-copy": "^3.5.0",
|
|
100
100
|
"rollup-plugin-dts": "^6.5.1",
|
|
101
101
|
"rollup-plugin-postcss": "^4.0.2",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
width: 100%;
|
|
55
55
|
display: flex;
|
|
56
56
|
padding: space.get("large");
|
|
57
|
-
gap: convert.to-rem(
|
|
57
|
+
gap: convert.to-rem(30px);
|
|
58
58
|
|
|
59
59
|
> div:not(.body-banner__button) {
|
|
60
60
|
flex: 1;
|
|
@@ -116,18 +116,20 @@
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
.body-banner__image {
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: flex-start;
|
|
121
|
+
justify-content: flex-end;
|
|
122
|
+
|
|
119
123
|
> * {
|
|
120
124
|
width: fit-content;
|
|
121
125
|
max-width: 100%;
|
|
122
|
-
height:
|
|
126
|
+
height: auto;
|
|
123
127
|
}
|
|
124
128
|
|
|
125
129
|
img {
|
|
126
130
|
width: 100%;
|
|
127
|
-
height:
|
|
131
|
+
height: auto;
|
|
128
132
|
max-height: none;
|
|
129
|
-
object-fit: cover;
|
|
130
|
-
object-position: center;
|
|
131
133
|
margin: 0 !important;
|
|
132
134
|
display: block;
|
|
133
135
|
}
|
|
@@ -106,6 +106,7 @@ export abstract class BaseCountdownStatic {
|
|
|
106
106
|
observer?: IntersectionObserver;
|
|
107
107
|
private instanceKey: string;
|
|
108
108
|
private defaultConfig: CountdownConfig;
|
|
109
|
+
private configOverrides: Partial<CountdownConfig>;
|
|
109
110
|
|
|
110
111
|
constructor(
|
|
111
112
|
element: HTMLElement,
|
|
@@ -118,6 +119,7 @@ export abstract class BaseCountdownStatic {
|
|
|
118
119
|
this.element = element;
|
|
119
120
|
this.defaultConfig = options.defaultConfig;
|
|
120
121
|
this.instanceKey = options.instanceKey;
|
|
122
|
+
this.configOverrides = { ...(config ?? {}) };
|
|
121
123
|
this.config = { ...options.defaultConfig, ...(config ?? {}) };
|
|
122
124
|
this.liveRegion = null;
|
|
123
125
|
|
|
@@ -183,7 +185,7 @@ export abstract class BaseCountdownStatic {
|
|
|
183
185
|
this.config = {
|
|
184
186
|
...this.defaultConfig,
|
|
185
187
|
...elementConfig,
|
|
186
|
-
...this.
|
|
188
|
+
...this.configOverrides,
|
|
187
189
|
};
|
|
188
190
|
|
|
189
191
|
this.liveRegion = this.getLiveRegion();
|
|
@@ -208,8 +210,8 @@ export abstract class BaseCountdownStatic {
|
|
|
208
210
|
this.stop();
|
|
209
211
|
this.observer?.disconnect();
|
|
210
212
|
this.destroyElements();
|
|
211
|
-
this.
|
|
212
|
-
...this.
|
|
213
|
+
this.configOverrides = {
|
|
214
|
+
...this.configOverrides,
|
|
213
215
|
...(config ?? {}),
|
|
214
216
|
};
|
|
215
217
|
this.init();
|
|
@@ -45,6 +45,25 @@ describe("Countdown static behavior", () => {
|
|
|
45
45
|
vi.useRealTimers();
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
+
it("sets all value layers on initial render", () => {
|
|
49
|
+
vi.useFakeTimers();
|
|
50
|
+
vi.setSystemTime(new Date("2026-07-24T00:00:00.000Z"));
|
|
51
|
+
|
|
52
|
+
const { container } = render(
|
|
53
|
+
<Countdown targetDate="2026-07-25T01:02:03.000Z" />,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const values = Array.from(
|
|
57
|
+
container
|
|
58
|
+
.querySelectorAll(".countdown__unit")[0]
|
|
59
|
+
.querySelectorAll(".countdown__value"),
|
|
60
|
+
).map((element) => element.textContent);
|
|
61
|
+
|
|
62
|
+
expect(values).toEqual(["01", "01", "01", "01"]);
|
|
63
|
+
|
|
64
|
+
vi.useRealTimers();
|
|
65
|
+
});
|
|
66
|
+
|
|
48
67
|
it("switches day label based on remaining value", () => {
|
|
49
68
|
vi.useFakeTimers();
|
|
50
69
|
vi.setSystemTime(new Date("2026-07-24T00:00:00.000Z"));
|
|
@@ -4,6 +4,35 @@ import { CountdownTag } from "../CountdownTag";
|
|
|
4
4
|
import CountdownTagStatic from "../CountdownTag.static";
|
|
5
5
|
|
|
6
6
|
describe("CountdownTag static behavior", () => {
|
|
7
|
+
it("initializes target date from data-countdown-config", () => {
|
|
8
|
+
vi.useFakeTimers();
|
|
9
|
+
vi.setSystemTime(new Date("2026-07-24T00:00:00.000Z"));
|
|
10
|
+
|
|
11
|
+
const element = document.createElement("div");
|
|
12
|
+
element.setAttribute(
|
|
13
|
+
"data-countdown-config",
|
|
14
|
+
JSON.stringify({
|
|
15
|
+
targetDate: "2026-07-24T00:00:59.000Z",
|
|
16
|
+
units: ["seconds"],
|
|
17
|
+
}),
|
|
18
|
+
);
|
|
19
|
+
element.innerHTML = `
|
|
20
|
+
<span data-countdown-unit="seconds">
|
|
21
|
+
<span data-countdown-tag-value="true">00</span>
|
|
22
|
+
<span class="countdown-tag__label"></span>
|
|
23
|
+
</span>
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
new CountdownTagStatic(element);
|
|
27
|
+
|
|
28
|
+
expect(
|
|
29
|
+
element.querySelector("[data-countdown-tag-value]"),
|
|
30
|
+
).toHaveTextContent("59");
|
|
31
|
+
|
|
32
|
+
CountdownTagStatic.getInstance(element)?.destroy();
|
|
33
|
+
vi.useRealTimers();
|
|
34
|
+
});
|
|
35
|
+
|
|
7
36
|
it("updates visible value from current time", () => {
|
|
8
37
|
vi.useFakeTimers();
|
|
9
38
|
vi.setSystemTime(new Date("2026-07-24T00:00:00.000Z"));
|