@lumx/react 3.18.2-alpha.4 → 3.19.1-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 (143) hide show
  1. package/index.d.ts +201 -117
  2. package/index.js +470 -480
  3. package/index.js.map +1 -1
  4. package/package.json +3 -3
  5. package/src/components/alert-dialog/AlertDialog.tsx +1 -1
  6. package/src/components/autocomplete/Autocomplete.tsx +1 -1
  7. package/src/components/autocomplete/AutocompleteMultiple.tsx +1 -1
  8. package/src/components/avatar/Avatar.tsx +1 -1
  9. package/src/components/badge/Badge.tsx +1 -1
  10. package/src/components/badge/BadgeWrapper.tsx +1 -1
  11. package/src/components/button/Button.test.tsx +5 -5
  12. package/src/components/button/Button.tsx +1 -1
  13. package/src/components/button/ButtonGroup.tsx +1 -1
  14. package/src/components/button/ButtonRoot.tsx +7 -37
  15. package/src/components/button/IconButton.tsx +1 -1
  16. package/src/components/checkbox/Checkbox.tsx +1 -1
  17. package/src/components/chip/Chip.tsx +2 -2
  18. package/src/components/chip/ChipGroup.tsx +2 -2
  19. package/src/components/comment-block/CommentBlock.tsx +1 -1
  20. package/src/components/date-picker/DatePickerControlled.tsx +1 -1
  21. package/src/components/date-picker/constants.ts +1 -1
  22. package/src/components/dialog/Dialog.tsx +1 -1
  23. package/src/components/divider/Divider.tsx +1 -1
  24. package/src/components/drag-handle/DragHandle.tsx +1 -1
  25. package/src/components/dropdown/Dropdown.tsx +1 -1
  26. package/src/components/expansion-panel/ExpansionPanel.tsx +1 -1
  27. package/src/components/flag/Flag.tsx +1 -1
  28. package/src/components/flex-box/FlexBox.tsx +2 -3
  29. package/src/components/generic-block/GenericBlock.tsx +1 -1
  30. package/src/components/grid/Grid.tsx +1 -1
  31. package/src/components/grid/GridItem.tsx +1 -1
  32. package/src/components/grid-column/GridColumn.tsx +1 -1
  33. package/src/components/heading/Heading.tsx +1 -1
  34. package/src/components/heading/constants.ts +1 -1
  35. package/src/components/icon/Icon.tsx +1 -1
  36. package/src/components/image-block/ImageBlock.tsx +1 -1
  37. package/src/components/image-lightbox/constants.ts +1 -1
  38. package/src/components/inline-list/InlineList.tsx +1 -1
  39. package/src/components/input-helper/InputHelper.tsx +1 -1
  40. package/src/components/input-label/InputLabel.test.tsx +1 -1
  41. package/src/components/input-label/InputLabel.tsx +1 -1
  42. package/src/components/lightbox/Lightbox.tsx +1 -1
  43. package/src/components/link/Link.test.tsx +8 -6
  44. package/src/components/link/Link.tsx +10 -21
  45. package/src/components/link-preview/LinkPreview.stories.tsx +1 -1
  46. package/src/components/link-preview/LinkPreview.test.tsx +1 -1
  47. package/src/components/link-preview/LinkPreview.tsx +1 -1
  48. package/src/components/list/List.tsx +1 -1
  49. package/src/components/list/ListDivider.tsx +1 -1
  50. package/src/components/list/ListItem.test.tsx +1 -3
  51. package/src/components/list/ListItem.tsx +20 -33
  52. package/src/components/list/ListSubheader.tsx +1 -1
  53. package/src/components/message/Message.tsx +1 -1
  54. package/src/components/mosaic/Mosaic.tsx +1 -1
  55. package/src/components/navigation/Navigation.test.tsx +1 -1
  56. package/src/components/navigation/Navigation.tsx +1 -1
  57. package/src/components/navigation/NavigationItem.tsx +8 -12
  58. package/src/components/navigation/NavigationSection.test.tsx +2 -1
  59. package/src/components/navigation/NavigationSection.tsx +5 -4
  60. package/src/components/navigation/context.tsx +2 -1
  61. package/src/components/notification/Notification.tsx +1 -1
  62. package/src/components/popover/Popover.tsx +1 -1
  63. package/src/components/popover-dialog/PopoverDialog.tsx +1 -1
  64. package/src/components/post-block/PostBlock.tsx +1 -1
  65. package/src/components/progress/Progress.tsx +1 -1
  66. package/src/components/progress/ProgressCircular.tsx +1 -1
  67. package/src/components/progress/ProgressLinear.tsx +1 -1
  68. package/src/components/progress-tracker/ProgressTracker.tsx +1 -1
  69. package/src/components/progress-tracker/ProgressTrackerStep.tsx +1 -1
  70. package/src/components/progress-tracker/ProgressTrackerStepPanel.tsx +1 -1
  71. package/src/components/radio-button/RadioButton.tsx +1 -1
  72. package/src/components/radio-button/RadioGroup.tsx +1 -1
  73. package/src/components/select/Select.test.tsx +1 -1
  74. package/src/components/select/Select.tsx +2 -2
  75. package/src/components/select/SelectMultiple.test.tsx +1 -1
  76. package/src/components/select/SelectMultiple.tsx +2 -2
  77. package/src/components/select/WithSelectContext.tsx +2 -2
  78. package/src/components/side-navigation/SideNavigation.tsx +1 -1
  79. package/src/components/side-navigation/SideNavigationItem.tsx +23 -28
  80. package/src/components/skeleton/SkeletonCircle.tsx +1 -1
  81. package/src/components/skeleton/SkeletonRectangle.tsx +1 -1
  82. package/src/components/skeleton/SkeletonTypography.tsx +1 -1
  83. package/src/components/slider/Slider.tsx +1 -1
  84. package/src/components/slideshow/Slides.tsx +1 -1
  85. package/src/components/slideshow/SlideshowControls.tsx +1 -1
  86. package/src/components/slideshow/SlideshowItem.tsx +1 -1
  87. package/src/components/slideshow/SlideshowItemGroup.tsx +1 -1
  88. package/src/components/switch/Switch.tsx +1 -1
  89. package/src/components/table/Table.tsx +1 -1
  90. package/src/components/table/TableBody.tsx +1 -1
  91. package/src/components/table/TableCell.tsx +1 -1
  92. package/src/components/table/TableHeader.tsx +1 -1
  93. package/src/components/table/TableRow.tsx +1 -1
  94. package/src/components/tabs/Tab.tsx +1 -1
  95. package/src/components/tabs/TabList.tsx +1 -1
  96. package/src/components/tabs/TabPanel.tsx +1 -1
  97. package/src/components/text/Text.stories.tsx +23 -1
  98. package/src/components/text/Text.tsx +2 -2
  99. package/src/components/text-field/TextField.test.tsx +1 -1
  100. package/src/components/text-field/TextField.tsx +1 -1
  101. package/src/components/thumbnail/Thumbnail.tsx +7 -12
  102. package/src/components/thumbnail/useFocusPointStyle.tsx +1 -1
  103. package/src/components/toolbar/Toolbar.tsx +1 -1
  104. package/src/components/tooltip/Tooltip.tsx +1 -1
  105. package/src/components/uploader/Uploader.tsx +1 -1
  106. package/src/components/user-block/UserBlock.tsx +1 -1
  107. package/src/hooks/useCallbackOnEscape.ts +1 -1
  108. package/src/hooks/useOverflowTooltipLabel.tsx +21 -18
  109. package/src/index.ts +3 -1
  110. package/src/utils/partitionMulti.ts +2 -1
  111. package/src/utils/react/RawClickable.test.tsx +153 -0
  112. package/src/utils/react/RawClickable.tsx +65 -0
  113. package/src/utils/type/HasRequiredLinkHref.ts +1 -0
  114. package/src/utils/type/index.ts +3 -13
  115. package/src/components/index.ts +0 -160
  116. package/src/utils/browser/event.ts +0 -1
  117. package/src/utils/className/fontColorClass.test.ts +0 -15
  118. package/src/utils/className/fontColorClass.ts +0 -12
  119. package/src/utils/className/getBasicClass.test.ts +0 -20
  120. package/src/utils/className/getRootClassName.test.ts +0 -11
  121. package/src/utils/className/getRootClassName.ts +0 -24
  122. package/src/utils/className/getTypographyClassName.test.ts +0 -7
  123. package/src/utils/className/getTypographyClassName.ts +0 -9
  124. package/src/utils/className/handleBasicClasses.test.ts +0 -28
  125. package/src/utils/className/index.ts +0 -5
  126. package/src/utils/className/resolveColorWithVariants.test.ts +0 -33
  127. package/src/utils/className/resolveColorWithVariants.ts +0 -11
  128. package/src/utils/react/renderButtonOrLink.tsx +0 -16
  129. package/src/utils/react/renderLink.tsx +0 -17
  130. package/src/utils/type/Callback.ts +0 -4
  131. package/src/utils/type/Falsy.ts +0 -5
  132. package/src/utils/type/GenericProps.ts +0 -11
  133. package/src/utils/type/HasAriaLabelOrLabelledBy.ts +0 -19
  134. package/src/utils/type/HasClassName.ts +0 -6
  135. package/src/utils/type/HasCloseMode.ts +0 -7
  136. package/src/utils/type/HasTheme.ts +0 -8
  137. package/src/utils/type/HeadingElement.ts +0 -2
  138. package/src/utils/type/Point.ts +0 -4
  139. package/src/utils/type/Predicate.ts +0 -2
  140. package/src/utils/type/RectSize.ts +0 -4
  141. package/src/utils/type/TextElement.ts +0 -4
  142. package/src/utils/type/ValueOf.ts +0 -2
  143. package/src/utils/type/color/index.ts +0 -43
@@ -1,19 +0,0 @@
1
- /**
2
- * Require either `aria-label` or `arial-labelledby` prop.
3
- * If none are set, the order will prioritize `aria-labelledby` over `aria-label` as it
4
- * needs a visible element.
5
- */
6
- export type HasAriaLabelOrLabelledBy<T = string | undefined> = T extends string
7
- ? {
8
- /**
9
- * The id of the element to use as title of the dialog. Can be within or out of the dialog.
10
- * Although it is not recommended, aria-label can be used instead if no visible element is available.
11
- */
12
- 'aria-labelledby': T;
13
- /** The label of the dialog. */
14
- 'aria-label'?: undefined;
15
- }
16
- : {
17
- 'aria-label': string;
18
- 'aria-labelledby'?: undefined;
19
- };
@@ -1,6 +0,0 @@
1
- export interface HasClassName {
2
- /**
3
- * Class name forwarded to the root element of the component.
4
- */
5
- className?: string;
6
- }
@@ -1,7 +0,0 @@
1
- export interface HasCloseMode {
2
- /**
3
- * Choose how the children are hidden when closed
4
- * ('hide' keeps the children in DOM but hide them, 'unmount' remove the children from the DOM).
5
- */
6
- closeMode?: 'hide' | 'unmount';
7
- }
@@ -1,8 +0,0 @@
1
- import type { Theme } from '@lumx/react';
2
-
3
- export interface HasTheme {
4
- /**
5
- * Theme adapting the component to light or dark background.
6
- */
7
- theme?: Theme;
8
- }
@@ -1,2 +0,0 @@
1
- /** Union type of all heading elements */
2
- export type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
@@ -1,4 +0,0 @@
1
- /**
2
- * A point coordinate in 2D space
3
- */
4
- export type Point = { x: number; y: number };
@@ -1,2 +0,0 @@
1
- /** Predicate function type */
2
- export type Predicate<T> = (t: T) => boolean;
@@ -1,4 +0,0 @@
1
- /**
2
- * Rectangle size
3
- */
4
- export type RectSize = { width: number; height: number };
@@ -1,4 +0,0 @@
1
- import type { HeadingElement } from './HeadingElement';
2
-
3
- /** Union type of all text elements */
4
- export type TextElement = 'span' | 'p' | HeadingElement;
@@ -1,2 +0,0 @@
1
- /** Get types of the values of a record. */
2
- export type ValueOf<T extends Record<any, any>> = T[keyof T];
@@ -1,43 +0,0 @@
1
- import type { ValueOf } from '@lumx/react/utils/type';
2
-
3
- /**
4
- * See SCSS variable $lumx-color-palette
5
- */
6
- export const ColorPalette = {
7
- primary: 'primary',
8
- secondary: 'secondary',
9
- blue: 'blue',
10
- dark: 'dark',
11
- green: 'green',
12
- yellow: 'yellow',
13
- red: 'red',
14
- light: 'light',
15
- grey: 'grey',
16
- } as const;
17
- export type ColorPalette = ValueOf<typeof ColorPalette>;
18
- export type Color = ColorPalette | string;
19
-
20
- /**
21
- * See SCSS variable $lumx-color-variants
22
- */
23
- export const ColorVariant = {
24
- D1: 'D1',
25
- D2: 'D2',
26
- L1: 'L1',
27
- L2: 'L2',
28
- L3: 'L3',
29
- L4: 'L4',
30
- L5: 'L5',
31
- L6: 'L6',
32
- N: 'N',
33
- } as const;
34
- export type ColorVariant = ValueOf<typeof ColorVariant>;
35
-
36
- /** ColorPalette with all possible color variant combination */
37
- export type ColorWithVariants =
38
- | ColorPalette
39
- | Exclude<
40
- `${ColorPalette}-${ColorVariant}`,
41
- // No dark variant for light and dark
42
- `light-D${number}` | `dark-D${number}`
43
- >;