@orangesk/orange-design-system 3.7.0 → 3.8.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/Alert/style.css +1 -1
- package/build/components/Alert/style.css.map +1 -1
- package/build/components/Bar/style.css +1 -1
- package/build/components/Bar/style.css.map +1 -1
- package/build/components/Drawer/style.css +2 -0
- package/build/components/Drawer/style.css.map +1 -0
- package/build/components/Megamenu/style.css +1 -1
- package/build/components/Megamenu/style.css.map +1 -1
- package/build/components/Modal/style.css +1 -1
- package/build/components/Modal/style.css.map +1 -1
- package/build/components/StatusIndicator/style.css +2 -0
- package/build/components/StatusIndicator/style.css.map +1 -0
- package/build/components/Table/style.css +1 -1
- package/build/components/Table/style.css.map +1 -1
- package/build/components/index.js +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/types/index.d.ts +55 -3
- 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.js +1 -1
- package/build/lib/footer.js.map +1 -1
- package/build/lib/megamenu.css +1 -1
- package/build/lib/megamenu.css.map +1 -1
- package/build/lib/megamenu.js +1 -1
- package/build/lib/megamenu.js.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/lib/utilities.css +1 -1
- package/build/lib/utilities.css.map +1 -1
- package/package.json +27 -27
- package/src/components/Alert/Alert.tsx +2 -2
- package/src/components/Alert/data.ts +8 -5
- package/src/components/Alert/styles/config.scss +4 -4
- package/src/components/Alert/styles/mixins.scss +8 -1
- package/src/components/Alert/tests/Alert.test.jsx +11 -1
- package/src/components/Bar/Bar.tsx +1 -1
- package/src/components/Bar/styles/config.scss +1 -0
- package/src/components/Bar/tests/Bar.unit.test.jsx +1 -1
- package/src/components/Carousel/Carousel.static.ts +103 -12
- package/src/components/Carousel/tests/Carousel.static.test.jsx +134 -0
- package/src/components/DocumentationSidebar/DocumentationSidebar.tsx +12 -4
- package/src/components/Drawer/Drawer.static.ts +281 -0
- package/src/components/Drawer/Drawer.tsx +82 -0
- package/src/components/Drawer/DrawerBody.tsx +21 -0
- package/src/components/Drawer/DrawerFooter.tsx +21 -0
- package/src/components/Drawer/DrawerHeader.tsx +21 -0
- package/src/components/Drawer/index.ts +5 -0
- package/src/components/Drawer/styles/config.scss +17 -0
- package/src/components/Drawer/styles/mixins.scss +119 -0
- package/src/components/Drawer/styles/style.scss +71 -0
- package/src/components/Drawer/tests/Drawer.unit.test.jsx +149 -0
- package/src/components/Forms/SegmentedControl/SegmentedControl.tsx +122 -0
- package/src/components/Forms/SegmentedControl/index.ts +5 -0
- package/src/components/Forms/SegmentedControl/styles/mixins.scss +52 -0
- package/src/components/Forms/SegmentedControl/styles/style.scss +35 -0
- package/src/components/Forms/SegmentedControl/tests/SegmentedControl.conformance.test.jsx +36 -0
- package/src/components/Forms/SegmentedControl/tests/SegmentedControl.unit.test.jsx +125 -0
- package/src/components/Forms/index.ts +1 -0
- package/src/components/Icon/index.ts +1 -0
- package/src/components/Megamenu/styles/mixins.scss +15 -14
- package/src/components/Modal/styles/config.scss +3 -2
- package/src/components/StatusIndicator/StatusIndicator.tsx +29 -0
- package/src/components/StatusIndicator/index.ts +2 -0
- package/src/components/StatusIndicator/styles/config.scss +12 -0
- package/src/components/StatusIndicator/styles/mixins.scss +36 -0
- package/src/components/StatusIndicator/styles/style.scss +16 -0
- package/src/components/StatusIndicator/tests/StatusIndicator.conformance.test.jsx +22 -0
- package/src/components/StatusIndicator/tests/StatusIndicator.unit.test.jsx +70 -0
- package/src/components/Table/Table.static.ts +23 -10
- package/src/components/Table/Table.tsx +7 -2
- package/src/components/Table/styles/mixins.scss +59 -0
- package/src/components/Table/styles/style.scss +25 -0
- package/src/components/Table/tests/Table.static.unit.test.jsx +72 -0
- package/src/components/Table/tests/Table.unit.test.jsx +33 -0
- package/src/components/index.ts +11 -0
- package/src/styles/tokens/overlay.scss +3 -0
- package/src/styles/typography/style.scss +0 -13
- package/src/styles/utilities/border.scss +4 -0
- package/src/styles/utilities/border.styles.unit.test.jsx +9 -0
- package/src/styles/utilities/text.scss +12 -0
- package/src/components/Carousel/CHANGELOG.md +0 -11
|
@@ -38,20 +38,39 @@
|
|
|
38
38
|
|
|
39
39
|
&--striped tbody tr:nth-of-type(odd) {
|
|
40
40
|
@include mixins.odd-row;
|
|
41
|
+
--table-pinned-column-background: var(--color-background-secondary);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
&--striped.background-secondary tbody tr:nth-of-type(odd),
|
|
44
45
|
.background-secondary &--striped tbody tr:nth-of-type(odd) {
|
|
45
46
|
background-color: config.$striped-color-on-secondary;
|
|
47
|
+
--table-pinned-column-background: var(--color-background-primary);
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
&--compact {
|
|
49
51
|
@include mixins.compact;
|
|
50
52
|
}
|
|
51
53
|
|
|
54
|
+
&--pinned-first-column {
|
|
55
|
+
@include mixins.pinned-first-column;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&--pinned-first-column.background-secondary,
|
|
59
|
+
.background-secondary &--pinned-first-column {
|
|
60
|
+
--table-pinned-column-background: var(--color-background-secondary);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&-scrollable--overflowing &--pinned-first-column tr > :first-child::after {
|
|
64
|
+
display: block;
|
|
65
|
+
}
|
|
66
|
+
|
|
52
67
|
&--responsive {
|
|
53
68
|
@include breakpoint.get("md", "down") {
|
|
54
69
|
@include mixins.responsive-table;
|
|
70
|
+
|
|
71
|
+
&.table--pinned-first-column {
|
|
72
|
+
@include mixins.unpin-first-column;
|
|
73
|
+
}
|
|
55
74
|
}
|
|
56
75
|
}
|
|
57
76
|
|
|
@@ -63,6 +82,12 @@
|
|
|
63
82
|
}
|
|
64
83
|
}
|
|
65
84
|
|
|
85
|
+
@include breakpoint.get("md", "down") {
|
|
86
|
+
&-scrollable:has(> &--responsive) {
|
|
87
|
+
@include mixins.responsive-scrollable-wrapper;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
66
91
|
&__sort-button {
|
|
67
92
|
@include mixins.sort-button;
|
|
68
93
|
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { afterEach, beforeEach, expect, it, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
import Table from "../Table.static";
|
|
4
|
+
|
|
5
|
+
let resizeCallback;
|
|
6
|
+
let observe;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
observe = vi.fn();
|
|
10
|
+
vi.stubGlobal(
|
|
11
|
+
"ResizeObserver",
|
|
12
|
+
vi.fn(function (callback) {
|
|
13
|
+
resizeCallback = callback;
|
|
14
|
+
this.observe = observe;
|
|
15
|
+
this.unobserve = vi.fn();
|
|
16
|
+
this.disconnect = vi.fn();
|
|
17
|
+
}),
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
afterEach(() => {
|
|
22
|
+
vi.unstubAllGlobals();
|
|
23
|
+
document.body.innerHTML = "";
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("does not make a responsive non-scrolling wrapper focusable", () => {
|
|
27
|
+
document.body.innerHTML = `
|
|
28
|
+
<div class="table-scrollable table-scrollable--overflowing" style="overflow-x: visible" tabindex="0">
|
|
29
|
+
<table class="table table--responsive"></table>
|
|
30
|
+
</div>
|
|
31
|
+
`;
|
|
32
|
+
const table = document.querySelector("table");
|
|
33
|
+
const scrollableRegion = document.querySelector(".table-scrollable");
|
|
34
|
+
Object.defineProperties(scrollableRegion, {
|
|
35
|
+
clientWidth: { configurable: true, value: 400 },
|
|
36
|
+
scrollWidth: { configurable: true, value: 800 },
|
|
37
|
+
});
|
|
38
|
+
new Table(table);
|
|
39
|
+
|
|
40
|
+
resizeCallback([{ target: table, contentRect: { width: 800 } }]);
|
|
41
|
+
|
|
42
|
+
expect(scrollableRegion).not.toHaveAttribute("tabindex");
|
|
43
|
+
expect(scrollableRegion).not.toHaveClass("table-scrollable--overflowing");
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("marks a horizontally overflowing wrapper", () => {
|
|
47
|
+
document.body.innerHTML = `
|
|
48
|
+
<div class="table-scrollable" style="overflow-x: auto">
|
|
49
|
+
<table class="table table--pinned-first-column"></table>
|
|
50
|
+
</div>
|
|
51
|
+
`;
|
|
52
|
+
const table = document.querySelector("table");
|
|
53
|
+
const scrollableRegion = document.querySelector(".table-scrollable");
|
|
54
|
+
Object.defineProperties(scrollableRegion, {
|
|
55
|
+
clientWidth: { configurable: true, value: 400 },
|
|
56
|
+
scrollWidth: { configurable: true, value: 800 },
|
|
57
|
+
});
|
|
58
|
+
const instance = new Table(table);
|
|
59
|
+
|
|
60
|
+
expect(observe).toHaveBeenCalledWith(table);
|
|
61
|
+
expect(observe).toHaveBeenCalledWith(scrollableRegion);
|
|
62
|
+
|
|
63
|
+
resizeCallback([{ target: table, contentRect: { width: 800 } }]);
|
|
64
|
+
|
|
65
|
+
expect(scrollableRegion).toHaveClass("table-scrollable--overflowing");
|
|
66
|
+
expect(scrollableRegion).toHaveAttribute("tabindex", "0");
|
|
67
|
+
|
|
68
|
+
instance.destroy();
|
|
69
|
+
|
|
70
|
+
expect(scrollableRegion).not.toHaveClass("table-scrollable--overflowing");
|
|
71
|
+
expect(scrollableRegion).not.toHaveAttribute("tabindex");
|
|
72
|
+
});
|
|
@@ -194,6 +194,39 @@ describe("rendering Table", () => {
|
|
|
194
194
|
expect(getByTestId("test-id")).toHaveClass("table");
|
|
195
195
|
expect(getByTestId("test-id")).toHaveClass("table--compact");
|
|
196
196
|
});
|
|
197
|
+
it("pins the first column and enables overflow handling when isFirstColumnPinned is passed", () => {
|
|
198
|
+
const { container, getByTestId } = render(
|
|
199
|
+
<Table
|
|
200
|
+
data-testid="test-id"
|
|
201
|
+
headers={[]}
|
|
202
|
+
rows={[]}
|
|
203
|
+
isFirstColumnPinned
|
|
204
|
+
/>,
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
expect(getByTestId("test-id")).toHaveClass("table--pinned-first-column");
|
|
208
|
+
expect(container.querySelector(".table-scrollable")).toContainElement(
|
|
209
|
+
getByTestId("test-id"),
|
|
210
|
+
);
|
|
211
|
+
});
|
|
212
|
+
it("labels the pinned-column scroll region with its caption", () => {
|
|
213
|
+
const { container } = render(
|
|
214
|
+
<Table
|
|
215
|
+
headers={[]}
|
|
216
|
+
rows={[]}
|
|
217
|
+
caption="Pinned table"
|
|
218
|
+
isFirstColumnPinned
|
|
219
|
+
/>,
|
|
220
|
+
);
|
|
221
|
+
const scrollableRegion = container.querySelector(".table-scrollable");
|
|
222
|
+
const caption = container.querySelector("caption");
|
|
223
|
+
|
|
224
|
+
expect(caption).toHaveAttribute(
|
|
225
|
+
"id",
|
|
226
|
+
scrollableRegion.getAttribute("aria-labelledby"),
|
|
227
|
+
);
|
|
228
|
+
expect(caption).toHaveTextContent("Pinned table");
|
|
229
|
+
});
|
|
197
230
|
it("renders div wrapper with class table-scrollable when isScrollable is passed", () => {
|
|
198
231
|
const { container } = render(
|
|
199
232
|
<Table headers={[]} rows={[]} isScrollable />,
|
package/src/components/index.ts
CHANGED
|
@@ -29,6 +29,7 @@ import { Controls } from "./Controls";
|
|
|
29
29
|
import { Countdown, CountdownTag } from "./Countdown";
|
|
30
30
|
import { Cover } from "./Cover";
|
|
31
31
|
import { Divider } from "./Divider";
|
|
32
|
+
import { Drawer, DrawerBody, DrawerFooter, DrawerHeader } from "./Drawer";
|
|
32
33
|
import {
|
|
33
34
|
Dropdown,
|
|
34
35
|
DropdownDivider,
|
|
@@ -50,6 +51,8 @@ import {
|
|
|
50
51
|
Message,
|
|
51
52
|
Radio,
|
|
52
53
|
RangeSlider,
|
|
54
|
+
SegmentedControl,
|
|
55
|
+
SegmentedControlItem,
|
|
53
56
|
Select,
|
|
54
57
|
SelectionTile,
|
|
55
58
|
TextArea,
|
|
@@ -89,6 +92,7 @@ import { Skeleton } from "./Skeleton";
|
|
|
89
92
|
import { SkipLink } from "./SkipLink";
|
|
90
93
|
import { SocialButton } from "./SocialButton";
|
|
91
94
|
import { StarRating } from "./StarRating";
|
|
95
|
+
import { StatusIndicator } from "./StatusIndicator";
|
|
92
96
|
import { Stepbar } from "./Stepbar";
|
|
93
97
|
import { Sticker } from "./Sticker";
|
|
94
98
|
import { Table } from "./Table";
|
|
@@ -135,6 +139,10 @@ export {
|
|
|
135
139
|
CountdownTag,
|
|
136
140
|
Cover,
|
|
137
141
|
Divider,
|
|
142
|
+
Drawer,
|
|
143
|
+
DrawerBody,
|
|
144
|
+
DrawerFooter,
|
|
145
|
+
DrawerHeader,
|
|
138
146
|
Dropdown,
|
|
139
147
|
DropdownDivider,
|
|
140
148
|
DropdownItem,
|
|
@@ -186,6 +194,8 @@ export {
|
|
|
186
194
|
Radio,
|
|
187
195
|
RangeSlider,
|
|
188
196
|
Section,
|
|
197
|
+
SegmentedControl,
|
|
198
|
+
SegmentedControlItem,
|
|
189
199
|
Select,
|
|
190
200
|
SelectionTile,
|
|
191
201
|
Skeleton,
|
|
@@ -194,6 +204,7 @@ export {
|
|
|
194
204
|
SpritePathContext,
|
|
195
205
|
SpritePathProvider,
|
|
196
206
|
StarRating,
|
|
207
|
+
StatusIndicator,
|
|
197
208
|
Stepbar,
|
|
198
209
|
Sticker,
|
|
199
210
|
Tab,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@use "../tools/generate";
|
|
2
2
|
@use "config" as *;
|
|
3
3
|
@use "mixins" as *;
|
|
4
|
-
@use "sass:map" as sass-map;
|
|
5
4
|
|
|
6
5
|
// Headings pre elementy h1, h2, h3 atď.
|
|
7
6
|
@include headings-base($headings, "h$", $heading-base);
|
|
@@ -16,18 +15,6 @@
|
|
|
16
15
|
@include body-text($body-text);
|
|
17
16
|
@include readability();
|
|
18
17
|
|
|
19
|
-
.caption {
|
|
20
|
-
@include generate.css-map(sass-map.get($caption, "default"));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.caption--small {
|
|
24
|
-
@include generate.css-map(sass-map.get($caption, "small"));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.caption--large {
|
|
28
|
-
@include generate.css-map(sass-map.get($caption, "large"));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
18
|
ol,
|
|
32
19
|
ul {
|
|
33
20
|
@include list-base();
|
|
@@ -67,6 +67,18 @@
|
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
.caption {
|
|
71
|
+
@include generate.css-map(map.get(typographyConfig.$caption, "default"));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.caption--small {
|
|
75
|
+
@include generate.css-map(map.get(typographyConfig.$caption, "small"));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.caption--large {
|
|
79
|
+
@include generate.css-map(map.get(typographyConfig.$caption, "large"));
|
|
80
|
+
}
|
|
81
|
+
|
|
70
82
|
.text-nowrap {
|
|
71
83
|
white-space: nowrap !important;
|
|
72
84
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
- **BREAKING**: Migrated `Carousel` component from Glider.js to Swiper.js library
|
|
2
|
-
- Replaced `@lighting-beetle/glider-js` dependency with `swiper`
|
|
3
|
-
- Updated `CarouselConfig` interface to extend `SwiperOptions` instead of Glider config
|
|
4
|
-
- Changed initialization from `new Glider()` to `new Swiper()` with required modules (Navigation, Pagination, Scrollbar, A11y)
|
|
5
|
-
- Updated prop name from `gliderOptions` to `swiperOptions` in React component
|
|
6
|
-
- Enhanced keyboard navigation support for pagination buttons (Arrow keys, Home/End, Tab navigation)
|
|
7
|
-
- Added tooltip position updates on slide changes for better tooltip integration
|
|
8
|
-
- Improved accessibility with proper ARIA attributes and Slovak language messages
|
|
9
|
-
- Updated slide classes from glider-specific to swiper-specific (`swiper-slide`, `swiper-wrapper`)
|
|
10
|
-
- Modified breakpoint configuration format to match Swiper's API
|
|
11
|
-
- Added automatic element detection and configuration for navigation, pagination, and scrollbar
|