@hubspot/ui-extensions 0.7.3 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -1,183 +1,851 @@
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
- export interface NumberInputProps extends Omit<BaseInputProps<number, number>, 'onInput'> {
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
- export interface DateInputProps extends Omit<BaseInputProps<BaseDate | null, DateInputEventsPayload>, 'onInput' | 'placeholder'> {
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
- /** @deprecated use maxValue instead */
121
- valueMax?: number;
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
- onClick?: () => void;
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
  }
790
+ export interface CheckboxProps {
791
+ /**
792
+ * A string representing the value of the checkbox. This is not displayed on the client-side,
793
+ * but on the server this is the value given to the data submitted with the checkbox's name.
794
+ */
795
+ value?: string;
796
+ /**
797
+ * The current status of the checkbox.
798
+ */
799
+ checked?: boolean;
800
+ /**
801
+ * When set to `true`, the option cannot be selected.
802
+ */
803
+ readonly?: boolean;
804
+ /**
805
+ * The string that displays below the toggle.
806
+ */
807
+ description?: string;
808
+ /**
809
+ * The unique identifier for the checkbox element.
810
+ */
811
+ name?: string;
812
+ /**
813
+ * The size variation of the checkbox.
814
+ *
815
+ * @defaultValue `"default"`
816
+ */
817
+ variant?: 'default' | 'small';
818
+ /**
819
+ * A function that is called with the checkbox status changes.
820
+ *
821
+ * @event
822
+ */
823
+ onChange?: (checked: boolean, value: string) => void;
824
+ /** The text that displays in the dropdown menu. */
825
+ children?: React.ReactNode;
826
+ /**
827
+ * Use the inline prop to arrange checkboxes side-by-side.
828
+ */
829
+ inline?: boolean;
830
+ /**
831
+ * When set to `true`, the option will be selected by default.
832
+ */
833
+ initialIsChecked?: boolean;
834
+ /**
835
+ * Accessibility label. It should be present when the checkbox has no label(children).
836
+ */
837
+ 'aria-label'?: string;
838
+ }
176
839
  export type ToggleGroupOption = {
840
+ /** The text that displays in the dropdown menu. */
177
841
  label: string;
842
+ /** The unique value that is submitted with the form. */
178
843
  value: string;
844
+ /** When set to `true`, the option will be selected by default. */
179
845
  initialIsChecked?: boolean;
846
+ /** When set to `true`, the option cannot be selected. */
180
847
  readonly?: boolean;
848
+ /** The string that displays below the toggle. */
181
849
  description?: string;
182
850
  };
183
851
  interface ToggleGroupListBaseProps {
@@ -195,26 +863,96 @@ export interface RadioButtonListProps extends ToggleGroupListBaseProps {
195
863
  onChange?: RadioButtonGroupProps['onChange'];
196
864
  }
197
865
  interface CheckboxGroupProps {
866
+ /**
867
+ * Denotes the type of list to render.
868
+ *
869
+ * @defaultValue `"checkboxList"`
870
+ */
198
871
  toggleType: 'checkboxList';
872
+ /**
873
+ * A function that is called with the new value or values when the list is updated.
874
+ *
875
+ * @event
876
+ */
199
877
  onChange?: (value: this['value']) => void;
878
+ /**
879
+ * The value of the toggle group.
880
+ */
200
881
  value?: string[];
201
882
  }
202
883
  interface RadioButtonGroupProps {
884
+ /**
885
+ * Denotes the type of list to render.
886
+ *
887
+ * @defaultValue `"checkboxList"`
888
+ */
203
889
  toggleType: 'radioButtonList';
890
+ /**
891
+ * A function that is called with the new value or values when the list is updated.
892
+ *
893
+ * @event
894
+ */
204
895
  onChange?: (value: this['value']) => void;
896
+ /**
897
+ * The value of the toggle group.
898
+ */
205
899
  value?: string;
206
900
  }
901
+ /**
902
+ * The props type for {@link !components.ToggleGroup}.
903
+ *
904
+ * @interface
905
+ * @category Component Props
906
+ */
207
907
  export type ToggleGroupProps = {
908
+ /**
909
+ * The unique identifier for the toggle group element.
910
+ */
208
911
  name: string;
912
+ /**
913
+ * The label that displays above the toggle group.
914
+ */
209
915
  label: string;
916
+ /**
917
+ * The text to display if the input has an error.
918
+ */
210
919
  validationMessage?: string;
920
+ /**
921
+ * When set to `true`, displays a required indicator next to the toggle group.
922
+ *
923
+ * @defaultValue `false`
924
+ */
211
925
  required?: boolean;
926
+ /**
927
+ * Text that will appear in a tooltip next to the toggle group label.
928
+ */
212
929
  tooltip?: string;
930
+ /**
931
+ * 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.
932
+ *
933
+ * @defaultValue `false`
934
+ */
213
935
  error?: boolean;
936
+ /**
937
+ * An array of options to display in the dropdown menu.
938
+ *
939
+ * @defaultValue `[]`
940
+ */
214
941
  options: Array<ToggleGroupOption>;
942
+ /**
943
+ * When set to `true`, stacks the options horizontally.
944
+ *
945
+ * @defaultValue `false`
946
+ */
215
947
  inline?: boolean;
948
+ /**
949
+ * The size variation of the individual options.
950
+ *
951
+ * @defaultValue `"default"`
952
+ */
216
953
  variant?: 'default' | 'small';
217
954
  } & (CheckboxGroupProps | RadioButtonGroupProps);
955
+ /** @ignore */
218
956
  export interface UserContext {
219
957
  id: number;
220
958
  emails: string[];
@@ -225,10 +963,12 @@ export interface UserContext {
225
963
  teams: Team[];
226
964
  locale?: string;
227
965
  }
966
+ /** @ignore */
228
967
  export interface PortalContext {
229
968
  id: number;
230
969
  timezone: string;
231
970
  }
971
+ /** @ignore */
232
972
  export interface Context {
233
973
  user: UserContext;
234
974
  portal: PortalContext;
@@ -241,28 +981,107 @@ export interface StackProps {
241
981
  align?: 'start' | 'center' | 'baseline' | 'end' | 'stretch';
242
982
  width?: 'auto' | '100%';
243
983
  }
984
+ /**
985
+ * The props type for {@link !components.Flex}.
986
+ *
987
+ * @category Component Props
988
+ */
244
989
  export interface FlexProps {
990
+ /**
991
+ * Sets the spacing between components.
992
+ *
993
+ * @defaultValue `"flush"`
994
+ */
245
995
  gap?: AllDistances;
996
+ /**
997
+ * Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
998
+ *
999
+ */
246
1000
  children?: ReactNode;
1001
+ /**
1002
+ * Arranges components `horizontally` or `vertically` by setting the main axis.
1003
+ *
1004
+ * @defaultValue `"row"`
1005
+ */
247
1006
  direction?: 'row' | 'column';
1007
+ /**
1008
+ * Distributes components along the main axis using the available free space.
1009
+ *
1010
+ * @defaultValue `"start"`
1011
+ */
248
1012
  justify?: 'center' | 'end' | 'start' | 'around' | 'between';
1013
+ /**
1014
+ * Distributes components along the cross-axis using the available free space.
1015
+ *
1016
+ * @defaultValue `"stretch"`
1017
+ */
249
1018
  align?: 'start' | 'center' | 'baseline' | 'end' | 'stretch';
1019
+ /**
1020
+ * 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.
1021
+ *
1022
+ */
250
1023
  alignSelf?: 'start' | 'center' | 'baseline' | 'end' | 'stretch';
1024
+ /**
1025
+ * Whether components will wrap instead of trying to fit on one line.
1026
+ *
1027
+ * @defaultValue `"nowrap"`
1028
+ */
251
1029
  wrap?: boolean | 'wrap' | 'nowrap';
252
1030
  }
1031
+ /**
1032
+ * The props type for {@link !components.StatisticsTrend}.
1033
+ *
1034
+ * @category Component Props
1035
+ */
253
1036
  export interface StatisticsTrendProps {
1037
+ /**
1038
+ * The text to be displayed as the trend value.
1039
+ */
254
1040
  value: string;
1041
+ /**
1042
+ * The direction of the trend arrow.
1043
+ *
1044
+ * @defaultValue `"increase"`
1045
+ */
255
1046
  direction: 'increase' | 'decrease';
256
1047
  }
1048
+ /**
1049
+ * The props type for {@link !components.StatisticsItem}.
1050
+ *
1051
+ * @category Component Props
1052
+ */
257
1053
  export interface StatisticsItemProps {
1054
+ /**
1055
+ * The unique identifier.
1056
+ */
258
1057
  id?: string;
1058
+ /**
1059
+ * The item's label text.
1060
+ */
259
1061
  label: string;
1062
+ /**
1063
+ * The string to be displayed as the item's primary number.
1064
+ */
260
1065
  number: string;
1066
+ /**
1067
+ * 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}.
1068
+ */
261
1069
  children: ReactNode;
262
1070
  }
1071
+ /**
1072
+ * The props type for {@link !components.Statistics}.
1073
+ *
1074
+ * @category Component Props
1075
+ */
263
1076
  export interface StatisticsProps {
1077
+ /**
1078
+ * 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}.
1079
+ */
264
1080
  children: ReactNode;
265
1081
  }
1082
+ /**
1083
+ * @category Serverless
1084
+ */
266
1085
  export interface ServerlessRunnerParams {
267
1086
  /**
268
1087
  * Name of the serverless function
@@ -282,10 +1101,16 @@ export interface ServerlessRunnerParams {
282
1101
  */
283
1102
  payload?: JsonValue;
284
1103
  }
1104
+ /**
1105
+ * @category Serverless
1106
+ */
285
1107
  export declare enum ServerlessExecutionStatus {
286
1108
  Success = "SUCCESS",
287
1109
  Error = "ERROR"
288
1110
  }
1111
+ /**
1112
+ * @category Serverless
1113
+ */
289
1114
  export type ServerlessExecutionResult = {
290
1115
  status: ServerlessExecutionStatus.Success;
291
1116
  response: JsonValue;
@@ -293,7 +1118,14 @@ export type ServerlessExecutionResult = {
293
1118
  status: ServerlessExecutionStatus.Error;
294
1119
  message: string;
295
1120
  };
1121
+ /**
1122
+ * @category Serverless
1123
+ */
296
1124
  export type ServerlessFuncRunner = (params: ServerlessRunnerParams) => Promise<ServerlessExecutionResult>;
1125
+ /**
1126
+ * @ignore
1127
+ * @category Serverless
1128
+ */
297
1129
  export interface ServerlessExecutionRequest {
298
1130
  appId: number;
299
1131
  extensibleCardId: number;
@@ -312,10 +1144,16 @@ export interface ServerlessExecutionRequest {
312
1144
  objectId?: number;
313
1145
  objectTypeId?: string;
314
1146
  }
1147
+ /**
1148
+ * @category Serverless
1149
+ */
315
1150
  export interface ServerlessExecutionResponse {
316
1151
  logId: string;
317
1152
  response?: JsonValue;
318
1153
  }
1154
+ /**
1155
+ * @category Serverless
1156
+ */
319
1157
  export interface ServerlessErrorResponse {
320
1158
  responseJSON?: {
321
1159
  message: string;
@@ -329,6 +1167,7 @@ export interface ServerlessErrorResponse {
329
1167
  };
330
1168
  status: number;
331
1169
  }
1170
+ /** @ignore */
332
1171
  export interface ExtensionCardContextData {
333
1172
  cardId: string;
334
1173
  cardTitle?: string;
@@ -338,39 +1177,35 @@ export interface ExtensionCardContextData {
338
1177
  objectTypeId: string;
339
1178
  location: keyof ExtensionPoints;
340
1179
  }
1180
+ /** @ignore */
341
1181
  export type ExtensionPointAction = (...args: any[]) => Promise<any> | void;
1182
+ /** @ignore */
342
1183
  export interface ExtensionPointContract {
343
1184
  actions?: {
344
1185
  [k: string]: ExtensionPointAction;
345
1186
  } | {};
346
1187
  customComponents: Record<string, ComponentType<any>>;
347
1188
  }
1189
+ /** @ignore */
348
1190
  type AlertType = 'info' | 'warning' | 'success' | 'danger' | 'tip' | undefined;
1191
+ /** @ignore */
349
1192
  export type AddAlertAction = (args: {
350
1193
  type?: AlertType;
351
1194
  message: string;
352
1195
  }) => void;
353
- export type NotifyObjectUpdateAction = (args: {
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;
1196
+ /** @ignore */
363
1197
  export type ReloadPageAction = () => void;
1198
+ /** @ignore */
364
1199
  export type FetchCrmObjectPropertiesAction = (properties: string[]) => Promise<Record<string, string>>;
1200
+ /** @ignore */
365
1201
  export type OpenIframeModalAction = (action: OpenIframeActionPayload) => void;
1202
+ /** @ignore */
366
1203
  export interface CrmMiddleExtensionPoint extends ExtensionPointContract {
367
1204
  actions: {
368
1205
  addAlert: AddAlertAction;
369
1206
  reloadPage: ReloadPageAction;
370
1207
  fetchCrmObjectProperties: FetchCrmObjectPropertiesAction;
371
1208
  openIframeModal: OpenIframeModalAction;
372
- notifyObjectUpdate?: NotifyObjectUpdateAction;
373
- listenForObjectUpdate?: ListenForObjectUpdateAction;
374
1209
  };
375
1210
  customComponents: {
376
1211
  CrmPropertyList: ComponentType<CrmPropertyListProps>;
@@ -386,6 +1221,7 @@ export interface CrmMiddleExtensionPoint extends ExtensionPointContract {
386
1221
  CrmCardActions?: ComponentType<CrmCardActionsProps>;
387
1222
  };
388
1223
  }
1224
+ /** @ignore */
389
1225
  export interface CrmSidebarExtensionPoint extends ExtensionPointContract {
390
1226
  actions: {
391
1227
  addAlert: AddAlertAction;
@@ -397,29 +1233,35 @@ export interface CrmSidebarExtensionPoint extends ExtensionPointContract {
397
1233
  [k: string]: never;
398
1234
  };
399
1235
  }
1236
+ /** @ignore */
400
1237
  export interface CrmDataHighlightProps {
401
1238
  properties: Array<string>;
402
1239
  objectTypeId?: string;
403
1240
  objectId?: number;
404
1241
  }
1242
+ /** @ignore */
405
1243
  export interface CrmReportProps {
406
1244
  reportId: string;
407
1245
  }
1246
+ /** @ignore */
408
1247
  export interface CrmPropertyListProps {
409
1248
  properties: Array<string>;
410
1249
  direction?: string;
411
1250
  objectTypeId?: string;
412
1251
  objectId?: number;
413
1252
  }
1253
+ /** @ignore */
414
1254
  export interface CrmObjectPropertyProps {
415
1255
  properties: Array<string>;
416
1256
  objectTypeId?: string;
417
1257
  objectId?: number;
418
1258
  }
1259
+ /** @ignore */
419
1260
  type CrmSortDescriptor = {
420
1261
  columnName: string;
421
1262
  direction: 1 | -1;
422
1263
  };
1264
+ /** @ignore */
423
1265
  interface CrmSearchFilter {
424
1266
  operator: 'EQ' | 'NEQ' | 'LT' | 'LTE' | 'GT' | 'GTE' | 'BETWEEN' | 'IN' | 'NOT_IN' | 'HAS_PROPERTY' | 'NOT_HAS_PROPERTY';
425
1267
  value?: string | number;
@@ -427,6 +1269,7 @@ interface CrmSearchFilter {
427
1269
  highValue?: string | number;
428
1270
  property: string;
429
1271
  }
1272
+ /** @ignore */
430
1273
  export interface CrmAssociationTableProps {
431
1274
  objectTypeId: string;
432
1275
  propertyColumns: Array<string>;
@@ -438,6 +1281,7 @@ export interface CrmAssociationTableProps {
438
1281
  preFilters?: Array<CrmSearchFilter>;
439
1282
  sort?: Array<CrmSortDescriptor>;
440
1283
  }
1284
+ /** @ignore */
441
1285
  export interface CrmAssociationPivotProps {
442
1286
  objectTypeId: string;
443
1287
  associationLabels?: Array<string>;
@@ -445,6 +1289,7 @@ export interface CrmAssociationPivotProps {
445
1289
  preFilters?: Array<CrmSearchFilter>;
446
1290
  sort?: Array<CrmSortDescriptor>;
447
1291
  }
1292
+ /** @ignore */
448
1293
  export interface CrmAssociationPropertyListProps {
449
1294
  objectTypeId: string;
450
1295
  properties: Array<string>;
@@ -452,16 +1297,19 @@ export interface CrmAssociationPropertyListProps {
452
1297
  filters?: Array<CrmSearchFilter>;
453
1298
  sort?: Array<CrmSortDescriptor>;
454
1299
  }
1300
+ /** @ignore */
455
1301
  export interface CrmStageTrackerProps {
456
1302
  objectId?: number;
457
1303
  objectTypeId?: string;
458
1304
  properties: Array<string>;
459
1305
  showProperties?: boolean;
460
1306
  }
1307
+ /** @ignore */
461
1308
  interface ObjectCoordinates {
462
1309
  objectTypeId: string;
463
1310
  objectId: number;
464
1311
  }
1312
+ /** @ignore */
465
1313
  interface OpenRecordAssociationFormArgs {
466
1314
  objectTypeId: string;
467
1315
  association: {
@@ -469,11 +1317,13 @@ interface OpenRecordAssociationFormArgs {
469
1317
  objectId: number;
470
1318
  };
471
1319
  }
1320
+ /** @ignore */
472
1321
  interface ActivityCreatorActionArgs {
473
1322
  objectTypeId: string;
474
1323
  objectId: number;
475
1324
  windowVariant?: 'windowed' | 'fullscreen';
476
1325
  }
1326
+ /** @ignore */
477
1327
  interface ActionArgs {
478
1328
  PREVIEW_OBJECT: ObjectCoordinates;
479
1329
  ADD_NOTE: ActivityCreatorActionArgs;
@@ -481,21 +1331,26 @@ interface ActionArgs {
481
1331
  SCHEDULE_MEETING: ActivityCreatorActionArgs;
482
1332
  OPEN_RECORD_ASSOCIATION_FORM: OpenRecordAssociationFormArgs;
483
1333
  }
1334
+ /** @ignore */
484
1335
  export type ArgsFor<SpecificActionType extends ActionType> = ActionArgs[SpecificActionType];
485
1336
  export type ActionType = 'PREVIEW_OBJECT' | 'ADD_NOTE' | 'SEND_EMAIL' | 'SCHEDULE_MEETING' | 'OPEN_RECORD_ASSOCIATION_FORM';
1337
+ /** @ignore */
486
1338
  interface BaseActionComponent {
487
1339
  children: ReactNode;
488
1340
  actionType: ActionType;
489
1341
  actionContext: ArgsFor<ActionType>;
490
1342
  onError?: (errors: string[]) => void;
491
1343
  }
1344
+ /** @ignore */
492
1345
  export interface CrmActionButtonProps extends BaseActionComponent {
493
1346
  variant?: 'primary' | 'secondary' | 'destructive';
494
1347
  type?: 'button' | 'reset' | 'submit';
495
1348
  }
1349
+ /** @ignore */
496
1350
  export interface CrmActionLinkProps extends BaseActionComponent {
497
1351
  variant?: 'primary' | 'light' | 'dark' | 'destructive';
498
1352
  }
1353
+ /** @ignore */
499
1354
  export interface ActionLibraryButtonCardActionConfig<SpecificActionType extends ActionType = ActionType> {
500
1355
  type: 'action-library-button';
501
1356
  actionType: SpecificActionType;
@@ -504,10 +1359,12 @@ export interface ActionLibraryButtonCardActionConfig<SpecificActionType extends
504
1359
  disabled?: boolean;
505
1360
  tooltipText?: string;
506
1361
  }
1362
+ /** @ignore */
507
1363
  export type DropdownCardActionConfigOptions = [
508
1364
  ActionLibraryButtonCardActionConfig,
509
1365
  ...ActionLibraryButtonCardActionConfig[]
510
1366
  ];
1367
+ /** @ignore */
511
1368
  export interface DropdownCardActionConfig {
512
1369
  type: 'dropdown';
513
1370
  options: DropdownCardActionConfigOptions;
@@ -515,12 +1372,16 @@ export interface DropdownCardActionConfig {
515
1372
  disabled?: boolean;
516
1373
  tooltipText?: string;
517
1374
  }
1375
+ /** @ignore */
518
1376
  type ErrorHandler = (errors: string[]) => void;
1377
+ /** @ignore */
519
1378
  type CardActionConfig = ActionLibraryButtonCardActionConfig | DropdownCardActionConfig;
1379
+ /** @ignore */
520
1380
  export type CrmCardActionsProps = {
521
1381
  actionConfigs: Array<CardActionConfig>;
522
1382
  onError?: ErrorHandler;
523
1383
  };
1384
+ /** @ignore */
524
1385
  interface RemotePlaygroundExtensionPoint extends ExtensionPointContract {
525
1386
  actions: {
526
1387
  warn: () => void;
@@ -529,6 +1390,7 @@ interface RemotePlaygroundExtensionPoint extends ExtensionPointContract {
529
1390
  ExampleCrmComponent: ComponentType<ExampleCrmComponentProps>;
530
1391
  };
531
1392
  }
1393
+ /** @ignore */
532
1394
  export interface ExtensionPoints {
533
1395
  'uie.playground.middle': RemotePlaygroundExtensionPoint;
534
1396
  'crm.record.tab': CrmMiddleExtensionPoint;
@@ -539,51 +1401,182 @@ export interface ExampleCrmComponentProps {
539
1401
  size: 'sm' | 'md' | 'lg';
540
1402
  count: number;
541
1403
  }
1404
+ /** @ignore */
542
1405
  export interface ExtensionPointApi<ExtensionPointName extends keyof ExtensionPoints> {
543
1406
  context: Context;
544
1407
  runServerlessFunction: ServerlessFuncRunner;
545
1408
  actions: ExtensionPoints[ExtensionPointName]['actions'];
546
1409
  }
1410
+ /** @ignore */
547
1411
  interface OpenIframeActionPayload {
548
1412
  uri: string;
549
1413
  height: number;
550
1414
  width: number;
551
1415
  associatedObjectProperties?: string[];
552
1416
  }
1417
+ /**
1418
+ * The props type for {@link !components.LoadingSpinner}.
1419
+ *
1420
+ * @category Component Props
1421
+ */
553
1422
  export interface LoadingSpinnerProps {
1423
+ /**
1424
+ * The text that displays next to the spinner.
1425
+ *
1426
+ */
554
1427
  label: string;
1428
+ /**
1429
+ * When set to `true`, the label will appear next to the spinner.
1430
+ *
1431
+ * @defaultValue `false`
1432
+ */
555
1433
  showLabel?: boolean;
1434
+ /**
1435
+ * The size of the spinner.
1436
+ *
1437
+ * @defaultValue `"sm"`
1438
+ */
556
1439
  size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
1440
+ /**
1441
+ * The position of the spinner. Can be one of `inline` or `centered`.
1442
+ *
1443
+ * @defaultValue `"inline"`
1444
+ */
557
1445
  layout?: 'inline' | 'centered';
558
1446
  }
559
- interface AlignmentProps {
1447
+ export interface AlignmentProps {
560
1448
  align?: 'left' | 'center' | 'right';
561
1449
  }
562
- interface WidthProps {
1450
+ export interface WidthProps {
563
1451
  width?: 'min' | 'max' | 'auto' | number;
564
1452
  }
565
1453
  export interface TableElementProps {
566
1454
  children: React.ReactNode;
567
1455
  }
568
- export type TableHeaderProps = TableElementProps & AlignmentProps & WidthProps;
1456
+ /**
1457
+ * @property align Sets the alignment of a table header.
1458
+ * @property width Sets the width of a table header.
1459
+ *
1460
+ * @interface
1461
+ */
1462
+ export type BaseTableHeaderProps = TableElementProps & AlignmentProps & WidthProps;
569
1463
  export type TableCellProps = TableElementProps & AlignmentProps & WidthProps;
1464
+ /**
1465
+ * The props type for {@link !components.TableHeader} when sorted === never.
1466
+ *
1467
+ * @category Component Props
1468
+ */
1469
+ export interface UnSortedTableHeaderProps extends BaseTableHeaderProps {
1470
+ sortDirection?: 'never';
1471
+ }
1472
+ /**
1473
+ * The props type for {@link !components.TableHeader} when sorted !== never.
1474
+ *
1475
+ * @category Component Props
1476
+ */
1477
+ export interface SortedTableHeaderProps extends BaseTableHeaderProps {
1478
+ /**
1479
+ * Sets the current direction in which the column is sorted (if any). It's a visual indicator, it doesn't modify the data.
1480
+ *
1481
+ * @defaultValue `"none"`
1482
+ */
1483
+ sortDirection: 'ascending' | 'descending' | 'none';
1484
+ /**
1485
+ * A callback function that is invoked when the header is clicked. It recieves the new `sortDirection` as an argument.
1486
+ * It's required when sort = `ascending`, `descending` or `none`.
1487
+ *
1488
+ * @event
1489
+ * @defaultValue `"none"`
1490
+ */
1491
+ onSortChange: (value: NonNullable<SortedTableHeaderProps['sortDirection']>) => void;
1492
+ /**
1493
+ * If `true`, users cannot change the sort ordering. It has no effect if sort=`never` or `undefined`.
1494
+ *
1495
+ * @defaultValue `false`
1496
+ */
1497
+ disabled?: boolean;
1498
+ }
1499
+ /**
1500
+ * The props type for {@link !components.TableHeader}.
1501
+ *
1502
+ * @category Component Props
1503
+ */
1504
+ export type TableHeaderProps = SortedTableHeaderProps | UnSortedTableHeaderProps;
570
1505
  interface BaseTableProps {
1506
+ /**
1507
+ * When set to false, the table will not have borders.
1508
+ *
1509
+ * @defaultValue `true`
1510
+ */
571
1511
  bordered?: boolean;
1512
+ /**
1513
+ * When set to `true`, the table will not have bottom margin.
1514
+ *
1515
+ * @defaultValue `false`
1516
+ */
572
1517
  flush?: boolean;
1518
+ /**
1519
+ * 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.
1520
+ */
573
1521
  children: React.ReactNode;
574
1522
  }
1523
+ /**
1524
+ * @internal
1525
+ */
575
1526
  export interface TableNoPaginatedProps extends BaseTableProps {
1527
+ /**
1528
+ * When set to `true`, the table will include pagination navigation. Take a look at {@link !types.TablePaginatedProps} for pagination props.
1529
+ *
1530
+ * @defaultValue `false`
1531
+ */
576
1532
  paginated?: false;
577
1533
  }
1534
+ /**
1535
+ * @internal
1536
+ */
578
1537
  export interface TablePaginatedProps extends BaseTableProps {
1538
+ /**
1539
+ * When set to `true`, the table will include pagination navigation. Take a look at {@link !types.TablePaginatedProps} for pagination props.
1540
+ *
1541
+ * @defaultValue `false`
1542
+ */
579
1543
  paginated: true;
1544
+ /**
1545
+ * The total number of pages available.
1546
+ */
580
1547
  pageCount: number;
581
- onPageChange: (pageNumber: number) => void;
1548
+ /**
1549
+ * When set to `false`, hides the text labels for the First/Prev/Next buttons. The button labels will still be accessible to screen readers.
1550
+ *
1551
+ * @defaultValue `true`
1552
+ */
582
1553
  showButtonLabels?: boolean;
1554
+ /**
1555
+ * When set to `true`, displays the **First/Last** page buttons.
1556
+ *
1557
+ * @defaultValue `false`
1558
+ */
583
1559
  showFirstLastButtons?: boolean;
1560
+ /**
1561
+ * Sets how many page buttons are displayed.
1562
+ */
584
1563
  maxVisiblePageButtons?: number;
1564
+ /**
1565
+ * Denotes the current page.
1566
+ */
585
1567
  page?: number;
1568
+ /**
1569
+ * A function that will be invoked when the pagination button is clicked. It receives the new page number as argument.
1570
+ *
1571
+ * @event
1572
+ */
1573
+ onPageChange: (pageNumber: number) => void;
586
1574
  }
1575
+ /**
1576
+ * The props type for {@link !components.Table}.
1577
+ *
1578
+ * @category Component Props
1579
+ */
587
1580
  export type TableProps = TableNoPaginatedProps | TablePaginatedProps;
588
1581
  export declare class RemoteEvent<V> {
589
1582
  type: string;
@@ -592,22 +1585,75 @@ export declare class RemoteEvent<V> {
592
1585
  targetValue: V;
593
1586
  constructor(value: V, event: Event);
594
1587
  }
1588
+ /**
1589
+ * The props type for {@link !components.Link}.
1590
+ *
1591
+ * @category Component Props
1592
+ */
595
1593
  export interface LinkProps {
1594
+ /**
1595
+ * Sets the content that will render inside the component.
1596
+ *
1597
+ */
596
1598
  children: ReactNode;
1599
+ /**
1600
+ * 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.
1601
+ *
1602
+ */
597
1603
  href: string;
1604
+ /**
1605
+ * The color variation of the link.
1606
+ *
1607
+ * @defaultValue `"primary"`
1608
+ */
598
1609
  variant?: 'primary' | 'destructive' | 'light' | 'dark';
1610
+ /**
1611
+ * A function that will be invoked with the link is clicked. The function receives no arguments and its return value is ignored.
1612
+ *
1613
+ * @event
1614
+ */
599
1615
  onClick?: () => void;
1616
+ /**
1617
+ * When set to true, `event.preventDefault()` will be invoked before the `onClick` function is called, preventing automatic navigation to the href URL.
1618
+ *
1619
+ * @defaultValue `false`
1620
+ */
600
1621
  preventDefault?: boolean;
601
1622
  }
602
1623
  export type JsonValue = string | number | boolean | null | JsonValue[] | {
603
1624
  [key: string]: JsonValue;
604
1625
  };
1626
+ /**
1627
+ * The props type for {@link !components.Box}.
1628
+ *
1629
+ * @category Component Props
1630
+ */
605
1631
  export interface BoxProps {
1632
+ /**
1633
+ * Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
1634
+ *
1635
+ */
606
1636
  children: ReactNode;
1637
+ /**
1638
+ * Overrides Flex's `alignItem` value for this element.
1639
+ *
1640
+ * @defaultValue `"auto"`
1641
+ */
607
1642
  alignSelf?: 'start' | 'center' | 'baseline' | 'end' | 'stretch' | 'auto';
1643
+ /**
1644
+ * Sets how the item will grow or shrink when it's a direct ancestor of the Flex component.
1645
+ * ##### Options in detail
1646
+ *
1647
+ *- `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.
1648
+ *- `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.
1649
+ *- `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.
1650
+ *- `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.
1651
+ *
1652
+ * @defaultValue `"initial"`
1653
+ */
608
1654
  flex?: 'initial' | 'auto' | 'none' | number;
609
1655
  }
610
- interface TShirtSizes {
1656
+ export interface TShirtSizes {
611
1657
  xs: 'extra-small' | 'xs';
612
1658
  sm: 'small' | 'sm';
613
1659
  md: 'medium' | 'md';
@@ -616,21 +1662,93 @@ interface TShirtSizes {
616
1662
  }
617
1663
  export type AllSizes = TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'] | TShirtSizes['xl'];
618
1664
  export type AllDistances = 'flush' | AllSizes;
1665
+ /**
1666
+ * The props type for {@link !components.StepIndicator}.
1667
+ *
1668
+ * @category Component Props
1669
+ */
619
1670
  export interface StepIndicatorProps {
1671
+ /**
1672
+ * An array containing the name of each step.
1673
+ */
620
1674
  stepNames: string[];
1675
+ /**
1676
+ * The orientation of the indicator.
1677
+ *
1678
+ * @defaultValue `"horizontal"`
1679
+ */
621
1680
  direction?: 'horizontal' | 'vertical';
622
- onClick?: (stepIndex: number) => void;
1681
+ /**
1682
+ * The size of the indicator circles.
1683
+ *
1684
+ * @defaultValue `"small"`
1685
+ */
623
1686
  circleSize?: AllSizes;
1687
+ /**
1688
+ * The currently active step. Steps are 0-based.
1689
+ */
624
1690
  currentStep?: number;
1691
+ /**
1692
+ * The visual style of the component.
1693
+ *
1694
+ * - default: default spacing.
1695
+ * - compact: only shows the title of the currently active step.
1696
+ * - flush: only shows the title of the currently active step and removes left and right margins.
1697
+ *
1698
+ * @defaultValue `"default"`
1699
+ */
625
1700
  variant?: 'default' | 'compact' | 'flush';
1701
+ /**
1702
+ * 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.
1703
+ *
1704
+ * @event
1705
+ */
1706
+ onClick?: (stepIndex: number) => void;
626
1707
  }
1708
+ /**
1709
+ * The props type for {@link !components.Accordion}.
1710
+ *
1711
+ * @category Component Props
1712
+ */
627
1713
  export interface AccordionProps {
1714
+ /**
1715
+ * The title text for the accordion.
1716
+ *
1717
+ */
628
1718
  title: string;
1719
+ /**
1720
+ * The main content of the accordion when it opens.
1721
+ *
1722
+ */
629
1723
  children: ReactNode;
1724
+ /**
1725
+ * Defines default open behavior on page load. When set to `true`, the accordion will be open by default on initial load.
1726
+ *
1727
+ * @defaultValue `false`
1728
+ */
630
1729
  defaultOpen?: boolean;
1730
+ /**
1731
+ * When set to `true`, the accordion's open state cannot be changed.
1732
+ *
1733
+ * @defaultValue `false`
1734
+ */
631
1735
  disabled?: boolean;
1736
+ /**
1737
+ * For controlling the accordion's open state programmatically. When set to `true`, the accordion will open. Takes precedence over `defaultOpen`.
1738
+ *
1739
+ */
632
1740
  open?: boolean;
1741
+ /**
1742
+ * The size of the accordion title.
1743
+ *
1744
+ * @defaultValue `"small"`
1745
+ */
633
1746
  size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
1747
+ /**
1748
+ * A function that will be invoked when the title is clicked. It receives no arguments and its return value is ignored.
1749
+ *
1750
+ * @event
1751
+ */
634
1752
  onClick?: () => void;
635
1753
  }
636
1754
  export {};