@lumx/react 3.0.3 → 3.0.4-alpha.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.
Files changed (48) hide show
  1. package/index.d.ts +8 -0
  2. package/index.js +17 -11
  3. package/index.js.map +1 -1
  4. package/package.json +17 -23
  5. package/src/components/alert-dialog/__snapshots__/AlertDialog.test.tsx.snap +23 -23
  6. package/src/components/autocomplete/Autocomplete.tsx +8 -0
  7. package/src/components/autocomplete/__snapshots__/Autocomplete.test.tsx.snap +4 -4
  8. package/src/components/autocomplete/__snapshots__/AutocompleteMultiple.test.tsx.snap +1 -1
  9. package/src/components/avatar/__snapshots__/Avatar.test.tsx.snap +6 -6
  10. package/src/components/button/__snapshots__/ButtonRoot.test.tsx.snap +1 -1
  11. package/src/components/date-picker/__snapshots__/DatePicker.test.tsx.snap +2 -2
  12. package/src/components/date-picker/__snapshots__/DatePickerField.test.tsx.snap +2 -2
  13. package/src/components/dialog/__snapshots__/Dialog.test.tsx.snap +22 -22
  14. package/src/components/dropdown/Dropdown.tsx +2 -0
  15. package/src/components/dropdown/__snapshots__/Dropdown.test.tsx.snap +2 -2
  16. package/src/components/flag/__snapshots__/Flag.test.tsx.snap +1 -1
  17. package/src/components/flex-box/__snapshots__/FlexBox.test.tsx.snap +31 -31
  18. package/src/components/heading/Heading.test.tsx +32 -27
  19. package/src/components/icon/__snapshots__/Icon.test.tsx.snap +2 -2
  20. package/src/components/image-block/__snapshots__/ImageBlock.test.tsx.snap +1 -1
  21. package/src/components/inline-list/InlineList.tsx +3 -1
  22. package/src/components/lightbox/__snapshots__/Lightbox.test.tsx.snap +7 -7
  23. package/src/components/list/__snapshots__/List.test.tsx.snap +13 -13
  24. package/src/components/notification/__snapshots__/Notification.test.tsx.snap +1 -1
  25. package/src/components/popover/__snapshots__/Popover.test.tsx.snap +52 -52
  26. package/src/components/post-block/__snapshots__/PostBlock.test.tsx.snap +4 -4
  27. package/src/components/progress-tracker/__snapshots__/ProgressTracker.test.tsx.snap +2 -2
  28. package/src/components/select/__snapshots__/Select.test.tsx.snap +2 -2
  29. package/src/components/select/__snapshots__/SelectMultiple.test.tsx.snap +6 -6
  30. package/src/components/skeleton/__snapshots__/SkeletonCircle.test.tsx.snap +1 -1
  31. package/src/components/skeleton/__snapshots__/SkeletonRectangle.test.tsx.snap +1 -1
  32. package/src/components/skeleton/__snapshots__/SkeletonTypography.test.tsx.snap +15 -15
  33. package/src/components/slider/__snapshots__/Slider.test.tsx.snap +4 -4
  34. package/src/components/slideshow/__snapshots__/Slideshow.test.tsx.snap +10 -10
  35. package/src/components/table/__snapshots__/Table.test.tsx.snap +1 -1
  36. package/src/components/text/Text.test.tsx +67 -35
  37. package/src/components/text/Text.tsx +8 -7
  38. package/src/components/text-field/TextField.test.tsx +75 -117
  39. package/src/components/text-field/__snapshots__/TextField.test.tsx.snap +12 -17
  40. package/src/components/thumbnail/__snapshots__/Thumbnail.test.tsx.snap +6 -6
  41. package/src/components/tooltip/__snapshots__/Tooltip.test.tsx.snap +6 -6
  42. package/src/components/user-block/__snapshots__/UserBlock.test.tsx.snap +11 -11
  43. package/src/stories/generated/Dropdown/Demos.stories.tsx +1 -0
  44. package/src/testing/utils/commonTestsSuiteRTL.ts +55 -0
  45. package/src/testing/utils/index.ts +1 -0
  46. package/src/testing/utils/queries.ts +19 -0
  47. package/src/utils/focus/getFocusableElements.test.ts +12 -12
  48. package/types.d.ts +0 -2847
package/types.d.ts DELETED
@@ -1,2847 +0,0 @@
1
- // Generated by dts-bundle-generator v5.6.0
2
-
3
- /// <reference types="cheerio" />
4
- /// <reference types="node" />
5
- /// <reference types="prop-types" />
6
-
7
- import * as CSS from 'csstype';
8
- import * as PropTypes from 'prop-types';
9
- import React from 'react';
10
- import { AriaAttributes, ButtonHTMLAttributes, CSSProperties, DetailedHTMLProps, ImgHTMLAttributes, InputHTMLAttributes, Key, KeyboardEventHandler, MouseEventHandler, ReactElement, ReactNode, Ref, RefObject, SetStateAction, SyntheticEvent } from 'react';
11
-
12
- /** Get types of the values of a record. */
13
- export declare type ValueOf<T extends Record<any, any>> = T[keyof T];
14
- /** LumX Component Type. */
15
- export declare type Comp<P, T = HTMLElement> = {
16
- (props: P & {
17
- ref?: Ref<T>;
18
- }): ReactElement | null;
19
- /** React component type. */
20
- readonly $$typeof: symbol;
21
- /** Component default props. */
22
- defaultProps?: Partial<P>;
23
- /** Component name. */
24
- displayName?: string;
25
- /** Component base class name. */
26
- className?: string;
27
- };
28
- /** Union type of all heading elements */
29
- export declare type HeadingElement = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
30
- /** Union type of all text elements */
31
- export declare type TextElement = "span" | "p" | HeadingElement;
32
- export interface HasTheme {
33
- /**
34
- * Theme adapting the component to light or dark background.
35
- */
36
- theme?: Theme;
37
- }
38
- /**
39
- * Define a generic props types.
40
- */
41
- export interface GenericProps {
42
- /**
43
- * Class name forwarded to the root element of the component.
44
- */
45
- className?: string;
46
- /**
47
- * Any prop (particularly any supported prop for a HTML element).
48
- */
49
- [propName: string]: any;
50
- }
51
- /**
52
- * Callback function type alias (use for readability)
53
- */
54
- export declare type Callback = () => void;
55
- /**
56
- * JS falsy values.
57
- * (excluding `NaN` as it can't be distinguished from `number`)
58
- */
59
- export declare type Falsy = false | undefined | null | 0 | "";
60
- /**
61
- * Alignments.
62
- */
63
- export declare const Alignment: {
64
- readonly bottom: "bottom";
65
- readonly center: "center";
66
- readonly end: "end";
67
- readonly left: "left";
68
- readonly right: "right";
69
- readonly spaceAround: "space-around";
70
- readonly spaceBetween: "space-between";
71
- readonly spaceEvenly: "space-evenly";
72
- readonly start: "start";
73
- readonly top: "top";
74
- };
75
- export declare type Alignment = ValueOf<typeof Alignment>;
76
- export declare type VerticalAlignment = Extract<Alignment, "top" | "center" | "bottom">;
77
- export declare type HorizontalAlignment = Extract<Alignment, "right" | "center" | "left">;
78
- /**
79
- * See SCSS variable $lumx-color-palette
80
- */
81
- export declare const ColorPalette: {
82
- readonly primary: "primary";
83
- readonly secondary: "secondary";
84
- readonly blue: "blue";
85
- readonly dark: "dark";
86
- readonly green: "green";
87
- readonly yellow: "yellow";
88
- readonly red: "red";
89
- readonly light: "light";
90
- readonly grey: "grey";
91
- };
92
- export declare type ColorPalette = ValueOf<typeof ColorPalette>;
93
- export declare type Color = ColorPalette | string;
94
- /**
95
- * See SCSS variable $lumx-color-variants
96
- */
97
- export declare const ColorVariant: {
98
- readonly D1: "D1";
99
- readonly D2: "D2";
100
- readonly L1: "L1";
101
- readonly L2: "L2";
102
- readonly L3: "L3";
103
- readonly L4: "L4";
104
- readonly L5: "L5";
105
- readonly L6: "L6";
106
- readonly N: "N";
107
- };
108
- export declare type ColorVariant = ValueOf<typeof ColorVariant>;
109
- export declare const Theme: {
110
- readonly light: "light";
111
- readonly dark: "dark";
112
- };
113
- export declare type Theme = ValueOf<typeof Theme>;
114
- export declare const Size: {
115
- readonly xxs: "xxs";
116
- readonly xs: "xs";
117
- readonly s: "s";
118
- readonly m: "m";
119
- readonly l: "l";
120
- readonly xl: "xl";
121
- readonly xxl: "xxl";
122
- readonly tiny: "tiny";
123
- readonly regular: "regular";
124
- readonly medium: "medium";
125
- readonly big: "big";
126
- readonly huge: "huge";
127
- };
128
- export declare type Size = ValueOf<typeof Size>;
129
- export declare type GlobalSize = Extract<Size, "xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl">;
130
- export declare const Orientation: {
131
- readonly horizontal: "horizontal";
132
- readonly vertical: "vertical";
133
- };
134
- export declare type Orientation = ValueOf<typeof Orientation>;
135
- export declare const Emphasis: {
136
- readonly low: "low";
137
- readonly medium: "medium";
138
- readonly high: "high";
139
- };
140
- export declare type Emphasis = ValueOf<typeof Emphasis>;
141
- /**
142
- * List of typographies that can't be customized.
143
- */
144
- export declare const TypographyInterface: {
145
- readonly overline: "overline";
146
- readonly caption: "caption";
147
- readonly body1: "body1";
148
- readonly body2: "body2";
149
- readonly subtitle1: "subtitle1";
150
- readonly subtitle2: "subtitle2";
151
- readonly title: "title";
152
- readonly headline: "headline";
153
- readonly display1: "display1";
154
- };
155
- export declare type TypographyInterface = ValueOf<typeof TypographyInterface>;
156
- /**
157
- * List of title typographies that can be customized (via CSS variables).
158
- */
159
- export declare const TypographyTitleCustom: {
160
- readonly title1: "custom-title1";
161
- readonly title2: "custom-title2";
162
- readonly title3: "custom-title3";
163
- readonly title4: "custom-title4";
164
- readonly title5: "custom-title5";
165
- readonly title6: "custom-title6";
166
- };
167
- export declare type TypographyTitleCustom = ValueOf<typeof TypographyTitleCustom>;
168
- /**
169
- * List of typographies that can be customized (via CSS variables).
170
- */
171
- export declare const TypographyCustom: {
172
- readonly intro: "custom-intro";
173
- readonly "body-large": "custom-body-large";
174
- readonly body: "custom-body";
175
- readonly quote: "custom-quote";
176
- readonly "publish-info": "custom-publish-info";
177
- readonly button: "custom-button";
178
- readonly title1: "custom-title1";
179
- readonly title2: "custom-title2";
180
- readonly title3: "custom-title3";
181
- readonly title4: "custom-title4";
182
- readonly title5: "custom-title5";
183
- readonly title6: "custom-title6";
184
- };
185
- export declare type TypographyCustom = ValueOf<typeof TypographyCustom>;
186
- /**
187
- * List of all typographies.
188
- */
189
- export declare const Typography: {
190
- readonly custom: {
191
- readonly intro: "custom-intro";
192
- readonly "body-large": "custom-body-large";
193
- readonly body: "custom-body";
194
- readonly quote: "custom-quote";
195
- readonly "publish-info": "custom-publish-info";
196
- readonly button: "custom-button";
197
- readonly title1: "custom-title1";
198
- readonly title2: "custom-title2";
199
- readonly title3: "custom-title3";
200
- readonly title4: "custom-title4";
201
- readonly title5: "custom-title5";
202
- readonly title6: "custom-title6";
203
- };
204
- readonly overline: "overline";
205
- readonly caption: "caption";
206
- readonly body1: "body1";
207
- readonly body2: "body2";
208
- readonly subtitle1: "subtitle1";
209
- readonly subtitle2: "subtitle2";
210
- readonly title: "title";
211
- readonly headline: "headline";
212
- readonly display1: "display1";
213
- };
214
- export declare type Typography = TypographyInterface | TypographyCustom;
215
- /**
216
- * All available aspect ratios.
217
- */
218
- export declare const AspectRatio: {
219
- /** Intrinsic content ratio. */
220
- readonly original: "original";
221
- /** Ratio 16:9 */
222
- readonly wide: "wide";
223
- /** Ratio 3:2 */
224
- readonly horizontal: "horizontal";
225
- /** Ratio 3:2 */
226
- readonly vertical: "vertical";
227
- /** Ratio 1:1 */
228
- readonly square: "square";
229
- /** Ratio constrained by the parent. */
230
- readonly free: "free";
231
- };
232
- export declare type AspectRatio = ValueOf<typeof AspectRatio>;
233
- /**
234
- * Semantic info about the purpose of the component
235
- */
236
- export declare const Kind: {
237
- readonly info: "info";
238
- readonly success: "success";
239
- readonly warning: "warning";
240
- readonly error: "error";
241
- };
242
- export declare type Kind = ValueOf<typeof Kind>;
243
- export interface AlertDialogProps extends Omit<DialogProps, "header" | "footer"> {
244
- /** Message variant. */
245
- kind?: Kind;
246
- /** Dialog title. */
247
- title?: string;
248
- /** Props forwarded to the confirm button */
249
- confirmProps: ButtonProps & {
250
- onClick(): void;
251
- label: string;
252
- };
253
- /**
254
- * Props forwarded to the cancel button.
255
- * Will not render a cancel button if undefined.
256
- */
257
- cancelProps?: ButtonProps & {
258
- onClick(): void;
259
- label: string;
260
- };
261
- }
262
- /**
263
- * AlertDialog component.
264
- *
265
- * An alert dialog is a modal dialog that interrupts the user's workflow to
266
- * communicate an important message and acquire a response.
267
- *
268
- * It should not have a complex content.
269
- * Children of this component should only be strings, paragraphs or links.
270
- */
271
- export declare const AlertDialog: Comp<AlertDialogProps, HTMLDivElement>;
272
- /**
273
- * Defines the props of the component.
274
- */
275
- export interface AutocompleteProps extends GenericProps, HasTheme {
276
- /**
277
- * Whether the suggestions list should display anchored to the input or to the wrapper.
278
- * @see {@link DropdownProps#anchorToInput}
279
- */
280
- anchorToInput?: boolean;
281
- /**
282
- * Props to pass to the clear button (minus those already set by the TextField props).
283
- * If not specified, the button won't be displayed.
284
- * @see {@link TextFieldProps#clearButtonProps}
285
- */
286
- clearButtonProps?: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis">;
287
- /**
288
- * Reference to the <input> or <textarea> element.
289
- * @see {@link TextFieldProps#inputRef}
290
- */
291
- inputRef?: TextFieldProps["inputRef"];
292
- /**
293
- * The offset that will be applied to the Dropdown position.
294
- * @see {@link DropdownProps#offset}
295
- */
296
- offset?: Offset;
297
- /**
298
- * The preferred Dropdown location against the anchor element.
299
- * @see {@link DropdownProps#placement}
300
- */
301
- placement?: Placement;
302
- /**
303
- * Whether the dropdown should fit to the anchor width or not.
304
- * @see {@link DropdownProps#fitToAnchorWidth}
305
- */
306
- fitToAnchorWidth?: boolean;
307
- /**
308
- * The error related to the component.
309
- * @see {@link TextFieldProps#error}
310
- */
311
- error?: string | ReactNode;
312
- /**
313
- * Whether the text field is displayed with error style or not.
314
- * @see {@link TextFieldProps#hasError}
315
- */
316
- hasError?: boolean;
317
- /**
318
- * Whether the text box should be focused upon closing the suggestions or not.
319
- */
320
- shouldFocusOnClose?: boolean;
321
- /**
322
- * The helper message of the text field.
323
- * @see {@link TextFieldProps#helper}
324
- */
325
- helper?: string;
326
- /**
327
- * The icon of the text field (SVG path).
328
- * @see {@link TextFieldProps#icon}
329
- */
330
- icon?: string;
331
- /**
332
- * Whether the component is disabled or not.
333
- * @see {@link TextFieldProps#isDisabled}
334
- */
335
- isDisabled?: boolean;
336
- /**
337
- * Whether the component is required or not.
338
- * @see {@link TextFieldProps#isRequired}
339
- */
340
- isRequired?: boolean;
341
- /**
342
- * Whether the text field is displayed with valid style or not.
343
- * @see {@link TextFieldProps#isValid}
344
- */
345
- isValid?: boolean;
346
- /**
347
- * The label of the text field displayed in a label tag.
348
- * @see {@link TextFieldProps#label}
349
- */
350
- label?: string;
351
- /**
352
- * The placeholder message of the text field.
353
- * @see {@link TextFieldProps#placeholder}
354
- */
355
- placeholder?: string;
356
- /** List of suggestions to display during autocomplete. */
357
- children: React.ReactNode;
358
- /**
359
- * The list of chips to be displayed before the text field input.
360
- */
361
- chips?: React.ReactNode;
362
- /**
363
- * The value of the text field.
364
- * @see {@link TextFieldProps#value}
365
- */
366
- value: string;
367
- /**
368
- * Whether the suggestions from the autocomplete should be displayed or not.
369
- * @see {@link DropdownProps#isOpen}
370
- */
371
- isOpen: boolean;
372
- /**
373
- * The native input name property.
374
- * @see {@link TextFieldProps#name}
375
- */
376
- name?: string;
377
- /**
378
- * Whether a click in the Autocomplete dropdown would close it or not.
379
- * @see {@link DropdownProps#closeOnClick}
380
- */
381
- closeOnClick?: boolean;
382
- /**
383
- * Whether a click anywhere out of the Autocomplete would close it or not.
384
- * @see {@link DropdownProps#closeOnClickAway}
385
- */
386
- closeOnClickAway?: boolean;
387
- /**
388
- * Whether an escape key press would close the Autocomplete or not.
389
- * @see {@link DropdownProps#closeOnEscape}
390
- */
391
- closeOnEscape?: boolean;
392
- /**
393
- * The function called on blur.
394
- * @see {@link TextFieldProps#onBlur}
395
- */
396
- onBlur?(event: React.FocusEvent): void;
397
- /**
398
- * On change callback.
399
- * @see {@link TextFieldProps#onChange}
400
- */
401
- onChange(value: string, name?: string, event?: SyntheticEvent): void;
402
- /**
403
- * The function called on close.
404
- * @see {@link DropdownProps#onClose}
405
- */
406
- onClose?(): void;
407
- /**
408
- * The function called on focus.
409
- * @see {@link TextFieldProps#onFocus}
410
- */
411
- onFocus?(event: React.FocusEvent): void;
412
- /**
413
- * The function called when the bottom of the dropdown is reached.
414
- * @see {@link DropdownProps#onInfiniteScroll}
415
- */
416
- onInfiniteScroll?(): void;
417
- }
418
- /**
419
- * Autocomplete component.
420
- *
421
- * @param props Component props.
422
- * @param ref Component ref.
423
- * @return React element.
424
- */
425
- export declare const Autocomplete: Comp<AutocompleteProps, HTMLDivElement>;
426
- /**
427
- * Defines the props of the component.
428
- */
429
- export interface AutocompleteMultipleProps extends AutocompleteProps {
430
- /** Selected values. */
431
- values: any[];
432
- /** Alignment of the chips in the autocomplete. */
433
- chipsAlignment?: HorizontalAlignment;
434
- /** Selected value render function. Default: Renders the value inside of a Chip. */
435
- selectedChipRender(choice: any, index: number, onClear?: (event: React.MouseEvent, choice: any) => void, isDisabled?: boolean): ReactNode | string;
436
- }
437
- /**
438
- * AutocompleteMultiple component.
439
- *
440
- * @param props Component props.
441
- * @param ref Component ref.
442
- * @return React element.
443
- */
444
- export declare const AutocompleteMultiple: Comp<AutocompleteMultipleProps, HTMLDivElement>;
445
- /**
446
- * Avatar sizes.
447
- */
448
- export declare type AvatarSize = Extract<Size, "xs" | "s" | "m" | "l" | "xl" | "xxl">;
449
- /**
450
- * Defines the props of the component.
451
- */
452
- export interface AvatarProps extends GenericProps, HasTheme {
453
- /** Action toolbar content. */
454
- actions?: ReactNode;
455
- /** Image alternative text. */
456
- alt: string;
457
- /** Badge. */
458
- badge?: ReactElement;
459
- /** Image URL. */
460
- image: string;
461
- /** Props to pass to the link wrapping the thumbnail. */
462
- linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
463
- /** Custom react component for the link (can be used to inject react router Link). */
464
- linkAs?: "a" | any;
465
- /** On click callback. */
466
- onClick?: MouseEventHandler<HTMLDivElement>;
467
- /** On key press callback. */
468
- onKeyPress?: KeyboardEventHandler<HTMLDivElement>;
469
- /** Size variant. */
470
- size?: AvatarSize;
471
- /** Props to pass to the thumbnail (minus those already set by the Avatar props). */
472
- thumbnailProps?: Omit<ThumbnailProps, "image" | "alt" | "size" | "theme" | "align" | "fillHeight" | "variant" | "aspectRatio">;
473
- }
474
- /**
475
- * Avatar component.
476
- *
477
- * @param props Component props.
478
- * @param ref Component ref.
479
- * @return React element.
480
- */
481
- export declare const Avatar: Comp<AvatarProps, HTMLDivElement>;
482
- /**
483
- * Defines the props of the component.
484
- */
485
- export interface BadgeProps extends GenericProps {
486
- /** Badge content. */
487
- children?: ReactNode;
488
- /** Color variant. */
489
- color?: Color;
490
- }
491
- /**
492
- * Badge component.
493
- *
494
- * @param props Component props.
495
- * @param ref Component ref.
496
- * @return React element.
497
- */
498
- export declare const Badge: Comp<BadgeProps, HTMLDivElement>;
499
- export declare type HTMLButtonProps = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
500
- /**
501
- * Button size definition.
502
- */
503
- export declare type ButtonSize = Extract<Size, "s" | "m">;
504
- export interface BaseButtonProps extends GenericProps, Pick<AriaAttributes, "aria-expanded" | "aria-haspopup" | "aria-pressed" | "aria-label">, HasTheme {
505
- /** Color variant. */
506
- color?: Color;
507
- /** Emphasis variant. */
508
- emphasis?: Emphasis;
509
- /** Whether or not the button has a background color in low emphasis. */
510
- hasBackground?: boolean;
511
- /** Native anchor href property. It determines whether the Button will be a <button> or an <a>. */
512
- href?: string;
513
- /** Whether the component is disabled or not. */
514
- isDisabled?: boolean;
515
- /** Whether the component is selected or not. */
516
- isSelected?: boolean;
517
- /** Native button name property. */
518
- name?: string;
519
- /** Size variant. */
520
- size?: ButtonSize;
521
- /** Native anchor target property. */
522
- target?: "_self" | "_blank" | "_parent" | "_top";
523
- /** Native button type. */
524
- type?: HTMLButtonProps["type"];
525
- /** Custom react component for the link (can be used to inject react router Link). */
526
- linkAs?: "a" | any;
527
- }
528
- /**
529
- * Button emphasis definition.
530
- * @deprecated Use Emphasis instead.
531
- */
532
- export declare const ButtonEmphasis: {
533
- readonly low: "low";
534
- readonly medium: "medium";
535
- readonly high: "high";
536
- };
537
- /**
538
- * Defines the props of the component.
539
- */
540
- export interface ButtonProps extends BaseButtonProps {
541
- /** Button content. */
542
- children?: ReactNode;
543
- /** Left icon (SVG path). */
544
- leftIcon?: string;
545
- /** Right icon (SVG path). */
546
- rightIcon?: string;
547
- /** When `true`, the button gets as large as possible. */
548
- fullWidth?: boolean;
549
- }
550
- /**
551
- * Button component.
552
- *
553
- * @param props Component props.
554
- * @param ref Component ref.
555
- * @return React element.
556
- */
557
- export declare const Button: Comp<ButtonProps, HTMLButtonElement | HTMLAnchorElement>;
558
- export interface IconButtonProps extends BaseButtonProps {
559
- /**
560
- * Icon (SVG path).
561
- * If `image` is also set, `image` will be used instead.
562
- */
563
- icon?: string;
564
- /**
565
- * Image (image url).
566
- * Has priority over `icon`.
567
- */
568
- image?: string;
569
- /**
570
- * Label text (required for a11y purpose).
571
- * If you really don't want an aria-label, you can set an empty label (this is not recommended).
572
- */
573
- label: string;
574
- /**
575
- * Props to pass to the tooltip.
576
- * If undefined or if tooltipProps.label is undefined, the label prop will be used as tooltip label.
577
- * */
578
- tooltipProps?: Partial<TooltipProps>;
579
- /** Whether the tooltip should be hidden or not. */
580
- hideTooltip?: boolean;
581
- }
582
- /**
583
- * IconButton component.
584
- *
585
- * @param props Component props.
586
- * @param ref Component ref.
587
- * @return React element.
588
- */
589
- export declare const IconButton: Comp<IconButtonProps, HTMLButtonElement>;
590
- /**
591
- * Defines the props of the component
592
- */
593
- export declare type ButtonGroupProps = GenericProps;
594
- /**
595
- * ButtonGroup component.
596
- *
597
- * @param props Component props.
598
- * @param ref Component ref.
599
- * @return React element.
600
- */
601
- export declare const ButtonGroup: Comp<ButtonGroupProps, HTMLDivElement>;
602
- /**
603
- * Defines the props of the component.
604
- */
605
- export interface CheckboxProps extends GenericProps, HasTheme {
606
- /** Helper text. */
607
- helper?: string;
608
- /** Native input id property. */
609
- id?: string;
610
- /** Native input ref. */
611
- inputRef?: React.Ref<HTMLInputElement>;
612
- /** Whether it is checked or not. */
613
- isChecked?: boolean;
614
- /** Whether the component is disabled or not. */
615
- isDisabled?: boolean;
616
- /** Label text. */
617
- label?: ReactNode;
618
- /** Native input name property. */
619
- name?: string;
620
- /** Native input value property. */
621
- value?: string;
622
- /** On change callback. */
623
- onChange?(isChecked: boolean, value?: string, name?: string, event?: SyntheticEvent): void;
624
- /** optional props for input */
625
- inputProps?: InputHTMLAttributes<HTMLInputElement>;
626
- }
627
- /**
628
- * Checkbox component.
629
- *
630
- * @param props Component props.
631
- * @param ref Component ref.
632
- * @return React element.
633
- */
634
- export declare const Checkbox: Comp<CheckboxProps, HTMLDivElement>;
635
- /**
636
- * Chip sizes.
637
- */
638
- export declare type ChipSize = Extract<Size, "s" | "m">;
639
- /**
640
- * Defines the props of the component.
641
- */
642
- export interface ChipProps extends GenericProps, HasTheme {
643
- /** A component to be rendered after the content. */
644
- after?: ReactNode;
645
- /** A component to be rendered before the content. */
646
- before?: ReactNode;
647
- /** Color variant. */
648
- color?: Color;
649
- /** Whether the component is clickable or not. */
650
- isClickable?: boolean;
651
- /** Whether the component is disabled or not. */
652
- isDisabled?: boolean;
653
- /** Whether the chip is currently in a highlighted state or not. */
654
- isHighlighted?: boolean;
655
- /** Whether the component is selected or not. */
656
- isSelected?: boolean;
657
- /** Size variant. */
658
- size?: ChipSize;
659
- /** On "after" element clicked callback. */
660
- onAfterClick?: MouseEventHandler;
661
- /** On "before" element clicked callback. */
662
- onBeforeClick?: MouseEventHandler;
663
- }
664
- /**
665
- * Chip component.
666
- *
667
- * @param props Component props.
668
- * @param ref Component ref.
669
- * @return React element.
670
- */
671
- export declare const Chip: Comp<ChipProps, HTMLAnchorElement>;
672
- export interface UseChipGroupNavigation {
673
- /** the current active chip index */
674
- activeChip: number;
675
- /** callback to be executed when the backspace was pressed */
676
- onBackspacePressed(): void;
677
- /** function that allows to reset the navigation */
678
- resetChipNavigation(): void;
679
- }
680
- export declare type useChipGroupNavigationType<C = any> = (chips: C[], onChipDeleted: (chip: C) => void, initialActiveChip?: number) => UseChipGroupNavigation;
681
- /**
682
- * Defines the props of the component.
683
- */
684
- export interface ChipGroupProps extends GenericProps {
685
- /** Chip horizontal alignment. */
686
- align?: HorizontalAlignment;
687
- /** List of Chip. */
688
- children: ReactNode;
689
- }
690
- export declare const ChipGroup: Comp<ChipGroupProps, HTMLDivElement> & {
691
- useChipGroupNavigation: import("../../hooks/useChipGroupNavigation").useChipGroupNavigationType<any>;
692
- };
693
- /**
694
- * Comment block variants.
695
- */
696
- export declare const CommentBlockVariant: {
697
- readonly indented: "indented";
698
- readonly linear: "linear";
699
- };
700
- export declare type CommentBlockVariant = ValueOf<typeof CommentBlockVariant>;
701
- /**
702
- * Defines the props of the component.
703
- */
704
- export interface CommentBlockProps extends GenericProps, HasTheme {
705
- /** Action toolbar content. */
706
- actions?: ReactNode;
707
- /** Props to pass to the avatar. */
708
- avatarProps: AvatarProps;
709
- /** Comment block replies. */
710
- children?: ReactNode;
711
- /** Comment date with the minimal timestamp informations (xx minutes, x hours, yesterday, 6 days, Month Day, Month Day Year)*/
712
- date: string;
713
- /** Comment date with the full timestamp informations (day, month, year, time) */
714
- fullDate?: string;
715
- /** Whether the component has actions to display or not. */
716
- hasActions?: boolean;
717
- /** Action toolbar header content. */
718
- headerActions?: ReactNode;
719
- /** Whether the component is open or not. */
720
- isOpen?: boolean;
721
- /** Whether the comment is relevant or not. */
722
- isRelevant?: boolean;
723
- /** Comment author name. */
724
- name: string;
725
- /** On click callback. */
726
- onClick?(): void;
727
- /** On mouse enter callback. */
728
- onMouseEnter?(): void;
729
- /** On mouse leave callback. */
730
- onMouseLeave?(): void;
731
- /** Comment content. */
732
- text: ReactNode | string;
733
- /** Comment variant. */
734
- variant?: CommentBlockVariant;
735
- }
736
- /**
737
- * CommentBlock component.
738
- *
739
- * @param props Component props.
740
- * @param ref Component ref.
741
- * @return React element.
742
- */
743
- export declare const CommentBlock: Comp<CommentBlockProps, HTMLDivElement>;
744
- /**
745
- * Defines the props of the component.
746
- */
747
- export interface DatePickerProps extends GenericProps {
748
- /** Default month. */
749
- defaultMonth?: Date;
750
- /** Locale (language or region) to use. */
751
- locale: string;
752
- /** Date after which dates can't be selected. */
753
- maxDate?: Date;
754
- /** Date before which dates can't be selected. */
755
- minDate?: Date;
756
- /** Props to pass to the next month button (minus those already set by the DatePickerControlled props). */
757
- nextButtonProps: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis">;
758
- /** Props to pass to the previous month button (minus those already set by the DatePickerControlled props). */
759
- previousButtonProps: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis">;
760
- /** Reference to the <button> element corresponding to the current date or the selected date. */
761
- todayOrSelectedDateRef?: Ref<HTMLButtonElement>;
762
- /** Currently selected date. */
763
- value: Date | undefined;
764
- /** On change callback. */
765
- onChange(value: Date | undefined): void;
766
- }
767
- /**
768
- * DatePicker component.
769
- *
770
- * @param props Component props.
771
- * @param ref Component ref.
772
- * @return React element.
773
- */
774
- export declare const DatePicker: Comp<DatePickerProps, HTMLDivElement>;
775
- /**
776
- * Defines the props of the component.
777
- */
778
- export interface DatePickerControlledProps extends DatePickerProps {
779
- /** Selected month to display. */
780
- selectedMonth: Date;
781
- /** On previous month change callback. */
782
- onPrevMonthChange(): void;
783
- /** On next month change callback. */
784
- onNextMonthChange(): void;
785
- }
786
- /**
787
- * DatePickerControlled component.
788
- *
789
- * @param props Component props.
790
- * @param ref Component ref.
791
- * @return React element.
792
- */
793
- export declare const DatePickerControlled: Comp<DatePickerControlledProps, HTMLDivElement>;
794
- /**
795
- * Defines the props of the component.
796
- */
797
- export interface DatePickerFieldProps extends GenericProps {
798
- /** Default month. */
799
- defaultMonth?: Date;
800
- /** Whether the component is disabled or not. */
801
- isDisabled?: boolean;
802
- /** Locale (language or region) to use. */
803
- locale: string;
804
- /** Date after which dates can't be selected. */
805
- maxDate?: Date;
806
- /** Date before which dates can't be selected. */
807
- minDate?: Date;
808
- /** Native input name property. */
809
- name?: string;
810
- /** Props to pass to the next month button (minus those already set by the DatePickerControlled props). */
811
- nextButtonProps: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis">;
812
- /** Props to pass to the previous month button (minus those already set by the DatePickerControlled props). */
813
- previousButtonProps: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis">;
814
- /** Currently selected date. */
815
- value: Date | undefined;
816
- /** On change callback. */
817
- onChange(value: Date | undefined, name?: string, event?: SyntheticEvent): void;
818
- }
819
- /**
820
- * DatePickerField component.
821
- *
822
- * @param props Component props.
823
- * @param ref Component ref.
824
- * @return React element.
825
- */
826
- export declare const DatePickerField: Comp<DatePickerFieldProps, HTMLDivElement>;
827
- /**
828
- * Defines the props of the component.
829
- */
830
- export interface DialogProps extends GenericProps {
831
- /** Footer content. */
832
- footer?: ReactNode;
833
- /** Whether the divider between the dialog content and the footer is always displayed (instead of showing it on scroll). */
834
- forceFooterDivider?: boolean;
835
- /** Header content. */
836
- header?: ReactNode;
837
- /** Whether the divider between the dialog content and the footer is always displayed (instead of showing it on scroll). */
838
- forceHeaderDivider?: boolean;
839
- /** Whether the indefinite progress indicator over the dialog content is displayed or not. */
840
- isLoading?: boolean;
841
- /** Whether the component is open or not. */
842
- isOpen?: boolean;
843
- /** Reference to the parent element that triggered modal opening (will get back focus on close). */
844
- parentElement?: RefObject<HTMLElement>;
845
- /** Reference to the dialog content element. */
846
- contentRef?: Ref<HTMLDivElement>;
847
- /** Reference to the of the element that should get the focus when the dialogs opens. By default, the first child will take focus. */
848
- focusElement?: RefObject<HTMLElement>;
849
- /** Whether to keep the dialog open on clickaway or escape press. */
850
- preventAutoClose?: boolean;
851
- /** Size variant. */
852
- size?: DialogSizes;
853
- /** Z-axis position. */
854
- zIndex?: number;
855
- /** Z-axis position. */
856
- dialogProps?: GenericProps;
857
- /** On close callback. */
858
- onClose?(): void;
859
- /** Callback called when the open animation starts and the close animation finishes. */
860
- onVisibilityChange?(isVisible: boolean): void;
861
- }
862
- export declare type DialogSizes = Extract<Size, "tiny" | "regular" | "big" | "huge">;
863
- /**
864
- * Dialog component.
865
- *
866
- * @param props Component props.
867
- * @param ref Component ref.
868
- * @return React element.
869
- */
870
- export declare const Dialog: Comp<DialogProps, HTMLDivElement>;
871
- /**
872
- * Defines the props of the component.
873
- */
874
- export interface DividerProps extends GenericProps, HasTheme {
875
- }
876
- /**
877
- * Divider component.
878
- *
879
- * @param props Component props.
880
- * @param ref Component ref.
881
- * @return React element.
882
- */
883
- export declare const Divider: Comp<DividerProps, HTMLHRElement>;
884
- /**
885
- * Defines the props of the component.
886
- */
887
- export interface DragHandleProps extends GenericProps, HasTheme {
888
- }
889
- /**
890
- * DragHandle component.
891
- *
892
- * @param props Component props.
893
- * @param ref Component ref.
894
- * @return React element.
895
- */
896
- export declare const DragHandle: Comp<DragHandleProps, HTMLDivElement>;
897
- /**
898
- * Different possible placements for the popover.
899
- */
900
- export declare const Placement: {
901
- readonly AUTO: "auto";
902
- readonly AUTO_END: "auto-end";
903
- readonly AUTO_START: "auto-start";
904
- readonly TOP: "top";
905
- readonly TOP_END: "top-end";
906
- readonly TOP_START: "top-start";
907
- readonly RIGHT: "right";
908
- readonly RIGHT_END: "right-end";
909
- readonly RIGHT_START: "right-start";
910
- readonly BOTTOM: "bottom";
911
- readonly BOTTOM_END: "bottom-end";
912
- readonly BOTTOM_START: "bottom-start";
913
- readonly LEFT: "left";
914
- readonly LEFT_END: "left-end";
915
- readonly LEFT_START: "left-start";
916
- };
917
- export declare type Placement = ValueOf<typeof Placement>;
918
- /**
919
- * Offset of the popover.
920
- */
921
- export interface Offset {
922
- /** Offset size along the reference. */
923
- along?: number;
924
- /** Offset size away from the reference. */
925
- away?: number;
926
- }
927
- /**
928
- * Popover elevation index.
929
- */
930
- export declare type Elevation = 1 | 2 | 3 | 4 | 5;
931
- /**
932
- * Defines the props of the component.
933
- */
934
- export interface PopoverProps extends GenericProps {
935
- /** Reference to the DOM element used to set the position of the popover. */
936
- anchorRef: React.RefObject<HTMLElement>;
937
- /** Element which will act as boundary when opening the popover. */
938
- boundaryRef?: RefObject<HTMLElement>;
939
- /** Content. */
940
- children: ReactNode;
941
- /** Whether a click anywhere out of the popover would close it. */
942
- closeOnClickAway?: boolean;
943
- /** Whether an escape key press would close the popover. */
944
- closeOnEscape?: boolean;
945
- /** Shadow elevation. */
946
- elevation?: Elevation;
947
- /** Whether the dropdown should fit to the anchor width (if dropdown is smaller). */
948
- fitToAnchorWidth?: boolean;
949
- /** Shrink popover if even after flipping there is not enough space. */
950
- fitWithinViewportHeight?: boolean;
951
- /** Element to focus when opening the popover. */
952
- focusElement?: RefObject<HTMLElement>;
953
- /** Whether the focus should go back on the anchor when popover closes and focus is within. */
954
- focusAnchorOnClose?: boolean;
955
- /** Whether we put an arrow or not. */
956
- hasArrow?: boolean;
957
- /** Whether the popover is open or not. */
958
- isOpen: boolean;
959
- /** Offset placement relative to anchor. */
960
- offset?: Offset;
961
- /** Reference to the parent element that triggered the popover (will get back focus on close or else fallback on the anchor element). */
962
- parentElement?: RefObject<HTMLElement>;
963
- /** Placement relative to anchor. */
964
- placement?: Placement;
965
- /** Whether the popover should be rendered into a DOM node that exists outside the DOM hierarchy of the parent component. */
966
- usePortal?: boolean;
967
- /** Z-axis position. */
968
- zIndex?: number;
969
- /** On close callback (on click away or Escape pressed). */
970
- onClose?(): void;
971
- }
972
- /**
973
- * Popover component.
974
- *
975
- * @param props Component props.
976
- * @param ref Component ref.
977
- * @return React element.
978
- */
979
- export declare const Popover: Comp<PopoverProps, HTMLDivElement>;
980
- /**
981
- * Defines the props of the component.
982
- */
983
- export interface DropdownProps extends GenericProps {
984
- /**
985
- * Reference to the element around which the dropdown is placed.
986
- * @see {@link PopoverProps#anchorRef}
987
- */
988
- anchorRef: PopoverProps["anchorRef"];
989
- /** Dropdown content. */
990
- children: React.ReactNode;
991
- /**
992
- * Whether a click anywhere out of the Dropdown would close it or not.
993
- * @see {@link PopoverProps#closeOnClickAway}
994
- */
995
- closeOnClickAway?: boolean;
996
- /**
997
- * Whether to close the Dropdown when clicking in it or not.
998
- */
999
- closeOnClick?: boolean;
1000
- /**
1001
- * Whether an escape key press would close the Dropdown or not.
1002
- * @see {@link PopoverProps#closeOnEscape}
1003
- */
1004
- closeOnEscape?: boolean;
1005
- /**
1006
- * Whether the dropdown should fit to the anchor width (if dropdown is smaller) or not.
1007
- * @see {@link PopoverProps#fitToAnchorWidth}
1008
- */
1009
- fitToAnchorWidth?: boolean;
1010
- /**
1011
- * Whether the dropdown should shrink to fit within the viewport height or not.
1012
- * @see {@link PopoverProps#fitWithinViewportHeight}
1013
- */
1014
- fitWithinViewportHeight?: boolean;
1015
- /**
1016
- * Whether the dropdown should be displayed or not. Useful to control the Dropdown from outside the component.
1017
- * @see {@link PopoverProps#isOpen}
1018
- */
1019
- isOpen: boolean;
1020
- /**
1021
- * Offset applied to the Dropdown position.
1022
- * @see {@link PopoverProps#offset}
1023
- */
1024
- offset?: Offset;
1025
- /**
1026
- * Preferred Dropdown placement against the anchor element.
1027
- * @see {@link PopoverProps#placement}
1028
- */
1029
- placement?: Placement;
1030
- /** Whether the focus should be set on the list when the dropdown is open or not. */
1031
- shouldFocusOnOpen?: boolean;
1032
- /** Whether the focus should go back on the anchor when dropdown closes and focus is within. */
1033
- focusAnchorOnClose?: boolean;
1034
- /**
1035
- * Z-axis position.
1036
- * @see {@link PopoverProps#zIndex}
1037
- */
1038
- zIndex?: number;
1039
- /**
1040
- * On close callback.
1041
- * @see {@link PopoverProps#onClose}
1042
- */
1043
- onClose?(): void;
1044
- /** On scroll end callback. */
1045
- onInfiniteScroll?(): void;
1046
- }
1047
- /**
1048
- * Dropdown component.
1049
- *
1050
- * @param props Component props.
1051
- * @param ref Component ref.
1052
- * @return React element.
1053
- */
1054
- export declare const Dropdown: Comp<DropdownProps, HTMLDivElement>;
1055
- /**
1056
- * Defines the props of the component.
1057
- */
1058
- export interface ExpansionPanelProps extends GenericProps, HasTheme {
1059
- /** Whether the expansion panel has a background. */
1060
- hasBackground?: boolean;
1061
- /** Whether the header has a divider. */
1062
- hasHeaderDivider?: boolean;
1063
- /** Whether the component is open or not. */
1064
- isOpen?: boolean;
1065
- /** Label text (overwritten if a `<header>` is provided in the children). */
1066
- label?: string;
1067
- /** On open callback. */
1068
- onOpen?: Callback;
1069
- /** On close callback. */
1070
- onClose?: Callback;
1071
- /** Props to pass to the toggle button (minus those already set by the ExpansionPanel props). */
1072
- toggleButtonProps: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis" | "color">;
1073
- /** On toggle open or close callback. */
1074
- onToggleOpen?(shouldOpen: boolean): void;
1075
- }
1076
- /**
1077
- * ExpansionPanel component.
1078
- *
1079
- * @param props Component props.
1080
- * @param ref Component ref.
1081
- * @return React element.
1082
- */
1083
- export declare const ExpansionPanel: Comp<ExpansionPanelProps, HTMLDivElement>;
1084
- export interface FlagProps extends GenericProps, HasTheme {
1085
- /** Color of the component. */
1086
- color?: ColorPalette;
1087
- /** Icon to use before the label. */
1088
- icon?: string;
1089
- /** Text label of the flag. */
1090
- label: string;
1091
- }
1092
- /**
1093
- * Flag component.
1094
- *
1095
- * @param props Component props.
1096
- * @param ref Component ref.
1097
- * @return React element.
1098
- */
1099
- export declare const Flag: Comp<FlagProps, HTMLDivElement>;
1100
- export declare type MarginAutoAlignment = Extract<Alignment, "top" | "bottom" | "right" | "left">;
1101
- export declare type GapSize = Extract<Size, "tiny" | "regular" | "medium" | "big" | "huge">;
1102
- export declare type SpaceAlignment = Extract<Alignment, "space-between" | "space-evenly" | "space-around">;
1103
- export declare type FlexVerticalAlignment = VerticalAlignment | SpaceAlignment;
1104
- export declare type FlexHorizontalAlignment = HorizontalAlignment | SpaceAlignment;
1105
- /**
1106
- * Defines the props of the component.
1107
- */
1108
- export interface FlexBoxProps extends GenericProps {
1109
- /** Customize the root element. */
1110
- as?: React.ElementType;
1111
- /** Children elements. */
1112
- children?: ReactNode;
1113
- /** Whether the "content filling space" is enabled or not. */
1114
- fillSpace?: boolean;
1115
- /** Gap space between flexbox items. */
1116
- gap?: GapSize;
1117
- /** Flex horizontal alignment. */
1118
- hAlign?: FlexVerticalAlignment;
1119
- /** Whether the "auto margin" is enabled all around or not. */
1120
- marginAuto?: MarginAutoAlignment | MarginAutoAlignment[];
1121
- /** Whether the "content shrink" is disabled or not. */
1122
- noShrink?: boolean;
1123
- /** Flex direction. */
1124
- orientation?: Orientation;
1125
- /** Flex vertical alignment. */
1126
- vAlign?: FlexHorizontalAlignment;
1127
- /** Whether the "flex wrap" is enabled or not. */
1128
- wrap?: boolean;
1129
- }
1130
- /**
1131
- * FlexBox component.
1132
- *
1133
- * @param props Component props.
1134
- * @param ref Component ref.
1135
- * @return React element.
1136
- */
1137
- export declare const FlexBox: Comp<FlexBoxProps, HTMLDivElement>;
1138
- /**
1139
- * Accepted gap sizes for the generic block.
1140
- */
1141
- export declare const GenericBlockGapSize: Pick<{
1142
- readonly xxs: "xxs";
1143
- readonly xs: "xs";
1144
- readonly s: "s";
1145
- readonly m: "m";
1146
- readonly l: "l";
1147
- readonly xl: "xl";
1148
- readonly xxl: "xxl";
1149
- readonly tiny: "tiny";
1150
- readonly regular: "regular";
1151
- readonly medium: "medium";
1152
- readonly big: "big";
1153
- readonly huge: "huge";
1154
- }, "tiny" | "regular" | "medium" | "big" | "huge">;
1155
- export declare type GenericBlockGapSize = ValueOf<typeof GenericBlockGapSize>;
1156
- export interface GenericBlockProps extends FlexBoxProps {
1157
- /**
1158
- * Component to use as visual element.
1159
- */
1160
- figure?: ReactNode;
1161
- /**
1162
- * Actions to set after the main content.
1163
- */
1164
- actions?: ReactNode;
1165
- /**
1166
- * Main content to display or sections components
1167
- * ({@see GenericBlock.Figure}, {@see GenericBlock.Content} & {@see GenericBlock.Actions})
1168
- */
1169
- children: ReactNode;
1170
- /**
1171
- * Orientation of the 3 sections
1172
- */
1173
- orientation?: FlexBoxProps["orientation"];
1174
- /**
1175
- * Horizontal alignment.
1176
- */
1177
- hAlign?: FlexBoxProps["hAlign"];
1178
- /**
1179
- * Vertical alignment.
1180
- */
1181
- vAlign?: FlexBoxProps["vAlign"];
1182
- /**
1183
- * The props to forward to the content.
1184
- * By default, the content will have the same alignment as wrapper.
1185
- */
1186
- contentProps?: Omit<FlexBoxProps, "children">;
1187
- /**
1188
- * props to forward to the actions element.
1189
- */
1190
- actionsProps?: Omit<FlexBoxProps, "children">;
1191
- /**
1192
- * props to forward to the figure element.
1193
- */
1194
- figureProps?: Omit<FlexBoxProps, "children">;
1195
- /**
1196
- * Gap space between sections.
1197
- */
1198
- gap?: GenericBlockGapSize;
1199
- }
1200
- export declare type BaseGenericBlock = Comp<GenericBlockProps, HTMLDivElement>;
1201
- export interface GenericBlockSectionProps extends FlexBoxProps {
1202
- /**
1203
- * Gap space between items.
1204
- */
1205
- gap?: GenericBlockGapSize;
1206
- }
1207
- export interface GenericBlock extends BaseGenericBlock {
1208
- /**
1209
- * Use `GenericBlock.Figure` component as children of the `GenericBlock` component as an alternative way to inject
1210
- * the "figure" section of the block (instead of using `figure` and `figureProps` props).
1211
- */
1212
- Figure: Comp<GenericBlockSectionProps>;
1213
- /**
1214
- * Use `GenericBlock.Content` component as children of the `GenericBlock` component as an alternative way to inject
1215
- * the "content" section of the block (instead of using `content` and `contentProps` props).
1216
- */
1217
- Content: Comp<GenericBlockSectionProps>;
1218
- /**
1219
- * Use `GenericBlock.Actions` component as children of the `GenericBlock` component as an alternative way to inject
1220
- * the "actions" section of the block (instead of using `actions` and `actionsProps` props).
1221
- */
1222
- Actions: Comp<GenericBlockSectionProps>;
1223
- }
1224
- declare const BaseGenericBlock: BaseGenericBlock;
1225
- export declare const GenericBlock: GenericBlock;
1226
- /**
1227
- * Defines the props of the component.
1228
- */
1229
- export interface TextProps extends GenericProps {
1230
- /**
1231
- * Color variant.
1232
- */
1233
- color?: ColorPalette;
1234
- /**
1235
- * Lightened or darkened variant of the selected color.
1236
- */
1237
- colorVariant?: ColorVariant;
1238
- /**
1239
- * Typography variant.
1240
- */
1241
- typography?: Typography;
1242
- /**
1243
- * Custom component to render the text.
1244
- */
1245
- as: TextElement;
1246
- /**
1247
- * Control whether the text should truncate or not.
1248
- * Setting as `true` will make the text truncate on a single line.
1249
- * Setting as `{ lines: number }` will make the text truncate on a multiple lines.
1250
- */
1251
- truncate?: boolean | {
1252
- lines: number;
1253
- };
1254
- /**
1255
- * Prevents text to wrap on multiple lines
1256
- * (automatically activated when single line text truncate is activated).
1257
- */
1258
- noWrap?: boolean;
1259
- }
1260
- /**
1261
- * Text component.
1262
- *
1263
- * @param props Component props.
1264
- * @param ref Component ref.
1265
- * @return React element.
1266
- */
1267
- export declare const Text: Comp<TextProps>;
1268
- /**
1269
- * Defines the props of the component.
1270
- */
1271
- export interface HeadingProps extends Partial<TextProps> {
1272
- /**
1273
- * Display a specific heading level instead of the one provided by parent context provider.
1274
- */
1275
- as?: HeadingElement;
1276
- }
1277
- /**
1278
- * Renders a heading component.
1279
- * Extends the `Text` Component with the heading level automatically computed based on
1280
- * the current level provided by the context.
1281
- */
1282
- export declare const Heading: Comp<HeadingProps>;
1283
- export interface HeadingLevelProviderProps {
1284
- /** The heading level to start at. If left undefined, the parent context will be used, if any. */
1285
- level?: number;
1286
- /** The children to display */
1287
- children: ReactNode;
1288
- }
1289
- /**
1290
- * Provide a new heading level context.
1291
- */
1292
- export declare const HeadingLevelProvider: React.FC<HeadingLevelProviderProps>;
1293
- export declare const useHeadingLevel: () => {
1294
- level: number;
1295
- headingElement: import("../../utils/type").HeadingElement;
1296
- };
1297
- export declare type GridGutterSize = Extract<Size, "regular" | "big" | "huge">;
1298
- /**
1299
- * Defines the props of the component.
1300
- */
1301
- export interface GridProps extends GenericProps {
1302
- /** Orientation. */
1303
- orientation?: Orientation;
1304
- /** Whether the children are wrapped or not. */
1305
- wrap?: string;
1306
- /** Vertical alignment. */
1307
- vAlign?: Alignment;
1308
- /** Horizontal alignment. */
1309
- hAlign?: Alignment;
1310
- /** Gutter size. */
1311
- gutter?: GridGutterSize;
1312
- }
1313
- /**
1314
- * Grid component.
1315
- *
1316
- * @param props Component props.
1317
- * @param ref Component ref.
1318
- * @return React element.
1319
- */
1320
- export declare const Grid: Comp<GridProps, HTMLDivElement>;
1321
- export declare type Columns = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12";
1322
- /**
1323
- * Defines the props of the component.
1324
- */
1325
- export interface GridItemProps extends GenericProps {
1326
- /** Alignment. */
1327
- align?: Alignment;
1328
- /** Order. */
1329
- order?: Columns;
1330
- /** Width. */
1331
- width?: Columns;
1332
- }
1333
- /**
1334
- * GridItem component.
1335
- *
1336
- * @param props Component props.
1337
- * @param ref Component ref.
1338
- * @return React element.
1339
- */
1340
- export declare const GridItem: Comp<GridItemProps, HTMLDivElement>;
1341
- export declare type IconSizes = Extract<Size, "xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl">;
1342
- /**
1343
- * Defines the props of the component.
1344
- */
1345
- export interface IconProps extends GenericProps, HasTheme {
1346
- /** Color variant. */
1347
- color?: Color;
1348
- /** Lightened or darkened variant of the selected icon color. */
1349
- colorVariant?: ColorVariant;
1350
- /** Whether the icon has a shape. */
1351
- hasShape?: boolean;
1352
- /**
1353
- * Icon (SVG path) draw code (`d` property of the `<path>` SVG element).
1354
- * See https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths
1355
- */
1356
- icon: string;
1357
- /** Size variant. */
1358
- size?: IconSizes;
1359
- /** Sets an alternative text on the svg. Will set an `img` role to the svg. */
1360
- alt?: string;
1361
- }
1362
- /**
1363
- * Icon component.
1364
- *
1365
- * @param props Component props.
1366
- * @param ref Component ref.
1367
- * @return React element.
1368
- */
1369
- export declare const Icon: Comp<IconProps, HTMLElement>;
1370
- /**
1371
- * Focal point using vertical alignment, horizontal alignment or coordinates (from -1 to 1).
1372
- */
1373
- export declare type FocusPoint = {
1374
- x?: number;
1375
- y?: number;
1376
- };
1377
- /**
1378
- * All available aspect ratios.
1379
- * @deprecated
1380
- */
1381
- export declare const ThumbnailAspectRatio: Record<string, AspectRatio>;
1382
- /**
1383
- * Thumbnail sizes.
1384
- */
1385
- export declare type ThumbnailSize = Extract<Size, "xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl">;
1386
- /**
1387
- * Thumbnail variants.
1388
- */
1389
- export declare const ThumbnailVariant: {
1390
- readonly squared: "squared";
1391
- readonly rounded: "rounded";
1392
- };
1393
- export declare type ThumbnailVariant = ValueOf<typeof ThumbnailVariant>;
1394
- export declare type ImgHTMLProps = ImgHTMLAttributes<HTMLImageElement>;
1395
- /**
1396
- * Defines the props of the component.
1397
- */
1398
- export interface ThumbnailProps extends GenericProps, HasTheme {
1399
- /** Alignment of the thumbnail in it's parent (requires flex parent). */
1400
- align?: HorizontalAlignment;
1401
- /** Image alternative text. */
1402
- alt: string;
1403
- /** Image aspect ratio. */
1404
- aspectRatio?: AspectRatio;
1405
- /** Badge. */
1406
- badge?: ReactElement | Falsy;
1407
- /** Image cross origin resource policy. */
1408
- crossOrigin?: ImgHTMLProps["crossOrigin"];
1409
- /** Fallback icon (SVG path) or react node when image fails to load. */
1410
- fallback?: string | ReactNode;
1411
- /** Whether the thumbnail should fill it's parent size (requires flex parent) or not. */
1412
- fillHeight?: boolean;
1413
- /** Apply relative vertical and horizontal shift (from -1 to 1) on the image position inside the thumbnail. */
1414
- focusPoint?: FocusPoint;
1415
- /** Image URL. */
1416
- image: string;
1417
- /** Props to inject into the native <img> element. */
1418
- imgProps?: ImgHTMLProps;
1419
- /** Reference to the native <img> element. */
1420
- imgRef?: Ref<HTMLImageElement>;
1421
- /** Set to true to force the display of the loading skeleton. */
1422
- isLoading?: boolean;
1423
- /** Size variant of the component. */
1424
- size?: ThumbnailSize;
1425
- /** Image loading mode. */
1426
- loading?: ImgHTMLProps["loading"];
1427
- /** On click callback. */
1428
- onClick?: MouseEventHandler<HTMLDivElement>;
1429
- /** On key press callback. */
1430
- onKeyPress?: KeyboardEventHandler<HTMLDivElement>;
1431
- /** Variant of the component. */
1432
- variant?: ThumbnailVariant;
1433
- /** Props to pass to the link wrapping the thumbnail. */
1434
- linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
1435
- /** Custom react component for the link (can be used to inject react router Link). */
1436
- linkAs?: "a" | any;
1437
- }
1438
- /**
1439
- * Thumbnail component.
1440
- *
1441
- * @param props Component props.
1442
- * @param ref Component ref.
1443
- * @return React element.
1444
- */
1445
- export declare const Thumbnail: Comp<ThumbnailProps>;
1446
- /**
1447
- * Image block variants.
1448
- */
1449
- export declare const ImageBlockCaptionPosition: {
1450
- readonly below: "below";
1451
- readonly over: "over";
1452
- };
1453
- export declare type ImageBlockCaptionPosition = ValueOf<typeof ImageBlockCaptionPosition>;
1454
- /**
1455
- * Image block sizes.
1456
- */
1457
- export declare type ImageBlockSize = Extract<Size, "xl" | "xxl">;
1458
- /**
1459
- * Defines the props of the component.
1460
- */
1461
- export interface ImageBlockProps extends GenericProps, HasTheme {
1462
- /** Action toolbar content. */
1463
- actions?: ReactNode;
1464
- /** Alignment. */
1465
- align?: HorizontalAlignment;
1466
- /** Image alternative text. */
1467
- alt: string;
1468
- /** Caption position. */
1469
- captionPosition?: ImageBlockCaptionPosition;
1470
- /** Caption custom CSS style. */
1471
- captionStyle?: CSSProperties;
1472
- /** Image description. Can be either a string, or sanitized html. */
1473
- description?: string | {
1474
- __html: string;
1475
- };
1476
- /** Whether the image has to fill its container height or not. */
1477
- fillHeight?: boolean;
1478
- /** Image URL. */
1479
- image: string;
1480
- /** Size variant. */
1481
- size?: ImageBlockSize;
1482
- /** Tag content. */
1483
- tags?: ReactNode;
1484
- /** Props to pass to the thumbnail (minus those already set by the ImageBlock props). */
1485
- thumbnailProps?: Omit<ThumbnailProps, "image" | "size" | "theme" | "align" | "fillHeight">;
1486
- /** Image title to display in the caption. */
1487
- title?: string;
1488
- }
1489
- /**
1490
- * ImageBlock component.
1491
- *
1492
- * @param props Component props.
1493
- * @param ref Component ref.
1494
- * @return React element.
1495
- */
1496
- export declare const ImageBlock: Comp<ImageBlockProps, HTMLDivElement>;
1497
- /**
1498
- * Defines the props of the component.
1499
- */
1500
- export interface InlineListProps extends GenericProps {
1501
- /**
1502
- * Text color.
1503
- */
1504
- color?: ColorPalette;
1505
- /**
1506
- * Lightened or darkened variant of the selected color.
1507
- */
1508
- colorVariant?: ColorVariant;
1509
- /**
1510
- * Typography variant.
1511
- */
1512
- typography?: Typography;
1513
- }
1514
- /**
1515
- * InlineList component.
1516
- *
1517
- * @param props Component props.
1518
- * @param ref Component ref.
1519
- * @return React element.
1520
- */
1521
- export declare const InlineList: Comp<InlineListProps>;
1522
- /**
1523
- * Defines the props of the component.
1524
- */
1525
- export interface InputHelperProps extends GenericProps, HasTheme {
1526
- /** Helper content. */
1527
- children: string | ReactNode;
1528
- /** Helper variant. */
1529
- kind?: Kind;
1530
- }
1531
- /**
1532
- * InputHelper component.
1533
- *
1534
- * @param props Component props.
1535
- * @param ref Component ref.
1536
- * @return React element.
1537
- */
1538
- export declare const InputHelper: Comp<InputHelperProps, HTMLSpanElement>;
1539
- /**
1540
- * Defines the props of the component.
1541
- */
1542
- export interface InputLabelProps extends GenericProps, HasTheme {
1543
- /** Label content. */
1544
- children: string | ReactNode;
1545
- /** Native htmlFor property. */
1546
- htmlFor: string;
1547
- /** Whether the component is required or not. */
1548
- isRequired?: boolean;
1549
- }
1550
- /**
1551
- * InputLabel component.
1552
- *
1553
- * @param props Component props.
1554
- * @param ref Component ref.
1555
- * @return React element.
1556
- */
1557
- export declare const InputLabel: Comp<InputLabelProps, HTMLLabelElement>;
1558
- /**
1559
- * Defines the props of the component.
1560
- */
1561
- export interface LightboxProps extends GenericProps, HasTheme {
1562
- /** Props to pass to the close button (minus those already set by the Lightbox props). */
1563
- closeButtonProps?: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis" | "color">;
1564
- /** Whether the component is open or not. */
1565
- isOpen?: boolean;
1566
- /** Reference to the element that triggered modal opening to set focus on. */
1567
- parentElement: RefObject<any>;
1568
- /** Whether to keep the dialog open on clickaway or escape press. */
1569
- preventAutoClose?: boolean;
1570
- /** Z-axis position. */
1571
- zIndex?: number;
1572
- /** On close callback. */
1573
- onClose?(): void;
1574
- }
1575
- /**
1576
- * Lightbox component.
1577
- *
1578
- * @param props Component props.
1579
- * @param ref Component ref.
1580
- * @return React element.
1581
- */
1582
- export declare const Lightbox: Comp<LightboxProps, HTMLDivElement>;
1583
- export declare type HTMLAnchorProps = React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
1584
- /**
1585
- * Defines the props of the component.
1586
- */
1587
- export interface LinkProps extends GenericProps {
1588
- /** Color variant. */
1589
- color?: Color;
1590
- /** Lightened or darkened variant of the selected icon color. */
1591
- colorVariant?: ColorVariant;
1592
- /** Link href. */
1593
- href?: HTMLAnchorProps["href"];
1594
- /** Whether the component is disabled or not. */
1595
- isDisabled?: boolean;
1596
- /** Left icon (SVG path). */
1597
- leftIcon?: string;
1598
- /** Custom react component for the link (can be used to inject react router Link). */
1599
- linkAs?: "a" | any;
1600
- /** Right icon (SVG path). */
1601
- rightIcon?: string;
1602
- /** Link target. */
1603
- target?: HTMLAnchorProps["target"];
1604
- /** Typography variant. */
1605
- typography?: Typography;
1606
- }
1607
- /**
1608
- * Link component.
1609
- *
1610
- * @param props Component props.
1611
- * @param ref Component ref.
1612
- * @return React element.
1613
- */
1614
- export declare const Link: Comp<LinkProps, HTMLAnchorElement | HTMLButtonElement>;
1615
- /**
1616
- * Defines the props of the component.
1617
- */
1618
- export interface LinkPreviewProps extends GenericProps, HasTheme {
1619
- /** Description. */
1620
- description?: string;
1621
- /** Link URL. */
1622
- link: string;
1623
- /** Custom react component for the link (can be used to inject react router Link). */
1624
- linkAs?: "a" | any;
1625
- /** Props to pass to the link (minus those already set by the LinkPreview props). */
1626
- linkProps?: Omit<LinkProps, "color" | "colorVariant" | "href" | "target">;
1627
- /** Size variant. */
1628
- size?: Extract<Size, "regular" | "big">;
1629
- /** Thumbnail for the link preview. */
1630
- thumbnailProps?: ThumbnailProps;
1631
- /** Title. */
1632
- title?: string;
1633
- /** Customize the title heading tag. */
1634
- titleHeading?: HeadingElement;
1635
- }
1636
- /**
1637
- * LinkPreview component.
1638
- *
1639
- * @param props Component props.
1640
- * @param ref Component ref.
1641
- * @return React element.
1642
- */
1643
- export declare const LinkPreview: Comp<LinkPreviewProps, HTMLDivElement>;
1644
- export declare type Listener = (evt: KeyboardEvent) => void;
1645
- export interface UseKeyboardListNavigationType {
1646
- /** the current active index */
1647
- activeItemIndex: number;
1648
- /** callback to be used when a key is pressed. usually used with the native prop `onKeyDown` */
1649
- onKeyboardNavigation: Listener;
1650
- /** Resets the active index to the initial state */
1651
- resetActiveIndex(): void;
1652
- /** Sets the active index to a given value */
1653
- setActiveItemIndex(value: SetStateAction<number>): void;
1654
- }
1655
- export declare type useKeyboardListNavigationType = <I>(items: I[], ref: RefObject<HTMLElement>, onListItemSelected: (itemSelected: I) => void, onListItemNavigated?: (itemSelected: I) => void, onEnterPressed?: (itemSelected: string) => void, onBackspacePressed?: Listener, keepFocusAfterSelection?: boolean, initialIndex?: number, preventTabOnEnteredValue?: boolean) => UseKeyboardListNavigationType;
1656
- /**
1657
- * Defines the props of the component.
1658
- */
1659
- export interface ListProps extends GenericProps {
1660
- /** List content (should be ListItem, ListSubheader or ListDivider). */
1661
- children: ReactNode;
1662
- /**
1663
- * Whether the list items are clickable.
1664
- * @deprecated not needed anymore.
1665
- */
1666
- isClickable?: boolean;
1667
- /** Item padding size. */
1668
- itemPadding?: Extract<Size, "big" | "huge">;
1669
- /** Tab index of the list. Default to -1 */
1670
- tabIndex?: number;
1671
- /**
1672
- * On list item selected callback.
1673
- *
1674
- * @param key React key of the selected item.
1675
- * @param index Index of the selected item among the sibling items.
1676
- * @param evt Source event (either mouse or keyboard event).
1677
- */
1678
- onListItemSelected?(key: Key, index: number, evt: SyntheticEvent): void;
1679
- }
1680
- export declare const List: Comp<ListProps, HTMLUListElement> & {
1681
- useKeyboardListNavigation: import("../../hooks/useKeyboardListNavigation").useKeyboardListNavigationType;
1682
- };
1683
- export declare type ListItemSize = Extract<Size, "tiny" | "regular" | "big" | "huge">;
1684
- /**
1685
- * Defines the props of the component.
1686
- */
1687
- export interface ListItemProps extends GenericProps {
1688
- /** A component to be rendered after the content. */
1689
- after?: ReactNode;
1690
- /** A component to be rendered before the content. */
1691
- before?: ReactNode;
1692
- /** Content. */
1693
- children: string | ReactNode;
1694
- /** Whether the list item should be highlighted or not. */
1695
- isHighlighted?: boolean;
1696
- /** Whether the component is selected or not. */
1697
- isSelected?: boolean;
1698
- /** Whether link/button is disabled or not. */
1699
- isDisabled?: boolean;
1700
- /** Reference to the <li> element. */
1701
- listItemRef?: Ref<HTMLLIElement>;
1702
- /** Custom react component for the link (can be used to inject react router Link). */
1703
- linkAs?: "a" | any;
1704
- /** Props that will be passed on to the Link */
1705
- linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
1706
- /** Reference to the link element. */
1707
- linkRef?: Ref<HTMLAnchorElement>;
1708
- /** Size variant. */
1709
- size?: ListItemSize;
1710
- /** On selected callback. */
1711
- onItemSelected?(evt: SyntheticEvent): void;
1712
- }
1713
- /**
1714
- * Check if the list item is clickable.
1715
- * @return `true` if the list item is clickable; `false` otherwise.
1716
- */
1717
- export declare function isClickable({ linkProps, onItemSelected }: Partial<ListItemProps>): boolean;
1718
- /**
1719
- * ListItem component.
1720
- *
1721
- * @param props Component props.
1722
- * @param ref Component ref.
1723
- * @return React element.
1724
- */
1725
- export declare const ListItem: Comp<ListItemProps, HTMLLIElement>;
1726
- /**
1727
- * Defines the props of the component.
1728
- */
1729
- export declare type ListDividerProps = GenericProps;
1730
- /**
1731
- * ListDivider component.
1732
- *
1733
- * @param props Component props.
1734
- * @param ref Component ref.
1735
- * @return React element.
1736
- */
1737
- export declare const ListDivider: Comp<ListDividerProps, HTMLLIElement>;
1738
- /**
1739
- * Defines the props of the component.
1740
- */
1741
- export interface ListSubheaderProps extends GenericProps {
1742
- /** Content. */
1743
- children: string | ReactNode;
1744
- }
1745
- /**
1746
- * ListSubheader component.
1747
- *
1748
- * @param props Component props.
1749
- * @param ref Component ref.
1750
- * @return React element.
1751
- */
1752
- export declare const ListSubheader: Comp<ListSubheaderProps, HTMLLIElement>;
1753
- /**
1754
- * Defines the props of the component.
1755
- */
1756
- export interface MessageProps extends GenericProps {
1757
- /** Content. */
1758
- children?: ReactNode;
1759
- /** Whether the message has a background or not. */
1760
- hasBackground?: boolean;
1761
- /** Message variant. */
1762
- kind?: Kind;
1763
- /** Message custom icon SVG path. */
1764
- icon?: string;
1765
- }
1766
- /**
1767
- * Message component.
1768
- *
1769
- * @param props Component props.
1770
- * @param ref Component ref.
1771
- * @return React element.
1772
- */
1773
- export declare const Message: Comp<MessageProps, HTMLDivElement>;
1774
- /**
1775
- * Defines the props of the component.
1776
- */
1777
- export interface MosaicProps extends GenericProps, HasTheme {
1778
- /** Thumbnails. */
1779
- thumbnails: ThumbnailProps[];
1780
- /** On image click callback. */
1781
- onImageClick?(index: number): void;
1782
- }
1783
- /**
1784
- * Mosaic component.
1785
- *
1786
- * @param props Component props.
1787
- * @param ref Component ref.
1788
- * @return React element.
1789
- */
1790
- export declare const Mosaic: Comp<MosaicProps, HTMLDivElement>;
1791
- /**
1792
- * Defines the props of the component.
1793
- */
1794
- export interface NotificationProps extends GenericProps, HasTheme {
1795
- /** Action button label. */
1796
- actionLabel?: string;
1797
- /** Content. */
1798
- content?: React.ReactNode;
1799
- /** Whether the component is open or not. */
1800
- isOpen?: boolean;
1801
- /** Notification type. */
1802
- type?: Kind;
1803
- /** Z-axis position. */
1804
- zIndex?: number;
1805
- /** On action button click callback. */
1806
- onActionClick?(): void;
1807
- /** On click callback. */
1808
- onClick?(): void;
1809
- }
1810
- /**
1811
- * Notification component.
1812
- *
1813
- * @param props Component props.
1814
- * @param ref Component ref.
1815
- * @return React element.
1816
- */
1817
- export declare const Notification: Comp<NotificationProps, HTMLDivElement>;
1818
- /**
1819
- * Defines the props of the component.
1820
- */
1821
- export interface PostBlockProps extends GenericProps, HasTheme {
1822
- /** Action toolbar content. */
1823
- actions?: ReactNode;
1824
- /** Attachment content. */
1825
- attachments?: ReactNode;
1826
- /** Author content. */
1827
- author?: ReactNode;
1828
- /** Metadata content. */
1829
- meta?: ReactNode;
1830
- /** Orientation. */
1831
- orientation?: Orientation;
1832
- /** Tag content. */
1833
- tags?: ReactNode;
1834
- /** Content (string, or sanitized html). */
1835
- text?: string | {
1836
- __html: string;
1837
- };
1838
- /** Thumbnail. */
1839
- thumbnailProps?: ThumbnailProps;
1840
- /** Title. */
1841
- title: string;
1842
- /** On click callback. */
1843
- onClick?(): void;
1844
- }
1845
- /**
1846
- * PostBlock component.
1847
- *
1848
- * @param props Component props.
1849
- * @param ref Component ref.
1850
- * @return React element.
1851
- */
1852
- export declare const PostBlock: Comp<PostBlockProps, HTMLDivElement>;
1853
- /**
1854
- * Progress variants.
1855
- */
1856
- export declare const ProgressVariant: {
1857
- readonly linear: "linear";
1858
- readonly circular: "circular";
1859
- };
1860
- export declare type ProgressVariant = ValueOf<typeof ProgressVariant>;
1861
- /**
1862
- * Defines the props of the component.
1863
- */
1864
- export interface ProgressProps extends GenericProps, HasTheme {
1865
- /** Progress variant. */
1866
- variant?: ProgressVariant;
1867
- }
1868
- /**
1869
- * Progress component.
1870
- *
1871
- * @param props Component props.
1872
- * @param ref Component ref.
1873
- * @return React element.
1874
- */
1875
- export declare const Progress: Comp<ProgressProps, HTMLDivElement>;
1876
- export interface ProgressTrackerProviderProps {
1877
- /** Active step index. */
1878
- activeStepIndex?: number;
1879
- /** ProgressTrackerProvider children. */
1880
- children: ReactNode;
1881
- /** Step panel children should not render if the step panel is hidden. */
1882
- isLazy?: boolean;
1883
- /** Activate tabs on focus. */
1884
- shouldActivateOnFocus?: boolean;
1885
- /** Step change callback. */
1886
- onChange?(index: number): void;
1887
- }
1888
- /**
1889
- * This component provides a context in which steps can be defined and linked to their step panel.
1890
- *
1891
- * It does not produce any markup so you can wrap it around any React elements and then split the ProgressTracker and ProgressTrackerPanel
1892
- * components in the react tree.
1893
- *
1894
- * This works exactly as TabProvider so it uses TabProviderContext and tabs state.
1895
- *
1896
- * @param props React component props.
1897
- * @return React element.
1898
- */
1899
- export declare const ProgressTrackerProvider: React.FC<ProgressTrackerProviderProps>;
1900
- /**
1901
- * Defines the props of the component.
1902
- */
1903
- export interface ProgressTrackerProps extends GenericProps {
1904
- /** ARIA label (purpose of the set of steps). */
1905
- ["aria-label"]: string;
1906
- /** Step list. */
1907
- children: ReactNode;
1908
- }
1909
- /**
1910
- * ProgressTracker component.
1911
- *
1912
- * Implements WAI-ARIA `tablist` role {@see https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-1/tabs.html#rps_label}
1913
- *
1914
- * @param props Component props.
1915
- * @param ref Component ref.
1916
- * @return React element.
1917
- */
1918
- export declare const ProgressTracker: Comp<ProgressTrackerProps, HTMLDivElement>;
1919
- /**
1920
- * Defines the props of the component.
1921
- */
1922
- export interface ProgressTrackerStepProps extends GenericProps {
1923
- /** Children are not supported. */
1924
- children?: never;
1925
- /** Whether the step should be in error state or not. */
1926
- hasError?: boolean;
1927
- /** Helper text. */
1928
- helper?: string | null;
1929
- /** Native id property. */
1930
- id?: string;
1931
- /** Whether the current step is active or not. */
1932
- isActive?: boolean;
1933
- /** Whether the current step is completed or not. */
1934
- isComplete?: boolean;
1935
- /** Whether the component is disabled or not. */
1936
- isDisabled?: boolean;
1937
- /** Label text. */
1938
- label?: string | null;
1939
- }
1940
- /**
1941
- * ProgressTrackerStep component.
1942
- *
1943
- * Implements WAI-ARIA `tab` role {@see https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-1/tabs.html#rps_label}
1944
- *
1945
- * @param props Component props.
1946
- * @param ref Component ref.
1947
- * @return React element.
1948
- */
1949
- export declare const ProgressTrackerStep: Comp<ProgressTrackerStepProps, HTMLButtonElement>;
1950
- /**
1951
- * Defines the props of the component.
1952
- */
1953
- export interface ProgressTrackerStepPanelProps extends GenericProps {
1954
- /** Native id property. */
1955
- id?: string;
1956
- /** Whether the step is active or not. */
1957
- isActive?: boolean;
1958
- }
1959
- /**
1960
- * ProgressTrackerStepPanel component.
1961
- *
1962
- * Implements WAI-ARIA `tabpanel` role {@see https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-1/tabs.html#rps_label}
1963
- *
1964
- * @param props Component props.
1965
- * @param ref Component ref.
1966
- * @return React element.
1967
- */
1968
- export declare const ProgressTrackerStepPanel: Comp<ProgressTrackerStepPanelProps, HTMLDivElement>;
1969
- /**
1970
- * Defines the props of the component.
1971
- */
1972
- export interface RadioButtonProps extends GenericProps, HasTheme {
1973
- /** Helper text. */
1974
- helper?: string;
1975
- /** Native input id property. */
1976
- id?: string;
1977
- /** Native input ref. */
1978
- inputRef?: React.Ref<HTMLInputElement>;
1979
- /** Whether it is checked or not. */
1980
- isChecked?: boolean;
1981
- /** Whether the component is disabled or not. */
1982
- isDisabled?: boolean;
1983
- /** Label content. */
1984
- label?: ReactNode;
1985
- /** Native input name property. */
1986
- name?: string;
1987
- /** Native input value property. */
1988
- value?: string;
1989
- /** On change callback. */
1990
- onChange?(value?: string, name?: string, event?: SyntheticEvent): void;
1991
- }
1992
- /**
1993
- * RadioButton component.
1994
- *
1995
- * @param props Component props.
1996
- * @param ref Component ref.
1997
- * @return React element.
1998
- */
1999
- export declare const RadioButton: Comp<RadioButtonProps, HTMLDivElement>;
2000
- /**
2001
- * Defines the props of the component.
2002
- */
2003
- export interface RadioGroupProps extends GenericProps {
2004
- /** RadioButton elements */
2005
- children: ReactNode;
2006
- }
2007
- /**
2008
- * RadioGroup component.
2009
- *
2010
- * @param props Component props.
2011
- * @param ref Component ref.
2012
- * @return React element.
2013
- */
2014
- export declare const RadioGroup: Comp<RadioGroupProps, HTMLDivElement>;
2015
- /**
2016
- * Select variants.
2017
- */
2018
- export declare const SelectVariant: {
2019
- readonly input: "input";
2020
- readonly chip: "chip";
2021
- };
2022
- export declare type SelectVariant = ValueOf<typeof SelectVariant>;
2023
- export interface CoreSelectProps extends GenericProps, HasTheme {
2024
- /** Props to pass to the clear button (minus those already set by the Select props). If not specified, the button won't be displayed. */
2025
- clearButtonProps?: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis">;
2026
- /** Whether the select (input variant) is displayed with error style or not. */
2027
- hasError?: boolean;
2028
- /** Error message. */
2029
- error?: string | ReactNode;
2030
- /** Helper text. */
2031
- helper?: string;
2032
- /** Whether the select should close on click. */
2033
- closeOnClick?: boolean;
2034
- /** Icon (SVG path). */
2035
- icon?: string;
2036
- /** Whether the component is disabled or not. */
2037
- isDisabled?: boolean;
2038
- /** Whether the component is required or not. */
2039
- isRequired?: boolean;
2040
- /** Whether the component is open or not. */
2041
- isOpen?: boolean;
2042
- /** Whether the select (input variant) is displayed with valid style or not. */
2043
- isValid?: boolean;
2044
- /** Label text. */
2045
- label?: string;
2046
- /** Placeholder input text. */
2047
- placeholder?: string;
2048
- /** Select variant. */
2049
- variant?: SelectVariant;
2050
- /** On clear callback. */
2051
- onClear?(event: SyntheticEvent, value?: string): void;
2052
- /** On blur callback. */
2053
- onBlur?(): void;
2054
- /** On filter text change callback (with 500ms debounce). */
2055
- onFilter?(): void;
2056
- /** On input click callback (can be used for dropdown toggle). */
2057
- onInputClick?(): void;
2058
- /** On dropdown close callback. */
2059
- onDropdownClose?(): void;
2060
- /** On scroll end callback. */
2061
- onInfiniteScroll?(): void;
2062
- /** Render value function. Default: Renders the value as a string. */
2063
- selectedValueRender?(choice: string): ReactNode | string;
2064
- }
2065
- /** Defines the props of the component. */
2066
- export interface SelectProps extends CoreSelectProps {
2067
- /** Selected value. */
2068
- value: string;
2069
- }
2070
- /**
2071
- * Select component.
2072
- *
2073
- * @param props Component props.
2074
- * @param ref Component ref.
2075
- * @return React element.
2076
- */
2077
- export declare const Select: Comp<SelectProps, HTMLDivElement>;
2078
- /** Defines the props of the component. */
2079
- export interface SelectMultipleProps extends CoreSelectProps {
2080
- /** Selected values. */
2081
- value: string[];
2082
- /** Selected value render function. Default: Renders the value inside of a Chip. */
2083
- selectedChipRender?(choice: string, index: number, onClear?: (event: SyntheticEvent, choice: string) => void, isDisabled?: boolean, theme?: any): ReactNode | string;
2084
- }
2085
- export declare const SelectMultipleField: React.FC<SelectMultipleProps>;
2086
- /**
2087
- * SelectMultiple component.
2088
- *
2089
- * @param props Component props.
2090
- * @param ref Component ref.
2091
- * @return React element.
2092
- */
2093
- export declare const SelectMultiple: Comp<SelectMultipleProps, HTMLDivElement>;
2094
- /**
2095
- * Defines the props of the component.
2096
- */
2097
- export interface SideNavigationProps extends GenericProps, HasTheme {
2098
- /** SideNavigationItem elements. */
2099
- children: ReactNode;
2100
- }
2101
- /**
2102
- * SideNavigation component.
2103
- *
2104
- * @param props Component props.
2105
- * @param ref Component ref.
2106
- * @return React element.
2107
- */
2108
- export declare const SideNavigation: Comp<SideNavigationProps, HTMLUListElement>;
2109
- /**
2110
- * Defines the props of the component.
2111
- */
2112
- export interface SideNavigationItemProps extends GenericProps {
2113
- /** SideNavigationItem elements. */
2114
- children?: ReactNode;
2115
- /** Emphasis variant. */
2116
- emphasis?: Emphasis;
2117
- /** Label content. */
2118
- label: string | ReactNode;
2119
- /** Icon (SVG path). */
2120
- icon?: string;
2121
- /** Whether the component is open or not. */
2122
- isOpen?: boolean;
2123
- /** Whether the component is selected or not. */
2124
- isSelected?: boolean;
2125
- /** Custom react component for the link (can be used to inject react router Link). */
2126
- linkAs?: "a" | any;
2127
- /** Props to pass to the link (minus those already set by the SideNavigationItem props). */
2128
- linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
2129
- /** Props to pass to the toggle button (minus those already set by the SideNavigationItem props). */
2130
- toggleButtonProps: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis" | "color" | "size">;
2131
- /**
2132
- * Choose how the children are hidden when closed
2133
- * ('hide' keeps the children in DOM but hide them, 'unmount' remove the children from the DOM).
2134
- */
2135
- closeMode?: "hide" | "unmount";
2136
- /** On action button click callback. */
2137
- onActionClick?(evt: React.MouseEvent): void;
2138
- /** On click callback. */
2139
- onClick?(evt: React.MouseEvent): void;
2140
- }
2141
- /**
2142
- * SideNavigationItem component.
2143
- *
2144
- * @param props Component props.
2145
- * @param ref Component ref.
2146
- * @return React element.
2147
- */
2148
- export declare const SideNavigationItem: Comp<SideNavigationItemProps, HTMLLIElement>;
2149
- /**
2150
- * Defines the props of the component.
2151
- */
2152
- export interface SkeletonCircleProps extends GenericProps, HasTheme {
2153
- /** Size variant. */
2154
- size: GlobalSize;
2155
- /** The color of the skeleton. */
2156
- color?: ColorPalette;
2157
- }
2158
- /**
2159
- * SkeletonCircle component.
2160
- *
2161
- * @param props Component props.
2162
- * @param ref Component ref.
2163
- * @return React element.
2164
- */
2165
- export declare const SkeletonCircle: Comp<SkeletonCircleProps, HTMLDivElement>;
2166
- /**
2167
- * Skeleton variants.
2168
- */
2169
- export declare const SkeletonRectangleVariant: {
2170
- readonly squared: "squared";
2171
- readonly rounded: "rounded";
2172
- readonly pill: "pill";
2173
- };
2174
- export declare type SkeletonRectangleVariant = ValueOf<typeof SkeletonRectangleVariant>;
2175
- /**
2176
- * Defines the props of the component.
2177
- */
2178
- export interface SkeletonRectangleProps extends GenericProps, HasTheme {
2179
- /** Aspect ratio (use with width and not height). */
2180
- aspectRatio?: Extract<AspectRatio, "square" | "horizontal" | "vertical" | "wide">;
2181
- /** Height size. */
2182
- height?: GlobalSize;
2183
- /** Border variant. */
2184
- variant?: SkeletonRectangleVariant;
2185
- /** Width size. */
2186
- width?: GlobalSize;
2187
- /** The color of the skeleton. */
2188
- color?: ColorPalette;
2189
- }
2190
- /**
2191
- * SkeletonRectangle component.
2192
- *
2193
- * @param props Component props.
2194
- * @param ref Component ref.
2195
- * @return React element.
2196
- */
2197
- export declare const SkeletonRectangle: Comp<SkeletonRectangleProps, HTMLDivElement>;
2198
- /**
2199
- * Defines the props of the component.
2200
- */
2201
- export interface SkeletonTypographyProps extends GenericProps, HasTheme {
2202
- /** Typography variant. */
2203
- typography: TypographyInterface;
2204
- /** Width CSS property. */
2205
- width?: CSSProperties["width"];
2206
- /** The color of the skeleton. */
2207
- color?: ColorPalette;
2208
- }
2209
- /**
2210
- * SkeletonTypography component.
2211
- *
2212
- * @param props Component props.
2213
- * @param ref Component ref.
2214
- * @return React element.
2215
- */
2216
- export declare const SkeletonTypography: Comp<SkeletonTypographyProps, HTMLDivElement>;
2217
- /**
2218
- * Defines the props of the component.
2219
- */
2220
- export interface SliderProps extends GenericProps, HasTheme {
2221
- /** Helper text. */
2222
- helper?: string;
2223
- /** Whether the min and max labels should be hidden or not. */
2224
- hideMinMaxLabel?: boolean;
2225
- /** Whether the component is disabled or not. */
2226
- isDisabled?: boolean;
2227
- /** Label text. */
2228
- label?: string;
2229
- /** Maximum value on the range. */
2230
- max: number;
2231
- /** Minimum value of the range. */
2232
- min: number;
2233
- /** Native input name property. */
2234
- name?: string;
2235
- /** Number of digits in the fractional part of the selected value. */
2236
- precision?: number;
2237
- /** Range step value. */
2238
- steps?: number;
2239
- /** Selected ranged value. */
2240
- value: number;
2241
- /** On change callback. */
2242
- onChange(value: number, name?: string, event?: SyntheticEvent): void;
2243
- /** On click callback. */
2244
- onMouseDown?(event: React.SyntheticEvent): void;
2245
- }
2246
- /**
2247
- * Slider component.
2248
- *
2249
- * @param props Component props.
2250
- * @param ref Component ref.
2251
- * @return React element.
2252
- */
2253
- export declare const Slider: Comp<SliderProps, HTMLDivElement>;
2254
- /**
2255
- * Clamp value in range.
2256
- *
2257
- * @param value Value to clamp.
2258
- * @param min Minimum value.
2259
- * @param max Maximum value.
2260
- * @return Clamped value.
2261
- */
2262
- export declare const clamp: (value: number, min: number, max: number) => number;
2263
- /**
2264
- * Defines the props of the component.
2265
- */
2266
- export interface SlideshowProps extends GenericProps, Pick<SlidesProps, "autoPlay" | "slidesId" | "id" | "theme" | "fillHeight" | "groupBy" | "slideGroupLabel"> {
2267
- /** current slide active */
2268
- activeIndex?: SlidesProps["activeIndex"];
2269
- /** Interval between each slide when automatic rotation is enabled. */
2270
- interval?: number;
2271
- /** Props to pass to the slideshow controls (minus those already set by the Slideshow props). */
2272
- slideshowControlsProps?: Pick<SlideshowControlsProps, "nextButtonProps" | "previousButtonProps" | "paginationItemProps"> & Omit<SlideshowControlsProps, "activeIndex" | "onPaginationClick" | "onNextClick" | "onPreviousClick" | "slidesCount" | "parentRef" | "theme">;
2273
- /** Callback when slide changes */
2274
- onChange?(index: number): void;
2275
- }
2276
- /**
2277
- * Slideshow component.
2278
- *
2279
- * @param props Component props.
2280
- * @param ref Component ref.
2281
- * @return React element.
2282
- */
2283
- export declare const Slideshow: Comp<SlideshowProps, HTMLDivElement>;
2284
- /**
2285
- * Defines the props of the component.
2286
- */
2287
- export interface SlideshowItemProps extends GenericProps {
2288
- /** interval in which slides are automatically shown */
2289
- interval?: number;
2290
- }
2291
- /**
2292
- * SlideshowItem component.
2293
- *
2294
- * @param props Component props.
2295
- * @param ref Component ref.
2296
- * @return React element.
2297
- */
2298
- export declare const SlideshowItem: Comp<SlideshowItemProps, HTMLDivElement>;
2299
- export interface UseSlideshowControlsOptions {
2300
- /** default active index to be displayed */
2301
- defaultActiveIndex?: number;
2302
- /** total slides to display */
2303
- itemsCount: number;
2304
- /** Index of the current slide. */
2305
- activeIndex?: number;
2306
- /** Whether the automatic rotation of the slideshow is enabled or not. */
2307
- autoPlay?: boolean;
2308
- /** Whether the image has to fill its container height or not. */
2309
- fillHeight?: boolean;
2310
- /** Number of slides to group together. */
2311
- groupBy?: number;
2312
- /** Interval between each slide when automatic rotation is enabled. */
2313
- interval?: number;
2314
- /** Callback when slide changes */
2315
- onChange?(index: number): void;
2316
- /** slideshow HTML id attribute */
2317
- id?: string;
2318
- /** slides wrapper HTML id attribute */
2319
- slidesId?: string;
2320
- }
2321
- export interface UseSlideshowControls {
2322
- /** Index for the first visible slide, should be used when groupBy is passed in */
2323
- startIndexVisible: number;
2324
- /** Index for the last visible slide, should be used when groupBy is passed in */
2325
- endIndexVisible: number;
2326
- /** total slides to be displayed */
2327
- slidesCount: number;
2328
- /** callback to set */
2329
- setSlideshow: (element: HTMLDivElement | null) => void;
2330
- /** reference to the slideshow element */
2331
- slideshow: HTMLDivElement | null;
2332
- /** id to be used for the slideshow */
2333
- slideshowId: string;
2334
- /** id to be used for the wrapper that contains the slides */
2335
- slideshowSlidesId: string;
2336
- /** callback that triggers the previous slide while using the slideshow controls */
2337
- onPreviousClick: (loopback: boolean) => void;
2338
- /** callback that triggers the next slide while using the slideshow controls */
2339
- onNextClick: (loopback: boolean) => void;
2340
- /** callback that triggers a specific page while using the slideshow controls */
2341
- onPaginationClick: (index: number) => void;
2342
- /** whether the slideshow is autoplaying or not */
2343
- isAutoPlaying: boolean;
2344
- /** whether the slideshow was force paused or not */
2345
- isForcePaused: boolean;
2346
- /** callback to change whether the slideshow is autoplaying or not */
2347
- toggleAutoPlay: () => void;
2348
- /** calback to change whether the slideshow should be force paused or not */
2349
- toggleForcePause: () => void;
2350
- /** current active slide index */
2351
- activeIndex: number;
2352
- /** set the current index as the active one */
2353
- setActiveIndex: (index: number) => void;
2354
- /** callback that stops the auto play */
2355
- stopAutoPlay: () => void;
2356
- /** callback that starts the auto play */
2357
- startAutoPlay: () => void;
2358
- }
2359
- /**
2360
- * Defines the props of the component.
2361
- */
2362
- export interface SlideshowControlsProps extends GenericProps, HasTheme {
2363
- /** Index of the current slide. */
2364
- activeIndex?: number;
2365
- /** Props to pass to the next button (minus those already set by the SlideshowControls props). */
2366
- nextButtonProps: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis" | "color">;
2367
- /** Reference to the parent element on which we want to listen touch swipe. */
2368
- parentRef?: RefObject<HTMLDivElement> | HTMLDivElement | null;
2369
- /** Props to pass to the previous button (minus those already set by the SlideshowControls props). */
2370
- previousButtonProps: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis" | "color">;
2371
- /** Props to pass to the pagination wrapper */
2372
- paginationProps?: Omit<React.HTMLAttributes<HTMLDivElement>, "className" | "style" | "role">;
2373
- /** Number of slides. */
2374
- slidesCount: number;
2375
- /** On next button click callback. */
2376
- onNextClick?(loopback?: boolean): void;
2377
- /** On pagination change callback. */
2378
- onPaginationClick?(index: number): void;
2379
- /** On previous button click callback. */
2380
- onPreviousClick?(loopback?: boolean): void;
2381
- /** whether the slideshow is currently playing */
2382
- isAutoPlaying?: boolean;
2383
- /**
2384
- * function to be executed in order to retrieve the label for the pagination item
2385
- * @deprecated Use paginationItemProps instead.
2386
- * */
2387
- paginationItemLabel?: (index: number) => string;
2388
- /**
2389
- * function to be executed in order to retrieve the props for a pagination item.
2390
- */
2391
- paginationItemProps?: (itemIndex: number) => React.HTMLAttributes<HTMLButtonElement> & {
2392
- label?: string;
2393
- };
2394
- /** Props to pass to the lay button (minus those already set by the SlideshowControls props). */
2395
- playButtonProps?: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis" | "color">;
2396
- }
2397
- export declare const SlideshowControls: Comp<SlideshowControlsProps, HTMLDivElement> & {
2398
- useSlideshowControls: ({ activeIndex, groupBy, interval, autoPlay, defaultActiveIndex, onChange, itemsCount, id, slidesId, }: import("../../hooks/useSlideshowControls").UseSlideshowControlsOptions) => import("../../hooks/useSlideshowControls").UseSlideshowControls;
2399
- useSlideshowControlsDefaultOptions: Partial<import("../../hooks/useSlideshowControls").UseSlideshowControlsOptions>;
2400
- };
2401
- export interface SlidesProps extends GenericProps, HasTheme {
2402
- /** current slide active */
2403
- activeIndex: number;
2404
- /** slides id to be added to the wrapper */
2405
- id?: string;
2406
- /** Whether the automatic rotation of the slideshow is enabled or not. */
2407
- autoPlay?: boolean;
2408
- /** Whether the image has to fill its container height or not. */
2409
- fillHeight?: boolean;
2410
- /** Number of slides to group together. */
2411
- groupBy?: number;
2412
- /** whether the slides are currently playing or not */
2413
- isAutoPlaying?: boolean;
2414
- /** id to be passed in into the slides */
2415
- slidesId?: string;
2416
- /** callback to change whether the slideshow is playing or not */
2417
- toggleAutoPlay: () => void;
2418
- /** component to be rendered after the slides */
2419
- afterSlides?: React.ReactNode;
2420
- /** Whether the slides have controls linked */
2421
- hasControls?: boolean;
2422
- /**
2423
- * Accessible label to set on a slide group.
2424
- * Receives the group position starting from 1 and the total number of groups.
2425
- * */
2426
- slideGroupLabel?: (groupPosition: number, groupTotal: number) => string;
2427
- }
2428
- /**
2429
- * Slides component.
2430
- *
2431
- * @param props Component props.
2432
- * @param ref Component ref.
2433
- * @return React element.
2434
- */
2435
- export declare const Slides: Comp<SlidesProps, HTMLDivElement>;
2436
- /**
2437
- * Defines the props of the component.
2438
- */
2439
- export interface SwitchProps extends GenericProps, HasTheme {
2440
- /** Helper text. */
2441
- helper?: string;
2442
- /** Whether it is checked or not. */
2443
- isChecked?: boolean;
2444
- /** Whether the component is disabled or not. */
2445
- isDisabled?: boolean;
2446
- /** Native input name property. */
2447
- name?: string;
2448
- /** Position of the switch relative to the label. */
2449
- position?: Extract<Alignment, "right" | "left">;
2450
- /** Native input value property. */
2451
- value?: string;
2452
- /** On change callback. */
2453
- onChange?(isChecked: boolean, value?: string, name?: string, event?: SyntheticEvent): void;
2454
- /** optional props for input */
2455
- inputProps?: InputHTMLAttributes<HTMLInputElement>;
2456
- }
2457
- /**
2458
- * Switch component.
2459
- *
2460
- * @param props Component props.
2461
- * @param ref Component ref.
2462
- * @return React element.
2463
- */
2464
- export declare const Switch: Comp<SwitchProps, HTMLDivElement>;
2465
- /**
2466
- * Defines the props of the component.
2467
- */
2468
- export interface TableProps extends GenericProps, HasTheme {
2469
- /** Whether the table has checkbox or thumbnail on first cell or not. */
2470
- hasBefore?: boolean;
2471
- /** Whether the table has dividers or not. */
2472
- hasDividers?: boolean;
2473
- }
2474
- /**
2475
- * Table component.
2476
- *
2477
- * @param props Component props.
2478
- * @param ref Component ref.
2479
- * @return React element.
2480
- */
2481
- export declare const Table: Comp<TableProps, HTMLTableElement>;
2482
- /**
2483
- * Defines the props of the component.
2484
- */
2485
- export declare type TableBodyProps = GenericProps;
2486
- /**
2487
- * TableBody component.
2488
- *
2489
- * @param props Component props.
2490
- * @param ref Component ref.
2491
- * @return React element.
2492
- */
2493
- export declare const TableBody: Comp<TableBodyProps, HTMLTableSectionElement>;
2494
- /**
2495
- * Table head cell sort order.
2496
- */
2497
- export declare const ThOrder: {
2498
- readonly asc: "asc";
2499
- readonly desc: "desc";
2500
- };
2501
- export declare type ThOrder = ValueOf<typeof ThOrder>;
2502
- /**
2503
- * Table cell variants.
2504
- */
2505
- export declare const TableCellVariant: {
2506
- readonly body: "body";
2507
- readonly head: "head";
2508
- };
2509
- export declare type TableCellVariant = ValueOf<typeof TableCellVariant>;
2510
- /**
2511
- * Defines the props of the component.
2512
- */
2513
- export interface TableCellProps extends GenericProps {
2514
- /** Icon (SVG path).(thead only). */
2515
- icon?: string;
2516
- /** Whether the column is sortable or not (thead only). */
2517
- isSortable?: boolean;
2518
- /** Sort order displayed as icon (sortable thead only). */
2519
- sortOrder?: ThOrder;
2520
- /** Variant. */
2521
- variant?: TableCellVariant;
2522
- /** On header cell click callback. */
2523
- onHeaderClick?(): void;
2524
- }
2525
- /**
2526
- * TableCell component.
2527
- *
2528
- * @param props Component props.
2529
- * @param ref Component ref.
2530
- * @return React element.
2531
- */
2532
- export declare const TableCell: Comp<TableCellProps, HTMLTableCellElement>;
2533
- /**
2534
- * Defines the props of the component.
2535
- */
2536
- export declare type TableHeaderProps = GenericProps;
2537
- /**
2538
- * TableHeader component.
2539
- *
2540
- * @param props Component props.
2541
- * @param ref Component ref.
2542
- * @return React element.
2543
- */
2544
- export declare const TableHeader: Comp<TableHeaderProps, HTMLTableSectionElement>;
2545
- /**
2546
- * Defines the props of the component.
2547
- */
2548
- export interface TableRowProps extends GenericProps {
2549
- /** Whether the component is clickable or not. */
2550
- isClickable?: boolean;
2551
- /** Whether the component is disabled or not. */
2552
- isDisabled?: boolean;
2553
- /** Whether the component is selected or not. */
2554
- isSelected?: boolean;
2555
- }
2556
- /**
2557
- * TableRow component.
2558
- *
2559
- * @param props Component props.
2560
- * @param ref Component ref.
2561
- * @return React element.
2562
- */
2563
- export declare const TableRow: Comp<TableRowProps, HTMLTableRowElement>;
2564
- export interface TabProviderProps {
2565
- /** Active tab index. */
2566
- activeTabIndex?: number;
2567
- /** Tab provider children. */
2568
- children: ReactNode;
2569
- /** Tab panel children should not render if the tab panel is hidden. */
2570
- isLazy?: boolean;
2571
- /** Activate tabs on focus. */
2572
- shouldActivateOnFocus?: boolean;
2573
- /** Tab change callback. */
2574
- onChange?(index: number): void;
2575
- }
2576
- /**
2577
- * This component provides a context in which tabs can be defined and linked to their tab panel.
2578
- *
2579
- * It does not produce any markup so you can wrap it around any React elements and then split the TabList and TabPanel
2580
- * components in the react tree.
2581
- *
2582
- * @param props React component props.
2583
- * @return React element.
2584
- */
2585
- export declare const TabProvider: React.FC<TabProviderProps>;
2586
- export declare enum TabListLayout {
2587
- clustered = "clustered",
2588
- fixed = "fixed"
2589
- }
2590
- /**
2591
- * Defines the props of the component.
2592
- */
2593
- export interface TabListProps extends GenericProps, HasTheme {
2594
- /** ARIA label (purpose of the set of tabs). */
2595
- ["aria-label"]: string;
2596
- /** Tab list. */
2597
- children: ReactNode;
2598
- /** Layout of the tabs in the list. */
2599
- layout?: TabListLayout;
2600
- /** Position of the tabs in the list (requires 'clustered' layout). */
2601
- position?: Alignment;
2602
- }
2603
- /**
2604
- * TabList component.
2605
- *
2606
- * Implements WAI-ARIA `tablist` role {@see https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-1/tabs.html#rps_label}
2607
- *
2608
- * @param props Component props.
2609
- * @param ref Component ref.
2610
- * @return React element.
2611
- */
2612
- export declare const TabList: Comp<TabListProps, HTMLDivElement>;
2613
- /**
2614
- * Defines the props of the component.
2615
- */
2616
- export interface TabProps extends GenericProps {
2617
- /** Children are not supported. */
2618
- children?: never;
2619
- /** Icon (SVG path). */
2620
- icon?: IconProps["icon"];
2621
- /** Native id property. */
2622
- id?: string;
2623
- /** Whether the tab is active or not. */
2624
- isActive?: boolean;
2625
- /** Whether the component is disabled or not. */
2626
- isDisabled?: boolean;
2627
- /** Label content. */
2628
- label: string | ReactNode;
2629
- }
2630
- /**
2631
- * Tab component.
2632
- *
2633
- * Implements WAI-ARIA `tab` role {@see https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-1/tabs.html#rps_label}
2634
- *
2635
- * @param props Component props.
2636
- * @param ref Component ref.
2637
- * @return React element.
2638
- */
2639
- export declare const Tab: Comp<TabProps, HTMLButtonElement>;
2640
- /**
2641
- * Defines the props of the component.
2642
- */
2643
- export interface TabPanelProps extends GenericProps {
2644
- /** Native id property */
2645
- id?: string;
2646
- /** Whether the tab is active or not. */
2647
- isActive?: boolean;
2648
- }
2649
- /**
2650
- * TabPanel component.
2651
- *
2652
- * Implements WAI-ARIA `tabpanel` role {@see https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-1/tabs.html#rps_label}
2653
- *
2654
- * @param props Component props.
2655
- * @param ref Component ref.
2656
- * @return React element.
2657
- */
2658
- export declare const TabPanel: Comp<TabPanelProps, HTMLDivElement>;
2659
- /**
2660
- * Defines the props of the component.
2661
- */
2662
- export interface TextFieldProps extends GenericProps, HasTheme {
2663
- /** Chip Group to be rendered before the main text input. */
2664
- chips?: HTMLElement | ReactNode;
2665
- /** Props to pass to the clear button (minus those already set by the TextField props). If not specified, the button won't be displayed. */
2666
- clearButtonProps?: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis">;
2667
- /** Error message. */
2668
- error?: string | ReactNode;
2669
- /** Whether we force the focus style or not. */
2670
- forceFocusStyle?: boolean;
2671
- /** Whether the text field is displayed with error style or not. */
2672
- hasError?: boolean;
2673
- /** Additional element to put at the end of the text field. */
2674
- afterElement?: ReactNode;
2675
- /** Helper text. */
2676
- helper?: string | ReactNode;
2677
- /** Icon (SVG path). */
2678
- icon?: string;
2679
- /** Native input id property (generated if not provided to link the label element). */
2680
- id?: string;
2681
- /** Reference to the <input> or <textarea> element. */
2682
- inputRef?: Ref<HTMLInputElement | HTMLTextAreaElement>;
2683
- /** Whether the component is disabled or not. */
2684
- isDisabled?: boolean;
2685
- /** Whether the component is required or not. */
2686
- isRequired?: boolean;
2687
- /** Whether the text field is displayed with valid style or not. */
2688
- isValid?: boolean;
2689
- /** Label text. */
2690
- label?: string;
2691
- /** Max string length the input accepts (constrains the input and displays a character counter). */
2692
- maxLength?: number;
2693
- /** Minimum number of rows displayed in multiline mode (requires `multiline` to be enabled). */
2694
- minimumRows?: number;
2695
- /** Whether the text field is a textarea or an input. */
2696
- multiline?: boolean;
2697
- /** Native input name property. */
2698
- name?: string;
2699
- /** Placeholder text. */
2700
- placeholder?: string;
2701
- /** Reference to the wrapper. */
2702
- textFieldRef?: Ref<HTMLDivElement>;
2703
- /** Value. */
2704
- value?: string;
2705
- /** On blur callback. */
2706
- onBlur?(event: React.FocusEvent): void;
2707
- /** On change callback. */
2708
- onChange(value: string, name?: string, event?: SyntheticEvent): void;
2709
- /** On focus callback. */
2710
- onFocus?(event: React.FocusEvent): void;
2711
- }
2712
- /**
2713
- * TextField component.
2714
- *
2715
- * @param props Component props.
2716
- * @param ref Component ref.
2717
- * @return React element.
2718
- */
2719
- export declare const TextField: Comp<TextFieldProps, HTMLDivElement>;
2720
- export declare const useFocusPointStyle: ({ image, aspectRatio, focusPoint, imgProps: { width, height } }: ThumbnailProps, element: HTMLImageElement | undefined, isLoaded: boolean) => CSSProperties;
2721
- /**
2722
- * Defines the props of the component.
2723
- */
2724
- export interface ToolbarProps extends GenericProps {
2725
- /** After content (placed after the label). */
2726
- after?: ReactNode;
2727
- /** Before content (placed before the label). */
2728
- before?: ReactNode;
2729
- /** Label content. */
2730
- label?: ReactNode;
2731
- }
2732
- /**
2733
- * Toolbar component.
2734
- *
2735
- * @param props Component props.
2736
- * @param ref Component ref.
2737
- * @return React element.
2738
- */
2739
- export declare const Toolbar: Comp<ToolbarProps, HTMLDivElement>;
2740
- /** Position of the tooltip relative to the anchor element. */
2741
- export declare type TooltipPlacement = Extract<Placement, "top" | "right" | "bottom" | "left">;
2742
- /**
2743
- * Defines the props of the component.
2744
- */
2745
- export interface TooltipProps extends GenericProps {
2746
- /** Anchor (element on which we activate the tooltip). */
2747
- children: ReactNode;
2748
- /** Delay (in ms) before closing the tooltip. */
2749
- delay?: number;
2750
- /** Whether the tooltip is displayed even without the mouse hovering the anchor. */
2751
- forceOpen?: boolean;
2752
- /** Label text. */
2753
- label?: string | null | false;
2754
- /** Placement of the tooltip relative to the anchor. */
2755
- placement?: TooltipPlacement;
2756
- }
2757
- /**
2758
- * Tooltip component.
2759
- *
2760
- * @param props Component props.
2761
- * @param ref Component ref.
2762
- * @return React element.
2763
- */
2764
- export declare const Tooltip: Comp<TooltipProps, HTMLDivElement>;
2765
- /**
2766
- * Uploader variants.
2767
- */
2768
- export declare const UploaderVariant: {
2769
- readonly square: "square";
2770
- readonly rounded: "rounded";
2771
- readonly circle: "circle";
2772
- };
2773
- export declare type UploaderVariant = ValueOf<typeof UploaderVariant>;
2774
- /**
2775
- * Uploader sizes.
2776
- */
2777
- export declare type UploaderSize = Extract<Size, "xl" | "xxl">;
2778
- /**
2779
- * Defines the props of the component.
2780
- */
2781
- export interface UploaderProps extends GenericProps, HasTheme {
2782
- /** Image aspect ratio. */
2783
- aspectRatio?: AspectRatio;
2784
- /** Icon (SVG path). */
2785
- icon?: string;
2786
- /** Label text. */
2787
- label?: string;
2788
- /** Size variant. */
2789
- size?: UploaderSize;
2790
- /** Variant. */
2791
- variant?: UploaderVariant;
2792
- /** On click callback. */
2793
- onClick?: MouseEventHandler<HTMLDivElement>;
2794
- }
2795
- /**
2796
- * Uploader component.
2797
- *
2798
- * @param props Component props.
2799
- * @param ref Component ref.
2800
- * @return React element.
2801
- */
2802
- export declare const Uploader: Comp<UploaderProps, HTMLDivElement>;
2803
- /**
2804
- * User block sizes.
2805
- */
2806
- export declare type UserBlockSize = Extract<Size, "s" | "m" | "l">;
2807
- /**
2808
- * Defines the props of the component.
2809
- */
2810
- export interface UserBlockProps extends GenericProps, HasTheme {
2811
- /** Props to pass to the avatar. */
2812
- avatarProps?: Omit<AvatarProps, "alt">;
2813
- /** Additional fields used to describe the user. */
2814
- fields?: string[];
2815
- /** Props to pass to the link wrapping the avatar thumbnail. */
2816
- linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
2817
- /** Custom react component for the link (can be used to inject react router Link). */
2818
- linkAs?: "a" | any;
2819
- /** Multiple action toolbar content. */
2820
- multipleActions?: ReactNode;
2821
- /** User name. */
2822
- name?: string;
2823
- /** Props to pass to the name block. */
2824
- nameProps?: GenericProps;
2825
- /** Orientation. */
2826
- orientation?: Orientation;
2827
- /** Simple action toolbar content. */
2828
- simpleAction?: ReactNode;
2829
- /** Size variant. */
2830
- size?: UserBlockSize;
2831
- /** On click callback. */
2832
- onClick?(): void;
2833
- /** On mouse enter callback. */
2834
- onMouseEnter?(): void;
2835
- /** On mouse leave callback. */
2836
- onMouseLeave?(): void;
2837
- }
2838
- /**
2839
- * UserBlock component.
2840
- *
2841
- * @param props Component props.
2842
- * @param ref Component ref.
2843
- * @return React element.
2844
- */
2845
- export declare const UserBlock: Comp<UserBlockProps, HTMLDivElement>;
2846
-
2847
- export {};