@carbon/ibm-products 1.46.2 → 1.48.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/css/index-full-carbon.css +1399 -29
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +5 -5
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +5 -12
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +2 -2
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +1395 -25
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +4 -4
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +1399 -29
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +5 -5
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/AddSelect/AddSelectBreadcrumbs.js +6 -4
  18. package/es/components/AddSelect/AddSelectList.js +15 -26
  19. package/es/components/CreateFullPage/CreateFullPage.js +3 -2
  20. package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  21. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +14 -5
  22. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +7 -1
  23. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +1 -5
  24. package/es/components/Datagrid/useSortableColumns.js +20 -4
  25. package/es/components/Datagrid/utils/getArgTypes.js +5 -0
  26. package/es/components/NonLinearReading/NonLinearReading.js +87 -0
  27. package/es/components/NonLinearReading/index.js +8 -0
  28. package/es/components/SidePanel/SidePanel.js +16 -8
  29. package/es/components/index.js +2 -1
  30. package/es/global/js/package-settings.js +3 -1
  31. package/lib/components/AddSelect/AddSelectBreadcrumbs.js +6 -4
  32. package/lib/components/AddSelect/AddSelectList.js +14 -25
  33. package/lib/components/CreateFullPage/CreateFullPage.js +2 -1
  34. package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  35. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +13 -4
  36. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +7 -1
  37. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +0 -4
  38. package/lib/components/Datagrid/useSortableColumns.js +20 -4
  39. package/lib/components/Datagrid/utils/getArgTypes.js +5 -0
  40. package/lib/components/NonLinearReading/NonLinearReading.js +90 -0
  41. package/lib/components/NonLinearReading/index.js +12 -0
  42. package/lib/components/SidePanel/SidePanel.js +15 -7
  43. package/lib/components/index.js +8 -1
  44. package/lib/global/js/package-settings.js +3 -1
  45. package/package.json +5 -5
  46. package/scss/components/AddSelect/_add-select.scss +0 -10
  47. package/scss/components/Datagrid/_storybook-styles.scss +26 -0
  48. package/scss/components/Datagrid/styles/_datagrid.scss +4 -0
  49. package/scss/components/Datagrid/styles/_useInlineEdit.scss +4 -0
  50. package/scss/components/Datagrid/styles/_useSortableColumns.scss +8 -4
  51. package/scss/components/EmptyStates/_empty-state.scss +4 -3
  52. package/scss/components/NonLinearReading/_index.scss +8 -0
  53. package/scss/components/NonLinearReading/_non-linear-reading.scss +157 -0
  54. package/scss/components/NonLinearReading/_storybook-styles.scss +13 -0
  55. package/scss/components/SidePanel/_side-panel.scss +5 -14
  56. package/scss/components/Tearsheet/_tearsheet.scss +4 -0
  57. package/scss/components/_index.scss +1 -0
@@ -40,14 +40,30 @@ var useSortableColumns = function useSortableColumns(hooks) {
40
40
  if (col.isSorted) {
41
41
  switch (col.isSortedDesc) {
42
42
  case false:
43
- return _iconsReact.ArrowUp16;
43
+ return function () {
44
+ return /*#__PURE__*/_react.default.createElement(_iconsReact.ArrowUp16, {
45
+ className: "".concat(blockClass, "__sortable-icon ").concat(_settings.carbon.prefix, "--btn__icon")
46
+ });
47
+ };
44
48
  case true:
45
- return _iconsReact.ArrowUp16;
49
+ return function () {
50
+ return /*#__PURE__*/_react.default.createElement(_iconsReact.ArrowUp16, {
51
+ className: "".concat(blockClass, "__sortable-icon ").concat(_settings.carbon.prefix, "--btn__icon")
52
+ });
53
+ };
46
54
  default:
47
- return _iconsReact.Arrows16;
55
+ return function () {
56
+ return /*#__PURE__*/_react.default.createElement(_iconsReact.Arrows16, {
57
+ className: "".concat(blockClass, "__sortable-icon ").concat(_settings.carbon.prefix, "--btn__icon")
58
+ });
59
+ };
48
60
  }
49
61
  }
50
- return _iconsReact.Arrows16;
62
+ return function () {
63
+ return /*#__PURE__*/_react.default.createElement(_iconsReact.Arrows16, {
64
+ className: "".concat(blockClass, "__sortable-icon ").concat(_settings.carbon.prefix, "--btn__icon")
65
+ });
66
+ };
51
67
  };
52
68
  var Header = function Header(headerProp) {
53
69
  var _cx;
@@ -101,6 +101,11 @@ var ARG_TYPES = {
101
101
  name: 'Filter props',
102
102
  control: 'object',
103
103
  description: 'This is an object for all the props passed into the filter flyout and filter panel'
104
+ },
105
+ expandedContentAlign: {
106
+ control: 'select',
107
+ options: ['flex-start', 'space-between'],
108
+ description: 'This sets the alignment of content inside expanded row.'
104
109
  }
105
110
  };
106
111
  exports.ARG_TYPES = ARG_TYPES;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.NonLinearReading = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
+ var _react = _interopRequireWildcard(require("react"));
13
+ var _propTypes = _interopRequireDefault(require("prop-types"));
14
+ var _classnames = _interopRequireDefault(require("classnames"));
15
+ var _iconsReact = require("@carbon/icons-react");
16
+ var _devtools = require("../../global/js/utils/devtools");
17
+ var _settings = require("../../settings");
18
+ var _excluded = ["children", "className", "definition", "theme"];
19
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+ // The block part of our conventional BEM class names (blockClass__E--M).
22
+ var blockClass = "".concat(_settings.pkg.prefix, "--non-linear-reading");
23
+ var componentName = 'NonLinearReading';
24
+
25
+ // Default values for props
26
+ var defaults = {
27
+ theme: 'light'
28
+ };
29
+
30
+ /**
31
+ * Use non-linear reading when space is limited to share a
32
+ * brief, at-a-glance, summary of a concept that may require
33
+ * more explanation for some users.
34
+ */
35
+ var NonLinearReading = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
36
+ var children = _ref.children,
37
+ className = _ref.className,
38
+ definition = _ref.definition,
39
+ _ref$theme = _ref.theme,
40
+ theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
41
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
42
+ var _useState = (0, _react.useState)(false),
43
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
44
+ isOpen = _useState2[0],
45
+ setOpen = _useState2[1];
46
+ var handleToggle = function handleToggle() {
47
+ setOpen(function (prevState) {
48
+ return !prevState;
49
+ });
50
+ };
51
+ return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({}, rest, {
52
+ className: (0, _classnames.default)(blockClass, className),
53
+ ref: ref,
54
+ role: "main"
55
+ }, (0, _devtools.getDevtoolsProps)(componentName)), ' ', /*#__PURE__*/_react.default.createElement("button", {
56
+ type: "button",
57
+ "aria-expanded": isOpen,
58
+ className: (0, _classnames.default)("".concat(blockClass, "__term-").concat(theme), [isOpen ? ["".concat(blockClass, "__term-").concat(theme, "--open")] : ["".concat(blockClass, "__term-").concat(theme, "--closed")]]),
59
+ onClick: handleToggle
60
+ }, children, isOpen && /*#__PURE__*/_react.default.createElement(_iconsReact.ChevronUp16, null)), ' ', isOpen && /*#__PURE__*/_react.default.createElement("span", {
61
+ className: "".concat(blockClass, "--body-").concat(theme)
62
+ }, definition), ' ');
63
+ });
64
+
65
+ // Return a placeholder if not released and not enabled by feature flag
66
+ exports.NonLinearReading = NonLinearReading;
67
+ exports.NonLinearReading = NonLinearReading = _settings.pkg.checkComponentEnabled(NonLinearReading, componentName);
68
+ NonLinearReading.displayName = componentName;
69
+
70
+ // The types and DocGen commentary for the component props,
71
+ // in alphabetical order (for consistency).
72
+ // See https://www.npmjs.com/package/prop-types#usage.
73
+ NonLinearReading.propTypes = {
74
+ /**
75
+ * The term of the component appears as a pill.
76
+ */
77
+ children: _propTypes.default.node.isRequired,
78
+ /**
79
+ * Provide an optional class to be applied to the containing node.
80
+ */
81
+ className: _propTypes.default.string,
82
+ /**
83
+ * The content that appears when the term is toggled open.
84
+ */
85
+ definition: _propTypes.default.node.isRequired,
86
+ /**
87
+ * Determines the theme of the component.
88
+ */
89
+ theme: _propTypes.default.oneOf(['light', 'dark'])
90
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "NonLinearReading", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _NonLinearReading.NonLinearReading;
10
+ }
11
+ });
12
+ var _NonLinearReading = require("./NonLinearReading");
@@ -27,7 +27,7 @@ var _iconsReact = require("@carbon/icons-react");
27
27
  var _ActionSet = require("../ActionSet");
28
28
  var _variants = require("./motion/variants");
29
29
  var _excluded = ["actionToolbarButtons", "actions", "animateTitle", "children", "className", "closeIconDescription", "condensedActions", "currentStep", "includeOverlay", "labelText", "navigationBackIconDescription", "onNavigationBack", "onRequestClose", "onUnmount", "open", "placement", "preventCloseOnClickOutside", "selectorPageContent", "selectorPrimaryFocus", "size", "slideIn", "subtitle", "title"],
30
- _excluded2 = ["label", "kind", "icon", "leading", "disabled", "className", "onClick"];
30
+ _excluded2 = ["label", "kind", "icon", "tooltipPosition", "tooltipAlignment", "leading", "disabled", "className", "onClick"];
31
31
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
32
32
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
33
33
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -396,10 +396,11 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
396
396
  }, subtitle), actionToolbarButtons && actionToolbarButtons.length && /*#__PURE__*/_react.default.createElement("div", {
397
397
  className: (0, _classnames.default)("".concat(blockClass, "__action-toolbar"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__action-toolbar-no-animation"), !animateTitle))
398
398
  }, actionToolbarButtons.map(function (_ref5) {
399
- var _ref6;
400
399
  var label = _ref5.label,
401
400
  kind = _ref5.kind,
402
401
  icon = _ref5.icon,
402
+ tooltipPosition = _ref5.tooltipPosition,
403
+ tooltipAlignment = _ref5.tooltipAlignment,
403
404
  leading = _ref5.leading,
404
405
  disabled = _ref5.disabled,
405
406
  className = _ref5.className,
@@ -411,11 +412,11 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
411
412
  size: "small",
412
413
  renderIcon: icon,
413
414
  iconDescription: label,
414
- tooltipPosition: "bottom",
415
- tooltipAlignment: "center",
415
+ tooltipPosition: tooltipPosition || 'bottom',
416
+ tooltipAlignment: tooltipAlignment || 'center',
416
417
  hasIconOnly: !leading,
417
418
  disabled: disabled,
418
- className: (0, _classnames.default)(["".concat(blockClass, "__action-toolbar-button"), className, (_ref6 = {}, (0, _defineProperty2.default)(_ref6, "".concat(blockClass, "__action-toolbar-icon-only-button"), icon && !leading), (0, _defineProperty2.default)(_ref6, "".concat(blockClass, "__action-toolbar-leading-button"), leading), _ref6)]),
419
+ className: (0, _classnames.default)(["".concat(blockClass, "__action-toolbar-button"), className, (0, _defineProperty2.default)({}, "".concat(blockClass, "__action-toolbar-leading-button"), leading)]),
419
420
  onClick: onClick
420
421
  }), leading && label);
421
422
  })));
@@ -494,13 +495,18 @@ SidePanel.propTypes = {
494
495
  leading: _propTypes.default.bool,
495
496
  icon: _propTypes.default.object,
496
497
  onClick: _propTypes.default.func,
497
- kind: _propTypes.default.oneOf(['ghost', 'tertiary', 'secondary', 'primary'])
498
+ kind: _propTypes.default.oneOf(['ghost', 'tertiary', 'secondary', 'primary']),
499
+ tooltipAlignment: _propTypes.default.oneOf(['top', 'right', 'bottom', 'left']),
500
+ tooltipPosition: _propTypes.default.oneOf(['start', 'center', 'end'])
498
501
  })),
499
502
  /**
500
503
  * The primary actions to be shown in the side panel. Each action is
501
504
  * specified as an object with optional fields: 'label' to supply the button
502
505
  * label, 'kind' to select the button kind (must be 'primary', 'secondary' or
503
- * 'ghost'), 'loading' to display a loading indicator, and 'onClick' to
506
+ * 'ghost'), 'tooltipPosition' to select where the tooltip is placed around
507
+ * the button (must be 'top', 'right', 'bottom', or 'left'), 'tooltipAlignment'
508
+ * to select how the tooltip is aligned with the button (must be 'start',
509
+ * 'center', or 'end', 'loading' to display a loading indicator, and 'onClick' to
504
510
  * receive notifications when the button is clicked. Additional fields in the
505
511
  * object will be passed to the Button component, and these can include
506
512
  * 'disabled', 'ref', 'className', and any other Button props. Any other
@@ -511,6 +517,8 @@ SidePanel.propTypes = {
511
517
  */
512
518
  actions: (0, _propsHelper.allPropTypes)([_ActionSet.ActionSet.validateActions(), _propTypes.default.arrayOf(_propTypes.default.shape(_objectSpread(_objectSpread({}, _carbonComponentsReact.Button.propTypes), {}, {
513
519
  kind: _propTypes.default.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
520
+ tooltipPosition: _propTypes.default.oneOf(['top', 'right', 'bottom', 'left']),
521
+ tooltipAlignment: _propTypes.default.oneOf(['start', 'center', 'end']),
514
522
  label: _propTypes.default.string,
515
523
  loading: _propTypes.default.bool,
516
524
  // we duplicate this Button prop to improve the DocGen here
@@ -201,6 +201,12 @@ Object.defineProperty(exports, "NoTagsEmptyState", {
201
201
  return _EmptyStates.NoTagsEmptyState;
202
202
  }
203
203
  });
204
+ Object.defineProperty(exports, "NonLinearReading", {
205
+ enumerable: true,
206
+ get: function get() {
207
+ return _NonLinearReading.NonLinearReading;
208
+ }
209
+ });
204
210
  Object.defineProperty(exports, "NotFoundEmptyState", {
205
211
  enumerable: true,
206
212
  get: function get() {
@@ -484,4 +490,5 @@ var _EditTearsheet = require("./EditTearsheet");
484
490
  var _EditTearsheetNarrow = require("./EditTearsheetNarrow");
485
491
  var _EditFullPage = require("./EditFullPage");
486
492
  var _EditUpdateCards = require("./EditUpdateCards");
487
- var _InlineEdit = require("./InlineEdit");
493
+ var _InlineEdit = require("./InlineEdit");
494
+ var _NonLinearReading = require("./NonLinearReading");
@@ -69,7 +69,9 @@ var defaults = {
69
69
  EditTearsheetNarrow: false,
70
70
  EditFullPage: false,
71
71
  EditUpdateCards: false,
72
- ButtonMenu: false
72
+ ButtonMenu: false,
73
+ // Novice to pro components not yet reviewed and released:
74
+ NonLinearReading: false
73
75
  /* new component flags here - comment used by generate CLI */
74
76
  },
75
77
 
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": "1.46.2",
4
+ "version": "1.48.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -61,7 +61,7 @@
61
61
  "fs-extra": "^11.1.0",
62
62
  "glob": "^8.1.0",
63
63
  "jest": "^29.4.2",
64
- "jest-config-ibm-cloud-cognitive": "^0.24.13",
64
+ "jest-config-ibm-cloud-cognitive": "^0.24.14",
65
65
  "jest-environment-jsdom": "^29.4.2",
66
66
  "namor": "^1.1.2",
67
67
  "npm-check-updates": "^16.7.4",
@@ -89,11 +89,11 @@
89
89
  "@carbon/motion": "^10.29.0",
90
90
  "@carbon/themes": "^10.55.1",
91
91
  "@carbon/type": "^10.45.1",
92
- "carbon-components": "^10.58.5",
93
- "carbon-components-react": "^7.59.5",
92
+ "carbon-components": "^10.58.6",
93
+ "carbon-components-react": "^7.59.6",
94
94
  "carbon-icons": "^7.0.7",
95
95
  "react": "^16.8.6 || ^17.0.1",
96
96
  "react-dom": "^16.8.6 || ^17.0.1"
97
97
  },
98
- "gitHead": "3ea7d485b3cc004a95bf621a26727847329391a3"
98
+ "gitHead": "e24d71d09cd3d3a5c570391bd4e24a3d1f88e96e"
99
99
  }
@@ -72,16 +72,6 @@
72
72
  justify-content: center;
73
73
  }
74
74
 
75
- &-cell:hover .#{$block-class}__selections-hidden-hover,
76
- .#{$carbon-prefix}--structured-list-row:focus-within
77
- .#{$block-class}__selections-hidden-hover {
78
- visibility: visible;
79
- }
80
-
81
- &-hidden-hover {
82
- visibility: hidden;
83
- }
84
-
85
75
  &-row--selected.#{$carbon-prefix}--structured-list-row {
86
76
  border-bottom: 1px solid $selected-ui;
87
77
  background-color: $selected-ui;
@@ -108,3 +108,29 @@ $block-class: #{$pkg-prefix}--datagrid;
108
108
  // stylelint-disable-next-line carbon/type-token-use
109
109
  font-size: 0;
110
110
  }
111
+
112
+ .#{$block-class} .expanded-content {
113
+ display: flex;
114
+ }
115
+
116
+ .expanded-content__title {
117
+ padding-bottom: $spacing-05;
118
+ }
119
+
120
+ .expanded-content__row {
121
+ display: flex;
122
+ }
123
+
124
+ .expanded-content__row span {
125
+ flex: 0 1 50%;
126
+ }
127
+
128
+ .expanded-content__row span:first-child:not(:last-child) {
129
+ margin-right: $spacing-05;
130
+ color: $text-secondary;
131
+ }
132
+
133
+ .expanded-content__child:not(:last-child) {
134
+ flex: 0 1 calc($spacing-05 * 30);
135
+ margin-right: $spacing-07;
136
+ }
@@ -613,3 +613,7 @@
613
613
  padding: 0 $spacing-03;
614
614
  }
615
615
  }
616
+
617
+ .#{$block-class} .#{$pkg-prefix}--datagrid__head-wrap {
618
+ background-color: $ui-03;
619
+ }
@@ -392,6 +392,10 @@ $row-heights: (
392
392
  outline-color: $support-01;
393
393
  }
394
394
 
395
+ .#{$block-class} .#{$carbon-prefix}--text-input:focus {
396
+ background: $field-01;
397
+ }
398
+
395
399
  .#{$block-class}
396
400
  .#{$block-class}__inline-edit--outer-cell-button--invalid
397
401
  .#{$carbon-prefix}--number
@@ -21,7 +21,7 @@
21
21
  .#{$carbon-prefix}--table-header-label .#{$carbon-prefix}--table-sort:active,
22
22
  .#{$carbon-prefix}--table-header-label
23
23
  .#{$carbon-prefix}--table-sort:focus
24
- svg {
24
+ .#{$block-class}__sortable-icon {
25
25
  /* stylelint-disable-next-line declaration-no-important */
26
26
  background: none !important;
27
27
  /* stylelint-disable-next-line declaration-no-important */
@@ -44,7 +44,9 @@
44
44
  color: $text-01 !important;
45
45
  font: inherit;
46
46
  }
47
- .#{$carbon-prefix}--table-header-label .#{$carbon-prefix}--table-sort svg {
47
+ .#{$carbon-prefix}--table-header-label
48
+ .#{$carbon-prefix}--table-sort
49
+ .#{$block-class}__sortable-icon {
48
50
  fill: $text-01;
49
51
  opacity: 0;
50
52
  transition: transform $duration--fast-02 motion(standard, productive);
@@ -60,12 +62,14 @@
60
62
  .#{$block-class}__sortableColumn:hover,
61
63
  .#{$block-class}__sortableColumn:focus-within,
62
64
  .#{$block-class}__sortableColumn.#{$block-class}__isSorted {
63
- .#{$carbon-prefix}--table-header-label svg {
65
+ .#{$carbon-prefix}--table-header-label .#{$block-class}__sortable-icon {
64
66
  opacity: 1;
65
67
  visibility: visible;
66
68
  }
67
69
  }
68
70
 
69
- .#{$block-class}__sortableColumn .#{$block-class}--table-sort--desc svg {
71
+ .#{$block-class}__sortableColumn
72
+ .#{$block-class}--table-sort--desc
73
+ .#{$block-class}__sortable-icon {
70
74
  transform: rotate(180deg);
71
75
  }
@@ -1,5 +1,5 @@
1
1
  //
2
- // Copyright IBM Corp. 2020, 2021
2
+ // Copyright IBM Corp. 2020, 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.
@@ -23,10 +23,11 @@
23
23
 
24
24
  .#{$block-class}__header {
25
25
  @include carbon--type-style('productive-heading-03');
26
- // stylelint-disable-next-line carbon/layout-token-use
27
- padding-bottom: calc($spacing-01 + $spacing-02);
26
+
27
+ padding-bottom: $spacing-03;
28
28
  margin: 0;
29
29
  }
30
+
30
31
  .#{$block-class}__subtitle {
31
32
  @include carbon--type-style('body-long-01');
32
33
 
@@ -0,0 +1,8 @@
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
+ @import './non-linear-reading';
@@ -0,0 +1,157 @@
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
+ @import '../../global/styles/project-settings';
10
+
11
+ @mixin term-closed-defaults {
12
+ // stylelint-disable-next-line carbon/layout-token-use
13
+ padding: rem(1px) $spacing-03 rem(1px) $spacing-03;
14
+ border: none;
15
+ border-radius: $spacing-04;
16
+ background-color: $interactive-02;
17
+ white-space: nowrap;
18
+
19
+ &:hover {
20
+ background-color: $hover-secondary;
21
+ cursor: pointer;
22
+ }
23
+ }
24
+ @mixin term-open-defaults {
25
+ @include term-closed-defaults();
26
+
27
+ padding-right: 0;
28
+
29
+ svg {
30
+ // stylelint-disable-next-line carbon/layout-token-use
31
+ padding-top: rem(1px);
32
+ margin: 0 $spacing-02 0 $spacing-01;
33
+ vertical-align: text-top;
34
+ }
35
+ }
36
+ @mixin body-defaults {
37
+ @include carbon--type-style('body-long-01');
38
+
39
+ display: block;
40
+ padding: $spacing-03 $spacing-04;
41
+ border-left-width: rem(1.25px);
42
+ border-left-style: solid;
43
+ margin: $spacing-02 0;
44
+ // Novice to pro does not always use Carbon defaults/tokens
45
+ // stylelint-disable-next-line carbon/motion-duration-use, carbon/motion-easing-use
46
+ animation: fade 600ms;
47
+ }
48
+
49
+ // Other Carbon settings.
50
+ // TODO: @import 'carbon-components/scss/globals/grid/grid'; if needed
51
+ // NonLinearReading uses the following Carbon components:
52
+ // TODO: @import(s) of Carbon component styles used by NonLinearReading
53
+ // NonLinearReading uses the following Carbon for IBM Products components:
54
+ // TODO: @import(s) of IBM Products component styles used by NonLinearReading
55
+ // Define all component styles in a mixin which is then exported using
56
+ // the Carbon import-once mechanism.
57
+ @mixin non-linear-reading {
58
+ // The block part of our conventional BEM class names (blockClass__E--M).
59
+ $block-class: #{$pkg-prefix}--non-linear-reading;
60
+
61
+ @keyframes fade {
62
+ 0% {
63
+ opacity: 0;
64
+ }
65
+
66
+ 15% {
67
+ opacity: 0;
68
+ }
69
+
70
+ 100% {
71
+ opacity: 1;
72
+ }
73
+ }
74
+
75
+ .#{$block-class} {
76
+ &__term {
77
+ &-light {
78
+ &--closed {
79
+ @include term-closed-defaults();
80
+
81
+ background-color: $interactive-02;
82
+ color: $inverse-01;
83
+
84
+ &:hover {
85
+ background-color: $hover-secondary;
86
+ }
87
+ }
88
+
89
+ &--open {
90
+ @include term-open-defaults();
91
+
92
+ // Novice to pro does not always use Carbon defaults/tokens
93
+ // stylelint-disable-next-line carbon/theme-token-use
94
+ background-color: $purple-20;
95
+ color: $text-01;
96
+
97
+ &:hover {
98
+ // stylelint-disable-next-line carbon/theme-token-use
99
+ background-color: #dcc7ff;
100
+ }
101
+ }
102
+ }
103
+
104
+ &-dark {
105
+ &--closed {
106
+ @include carbon--theme($carbon--theme--g100, true);
107
+ @include term-closed-defaults();
108
+
109
+ background-color: $interactive-02;
110
+ color: $text-04;
111
+
112
+ &:hover {
113
+ background-color: $hover-secondary;
114
+ }
115
+ }
116
+
117
+ &--open {
118
+ @include carbon--theme($carbon--theme--g100, true);
119
+ @include term-open-defaults();
120
+
121
+ // stylelint-disable-next-line carbon/theme-token-use
122
+ background-color: #491d8b;
123
+ color: $text-04;
124
+
125
+ &:hover {
126
+ // stylelint-disable-next-line carbon/theme-token-use
127
+ background-color: #7f3ae7;
128
+ }
129
+ }
130
+ }
131
+ }
132
+
133
+ &--body {
134
+ &-light {
135
+ @include body-defaults();
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
+ }
142
+
143
+ &-dark {
144
+ @include carbon--theme($carbon--theme--g100, true);
145
+ @include body-defaults();
146
+
147
+ // stylelint-disable-next-line carbon/theme-token-use
148
+ border-left-color: #d4bbff;
149
+ // stylelint-disable-next-line carbon/theme-token-use
150
+ color: #d4bbff;
151
+ }
152
+ }
153
+ }
154
+ }
155
+ @include exports('non-linear-reading') {
156
+ @include non-linear-reading;
157
+ }
@@ -0,0 +1,13 @@
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
+ @import '../../global/styles/project-settings';
9
+
10
+ // For demo purposes, have text surrounding component match styling in component.
11
+ #root {
12
+ @include carbon--type-style('body-long-01');
13
+ }
@@ -1,5 +1,5 @@
1
1
  //
2
- // Copyright IBM Corp. 2020, 2021
2
+ // Copyright IBM Corp. 2020, 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.
@@ -309,19 +309,10 @@ $action-set-block-class: #{$pkg-prefix}--action-set;
309
309
  margin-bottom: $spacing-03;
310
310
  background-color: $ui-01;
311
311
  transition: transform $duration--moderate-01 carbon--motion(standard);
312
- .#{$block-class}__action-toolbar-button {
313
- min-width: 2rem;
314
- &.#{$block-class}__action-toolbar-icon-only-button {
315
- padding: 0;
316
- color: $text-01;
317
- }
318
- &.#{$block-class}__action-toolbar-icon-only-button svg {
319
- margin-left: $spacing-03;
320
- }
321
- &.#{$block-class}__action-toolbar-leading-button {
322
- margin-right: $spacing-03;
323
- }
324
- }
312
+ }
313
+
314
+ .#{$block-class}__action-toolbar-leading-button {
315
+ margin-right: $spacing-03;
325
316
  }
326
317
 
327
318
  .#{$carbon-prefix}--btn.#{$block-class}__navigation-back-button {
@@ -155,6 +155,10 @@
155
155
  margin: 0;
156
156
  }
157
157
 
158
+ &.#{$block-class}--narrow .#{$block-class}__header-description {
159
+ max-width: 80%;
160
+ }
161
+
158
162
  &.#{$block-class}--wide .#{$block-class}__header--with-close-icon {
159
163
  padding-right: $spacing-10;
160
164
  }
@@ -52,3 +52,4 @@
52
52
 
53
53
  @import './InlineEditV1/index';
54
54
  @import './InlineEditV2/index';
55
+ @import './NonLinearReading/index';