@protonradio/proton-ui 0.11.0-beta.22 → 0.11.0-beta.5
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 +73 -153
- package/dist/constants.cjs.js +1 -1
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.d.ts +147 -4
- package/dist/constants.es.js +19 -7
- package/dist/constants.es.js.map +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.cjs.js.map +1 -1
- package/dist/hooks.d.ts +5 -34
- package/dist/hooks.es.js +4 -36
- package/dist/hooks.es.js.map +1 -1
- package/dist/icons.svg +10 -10
- package/dist/index.cjs.js +12 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +291 -512
- package/dist/index.es.js +11459 -10001
- package/dist/index.es.js.map +1 -1
- package/dist/palettes-BX86v-qb.js +2 -0
- package/dist/palettes-BX86v-qb.js.map +1 -0
- package/dist/palettes-mcF0lNKY.mjs +171 -0
- package/dist/palettes-mcF0lNKY.mjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/useBreakpoint-CjRyGKN-.mjs.map +1 -1
- package/dist/{useBreakpoint-CA9tMMV8.js → useBreakpoint-DA-JqOu3.js} +2 -2
- package/dist/useBreakpoint-DA-JqOu3.js.map +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.cjs.js.map +1 -1
- package/dist/utils.d.ts +45 -33
- package/dist/utils.es.js +451 -17
- package/dist/utils.es.js.map +1 -1
- package/package.json +100 -106
- package/dist/breakpoint-9y1_8U_b.mjs +0 -10
- package/dist/breakpoint-9y1_8U_b.mjs.map +0 -1
- package/dist/breakpoint-DtqbboOa.js +0 -2
- package/dist/breakpoint-DtqbboOa.js.map +0 -1
- package/dist/darkTheme-DUWn6YJ-.mjs +0 -345
- package/dist/darkTheme-DUWn6YJ-.mjs.map +0 -1
- package/dist/darkTheme-ann6VTfq.js +0 -2
- package/dist/darkTheme-ann6VTfq.js.map +0 -1
- package/dist/image-BlhKzTx8.js +0 -2
- package/dist/image-BlhKzTx8.js.map +0 -1
- package/dist/image-C8M6y5Op.mjs +0 -205
- package/dist/image-C8M6y5Op.mjs.map +0 -1
- package/dist/navigation-BB0MBIiR.js +0 -2
- package/dist/navigation-BB0MBIiR.js.map +0 -1
- package/dist/navigation-Bj7Pex9j.mjs +0 -43
- package/dist/navigation-Bj7Pex9j.mjs.map +0 -1
- package/dist/theme-DQsfWeLo.mjs +0 -12
- package/dist/theme-DQsfWeLo.mjs.map +0 -1
- package/dist/theme-Dc0Ahjq9.js +0 -2
- package/dist/theme-Dc0Ahjq9.js.map +0 -1
- package/dist/useBreakpoint-CA9tMMV8.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,101 +1,70 @@
|
|
|
1
|
-
import { AriaDialogProps } from '
|
|
2
|
-
import { AriaPopoverProps } from '
|
|
3
|
-
import { AriaTableProps } from '
|
|
1
|
+
import { AriaDialogProps } from 'react-aria';
|
|
2
|
+
import { AriaPopoverProps } from 'react-aria';
|
|
3
|
+
import { AriaTableProps } from 'react-aria';
|
|
4
4
|
import { ColumnProps } from '@react-stately/table';
|
|
5
5
|
import { default as default_2 } from 'react';
|
|
6
6
|
import { DOMProps } from '@react-types/shared';
|
|
7
7
|
import { ForwardRefExoticComponent } from 'react';
|
|
8
8
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { OverlayTriggerProps } from 'react-stately';
|
|
10
|
+
import { OverlayTriggerState } from 'react-stately';
|
|
11
|
+
import { PressEvent } from 'react-aria';
|
|
12
|
+
import { PressProps } from 'react-aria';
|
|
12
13
|
import { ReactNode } from 'react';
|
|
13
14
|
import { RefAttributes } from 'react';
|
|
14
15
|
import { RowProps } from '@react-stately/table';
|
|
15
16
|
import { Section } from '@react-stately/table';
|
|
16
|
-
import { Selection as Selection_2 } from '
|
|
17
|
+
import { Selection as Selection_2 } from 'react-stately';
|
|
17
18
|
import { TableBodyProps } from '@react-stately/table';
|
|
18
19
|
import { TableHeader } from '@react-stately/table';
|
|
19
|
-
import { TableStateProps } from '
|
|
20
|
+
import { TableStateProps } from 'react-stately';
|
|
20
21
|
import { TooltipProps as TooltipProps_2 } from 'react-aria-components';
|
|
21
22
|
import { TooltipTriggerComponentProps } from 'react-aria-components';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* ActionMenu to display a menu of actions.
|
|
25
26
|
* Renders a list of actions as a focusable menu, or non-focusable children.
|
|
26
|
-
*
|
|
27
|
-
* API:
|
|
28
|
-
* - {@link ActionMenuProps}
|
|
27
|
+
* @interface ActionMenuProps
|
|
29
28
|
*/
|
|
30
|
-
export declare const ActionMenu: ({ isOpen, selectionMode, selectedKeys, defaultSelectedKeys, disabledKeys, children, showCancel, cancelButtonText, actions,
|
|
29
|
+
export declare const ActionMenu: ({ isOpen, selectionMode, selectedKeys, defaultSelectedKeys, disabledKeys, children, showCancel, cancelButtonText, actions, onSelectionChange, onClose, "data-testid": testId, }: ActionMenuProps) => JSX_2.Element;
|
|
31
30
|
|
|
32
31
|
declare interface ActionMenuAction {
|
|
33
32
|
key: string;
|
|
34
33
|
label?: ReactNode;
|
|
35
|
-
description?: ReactNode;
|
|
36
34
|
to?: string;
|
|
37
35
|
onAction?: (key: string) => void;
|
|
38
36
|
children?: ActionMenuAction[];
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
declare interface ActionMenuProps {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
cancelButtonText?: string;
|
|
48
|
-
/** The children of the menu */
|
|
40
|
+
isOpen: boolean;
|
|
41
|
+
selectionMode?: "single" | "multiple" | "none";
|
|
42
|
+
selectedKeys?: string[];
|
|
43
|
+
defaultSelectedKeys?: string[];
|
|
44
|
+
disabledKeys?: string[];
|
|
49
45
|
children?: ReactNode | ((props: {
|
|
50
46
|
close: () => void;
|
|
51
47
|
}) => ReactNode);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/** The keys of the disabled items */
|
|
57
|
-
disabledKeys?: string[];
|
|
58
|
-
/** Whether the menu is open
|
|
59
|
-
* @default false
|
|
60
|
-
*/
|
|
61
|
-
isOpen: boolean;
|
|
62
|
-
/** The callback function to close the menu */
|
|
48
|
+
showCancel?: boolean;
|
|
49
|
+
cancelButtonText?: string;
|
|
50
|
+
actions?: ActionMenuAction[];
|
|
51
|
+
id?: string;
|
|
63
52
|
onClose?: () => void;
|
|
64
|
-
/** The callback function to change the selection
|
|
65
|
-
* - type {@link Selection}
|
|
66
|
-
*/
|
|
67
53
|
onSelectionChange?: (keys: Selection_2) => void;
|
|
68
|
-
|
|
69
|
-
* @default "single"
|
|
70
|
-
*/
|
|
71
|
-
selectionMode?: "single" | "multiple" | "none";
|
|
72
|
-
/** The keys of the selected items */
|
|
73
|
-
selectedKeys?: string[];
|
|
74
|
-
/** Whether to show the cancel button */
|
|
75
|
-
showCancel?: boolean;
|
|
76
|
-
/** The title of the menu */
|
|
77
|
-
title?: string;
|
|
54
|
+
"data-testid"?: string;
|
|
78
55
|
}
|
|
79
56
|
|
|
80
|
-
/**
|
|
81
|
-
* A badge component for displaying status, categories, or counts with various visual styles.
|
|
82
|
-
*
|
|
83
|
-
* API:
|
|
84
|
-
* - {@link BadgeProps}
|
|
85
|
-
* - extends {@link React.HTMLAttributes}
|
|
86
|
-
*/
|
|
87
57
|
export declare const Badge: ({ variant, children, ...props }: BadgeProps) => JSX_2.Element;
|
|
88
58
|
|
|
89
|
-
declare interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
90
|
-
/**
|
|
91
|
-
* The content to display within the badge.
|
|
92
|
-
*/
|
|
93
|
-
children: ReactNode;
|
|
59
|
+
export declare interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
94
60
|
/**
|
|
95
61
|
* The badge's visual aesthetic.
|
|
96
|
-
* - type {@link BadgeVariant}
|
|
97
62
|
*/
|
|
98
63
|
variant?: BadgeVariant;
|
|
64
|
+
/**
|
|
65
|
+
* The content to display within the badge.
|
|
66
|
+
*/
|
|
67
|
+
children: ReactNode;
|
|
99
68
|
}
|
|
100
69
|
|
|
101
70
|
export declare type BadgeVariant = "primary" | "secondary" | "transparent" | "success" | "warning" | "danger";
|
|
@@ -104,96 +73,60 @@ export declare const BadgeVariants: Record<BadgeVariant, BadgeVariant>;
|
|
|
104
73
|
|
|
105
74
|
/**
|
|
106
75
|
* A banner used to display a success, warning, or error message.
|
|
107
|
-
*
|
|
108
|
-
* API:
|
|
109
|
-
* - {@link BannerProps}
|
|
110
|
-
* - extends {@link BannerIconProps}
|
|
76
|
+
* @interface BannerProps
|
|
111
77
|
*/
|
|
112
78
|
export declare const Banner: {
|
|
113
79
|
({ variant, rounded, icon, compact, children, "data-testid": dataTestId, }: BannerProps): JSX_2.Element;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
*/
|
|
128
|
-
Content: {
|
|
129
|
-
({ children, "data-testid": dataTestId, }: {
|
|
130
|
-
children: ReactNode;
|
|
131
|
-
"data-testid"?: string;
|
|
132
|
-
}): JSX_2.Element;
|
|
133
|
-
displayName: string;
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* Renders an icon inline with the banner title.
|
|
137
|
-
*
|
|
138
|
-
* API:
|
|
139
|
-
* - {@link BannerIconProps}
|
|
140
|
-
*/
|
|
141
|
-
Icon: {
|
|
142
|
-
({ icon, "data-testid": dataTestId }: BannerIconProps): JSX_2.Element;
|
|
143
|
-
displayName: string;
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* Renders a Proton Button.
|
|
147
|
-
* - @prop buttonProps {@link ButtonProps}
|
|
148
|
-
*/
|
|
149
|
-
Action: {
|
|
150
|
-
({ children, ...buttonProps }: ButtonProps): JSX_2.Element;
|
|
151
|
-
displayName: string;
|
|
80
|
+
Title: ({ children, ...props }: {
|
|
81
|
+
children: ReactNode;
|
|
82
|
+
}) => JSX_2.Element;
|
|
83
|
+
Content: ({ children, ...props }: {
|
|
84
|
+
children: ReactNode;
|
|
85
|
+
}) => JSX_2.Element;
|
|
86
|
+
Icon: ({ children, icon, ...props }: BannerIconProps) => JSX_2.Element;
|
|
87
|
+
Action: ({ children, ...props }: ButtonProps) => JSX_2.Element;
|
|
88
|
+
Actions: default_2.FC<BannerActionsProps>;
|
|
89
|
+
icons: {
|
|
90
|
+
success: JSX_2.Element;
|
|
91
|
+
warning: JSX_2.Element;
|
|
92
|
+
danger: JSX_2.Element;
|
|
152
93
|
};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
children: ReactNode;
|
|
159
|
-
}): JSX_2.Element;
|
|
160
|
-
displayName: string;
|
|
94
|
+
variants: {
|
|
95
|
+
readonly default: "default";
|
|
96
|
+
readonly success: "success";
|
|
97
|
+
readonly warning: "warning";
|
|
98
|
+
readonly danger: "danger";
|
|
161
99
|
};
|
|
162
100
|
};
|
|
163
101
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
danger: JSX_2.Element;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
export declare const BANNER_VARIANTS: {
|
|
171
|
-
readonly default: "default";
|
|
172
|
-
readonly success: "success";
|
|
173
|
-
readonly warning: "warning";
|
|
174
|
-
readonly danger: "danger";
|
|
175
|
-
};
|
|
102
|
+
declare interface BannerActionsProps {
|
|
103
|
+
children: ReactNode;
|
|
104
|
+
}
|
|
176
105
|
|
|
177
106
|
declare interface BannerIconProps {
|
|
178
|
-
/**
|
|
179
|
-
* Optional custom icon or children for the icon area.
|
|
180
|
-
*/
|
|
181
|
-
children?: ReactNode;
|
|
182
107
|
/**
|
|
183
108
|
* The icon to display in the banner.
|
|
184
|
-
* Can be a boolean to conditionally show or hide,
|
|
109
|
+
* Can be a boolean to conditionally show or hide,
|
|
110
|
+
* or a ReactNode to provide a custom icon.
|
|
185
111
|
*/
|
|
186
112
|
icon?: boolean | ReactNode;
|
|
187
113
|
/**
|
|
188
|
-
*
|
|
114
|
+
* Optional custom icon or children for the icon area.
|
|
189
115
|
*/
|
|
190
|
-
|
|
116
|
+
children?: ReactNode;
|
|
191
117
|
}
|
|
192
118
|
|
|
193
119
|
declare interface BannerProps extends BannerIconProps {
|
|
120
|
+
/**
|
|
121
|
+
* The banner's visual aesthetic.
|
|
122
|
+
*/
|
|
123
|
+
variant?: BannerVariant;
|
|
124
|
+
/**
|
|
125
|
+
* Round the corners of the banner.
|
|
126
|
+
*/
|
|
127
|
+
rounded?: boolean;
|
|
194
128
|
/**
|
|
195
129
|
* Compact padding around the content of the banner.
|
|
196
|
-
* @default true
|
|
197
130
|
*/
|
|
198
131
|
compact?: boolean;
|
|
199
132
|
/**
|
|
@@ -204,16 +137,6 @@ declare interface BannerProps extends BannerIconProps {
|
|
|
204
137
|
* The data-testid to display within the banner.
|
|
205
138
|
*/
|
|
206
139
|
"data-testid"?: string;
|
|
207
|
-
/**
|
|
208
|
-
* Round the corners of the banner.
|
|
209
|
-
* @default true
|
|
210
|
-
*/
|
|
211
|
-
rounded?: boolean;
|
|
212
|
-
/**
|
|
213
|
-
* The banner's visual aesthetic.
|
|
214
|
-
* - type {@link BannerVariant}
|
|
215
|
-
*/
|
|
216
|
-
variant?: BannerVariant;
|
|
217
140
|
}
|
|
218
141
|
|
|
219
142
|
export declare type BannerVariant = "default" | "success" | "warning" | "danger";
|
|
@@ -269,7 +192,6 @@ declare interface BaseInputProps {
|
|
|
269
192
|
/**
|
|
270
193
|
* The type attribute of the input element.
|
|
271
194
|
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/type
|
|
272
|
-
* @default "text"
|
|
273
195
|
*/
|
|
274
196
|
type?: string;
|
|
275
197
|
/**
|
|
@@ -277,44 +199,17 @@ declare interface BaseInputProps {
|
|
|
277
199
|
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
278
200
|
*/
|
|
279
201
|
value?: string;
|
|
280
|
-
/**
|
|
281
|
-
* Whether the input is required.
|
|
282
|
-
* @default false
|
|
283
|
-
*/
|
|
284
|
-
isRequired?: boolean;
|
|
285
|
-
/**
|
|
286
|
-
* Whether the input is read-only.
|
|
287
|
-
* @default false
|
|
288
|
-
*/
|
|
289
|
-
isReadOnly?: boolean;
|
|
290
|
-
/**
|
|
291
|
-
* Called when the input is submitted (e.g. by pressing Enter).
|
|
292
|
-
*/
|
|
293
|
-
onSubmit?: default_2.FormEventHandler<HTMLInputElement>;
|
|
294
|
-
/**
|
|
295
|
-
* Called when the input is cleared (e.g. by pressing Escape).
|
|
296
|
-
*/
|
|
297
|
-
onClear?: () => void;
|
|
298
202
|
}
|
|
299
203
|
|
|
300
204
|
/**
|
|
301
|
-
* A customizable button component that can render as either a button or anchor element
|
|
302
|
-
*
|
|
303
|
-
* API:
|
|
304
|
-
* - {@link ButtonProps}
|
|
205
|
+
* A customizable button component that can render as either a button or anchor element
|
|
206
|
+
* @interface ButtonProps
|
|
305
207
|
*/
|
|
306
208
|
export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
307
209
|
|
|
308
|
-
/**
|
|
309
|
-
* A radio button group component that allows selection of a single option from multiple choices.
|
|
310
|
-
*
|
|
311
|
-
* API:
|
|
312
|
-
* - {@link ButtonGroupProps}
|
|
313
|
-
*/
|
|
314
210
|
export declare function ButtonGroup(props: ButtonGroupProps): JSX_2.Element;
|
|
315
211
|
|
|
316
212
|
export declare namespace ButtonGroup {
|
|
317
|
-
var displayName: string;
|
|
318
213
|
var Option: (props: ButtonGroupOptionProps) => JSX_2.Element;
|
|
319
214
|
}
|
|
320
215
|
|
|
@@ -352,80 +247,70 @@ declare interface ButtonGroupProps {
|
|
|
352
247
|
|
|
353
248
|
declare interface ButtonProps {
|
|
354
249
|
/** The button's visual aesthetic
|
|
355
|
-
*
|
|
250
|
+
* @param {ButtonVariant} variant
|
|
356
251
|
*/
|
|
357
252
|
variant?: ButtonVariant;
|
|
358
253
|
/** The size of the button
|
|
359
|
-
*
|
|
360
|
-
* @default "
|
|
254
|
+
* @param {ButtonSize} size
|
|
255
|
+
* @default "fullWidth"
|
|
361
256
|
*/
|
|
362
257
|
size?: ButtonSize;
|
|
363
258
|
/** Should the button be full width?
|
|
364
|
-
* @
|
|
259
|
+
* @param {boolean} fullWidth
|
|
365
260
|
*/
|
|
366
261
|
fullWidth?: boolean;
|
|
367
|
-
/** The prefix to display within the button
|
|
262
|
+
/** The prefix to display within the button
|
|
263
|
+
* @param {React.ReactNode} icon
|
|
264
|
+
*/
|
|
368
265
|
icon?: React.ReactNode;
|
|
369
|
-
/** Should the button be non-interactive?
|
|
266
|
+
/** Should the button be non-interactive?
|
|
267
|
+
* @param {boolean} isDisabled
|
|
268
|
+
*/
|
|
370
269
|
isDisabled?: boolean;
|
|
371
|
-
/** 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`).
|
|
270
|
+
/** 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`).
|
|
271
|
+
* @param {string} to
|
|
272
|
+
*/
|
|
372
273
|
to?: string;
|
|
373
|
-
/** The target attribute for the link. Defaults to `_blank` if the URL is external.
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
/**
|
|
274
|
+
/** The target attribute for the link. Defaults to `_blank` if the URL is external.
|
|
275
|
+
* @param {string} target
|
|
276
|
+
*/
|
|
277
|
+
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
278
|
+
/** Called when the button is pressed (on release, not keydown)
|
|
279
|
+
* @param {(e: PressEvent) => void} onPress
|
|
280
|
+
*/
|
|
281
|
+
onPress?: (e: PressEvent) => void;
|
|
282
|
+
/** The type of button
|
|
283
|
+
* @param {"button" | "submit" | "reset"} type
|
|
284
|
+
*/
|
|
378
285
|
type?: "button" | "submit" | "reset";
|
|
379
|
-
/** The test ID for the button
|
|
286
|
+
/** The test ID for the button
|
|
287
|
+
* @param {string} dataTestId
|
|
288
|
+
*/
|
|
380
289
|
"data-testid"?: string;
|
|
381
|
-
/** The content to display within the button
|
|
290
|
+
/** The content to display within the button
|
|
291
|
+
* @param {React.ReactNode} children
|
|
292
|
+
*/
|
|
382
293
|
children?: React.ReactNode;
|
|
294
|
+
/** DO NOT USE. INTERNAL USE ONLY. Will be used in calculation for the shift of the button text. Represents the # of horizontal pixels to shift.
|
|
295
|
+
* @param {number} __textShift
|
|
296
|
+
*/
|
|
297
|
+
__textShift?: number;
|
|
383
298
|
}
|
|
384
299
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
export declare const ButtonSizes: Record<ButtonSize, ButtonSize>;
|
|
300
|
+
declare type ButtonSize = "small" | "medium" | "large" | "xlarge" | "2xlarge";
|
|
388
301
|
|
|
389
302
|
export declare type ButtonVariant = "primary" | "secondary" | "success" | "danger" | "translucent";
|
|
390
303
|
|
|
391
|
-
export declare const ButtonVariants: Record<ButtonVariant, ButtonVariant>;
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* A button with a select menu.
|
|
395
|
-
*
|
|
396
|
-
* API:
|
|
397
|
-
* - {@link ButtonWithSelectProps}
|
|
398
|
-
* - extends {@link ButtonProps}
|
|
399
|
-
*/
|
|
400
304
|
export declare function ButtonWithSelect({ items, defaultValue, children, onSelectionChange, disabledKeys, selectedKey, icon, variant, fullWidth, onPress, ...buttonProps }: ButtonWithSelectProps): JSX_2.Element;
|
|
401
305
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
declare interface ButtonWithSelectProps extends ButtonProps {
|
|
407
|
-
/**
|
|
408
|
-
* The default value of the select menu.
|
|
409
|
-
*/
|
|
306
|
+
declare type ButtonWithSelectProps = {
|
|
307
|
+
items: MenuItemType[];
|
|
410
308
|
defaultValue?: string;
|
|
411
|
-
|
|
412
|
-
* The keys of the disabled items.
|
|
413
|
-
*/
|
|
414
|
-
disabledKeys?: string[];
|
|
415
|
-
/**
|
|
416
|
-
* The items to display in the select menu.
|
|
417
|
-
* - type {@link ActionMenuAction}
|
|
418
|
-
*/
|
|
419
|
-
items: ActionMenuAction[];
|
|
420
|
-
/**
|
|
421
|
-
* The callback function to call when the selection changes.
|
|
422
|
-
*/
|
|
309
|
+
children: default_2.ReactNode;
|
|
423
310
|
onSelectionChange?: (key: string) => void;
|
|
424
|
-
/**
|
|
425
|
-
* The key of the selected item.
|
|
426
|
-
*/
|
|
427
311
|
selectedKey?: string;
|
|
428
|
-
|
|
312
|
+
disabledKeys?: string[];
|
|
313
|
+
} & ButtonProps;
|
|
429
314
|
|
|
430
315
|
export declare const Cell: <T>(props: ProtonColumnProps<T>) => JSX.Element;
|
|
431
316
|
|
|
@@ -433,9 +318,7 @@ export declare const Column: <T>(props: ProtonColumnProps<T>) => JSX.Element;
|
|
|
433
318
|
|
|
434
319
|
/**
|
|
435
320
|
* Input with a button to copy value to the clipboard.
|
|
436
|
-
*
|
|
437
|
-
* API:
|
|
438
|
-
* - {@link CopyInputProps}
|
|
321
|
+
* @interface CopyInputProps
|
|
439
322
|
*/
|
|
440
323
|
export declare function CopyInput({ name, value, isDisabled, onError, onSuccess, }: CopyInputProps): JSX_2.Element;
|
|
441
324
|
|
|
@@ -454,10 +337,6 @@ declare interface CopyInputProps {
|
|
|
454
337
|
|
|
455
338
|
/**
|
|
456
339
|
* Intended use in overlay containers such as modals or popovers.
|
|
457
|
-
*
|
|
458
|
-
* API:
|
|
459
|
-
* - {@link DialogProps}
|
|
460
|
-
* - extends {@link AriaDialogProps}
|
|
461
340
|
*/
|
|
462
341
|
export declare function Dialog({ title, children, ...props }: DialogProps): JSX_2.Element;
|
|
463
342
|
|
|
@@ -473,8 +352,7 @@ declare interface DialogProps extends AriaDialogProps {
|
|
|
473
352
|
* to create a sense of depth or hierarchy in the UI. It uses the `--proton-control__background-color-light`
|
|
474
353
|
* CSS variable which is theme-aware and will adapt to light, dark, and custom-dark themes.
|
|
475
354
|
*
|
|
476
|
-
*
|
|
477
|
-
* - {@link ElevationProps}
|
|
355
|
+
* @interface ElevationProps
|
|
478
356
|
*/
|
|
479
357
|
export declare const Elevation: ({ children, hasPrimaryGradient, "data-testid": dataTestId, }: ElevationProps) => JSX_2.Element;
|
|
480
358
|
|
|
@@ -483,29 +361,23 @@ declare interface ElevationProps {
|
|
|
483
361
|
* The content to be displayed within the elevation.
|
|
484
362
|
*/
|
|
485
363
|
children?: ReactNode;
|
|
486
|
-
/**
|
|
487
|
-
* The data-testid attribute for testing purposes.
|
|
488
|
-
*/
|
|
489
|
-
"data-testid"?: string;
|
|
490
364
|
/**
|
|
491
365
|
* Whether the elevation should have a background gradient.
|
|
492
366
|
* @important only works in custom dark mode
|
|
493
367
|
* @default false
|
|
494
368
|
*/
|
|
495
369
|
hasPrimaryGradient?: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* The data-testid attribute for testing purposes.
|
|
372
|
+
*/
|
|
373
|
+
"data-testid"?: string;
|
|
496
374
|
}
|
|
497
375
|
|
|
498
|
-
|
|
499
|
-
* An icon component that displays SVG icons from a sprite sheet or inline.
|
|
500
|
-
*
|
|
501
|
-
* API:
|
|
502
|
-
* - {@link IconProps}
|
|
503
|
-
*/
|
|
504
|
-
export declare function Icon(props: IconProps): JSX_2.Element;
|
|
376
|
+
export declare function Icon(props: Omit<IconProps, "svgContent">): JSX_2.Element;
|
|
505
377
|
|
|
506
378
|
declare type IconID = "external-link" | "caret-down" | "caret-right" | "chevron-right" | "chevron-left" | "chevron-up" | "chevron-down";
|
|
507
379
|
|
|
508
|
-
|
|
380
|
+
declare interface IconProps {
|
|
509
381
|
/**
|
|
510
382
|
* The spritesheet ID defined in the Icons spritesheet.
|
|
511
383
|
*/
|
|
@@ -522,9 +394,7 @@ export declare interface IconProps {
|
|
|
522
394
|
|
|
523
395
|
/**
|
|
524
396
|
* ImageOverlay component for displaying an image with a blur effect.
|
|
525
|
-
*
|
|
526
|
-
* API:
|
|
527
|
-
* - {@link ImageBackgroundProps}
|
|
397
|
+
* @interface ImageBackgroundProps
|
|
528
398
|
*/
|
|
529
399
|
export declare function ImageBackground({ image, imageUrl, onLoad, }: ImageBackgroundProps): JSX_2.Element;
|
|
530
400
|
|
|
@@ -550,35 +420,26 @@ declare interface ImageBackgroundProps {
|
|
|
550
420
|
|
|
551
421
|
/**
|
|
552
422
|
* A controlled and customizable input component with support for labels, prefixes, suffixes, and error states.
|
|
553
|
-
*
|
|
554
|
-
* API:
|
|
555
|
-
* - {@link BaseInputProps}
|
|
556
423
|
*/
|
|
557
424
|
export declare const Input: default_2.ForwardRefExoticComponent<BaseInputProps & default_2.RefAttributes<HTMLInputElement>>;
|
|
558
425
|
|
|
426
|
+
declare type MenuItemType = ActionMenuAction;
|
|
427
|
+
|
|
559
428
|
declare interface MenuProps {
|
|
560
|
-
/**
|
|
561
|
-
|
|
562
|
-
|
|
429
|
+
/** The id of the menu */
|
|
430
|
+
menuId?: string;
|
|
431
|
+
/** Custom trigger component. If not provided, defaults to ellipsis icon */
|
|
563
432
|
renderTrigger?: (triggerProps: TriggerProps) => ReactNode;
|
|
564
|
-
/** Size of the trigger icon
|
|
565
|
-
* @default 24
|
|
566
|
-
*/
|
|
433
|
+
/** Size of the trigger icon */
|
|
567
434
|
size?: number;
|
|
568
|
-
/**
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* - type {@link ActionMenuAction}[]
|
|
572
|
-
*/
|
|
573
|
-
items: ActionMenuAction[];
|
|
574
|
-
/** Whether the menu is disabled
|
|
575
|
-
* @default false
|
|
576
|
-
*/
|
|
435
|
+
/** Array of menu actions/items to display */
|
|
436
|
+
items: MenuItemType[];
|
|
437
|
+
/** Whether the menu is disabled */
|
|
577
438
|
disabled?: boolean;
|
|
578
439
|
/** Callback when menu closes */
|
|
579
440
|
onClose?: () => void;
|
|
580
441
|
/** Test ID for the trigger component */
|
|
581
|
-
|
|
442
|
+
testId?: string;
|
|
582
443
|
/** Test ID for the menu */
|
|
583
444
|
menuTestId?: string;
|
|
584
445
|
/** Callback when a menu item is selected */
|
|
@@ -589,83 +450,106 @@ declare interface MenuProps {
|
|
|
589
450
|
disabledKeys?: string[];
|
|
590
451
|
}
|
|
591
452
|
|
|
592
|
-
|
|
593
|
-
* A component that displays either a popover menu or an action menu
|
|
594
|
-
* depending on the screen size when the menu trigger is pressed.
|
|
595
|
-
*
|
|
596
|
-
* API:
|
|
597
|
-
* - {@link MenuProps}
|
|
598
|
-
*/
|
|
599
|
-
export declare function MenuTrigger({ renderTrigger, size, title, items, disabled, onClose, triggerTestId, menuTestId, onSelectionChange, selectedKey, disabledKeys, }: MenuProps): JSX_2.Element;
|
|
453
|
+
export declare function MenuTrigger({ renderTrigger, menuId, size, items, disabled, onClose, testId: triggerTestId, menuTestId, onSelectionChange, selectedKey, disabledKeys, }: MenuProps): JSX_2.Element;
|
|
600
454
|
|
|
601
455
|
export declare const Modal: (({ isOpen, onClose, title, subtitle, body, children, isOverlay, "data-testid": dataTestId, }: ModalProps) => JSX_2.Element) & {
|
|
602
|
-
/**
|
|
603
|
-
* Renders a h2 styled title
|
|
604
|
-
* */
|
|
605
456
|
Title: ({ children }: {
|
|
606
457
|
children: React.ReactNode;
|
|
607
458
|
}) => JSX_2.Element;
|
|
608
|
-
/**
|
|
609
|
-
* Renders a h3 styled subtitle
|
|
610
|
-
* */
|
|
611
459
|
Subtitle: ({ children }: {
|
|
612
460
|
children: React.ReactNode;
|
|
613
461
|
}) => JSX_2.Element;
|
|
614
|
-
/**
|
|
615
|
-
* Renders a div styled body
|
|
616
|
-
* */
|
|
617
462
|
Body: ({ children }: {
|
|
618
463
|
children: React.ReactNode;
|
|
619
464
|
}) => JSX_2.Element;
|
|
620
|
-
|
|
621
|
-
* Renders a Proton Button action
|
|
622
|
-
* - @prop buttonProps {@link ButtonProps}
|
|
623
|
-
* */
|
|
624
|
-
Action: (buttonProps: ButtonProps) => JSX_2.Element;
|
|
625
|
-
/**
|
|
626
|
-
* Renders a group of Proton Buttons
|
|
627
|
-
* */
|
|
465
|
+
Action: (props: ButtonProps) => JSX_2.Element;
|
|
628
466
|
Actions: ({ children }: {
|
|
629
467
|
children: React.ReactNode;
|
|
630
468
|
}) => JSX_2.Element;
|
|
631
469
|
};
|
|
632
470
|
|
|
633
471
|
declare interface ModalProps {
|
|
634
|
-
/**
|
|
635
|
-
* Optional body text content for the modal
|
|
636
|
-
* */
|
|
637
|
-
body?: string;
|
|
638
|
-
/**
|
|
639
|
-
* Content to render inside the modal
|
|
640
|
-
* */
|
|
641
|
-
children: React.ReactNode;
|
|
642
|
-
/**
|
|
643
|
-
* data-testid for the modal
|
|
644
|
-
* */
|
|
645
|
-
"data-testid"?: string;
|
|
646
472
|
/**
|
|
647
473
|
* Controls the visibility of the modal
|
|
648
474
|
* */
|
|
649
475
|
isOpen: boolean;
|
|
476
|
+
/**
|
|
477
|
+
* Callback function when modal is closed
|
|
478
|
+
* */
|
|
479
|
+
onClose?: () => void;
|
|
650
480
|
/**
|
|
651
481
|
* Whether to show the modal with an overlay background.
|
|
652
482
|
* @default true
|
|
653
483
|
* */
|
|
654
484
|
isOverlay?: boolean;
|
|
655
485
|
/**
|
|
656
|
-
*
|
|
486
|
+
* Optional title text for the modal header
|
|
657
487
|
* */
|
|
658
|
-
|
|
488
|
+
title?: string;
|
|
659
489
|
/**
|
|
660
490
|
* Optional subtitle text below the modal title
|
|
661
491
|
* */
|
|
662
492
|
subtitle?: string;
|
|
663
493
|
/**
|
|
664
|
-
* Optional
|
|
494
|
+
* Optional body text content for the modal
|
|
665
495
|
* */
|
|
666
|
-
|
|
496
|
+
body?: string;
|
|
497
|
+
/**
|
|
498
|
+
* Content to render inside the modal
|
|
499
|
+
* */
|
|
500
|
+
children: React.ReactNode;
|
|
501
|
+
/**
|
|
502
|
+
* data-testid for the modal
|
|
503
|
+
* */
|
|
504
|
+
"data-testid"?: string;
|
|
667
505
|
}
|
|
668
506
|
|
|
507
|
+
declare type Palette = {
|
|
508
|
+
BASE_COLOR: string;
|
|
509
|
+
BRAND: {
|
|
510
|
+
PRIMARY: string;
|
|
511
|
+
PRIMARY_LIGHT: string;
|
|
512
|
+
SECONDARY: string;
|
|
513
|
+
};
|
|
514
|
+
PRIMARY: {
|
|
515
|
+
PRIMARY_SUPER_DARK: string;
|
|
516
|
+
PRIMARY_DARK: string;
|
|
517
|
+
PRIMARY_MEDIUM: string;
|
|
518
|
+
PRIMARY_MEDIUM_LIGHT: string;
|
|
519
|
+
PRIMARY_LIGHT: string;
|
|
520
|
+
PRIMARY_LIGHTEST: string;
|
|
521
|
+
PRIMARY_SUPER_LIGHT: string;
|
|
522
|
+
};
|
|
523
|
+
SECONDARY: {
|
|
524
|
+
SECONDARY_SUPER_DARK: string;
|
|
525
|
+
SECONDARY_DARK: string;
|
|
526
|
+
SECONDARY_MEDIUM: string;
|
|
527
|
+
SECONDARY_MEDIUM_LIGHT: string;
|
|
528
|
+
SECONDARY_LIGHT: string;
|
|
529
|
+
SECONDARY_LIGHTEST: string;
|
|
530
|
+
SECONDARY_SUPER_LIGHT: string;
|
|
531
|
+
};
|
|
532
|
+
SUCCESS: {
|
|
533
|
+
SUCCESS_DARK: string;
|
|
534
|
+
SUCCESS_MEDIUM: string;
|
|
535
|
+
SUCCESS_LIGHT: string;
|
|
536
|
+
SUCCESS_SUPER_LIGHT: string;
|
|
537
|
+
};
|
|
538
|
+
WARNING: {
|
|
539
|
+
WARNING_DARK: string;
|
|
540
|
+
WARNING_MEDIUM: string;
|
|
541
|
+
WARNING_LIGHT: string;
|
|
542
|
+
WARNING_SUPER_LIGHT: string;
|
|
543
|
+
};
|
|
544
|
+
DANGER: {
|
|
545
|
+
DANGER_SUPER_DARK: string;
|
|
546
|
+
DANGER_DARK: string;
|
|
547
|
+
DANGER_MEDIUM: string;
|
|
548
|
+
DANGER_LIGHT: string;
|
|
549
|
+
DANGER_SUPER_LIGHT: string;
|
|
550
|
+
};
|
|
551
|
+
};
|
|
552
|
+
|
|
669
553
|
/**
|
|
670
554
|
* Popover is an unstyled popover component that handles positioning. It should be used
|
|
671
555
|
* with the Dialog component to provide a styled popover.
|
|
@@ -673,109 +557,39 @@ declare interface ModalProps {
|
|
|
673
557
|
* A popover displays interactive content in context with a trigger element.
|
|
674
558
|
* A tooltip displays a description of an element on hover or focus.
|
|
675
559
|
*
|
|
676
|
-
* @
|
|
677
|
-
*
|
|
678
|
-
* API:
|
|
679
|
-
* - {@link PopoverProps}
|
|
680
|
-
* - extends {@link AriaPopoverProps}
|
|
560
|
+
* @interface PopoverProps
|
|
681
561
|
*/
|
|
682
562
|
export declare function Popover({ children, state, arrow, offset, ...props }: PopoverProps): JSX_2.Element;
|
|
683
563
|
|
|
684
564
|
declare interface PopoverProps extends Omit<AriaPopoverProps, "popoverRef"> {
|
|
685
|
-
/**
|
|
686
|
-
* Whether to show an arrow on the popover.
|
|
687
|
-
*/
|
|
688
|
-
arrow?: boolean;
|
|
689
565
|
/**
|
|
690
566
|
* Content to display within the popover.
|
|
691
567
|
*/
|
|
692
568
|
children: default_2.ReactNode;
|
|
569
|
+
/**
|
|
570
|
+
* The `isOpen` state of the popover and the methods to toggle it.
|
|
571
|
+
*/
|
|
572
|
+
state: OverlayTriggerState;
|
|
693
573
|
/**
|
|
694
574
|
* Can optionally forward the ref to the popover.
|
|
695
575
|
*/
|
|
696
576
|
popoverRef?: default_2.RefObject<HTMLDivElement>;
|
|
697
577
|
/**
|
|
698
|
-
*
|
|
699
|
-
* - type {@link OverlayTriggerState}
|
|
578
|
+
* Whether to show an arrow on the popover.
|
|
700
579
|
*/
|
|
701
|
-
|
|
580
|
+
arrow?: boolean;
|
|
702
581
|
}
|
|
703
582
|
|
|
704
|
-
declare type ProtonColorScale = {
|
|
705
|
-
SUPER_DARK: string;
|
|
706
|
-
DARK: string;
|
|
707
|
-
MEDIUM: string;
|
|
708
|
-
MEDIUM_LIGHT: string;
|
|
709
|
-
LIGHT: string;
|
|
710
|
-
LIGHTEST: string;
|
|
711
|
-
SUPER_LIGHT: string;
|
|
712
|
-
WHITE: string;
|
|
713
|
-
};
|
|
714
|
-
|
|
715
583
|
export declare interface ProtonColumnProps<T> extends ColumnProps<T> {
|
|
716
584
|
align?: "left" | "center" | "right";
|
|
717
585
|
onClick?: (key: string) => void;
|
|
718
586
|
}
|
|
719
587
|
|
|
720
|
-
declare type ProtonPalette = {
|
|
721
|
-
BASE_COLOR: string;
|
|
722
|
-
BRAND: {
|
|
723
|
-
PRIMARY: string;
|
|
724
|
-
PRIMARY_LIGHT: string;
|
|
725
|
-
PRIMARY_SUPER_LIGHT: string;
|
|
726
|
-
SECONDARY: string;
|
|
727
|
-
SECONDARY_LIGHT: string;
|
|
728
|
-
SECONDARY_SUPER_LIGHT: string;
|
|
729
|
-
};
|
|
730
|
-
PRIMARY: ProtonColorScale;
|
|
731
|
-
SECONDARY: ProtonColorScale;
|
|
732
|
-
GRAYSCALE: ProtonColorScale;
|
|
733
|
-
};
|
|
734
|
-
|
|
735
588
|
export declare interface ProtonRowProps<T = object> extends RowProps<T> {
|
|
736
589
|
backgroundColor?: string;
|
|
737
590
|
onClick?: (key: string) => void;
|
|
738
591
|
}
|
|
739
592
|
|
|
740
|
-
declare interface ProtonStyleSheet {
|
|
741
|
-
"--proton-control__background-color": string;
|
|
742
|
-
"--proton-control__background-color-light": string;
|
|
743
|
-
"--proton-control__text-color": string;
|
|
744
|
-
"--proton-control__title-color": string;
|
|
745
|
-
"--proton-control__border-color": string;
|
|
746
|
-
"--proton-control__shadow-color": string;
|
|
747
|
-
"--proton-control__hover-color": string;
|
|
748
|
-
"--proton-control__border-radius": string;
|
|
749
|
-
"--proton-control__interactive-color": string;
|
|
750
|
-
"--proton-color__primary": string;
|
|
751
|
-
"--proton-color__primary-light": string;
|
|
752
|
-
"--proton-color__primary-super-light": string;
|
|
753
|
-
"--proton-color__secondary": string;
|
|
754
|
-
"--proton-color__secondary-light": string;
|
|
755
|
-
"--proton-color__secondary-super-light": string;
|
|
756
|
-
"--proton-color__danger-super-dark": string;
|
|
757
|
-
"--proton-color__danger-dark": string;
|
|
758
|
-
"--proton-color__danger-medium": string;
|
|
759
|
-
"--proton-color__danger-light": string;
|
|
760
|
-
"--proton-color__danger-super-light": string;
|
|
761
|
-
"--proton-color__warning-dark": string;
|
|
762
|
-
"--proton-color__warning-medium": string;
|
|
763
|
-
"--proton-color__warning-light": string;
|
|
764
|
-
"--proton-color__warning-super-light": string;
|
|
765
|
-
"--proton-color__success-dark": string;
|
|
766
|
-
"--proton-color__success-medium": string;
|
|
767
|
-
"--proton-color__success-light": string;
|
|
768
|
-
"--proton-color__success-super-light": string;
|
|
769
|
-
"--proton-color__gray-super-dark": string;
|
|
770
|
-
"--proton-color__gray-dark": string;
|
|
771
|
-
"--proton-color__gray-medium": string;
|
|
772
|
-
"--proton-color__gray-medium-light": string;
|
|
773
|
-
"--proton-color__gray-light": string;
|
|
774
|
-
"--proton-color__gray-lightest": string;
|
|
775
|
-
"--proton-color__gray-super-light": string;
|
|
776
|
-
"--proton-color__white": string;
|
|
777
|
-
}
|
|
778
|
-
|
|
779
593
|
export declare interface ProtonTableBodyProps<T = object> extends TableBodyProps<T> {
|
|
780
594
|
showLines?: boolean;
|
|
781
595
|
}
|
|
@@ -784,17 +598,11 @@ export declare const Row: <T = object>(props: ProtonRowProps<T>) => JSX.Element;
|
|
|
784
598
|
|
|
785
599
|
/**
|
|
786
600
|
* Base Overlay component for creating modal-like backgrounds.
|
|
787
|
-
*
|
|
788
|
-
* API:
|
|
789
|
-
* - {@link ScreenOverlayProps}
|
|
601
|
+
* @interface ScreenOverlayProps
|
|
790
602
|
*/
|
|
791
603
|
export declare const ScreenOverlay: ForwardRefExoticComponent<Omit<ScreenOverlayProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
792
604
|
|
|
793
605
|
declare interface ScreenOverlayProps {
|
|
794
|
-
/**
|
|
795
|
-
* Children to render inside the overlay.
|
|
796
|
-
*/
|
|
797
|
-
children?: React.ReactNode;
|
|
798
606
|
/**
|
|
799
607
|
* Whether to fade in the overlay.
|
|
800
608
|
*/
|
|
@@ -807,26 +615,26 @@ declare interface ScreenOverlayProps {
|
|
|
807
615
|
* Ref to the overlay element.
|
|
808
616
|
*/
|
|
809
617
|
ref?: React.RefObject<HTMLDivElement>;
|
|
618
|
+
/**
|
|
619
|
+
* Children to render inside the overlay.
|
|
620
|
+
*/
|
|
621
|
+
children?: React.ReactNode;
|
|
810
622
|
}
|
|
811
623
|
|
|
812
624
|
/**
|
|
813
625
|
* A search input component with optional clear functionality and URL parameter sync.
|
|
814
|
-
*
|
|
815
|
-
* API:
|
|
816
|
-
* - {@link SearchInputProps}
|
|
817
|
-
* - extends {@link BaseInputProps}
|
|
818
626
|
*/
|
|
819
627
|
export declare const SearchInput: ({ name, placeholder, autoComplete, isClearable, isDisabled, error, defaultValue, value: controlledValue, "data-testid": testId, onChange, onClear, }: SearchInputProps) => JSX_2.Element;
|
|
820
628
|
|
|
821
629
|
declare interface SearchInputProps extends Omit<BaseInputProps, "prefix" | "suffix" | "value" | "onChange" | "description" | "descriptionPosition" | "label"> {
|
|
822
|
-
/** The initial value of the input. */
|
|
823
|
-
defaultValue?: string;
|
|
824
630
|
/** Should the clear button be shown when there is text? */
|
|
825
631
|
isClearable?: boolean;
|
|
826
632
|
/** Called when the input value changes. */
|
|
827
633
|
onChange?: (value: string) => void;
|
|
828
634
|
/** Called when the clear button is clicked. */
|
|
829
635
|
onClear?: () => void;
|
|
636
|
+
/** The initial value of the input. */
|
|
637
|
+
defaultValue?: string;
|
|
830
638
|
/** The current value of the input (for controlled usage) */
|
|
831
639
|
value?: string;
|
|
832
640
|
}
|
|
@@ -836,16 +644,9 @@ export { Section }
|
|
|
836
644
|
/**
|
|
837
645
|
* A dropdown select menu that opens a popover on desktop and an action menu on mobile.
|
|
838
646
|
* Supports controlled and uncontrolled modes.
|
|
839
|
-
*
|
|
840
|
-
* API:
|
|
841
|
-
* - {@link SelectProps}
|
|
842
647
|
*/
|
|
843
648
|
export declare function Select({ label, name, isDisabled, disabledKeys, selectedKey, onSelectionChange, defaultSelectedKey, onOpen, onClose, items, "data-testid": testId, }: SelectProps): JSX_2.Element;
|
|
844
649
|
|
|
845
|
-
export declare namespace Select {
|
|
846
|
-
var displayName: string;
|
|
847
|
-
}
|
|
848
|
-
|
|
849
650
|
declare interface SelectItem {
|
|
850
651
|
label: string;
|
|
851
652
|
key: string;
|
|
@@ -853,42 +654,36 @@ declare interface SelectItem {
|
|
|
853
654
|
}
|
|
854
655
|
|
|
855
656
|
declare interface SelectProps {
|
|
657
|
+
/** The name of the select field */
|
|
658
|
+
name: string;
|
|
659
|
+
/** Label to display above the select
|
|
660
|
+
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#text
|
|
661
|
+
*/
|
|
662
|
+
label?: string;
|
|
663
|
+
/** Whether the select is disabled */
|
|
664
|
+
isDisabled?: boolean;
|
|
856
665
|
/** Array of keys that should be disabled
|
|
857
666
|
* @example ["Thing 1", "Thing 2"]
|
|
858
667
|
*/
|
|
859
668
|
disabledKeys?: string[];
|
|
669
|
+
/** Currently selected key */
|
|
670
|
+
selectedKey?: string;
|
|
671
|
+
/** Callback fired when selection changes */
|
|
672
|
+
onSelectionChange?: (key: string) => void;
|
|
860
673
|
/** The key of the default selected item */
|
|
861
674
|
defaultSelectedKey?: string;
|
|
862
|
-
/**
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
|
|
675
|
+
/** Callback fired when the menu opens */
|
|
676
|
+
onOpen?: () => void;
|
|
677
|
+
/** Callback fired when the menu closes */
|
|
678
|
+
onClose?: () => void;
|
|
866
679
|
/** Array of items to display
|
|
867
680
|
* @example [{ key: "thing-1", label: "Thing 1" }, { key: "thing-2", label: "Thing 2" }]
|
|
868
681
|
*/
|
|
869
682
|
items: SelectItem[];
|
|
870
|
-
/**
|
|
871
|
-
|
|
872
|
-
*/
|
|
873
|
-
label?: string;
|
|
874
|
-
/** The name of the select field */
|
|
875
|
-
name: string;
|
|
876
|
-
/** Callback fired when the menu closes */
|
|
877
|
-
onClose?: () => void;
|
|
878
|
-
/** Callback fired when the menu opens */
|
|
879
|
-
onOpen?: () => void;
|
|
880
|
-
/** Callback fired when selection changes */
|
|
881
|
-
onSelectionChange?: (key: string) => void;
|
|
882
|
-
/** Currently selected key */
|
|
883
|
-
selectedKey?: string;
|
|
683
|
+
/** Test ID for the select */
|
|
684
|
+
"data-testid"?: string;
|
|
884
685
|
}
|
|
885
686
|
|
|
886
|
-
/**
|
|
887
|
-
* A toggle switch component for boolean state control with support for controlled and uncontrolled modes.
|
|
888
|
-
*
|
|
889
|
-
* API:
|
|
890
|
-
* - {@link SwitchProps}
|
|
891
|
-
*/
|
|
892
687
|
export declare function Switch(props: SwitchProps): JSX_2.Element;
|
|
893
688
|
|
|
894
689
|
declare interface SwitchProps {
|
|
@@ -919,14 +714,6 @@ declare interface SwitchProps {
|
|
|
919
714
|
children?: React.ReactNode;
|
|
920
715
|
}
|
|
921
716
|
|
|
922
|
-
/**
|
|
923
|
-
* A table component that displays data in a grid format.
|
|
924
|
-
*
|
|
925
|
-
* API:
|
|
926
|
-
* - {@link TableProps}
|
|
927
|
-
* - extends {@link AriaTableProps}
|
|
928
|
-
* - extends {@link TableStateProps}<object>
|
|
929
|
-
*/
|
|
930
717
|
export declare function Table(props: TableProps): JSX_2.Element;
|
|
931
718
|
|
|
932
719
|
export declare const TableBody: <T = object>(props: ProtonTableBodyProps<T>) => JSX.Element;
|
|
@@ -941,9 +728,7 @@ declare interface TableProps extends AriaTableProps, TableStateProps<object> {
|
|
|
941
728
|
|
|
942
729
|
/**
|
|
943
730
|
* A component that displays text with an ellipsis when it overflows its container.
|
|
944
|
-
*
|
|
945
|
-
* API:
|
|
946
|
-
* - {@link TextEllipsisProps}
|
|
731
|
+
* @interface TextEllipsisProps
|
|
947
732
|
*/
|
|
948
733
|
export declare const TextEllipsis: ({ children, maxWidth, singleLine, lines, title, "data-testid": testId, }: TextEllipsisProps) => JSX_2.Element;
|
|
949
734
|
|
|
@@ -980,10 +765,7 @@ declare interface TextEllipsisProps {
|
|
|
980
765
|
|
|
981
766
|
/**
|
|
982
767
|
* A component that displays text with emphasis. Provide tooltipProps to wrap the text in a tooltip trigger.
|
|
983
|
-
*
|
|
984
|
-
* API:
|
|
985
|
-
* - {@link TextEmphasisProps}
|
|
986
|
-
* - extends {@link React.HTMLAttributes}
|
|
768
|
+
* @interface TextEmphasisProps
|
|
987
769
|
*/
|
|
988
770
|
export declare const TextEmphasis: ({ to, children, tooltipProps, "data-testid": testId, }: TextEmphasisProps) => JSX_2.Element;
|
|
989
771
|
|
|
@@ -1011,9 +793,8 @@ declare type Theme = (typeof THEMES)[keyof typeof THEMES];
|
|
|
1011
793
|
declare interface ThemeContextType {
|
|
1012
794
|
theme: Theme;
|
|
1013
795
|
className: string;
|
|
1014
|
-
style:
|
|
1015
|
-
palette:
|
|
1016
|
-
hasPalette?: boolean;
|
|
796
|
+
style: ThemeVariables;
|
|
797
|
+
palette: Palette;
|
|
1017
798
|
}
|
|
1018
799
|
|
|
1019
800
|
export declare const ThemeProvider: default_2.FC<ThemeProviderProps>;
|
|
@@ -1021,40 +802,66 @@ export declare const ThemeProvider: default_2.FC<ThemeProviderProps>;
|
|
|
1021
802
|
declare interface ThemeProviderProps {
|
|
1022
803
|
theme: Theme;
|
|
1023
804
|
children: ReactNode;
|
|
1024
|
-
palette?:
|
|
805
|
+
palette?: Palette;
|
|
1025
806
|
}
|
|
1026
807
|
|
|
1027
808
|
declare const THEMES: {
|
|
1028
809
|
readonly DARK: "dark";
|
|
810
|
+
readonly CUSTOM_DARK: "custom-dark";
|
|
1029
811
|
readonly LIGHT: "light";
|
|
1030
812
|
};
|
|
1031
813
|
|
|
814
|
+
declare interface ThemeVariables {
|
|
815
|
+
"--proton-control__background-color": string;
|
|
816
|
+
"--proton-control__background-color-light": string;
|
|
817
|
+
"--proton-control__text-color": string;
|
|
818
|
+
"--proton-control__border-color": string;
|
|
819
|
+
"--proton-control__shadow-color": string;
|
|
820
|
+
"--proton-color__primary": string;
|
|
821
|
+
"--proton-color__primary-light": string;
|
|
822
|
+
"--proton-color__secondary": string;
|
|
823
|
+
"--proton-control__primary-super-dark": string;
|
|
824
|
+
"--proton-control__primary-dark": string;
|
|
825
|
+
"--proton-control__primary-medium": string;
|
|
826
|
+
"--proton-control__primary-medium-light": string;
|
|
827
|
+
"--proton-control__primary-light": string;
|
|
828
|
+
"--proton-control__primary-lightest": string;
|
|
829
|
+
"--proton-control__primary-super-light": string;
|
|
830
|
+
"--proton-control__secondary-super-dark": string;
|
|
831
|
+
"--proton-control__secondary-dark": string;
|
|
832
|
+
"--proton-control__secondary-medium": string;
|
|
833
|
+
"--proton-control__secondary-medium-light": string;
|
|
834
|
+
"--proton-control__secondary-light": string;
|
|
835
|
+
"--proton-control__secondary-lightest": string;
|
|
836
|
+
"--proton-control__secondary-super-light": string;
|
|
837
|
+
}
|
|
838
|
+
|
|
1032
839
|
/**
|
|
1033
|
-
* A component that displays a loading tombstone. For use as a placeholder while loading content
|
|
1034
|
-
*
|
|
1035
|
-
* API:
|
|
1036
|
-
* - {@link TombstoneProps}
|
|
840
|
+
* A component that displays a loading tombstone. For use as a placeholder while loading content
|
|
841
|
+
* @interface TombstoneProps
|
|
1037
842
|
*/
|
|
1038
843
|
export declare const Tombstone: ({ width, height, borderRadius, }: TombstoneProps) => JSX_2.Element;
|
|
1039
844
|
|
|
1040
845
|
declare interface TombstoneProps {
|
|
1041
846
|
/**
|
|
1042
|
-
* The
|
|
1043
|
-
* @default "
|
|
847
|
+
* The width of the tombstone.
|
|
848
|
+
* @default "100%"
|
|
1044
849
|
*/
|
|
1045
|
-
|
|
850
|
+
width?: string;
|
|
1046
851
|
/**
|
|
1047
852
|
* The height of the tombstone.
|
|
1048
853
|
* @default "1.5rem"
|
|
1049
854
|
*/
|
|
1050
855
|
height?: string;
|
|
1051
856
|
/**
|
|
1052
|
-
* The
|
|
1053
|
-
* @default "
|
|
857
|
+
* The border radius of the tombstone.
|
|
858
|
+
* @default "4px"
|
|
1054
859
|
*/
|
|
1055
|
-
|
|
860
|
+
borderRadius?: string;
|
|
1056
861
|
}
|
|
1057
862
|
|
|
863
|
+
export declare function Tooltip({ children, arrow, ...props }: TooltipProps): JSX_2.Element;
|
|
864
|
+
|
|
1058
865
|
export declare interface TooltipProps extends Omit<TooltipProps_2, "children"> {
|
|
1059
866
|
children: React.ReactNode;
|
|
1060
867
|
arrow?: boolean;
|
|
@@ -1067,18 +874,6 @@ export declare interface TooltipProps extends Omit<TooltipProps_2, "children"> {
|
|
|
1067
874
|
*
|
|
1068
875
|
* If you wish to disable the trigger click feature, you can set the `disableTriggerClick` prop.
|
|
1069
876
|
* This is useful when using an info only Tooltip that might wrap a clickable element.
|
|
1070
|
-
*
|
|
1071
|
-
* API:
|
|
1072
|
-
* - {@link TooltipTriggerProps}
|
|
1073
|
-
* - extends {@link TooltipProps}
|
|
1074
|
-
* - extends {@link TooltipTriggerComponentProps}
|
|
1075
|
-
*
|
|
1076
|
-
* @example
|
|
1077
|
-
* ```tsx
|
|
1078
|
-
<TooltipTrigger content={...} placement="top" arrow isDisabled={disabled}>
|
|
1079
|
-
{children}
|
|
1080
|
-
</TooltipTrigger>
|
|
1081
|
-
* ```
|
|
1082
877
|
*/
|
|
1083
878
|
export declare function TooltipTrigger({ children, delay, closeDelay, isDisabled, defaultOpen, onOpenChange, disableTriggerClick, content, ...tooltipProps }: TooltipTriggerProps): JSX_2.Element;
|
|
1084
879
|
|
|
@@ -1094,46 +889,23 @@ export declare interface TooltipTriggerProps extends TooltipProps, TooltipTrigge
|
|
|
1094
889
|
disableTriggerClick?: boolean;
|
|
1095
890
|
}
|
|
1096
891
|
|
|
892
|
+
/**
|
|
893
|
+
* A component that displays either a popover menu or an action menu
|
|
894
|
+
* depending on the screen size when the menu trigger is pressed.
|
|
895
|
+
*
|
|
896
|
+
* @param {MenuProps} props - The props for the MenuTrigger component.
|
|
897
|
+
* @returns {JSX.Element} - The MenuTrigger component.
|
|
898
|
+
*/
|
|
1097
899
|
declare interface TriggerProps {
|
|
1098
900
|
disabled?: boolean;
|
|
901
|
+
pressProps: PressProps;
|
|
1099
902
|
isOpen?: boolean;
|
|
1100
|
-
setIsOpen?: (isOpen: boolean) => void;
|
|
1101
903
|
triggerRef: React.RefObject<HTMLButtonElement>;
|
|
1102
904
|
}
|
|
1103
905
|
|
|
1104
906
|
/**
|
|
1105
907
|
* Hook for creating a popover trigger. This hook manages the state and events for the popover
|
|
1106
908
|
* and popover trigger. For examples see Popover.stories.tsx.
|
|
1107
|
-
*
|
|
1108
|
-
* API:
|
|
1109
|
-
* - {@link OverlayTriggerProps}
|
|
1110
|
-
*
|
|
1111
|
-
* @example
|
|
1112
|
-
* ```tsx
|
|
1113
|
-
* let { buttonProps, overlayProps, buttonRef, state } = usePopoverTrigger();
|
|
1114
|
-
*
|
|
1115
|
-
* return (
|
|
1116
|
-
* <div>
|
|
1117
|
-
* <button {...buttonProps} ref={buttonRef}>
|
|
1118
|
-
* Trigger
|
|
1119
|
-
* </button>
|
|
1120
|
-
*
|
|
1121
|
-
* {state.isOpen && (
|
|
1122
|
-
* <Popover
|
|
1123
|
-
* state={state}
|
|
1124
|
-
* triggerRef={buttonRef}
|
|
1125
|
-
* arrow={props.arrow}
|
|
1126
|
-
* offset={props.offset}
|
|
1127
|
-
* placement={props.placement}
|
|
1128
|
-
* >
|
|
1129
|
-
* <Dialog {...overlayProps} title="Popover">
|
|
1130
|
-
* Here is some popover content
|
|
1131
|
-
* </Dialog>
|
|
1132
|
-
* </Popover>
|
|
1133
|
-
* )}
|
|
1134
|
-
* </div>
|
|
1135
|
-
* );
|
|
1136
|
-
* ```
|
|
1137
909
|
*/
|
|
1138
910
|
export declare function usePopoverTrigger(props?: OverlayTriggerProps): {
|
|
1139
911
|
buttonProps: default_2.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
@@ -1147,8 +919,10 @@ export declare const useTheme: () => ThemeContextType;
|
|
|
1147
919
|
/**
|
|
1148
920
|
* A waveform visualization component that displays audio data with interactive features.
|
|
1149
921
|
*
|
|
1150
|
-
*
|
|
1151
|
-
*
|
|
922
|
+
* @component
|
|
923
|
+
* @interface WaveformProps
|
|
924
|
+
*
|
|
925
|
+
* @returns {JSX.Element} A waveform visualization with optional timestamps and interactive features
|
|
1152
926
|
*/
|
|
1153
927
|
export declare function Waveform({ data: waveformData, resolution, startDuration, endDuration, currentTime, showTimestamps, totalDuration, disabled, disabledMessage, onClick, "data-testid": testId, }: WaveformProps): JSX_2.Element;
|
|
1154
928
|
|
|
@@ -1158,14 +932,6 @@ declare interface WaveformProps {
|
|
|
1158
932
|
* If not provided, uses a sample sine wave.
|
|
1159
933
|
*/
|
|
1160
934
|
data?: number[];
|
|
1161
|
-
/**
|
|
1162
|
-
* Current playback position in seconds.
|
|
1163
|
-
*/
|
|
1164
|
-
currentTime?: number;
|
|
1165
|
-
/**
|
|
1166
|
-
* Test ID for testing purposes.
|
|
1167
|
-
*/
|
|
1168
|
-
"data-testid"?: string;
|
|
1169
935
|
/**
|
|
1170
936
|
* Whether the entire waveform is disabled.
|
|
1171
937
|
*/
|
|
@@ -1175,29 +941,42 @@ declare interface WaveformProps {
|
|
|
1175
941
|
*/
|
|
1176
942
|
disabledMessage?: string;
|
|
1177
943
|
/**
|
|
1178
|
-
*
|
|
944
|
+
* Total duration of the audio in seconds.
|
|
1179
945
|
*/
|
|
1180
|
-
|
|
946
|
+
totalDuration: number;
|
|
1181
947
|
/**
|
|
1182
|
-
*
|
|
948
|
+
* Current playback position in seconds.
|
|
1183
949
|
*/
|
|
1184
|
-
|
|
950
|
+
currentTime?: number;
|
|
1185
951
|
/**
|
|
1186
952
|
* Width in pixels of each waveform bar.
|
|
1187
953
|
*/
|
|
1188
954
|
resolution?: number;
|
|
955
|
+
/**
|
|
956
|
+
* Start time to display from in seconds.
|
|
957
|
+
*/
|
|
958
|
+
startDuration?: number;
|
|
959
|
+
/**
|
|
960
|
+
* End time to display until in seconds.
|
|
961
|
+
*/
|
|
962
|
+
endDuration?: number;
|
|
1189
963
|
/**
|
|
1190
964
|
* Whether to show timestamp markers.
|
|
1191
965
|
*/
|
|
1192
966
|
showTimestamps?: boolean;
|
|
1193
967
|
/**
|
|
1194
|
-
*
|
|
968
|
+
* Click handler that receives the clicked position (0-1) and event.
|
|
1195
969
|
*/
|
|
1196
|
-
|
|
970
|
+
onClick?: (position: number, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
1197
971
|
/**
|
|
1198
|
-
*
|
|
972
|
+
* Test ID for testing purposes.
|
|
1199
973
|
*/
|
|
1200
|
-
|
|
974
|
+
"data-testid"?: string;
|
|
1201
975
|
}
|
|
1202
976
|
|
|
1203
977
|
export { }
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
declare namespace ButtonGroup {
|
|
981
|
+
var Option: (props: ButtonGroupOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
982
|
+
}
|