@orangesk/orange-design-system 2.0.0-beta.47 → 2.0.0-beta.49
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/BlockAction/style.css +1 -1
- package/build/components/BlockAction/style.css.map +1 -1
- package/build/components/Breadcrumbs/style.css +1 -1
- package/build/components/Breadcrumbs/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/DocumentationSidebar/style.css +1 -1
- package/build/components/DocumentationSidebar/style.css.map +1 -1
- package/build/components/Icon/style.css +1 -1
- package/build/components/Icon/style.css.map +1 -1
- package/build/components/Loader/style.css +1 -1
- package/build/components/Loader/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/Pagination/style.css +1 -1
- package/build/components/Pagination/style.css.map +1 -1
- package/build/components/PromotionCard/style.css +1 -1
- package/build/components/PromotionCard/style.css.map +1 -1
- package/build/components/Section/style.css +1 -1
- package/build/components/Section/style.css.map +1 -1
- package/build/components/SocialButton/style.css +1 -1
- package/build/components/SocialButton/style.css.map +1 -1
- package/build/components/Stepbar/style.css +1 -1
- package/build/components/Stepbar/style.css.map +1 -1
- package/build/components/Table/style.css +1 -1
- package/build/components/Table/style.css.map +1 -1
- package/build/components/Tag/style.css +1 -1
- package/build/components/Tag/style.css.map +1 -1
- package/build/components/Tile/style.css +1 -1
- package/build/components/Tile/style.css.map +1 -1
- 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 +5 -11
- package/build/components/types/src/components/Carousel/Carousel.static.d.ts +4 -1
- package/build/components/types/src/components/CarouselHero/CarouselHero.d.ts +1 -0
- package/build/components/types/src/components/Forms/Autocomplete/Autocomplete.static.d.ts +11 -0
- package/build/components/types/src/components/Forms/Group/Group.d.ts +1 -1
- package/build/components/types/src/components/Tile/Tile.d.ts +3 -11
- 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/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/lib/tsconfig.tsbuildinfo +1 -1
- package/build/lib/utilities.css +1 -1
- package/build/lib/utilities.css.map +1 -1
- package/build/search-index.json +5 -5
- package/package.json +21 -21
- package/src/components/BlockAction/styles/style.scss +6 -4
- package/src/components/Breadcrumbs/styles/style.scss +2 -1
- package/src/components/Card/styles/config.scss +1 -1
- package/src/components/Carousel/Carousel.static.ts +29 -1
- package/src/components/Carousel/tests/Carousel.static.test.jsx +50 -0
- package/src/components/CarouselHero/CarouselHero.static.ts +7 -0
- package/src/components/CarouselHero/CarouselHero.tsx +61 -3
- package/src/components/CarouselHero/tests/CarouselHero.unit.test.jsx +31 -1
- package/src/components/DocumentationSidebar/DocumentationSidebar.tsx +21 -34
- package/src/components/DocumentationSidebar/styles/style.scss +0 -6
- package/src/components/Forms/Autocomplete/Autocomplete.static.ts +190 -14
- package/src/components/Forms/Autocomplete/styles/style.scss +61 -8
- package/src/components/Forms/Autocomplete/tests/Autocomplete.static.test.ts +187 -0
- package/src/components/Forms/DatePicker/styles/style.scss +1 -2
- package/src/components/Forms/Group/Group.tsx +4 -1
- package/src/components/Forms/Group/styles/config.scss +1 -1
- package/src/components/Forms/Group/styles/mixins.scss +17 -0
- package/src/components/Forms/Group/tests/Group.unit.test.jsx +9 -0
- package/src/components/Forms/TextArea/styles/config.scss +1 -0
- package/src/components/Forms/TextArea/styles/mixins.scss +7 -1
- package/src/components/Forms/TextInput/styles/config.scss +3 -1
- package/src/components/Forms/TextInput/styles/mixins.scss +7 -1
- package/src/components/Forms/TextInput/styles/style.scss +17 -12
- package/src/components/Forms/styles/config.scss +3 -2
- package/src/components/Icon/styles/style.scss +2 -1
- package/src/components/Loader/styles/style.scss +0 -2
- package/src/components/Pagination/styles/mixins.scss +8 -6
- package/src/components/Pagination/styles/style.scss +0 -4
- package/src/components/Preview/PreviewGenerator.tsx +15 -2
- package/src/components/PromotionCard/styles/mixins.scss +2 -1
- package/src/components/Section/styles/mixins.scss +27 -5
- package/src/components/SocialButton/styles/config.scss +2 -2
- package/src/components/Stepbar/styles/style.scss +4 -2
- package/src/components/Table/styles/mixins.scss +6 -3
- package/src/components/Tag/styles/config.scss +1 -1
- package/src/components/Tag/styles/style.scss +22 -5
- package/src/components/Tile/Tile.tsx +18 -42
- package/src/components/Tile/styles/mixins.scss +55 -45
- package/src/components/Tile/styles/style.scss +5 -17
- package/src/components/Tile/tests/Tile.unit.test.jsx +9 -78
- package/src/styles/tokens/color-vars.scss +0 -2
- package/src/styles/utilities/color.scss +0 -153
- package/src/components/Tile/CHANGELOG.md +0 -28
- package/src/components/Tile/styles/config.scss +0 -7
|
@@ -39,15 +39,32 @@
|
|
|
39
39
|
border-radius: 0 !important;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
> *:not(:first-child):not(:last-child) .autocomplete__input {
|
|
43
|
+
border-radius: 0 !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
42
46
|
> *:first-child:not(:last-child) {
|
|
43
47
|
border-top-right-radius: 0 !important;
|
|
44
48
|
border-bottom-right-radius: 0 !important;
|
|
45
49
|
}
|
|
46
50
|
|
|
51
|
+
> *:first-child:not(:last-child) .autocomplete__input,
|
|
52
|
+
> *:has(+ .autocomplete[style*="display: none"] + *) .autocomplete__input {
|
|
53
|
+
border-top-right-radius: 0 !important;
|
|
54
|
+
border-bottom-right-radius: 0 !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
47
57
|
> *:last-child:not(:first-child) {
|
|
48
58
|
border-top-left-radius: 0 !important;
|
|
49
59
|
border-bottom-left-radius: 0 !important;
|
|
50
60
|
}
|
|
61
|
+
|
|
62
|
+
> *:last-child:not(:first-child) .autocomplete__input,
|
|
63
|
+
> *:not(:first-child):has(+ .autocomplete[style*="display: none"])
|
|
64
|
+
.autocomplete__input {
|
|
65
|
+
border-top-left-radius: 0 !important;
|
|
66
|
+
border-bottom-left-radius: 0 !important;
|
|
67
|
+
}
|
|
51
68
|
}
|
|
52
69
|
|
|
53
70
|
@mixin item($config: config.$item) {
|
|
@@ -109,6 +109,15 @@ describe("rendering Group", () => {
|
|
|
109
109
|
);
|
|
110
110
|
expect(container.getElementsByClassName("select").length).toBe(1);
|
|
111
111
|
});
|
|
112
|
+
it("renders Autocomplete component (autocomplete class) when control type is set to autocomplete", () => {
|
|
113
|
+
const { container } = render(
|
|
114
|
+
<Group
|
|
115
|
+
data-testid="test-id"
|
|
116
|
+
control={{ type: "autocomplete", options: ["", "apple"] }}
|
|
117
|
+
/>,
|
|
118
|
+
);
|
|
119
|
+
expect(container.getElementsByClassName("autocomplete").length).toBe(1);
|
|
120
|
+
});
|
|
112
121
|
it("addonPrefix Item has class control-group__item--large when size is set to large", () => {
|
|
113
122
|
const { container } = render(
|
|
114
123
|
<Group
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
@include generate.css-map($config, "disabled");
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
&:read-only {
|
|
25
|
+
&:read-only:not(:disabled) {
|
|
26
26
|
@include generate.css-map($config, "readonly");
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -30,6 +30,12 @@
|
|
|
30
30
|
@include generate.css-map($config, "invalid");
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
&::placeholder {
|
|
34
|
+
@include generate.css-map($config, "placeholder");
|
|
35
|
+
|
|
36
|
+
opacity: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
33
39
|
&.is-valid {
|
|
34
40
|
padding-right: 36px;
|
|
35
41
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 15 15'%3E%3Cpath d='M7.5,15 C3.35786438,15 0,11.6421356 0,7.5 C0,3.35786438 3.35786438,0 7.5,0 C11.6421356,0 15,3.35786438 15,7.5 C15,11.6421356 11.6421356,15 7.5,15 Z M3.40550597,6.68901229 C2.99100286,7.0539857 2.95085113,7.6858763 3.31582458,8.1003794 L5.77477826,10.8930318 C6.1397517,11.3075349 6.7716423,11.3476866 7.18614541,10.9827132 C7.20478962,10.9662968 7.22281563,10.9491914 7.24018594,10.9314326 L11.8941565,6.17336831 C12.2803381,5.7785491 12.2733359,5.14542284 11.8785167,4.75924123 C11.4836975,4.37305961 10.8505712,4.38006176 10.4643896,4.77488097 L7.31720124,7.9924615 C6.93101963,8.3872807 6.29789337,8.3942828 5.90307416,8.0081012 C5.88531533,7.9907309 5.86820993,7.9727049 5.85179355,7.9540607 L4.81687313,6.77869369 C4.45189969,6.36419058 3.82000909,6.32403885 3.40550597,6.68901229 Z' fill='%2332c832' /%3E%3C/svg%3E");
|
|
@@ -25,6 +25,7 @@ $states: (
|
|
|
25
25
|
disabled: commonConfig.$disabled,
|
|
26
26
|
readonly: commonConfig.$readonly,
|
|
27
27
|
invalid: commonConfig.$invalid,
|
|
28
|
+
placeholder: commonConfig.$placeholder,
|
|
28
29
|
);
|
|
29
30
|
|
|
30
31
|
$sizes: (
|
|
@@ -57,4 +58,5 @@ $widths: (
|
|
|
57
58
|
),
|
|
58
59
|
);
|
|
59
60
|
|
|
60
|
-
$background-image-search-icon: url('data:image/svg+xml,<svg
|
|
61
|
+
$background-image-search-icon: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.5 0C13.1944 1.026e-07 17 3.80558 17 8.5C17 10.3053 16.4363 11.9785 15.4766 13.355L19.4248 17.3032L17.3032 19.4248L13.3555 15.4766C11.9789 16.4364 10.3054 17 8.5 17C3.80558 17 -1.026e-07 13.1944 0 8.5C1.026e-07 3.80558 3.80558 -1.026e-07 8.5 0ZM8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C11.5376 14 14 11.5376 14 8.5C14 5.46243 11.5376 3 8.5 3Z" fill="%23F15E00"/></svg>');
|
|
62
|
+
$mask-image-search-icon: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.5 0C13.1944 1.026e-07 17 3.80558 17 8.5C17 10.3053 16.4363 11.9785 15.4766 13.355L19.4248 17.3032L17.3032 19.4248L13.3555 15.4766C11.9789 16.4364 10.3054 17 8.5 17C3.80558 17 -1.026e-07 13.1944 0 8.5C1.026e-07 3.80558 3.80558 -1.026e-07 8.5 0ZM8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C11.5376 14 14 11.5376 14 8.5C14 5.46243 11.5376 3 8.5 3Z" fill="%23000"/></svg>');
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
@include generate.css-map($config, "disabled");
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
&:read-only {
|
|
27
|
+
&:read-only:not(:disabled) {
|
|
28
28
|
@include generate.css-map($config, "readonly");
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
@include generate.css-map($config, "invalid");
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
&::placeholder {
|
|
36
|
+
@include generate.css-map($config, "placeholder");
|
|
37
|
+
|
|
38
|
+
opacity: 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
&.is-valid {
|
|
36
42
|
padding-right: convert.to-rem(36px);
|
|
37
43
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 15 15'%3E%3Cpath d='M7.5,15 C3.35786438,15 0,11.6421356 0,7.5 C0,3.35786438 3.35786438,0 7.5,0 C11.6421356,0 15,3.35786438 15,7.5 C15,11.6421356 11.6421356,15 7.5,15 Z M3.40550597,6.68901229 C2.99100286,7.0539857 2.95085113,7.6858763 3.31582458,8.1003794 L5.77477826,10.8930318 C6.1397517,11.3075349 6.7716423,11.3476866 7.18614541,10.9827132 C7.20478962,10.9662968 7.22281563,10.9491914 7.24018594,10.9314326 L11.8941565,6.17336831 C12.2803381,5.7785491 12.2733359,5.14542284 11.8785167,4.75924123 C11.4836975,4.37305961 10.8505712,4.38006176 10.4643896,4.77488097 L7.31720124,7.9924615 C6.93101963,8.3872807 6.29789337,8.3942828 5.90307416,8.0081012 C5.88531533,7.9907309 5.86820993,7.9727049 5.85179355,7.9540607 L4.81687313,6.77869369 C4.45189969,6.36419058 3.82000909,6.32403885 3.40550597,6.68901229 Z' fill='%2332c832' /%3E%3C/svg%3E");
|
|
@@ -38,29 +38,34 @@
|
|
|
38
38
|
content: "";
|
|
39
39
|
position: absolute;
|
|
40
40
|
top: 50%;
|
|
41
|
-
left: 0.
|
|
41
|
+
left: 0.625rem;
|
|
42
42
|
width: 1.25rem;
|
|
43
43
|
height: 1.25rem;
|
|
44
44
|
transform: translateY(-50%);
|
|
45
|
-
background-
|
|
46
|
-
|
|
45
|
+
background-color: var(--color-icon-brand);
|
|
46
|
+
mask-image: config.$mask-image-search-icon;
|
|
47
|
+
mask-position: center;
|
|
48
|
+
mask-repeat: no-repeat;
|
|
49
|
+
mask-size: contain;
|
|
47
50
|
pointer-events: none;
|
|
48
51
|
z-index: 1;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
> .text-input {
|
|
52
|
-
background-
|
|
53
|
-
padding-left: 2.5rem;
|
|
54
|
+
&:has(> .text-input:not(:placeholder-shown))::before {
|
|
55
|
+
background-color: var(--color-icon-default);
|
|
54
56
|
}
|
|
55
|
-
}
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
opacity: 0;
|
|
58
|
+
&:has(> .text-input:disabled)::before {
|
|
59
|
+
background-color: var(--color-icon-disabled);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
&:has(> .text-input
|
|
63
|
-
|
|
62
|
+
&:has(> .text-input.is-invalid)::before {
|
|
63
|
+
background-color: var(--color-icon-negative);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
> .text-input {
|
|
67
|
+
background-image: none !important;
|
|
68
|
+
padding-left: 2.5rem;
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
71
|
}
|
|
@@ -15,7 +15,7 @@ $focus: (
|
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
$disabled: (
|
|
18
|
-
background-color:
|
|
18
|
+
background-color: transparent,
|
|
19
19
|
border-color: var(--color-border-strong),
|
|
20
20
|
color: var(--color-text-secondary),
|
|
21
21
|
);
|
|
@@ -25,7 +25,7 @@ $disabled-checked: (
|
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
$readonly: (
|
|
28
|
-
background-color:
|
|
28
|
+
background-color: transparent,
|
|
29
29
|
color: var(--color-text-secondary),
|
|
30
30
|
);
|
|
31
31
|
|
|
@@ -35,6 +35,7 @@ $invalid: (
|
|
|
35
35
|
|
|
36
36
|
$placeholder: (
|
|
37
37
|
color: var(--color-text-secondary),
|
|
38
|
+
font-weight: bold,
|
|
38
39
|
);
|
|
39
40
|
|
|
40
41
|
$radiocheck-sizes: (
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
@include mixins.size(large);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.bg-orange &,
|
|
17
16
|
.surface-secondary &,
|
|
18
17
|
.surface-tertiary & {
|
|
19
18
|
@include mixins.color-inverse();
|
|
@@ -23,7 +22,6 @@
|
|
|
23
22
|
&__line {
|
|
24
23
|
@include mixins.line-base;
|
|
25
24
|
|
|
26
|
-
.bg-orange &,
|
|
27
25
|
.surface-secondary &,
|
|
28
26
|
.surface-tertiary & {
|
|
29
27
|
@include mixins.line-color-inverse();
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
@mixin base() {
|
|
9
9
|
@include typoMixins.list-unstyled();
|
|
10
10
|
|
|
11
|
+
gap: convert.to-rem(7px);
|
|
11
12
|
display: flex;
|
|
12
13
|
max-width: none;
|
|
13
14
|
margin-bottom: space.get("large");
|
|
@@ -17,24 +18,25 @@
|
|
|
17
18
|
font-weight: bold;
|
|
18
19
|
height: 50%;
|
|
19
20
|
align-self: center;
|
|
21
|
+
margin: 0 convert.to-rem(10px);
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
@mixin item() {
|
|
23
|
-
margin-right: space.get("small");
|
|
24
25
|
margin-bottom: 0;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
@mixin last-item() {
|
|
28
|
-
margin-right: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
28
|
@mixin link() {
|
|
32
|
-
border-radius:
|
|
29
|
+
border-radius: convert.to-rem(5px);
|
|
33
30
|
margin-bottom: 0;
|
|
34
31
|
background-color: var(--color-background-primary);
|
|
32
|
+
|
|
35
33
|
&:hover {
|
|
36
34
|
background-color: var(--color-background-contrast);
|
|
37
35
|
}
|
|
36
|
+
|
|
37
|
+
&:active {
|
|
38
|
+
background-color: var(--color-surface-tertiary);
|
|
39
|
+
}
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
@mixin link-active() {
|
|
@@ -297,11 +297,10 @@ const getBackgroundsAsArray = (
|
|
|
297
297
|
return acc;
|
|
298
298
|
}, []);
|
|
299
299
|
|
|
300
|
-
// Map names to
|
|
300
|
+
// Map names to allowed background/surface classes
|
|
301
301
|
const getBgClassFromName = (name: string): string => {
|
|
302
302
|
const normalized = name.toLowerCase().replace(/\s+/g, "-");
|
|
303
303
|
|
|
304
|
-
// Only allow these background classes
|
|
305
304
|
const allowedBackgrounds = [
|
|
306
305
|
"background-primary",
|
|
307
306
|
"background-secondary",
|
|
@@ -310,6 +309,13 @@ const getBgClassFromName = (name: string): string => {
|
|
|
310
309
|
"background-accent1-blog",
|
|
311
310
|
"background-accent2-blog",
|
|
312
311
|
"background-none",
|
|
312
|
+
"surface-primary",
|
|
313
|
+
"surface-secondary",
|
|
314
|
+
"surface-tertiary",
|
|
315
|
+
"surface-subtle",
|
|
316
|
+
"surface-moderate",
|
|
317
|
+
"surface-contrast",
|
|
318
|
+
"surface-accent",
|
|
313
319
|
];
|
|
314
320
|
|
|
315
321
|
// Return the class if it's in the allowed list, otherwise default to background-primary
|
|
@@ -327,6 +333,13 @@ const PreviewGenerator: FunctionComponent<PreviewProps> = ({
|
|
|
327
333
|
"Background Accent": "background-accent",
|
|
328
334
|
"Background Accent1 Blog": "background-accent1-blog",
|
|
329
335
|
"Background Accent2 Blog": "background-accent2-blog",
|
|
336
|
+
"Surface Primary": "surface-primary",
|
|
337
|
+
"Surface Secondary": "surface-secondary",
|
|
338
|
+
"Surface Tertiary": "surface-tertiary",
|
|
339
|
+
"Surface Subtle": "surface-subtle",
|
|
340
|
+
"Surface Moderate": "surface-moderate",
|
|
341
|
+
"Surface Contrast": "surface-contrast",
|
|
342
|
+
"Surface Accent": "surface-accent",
|
|
330
343
|
},
|
|
331
344
|
bgThemeExcludedColors = [],
|
|
332
345
|
children,
|
|
@@ -4,6 +4,23 @@
|
|
|
4
4
|
@use "../../../styles/tools/map";
|
|
5
5
|
@use "./config";
|
|
6
6
|
|
|
7
|
+
$section-spacing-colors: (
|
|
8
|
+
background-primary,
|
|
9
|
+
background-secondary,
|
|
10
|
+
background-contrast,
|
|
11
|
+
background-accent,
|
|
12
|
+
background-accent1-blog,
|
|
13
|
+
background-accent2-blog,
|
|
14
|
+
background-none,
|
|
15
|
+
surface-primary,
|
|
16
|
+
surface-secondary,
|
|
17
|
+
surface-tertiary,
|
|
18
|
+
surface-subtle,
|
|
19
|
+
surface-moderate,
|
|
20
|
+
surface-contrast,
|
|
21
|
+
surface-accent
|
|
22
|
+
);
|
|
23
|
+
|
|
7
24
|
@mixin base {
|
|
8
25
|
background-color: var(--color-background-primary);
|
|
9
26
|
}
|
|
@@ -13,15 +30,20 @@
|
|
|
13
30
|
}
|
|
14
31
|
|
|
15
32
|
@mixin spacing-rules($config: config.$spacing) {
|
|
16
|
-
&:not([class*="
|
|
17
|
-
|
|
18
|
-
&[class~="bg-white"] + &[class~="bg-white"],
|
|
19
|
-
&[class~="bg-orange"] + &[class~="bg-orange"],
|
|
20
|
-
&[class~="bg-gray"] + &[class~="bg-gray"] {
|
|
33
|
+
&:not([class*="background-"]):not([class*="surface-"])
|
|
34
|
+
+ &:not([class*="background-"]):not([class*="surface-"]) {
|
|
21
35
|
&:not(.section--default) {
|
|
22
36
|
@include spacing("small");
|
|
23
37
|
}
|
|
24
38
|
}
|
|
39
|
+
|
|
40
|
+
@each $color in $section-spacing-colors {
|
|
41
|
+
&[class~="#{$color}"] + &[class~="#{$color}"] {
|
|
42
|
+
&:not(.section--default) {
|
|
43
|
+
@include spacing("small");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
25
47
|
}
|
|
26
48
|
|
|
27
49
|
@mixin image-stuck-to-bottom($config: config.$stuck-image-spacing) {
|
|
@@ -160,8 +160,8 @@ $social-colors: (
|
|
|
160
160
|
),
|
|
161
161
|
hover: (
|
|
162
162
|
color: color.$white "!important",
|
|
163
|
-
background-color:
|
|
164
|
-
border-color:
|
|
163
|
+
background-color: var(--color-icon-brand),
|
|
164
|
+
border-color: var(--color-icon-brand),
|
|
165
165
|
),
|
|
166
166
|
pressed: (
|
|
167
167
|
color: var(--color-text-inverse) "!important",
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
@include mixins.item-color("default", "next");
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
.
|
|
40
|
+
.background-contrast &,
|
|
41
|
+
.surface-contrast &,
|
|
41
42
|
.is-dark & {
|
|
42
43
|
@include mixins.item-color("inverse", "done");
|
|
43
44
|
|
|
@@ -68,7 +69,8 @@
|
|
|
68
69
|
@include mixins.link-overlay();
|
|
69
70
|
@include mixins.link-underline();
|
|
70
71
|
|
|
71
|
-
.
|
|
72
|
+
.background-contrast &,
|
|
73
|
+
.surface-contrast &,
|
|
72
74
|
.is-dark & {
|
|
73
75
|
@include mixins.link-color("inverse");
|
|
74
76
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
@use "./config";
|
|
2
3
|
@use "../../../styles/tokens/color";
|
|
3
4
|
@use "../../../styles/tokens/space";
|
|
4
|
-
@use "../../../styles/tools/
|
|
5
|
+
@use "../../../styles/tools/generate";
|
|
6
|
+
@use "../../../styles/typography/config" as typography;
|
|
5
7
|
|
|
6
8
|
@mixin base {
|
|
7
9
|
width: 100%;
|
|
@@ -12,8 +14,9 @@
|
|
|
12
14
|
@mixin cells {
|
|
13
15
|
padding: space.get("medium");
|
|
14
16
|
vertical-align: middle;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
@include generate.responsive-css-map(
|
|
18
|
+
map.get(typography.$body-text, "default")
|
|
19
|
+
);
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
@mixin header-cells {
|
|
@@ -51,11 +51,6 @@
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
// TODO: This is a temporary solution to make transparent tags work on gray backgrounds, we need to find a better way to handle this in the future.
|
|
56
|
-
&--transparent {
|
|
57
|
-
background-color: var(--color-surface-primary);
|
|
58
|
-
}
|
|
59
54
|
}
|
|
60
55
|
|
|
61
56
|
// Transparent class is a special variant of color, it's not possible to make transparent variant for each color at the moment.
|
|
@@ -121,6 +116,28 @@
|
|
|
121
116
|
border-radius: 9999px;
|
|
122
117
|
z-index: 2;
|
|
123
118
|
|
|
119
|
+
.background-secondary & {
|
|
120
|
+
background-color: var(--color-border-strong);
|
|
121
|
+
|
|
122
|
+
&:not([disabled]):not([aria-disabled="true"]) {
|
|
123
|
+
&:focus-visible,
|
|
124
|
+
&:hover {
|
|
125
|
+
background-color: color.$gray-600;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:active,
|
|
129
|
+
&.is-active {
|
|
130
|
+
color: var(--color-text-inverse);
|
|
131
|
+
background-color: var(--color-background-contrast);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&[aria-disabled="true"],
|
|
136
|
+
&[disabled] {
|
|
137
|
+
background-color: var(--color-border-strong);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
124
141
|
@each $name, $props in config.$icon-sizes {
|
|
125
142
|
&#{generate.variant-name($name)} {
|
|
126
143
|
$padding: sass-map.get($props, padding);
|
|
@@ -2,30 +2,18 @@ import cx from "classnames";
|
|
|
2
2
|
import React, { ReactNode } from "react";
|
|
3
3
|
import { Icon } from "../Icon";
|
|
4
4
|
import { IconProps } from "../Icon/Icon";
|
|
5
|
-
import { Image } from "../Image";
|
|
6
5
|
|
|
7
|
-
export const tileColors = [
|
|
8
|
-
"surface-primary",
|
|
9
|
-
"surface-subtle",
|
|
10
|
-
"surface-contrast",
|
|
11
|
-
] as const;
|
|
12
|
-
export type TileColor = (typeof tileColors)[number];
|
|
13
6
|
export type TileHAlign = "center";
|
|
14
7
|
export type TileVAlign = "center" | "end" | "space-between";
|
|
8
|
+
export type TileVariant = "compact" | "action";
|
|
15
9
|
|
|
16
10
|
export interface TileProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
17
|
-
/** Tile color. */
|
|
18
|
-
color?: TileColor;
|
|
19
11
|
/** Horizontal alignment of the tile content. */
|
|
20
12
|
hAlign?: TileHAlign;
|
|
21
13
|
/** Vertical alignment of the tile content. */
|
|
22
14
|
vAlign?: TileVAlign;
|
|
23
|
-
/** variant
|
|
24
|
-
variant?:
|
|
25
|
-
/** Alt and src attributes are required */
|
|
26
|
-
backgroundImage?: React.ComponentProps<typeof Image>;
|
|
27
|
-
/** Use small spacing */
|
|
28
|
-
space?: "small";
|
|
15
|
+
/** Tile variant. */
|
|
16
|
+
variant?: TileVariant;
|
|
29
17
|
children?: ReactNode;
|
|
30
18
|
className?: string;
|
|
31
19
|
}
|
|
@@ -36,54 +24,42 @@ const Tile: React.FC<TileProps> = ({
|
|
|
36
24
|
className,
|
|
37
25
|
children,
|
|
38
26
|
variant,
|
|
39
|
-
backgroundImage,
|
|
40
27
|
vAlign,
|
|
41
28
|
hAlign,
|
|
42
|
-
color,
|
|
43
|
-
space,
|
|
44
29
|
...other
|
|
45
30
|
}) => {
|
|
31
|
+
const isCompact = variant === "compact";
|
|
32
|
+
const isAction = variant === "action";
|
|
33
|
+
|
|
46
34
|
const classesWrapper = cx(
|
|
47
35
|
CLASS_ROOT,
|
|
48
36
|
{
|
|
49
|
-
[`${CLASS_ROOT}
|
|
50
|
-
|
|
51
|
-
...(color === "surface-contrast"
|
|
52
|
-
? { [`${color} text-inverse`]: true }
|
|
53
|
-
: {}),
|
|
37
|
+
[`${CLASS_ROOT}--compact`]: isCompact,
|
|
38
|
+
[`${CLASS_ROOT}--action`]: isAction,
|
|
54
39
|
},
|
|
55
40
|
className,
|
|
56
41
|
);
|
|
57
42
|
|
|
58
43
|
const classesBody = cx(
|
|
59
44
|
`${CLASS_ROOT}__body`,
|
|
60
|
-
vAlign && `justify-content-${vAlign}`,
|
|
61
|
-
hAlign && `align-items-${hAlign}`,
|
|
62
|
-
space && `${CLASS_ROOT}__body--space-${space}`,
|
|
45
|
+
!isAction && vAlign && `justify-content-${vAlign}`,
|
|
46
|
+
!isAction && hAlign && `align-items-${hAlign}`,
|
|
63
47
|
);
|
|
64
48
|
|
|
65
|
-
const iconProps =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
: null;
|
|
49
|
+
const iconProps = isAction
|
|
50
|
+
? ({
|
|
51
|
+
name: "chevron-right",
|
|
52
|
+
size: "medium",
|
|
53
|
+
color: "orange",
|
|
54
|
+
} as IconProps)
|
|
55
|
+
: null;
|
|
73
56
|
|
|
74
57
|
return (
|
|
75
58
|
<div className={classesWrapper} {...other}>
|
|
76
59
|
<div className={classesBody}>
|
|
77
|
-
{iconProps && <Icon {...iconProps} />}
|
|
78
60
|
{children}
|
|
61
|
+
{iconProps && <Icon {...iconProps} />}
|
|
79
62
|
</div>
|
|
80
|
-
{backgroundImage && (
|
|
81
|
-
// eslint-disable-next-line jsx-a11y/alt-text
|
|
82
|
-
<Image
|
|
83
|
-
{...backgroundImage}
|
|
84
|
-
className={cx(`${CLASS_ROOT}__bg`, backgroundImage.className)}
|
|
85
|
-
/>
|
|
86
|
-
)}
|
|
87
63
|
</div>
|
|
88
64
|
);
|
|
89
65
|
};
|