@carbon/ibm-products 2.25.0 → 2.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. package/css/index-full-carbon.css +556 -63
  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 +50 -16
  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 +556 -63
  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 +527 -55
  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/BigNumbers/BigNumbers.d.ts +11 -0
  18. package/es/components/BigNumbers/BigNumbers.js +238 -0
  19. package/es/components/BigNumbers/constants.d.ts +13 -0
  20. package/es/components/BigNumbers/constants.js +67 -0
  21. package/es/components/BigNumbers/index.d.ts +1 -0
  22. package/es/components/Cascade/Cascade.d.ts +19 -2
  23. package/es/components/Cascade/Cascade.js +12 -9
  24. package/es/components/Coachmark/CoachmarkTagline.js +1 -2
  25. package/es/components/CoachmarkStack/CoachmarkStackHome.js +1 -1
  26. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +4 -3
  27. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +3 -2
  28. package/es/components/DataSpreadsheet/utils/checkForHoldingKey.d.ts +1 -0
  29. package/es/components/DataSpreadsheet/utils/checkForHoldingKey.js +17 -0
  30. package/es/components/Datagrid/Datagrid/Datagrid.js +9 -2
  31. package/es/components/Datagrid/Datagrid/DatagridContent.d.ts +3 -1
  32. package/es/components/Datagrid/Datagrid/DatagridContent.js +6 -2
  33. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +21 -8
  34. package/es/components/Datagrid/Datagrid/DatagridRow.js +15 -2
  35. package/es/components/Datagrid/Datagrid/DatagridToolbar.d.ts +10 -1
  36. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +21 -4
  37. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +32 -9
  38. package/es/components/Datagrid/Datagrid/addons/Filtering/constants.d.ts +3 -1
  39. package/es/components/Datagrid/Datagrid/addons/Filtering/constants.js +4 -1
  40. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +35 -3
  41. package/es/components/Datagrid/Datagrid/addons/Slug/DatagridSlug.d.ts +2 -0
  42. package/es/components/Datagrid/Datagrid/addons/Slug/{ColumnHeaderSlug.js → DatagridSlug.js} +4 -4
  43. package/es/components/Datagrid/Datagrid/addons/stateReducer.js +3 -3
  44. package/es/components/Datagrid/useSelectAllToggle.js +5 -3
  45. package/es/components/Datagrid/useSortableColumns.js +2 -2
  46. package/es/components/EmptyStates/EmptyStateContent.d.ts +1 -1
  47. package/es/components/FullPageError/FullPageError.js +41 -15
  48. package/es/components/FullPageError/assets/Error403SVG.d.ts +9 -0
  49. package/es/components/FullPageError/assets/Error403SVG.js +714 -0
  50. package/es/components/FullPageError/assets/Error404SVG.d.ts +9 -0
  51. package/es/components/FullPageError/assets/Error404SVG.js +623 -0
  52. package/es/components/HTTPErrors/HTTPErrorContent.d.ts +1 -1
  53. package/es/components/InterstitialScreen/InterstitialScreen.js +1 -1
  54. package/es/components/SidePanel/SidePanel.js +13 -6
  55. package/es/components/SidePanel/motion/variants.d.ts +39 -12
  56. package/es/components/SidePanel/motion/variants.js +42 -11
  57. package/es/components/StringFormatter/StringFormatter.d.ts +6 -0
  58. package/es/components/StringFormatter/StringFormatter.js +79 -0
  59. package/es/components/StringFormatter/index.d.ts +1 -0
  60. package/es/components/StringFormatter/utils/enums.d.ts +14 -0
  61. package/es/components/StringFormatter/utils/enums.js +23 -0
  62. package/es/components/Tearsheet/TearsheetShell.js +26 -8
  63. package/es/components/UserAvatar/UserAvatar.js +59 -44
  64. package/es/components/index.d.ts +2 -0
  65. package/es/global/js/hooks/index.d.ts +2 -0
  66. package/es/global/js/hooks/useFocus.d.ts +11 -0
  67. package/es/global/js/hooks/useFocus.js +76 -0
  68. package/es/global/js/hooks/useIsomorphicEffect.d.ts +2 -0
  69. package/es/global/js/hooks/useIsomorphicEffect.js +14 -0
  70. package/es/global/js/package-settings.d.ts +2 -0
  71. package/es/global/js/package-settings.js +2 -0
  72. package/es/index.js +2 -0
  73. package/es/settings.d.ts +2 -0
  74. package/lib/components/BigNumbers/BigNumbers.d.ts +11 -0
  75. package/lib/components/BigNumbers/BigNumbers.js +244 -0
  76. package/lib/components/BigNumbers/constants.d.ts +13 -0
  77. package/lib/components/BigNumbers/constants.js +76 -0
  78. package/lib/components/BigNumbers/index.d.ts +1 -0
  79. package/lib/components/Cascade/Cascade.d.ts +19 -2
  80. package/lib/components/Cascade/Cascade.js +12 -9
  81. package/lib/components/Coachmark/CoachmarkTagline.js +3 -4
  82. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
  83. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +4 -3
  84. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +3 -2
  85. package/lib/components/DataSpreadsheet/utils/checkForHoldingKey.d.ts +1 -0
  86. package/lib/components/DataSpreadsheet/utils/checkForHoldingKey.js +21 -0
  87. package/lib/components/Datagrid/Datagrid/Datagrid.js +9 -2
  88. package/lib/components/Datagrid/Datagrid/DatagridContent.d.ts +3 -1
  89. package/lib/components/Datagrid/Datagrid/DatagridContent.js +6 -2
  90. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +20 -7
  91. package/lib/components/Datagrid/Datagrid/DatagridRow.js +14 -1
  92. package/lib/components/Datagrid/Datagrid/DatagridToolbar.d.ts +10 -1
  93. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +20 -3
  94. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +30 -7
  95. package/lib/components/Datagrid/Datagrid/addons/Filtering/constants.d.ts +3 -1
  96. package/lib/components/Datagrid/Datagrid/addons/Filtering/constants.js +4 -0
  97. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +33 -1
  98. package/lib/components/Datagrid/Datagrid/addons/Slug/DatagridSlug.d.ts +2 -0
  99. package/lib/components/Datagrid/Datagrid/addons/Slug/{ColumnHeaderSlug.js → DatagridSlug.js} +4 -4
  100. package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +3 -3
  101. package/lib/components/Datagrid/useSelectAllToggle.js +4 -2
  102. package/lib/components/Datagrid/useSortableColumns.js +2 -2
  103. package/lib/components/EmptyStates/EmptyStateContent.d.ts +1 -1
  104. package/lib/components/FullPageError/FullPageError.js +41 -15
  105. package/lib/components/FullPageError/assets/Error403SVG.d.ts +9 -0
  106. package/lib/components/FullPageError/assets/Error403SVG.js +722 -0
  107. package/lib/components/FullPageError/assets/Error404SVG.d.ts +9 -0
  108. package/lib/components/FullPageError/assets/Error404SVG.js +631 -0
  109. package/lib/components/HTTPErrors/HTTPErrorContent.d.ts +1 -1
  110. package/lib/components/InterstitialScreen/InterstitialScreen.js +3 -3
  111. package/lib/components/SidePanel/SidePanel.js +11 -4
  112. package/lib/components/SidePanel/motion/variants.d.ts +39 -12
  113. package/lib/components/SidePanel/motion/variants.js +42 -10
  114. package/lib/components/StringFormatter/StringFormatter.d.ts +6 -0
  115. package/lib/components/StringFormatter/StringFormatter.js +85 -0
  116. package/lib/components/StringFormatter/index.d.ts +1 -0
  117. package/lib/components/StringFormatter/utils/enums.d.ts +14 -0
  118. package/lib/components/StringFormatter/utils/enums.js +27 -0
  119. package/lib/components/Tearsheet/TearsheetShell.js +26 -8
  120. package/lib/components/UserAvatar/UserAvatar.js +59 -44
  121. package/lib/components/index.d.ts +2 -0
  122. package/lib/global/js/hooks/index.d.ts +2 -0
  123. package/lib/global/js/hooks/useFocus.d.ts +11 -0
  124. package/lib/global/js/hooks/useFocus.js +80 -0
  125. package/lib/global/js/hooks/useIsomorphicEffect.d.ts +2 -0
  126. package/lib/global/js/hooks/useIsomorphicEffect.js +18 -0
  127. package/lib/global/js/package-settings.d.ts +2 -0
  128. package/lib/global/js/package-settings.js +2 -0
  129. package/lib/index.js +10 -0
  130. package/lib/settings.d.ts +2 -0
  131. package/package.json +7 -7
  132. package/scss/components/BigNumbers/_big-numbers.scss +151 -0
  133. package/scss/components/BigNumbers/_carbon-imports.scss +11 -0
  134. package/scss/components/BigNumbers/_index-with-carbon.scss +9 -0
  135. package/scss/components/BigNumbers/_index.scss +8 -0
  136. package/scss/components/Datagrid/styles/_datagrid.scss +19 -0
  137. package/scss/components/FilterSummary/_filter-summary.scss +1 -1
  138. package/scss/components/FullPageError/_full-page-error.scss +20 -2
  139. package/scss/components/ProductiveCard/_productive-card.scss +1 -1
  140. package/scss/components/SidePanel/_side-panel.scss +1 -1
  141. package/scss/components/StringFormatter/_carbon-imports.scss +10 -0
  142. package/scss/components/StringFormatter/_index-with-carbon.scss +9 -0
  143. package/scss/components/StringFormatter/_index.scss +8 -0
  144. package/scss/components/StringFormatter/_string-formatter.scss +97 -0
  145. package/scss/components/Tearsheet/_tearsheet.scss +34 -2
  146. package/scss/components/UserAvatar/_user-avatar.scss +47 -4
  147. package/scss/components/_index-with-carbon.scss +2 -0
  148. package/scss/components/_index.scss +2 -0
  149. package/es/components/Datagrid/Datagrid/addons/Slug/ColumnHeaderSlug.d.ts +0 -2
  150. package/es/node_modules/@carbon/icon-helpers/es/index.js +0 -140
  151. package/es/node_modules/@carbon/icons-react/es/Icon.js +0 -73
  152. package/es/node_modules/@carbon/icons-react/es/generated/bucket-0.js +0 -2985
  153. package/es/node_modules/@carbon/icons-react/es/generated/bucket-3.js +0 -2900
  154. package/es/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3004
  155. package/es/node_modules/@carbon/icons-react/es/iconPropTypes-4cbeb95d.js +0 -14
  156. package/lib/components/Datagrid/Datagrid/addons/Slug/ColumnHeaderSlug.d.ts +0 -2
  157. package/lib/node_modules/@carbon/icon-helpers/es/index.js +0 -145
  158. package/lib/node_modules/@carbon/icons-react/es/Icon.js +0 -81
  159. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-0.js +0 -3117
  160. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-3.js +0 -3032
  161. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3136
  162. package/lib/node_modules/@carbon/icons-react/es/iconPropTypes-4cbeb95d.js +0 -18
@@ -17,13 +17,14 @@ var react = require('@carbon/react');
17
17
  var ErrorGenericSVG = require('./assets/ErrorGenericSVG.js');
18
18
  var devtools = require('../../global/js/utils/devtools.js');
19
19
  var settings = require('../../settings.js');
20
+ var Error404SVG = require('./assets/Error404SVG.js');
21
+ var Error403SVG = require('./assets/Error403SVG.js');
20
22
 
21
23
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
22
24
 
23
25
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
26
 
25
- var _br;
26
- var _excluded = ["children", "className", "description", "errorLabel", "title"];
27
+ var _excluded = ["children", "className", "description", "errorLabel", "kind", "title"];
27
28
 
28
29
  // Carbon and package components we use.
29
30
  /* TODO: @import(s) of carbon components and other package components. */
@@ -44,9 +45,9 @@ var componentName = 'FullPageError';
44
45
  // or assumption when a prop is not supplied.
45
46
 
46
47
  // Default values for props
47
- // const defaults = {
48
- // /* TODO: add defaults for relevant props if needed */
49
- // };
48
+ var defaults = {
49
+ kind: 'custom'
50
+ };
50
51
 
51
52
  /**
52
53
  * TODO: A description of the component.
@@ -56,8 +57,33 @@ exports.FullPageError = /*#__PURE__*/React__default["default"].forwardRef(functi
56
57
  className = _ref.className,
57
58
  description = _ref.description,
58
59
  errorLabel = _ref.errorLabel,
60
+ _ref$kind = _ref.kind,
61
+ kind = _ref$kind === void 0 ? defaults.kind : _ref$kind,
59
62
  title = _ref.title,
60
63
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
64
+ var errorData = {
65
+ 403: {
66
+ title: 'Access denied',
67
+ description: 'You are not authorized to access the requested page. Please verify that you are logged in to the hosting environment and your access permissions are correct.',
68
+ svg: /*#__PURE__*/React__default["default"].createElement(Error403SVG.Error403SVG, {
69
+ className: index["default"]("".concat(blockClass, "__error-svg"), "".concat(blockClass, "__error-403"))
70
+ })
71
+ },
72
+ 404: {
73
+ title: 'Page not found',
74
+ description: 'The page you requested has moved or is unavailable, or the specified URL is not valid. Please check the URL or search the site for the requested content.',
75
+ svg: /*#__PURE__*/React__default["default"].createElement(Error404SVG.Error404SVG, {
76
+ className: index["default"]("".concat(blockClass, "__error-svg"), "".concat(blockClass, "__error-404"))
77
+ })
78
+ },
79
+ custom: {
80
+ title: title,
81
+ description: description,
82
+ svg: /*#__PURE__*/React__default["default"].createElement(ErrorGenericSVG.ErrorGenericSVG, {
83
+ className: index["default"]("".concat(blockClass, "__error-svg"), "".concat(blockClass, "__error-custom"))
84
+ })
85
+ }
86
+ };
61
87
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
62
88
  className: index["default"](blockClass,
63
89
  // Apply the block class to the main HTML element
@@ -83,20 +109,15 @@ exports.FullPageError = /*#__PURE__*/React__default["default"].forwardRef(functi
83
109
  className: "".concat(blockClass, "__error-title")
84
110
  }, /*#__PURE__*/React__default["default"].createElement("span", {
85
111
  className: "".concat(blockClass, "__error-label")
86
- }, "\u21B3 ", errorLabel), _br || (_br = /*#__PURE__*/React__default["default"].createElement("br", null)), /*#__PURE__*/React__default["default"].createElement("span", null, title)), /*#__PURE__*/React__default["default"].createElement("p", {
112
+ }, "\u21B3 ", kind === 'custom' ? errorLabel : "Error ".concat(kind)), /*#__PURE__*/React__default["default"].createElement("span", null, errorData[kind].title)), /*#__PURE__*/React__default["default"].createElement("p", {
87
113
  className: "".concat(blockClass, "__description")
88
- }, description), children), /*#__PURE__*/React__default["default"].createElement(react.Column, {
114
+ }, description || errorData[kind].description), children), /*#__PURE__*/React__default["default"].createElement(react.Column, {
89
115
  sm: 4,
90
116
  md: 5,
91
117
  lg: 10
92
118
  }, /*#__PURE__*/React__default["default"].createElement("div", {
93
- style: {
94
- display: 'flex',
95
- height: '100%'
96
- }
97
- }, /*#__PURE__*/React__default["default"].createElement(ErrorGenericSVG.ErrorGenericSVG, {
98
- className: "".concat(blockClass, "__error-svg")
99
- }))))));
119
+ className: "".concat(blockClass, "__error-svg-container")
120
+ }, errorData[kind].svg)))));
100
121
  });
101
122
 
102
123
  // Return a placeholder if not released and not enabled by feature flag
@@ -119,13 +140,18 @@ exports.FullPageError.propTypes = {
119
140
  */
120
141
  className: index$1["default"].string,
121
142
  /**
122
- * String that will provide the description for the error code
143
+ * String that will provide the description for the error code. <br/>
144
+ * This is optional for 403 and 404 kinds, and passing this would override their default descriptions.
123
145
  */
124
146
  description: index$1["default"].string.isRequired,
125
147
  /**
126
148
  * String that will describe the error that occurred
127
149
  */
128
150
  errorLabel: index$1["default"].string.isRequired,
151
+ /**
152
+ * The kind of error page to be displayed, default is custom
153
+ */
154
+ kind: index$1["default"].oneOf(['custom', '403', '404']),
129
155
  /**
130
156
  * This will be for the main title of the FullPageError component
131
157
  */
@@ -0,0 +1,9 @@
1
+ export function Error403SVG({ className }: {
2
+ className: any;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export namespace Error403SVG {
5
+ namespace propTypes {
6
+ export { string as className };
7
+ }
8
+ }
9
+ import { string } from 'prop-types';