@protonradio/proton-ui 0.11.1-beta.0 → 0.11.1
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.
- package/README.md +153 -73
- package/dist/Button-D5vY_uZz.js +31 -0
- package/dist/Button-D5vY_uZz.js.map +1 -0
- package/dist/Button-R07nvJbw.mjs +727 -0
- package/dist/Button-R07nvJbw.mjs.map +1 -0
- package/dist/Button.cjs.js +2 -0
- package/dist/Button.cjs.js.map +1 -0
- package/dist/Button.d.ts +53 -0
- package/dist/Button.es.js +9 -0
- package/dist/Button.es.js.map +1 -0
- package/dist/breakpoint-9y1_8U_b.mjs +10 -0
- package/dist/breakpoint-9y1_8U_b.mjs.map +1 -0
- package/dist/breakpoint-DtqbboOa.js +2 -0
- package/dist/breakpoint-DtqbboOa.js.map +1 -0
- package/dist/constants.cjs.js +1 -1
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.d.ts +4 -149
- package/dist/constants.es.js +7 -19
- package/dist/constants.es.js.map +1 -1
- package/dist/copy-DxIZCnfT.js +2 -0
- package/dist/copy-DxIZCnfT.js.map +1 -0
- package/dist/copy-qSgElu2b.mjs +31 -0
- package/dist/copy-qSgElu2b.mjs.map +1 -0
- package/dist/darkTheme-DUWn6YJ-.mjs +345 -0
- package/dist/darkTheme-DUWn6YJ-.mjs.map +1 -0
- package/dist/darkTheme-ann6VTfq.js +2 -0
- package/dist/darkTheme-ann6VTfq.js.map +1 -0
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.cjs.js.map +1 -1
- package/dist/hooks.d.ts +34 -5
- package/dist/hooks.es.js +36 -4
- package/dist/hooks.es.js.map +1 -1
- package/dist/icons.svg +10 -10
- package/dist/image-BlhKzTx8.js +2 -0
- package/dist/image-BlhKzTx8.js.map +1 -0
- package/dist/image-C8M6y5Op.mjs +205 -0
- package/dist/image-C8M6y5Op.mjs.map +1 -0
- package/dist/index.cjs.js +3 -32
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +680 -318
- package/dist/index.es.js +6775 -11255
- package/dist/index.es.js.map +1 -1
- package/dist/navigation-DdxS0JoV.js +2 -0
- package/dist/navigation-DdxS0JoV.js.map +1 -0
- package/dist/navigation-DsfDNfej.mjs +16 -0
- package/dist/navigation-DsfDNfej.mjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/theme-DQsfWeLo.mjs +12 -0
- package/dist/theme-DQsfWeLo.mjs.map +1 -0
- package/dist/theme-Dc0Ahjq9.js +2 -0
- package/dist/theme-Dc0Ahjq9.js.map +1 -0
- package/dist/{useBreakpoint-DA-JqOu3.js → useBreakpoint-CA9tMMV8.js} +2 -2
- package/dist/useBreakpoint-CA9tMMV8.js.map +1 -0
- package/dist/useBreakpoint-CjRyGKN-.mjs.map +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.cjs.js.map +1 -1
- package/dist/utils.d.ts +26 -45
- package/dist/utils.es.js +18 -457
- package/dist/utils.es.js.map +1 -1
- package/package.json +116 -100
- package/dist/palettes-D006-kxf.mjs +0 -174
- package/dist/palettes-D006-kxf.mjs.map +0 -1
- package/dist/palettes-DfloGKJz.js +0 -2
- package/dist/palettes-DfloGKJz.js.map +0 -1
- package/dist/useBreakpoint-DA-JqOu3.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AriaDialogProps } from 'react-aria';
|
|
3
|
-
import { AriaPopoverProps } from 'react-aria';
|
|
4
|
-
import { AriaTableProps } from 'react-aria';
|
|
5
|
-
import { ColumnProps } from '@react-stately/table';
|
|
1
|
+
import { AriaAttributes } from 'react';
|
|
2
|
+
import { AriaDialogProps } from '@react-aria/dialog';
|
|
3
|
+
import { AriaPopoverProps } from '@react-aria/overlays';
|
|
6
4
|
import { default as default_2 } from 'react';
|
|
7
5
|
import { DOMProps } from '@react-types/shared';
|
|
8
6
|
import { ForwardRefExoticComponent } from 'react';
|
|
9
7
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
9
|
+
import { OverlayTriggerProps } from '@react-stately/overlays';
|
|
10
|
+
import { OverlayTriggerState } from '@react-stately/overlays';
|
|
11
|
+
import { ReactElement } from 'react';
|
|
13
12
|
import { ReactNode } from 'react';
|
|
14
13
|
import { RefAttributes } from 'react';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { Selection as Selection_2 } from 'react-stately';
|
|
18
|
-
import { TableBodyProps } from '@react-stately/table';
|
|
19
|
-
import { TableHeader } from '@react-stately/table';
|
|
20
|
-
import { TableStateProps } from 'react-stately';
|
|
14
|
+
import { Selection as Selection_2 } from '@react-types/shared';
|
|
15
|
+
import { TableColumnData as TableColumnData_2 } from '../Table';
|
|
21
16
|
import { TooltipProps as TooltipProps_2 } from 'react-aria-components';
|
|
22
17
|
import { TooltipTriggerComponentProps } from 'react-aria-components';
|
|
23
18
|
|
|
24
19
|
/**
|
|
25
20
|
* ActionMenu to display a menu of actions.
|
|
26
21
|
* Renders a list of actions as a focusable menu, or non-focusable children.
|
|
27
|
-
*
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
* - {@link ActionMenuProps}
|
|
28
25
|
*/
|
|
29
|
-
export declare const ActionMenu: ({ isOpen, selectionMode, selectedKeys, defaultSelectedKeys, disabledKeys, children, showCancel, cancelButtonText, actions, title, onSelectionChange, onClose, "data-testid": testId,
|
|
26
|
+
export declare const ActionMenu: ({ isOpen, selectionMode, selectedKeys, defaultSelectedKeys, disabledKeys, children, showCancel, cancelButtonText, actions, title, onSelectionChange, onClose, "data-testid": testId, }: ActionMenuProps) => JSX_2.Element;
|
|
30
27
|
|
|
31
28
|
declare interface ActionMenuAction {
|
|
32
29
|
key: string;
|
|
@@ -38,35 +35,63 @@ declare interface ActionMenuAction {
|
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
declare interface ActionMenuProps {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
/** The actions of the menu
|
|
39
|
+
* - type {@link ActionMenuAction}[]
|
|
40
|
+
*/
|
|
41
|
+
actions?: ActionMenuAction[];
|
|
42
|
+
/** The text of the cancel button */
|
|
43
|
+
cancelButtonText?: string;
|
|
44
|
+
/** The children of the menu */
|
|
46
45
|
children?: ReactNode | ((props: {
|
|
47
46
|
close: () => void;
|
|
48
47
|
}) => ReactNode);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
/** The test id of the menu */
|
|
49
|
+
"data-testid"?: string;
|
|
50
|
+
/** The keys of the default selected items */
|
|
51
|
+
defaultSelectedKeys?: string[];
|
|
52
|
+
/** The keys of the disabled items */
|
|
53
|
+
disabledKeys?: string[];
|
|
54
|
+
/** Whether the menu is open
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
isOpen: boolean;
|
|
58
|
+
/** The callback function to close the menu */
|
|
53
59
|
onClose?: () => void;
|
|
60
|
+
/** The callback function to change the selection
|
|
61
|
+
* - type {@link Selection}
|
|
62
|
+
*/
|
|
54
63
|
onSelectionChange?: (keys: Selection_2) => void;
|
|
55
|
-
|
|
56
|
-
|
|
64
|
+
/** The selection mode of the menu
|
|
65
|
+
* @default "single"
|
|
66
|
+
*/
|
|
67
|
+
selectionMode?: "single" | "multiple" | "none";
|
|
68
|
+
/** The keys of the selected items */
|
|
69
|
+
selectedKeys?: string[];
|
|
70
|
+
/** Whether to show the cancel button */
|
|
71
|
+
showCancel?: boolean;
|
|
72
|
+
/** The title of the menu */
|
|
73
|
+
title?: string;
|
|
57
74
|
}
|
|
58
75
|
|
|
76
|
+
/**
|
|
77
|
+
* A badge component for displaying status, categories, or counts with various visual styles.
|
|
78
|
+
*
|
|
79
|
+
* API:
|
|
80
|
+
* - {@link BadgeProps}
|
|
81
|
+
* - extends {@link React.HTMLAttributes}
|
|
82
|
+
*/
|
|
59
83
|
export declare const Badge: ({ variant, children, ...props }: BadgeProps) => JSX_2.Element;
|
|
60
84
|
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* The badge's visual aesthetic.
|
|
64
|
-
*/
|
|
65
|
-
variant?: BadgeVariant;
|
|
85
|
+
declare interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
66
86
|
/**
|
|
67
87
|
* The content to display within the badge.
|
|
68
88
|
*/
|
|
69
89
|
children: ReactNode;
|
|
90
|
+
/**
|
|
91
|
+
* The badge's visual aesthetic.
|
|
92
|
+
* - type {@link BadgeVariant}
|
|
93
|
+
*/
|
|
94
|
+
variant?: BadgeVariant;
|
|
70
95
|
}
|
|
71
96
|
|
|
72
97
|
export declare type BadgeVariant = "primary" | "secondary" | "transparent" | "success" | "warning" | "danger";
|
|
@@ -75,60 +100,96 @@ export declare const BadgeVariants: Record<BadgeVariant, BadgeVariant>;
|
|
|
75
100
|
|
|
76
101
|
/**
|
|
77
102
|
* A banner used to display a success, warning, or error message.
|
|
78
|
-
*
|
|
103
|
+
*
|
|
104
|
+
* API:
|
|
105
|
+
* - {@link BannerProps}
|
|
106
|
+
* - extends {@link BannerIconProps}
|
|
79
107
|
*/
|
|
80
108
|
export declare const Banner: {
|
|
81
109
|
({ variant, rounded, icon, compact, children, "data-testid": dataTestId, }: BannerProps): JSX_2.Element;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
success: JSX_2.Element;
|
|
93
|
-
warning: JSX_2.Element;
|
|
94
|
-
danger: JSX_2.Element;
|
|
110
|
+
displayName: string;
|
|
111
|
+
/**
|
|
112
|
+
* Renders an h3 styled banner.
|
|
113
|
+
*/
|
|
114
|
+
Title: {
|
|
115
|
+
({ children, "data-testid": dataTestId, }: {
|
|
116
|
+
children: ReactNode;
|
|
117
|
+
"data-testid"?: string;
|
|
118
|
+
}): JSX_2.Element;
|
|
119
|
+
displayName: string;
|
|
95
120
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Renders a p styled banner.
|
|
123
|
+
*/
|
|
124
|
+
Content: {
|
|
125
|
+
({ children, "data-testid": dataTestId, }: {
|
|
126
|
+
children: ReactNode;
|
|
127
|
+
"data-testid"?: string;
|
|
128
|
+
}): JSX_2.Element;
|
|
129
|
+
displayName: string;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Renders an icon inline with the banner title.
|
|
133
|
+
*
|
|
134
|
+
* API:
|
|
135
|
+
* - {@link BannerIconProps}
|
|
136
|
+
*/
|
|
137
|
+
Icon: {
|
|
138
|
+
({ icon, "data-testid": dataTestId }: BannerIconProps): JSX_2.Element;
|
|
139
|
+
displayName: string;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Renders a Proton Button.
|
|
143
|
+
* - @prop buttonProps {@link ButtonProps}
|
|
144
|
+
*/
|
|
145
|
+
Action: {
|
|
146
|
+
({ children, ...buttonProps }: ButtonProps): JSX_2.Element;
|
|
147
|
+
displayName: string;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Renders Proton Buttons in a responsive actions grid.
|
|
151
|
+
*/
|
|
152
|
+
Actions: {
|
|
153
|
+
({ children }: {
|
|
154
|
+
children: ReactNode;
|
|
155
|
+
}): JSX_2.Element;
|
|
156
|
+
displayName: string;
|
|
101
157
|
};
|
|
102
158
|
};
|
|
103
159
|
|
|
104
|
-
declare
|
|
105
|
-
|
|
106
|
-
|
|
160
|
+
export declare const BANNER_ICONS: {
|
|
161
|
+
success: JSX_2.Element;
|
|
162
|
+
warning: JSX_2.Element;
|
|
163
|
+
danger: JSX_2.Element;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export declare const BANNER_VARIANTS: {
|
|
167
|
+
readonly default: "default";
|
|
168
|
+
readonly success: "success";
|
|
169
|
+
readonly warning: "warning";
|
|
170
|
+
readonly danger: "danger";
|
|
171
|
+
};
|
|
107
172
|
|
|
108
173
|
declare interface BannerIconProps {
|
|
174
|
+
/**
|
|
175
|
+
* Optional custom icon or children for the icon area.
|
|
176
|
+
*/
|
|
177
|
+
children?: ReactNode;
|
|
109
178
|
/**
|
|
110
179
|
* The icon to display in the banner.
|
|
111
|
-
* Can be a boolean to conditionally show or hide,
|
|
112
|
-
* or a ReactNode to provide a custom icon.
|
|
180
|
+
* Can be a boolean to conditionally show or hide, or a ReactNode to provide a custom icon.
|
|
113
181
|
*/
|
|
114
182
|
icon?: boolean | ReactNode;
|
|
115
183
|
/**
|
|
116
|
-
*
|
|
184
|
+
* The data-testid to display within the banner.
|
|
117
185
|
*/
|
|
118
|
-
|
|
186
|
+
"data-testid"?: string;
|
|
119
187
|
}
|
|
120
188
|
|
|
121
189
|
declare interface BannerProps extends BannerIconProps {
|
|
122
|
-
/**
|
|
123
|
-
* The banner's visual aesthetic.
|
|
124
|
-
*/
|
|
125
|
-
variant?: BannerVariant;
|
|
126
|
-
/**
|
|
127
|
-
* Round the corners of the banner.
|
|
128
|
-
*/
|
|
129
|
-
rounded?: boolean;
|
|
130
190
|
/**
|
|
131
191
|
* Compact padding around the content of the banner.
|
|
192
|
+
* @default true
|
|
132
193
|
*/
|
|
133
194
|
compact?: boolean;
|
|
134
195
|
/**
|
|
@@ -139,10 +200,47 @@ declare interface BannerProps extends BannerIconProps {
|
|
|
139
200
|
* The data-testid to display within the banner.
|
|
140
201
|
*/
|
|
141
202
|
"data-testid"?: string;
|
|
203
|
+
/**
|
|
204
|
+
* Round the corners of the banner.
|
|
205
|
+
* @default true
|
|
206
|
+
*/
|
|
207
|
+
rounded?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* The banner's visual aesthetic.
|
|
210
|
+
* - type {@link BannerVariant}
|
|
211
|
+
*/
|
|
212
|
+
variant?: BannerVariant;
|
|
142
213
|
}
|
|
143
214
|
|
|
144
215
|
export declare type BannerVariant = "default" | "success" | "warning" | "danger";
|
|
145
216
|
|
|
217
|
+
declare interface BaseDataTableProps<T = any> {
|
|
218
|
+
/** Array of column definitions
|
|
219
|
+
* - {@link DataTableColumn}
|
|
220
|
+
*/
|
|
221
|
+
columns: DataTableColumn<T>[];
|
|
222
|
+
/** Array of data objects to display. Can be empty array for loading/empty states */
|
|
223
|
+
data?: T[] | null;
|
|
224
|
+
/** Loading state */
|
|
225
|
+
loading?: boolean;
|
|
226
|
+
/** Tombstone component to use when loading */
|
|
227
|
+
tombstoneComponent?: ReactNode;
|
|
228
|
+
/** Error state */
|
|
229
|
+
error?: boolean | string;
|
|
230
|
+
/** Table name/caption for accessibility. This provides essential context for screen readers. */
|
|
231
|
+
name: string;
|
|
232
|
+
/** Callback when a row is clicked */
|
|
233
|
+
onRowClick?: (row: T) => void;
|
|
234
|
+
/** Custom empty state message */
|
|
235
|
+
emptyMessage?: string;
|
|
236
|
+
/** Custom error message */
|
|
237
|
+
errorMessage?: string;
|
|
238
|
+
/** Number of skeleton rows to show in loading state */
|
|
239
|
+
loadingRows?: number;
|
|
240
|
+
/** Test ID for testing purposes */
|
|
241
|
+
"data-testid"?: string;
|
|
242
|
+
}
|
|
243
|
+
|
|
146
244
|
declare interface BaseInputProps {
|
|
147
245
|
/**
|
|
148
246
|
* onChange handler for the input
|
|
@@ -194,6 +292,7 @@ declare interface BaseInputProps {
|
|
|
194
292
|
/**
|
|
195
293
|
* The type attribute of the input element.
|
|
196
294
|
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/type
|
|
295
|
+
* @default "text"
|
|
197
296
|
*/
|
|
198
297
|
type?: string;
|
|
199
298
|
/**
|
|
@@ -201,17 +300,44 @@ declare interface BaseInputProps {
|
|
|
201
300
|
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
202
301
|
*/
|
|
203
302
|
value?: string;
|
|
303
|
+
/**
|
|
304
|
+
* Whether the input is required.
|
|
305
|
+
* @default false
|
|
306
|
+
*/
|
|
307
|
+
isRequired?: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Whether the input is read-only.
|
|
310
|
+
* @default false
|
|
311
|
+
*/
|
|
312
|
+
isReadOnly?: boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Called when the input is submitted (e.g. by pressing Enter).
|
|
315
|
+
*/
|
|
316
|
+
onSubmit?: default_2.FormEventHandler<HTMLInputElement>;
|
|
317
|
+
/**
|
|
318
|
+
* Called when the input is cleared (e.g. by pressing Escape).
|
|
319
|
+
*/
|
|
320
|
+
onClear?: () => void;
|
|
204
321
|
}
|
|
205
322
|
|
|
206
323
|
/**
|
|
207
|
-
* A customizable button component that can render as either a button or anchor element
|
|
208
|
-
*
|
|
324
|
+
* A customizable button component that can render as either a button or anchor element.
|
|
325
|
+
*
|
|
326
|
+
* API:
|
|
327
|
+
* - {@link ButtonProps}
|
|
209
328
|
*/
|
|
210
329
|
export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
211
330
|
|
|
331
|
+
/**
|
|
332
|
+
* A radio button group component that allows selection of a single option from multiple choices.
|
|
333
|
+
*
|
|
334
|
+
* API:
|
|
335
|
+
* - {@link ButtonGroupProps}
|
|
336
|
+
*/
|
|
212
337
|
export declare function ButtonGroup(props: ButtonGroupProps): JSX_2.Element;
|
|
213
338
|
|
|
214
339
|
export declare namespace ButtonGroup {
|
|
340
|
+
var displayName: string;
|
|
215
341
|
var Option: (props: ButtonGroupOptionProps) => JSX_2.Element;
|
|
216
342
|
}
|
|
217
343
|
|
|
@@ -247,76 +373,88 @@ declare interface ButtonGroupProps {
|
|
|
247
373
|
children?: React.ReactNode;
|
|
248
374
|
}
|
|
249
375
|
|
|
250
|
-
declare interface ButtonProps
|
|
376
|
+
declare interface ButtonProps {
|
|
251
377
|
/** The button's visual aesthetic
|
|
252
|
-
* @
|
|
378
|
+
* - type {@link ButtonVariant}
|
|
253
379
|
*/
|
|
254
380
|
variant?: ButtonVariant;
|
|
255
381
|
/** The size of the button
|
|
256
|
-
* @
|
|
257
|
-
* @default "
|
|
382
|
+
* - type {@link ButtonSize}
|
|
383
|
+
* @default "medium"
|
|
258
384
|
*/
|
|
259
385
|
size?: ButtonSize;
|
|
260
386
|
/** Should the button be full width?
|
|
261
|
-
* @
|
|
387
|
+
* @default false
|
|
262
388
|
*/
|
|
263
389
|
fullWidth?: boolean;
|
|
264
|
-
/** The prefix to display within the button
|
|
265
|
-
* @param {React.ReactNode} icon
|
|
266
|
-
*/
|
|
390
|
+
/** The prefix to display within the button */
|
|
267
391
|
icon?: React.ReactNode;
|
|
268
|
-
/** Should the button be non-interactive?
|
|
269
|
-
* @param {boolean} isDisabled
|
|
270
|
-
*/
|
|
392
|
+
/** Should the button be non-interactive? */
|
|
271
393
|
isDisabled?: boolean;
|
|
272
|
-
/** The URL that the button should link to. Turns the element into an `a` tag. If the URL is external, you should pass the entire URL to the `to` prop (e.g. `https://example.com`).
|
|
273
|
-
* @param {string} to
|
|
274
|
-
*/
|
|
394
|
+
/** The URL that the button should link to. Turns the element into an `a` tag. If the URL is external, you should pass the entire URL to the `to` prop (e.g. `https://example.com`). */
|
|
275
395
|
to?: string;
|
|
276
|
-
/** The target attribute for the link. Defaults to `_blank` if the URL is external.
|
|
277
|
-
* @param {string} target
|
|
278
|
-
*/
|
|
396
|
+
/** The target attribute for the link. Defaults to `_blank` if the URL is external. */
|
|
279
397
|
target?: "_blank" | "_self" | "_parent" | "_top" | string;
|
|
280
|
-
/** Called when the button is pressed (on release, not keydown)
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
onPress?: (e: PressEvent) => void;
|
|
284
|
-
/** The type of button
|
|
285
|
-
* @param {"button" | "submit" | "reset"} type
|
|
286
|
-
*/
|
|
398
|
+
/** Called when the button is pressed (on release, not keydown) */
|
|
399
|
+
onPress?: (e: MouseEvent_2<HTMLButtonElement | HTMLAnchorElement>) => void;
|
|
400
|
+
/** The type of button */
|
|
287
401
|
type?: "button" | "submit" | "reset";
|
|
288
|
-
/** The test ID for the button
|
|
289
|
-
* @param {string} dataTestId
|
|
290
|
-
*/
|
|
402
|
+
/** The test ID for the button */
|
|
291
403
|
"data-testid"?: string;
|
|
292
|
-
/** The content to display within the button
|
|
293
|
-
* @param {React.ReactNode} children
|
|
294
|
-
*/
|
|
404
|
+
/** The content to display within the button */
|
|
295
405
|
children?: React.ReactNode;
|
|
296
406
|
}
|
|
297
407
|
|
|
298
|
-
declare type ButtonSize = "small" | "medium" | "large" | "xlarge" | "2xlarge";
|
|
408
|
+
export declare type ButtonSize = "small" | "medium" | "large" | "xlarge" | "2xlarge";
|
|
409
|
+
|
|
410
|
+
export declare const ButtonSizes: Record<ButtonSize, ButtonSize>;
|
|
299
411
|
|
|
300
412
|
export declare type ButtonVariant = "primary" | "secondary" | "success" | "danger" | "translucent";
|
|
301
413
|
|
|
414
|
+
export declare const ButtonVariants: Record<ButtonVariant, ButtonVariant>;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* A button with a select menu.
|
|
418
|
+
*
|
|
419
|
+
* API:
|
|
420
|
+
* - {@link ButtonWithSelectProps}
|
|
421
|
+
* - extends {@link ButtonProps}
|
|
422
|
+
*/
|
|
302
423
|
export declare function ButtonWithSelect({ items, defaultValue, children, onSelectionChange, disabledKeys, selectedKey, icon, variant, fullWidth, onPress, ...buttonProps }: ButtonWithSelectProps): JSX_2.Element;
|
|
303
424
|
|
|
304
|
-
declare
|
|
305
|
-
|
|
425
|
+
export declare namespace ButtonWithSelect {
|
|
426
|
+
var displayName: string;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
declare interface ButtonWithSelectProps extends ButtonProps {
|
|
430
|
+
/**
|
|
431
|
+
* The default value of the select menu.
|
|
432
|
+
*/
|
|
306
433
|
defaultValue?: string;
|
|
307
|
-
|
|
434
|
+
/**
|
|
435
|
+
* The keys of the disabled items.
|
|
436
|
+
*/
|
|
437
|
+
disabledKeys?: string[];
|
|
438
|
+
/**
|
|
439
|
+
* The items to display in the select menu.
|
|
440
|
+
* - type {@link ActionMenuAction}
|
|
441
|
+
*/
|
|
442
|
+
items: ActionMenuAction[];
|
|
443
|
+
/**
|
|
444
|
+
* The callback function to call when the selection changes.
|
|
445
|
+
*/
|
|
308
446
|
onSelectionChange?: (key: string) => void;
|
|
447
|
+
/**
|
|
448
|
+
* The key of the selected item.
|
|
449
|
+
*/
|
|
309
450
|
selectedKey?: string;
|
|
310
|
-
|
|
311
|
-
} & ButtonProps;
|
|
312
|
-
|
|
313
|
-
export declare const Cell: <T>(props: ProtonColumnProps<T>) => JSX.Element;
|
|
314
|
-
|
|
315
|
-
export declare const Column: <T>(props: ProtonColumnProps<T>) => JSX.Element;
|
|
451
|
+
}
|
|
316
452
|
|
|
317
453
|
/**
|
|
318
454
|
* Input with a button to copy value to the clipboard.
|
|
319
|
-
*
|
|
455
|
+
*
|
|
456
|
+
* API:
|
|
457
|
+
* - {@link CopyInputProps}
|
|
320
458
|
*/
|
|
321
459
|
export declare function CopyInput({ name, value, isDisabled, onError, onSuccess, }: CopyInputProps): JSX_2.Element;
|
|
322
460
|
|
|
@@ -333,8 +471,34 @@ declare interface CopyInputProps {
|
|
|
333
471
|
onSuccess?: () => void;
|
|
334
472
|
}
|
|
335
473
|
|
|
474
|
+
/**
|
|
475
|
+
* DataTable is a declarative wrapper around the base Table component that provides:
|
|
476
|
+
*
|
|
477
|
+
* API:
|
|
478
|
+
* - {@link DataTableProps}
|
|
479
|
+
* - {@link SortingConfig}
|
|
480
|
+
*/
|
|
481
|
+
export declare function DataTable<T = any>(props: DataTableProps<T>): JSX_2.Element;
|
|
482
|
+
|
|
483
|
+
export declare interface DataTableColumn<T> {
|
|
484
|
+
/** id for the column */
|
|
485
|
+
id: string;
|
|
486
|
+
/** Header text or component */
|
|
487
|
+
header: ReactNode;
|
|
488
|
+
/** Function to render cell content from row data */
|
|
489
|
+
cell: (row: T) => ReactNode;
|
|
490
|
+
/** Whether this column should be hidden */
|
|
491
|
+
hidden?: boolean;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export declare type DataTableProps<T = any> = BaseDataTableProps<T> & SortingConfig<T>;
|
|
495
|
+
|
|
336
496
|
/**
|
|
337
497
|
* Intended use in overlay containers such as modals or popovers.
|
|
498
|
+
*
|
|
499
|
+
* API:
|
|
500
|
+
* - {@link DialogProps}
|
|
501
|
+
* - extends {@link AriaDialogProps}
|
|
338
502
|
*/
|
|
339
503
|
export declare function Dialog({ title, children, ...props }: DialogProps): JSX_2.Element;
|
|
340
504
|
|
|
@@ -348,9 +512,10 @@ declare interface DialogProps extends AriaDialogProps {
|
|
|
348
512
|
*
|
|
349
513
|
* This component is designed to be used as a visual layer that sits on top of other content
|
|
350
514
|
* to create a sense of depth or hierarchy in the UI. It uses the `--proton-control__background-color-light`
|
|
351
|
-
* CSS variable which is theme-aware and will adapt to light, dark
|
|
515
|
+
* CSS variable which is theme-aware and will adapt to light, dark themes.
|
|
352
516
|
*
|
|
353
|
-
*
|
|
517
|
+
* API:
|
|
518
|
+
* - {@link ElevationProps}
|
|
354
519
|
*/
|
|
355
520
|
export declare const Elevation: ({ children, hasPrimaryGradient, "data-testid": dataTestId, }: ElevationProps) => JSX_2.Element;
|
|
356
521
|
|
|
@@ -359,23 +524,29 @@ declare interface ElevationProps {
|
|
|
359
524
|
* The content to be displayed within the elevation.
|
|
360
525
|
*/
|
|
361
526
|
children?: ReactNode;
|
|
527
|
+
/**
|
|
528
|
+
* The data-testid attribute for testing purposes.
|
|
529
|
+
*/
|
|
530
|
+
"data-testid"?: string;
|
|
362
531
|
/**
|
|
363
532
|
* Whether the elevation should have a background gradient.
|
|
364
533
|
* @important only works in custom dark mode
|
|
365
534
|
* @default false
|
|
366
535
|
*/
|
|
367
536
|
hasPrimaryGradient?: boolean;
|
|
368
|
-
/**
|
|
369
|
-
* The data-testid attribute for testing purposes.
|
|
370
|
-
*/
|
|
371
|
-
"data-testid"?: string;
|
|
372
537
|
}
|
|
373
538
|
|
|
374
|
-
|
|
539
|
+
/**
|
|
540
|
+
* An icon component that displays SVG icons from a sprite sheet or inline.
|
|
541
|
+
*
|
|
542
|
+
* API:
|
|
543
|
+
* - {@link IconProps}
|
|
544
|
+
*/
|
|
545
|
+
export declare function Icon(props: IconProps): JSX_2.Element;
|
|
375
546
|
|
|
376
547
|
declare type IconID = "external-link" | "caret-down" | "caret-right" | "chevron-right" | "chevron-left" | "chevron-up" | "chevron-down";
|
|
377
548
|
|
|
378
|
-
declare interface IconProps {
|
|
549
|
+
export declare interface IconProps {
|
|
379
550
|
/**
|
|
380
551
|
* The spritesheet ID defined in the Icons spritesheet.
|
|
381
552
|
*/
|
|
@@ -392,7 +563,9 @@ declare interface IconProps {
|
|
|
392
563
|
|
|
393
564
|
/**
|
|
394
565
|
* ImageOverlay component for displaying an image with a blur effect.
|
|
395
|
-
*
|
|
566
|
+
*
|
|
567
|
+
* API:
|
|
568
|
+
* - {@link ImageBackgroundProps}
|
|
396
569
|
*/
|
|
397
570
|
export declare function ImageBackground({ image, imageUrl, onLoad, }: ImageBackgroundProps): JSX_2.Element;
|
|
398
571
|
|
|
@@ -418,13 +591,16 @@ declare interface ImageBackgroundProps {
|
|
|
418
591
|
|
|
419
592
|
/**
|
|
420
593
|
* A controlled and customizable input component with support for labels, prefixes, suffixes, and error states.
|
|
594
|
+
*
|
|
595
|
+
* API:
|
|
596
|
+
* - {@link BaseInputProps}
|
|
421
597
|
*/
|
|
422
598
|
export declare const Input: default_2.ForwardRefExoticComponent<BaseInputProps & default_2.RefAttributes<HTMLInputElement>>;
|
|
423
599
|
|
|
424
|
-
declare type MenuItemType = ActionMenuAction;
|
|
425
|
-
|
|
426
600
|
declare interface MenuProps {
|
|
427
|
-
/** Custom trigger component. If not provided, defaults to ellipsis icon
|
|
601
|
+
/** Custom trigger component. If not provided, defaults to ellipsis icon.
|
|
602
|
+
* - @prop triggerProps {@link TriggerProps}
|
|
603
|
+
*/
|
|
428
604
|
renderTrigger?: (triggerProps: TriggerProps) => ReactNode;
|
|
429
605
|
/** Size of the trigger icon
|
|
430
606
|
* @default 24
|
|
@@ -432,9 +608,13 @@ declare interface MenuProps {
|
|
|
432
608
|
size?: number;
|
|
433
609
|
/** Title of the parent menu */
|
|
434
610
|
title?: string;
|
|
435
|
-
/** Array of menu actions/items to display
|
|
436
|
-
|
|
437
|
-
|
|
611
|
+
/** Array of menu actions/items to display
|
|
612
|
+
* - type {@link ActionMenuAction}[]
|
|
613
|
+
*/
|
|
614
|
+
items: ActionMenuAction[];
|
|
615
|
+
/** Whether the menu is disabled
|
|
616
|
+
* @default false
|
|
617
|
+
*/
|
|
438
618
|
disabled?: boolean;
|
|
439
619
|
/** Callback when menu closes */
|
|
440
620
|
onClose?: () => void;
|
|
@@ -442,8 +622,6 @@ declare interface MenuProps {
|
|
|
442
622
|
triggerTestId?: string;
|
|
443
623
|
/** Test ID for the menu */
|
|
444
624
|
menuTestId?: string;
|
|
445
|
-
/** Can be used to target the menu element */
|
|
446
|
-
menuId?: string;
|
|
447
625
|
/** Callback when a menu item is selected */
|
|
448
626
|
onSelectionChange?: (key: string) => void;
|
|
449
627
|
/** The key of the selected item */
|
|
@@ -452,19 +630,42 @@ declare interface MenuProps {
|
|
|
452
630
|
disabledKeys?: string[];
|
|
453
631
|
}
|
|
454
632
|
|
|
455
|
-
|
|
633
|
+
/**
|
|
634
|
+
* A component that displays either a popover menu or an action menu
|
|
635
|
+
* depending on the screen size when the menu trigger is pressed.
|
|
636
|
+
*
|
|
637
|
+
* API:
|
|
638
|
+
* - {@link MenuProps}
|
|
639
|
+
*/
|
|
640
|
+
export declare function MenuTrigger({ renderTrigger, size, title, items, disabled, onClose, triggerTestId, menuTestId, onSelectionChange, selectedKey, disabledKeys, }: MenuProps): JSX_2.Element;
|
|
456
641
|
|
|
457
642
|
export declare const Modal: (({ isOpen, onClose, title, subtitle, body, children, isOverlay, "data-testid": dataTestId, }: ModalProps) => JSX_2.Element) & {
|
|
643
|
+
/**
|
|
644
|
+
* Renders a h2 styled title
|
|
645
|
+
* */
|
|
458
646
|
Title: ({ children }: {
|
|
459
647
|
children: React.ReactNode;
|
|
460
648
|
}) => JSX_2.Element;
|
|
649
|
+
/**
|
|
650
|
+
* Renders a h3 styled subtitle
|
|
651
|
+
* */
|
|
461
652
|
Subtitle: ({ children }: {
|
|
462
653
|
children: React.ReactNode;
|
|
463
654
|
}) => JSX_2.Element;
|
|
655
|
+
/**
|
|
656
|
+
* Renders a div styled body
|
|
657
|
+
* */
|
|
464
658
|
Body: ({ children }: {
|
|
465
659
|
children: React.ReactNode;
|
|
466
660
|
}) => JSX_2.Element;
|
|
467
|
-
|
|
661
|
+
/**
|
|
662
|
+
* Renders a Proton Button action
|
|
663
|
+
* - @prop buttonProps {@link ButtonProps}
|
|
664
|
+
* */
|
|
665
|
+
Action: (buttonProps: ButtonProps) => JSX_2.Element;
|
|
666
|
+
/**
|
|
667
|
+
* Renders a group of Proton Buttons
|
|
668
|
+
* */
|
|
468
669
|
Actions: ({ children }: {
|
|
469
670
|
children: React.ReactNode;
|
|
470
671
|
}) => JSX_2.Element;
|
|
@@ -472,87 +673,40 @@ export declare const Modal: (({ isOpen, onClose, title, subtitle, body, children
|
|
|
472
673
|
|
|
473
674
|
declare interface ModalProps {
|
|
474
675
|
/**
|
|
475
|
-
*
|
|
676
|
+
* Optional body text content for the modal
|
|
476
677
|
* */
|
|
477
|
-
|
|
678
|
+
body?: string;
|
|
478
679
|
/**
|
|
479
|
-
*
|
|
680
|
+
* Content to render inside the modal
|
|
480
681
|
* */
|
|
481
|
-
|
|
682
|
+
children: React.ReactNode;
|
|
683
|
+
/**
|
|
684
|
+
* data-testid for the modal
|
|
685
|
+
* */
|
|
686
|
+
"data-testid"?: string;
|
|
687
|
+
/**
|
|
688
|
+
* Controls the visibility of the modal
|
|
689
|
+
* */
|
|
690
|
+
isOpen: boolean;
|
|
482
691
|
/**
|
|
483
692
|
* Whether to show the modal with an overlay background.
|
|
484
693
|
* @default true
|
|
485
694
|
* */
|
|
486
695
|
isOverlay?: boolean;
|
|
487
696
|
/**
|
|
488
|
-
*
|
|
697
|
+
* Callback function when modal is closed
|
|
489
698
|
* */
|
|
490
|
-
|
|
699
|
+
onClose?: () => void;
|
|
491
700
|
/**
|
|
492
701
|
* Optional subtitle text below the modal title
|
|
493
702
|
* */
|
|
494
703
|
subtitle?: string;
|
|
495
704
|
/**
|
|
496
|
-
* Optional
|
|
497
|
-
* */
|
|
498
|
-
body?: string;
|
|
499
|
-
/**
|
|
500
|
-
* Content to render inside the modal
|
|
501
|
-
* */
|
|
502
|
-
children: React.ReactNode;
|
|
503
|
-
/**
|
|
504
|
-
* data-testid for the modal
|
|
705
|
+
* Optional title text for the modal header
|
|
505
706
|
* */
|
|
506
|
-
|
|
707
|
+
title?: string;
|
|
507
708
|
}
|
|
508
709
|
|
|
509
|
-
declare type Palette = {
|
|
510
|
-
BASE_COLOR: string;
|
|
511
|
-
BRAND: {
|
|
512
|
-
PRIMARY: string;
|
|
513
|
-
PRIMARY_LIGHT: string;
|
|
514
|
-
PRIMARY_SUPER_LIGHT: string;
|
|
515
|
-
SECONDARY: string;
|
|
516
|
-
};
|
|
517
|
-
PRIMARY: {
|
|
518
|
-
PRIMARY_SUPER_DARK: string;
|
|
519
|
-
PRIMARY_DARK: string;
|
|
520
|
-
PRIMARY_MEDIUM: string;
|
|
521
|
-
PRIMARY_MEDIUM_LIGHT: string;
|
|
522
|
-
PRIMARY_LIGHT: string;
|
|
523
|
-
PRIMARY_LIGHTEST: string;
|
|
524
|
-
PRIMARY_SUPER_LIGHT: string;
|
|
525
|
-
};
|
|
526
|
-
SECONDARY: {
|
|
527
|
-
SECONDARY_SUPER_DARK: string;
|
|
528
|
-
SECONDARY_DARK: string;
|
|
529
|
-
SECONDARY_MEDIUM: string;
|
|
530
|
-
SECONDARY_MEDIUM_LIGHT: string;
|
|
531
|
-
SECONDARY_LIGHT: string;
|
|
532
|
-
SECONDARY_LIGHTEST: string;
|
|
533
|
-
SECONDARY_SUPER_LIGHT: string;
|
|
534
|
-
};
|
|
535
|
-
SUCCESS: {
|
|
536
|
-
SUCCESS_DARK: string;
|
|
537
|
-
SUCCESS_MEDIUM: string;
|
|
538
|
-
SUCCESS_LIGHT: string;
|
|
539
|
-
SUCCESS_SUPER_LIGHT: string;
|
|
540
|
-
};
|
|
541
|
-
WARNING: {
|
|
542
|
-
WARNING_DARK: string;
|
|
543
|
-
WARNING_MEDIUM: string;
|
|
544
|
-
WARNING_LIGHT: string;
|
|
545
|
-
WARNING_SUPER_LIGHT: string;
|
|
546
|
-
};
|
|
547
|
-
DANGER: {
|
|
548
|
-
DANGER_SUPER_DARK: string;
|
|
549
|
-
DANGER_DARK: string;
|
|
550
|
-
DANGER_MEDIUM: string;
|
|
551
|
-
DANGER_LIGHT: string;
|
|
552
|
-
DANGER_SUPER_LIGHT: string;
|
|
553
|
-
};
|
|
554
|
-
};
|
|
555
|
-
|
|
556
710
|
/**
|
|
557
711
|
* Popover is an unstyled popover component that handles positioning. It should be used
|
|
558
712
|
* with the Dialog component to provide a styled popover.
|
|
@@ -560,52 +714,112 @@ declare type Palette = {
|
|
|
560
714
|
* A popover displays interactive content in context with a trigger element.
|
|
561
715
|
* A tooltip displays a description of an element on hover or focus.
|
|
562
716
|
*
|
|
563
|
-
* @
|
|
717
|
+
* @see {@link usePopoverTrigger} for a complete usage example
|
|
718
|
+
*
|
|
719
|
+
* API:
|
|
720
|
+
* - {@link PopoverProps}
|
|
721
|
+
* - extends {@link AriaPopoverProps}
|
|
564
722
|
*/
|
|
565
723
|
export declare function Popover({ children, state, arrow, offset, ...props }: PopoverProps): JSX_2.Element;
|
|
566
724
|
|
|
567
725
|
declare interface PopoverProps extends Omit<AriaPopoverProps, "popoverRef"> {
|
|
568
726
|
/**
|
|
569
|
-
*
|
|
727
|
+
* Whether to show an arrow on the popover.
|
|
570
728
|
*/
|
|
571
|
-
|
|
729
|
+
arrow?: boolean;
|
|
572
730
|
/**
|
|
573
|
-
*
|
|
731
|
+
* Content to display within the popover.
|
|
574
732
|
*/
|
|
575
|
-
|
|
733
|
+
children: default_2.ReactNode;
|
|
576
734
|
/**
|
|
577
735
|
* Can optionally forward the ref to the popover.
|
|
578
736
|
*/
|
|
579
737
|
popoverRef?: default_2.RefObject<HTMLDivElement>;
|
|
580
738
|
/**
|
|
581
|
-
*
|
|
739
|
+
* The `isOpen` state of the popover and the methods to toggle it.
|
|
740
|
+
* - type {@link OverlayTriggerState}
|
|
582
741
|
*/
|
|
583
|
-
|
|
742
|
+
state: OverlayTriggerState;
|
|
584
743
|
}
|
|
585
744
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
745
|
+
declare type ProtonColorScale = {
|
|
746
|
+
SUPER_DARK: string;
|
|
747
|
+
DARK: string;
|
|
748
|
+
MEDIUM: string;
|
|
749
|
+
MEDIUM_LIGHT: string;
|
|
750
|
+
LIGHT: string;
|
|
751
|
+
LIGHTEST: string;
|
|
752
|
+
SUPER_LIGHT: string;
|
|
753
|
+
WHITE: string;
|
|
754
|
+
};
|
|
590
755
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
756
|
+
declare type ProtonPalette = {
|
|
757
|
+
BASE_COLOR: string;
|
|
758
|
+
BRAND: {
|
|
759
|
+
PRIMARY: string;
|
|
760
|
+
PRIMARY_LIGHT: string;
|
|
761
|
+
PRIMARY_SUPER_LIGHT: string;
|
|
762
|
+
SECONDARY: string;
|
|
763
|
+
SECONDARY_LIGHT: string;
|
|
764
|
+
SECONDARY_SUPER_LIGHT: string;
|
|
765
|
+
};
|
|
766
|
+
PRIMARY: ProtonColorScale;
|
|
767
|
+
SECONDARY: ProtonColorScale;
|
|
768
|
+
GRAYSCALE: ProtonColorScale;
|
|
769
|
+
};
|
|
595
770
|
|
|
596
|
-
|
|
597
|
-
|
|
771
|
+
declare interface ProtonStyleSheet {
|
|
772
|
+
"--proton-control__background-color": string;
|
|
773
|
+
"--proton-control__background-color-light": string;
|
|
774
|
+
"--proton-control__text-color": string;
|
|
775
|
+
"--proton-control__title-color": string;
|
|
776
|
+
"--proton-control__border-color": string;
|
|
777
|
+
"--proton-control__shadow-color": string;
|
|
778
|
+
"--proton-control__hover-color": string;
|
|
779
|
+
"--proton-control__border-radius": string;
|
|
780
|
+
"--proton-control__interactive-color": string;
|
|
781
|
+
"--proton-color__primary": string;
|
|
782
|
+
"--proton-color__primary-light": string;
|
|
783
|
+
"--proton-color__primary-super-light": string;
|
|
784
|
+
"--proton-color__secondary": string;
|
|
785
|
+
"--proton-color__secondary-light": string;
|
|
786
|
+
"--proton-color__secondary-super-light": string;
|
|
787
|
+
"--proton-color__danger-super-dark": string;
|
|
788
|
+
"--proton-color__danger-dark": string;
|
|
789
|
+
"--proton-color__danger-medium": string;
|
|
790
|
+
"--proton-color__danger-light": string;
|
|
791
|
+
"--proton-color__danger-super-light": string;
|
|
792
|
+
"--proton-color__warning-dark": string;
|
|
793
|
+
"--proton-color__warning-medium": string;
|
|
794
|
+
"--proton-color__warning-light": string;
|
|
795
|
+
"--proton-color__warning-super-light": string;
|
|
796
|
+
"--proton-color__success-dark": string;
|
|
797
|
+
"--proton-color__success-medium": string;
|
|
798
|
+
"--proton-color__success-light": string;
|
|
799
|
+
"--proton-color__success-super-light": string;
|
|
800
|
+
"--proton-color__gray-super-dark": string;
|
|
801
|
+
"--proton-color__gray-dark": string;
|
|
802
|
+
"--proton-color__gray-medium": string;
|
|
803
|
+
"--proton-color__gray-medium-light": string;
|
|
804
|
+
"--proton-color__gray-light": string;
|
|
805
|
+
"--proton-color__gray-lightest": string;
|
|
806
|
+
"--proton-color__gray-super-light": string;
|
|
807
|
+
"--proton-color__white": string;
|
|
598
808
|
}
|
|
599
809
|
|
|
600
|
-
export declare const Row: <T = object>(props: ProtonRowProps<T>) => JSX.Element;
|
|
601
|
-
|
|
602
810
|
/**
|
|
603
811
|
* Base Overlay component for creating modal-like backgrounds.
|
|
604
|
-
*
|
|
812
|
+
*
|
|
813
|
+
* API:
|
|
814
|
+
* - {@link ScreenOverlayProps}
|
|
605
815
|
*/
|
|
606
816
|
export declare const ScreenOverlay: ForwardRefExoticComponent<Omit<ScreenOverlayProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
607
817
|
|
|
608
818
|
declare interface ScreenOverlayProps {
|
|
819
|
+
/**
|
|
820
|
+
* Children to render inside the overlay.
|
|
821
|
+
*/
|
|
822
|
+
children?: React.ReactNode;
|
|
609
823
|
/**
|
|
610
824
|
* Whether to fade in the overlay.
|
|
611
825
|
*/
|
|
@@ -618,38 +832,43 @@ declare interface ScreenOverlayProps {
|
|
|
618
832
|
* Ref to the overlay element.
|
|
619
833
|
*/
|
|
620
834
|
ref?: React.RefObject<HTMLDivElement>;
|
|
621
|
-
/**
|
|
622
|
-
* Children to render inside the overlay.
|
|
623
|
-
*/
|
|
624
|
-
children?: React.ReactNode;
|
|
625
835
|
}
|
|
626
836
|
|
|
627
837
|
/**
|
|
628
838
|
* A search input component with optional clear functionality and URL parameter sync.
|
|
839
|
+
*
|
|
840
|
+
* API:
|
|
841
|
+
* - {@link SearchInputProps}
|
|
842
|
+
* - extends {@link BaseInputProps}
|
|
629
843
|
*/
|
|
630
844
|
export declare const SearchInput: ({ name, placeholder, autoComplete, isClearable, isDisabled, error, defaultValue, value: controlledValue, "data-testid": testId, onChange, onClear, }: SearchInputProps) => JSX_2.Element;
|
|
631
845
|
|
|
632
846
|
declare interface SearchInputProps extends Omit<BaseInputProps, "prefix" | "suffix" | "value" | "onChange" | "description" | "descriptionPosition" | "label"> {
|
|
847
|
+
/** The initial value of the input. */
|
|
848
|
+
defaultValue?: string;
|
|
633
849
|
/** Should the clear button be shown when there is text? */
|
|
634
850
|
isClearable?: boolean;
|
|
635
851
|
/** Called when the input value changes. */
|
|
636
852
|
onChange?: (value: string) => void;
|
|
637
853
|
/** Called when the clear button is clicked. */
|
|
638
854
|
onClear?: () => void;
|
|
639
|
-
/** The initial value of the input. */
|
|
640
|
-
defaultValue?: string;
|
|
641
855
|
/** The current value of the input (for controlled usage) */
|
|
642
856
|
value?: string;
|
|
643
857
|
}
|
|
644
858
|
|
|
645
|
-
export { Section }
|
|
646
|
-
|
|
647
859
|
/**
|
|
648
860
|
* A dropdown select menu that opens a popover on desktop and an action menu on mobile.
|
|
649
861
|
* Supports controlled and uncontrolled modes.
|
|
862
|
+
*
|
|
863
|
+
* API:
|
|
864
|
+
* - {@link SelectProps}
|
|
650
865
|
*/
|
|
651
866
|
export declare function Select({ label, name, isDisabled, disabledKeys, selectedKey, onSelectionChange, defaultSelectedKey, onOpen, onClose, items, "data-testid": testId, }: SelectProps): JSX_2.Element;
|
|
652
867
|
|
|
868
|
+
export declare namespace Select {
|
|
869
|
+
var displayName: string;
|
|
870
|
+
}
|
|
871
|
+
|
|
653
872
|
declare interface SelectItem {
|
|
654
873
|
label: string;
|
|
655
874
|
key: string;
|
|
@@ -657,36 +876,58 @@ declare interface SelectItem {
|
|
|
657
876
|
}
|
|
658
877
|
|
|
659
878
|
declare interface SelectProps {
|
|
660
|
-
/** The name of the select field */
|
|
661
|
-
name: string;
|
|
662
|
-
/** Label to display above the select
|
|
663
|
-
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#text
|
|
664
|
-
*/
|
|
665
|
-
label?: string;
|
|
666
|
-
/** Whether the select is disabled */
|
|
667
|
-
isDisabled?: boolean;
|
|
668
879
|
/** Array of keys that should be disabled
|
|
669
880
|
* @example ["Thing 1", "Thing 2"]
|
|
670
881
|
*/
|
|
671
882
|
disabledKeys?: string[];
|
|
672
|
-
/** Currently selected key */
|
|
673
|
-
selectedKey?: string;
|
|
674
|
-
/** Callback fired when selection changes */
|
|
675
|
-
onSelectionChange?: (key: string) => void;
|
|
676
883
|
/** The key of the default selected item */
|
|
677
884
|
defaultSelectedKey?: string;
|
|
678
|
-
/**
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
|
|
885
|
+
/** Test ID for the select */
|
|
886
|
+
"data-testid"?: string;
|
|
887
|
+
/** Whether the select is disabled */
|
|
888
|
+
isDisabled?: boolean;
|
|
682
889
|
/** Array of items to display
|
|
683
890
|
* @example [{ key: "thing-1", label: "Thing 1" }, { key: "thing-2", label: "Thing 2" }]
|
|
684
891
|
*/
|
|
685
892
|
items: SelectItem[];
|
|
686
|
-
/**
|
|
687
|
-
|
|
893
|
+
/** Label to display above the select
|
|
894
|
+
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#text
|
|
895
|
+
*/
|
|
896
|
+
label?: string;
|
|
897
|
+
/** The name of the select field */
|
|
898
|
+
name: string;
|
|
899
|
+
/** Callback fired when the menu closes */
|
|
900
|
+
onClose?: () => void;
|
|
901
|
+
/** Callback fired when the menu opens */
|
|
902
|
+
onOpen?: () => void;
|
|
903
|
+
/** Callback fired when selection changes */
|
|
904
|
+
onSelectionChange?: (key: string) => void;
|
|
905
|
+
/** Currently selected key */
|
|
906
|
+
selectedKey?: string;
|
|
688
907
|
}
|
|
689
908
|
|
|
909
|
+
export declare type SortDirection = "ASC" | "DESC";
|
|
910
|
+
|
|
911
|
+
declare type SortingConfig<T> = {
|
|
912
|
+
/** When sorting is enabled, all these props must be provided together. */
|
|
913
|
+
sortableColumns: string[];
|
|
914
|
+
sortedBy: string;
|
|
915
|
+
sortDirection: SortDirection;
|
|
916
|
+
onSort: (columnId: string, direction: SortDirection) => void;
|
|
917
|
+
} | {
|
|
918
|
+
/** When no sorting is needed, none of these props should be provided */
|
|
919
|
+
sortableColumns?: never;
|
|
920
|
+
sortedBy?: never;
|
|
921
|
+
sortDirection?: never;
|
|
922
|
+
onSort?: never;
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* A toggle switch component for boolean state control with support for controlled and uncontrolled modes.
|
|
927
|
+
*
|
|
928
|
+
* API:
|
|
929
|
+
* - {@link SwitchProps}
|
|
930
|
+
*/
|
|
690
931
|
export declare function Switch(props: SwitchProps): JSX_2.Element;
|
|
691
932
|
|
|
692
933
|
declare interface SwitchProps {
|
|
@@ -717,21 +958,118 @@ declare interface SwitchProps {
|
|
|
717
958
|
children?: React.ReactNode;
|
|
718
959
|
}
|
|
719
960
|
|
|
720
|
-
|
|
961
|
+
/**
|
|
962
|
+
* Base Table component that renders data in rows and columns using collections.
|
|
963
|
+
*
|
|
964
|
+
* - Built-in keyboard navigation for interactive rows.
|
|
965
|
+
* - Full ARIA table semantics with proper roles, labels, and indices.
|
|
966
|
+
*
|
|
967
|
+
* API:
|
|
968
|
+
* - {@link TableProps}
|
|
969
|
+
*
|
|
970
|
+
* @example
|
|
971
|
+
* ```tsx
|
|
972
|
+
* <Table caption="Employee Directory">
|
|
973
|
+
* <Table.Header>
|
|
974
|
+
* <Table.Column id="name">Name</Table.Column>
|
|
975
|
+
* </Table.Header>
|
|
976
|
+
* <Table.Body>
|
|
977
|
+
* <Table.Row key="1">
|
|
978
|
+
* <Table.Cell>Joe</Table.Cell>
|
|
979
|
+
* </Table.Row>
|
|
980
|
+
* </Table.Body>
|
|
981
|
+
* </Table>
|
|
982
|
+
* ```
|
|
983
|
+
*/
|
|
984
|
+
export declare const Table: (({ children, name }: TableProps) => JSX_2.Element) & {
|
|
985
|
+
/** Table header: {@link TableHeaderProps} */
|
|
986
|
+
Header: ({ ...props }: TableHeaderProps) => any;
|
|
987
|
+
/** Table column: {@link TableColumnProps} */
|
|
988
|
+
Column: ({ ...props }: TableColumnProps) => any;
|
|
989
|
+
/** Table body: {@link TableBodyProps} */
|
|
990
|
+
Body: ({ ...props }: TableBodyProps) => any;
|
|
991
|
+
/** Table row: {@link TableRowProps} */
|
|
992
|
+
Row: ({ ...props }: TableRowProps) => any;
|
|
993
|
+
/** Table cell: {@link TableCellProps} */
|
|
994
|
+
Cell: ({ ...props }: TableCellProps) => any;
|
|
995
|
+
};
|
|
721
996
|
|
|
722
|
-
export declare
|
|
997
|
+
export declare interface TableBodyProps {
|
|
998
|
+
children: TableRowElement | TableRowElement[];
|
|
999
|
+
}
|
|
723
1000
|
|
|
724
|
-
|
|
1001
|
+
declare const TableCell: ({ ...props }: TableCellProps) => any;
|
|
725
1002
|
|
|
726
|
-
declare
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
1003
|
+
export declare type TableCellData = {
|
|
1004
|
+
columnKey: string | number;
|
|
1005
|
+
value: ReactNode;
|
|
1006
|
+
colSpan?: number;
|
|
1007
|
+
};
|
|
1008
|
+
|
|
1009
|
+
declare type TableCellElement = ReactElement<TableCellProps, typeof TableCell>;
|
|
1010
|
+
|
|
1011
|
+
export declare interface TableCellProps {
|
|
1012
|
+
columnKey?: string;
|
|
1013
|
+
children?: ReactNode;
|
|
1014
|
+
colSpan?: number;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
export declare type TableCollection = ReturnType<typeof useTableCollection>;
|
|
1018
|
+
|
|
1019
|
+
declare const TableColumn: ({ ...props }: TableColumnProps) => any;
|
|
1020
|
+
|
|
1021
|
+
export declare type TableColumnData = {
|
|
1022
|
+
key: string | number;
|
|
1023
|
+
header: ReactNode;
|
|
1024
|
+
isHidden?: boolean;
|
|
1025
|
+
ariaSort?: AriaAttributes["aria-sort"];
|
|
1026
|
+
};
|
|
1027
|
+
|
|
1028
|
+
declare type TableColumnElement = ReactElement<TableColumnProps, typeof TableColumn>;
|
|
1029
|
+
|
|
1030
|
+
export declare interface TableColumnProps {
|
|
1031
|
+
id: string;
|
|
1032
|
+
children: ReactNode;
|
|
1033
|
+
"aria-sort"?: AriaAttributes["aria-sort"];
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
export declare type TableData = {
|
|
1037
|
+
columns: TableColumnData[];
|
|
1038
|
+
rows: TableRowData[];
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
export declare interface TableHeaderProps {
|
|
1042
|
+
children: TableColumnElement | TableColumnElement[];
|
|
1043
|
+
isHidden?: boolean;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
declare interface TableProps {
|
|
1047
|
+
children: [ReactElement<TableHeaderProps>, ReactElement<TableBodyProps>];
|
|
1048
|
+
/** Table name/caption for accessibility. Provides essential context for screen readers about table content. */
|
|
1049
|
+
name: string;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
declare const TableRow: ({ ...props }: TableRowProps) => any;
|
|
1053
|
+
|
|
1054
|
+
export declare type TableRowData = {
|
|
1055
|
+
key: string | number;
|
|
1056
|
+
cells: TableCellData[];
|
|
1057
|
+
onClick?: () => void;
|
|
1058
|
+
};
|
|
1059
|
+
|
|
1060
|
+
declare type TableRowElement = ReactElement<TableRowProps, typeof TableRow>;
|
|
1061
|
+
|
|
1062
|
+
export declare interface TableRowProps {
|
|
1063
|
+
key?: string | number;
|
|
1064
|
+
children: TableCellElement | TableCellElement[];
|
|
1065
|
+
onClick?: () => void;
|
|
730
1066
|
}
|
|
731
1067
|
|
|
732
1068
|
/**
|
|
733
1069
|
* A component that displays text with an ellipsis when it overflows its container.
|
|
734
|
-
*
|
|
1070
|
+
*
|
|
1071
|
+
* API:
|
|
1072
|
+
* - {@link TextEllipsisProps}
|
|
735
1073
|
*/
|
|
736
1074
|
export declare const TextEllipsis: ({ children, maxWidth, singleLine, lines, title, "data-testid": testId, }: TextEllipsisProps) => JSX_2.Element;
|
|
737
1075
|
|
|
@@ -768,7 +1106,10 @@ declare interface TextEllipsisProps {
|
|
|
768
1106
|
|
|
769
1107
|
/**
|
|
770
1108
|
* A component that displays text with emphasis. Provide tooltipProps to wrap the text in a tooltip trigger.
|
|
771
|
-
*
|
|
1109
|
+
*
|
|
1110
|
+
* API:
|
|
1111
|
+
* - {@link TextEmphasisProps}
|
|
1112
|
+
* - extends {@link React.HTMLAttributes}
|
|
772
1113
|
*/
|
|
773
1114
|
export declare const TextEmphasis: ({ to, children, tooltipProps, "data-testid": testId, }: TextEmphasisProps) => JSX_2.Element;
|
|
774
1115
|
|
|
@@ -796,8 +1137,9 @@ declare type Theme = (typeof THEMES)[keyof typeof THEMES];
|
|
|
796
1137
|
declare interface ThemeContextType {
|
|
797
1138
|
theme: Theme;
|
|
798
1139
|
className: string;
|
|
799
|
-
style:
|
|
800
|
-
palette:
|
|
1140
|
+
style: ProtonStyleSheet;
|
|
1141
|
+
palette: ProtonPalette;
|
|
1142
|
+
hasPalette?: boolean;
|
|
801
1143
|
}
|
|
802
1144
|
|
|
803
1145
|
export declare const ThemeProvider: default_2.FC<ThemeProviderProps>;
|
|
@@ -805,67 +1147,40 @@ export declare const ThemeProvider: default_2.FC<ThemeProviderProps>;
|
|
|
805
1147
|
declare interface ThemeProviderProps {
|
|
806
1148
|
theme: Theme;
|
|
807
1149
|
children: ReactNode;
|
|
808
|
-
palette?:
|
|
1150
|
+
palette?: ProtonPalette;
|
|
809
1151
|
}
|
|
810
1152
|
|
|
811
1153
|
declare const THEMES: {
|
|
812
1154
|
readonly DARK: "dark";
|
|
813
|
-
readonly CUSTOM_DARK: "custom-dark";
|
|
814
1155
|
readonly LIGHT: "light";
|
|
815
1156
|
};
|
|
816
1157
|
|
|
817
|
-
declare interface ThemeVariables {
|
|
818
|
-
"--proton-control__background-color": string;
|
|
819
|
-
"--proton-control__background-color-light": string;
|
|
820
|
-
"--proton-control__text-color": string;
|
|
821
|
-
"--proton-control__border-color": string;
|
|
822
|
-
"--proton-control__shadow-color": string;
|
|
823
|
-
"--proton-color__primary": string;
|
|
824
|
-
"--proton-color__primary-light": string;
|
|
825
|
-
"--proton-color__primary-super-light": string;
|
|
826
|
-
"--proton-color__secondary": string;
|
|
827
|
-
"--proton-control__primary-super-dark": string;
|
|
828
|
-
"--proton-control__primary-dark": string;
|
|
829
|
-
"--proton-control__primary-medium": string;
|
|
830
|
-
"--proton-control__primary-medium-light": string;
|
|
831
|
-
"--proton-control__primary-light": string;
|
|
832
|
-
"--proton-control__primary-lightest": string;
|
|
833
|
-
"--proton-control__primary-super-light": string;
|
|
834
|
-
"--proton-control__secondary-super-dark": string;
|
|
835
|
-
"--proton-control__secondary-dark": string;
|
|
836
|
-
"--proton-control__secondary-medium": string;
|
|
837
|
-
"--proton-control__secondary-medium-light": string;
|
|
838
|
-
"--proton-control__secondary-light": string;
|
|
839
|
-
"--proton-control__secondary-lightest": string;
|
|
840
|
-
"--proton-control__secondary-super-light": string;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
1158
|
/**
|
|
844
|
-
* A component that displays a loading tombstone. For use as a placeholder while loading content
|
|
845
|
-
*
|
|
1159
|
+
* A component that displays a loading tombstone. For use as a placeholder while loading content.
|
|
1160
|
+
*
|
|
1161
|
+
* API:
|
|
1162
|
+
* - {@link TombstoneProps}
|
|
846
1163
|
*/
|
|
847
1164
|
export declare const Tombstone: ({ width, height, borderRadius, }: TombstoneProps) => JSX_2.Element;
|
|
848
1165
|
|
|
849
1166
|
declare interface TombstoneProps {
|
|
850
1167
|
/**
|
|
851
|
-
* The
|
|
852
|
-
* @default "
|
|
1168
|
+
* The border radius of the tombstone.
|
|
1169
|
+
* @default "4px"
|
|
853
1170
|
*/
|
|
854
|
-
|
|
1171
|
+
borderRadius?: string;
|
|
855
1172
|
/**
|
|
856
1173
|
* The height of the tombstone.
|
|
857
1174
|
* @default "1.5rem"
|
|
858
1175
|
*/
|
|
859
1176
|
height?: string;
|
|
860
1177
|
/**
|
|
861
|
-
* The
|
|
862
|
-
* @default "
|
|
1178
|
+
* The width of the tombstone.
|
|
1179
|
+
* @default "100%"
|
|
863
1180
|
*/
|
|
864
|
-
|
|
1181
|
+
width?: string;
|
|
865
1182
|
}
|
|
866
1183
|
|
|
867
|
-
export declare function Tooltip({ children, arrow, ...props }: TooltipProps): JSX_2.Element;
|
|
868
|
-
|
|
869
1184
|
export declare interface TooltipProps extends Omit<TooltipProps_2, "children"> {
|
|
870
1185
|
children: React.ReactNode;
|
|
871
1186
|
arrow?: boolean;
|
|
@@ -878,6 +1193,18 @@ export declare interface TooltipProps extends Omit<TooltipProps_2, "children"> {
|
|
|
878
1193
|
*
|
|
879
1194
|
* If you wish to disable the trigger click feature, you can set the `disableTriggerClick` prop.
|
|
880
1195
|
* This is useful when using an info only Tooltip that might wrap a clickable element.
|
|
1196
|
+
*
|
|
1197
|
+
* API:
|
|
1198
|
+
* - {@link TooltipTriggerProps}
|
|
1199
|
+
* - extends {@link TooltipProps}
|
|
1200
|
+
* - extends {@link TooltipTriggerComponentProps}
|
|
1201
|
+
*
|
|
1202
|
+
* @example
|
|
1203
|
+
* ```tsx
|
|
1204
|
+
<TooltipTrigger content={...} placement="top" arrow isDisabled={disabled}>
|
|
1205
|
+
{children}
|
|
1206
|
+
</TooltipTrigger>
|
|
1207
|
+
* ```
|
|
881
1208
|
*/
|
|
882
1209
|
export declare function TooltipTrigger({ children, delay, closeDelay, isDisabled, defaultOpen, onOpenChange, disableTriggerClick, content, ...tooltipProps }: TooltipTriggerProps): JSX_2.Element;
|
|
883
1210
|
|
|
@@ -893,13 +1220,6 @@ export declare interface TooltipTriggerProps extends TooltipProps, TooltipTrigge
|
|
|
893
1220
|
disableTriggerClick?: boolean;
|
|
894
1221
|
}
|
|
895
1222
|
|
|
896
|
-
/**
|
|
897
|
-
* A component that displays either a popover menu or an action menu
|
|
898
|
-
* depending on the screen size when the menu trigger is pressed.
|
|
899
|
-
*
|
|
900
|
-
* @param {MenuProps} props - The props for the MenuTrigger component.
|
|
901
|
-
* @returns {JSX.Element} - The MenuTrigger component.
|
|
902
|
-
*/
|
|
903
1223
|
declare interface TriggerProps {
|
|
904
1224
|
disabled?: boolean;
|
|
905
1225
|
isOpen?: boolean;
|
|
@@ -910,6 +1230,36 @@ declare interface TriggerProps {
|
|
|
910
1230
|
/**
|
|
911
1231
|
* Hook for creating a popover trigger. This hook manages the state and events for the popover
|
|
912
1232
|
* and popover trigger. For examples see Popover.stories.tsx.
|
|
1233
|
+
*
|
|
1234
|
+
* API:
|
|
1235
|
+
* - {@link OverlayTriggerProps}
|
|
1236
|
+
*
|
|
1237
|
+
* @example
|
|
1238
|
+
* ```tsx
|
|
1239
|
+
* let { buttonProps, overlayProps, buttonRef, state } = usePopoverTrigger();
|
|
1240
|
+
*
|
|
1241
|
+
* return (
|
|
1242
|
+
* <div>
|
|
1243
|
+
* <button {...buttonProps} ref={buttonRef}>
|
|
1244
|
+
* Trigger
|
|
1245
|
+
* </button>
|
|
1246
|
+
*
|
|
1247
|
+
* {state.isOpen && (
|
|
1248
|
+
* <Popover
|
|
1249
|
+
* state={state}
|
|
1250
|
+
* triggerRef={buttonRef}
|
|
1251
|
+
* arrow={props.arrow}
|
|
1252
|
+
* offset={props.offset}
|
|
1253
|
+
* placement={props.placement}
|
|
1254
|
+
* >
|
|
1255
|
+
* <Dialog {...overlayProps} title="Popover">
|
|
1256
|
+
* Here is some popover content
|
|
1257
|
+
* </Dialog>
|
|
1258
|
+
* </Popover>
|
|
1259
|
+
* )}
|
|
1260
|
+
* </div>
|
|
1261
|
+
* );
|
|
1262
|
+
* ```
|
|
913
1263
|
*/
|
|
914
1264
|
export declare function usePopoverTrigger(props?: OverlayTriggerProps): {
|
|
915
1265
|
buttonProps: default_2.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
@@ -918,15 +1268,32 @@ export declare function usePopoverTrigger(props?: OverlayTriggerProps): {
|
|
|
918
1268
|
state: OverlayTriggerState;
|
|
919
1269
|
};
|
|
920
1270
|
|
|
1271
|
+
/**
|
|
1272
|
+
* Hook for managing table data structure and providing navigation methods
|
|
1273
|
+
*/
|
|
1274
|
+
export declare function useTableCollection(data: TableData): {
|
|
1275
|
+
columns: TableColumnData_2[];
|
|
1276
|
+
rows: TableRowData[];
|
|
1277
|
+
size: number;
|
|
1278
|
+
firstItem: TableRowData;
|
|
1279
|
+
lastItem: TableRowData;
|
|
1280
|
+
isHeaderHidden: boolean;
|
|
1281
|
+
hasVisibleHeader: boolean;
|
|
1282
|
+
getTotalRowCount: number;
|
|
1283
|
+
getRowAriaIndex: (rowIndex: number) => number;
|
|
1284
|
+
getItemByKey: (key: string | number) => TableRowData | null;
|
|
1285
|
+
getItemAfter: (key: string | number) => TableRowData | null;
|
|
1286
|
+
getItemBefore: (key: string | number) => TableRowData | null;
|
|
1287
|
+
getItemIndex: (key: string | number) => number;
|
|
1288
|
+
};
|
|
1289
|
+
|
|
921
1290
|
export declare const useTheme: () => ThemeContextType;
|
|
922
1291
|
|
|
923
1292
|
/**
|
|
924
1293
|
* A waveform visualization component that displays audio data with interactive features.
|
|
925
1294
|
*
|
|
926
|
-
*
|
|
927
|
-
* @
|
|
928
|
-
*
|
|
929
|
-
* @returns {JSX.Element} A waveform visualization with optional timestamps and interactive features
|
|
1295
|
+
* API:
|
|
1296
|
+
* - {@link WaveformProps}
|
|
930
1297
|
*/
|
|
931
1298
|
export declare function Waveform({ data: waveformData, resolution, startDuration, endDuration, currentTime, showTimestamps, totalDuration, disabled, disabledMessage, onClick, "data-testid": testId, }: WaveformProps): JSX_2.Element;
|
|
932
1299
|
|
|
@@ -936,6 +1303,14 @@ declare interface WaveformProps {
|
|
|
936
1303
|
* If not provided, uses a sample sine wave.
|
|
937
1304
|
*/
|
|
938
1305
|
data?: number[];
|
|
1306
|
+
/**
|
|
1307
|
+
* Current playback position in seconds.
|
|
1308
|
+
*/
|
|
1309
|
+
currentTime?: number;
|
|
1310
|
+
/**
|
|
1311
|
+
* Test ID for testing purposes.
|
|
1312
|
+
*/
|
|
1313
|
+
"data-testid"?: string;
|
|
939
1314
|
/**
|
|
940
1315
|
* Whether the entire waveform is disabled.
|
|
941
1316
|
*/
|
|
@@ -945,42 +1320,29 @@ declare interface WaveformProps {
|
|
|
945
1320
|
*/
|
|
946
1321
|
disabledMessage?: string;
|
|
947
1322
|
/**
|
|
948
|
-
*
|
|
1323
|
+
* End time to display until in seconds.
|
|
949
1324
|
*/
|
|
950
|
-
|
|
1325
|
+
endDuration?: number;
|
|
951
1326
|
/**
|
|
952
|
-
*
|
|
1327
|
+
* Click handler that receives the clicked position (0-1) and event.
|
|
953
1328
|
*/
|
|
954
|
-
|
|
1329
|
+
onClick?: (position: number, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
955
1330
|
/**
|
|
956
1331
|
* Width in pixels of each waveform bar.
|
|
957
1332
|
*/
|
|
958
1333
|
resolution?: number;
|
|
959
|
-
/**
|
|
960
|
-
* Start time to display from in seconds.
|
|
961
|
-
*/
|
|
962
|
-
startDuration?: number;
|
|
963
|
-
/**
|
|
964
|
-
* End time to display until in seconds.
|
|
965
|
-
*/
|
|
966
|
-
endDuration?: number;
|
|
967
1334
|
/**
|
|
968
1335
|
* Whether to show timestamp markers.
|
|
969
1336
|
*/
|
|
970
1337
|
showTimestamps?: boolean;
|
|
971
1338
|
/**
|
|
972
|
-
*
|
|
1339
|
+
* Start time to display from in seconds.
|
|
973
1340
|
*/
|
|
974
|
-
|
|
1341
|
+
startDuration?: number;
|
|
975
1342
|
/**
|
|
976
|
-
*
|
|
1343
|
+
* Total duration of the audio in seconds.
|
|
977
1344
|
*/
|
|
978
|
-
|
|
1345
|
+
totalDuration: number;
|
|
979
1346
|
}
|
|
980
1347
|
|
|
981
1348
|
export { }
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
declare namespace ButtonGroup {
|
|
985
|
-
var Option: (props: ButtonGroupOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
986
|
-
}
|