@carbon/react 1.31.3 → 1.32.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 (190) hide show
  1. package/README.md +1 -1
  2. package/es/components/Accordion/Accordion.Skeleton.d.ts +64 -0
  3. package/es/components/Accordion/Accordion.Skeleton.js +3 -3
  4. package/es/components/Accordion/Accordion.d.ts +65 -0
  5. package/es/components/Accordion/Accordion.js +5 -6
  6. package/es/components/Accordion/AccordionItem.d.ts +105 -0
  7. package/es/components/Accordion/AccordionItem.js +12 -9
  8. package/es/components/Accordion/AccordionProvider.d.ts +20 -0
  9. package/es/components/Accordion/AccordionProvider.js +25 -0
  10. package/es/components/Accordion/index.d.ts +11 -0
  11. package/es/components/Button/Button.Skeleton.d.ts +28 -0
  12. package/es/components/Button/Button.Skeleton.js +5 -3
  13. package/es/components/Button/Button.d.ts +72 -0
  14. package/es/components/Button/Button.js +13 -10
  15. package/es/components/Button/index.d.ts +11 -0
  16. package/es/components/Button/index.js +2 -1
  17. package/es/components/ButtonSet/ButtonSet.d.ts +17 -0
  18. package/es/components/ButtonSet/ButtonSet.js +1 -2
  19. package/es/components/ButtonSet/index.d.ts +9 -0
  20. package/es/components/CodeSnippet/CodeSnippet.js +1 -0
  21. package/es/components/ComboButton/index.js +1 -0
  22. package/es/components/ComposedModal/ComposedModal.d.ts +70 -0
  23. package/es/components/ComposedModal/ComposedModal.js +58 -67
  24. package/es/components/ComposedModal/ModalFooter.d.ts +71 -0
  25. package/es/components/ComposedModal/ModalFooter.js +22 -19
  26. package/es/components/ComposedModal/ModalHeader.d.ts +58 -0
  27. package/es/components/ComposedModal/ModalHeader.js +8 -25
  28. package/es/components/ComposedModal/index.d.ts +9 -0
  29. package/es/components/ContainedList/ContainedList.js +12 -1
  30. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +109 -0
  31. package/es/components/ContentSwitcher/ContentSwitcher.js +14 -6
  32. package/es/components/DangerButton/DangerButton.d.ts +9 -0
  33. package/es/components/DangerButton/DangerButton.js +2 -2
  34. package/es/components/DangerButton/index.d.ts +9 -0
  35. package/es/components/DataTable/TableBatchAction.js +1 -0
  36. package/es/components/DataTable/TableBatchActions.js +1 -0
  37. package/es/components/DataTable/TableBody.d.ts +29 -0
  38. package/es/components/DataTable/TableBody.js +2 -3
  39. package/es/components/DataTable/TableContainer.d.ts +51 -0
  40. package/es/components/DataTable/TableContainer.js +3 -4
  41. package/es/components/DataTable/TableExpandHeader.d.ts +86 -0
  42. package/es/components/DataTable/TableExpandHeader.js +4 -5
  43. package/es/components/DatePicker/plugins/fixEventsPlugin.js +12 -16
  44. package/es/components/Dropdown/Dropdown.js +1 -0
  45. package/es/components/FluidTextInput/FluidTextInput.js +1 -0
  46. package/es/components/FormGroup/FormGroup.d.ts +80 -0
  47. package/es/components/IconButton/index.js +3 -2
  48. package/es/components/Layout/index.d.ts +74 -0
  49. package/es/components/Layout/index.js +14 -5
  50. package/es/components/Link/Link.d.ts +2 -2
  51. package/es/components/Link/Link.js +2 -1
  52. package/es/components/MenuButton/index.js +1 -0
  53. package/es/components/Modal/Modal.js +1 -0
  54. package/es/components/ModalWrapper/ModalWrapper.js +1 -0
  55. package/es/components/Notification/Notification.d.ts +531 -0
  56. package/es/components/Notification/Notification.js +40 -6
  57. package/es/components/Notification/index.d.ts +7 -0
  58. package/es/components/PrimaryButton/PrimaryButton.js +1 -0
  59. package/es/components/SecondaryButton/SecondaryButton.js +1 -0
  60. package/es/components/Select/Select.d.ts +1 -1
  61. package/es/components/SkeletonText/SkeletonText.d.ts +61 -0
  62. package/es/components/SkeletonText/SkeletonText.js +15 -17
  63. package/es/components/SkeletonText/index.d.ts +9 -0
  64. package/es/components/Switch/Switch.d.ts +56 -0
  65. package/es/components/Switch/Switch.js +4 -4
  66. package/es/components/Tab/index.d.ts +9 -0
  67. package/es/components/TabContent/TabContent.d.ts +40 -0
  68. package/es/components/TabContent/TabContent.js +6 -12
  69. package/es/components/TabContent/index.d.ts +10 -0
  70. package/es/components/Tabs/Tabs.Skeleton.d.ts +33 -0
  71. package/es/components/Tabs/Tabs.Skeleton.js +2 -2
  72. package/es/components/Tabs/Tabs.d.ts +311 -0
  73. package/es/components/Tabs/Tabs.js +151 -97
  74. package/es/components/Tabs/index.d.ts +10 -0
  75. package/es/components/Tabs/usePressable.js +11 -0
  76. package/es/components/TextInput/ControlledPasswordInput.d.ts +90 -0
  77. package/es/components/TextInput/ControlledPasswordInput.js +5 -6
  78. package/es/components/Tile/Tile.d.ts +153 -0
  79. package/es/components/Tile/Tile.js +62 -74
  80. package/es/components/Tile/index.d.ts +7 -0
  81. package/es/components/Toggle/Toggle.Skeleton.d.ts +3 -47
  82. package/es/components/Toggle/Toggle.Skeleton.js +24 -64
  83. package/es/components/Toggle/Toggle.js +1 -1
  84. package/es/components/UIShell/HeaderGlobalAction.js +1 -0
  85. package/es/components/UIShell/HeaderPanel.js +61 -5
  86. package/es/components/UIShell/SideNav.d.ts +1 -1
  87. package/es/components/UIShell/Switcher.js +45 -5
  88. package/es/components/UIShell/SwitcherItem.js +45 -6
  89. package/es/index.js +16 -16
  90. package/es/internal/keyboard/match.js +2 -2
  91. package/es/internal/useControllableState.js +2 -2
  92. package/es/internal/useMatchMedia.js +44 -0
  93. package/es/internal/wrapFocus.js +6 -6
  94. package/es/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
  95. package/es/prop-types/types.js +3 -0
  96. package/lib/components/Accordion/Accordion.Skeleton.d.ts +64 -0
  97. package/lib/components/Accordion/Accordion.Skeleton.js +3 -3
  98. package/lib/components/Accordion/Accordion.d.ts +65 -0
  99. package/lib/components/Accordion/Accordion.js +5 -6
  100. package/lib/components/Accordion/AccordionItem.d.ts +105 -0
  101. package/lib/components/Accordion/AccordionItem.js +11 -8
  102. package/lib/components/Accordion/AccordionProvider.d.ts +20 -0
  103. package/lib/components/Accordion/AccordionProvider.js +34 -0
  104. package/lib/components/Accordion/index.d.ts +11 -0
  105. package/lib/components/Button/Button.Skeleton.d.ts +28 -0
  106. package/lib/components/Button/Button.Skeleton.js +5 -3
  107. package/lib/components/Button/Button.d.ts +72 -0
  108. package/lib/components/Button/Button.js +18 -11
  109. package/lib/components/Button/index.d.ts +11 -0
  110. package/lib/components/Button/index.js +6 -0
  111. package/lib/components/ButtonSet/ButtonSet.d.ts +17 -0
  112. package/lib/components/ButtonSet/ButtonSet.js +1 -2
  113. package/lib/components/ButtonSet/index.d.ts +9 -0
  114. package/lib/components/CodeSnippet/CodeSnippet.js +1 -0
  115. package/lib/components/ComboButton/index.js +1 -0
  116. package/lib/components/ComposedModal/ComposedModal.d.ts +70 -0
  117. package/lib/components/ComposedModal/ComposedModal.js +58 -67
  118. package/lib/components/ComposedModal/ModalFooter.d.ts +71 -0
  119. package/lib/components/ComposedModal/ModalFooter.js +22 -19
  120. package/lib/components/ComposedModal/ModalHeader.d.ts +58 -0
  121. package/lib/components/ComposedModal/ModalHeader.js +8 -25
  122. package/lib/components/ComposedModal/index.d.ts +9 -0
  123. package/lib/components/ContainedList/ContainedList.js +12 -1
  124. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +109 -0
  125. package/lib/components/ContentSwitcher/ContentSwitcher.js +14 -6
  126. package/lib/components/DangerButton/DangerButton.d.ts +9 -0
  127. package/lib/components/DangerButton/DangerButton.js +2 -2
  128. package/lib/components/DangerButton/index.d.ts +9 -0
  129. package/lib/components/DataTable/TableBatchAction.js +1 -0
  130. package/lib/components/DataTable/TableBatchActions.js +1 -0
  131. package/lib/components/DataTable/TableBody.d.ts +29 -0
  132. package/lib/components/DataTable/TableBody.js +3 -4
  133. package/lib/components/DataTable/TableContainer.d.ts +51 -0
  134. package/lib/components/DataTable/TableContainer.js +3 -4
  135. package/lib/components/DataTable/TableExpandHeader.d.ts +86 -0
  136. package/lib/components/DataTable/TableExpandHeader.js +4 -5
  137. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +12 -16
  138. package/lib/components/Dropdown/Dropdown.js +1 -0
  139. package/lib/components/FluidTextInput/FluidTextInput.js +1 -0
  140. package/lib/components/FormGroup/FormGroup.d.ts +80 -0
  141. package/lib/components/IconButton/index.js +3 -2
  142. package/lib/components/Layout/index.d.ts +74 -0
  143. package/lib/components/Layout/index.js +14 -5
  144. package/lib/components/Link/Link.d.ts +2 -2
  145. package/lib/components/Link/Link.js +2 -1
  146. package/lib/components/MenuButton/index.js +1 -0
  147. package/lib/components/Modal/Modal.js +1 -0
  148. package/lib/components/ModalWrapper/ModalWrapper.js +1 -0
  149. package/lib/components/Notification/Notification.d.ts +531 -0
  150. package/lib/components/Notification/Notification.js +40 -6
  151. package/lib/components/Notification/index.d.ts +7 -0
  152. package/lib/components/PrimaryButton/PrimaryButton.js +1 -0
  153. package/lib/components/SecondaryButton/SecondaryButton.js +1 -0
  154. package/lib/components/Select/Select.d.ts +1 -1
  155. package/lib/components/SkeletonText/SkeletonText.d.ts +61 -0
  156. package/lib/components/SkeletonText/SkeletonText.js +15 -17
  157. package/lib/components/SkeletonText/index.d.ts +9 -0
  158. package/lib/components/Switch/Switch.d.ts +56 -0
  159. package/lib/components/Switch/Switch.js +4 -4
  160. package/lib/components/Tab/index.d.ts +9 -0
  161. package/lib/components/TabContent/TabContent.d.ts +40 -0
  162. package/lib/components/TabContent/TabContent.js +6 -12
  163. package/lib/components/TabContent/index.d.ts +10 -0
  164. package/lib/components/Tabs/Tabs.Skeleton.d.ts +33 -0
  165. package/lib/components/Tabs/Tabs.Skeleton.js +2 -2
  166. package/lib/components/Tabs/Tabs.d.ts +311 -0
  167. package/lib/components/Tabs/Tabs.js +150 -96
  168. package/lib/components/Tabs/index.d.ts +10 -0
  169. package/lib/components/Tabs/usePressable.js +11 -0
  170. package/lib/components/TextInput/ControlledPasswordInput.d.ts +90 -0
  171. package/lib/components/TextInput/ControlledPasswordInput.js +5 -6
  172. package/lib/components/Tile/Tile.d.ts +153 -0
  173. package/lib/components/Tile/Tile.js +62 -74
  174. package/lib/components/Tile/index.d.ts +7 -0
  175. package/lib/components/Toggle/Toggle.Skeleton.d.ts +3 -47
  176. package/lib/components/Toggle/Toggle.Skeleton.js +22 -62
  177. package/lib/components/Toggle/Toggle.js +1 -1
  178. package/lib/components/UIShell/HeaderGlobalAction.js +1 -0
  179. package/lib/components/UIShell/HeaderPanel.js +60 -4
  180. package/lib/components/UIShell/SideNav.d.ts +1 -1
  181. package/lib/components/UIShell/Switcher.js +44 -4
  182. package/lib/components/UIShell/SwitcherItem.js +45 -6
  183. package/lib/index.js +51 -47
  184. package/lib/internal/keyboard/match.js +2 -2
  185. package/lib/internal/useControllableState.js +2 -2
  186. package/lib/internal/useMatchMedia.js +48 -0
  187. package/lib/internal/wrapFocus.js +6 -6
  188. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
  189. package/lib/prop-types/types.js +3 -0
  190. package/package.json +4 -3
@@ -4,8 +4,8 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React, { AriaAttributes, ComponentType, HTMLAttributeAnchorTarget } from 'react';
8
- interface LinkProps {
7
+ import React, { AnchorHTMLAttributes, AriaAttributes, ComponentType, HTMLAttributeAnchorTarget } from 'react';
8
+ interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
9
9
  /**
10
10
  * @description Indicates the element that represents the
11
11
  * current item within a container or set of related
@@ -44,7 +44,8 @@ const Link = /*#__PURE__*/React__default["default"].forwardRef(function Link(_re
44
44
  const rel = target === '_blank' ? 'noopener' : undefined;
45
45
  const linkProps = {
46
46
  className,
47
- rel
47
+ rel,
48
+ target
48
49
  };
49
50
 
50
51
  // Reference for disabled links:
@@ -15,6 +15,7 @@ var PropTypes = require('prop-types');
15
15
  var cx = require('classnames');
16
16
  var iconsReact = require('@carbon/icons-react');
17
17
  var Button = require('../Button/Button.js');
18
+ require('../Button/Button.Skeleton.js');
18
19
  var Menu = require('../Menu/Menu.js');
19
20
  var useAttachedMenu = require('../../internal/useAttachedMenu.js');
20
21
  var useId = require('../../internal/useId.js');
@@ -16,6 +16,7 @@ var cx = require('classnames');
16
16
  var iconsReact = require('@carbon/icons-react');
17
17
  var toggleClass = require('../../tools/toggleClass.js');
18
18
  var Button = require('../Button/Button.js');
19
+ require('../Button/Button.Skeleton.js');
19
20
  var ButtonSet = require('../ButtonSet/ButtonSet.js');
20
21
  var requiredIfGivenPropIsTruthy = require('../../prop-types/requiredIfGivenPropIsTruthy.js');
21
22
  var wrapFocus = require('../../internal/wrapFocus.js');
@@ -14,6 +14,7 @@ var PropTypes = require('prop-types');
14
14
  var React = require('react');
15
15
  var Modal = require('../Modal/Modal.js');
16
16
  var Button = require('../Button/Button.js');
17
+ require('../Button/Button.Skeleton.js');
17
18
  var types = require('../../prop-types/types.js');
18
19
  var warning = require('../../internal/warning.js');
19
20
 
@@ -0,0 +1,531 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 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
+ import PropTypes from 'prop-types';
8
+ import { type ReactNode, type MouseEvent, type ComponentType, type FunctionComponent, type ButtonHTMLAttributes, type HTMLAttributes } from 'react';
9
+ import { type ButtonProps } from '../Button';
10
+ export interface NotificationActionButtonProps extends ButtonProps<'button'> {
11
+ /**
12
+ * Specify the content of the notification action button.
13
+ */
14
+ children?: ReactNode;
15
+ /**
16
+ * Specify an optional className to be applied to the notification action button
17
+ */
18
+ className?: string;
19
+ /**
20
+ * Specify if the visual treatment of the button should be for an inline notification
21
+ */
22
+ inline?: boolean;
23
+ /**
24
+ * Optionally specify a click handler for the notification action button.
25
+ */
26
+ onClick?(): void;
27
+ }
28
+ export declare function NotificationActionButton({ children, className: customClassName, onClick, inline, ...rest }: NotificationActionButtonProps): JSX.Element;
29
+ export declare namespace NotificationActionButton {
30
+ var propTypes: {
31
+ /**
32
+ * Specify the content of the notification action button.
33
+ */
34
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
35
+ /**
36
+ * Specify an optional className to be applied to the notification action button
37
+ */
38
+ className: PropTypes.Requireable<string>;
39
+ /**
40
+ * Specify if the visual treatment of the button should be for an inline notification
41
+ */
42
+ inline: PropTypes.Requireable<boolean>;
43
+ /**
44
+ * Optionally specify a click handler for the notification action button.
45
+ */
46
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
47
+ };
48
+ }
49
+ /**
50
+ * NotificationButton
51
+ * ==================
52
+ */
53
+ export interface NotificationButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
54
+ /**
55
+ * Specify an optional icon for the Button through a string,
56
+ * if provided. However, regular "close" icon is preferred.
57
+ */
58
+ name?: string;
59
+ /**
60
+ * Specify the notification type
61
+ */
62
+ notificationType?: 'toast' | 'inline' | 'actionable';
63
+ /**
64
+ * Optional prop to allow overriding the icon rendering.
65
+ * Can be a React component class
66
+ */
67
+ renderIcon?: ComponentType<{
68
+ className?: string;
69
+ name?: string;
70
+ }> | FunctionComponent<{
71
+ className?: string;
72
+ name?: string;
73
+ }>;
74
+ }
75
+ export declare function NotificationButton({ 'aria-label': ariaLabel, ariaLabel: deprecatedAriaLabel, className, type, renderIcon: IconTag, name, notificationType, ...rest }: NotificationButtonProps): JSX.Element;
76
+ export declare namespace NotificationButton {
77
+ var propTypes: {
78
+ /**
79
+ * Specify a label to be read by screen readers on the container node
80
+ */
81
+ "aria-label": PropTypes.Requireable<string>;
82
+ /**
83
+ * Deprecated, please use `aria-label` instead.
84
+ * Specify a label to be read by screen readers on the container note.
85
+ */
86
+ ariaLabel: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
87
+ /**
88
+ * Specify an optional className to be applied to the notification button
89
+ */
90
+ className: PropTypes.Requireable<string>;
91
+ /**
92
+ * Specify an optional icon for the Button through a string,
93
+ * if something but regular "close" icon is desirable
94
+ */
95
+ name: PropTypes.Requireable<string>;
96
+ /**
97
+ * Specify the notification type
98
+ */
99
+ notificationType: PropTypes.Requireable<string>;
100
+ /**
101
+ * Optional prop to allow overriding the icon rendering.
102
+ * Can be a React component class
103
+ */
104
+ renderIcon: PropTypes.Requireable<object>;
105
+ /**
106
+ * Optional prop to specify the type of the Button
107
+ */
108
+ type: PropTypes.Requireable<string>;
109
+ };
110
+ var defaultProps: {
111
+ "aria-label": string;
112
+ notificationType: string;
113
+ type: string;
114
+ renderIcon: any;
115
+ };
116
+ }
117
+ export interface NotificationIconProps {
118
+ iconDescription: string;
119
+ kind: 'error' | 'success' | 'warning' | 'warning-alt' | 'info' | 'info-square';
120
+ notificationType: 'inline' | 'toast';
121
+ }
122
+ /**
123
+ * ToastNotification
124
+ * =================
125
+ */
126
+ export interface ToastNotificationProps extends HTMLAttributes<HTMLDivElement> {
127
+ /**
128
+ * Provide a description for "close" icon button that can be read by screen readers
129
+ */
130
+ 'aria-label'?: string;
131
+ /**
132
+ * Specify the caption
133
+ */
134
+ caption?: string;
135
+ /**
136
+ * Specify the content
137
+ */
138
+ children?: ReactNode;
139
+ /**
140
+ * Specify an optional className to be applied to the notification box
141
+ */
142
+ className?: string;
143
+ /**
144
+ * Specify the close button should be disabled, or not
145
+ */
146
+ hideCloseButton?: boolean;
147
+ /**
148
+ * Specify what state the notification represents
149
+ */
150
+ kind: 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt';
151
+ /**
152
+ * Specify whether you are using the low contrast variant of the ToastNotification.
153
+ */
154
+ lowContrast?: boolean;
155
+ /**
156
+ * Provide a function that is called when menu is closed
157
+ */
158
+ onClose?(event: MouseEvent): boolean | void;
159
+ /**
160
+ * Provide a function that is called when the close button is clicked
161
+ */
162
+ onCloseButtonClick(event: MouseEvent): void;
163
+ /**
164
+ * By default, this value is "status". You can also provide an alternate
165
+ * role if it makes sense from the accessibility-side
166
+ */
167
+ role: 'alert' | 'log' | 'status';
168
+ /**
169
+ * Provide a description for "status" icon that can be read by screen readers
170
+ */
171
+ statusIconDescription?: string;
172
+ /**
173
+ * Specify the subtitle
174
+ */
175
+ subtitle?: string;
176
+ /**
177
+ * Specify an optional duration the notification should be closed in
178
+ */
179
+ timeout?: number;
180
+ /**
181
+ * Specify the title
182
+ */
183
+ title?: string;
184
+ }
185
+ export declare function ToastNotification({ ['aria-label']: ariaLabel, ariaLabel: deprecatedAriaLabel, role, onClose, onCloseButtonClick, statusIconDescription, className, children, kind, lowContrast, hideCloseButton, timeout, title, caption, subtitle, ...rest }: ToastNotificationProps): JSX.Element | null;
186
+ export declare namespace ToastNotification {
187
+ var propTypes: {
188
+ /**
189
+ * Provide a description for "close" icon button that can be read by screen readers
190
+ */
191
+ "aria-label": PropTypes.Requireable<string>;
192
+ /**
193
+ * Deprecated, please use `aria-label` instead.
194
+ * Provide a description for "close" icon button that can be read by screen readers
195
+ */
196
+ ariaLabel: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
197
+ /**
198
+ * Specify the caption
199
+ */
200
+ caption: PropTypes.Requireable<string>;
201
+ /**
202
+ * Specify the content
203
+ */
204
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
205
+ /**
206
+ * Specify an optional className to be applied to the notification box
207
+ */
208
+ className: PropTypes.Requireable<string>;
209
+ /**
210
+ * Specify the close button should be disabled, or not
211
+ */
212
+ hideCloseButton: PropTypes.Requireable<boolean>;
213
+ /**
214
+ * Specify what state the notification represents
215
+ */
216
+ kind: PropTypes.Requireable<string>;
217
+ /**
218
+ * Specify whether you are using the low contrast variant of the ToastNotification.
219
+ */
220
+ lowContrast: PropTypes.Requireable<boolean>;
221
+ /**
222
+ * Provide a function that is called when menu is closed
223
+ */
224
+ onClose: PropTypes.Requireable<(...args: any[]) => any>;
225
+ /**
226
+ * Provide a function that is called when the close button is clicked
227
+ */
228
+ onCloseButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
229
+ /**
230
+ * By default, this value is "status". You can also provide an alternate
231
+ * role if it makes sense from the accessibility-side
232
+ */
233
+ role: PropTypes.Requireable<string>;
234
+ /**
235
+ * Provide a description for "status" icon that can be read by screen readers
236
+ */
237
+ statusIconDescription: PropTypes.Requireable<string>;
238
+ /**
239
+ * Specify the subtitle
240
+ */
241
+ subtitle: PropTypes.Requireable<string>;
242
+ /**
243
+ * Specify an optional duration the notification should be closed in
244
+ */
245
+ timeout: PropTypes.Requireable<number>;
246
+ /**
247
+ * Specify the title
248
+ */
249
+ title: PropTypes.Requireable<string>;
250
+ };
251
+ var defaultProps: {
252
+ kind: string;
253
+ role: string;
254
+ onCloseButtonClick: () => void;
255
+ hideCloseButton: boolean;
256
+ timeout: number;
257
+ };
258
+ }
259
+ /**
260
+ * InlineNotification
261
+ * ==================
262
+ */
263
+ export interface InlineNotificationProps extends HTMLAttributes<HTMLDivElement> {
264
+ /**
265
+ * Provide a description for "close" icon button that can be read by screen readers
266
+ */
267
+ 'aria-label'?: string;
268
+ /**
269
+ * Specify the content
270
+ */
271
+ children?: ReactNode;
272
+ /**
273
+ * Specify an optional className to be applied to the notification box
274
+ */
275
+ className?: string;
276
+ /**
277
+ * Specify the close button should be disabled, or not
278
+ */
279
+ hideCloseButton?: boolean;
280
+ /**
281
+ * Specify what state the notification represents
282
+ */
283
+ kind: 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt';
284
+ /**
285
+ * Specify whether you are using the low contrast variant of the InlineNotification.
286
+ */
287
+ lowContrast?: boolean;
288
+ /**
289
+ * Provide a function that is called when menu is closed
290
+ */
291
+ onClose?(event: MouseEvent): boolean | void;
292
+ /**
293
+ * Provide a function that is called when the close button is clicked
294
+ */
295
+ onCloseButtonClick(event: MouseEvent): void;
296
+ /**
297
+ * By default, this value is "status". You can also provide an alternate
298
+ * role if it makes sense from the accessibility-side.
299
+ */
300
+ role: 'alert' | 'log' | 'status';
301
+ /**
302
+ * Provide a description for "status" icon that can be read by screen readers
303
+ */
304
+ statusIconDescription?: string;
305
+ /**
306
+ * Specify the subtitle
307
+ */
308
+ subtitle?: string;
309
+ /**
310
+ * Specify the title
311
+ */
312
+ title?: string;
313
+ }
314
+ export declare function InlineNotification({ ['aria-label']: ariaLabel, children, title, subtitle, role, onClose, onCloseButtonClick, statusIconDescription, className, kind, lowContrast, hideCloseButton, ...rest }: InlineNotificationProps): JSX.Element | null;
315
+ export declare namespace InlineNotification {
316
+ var propTypes: {
317
+ /**
318
+ * Provide a description for "close" icon button that can be read by screen readers
319
+ */
320
+ "aria-label": PropTypes.Requireable<string>;
321
+ /**
322
+ * Specify the content
323
+ */
324
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
325
+ /**
326
+ * Specify an optional className to be applied to the notification box
327
+ */
328
+ className: PropTypes.Requireable<string>;
329
+ /**
330
+ * Specify the close button should be disabled, or not
331
+ */
332
+ hideCloseButton: PropTypes.Requireable<boolean>;
333
+ /**
334
+ * Specify what state the notification represents
335
+ */
336
+ kind: PropTypes.Requireable<string>;
337
+ /**
338
+ * Specify whether you are using the low contrast variant of the InlineNotification.
339
+ */
340
+ lowContrast: PropTypes.Requireable<boolean>;
341
+ /**
342
+ * Provide a function that is called when menu is closed
343
+ */
344
+ onClose: PropTypes.Requireable<(...args: any[]) => any>;
345
+ /**
346
+ * Provide a function that is called when the close button is clicked
347
+ */
348
+ onCloseButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
349
+ /**
350
+ * By default, this value is "status". You can also provide an alternate
351
+ * role if it makes sense from the accessibility-side.
352
+ */
353
+ role: PropTypes.Requireable<string>;
354
+ /**
355
+ * Provide a description for "status" icon that can be read by screen readers
356
+ */
357
+ statusIconDescription: PropTypes.Requireable<string>;
358
+ /**
359
+ * Specify the subtitle
360
+ */
361
+ subtitle: PropTypes.Requireable<string>;
362
+ /**
363
+ * Specify the title
364
+ */
365
+ title: PropTypes.Requireable<string>;
366
+ };
367
+ var defaultProps: {
368
+ kind: string;
369
+ role: string;
370
+ onCloseButtonClick: () => void;
371
+ hideCloseButton: boolean;
372
+ };
373
+ }
374
+ /**
375
+ * ActionableNotification
376
+ * ======================
377
+ */
378
+ export interface ActionableNotificationProps extends HTMLAttributes<HTMLDivElement> {
379
+ /**
380
+ * Pass in the action button label that will be rendered within the ActionableNotification.
381
+ */
382
+ actionButtonLabel: string;
383
+ /**
384
+ * Provide a description for "close" icon button that can be read by screen readers
385
+ */
386
+ 'aria-label'?: string;
387
+ /**
388
+ * Specify the content
389
+ */
390
+ children?: ReactNode;
391
+ /**
392
+ * Specify an optional className to be applied to the notification box
393
+ */
394
+ className?: string;
395
+ /**
396
+ * Specify if pressing the escape key should close notifications
397
+ */
398
+ closeOnEscape?: boolean;
399
+ /**
400
+ * Specify if focus should be moved to the component when the notification contains actions
401
+ */
402
+ hasFocus?: boolean;
403
+ /**
404
+ * Specify the close button should be disabled, or not
405
+ */
406
+ hideCloseButton?: boolean;
407
+ inline?: boolean;
408
+ /**
409
+ * Specify what state the notification represents
410
+ */
411
+ kind: 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt';
412
+ /**
413
+ * Specify whether you are using the low contrast variant of the ActionableNotification.
414
+ */
415
+ lowContrast?: boolean;
416
+ /**
417
+ * Provide a function that is called when the action is clicked
418
+ */
419
+ onActionButtonClick?(): void;
420
+ /**
421
+ * Provide a function that is called when menu is closed.
422
+ * Default behavior of hiding the notification is prevented if this function returns false.
423
+ */
424
+ onClose?(event: MouseEvent): boolean | void;
425
+ /**
426
+ * Provide a function that is called when the close button is clicked
427
+ */
428
+ onCloseButtonClick(event: MouseEvent): void;
429
+ /**
430
+ * By default, this value is "alertdialog". You can also provide an alternate
431
+ * role if it makes sense from from an accessibility perspective.
432
+ */
433
+ role?: string;
434
+ /**
435
+ * Provide a description for "status" icon that can be read by screen readers
436
+ */
437
+ statusIconDescription?: string;
438
+ /**
439
+ * Specify the subtitle
440
+ */
441
+ subtitle?: string;
442
+ /**
443
+ * Specify the title
444
+ */
445
+ title?: string;
446
+ }
447
+ export declare function ActionableNotification({ actionButtonLabel, ['aria-label']: ariaLabel, ariaLabel: deprecatedAriaLabel, children, role, onActionButtonClick, onClose, onCloseButtonClick, statusIconDescription, className, inline, kind, lowContrast, hideCloseButton, hasFocus, closeOnEscape, title, subtitle, ...rest }: ActionableNotificationProps): JSX.Element | null;
448
+ export declare namespace ActionableNotification {
449
+ var propTypes: {
450
+ /**
451
+ * Pass in the action button label that will be rendered within the ActionableNotification.
452
+ */
453
+ actionButtonLabel: PropTypes.Validator<string>;
454
+ /**
455
+ * Provide a description for "close" icon button that can be read by screen readers
456
+ */
457
+ "aria-label": PropTypes.Requireable<string>;
458
+ /**
459
+ * Deprecated, please use `aria-label` instead.
460
+ * Provide a description for "close" icon button that can be read by screen readers
461
+ */
462
+ ariaLabel: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
463
+ /**
464
+ * Specify the content
465
+ */
466
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
467
+ /**
468
+ * Specify an optional className to be applied to the notification box
469
+ */
470
+ className: PropTypes.Requireable<string>;
471
+ /**
472
+ * Specify if pressing the escape key should close notifications
473
+ */
474
+ closeOnEscape: PropTypes.Requireable<boolean>;
475
+ /**
476
+ * Specify if focus should be moved to the component when the notification contains actions
477
+ */
478
+ hasFocus: PropTypes.Requireable<boolean>;
479
+ /**
480
+ * Specify the close button should be disabled, or not
481
+ */
482
+ hideCloseButton: PropTypes.Requireable<boolean>;
483
+ inline: PropTypes.Requireable<boolean>;
484
+ /**
485
+ * Specify what state the notification represents
486
+ */
487
+ kind: PropTypes.Validator<string>;
488
+ /**
489
+ * Specify whether you are using the low contrast variant of the ActionableNotification.
490
+ */
491
+ lowContrast: PropTypes.Requireable<boolean>;
492
+ /**
493
+ * Provide a function that is called when the action is clicked
494
+ */
495
+ onActionButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
496
+ /**
497
+ * Provide a function that is called when menu is closed
498
+ */
499
+ onClose: PropTypes.Requireable<(...args: any[]) => any>;
500
+ /**
501
+ * Provide a function that is called when the close button is clicked
502
+ */
503
+ onCloseButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
504
+ /**
505
+ * By default, this value is "alertdialog". You can also provide an alternate
506
+ * role if it makes sense from the accessibility-side.
507
+ */
508
+ role: PropTypes.Requireable<string>;
509
+ /**
510
+ * Provide a description for "status" icon that can be read by screen readers
511
+ */
512
+ statusIconDescription: PropTypes.Requireable<string>;
513
+ /**
514
+ * Specify the subtitle
515
+ */
516
+ subtitle: PropTypes.Requireable<string>;
517
+ /**
518
+ * Specify the title
519
+ */
520
+ title: PropTypes.Requireable<string>;
521
+ };
522
+ var defaultProps: {
523
+ kind: string;
524
+ role: string;
525
+ onCloseButtonClick: () => void;
526
+ hideCloseButton: boolean;
527
+ hasFocus: boolean;
528
+ closeOnEscape: boolean;
529
+ inline: boolean;
530
+ };
531
+ }