@carbon/ibm-products 2.38.0 → 2.40.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. package/css/index-full-carbon.css +236 -3
  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 +5 -0
  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 +236 -3
  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 +236 -3
  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/AddSelect/AddSelect.d.ts +44 -2
  18. package/es/components/AddSelect/AddSelect.js +8 -4
  19. package/es/components/AddSelect/AddSelectBody.d.ts +44 -2
  20. package/es/components/AddSelect/AddSelectBody.js +10 -12
  21. package/es/components/AddSelect/AddSelectSort.d.ts +16 -17
  22. package/es/components/AddSelect/AddSelectSort.js +5 -5
  23. package/es/components/AddSelect/types/index.d.ts +44 -0
  24. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +5 -1
  25. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +12 -6
  26. package/es/components/Card/Card.js +50 -9
  27. package/es/components/Card/CardFooter.d.ts +5 -1
  28. package/es/components/Card/CardFooter.js +11 -1
  29. package/es/components/Carousel/Carousel.d.ts +6 -2
  30. package/es/components/Checklist/Checklist.d.ts +100 -2
  31. package/es/components/Checklist/Checklist.js +9 -5
  32. package/es/components/Checklist/Checklist.types.d.ts +19 -0
  33. package/es/components/Checklist/Checklist.types.js +22 -0
  34. package/es/components/Checklist/ChecklistChart.d.ts +5 -1
  35. package/es/components/Checklist/ChecklistChart.js +9 -4
  36. package/es/components/Checklist/ChecklistIcon.d.ts +5 -1
  37. package/es/components/Checklist/ChecklistIcon.js +9 -4
  38. package/es/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
  39. package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
  40. package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
  41. package/es/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
  42. package/es/components/CreateInfluencer/CreateInfluencer.js +1 -1
  43. package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
  44. package/es/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
  45. package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
  46. package/es/components/DataSpreadsheet/DataSpreadsheet.js +50 -28
  47. package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
  48. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +46 -31
  49. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
  50. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +39 -25
  51. package/es/components/DataSpreadsheet/types/index.d.ts +30 -0
  52. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
  53. package/es/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
  54. package/es/components/GetStartedCard/GetStartedCard.d.ts +5 -0
  55. package/es/components/GetStartedCard/GetStartedCard.js +82 -0
  56. package/es/components/GetStartedCard/index.d.ts +1 -0
  57. package/es/components/Guidebanner/Guidebanner.d.ts +62 -2
  58. package/es/components/Guidebanner/Guidebanner.js +6 -5
  59. package/es/components/Guidebanner/GuidebannerElement.d.ts +30 -17
  60. package/es/components/Guidebanner/GuidebannerElement.js +4 -4
  61. package/es/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
  62. package/es/components/Guidebanner/GuidebannerElementButton.js +10 -4
  63. package/es/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
  64. package/es/components/Guidebanner/GuidebannerElementLink.js +3 -3
  65. package/es/components/InterstitialScreen/InterstitialScreen.js +3 -1
  66. package/es/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
  67. package/es/components/MultiAddSelect/MultiAddSelect.js +2 -1
  68. package/es/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
  69. package/es/components/NotificationsPanel/NotificationsPanel.js +10 -11
  70. package/es/components/PageHeader/PageHeader.d.ts +298 -5
  71. package/es/components/PageHeader/PageHeader.js +98 -47
  72. package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  73. package/es/components/PageHeader/PageHeaderUtils.js +4 -1
  74. package/es/components/SidePanel/SidePanel.d.ts +6 -2
  75. package/es/components/SidePanel/SidePanel.js +18 -3
  76. package/es/components/SidePanel/constants.d.ts +1 -0
  77. package/es/components/SidePanel/constants.js +1 -0
  78. package/es/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
  79. package/es/components/SingleAddSelect/SingleAddSelect.js +2 -1
  80. package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
  81. package/es/components/TagOverflow/TagOverflow.js +153 -29
  82. package/es/components/TagOverflow/TagOverflowModal.d.ts +29 -0
  83. package/es/components/TagOverflow/TagOverflowModal.js +112 -0
  84. package/es/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
  85. package/es/components/TagOverflow/TagOverflowPopover.js +135 -0
  86. package/es/components/Tearsheet/Tearsheet.d.ts +132 -6
  87. package/es/components/Tearsheet/Tearsheet.js +25 -13
  88. package/es/components/Tearsheet/TearsheetShell.d.ts +5 -1
  89. package/es/components/Tearsheet/TearsheetShell.js +26 -4
  90. package/es/components/WebTerminal/WebTerminal.d.ts +4 -0
  91. package/es/components/WebTerminal/WebTerminal.js +11 -3
  92. package/es/components/index.d.ts +1 -0
  93. package/es/global/js/hooks/useFocus.d.ts +3 -1
  94. package/es/global/js/hooks/useFocus.js +6 -3
  95. package/es/global/js/hooks/useRetrieveStepData.d.ts +1 -1
  96. package/es/global/js/hooks/useRetrieveStepData.js +1 -1
  97. package/es/global/js/package-settings.d.ts +1 -0
  98. package/es/global/js/package-settings.js +1 -0
  99. package/es/index.js +1 -0
  100. package/es/settings.d.ts +1 -0
  101. package/lib/components/AddSelect/AddSelect.d.ts +44 -2
  102. package/lib/components/AddSelect/AddSelect.js +7 -3
  103. package/lib/components/AddSelect/AddSelectBody.d.ts +44 -2
  104. package/lib/components/AddSelect/AddSelectBody.js +10 -12
  105. package/lib/components/AddSelect/AddSelectSort.d.ts +16 -17
  106. package/lib/components/AddSelect/AddSelectSort.js +5 -5
  107. package/lib/components/AddSelect/types/index.d.ts +44 -0
  108. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +5 -1
  109. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +12 -6
  110. package/lib/components/Card/Card.js +50 -9
  111. package/lib/components/Card/CardFooter.d.ts +5 -1
  112. package/lib/components/Card/CardFooter.js +11 -1
  113. package/lib/components/Carousel/Carousel.d.ts +6 -2
  114. package/lib/components/Checklist/Checklist.d.ts +100 -2
  115. package/lib/components/Checklist/Checklist.js +9 -5
  116. package/lib/components/Checklist/Checklist.types.d.ts +19 -0
  117. package/lib/components/Checklist/Checklist.types.js +27 -0
  118. package/lib/components/Checklist/ChecklistChart.d.ts +5 -1
  119. package/lib/components/Checklist/ChecklistChart.js +14 -9
  120. package/lib/components/Checklist/ChecklistIcon.d.ts +5 -1
  121. package/lib/components/Checklist/ChecklistIcon.js +9 -4
  122. package/lib/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
  123. package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
  124. package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
  125. package/lib/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
  126. package/lib/components/CreateInfluencer/CreateInfluencer.js +1 -1
  127. package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
  128. package/lib/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
  129. package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
  130. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +50 -28
  131. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
  132. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +46 -31
  133. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
  134. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +39 -25
  135. package/lib/components/DataSpreadsheet/types/index.d.ts +30 -0
  136. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
  137. package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
  138. package/lib/components/GetStartedCard/GetStartedCard.d.ts +5 -0
  139. package/lib/components/GetStartedCard/GetStartedCard.js +88 -0
  140. package/lib/components/GetStartedCard/index.d.ts +1 -0
  141. package/lib/components/Guidebanner/Guidebanner.d.ts +62 -2
  142. package/lib/components/Guidebanner/Guidebanner.js +6 -5
  143. package/lib/components/Guidebanner/GuidebannerElement.d.ts +30 -17
  144. package/lib/components/Guidebanner/GuidebannerElement.js +4 -4
  145. package/lib/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
  146. package/lib/components/Guidebanner/GuidebannerElementButton.js +10 -4
  147. package/lib/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
  148. package/lib/components/Guidebanner/GuidebannerElementLink.js +3 -3
  149. package/lib/components/InterstitialScreen/InterstitialScreen.js +3 -1
  150. package/lib/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
  151. package/lib/components/MultiAddSelect/MultiAddSelect.js +2 -1
  152. package/lib/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
  153. package/lib/components/NotificationsPanel/NotificationsPanel.js +10 -11
  154. package/lib/components/PageHeader/PageHeader.d.ts +298 -5
  155. package/lib/components/PageHeader/PageHeader.js +98 -47
  156. package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  157. package/lib/components/PageHeader/PageHeaderUtils.js +4 -1
  158. package/lib/components/SidePanel/SidePanel.d.ts +6 -2
  159. package/lib/components/SidePanel/SidePanel.js +18 -3
  160. package/lib/components/SidePanel/constants.d.ts +1 -0
  161. package/lib/components/SidePanel/constants.js +1 -0
  162. package/lib/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
  163. package/lib/components/SingleAddSelect/SingleAddSelect.js +2 -1
  164. package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
  165. package/lib/components/TagOverflow/TagOverflow.js +154 -28
  166. package/lib/components/TagOverflow/TagOverflowModal.d.ts +29 -0
  167. package/lib/components/TagOverflow/TagOverflowModal.js +121 -0
  168. package/lib/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
  169. package/lib/components/TagOverflow/TagOverflowPopover.js +144 -0
  170. package/lib/components/Tearsheet/Tearsheet.d.ts +132 -6
  171. package/lib/components/Tearsheet/Tearsheet.js +25 -13
  172. package/lib/components/Tearsheet/TearsheetShell.d.ts +5 -1
  173. package/lib/components/Tearsheet/TearsheetShell.js +26 -4
  174. package/lib/components/WebTerminal/WebTerminal.d.ts +4 -0
  175. package/lib/components/WebTerminal/WebTerminal.js +11 -3
  176. package/lib/components/index.d.ts +1 -0
  177. package/lib/global/js/hooks/useFocus.d.ts +3 -1
  178. package/lib/global/js/hooks/useFocus.js +6 -3
  179. package/lib/global/js/hooks/useRetrieveStepData.d.ts +1 -1
  180. package/lib/global/js/hooks/useRetrieveStepData.js +1 -1
  181. package/lib/global/js/package-settings.d.ts +1 -0
  182. package/lib/global/js/package-settings.js +1 -0
  183. package/lib/index.js +5 -0
  184. package/lib/settings.d.ts +1 -0
  185. package/package.json +3 -3
  186. package/scss/components/CoachmarkStack/_coachmark-stack.scss +4 -2
  187. package/scss/components/GetStartedCard/_carbon-imports.scss +9 -0
  188. package/scss/components/GetStartedCard/_get-started-card.scss +135 -0
  189. package/scss/components/GetStartedCard/_index-with-carbon.scss +9 -0
  190. package/scss/components/GetStartedCard/_index.scss +8 -0
  191. package/scss/components/SidePanel/_side-panel-variables.scss +1 -0
  192. package/scss/components/StringFormatter/_string-formatter.scss +1 -1
  193. package/scss/components/TagOverflow/_tag-overflow.scss +157 -0
  194. package/scss/components/_index-with-carbon.scss +1 -0
  195. package/scss/components/_index.scss +1 -0
  196. package/telemetry.yml +25 -16
@@ -1,3 +1,121 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 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
+ /// <reference path="../../../src/custom-typings/index.d.ts" />
8
+ import React, { PropsWithChildren, ReactNode } from 'react';
9
+ import PropTypes from 'prop-types';
10
+ import { ButtonProps } from '@carbon/react';
11
+ /**
12
+ * The accessibility title for the close icon (if shown).
13
+ *
14
+ * **Note:** This prop is only required if a close icon is shown, i.e. if
15
+ * there are a no navigation actions and/or hasCloseIcon is true.
16
+ */
17
+ export type CloseIconDescriptionTypes = {
18
+ hasCloseIcon?: false;
19
+ closeIconDescription?: string;
20
+ } | {
21
+ hasCloseIcon: true;
22
+ closeIconDescription: string;
23
+ };
24
+ interface TearsheetProps extends PropsWithChildren {
25
+ /**
26
+ * The navigation actions to be shown as buttons in the action area at the
27
+ * bottom of the tearsheet. Each action is specified as an object with
28
+ * optional fields: 'label' to supply the button label, 'kind' to select the
29
+ * button kind (must be 'primary', 'secondary' or 'ghost'), 'loading' to
30
+ * display a loading indicator, and 'onClick' to receive notifications when
31
+ * the button is clicked. Additional fields in the object will be passed to
32
+ * the Button component, and these can include 'disabled', 'ref', 'className',
33
+ * and any other Button props, except 'size'. Any other fields in the object will
34
+ * be passed through to the button element as HTML attributes.
35
+ *
36
+ * See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
37
+ */
38
+ actions: ButtonProps[];
39
+ /**
40
+ * The aria-label for the tearsheet, which is optional.
41
+ * if it is not passed, the title will be used as the aria-label.
42
+ */
43
+ ariaLabel?: string;
44
+ /**
45
+ * An optional class or classes to be added to the outermost element.
46
+ */
47
+ className?: string;
48
+ /**
49
+ * A description of the flow, displayed in the header area of the tearsheet.
50
+ */
51
+ description?: ReactNode;
52
+ /**
53
+ * Enable a close icon ('x') in the header area of the tearsheet. By default,
54
+ * (when this prop is omitted, or undefined or null) a tearsheet does not
55
+ * display a close icon if there are navigation actions ("transactional
56
+ * tearsheet") and displays one if there are no navigation actions ("passive
57
+ * tearsheet"), and that behavior can be overridden if required by setting
58
+ * this prop to either true or false.
59
+ */
60
+ hasCloseIcon?: boolean;
61
+ /**
62
+ * The content for the influencer section of the tearsheet, displayed
63
+ * alongside the main content. This is typically a menu, or filter, or
64
+ * progress indicator, or similar.
65
+ */
66
+ influencer?: ReactNode;
67
+ /**
68
+ * The position of the influencer section, 'left' or 'right'.
69
+ */
70
+ influencerPosition?: 'left' | 'right';
71
+ /**
72
+ * The width of the influencer: 'narrow' (the default) is 256px, and 'wide'
73
+ * is 320px.
74
+ */
75
+ influencerWidth?: 'narrow' | 'wide';
76
+ /**
77
+ * A label for the tearsheet, displayed in the header area of the tearsheet
78
+ * to maintain context for the tearsheet (e.g. as the title changes from page
79
+ * to page of a multi-page task).
80
+ */
81
+ label?: ReactNode;
82
+ /**
83
+ * Navigation content, such as a set of tabs, to be displayed at the bottom
84
+ * of the header area of the tearsheet.
85
+ */
86
+ navigation?: ReactNode;
87
+ /**
88
+ * An optional handler that is called when the user closes the tearsheet (by
89
+ * clicking the close button, if enabled, or clicking outside, if enabled).
90
+ * Returning `false` here prevents the modal from closing.
91
+ */
92
+ onClose?: () => void;
93
+ /**
94
+ * Specifies whether the tearsheet is currently open.
95
+ */
96
+ open?: boolean;
97
+ /**
98
+ * The DOM element that the tearsheet should be rendered within. Defaults to document.body.
99
+ */
100
+ portalTarget: ReactNode;
101
+ /**
102
+ * Specify a CSS selector that matches the DOM element that should be focused when the Modal opens
103
+ */
104
+ selectorPrimaryFocus?: string;
105
+ /**
106
+ * The main title of the tearsheet, displayed in the header area.
107
+ */
108
+ title?: ReactNode;
109
+ /** @deprecated */
110
+ /**
111
+ * The position of the top of tearsheet in the viewport. The 'normal'
112
+ * position is a short distance down from the top of the
113
+ * viewport, leaving room at the top for a global header bar to show through
114
+ * from below. The 'lower' position (the default) provides a little extra room at the top
115
+ * to allow an action bar navigation or breadcrumbs to also show through.
116
+ */
117
+ verticalPosition?: 'normal' | 'lower';
118
+ }
1
119
  /**
2
120
  * A tearsheet is a mostly full-screen type of dialog that keeps users
3
121
  * in-context and focused by bringing actionable content front and center while
@@ -10,9 +128,17 @@
10
128
  * panel on either the left or right side, the main content area, and a set of
11
129
  * action buttons.
12
130
  */
13
- export let Tearsheet: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
14
- export namespace deprecatedProps {
15
- let verticalPosition: PropTypes.Requireable<string>;
16
- }
17
- import React from 'react';
18
- import PropTypes from 'prop-types';
131
+ export declare let Tearsheet: React.ForwardRefExoticComponent<(TearsheetProps & CloseIconDescriptionTypes) & React.RefAttributes<HTMLDivElement>>;
132
+ export declare const deprecatedProps: {
133
+ /**
134
+ * **Deprecated**
135
+ *
136
+ * The position of the top of tearsheet in the viewport. The 'normal'
137
+ * position is a short distance down from the top of the
138
+ * viewport, leaving room at the top for a global header bar to show through
139
+ * from below. The 'lower' position (the default) provides a little extra room at the top
140
+ * to allow an action bar navigation or breadcrumbs to also show through.
141
+ */
142
+ verticalPosition: PropTypes.Requireable<string>;
143
+ };
144
+ export {};
@@ -23,17 +23,24 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
23
23
 
24
24
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
25
25
 
26
- var _excluded = ["influencerPosition", "influencerWidth", "verticalPosition"];
26
+ var _excluded = ["influencerPosition", "influencerWidth"];
27
27
  var componentName = 'Tearsheet';
28
28
 
29
29
  // NOTE: the component SCSS is not imported here: it is rolled up separately.
30
30
 
31
- // Default values for props
32
- var defaults = {
33
- influencerPosition: 'left',
34
- influencerWidth: 'narrow',
35
- verticalPosition: 'lower'
36
- };
31
+ /**
32
+ * The accessibility title for the close icon (if shown).
33
+ *
34
+ * **Note:** This prop is only required if a close icon is shown, i.e. if
35
+ * there are a no navigation actions and/or hasCloseIcon is true.
36
+ */
37
+
38
+ // The types and DocGen commentary for the component props,
39
+ // in alphabetical order (for consistency).
40
+ // See https://www.npmjs.com/package/prop-types#usage.
41
+
42
+ // Note that the descriptions here should be kept in sync with those for the
43
+ // corresponding props for TearsheetNarrow and TearsheetShell components.
37
44
 
38
45
  /**
39
46
  * A tearsheet is a mostly full-screen type of dialog that keeps users
@@ -49,16 +56,13 @@ var defaults = {
49
56
  */
50
57
  exports.Tearsheet = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
51
58
  var _ref$influencerPositi = _ref.influencerPosition,
52
- influencerPosition = _ref$influencerPositi === void 0 ? defaults.influencerPosition : _ref$influencerPositi,
59
+ influencerPosition = _ref$influencerPositi === void 0 ? 'left' : _ref$influencerPositi,
53
60
  _ref$influencerWidth = _ref.influencerWidth,
54
- influencerWidth = _ref$influencerWidth === void 0 ? defaults.influencerWidth : _ref$influencerWidth,
55
- _ref$verticalPosition = _ref.verticalPosition,
56
- verticalPosition = _ref$verticalPosition === void 0 ? defaults.verticalPosition : _ref$verticalPosition,
61
+ influencerWidth = _ref$influencerWidth === void 0 ? 'narrow' : _ref$influencerWidth,
57
62
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
58
63
  return /*#__PURE__*/React__default["default"].createElement(TearsheetShell.TearsheetShell, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, devtools.getDevtoolsProps(componentName)), rest), {}, {
59
64
  influencerPosition: influencerPosition,
60
65
  influencerWidth: influencerWidth,
61
- verticalPosition: verticalPosition,
62
66
  ref: ref,
63
67
  size: 'wide'
64
68
  }));
@@ -103,7 +107,8 @@ exports.Tearsheet.propTypes = _rollupPluginBabelHelpers.objectSpread2({
103
107
  *
104
108
  * See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
105
109
  */
106
- actions: propsHelper.allPropTypes([ActionSet.ActionSet.validateActions(function () {
110
+ actions: propsHelper.allPropTypes([/**@ts-ignore */
111
+ ActionSet.ActionSet.validateActions(function () {
107
112
  return '2xl';
108
113
  }), index["default"].arrayOf(index["default"].shape(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, react.Button.propTypes), {}, {
109
114
  kind: index["default"].oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
@@ -127,6 +132,7 @@ exports.Tearsheet.propTypes = _rollupPluginBabelHelpers.objectSpread2({
127
132
  * **Note:** This prop is only required if a close icon is shown, i.e. if
128
133
  * there are a no navigation actions and/or hasCloseIcon is true.
129
134
  */
135
+ /**@ts-ignore */
130
136
  closeIconDescription: index["default"].string.isRequired.if(function (_ref2) {
131
137
  var actions = _ref2.actions,
132
138
  hasCloseIcon = _ref2.hasCloseIcon;
@@ -144,6 +150,7 @@ exports.Tearsheet.propTypes = _rollupPluginBabelHelpers.objectSpread2({
144
150
  * tearsheet"), and that behavior can be overridden if required by setting
145
151
  * this prop to either true or false.
146
152
  */
153
+ /**@ts-ignore */
147
154
  hasCloseIcon: index["default"].bool,
148
155
  /**
149
156
  * The content for the influencer section of the tearsheet, displayed
@@ -166,6 +173,10 @@ exports.Tearsheet.propTypes = _rollupPluginBabelHelpers.objectSpread2({
166
173
  * to page of a multi-page task).
167
174
  */
168
175
  label: index["default"].node,
176
+ /**
177
+ * Provide a ref to return focus to once the tearsheet is closed.
178
+ */
179
+ launcherButtonRef: index["default"].any,
169
180
  /**
170
181
  * Navigation content, such as a set of tabs, to be displayed at the bottom
171
182
  * of the header area of the tearsheet.
@@ -184,6 +195,7 @@ exports.Tearsheet.propTypes = _rollupPluginBabelHelpers.objectSpread2({
184
195
  /**
185
196
  * The DOM element that the tearsheet should be rendered within. Defaults to document.body.
186
197
  */
198
+ /**@ts-ignore */
187
199
  portalTarget: TearsheetShell.portalType,
188
200
  /**
189
201
  * Specify a CSS selector that matches the DOM element that should be focused when the Modal opens
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference path="../../../src/custom-typings/index.d.ts" />
8
- import React, { PropsWithChildren, ReactNode } from 'react';
8
+ import React, { PropsWithChildren, ReactNode, RefObject } from 'react';
9
9
  import PropTypes from 'prop-types';
10
10
  import { type ButtonProps } from '@carbon/react';
11
11
  interface TearsheetShellProps extends PropsWithChildren {
@@ -57,6 +57,10 @@ interface TearsheetShellProps extends PropsWithChildren {
57
57
  * to page of a multi-page task).
58
58
  */
59
59
  label?: ReactNode;
60
+ /**
61
+ * Provide a ref to return focus to once the tearsheet is closed.
62
+ */
63
+ launcherButtonRef?: RefObject<any>;
60
64
  /**
61
65
  * Navigation content, such as a set of tabs, to be displayed at the bottom
62
66
  * of the header area of the tearsheet. NB the navigation is only applicable
@@ -21,6 +21,7 @@ var react = require('@carbon/react');
21
21
  var Wrap = require('../../global/js/utils/Wrap.js');
22
22
  var usePortalTarget = require('../../global/js/hooks/usePortalTarget.js');
23
23
  var useFocus = require('../../global/js/hooks/useFocus.js');
24
+ var usePreviousValue = require('../../global/js/hooks/usePreviousValue.js');
24
25
  var ActionSet = require('../ActionSet/ActionSet.js');
25
26
 
26
27
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -28,7 +29,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
28
29
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
30
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
30
31
 
31
- var _excluded = ["actions", "ariaLabel", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "portalTarget", "selectorPrimaryFocus", "size", "slug", "title", "verticalPosition"];
32
+ var _excluded = ["actions", "ariaLabel", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "portalTarget", "selectorPrimaryFocus", "size", "slug", "title", "verticalPosition", "launcherButtonRef"];
32
33
 
33
34
  // The block part of our conventional BEM class names (bc__E--M).
34
35
  var bc = "".concat(settings.pkg.prefix, "--tearsheet");
@@ -91,6 +92,7 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
91
92
  slug = _ref.slug,
92
93
  title = _ref.title,
93
94
  verticalPosition = _ref.verticalPosition,
95
+ launcherButtonRef = _ref.launcherButtonRef,
94
96
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
95
97
  var carbonPrefix = react.usePrefix();
96
98
  var bcModalHeader = "".concat(carbonPrefix, "--modal-header");
@@ -101,9 +103,11 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
101
103
  var modalRef = ref || localRef;
102
104
  var _useResizeObserver = useResizeObserver.useResizeObserver(resizer),
103
105
  width = _useResizeObserver.width;
104
- var _useFocus = useFocus.useFocus(modalRef),
106
+ var prevOpen = usePreviousValue.usePreviousValue(open);
107
+ var _useFocus = useFocus.useFocus(modalRef, selectorPrimaryFocus),
105
108
  firstElement = _useFocus.firstElement,
106
- keyDownListener = _useFocus.keyDownListener;
109
+ keyDownListener = _useFocus.keyDownListener,
110
+ specifiedElement = _useFocus.specifiedElement;
107
111
  var modalRefValue = modalRef.current;
108
112
  var wide = size === 'wide';
109
113
 
@@ -142,17 +146,30 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
142
146
 
143
147
  // Callback to give the tearsheet the opportunity to claim focus
144
148
  handleStackChange.claimFocus = function () {
149
+ if (selectorPrimaryFocus) {
150
+ return specifiedElement === null || specifiedElement === void 0 ? void 0 : specifiedElement.focus();
151
+ }
145
152
  firstElement === null || firstElement === void 0 || firstElement.focus();
146
153
  };
147
154
  React.useEffect(function () {
148
155
  if (open) {
149
- // Focusing the first element
156
+ // Focusing the first element or selectorPrimaryFocus element
150
157
  setTimeout(function () {
158
+ if (selectorPrimaryFocus) {
159
+ return specifiedElement === null || specifiedElement === void 0 ? void 0 : specifiedElement.focus();
160
+ }
151
161
  firstElement === null || firstElement === void 0 || firstElement.focus();
152
162
  }, 0);
153
163
  }
154
164
  // eslint-disable-next-line react-hooks/exhaustive-deps
155
165
  }, [open]);
166
+ React.useEffect(function () {
167
+ if (prevOpen && !open && launcherButtonRef) {
168
+ setTimeout(function () {
169
+ launcherButtonRef.current.focus();
170
+ }, 0);
171
+ }
172
+ }, [launcherButtonRef, open, prevOpen]);
156
173
  React.useEffect(function () {
157
174
  if (open && position !== depth) {
158
175
  setTimeout(function () {
@@ -411,6 +428,11 @@ TearsheetShell.propTypes = _rollupPluginBabelHelpers.objectSpread2({
411
428
  * to page of a multi-page task).
412
429
  */
413
430
  label: index["default"].node,
431
+ /**
432
+ * Provide a ref to return focus to once the tearsheet is closed.
433
+ */
434
+ /**@ts-ignore */
435
+ launcherButtonRef: index["default"].any,
414
436
  /**
415
437
  * Navigation content, such as a set of tabs, to be displayed at the bottom
416
438
  * of the header area of the tearsheet. NB the navigation is only applicable
@@ -41,6 +41,10 @@ interface WebTerminalProps extends PropsWithChildren {
41
41
  * Optionally pass if the web terminal should be open by default
42
42
  */
43
43
  isInitiallyOpen?: boolean;
44
+ /**
45
+ * Specifies aria label for Web terminal
46
+ */
47
+ webTerminalAriaLabel?: string;
44
48
  }
45
49
  /**
46
50
  * The `WebTerminal` is prompted by the user and is persistent until dismissed. The purpose of a web terminal is to provide users with the ability to type commands manually instead of using the GUI.
@@ -25,7 +25,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
25
25
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
26
26
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
27
27
 
28
- var _excluded = ["actions", "children", "className", "closeIconDescription", "documentationLinks", "documentationLinksIconDescription", "isInitiallyOpen"];
28
+ var _excluded = ["actions", "children", "className", "closeIconDescription", "documentationLinks", "documentationLinksIconDescription", "isInitiallyOpen", "webTerminalAriaLabel"];
29
29
 
30
30
  // The block part of our conventional BEM class names (blockClass__E--M).
31
31
  var componentName = 'WebTerminal';
@@ -36,7 +36,8 @@ var defaults = {
36
36
  actions: Object.freeze([]),
37
37
  documentationLinks: Object.freeze([]),
38
38
  documentationLinksIconDescription: 'Show documentation links',
39
- isInitiallyOpen: false
39
+ isInitiallyOpen: false,
40
+ webTerminalAriaLabel: 'Web terminal header'
40
41
  };
41
42
  /**
42
43
  * The `WebTerminal` is prompted by the user and is persistent until dismissed. The purpose of a web terminal is to provide users with the ability to type commands manually instead of using the GUI.
@@ -53,6 +54,8 @@ exports.WebTerminal = /*#__PURE__*/React__default["default"].forwardRef(function
53
54
  documentationLinksIconDescription = _ref$documentationLin2 === void 0 ? defaults.documentationLinksIconDescription : _ref$documentationLin2,
54
55
  _ref$isInitiallyOpen = _ref.isInitiallyOpen,
55
56
  isInitiallyOpen = _ref$isInitiallyOpen === void 0 ? defaults.isInitiallyOpen : _ref$isInitiallyOpen,
57
+ _ref$webTerminalAriaL = _ref.webTerminalAriaLabel,
58
+ webTerminalAriaLabel = _ref$webTerminalAriaL === void 0 ? defaults.webTerminalAriaLabel : _ref$webTerminalAriaL,
56
59
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
57
60
  var _useWebTerminal = index.useWebTerminal(),
58
61
  open = _useWebTerminal.open,
@@ -111,6 +114,7 @@ exports.WebTerminal = /*#__PURE__*/React__default["default"].forwardRef(function
111
114
  },
112
115
  onAnimationEnd: onAnimationEnd
113
116
  }), /*#__PURE__*/React__default["default"].createElement("header", {
117
+ "aria-label": webTerminalAriaLabel,
114
118
  className: "".concat(blockClass, "__bar")
115
119
  }, /*#__PURE__*/React__default["default"].createElement("div", {
116
120
  className: "".concat(blockClass, "__actions")
@@ -205,5 +209,9 @@ exports.WebTerminal.propTypes = {
205
209
  /**
206
210
  * Optionally pass if the web terminal should be open by default
207
211
  */
208
- isInitiallyOpen: index$1["default"].bool
212
+ isInitiallyOpen: index$1["default"].bool,
213
+ /**
214
+ * Specifies aria label for Web terminal
215
+ */
216
+ webTerminalAriaLabel: index$1["default"].string
209
217
  };
@@ -54,6 +54,7 @@ export { StatusIndicator } from "./StatusIndicator";
54
54
  export { TagOverflow } from "./TagOverflow";
55
55
  export { ActionBar } from "./ActionBar";
56
56
  export { ConditionBuilder } from "./ConditionBuilder";
57
+ export { GetStartedCard } from "./GetStartedCard";
57
58
  export { ComboButton, ComboButtonItem } from "./ComboButton";
58
59
  export { CreateFullPage, CreateFullPageStep } from "./CreateFullPage";
59
60
  export { CreateTearsheet, CreateTearsheetStep, CreateTearsheetDivider } from "./CreateTearsheet";
@@ -1,11 +1,13 @@
1
- export function useFocus(modalRef: any): {
1
+ export function useFocus(modalRef: any, selectorPrimaryFocus: any): {
2
2
  firstElement: any;
3
3
  lastElement: any;
4
4
  allElements: any;
5
+ specifiedElement: any;
5
6
  keyDownListener: (event: any) => void;
6
7
  getFocusable: () => {
7
8
  first: any;
8
9
  last: any;
9
10
  all: any;
11
+ specifiedElement: any;
10
12
  };
11
13
  };
@@ -13,7 +13,7 @@ var react = require('@carbon/react');
13
13
  var settings = require('../../../settings.js');
14
14
  var React = require('react');
15
15
 
16
- var useFocus = function useFocus(modalRef) {
16
+ var useFocus = function useFocus(modalRef, selectorPrimaryFocus) {
17
17
  var carbonPrefix = react.usePrefix();
18
18
  var tearsheetBaseClass = "".concat(settings.pkg.prefix, "--tearsheet");
19
19
  // Querying focusable element in the modal
@@ -43,12 +43,14 @@ var useFocus = function useFocus(modalRef) {
43
43
  var first = (_focusableElements2 = focusableElements) === null || _focusableElements2 === void 0 ? void 0 : _focusableElements2[0];
44
44
  var last = (_focusableElements3 = focusableElements) === null || _focusableElements3 === void 0 ? void 0 : _focusableElements3[((_focusableElements4 = focusableElements) === null || _focusableElements4 === void 0 ? void 0 : _focusableElements4.length) - 1];
45
45
  var all = focusableElements;
46
+ var specifiedElement = selectorPrimaryFocus ? modalEl === null || modalEl === void 0 ? void 0 : modalEl.querySelector(selectorPrimaryFocus) : null;
46
47
  return {
47
48
  first: first,
48
49
  last: last,
49
- all: all
50
+ all: all,
51
+ specifiedElement: specifiedElement
50
52
  };
51
- }, [modalEl, query]);
53
+ }, [modalEl, query, selectorPrimaryFocus]);
52
54
  React.useEffect(function () {
53
55
  getFocusable();
54
56
  }, [getFocusable]);
@@ -80,6 +82,7 @@ var useFocus = function useFocus(modalRef) {
80
82
  firstElement: getFocusable().first,
81
83
  lastElement: getFocusable().last,
82
84
  allElements: getFocusable().all,
85
+ specifiedElement: getFocusable().specified,
83
86
  keyDownListener: handleKeyDown,
84
87
  getFocusable: getFocusable
85
88
  };
@@ -5,5 +5,5 @@ export function useRetrieveStepData({ stepsContext, stepNumber, introStep, inval
5
5
  invalid: boolean;
6
6
  shouldIncludeStep: boolean;
7
7
  secondaryLabel: string;
8
- title: string;
8
+ title: React.ReactNode;
9
9
  }): void;
@@ -22,7 +22,7 @@ var React = require('react');
22
22
  * @param {boolean} useResetCreateComponent.invalid
23
23
  * @param {boolean} useResetCreateComponent.shouldIncludeStep
24
24
  * @param {string} useResetCreateComponent.secondaryLabel
25
- * @param {string} useResetCreateComponent.title
25
+ * @param {React.ReactNode} useResetCreateComponent.title
26
26
  */
27
27
  var useRetrieveStepData = function useRetrieveStepData(_ref) {
28
28
  var stepsContext = _ref.stepsContext,
@@ -96,6 +96,7 @@ declare namespace defaults {
96
96
  let FilterPanelLabel: boolean;
97
97
  let FilterPanelSearch: boolean;
98
98
  let ConditionBuilder: boolean;
99
+ let GetStartedCard: boolean;
99
100
  let Coachmark: boolean;
100
101
  let CoachmarkBeacon: boolean;
101
102
  let CoachmarkButton: boolean;
@@ -99,6 +99,7 @@ var defaults = {
99
99
  FilterPanelLabel: false,
100
100
  FilterPanelSearch: false,
101
101
  ConditionBuilder: false,
102
+ GetStartedCard: false,
102
103
  /* new component flags here - comment used by generate CLI */
103
104
 
104
105
  // Novice to pro components not yet reviewed and released:
package/lib/index.js CHANGED
@@ -136,6 +136,7 @@ var FilterPanelGroup = require('./components/FilterPanel/FilterPanelGroup/Filter
136
136
  var FilterPanelLabel = require('./components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js');
137
137
  var FilterPanelSearch = require('./components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js');
138
138
  var ConditionBuilder = require('./components/ConditionBuilder/ConditionBuilder.js');
139
+ var GetStartedCard = require('./components/GetStartedCard/GetStartedCard.js');
139
140
 
140
141
 
141
142
 
@@ -576,3 +577,7 @@ Object.defineProperty(exports, 'ConditionBuilder', {
576
577
  enumerable: true,
577
578
  get: function () { return ConditionBuilder.ConditionBuilder; }
578
579
  });
580
+ Object.defineProperty(exports, 'GetStartedCard', {
581
+ enumerable: true,
582
+ get: function () { return GetStartedCard.GetStartedCard; }
583
+ });
package/lib/settings.d.ts CHANGED
@@ -82,6 +82,7 @@ export const pkg: {
82
82
  FilterPanelLabel: boolean;
83
83
  FilterPanelSearch: boolean;
84
84
  ConditionBuilder: boolean;
85
+ GetStartedCard: boolean;
85
86
  Coachmark: boolean;
86
87
  CoachmarkBeacon: boolean;
87
88
  CoachmarkButton: boolean;
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.38.0",
4
+ "version": "2.40.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -92,7 +92,7 @@
92
92
  },
93
93
  "dependencies": {
94
94
  "@babel/runtime": "^7.23.9",
95
- "@carbon/ibm-products-styles": "^2.36.0",
95
+ "@carbon/ibm-products-styles": "^2.37.1",
96
96
  "@carbon/telemetry": "^0.1.0",
97
97
  "@dnd-kit/core": "^6.0.8",
98
98
  "@dnd-kit/modifiers": "^7.0.0",
@@ -116,5 +116,5 @@
116
116
  "react": "^16.8.6 || ^17.0.1 || ^18.2.0",
117
117
  "react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
118
118
  },
119
- "gitHead": "c3f7c28b58bf5412337cca1a1d3f98a250522294"
119
+ "gitHead": "2fbbfdc269add9b97a3eac30e5570b91ec80fd82"
120
120
  }
@@ -14,6 +14,7 @@
14
14
  @use '@carbon/react/scss/motion' as *;
15
15
  @use '@carbon/react/scss/colors' as *;
16
16
  @use '@carbon/react/scss/theme' as *;
17
+ @use '@carbon/layout/scss/convert';
17
18
  @use '@carbon/styles/scss/components/button/tokens' as *;
18
19
  // Other Carbon settings if needed
19
20
  // TODO: @use '@carbon/styles/scss/grid';
@@ -43,7 +44,7 @@ $stack-home-class: #{c4p-settings.$pkg-prefix}--coachmark-stacked-home;
43
44
  &--is-mounted {
44
45
  bottom: 0;
45
46
  /* stylelint-disable-next-line carbon/motion-easing-use, carbon/motion-duration-use */
46
- transition: transform $duration-moderate-02 motion(exit, productive);
47
+ transition: $duration-moderate-02 motion(exit, productive);
47
48
  @media (prefers-reduced-motion) {
48
49
  transition: none;
49
50
  }
@@ -60,7 +61,8 @@ $stack-home-class: #{c4p-settings.$pkg-prefix}--coachmark-stacked-home;
60
61
  bottom: 0;
61
62
  overflow: hidden;
62
63
  pointer-events: none;
63
- transform: perspective(carbon--mini-units(18))
64
+ /* stylelint-disable-next-line function-no-unknown -- to-rem carbon replacement for rem */
65
+ transform: perspective(convert.to-rem(144px))
64
66
  translate3d(0, calc($spacing-09 * -1), calc($spacing-05 * -1));
65
67
  transform-origin: top center;
66
68
  visibility: visible;
@@ -0,0 +1,9 @@
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
+
8
+ // Import any Carbon component styles used from GetStartedCard in this file.
9
+ // GetStartedCard uses the following Carbon components: