@lumx/react 2.2.21 → 2.2.22-alpha-fix-generic-block.2

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 (109) hide show
  1. package/esm/_internal/AutocompleteMultiple.js.map +1 -1
  2. package/esm/_internal/Avatar2.js.map +1 -1
  3. package/esm/_internal/ButtonRoot.js.map +1 -1
  4. package/esm/_internal/Checkbox2.js.map +1 -1
  5. package/esm/_internal/Chip2.js.map +1 -1
  6. package/esm/_internal/ClickAwayProvider.js +43 -24
  7. package/esm/_internal/ClickAwayProvider.js.map +1 -1
  8. package/esm/_internal/CommentBlock.js.map +1 -1
  9. package/esm/_internal/Dialog2.js +6 -3
  10. package/esm/_internal/Dialog2.js.map +1 -1
  11. package/esm/_internal/Divider2.js.map +1 -1
  12. package/esm/_internal/DragHandle.js.map +1 -1
  13. package/esm/_internal/Dropdown2.js.map +1 -1
  14. package/esm/_internal/ExpansionPanel.js.map +1 -1
  15. package/esm/_internal/Flag2.js.map +1 -1
  16. package/esm/_internal/FlexBox.js.map +1 -1
  17. package/esm/_internal/GenericBlock.js +72 -37
  18. package/esm/_internal/GenericBlock.js.map +1 -1
  19. package/esm/_internal/Icon2.js.map +1 -1
  20. package/esm/_internal/ImageBlock.js.map +1 -1
  21. package/esm/_internal/InputHelper.js.map +1 -1
  22. package/esm/_internal/InputLabel.js.map +1 -1
  23. package/esm/_internal/Lightbox2.js +1 -1
  24. package/esm/_internal/Lightbox2.js.map +1 -1
  25. package/esm/_internal/LinkPreview.js.map +1 -1
  26. package/esm/_internal/Mosaic2.js.map +1 -1
  27. package/esm/_internal/Notification2.js.map +1 -1
  28. package/esm/_internal/Popover2.js +1 -1
  29. package/esm/_internal/Popover2.js.map +1 -1
  30. package/esm/_internal/PostBlock.js.map +1 -1
  31. package/esm/_internal/Progress2.js.map +1 -1
  32. package/esm/_internal/RadioGroup.js.map +1 -1
  33. package/esm/_internal/SelectMultiple.js.map +1 -1
  34. package/esm/_internal/SideNavigationItem.js.map +1 -1
  35. package/esm/_internal/SkeletonTypography.js.map +1 -1
  36. package/esm/_internal/Slider2.js.map +1 -1
  37. package/esm/_internal/Slides.js.map +1 -1
  38. package/esm/_internal/Switch2.js.map +1 -1
  39. package/esm/_internal/TabPanel.js.map +1 -1
  40. package/esm/_internal/TableRow.js.map +1 -1
  41. package/esm/_internal/TextField.js.map +1 -1
  42. package/esm/_internal/Thumbnail2.js.map +1 -1
  43. package/esm/_internal/Uploader2.js.map +1 -1
  44. package/esm/_internal/UserBlock.js.map +1 -1
  45. package/esm/_internal/_rollupPluginBabelHelpers.js +5 -1
  46. package/esm/_internal/_rollupPluginBabelHelpers.js.map +1 -1
  47. package/esm/_internal/generic-block.js +8 -0
  48. package/esm/_internal/generic-block.js.map +1 -1
  49. package/esm/_internal/type.js +11 -1
  50. package/esm/_internal/type.js.map +1 -1
  51. package/package.json +4 -4
  52. package/src/components/autocomplete/Autocomplete.tsx +6 -8
  53. package/src/components/avatar/Avatar.tsx +2 -4
  54. package/src/components/button/Button.test.tsx +1 -1
  55. package/src/components/button/ButtonRoot.tsx +3 -4
  56. package/src/components/button/IconButton.test.tsx +1 -1
  57. package/src/components/checkbox/Checkbox.tsx +2 -4
  58. package/src/components/chip/Chip.tsx +2 -4
  59. package/src/components/comment-block/CommentBlock.tsx +2 -4
  60. package/src/components/dialog/Dialog.stories.tsx +3 -3
  61. package/src/components/dialog/Dialog.tsx +11 -4
  62. package/src/components/divider/Divider.tsx +2 -5
  63. package/src/components/drag-handle/DragHandle.tsx +2 -5
  64. package/src/components/dropdown/Dropdown.tsx +4 -3
  65. package/src/components/expansion-panel/ExpansionPanel.tsx +2 -3
  66. package/src/components/flag/Flag.tsx +2 -4
  67. package/src/components/flex-box/FlexBox.stories.tsx +1 -1
  68. package/src/components/flex-box/FlexBox.tsx +1 -1
  69. package/src/components/generic-block/GenericBlock.stories.jsx +106 -0
  70. package/src/components/generic-block/GenericBlock.test.tsx +129 -5
  71. package/src/components/generic-block/GenericBlock.tsx +132 -44
  72. package/src/components/icon/Icon.tsx +2 -4
  73. package/src/components/image-block/ImageBlock.tsx +2 -4
  74. package/src/components/input-helper/InputHelper.tsx +2 -4
  75. package/src/components/input-label/InputLabel.tsx +2 -4
  76. package/src/components/lightbox/Lightbox.tsx +4 -6
  77. package/src/components/lightbox/__snapshots__/Lightbox.test.tsx.snap +1 -1
  78. package/src/components/link-preview/LinkPreview.tsx +2 -4
  79. package/src/components/mosaic/Mosaic.tsx +2 -4
  80. package/src/components/notification/Notification.tsx +2 -4
  81. package/src/components/popover/Popover.tsx +1 -1
  82. package/src/components/popover/__snapshots__/Popover.test.tsx.snap +10 -10
  83. package/src/components/post-block/PostBlock.tsx +2 -4
  84. package/src/components/progress/Progress.tsx +2 -4
  85. package/src/components/radio-button/RadioButton.tsx +2 -4
  86. package/src/components/select/constants.ts +2 -5
  87. package/src/components/side-navigation/SideNavigation.tsx +2 -4
  88. package/src/components/skeleton/SkeletonCircle.tsx +2 -4
  89. package/src/components/skeleton/SkeletonRectangle.tsx +2 -4
  90. package/src/components/skeleton/SkeletonTypography.tsx +2 -4
  91. package/src/components/slider/Slider.tsx +2 -4
  92. package/src/components/slideshow/Slides.tsx +2 -7
  93. package/src/components/slideshow/SlideshowControls.tsx +2 -4
  94. package/src/components/switch/Switch.tsx +2 -4
  95. package/src/components/table/Table.tsx +2 -4
  96. package/src/components/tabs/TabList.tsx +2 -4
  97. package/src/components/text-field/TextField.tsx +6 -8
  98. package/src/components/thumbnail/Thumbnail.tsx +3 -5
  99. package/src/components/uploader/Uploader.tsx +2 -4
  100. package/src/components/user-block/UserBlock.tsx +2 -4
  101. package/src/hooks/useClickAway.tsx +5 -5
  102. package/src/testing/utils/commonTestsSuite.ts +2 -2
  103. package/src/utils/ClickAwayProvider/ClickAwayProvider.stories.jsx +58 -0
  104. package/src/utils/ClickAwayProvider/ClickAwayProvider.tsx +51 -19
  105. package/src/utils/type.ts +19 -2
  106. package/types.d.ts +105 -139
  107. package/src/components/generic-block/GenericBlock.stories.tsx +0 -149
  108. package/src/components/generic-block/__snapshots__/GenericBlock.test.tsx.snap +0 -92
  109. package/src/utils/ClickAwayProvider/ClickAwayProvider.stories.tsx +0 -75
package/types.d.ts CHANGED
@@ -27,13 +27,22 @@ export declare type Comp<P, T = HTMLElement> = {
27
27
  };
28
28
  /** Union type of all heading elements */
29
29
  export declare type HeadingElement = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
30
+ export interface HasTheme {
31
+ /**
32
+ * Theme adapting the component to light or dark background.
33
+ */
34
+ theme?: Theme;
35
+ }
30
36
  /**
31
37
  * Define a generic props types.
32
38
  */
33
39
  export interface GenericProps {
40
+ /**
41
+ * Class name forwarded to the root element of the component.
42
+ */
43
+ className?: string;
34
44
  /**
35
45
  * Any prop (particularly any supported prop for a HTML element).
36
- * E.g. classNames, onClick, disabled, ...
37
46
  */
38
47
  [propName: string]: any;
39
48
  }
@@ -41,6 +50,11 @@ export interface GenericProps {
41
50
  * Callback function type alias (use for readability)
42
51
  */
43
52
  export declare type Callback = () => void;
53
+ /**
54
+ * JS falsy values.
55
+ * (excluding `NaN` as it can't be distinguished from `number`)
56
+ */
57
+ export declare type Falsy = false | undefined | null | 0 | "";
44
58
  /**
45
59
  * Alignments.
46
60
  */
@@ -252,7 +266,7 @@ export declare const AlertDialog: Comp<AlertDialogProps, HTMLDivElement>;
252
266
  /**
253
267
  * Defines the props of the component.
254
268
  */
255
- export interface AutocompleteProps extends GenericProps {
269
+ export interface AutocompleteProps extends GenericProps, HasTheme {
256
270
  /**
257
271
  * Whether the suggestions list should display anchored to the input or to the wrapper.
258
272
  * @see {@link DropdownProps#anchorToInput}
@@ -268,7 +282,7 @@ export interface AutocompleteProps extends GenericProps {
268
282
  * Reference to the <input> or <textarea> element.
269
283
  * @see {@link TextFieldProps#inputRef}
270
284
  */
271
- inputRef?: RefObject<HTMLInputElement>;
285
+ inputRef?: TextFieldProps["inputRef"];
272
286
  /**
273
287
  * The offset that will be applied to the Dropdown position.
274
288
  * @see {@link DropdownProps#offset}
@@ -333,8 +347,6 @@ export interface AutocompleteProps extends GenericProps {
333
347
  * @see {@link TextFieldProps#placeholder}
334
348
  */
335
349
  placeholder?: string;
336
- /** Theme adapting the component to light or dark background. */
337
- theme?: Theme;
338
350
  /** List of suggestions to display during autocomplete. */
339
351
  children: React.ReactNode;
340
352
  /**
@@ -431,7 +443,7 @@ export declare type AvatarSize = Extract<Size, "xs" | "s" | "m" | "l" | "xl" | "
431
443
  /**
432
444
  * Defines the props of the component.
433
445
  */
434
- export interface AvatarProps extends GenericProps {
446
+ export interface AvatarProps extends GenericProps, HasTheme {
435
447
  /** Action toolbar content. */
436
448
  actions?: ReactNode;
437
449
  /** Image alternative text. */
@@ -450,8 +462,6 @@ export interface AvatarProps extends GenericProps {
450
462
  onKeyPress?: KeyboardEventHandler<HTMLDivElement>;
451
463
  /** Size variant. */
452
464
  size?: AvatarSize;
453
- /** Theme adapting the component to light or dark background. */
454
- theme?: Theme;
455
465
  /** Props to pass to the thumbnail (minus those already set by the Avatar props). */
456
466
  thumbnailProps?: Omit<ThumbnailProps, "image" | "alt" | "size" | "theme" | "align" | "fillHeight" | "variant" | "aspectRatio">;
457
467
  }
@@ -485,7 +495,7 @@ export declare type HTMLButtonProps = DetailedHTMLProps<ButtonHTMLAttributes<HTM
485
495
  * Button size definition.
486
496
  */
487
497
  export declare type ButtonSize = Extract<Size, "s" | "m">;
488
- export interface BaseButtonProps extends GenericProps, Pick<AriaAttributes, "aria-expanded" | "aria-haspopup" | "aria-pressed" | "aria-label"> {
498
+ export interface BaseButtonProps extends GenericProps, Pick<AriaAttributes, "aria-expanded" | "aria-haspopup" | "aria-pressed" | "aria-label">, HasTheme {
489
499
  /** Color variant. */
490
500
  color?: Color;
491
501
  /** Emphasis variant. */
@@ -504,8 +514,6 @@ export interface BaseButtonProps extends GenericProps, Pick<AriaAttributes, "ari
504
514
  size?: ButtonSize;
505
515
  /** Native anchor target property. */
506
516
  target?: "_self" | "_blank" | "_parent" | "_top";
507
- /** Theme adapting the component to light or dark background. */
508
- theme?: Theme;
509
517
  /** Native button type. */
510
518
  type?: HTMLButtonProps["type"];
511
519
  /** Custom react component for the link (can be used to inject react router Link). */
@@ -588,7 +596,7 @@ export declare const ButtonGroup: Comp<ButtonGroupProps, HTMLDivElement>;
588
596
  /**
589
597
  * Defines the props of the component.
590
598
  */
591
- export interface CheckboxProps extends GenericProps {
599
+ export interface CheckboxProps extends GenericProps, HasTheme {
592
600
  /** Helper text. */
593
601
  helper?: string;
594
602
  /** Native input id property. */
@@ -603,8 +611,6 @@ export interface CheckboxProps extends GenericProps {
603
611
  label?: ReactNode;
604
612
  /** Native input name property. */
605
613
  name?: string;
606
- /** Theme adapting the component to light or dark background. */
607
- theme?: Theme;
608
614
  /** Native input value property. */
609
615
  value?: string;
610
616
  /** On change callback. */
@@ -627,7 +633,7 @@ export declare type ChipSize = Extract<Size, "s" | "m">;
627
633
  /**
628
634
  * Defines the props of the component.
629
635
  */
630
- export interface ChipProps extends GenericProps {
636
+ export interface ChipProps extends GenericProps, HasTheme {
631
637
  /** A component to be rendered after the content. */
632
638
  after?: ReactNode;
633
639
  /** A component to be rendered before the content. */
@@ -644,8 +650,6 @@ export interface ChipProps extends GenericProps {
644
650
  isSelected?: boolean;
645
651
  /** Size variant. */
646
652
  size?: ChipSize;
647
- /** Theme adapting the component to light or dark background. */
648
- theme?: Theme;
649
653
  /** On "after" element clicked callback. */
650
654
  onAfterClick?: MouseEventHandler;
651
655
  /** On "before" element clicked callback. */
@@ -691,7 +695,7 @@ export declare type CommentBlockVariant = ValueOf<typeof CommentBlockVariant>;
691
695
  /**
692
696
  * Defines the props of the component.
693
697
  */
694
- export interface CommentBlockProps extends GenericProps {
698
+ export interface CommentBlockProps extends GenericProps, HasTheme {
695
699
  /** Action toolbar content. */
696
700
  actions?: ReactNode;
697
701
  /** Props to pass to the avatar. */
@@ -720,8 +724,6 @@ export interface CommentBlockProps extends GenericProps {
720
724
  onMouseLeave?(): void;
721
725
  /** Comment content. */
722
726
  text: ReactNode | string;
723
- /** Theme adapting the component to light or dark background. */
724
- theme?: Theme;
725
727
  /** Comment variant. */
726
728
  variant?: CommentBlockVariant;
727
729
  }
@@ -835,7 +837,7 @@ export interface DialogProps extends GenericProps {
835
837
  /** Reference to the parent element that triggered modal opening (will get back focus on close). */
836
838
  parentElement?: RefObject<HTMLElement>;
837
839
  /** Reference to the dialog content element. */
838
- contentRef?: RefObject<HTMLDivElement>;
840
+ contentRef?: Ref<HTMLDivElement>;
839
841
  /** Reference to the of the element that should get the focus when the dialogs opens. By default, the first child will take focus. */
840
842
  focusElement?: RefObject<HTMLElement>;
841
843
  /** Whether to keep the dialog open on clickaway or escape press. */
@@ -863,9 +865,7 @@ export declare const Dialog: Comp<DialogProps, HTMLDivElement>;
863
865
  /**
864
866
  * Defines the props of the component.
865
867
  */
866
- export interface DividerProps extends GenericProps {
867
- /** Theme adapting the component to light or dark background. */
868
- theme?: Theme;
868
+ export interface DividerProps extends GenericProps, HasTheme {
869
869
  }
870
870
  /**
871
871
  * Component default props.
@@ -882,9 +882,7 @@ export declare const Divider: Comp<DividerProps, HTMLHRElement>;
882
882
  /**
883
883
  * Defines the props of the component.
884
884
  */
885
- export interface DragHandleProps extends GenericProps {
886
- /** Theme adapting the component to light or dark background. */
887
- theme?: Theme;
885
+ export interface DragHandleProps extends GenericProps, HasTheme {
888
886
  }
889
887
  /**
890
888
  * DragHandle component.
@@ -981,10 +979,11 @@ export declare const Popover: Comp<PopoverProps, HTMLDivElement>;
981
979
  * Defines the props of the component.
982
980
  */
983
981
  export interface DropdownProps extends GenericProps {
984
- /** Reference to the element around which the dropdown is placed.
982
+ /**
983
+ * Reference to the element around which the dropdown is placed.
985
984
  * @see {@link PopoverProps#anchorRef}
986
985
  */
987
- anchorRef: React.RefObject<HTMLElement>;
986
+ anchorRef: PopoverProps["anchorRef"];
988
987
  /** Dropdown content. */
989
988
  children: React.ReactNode;
990
989
  /**
@@ -1054,7 +1053,7 @@ export declare const Dropdown: Comp<DropdownProps, HTMLDivElement>;
1054
1053
  /**
1055
1054
  * Defines the props of the component.
1056
1055
  */
1057
- export interface ExpansionPanelProps extends GenericProps {
1056
+ export interface ExpansionPanelProps extends GenericProps, HasTheme {
1058
1057
  /** Whether the expansion panel has a background. */
1059
1058
  hasBackground?: boolean;
1060
1059
  /** Whether the header has a divider. */
@@ -1063,8 +1062,6 @@ export interface ExpansionPanelProps extends GenericProps {
1063
1062
  isOpen?: boolean;
1064
1063
  /** Label text (overwritten if a `<header>` is provided in the children). */
1065
1064
  label?: string;
1066
- /** Theme adapting the component to light or dark background. */
1067
- theme?: Theme;
1068
1065
  /** On open callback. */
1069
1066
  onOpen?: Callback;
1070
1067
  /** On close callback. */
@@ -1082,9 +1079,7 @@ export interface ExpansionPanelProps extends GenericProps {
1082
1079
  * @return React element.
1083
1080
  */
1084
1081
  export declare const ExpansionPanel: Comp<ExpansionPanelProps, HTMLDivElement>;
1085
- export interface FlagProps extends GenericProps {
1086
- /** Theme adapting the component to light or dark background. */
1087
- theme?: Theme;
1082
+ export interface FlagProps extends GenericProps, HasTheme {
1088
1083
  /** Color of the component. */
1089
1084
  color?: ColorPalette;
1090
1085
  /** Icon to use before the label. */
@@ -1101,7 +1096,7 @@ export interface FlagProps extends GenericProps {
1101
1096
  */
1102
1097
  export declare const Flag: Comp<FlagProps, HTMLDivElement>;
1103
1098
  export declare type MarginAutoAlignment = Extract<Alignment, "top" | "bottom" | "right" | "left">;
1104
- export declare type GapSize = Extract<Size, "regular" | "medium" | "big" | "huge">;
1099
+ export declare type GapSize = Extract<Size, "tiny" | "regular" | "medium" | "big" | "huge">;
1105
1100
  /**
1106
1101
  * Defines the props of the component.
1107
1102
  */
@@ -1134,40 +1129,65 @@ export interface FlexBoxProps extends GenericProps {
1134
1129
  */
1135
1130
  export declare const FlexBox: Comp<FlexBoxProps, HTMLDivElement>;
1136
1131
  export interface GenericBlockProps extends FlexBoxProps {
1137
- /** Component to use as visual element. */
1132
+ /**
1133
+ * Component to use as visual element.
1134
+ */
1138
1135
  figure?: ReactNode;
1139
- /** Actions to set after the main content. */
1136
+ /**
1137
+ * Actions to set after the main content.
1138
+ */
1140
1139
  actions?: ReactNode;
1141
- /** Main content to display */
1140
+ /**
1141
+ * Main content to display or sections components
1142
+ * ({@see GenericBlock.Figure}, {@see GenericBlock.Content} & {@see GenericBlock.Actions})
1143
+ */
1142
1144
  children: ReactNode;
1143
- /** Orientation of the 3 sections */
1145
+ /**
1146
+ * Orientation of the 3 sections
1147
+ */
1144
1148
  orientation?: FlexBoxProps["orientation"];
1145
- /** Horizontal alignment. */
1149
+ /**
1150
+ * Horizontal alignment.
1151
+ */
1146
1152
  hAlign?: FlexBoxProps["hAlign"];
1147
- /** Vertical alignment. */
1153
+ /**
1154
+ * Vertical alignment.
1155
+ */
1148
1156
  vAlign?: FlexBoxProps["vAlign"];
1149
1157
  /**
1150
1158
  * The props to forward to the content.
1151
1159
  * By default, the content will have the same alignment as wrapper.
1152
1160
  */
1153
1161
  contentProps?: Omit<FlexBoxProps, "children">;
1154
- /** props to forward to the actions element. */
1162
+ /**
1163
+ * props to forward to the actions element.
1164
+ */
1155
1165
  actionsProps?: Omit<FlexBoxProps, "children">;
1156
- /** props to forward to the figure element. */
1166
+ /**
1167
+ * props to forward to the figure element.
1168
+ */
1157
1169
  figureProps?: Omit<FlexBoxProps, "children">;
1158
1170
  }
1159
- /**
1160
- * The GenericBlock is a layout component made of 3 sections that can be
1161
- * displayed either horizontally of vertically with the same gap between each section.
1162
- *
1163
- * The sections are:
1164
- * * (Optional) `Figure` => A visual element to display before the main content.
1165
- * * (Required) `Content` => The main content displayed
1166
- * * (Optional) `Actions` => One or more actions to set after the element.
1167
- *
1168
- * @see https://www.figma.com/file/lzzrQmsfaXRaOyRfoEogPZ/DS%3A-playground?node-id=1%3A4076
1169
- */
1170
- export declare const GenericBlock: Comp<GenericBlockProps, HTMLDivElement>;
1171
+ export declare type BaseGenericBlock = Comp<GenericBlockProps, HTMLDivElement>;
1172
+ export interface GenericBlock extends BaseGenericBlock {
1173
+ /**
1174
+ * Use `GenericBlock.Figure` component as children of the `GenericBlock` component as an alternative way to inject
1175
+ * the "figure" section of the block (instead of using `figure` and `figureProps` props).
1176
+ */
1177
+ Figure: Comp<FlexBoxProps>;
1178
+ /**
1179
+ * Use `GenericBlock.Content` component as children of the `GenericBlock` component as an alternative way to inject
1180
+ * the "content" section of the block (instead of using `content` and `contentProps` props).
1181
+ */
1182
+ Content: Comp<FlexBoxProps>;
1183
+ /**
1184
+ * Use `GenericBlock.Actions` component as children of the `GenericBlock` component as an alternative way to inject
1185
+ * the "actions" section of the block (instead of using `actions` and `actionsProps` props).
1186
+ */
1187
+ Actions: Comp<FlexBoxProps>;
1188
+ }
1189
+ declare const BaseGenericBlock: BaseGenericBlock;
1190
+ export declare const GenericBlock: GenericBlock;
1171
1191
  export declare type GridGutterSize = Extract<Size, "regular" | "big" | "huge">;
1172
1192
  /**
1173
1193
  * Defines the props of the component.
@@ -1216,7 +1236,7 @@ export declare type IconSizes = Extract<Size, "xxs" | "xs" | "s" | "m" | "l" | "
1216
1236
  /**
1217
1237
  * Defines the props of the component.
1218
1238
  */
1219
- export interface IconProps extends GenericProps {
1239
+ export interface IconProps extends GenericProps, HasTheme {
1220
1240
  /** Color variant. */
1221
1241
  color?: Color;
1222
1242
  /** Lightened or darkened variant of the selected icon color. */
@@ -1230,8 +1250,6 @@ export interface IconProps extends GenericProps {
1230
1250
  icon: string;
1231
1251
  /** Size variant. */
1232
1252
  size?: IconSizes;
1233
- /** Theme adapting the component to light or dark background. */
1234
- theme?: Theme;
1235
1253
  /** Sets an alternative text on the svg. Will set an `img` role to the svg. */
1236
1254
  alt?: string;
1237
1255
  }
@@ -1271,7 +1289,7 @@ export declare type ImgHTMLProps = ImgHTMLAttributes<HTMLImageElement>;
1271
1289
  /**
1272
1290
  * Defines the props of the component.
1273
1291
  */
1274
- export interface ThumbnailProps extends GenericProps {
1292
+ export interface ThumbnailProps extends GenericProps, HasTheme {
1275
1293
  /** Alignment of the thumbnail in it's parent (requires flex parent). */
1276
1294
  align?: HorizontalAlignment;
1277
1295
  /** Image alternative text. */
@@ -1279,7 +1297,7 @@ export interface ThumbnailProps extends GenericProps {
1279
1297
  /** Image aspect ratio. */
1280
1298
  aspectRatio?: AspectRatio;
1281
1299
  /** Badge. */
1282
- badge?: ReactElement;
1300
+ badge?: ReactElement | Falsy;
1283
1301
  /** Image cross origin resource policy. */
1284
1302
  crossOrigin?: ImgHTMLProps["crossOrigin"];
1285
1303
  /** Fallback icon (SVG path) or react node when image fails to load. */
@@ -1304,8 +1322,6 @@ export interface ThumbnailProps extends GenericProps {
1304
1322
  onClick?: MouseEventHandler<HTMLDivElement>;
1305
1323
  /** On key press callback. */
1306
1324
  onKeyPress?: KeyboardEventHandler<HTMLDivElement>;
1307
- /** Theme adapting the component to light or dark background. */
1308
- theme?: Theme;
1309
1325
  /** Variant of the component. */
1310
1326
  variant?: ThumbnailVariant;
1311
1327
  /** Props to pass to the link wrapping the thumbnail. */
@@ -1336,7 +1352,7 @@ export declare type ImageBlockSize = Extract<Size, "xl" | "xxl">;
1336
1352
  /**
1337
1353
  * Defines the props of the component.
1338
1354
  */
1339
- export interface ImageBlockProps extends GenericProps {
1355
+ export interface ImageBlockProps extends GenericProps, HasTheme {
1340
1356
  /** Action toolbar content. */
1341
1357
  actions?: ReactNode;
1342
1358
  /** Alignment. */
@@ -1359,8 +1375,6 @@ export interface ImageBlockProps extends GenericProps {
1359
1375
  size?: ImageBlockSize;
1360
1376
  /** Tag content. */
1361
1377
  tags?: ReactNode;
1362
- /** Theme adapting the component to light or dark background. */
1363
- theme?: Theme;
1364
1378
  /** Props to pass to the thumbnail (minus those already set by the ImageBlock props). */
1365
1379
  thumbnailProps?: Omit<ThumbnailProps, "image" | "size" | "theme" | "align" | "fillHeight">;
1366
1380
  /** Image title to display in the caption. */
@@ -1377,13 +1391,11 @@ export declare const ImageBlock: Comp<ImageBlockProps, HTMLDivElement>;
1377
1391
  /**
1378
1392
  * Defines the props of the component.
1379
1393
  */
1380
- export interface InputHelperProps extends GenericProps {
1394
+ export interface InputHelperProps extends GenericProps, HasTheme {
1381
1395
  /** Helper content. */
1382
1396
  children: string | ReactNode;
1383
1397
  /** Helper variant. */
1384
1398
  kind?: Kind;
1385
- /** Theme adapting the component to light or dark background. */
1386
- theme?: Theme;
1387
1399
  }
1388
1400
  /**
1389
1401
  * InputHelper component.
@@ -1396,15 +1408,13 @@ export declare const InputHelper: Comp<InputHelperProps, HTMLSpanElement>;
1396
1408
  /**
1397
1409
  * Defines the props of the component.
1398
1410
  */
1399
- export interface InputLabelProps extends GenericProps {
1411
+ export interface InputLabelProps extends GenericProps, HasTheme {
1400
1412
  /** Label content. */
1401
1413
  children: string | ReactNode;
1402
1414
  /** Native htmlFor property. */
1403
1415
  htmlFor: string;
1404
1416
  /** Whether the component is required or not. */
1405
1417
  isRequired?: boolean;
1406
- /** Theme adapting the component to light or dark background. */
1407
- theme?: Theme;
1408
1418
  }
1409
1419
  /**
1410
1420
  * InputLabel component.
@@ -1417,7 +1427,7 @@ export declare const InputLabel: Comp<InputLabelProps, HTMLLabelElement>;
1417
1427
  /**
1418
1428
  * Defines the props of the component.
1419
1429
  */
1420
- export interface LightboxProps extends GenericProps {
1430
+ export interface LightboxProps extends GenericProps, HasTheme {
1421
1431
  /** Props to pass to the close button (minus those already set by the Lightbox props). */
1422
1432
  closeButtonProps?: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis" | "color">;
1423
1433
  /** Whether the component is open or not. */
@@ -1426,8 +1436,6 @@ export interface LightboxProps extends GenericProps {
1426
1436
  parentElement: RefObject<any>;
1427
1437
  /** Whether to keep the dialog open on clickaway or escape press. */
1428
1438
  preventAutoClose?: boolean;
1429
- /** Theme adapting the component to light or dark background. */
1430
- theme?: Theme;
1431
1439
  /** Z-axis position. */
1432
1440
  zIndex?: number;
1433
1441
  /** On close callback. */
@@ -1476,7 +1484,7 @@ export declare const Link: Comp<LinkProps, HTMLAnchorElement | HTMLButtonElement
1476
1484
  /**
1477
1485
  * Defines the props of the component.
1478
1486
  */
1479
- export interface LinkPreviewProps extends GenericProps {
1487
+ export interface LinkPreviewProps extends GenericProps, HasTheme {
1480
1488
  /** Description. */
1481
1489
  description?: string;
1482
1490
  /** Link URL. */
@@ -1487,8 +1495,6 @@ export interface LinkPreviewProps extends GenericProps {
1487
1495
  linkProps?: Omit<LinkProps, "color" | "colorVariant" | "href" | "target">;
1488
1496
  /** Size variant. */
1489
1497
  size?: Extract<Size, "regular" | "big">;
1490
- /** Theme adapting the component to light or dark background. */
1491
- theme?: Theme;
1492
1498
  /** Thumbnail for the link preview. */
1493
1499
  thumbnailProps?: ThumbnailProps;
1494
1500
  /** Title. */
@@ -1637,9 +1643,7 @@ export declare const Message: Comp<MessageProps, HTMLDivElement>;
1637
1643
  /**
1638
1644
  * Defines the props of the component.
1639
1645
  */
1640
- export interface MosaicProps extends GenericProps {
1641
- /** Theme adapting the component to light or dark background. */
1642
- theme?: Theme;
1646
+ export interface MosaicProps extends GenericProps, HasTheme {
1643
1647
  /** Thumbnails. */
1644
1648
  thumbnails: ThumbnailProps[];
1645
1649
  /** On image click callback. */
@@ -1656,15 +1660,13 @@ export declare const Mosaic: Comp<MosaicProps, HTMLDivElement>;
1656
1660
  /**
1657
1661
  * Defines the props of the component.
1658
1662
  */
1659
- export interface NotificationProps extends GenericProps {
1663
+ export interface NotificationProps extends GenericProps, HasTheme {
1660
1664
  /** Action button label. */
1661
1665
  actionLabel?: string;
1662
1666
  /** Content. */
1663
1667
  content?: React.ReactNode;
1664
1668
  /** Whether the component is open or not. */
1665
1669
  isOpen?: boolean;
1666
- /** Theme adapting the component to light or dark background. */
1667
- theme?: Theme;
1668
1670
  /** Notification type. */
1669
1671
  type?: Kind;
1670
1672
  /** Z-axis position. */
@@ -1685,7 +1687,7 @@ export declare const Notification: Comp<NotificationProps, HTMLDivElement>;
1685
1687
  /**
1686
1688
  * Defines the props of the component.
1687
1689
  */
1688
- export interface PostBlockProps extends GenericProps {
1690
+ export interface PostBlockProps extends GenericProps, HasTheme {
1689
1691
  /** Action toolbar content. */
1690
1692
  actions?: ReactNode;
1691
1693
  /** Attachment content. */
@@ -1702,8 +1704,6 @@ export interface PostBlockProps extends GenericProps {
1702
1704
  text?: string | {
1703
1705
  __html: string;
1704
1706
  };
1705
- /** Theme adapting the component to light or dark background. */
1706
- theme?: Theme;
1707
1707
  /** Thumbnail. */
1708
1708
  thumbnailProps?: ThumbnailProps;
1709
1709
  /** Title. */
@@ -1730,9 +1730,7 @@ export declare type ProgressVariant = ValueOf<typeof ProgressVariant>;
1730
1730
  /**
1731
1731
  * Defines the props of the component.
1732
1732
  */
1733
- export interface ProgressProps extends GenericProps {
1734
- /** Theme adapting the component to light or dark background. */
1735
- theme?: Theme;
1733
+ export interface ProgressProps extends GenericProps, HasTheme {
1736
1734
  /** Progress variant. */
1737
1735
  variant?: ProgressVariant;
1738
1736
  }
@@ -1840,7 +1838,7 @@ export declare const ProgressTrackerStepPanel: Comp<ProgressTrackerStepPanelProp
1840
1838
  /**
1841
1839
  * Defines the props of the component.
1842
1840
  */
1843
- export interface RadioButtonProps extends GenericProps {
1841
+ export interface RadioButtonProps extends GenericProps, HasTheme {
1844
1842
  /** Helper text. */
1845
1843
  helper?: string;
1846
1844
  /** Native input id property. */
@@ -1855,8 +1853,6 @@ export interface RadioButtonProps extends GenericProps {
1855
1853
  label?: ReactNode;
1856
1854
  /** Native input name property. */
1857
1855
  name?: string;
1858
- /** Theme adapting the component to light or dark background. */
1859
- theme?: Theme;
1860
1856
  /** Native input value property. */
1861
1857
  value?: string;
1862
1858
  /** On change callback. */
@@ -1893,7 +1889,7 @@ export declare const SelectVariant: {
1893
1889
  readonly chip: "chip";
1894
1890
  };
1895
1891
  export declare type SelectVariant = ValueOf<typeof SelectVariant>;
1896
- export interface CoreSelectProps extends GenericProps {
1892
+ export interface CoreSelectProps extends GenericProps, HasTheme {
1897
1893
  /** Props to pass to the clear button (minus those already set by the Select props). If not specified, the button won't be displayed. */
1898
1894
  clearButtonProps?: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis">;
1899
1895
  /** Whether the select (input variant) is displayed with error style or not. */
@@ -1918,8 +1914,6 @@ export interface CoreSelectProps extends GenericProps {
1918
1914
  label?: string;
1919
1915
  /** Placeholder input text. */
1920
1916
  placeholder?: string;
1921
- /** Theme adapting the component to light or dark background. */
1922
- theme?: Theme;
1923
1917
  /** Select variant. */
1924
1918
  variant?: SelectVariant;
1925
1919
  /** On clear callback. */
@@ -1969,11 +1963,9 @@ export declare const SelectMultiple: Comp<SelectMultipleProps, HTMLDivElement>;
1969
1963
  /**
1970
1964
  * Defines the props of the component.
1971
1965
  */
1972
- export interface SideNavigationProps extends GenericProps {
1966
+ export interface SideNavigationProps extends GenericProps, HasTheme {
1973
1967
  /** SideNavigationItem elements. */
1974
1968
  children: ReactNode;
1975
- /** Theme adapting the component to light or dark background. */
1976
- theme?: Theme;
1977
1969
  }
1978
1970
  /**
1979
1971
  * SideNavigation component.
@@ -2026,11 +2018,9 @@ export declare const SideNavigationItem: Comp<SideNavigationItemProps, HTMLLIEle
2026
2018
  /**
2027
2019
  * Defines the props of the component.
2028
2020
  */
2029
- export interface SkeletonCircleProps extends GenericProps {
2021
+ export interface SkeletonCircleProps extends GenericProps, HasTheme {
2030
2022
  /** Size variant. */
2031
2023
  size: GlobalSize;
2032
- /** Theme. */
2033
- theme?: Theme;
2034
2024
  /** The color of the skeleton. */
2035
2025
  color?: ColorPalette;
2036
2026
  }
@@ -2054,13 +2044,11 @@ export declare type SkeletonRectangleVariant = ValueOf<typeof SkeletonRectangleV
2054
2044
  /**
2055
2045
  * Defines the props of the component.
2056
2046
  */
2057
- export interface SkeletonRectangleProps extends GenericProps {
2047
+ export interface SkeletonRectangleProps extends GenericProps, HasTheme {
2058
2048
  /** Aspect ratio (use with width and not height). */
2059
2049
  aspectRatio?: Extract<AspectRatio, "square" | "horizontal" | "vertical" | "wide">;
2060
2050
  /** Height size. */
2061
2051
  height?: GlobalSize;
2062
- /** Theme adapting the component to light or dark background. */
2063
- theme?: Theme;
2064
2052
  /** Border variant. */
2065
2053
  variant?: SkeletonRectangleVariant;
2066
2054
  /** Width size. */
@@ -2079,9 +2067,7 @@ export declare const SkeletonRectangle: Comp<SkeletonRectangleProps, HTMLDivElem
2079
2067
  /**
2080
2068
  * Defines the props of the component.
2081
2069
  */
2082
- export interface SkeletonTypographyProps extends GenericProps {
2083
- /** Theme adapting the component to light or dark background. */
2084
- theme?: Theme;
2070
+ export interface SkeletonTypographyProps extends GenericProps, HasTheme {
2085
2071
  /** Typography variant. */
2086
2072
  typography: TypographyInterface;
2087
2073
  /** Width CSS property. */
@@ -2100,7 +2086,7 @@ export declare const SkeletonTypography: Comp<SkeletonTypographyProps, HTMLDivEl
2100
2086
  /**
2101
2087
  * Defines the props of the component.
2102
2088
  */
2103
- export interface SliderProps extends GenericProps {
2089
+ export interface SliderProps extends GenericProps, HasTheme {
2104
2090
  /** Helper text. */
2105
2091
  helper?: string;
2106
2092
  /** Whether the min and max labels should be hidden or not. */
@@ -2119,8 +2105,6 @@ export interface SliderProps extends GenericProps {
2119
2105
  precision?: number;
2120
2106
  /** Range step value. */
2121
2107
  steps?: number;
2122
- /** Theme adapting the component to light or dark background. */
2123
- theme?: Theme;
2124
2108
  /** Selected ranged value. */
2125
2109
  value: number;
2126
2110
  /** On change callback. */
@@ -2246,7 +2230,7 @@ export interface UseSlideshowControls {
2246
2230
  /**
2247
2231
  * Defines the props of the component.
2248
2232
  */
2249
- export interface SlideshowControlsProps extends GenericProps {
2233
+ export interface SlideshowControlsProps extends GenericProps, HasTheme {
2250
2234
  /** Index of the current slide. */
2251
2235
  activeIndex?: number;
2252
2236
  /** Props to pass to the next button (minus those already set by the SlideshowControls props). */
@@ -2257,8 +2241,6 @@ export interface SlideshowControlsProps extends GenericProps {
2257
2241
  previousButtonProps: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis" | "color">;
2258
2242
  /** Number of slides. */
2259
2243
  slidesCount: number;
2260
- /** Theme adapting the component to light or dark background. */
2261
- theme?: Theme;
2262
2244
  /** On next button click callback. */
2263
2245
  onNextClick?(loopback?: boolean): void;
2264
2246
  /** On pagination change callback. */
@@ -2276,15 +2258,11 @@ export declare const SlideshowControls: Comp<SlideshowControlsProps, HTMLDivElem
2276
2258
  useSlideshowControls: ({ activeIndex, groupBy, interval, autoPlay, defaultActiveIndex, onChange, itemsCount, id, slidesId, }: import("../../hooks/useSlideshowControls").UseSlideshowControlsOptions) => import("../../hooks/useSlideshowControls").UseSlideshowControls;
2277
2259
  useSlideshowControlsDefaultOptions: Partial<import("../../hooks/useSlideshowControls").UseSlideshowControlsOptions>;
2278
2260
  };
2279
- export interface SlidesProps extends GenericProps {
2261
+ export interface SlidesProps extends GenericProps, HasTheme {
2280
2262
  /** current slide active */
2281
2263
  activeIndex: number;
2282
2264
  /** slides id to be added to the wrapper */
2283
2265
  id?: string;
2284
- /** custom classname */
2285
- className?: string;
2286
- /** custom theme */
2287
- theme?: Theme;
2288
2266
  /** Whether the automatic rotation of the slideshow is enabled or not. */
2289
2267
  autoPlay?: boolean;
2290
2268
  /** Whether the image has to fill its container height or not. */
@@ -2311,7 +2289,7 @@ export declare const Slides: Comp<SlidesProps, HTMLDivElement>;
2311
2289
  /**
2312
2290
  * Defines the props of the component.
2313
2291
  */
2314
- export interface SwitchProps extends GenericProps {
2292
+ export interface SwitchProps extends GenericProps, HasTheme {
2315
2293
  /** Helper text. */
2316
2294
  helper?: string;
2317
2295
  /** Whether it is checked or not. */
@@ -2322,8 +2300,6 @@ export interface SwitchProps extends GenericProps {
2322
2300
  name?: string;
2323
2301
  /** Position of the switch relative to the label. */
2324
2302
  position?: Extract<Alignment, "right" | "left">;
2325
- /** Theme adapting the component to light or dark background. */
2326
- theme?: Theme;
2327
2303
  /** Native input value property. */
2328
2304
  value?: string;
2329
2305
  /** On change callback. */
@@ -2342,13 +2318,11 @@ export declare const Switch: Comp<SwitchProps, HTMLDivElement>;
2342
2318
  /**
2343
2319
  * Defines the props of the component.
2344
2320
  */
2345
- export interface TableProps extends GenericProps {
2321
+ export interface TableProps extends GenericProps, HasTheme {
2346
2322
  /** Whether the table has checkbox or thumbnail on first cell or not. */
2347
2323
  hasBefore?: boolean;
2348
2324
  /** Whether the table has dividers or not. */
2349
2325
  hasDividers?: boolean;
2350
- /** Theme adapting the component to light or dark background. */
2351
- theme?: Theme;
2352
2326
  }
2353
2327
  /**
2354
2328
  * Table component.
@@ -2469,7 +2443,7 @@ export declare enum TabListLayout {
2469
2443
  /**
2470
2444
  * Defines the props of the component.
2471
2445
  */
2472
- export interface TabListProps extends GenericProps {
2446
+ export interface TabListProps extends GenericProps, HasTheme {
2473
2447
  /** ARIA label (purpose of the set of tabs). */
2474
2448
  ["aria-label"]: string;
2475
2449
  /** Tab list. */
@@ -2478,8 +2452,6 @@ export interface TabListProps extends GenericProps {
2478
2452
  layout?: TabListLayout;
2479
2453
  /** Position of the tabs in the list (requires 'clustered' layout). */
2480
2454
  position?: Alignment;
2481
- /** Theme adapting the component to light or dark background. */
2482
- theme?: Theme;
2483
2455
  }
2484
2456
  /**
2485
2457
  * TabList component.
@@ -2540,7 +2512,7 @@ export declare const TabPanel: Comp<TabPanelProps, HTMLDivElement>;
2540
2512
  /**
2541
2513
  * Defines the props of the component.
2542
2514
  */
2543
- export interface TextFieldProps extends GenericProps {
2515
+ export interface TextFieldProps extends GenericProps, HasTheme {
2544
2516
  /** Chip Group to be rendered before the main text input. */
2545
2517
  chips?: HTMLElement | ReactNode;
2546
2518
  /** Props to pass to the clear button (minus those already set by the TextField props). If not specified, the button won't be displayed. */
@@ -2560,7 +2532,7 @@ export interface TextFieldProps extends GenericProps {
2560
2532
  /** Native input id property (generated if not provided to link the label element). */
2561
2533
  id?: string;
2562
2534
  /** Reference to the <input> or <textarea> element. */
2563
- inputRef?: RefObject<HTMLInputElement> | RefObject<HTMLTextAreaElement>;
2535
+ inputRef?: Ref<HTMLInputElement | HTMLTextAreaElement>;
2564
2536
  /** Whether the component is disabled or not. */
2565
2537
  isDisabled?: boolean;
2566
2538
  /** Whether the component is required or not. */
@@ -2580,9 +2552,7 @@ export interface TextFieldProps extends GenericProps {
2580
2552
  /** Placeholder text. */
2581
2553
  placeholder?: string;
2582
2554
  /** Reference to the wrapper. */
2583
- textFieldRef?: RefObject<HTMLDivElement>;
2584
- /** Theme adapting the component to light or dark background. */
2585
- theme?: Theme;
2555
+ textFieldRef?: Ref<HTMLDivElement>;
2586
2556
  /** Value. */
2587
2557
  value?: string;
2588
2558
  /** On blur callback. */
@@ -2661,7 +2631,7 @@ export declare type UploaderSize = Extract<Size, "xl" | "xxl">;
2661
2631
  /**
2662
2632
  * Defines the props of the component.
2663
2633
  */
2664
- export interface UploaderProps extends GenericProps {
2634
+ export interface UploaderProps extends GenericProps, HasTheme {
2665
2635
  /** Image aspect ratio. */
2666
2636
  aspectRatio?: AspectRatio;
2667
2637
  /** Icon (SVG path). */
@@ -2670,8 +2640,6 @@ export interface UploaderProps extends GenericProps {
2670
2640
  label?: string;
2671
2641
  /** Size variant. */
2672
2642
  size?: UploaderSize;
2673
- /** Theme adapting the component to light or dark background. */
2674
- theme?: Theme;
2675
2643
  /** Variant. */
2676
2644
  variant?: UploaderVariant;
2677
2645
  /** On click callback. */
@@ -2692,7 +2660,7 @@ export declare type UserBlockSize = Extract<Size, "s" | "m" | "l">;
2692
2660
  /**
2693
2661
  * Defines the props of the component.
2694
2662
  */
2695
- export interface UserBlockProps extends GenericProps {
2663
+ export interface UserBlockProps extends GenericProps, HasTheme {
2696
2664
  /** Props to pass to the avatar. */
2697
2665
  avatarProps?: Omit<AvatarProps, "alt">;
2698
2666
  /** Additional fields used to describe the user. */
@@ -2713,8 +2681,6 @@ export interface UserBlockProps extends GenericProps {
2713
2681
  simpleAction?: ReactNode;
2714
2682
  /** Size variant. */
2715
2683
  size?: UserBlockSize;
2716
- /** Theme adapting the component to light or dark background. */
2717
- theme?: Theme;
2718
2684
  /** On click callback. */
2719
2685
  onClick?(): void;
2720
2686
  /** On mouse enter callback. */