@carbon/styles 1.50.0-rc.0 → 1.50.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/css/styles.css +153 -29
- package/css/styles.min.css +1 -1
- package/package.json +3 -3
- package/scss/__tests__/theme-test.js +1 -0
- package/scss/components/_index.scss +1 -0
- package/scss/components/chat-button/_chat-button.scss +69 -0
- package/scss/components/chat-button/_index.scss +11 -0
- package/scss/components/data-table/_data-table.scss +104 -6
- package/scss/components/data-table/expandable/_data-table-expandable.scss +4 -4
- package/scss/components/data-table/sort/_data-table-sort.scss +7 -2
- package/scss/utilities/_ai-gradient.scss +31 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/styles",
|
|
3
3
|
"description": "Styles for the Carbon Design System",
|
|
4
|
-
"version": "1.50.0
|
|
4
|
+
"version": "1.50.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@carbon/grid": "^11.21.0",
|
|
44
44
|
"@carbon/layout": "^11.20.0",
|
|
45
45
|
"@carbon/motion": "^11.16.0",
|
|
46
|
-
"@carbon/themes": "^11.
|
|
46
|
+
"@carbon/themes": "^11.31.0",
|
|
47
47
|
"@carbon/type": "^11.25.0",
|
|
48
48
|
"@ibm/plex": "6.0.0-next.6"
|
|
49
49
|
},
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"scss/**/*.css",
|
|
66
66
|
"css/**/*.css"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "eb7d66891262363368b48211b9fd1caa78fa58f9"
|
|
69
69
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright IBM Corp. 2016, 2024
|
|
3
|
+
//
|
|
4
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
@use '../button';
|
|
9
|
+
@use '../../config' as *;
|
|
10
|
+
@use '../../theme' as *;
|
|
11
|
+
@use '../../type' as *;
|
|
12
|
+
@use '../../utilities/convert';
|
|
13
|
+
|
|
14
|
+
@mixin chat-button {
|
|
15
|
+
.#{$prefix}--chat-btn {
|
|
16
|
+
border-radius: convert.to-rem(24px);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.#{$prefix}--chat-btn.#{$prefix}--btn--md {
|
|
20
|
+
border-radius: convert.to-rem(20px);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.#{$prefix}--chat-btn.#{$prefix}--btn--sm {
|
|
24
|
+
border-radius: convert.to-rem(16px);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Quick action button
|
|
28
|
+
.#{$prefix}--chat-btn--quick-action {
|
|
29
|
+
align-items: center;
|
|
30
|
+
border: 1px solid $link-primary;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.#{$prefix}--chat-btn--quick-action:hover:not(:active):not([disabled]) {
|
|
34
|
+
border-color: transparent;
|
|
35
|
+
background: $background-hover;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.#{$prefix}--chat-btn--quick-action.#{$prefix}--btn--ghost:focus {
|
|
39
|
+
border-color: $focus;
|
|
40
|
+
box-shadow: inset 0 0 0 1px $focus;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.#{$prefix}--chat-btn--quick-action.#{$prefix}--btn--ghost:hover:focus {
|
|
44
|
+
border-color: $focus;
|
|
45
|
+
box-shadow: inset 0 0 0 1px $focus-inset;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.#{$prefix}--chat-btn--quick-action[disabled],
|
|
49
|
+
.#{$prefix}--chat-btn--quick-action[disabled]:hover {
|
|
50
|
+
border-color: button.$button-disabled;
|
|
51
|
+
color: button.$button-disabled;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.#{$prefix}--chat-btn--quick-action--selected,
|
|
55
|
+
.#{$prefix}--chat-btn--quick-action--selected[disabled],
|
|
56
|
+
.#{$prefix}--chat-btn--quick-action--selected[disabled]:hover {
|
|
57
|
+
border-color: transparent;
|
|
58
|
+
background: $background-selected;
|
|
59
|
+
color: $text-secondary;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.#{$prefix}--chat-btn--quick-action--selected:hover {
|
|
63
|
+
color: $text-secondary;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.#{$prefix}--chat-btn.#{$prefix}--skeleton {
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright IBM Corp. 2018, 2024
|
|
3
|
+
//
|
|
4
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
@forward 'chat-button';
|
|
9
|
+
@use 'chat-button';
|
|
10
|
+
|
|
11
|
+
@include chat-button.chat-button;
|
|
@@ -945,20 +945,94 @@
|
|
|
945
945
|
margin: convert.to-rem(-3px) 0;
|
|
946
946
|
}
|
|
947
947
|
|
|
948
|
+
// -------------------
|
|
948
949
|
// Slug styles
|
|
950
|
+
// -------------------
|
|
949
951
|
.#{$prefix}--data-table .#{$prefix}--table-column-slug {
|
|
950
952
|
inline-size: $spacing-05;
|
|
951
953
|
padding-inline-end: 0;
|
|
952
954
|
}
|
|
953
955
|
|
|
954
|
-
.#{$prefix}--data-table
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
@include ai-gradient('left', 50%);
|
|
956
|
+
tr.#{$prefix}--data-table--slug-row,
|
|
957
|
+
tr.#{$prefix}--data-table--slug-row + .#{$prefix}--expandable-row {
|
|
958
|
+
@include ai-table-gradient();
|
|
958
959
|
|
|
959
960
|
background-attachment: fixed;
|
|
960
961
|
}
|
|
961
962
|
|
|
963
|
+
.#{$prefix}--data-table--slug-row {
|
|
964
|
+
box-shadow: inset 1px 0 $ai-border-strong;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
// Remove table cell backgrounds that are overriding gradient background on row
|
|
968
|
+
.#{$prefix}--data-table tbody tr.#{$prefix}--data-table--slug-row:hover td,
|
|
969
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--expandable-row:hover
|
|
970
|
+
+ .#{$prefix}--expandable-row[data-child-row]
|
|
971
|
+
td,
|
|
972
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--expandable-row--hover
|
|
973
|
+
+ .#{$prefix}--expandable-row[data-child-row]:hover
|
|
974
|
+
> td,
|
|
975
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--expandable-row--hover > td,
|
|
976
|
+
tr.#{$prefix}--data-table--selected.#{$prefix}--data-table--slug-row.#{$prefix}--expandable-row
|
|
977
|
+
+ tr.#{$prefix}--expandable-row[data-child-row]
|
|
978
|
+
> td,
|
|
979
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--parent-row.#{$prefix}--data-table--selected.#{$prefix}--expandable-row:hover
|
|
980
|
+
td,
|
|
981
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--parent-row.#{$prefix}--data-table--selected.#{$prefix}--expandable-row:hover
|
|
982
|
+
td:first-of-type,
|
|
983
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--parent-row.#{$prefix}--data-table--selected:not(
|
|
984
|
+
.#{$prefix}--expandable-row
|
|
985
|
+
):hover
|
|
986
|
+
> td,
|
|
987
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--parent-row.#{$prefix}--data-table--selected.#{$prefix}--expandable-row:hover
|
|
988
|
+
+ tr[data-child-row]
|
|
989
|
+
> td,
|
|
990
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--parent-row.#{$prefix}--data-table--selected.#{$prefix}--expandable-row--hover
|
|
991
|
+
> td,
|
|
992
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--parent-row.#{$prefix}--data-table--selected.#{$prefix}--expandable-row--hover
|
|
993
|
+
> td:first-of-type {
|
|
994
|
+
background-color: transparent;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.#{$prefix}--data-table tbody tr.#{$prefix}--data-table--slug-row:hover,
|
|
998
|
+
tr.#{$prefix}--data-table--slug-row:hover
|
|
999
|
+
+ .#{$prefix}--expandable-row[data-child-row],
|
|
1000
|
+
tr.#{$prefix}--expandable-row--hover
|
|
1001
|
+
+ .#{$prefix}--expandable-row[data-child-row]:hover,
|
|
1002
|
+
tr.#{$prefix}--expandable-row--hover.#{$prefix}--data-table--slug-row,
|
|
1003
|
+
tr.#{$prefix}--data-table--selected.#{$prefix}--parent-row.#{$prefix}--expandable-row--hover.#{$prefix}--data-table--slug-row {
|
|
1004
|
+
@include ai-table-gradient('hover');
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
tr.#{$prefix}--parent-row.cds--data-table--selected.#{$prefix}--data-table--slug-row,
|
|
1008
|
+
.#{$prefix}--data-table--selected.#{$prefix}--data-table--slug-row,
|
|
1009
|
+
tr.#{$prefix}--data-table--selected.#{$prefix}--data-table--slug-row
|
|
1010
|
+
+ .#{$prefix}--expandable-row {
|
|
1011
|
+
@include ai-table-gradient('selected');
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--data-table--selected td,
|
|
1015
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--data-table--selected:hover td,
|
|
1016
|
+
tbody tr.#{$prefix}--data-table--slug-row:hover td,
|
|
1017
|
+
tr.#{$prefix}--data-table--slug-row.#{$prefix}--parent-row.#{$prefix}--data-table--selected.#{$prefix}--expandable-row:hover
|
|
1018
|
+
td:not(.#{$prefix}--table-expand):not(
|
|
1019
|
+
.#{$prefix}--table-column-checkbox
|
|
1020
|
+
):not(.#{$prefix}--table-column-slug) {
|
|
1021
|
+
border-block-end-color: $border-subtle;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
tr.#{$prefix}--expandable-row.cds--data-table--selected.#{$prefix}--data-table--slug-row[data-parent-row]
|
|
1025
|
+
> td:not(.#{$prefix}--table-expand):not(
|
|
1026
|
+
.#{$prefix}--table-column-checkbox
|
|
1027
|
+
):not(.#{$prefix}--table-column-slug) {
|
|
1028
|
+
border-block-end: 1px solid $layer-selected;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
tr.#{$prefix}--parent-row.#{$prefix}--data-table--slug-row.#{$prefix}--expandable-row:hover
|
|
1032
|
+
td:first-of-type {
|
|
1033
|
+
border-block-end: 1px solid transparent;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
962
1036
|
.#{$prefix}--data-table
|
|
963
1037
|
thead
|
|
964
1038
|
th.#{$prefix}--table-sort__header--slug
|
|
@@ -966,11 +1040,12 @@
|
|
|
966
1040
|
.#{$prefix}--data-table
|
|
967
1041
|
thead
|
|
968
1042
|
th:has(> .#{$prefix}--table-header-label--slug) {
|
|
969
|
-
@include ai-gradient(
|
|
1043
|
+
@include ai-table-gradient();
|
|
970
1044
|
}
|
|
971
1045
|
|
|
972
1046
|
.#{$prefix}--table-column-slug .#{$prefix}--slug {
|
|
973
1047
|
position: absolute;
|
|
1048
|
+
z-index: 2;
|
|
974
1049
|
transform: translateY(-50%);
|
|
975
1050
|
}
|
|
976
1051
|
|
|
@@ -987,9 +1062,32 @@
|
|
|
987
1062
|
th
|
|
988
1063
|
.#{$prefix}--table-header-label.#{$prefix}--table-header-label--slug
|
|
989
1064
|
.#{$prefix}--slug {
|
|
990
|
-
margin-inline-start:
|
|
1065
|
+
margin-inline-start: auto;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
th.#{$prefix}--table-sort__header--slug,
|
|
1069
|
+
th:has(.#{$prefix}--table-header-label--slug) {
|
|
1070
|
+
box-shadow: inset 0 1px $ai-border-strong;
|
|
991
1071
|
}
|
|
992
1072
|
|
|
1073
|
+
td.#{$prefix}--table-cell--column-slug {
|
|
1074
|
+
@include ai-table-gradient();
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
tr.#{$prefix}--parent-row:not(.#{$prefix}--expandable-row):not(:first-of-type)
|
|
1078
|
+
td.#{$prefix}--table-cell--column-slug {
|
|
1079
|
+
// Same gradient as background
|
|
1080
|
+
border-block-start: linear-gradient(
|
|
1081
|
+
to right,
|
|
1082
|
+
$ai-aura-start-table 0%,
|
|
1083
|
+
$ai-aura-end 50%,
|
|
1084
|
+
transparent 50%
|
|
1085
|
+
);
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
tr.#{$prefix}--parent-row:not(.#{$prefix}--expandable-row):not(:first-of-type)
|
|
1089
|
+
td.#{$prefix}--table-cell--column-slug,
|
|
1090
|
+
|
|
993
1091
|
// Windows HCM fix
|
|
994
1092
|
// stylelint-disable-next-line no-duplicate-selectors
|
|
995
1093
|
.#{$prefix}--data-table-content {
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// Increase padding inside expandable row when only a slug OR checkbox is present in row
|
|
81
|
-
tbody:has(> tr.#{$prefix}--
|
|
81
|
+
tbody:has(> tr.#{$prefix}--data-table--slug-row)
|
|
82
82
|
> tr.#{$prefix}--expandable-row[data-child-row]
|
|
83
83
|
td,
|
|
84
84
|
tbody:has(td.#{$prefix}--table-column-checkbox)
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// Increase padding inside expandable row when slug AND checkbox is present in row
|
|
91
|
-
tbody:has(> tr.#{$prefix}--
|
|
91
|
+
tbody:has(> tr.#{$prefix}--data-table--slug-row):has(
|
|
92
92
|
td.#{$prefix}--table-column-checkbox
|
|
93
93
|
)
|
|
94
94
|
> tr.#{$prefix}--expandable-row[data-child-row]
|
|
@@ -476,8 +476,8 @@
|
|
|
476
476
|
border-block-end: 1px solid transparent;
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
-
.#{$prefix}--
|
|
480
|
-
.#{$prefix}--data-table tr.#{$prefix}--
|
|
479
|
+
.#{$prefix}--data-table--slug-row td,
|
|
480
|
+
.#{$prefix}--data-table tr.#{$prefix}--data-table--slug-row:hover td {
|
|
481
481
|
border-block-start: 1px solid transparent;
|
|
482
482
|
}
|
|
483
483
|
|
|
@@ -249,9 +249,14 @@
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
// Slug styles
|
|
252
|
+
.#{$prefix}--table-sort__header--slug .#{$prefix}--table-sort__icon,
|
|
253
|
+
.#{$prefix}--table-sort__header--slug .#{$prefix}--table-sort__icon-unsorted {
|
|
254
|
+
margin-inline-end: convert.to-rem(8px);
|
|
255
|
+
margin-inline-start: auto;
|
|
256
|
+
}
|
|
257
|
+
|
|
252
258
|
.#{$prefix}--table-sort__header--slug .#{$prefix}--slug {
|
|
253
|
-
margin-inline-end:
|
|
254
|
-
margin-inline-start: convert.to-rem(8px);
|
|
259
|
+
margin-inline-end: convert.to-rem(8px);
|
|
255
260
|
}
|
|
256
261
|
|
|
257
262
|
// Windows HCM fix
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
@use '../theme';
|
|
9
|
+
@use './custom-property';
|
|
9
10
|
|
|
10
11
|
/// Experimental - name and structure subject to change. Use at your own risk!
|
|
11
12
|
/// Adds AI gradient styles to a component
|
|
@@ -37,27 +38,52 @@
|
|
|
37
38
|
border-block-end-color: theme.$ai-border-strong;
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
@mixin ai-table-gradient($type: 'default', $span: 50%) {
|
|
42
|
+
@if $type == 'hover' {
|
|
43
|
+
background: linear-gradient(
|
|
44
|
+
to right,
|
|
45
|
+
theme.$ai-aura-hover-start 0%,
|
|
46
|
+
15%,
|
|
47
|
+
theme.$ai-aura-hover-end 50%
|
|
48
|
+
),
|
|
49
|
+
theme.$ai-aura-hover-background;
|
|
50
|
+
} @else if $type == 'selected' {
|
|
51
|
+
background: linear-gradient(
|
|
52
|
+
to right,
|
|
53
|
+
theme.$ai-inner-shadow 0%,
|
|
54
|
+
theme.$ai-aura-end 50%,
|
|
55
|
+
transparent 50%
|
|
56
|
+
),
|
|
57
|
+
theme.$layer-selected;
|
|
58
|
+
} @else {
|
|
59
|
+
background: linear-gradient(
|
|
60
|
+
to right,
|
|
61
|
+
theme.$ai-aura-start-table 0%,
|
|
62
|
+
theme.$ai-aura-end $span,
|
|
63
|
+
transparent 50%
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
40
68
|
/// Experimental - name and structure subject to change. Use at your own risk!
|
|
41
69
|
/// Adds callout gradient styles to a component
|
|
42
70
|
/// @access private
|
|
43
71
|
/// @example @include callout-gradient();
|
|
44
72
|
/// @param {String} $type - Type of gradient, either 'default', 'selected' or 'hover'
|
|
45
73
|
/// @param {Number} $offset - specify a pixel offset the callout should start from the bottom
|
|
46
|
-
/// @param {String} $background - specify
|
|
74
|
+
/// @param {String} $background - specify the token to be used as the background
|
|
47
75
|
/// @group utilities
|
|
48
76
|
@mixin callout-gradient(
|
|
49
77
|
$type: 'default',
|
|
50
78
|
$offset: 0,
|
|
51
|
-
$background:
|
|
79
|
+
$background: 'background'
|
|
52
80
|
) {
|
|
53
81
|
$start: 0%;
|
|
54
82
|
@if $offset != 0 {
|
|
55
83
|
$start: calc(0% + #{$offset});
|
|
56
84
|
}
|
|
57
85
|
|
|
58
|
-
|
|
59
|
-
$background: theme.$layer;
|
|
60
|
-
}
|
|
86
|
+
$background: custom-property.get-var(#{$background}, theme.$background);
|
|
61
87
|
|
|
62
88
|
@if $type == 'hover' {
|
|
63
89
|
background: linear-gradient(
|