@carbon/ibm-products 2.35.0 → 2.36.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. package/css/index-full-carbon.css +957 -567
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +67 -74
  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 +227 -206
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +443 -247
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/Carousel/Carousel.d.ts +46 -2
  18. package/es/components/Carousel/Carousel.js +36 -21
  19. package/es/components/Carousel/CarouselItem.d.ts +19 -2
  20. package/es/components/Carousel/CarouselItem.js +0 -1
  21. package/es/components/Coachmark/utils/enums.d.ts +36 -22
  22. package/es/components/CoachmarkBeacon/CoachmarkBeacon.d.ts +26 -2
  23. package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -3
  24. package/es/components/CoachmarkOverlayElement/CoachmarkOverlayElement.d.ts +28 -2
  25. package/es/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +0 -1
  26. package/es/components/ConditionBuilder/assets/sampleInput.d.ts +5 -5
  27. package/es/components/CreateFullPage/CreateFullPage.d.ts +121 -4
  28. package/es/components/CreateFullPage/CreateFullPage.js +12 -8
  29. package/es/components/CreateTearsheet/CreateTearsheet.js +2 -0
  30. package/es/components/Datagrid/Datagrid/DatagridRow.js +4 -3
  31. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +2 -1
  32. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +10 -6
  33. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -2
  34. package/es/components/EditFullPage/EditFullPage.d.ts +19 -2
  35. package/es/components/EditFullPage/EditFullPage.js +3 -3
  36. package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.d.ts +61 -2
  37. package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -3
  38. package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.d.ts +61 -2
  39. package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -2
  40. package/es/components/FullPageError/FullPageError.d.ts +2 -1
  41. package/es/components/FullPageError/FullPageError.js +24 -49
  42. package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.d.ts +40 -2
  43. package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +1 -1
  44. package/es/components/InlineTip/InlineTipLink.d.ts +19 -2
  45. package/es/components/InterstitialScreenView/InterstitialScreenView.d.ts +23 -2
  46. package/es/components/InterstitialScreenView/InterstitialScreenView.js +0 -1
  47. package/es/components/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +23 -2
  48. package/es/components/NonLinearReading/NonLinearReading.d.ts +28 -2
  49. package/es/components/NonLinearReading/NonLinearReading.js +2 -7
  50. package/es/components/SearchBar/SearchBar.d.ts +51 -3
  51. package/es/components/SearchBar/SearchBar.js +5 -6
  52. package/es/components/SidePanel/SidePanel.js +10 -5
  53. package/es/components/TruncatedList/TruncatedList.d.ts +47 -2
  54. package/es/components/TruncatedList/TruncatedList.js +5 -4
  55. package/es/components/UserProfileImage/UserProfileImage.d.ts +66 -2
  56. package/es/components/UserProfileImage/UserProfileImage.js +5 -3
  57. package/lib/components/Carousel/Carousel.d.ts +46 -2
  58. package/lib/components/Carousel/Carousel.js +35 -20
  59. package/lib/components/Carousel/CarouselItem.d.ts +19 -2
  60. package/lib/components/Carousel/CarouselItem.js +0 -1
  61. package/lib/components/Coachmark/utils/enums.d.ts +36 -22
  62. package/lib/components/CoachmarkBeacon/CoachmarkBeacon.d.ts +26 -2
  63. package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -3
  64. package/lib/components/CoachmarkOverlayElement/CoachmarkOverlayElement.d.ts +28 -2
  65. package/lib/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +0 -1
  66. package/lib/components/ConditionBuilder/assets/sampleInput.d.ts +5 -5
  67. package/lib/components/CreateFullPage/CreateFullPage.d.ts +121 -4
  68. package/lib/components/CreateFullPage/CreateFullPage.js +12 -8
  69. package/lib/components/CreateTearsheet/CreateTearsheet.js +2 -0
  70. package/lib/components/Datagrid/Datagrid/DatagridRow.js +4 -3
  71. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +2 -1
  72. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +11 -7
  73. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -2
  74. package/lib/components/EditFullPage/EditFullPage.d.ts +19 -2
  75. package/lib/components/EditFullPage/EditFullPage.js +3 -3
  76. package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.d.ts +61 -2
  77. package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -3
  78. package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.d.ts +61 -2
  79. package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -2
  80. package/lib/components/FullPageError/FullPageError.d.ts +2 -1
  81. package/lib/components/FullPageError/FullPageError.js +24 -49
  82. package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.d.ts +40 -2
  83. package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +1 -1
  84. package/lib/components/InlineTip/InlineTipLink.d.ts +19 -2
  85. package/lib/components/InterstitialScreenView/InterstitialScreenView.d.ts +23 -2
  86. package/lib/components/InterstitialScreenView/InterstitialScreenView.js +0 -1
  87. package/lib/components/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +23 -2
  88. package/lib/components/NonLinearReading/NonLinearReading.d.ts +28 -2
  89. package/lib/components/NonLinearReading/NonLinearReading.js +2 -7
  90. package/lib/components/SearchBar/SearchBar.d.ts +51 -3
  91. package/lib/components/SearchBar/SearchBar.js +5 -6
  92. package/lib/components/SidePanel/SidePanel.js +10 -5
  93. package/lib/components/TruncatedList/TruncatedList.d.ts +47 -2
  94. package/lib/components/TruncatedList/TruncatedList.js +5 -4
  95. package/lib/components/UserProfileImage/UserProfileImage.d.ts +66 -2
  96. package/lib/components/UserProfileImage/UserProfileImage.js +5 -3
  97. package/package.json +7 -7
  98. package/scss/components/Datagrid/styles/_useSortableColumns.scss +2 -0
  99. package/scss/components/FullPageError/_full-page-error.scss +10 -10
  100. package/scss/components/UserAvatar/_user-avatar.scss +6 -3
  101. package/telemetry.yml +3 -0
@@ -1,7 +1,52 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024, 2024
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
+ import React, { PropsWithChildren, ReactNode } from 'react';
8
+ interface TruncatedListProps extends PropsWithChildren {
9
+ as?: React.ElementType | string;
10
+ /**
11
+ * Optional class name for expand/collapse button.
12
+ */
13
+ buttonClassName?: string;
14
+ /**
15
+ * The contents of the TruncatedList.
16
+ */
17
+ children: ReactNode;
18
+ /**
19
+ * Provide an optional class to be applied to the containing node.
20
+ */
21
+ className?: string;
22
+ /**
23
+ * Number of items to render and display when the list is truncated and collapsed.
24
+ * Scrolling is not enabled when collapsed. The smallest number is 1.
25
+ */
26
+ collapsedItemsLimit?: number;
27
+ /**
28
+ * Maximum number of items to show when the list is expanded. All
29
+ * items are rendered when the list is expanded. Scrolling is enabled
30
+ * if there are more items to display than this number.
31
+ */
32
+ expandedItemsLimit?: number;
33
+ /**
34
+ * Optional callback reports the collapsed state of the list.
35
+ */
36
+ onClick?: (value: any) => void;
37
+ /**
38
+ * Text label for when the list is expanded.
39
+ */
40
+ viewLessLabel?: string;
41
+ /**
42
+ * Callback function for building the label when the list is collapsed.
43
+ */
44
+ viewMoreLabel?: (value: any) => void;
45
+ }
1
46
  /**
2
47
  * The `TruncatedList` allows consumers to control how many items are
3
48
  * revealed to the user while giving the user the ability to expand
4
49
  * and see the entire list.
5
50
  */
6
- export let TruncatedList: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
7
- import React from 'react';
51
+ export declare let TruncatedList: React.ForwardRefExoticComponent<TruncatedListProps & React.RefAttributes<HTMLDivElement>>;
52
+ export {};
@@ -37,7 +37,6 @@ var defaults = {
37
37
  return "View more (".concat(value, ")");
38
38
  }
39
39
  };
40
-
41
40
  /**
42
41
  * The `TruncatedList` allows consumers to control how many items are
43
42
  * revealed to the user while giving the user the ability to expand
@@ -93,13 +92,15 @@ exports.TruncatedList = /*#__PURE__*/React__default["default"].forwardRef(functi
93
92
  // list is both collapsed and expanded.
94
93
  React.useEffect(function () {
95
94
  if (listRef && childrenArray.length > 0) {
95
+ var _listRef$current;
96
96
  var numItemsToShow = isCollapsed ? minItems : maxItems;
97
- var items = listRef.current.childNodes;
97
+ var items = (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.childNodes;
98
98
  var _listHeight = 0;
99
99
  for (var index = 0; index < numItemsToShow; index++) {
100
- if (items[index]) {
100
+ if (items && items[index]) {
101
101
  var _window;
102
- var height = ((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(items[index])) === null || _window === void 0 ? void 0 : _window.height) || 16;
102
+ var itemElement = items[index];
103
+ var height = ((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(itemElement)) === null || _window === void 0 ? void 0 : _window.height) || '16';
103
104
  _listHeight += parseInt(height);
104
105
  }
105
106
  }
@@ -1,5 +1,69 @@
1
1
  /**
2
- * The user profile avatar allows for an image of the user to be displayed by passing in the image prop. By default the component will display a user icon on a blue background.
2
+ * Copyright IBM Corp. 2021, 2021
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.
3
6
  */
4
- export let UserProfileImage: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
7
+ /// <reference path="../../../src/custom-typings/index.d.ts" />
5
8
  import React from 'react';
9
+ import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
10
+ import '../../global/js/utils/props-helper';
11
+ import { IconButton } from '@carbon/react';
12
+ type imageProps = {
13
+ /**
14
+ * When passing the image prop, supply a full path to the image to be displayed.
15
+ */
16
+ image: string;
17
+ /**
18
+ * When passing the image prop use the imageDescription prop to describe the image for screen reader.
19
+ */
20
+ imageDescription: string;
21
+ } | {
22
+ image?: never;
23
+ imageDescription?: never;
24
+ };
25
+ type UserProfileImageBaseProps = {
26
+ /**
27
+ * The background color passed should match one of the background colors in the library documentation:
28
+ * https://pages.github.ibm.com/cdai-design/pal/patterns/user-profile-images/
29
+ */
30
+ backgroundColor?: string;
31
+ /**
32
+ * Provide an optional class to be applied to the containing node.
33
+ */
34
+ className?: string;
35
+ /**
36
+ * Provide a custom icon to use if you need to use an icon other than the included ones
37
+ */
38
+ icon?: () => CarbonIconType | null;
39
+ /**
40
+ * When passing the initials prop, either send the initials to be used or the user's display name. The first two capital letters of the display name will be used as the initials.
41
+ */
42
+ initials?: string;
43
+ /**
44
+ * When passing the kind prop, use either "user" or "group". The values match up to the Carbon Library icons.
45
+ */
46
+ kind?: 'user' | 'group';
47
+ /**
48
+ * Set the size of the avatar circle
49
+ */
50
+ size: 'xl' | 'lg' | 'md';
51
+ /**
52
+ * Set theme in which the component will be rendered
53
+ */
54
+ theme: 'light' | 'dark';
55
+ /**
56
+ * Specify how the trigger should align with the tooltip
57
+ */
58
+ tooltipAlignment?: React.ComponentProps<typeof IconButton>['align'];
59
+ /**
60
+ * Pass in the display name to have it shown on hover
61
+ */
62
+ tooltipText?: string;
63
+ };
64
+ type UserProfileImageProps = UserProfileImageBaseProps & imageProps;
65
+ /**
66
+ * The user profile avatar allows for an image of the user to be displayed by passing in the image prop. By default the component will display a user icon on a blue background.
67
+ */
68
+ export declare let UserProfileImage: React.ForwardRefExoticComponent<UserProfileImageProps & React.RefAttributes<HTMLDivElement>>;
69
+ export {};
@@ -26,7 +26,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
26
26
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
27
27
 
28
28
  var _excluded = ["backgroundColor", "className", "kind", "icon", "initials", "image", "imageDescription", "size", "theme", "tooltipText", "tooltipAlignment"];
29
-
30
29
  // The block part of our conventional BEM class names (blockClass__E--M).
31
30
  var blockClass = "".concat(settings.pkg.prefix, "--user-profile-image");
32
31
  var componentName = 'UserProfileImage';
@@ -93,12 +92,13 @@ exports.UserProfileImage = /*#__PURE__*/React__default["default"].forwardRef(fun
93
92
  }
94
93
  };
95
94
  var formatInitials = function formatInitials() {
96
- if (initials.length === 2) {
95
+ var _match;
96
+ if (initials && initials.length === 2) {
97
97
  return initials;
98
98
  }
99
99
  // RegEx takes in the display name and returns the first and last initials. Thomas Watson and Thomas J. Watson
100
100
  // both return JW.
101
- return initials.match(/(^\S\S?|\b\S)?/g).join('').match(/(^\S|\S$)?/g).join('').toUpperCase();
101
+ return ((_match = (initials || '').match(/(^\S\S?|\b\S)?/g)) === null || _match === void 0 || (_match = _match.join('').match(/(^\S|\S$)?/g)) === null || _match === void 0 ? void 0 : _match.join('').toUpperCase()) || '';
102
102
  };
103
103
  var getFillItem = function getFillItem() {
104
104
  if (image) {
@@ -158,10 +158,12 @@ exports.UserProfileImage.propTypes = {
158
158
  /**
159
159
  * When passing the image prop, supply a full path to the image to be displayed.
160
160
  */
161
+ /**@ts-ignore */
161
162
  image: index["default"].string,
162
163
  /**
163
164
  * When passing the image prop use the imageDescription prop to describe the image for screen reader.
164
165
  */
166
+ /**@ts-ignore */
165
167
  imageDescription: index["default"].string.isRequired.if(function (_ref2) {
166
168
  var image = _ref2.image;
167
169
  return !!image;
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.35.0",
4
+ "version": "2.36.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -76,7 +76,7 @@
76
76
  "fs-extra": "^11.2.0",
77
77
  "glob": "^10.3.10",
78
78
  "jest": "^29.7.0",
79
- "jest-config-ibm-cloud-cognitive": "^1.1.5",
79
+ "jest-config-ibm-cloud-cognitive": "^1.1.6",
80
80
  "jest-environment-jsdom": "^29.7.0",
81
81
  "namor": "^1.1.2",
82
82
  "npm-check-updates": "^16.14.12",
@@ -90,13 +90,13 @@
90
90
  },
91
91
  "dependencies": {
92
92
  "@babel/runtime": "^7.23.9",
93
- "@carbon/ibm-products-styles": "^2.33.0",
93
+ "@carbon/ibm-products-styles": "^2.34.0",
94
94
  "@carbon/telemetry": "^0.1.0",
95
95
  "@dnd-kit/core": "^6.0.8",
96
96
  "@dnd-kit/modifiers": "^7.0.0",
97
97
  "@dnd-kit/sortable": "^8.0.0",
98
98
  "@dnd-kit/utilities": "^3.2.2",
99
- "@ibm/telemetry-js": "^1.2.0",
99
+ "@ibm/telemetry-js": "^1.5.0",
100
100
  "framer-motion": "^6.5.1 < 7",
101
101
  "immutability-helper": "^3.1.1",
102
102
  "lodash": "^4.17.21",
@@ -108,11 +108,11 @@
108
108
  "@carbon/grid": "^11.22.0",
109
109
  "@carbon/layout": "^11.21.0",
110
110
  "@carbon/motion": "^11.17.0",
111
- "@carbon/react": "^1.53.0",
112
- "@carbon/themes": "^11.33.0",
111
+ "@carbon/react": "^1.55.0",
112
+ "@carbon/themes": "^11.34.0",
113
113
  "@carbon/type": "^11.26.0",
114
114
  "react": "^16.8.6 || ^17.0.1 || ^18.2.0",
115
115
  "react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
116
116
  },
117
- "gitHead": "7a5a7cdd83c39a7f0b5c1e5baf647ebe70ab2983"
117
+ "gitHead": "b1783b0aa7a0fbfbc120c3b47ecfb6855983a37d"
118
118
  }
@@ -76,4 +76,6 @@
76
76
  opacity: 1;
77
77
  visibility: visible;
78
78
  }
79
+
80
+ background-color: $layer-selected-hover-01;
79
81
  }
@@ -24,7 +24,7 @@ $block-class: #{c4p-settings.$pkg-prefix}--full-page-error;
24
24
  .#{$block-class} {
25
25
  height: inherit;
26
26
  }
27
- .#{$block-class}__error-container {
27
+ .#{$block-class}__container {
28
28
  height: 100%;
29
29
  margin: 0 $spacing-06;
30
30
 
@@ -32,19 +32,19 @@ $block-class: #{c4p-settings.$pkg-prefix}--full-page-error;
32
32
  margin: 0 $spacing-03;
33
33
  }
34
34
  }
35
- .#{$block-class}__error-grid {
35
+ .#{$block-class}__grid {
36
36
  height: 100%;
37
37
  padding-top: $spacing-07;
38
38
  padding-bottom: $spacing-07;
39
39
  }
40
- .#{$block-class}__error-column {
40
+ .#{$block-class}__column {
41
41
  padding: 0;
42
42
  @include breakpoint(lg) {
43
43
  padding: 0 $spacing-07 0 0;
44
44
  }
45
45
  }
46
46
 
47
- .#{$block-class}__error-svg-container {
47
+ .#{$block-class}__svg-container {
48
48
  display: flex;
49
49
  height: 100%;
50
50
  padding: $spacing-03 $spacing-03 $spacing-11 $spacing-03;
@@ -53,16 +53,16 @@ $block-class: #{c4p-settings.$pkg-prefix}--full-page-error;
53
53
  }
54
54
  }
55
55
 
56
- .#{$block-class}__error-label,
57
- .#{$block-class}__error-title {
56
+ .#{$block-class}__label,
57
+ .#{$block-class}__title {
58
58
  @include type-style('fluid-heading-05', true);
59
59
  }
60
60
 
61
- .#{$block-class}__error-label {
61
+ .#{$block-class}__label {
62
62
  display: block;
63
63
  color: $text-error;
64
64
  }
65
- .#{$block-class}__error-title {
65
+ .#{$block-class}__title {
66
66
  margin-bottom: $spacing-09;
67
67
  }
68
68
 
@@ -73,12 +73,12 @@ $block-class: #{c4p-settings.$pkg-prefix}--full-page-error;
73
73
  }
74
74
 
75
75
  // safari rendering fix
76
- .#{$block-class}__error-svg-container svg.#{$block-class}__error-svg {
76
+ .#{$block-class}__svg-container svg.#{$block-class}__svg {
77
77
  width: 100%;
78
78
  }
79
79
 
80
80
  // svg theme styles
81
- .#{$block-class}__error-svg-container svg.#{$block-class}__error-svg path {
81
+ .#{$block-class}__svg-container svg.#{$block-class}__svg path {
82
82
  fill: $background;
83
83
  stroke: $border-inverse;
84
84
  }
@@ -65,7 +65,6 @@ $sizes: (
65
65
  }
66
66
 
67
67
  @mixin photo-styling {
68
- position: fixed;
69
68
  border-radius: 100%;
70
69
  object-fit: fill;
71
70
  }
@@ -78,14 +77,18 @@ $sizes: (
78
77
  @mixin setLightBg($order, $color) {
79
78
  :root .#{$block-class}--#{$order},
80
79
  .#{$carbon-prefix}--g10 .#{$block-class}--#{$order},
81
- .#{$carbon-prefix}--white .#{$block-class}--#{$order} {
80
+ .#{$carbon-prefix}--white .#{$block-class}--#{$order},
81
+ [storybook-carbon-theme='g10'] .#{$block-class}--#{$order},
82
+ [storybook-carbon-theme='white'] .#{$block-class}--#{$order} {
82
83
  @include setBgColor($color);
83
84
  }
84
85
  }
85
86
 
86
87
  @mixin setDarkBg($order, $color) {
87
88
  .#{$carbon-prefix}--g90 .#{$block-class}--#{$order},
88
- .#{$carbon-prefix}--g100 .#{$block-class}--#{$order} {
89
+ .#{$carbon-prefix}--g100 .#{$block-class}--#{$order},
90
+ [storybook-carbon-theme='g90'] .#{$block-class}--#{$order},
91
+ [storybook-carbon-theme='g100'] .#{$block-class}--#{$order} {
89
92
  @include setBgColor($color);
90
93
  }
91
94
  }
package/telemetry.yml CHANGED
@@ -788,3 +788,6 @@ collect:
788
788
  - 'light-magenta'
789
789
  - 'light-purple'
790
790
  - 'light-teal'
791
+ js:
792
+ functions: {}
793
+ tokens: null