@carbon/ibm-products 2.39.0 → 2.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/css/index-full-carbon.css +9 -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 +9 -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 +9 -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 +1 -1
  27. package/es/components/CreateInfluencer/CreateInfluencer.js +1 -1
  28. package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
  29. package/es/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
  30. package/es/components/DataSpreadsheet/DataSpreadsheet.js +4 -3
  31. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -0
  32. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
  33. package/es/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
  34. package/es/components/Guidebanner/Guidebanner.d.ts +62 -2
  35. package/es/components/Guidebanner/Guidebanner.js +8 -7
  36. package/es/components/Guidebanner/GuidebannerElement.d.ts +30 -17
  37. package/es/components/Guidebanner/GuidebannerElement.js +4 -4
  38. package/es/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
  39. package/es/components/Guidebanner/GuidebannerElementButton.js +10 -4
  40. package/es/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
  41. package/es/components/Guidebanner/GuidebannerElementLink.js +3 -3
  42. package/es/components/InterstitialScreen/InterstitialScreen.js +3 -1
  43. package/es/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
  44. package/es/components/MultiAddSelect/MultiAddSelect.js +2 -1
  45. package/es/components/NotificationsPanel/NotificationsPanel.js +0 -1
  46. package/es/components/PageHeader/PageHeader.d.ts +298 -5
  47. package/es/components/PageHeader/PageHeader.js +98 -47
  48. package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  49. package/es/components/PageHeader/PageHeaderUtils.js +4 -1
  50. package/es/components/SidePanel/SidePanel.d.ts +6 -2
  51. package/es/components/SidePanel/SidePanel.js +17 -2
  52. package/es/components/SidePanel/constants.d.ts +1 -0
  53. package/es/components/SidePanel/constants.js +1 -0
  54. package/es/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
  55. package/es/components/SingleAddSelect/SingleAddSelect.js +2 -1
  56. package/es/components/Tearsheet/Tearsheet.d.ts +132 -6
  57. package/es/components/Tearsheet/Tearsheet.js +25 -13
  58. package/es/components/Tearsheet/TearsheetShell.d.ts +5 -1
  59. package/es/components/Tearsheet/TearsheetShell.js +26 -4
  60. package/es/components/WebTerminal/WebTerminal.d.ts +4 -0
  61. package/es/components/WebTerminal/WebTerminal.js +11 -3
  62. package/es/global/js/hooks/useFocus.d.ts +3 -1
  63. package/es/global/js/hooks/useFocus.js +6 -3
  64. package/es/global/js/hooks/useRetrieveStepData.d.ts +1 -1
  65. package/es/global/js/hooks/useRetrieveStepData.js +1 -1
  66. package/lib/components/AddSelect/AddSelect.d.ts +44 -2
  67. package/lib/components/AddSelect/AddSelect.js +7 -3
  68. package/lib/components/AddSelect/AddSelectBody.d.ts +44 -2
  69. package/lib/components/AddSelect/AddSelectBody.js +10 -12
  70. package/lib/components/AddSelect/AddSelectSort.d.ts +16 -17
  71. package/lib/components/AddSelect/AddSelectSort.js +5 -5
  72. package/lib/components/AddSelect/types/index.d.ts +44 -0
  73. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +5 -1
  74. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +12 -6
  75. package/lib/components/Card/Card.js +1 -1
  76. package/lib/components/CreateInfluencer/CreateInfluencer.js +1 -1
  77. package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
  78. package/lib/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
  79. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +4 -3
  80. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -0
  81. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
  82. package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
  83. package/lib/components/Guidebanner/Guidebanner.d.ts +62 -2
  84. package/lib/components/Guidebanner/Guidebanner.js +8 -7
  85. package/lib/components/Guidebanner/GuidebannerElement.d.ts +30 -17
  86. package/lib/components/Guidebanner/GuidebannerElement.js +4 -4
  87. package/lib/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
  88. package/lib/components/Guidebanner/GuidebannerElementButton.js +10 -4
  89. package/lib/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
  90. package/lib/components/Guidebanner/GuidebannerElementLink.js +3 -3
  91. package/lib/components/InterstitialScreen/InterstitialScreen.js +3 -1
  92. package/lib/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
  93. package/lib/components/MultiAddSelect/MultiAddSelect.js +2 -1
  94. package/lib/components/NotificationsPanel/NotificationsPanel.js +0 -1
  95. package/lib/components/PageHeader/PageHeader.d.ts +298 -5
  96. package/lib/components/PageHeader/PageHeader.js +98 -47
  97. package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  98. package/lib/components/PageHeader/PageHeaderUtils.js +4 -1
  99. package/lib/components/SidePanel/SidePanel.d.ts +6 -2
  100. package/lib/components/SidePanel/SidePanel.js +17 -2
  101. package/lib/components/SidePanel/constants.d.ts +1 -0
  102. package/lib/components/SidePanel/constants.js +1 -0
  103. package/lib/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
  104. package/lib/components/SingleAddSelect/SingleAddSelect.js +2 -1
  105. package/lib/components/Tearsheet/Tearsheet.d.ts +132 -6
  106. package/lib/components/Tearsheet/Tearsheet.js +25 -13
  107. package/lib/components/Tearsheet/TearsheetShell.d.ts +5 -1
  108. package/lib/components/Tearsheet/TearsheetShell.js +26 -4
  109. package/lib/components/WebTerminal/WebTerminal.d.ts +4 -0
  110. package/lib/components/WebTerminal/WebTerminal.js +11 -3
  111. package/lib/global/js/hooks/useFocus.d.ts +3 -1
  112. package/lib/global/js/hooks/useFocus.js +6 -3
  113. package/lib/global/js/hooks/useRetrieveStepData.d.ts +1 -1
  114. package/lib/global/js/hooks/useRetrieveStepData.js +1 -1
  115. package/package.json +3 -3
  116. package/scss/components/CoachmarkStack/_coachmark-stack.scss +4 -2
  117. package/scss/components/SidePanel/_side-panel-variables.scss +1 -0
  118. package/scss/components/StringFormatter/_string-formatter.scss +1 -1
  119. package/telemetry.yml +2 -0
@@ -1,6 +1,299 @@
1
- export let PageHeader: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
- export namespace deprecatedProps {
3
- let disableBreadcrumbScroll: (props: any, propName: any, comp: any, loc: any, propFullName: any, secret: any) => any;
4
- let hasBackgroundAlways: (props: any, propName: any, comp: any, loc: any, propFullName: any, secret: any) => any;
1
+ /// <reference path="../../../src/custom-typings/index.d.ts" />
2
+ import React, { PropsWithChildren, ReactNode } from 'react';
3
+ import { Tag } from '@carbon/react';
4
+ import { ButtonProps, PopoverAlignment, TagProps } from '@carbon/type';
5
+ interface ActionBarItem extends ButtonProps {
6
+ iconDescription: string;
7
+ onClick: () => void;
8
+ renderIcon: ReactNode;
5
9
  }
6
- import React from 'react';
10
+ type Size = 'xl';
11
+ type ActionBarOverflowAriaLabelProps = {
12
+ /**
13
+ * Specifies the action bar items which are the final items in the row top of the PageHeader.
14
+ * Each item is specified as an object with the properties of a Carbon Button in icon only form.
15
+ * Button kind, size, tooltipPosition, tooltipAlignment and type are ignored.
16
+ */
17
+ actionBarItems: ActionBarItem[];
18
+ /**
19
+ * When there is insufficient space for all actionBarItems to be displayed this
20
+ * aria label is used for the action bar overflow menu
21
+ *
22
+ * NOTE: This prop is required if actionBarItems are supplied
23
+ */
24
+ actionBarOverflowAriaLabel: string;
25
+ } | {
26
+ actionBarItems?: never;
27
+ actionBarOverflowAriaLabel?: string;
28
+ };
29
+ type BreadcrumbLabelProps = {
30
+ label?: string;
31
+ title?: string;
32
+ } | {
33
+ /**
34
+ * Pass in content that will be inside of the BreadcrumbItem
35
+ */
36
+ label: ReactNode | JSX.Element | (() => JSX.Element) | JSX.Element[] | ReactNode[];
37
+ /**
38
+ * A text version of the `label` for display, required if `label` is not a string.
39
+ */
40
+ title: string;
41
+ };
42
+ interface BreadcrumbBase {
43
+ /**
44
+ * Optional string representing the link location for the BreadcrumbItem
45
+ */
46
+ href?: string;
47
+ /**
48
+ * Provide if this breadcrumb item represents the current page
49
+ */
50
+ isCurrentPage?: boolean;
51
+ /**
52
+ * Key required to render array efficiently
53
+ */
54
+ key: string;
55
+ }
56
+ type Breadcrumb = BreadcrumbBase & BreadcrumbLabelProps;
57
+ type BreadcrumbProps = {
58
+ /**
59
+ * Specifies the breadcrumb components to be shown in the breadcrumb area of
60
+ * the page header. Each item is specified as an object with optional fields
61
+ * 'label' to supply the breadcrumb label, 'href' to supply the link location,
62
+ * and 'isCurrentPage' to specify whether this breadcrumb component represents
63
+ * the current page. Each item should also include a unique 'key' field to
64
+ * enable efficient rendering, and if the label is not a string then a 'title'
65
+ * field is required to provide a text alternative for display. Any other
66
+ * fields in the object will be passed through to the breadcrumb element as
67
+ * HTML attributes.
68
+ */
69
+ breadcrumbs: Breadcrumb[];
70
+ /**
71
+ * If the user supplies breadcrumbs then this property is required.
72
+ * It is used in an overflow menu when there is insufficient space to display all breadcrumbs inline.
73
+ */
74
+ breadcrumbOverflowAriaLabel: string;
75
+ } | {
76
+ breadcrumbs?: never;
77
+ breadcrumbOverflowAriaLabel?: string;
78
+ };
79
+ type CollapseHeaderProps = {
80
+ hasCollapseHeaderToggle?: false;
81
+ withoutBackground?: boolean;
82
+ collapseHeaderIconDescription?: string;
83
+ expandHeaderIconDescription?: string;
84
+ } | {
85
+ /**
86
+ * Adds a button as the last element of the bottom row which collapses and expands the header.
87
+ *
88
+ * NOTE: The header is collapsed by setting the scroll position to hide part of the header.
89
+ * Collapsing has no effect if there is insufficient content to scroll.
90
+ */
91
+ hasCollapseHeaderToggle: true;
92
+ /**
93
+ * Specifies if the PageHeader should appear without a background color, and defaults to the preferred `false` (a background color is shown).
94
+ * Note that when `true` some parts of the header still gain a background if and when they stick to the top of the PageHeader on scroll.
95
+ */
96
+ withoutBackground?: false;
97
+ /**
98
+ * If `hasCollapseHeaderToggle` is set and `withoutBackground` is unset/falsy then assistive text is
99
+ * required for both the expend and collapse states of the button component used.
100
+ */
101
+ collapseHeaderIconDescription: string;
102
+ expandHeaderIconDescription: string;
103
+ };
104
+ interface PageAction {
105
+ content: ReactNode;
106
+ minWidth: number;
107
+ maxWidth: number;
108
+ }
109
+ type PageActionProps = {
110
+ /**
111
+ * Specifies the primary page actions which are placed at the same level in the page as the title.
112
+ *
113
+ * Either a set of actions, each specified as an object with the properties of a Carbon Button plus:
114
+ *
115
+ * - label: node
116
+ *
117
+ * Or a single object
118
+ *
119
+ * - content: content to be rendered. NOTE: must be capable of restricting itself to the space provided. This 2.5rem height ($spacing-08)
120
+ * and the width not used by action bar items when scrolled into toolbar.
121
+ * - minWidth: smallest number of pixel width the content would like. NOTE: This is not guaranteed and may be less on small viewports.
122
+ * - maxWidth: maximum number of pixels the content will grow to
123
+ * Carbon Button API https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
124
+ */
125
+ pageActions: ButtonProps[] | PageAction;
126
+ /**
127
+ * When there is insufficient space to display all of hte page actions inline a dropdown button menu is shown,
128
+ * containing the page actions. This label is used as the display content of the dropdown button menu.
129
+ *
130
+ * NOTE: This prop is required if pageActions are supplied
131
+ */
132
+ pageActionsOverflowLabel: ReactNode;
133
+ } | {
134
+ pageActions?: never;
135
+ pageActionsOverflowLabel?: ReactNode;
136
+ };
137
+ interface Tag extends TagProps {
138
+ label: string;
139
+ }
140
+ interface TitleIcon {
141
+ text: string;
142
+ icon?: object | (() => void);
143
+ loading?: boolean;
144
+ editableLabel?: string;
145
+ id?: string;
146
+ onCancel?: () => void;
147
+ onChange?: () => void;
148
+ onSave?: () => void;
149
+ cancelDescription?: string;
150
+ editDescription?: string;
151
+ saveDescription?: string;
152
+ }
153
+ interface TitleContent {
154
+ content: ReactNode;
155
+ breadcrumbContent?: ReactNode;
156
+ asText: string;
157
+ }
158
+ interface PageHeaderBaseProps extends PropsWithChildren {
159
+ /**
160
+ * class name applied to the action bar overflow options
161
+ */
162
+ actionBarMenuOptionsClass?: string;
163
+ /**
164
+ * When tags are supplied there may not be sufficient space to display all of the tags. This results in an overflow
165
+ * menu being shown. If in the overflow menu there is still insufficient space this label is used in a dialog showing
166
+ * all tags.
167
+ *
168
+ * **Note: Required if more than 10 tags**
169
+ */
170
+ allTagsModalSearchLabel?: string;
171
+ /**
172
+ * When tags are supplied there may not be sufficient space to display all of the tags. This results in an overflow
173
+ * menu being shown. If in the overflow menu there is still insufficient space this placeholder is used in a dialog
174
+ * showing all tags.
175
+ *
176
+ * **Note: Required if more than 10 tags**
177
+ */
178
+ allTagsModalSearchPlaceholderText?: string;
179
+ /**
180
+ * When tags are supplied there may not be sufficient space to display all of the tags. This results in an overflow
181
+ * menu being shown. If in the overflow menu there is still insufficient space this title is used in a dialog showing
182
+ * all tags.
183
+ *
184
+ * **Note: Required if more than 10 tags**
185
+ */
186
+ allTagsModalTitle?: string;
187
+ /**
188
+ * align breadcrumb overflow tooltip
189
+ */
190
+ breadcrumbOverflowTooltipAlign?: PopoverAlignment;
191
+ /**
192
+ * Specifies class(es) to be applied to the top-level PageHeader node.
193
+ * Optional.
194
+ */
195
+ className?: string;
196
+ /**
197
+ * The header can as a whole be collapsed, expanded or somewhere in between.
198
+ * This setting controls the initial value, but also takes effect on change
199
+ *
200
+ * NOTE: The header is collapsed by setting the scroll position to hide part of the header.
201
+ * Collapsing has no effect if there is insufficient content to scroll.
202
+ */
203
+ collapseHeader?: boolean;
204
+ /**
205
+ * The title row typically starts below the breadcrumb row. This option
206
+ * preCollapses it into the breadcrumb row.
207
+ */
208
+ collapseTitle?: boolean;
209
+ /**
210
+ * Standard keeps the breadcrumb on the page. This option allows the breadcrumb
211
+ * to scroll off
212
+ */
213
+ enableBreadcrumbScroll?: boolean;
214
+ /**
215
+ * The PageHeader is hosted in a Carbon grid, this value is passed through to the Carbon grid fullWidth prop.
216
+ * 'xl' is used to override the grid width setting. Can be used with narrowGrid: true to get the largest size.
217
+ */
218
+ fullWidthGrid?: boolean | Size;
219
+ /**
220
+ * The PageHeader is hosted in a Carbon grid, this value is passed through to the Carbon grid narrow prop
221
+ */
222
+ narrowGrid?: boolean;
223
+ /**
224
+ * Content for the navigation area in the PageHeader. Should
225
+ * be a React element that is normally a Carbon Tabs component. Optional.
226
+ */
227
+ navigation?: object;
228
+ /**
229
+ * class name applied to the page actions overflow options
230
+ */
231
+ pageActionsMenuOptionsClass?: string;
232
+ /**
233
+ * When tags are supplied there may not be sufficient space to display all of the tags. This results in an overflow
234
+ * menu being shown. If in the overflow menu there is still insufficient space this label is used to offer a
235
+ * "View all tags" option.
236
+ *
237
+ * **Note: Required if more than 10 tags**
238
+ */
239
+ showAllTagsLabel?: string;
240
+ /**
241
+ * Sitting just below the title is this optional subtitle that provides additional context to
242
+ * identify the current page.
243
+ */
244
+ subtitle?: ReactNode;
245
+ /**
246
+ * An array of tags to be shown as the final content in the PageHeader.
247
+ *
248
+ * Each tag is specified as an object with the following properties
249
+ * **label**\* (required) to supply the tag content, and properties of the the Carbon Tag component,
250
+ * such as **type**, **disabled**, **ref**, **className** , and any other Tag props.
251
+ *
252
+ * NOTE: **filter** is not supported. Any remaining fields in the object will be passed through to the HTML element
253
+ * as HTML attributes.
254
+ *
255
+ * See https://react.carbondesignsystem.com/?path=/docs/components-tag--default
256
+ */
257
+ tags?: Tag[];
258
+ /**
259
+ * An optional page title supplied as a string or object with the following attributes: text, icon, loading
260
+ *
261
+ * Can be supplied either as:
262
+ * - String
263
+ * - Object containing
264
+ * - text: title string
265
+ * - icon: optional icon
266
+ * - loading: boolean shows loading indicator if true
267
+ * - onChange: function to process the live value (React change === HTML Input)
268
+ * - onSave: function to process a confirmed change
269
+ * - editableLabel: label for edit required if onChange supplied
270
+ * - cancelDescription: label for edit cancel button
271
+ * - saveDescription: label for edit save button
272
+ * - Object containing user defined contents. These must fit within the area defined for the title in both main part of the header and the breadcrumb.
273
+ * - content: title or name of current location shown in main part of page header
274
+ * - breadcrumbContent: version of content used in the breadcrumb on scroll. If not supplied
275
+ * - asText: String based representation of the title
276
+ */
277
+ title: string | TitleIcon | TitleContent;
278
+ /**
279
+ * @deprecated Property replaced by `enableBreadcrumbScroll
280
+ */
281
+ disableBreadcrumbScroll?: boolean;
282
+ /**
283
+ * @deprecated Property replaced by `withoutBackground`
284
+ */
285
+ hasBackgroundAlways?: boolean;
286
+ }
287
+ type PageHeaderProps = PageHeaderBaseProps & PageActionProps & CollapseHeaderProps & BreadcrumbProps & ActionBarOverflowAriaLabelProps;
288
+ export declare let PageHeader: React.ForwardRefExoticComponent<PageHeaderProps & React.RefAttributes<HTMLDivElement>>;
289
+ export declare const deprecatedProps: {
290
+ /**
291
+ * **Deprecated** see property `enableBreadcrumbScroll`
292
+ */
293
+ disableBreadcrumbScroll: (props: any, propName: any, comp: any, loc: any, propFullName: any, secret: any) => any;
294
+ /**
295
+ * **Deprecated** see property `withoutBackground`
296
+ */
297
+ hasBackgroundAlways: (props: any, propName: any, comp: any, loc: any, propFullName: any, secret: any) => any;
298
+ };
299
+ export {};