@carbon/react 1.89.0-rc.0 → 1.89.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 (63) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1113 -851
  2. package/es/components/AILabel/index.d.ts +2 -5
  3. package/es/components/AILabel/index.js +2 -42
  4. package/es/components/ComposedModal/ComposedModal.js +2 -2
  5. package/es/components/Copy/Copy.js +1 -0
  6. package/es/components/DataTable/DataTable.js +10 -3
  7. package/es/components/Dialog/Dialog.d.ts +245 -0
  8. package/es/components/Dialog/Dialog.js +593 -0
  9. package/es/components/Dialog/index.d.ts +3 -251
  10. package/es/components/Dialog/index.js +1 -609
  11. package/es/components/FeatureFlags/index.d.ts +3 -1
  12. package/es/components/FeatureFlags/index.js +5 -2
  13. package/es/components/FileUploader/FileUploader.d.ts +28 -6
  14. package/es/components/FileUploader/FileUploader.js +152 -38
  15. package/es/components/Link/Link.js +15 -1
  16. package/es/components/Menu/MenuContext.d.ts +1 -1
  17. package/es/components/Menu/MenuContext.js +11 -4
  18. package/es/components/Menu/MenuItem.js +4 -10
  19. package/es/components/Modal/Modal.js +17 -9
  20. package/es/components/MultiSelect/FilterableMultiSelect.js +1 -5
  21. package/es/components/MultiSelect/MultiSelect.js +3 -7
  22. package/es/components/Popover/index.d.ts +4 -0
  23. package/es/components/Popover/index.js +8 -2
  24. package/es/components/StructuredList/StructuredList.d.ts +16 -0
  25. package/es/components/StructuredList/StructuredList.js +23 -11
  26. package/es/components/Toggletip/index.d.ts +13 -36
  27. package/es/components/Toggletip/index.js +12 -51
  28. package/es/index.d.ts +2 -1
  29. package/es/index.js +2 -0
  30. package/es/internal/Selection.js +1 -1
  31. package/es/internal/useMergedRefs.js +4 -3
  32. package/lib/components/AILabel/index.d.ts +2 -5
  33. package/lib/components/AILabel/index.js +1 -41
  34. package/lib/components/ComposedModal/ComposedModal.js +2 -2
  35. package/lib/components/Copy/Copy.js +1 -0
  36. package/lib/components/DataTable/DataTable.js +10 -3
  37. package/lib/components/Dialog/Dialog.d.ts +245 -0
  38. package/lib/components/Dialog/Dialog.js +602 -0
  39. package/lib/components/Dialog/index.d.ts +3 -251
  40. package/lib/components/Dialog/index.js +9 -614
  41. package/lib/components/FeatureFlags/index.d.ts +3 -1
  42. package/lib/components/FeatureFlags/index.js +5 -2
  43. package/lib/components/FileUploader/FileUploader.d.ts +28 -6
  44. package/lib/components/FileUploader/FileUploader.js +151 -37
  45. package/lib/components/Link/Link.js +15 -1
  46. package/lib/components/Menu/MenuContext.d.ts +1 -1
  47. package/lib/components/Menu/MenuContext.js +11 -4
  48. package/lib/components/Menu/MenuItem.js +4 -10
  49. package/lib/components/Modal/Modal.js +24 -16
  50. package/lib/components/MultiSelect/FilterableMultiSelect.js +1 -5
  51. package/lib/components/MultiSelect/MultiSelect.js +3 -7
  52. package/lib/components/Popover/index.d.ts +4 -0
  53. package/lib/components/Popover/index.js +8 -2
  54. package/lib/components/StructuredList/StructuredList.d.ts +16 -0
  55. package/lib/components/StructuredList/StructuredList.js +23 -11
  56. package/lib/components/Toggletip/index.d.ts +13 -36
  57. package/lib/components/Toggletip/index.js +11 -50
  58. package/lib/index.d.ts +2 -1
  59. package/lib/index.js +60 -58
  60. package/lib/internal/Selection.js +1 -1
  61. package/lib/internal/useMergedRefs.js +3 -2
  62. package/package.json +15 -16
  63. package/telemetry.yml +5 -2
@@ -1,256 +1,8 @@
1
1
  /**
2
- * Copyright IBM Corp. 2014, 2025
2
+ * Copyright IBM Corp. 2025
3
3
  *
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, { type HTMLAttributes, type RefObject } from 'react';
8
- import { InlineLoadingStatus } from '../InlineLoading/InlineLoading';
9
- /**
10
- * ----------
11
- * Dialog
12
- * ----------
13
- */
14
- interface DialogProps extends HTMLAttributes<HTMLDialogElement> {
15
- /**
16
- * Provide the contents of the Dialog
17
- */
18
- children?: React.ReactNode;
19
- /**
20
- * Specify an optional className to be applied to the modal root node
21
- */
22
- className?: string;
23
- /**
24
- * Provide a ref to return focus to once the dialog is closed.
25
- */
26
- focusAfterCloseRef?: RefObject<HTMLElement | null>;
27
- /**
28
- * Specifies whether the dialog is modal or non-modal. This cannot be changed
29
- * while open=true
30
- */
31
- modal?: boolean;
32
- /**
33
- * Specify a handler for the dialog's cancel event.
34
- * The browser fires this event when the user presses the Esc key and is cancelable.
35
- */
36
- onCancel?: React.ReactEventHandler<HTMLDialogElement>;
37
- /**
38
- * Specify a click handler applied to the dialog.
39
- */
40
- onClick?: React.ReactEventHandler<HTMLDialogElement>;
41
- /**
42
- * Specify a handler the dialog's close event.
43
- * The browser fires this event after the dialog has closed.
44
- */
45
- onClose?: React.ReactEventHandler<HTMLDialogElement>;
46
- /**
47
- * Specify a handler for closing Dialog.
48
- * The handler should care of closing Dialog, e.g. changing `open` prop.
49
- */
50
- onRequestClose?: React.ReactEventHandler<HTMLElement>;
51
- /**
52
- * Specify whether the Dialog is currently open
53
- */
54
- open?: boolean;
55
- /**
56
- * Specify the role of the dialog for accessibility
57
- * 'dialog' is the default, but 'alertdialog' can be used for important messages requiring user attention
58
- */
59
- role?: '' | 'alertdialog';
60
- /**
61
- * Specify a label for screen readers
62
- */
63
- ariaLabel?: string;
64
- /**
65
- * Specify the ID of an element that labels this dialog
66
- */
67
- ariaLabelledBy?: string;
68
- /**
69
- * Specify the ID of an element that describes this dialog
70
- */
71
- ariaDescribedBy?: string;
72
- }
73
- declare const unstable__Dialog: React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<unknown>>;
74
- /**
75
- * -------------
76
- * DialogHeader
77
- * -------------
78
- */
79
- interface DialogHeaderProps extends HTMLAttributes<HTMLDivElement> {
80
- /**
81
- * Provide the contents to be rendered inside of this component
82
- */
83
- children?: React.ReactNode;
84
- }
85
- declare const DialogHeader: React.ForwardRefExoticComponent<DialogHeaderProps & React.RefAttributes<HTMLDivElement>>;
86
- /**
87
- * ---------------
88
- * DialogControls
89
- * ---------------
90
- */
91
- interface DialogControlsProps extends HTMLAttributes<HTMLDivElement> {
92
- /**
93
- * Provide the contents to be rendered inside of this component
94
- */
95
- children?: React.ReactNode;
96
- }
97
- declare const DialogControls: React.ForwardRefExoticComponent<DialogControlsProps & React.RefAttributes<HTMLDivElement>>;
98
- /**
99
- * -------------------
100
- * DialogCloseButton
101
- * -------------------
102
- */
103
- interface DialogCloseButtonProps extends HTMLAttributes<HTMLDivElement> {
104
- /**
105
- * Specify a click handler applied to the IconButton
106
- */
107
- onClick?: React.MouseEventHandler;
108
- }
109
- declare const DialogCloseButton: React.ForwardRefExoticComponent<DialogCloseButtonProps & React.RefAttributes<HTMLDivElement>>;
110
- /**
111
- * ------------
112
- * DialogTitle
113
- * ------------
114
- */
115
- interface DialogTitleProps extends HTMLAttributes<HTMLHeadingElement> {
116
- /**
117
- * Provide the contents of the DialogTitle
118
- */
119
- children?: React.ReactNode;
120
- /**
121
- * Specify an optional className to be applied to the title node
122
- */
123
- className?: string;
124
- /**
125
- * Specify an optional id for the title element
126
- */
127
- id?: string;
128
- }
129
- declare const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
130
- /**
131
- * ---------------
132
- * DialogSubtitle
133
- * ---------------
134
- */
135
- interface DialogSubtitleProps extends HTMLAttributes<HTMLParagraphElement> {
136
- /**
137
- * Provide the contents of the DialogSubtitle
138
- */
139
- children?: React.ReactNode;
140
- /**
141
- * Specify an optional className to be applied to the subtitle node
142
- */
143
- className?: string;
144
- /**
145
- * Specify an optional id for the subtitle element
146
- */
147
- id?: string;
148
- }
149
- declare const DialogSubtitle: React.ForwardRefExoticComponent<DialogSubtitleProps & React.RefAttributes<HTMLParagraphElement>>;
150
- /**
151
- * -----------
152
- * DialogBody
153
- * -----------
154
- */
155
- interface DialogBodyProps extends HTMLAttributes<HTMLDivElement> {
156
- /**
157
- * Provide the contents of the DialogBody
158
- */
159
- children?: React.ReactNode;
160
- /**
161
- * Specify an optional className to be applied to the body node
162
- */
163
- className?: string;
164
- /**
165
- * Specify whether the content has overflow that should be scrollable
166
- */
167
- hasScrollingContent?: boolean;
168
- }
169
- declare const DialogBody: React.ForwardRefExoticComponent<DialogBodyProps & React.RefAttributes<HTMLDivElement>>;
170
- /**
171
- * -------------
172
- * DialogFooter
173
- * -------------
174
- */
175
- interface DialogFooterProps extends HTMLAttributes<HTMLDivElement> {
176
- /**
177
- * Provide the contents of the DialogFooter
178
- */
179
- children?: React.ReactNode;
180
- /**
181
- * Specify an optional className to be applied to the footer node
182
- */
183
- className?: string;
184
- /**
185
- * Specify a handler for closing dialog (secondary button)
186
- */
187
- onRequestClose?: React.ReactEventHandler<HTMLElement>;
188
- /**
189
- * Specify a handler for the secondary button.
190
- * Useful if separate handler from `onRequestClose` is desirable
191
- */
192
- onSecondarySubmit?: React.ReactEventHandler<HTMLElement>;
193
- /**
194
- * Specify a handler for submitting dialog (primary button)
195
- */
196
- onRequestSubmit?: React.ReactEventHandler<HTMLElement>;
197
- /**
198
- * Specify the text for the primary button
199
- */
200
- primaryButtonText?: React.ReactNode;
201
- /**
202
- * Specify whether the Button should be disabled, or not
203
- */
204
- primaryButtonDisabled?: boolean;
205
- /**
206
- * Specify the text for the secondary button
207
- */
208
- secondaryButtonText?: React.ReactNode;
209
- /**
210
- * Specify an array of config objects for secondary buttons
211
- */
212
- secondaryButtons?: Array<{
213
- buttonText: React.ReactNode;
214
- onClick: React.MouseEventHandler<HTMLButtonElement>;
215
- }>;
216
- /**
217
- * Specify whether the Dialog is for dangerous actions
218
- */
219
- danger?: boolean;
220
- /**
221
- * Specify loading status
222
- */
223
- loadingStatus?: InlineLoadingStatus;
224
- /**
225
- * Specify the description for the loading text
226
- */
227
- loadingDescription?: string;
228
- /**
229
- * Specify the description for the loading icon
230
- */
231
- loadingIconDescription?: string;
232
- /**
233
- * Specify an optional handler to be invoked when loading is
234
- * successful
235
- */
236
- onLoadingSuccess?: () => void;
237
- }
238
- declare const DialogFooter: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;
239
- /**
240
- * -------
241
- * Exports
242
- * -------
243
- */
244
- type DialogComponentType = typeof unstable__Dialog & {
245
- Root: typeof unstable__Dialog;
246
- Header: typeof DialogHeader;
247
- Controls: typeof DialogControls;
248
- CloseButton: typeof DialogCloseButton;
249
- Title: typeof DialogTitle;
250
- Subtitle: typeof DialogSubtitle;
251
- Body: typeof DialogBody;
252
- Footer: typeof DialogFooter;
253
- };
254
- declare const Dialog: DialogComponentType;
255
- export { Dialog, unstable__Dialog, DialogHeader, DialogControls, DialogCloseButton, DialogTitle, DialogSubtitle, DialogBody, DialogFooter, };
256
- export type { DialogProps, DialogHeaderProps, DialogControlsProps, DialogCloseButtonProps, DialogTitleProps, DialogSubtitleProps, DialogBodyProps, DialogFooterProps, };
7
+ export { Dialog, DialogHeader, DialogControls, DialogCloseButton, DialogTitle, DialogSubtitle, DialogBody, DialogFooter, } from './Dialog';
8
+ export type { DialogProps, DialogHeaderProps, DialogControlsProps, DialogCloseButtonProps, DialogTitleProps, DialogSubtitleProps, DialogBodyProps, DialogFooterProps, } from './Dialog';