@carbon/ibm-products 1.50.0 → 1.52.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/README.md +10 -5
- package/css/index-full-carbon.css +131 -82
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +2 -2
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +38 -11
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +131 -82
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +2 -2
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +131 -82
- package/css/index.css.map +1 -1
- package/css/index.min.css +2 -2
- package/css/index.min.css.map +1 -1
- package/es/components/AboutModal/AboutModal.js +3 -4
- package/es/components/ActionBar/ActionBar.js +9 -18
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +8 -13
- package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +7 -11
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +8 -8
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +5 -5
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -4
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +17 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +17 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +8 -4
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +2 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/utils.js +14 -0
- package/es/components/Datagrid/index.js +1 -0
- package/es/components/Datagrid/useActionsColumn.js +10 -7
- package/es/components/Datagrid/useCustomizeColumns.js +5 -1
- package/es/components/Datagrid/useEditableCell.js +12 -0
- package/es/components/Datagrid/useExpandedRow.js +11 -7
- package/es/components/Datagrid/useFiltering.js +15 -10
- package/es/components/Datagrid/useInlineEdit.js +17 -8
- package/es/components/Datagrid/useNestedRows.js +10 -6
- package/es/components/Datagrid/useOnRowClick.js +9 -1
- package/es/components/Datagrid/useSelectRows.js +2 -0
- package/es/components/EditInPlace/EditInPlace.js +43 -0
- package/es/components/EditInPlace/index.js +8 -0
- package/es/components/ExampleComponent/ExampleComponent.js +32 -4
- package/es/components/ExampleComponent/useExample.js +49 -0
- package/es/components/InlineEdit/InlineEdit.js +5 -1
- package/es/components/InlineEditV1/InlineEditV1.js +7 -2
- package/es/components/InlineEditV2/InlineEditV2.js +51 -15
- package/es/components/NonLinearReading/NonLinearReading.js +7 -7
- package/es/components/PageHeader/PageHeader.js +28 -31
- package/es/components/SidePanel/SidePanel.js +25 -26
- package/es/components/TagSet/TagSet.js +5 -7
- package/es/components/Tearsheet/TearsheetShell.js +4 -6
- package/es/components/index.js +2 -1
- package/es/global/js/hooks/useResizeObserver.js +74 -0
- package/es/global/js/package-settings.js +35 -4
- package/es/global/js/utils/test-helper.js +34 -3
- package/es/settings.js +40 -29
- package/lib/components/AboutModal/AboutModal.js +3 -4
- package/lib/components/ActionBar/ActionBar.js +9 -18
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +8 -13
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +7 -11
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +4 -4
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +17 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +17 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +8 -4
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +2 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +15 -0
- package/lib/components/Datagrid/index.js +7 -0
- package/lib/components/Datagrid/useActionsColumn.js +7 -1
- package/lib/components/Datagrid/useCustomizeColumns.js +4 -0
- package/lib/components/Datagrid/useEditableCell.js +20 -0
- package/lib/components/Datagrid/useExpandedRow.js +4 -0
- package/lib/components/Datagrid/useFiltering.js +8 -2
- package/lib/components/Datagrid/useInlineEdit.js +19 -8
- package/lib/components/Datagrid/useNestedRows.js +9 -6
- package/lib/components/Datagrid/useOnRowClick.js +9 -1
- package/lib/components/Datagrid/useSelectRows.js +2 -0
- package/lib/components/EditInPlace/EditInPlace.js +46 -0
- package/lib/components/EditInPlace/index.js +12 -0
- package/lib/components/ExampleComponent/ExampleComponent.js +35 -4
- package/lib/components/ExampleComponent/useExample.js +58 -0
- package/lib/components/InlineEdit/InlineEdit.js +5 -1
- package/lib/components/InlineEditV1/InlineEditV1.js +7 -2
- package/lib/components/InlineEditV2/InlineEditV2.js +53 -16
- package/lib/components/NonLinearReading/NonLinearReading.js +6 -6
- package/lib/components/PageHeader/PageHeader.js +28 -31
- package/lib/components/SidePanel/SidePanel.js +25 -26
- package/lib/components/TagSet/TagSet.js +5 -7
- package/lib/components/Tearsheet/TearsheetShell.js +4 -6
- package/lib/components/index.js +13 -0
- package/lib/global/js/hooks/useResizeObserver.js +83 -0
- package/lib/global/js/package-settings.js +34 -3
- package/lib/global/js/utils/test-helper.js +37 -5
- package/lib/settings.js +41 -30
- package/package.json +2 -3
- package/scss/components/Datagrid/styles/_useSelectAllToggle.scss +10 -7
- package/scss/components/InlineEditV2/_inline-edit-v2.scss +52 -11
- package/scss/components/InlineEditV2/_storybook-styles.scss +9 -2
- package/scss/components/NonLinearReading/_non-linear-reading.scss +76 -67
- package/scss/components/NonLinearReading/_storybook-styles.scss +16 -0
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
$carbon-input: #{$carbon-prefix}--text-input;
|
|
16
16
|
|
|
17
17
|
.#{$block-class} {
|
|
18
|
+
--#{$block-class}--size: #{$spacing-07};
|
|
19
|
+
|
|
18
20
|
display: flex;
|
|
19
21
|
align-items: center;
|
|
20
22
|
background: transparent;
|
|
@@ -24,11 +26,24 @@
|
|
|
24
26
|
cursor: not-allowed;
|
|
25
27
|
}
|
|
26
28
|
|
|
29
|
+
&--sm {
|
|
30
|
+
--#{$block-class}--size: #{$spacing-07};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&--md {
|
|
34
|
+
--#{$block-class}--size: #{$spacing-08};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&--lg {
|
|
38
|
+
--#{$block-class}--size: #{$spacing-09};
|
|
39
|
+
}
|
|
40
|
+
|
|
27
41
|
&:hover {
|
|
28
42
|
background: $field-01;
|
|
29
43
|
}
|
|
30
44
|
|
|
31
|
-
&:hover .#{$block-class}__btn-edit
|
|
45
|
+
&:hover .#{$block-class}__btn-edit,
|
|
46
|
+
.#{$block-class}__btn-edit.#{$block-class}__btn-edit--always-visible {
|
|
32
47
|
visibility: visible;
|
|
33
48
|
}
|
|
34
49
|
|
|
@@ -36,6 +51,10 @@
|
|
|
36
51
|
visibility: hidden;
|
|
37
52
|
}
|
|
38
53
|
|
|
54
|
+
&--invalid {
|
|
55
|
+
outline: 2px solid $support-01;
|
|
56
|
+
}
|
|
57
|
+
|
|
39
58
|
&--focused {
|
|
40
59
|
background: $field-01;
|
|
41
60
|
outline: 2px solid $focus;
|
|
@@ -45,12 +64,31 @@
|
|
|
45
64
|
flex: 1;
|
|
46
65
|
}
|
|
47
66
|
|
|
67
|
+
&--inherit-type .#{$block-class}__text-input {
|
|
68
|
+
/* match font of container */
|
|
69
|
+
font-size: inherit;
|
|
70
|
+
font-weight: inherit;
|
|
71
|
+
letter-spacing: inherit;
|
|
72
|
+
line-height: inherit;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&__ellipsis {
|
|
76
|
+
position: relative;
|
|
77
|
+
margin-left: calc(-1 * $spacing-05);
|
|
78
|
+
opacity: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&--overflows:not(.#{$block-class}--focused) .#{$block-class}__ellipsis {
|
|
82
|
+
opacity: 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
48
85
|
&__text-input-label {
|
|
49
86
|
display: none;
|
|
50
87
|
}
|
|
51
88
|
|
|
52
89
|
&__warning-icon {
|
|
53
|
-
|
|
90
|
+
width: $spacing-05;
|
|
91
|
+
margin: auto $spacing-03 auto auto;
|
|
54
92
|
color: $support-01;
|
|
55
93
|
}
|
|
56
94
|
|
|
@@ -70,11 +108,11 @@
|
|
|
70
108
|
outline: none;
|
|
71
109
|
}
|
|
72
110
|
|
|
73
|
-
.#{$block-class}
|
|
74
|
-
.#{$block-class}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
111
|
+
// .#{$block-class}--readonly .#{$block-class}__text-input.#{$carbon-input},
|
|
112
|
+
// .#{$block-class}--readonly
|
|
113
|
+
// .#{$carbon-prefix}--btn.#{$carbon-prefix}--btn--icon-only.#{$carbon-prefix}--tooltip__trigger {
|
|
114
|
+
// cursor: not-allowed;
|
|
115
|
+
// }
|
|
78
116
|
|
|
79
117
|
.#{$block-class}__text-input.#{$carbon-input}:focus,
|
|
80
118
|
.#{$block-class}__text-input.#{$carbon-input}:active {
|
|
@@ -82,8 +120,8 @@
|
|
|
82
120
|
}
|
|
83
121
|
|
|
84
122
|
.#{$block-class}__toolbar {
|
|
85
|
-
--toolbar-width:
|
|
86
|
-
--toolbar-width-focussed:
|
|
123
|
+
--toolbar-width: var(--#{$block-class}--size);
|
|
124
|
+
--toolbar-width-focussed: calc(2 * var(--#{$block-class}--size));
|
|
87
125
|
|
|
88
126
|
// animation div
|
|
89
127
|
display: inline-flex;
|
|
@@ -92,8 +130,11 @@
|
|
|
92
130
|
}
|
|
93
131
|
|
|
94
132
|
.#{$block-class}--invalid .#{$block-class}__toolbar {
|
|
95
|
-
|
|
96
|
-
--toolbar-width
|
|
133
|
+
// width of invalid icon is always $spacing-07 ($spacing-05 + 2 * $spacing-03 margin)
|
|
134
|
+
--toolbar-width: calc(var(--#{$block-class}--size) + #{$spacing-07});
|
|
135
|
+
--toolbar-width-focussed: calc(
|
|
136
|
+
2 * var(--#{$block-class}--size) + #{$spacing-07}
|
|
137
|
+
);
|
|
97
138
|
}
|
|
98
139
|
|
|
99
140
|
@keyframes slide-in {
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
@import '../../global/styles/display-box';
|
|
9
|
+
|
|
10
|
+
$block-class: 'inline-edit-v2-example';
|
|
11
|
+
|
|
12
|
+
.#{$block-class}__viewport {
|
|
13
|
+
// width: 300px; // larger than standard size needed by text input at standard font size (html input attribute size)
|
|
14
|
+
// stylelint-disable-next-line carbon/layout-token-use
|
|
15
|
+
margin: 100px;
|
|
9
16
|
}
|
|
@@ -8,31 +8,35 @@
|
|
|
8
8
|
// Standard imports.
|
|
9
9
|
@import '../../global/styles/project-settings';
|
|
10
10
|
|
|
11
|
-
@mixin
|
|
11
|
+
@mixin keyword-closed-defaults {
|
|
12
|
+
height: rem(20px);
|
|
13
|
+
padding-top: 0;
|
|
12
14
|
// stylelint-disable-next-line carbon/layout-token-use
|
|
13
|
-
padding: rem(
|
|
14
|
-
border:
|
|
15
|
+
padding-right: rem(3px);
|
|
16
|
+
border-width: rem(1px);
|
|
17
|
+
border-style: solid;
|
|
15
18
|
border-radius: $spacing-04;
|
|
16
|
-
background-color: $interactive-02;
|
|
17
19
|
white-space: nowrap;
|
|
18
20
|
|
|
19
21
|
&:hover {
|
|
20
|
-
background-color: $hover-secondary;
|
|
21
22
|
cursor: pointer;
|
|
22
23
|
}
|
|
23
|
-
}
|
|
24
|
-
@mixin term-open-defaults {
|
|
25
|
-
@include term-closed-defaults();
|
|
26
|
-
|
|
27
|
-
padding-right: 0;
|
|
28
24
|
|
|
25
|
+
// The "up" chevron
|
|
29
26
|
svg {
|
|
30
27
|
// stylelint-disable-next-line carbon/layout-token-use
|
|
31
|
-
|
|
32
|
-
margin: 0 $spacing-02 0 $spacing-01;
|
|
28
|
+
margin: rem(1px) 0 0 0;
|
|
33
29
|
vertical-align: text-top;
|
|
34
30
|
}
|
|
35
31
|
}
|
|
32
|
+
@mixin keyword-open-defaults {
|
|
33
|
+
@include keyword-closed-defaults();
|
|
34
|
+
|
|
35
|
+
// The "up" chevron, flipped
|
|
36
|
+
svg {
|
|
37
|
+
transform: rotate(180deg);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
36
40
|
@mixin body-defaults {
|
|
37
41
|
@include carbon--type-style('body-long-01');
|
|
38
42
|
|
|
@@ -48,10 +52,13 @@
|
|
|
48
52
|
|
|
49
53
|
// Other Carbon settings.
|
|
50
54
|
// TODO: @import 'carbon-components/scss/globals/grid/grid'; if needed
|
|
55
|
+
|
|
51
56
|
// NonLinearReading uses the following Carbon components:
|
|
52
57
|
// TODO: @import(s) of Carbon component styles used by NonLinearReading
|
|
58
|
+
|
|
53
59
|
// NonLinearReading uses the following Carbon for IBM Products components:
|
|
54
60
|
// TODO: @import(s) of IBM Products component styles used by NonLinearReading
|
|
61
|
+
|
|
55
62
|
// Define all component styles in a mixin which is then exported using
|
|
56
63
|
// the Carbon import-once mechanism.
|
|
57
64
|
@mixin non-linear-reading {
|
|
@@ -72,86 +79,88 @@
|
|
|
72
79
|
}
|
|
73
80
|
}
|
|
74
81
|
|
|
75
|
-
.#{$block-class} {
|
|
76
|
-
|
|
77
|
-
&-
|
|
78
|
-
|
|
79
|
-
@include term-closed-defaults();
|
|
82
|
+
.#{$block-class}__light {
|
|
83
|
+
.#{$block-class}__keyword {
|
|
84
|
+
&-closed {
|
|
85
|
+
@include keyword-closed-defaults();
|
|
80
86
|
|
|
81
|
-
|
|
82
|
-
|
|
87
|
+
border-color: $interactive-03;
|
|
88
|
+
background-color: transparent;
|
|
89
|
+
color: $interactive-03;
|
|
83
90
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
91
|
+
&:hover {
|
|
92
|
+
background-color: $interactive-03;
|
|
93
|
+
color: $inverse-01;
|
|
87
94
|
}
|
|
95
|
+
}
|
|
88
96
|
|
|
89
|
-
|
|
90
|
-
|
|
97
|
+
&-open {
|
|
98
|
+
@include keyword-open-defaults();
|
|
91
99
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
color: $text-01;
|
|
100
|
+
border-color: $interactive-03;
|
|
101
|
+
background-color: $interactive-03;
|
|
102
|
+
color: $inverse-01;
|
|
96
103
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
104
|
+
&:hover {
|
|
105
|
+
background-color: transparent;
|
|
106
|
+
color: $interactive-03;
|
|
101
107
|
}
|
|
102
108
|
}
|
|
109
|
+
}
|
|
103
110
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
@include carbon--theme($carbon--theme--g100, true);
|
|
107
|
-
@include term-closed-defaults();
|
|
111
|
+
.#{$block-class}__body {
|
|
112
|
+
@include body-defaults();
|
|
108
113
|
|
|
109
|
-
|
|
110
|
-
|
|
114
|
+
border-left-color: $text-01;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.#{$block-class}__dark {
|
|
119
|
+
.#{$block-class}__keyword {
|
|
120
|
+
&-closed {
|
|
121
|
+
@include carbon--theme($carbon--theme--g100, true);
|
|
122
|
+
@include keyword-closed-defaults();
|
|
111
123
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
124
|
+
border-color: $icon-03;
|
|
125
|
+
background-color: transparent;
|
|
126
|
+
color: $text-01;
|
|
127
|
+
|
|
128
|
+
&:hover {
|
|
129
|
+
background-color: $icon-03;
|
|
130
|
+
color: $inverse-01;
|
|
115
131
|
}
|
|
132
|
+
}
|
|
116
133
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
134
|
+
&-open {
|
|
135
|
+
@include carbon--theme($carbon--theme--g100, true);
|
|
136
|
+
@include keyword-open-defaults();
|
|
120
137
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
138
|
+
border-color: $icon-03;
|
|
139
|
+
background-color: $icon-03;
|
|
140
|
+
color: $inverse-01;
|
|
124
141
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
142
|
+
&:hover {
|
|
143
|
+
background-color: transparent;
|
|
144
|
+
color: $text-01;
|
|
129
145
|
}
|
|
130
146
|
}
|
|
131
147
|
}
|
|
132
148
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
// stylelint-disable-next-line carbon/theme-token-use
|
|
138
|
-
border-left-color: #6929c4;
|
|
139
|
-
// stylelint-disable-next-line carbon/theme-token-use
|
|
140
|
-
color: #6929c4;
|
|
141
|
-
}
|
|
149
|
+
.#{$block-class}__body {
|
|
150
|
+
@include carbon--theme($carbon--theme--g100, true);
|
|
151
|
+
@include body-defaults();
|
|
142
152
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
@include body-defaults();
|
|
153
|
+
border-left-color: $text-01;
|
|
154
|
+
color: $text-01;
|
|
146
155
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
color: #d4bbff;
|
|
156
|
+
// override default link color to compensate for a gradient background.
|
|
157
|
+
a {
|
|
158
|
+
color: $link-01;
|
|
151
159
|
}
|
|
152
160
|
}
|
|
153
161
|
}
|
|
154
162
|
}
|
|
163
|
+
|
|
155
164
|
@include exports('non-linear-reading') {
|
|
156
165
|
@include non-linear-reading;
|
|
157
166
|
}
|
|
@@ -11,3 +11,19 @@
|
|
|
11
11
|
#root {
|
|
12
12
|
@include carbon--type-style('body-long-01');
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
// The layout has been changed from middle/center to top/left, because
|
|
16
|
+
// the component can expand, and it looks weird when expanding vertically
|
|
17
|
+
// from the middle of the page instead of "dropping down" from above.
|
|
18
|
+
// Margin provides spacing from the edge of the viewport.
|
|
19
|
+
.non-linear-reading-stories__viewport {
|
|
20
|
+
margin: $spacing-10; // 64px
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.gradient-bg {
|
|
24
|
+
@include carbon--theme($carbon--theme--g100, true);
|
|
25
|
+
|
|
26
|
+
padding: $spacing-05;
|
|
27
|
+
background: linear-gradient(90deg, $blue-90 0%, $purple-70 100%);
|
|
28
|
+
color: $text-01;
|
|
29
|
+
}
|