@hubspot/ui-extensions 0.7.3 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/dist/types.d.ts +1092 -23
- package/dist/types.js +3 -0
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,183 +1,802 @@
|
|
|
1
1
|
import { ReactNode, ComponentType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The props type for {@link !components.Alert}.
|
|
4
|
+
*
|
|
5
|
+
* @category Component Props
|
|
6
|
+
*/
|
|
2
7
|
export interface AlertProps {
|
|
8
|
+
/**
|
|
9
|
+
* The bolded title text of the alert.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
3
12
|
title: string;
|
|
13
|
+
/**
|
|
14
|
+
* The main content of the alert message.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
4
17
|
children?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* The color of the alert.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue `"info"`
|
|
22
|
+
*/
|
|
5
23
|
variant?: 'info' | 'warning' | 'success' | 'error' | 'danger';
|
|
6
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* The props type for {@link !components.Button}.
|
|
27
|
+
*
|
|
28
|
+
* @category Component Props
|
|
29
|
+
*/
|
|
7
30
|
export interface ButtonProps {
|
|
31
|
+
/**
|
|
32
|
+
* A function that will be invoked when the button is clicked. It receives no arguments and its return value is ignored.
|
|
33
|
+
*
|
|
34
|
+
* @event
|
|
35
|
+
*/
|
|
8
36
|
onClick?: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* A URL that will be opened when the button is clicked. If the value is a URL external to `hubspot.com` it will be opened in a new tab.
|
|
39
|
+
*/
|
|
9
40
|
href?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Determines whether or not the button should be disabled.
|
|
43
|
+
*/
|
|
10
44
|
disabled?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the color variation of the button.
|
|
47
|
+
*
|
|
48
|
+
* @defaultValue `"secondary"`
|
|
49
|
+
*/
|
|
11
50
|
variant?: 'primary' | 'secondary' | 'destructive';
|
|
51
|
+
/**
|
|
52
|
+
* Sets the HTML attribute "role" of the button.
|
|
53
|
+
*
|
|
54
|
+
* @defaultValue `"button"`
|
|
55
|
+
*/
|
|
12
56
|
type?: 'button' | 'reset' | 'submit';
|
|
57
|
+
/**
|
|
58
|
+
* The displayable text for the Button.
|
|
59
|
+
*/
|
|
13
60
|
children: ReactNode;
|
|
14
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* The props type for {@link !components.ButtonRow}.
|
|
64
|
+
*
|
|
65
|
+
* @category Component Props
|
|
66
|
+
*/
|
|
15
67
|
export interface ButtonRowProps {
|
|
68
|
+
/**
|
|
69
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
70
|
+
*/
|
|
16
71
|
children: ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Disables the dropdown list of buttons that appears when the children expand beyond the horizontal space.
|
|
74
|
+
*
|
|
75
|
+
* @defaultValue `false`
|
|
76
|
+
*/
|
|
17
77
|
disableDropdown?: boolean;
|
|
18
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* The props type for {@link !components.Card}.
|
|
81
|
+
*
|
|
82
|
+
* @category Component Props
|
|
83
|
+
*/
|
|
19
84
|
export interface CardProps {
|
|
85
|
+
/**
|
|
86
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
87
|
+
*/
|
|
20
88
|
children: ReactNode;
|
|
21
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The props type for {@link !components.DescriptionListItem}.
|
|
92
|
+
*
|
|
93
|
+
* @category Component Props
|
|
94
|
+
*/
|
|
22
95
|
export interface DescriptionListItemProps {
|
|
96
|
+
/**
|
|
97
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
98
|
+
*
|
|
99
|
+
*/
|
|
23
100
|
children: ReactNode;
|
|
101
|
+
/**
|
|
102
|
+
* Text to be displayed as the label.
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
24
105
|
label: string;
|
|
25
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* The props type for {@link !components.DescriptionList}.
|
|
109
|
+
*
|
|
110
|
+
* @category Component Props
|
|
111
|
+
*/
|
|
26
112
|
export interface DescriptionListProps {
|
|
113
|
+
/**
|
|
114
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. The children should be {@link !components.DescriptionListItem}.
|
|
115
|
+
*
|
|
116
|
+
*/
|
|
27
117
|
children: ReactNode;
|
|
118
|
+
/**
|
|
119
|
+
* The direction the label/value pairs are placed in the description list container.
|
|
120
|
+
*
|
|
121
|
+
* @defaultValue `"column"`
|
|
122
|
+
*/
|
|
28
123
|
direction?: 'row' | 'column';
|
|
29
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* The props type for {@link !components.Divider}.
|
|
127
|
+
*
|
|
128
|
+
* @category Component Props
|
|
129
|
+
*/
|
|
30
130
|
export interface DividerProps {
|
|
131
|
+
/**
|
|
132
|
+
* The space between the divider and the content above and below it.
|
|
133
|
+
*
|
|
134
|
+
* @defaultValue `"small"`
|
|
135
|
+
*/
|
|
31
136
|
distance?: AllDistances;
|
|
32
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* The props type for {@link !components.EmptyState}.
|
|
140
|
+
*
|
|
141
|
+
* @category Component Props
|
|
142
|
+
*/
|
|
33
143
|
export interface EmptyStateProps {
|
|
144
|
+
/**
|
|
145
|
+
* When set to `true`, removes the default vertical margins in the component.
|
|
146
|
+
*
|
|
147
|
+
* @defaultValue `false`
|
|
148
|
+
*/
|
|
34
149
|
flush?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
152
|
+
*
|
|
153
|
+
*/
|
|
35
154
|
children: ReactNode;
|
|
155
|
+
/**
|
|
156
|
+
* The text for the title header.
|
|
157
|
+
*
|
|
158
|
+
* @defaultValue `"All is not lost."`
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
36
161
|
title?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Sets the layout direction for the content. Can be either `horizontal` or `vertical`.
|
|
164
|
+
*
|
|
165
|
+
* @defaultValue `"horizontal"`
|
|
166
|
+
*/
|
|
37
167
|
layout?: 'horizontal' | 'vertical';
|
|
168
|
+
/**
|
|
169
|
+
* When set to `true`, swaps the visual order of the text (primary) and image (secondary) content. This ensures the primary content is still presented first to assistive technology.
|
|
170
|
+
*
|
|
171
|
+
* @defaultValue `false`
|
|
172
|
+
*/
|
|
38
173
|
reverseOrder?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* The max-width(in pixels) for the image container.
|
|
176
|
+
*
|
|
177
|
+
* @defaultValue `250`
|
|
178
|
+
*/
|
|
39
179
|
imageWidth?: number;
|
|
40
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* The props type for {@link !components.ErrorState}.
|
|
183
|
+
*
|
|
184
|
+
* @category Component Props
|
|
185
|
+
*/
|
|
41
186
|
export interface ErrorStateProps {
|
|
187
|
+
/**
|
|
188
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
189
|
+
*
|
|
190
|
+
*/
|
|
42
191
|
children: ReactNode;
|
|
192
|
+
/**
|
|
193
|
+
* The text of the title header.
|
|
194
|
+
*
|
|
195
|
+
*/
|
|
43
196
|
title?: string;
|
|
197
|
+
/**
|
|
198
|
+
* The type of error image that will be shown.
|
|
199
|
+
*
|
|
200
|
+
* @defaultValue `"error"`
|
|
201
|
+
*/
|
|
44
202
|
type?: 'error' | 'support' | 'lock';
|
|
45
203
|
}
|
|
46
204
|
export type FormInputValues = Record<string, string | number>;
|
|
205
|
+
/**
|
|
206
|
+
* The props type for {@link !components.Form}.
|
|
207
|
+
*
|
|
208
|
+
* @category Component Props
|
|
209
|
+
*/
|
|
47
210
|
export interface FormProps {
|
|
211
|
+
/**
|
|
212
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
213
|
+
*
|
|
214
|
+
*/
|
|
48
215
|
children: ReactNode;
|
|
216
|
+
/**
|
|
217
|
+
* The function that is called when the form is submitted. It will receive a RemoteEvent as an argument and its return value will be ignored.
|
|
218
|
+
*
|
|
219
|
+
* @event
|
|
220
|
+
*/
|
|
49
221
|
onSubmit?: (event: RemoteEvent<FormInputValues>) => void;
|
|
222
|
+
/**
|
|
223
|
+
* When set to `true`, `event.preventDefault()` will be invoked before the `onSubmit` function is called, preventing the default HTML form behavior.
|
|
224
|
+
*
|
|
225
|
+
* @defaultValue `false`
|
|
226
|
+
*/
|
|
50
227
|
preventDefault?: boolean;
|
|
51
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* The props type for {@link !components.Heading}.
|
|
231
|
+
*
|
|
232
|
+
* @category Component Props
|
|
233
|
+
*/
|
|
52
234
|
export interface HeadingProps {
|
|
235
|
+
/**
|
|
236
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
237
|
+
*
|
|
238
|
+
*/
|
|
53
239
|
children: ReactNode;
|
|
240
|
+
/**
|
|
241
|
+
* When set to true, text will not line break.
|
|
242
|
+
*
|
|
243
|
+
* @defaultValue `false`
|
|
244
|
+
*/
|
|
54
245
|
inline?: boolean;
|
|
55
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* The props type for {@link !components.Image}.
|
|
249
|
+
*
|
|
250
|
+
* @category Component Props
|
|
251
|
+
*/
|
|
56
252
|
export interface ImageProps {
|
|
253
|
+
/**
|
|
254
|
+
* The alt text for the image.
|
|
255
|
+
*
|
|
256
|
+
*/
|
|
57
257
|
alt?: string;
|
|
258
|
+
/**
|
|
259
|
+
* If provided, will be used as the href that will be opened in a new browser tab on click.
|
|
260
|
+
*
|
|
261
|
+
*/
|
|
58
262
|
href?: string;
|
|
263
|
+
/**
|
|
264
|
+
* A function that will be called when the image is clicked. This function will receive no arguments and any returned values will be ignored.
|
|
265
|
+
*
|
|
266
|
+
* @event
|
|
267
|
+
*/
|
|
59
268
|
onClick?: () => void;
|
|
269
|
+
/**
|
|
270
|
+
* The URL of the image to display.
|
|
271
|
+
*
|
|
272
|
+
*/
|
|
60
273
|
src: string;
|
|
274
|
+
/**
|
|
275
|
+
* The pixel width of the image.
|
|
276
|
+
*
|
|
277
|
+
*/
|
|
61
278
|
width?: number;
|
|
279
|
+
/**
|
|
280
|
+
* The pixel height of the image.
|
|
281
|
+
*
|
|
282
|
+
*/
|
|
62
283
|
height?: number;
|
|
63
284
|
}
|
|
285
|
+
/**
|
|
286
|
+
* Generic collection of props for all inputs
|
|
287
|
+
* @internal
|
|
288
|
+
* */
|
|
64
289
|
interface BaseInputProps<T = string, V = string> {
|
|
290
|
+
/**
|
|
291
|
+
* The label text to display for the form input element.
|
|
292
|
+
*/
|
|
65
293
|
label: string;
|
|
294
|
+
/**
|
|
295
|
+
* The unique identifier for the input element, this could be thought of as the HTML5 [Input element's name attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name).
|
|
296
|
+
*/
|
|
66
297
|
name: string;
|
|
298
|
+
/**
|
|
299
|
+
* The value of the input.
|
|
300
|
+
*/
|
|
67
301
|
value?: T;
|
|
302
|
+
/**
|
|
303
|
+
* Determines if the required indicator should be displayed.
|
|
304
|
+
*
|
|
305
|
+
* @defaultValue `false`
|
|
306
|
+
*/
|
|
68
307
|
required?: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Determines if the field is editable or not.
|
|
310
|
+
*
|
|
311
|
+
* @defaultValue `false`
|
|
312
|
+
*/
|
|
69
313
|
readOnly?: boolean;
|
|
314
|
+
/**
|
|
315
|
+
* Instructional message to display to the user to help understand the purpose of the input.
|
|
316
|
+
*/
|
|
70
317
|
description?: string;
|
|
318
|
+
/**
|
|
319
|
+
* Text that will appear in a tooltip next to the input label.
|
|
320
|
+
*/
|
|
71
321
|
tooltip?: string;
|
|
322
|
+
/**
|
|
323
|
+
* Text that appears in the input when it has no value set.
|
|
324
|
+
*/
|
|
72
325
|
placeholder?: string;
|
|
326
|
+
/**
|
|
327
|
+
* If set to `true`, `validationMessage` is displayed as an error message, if it was provided. The input will also render its error state to let the user know there is an error. If set to `false`, `validationMessage` is displayed as a success message.
|
|
328
|
+
*
|
|
329
|
+
* @defaultValue `false`
|
|
330
|
+
*/
|
|
73
331
|
error?: boolean;
|
|
332
|
+
/**
|
|
333
|
+
* The value of the input on the first render.
|
|
334
|
+
*/
|
|
74
335
|
defaultValue?: T;
|
|
336
|
+
/**
|
|
337
|
+
* The text to show under the input for error or success validations.
|
|
338
|
+
*/
|
|
75
339
|
validationMessage?: string;
|
|
340
|
+
/**
|
|
341
|
+
* A callback function that is invoked when the value is committed. Currently these times are `onBlur` of the input and when the user submits the form.
|
|
342
|
+
*
|
|
343
|
+
* @event
|
|
344
|
+
*/
|
|
76
345
|
onChange?: (value: V) => void;
|
|
346
|
+
/**
|
|
347
|
+
* A function that is called and passed the value every time the field is edited by the user. It is recommended that you do not use this value to update state, that is what `onChange` should be used for. Instead this should be used for validation.
|
|
348
|
+
*
|
|
349
|
+
* @event
|
|
350
|
+
*/
|
|
77
351
|
onInput?: (value: V) => void;
|
|
352
|
+
/**
|
|
353
|
+
* A function that is called and passed the value every time the field loses focus.
|
|
354
|
+
*
|
|
355
|
+
* @event
|
|
356
|
+
*/
|
|
78
357
|
onBlur?: (value: V) => void;
|
|
358
|
+
/**
|
|
359
|
+
* A function that is called and passed the value every time the field gets focused.
|
|
360
|
+
*
|
|
361
|
+
* @event
|
|
362
|
+
*/
|
|
79
363
|
onFocus?: (value: V) => void;
|
|
80
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* The props type for {@link !components.Input}.
|
|
367
|
+
*
|
|
368
|
+
* @interface
|
|
369
|
+
* @category Component Props
|
|
370
|
+
*/
|
|
81
371
|
export type InputProps = BaseInputProps;
|
|
372
|
+
/**
|
|
373
|
+
* The props type for {@link !components.TextArea}.
|
|
374
|
+
*
|
|
375
|
+
* @category Component Props
|
|
376
|
+
*/
|
|
82
377
|
export interface TextAreaProps extends BaseInputProps {
|
|
378
|
+
/**
|
|
379
|
+
* The visible width of the text field in average character widths.
|
|
380
|
+
*/
|
|
83
381
|
cols?: number;
|
|
382
|
+
/**
|
|
383
|
+
* The maximum number of characters (UTF-16 code units) that the user can enter. If not specified, the max length is unlimited.
|
|
384
|
+
*/
|
|
84
385
|
maxLength?: number;
|
|
386
|
+
/**
|
|
387
|
+
* The number of visible text lines for the text field.
|
|
388
|
+
*/
|
|
85
389
|
rows?: number;
|
|
390
|
+
/**
|
|
391
|
+
* Sets whether the element is resizable, and if so in which directions.
|
|
392
|
+
*
|
|
393
|
+
* @defaultValue `"both"`
|
|
394
|
+
*/
|
|
86
395
|
resize?: 'vertical' | 'horizontal' | 'both' | 'none';
|
|
87
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* Textarea was changed to TextArea. Exporting both for backwards compat
|
|
399
|
+
*
|
|
400
|
+
* @ignore
|
|
401
|
+
* @internal
|
|
402
|
+
* */
|
|
88
403
|
export type TextareaProps = TextAreaProps;
|
|
89
|
-
|
|
404
|
+
/**
|
|
405
|
+
* @internal
|
|
406
|
+
* @ignore
|
|
407
|
+
* */
|
|
408
|
+
type BaseInputForNumber = Omit<BaseInputProps<number, number>, 'onInput'>;
|
|
409
|
+
/**
|
|
410
|
+
* The props type for {@link !components.NumberInput}.
|
|
411
|
+
*
|
|
412
|
+
* @category Component Props
|
|
413
|
+
*/
|
|
414
|
+
export interface NumberInputProps extends BaseInputForNumber {
|
|
415
|
+
/**
|
|
416
|
+
* Sets the lower bound of the input.
|
|
417
|
+
*
|
|
418
|
+
*/
|
|
90
419
|
min?: number;
|
|
420
|
+
/**
|
|
421
|
+
* Sets the upper bound of the input.
|
|
422
|
+
*
|
|
423
|
+
*/
|
|
91
424
|
max?: number;
|
|
425
|
+
/**
|
|
426
|
+
* Sets the number of digits to the right of the decimal point.
|
|
427
|
+
*
|
|
428
|
+
*/
|
|
92
429
|
precision?: number;
|
|
430
|
+
/**
|
|
431
|
+
* Formats the input as a decimal point (decimal) or percentage (percentage).
|
|
432
|
+
*
|
|
433
|
+
* @defaultValue `"decimal"`
|
|
434
|
+
*/
|
|
93
435
|
formatStyle?: 'decimal' | 'percentage';
|
|
94
436
|
/** @deprecated use onChange instead. It doesn't guarantee valid format */
|
|
95
437
|
onInput?: (value: number) => void;
|
|
96
438
|
}
|
|
439
|
+
/** Object that represents dates. */
|
|
97
440
|
export interface BaseDate {
|
|
441
|
+
/** the four-digit year (e.g., 2023). */
|
|
98
442
|
year: number;
|
|
443
|
+
/** starting at 0, the number of the month (e.g., 0 = January, 11 = December). */
|
|
99
444
|
month: number;
|
|
445
|
+
/** the number of the day (e.g., 1 = the first day of the month).*/
|
|
100
446
|
date: number;
|
|
101
447
|
}
|
|
448
|
+
/** The values used to invoke events on the DateInput component */
|
|
102
449
|
export interface DateInputEventsPayload extends BaseDate {
|
|
450
|
+
/** Selected date with formatting option applied. (e.g., 09/04/1986). */
|
|
103
451
|
formattedDate?: string;
|
|
104
452
|
}
|
|
105
|
-
|
|
453
|
+
/**
|
|
454
|
+
* @internal
|
|
455
|
+
* @ignore
|
|
456
|
+
* */
|
|
457
|
+
type BaseDateInputForDate = Omit<BaseInputProps<BaseDate | null, DateInputEventsPayload>, 'onInput' | 'placeholder'>;
|
|
458
|
+
/**
|
|
459
|
+
* The props type for {@link !components.DateInput}.
|
|
460
|
+
*
|
|
461
|
+
* @category Component Props
|
|
462
|
+
*/
|
|
463
|
+
export interface DateInputProps extends BaseDateInputForDate {
|
|
464
|
+
/**
|
|
465
|
+
* Sets the earliest date that will be valid.
|
|
466
|
+
*/
|
|
106
467
|
min?: BaseDate;
|
|
468
|
+
/**
|
|
469
|
+
* Sets the latest date that will be valid.
|
|
470
|
+
*/
|
|
107
471
|
max?: BaseDate;
|
|
472
|
+
/**
|
|
473
|
+
* Sets the message that users will see when they hover over dates before the min date.
|
|
474
|
+
*
|
|
475
|
+
* @defaultValue `"You must choose a newer date"`
|
|
476
|
+
*/
|
|
108
477
|
minValidationMessage?: string;
|
|
478
|
+
/**
|
|
479
|
+
* Sets the message that users will see when the hover over dates after the max date.
|
|
480
|
+
*
|
|
481
|
+
* @defaultValue `"You must choose an older date"`
|
|
482
|
+
*/
|
|
109
483
|
maxValidationMessage?: string;
|
|
484
|
+
/**
|
|
485
|
+
* Sets the date format that input will display to users.
|
|
486
|
+
*
|
|
487
|
+
* @defaultValue `short`
|
|
488
|
+
*
|
|
489
|
+
* #### Format Options
|
|
490
|
+
*
|
|
491
|
+
* - short: `09/04/1986`
|
|
492
|
+
* - long: `September 4, 1986`
|
|
493
|
+
* - medium : `Sep 4, 1986`
|
|
494
|
+
* - standard: `1986-09-04`
|
|
495
|
+
* - L: `09/04/1986`
|
|
496
|
+
* - LL: `September 4, 1986`
|
|
497
|
+
* - ll : `Sep 4, 1986`
|
|
498
|
+
* - YYYY-MM-DD: `1986-09-04`
|
|
499
|
+
*/
|
|
110
500
|
format?: 'YYYY-MM-DD' | 'L' | 'LL' | 'll' | 'short' | 'long' | 'medium' | 'standard';
|
|
501
|
+
/**
|
|
502
|
+
* Sets the timezone that the component will user to calculate valid dates.
|
|
503
|
+
*
|
|
504
|
+
* @defaultValue `"userTz"`
|
|
505
|
+
*/
|
|
111
506
|
timezone?: 'userTz' | 'portalTz';
|
|
507
|
+
/**
|
|
508
|
+
* Sets the label of the clear button.
|
|
509
|
+
*
|
|
510
|
+
* @defaultValue `"Clear"`
|
|
511
|
+
*/
|
|
112
512
|
clearButtonLabel?: string;
|
|
513
|
+
/**
|
|
514
|
+
* Sets the label of the today button.
|
|
515
|
+
*
|
|
516
|
+
* @defaultValue `"Today"`
|
|
517
|
+
*/
|
|
113
518
|
todayButtonLabel?: string;
|
|
114
519
|
}
|
|
520
|
+
/**
|
|
521
|
+
* The props type for {@link !components.ProgressBar}.
|
|
522
|
+
*
|
|
523
|
+
* @category Component Props
|
|
524
|
+
*/
|
|
115
525
|
export interface ProgressBarProps {
|
|
526
|
+
/**
|
|
527
|
+
* The text that displays above the progress bar.
|
|
528
|
+
*
|
|
529
|
+
*/
|
|
116
530
|
title?: string;
|
|
531
|
+
/**
|
|
532
|
+
* Accessibility label.
|
|
533
|
+
*
|
|
534
|
+
*/
|
|
117
535
|
'aria-label'?: string;
|
|
536
|
+
/**
|
|
537
|
+
* Whether the progress bar displays the completion percentage.
|
|
538
|
+
*
|
|
539
|
+
* @defaultValue `false`
|
|
540
|
+
*/
|
|
118
541
|
showPercentage?: boolean;
|
|
542
|
+
/**
|
|
543
|
+
* The number representing the progress so far.
|
|
544
|
+
*
|
|
545
|
+
* @defaultValue `0`
|
|
546
|
+
*/
|
|
119
547
|
value?: number;
|
|
120
|
-
/**
|
|
121
|
-
|
|
548
|
+
/**
|
|
549
|
+
* The maximum value of the progress bar.
|
|
550
|
+
*
|
|
551
|
+
* @defaultValue `100`
|
|
552
|
+
*/
|
|
122
553
|
maxValue?: number;
|
|
554
|
+
/**
|
|
555
|
+
* The text that explains the current state of the value property. For example, "150 out of 250". Displays above the progress bar on the right side.
|
|
556
|
+
*
|
|
557
|
+
*/
|
|
123
558
|
valueDescription?: string;
|
|
559
|
+
/**
|
|
560
|
+
* The color that indicates the type of progress bar.
|
|
561
|
+
*
|
|
562
|
+
* @defaultValue `"success"`
|
|
563
|
+
*/
|
|
124
564
|
variant?: 'success' | 'danger' | 'warning';
|
|
565
|
+
/** @deprecated use maxValue instead */
|
|
566
|
+
valueMax?: number;
|
|
125
567
|
}
|
|
568
|
+
/**
|
|
569
|
+
* Generic collection of props for select components
|
|
570
|
+
* @internal
|
|
571
|
+
* */
|
|
126
572
|
export interface BaseSelectProps {
|
|
573
|
+
/**
|
|
574
|
+
* The text that displays above to the dropdown menu.
|
|
575
|
+
*
|
|
576
|
+
*/
|
|
127
577
|
label?: string;
|
|
578
|
+
/**
|
|
579
|
+
* The unique identifier for the select element.
|
|
580
|
+
*
|
|
581
|
+
*/
|
|
128
582
|
name?: string;
|
|
583
|
+
/**
|
|
584
|
+
* When set to `true`, displays a required field indicator.
|
|
585
|
+
*
|
|
586
|
+
* @defaultValue `false`
|
|
587
|
+
*/
|
|
129
588
|
required?: boolean;
|
|
589
|
+
/**
|
|
590
|
+
* When set to `true`, sets the field as read-only on the CRM record, and users will not be able to fill the input field.
|
|
591
|
+
*
|
|
592
|
+
* @defaultValue `false`
|
|
593
|
+
*/
|
|
130
594
|
readOnly?: boolean;
|
|
595
|
+
/**
|
|
596
|
+
* Displayed text that describes the field's purpose.
|
|
597
|
+
*
|
|
598
|
+
*/
|
|
131
599
|
description?: string;
|
|
600
|
+
/**
|
|
601
|
+
* The text that displays in a tooltip next to the label.
|
|
602
|
+
*
|
|
603
|
+
*/
|
|
132
604
|
tooltip?: string;
|
|
605
|
+
/**
|
|
606
|
+
* Text that appears in the input when no value is set.
|
|
607
|
+
*
|
|
608
|
+
*/
|
|
133
609
|
placeholder?: string;
|
|
610
|
+
/**
|
|
611
|
+
* When set to `true`, `validationMessage` is displayed as an error message if provided.
|
|
612
|
+
* The input will also render its error state to let the user know there's an error.
|
|
613
|
+
* If left `false` (default), `validationMessage` is displayed as a success message.
|
|
614
|
+
*
|
|
615
|
+
* @defaultValue `false`
|
|
616
|
+
*/
|
|
134
617
|
error?: boolean;
|
|
618
|
+
/**
|
|
619
|
+
* The text to show if the input has an error.
|
|
620
|
+
*
|
|
621
|
+
*/
|
|
135
622
|
validationMessage?: string;
|
|
623
|
+
/**
|
|
624
|
+
* The options to display in the dropdown menu.
|
|
625
|
+
*/
|
|
136
626
|
options: {
|
|
627
|
+
/** Will be used as the display text. **/
|
|
137
628
|
label: string;
|
|
629
|
+
/** Should be the option's unique identifier, which is submitted with the form. **/
|
|
138
630
|
value: string | number;
|
|
139
631
|
}[];
|
|
632
|
+
/**
|
|
633
|
+
* The variant type for the select.
|
|
634
|
+
*
|
|
635
|
+
* @defaultValue `"input"`
|
|
636
|
+
*/
|
|
140
637
|
variant?: 'transparent' | 'input';
|
|
141
638
|
}
|
|
639
|
+
/**
|
|
640
|
+
* The props type for {@link !components.Select}.
|
|
641
|
+
*
|
|
642
|
+
* @category Component Props
|
|
643
|
+
*/
|
|
142
644
|
export interface SelectProps extends BaseSelectProps {
|
|
645
|
+
/**
|
|
646
|
+
* The value of the select input.
|
|
647
|
+
*
|
|
648
|
+
*/
|
|
143
649
|
value?: string | number;
|
|
650
|
+
/**
|
|
651
|
+
* A callback function that is invoked when the value is committed.
|
|
652
|
+
*
|
|
653
|
+
* @event
|
|
654
|
+
*/
|
|
144
655
|
onChange?: (value: NonNullable<SelectProps['value']>) => void;
|
|
656
|
+
/**
|
|
657
|
+
* The variant type for the select.
|
|
658
|
+
*
|
|
659
|
+
* @defaultValue `"input"`
|
|
660
|
+
*/
|
|
145
661
|
variant?: 'transparent' | 'input';
|
|
146
662
|
}
|
|
663
|
+
/**
|
|
664
|
+
* The props type for {@link !components.MultiSelect}.
|
|
665
|
+
*
|
|
666
|
+
* @category Component Props
|
|
667
|
+
*/
|
|
147
668
|
export interface MultiSelectProps extends BaseSelectProps {
|
|
669
|
+
/**
|
|
670
|
+
* The value of the select input.
|
|
671
|
+
*
|
|
672
|
+
*/
|
|
148
673
|
value?: (string | number)[];
|
|
674
|
+
/**
|
|
675
|
+
* A callback function that is invoked when the value is committed.
|
|
676
|
+
*
|
|
677
|
+
* @event
|
|
678
|
+
*/
|
|
149
679
|
onChange?: (value: NonNullable<MultiSelectProps['value']>) => void;
|
|
150
680
|
}
|
|
681
|
+
/**
|
|
682
|
+
* The props type for {@link !components.Tag}.
|
|
683
|
+
*
|
|
684
|
+
* @category Component Props
|
|
685
|
+
*/
|
|
151
686
|
export interface TagProps {
|
|
687
|
+
/**
|
|
688
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
689
|
+
*/
|
|
152
690
|
children: ReactNode;
|
|
153
|
-
|
|
691
|
+
/**
|
|
692
|
+
* The tag's color. The following variants are available.
|
|
693
|
+
*
|
|
694
|
+
* @defaultValue `"default"`
|
|
695
|
+
*/
|
|
154
696
|
variant?: 'default' | 'warning' | 'success' | 'error';
|
|
697
|
+
/**
|
|
698
|
+
* A function that will be invoked when the tag is clicked. It receives no argument and its return value is ignored.
|
|
699
|
+
*
|
|
700
|
+
* @event
|
|
701
|
+
*/
|
|
702
|
+
onClick?: () => void;
|
|
155
703
|
}
|
|
704
|
+
/**
|
|
705
|
+
* @internal
|
|
706
|
+
* Format options for text component.
|
|
707
|
+
*/
|
|
156
708
|
export interface TextFormatOptions {
|
|
709
|
+
/**
|
|
710
|
+
* Weight of the font.
|
|
711
|
+
*
|
|
712
|
+
* @defaultValue `"regular"`
|
|
713
|
+
*/
|
|
157
714
|
fontWeight?: 'regular' | 'bold' | 'demibold';
|
|
715
|
+
/**
|
|
716
|
+
* If `true`, font will be in italicized.
|
|
717
|
+
*
|
|
718
|
+
* @defaultValue `false`
|
|
719
|
+
*/
|
|
158
720
|
italic?: boolean;
|
|
721
|
+
/**
|
|
722
|
+
* Line decoration of the font.
|
|
723
|
+
*
|
|
724
|
+
* @defaultValue `"none"`
|
|
725
|
+
*/
|
|
159
726
|
lineDecoration?: 'none' | 'underline' | 'strikethrough';
|
|
160
727
|
}
|
|
728
|
+
/**
|
|
729
|
+
* The props type for {@link !components.Text}.
|
|
730
|
+
*
|
|
731
|
+
* @interface
|
|
732
|
+
* @category Component Props
|
|
733
|
+
*/
|
|
161
734
|
export type TextProps = {
|
|
735
|
+
/**
|
|
736
|
+
* The style of text to display. Can be either of:
|
|
737
|
+
*
|
|
738
|
+
* - bodytext: the default value which renders the standard text size.
|
|
739
|
+
* - microcopy: smaller text used for adding context.
|
|
740
|
+
*
|
|
741
|
+
* @defaultValue `"bodytext"`
|
|
742
|
+
*/
|
|
162
743
|
variant?: 'bodytext' | 'microcopy';
|
|
744
|
+
/**
|
|
745
|
+
* When set to `true`, inserts a line break.
|
|
746
|
+
*
|
|
747
|
+
* @defaultValue `false`
|
|
748
|
+
*/
|
|
163
749
|
inline?: boolean;
|
|
750
|
+
/**
|
|
751
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
752
|
+
*/
|
|
164
753
|
children: ReactNode;
|
|
754
|
+
/**
|
|
755
|
+
* @interface
|
|
756
|
+
* The style of text to display. Can be any of:
|
|
757
|
+
*
|
|
758
|
+
* - { fontWeight: 'bold' }
|
|
759
|
+
* - { fontWeight: 'demibold' }
|
|
760
|
+
* - { italic: true }
|
|
761
|
+
* - { lineDecoration: 'strikethrough' }
|
|
762
|
+
* - { lineDecoration: 'underline' }
|
|
763
|
+
* - <Text inline={true}>
|
|
764
|
+
*/
|
|
165
765
|
format?: TextFormatOptions;
|
|
166
766
|
};
|
|
767
|
+
/**
|
|
768
|
+
* The props type for {@link !components.Tile}.
|
|
769
|
+
*
|
|
770
|
+
* @category Component Props
|
|
771
|
+
*/
|
|
167
772
|
export interface TileProps {
|
|
773
|
+
/**
|
|
774
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
775
|
+
*/
|
|
168
776
|
children: ReactNode;
|
|
777
|
+
/**
|
|
778
|
+
* When set to `true`, removes left and right padding from tile contents.
|
|
779
|
+
*
|
|
780
|
+
* @defaultValue `false`
|
|
781
|
+
*/
|
|
169
782
|
flush?: boolean;
|
|
170
783
|
}
|
|
784
|
+
/** @ignore */
|
|
171
785
|
interface Team {
|
|
172
786
|
id: number;
|
|
173
787
|
name: string;
|
|
174
788
|
teammates: number[];
|
|
175
789
|
}
|
|
176
790
|
export type ToggleGroupOption = {
|
|
791
|
+
/** The text that displays in the dropdown menu. */
|
|
177
792
|
label: string;
|
|
793
|
+
/** The unique value that is submitted with the form. */
|
|
178
794
|
value: string;
|
|
795
|
+
/** When set to `true`, the option will be selected by default. */
|
|
179
796
|
initialIsChecked?: boolean;
|
|
797
|
+
/** When set to `true`, the option cannot be selected. */
|
|
180
798
|
readonly?: boolean;
|
|
799
|
+
/** The string that displays below the toggle. */
|
|
181
800
|
description?: string;
|
|
182
801
|
};
|
|
183
802
|
interface ToggleGroupListBaseProps {
|
|
@@ -195,26 +814,96 @@ export interface RadioButtonListProps extends ToggleGroupListBaseProps {
|
|
|
195
814
|
onChange?: RadioButtonGroupProps['onChange'];
|
|
196
815
|
}
|
|
197
816
|
interface CheckboxGroupProps {
|
|
817
|
+
/**
|
|
818
|
+
* Denotes the type of list to render.
|
|
819
|
+
*
|
|
820
|
+
* @defaultValue `"checkboxList"`
|
|
821
|
+
*/
|
|
198
822
|
toggleType: 'checkboxList';
|
|
823
|
+
/**
|
|
824
|
+
* A function that is called with the new value or values when the list is updated.
|
|
825
|
+
*
|
|
826
|
+
* @event
|
|
827
|
+
*/
|
|
199
828
|
onChange?: (value: this['value']) => void;
|
|
829
|
+
/**
|
|
830
|
+
* The value of the toggle group.
|
|
831
|
+
*/
|
|
200
832
|
value?: string[];
|
|
201
833
|
}
|
|
202
834
|
interface RadioButtonGroupProps {
|
|
835
|
+
/**
|
|
836
|
+
* Denotes the type of list to render.
|
|
837
|
+
*
|
|
838
|
+
* @defaultValue `"checkboxList"`
|
|
839
|
+
*/
|
|
203
840
|
toggleType: 'radioButtonList';
|
|
841
|
+
/**
|
|
842
|
+
* A function that is called with the new value or values when the list is updated.
|
|
843
|
+
*
|
|
844
|
+
* @event
|
|
845
|
+
*/
|
|
204
846
|
onChange?: (value: this['value']) => void;
|
|
847
|
+
/**
|
|
848
|
+
* The value of the toggle group.
|
|
849
|
+
*/
|
|
205
850
|
value?: string;
|
|
206
851
|
}
|
|
852
|
+
/**
|
|
853
|
+
* The props type for {@link !components.ToggleGroup}.
|
|
854
|
+
*
|
|
855
|
+
* @interface
|
|
856
|
+
* @category Component Props
|
|
857
|
+
*/
|
|
207
858
|
export type ToggleGroupProps = {
|
|
859
|
+
/**
|
|
860
|
+
* The unique identifier for the toggle group element.
|
|
861
|
+
*/
|
|
208
862
|
name: string;
|
|
863
|
+
/**
|
|
864
|
+
* The label that displays above the toggle group.
|
|
865
|
+
*/
|
|
209
866
|
label: string;
|
|
867
|
+
/**
|
|
868
|
+
* The text to display if the input has an error.
|
|
869
|
+
*/
|
|
210
870
|
validationMessage?: string;
|
|
871
|
+
/**
|
|
872
|
+
* When set to `true`, displays a required indicator next to the toggle group.
|
|
873
|
+
*
|
|
874
|
+
* @defaultValue `false`
|
|
875
|
+
*/
|
|
211
876
|
required?: boolean;
|
|
877
|
+
/**
|
|
878
|
+
* Text that will appear in a tooltip next to the toggle group label.
|
|
879
|
+
*/
|
|
212
880
|
tooltip?: string;
|
|
881
|
+
/**
|
|
882
|
+
* When set to `true`, `validationMessage` is displayed as an error message if provided. The input will also render its error state to let the user know there is an error. If left false, `validationMessage` is displayed as a success message.
|
|
883
|
+
*
|
|
884
|
+
* @defaultValue `false`
|
|
885
|
+
*/
|
|
213
886
|
error?: boolean;
|
|
887
|
+
/**
|
|
888
|
+
* An array of options to display in the dropdown menu.
|
|
889
|
+
*
|
|
890
|
+
* @defaultValue `[]`
|
|
891
|
+
*/
|
|
214
892
|
options: Array<ToggleGroupOption>;
|
|
893
|
+
/**
|
|
894
|
+
* When set to `true`, stacks the options horizontally.
|
|
895
|
+
*
|
|
896
|
+
* @defaultValue `false`
|
|
897
|
+
*/
|
|
215
898
|
inline?: boolean;
|
|
899
|
+
/**
|
|
900
|
+
* The size variation of the individual options.
|
|
901
|
+
*
|
|
902
|
+
* @defaultValue `"default"`
|
|
903
|
+
*/
|
|
216
904
|
variant?: 'default' | 'small';
|
|
217
905
|
} & (CheckboxGroupProps | RadioButtonGroupProps);
|
|
906
|
+
/** @ignore */
|
|
218
907
|
export interface UserContext {
|
|
219
908
|
id: number;
|
|
220
909
|
emails: string[];
|
|
@@ -225,10 +914,12 @@ export interface UserContext {
|
|
|
225
914
|
teams: Team[];
|
|
226
915
|
locale?: string;
|
|
227
916
|
}
|
|
917
|
+
/** @ignore */
|
|
228
918
|
export interface PortalContext {
|
|
229
919
|
id: number;
|
|
230
920
|
timezone: string;
|
|
231
921
|
}
|
|
922
|
+
/** @ignore */
|
|
232
923
|
export interface Context {
|
|
233
924
|
user: UserContext;
|
|
234
925
|
portal: PortalContext;
|
|
@@ -241,28 +932,107 @@ export interface StackProps {
|
|
|
241
932
|
align?: 'start' | 'center' | 'baseline' | 'end' | 'stretch';
|
|
242
933
|
width?: 'auto' | '100%';
|
|
243
934
|
}
|
|
935
|
+
/**
|
|
936
|
+
* The props type for {@link !components.Flex}.
|
|
937
|
+
*
|
|
938
|
+
* @category Component Props
|
|
939
|
+
*/
|
|
244
940
|
export interface FlexProps {
|
|
941
|
+
/**
|
|
942
|
+
* Sets the spacing between components.
|
|
943
|
+
*
|
|
944
|
+
* @defaultValue `"flush"`
|
|
945
|
+
*/
|
|
245
946
|
gap?: AllDistances;
|
|
947
|
+
/**
|
|
948
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
949
|
+
*
|
|
950
|
+
*/
|
|
246
951
|
children?: ReactNode;
|
|
952
|
+
/**
|
|
953
|
+
* Arranges components `horizontally` or `vertically` by setting the main axis.
|
|
954
|
+
*
|
|
955
|
+
* @defaultValue `"row"`
|
|
956
|
+
*/
|
|
247
957
|
direction?: 'row' | 'column';
|
|
958
|
+
/**
|
|
959
|
+
* Distributes components along the main axis using the available free space.
|
|
960
|
+
*
|
|
961
|
+
* @defaultValue `"start"`
|
|
962
|
+
*/
|
|
248
963
|
justify?: 'center' | 'end' | 'start' | 'around' | 'between';
|
|
964
|
+
/**
|
|
965
|
+
* Distributes components along the cross-axis using the available free space.
|
|
966
|
+
*
|
|
967
|
+
* @defaultValue `"stretch"`
|
|
968
|
+
*/
|
|
249
969
|
align?: 'start' | 'center' | 'baseline' | 'end' | 'stretch';
|
|
970
|
+
/**
|
|
971
|
+
* Distributes a child component along the cross-axis using the available free space. Use this prop for nested child Flex and Box components to align them differently from other child components in the Flex.
|
|
972
|
+
*
|
|
973
|
+
*/
|
|
250
974
|
alignSelf?: 'start' | 'center' | 'baseline' | 'end' | 'stretch';
|
|
975
|
+
/**
|
|
976
|
+
* Whether components will wrap instead of trying to fit on one line.
|
|
977
|
+
*
|
|
978
|
+
* @defaultValue `"nowrap"`
|
|
979
|
+
*/
|
|
251
980
|
wrap?: boolean | 'wrap' | 'nowrap';
|
|
252
981
|
}
|
|
982
|
+
/**
|
|
983
|
+
* The props type for {@link !components.StatisticsTrend}.
|
|
984
|
+
*
|
|
985
|
+
* @category Component Props
|
|
986
|
+
*/
|
|
253
987
|
export interface StatisticsTrendProps {
|
|
988
|
+
/**
|
|
989
|
+
* The text to be displayed as the trend value.
|
|
990
|
+
*/
|
|
254
991
|
value: string;
|
|
992
|
+
/**
|
|
993
|
+
* The direction of the trend arrow.
|
|
994
|
+
*
|
|
995
|
+
* @defaultValue `"increase"`
|
|
996
|
+
*/
|
|
255
997
|
direction: 'increase' | 'decrease';
|
|
256
998
|
}
|
|
999
|
+
/**
|
|
1000
|
+
* The props type for {@link !components.StatisticsItem}.
|
|
1001
|
+
*
|
|
1002
|
+
* @category Component Props
|
|
1003
|
+
*/
|
|
257
1004
|
export interface StatisticsItemProps {
|
|
1005
|
+
/**
|
|
1006
|
+
* The unique identifier.
|
|
1007
|
+
*/
|
|
258
1008
|
id?: string;
|
|
1009
|
+
/**
|
|
1010
|
+
* The item's label text.
|
|
1011
|
+
*/
|
|
259
1012
|
label: string;
|
|
1013
|
+
/**
|
|
1014
|
+
* The string to be displayed as the item's primary number.
|
|
1015
|
+
*/
|
|
260
1016
|
number: string;
|
|
1017
|
+
/**
|
|
1018
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. The children should be {@link !components.StatisticsTrend} or {@link !components.Text}.
|
|
1019
|
+
*/
|
|
261
1020
|
children: ReactNode;
|
|
262
1021
|
}
|
|
1022
|
+
/**
|
|
1023
|
+
* The props type for {@link !components.Statistics}.
|
|
1024
|
+
*
|
|
1025
|
+
* @category Component Props
|
|
1026
|
+
*/
|
|
263
1027
|
export interface StatisticsProps {
|
|
1028
|
+
/**
|
|
1029
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. The children should be {@link !components.StatisticsItem}.
|
|
1030
|
+
*/
|
|
264
1031
|
children: ReactNode;
|
|
265
1032
|
}
|
|
1033
|
+
/**
|
|
1034
|
+
* @category Serverless
|
|
1035
|
+
*/
|
|
266
1036
|
export interface ServerlessRunnerParams {
|
|
267
1037
|
/**
|
|
268
1038
|
* Name of the serverless function
|
|
@@ -282,10 +1052,16 @@ export interface ServerlessRunnerParams {
|
|
|
282
1052
|
*/
|
|
283
1053
|
payload?: JsonValue;
|
|
284
1054
|
}
|
|
1055
|
+
/**
|
|
1056
|
+
* @category Serverless
|
|
1057
|
+
*/
|
|
285
1058
|
export declare enum ServerlessExecutionStatus {
|
|
286
1059
|
Success = "SUCCESS",
|
|
287
1060
|
Error = "ERROR"
|
|
288
1061
|
}
|
|
1062
|
+
/**
|
|
1063
|
+
* @category Serverless
|
|
1064
|
+
*/
|
|
289
1065
|
export type ServerlessExecutionResult = {
|
|
290
1066
|
status: ServerlessExecutionStatus.Success;
|
|
291
1067
|
response: JsonValue;
|
|
@@ -293,7 +1069,14 @@ export type ServerlessExecutionResult = {
|
|
|
293
1069
|
status: ServerlessExecutionStatus.Error;
|
|
294
1070
|
message: string;
|
|
295
1071
|
};
|
|
1072
|
+
/**
|
|
1073
|
+
* @category Serverless
|
|
1074
|
+
*/
|
|
296
1075
|
export type ServerlessFuncRunner = (params: ServerlessRunnerParams) => Promise<ServerlessExecutionResult>;
|
|
1076
|
+
/**
|
|
1077
|
+
* @ignore
|
|
1078
|
+
* @category Serverless
|
|
1079
|
+
*/
|
|
297
1080
|
export interface ServerlessExecutionRequest {
|
|
298
1081
|
appId: number;
|
|
299
1082
|
extensibleCardId: number;
|
|
@@ -312,10 +1095,16 @@ export interface ServerlessExecutionRequest {
|
|
|
312
1095
|
objectId?: number;
|
|
313
1096
|
objectTypeId?: string;
|
|
314
1097
|
}
|
|
1098
|
+
/**
|
|
1099
|
+
* @category Serverless
|
|
1100
|
+
*/
|
|
315
1101
|
export interface ServerlessExecutionResponse {
|
|
316
1102
|
logId: string;
|
|
317
1103
|
response?: JsonValue;
|
|
318
1104
|
}
|
|
1105
|
+
/**
|
|
1106
|
+
* @category Serverless
|
|
1107
|
+
*/
|
|
319
1108
|
export interface ServerlessErrorResponse {
|
|
320
1109
|
responseJSON?: {
|
|
321
1110
|
message: string;
|
|
@@ -329,6 +1118,7 @@ export interface ServerlessErrorResponse {
|
|
|
329
1118
|
};
|
|
330
1119
|
status: number;
|
|
331
1120
|
}
|
|
1121
|
+
/** @ignore */
|
|
332
1122
|
export interface ExtensionCardContextData {
|
|
333
1123
|
cardId: string;
|
|
334
1124
|
cardTitle?: string;
|
|
@@ -338,39 +1128,35 @@ export interface ExtensionCardContextData {
|
|
|
338
1128
|
objectTypeId: string;
|
|
339
1129
|
location: keyof ExtensionPoints;
|
|
340
1130
|
}
|
|
1131
|
+
/** @ignore */
|
|
341
1132
|
export type ExtensionPointAction = (...args: any[]) => Promise<any> | void;
|
|
1133
|
+
/** @ignore */
|
|
342
1134
|
export interface ExtensionPointContract {
|
|
343
1135
|
actions?: {
|
|
344
1136
|
[k: string]: ExtensionPointAction;
|
|
345
1137
|
} | {};
|
|
346
1138
|
customComponents: Record<string, ComponentType<any>>;
|
|
347
1139
|
}
|
|
1140
|
+
/** @ignore */
|
|
348
1141
|
type AlertType = 'info' | 'warning' | 'success' | 'danger' | 'tip' | undefined;
|
|
1142
|
+
/** @ignore */
|
|
349
1143
|
export type AddAlertAction = (args: {
|
|
350
1144
|
type?: AlertType;
|
|
351
1145
|
message: string;
|
|
352
1146
|
}) => void;
|
|
353
|
-
|
|
354
|
-
objectTypeId: string;
|
|
355
|
-
objectId: string;
|
|
356
|
-
}) => void;
|
|
357
|
-
export type ListenForObjectUpdateAction = (args: {
|
|
358
|
-
callback: (args: {
|
|
359
|
-
objectTypeId: string;
|
|
360
|
-
objectId: string;
|
|
361
|
-
}) => void;
|
|
362
|
-
}) => void;
|
|
1147
|
+
/** @ignore */
|
|
363
1148
|
export type ReloadPageAction = () => void;
|
|
1149
|
+
/** @ignore */
|
|
364
1150
|
export type FetchCrmObjectPropertiesAction = (properties: string[]) => Promise<Record<string, string>>;
|
|
1151
|
+
/** @ignore */
|
|
365
1152
|
export type OpenIframeModalAction = (action: OpenIframeActionPayload) => void;
|
|
1153
|
+
/** @ignore */
|
|
366
1154
|
export interface CrmMiddleExtensionPoint extends ExtensionPointContract {
|
|
367
1155
|
actions: {
|
|
368
1156
|
addAlert: AddAlertAction;
|
|
369
1157
|
reloadPage: ReloadPageAction;
|
|
370
1158
|
fetchCrmObjectProperties: FetchCrmObjectPropertiesAction;
|
|
371
1159
|
openIframeModal: OpenIframeModalAction;
|
|
372
|
-
notifyObjectUpdate?: NotifyObjectUpdateAction;
|
|
373
|
-
listenForObjectUpdate?: ListenForObjectUpdateAction;
|
|
374
1160
|
};
|
|
375
1161
|
customComponents: {
|
|
376
1162
|
CrmPropertyList: ComponentType<CrmPropertyListProps>;
|
|
@@ -386,6 +1172,7 @@ export interface CrmMiddleExtensionPoint extends ExtensionPointContract {
|
|
|
386
1172
|
CrmCardActions?: ComponentType<CrmCardActionsProps>;
|
|
387
1173
|
};
|
|
388
1174
|
}
|
|
1175
|
+
/** @ignore */
|
|
389
1176
|
export interface CrmSidebarExtensionPoint extends ExtensionPointContract {
|
|
390
1177
|
actions: {
|
|
391
1178
|
addAlert: AddAlertAction;
|
|
@@ -397,29 +1184,35 @@ export interface CrmSidebarExtensionPoint extends ExtensionPointContract {
|
|
|
397
1184
|
[k: string]: never;
|
|
398
1185
|
};
|
|
399
1186
|
}
|
|
1187
|
+
/** @ignore */
|
|
400
1188
|
export interface CrmDataHighlightProps {
|
|
401
1189
|
properties: Array<string>;
|
|
402
1190
|
objectTypeId?: string;
|
|
403
1191
|
objectId?: number;
|
|
404
1192
|
}
|
|
1193
|
+
/** @ignore */
|
|
405
1194
|
export interface CrmReportProps {
|
|
406
1195
|
reportId: string;
|
|
407
1196
|
}
|
|
1197
|
+
/** @ignore */
|
|
408
1198
|
export interface CrmPropertyListProps {
|
|
409
1199
|
properties: Array<string>;
|
|
410
1200
|
direction?: string;
|
|
411
1201
|
objectTypeId?: string;
|
|
412
1202
|
objectId?: number;
|
|
413
1203
|
}
|
|
1204
|
+
/** @ignore */
|
|
414
1205
|
export interface CrmObjectPropertyProps {
|
|
415
1206
|
properties: Array<string>;
|
|
416
1207
|
objectTypeId?: string;
|
|
417
1208
|
objectId?: number;
|
|
418
1209
|
}
|
|
1210
|
+
/** @ignore */
|
|
419
1211
|
type CrmSortDescriptor = {
|
|
420
1212
|
columnName: string;
|
|
421
1213
|
direction: 1 | -1;
|
|
422
1214
|
};
|
|
1215
|
+
/** @ignore */
|
|
423
1216
|
interface CrmSearchFilter {
|
|
424
1217
|
operator: 'EQ' | 'NEQ' | 'LT' | 'LTE' | 'GT' | 'GTE' | 'BETWEEN' | 'IN' | 'NOT_IN' | 'HAS_PROPERTY' | 'NOT_HAS_PROPERTY';
|
|
425
1218
|
value?: string | number;
|
|
@@ -427,6 +1220,7 @@ interface CrmSearchFilter {
|
|
|
427
1220
|
highValue?: string | number;
|
|
428
1221
|
property: string;
|
|
429
1222
|
}
|
|
1223
|
+
/** @ignore */
|
|
430
1224
|
export interface CrmAssociationTableProps {
|
|
431
1225
|
objectTypeId: string;
|
|
432
1226
|
propertyColumns: Array<string>;
|
|
@@ -438,6 +1232,7 @@ export interface CrmAssociationTableProps {
|
|
|
438
1232
|
preFilters?: Array<CrmSearchFilter>;
|
|
439
1233
|
sort?: Array<CrmSortDescriptor>;
|
|
440
1234
|
}
|
|
1235
|
+
/** @ignore */
|
|
441
1236
|
export interface CrmAssociationPivotProps {
|
|
442
1237
|
objectTypeId: string;
|
|
443
1238
|
associationLabels?: Array<string>;
|
|
@@ -445,6 +1240,7 @@ export interface CrmAssociationPivotProps {
|
|
|
445
1240
|
preFilters?: Array<CrmSearchFilter>;
|
|
446
1241
|
sort?: Array<CrmSortDescriptor>;
|
|
447
1242
|
}
|
|
1243
|
+
/** @ignore */
|
|
448
1244
|
export interface CrmAssociationPropertyListProps {
|
|
449
1245
|
objectTypeId: string;
|
|
450
1246
|
properties: Array<string>;
|
|
@@ -452,16 +1248,19 @@ export interface CrmAssociationPropertyListProps {
|
|
|
452
1248
|
filters?: Array<CrmSearchFilter>;
|
|
453
1249
|
sort?: Array<CrmSortDescriptor>;
|
|
454
1250
|
}
|
|
1251
|
+
/** @ignore */
|
|
455
1252
|
export interface CrmStageTrackerProps {
|
|
456
1253
|
objectId?: number;
|
|
457
1254
|
objectTypeId?: string;
|
|
458
1255
|
properties: Array<string>;
|
|
459
1256
|
showProperties?: boolean;
|
|
460
1257
|
}
|
|
1258
|
+
/** @ignore */
|
|
461
1259
|
interface ObjectCoordinates {
|
|
462
1260
|
objectTypeId: string;
|
|
463
1261
|
objectId: number;
|
|
464
1262
|
}
|
|
1263
|
+
/** @ignore */
|
|
465
1264
|
interface OpenRecordAssociationFormArgs {
|
|
466
1265
|
objectTypeId: string;
|
|
467
1266
|
association: {
|
|
@@ -469,11 +1268,13 @@ interface OpenRecordAssociationFormArgs {
|
|
|
469
1268
|
objectId: number;
|
|
470
1269
|
};
|
|
471
1270
|
}
|
|
1271
|
+
/** @ignore */
|
|
472
1272
|
interface ActivityCreatorActionArgs {
|
|
473
1273
|
objectTypeId: string;
|
|
474
1274
|
objectId: number;
|
|
475
1275
|
windowVariant?: 'windowed' | 'fullscreen';
|
|
476
1276
|
}
|
|
1277
|
+
/** @ignore */
|
|
477
1278
|
interface ActionArgs {
|
|
478
1279
|
PREVIEW_OBJECT: ObjectCoordinates;
|
|
479
1280
|
ADD_NOTE: ActivityCreatorActionArgs;
|
|
@@ -481,21 +1282,26 @@ interface ActionArgs {
|
|
|
481
1282
|
SCHEDULE_MEETING: ActivityCreatorActionArgs;
|
|
482
1283
|
OPEN_RECORD_ASSOCIATION_FORM: OpenRecordAssociationFormArgs;
|
|
483
1284
|
}
|
|
1285
|
+
/** @ignore */
|
|
484
1286
|
export type ArgsFor<SpecificActionType extends ActionType> = ActionArgs[SpecificActionType];
|
|
485
1287
|
export type ActionType = 'PREVIEW_OBJECT' | 'ADD_NOTE' | 'SEND_EMAIL' | 'SCHEDULE_MEETING' | 'OPEN_RECORD_ASSOCIATION_FORM';
|
|
1288
|
+
/** @ignore */
|
|
486
1289
|
interface BaseActionComponent {
|
|
487
1290
|
children: ReactNode;
|
|
488
1291
|
actionType: ActionType;
|
|
489
1292
|
actionContext: ArgsFor<ActionType>;
|
|
490
1293
|
onError?: (errors: string[]) => void;
|
|
491
1294
|
}
|
|
1295
|
+
/** @ignore */
|
|
492
1296
|
export interface CrmActionButtonProps extends BaseActionComponent {
|
|
493
1297
|
variant?: 'primary' | 'secondary' | 'destructive';
|
|
494
1298
|
type?: 'button' | 'reset' | 'submit';
|
|
495
1299
|
}
|
|
1300
|
+
/** @ignore */
|
|
496
1301
|
export interface CrmActionLinkProps extends BaseActionComponent {
|
|
497
1302
|
variant?: 'primary' | 'light' | 'dark' | 'destructive';
|
|
498
1303
|
}
|
|
1304
|
+
/** @ignore */
|
|
499
1305
|
export interface ActionLibraryButtonCardActionConfig<SpecificActionType extends ActionType = ActionType> {
|
|
500
1306
|
type: 'action-library-button';
|
|
501
1307
|
actionType: SpecificActionType;
|
|
@@ -504,10 +1310,12 @@ export interface ActionLibraryButtonCardActionConfig<SpecificActionType extends
|
|
|
504
1310
|
disabled?: boolean;
|
|
505
1311
|
tooltipText?: string;
|
|
506
1312
|
}
|
|
1313
|
+
/** @ignore */
|
|
507
1314
|
export type DropdownCardActionConfigOptions = [
|
|
508
1315
|
ActionLibraryButtonCardActionConfig,
|
|
509
1316
|
...ActionLibraryButtonCardActionConfig[]
|
|
510
1317
|
];
|
|
1318
|
+
/** @ignore */
|
|
511
1319
|
export interface DropdownCardActionConfig {
|
|
512
1320
|
type: 'dropdown';
|
|
513
1321
|
options: DropdownCardActionConfigOptions;
|
|
@@ -515,12 +1323,16 @@ export interface DropdownCardActionConfig {
|
|
|
515
1323
|
disabled?: boolean;
|
|
516
1324
|
tooltipText?: string;
|
|
517
1325
|
}
|
|
1326
|
+
/** @ignore */
|
|
518
1327
|
type ErrorHandler = (errors: string[]) => void;
|
|
1328
|
+
/** @ignore */
|
|
519
1329
|
type CardActionConfig = ActionLibraryButtonCardActionConfig | DropdownCardActionConfig;
|
|
1330
|
+
/** @ignore */
|
|
520
1331
|
export type CrmCardActionsProps = {
|
|
521
1332
|
actionConfigs: Array<CardActionConfig>;
|
|
522
1333
|
onError?: ErrorHandler;
|
|
523
1334
|
};
|
|
1335
|
+
/** @ignore */
|
|
524
1336
|
interface RemotePlaygroundExtensionPoint extends ExtensionPointContract {
|
|
525
1337
|
actions: {
|
|
526
1338
|
warn: () => void;
|
|
@@ -529,6 +1341,7 @@ interface RemotePlaygroundExtensionPoint extends ExtensionPointContract {
|
|
|
529
1341
|
ExampleCrmComponent: ComponentType<ExampleCrmComponentProps>;
|
|
530
1342
|
};
|
|
531
1343
|
}
|
|
1344
|
+
/** @ignore */
|
|
532
1345
|
export interface ExtensionPoints {
|
|
533
1346
|
'uie.playground.middle': RemotePlaygroundExtensionPoint;
|
|
534
1347
|
'crm.record.tab': CrmMiddleExtensionPoint;
|
|
@@ -539,51 +1352,182 @@ export interface ExampleCrmComponentProps {
|
|
|
539
1352
|
size: 'sm' | 'md' | 'lg';
|
|
540
1353
|
count: number;
|
|
541
1354
|
}
|
|
1355
|
+
/** @ignore */
|
|
542
1356
|
export interface ExtensionPointApi<ExtensionPointName extends keyof ExtensionPoints> {
|
|
543
1357
|
context: Context;
|
|
544
1358
|
runServerlessFunction: ServerlessFuncRunner;
|
|
545
1359
|
actions: ExtensionPoints[ExtensionPointName]['actions'];
|
|
546
1360
|
}
|
|
1361
|
+
/** @ignore */
|
|
547
1362
|
interface OpenIframeActionPayload {
|
|
548
1363
|
uri: string;
|
|
549
1364
|
height: number;
|
|
550
1365
|
width: number;
|
|
551
1366
|
associatedObjectProperties?: string[];
|
|
552
1367
|
}
|
|
1368
|
+
/**
|
|
1369
|
+
* The props type for {@link !components.LoadingSpinner}.
|
|
1370
|
+
*
|
|
1371
|
+
* @category Component Props
|
|
1372
|
+
*/
|
|
553
1373
|
export interface LoadingSpinnerProps {
|
|
1374
|
+
/**
|
|
1375
|
+
* The text that displays next to the spinner.
|
|
1376
|
+
*
|
|
1377
|
+
*/
|
|
554
1378
|
label: string;
|
|
1379
|
+
/**
|
|
1380
|
+
* When set to `true`, the label will appear next to the spinner.
|
|
1381
|
+
*
|
|
1382
|
+
* @defaultValue `false`
|
|
1383
|
+
*/
|
|
555
1384
|
showLabel?: boolean;
|
|
1385
|
+
/**
|
|
1386
|
+
* The size of the spinner.
|
|
1387
|
+
*
|
|
1388
|
+
* @defaultValue `"sm"`
|
|
1389
|
+
*/
|
|
556
1390
|
size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
|
|
1391
|
+
/**
|
|
1392
|
+
* The position of the spinner. Can be one of `inline` or `centered`.
|
|
1393
|
+
*
|
|
1394
|
+
* @defaultValue `"inline"`
|
|
1395
|
+
*/
|
|
557
1396
|
layout?: 'inline' | 'centered';
|
|
558
1397
|
}
|
|
559
|
-
interface AlignmentProps {
|
|
1398
|
+
export interface AlignmentProps {
|
|
560
1399
|
align?: 'left' | 'center' | 'right';
|
|
561
1400
|
}
|
|
562
|
-
interface WidthProps {
|
|
1401
|
+
export interface WidthProps {
|
|
563
1402
|
width?: 'min' | 'max' | 'auto' | number;
|
|
564
1403
|
}
|
|
565
1404
|
export interface TableElementProps {
|
|
566
1405
|
children: React.ReactNode;
|
|
567
1406
|
}
|
|
568
|
-
|
|
1407
|
+
/**
|
|
1408
|
+
* @property align Sets the alignment of a table header.
|
|
1409
|
+
* @property width Sets the width of a table header.
|
|
1410
|
+
*
|
|
1411
|
+
* @interface
|
|
1412
|
+
*/
|
|
1413
|
+
export type BaseTableHeaderProps = TableElementProps & AlignmentProps & WidthProps;
|
|
569
1414
|
export type TableCellProps = TableElementProps & AlignmentProps & WidthProps;
|
|
1415
|
+
/**
|
|
1416
|
+
* The props type for {@link !components.TableHeader} when sorted === never.
|
|
1417
|
+
*
|
|
1418
|
+
* @category Component Props
|
|
1419
|
+
*/
|
|
1420
|
+
export interface UnSortedTableHeaderProps extends BaseTableHeaderProps {
|
|
1421
|
+
sortDirection?: 'never';
|
|
1422
|
+
}
|
|
1423
|
+
/**
|
|
1424
|
+
* The props type for {@link !components.TableHeader} when sorted !== never.
|
|
1425
|
+
*
|
|
1426
|
+
* @category Component Props
|
|
1427
|
+
*/
|
|
1428
|
+
export interface SortedTableHeaderProps extends BaseTableHeaderProps {
|
|
1429
|
+
/**
|
|
1430
|
+
* Sets the current direction in which the column is sorted (if any). It's a visual indicator, it doesn't modify the data.
|
|
1431
|
+
*
|
|
1432
|
+
* @defaultValue `"none"`
|
|
1433
|
+
*/
|
|
1434
|
+
sortDirection: 'ascending' | 'descending' | 'none';
|
|
1435
|
+
/**
|
|
1436
|
+
* A callback function that is invoked when the header is clicked. It recieves the new `sortDirection` as an argument.
|
|
1437
|
+
* It's required when sort = `ascending`, `descending` or `none`.
|
|
1438
|
+
*
|
|
1439
|
+
* @event
|
|
1440
|
+
* @defaultValue `"none"`
|
|
1441
|
+
*/
|
|
1442
|
+
onSortChange: (value: NonNullable<SortedTableHeaderProps['sortDirection']>) => void;
|
|
1443
|
+
/**
|
|
1444
|
+
* If `true`, users cannot change the sort ordering. It has no effect if sort=`never` or `undefined`.
|
|
1445
|
+
*
|
|
1446
|
+
* @defaultValue `false`
|
|
1447
|
+
*/
|
|
1448
|
+
disabled?: boolean;
|
|
1449
|
+
}
|
|
1450
|
+
/**
|
|
1451
|
+
* The props type for {@link !components.TableHeader}.
|
|
1452
|
+
*
|
|
1453
|
+
* @category Component Props
|
|
1454
|
+
*/
|
|
1455
|
+
export type TableHeaderProps = SortedTableHeaderProps | UnSortedTableHeaderProps;
|
|
570
1456
|
interface BaseTableProps {
|
|
1457
|
+
/**
|
|
1458
|
+
* When set to false, the table will not have borders.
|
|
1459
|
+
*
|
|
1460
|
+
* @defaultValue `true`
|
|
1461
|
+
*/
|
|
571
1462
|
bordered?: boolean;
|
|
1463
|
+
/**
|
|
1464
|
+
* When set to `true`, the table will not have bottom margin.
|
|
1465
|
+
*
|
|
1466
|
+
* @defaultValue `false`
|
|
1467
|
+
*/
|
|
572
1468
|
flush?: boolean;
|
|
1469
|
+
/**
|
|
1470
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. The children should be one of Table's subcomponents.
|
|
1471
|
+
*/
|
|
573
1472
|
children: React.ReactNode;
|
|
574
1473
|
}
|
|
1474
|
+
/**
|
|
1475
|
+
* @internal
|
|
1476
|
+
*/
|
|
575
1477
|
export interface TableNoPaginatedProps extends BaseTableProps {
|
|
1478
|
+
/**
|
|
1479
|
+
* When set to `true`, the table will include pagination navigation. Take a look at {@link !types.TablePaginatedProps} for pagination props.
|
|
1480
|
+
*
|
|
1481
|
+
* @defaultValue `false`
|
|
1482
|
+
*/
|
|
576
1483
|
paginated?: false;
|
|
577
1484
|
}
|
|
1485
|
+
/**
|
|
1486
|
+
* @internal
|
|
1487
|
+
*/
|
|
578
1488
|
export interface TablePaginatedProps extends BaseTableProps {
|
|
1489
|
+
/**
|
|
1490
|
+
* When set to `true`, the table will include pagination navigation. Take a look at {@link !types.TablePaginatedProps} for pagination props.
|
|
1491
|
+
*
|
|
1492
|
+
* @defaultValue `false`
|
|
1493
|
+
*/
|
|
579
1494
|
paginated: true;
|
|
1495
|
+
/**
|
|
1496
|
+
* The total number of pages available.
|
|
1497
|
+
*/
|
|
580
1498
|
pageCount: number;
|
|
581
|
-
|
|
1499
|
+
/**
|
|
1500
|
+
* When set to `false`, hides the text labels for the First/Prev/Next buttons. The button labels will still be accessible to screen readers.
|
|
1501
|
+
*
|
|
1502
|
+
* @defaultValue `true`
|
|
1503
|
+
*/
|
|
582
1504
|
showButtonLabels?: boolean;
|
|
1505
|
+
/**
|
|
1506
|
+
* When set to `true`, displays the **First/Last** page buttons.
|
|
1507
|
+
*
|
|
1508
|
+
* @defaultValue `false`
|
|
1509
|
+
*/
|
|
583
1510
|
showFirstLastButtons?: boolean;
|
|
1511
|
+
/**
|
|
1512
|
+
* Sets how many page buttons are displayed.
|
|
1513
|
+
*/
|
|
584
1514
|
maxVisiblePageButtons?: number;
|
|
1515
|
+
/**
|
|
1516
|
+
* Denotes the current page.
|
|
1517
|
+
*/
|
|
585
1518
|
page?: number;
|
|
1519
|
+
/**
|
|
1520
|
+
* A function that will be invoked when the pagination button is clicked. It receives the new page number as argument.
|
|
1521
|
+
*
|
|
1522
|
+
* @event
|
|
1523
|
+
*/
|
|
1524
|
+
onPageChange: (pageNumber: number) => void;
|
|
586
1525
|
}
|
|
1526
|
+
/**
|
|
1527
|
+
* The props type for {@link !components.Table}.
|
|
1528
|
+
*
|
|
1529
|
+
* @category Component Props
|
|
1530
|
+
*/
|
|
587
1531
|
export type TableProps = TableNoPaginatedProps | TablePaginatedProps;
|
|
588
1532
|
export declare class RemoteEvent<V> {
|
|
589
1533
|
type: string;
|
|
@@ -592,22 +1536,75 @@ export declare class RemoteEvent<V> {
|
|
|
592
1536
|
targetValue: V;
|
|
593
1537
|
constructor(value: V, event: Event);
|
|
594
1538
|
}
|
|
1539
|
+
/**
|
|
1540
|
+
* The props type for {@link !components.Link}.
|
|
1541
|
+
*
|
|
1542
|
+
* @category Component Props
|
|
1543
|
+
*/
|
|
595
1544
|
export interface LinkProps {
|
|
1545
|
+
/**
|
|
1546
|
+
* Sets the content that will render inside the component.
|
|
1547
|
+
*
|
|
1548
|
+
*/
|
|
596
1549
|
children: ReactNode;
|
|
1550
|
+
/**
|
|
1551
|
+
* The URL that will be opened on click. Links to pages in the HubSpot account will open in the same tab, while non-HubSpot links will open in a new tab.
|
|
1552
|
+
*
|
|
1553
|
+
*/
|
|
597
1554
|
href: string;
|
|
1555
|
+
/**
|
|
1556
|
+
* The color variation of the link.
|
|
1557
|
+
*
|
|
1558
|
+
* @defaultValue `"primary"`
|
|
1559
|
+
*/
|
|
598
1560
|
variant?: 'primary' | 'destructive' | 'light' | 'dark';
|
|
1561
|
+
/**
|
|
1562
|
+
* A function that will be invoked with the link is clicked. The function receives no arguments and its return value is ignored.
|
|
1563
|
+
*
|
|
1564
|
+
* @event
|
|
1565
|
+
*/
|
|
599
1566
|
onClick?: () => void;
|
|
1567
|
+
/**
|
|
1568
|
+
* When set to true, `event.preventDefault()` will be invoked before the `onClick` function is called, preventing automatic navigation to the href URL.
|
|
1569
|
+
*
|
|
1570
|
+
* @defaultValue `false`
|
|
1571
|
+
*/
|
|
600
1572
|
preventDefault?: boolean;
|
|
601
1573
|
}
|
|
602
1574
|
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
603
1575
|
[key: string]: JsonValue;
|
|
604
1576
|
};
|
|
1577
|
+
/**
|
|
1578
|
+
* The props type for {@link !components.Box}.
|
|
1579
|
+
*
|
|
1580
|
+
* @category Component Props
|
|
1581
|
+
*/
|
|
605
1582
|
export interface BoxProps {
|
|
1583
|
+
/**
|
|
1584
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
1585
|
+
*
|
|
1586
|
+
*/
|
|
606
1587
|
children: ReactNode;
|
|
1588
|
+
/**
|
|
1589
|
+
* Overrides Flex's `alignItem` value for this element.
|
|
1590
|
+
*
|
|
1591
|
+
* @defaultValue `"auto"`
|
|
1592
|
+
*/
|
|
607
1593
|
alignSelf?: 'start' | 'center' | 'baseline' | 'end' | 'stretch' | 'auto';
|
|
1594
|
+
/**
|
|
1595
|
+
* Sets how the item will grow or shrink when it's a direct ancestor of the Flex component.
|
|
1596
|
+
* ##### Options in detail
|
|
1597
|
+
*
|
|
1598
|
+
*- `initial`: The item is sized according to its width and height properties. It shrinks to its minimum size to fit the container, but does not grow to absorb any extra free space in the flex container.
|
|
1599
|
+
*- `auto`: The item is sized according to its width and height properties, but grows to absorb any extra free space in the flex container, and shrinks to its minimum size to fit the container.
|
|
1600
|
+
*- `none`: The item is sized according to its width and height properties. It is fully inflexible: it neither shrinks nor grows in relation to the flex container.
|
|
1601
|
+
*- `number`: Tells a component to fill all available space, shared evenly amongst other components with the same parent. The larger the flex given, the higher the ratio of space a component will take compared to its siblings.
|
|
1602
|
+
*
|
|
1603
|
+
* @defaultValue `"initial"`
|
|
1604
|
+
*/
|
|
608
1605
|
flex?: 'initial' | 'auto' | 'none' | number;
|
|
609
1606
|
}
|
|
610
|
-
interface TShirtSizes {
|
|
1607
|
+
export interface TShirtSizes {
|
|
611
1608
|
xs: 'extra-small' | 'xs';
|
|
612
1609
|
sm: 'small' | 'sm';
|
|
613
1610
|
md: 'medium' | 'md';
|
|
@@ -616,21 +1613,93 @@ interface TShirtSizes {
|
|
|
616
1613
|
}
|
|
617
1614
|
export type AllSizes = TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'] | TShirtSizes['xl'];
|
|
618
1615
|
export type AllDistances = 'flush' | AllSizes;
|
|
1616
|
+
/**
|
|
1617
|
+
* The props type for {@link !components.StepIndicator}.
|
|
1618
|
+
*
|
|
1619
|
+
* @category Component Props
|
|
1620
|
+
*/
|
|
619
1621
|
export interface StepIndicatorProps {
|
|
1622
|
+
/**
|
|
1623
|
+
* An array containing the name of each step.
|
|
1624
|
+
*/
|
|
620
1625
|
stepNames: string[];
|
|
1626
|
+
/**
|
|
1627
|
+
* The orientation of the indicator.
|
|
1628
|
+
*
|
|
1629
|
+
* @defaultValue `"horizontal"`
|
|
1630
|
+
*/
|
|
621
1631
|
direction?: 'horizontal' | 'vertical';
|
|
622
|
-
|
|
1632
|
+
/**
|
|
1633
|
+
* The size of the indicator circles.
|
|
1634
|
+
*
|
|
1635
|
+
* @defaultValue `"small"`
|
|
1636
|
+
*/
|
|
623
1637
|
circleSize?: AllSizes;
|
|
1638
|
+
/**
|
|
1639
|
+
* The currently active step. Steps are 0-based.
|
|
1640
|
+
*/
|
|
624
1641
|
currentStep?: number;
|
|
1642
|
+
/**
|
|
1643
|
+
* The visual style of the component.
|
|
1644
|
+
*
|
|
1645
|
+
* - default: default spacing.
|
|
1646
|
+
* - compact: only shows the title of the currently active step.
|
|
1647
|
+
* - flush: only shows the title of the currently active step and removes left and right margins.
|
|
1648
|
+
*
|
|
1649
|
+
* @defaultValue `"default"`
|
|
1650
|
+
*/
|
|
625
1651
|
variant?: 'default' | 'compact' | 'flush';
|
|
1652
|
+
/**
|
|
1653
|
+
* A function that will be invoked when a step in the indicator is clicked. The function receives the current step index as an argument (zero-based). Use this to update the currently active step.
|
|
1654
|
+
*
|
|
1655
|
+
* @event
|
|
1656
|
+
*/
|
|
1657
|
+
onClick?: (stepIndex: number) => void;
|
|
626
1658
|
}
|
|
1659
|
+
/**
|
|
1660
|
+
* The props type for {@link !components.Accordion}.
|
|
1661
|
+
*
|
|
1662
|
+
* @category Component Props
|
|
1663
|
+
*/
|
|
627
1664
|
export interface AccordionProps {
|
|
1665
|
+
/**
|
|
1666
|
+
* The title text for the accordion.
|
|
1667
|
+
*
|
|
1668
|
+
*/
|
|
628
1669
|
title: string;
|
|
1670
|
+
/**
|
|
1671
|
+
* The main content of the accordion when it opens.
|
|
1672
|
+
*
|
|
1673
|
+
*/
|
|
629
1674
|
children: ReactNode;
|
|
1675
|
+
/**
|
|
1676
|
+
* Defines default open behavior on page load. When set to `true`, the accordion will be open by default on initial load.
|
|
1677
|
+
*
|
|
1678
|
+
* @defaultValue `false`
|
|
1679
|
+
*/
|
|
630
1680
|
defaultOpen?: boolean;
|
|
1681
|
+
/**
|
|
1682
|
+
* When set to `true`, the accordion's open state cannot be changed.
|
|
1683
|
+
*
|
|
1684
|
+
* @defaultValue `false`
|
|
1685
|
+
*/
|
|
631
1686
|
disabled?: boolean;
|
|
1687
|
+
/**
|
|
1688
|
+
* For controlling the accordion's open state programmatically. When set to `true`, the accordion will open. Takes precedence over `defaultOpen`.
|
|
1689
|
+
*
|
|
1690
|
+
*/
|
|
632
1691
|
open?: boolean;
|
|
1692
|
+
/**
|
|
1693
|
+
* The size of the accordion title.
|
|
1694
|
+
*
|
|
1695
|
+
* @defaultValue `"small"`
|
|
1696
|
+
*/
|
|
633
1697
|
size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
|
|
1698
|
+
/**
|
|
1699
|
+
* A function that will be invoked when the title is clicked. It receives no arguments and its return value is ignored.
|
|
1700
|
+
*
|
|
1701
|
+
* @event
|
|
1702
|
+
*/
|
|
634
1703
|
onClick?: () => void;
|
|
635
1704
|
}
|
|
636
1705
|
export {};
|