@carbon/ibm-products 2.17.1 → 2.18.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +17078 -15669
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +71 -9
- 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 +5763 -6355
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +124 -9
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/Carousel/Carousel.docs-page.js +11 -0
- package/es/components/Carousel/Carousel.js +322 -0
- package/es/components/Carousel/CarouselItem.js +53 -0
- package/es/components/Carousel/index.js +9 -0
- package/es/components/Carousel/utils.js +98 -0
- package/es/components/CreateSidePanel/CreateSidePanel.js +7 -1
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +3 -1
- package/es/components/Datagrid/Datagrid/DatagridRow.js +13 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +4 -3
- package/es/components/Datagrid/Extensions/Filtering/Filtering.docs-page.js +7 -1
- package/es/components/Datagrid/useExpandedRow.js +3 -6
- package/es/components/Datagrid/useFocusRowExpander.js +40 -0
- package/es/components/Datagrid/useNestedRowExpander.js +9 -0
- package/es/components/Datagrid/useNestedRows.js +1 -5
- package/es/components/Datagrid/useRowExpander.js +9 -0
- package/es/components/Datagrid/useSelectRows.js +9 -2
- package/es/components/Datagrid/utils/handleFilterTagLabelText.js +26 -0
- package/es/components/EditSidePanel/EditSidePanel.js +8 -2
- package/es/components/FilterSummary/FilterSummary.js +21 -7
- package/es/components/Guidebanner/Guidebanner.docs-page.js +15 -0
- package/es/components/Guidebanner/Guidebanner.js +221 -0
- package/es/components/Guidebanner/GuidebannerElement.js +72 -0
- package/es/components/Guidebanner/GuidebannerElementButton.js +80 -0
- package/es/components/Guidebanner/GuidebannerElementLink.js +57 -0
- package/es/components/Guidebanner/index.js +11 -0
- package/es/components/NonLinearReading/NonLinearReading.docs-page.js +15 -0
- package/es/components/NonLinearReading/NonLinearReading.js +89 -0
- package/es/components/NonLinearReading/index.js +8 -0
- package/es/components/SidePanel/SidePanel.js +48 -27
- package/es/components/TagSet/TagSet.js +22 -5
- package/es/components/WebTerminal/WebTerminal.js +5 -3
- package/es/global/js/hooks/useCreateComponentStepChange.js +1 -1
- package/es/global/js/package-settings.js +6 -3
- package/lib/components/Carousel/Carousel.docs-page.js +21 -0
- package/lib/components/Carousel/Carousel.js +329 -0
- package/lib/components/Carousel/CarouselItem.js +54 -0
- package/lib/components/Carousel/index.js +19 -0
- package/lib/components/Carousel/utils.js +105 -0
- package/lib/components/CreateSidePanel/CreateSidePanel.js +7 -1
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +3 -1
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +13 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +4 -3
- package/lib/components/Datagrid/Extensions/Filtering/Filtering.docs-page.js +7 -1
- package/lib/components/Datagrid/useExpandedRow.js +2 -5
- package/lib/components/Datagrid/useFocusRowExpander.js +45 -0
- package/lib/components/Datagrid/useNestedRowExpander.js +9 -0
- package/lib/components/Datagrid/useNestedRows.js +1 -5
- package/lib/components/Datagrid/useRowExpander.js +9 -0
- package/lib/components/Datagrid/useSelectRows.js +9 -2
- package/lib/components/Datagrid/utils/handleFilterTagLabelText.js +32 -0
- package/lib/components/EditSidePanel/EditSidePanel.js +8 -2
- package/lib/components/FilterSummary/FilterSummary.js +24 -7
- package/lib/components/Guidebanner/Guidebanner.docs-page.js +25 -0
- package/lib/components/Guidebanner/Guidebanner.js +229 -0
- package/lib/components/Guidebanner/GuidebannerElement.js +77 -0
- package/lib/components/Guidebanner/GuidebannerElementButton.js +85 -0
- package/lib/components/Guidebanner/GuidebannerElementLink.js +62 -0
- package/lib/components/Guidebanner/index.js +33 -0
- package/lib/components/NonLinearReading/NonLinearReading.docs-page.js +25 -0
- package/lib/components/NonLinearReading/NonLinearReading.js +97 -0
- package/lib/components/NonLinearReading/index.js +12 -0
- package/lib/components/SidePanel/SidePanel.js +47 -26
- package/lib/components/TagSet/TagSet.js +22 -5
- package/lib/components/WebTerminal/WebTerminal.js +4 -2
- package/lib/global/js/hooks/useCreateComponentStepChange.js +1 -1
- package/lib/global/js/package-settings.js +6 -3
- package/package.json +5 -5
- package/scss/components/Carousel/_carbon-imports.scss +6 -0
- package/scss/components/Carousel/_carousel.scss +72 -0
- package/scss/components/Carousel/_index-with-carbon.scss +9 -0
- package/scss/components/Carousel/_index.scss +8 -0
- package/scss/components/Datagrid/styles/_useExpandedRow.scss +21 -0
- package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +9 -0
- package/scss/components/FilterSummary/_filter-summary.scss +6 -1
- package/scss/components/Guidebanner/_carbon-imports.scss +6 -0
- package/scss/components/Guidebanner/_guidebanner.scss +248 -0
- package/scss/components/Guidebanner/_index-with-carbon.scss +9 -0
- package/scss/components/Guidebanner/_index.scss +8 -0
- package/scss/components/NonLinearReading/_carbon-imports.scss +6 -0
- package/scss/components/NonLinearReading/_index-with-carbon.scss +9 -0
- package/scss/components/NonLinearReading/_index.scss +8 -0
- package/scss/components/NonLinearReading/_non-linear-reading.scss +122 -0
- package/scss/components/SidePanel/_side-panel.scss +22 -6
- package/scss/components/WebTerminal/_web-terminal.scss +1 -2
- package/scss/components/_Canary/_canary.scss +1 -2
- package/scss/components/_Canary/_carbon-imports.scss +7 -0
- package/scss/components/_Canary/_index-with-carbon.scss +8 -0
- package/scss/components/_Canary/_index.scss +7 -0
- package/scss/components/_index-with-carbon.scss +1 -1
- package/scss/components/_index.scss +5 -2
- /package/es/components/Datagrid/{Extensions → Datagrid.stories}/ColumnAlignment/ColumnAlignment.docs-page.js +0 -0
- /package/lib/components/Datagrid/{Extensions → Datagrid.stories}/ColumnAlignment/ColumnAlignment.docs-page.js +0 -0
@@ -20,10 +20,10 @@ var _useResizeObserver = require("../../global/js/hooks/useResizeObserver");
|
|
20
20
|
var _devtools = require("../../global/js/utils/devtools");
|
21
21
|
var _propsHelper = require("../../global/js/utils/props-helper");
|
22
22
|
var _settings = require("../../settings");
|
23
|
-
var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "overflowType", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags"],
|
23
|
+
var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "overflowType", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags", "containingElementRef", "measurementOffset"],
|
24
24
|
_excluded2 = ["label", "id"],
|
25
25
|
_excluded3 = ["label"]; //
|
26
|
-
// Copyright IBM Corp. 2020,
|
26
|
+
// Copyright IBM Corp. 2020, 2023
|
27
27
|
//
|
28
28
|
// This source code is licensed under the Apache-2.0 license found in the
|
29
29
|
// LICENSE file in the root directory of this source tree.
|
@@ -39,6 +39,7 @@ var allTagsModalSearchThreshold = 10;
|
|
39
39
|
// Default values for props
|
40
40
|
var defaults = {
|
41
41
|
align: 'start',
|
42
|
+
measurementOffset: 0,
|
42
43
|
overflowAlign: 'bottom',
|
43
44
|
overflowType: 'default'
|
44
45
|
};
|
@@ -59,6 +60,9 @@ var TagSet = exports.TagSet = /*#__PURE__*/_react.default.forwardRef(function (_
|
|
59
60
|
allTagsModalSearchPlaceholderText = _ref.allTagsModalSearchPlaceholderText,
|
60
61
|
showAllTagsLabel = _ref.showAllTagsLabel,
|
61
62
|
tags = _ref.tags,
|
63
|
+
containingElementRef = _ref.containingElementRef,
|
64
|
+
_ref$measurementOffse = _ref.measurementOffset,
|
65
|
+
measurementOffset = _ref$measurementOffse === void 0 ? defaults.measurementOffset : _ref$measurementOffse,
|
62
66
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
63
67
|
var _useState = (0, _react.useState)(3),
|
64
68
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
@@ -149,7 +153,9 @@ var TagSet = exports.TagSet = /*#__PURE__*/_react.default.forwardRef(function (_
|
|
149
153
|
// how many will fit?
|
150
154
|
var willFit = 0;
|
151
155
|
if (sizingTags.length > 0) {
|
152
|
-
var
|
156
|
+
var optionalContainingElement = containingElementRef === null || containingElementRef === void 0 ? void 0 : containingElementRef.current;
|
157
|
+
var measurementOffsetValue = typeof measurementOffset === 'number' ? measurementOffset : 0;
|
158
|
+
var spaceAvailable = optionalContainingElement ? optionalContainingElement.offsetWidth - measurementOffsetValue : tagSetRef.current.offsetWidth;
|
153
159
|
for (var i in sizingTags) {
|
154
160
|
var _sizingTags$i;
|
155
161
|
var tagWidth = ((_sizingTags$i = sizingTags[i]) === null || _sizingTags$i === void 0 ? void 0 : _sizingTags$i.offsetWidth) || 0;
|
@@ -173,7 +179,7 @@ var TagSet = exports.TagSet = /*#__PURE__*/_react.default.forwardRef(function (_
|
|
173
179
|
} else {
|
174
180
|
setDisplayCount(maxVisible ? Math.min(willFit, maxVisible) : willFit);
|
175
181
|
}
|
176
|
-
}, [maxVisible, multiline, sizingTags, tagSetRef]);
|
182
|
+
}, [maxVisible, multiline, sizingTags, tagSetRef, measurementOffset, containingElementRef]);
|
177
183
|
(0, _react.useEffect)(function () {
|
178
184
|
checkFullyVisibleTags();
|
179
185
|
}, [checkFullyVisibleTags, maxVisible, multiline, sizingTags]);
|
@@ -195,7 +201,8 @@ var TagSet = exports.TagSet = /*#__PURE__*/_react.default.forwardRef(function (_
|
|
195
201
|
setShowAllModalOpen(false);
|
196
202
|
};
|
197
203
|
(0, _useResizeObserver.useResizeObserver)(sizingContainerRef, handleSizerTagsResize);
|
198
|
-
|
204
|
+
var resizeOption = containingElementRef ? containingElementRef : tagSetRef;
|
205
|
+
(0, _useResizeObserver.useResizeObserver)(resizeOption, handleResize);
|
199
206
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
200
207
|
className: (0, _classnames.default)([blockClass, className]),
|
201
208
|
ref: tagSetRef
|
@@ -273,10 +280,20 @@ TagSet.propTypes = {
|
|
273
280
|
* className
|
274
281
|
*/
|
275
282
|
className: _propTypes.default.string,
|
283
|
+
/**
|
284
|
+
* Optional ref for custom resize container to measure available space
|
285
|
+
* Default will measure the available space of the TagSet container itself.
|
286
|
+
*/
|
287
|
+
containingElementRef: _propTypes.default.object,
|
276
288
|
/**
|
277
289
|
* maximum visible tags
|
278
290
|
*/
|
279
291
|
maxVisible: _propTypes.default.number,
|
292
|
+
/**
|
293
|
+
* Specify offset amount for measure available space, only used when `containingElementSelector`
|
294
|
+
* is also provided
|
295
|
+
*/
|
296
|
+
measurementOffset: _propTypes.default.number,
|
280
297
|
/**
|
281
298
|
* display tags in multiple lines
|
282
299
|
*/
|
@@ -164,9 +164,11 @@ var WebTerminal = exports.WebTerminal = /*#__PURE__*/_react.default.forwardRef(f
|
|
164
164
|
onAnimationEnd: function onAnimationEnd(event) {
|
165
165
|
return event.stopPropagation();
|
166
166
|
}
|
167
|
-
})), /*#__PURE__*/_react.default.createElement(
|
167
|
+
})), /*#__PURE__*/_react.default.createElement(_react2.Theme, {
|
168
|
+
theme: "g100"
|
169
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
168
170
|
className: "".concat(blockClass, "__body")
|
169
|
-
}, children)) : null;
|
171
|
+
}, children))) : null;
|
170
172
|
});
|
171
173
|
|
172
174
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -73,7 +73,7 @@ var useCreateComponentStepChange = exports.useCreateComponentStepChange = functi
|
|
73
73
|
(0, _react.useEffect)(function () {
|
74
74
|
var onUnmount = function onUnmount() {
|
75
75
|
if (componentName !== 'CreateFullPage') {
|
76
|
-
setCurrentStep(
|
76
|
+
setCurrentStep(1);
|
77
77
|
}
|
78
78
|
setIsSubmitting(false);
|
79
79
|
onClose();
|
@@ -78,15 +78,18 @@ var defaults = {
|
|
78
78
|
|
79
79
|
// Novice to pro components not yet reviewed and released:
|
80
80
|
Checklist: false,
|
81
|
-
|
81
|
+
Guidebanner: false,
|
82
|
+
GuidebannerElement: false,
|
83
|
+
GuidebannerElementButton: false,
|
84
|
+
GuidebannerElementLink: false,
|
85
|
+
InlineTip: false,
|
86
|
+
NonLinearReading: false
|
82
87
|
},
|
83
88
|
// feature level flags
|
84
89
|
feature: {
|
85
90
|
'default-portal-target-body': true,
|
86
91
|
'Datagrid.useInlineEdit': false,
|
87
92
|
'Datagrid.useEditableCell': false,
|
88
|
-
'Datagrid.useExpandedRow': false,
|
89
|
-
'Datagrid.useNestedRows': false,
|
90
93
|
'Datagrid.useFiltering': false,
|
91
94
|
'Datagrid.useCustomizeColumns': false,
|
92
95
|
'ExampleComponent.secondaryIcon': false,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.
|
4
|
+
"version": "2.18.0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -74,7 +74,7 @@
|
|
74
74
|
},
|
75
75
|
"dependencies": {
|
76
76
|
"@babel/runtime": "^7.22.10",
|
77
|
-
"@carbon/ibm-products-styles": "^2.
|
77
|
+
"@carbon/ibm-products-styles": "^2.18.0",
|
78
78
|
"@carbon/telemetry": "^0.1.0",
|
79
79
|
"@dnd-kit/core": "^6.0.8",
|
80
80
|
"@dnd-kit/sortable": "^7.0.2",
|
@@ -89,11 +89,11 @@
|
|
89
89
|
"@carbon/grid": "^11.21.1",
|
90
90
|
"@carbon/layout": "^11.20.1",
|
91
91
|
"@carbon/motion": "^11.16.1",
|
92
|
-
"@carbon/react": "^1.
|
93
|
-
"@carbon/themes": "^11.
|
92
|
+
"@carbon/react": "^1.44.0",
|
93
|
+
"@carbon/themes": "^11.28.0",
|
94
94
|
"@carbon/type": "^11.25.1",
|
95
95
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
96
96
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
97
97
|
},
|
98
|
-
"gitHead": "
|
98
|
+
"gitHead": "a683f659e575d3ee051af4702703888070501824"
|
99
99
|
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
//
|
2
|
+
// Copyright IBM Corp. 2023, 2023
|
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
|
+
// Standard imports.
|
9
|
+
@use '@carbon/layout/scss/convert' as *;
|
10
|
+
@use '@carbon/react/scss/colors' as *;
|
11
|
+
@use '@carbon/styles/scss/motion' as *;
|
12
|
+
@use '@carbon/styles/scss/spacing' as *;
|
13
|
+
@use '@carbon/styles/scss/theme' as *;
|
14
|
+
@use '@carbon/styles/scss/themes';
|
15
|
+
@use '@carbon/styles/scss/type' as *;
|
16
|
+
@use '../../global/styles/project-settings' as c4p-settings;
|
17
|
+
|
18
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
19
|
+
$block-class: #{c4p-settings.$pkg-prefix}--carousel;
|
20
|
+
|
21
|
+
.#{$block-class} {
|
22
|
+
position: relative;
|
23
|
+
|
24
|
+
/* stylelint-disable-next-line max-nesting-depth */
|
25
|
+
&:focus {
|
26
|
+
outline: none;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
.#{$block-class}__elements-container {
|
30
|
+
overflow: hidden;
|
31
|
+
}
|
32
|
+
.#{$block-class}__elements-container--scrolled,
|
33
|
+
.#{$block-class}__elements-container--scroll-max {
|
34
|
+
position: absolute;
|
35
|
+
z-index: 1;
|
36
|
+
top: 0;
|
37
|
+
bottom: 0;
|
38
|
+
width: $spacing-07;
|
39
|
+
pointer-events: none;
|
40
|
+
}
|
41
|
+
|
42
|
+
.#{$block-class}__elements-container--scrolled {
|
43
|
+
left: 0;
|
44
|
+
}
|
45
|
+
|
46
|
+
.#{$block-class}__elements-container--scroll-max {
|
47
|
+
right: 0;
|
48
|
+
}
|
49
|
+
|
50
|
+
.#{$block-class}__elements {
|
51
|
+
display: flex;
|
52
|
+
overflow: scroll;
|
53
|
+
-ms-overflow-style: none;
|
54
|
+
scroll-behavior: smooth;
|
55
|
+
scroll-snap-type: x mandatory;
|
56
|
+
scrollbar-width: none;
|
57
|
+
-webkit-touch-callout: none;
|
58
|
+
-webkit-user-select: none;
|
59
|
+
-khtml-user-select: none;
|
60
|
+
-moz-user-select: none;
|
61
|
+
-ms-user-select: none;
|
62
|
+
user-select: none;
|
63
|
+
|
64
|
+
/* stylelint-disable-next-line max-nesting-depth */
|
65
|
+
@media (prefers-reduced-motion) {
|
66
|
+
scroll-behavior: auto;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
.#{$block-class}__elements::-webkit-scrollbar {
|
71
|
+
display: none;
|
72
|
+
}
|
@@ -71,3 +71,24 @@
|
|
71
71
|
td {
|
72
72
|
background: $layer-hover;
|
73
73
|
}
|
74
|
+
|
75
|
+
.#{variables.$block-class}
|
76
|
+
.#{c4p-settings.$carbon-prefix}--data-table
|
77
|
+
tbody
|
78
|
+
tr:hover
|
79
|
+
td.#{variables.$block-class}__expanded-row-cell-wrapper,
|
80
|
+
.#{variables.$block-class}
|
81
|
+
.#{c4p-settings.$carbon-prefix}--data-table
|
82
|
+
td.#{variables.$block-class}__expanded-row-cell-wrapper,
|
83
|
+
.#{variables.$block-class}
|
84
|
+
.#{c4p-settings.$carbon-prefix}--data-table
|
85
|
+
.#{variables.$block-class}__carbon-row-expanded
|
86
|
+
td.#{variables.$block-class}__expandable-row-cell {
|
87
|
+
border: none;
|
88
|
+
}
|
89
|
+
|
90
|
+
.#{variables.$block-class}
|
91
|
+
.#{c4p-settings.$carbon-prefix}--data-table
|
92
|
+
td.#{variables.$block-class}__expanded-row-cell-wrapper {
|
93
|
+
padding: 0;
|
94
|
+
}
|
@@ -84,3 +84,12 @@
|
|
84
84
|
.#{variables.$block-class}__row-size__row-settings-trigger--open.#{c4p-settings.$carbon-prefix}--btn--ghost {
|
85
85
|
background-color: $layer-02;
|
86
86
|
}
|
87
|
+
|
88
|
+
.#{variables.$block-class}
|
89
|
+
table.#{c4p-settings.$carbon-prefix}--data-table--xl.#{variables.$block-class}__vertical-align-center
|
90
|
+
td.#{variables.$block-class}__expandable-row-cell,
|
91
|
+
.#{variables.$block-class}
|
92
|
+
table.#{c4p-settings.$carbon-prefix}--data-table--xl.#{variables.$block-class}__vertical-align-top
|
93
|
+
td.#{variables.$block-class}__expandable-row-cell {
|
94
|
+
padding-top: $spacing-03;
|
95
|
+
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
//
|
2
|
-
// Copyright IBM Corp. 2022
|
2
|
+
// Copyright IBM Corp. 2022, 2023
|
3
3
|
//
|
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.
|
@@ -21,3 +21,8 @@ $block-class: #{$pkg-prefix}--filter-summary;
|
|
21
21
|
border-top: 1px solid $border-subtle-01;
|
22
22
|
background: $layer-01;
|
23
23
|
}
|
24
|
+
|
25
|
+
.#{$block-class}
|
26
|
+
.#{$pkg-prefix}--tag-set.#{$pkg-prefix}--tag-set.#{$block-class}__clear-button-inline {
|
27
|
+
width: auto;
|
28
|
+
}
|
@@ -0,0 +1,248 @@
|
|
1
|
+
//
|
2
|
+
// Copyright IBM Corp. 2023, 2023
|
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
|
+
/**
|
9
|
+
* The Guidebanner specifically is theme-agnostic, and so we have to
|
10
|
+
* use color tokens to keep the colors static instead of theme tokens
|
11
|
+
* that will change depending on the selected theme.
|
12
|
+
*
|
13
|
+
* Because of this, we are triggering a *large* amount of linting errors.
|
14
|
+
* So, we're adding a few "disable" rules for the file instead of 60
|
15
|
+
* individual rules.
|
16
|
+
*/
|
17
|
+
|
18
|
+
/* stylelint-disable carbon/layout-token-use */
|
19
|
+
/* stylelint-disable carbon/motion-duration-use */
|
20
|
+
/* stylelint-disable carbon/theme-token-use */
|
21
|
+
/* stylelint-disable declaration-no-important */
|
22
|
+
/* stylelint-disable function-no-unknown */
|
23
|
+
/* stylelint-disable max-nesting-depth */
|
24
|
+
|
25
|
+
// Standard imports.
|
26
|
+
@use '@carbon/layout/scss/convert' as *;
|
27
|
+
@use '@carbon/react/scss/colors' as *;
|
28
|
+
@use '@carbon/styles/scss/motion' as *;
|
29
|
+
@use '@carbon/styles/scss/spacing' as *;
|
30
|
+
@use '@carbon/styles/scss/theme' as *;
|
31
|
+
@use '@carbon/styles/scss/themes';
|
32
|
+
@use '@carbon/styles/scss/type' as *;
|
33
|
+
@use '../../global/styles/project-settings' as c4p-settings;
|
34
|
+
|
35
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
36
|
+
$block-class: #{c4p-settings.$pkg-prefix}--guidebanner;
|
37
|
+
|
38
|
+
// Each GuidebannerElement is contained in a CarouselItem.
|
39
|
+
$carousel-item: #{c4p-settings.$pkg-prefix}--carousel__item;
|
40
|
+
|
41
|
+
@mixin when-collapsed($selector: '&') {
|
42
|
+
.#{c4p-settings.$pkg-prefix}--guidebanner__collapsible-collapsed
|
43
|
+
#{$selector} {
|
44
|
+
@content;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
$horizontal-margin: to-rem(52px);
|
49
|
+
// Guidebanner-specific colors.
|
50
|
+
$purple-1: #9b63ff;
|
51
|
+
$purple-2: #7f3ae7;
|
52
|
+
$purple-3: #7433e3;
|
53
|
+
|
54
|
+
.#{$block-class} {
|
55
|
+
// Due to the Guidebanner's dark background,
|
56
|
+
// apply dark theme by default for all elements:
|
57
|
+
// i.e. light text, icons, tooltips, etc.
|
58
|
+
@include theme(themes.$g100, true);
|
59
|
+
|
60
|
+
position: relative;
|
61
|
+
background: linear-gradient(90deg, $blue-90 0%, $purple-70 100%);
|
62
|
+
background-color: $blue-90;
|
63
|
+
}
|
64
|
+
|
65
|
+
.#{$block-class}__icon-idea {
|
66
|
+
position: absolute;
|
67
|
+
top: $spacing-05;
|
68
|
+
left: $spacing-05;
|
69
|
+
|
70
|
+
path {
|
71
|
+
fill: $gray-10;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
.#{$block-class}__title {
|
76
|
+
@include type-style('heading-compact-02');
|
77
|
+
|
78
|
+
padding: $spacing-05 to-rem(175px) 0 $horizontal-margin;
|
79
|
+
color: $gray-10;
|
80
|
+
}
|
81
|
+
|
82
|
+
.#{$block-class}__close-button {
|
83
|
+
position: absolute;
|
84
|
+
top: 0;
|
85
|
+
right: 0;
|
86
|
+
}
|
87
|
+
.#{$block-class}__close-button button {
|
88
|
+
width: $spacing-07;
|
89
|
+
height: $spacing-07;
|
90
|
+
min-height: $spacing-07;
|
91
|
+
padding-top: 6px;
|
92
|
+
|
93
|
+
&:active,
|
94
|
+
&:hover {
|
95
|
+
background-color: $purple-3;
|
96
|
+
}
|
97
|
+
|
98
|
+
path {
|
99
|
+
fill: $white-0;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
// Specify Carousel look and feel.
|
104
|
+
.#{$block-class}__carousel {
|
105
|
+
padding: 0 0 $spacing-05 0;
|
106
|
+
color: $gray-10;
|
107
|
+
|
108
|
+
@include when-collapsed() {
|
109
|
+
margin-bottom: 0;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
// All carousel elements are 400px wide,
|
114
|
+
// except the last one (see below).
|
115
|
+
.#{$block-class}__carousel .#{$carousel-item} .#{$block-class}__element {
|
116
|
+
display: flex;
|
117
|
+
width: to-rem(400px); // 25rem
|
118
|
+
max-height: to-rem(512px); // 32rem
|
119
|
+
flex-flow: column;
|
120
|
+
flex-shrink: 0;
|
121
|
+
padding-left: $horizontal-margin;
|
122
|
+
margin: $spacing-05 0 0 0;
|
123
|
+
opacity: 1;
|
124
|
+
scroll-snap-align: start;
|
125
|
+
transition: max-height 50ms motion(exit, productive),
|
126
|
+
margin-top 50ms motion(exit, productive),
|
127
|
+
opacity 300ms motion(exit, productive);
|
128
|
+
|
129
|
+
@include when-collapsed() {
|
130
|
+
max-height: $spacing-03;
|
131
|
+
margin-top: 0;
|
132
|
+
opacity: 0;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
// The last carousel item is wider, with more padding-right,
|
136
|
+
// to provide more space against the right edge of the carousel.
|
137
|
+
.#{$block-class}__carousel
|
138
|
+
.#{$carousel-item}:last-child
|
139
|
+
.#{$block-class}__element {
|
140
|
+
width: to-rem(448px); // 28rem
|
141
|
+
padding-right: $horizontal-margin;
|
142
|
+
}
|
143
|
+
|
144
|
+
.#{$block-class}__carousel .#{$carousel-item} .#{$block-class}__element-title {
|
145
|
+
@include type-style('heading-compact-01');
|
146
|
+
|
147
|
+
margin: $spacing-05 0 0 0;
|
148
|
+
}
|
149
|
+
|
150
|
+
.#{$block-class}__carousel .#{$block-class}__element-content {
|
151
|
+
@include type-style('body-01');
|
152
|
+
|
153
|
+
margin-bottom: $spacing-05;
|
154
|
+
}
|
155
|
+
|
156
|
+
// Button with crossroads icon
|
157
|
+
.#{$block-class}__carousel .#{c4p-settings.$carbon-prefix}--btn--tertiary {
|
158
|
+
border-color: $white-0;
|
159
|
+
color: $white-0;
|
160
|
+
|
161
|
+
&:active,
|
162
|
+
&:hover {
|
163
|
+
border-color: $white-0;
|
164
|
+
background-color: $white-0;
|
165
|
+
color: $gray-100;
|
166
|
+
}
|
167
|
+
|
168
|
+
// The "render icon" CSS seems to be missing in the latest Carbon button.
|
169
|
+
// Specifically, getting the icon to move to right-hand side of the content area.
|
170
|
+
// Repeating here.
|
171
|
+
svg {
|
172
|
+
position: absolute;
|
173
|
+
right: 1rem;
|
174
|
+
width: 1rem;
|
175
|
+
height: 1rem;
|
176
|
+
flex-shrink: 0;
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
.#{$block-class}__carousel .#{c4p-settings.$carbon-prefix}--btn--ghost {
|
181
|
+
margin-left: calc(-1 * $spacing-05);
|
182
|
+
color: $blue-30;
|
183
|
+
|
184
|
+
&:active,
|
185
|
+
&:hover {
|
186
|
+
background-color: $purple-2;
|
187
|
+
color: $gray-10;
|
188
|
+
}
|
189
|
+
}
|
190
|
+
|
191
|
+
.#{$block-class}__carousel .#{$block-class}__element-link {
|
192
|
+
color: $blue-30;
|
193
|
+
|
194
|
+
&:visited {
|
195
|
+
color: $blue-30;
|
196
|
+
}
|
197
|
+
|
198
|
+
&:active,
|
199
|
+
&:hover {
|
200
|
+
color: $blue-20;
|
201
|
+
}
|
202
|
+
}
|
203
|
+
|
204
|
+
.#{$block-class}__navigation {
|
205
|
+
display: flex;
|
206
|
+
border-top: to-rem(1px) solid $purple-60;
|
207
|
+
|
208
|
+
@include when-collapsed() {
|
209
|
+
border-top: none;
|
210
|
+
}
|
211
|
+
}
|
212
|
+
.#{$block-class}__navigation .#{$block-class}__toggle-button {
|
213
|
+
margin-left: calc($horizontal-margin - to-rem(18px));
|
214
|
+
color: $blue-30;
|
215
|
+
|
216
|
+
&:active,
|
217
|
+
&:hover {
|
218
|
+
background-color: $purple-3;
|
219
|
+
color: $gray-10;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
// Push navigation buttons to the right
|
224
|
+
.#{$block-class}__navigation .#{$block-class}__back-button {
|
225
|
+
margin-left: auto;
|
226
|
+
}
|
227
|
+
// Hide navigation buttons when collapsed
|
228
|
+
.#{$block-class}__navigation .#{$block-class}__back-button,
|
229
|
+
.#{$block-class}__navigation .#{$block-class}__next-button {
|
230
|
+
@include when-collapsed() {
|
231
|
+
display: none;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
.#{$block-class}__navigation .#{$block-class}__back-button button,
|
235
|
+
.#{$block-class}__navigation .#{$block-class}__next-button button {
|
236
|
+
&:active,
|
237
|
+
&:hover {
|
238
|
+
background-color: $purple-3;
|
239
|
+
}
|
240
|
+
|
241
|
+
path {
|
242
|
+
fill: $white-0;
|
243
|
+
}
|
244
|
+
|
245
|
+
&[disabled] path {
|
246
|
+
fill: $purple-1;
|
247
|
+
}
|
248
|
+
}
|