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