@carbon/ibm-products 1.47.0 → 1.48.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. package/css/index-full-carbon.css +1387 -24
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +4 -4
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +1 -11
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +1387 -24
  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 +1387 -24
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +4 -4
  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 +0 -6
  24. package/es/components/Datagrid/useSortableColumns.js +20 -4
  25. package/es/components/NonLinearReading/NonLinearReading.js +87 -0
  26. package/es/components/NonLinearReading/index.js +8 -0
  27. package/es/components/SidePanel/SidePanel.js +2 -3
  28. package/es/components/index.js +2 -1
  29. package/es/global/js/package-settings.js +3 -1
  30. package/lib/components/AddSelect/AddSelectBreadcrumbs.js +6 -4
  31. package/lib/components/AddSelect/AddSelectList.js +14 -25
  32. package/lib/components/CreateFullPage/CreateFullPage.js +2 -1
  33. package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  34. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +13 -4
  35. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +7 -1
  36. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +0 -6
  37. package/lib/components/Datagrid/useSortableColumns.js +20 -4
  38. package/lib/components/NonLinearReading/NonLinearReading.js +90 -0
  39. package/lib/components/NonLinearReading/index.js +12 -0
  40. package/lib/components/SidePanel/SidePanel.js +1 -2
  41. package/lib/components/index.js +8 -1
  42. package/lib/global/js/package-settings.js +3 -1
  43. package/package.json +2 -2
  44. package/scss/components/AddSelect/_add-select.scss +0 -10
  45. package/scss/components/Datagrid/styles/_datagrid.scss +4 -0
  46. package/scss/components/Datagrid/styles/_useSortableColumns.scss +8 -4
  47. package/scss/components/NonLinearReading/_index.scss +8 -0
  48. package/scss/components/NonLinearReading/_non-linear-reading.scss +157 -0
  49. package/scss/components/NonLinearReading/_storybook-styles.scss +13 -0
  50. package/scss/components/SidePanel/_side-panel.scss +5 -14
  51. package/scss/components/_index.scss +1 -0
@@ -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");
@@ -396,7 +396,6 @@ 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,
@@ -417,7 +416,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
417
416
  tooltipAlignment: tooltipAlignment || 'center',
418
417
  hasIconOnly: !leading,
419
418
  disabled: disabled,
420
- 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)]),
421
420
  onClick: onClick
422
421
  }), leading && label);
423
422
  })));
@@ -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.47.0",
4
+ "version": "1.48.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -95,5 +95,5 @@
95
95
  "react": "^16.8.6 || ^17.0.1",
96
96
  "react-dom": "^16.8.6 || ^17.0.1"
97
97
  },
98
- "gitHead": "fa80a91ae0247e4a7be80e31fe13dc43dcff0ba0"
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;
@@ -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
+ }
@@ -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
  }
@@ -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 {
@@ -52,3 +52,4 @@
52
52
 
53
53
  @import './InlineEditV1/index';
54
54
  @import './InlineEditV2/index';
55
+ @import './NonLinearReading/index';