@carbon/ibm-products 2.18.1 → 2.19.1
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/index-full-carbon.css +460 -120
- 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 +113 -49
- 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 +141 -49
- 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 +127 -50
- 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/APIKeyModal/APIKeyModal.js +1 -1
- package/es/components/Card/Card.js +11 -2
- package/es/components/Card/CardHeader.js +41 -3
- package/es/components/CreateSidePanel/CreateSidePanel.js +4 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +2 -1
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +98 -47
- package/es/components/Datagrid/Datagrid/DatagridRow.js +14 -4
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +0 -3
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +55 -30
- package/es/components/Datagrid/Extensions/Filtering/Filtering.docs-page.js +1 -1
- package/es/components/Datagrid/useFiltering.js +2 -1
- package/es/components/EditSidePanel/EditSidePanel.js +4 -0
- package/es/components/ExpressiveCard/ExpressiveCard.js +5 -0
- package/es/components/Guidebanner/Guidebanner.js +12 -3
- package/es/components/InlineTip/InlineTip.js +17 -6
- package/es/components/InlineTip/InlineTipButton.js +2 -0
- package/es/components/InlineTip/InlineTipLink.js +2 -0
- package/es/components/ProductiveCard/ProductiveCard.js +5 -0
- package/es/components/SidePanel/SidePanel.js +7 -6
- package/es/components/index.js +4 -1
- package/es/global/js/package-settings.js +2 -0
- package/lib/components/APIKeyModal/APIKeyModal.js +1 -1
- package/lib/components/Card/Card.js +13 -4
- package/lib/components/Card/CardHeader.js +40 -2
- package/lib/components/CreateSidePanel/CreateSidePanel.js +4 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +105 -53
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +14 -4
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +0 -3
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +2 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +55 -30
- package/lib/components/Datagrid/Extensions/Filtering/Filtering.docs-page.js +1 -1
- package/lib/components/Datagrid/useFiltering.js +2 -1
- package/lib/components/EditSidePanel/EditSidePanel.js +4 -0
- package/lib/components/ExpressiveCard/ExpressiveCard.js +5 -0
- package/lib/components/Guidebanner/Guidebanner.js +12 -3
- package/lib/components/InlineTip/InlineTip.js +17 -6
- package/lib/components/InlineTip/InlineTipButton.js +2 -0
- package/lib/components/InlineTip/InlineTipLink.js +2 -0
- package/lib/components/ProductiveCard/ProductiveCard.js +5 -0
- package/lib/components/SidePanel/SidePanel.js +7 -6
- package/lib/components/index.js +52 -1
- package/lib/global/js/package-settings.js +2 -0
- package/package.json +5 -5
- package/scss/components/Card/_card.scss +89 -0
- package/scss/components/Guidebanner/_guidebanner.scss +25 -0
- package/scss/components/InlineTip/_inline-tip.scss +12 -0
- package/scss/components/ProductiveCard/_productive-card.scss +0 -5
- package/scss/components/SidePanel/_side-panel.scss +41 -23
@@ -61,16 +61,21 @@ var useFilters = function useFilters(_ref2) {
|
|
61
61
|
_ref2$onCancel = _ref2.onCancel,
|
62
62
|
onCancel = _ref2$onCancel === void 0 ? function () {} : _ref2$onCancel,
|
63
63
|
panelOpen = _ref2.panelOpen,
|
64
|
-
autoHideFilters = _ref2.autoHideFilters
|
64
|
+
autoHideFilters = _ref2.autoHideFilters,
|
65
|
+
isFetching = _ref2.isFetching;
|
65
66
|
/** State */
|
66
67
|
var _useState = (0, _react2.useState)((0, _utils.getInitialStateFromFilters)(filters, variation, reactTableFiltersState)),
|
67
68
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
68
69
|
filtersState = _useState2[0],
|
69
70
|
setFiltersState = _useState2[1];
|
70
|
-
var _useState3 = (0, _react2.useState)(
|
71
|
+
var _useState3 = (0, _react2.useState)(false),
|
71
72
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
72
|
-
|
73
|
-
|
73
|
+
fetchingReset = _useState4[0],
|
74
|
+
setFetchingReset = _useState4[1];
|
75
|
+
var _useState5 = (0, _react2.useState)(reactTableFiltersState),
|
76
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
77
|
+
filtersObjectArray = _useState6[0],
|
78
|
+
setFiltersObjectArray = _useState6[1];
|
74
79
|
var previousState = (0, _hooks.usePreviousValue)({
|
75
80
|
panelOpen: panelOpen
|
76
81
|
});
|
@@ -113,6 +118,7 @@ var useFilters = function useFilters(_ref2) {
|
|
113
118
|
// Update their respective refs so everything is in sync
|
114
119
|
prevFiltersRef.current = JSON.stringify(initialFiltersState);
|
115
120
|
prevFiltersObjectArrayRef.current = JSON.stringify(initialFiltersObjectArray);
|
121
|
+
lastAppliedFilters.current = JSON.stringify([]);
|
116
122
|
}, [filters, setAllFilters, variation]);
|
117
123
|
var applyFilters = function applyFilters(_ref3) {
|
118
124
|
var column = _ref3.column,
|
@@ -203,7 +209,7 @@ var useFilters = function useFilters(_ref2) {
|
|
203
209
|
};
|
204
210
|
/** Render the individual filter component */
|
205
211
|
var renderFilter = function renderFilter(_ref4) {
|
206
|
-
var _filtersState$
|
212
|
+
var _filtersState$column3, _filtersState$column4;
|
207
213
|
var type = _ref4.type,
|
208
214
|
column = _ref4.column,
|
209
215
|
components = _ref4.props;
|
@@ -295,31 +301,36 @@ var useFilters = function useFilters(_ref2) {
|
|
295
301
|
filter = renderCheckboxes();
|
296
302
|
break;
|
297
303
|
case _constants.RADIO:
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
}, radio)
|
322
|
-
|
304
|
+
{
|
305
|
+
var _filtersState$column, _components$DefaultRa, _components$DefaultRa2, _filtersState$column2, _components$DefaultRa3, _components$DefaultRa4, _components$DefaultRa5, _components$DefaultRa6, _components$DefaultRa7, _components$DefaultRa8;
|
306
|
+
var _components$RadioButt = _objectSpread({}, components.RadioButtonGroup),
|
307
|
+
name = _components$RadioButt.name;
|
308
|
+
filter = /*#__PURE__*/_react2.default.createElement(_react.FormGroup, components.FormGroup, /*#__PURE__*/_react2.default.createElement(_react.RadioButtonGroup, (0, _extends2.default)({}, components.RadioButtonGroup, {
|
309
|
+
valueSelected: ((_filtersState$column = filtersState[column]) === null || _filtersState$column === void 0 ? void 0 : _filtersState$column.value) === '' ? (_components$DefaultRa = (_components$DefaultRa2 = components.DefaultRadioButton) === null || _components$DefaultRa2 === void 0 ? void 0 : _components$DefaultRa2.value) !== null && _components$DefaultRa !== void 0 ? _components$DefaultRa : 'Any' : (_filtersState$column2 = filtersState[column]) === null || _filtersState$column2 === void 0 ? void 0 : _filtersState$column2.value,
|
310
|
+
onChange: function onChange(selected) {
|
311
|
+
var _components$RadioButt2, _components$RadioButt3;
|
312
|
+
setFiltersState(_objectSpread(_objectSpread({}, filtersState), {}, (0, _defineProperty2.default)({}, column, {
|
313
|
+
value: selected,
|
314
|
+
type: type
|
315
|
+
})));
|
316
|
+
applyFilters({
|
317
|
+
column: column,
|
318
|
+
value: selected,
|
319
|
+
type: type
|
320
|
+
});
|
321
|
+
(_components$RadioButt2 = (_components$RadioButt3 = components.RadioButtonGroup).onChange) === null || _components$RadioButt2 === void 0 || _components$RadioButt2.call(_components$RadioButt3, selected);
|
322
|
+
}
|
323
|
+
}), /*#__PURE__*/_react2.default.createElement(_react.RadioButton, (0, _extends2.default)({
|
324
|
+
id: (_components$DefaultRa3 = components === null || components === void 0 || (_components$DefaultRa4 = components.DefaultRadioButton) === null || _components$DefaultRa4 === void 0 ? void 0 : _components$DefaultRa4.id) !== null && _components$DefaultRa3 !== void 0 ? _components$DefaultRa3 : "any__".concat(name),
|
325
|
+
labelText: (_components$DefaultRa5 = components === null || components === void 0 || (_components$DefaultRa6 = components.DefaultRadioButton) === null || _components$DefaultRa6 === void 0 ? void 0 : _components$DefaultRa6.labelText) !== null && _components$DefaultRa5 !== void 0 ? _components$DefaultRa5 : 'Any',
|
326
|
+
value: (_components$DefaultRa7 = components === null || components === void 0 || (_components$DefaultRa8 = components.DefaultRadioButton) === null || _components$DefaultRa8 === void 0 ? void 0 : _components$DefaultRa8.value) !== null && _components$DefaultRa7 !== void 0 ? _components$DefaultRa7 : 'Any'
|
327
|
+
}, components.DefaultRadioButton)), components.RadioButton.map(function (radio) {
|
328
|
+
var _ref6, _radio$id;
|
329
|
+
return /*#__PURE__*/_react2.default.createElement(_react.RadioButton, (0, _extends2.default)({
|
330
|
+
key: (_ref6 = (_radio$id = radio.id) !== null && _radio$id !== void 0 ? _radio$id : radio.labelText) !== null && _ref6 !== void 0 ? _ref6 : radio.value
|
331
|
+
}, radio));
|
332
|
+
})));
|
333
|
+
}
|
323
334
|
break;
|
324
335
|
case _constants.DROPDOWN:
|
325
336
|
filter = /*#__PURE__*/_react2.default.createElement(_react.Dropdown, (0, _extends2.default)({}, components.Dropdown, {
|
@@ -371,6 +382,20 @@ var useFilters = function useFilters(_ref2) {
|
|
371
382
|
}
|
372
383
|
}
|
373
384
|
}, [panelOpen, previousState, previousState === null || previousState === void 0 ? void 0 : previousState.panelOpen, reset, setAllFilters, revertToPreviousFilters]);
|
385
|
+
|
386
|
+
// Re-applies filters if the Datagrid goes into a fetching state while panel is open
|
387
|
+
// and has had filters changed without applying
|
388
|
+
(0, _react2.useEffect)(function () {
|
389
|
+
if (isFetching && !fetchingReset) {
|
390
|
+
setFiltersState(JSON.parse(prevFiltersRef.current));
|
391
|
+
setFiltersObjectArray(JSON.parse(prevFiltersRef.current));
|
392
|
+
setAllFilters(JSON.parse(prevFiltersObjectArrayRef.current));
|
393
|
+
setFetchingReset(true);
|
394
|
+
}
|
395
|
+
if (!isFetching) {
|
396
|
+
setFetchingReset(false);
|
397
|
+
}
|
398
|
+
}, [isFetching, reactTableFiltersState, setAllFilters, fetchingReset]);
|
374
399
|
var cancel = function cancel() {
|
375
400
|
// Reverting to previous filters only applies when using batch actions
|
376
401
|
if (updateMethod === _constants.BATCH) {
|
@@ -43,7 +43,7 @@ var DocsPage = exports.DocsPage = function DocsPage() {
|
|
43
43
|
subTitle: 'Create your filters for flyout variant',
|
44
44
|
description: "To add filters to the flyout, you have to pass in an array of filters. These filters will be converted to it's respective component. Each filters has 3 important props, `type`, `column`, `props`.\n- `type`: the type of filter (this should be the same `filter` property in the headers)\n- `column`: the column that it should be filtered on\n- `props`: the props for the components needed to render the filter.\n\nPlease refer to all the available filters that you can use below.\n ",
|
45
45
|
source: {
|
46
|
-
code: "\nconst filters = [\n {\n type: 'date',\n column: 'joined',\n props: {\n DatePicker: {\n datePickerType: 'range',\n // Add any other Carbon DatePicker props here\n },\n DatePickerInput: {\n start: {\n id: 'date-picker-input-id-start',\n placeholder: 'mm/dd/yyyy',\n labelText: 'Joined start date',\n // Add any other Carbon DatePickerInput props here\n },\n end: {\n id: 'date-picker-input-id-end',\n placeholder: 'mm/dd/yyyy',\n labelText: 'Joined end date',\n // Add any other Carbon DatePickerInput props here\n },\n },\n },\n },\n {\n type: 'number',\n column: 'visits',\n props: {\n NumberInput: {\n min: 0,\n id: 'visits-number-input',\n invalidText: 'A valid value is required',\n label: 'Visits',\n placeholder: 'Type a number amount of visits',\n // Add any other Carbon NumberInput props here\n },\n },\n },\n {\n type: 'checkbox',\n column: 'passwordStrength',\n props: {\n FormGroup: {\n legendText: 'Password strength',\n // Add any other Carbon FormGroup props here\n },\n Checkbox: [\n {\n id: 'normal',\n labelText: 'Normal',\n value: 'normal',\n // Add any other Carbon Checkbox props here\n },\n {\n id: 'minor-warning',\n labelText: 'Minor warning',\n value: 'minor-warning',\n // Add any other Carbon Checkbox props here\n },\n {\n id: 'critical',\n labelText: 'Critical',\n value: 'critical',\n // Add any other Carbon Checkbox props here\n },\n ],\n },\n },\n {\n type: 'radio',\n column: 'role',\n props: {\n FormGroup: {\n legendText: 'Role',\n // Add any other Carbon FormGroup props here\n },\n RadioButtonGroup: {\n orientation: 'vertical',\n legend: 'Role legend',\n name: 'role-radio-button-group',\n // Add any other Carbon RadioButtonGroup props here\n },\n RadioButton: [\n {\n id: 'developer',\n labelText: 'Developer',\n value: 'developer',\n // Add any other Carbon RadioButton props here\n },\n {\n id: 'designer',\n labelText: 'Designer',\n value: 'designer',\n // Add any other Carbon RadioButton props here\n },\n {\n id: 'researcher',\n labelText: 'Researcher',\n value: 'researcher',\n // Add any other Carbon RadioButton props here\n },\n ],\n },\n },\n {\n type: 'dropdown',\n column: 'status',\n props: {\n Dropdown: {\n id: 'marital-status-dropdown',\n ariaLabel: 'Marital status dropdown',\n items: ['relationship', 'complicated', 'single'],\n label: 'Marital status',\n titleText: 'Marital status',\n // Add any other Carbon Dropdown props here\n },\n },\n },\n];\n "
|
46
|
+
code: "\nconst filters = [\n {\n type: 'date',\n column: 'joined',\n props: {\n DatePicker: {\n datePickerType: 'range',\n // Add any other Carbon DatePicker props here\n },\n DatePickerInput: {\n start: {\n id: 'date-picker-input-id-start',\n placeholder: 'mm/dd/yyyy',\n labelText: 'Joined start date',\n // Add any other Carbon DatePickerInput props here\n },\n end: {\n id: 'date-picker-input-id-end',\n placeholder: 'mm/dd/yyyy',\n labelText: 'Joined end date',\n // Add any other Carbon DatePickerInput props here\n },\n },\n },\n },\n {\n type: 'number',\n column: 'visits',\n props: {\n NumberInput: {\n min: 0,\n id: 'visits-number-input',\n invalidText: 'A valid value is required',\n label: 'Visits',\n placeholder: 'Type a number amount of visits',\n // Add any other Carbon NumberInput props here\n },\n },\n },\n {\n type: 'checkbox',\n column: 'passwordStrength',\n props: {\n FormGroup: {\n legendText: 'Password strength',\n // Add any other Carbon FormGroup props here\n },\n Checkbox: [\n {\n id: 'normal',\n labelText: 'Normal',\n value: 'normal',\n // Add any other Carbon Checkbox props here\n },\n {\n id: 'minor-warning',\n labelText: 'Minor warning',\n value: 'minor-warning',\n // Add any other Carbon Checkbox props here\n },\n {\n id: 'critical',\n labelText: 'Critical',\n value: 'critical',\n // Add any other Carbon Checkbox props here\n },\n ],\n },\n },\n {\n type: 'radio',\n column: 'role',\n props: {\n FormGroup: {\n legendText: 'Role',\n // Add any other Carbon FormGroup props here\n },\n RadioButtonGroup: {\n orientation: 'vertical',\n legend: 'Role legend',\n name: 'role-radio-button-group',\n // Add any other Carbon RadioButtonGroup props here\n },\n RadioButton: [\n {\n id: 'developer',\n labelText: 'Developer',\n value: 'developer',\n // Add any other Carbon RadioButton props here\n },\n {\n id: 'designer',\n labelText: 'Designer',\n value: 'designer',\n // Add any other Carbon RadioButton props here\n },\n {\n id: 'researcher',\n labelText: 'Researcher',\n value: 'researcher',\n // Add any other Carbon RadioButton props here\n },\n ],\n DefaultRadioButton: {\n id: 'any__unique-id-for-any-radio-button',\n labelText: 'Any',\n value: 'Any',\n // Add any other Carbon RadioButton props here\n }\n },\n },\n {\n type: 'dropdown',\n column: 'status',\n props: {\n Dropdown: {\n id: 'marital-status-dropdown',\n ariaLabel: 'Marital status dropdown',\n items: ['relationship', 'complicated', 'single'],\n label: 'Marital status',\n titleText: 'Marital status',\n // Add any other Carbon Dropdown props here\n },\n },\n },\n];\n "
|
47
47
|
}
|
48
48
|
}, {
|
49
49
|
subTitle: 'Create your filters for panel variant',
|
@@ -33,7 +33,8 @@ var useFiltering = function useFiltering(hooks) {
|
|
33
33
|
var rowValue = row.values[id];
|
34
34
|
var startDateObj = (0, _typeof2.default)(startDate) === 'object' ? startDate : new Date(startDate);
|
35
35
|
var endDateObj = (0, _typeof2.default)(endDate) === 'object' ? endDate : new Date(endDate);
|
36
|
-
|
36
|
+
var rowValueDateObj = (0, _typeof2.default)(rowValue) === 'object' ? rowValue : new Date(rowValue);
|
37
|
+
if (rowValueDateObj.getTime() <= endDateObj.getTime() && rowValueDateObj.getTime() >= startDateObj.getTime()) {
|
37
38
|
// In date range
|
38
39
|
return true;
|
39
40
|
} else {
|
@@ -191,6 +191,10 @@ EditSidePanel.propTypes = {
|
|
191
191
|
* Specifies which DOM element in the form should be focused.
|
192
192
|
*/
|
193
193
|
slideIn: _propTypes.default.bool,
|
194
|
+
/**
|
195
|
+
* **Experimental:** Provide a `Slug` component to be rendered inside the `SidePanel` component
|
196
|
+
*/
|
197
|
+
slug: _propTypes.default.node,
|
194
198
|
/**
|
195
199
|
* The subtitle of the CreateSidePanel is optional and serves to provide more information about the modal.
|
196
200
|
*/
|
@@ -116,6 +116,11 @@ ExpressiveCard.propTypes = {
|
|
116
116
|
* The text that's displayed in the secondary button
|
117
117
|
*/
|
118
118
|
secondaryButtonText: _propTypes.default.string,
|
119
|
+
/**
|
120
|
+
* **Experimental:** For all cases a `Slug` component can be provided.
|
121
|
+
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
122
|
+
*/
|
123
|
+
slug: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.bool]),
|
119
124
|
/**
|
120
125
|
* Title that's displayed at the top of the card
|
121
126
|
*/
|
@@ -18,7 +18,7 @@ var _react2 = require("@carbon/react");
|
|
18
18
|
var _Carousel = require("../Carousel");
|
19
19
|
var _devtools = require("../../global/js/utils/devtools");
|
20
20
|
var _settings = require("../../settings");
|
21
|
-
var _excluded = ["children", "className", "collapsible", "onClose", "closeIconDescription", "collapseButtonLabel", "expandButtonLabel", "nextIconDescription", "previousIconDescription", "title"];
|
21
|
+
var _excluded = ["children", "className", "collapsible", "onClose", "withLeftGutter", "closeIconDescription", "collapseButtonLabel", "expandButtonLabel", "nextIconDescription", "previousIconDescription", "title"];
|
22
22
|
/**
|
23
23
|
* Copyright IBM Corp. 2023, 2023
|
24
24
|
*
|
@@ -33,6 +33,7 @@ var blockClass = "".concat(_settings.pkg.prefix, "--guidebanner");
|
|
33
33
|
var componentName = 'Guidebanner';
|
34
34
|
var defaults = {
|
35
35
|
collapsible: false,
|
36
|
+
withLeftGutter: false,
|
36
37
|
// Labels
|
37
38
|
closeIconDescription: 'Close',
|
38
39
|
collapseButtonLabel: 'Read less',
|
@@ -51,6 +52,8 @@ var Guidebanner = exports.Guidebanner = /*#__PURE__*/_react.default.forwardRef(f
|
|
51
52
|
_ref$collapsible = _ref.collapsible,
|
52
53
|
collapsible = _ref$collapsible === void 0 ? defaults.collapsible : _ref$collapsible,
|
53
54
|
onClose = _ref.onClose,
|
55
|
+
_ref$withLeftGutter = _ref.withLeftGutter,
|
56
|
+
withLeftGutter = _ref$withLeftGutter === void 0 ? defaults.withLeftGutter : _ref$withLeftGutter,
|
54
57
|
_ref$closeIconDescrip = _ref.closeIconDescription,
|
55
58
|
closeIconDescription = _ref$closeIconDescrip === void 0 ? defaults.closeIconDescription : _ref$closeIconDescrip,
|
56
59
|
_ref$collapseButtonLa = _ref.collapseButtonLabel,
|
@@ -84,7 +87,7 @@ var Guidebanner = exports.Guidebanner = /*#__PURE__*/_react.default.forwardRef(f
|
|
84
87
|
};
|
85
88
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
86
89
|
"aria-expanded": !isCollapsed,
|
87
|
-
className: (0, _classnames.default)(blockClass, className,
|
90
|
+
className: (0, _classnames.default)(blockClass, className, collapsible && "".concat(blockClass, "__collapsible"), isCollapsed && "".concat(blockClass, "__collapsible-collapsed"), withLeftGutter && "".concat(blockClass, "__with-left-gutter")),
|
88
91
|
ref: ref
|
89
92
|
}, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement(_icons.Idea, {
|
90
93
|
size: 20,
|
@@ -225,5 +228,11 @@ Guidebanner.propTypes = {
|
|
225
228
|
/**
|
226
229
|
* Title text.
|
227
230
|
*/
|
228
|
-
title: _propTypes.default.string.isRequired
|
231
|
+
title: _propTypes.default.string.isRequired,
|
232
|
+
/**
|
233
|
+
* If true, insert 1 rem of "space" on the left of the component.
|
234
|
+
* This will allow the component's content to line up with other
|
235
|
+
* content on the page under special circumstances.
|
236
|
+
*/
|
237
|
+
withLeftGutter: _propTypes.default.bool
|
229
238
|
};
|
@@ -19,7 +19,7 @@ var _SteppedAnimatedMedia = require("../SteppedAnimatedMedia");
|
|
19
19
|
var _devtools = require("../../global/js/utils/devtools");
|
20
20
|
var _uuidv = _interopRequireDefault(require("../../global/js/utils/uuidv4"));
|
21
21
|
var _settings = require("../../settings");
|
22
|
-
var _excluded = ["children", "className", "closeIconDescription", "collapsible", "collapseButtonLabel", "expandButtonLabel", "narrow", "onClick", "onClose", "tertiaryButtonLabel", "
|
22
|
+
var _excluded = ["action", "children", "className", "closeIconDescription", "collapsible", "collapseButtonLabel", "expandButtonLabel", "media", "narrow", "onClick", "onClose", "tertiaryButtonLabel", "title", "withLeftGutter"];
|
23
23
|
/**
|
24
24
|
* Copyright IBM Corp. 2023, 2023
|
25
25
|
*
|
@@ -43,6 +43,7 @@ var defaults = {
|
|
43
43
|
collapseButtonLabel: 'Read less',
|
44
44
|
expandButtonLabel: 'Read more',
|
45
45
|
narrow: false,
|
46
|
+
withLeftGutter: false,
|
46
47
|
onClick: function onClick() {},
|
47
48
|
onClose: function onClose() {}
|
48
49
|
};
|
@@ -53,7 +54,8 @@ var defaults = {
|
|
53
54
|
* distracting the user from their flow.
|
54
55
|
*/
|
55
56
|
var InlineTip = exports.InlineTip = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
56
|
-
var
|
57
|
+
var action = _ref.action,
|
58
|
+
children = _ref.children,
|
57
59
|
className = _ref.className,
|
58
60
|
_ref$closeIconDescrip = _ref.closeIconDescription,
|
59
61
|
closeIconDescription = _ref$closeIconDescrip === void 0 ? defaults.closeIconDescription : _ref$closeIconDescrip,
|
@@ -63,15 +65,16 @@ var InlineTip = exports.InlineTip = /*#__PURE__*/_react.default.forwardRef(funct
|
|
63
65
|
collapseButtonLabel = _ref$collapseButtonLa === void 0 ? defaults.collapseButtonLabel : _ref$collapseButtonLa,
|
64
66
|
_ref$expandButtonLabe = _ref.expandButtonLabel,
|
65
67
|
expandButtonLabel = _ref$expandButtonLabe === void 0 ? defaults.expandButtonLabel : _ref$expandButtonLabe,
|
68
|
+
media = _ref.media,
|
66
69
|
_ref$narrow = _ref.narrow,
|
67
70
|
narrow = _ref$narrow === void 0 ? defaults.narrow : _ref$narrow,
|
68
71
|
onClick = _ref.onClick,
|
69
72
|
onClose = _ref.onClose,
|
70
73
|
tertiaryButtonLabel = _ref.tertiaryButtonLabel,
|
71
|
-
action = _ref.action,
|
72
74
|
_ref$title = _ref.title,
|
73
75
|
title = _ref$title === void 0 ? defaults.title : _ref$title,
|
74
|
-
|
76
|
+
_ref$withLeftGutter = _ref.withLeftGutter,
|
77
|
+
withLeftGutter = _ref$withLeftGutter === void 0 ? defaults.withLeftGutter : _ref$withLeftGutter,
|
75
78
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
76
79
|
var _useState = (0, _react.useState)(collapsible),
|
77
80
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
@@ -94,7 +97,7 @@ var InlineTip = exports.InlineTip = /*#__PURE__*/_react.default.forwardRef(funct
|
|
94
97
|
}, [collapsible]);
|
95
98
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
96
99
|
"aria-labelledby": labelId,
|
97
|
-
className: (0, _classnames.default)(blockClass, className,
|
100
|
+
className: (0, _classnames.default)(blockClass, className, collapsible && "".concat(blockClass, "__collapsible"), isCollapsed && "".concat(blockClass, "__collapsible-collapsed"), media && "".concat(blockClass, "__has-media"), [narrow ? "".concat(blockClass, "__narrow") : "".concat(blockClass, "__wide")], withLeftGutter && !narrow && "".concat(blockClass, "__with-left-gutter")),
|
98
101
|
ref: ref,
|
99
102
|
role: "complementary"
|
100
103
|
}, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement("div", {
|
@@ -220,5 +223,13 @@ InlineTip.propTypes = {
|
|
220
223
|
/**
|
221
224
|
* The title of the InlineTip.
|
222
225
|
*/
|
223
|
-
title: _propTypes.default.string.isRequired
|
226
|
+
title: _propTypes.default.string.isRequired,
|
227
|
+
/**
|
228
|
+
* If true, insert 1 rem of "space" on the left of the component.
|
229
|
+
* This will allow the component's content to line up with other
|
230
|
+
* content on the page under special circumstances.
|
231
|
+
*
|
232
|
+
* This will only be applied when `narrow` is false.
|
233
|
+
*/
|
234
|
+
withLeftGutter: _propTypes.default.bool
|
224
235
|
};
|
@@ -43,6 +43,8 @@ var InlineTipButton = exports.InlineTipButton = /*#__PURE__*/_react.default.forw
|
|
43
43
|
kind: "ghost"
|
44
44
|
}), children);
|
45
45
|
});
|
46
|
+
exports.InlineTipButton = InlineTipButton = _settings.pkg.checkComponentEnabled(InlineTipButton, componentName);
|
47
|
+
InlineTipButton.displayName = componentName;
|
46
48
|
InlineTipButton.propTypes = {
|
47
49
|
/**
|
48
50
|
* Provide the contents of the InlineTipButton.
|
@@ -47,6 +47,8 @@ var InlineTipLink = exports.InlineTipLink = /*#__PURE__*/_react.default.forwardR
|
|
47
47
|
}
|
48
48
|
}), children);
|
49
49
|
});
|
50
|
+
exports.InlineTipLink = InlineTipLink = _settings.pkg.checkComponentEnabled(InlineTipLink, componentName);
|
51
|
+
InlineTipLink.displayName = componentName;
|
50
52
|
InlineTipLink.propTypes = {
|
51
53
|
/**
|
52
54
|
* Provide the contents of the InlineTipLink.
|
@@ -139,6 +139,11 @@ ProductiveCard.propTypes = {
|
|
139
139
|
* The text that's displayed in the secondary button
|
140
140
|
*/
|
141
141
|
secondaryButtonText: _propTypes.default.node,
|
142
|
+
/**
|
143
|
+
* **Experimental:** For all cases a `Slug` component can be provided.
|
144
|
+
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
145
|
+
*/
|
146
|
+
slug: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.bool]),
|
142
147
|
/**
|
143
148
|
* Title that's displayed at the top of the card
|
144
149
|
*/
|
@@ -384,12 +384,13 @@ var SidePanel = exports.SidePanel = /*#__PURE__*/_react.default.forwardRef(funct
|
|
384
384
|
var primaryActionContainerClassNames = (0, _classnames.default)(["".concat(blockClass, "__actions-container"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__actions-container-condensed"), condensedActions)]);
|
385
385
|
var mainPanelClassNames = (0, _classnames.default)([blockClass, className, "".concat(blockClass, "__container"), "".concat(blockClass, "__container--").concat(size), (_ref5 = {}, (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-right-placement"), placement === 'right'), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-left-placement"), placement === 'left'), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-with-action-toolbar"), actionToolbarButtons && actionToolbarButtons.length), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-without-overlay"), !includeOverlay && !slideIn), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-is-animating"), !animationComplete || !open), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container--has-slug"), slug), _ref5)]);
|
386
386
|
var renderHeader = function renderHeader() {
|
387
|
-
var _cx, _cx2;
|
387
|
+
var _slug$type, _cx, _cx2;
|
388
|
+
var slugCloseSize = actions && actions.length && /l/.test(size) ? 'md' : 'sm';
|
388
389
|
var normalizedSlug;
|
389
|
-
if (slug) {
|
390
|
+
if (slug && (slug === null || slug === void 0 || (_slug$type = slug.type) === null || _slug$type === void 0 ? void 0 : _slug$type.displayName) === 'Slug') {
|
390
391
|
normalizedSlug = /*#__PURE__*/_react.default.cloneElement(slug, {
|
391
392
|
// slug size is sm unless actions and size > md
|
392
|
-
size:
|
393
|
+
size: slugCloseSize
|
393
394
|
});
|
394
395
|
}
|
395
396
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
@@ -397,7 +398,7 @@ var SidePanel = exports.SidePanel = /*#__PURE__*/_react.default.forwardRef(funct
|
|
397
398
|
}, currentStep > 0 && /*#__PURE__*/_react.default.createElement(_react2.Button, {
|
398
399
|
"aria-label": navigationBackIconDescription,
|
399
400
|
kind: "ghost",
|
400
|
-
size:
|
401
|
+
size: slugCloseSize,
|
401
402
|
disabled: false,
|
402
403
|
renderIcon: function renderIcon(props) {
|
403
404
|
return /*#__PURE__*/_react.default.createElement(_icons.ArrowLeft, (0, _extends2.default)({
|
@@ -414,7 +415,7 @@ var SidePanel = exports.SidePanel = /*#__PURE__*/_react.default.forwardRef(funct
|
|
414
415
|
}, normalizedSlug, /*#__PURE__*/_react.default.createElement(_react2.Button, {
|
415
416
|
"aria-label": closeIconDescription,
|
416
417
|
kind: "ghost",
|
417
|
-
size:
|
418
|
+
size: slugCloseSize,
|
418
419
|
renderIcon: function renderIcon(props) {
|
419
420
|
return /*#__PURE__*/_react.default.createElement(_icons.Close, (0, _extends2.default)({
|
420
421
|
size: 20
|
@@ -640,7 +641,7 @@ SidePanel.propTypes = {
|
|
640
641
|
*/
|
641
642
|
slideIn: _propTypes.default.bool,
|
642
643
|
/**
|
643
|
-
* Provide a `Slug` component to be rendered inside the `SidePanel` component
|
644
|
+
* **Experimental:** Provide a `Slug` component to be rendered inside the `SidePanel` component
|
644
645
|
*/
|
645
646
|
slug: _propTypes.default.node,
|
646
647
|
/**
|
package/lib/components/index.js
CHANGED
@@ -165,6 +165,30 @@ Object.defineProperty(exports, "ExpressiveCard", {
|
|
165
165
|
return _ExpressiveCard.ExpressiveCard;
|
166
166
|
}
|
167
167
|
});
|
168
|
+
Object.defineProperty(exports, "Guidebanner", {
|
169
|
+
enumerable: true,
|
170
|
+
get: function get() {
|
171
|
+
return _Guidebanner.Guidebanner;
|
172
|
+
}
|
173
|
+
});
|
174
|
+
Object.defineProperty(exports, "GuidebannerElement", {
|
175
|
+
enumerable: true,
|
176
|
+
get: function get() {
|
177
|
+
return _Guidebanner.GuidebannerElement;
|
178
|
+
}
|
179
|
+
});
|
180
|
+
Object.defineProperty(exports, "GuidebannerElementButton", {
|
181
|
+
enumerable: true,
|
182
|
+
get: function get() {
|
183
|
+
return _Guidebanner.GuidebannerElementButton;
|
184
|
+
}
|
185
|
+
});
|
186
|
+
Object.defineProperty(exports, "GuidebannerElementLink", {
|
187
|
+
enumerable: true,
|
188
|
+
get: function get() {
|
189
|
+
return _Guidebanner.GuidebannerElementLink;
|
190
|
+
}
|
191
|
+
});
|
168
192
|
Object.defineProperty(exports, "HTTPError403", {
|
169
193
|
enumerable: true,
|
170
194
|
get: function get() {
|
@@ -189,6 +213,24 @@ Object.defineProperty(exports, "ImportModal", {
|
|
189
213
|
return _ImportModal.ImportModal;
|
190
214
|
}
|
191
215
|
});
|
216
|
+
Object.defineProperty(exports, "InlineTip", {
|
217
|
+
enumerable: true,
|
218
|
+
get: function get() {
|
219
|
+
return _InlineTip.InlineTip;
|
220
|
+
}
|
221
|
+
});
|
222
|
+
Object.defineProperty(exports, "InlineTipButton", {
|
223
|
+
enumerable: true,
|
224
|
+
get: function get() {
|
225
|
+
return _InlineTip.InlineTipButton;
|
226
|
+
}
|
227
|
+
});
|
228
|
+
Object.defineProperty(exports, "InlineTipLink", {
|
229
|
+
enumerable: true,
|
230
|
+
get: function get() {
|
231
|
+
return _InlineTip.InlineTipLink;
|
232
|
+
}
|
233
|
+
});
|
192
234
|
Object.defineProperty(exports, "MultiAddSelect", {
|
193
235
|
enumerable: true,
|
194
236
|
get: function get() {
|
@@ -207,6 +249,12 @@ Object.defineProperty(exports, "NoTagsEmptyState", {
|
|
207
249
|
return _EmptyStates.NoTagsEmptyState;
|
208
250
|
}
|
209
251
|
});
|
252
|
+
Object.defineProperty(exports, "NonLinearReading", {
|
253
|
+
enumerable: true,
|
254
|
+
get: function get() {
|
255
|
+
return _NonLinearReading.NonLinearReading;
|
256
|
+
}
|
257
|
+
});
|
210
258
|
Object.defineProperty(exports, "NotFoundEmptyState", {
|
211
259
|
enumerable: true,
|
212
260
|
get: function get() {
|
@@ -502,4 +550,7 @@ var _EditTearsheet = require("./EditTearsheet");
|
|
502
550
|
var _EditTearsheetNarrow = require("./EditTearsheetNarrow");
|
503
551
|
var _EditFullPage = require("./EditFullPage");
|
504
552
|
var _EditUpdateCards = require("./EditUpdateCards");
|
505
|
-
var _Checklist = require("./Checklist");
|
553
|
+
var _Checklist = require("./Checklist");
|
554
|
+
var _Guidebanner = require("./Guidebanner");
|
555
|
+
var _InlineTip = require("./InlineTip");
|
556
|
+
var _NonLinearReading = require("./NonLinearReading");
|
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.19.1",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -64,7 +64,7 @@
|
|
64
64
|
"fs-extra": "^11.1.1",
|
65
65
|
"glob": "^10.3.3",
|
66
66
|
"jest": "^29.6.2",
|
67
|
-
"jest-config-ibm-cloud-cognitive": "^1.1.
|
67
|
+
"jest-config-ibm-cloud-cognitive": "^1.1.2",
|
68
68
|
"jest-environment-jsdom": "^29.6.2",
|
69
69
|
"namor": "^1.1.2",
|
70
70
|
"npm-check-updates": "^16.11.1",
|
@@ -75,7 +75,7 @@
|
|
75
75
|
},
|
76
76
|
"dependencies": {
|
77
77
|
"@babel/runtime": "^7.22.10",
|
78
|
-
"@carbon/ibm-products-styles": "^2.
|
78
|
+
"@carbon/ibm-products-styles": "^2.19.1",
|
79
79
|
"@carbon/telemetry": "^0.1.0",
|
80
80
|
"@dnd-kit/core": "^6.0.8",
|
81
81
|
"@dnd-kit/sortable": "^7.0.2",
|
@@ -90,11 +90,11 @@
|
|
90
90
|
"@carbon/grid": "^11.21.1",
|
91
91
|
"@carbon/layout": "^11.20.1",
|
92
92
|
"@carbon/motion": "^11.16.1",
|
93
|
-
"@carbon/react": "^1.
|
93
|
+
"@carbon/react": "^1.45.0",
|
94
94
|
"@carbon/themes": "^11.28.0",
|
95
95
|
"@carbon/type": "^11.25.1",
|
96
96
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
97
97
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
98
98
|
},
|
99
|
-
"gitHead": "
|
99
|
+
"gitHead": "e25bdb787ba9002f6508e263e18a1e0266ef4409"
|
100
100
|
}
|
@@ -11,6 +11,7 @@
|
|
11
11
|
@use '@carbon/styles/scss/type' as *;
|
12
12
|
@use '@carbon/styles/scss/motion' as *;
|
13
13
|
@use '../../global/styles/project-settings' as c4p-settings;
|
14
|
+
@use '@carbon/styles/scss/utilities';
|
14
15
|
|
15
16
|
$block-class: #{c4p-settings.$pkg-prefix}--card;
|
16
17
|
|
@@ -25,6 +26,10 @@ $block-class: #{c4p-settings.$pkg-prefix}--card;
|
|
25
26
|
transition: background-color $duration-fast-02;
|
26
27
|
}
|
27
28
|
|
29
|
+
.#{$block-class}__clickable:focus {
|
30
|
+
@include utilities.focus-outline('outline');
|
31
|
+
}
|
32
|
+
|
28
33
|
.#{$block-class}__clickable:hover {
|
29
34
|
background-color: $layer-hover-01;
|
30
35
|
}
|
@@ -52,6 +57,7 @@ $block-class: #{c4p-settings.$pkg-prefix}--card;
|
|
52
57
|
|
53
58
|
.#{$block-class}__header {
|
54
59
|
padding: $spacing-05;
|
60
|
+
padding-right: 0; // makes for consistent slug position across productive and expressive
|
55
61
|
}
|
56
62
|
|
57
63
|
.#{$block-class}__header-label-only {
|
@@ -121,3 +127,86 @@ $block-class: #{c4p-settings.$pkg-prefix}--card;
|
|
121
127
|
padding-top: $spacing-05;
|
122
128
|
padding-left: $spacing-05;
|
123
129
|
}
|
130
|
+
|
131
|
+
.#{$block-class}__header-container--has-actions {
|
132
|
+
padding-right: $spacing-03;
|
133
|
+
}
|
134
|
+
|
135
|
+
// +++ adjustments for slug
|
136
|
+
.#{$block-class} {
|
137
|
+
position: relative;
|
138
|
+
}
|
139
|
+
|
140
|
+
.#{$block-class}__media + .#{$block-class}__content-container {
|
141
|
+
/* display relative to container when media displayed */
|
142
|
+
position: relative;
|
143
|
+
}
|
144
|
+
|
145
|
+
.#{$block-class} .#{c4p-settings.$carbon-prefix}--slug {
|
146
|
+
@include utilities.callout-gradient();
|
147
|
+
|
148
|
+
position: absolute;
|
149
|
+
top: $spacing-05;
|
150
|
+
right: $spacing-05;
|
151
|
+
}
|
152
|
+
|
153
|
+
.#{$block-class}__header-container--has-slug {
|
154
|
+
width: 100%;
|
155
|
+
padding-right: $spacing-07;
|
156
|
+
}
|
157
|
+
|
158
|
+
.#{$block-class}__header-container--has-slug.#{$block-class}__header-container--has-actions {
|
159
|
+
padding-right: $spacing-08;
|
160
|
+
}
|
161
|
+
|
162
|
+
.#{$block-class}__header-container--has-slug.#{$block-class}__header-container--large-tile-or-label {
|
163
|
+
padding-right: $spacing-09;
|
164
|
+
}
|
165
|
+
|
166
|
+
.#{$block-class}__clickable {
|
167
|
+
position: relative;
|
168
|
+
}
|
169
|
+
|
170
|
+
.#{$block-class}__clickable .#{c4p-settings.$carbon-prefix}--slug,
|
171
|
+
.#{$block-class}__clickable .#{c4p-settings.$carbon-prefix}--slug-icon {
|
172
|
+
pointer-events: none;
|
173
|
+
}
|
174
|
+
|
175
|
+
.#{$block-class}--has-slug {
|
176
|
+
@include utilities.callout-gradient();
|
177
|
+
|
178
|
+
border: 1px solid $border-tile;
|
179
|
+
}
|
180
|
+
|
181
|
+
.#{$block-class}__clickable.#{$block-class}--has-slug::before {
|
182
|
+
@include utilities.callout-gradient('hover');
|
183
|
+
|
184
|
+
position: absolute;
|
185
|
+
display: block;
|
186
|
+
block-size: 100%;
|
187
|
+
content: '';
|
188
|
+
inline-size: 100%;
|
189
|
+
inset-block-start: 0;
|
190
|
+
inset-inline-start: 0;
|
191
|
+
opacity: 0;
|
192
|
+
transition: opacity $duration-fast-02 motion(standard, productive);
|
193
|
+
}
|
194
|
+
|
195
|
+
.#{$block-class}__clickable.#{$block-class}--has-slug:hover::before {
|
196
|
+
opacity: 1;
|
197
|
+
}
|
198
|
+
|
199
|
+
.#{$block-class}__clickable .#{$block-class}__content-container {
|
200
|
+
position: relative;
|
201
|
+
z-index: 1;
|
202
|
+
}
|
203
|
+
|
204
|
+
.#{$block-class} .#{c4p-settings.$carbon-prefix}--slug-icon rect {
|
205
|
+
stroke: $icon-primary;
|
206
|
+
}
|
207
|
+
|
208
|
+
.#{$block-class} .#{c4p-settings.$carbon-prefix}--slug-icon path {
|
209
|
+
fill: $icon-primary;
|
210
|
+
}
|
211
|
+
|
212
|
+
// --- adjustments for slug
|