@orangesk/orange-design-system 2.0.0-beta.6 → 2.0.0-beta.8
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 +24 -5
- package/build/components/types/src/components/AnchorNavigation/AnchorNavigation.d.ts +1 -1
- package/build/components/types/src/components/AnchorNavigation/AnchorNavigation.static.d.ts +19 -17
- package/build/components/types/src/components/Card/Card.d.ts +1 -1
- package/build/components/types/src/components/Expander/Expander.d.ts +2 -2
- package/build/components/types/src/components/Megamenu/constants.d.ts +2 -0
- 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/components/types/src/scripts/index.d.ts +5 -0
- package/build/lib/after-components.css +1 -1
- package/build/lib/after-components.css.map +1 -1
- package/build/lib/before-components.css +1 -1
- package/build/lib/before-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/megamenu.js +1 -1
- package/build/lib/megamenu.js.map +1 -1
- package/build/lib/scripts.js +4 -4
- 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/tsconfig.tsbuildinfo +1 -1
- package/build/sprite.svg +1 -1
- package/package.json +13 -13
- package/src/assets/icons/article.svg +4 -4
- package/src/components/Accordion/styles/config.scss +4 -4
- package/src/components/Accordion/styles/mixins.scss +2 -2
- package/src/components/AnchorNavigation/AnchorNavigation.static.ts +253 -73
- package/src/components/AnchorNavigation/AnchorNavigation.tsx +20 -16
- package/src/components/AnchorNavigation/styles/mixins.scss +14 -27
- package/src/components/AnchorNavigation/tests/AnchorNavigation.conformance.test.js +67 -0
- package/src/components/AnchorNavigation/tests/AnchorNavigation.unit.test.js +163 -0
- package/src/components/BlockAction/styles/mixins.scss +0 -6
- package/src/components/Card/Card.tsx +1 -0
- 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/Link/styles/style.scss +1 -1
- package/src/components/Link/tests/Link.conformance.test.js +5 -20
- package/src/components/Link/tests/Link.unit.test.js +1 -10
- package/src/components/Megamenu/Megamenu.static.ts +2 -0
- package/src/components/Megamenu/Megamenu.tsx +671 -665
- package/src/components/Megamenu/MegamenuBlog.tsx +187 -183
- package/src/components/Megamenu/constants.ts +2 -0
- package/src/components/Megamenu/styles/mixins.scss +30 -1
- package/src/components/Megamenu/styles/style.scss +8 -0
- 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/index.ts +2 -0
- package/src/styles/base/globals.scss +18 -0
- package/src/styles/utilities/color.scss +4 -0
|
@@ -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();
|
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,
|
|
@@ -28,8 +28,26 @@
|
|
|
28
28
|
color: var(--color-text-default);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
:root {
|
|
32
|
+
--extra-scroll-margin: 0;
|
|
33
|
+
--header-height: 80px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media screen and (min-width: 992px) {
|
|
37
|
+
:root {
|
|
38
|
+
--header-height: 120px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:target {
|
|
43
|
+
scroll-margin-top: calc(
|
|
44
|
+
var(--header-height) + var(--extra-scroll-margin) - 1px
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
31
48
|
html {
|
|
32
49
|
font-size: base.$font-size;
|
|
50
|
+
scroll-padding-top: unset;
|
|
33
51
|
}
|
|
34
52
|
|
|
35
53
|
html,
|
|
@@ -75,6 +75,10 @@
|
|
|
75
75
|
background-color: var(--color-surface-subtle) !important;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
.bg-gray-lighter {
|
|
79
|
+
background-color: var(--color-background-secondary) !important;
|
|
80
|
+
}
|
|
81
|
+
|
|
78
82
|
.bg-blue {
|
|
79
83
|
background-color: var(--color-fill-accent1) !important;
|
|
80
84
|
// TODO: replace with new token when available
|