@lumx/react 3.10.1-alpha.5 → 3.10.1-alpha.7

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 (115) hide show
  1. package/_internal/Falsy.d.ts +7 -0
  2. package/index.d.ts +291 -5
  3. package/index.js +167 -267
  4. package/index.js.map +1 -1
  5. package/package.json +3 -3
  6. package/src/components/alert-dialog/AlertDialog.tsx +3 -2
  7. package/src/components/autocomplete/Autocomplete.tsx +2 -2
  8. package/src/components/autocomplete/AutocompleteMultiple.tsx +2 -2
  9. package/src/components/avatar/Avatar.tsx +3 -3
  10. package/src/components/badge/Badge.tsx +3 -3
  11. package/src/components/badge/BadgeWrapper.tsx +2 -3
  12. package/src/components/button/Button.tsx +4 -4
  13. package/src/components/button/ButtonGroup.tsx +2 -3
  14. package/src/components/button/IconButton.tsx +2 -2
  15. package/src/components/checkbox/Checkbox.tsx +3 -3
  16. package/src/components/chip/Chip.tsx +3 -3
  17. package/src/components/chip/ChipGroup.tsx +2 -3
  18. package/src/components/comment-block/CommentBlock.tsx +3 -3
  19. package/src/components/date-picker/constants.ts +2 -2
  20. package/src/components/dialog/Dialog.tsx +5 -5
  21. package/src/components/divider/Divider.tsx +3 -3
  22. package/src/components/drag-handle/DragHandle.tsx +3 -3
  23. package/src/components/dropdown/Dropdown.tsx +3 -4
  24. package/src/components/expansion-panel/ExpansionPanel.tsx +6 -6
  25. package/src/components/flag/Flag.tsx +3 -3
  26. package/src/components/flex-box/FlexBox.tsx +3 -3
  27. package/src/components/generic-block/GenericBlock.tsx +2 -3
  28. package/src/components/grid/Grid.tsx +3 -3
  29. package/src/components/grid/GridItem.tsx +3 -3
  30. package/src/components/grid-column/GridColumn.tsx +2 -3
  31. package/src/components/heading/Heading.tsx +2 -3
  32. package/src/components/icon/Icon.tsx +3 -3
  33. package/src/components/image-block/ImageBlock.tsx +3 -3
  34. package/src/components/image-lightbox/constants.ts +2 -2
  35. package/src/components/inline-list/InlineList.tsx +3 -3
  36. package/src/components/input-helper/InputHelper.tsx +3 -3
  37. package/src/components/input-label/InputLabel.tsx +3 -3
  38. package/src/components/lightbox/Lightbox.tsx +3 -3
  39. package/src/components/link/Link.tsx +3 -3
  40. package/src/components/link-preview/LinkPreview.tsx +3 -3
  41. package/src/components/list/List.tsx +3 -3
  42. package/src/components/list/ListDivider.tsx +2 -3
  43. package/src/components/list/ListItem.tsx +3 -3
  44. package/src/components/list/ListSubheader.tsx +2 -3
  45. package/src/components/list/useInteractiveList.tsx +3 -3
  46. package/src/components/message/Message.tsx +3 -3
  47. package/src/components/mosaic/Mosaic.tsx +3 -3
  48. package/src/components/navigation/Navigation.tsx +3 -3
  49. package/src/components/navigation/NavigationItem.tsx +9 -3
  50. package/src/components/navigation/NavigationSection.tsx +3 -3
  51. package/src/components/notification/Notification.tsx +3 -3
  52. package/src/components/popover/Popover.tsx +3 -3
  53. package/src/components/popover-dialog/PopoverDialog.tsx +2 -3
  54. package/src/components/post-block/PostBlock.tsx +3 -3
  55. package/src/components/progress/Progress.tsx +3 -3
  56. package/src/components/progress/ProgressCircular.tsx +3 -3
  57. package/src/components/progress/ProgressLinear.tsx +3 -3
  58. package/src/components/progress-tracker/ProgressTracker.tsx +2 -3
  59. package/src/components/progress-tracker/ProgressTrackerStep.tsx +3 -3
  60. package/src/components/radio-button/RadioButton.tsx +3 -3
  61. package/src/components/radio-button/RadioGroup.tsx +2 -3
  62. package/src/components/select/Select.tsx +3 -2
  63. package/src/components/select/SelectMultiple.tsx +3 -2
  64. package/src/components/select/WithSelectContext.tsx +3 -2
  65. package/src/components/side-navigation/SideNavigation.tsx +3 -4
  66. package/src/components/side-navigation/SideNavigationItem.tsx +4 -4
  67. package/src/components/skeleton/SkeletonCircle.tsx +3 -3
  68. package/src/components/skeleton/SkeletonRectangle.tsx +3 -3
  69. package/src/components/skeleton/SkeletonTypography.tsx +3 -3
  70. package/src/components/slider/Slider.tsx +3 -3
  71. package/src/components/slideshow/Slides.tsx +3 -3
  72. package/src/components/slideshow/SlideshowControls.tsx +3 -3
  73. package/src/components/slideshow/SlideshowItem.tsx +2 -3
  74. package/src/components/slideshow/SlideshowItemGroup.tsx +2 -3
  75. package/src/components/switch/Switch.tsx +3 -3
  76. package/src/components/table/Table.tsx +3 -3
  77. package/src/components/table/TableBody.tsx +2 -3
  78. package/src/components/table/TableCell.tsx +3 -3
  79. package/src/components/table/TableHeader.tsx +2 -3
  80. package/src/components/table/TableRow.tsx +3 -3
  81. package/src/components/text/Text.tsx +4 -9
  82. package/src/components/text-field/TextField.tsx +3 -3
  83. package/src/components/thumbnail/Thumbnail.tsx +3 -3
  84. package/src/components/toolbar/Toolbar.tsx +3 -3
  85. package/src/components/tooltip/Tooltip.tsx +3 -3
  86. package/src/components/uploader/Uploader.tsx +3 -3
  87. package/src/components/user-block/UserBlock.tsx +3 -3
  88. package/src/utils/className/index.ts +0 -1
  89. package/src/utils/className.test.js +41 -0
  90. package/src/utils/type/Callback.ts +4 -0
  91. package/src/utils/type/Comp.ts +14 -0
  92. package/src/utils/type/ComponentClassName.ts +7 -0
  93. package/src/utils/type/ComponentRef.ts +16 -0
  94. package/src/utils/type/Falsy.ts +5 -0
  95. package/src/utils/type/GenericProps.ts +11 -0
  96. package/src/utils/type/HasAriaLabelOrLabelledBy.ts +19 -0
  97. package/src/utils/type/HasClassName.ts +6 -0
  98. package/src/utils/type/HasCloseMode.ts +7 -0
  99. package/src/utils/type/HasPolymorphicAs.ts +8 -0
  100. package/src/utils/type/HasTheme.ts +8 -0
  101. package/src/utils/type/HeadingElement.ts +2 -0
  102. package/src/utils/type/KebabCase.ts +6 -0
  103. package/src/utils/type/MaybeElementOrRef.ts +6 -0
  104. package/src/utils/type/Point.ts +4 -0
  105. package/src/utils/type/Predicate.ts +2 -0
  106. package/src/utils/type/RectSize.ts +4 -0
  107. package/src/utils/type/TextElement.ts +4 -0
  108. package/src/utils/type/ValueOf.ts +2 -0
  109. package/src/utils/type/index.ts +19 -0
  110. package/src/utils/type/isComponentType.ts +9 -0
  111. package/utils/index.d.ts +1 -1
  112. package/_internal/index.d.ts +0 -285
  113. package/src/utils/className/getRootClassName.test.ts +0 -11
  114. package/src/utils/className/getRootClassName.ts +0 -24
  115. package/src/utils/type.ts +0 -164
@@ -1,4 +1,4 @@
1
- import { getRootClassName } from '@lumx/react/utils/className';
1
+ import type { ComponentClassName } from '@lumx/react/utils/type';
2
2
 
3
3
  /**
4
4
  * Component display name.
@@ -8,4 +8,4 @@ export const COMPONENT_NAME = 'ImageLightbox';
8
8
  /**
9
9
  * Component default class name and class prefix.
10
10
  */
11
- export const CLASSNAME = getRootClassName(COMPONENT_NAME);
11
+ export const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-image-lightbox';
@@ -3,8 +3,8 @@ import React, { Children, isValidElement } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { ColorPalette, ColorVariant, Typography } from '@lumx/react';
6
- import { GenericProps } from '@lumx/react/utils/type';
7
- import { getFontColorClassName, getRootClassName, getTypographyClassName } from '@lumx/react/utils/className';
6
+ import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
7
+ import { getFontColorClassName, getTypographyClassName } from '@lumx/react/utils/className';
8
8
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
9
9
 
10
10
  /**
@@ -37,7 +37,7 @@ const COMPONENT_NAME = 'InlineList';
37
37
  /**
38
38
  * Component default class name and class prefix.
39
39
  */
40
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
40
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-inline-list';
41
41
 
42
42
  /**
43
43
  * Component default props.
@@ -3,8 +3,8 @@ import React, { ReactNode } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { Kind, Theme } from '@lumx/react';
6
- import { GenericProps, HasTheme } from '@lumx/react/utils/type';
7
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
6
+ import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
7
+ import { handleBasicClasses } from '@lumx/react/utils/className';
8
8
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
9
9
 
10
10
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
@@ -28,7 +28,7 @@ const COMPONENT_NAME = 'InputHelper';
28
28
  /**
29
29
  * Component default class name and class prefix.
30
30
  */
31
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
31
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-input-helper';
32
32
 
33
33
  /**
34
34
  * Component default props.
@@ -3,8 +3,8 @@ import React, { ReactNode } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { Theme } from '@lumx/react';
6
- import { GenericProps, HasTheme } from '@lumx/react/utils/type';
7
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
6
+ import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
7
+ import { handleBasicClasses } from '@lumx/react/utils/className';
8
8
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
9
9
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
10
10
 
@@ -28,7 +28,7 @@ const COMPONENT_NAME = 'InputLabel';
28
28
  /**
29
29
  * Component default class name and class prefix.
30
30
  */
31
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
31
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-input-label';
32
32
 
33
33
  /**
34
34
  * Component default props.
@@ -6,8 +6,8 @@ import { createPortal } from 'react-dom';
6
6
  import { mdiClose } from '@lumx/icons';
7
7
  import { IconButton, IconButtonProps } from '@lumx/react';
8
8
  import { DIALOG_TRANSITION_DURATION, DOCUMENT } from '@lumx/react/constants';
9
- import { GenericProps, HasTheme } from '@lumx/react/utils/type';
10
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
9
+ import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
10
+ import { handleBasicClasses } from '@lumx/react/utils/className';
11
11
 
12
12
  import { useFocusTrap } from '@lumx/react/hooks/useFocusTrap';
13
13
  import { useDisableBodyScroll } from '@lumx/react/hooks/useDisableBodyScroll';
@@ -47,7 +47,7 @@ const COMPONENT_NAME = 'Lightbox';
47
47
  /**
48
48
  * Component default class name and class prefix.
49
49
  */
50
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
50
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-lightbox';
51
51
 
52
52
  /**
53
53
  * Lightbox component.
@@ -3,8 +3,8 @@ import React, { RefObject, useMemo } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { ColorPalette, ColorVariant, Icon, Size, Typography } from '@lumx/react';
6
- import { GenericProps } from '@lumx/react/utils/type';
7
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
6
+ import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
7
+ import { handleBasicClasses } from '@lumx/react/utils/className';
8
8
  import { renderLink } from '@lumx/react/utils/renderLink';
9
9
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
10
10
 
@@ -42,7 +42,7 @@ const COMPONENT_NAME = 'Link';
42
42
  /**
43
43
  * Component default class name and class prefix.
44
44
  */
45
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
45
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-link';
46
46
 
47
47
  const getIconSize = (typography?: Typography) => {
48
48
  switch (typography) {
@@ -14,8 +14,8 @@ import {
14
14
  ThumbnailProps,
15
15
  } from '@lumx/react';
16
16
 
17
- import { GenericProps, HeadingElement, HasTheme } from '@lumx/react/utils/type';
18
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
17
+ import type { GenericProps, HeadingElement, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
18
+ import { handleBasicClasses } from '@lumx/react/utils/className';
19
19
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
20
20
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
21
21
 
@@ -49,7 +49,7 @@ const COMPONENT_NAME = 'LinkPreview';
49
49
  /**
50
50
  * Component default class name and class prefix.
51
51
  */
52
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
52
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-link-preview';
53
53
 
54
54
  /**
55
55
  * Component default props.
@@ -4,8 +4,8 @@ import classNames from 'classnames';
4
4
 
5
5
  import { Size } from '@lumx/react';
6
6
  import { useKeyboardListNavigation } from '@lumx/react/hooks/useKeyboardListNavigation';
7
- import { GenericProps } from '@lumx/react/utils/type';
8
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
7
+ import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
8
+ import { handleBasicClasses } from '@lumx/react/utils/className';
9
9
  import { mergeRefs } from '@lumx/react/utils/mergeRefs';
10
10
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
11
11
 
@@ -44,7 +44,7 @@ const COMPONENT_NAME = 'List';
44
44
  /**
45
45
  * Component default class name and class prefix.
46
46
  */
47
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
47
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-list';
48
48
 
49
49
  /**
50
50
  * Component default props.
@@ -2,8 +2,7 @@ import React from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
5
- import { GenericProps } from '@lumx/react/utils/type';
6
- import { getRootClassName } from '@lumx/react/utils/className';
5
+ import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
7
6
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
8
7
 
9
8
  /**
@@ -19,7 +18,7 @@ const COMPONENT_NAME = 'ListDivider';
19
18
  /**
20
19
  * Component default class name and class prefix.
21
20
  */
22
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
21
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-list-divider';
23
22
 
24
23
  /**
25
24
  * ListDivider component.
@@ -3,9 +3,9 @@ import React, { ReactNode, Ref, SyntheticEvent, useMemo } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { ListProps, Size } from '@lumx/react';
6
- import { GenericProps } from '@lumx/react/utils/type';
6
+ import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
7
7
  import { onEnterPressed, onButtonPressed } from '@lumx/react/utils/browser/event';
8
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
8
+ import { handleBasicClasses } from '@lumx/react/utils/className';
9
9
  import { renderLink } from '@lumx/react/utils/renderLink';
10
10
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
11
11
 
@@ -50,7 +50,7 @@ const COMPONENT_NAME = 'ListItem';
50
50
  /**
51
51
  * Component default class name and class prefix.
52
52
  */
53
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
53
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-list-item';
54
54
 
55
55
  /**
56
56
  * Component default props.
@@ -2,8 +2,7 @@ import React, { ReactNode } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
5
- import { GenericProps } from '@lumx/react/utils/type';
6
- import { getRootClassName } from '@lumx/react/utils/className';
5
+ import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
7
6
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
8
7
 
9
8
  /**
@@ -22,7 +21,7 @@ const COMPONENT_NAME = 'ListSubheader';
22
21
  /**
23
22
  * Component default class name and class prefix.
24
23
  */
25
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
24
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-list-subheader';
26
25
 
27
26
  /**
28
27
  * ListSubheader component.
@@ -1,7 +1,7 @@
1
- import { ListItemProps } from '@lumx/react';
1
+ import { ListItem, ListItemProps } from '@lumx/react';
2
2
  import { isClickable } from '@lumx/react/components/list/ListItem';
3
3
 
4
- import { isComponent } from '@lumx/react/utils/type';
4
+ import { isComponentType } from '@lumx/react/utils/type';
5
5
  import { flattenChildren } from '@lumx/react/utils/flattenChildren';
6
6
  import { mergeRefs } from '@lumx/react/utils/mergeRefs';
7
7
  import {
@@ -74,7 +74,7 @@ function onKeyboardFocus(props: any, handler: (evt: FocusEvent) => void) {
74
74
  }
75
75
 
76
76
  const isNavigableItem = (node: ReactNode): node is ReactElement => {
77
- return isComponent('ListItem')(node) && isClickable(node.props) && !node.props.isDisabled;
77
+ return isComponentType(ListItem)(node) && isClickable(node.props) && !node.props.isDisabled;
78
78
  };
79
79
 
80
80
  /**
@@ -4,8 +4,8 @@ import classNames from 'classnames';
4
4
 
5
5
  import { mdiAlert, mdiAlertCircle, mdiCheckCircle, mdiClose, mdiInformation } from '@lumx/icons';
6
6
  import { ColorPalette, Emphasis, Icon, IconButton, Kind, Size } from '@lumx/react';
7
- import { GenericProps } from '@lumx/react/utils/type';
8
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
7
+ import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
8
+ import { handleBasicClasses } from '@lumx/react/utils/className';
9
9
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
10
10
 
11
11
  /**
@@ -41,7 +41,7 @@ const COMPONENT_NAME = 'Message';
41
41
  /**
42
42
  * Component default class name and class prefix.
43
43
  */
44
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
44
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-message';
45
45
 
46
46
  /**
47
47
  * Associative map from message kind to color and icon.
@@ -4,8 +4,8 @@ import classNames from 'classnames';
4
4
 
5
5
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
6
6
  import { Alignment, AspectRatio, Theme, Thumbnail, ThumbnailProps } from '@lumx/react';
7
- import { GenericProps, HasTheme } from '@lumx/react/utils/type';
8
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
7
+ import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
8
+ import { handleBasicClasses } from '@lumx/react/utils/className';
9
9
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
10
10
 
11
11
  /**
@@ -26,7 +26,7 @@ const COMPONENT_NAME = 'Mosaic';
26
26
  /**
27
27
  * Component default class name and class prefix.
28
28
  */
29
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
29
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-mosaic';
30
30
 
31
31
  /**
32
32
  * Component default props.
@@ -2,8 +2,8 @@ import React from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
5
- import { HasAriaLabelOrLabelledBy, HasClassName, HasTheme } from '@lumx/react/utils/type';
6
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
5
+ import type { HasAriaLabelOrLabelledBy, HasClassName, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
6
+ import { handleBasicClasses } from '@lumx/react/utils/className';
7
7
  import { Orientation, Theme } from '@lumx/react';
8
8
  import { ThemeProvider, useTheme } from '@lumx/react/utils/theme/ThemeContext';
9
9
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
@@ -28,7 +28,7 @@ const COMPONENT_NAME = 'Navigation';
28
28
  /**
29
29
  * Component default class name and class prefix.
30
30
  */
31
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
31
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-navigation';
32
32
 
33
33
  /**
34
34
  * Component default props
@@ -1,7 +1,13 @@
1
1
  import React, { ElementType, ReactNode } from 'react';
2
2
  import { Icon, Placement, Size, Tooltip, Text } from '@lumx/react';
3
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
4
- import { ComponentRef, HasClassName, HasPolymorphicAs, HasTheme } from '@lumx/react/utils/type';
3
+ import { handleBasicClasses } from '@lumx/react/utils/className';
4
+ import type {
5
+ ComponentRef,
6
+ HasClassName,
7
+ HasPolymorphicAs,
8
+ HasTheme,
9
+ ComponentClassName,
10
+ } from '@lumx/react/utils/type';
5
11
  import classNames from 'classnames';
6
12
  import { forwardRefPolymorphic } from '@lumx/react/utils/react/forwardRefPolymorphic';
7
13
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
@@ -36,7 +42,7 @@ const COMPONENT_NAME = 'NavigationItem';
36
42
  /**
37
43
  * Component default class name and class prefix.
38
44
  */
39
- export const CLASSNAME = getRootClassName(COMPONENT_NAME);
45
+ export const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-navigation-item';
40
46
 
41
47
  export const NavigationItem = Object.assign(
42
48
  forwardRefPolymorphic(<E extends ElementType = 'a'>(props: NavigationItemProps<E>, ref: ComponentRef<E>) => {
@@ -3,8 +3,8 @@ import React, { useRef, useState, useContext } from 'react';
3
3
  import { mdiChevronDown, mdiChevronUp } from '@lumx/icons';
4
4
  import { Icon, Size, Text, Orientation, Popover, Placement, Theme } from '@lumx/react';
5
5
  import classNames from 'classnames';
6
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
7
- import { HasClassName } from '@lumx/react/utils/type';
6
+ import { handleBasicClasses } from '@lumx/react/utils/className';
7
+ import type { HasClassName, ComponentClassName } from '@lumx/react/utils/type';
8
8
  import { ThemeProvider, useTheme } from '@lumx/react/utils/theme/ThemeContext';
9
9
  import { useId } from '@lumx/react/hooks/useId';
10
10
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
@@ -29,7 +29,7 @@ const COMPONENT_NAME = 'NavigationSection';
29
29
  /**
30
30
  * Component default class name and class prefix.
31
31
  */
32
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
32
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-navigation-section';
33
33
 
34
34
  export const NavigationSection = forwardRef<NavigationSectionProps, HTMLLIElement>((props, ref) => {
35
35
  const { children, className, label, icon, ...forwardedProps } = props;
@@ -5,8 +5,8 @@ import classNames from 'classnames';
5
5
  import { Button, Emphasis, Icon, Kind, Size, Theme } from '@lumx/react';
6
6
  import { DOCUMENT, NOTIFICATION_TRANSITION_DURATION } from '@lumx/react/constants';
7
7
  import { NOTIFICATION_CONFIGURATION } from '@lumx/react/components/notification/constants';
8
- import { GenericProps, HasTheme } from '@lumx/react/utils/type';
9
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
8
+ import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
9
+ import { handleBasicClasses } from '@lumx/react/utils/className';
10
10
  import { useTransitionVisibility } from '@lumx/react/hooks/useTransitionVisibility';
11
11
  import { mergeRefs } from '@lumx/react/utils/mergeRefs';
12
12
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
@@ -42,7 +42,7 @@ const COMPONENT_NAME = 'Notification';
42
42
  /**
43
43
  * Component default class name and class prefix.
44
44
  */
45
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
45
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-notification';
46
46
 
47
47
  /**
48
48
  * Component default props.
@@ -7,8 +7,8 @@ import { useCallbackOnEscape } from '@lumx/react/hooks/useCallbackOnEscape';
7
7
  import { useFocus } from '@lumx/react/hooks/useFocus';
8
8
  import { ClickAwayProvider } from '@lumx/react/utils/ClickAwayProvider';
9
9
  import { DOCUMENT } from '@lumx/react/constants';
10
- import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
11
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
10
+ import type { Comp, GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
11
+ import { handleBasicClasses } from '@lumx/react/utils/className';
12
12
  import { useMergeRefs } from '@lumx/react/utils/mergeRefs';
13
13
  import { useFocusTrap } from '@lumx/react/hooks/useFocusTrap';
14
14
  import { skipRender } from '@lumx/react/utils/skipRender';
@@ -80,7 +80,7 @@ const COMPONENT_NAME = 'Popover';
80
80
  /**
81
81
  * Component default class name and class prefix.
82
82
  */
83
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
83
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-popover';
84
84
 
85
85
  /**
86
86
  * Component default props.
@@ -2,8 +2,7 @@ import React from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
5
- import { HasAriaLabelOrLabelledBy } from '@lumx/react/utils/type';
6
- import { getRootClassName } from '@lumx/react/utils/className';
5
+ import { HasAriaLabelOrLabelledBy, ComponentClassName } from '@lumx/react/utils/type';
7
6
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
8
7
 
9
8
  import { Popover, PopoverProps } from '../popover/Popover';
@@ -22,7 +21,7 @@ const COMPONENT_NAME = 'PopoverDialog';
22
21
  /**
23
22
  * Component default class name and class prefix.
24
23
  */
25
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
24
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-popover-dialog';
26
25
 
27
26
  /**
28
27
  * Component default props.
@@ -2,8 +2,8 @@ import React, { ReactNode } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
  import { Orientation, Theme, Thumbnail, ThumbnailProps, ThumbnailVariant } from '@lumx/react';
5
- import { GenericProps, HasTheme } from '@lumx/react/utils/type';
6
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
5
+ import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
6
+ import { handleBasicClasses } from '@lumx/react/utils/className';
7
7
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
8
8
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
9
9
 
@@ -41,7 +41,7 @@ const COMPONENT_NAME = 'PostBlock';
41
41
  /**
42
42
  * Component default class name and class prefix.
43
43
  */
44
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
44
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-post-block';
45
45
 
46
46
  /**
47
47
  * Component default props.
@@ -3,8 +3,8 @@ import React from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { Theme } from '@lumx/react';
6
- import { GenericProps, HasTheme, ValueOf } from '@lumx/react/utils/type';
7
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
6
+ import type { GenericProps, HasTheme, ValueOf, ComponentClassName } from '@lumx/react/utils/type';
7
+ import { handleBasicClasses } from '@lumx/react/utils/className';
8
8
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
9
9
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
10
10
 
@@ -33,7 +33,7 @@ const COMPONENT_NAME = 'Progress';
33
33
  /**
34
34
  * Component default class name and class prefix.
35
35
  */
36
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
36
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-progress';
37
37
 
38
38
  /**
39
39
  * Component default props.
@@ -3,8 +3,8 @@ import React from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { Theme, Size } from '@lumx/react';
6
- import { GenericProps, HasTheme } from '@lumx/react/utils/type';
7
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
6
+ import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
7
+ import { handleBasicClasses } from '@lumx/react/utils/className';
8
8
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
9
9
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
10
10
 
@@ -29,7 +29,7 @@ const COMPONENT_NAME = 'ProgressCircular';
29
29
  /**
30
30
  * Component default class name and class prefix.
31
31
  */
32
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
32
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-progress-circular';
33
33
 
34
34
  /**
35
35
  * Component default props.
@@ -3,8 +3,8 @@ import React from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { Theme } from '@lumx/react';
6
- import { GenericProps, HasTheme } from '@lumx/react/utils/type';
7
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
6
+ import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
7
+ import { handleBasicClasses } from '@lumx/react/utils/className';
8
8
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
9
9
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
10
10
 
@@ -18,7 +18,7 @@ const COMPONENT_NAME = 'ProgressLinear';
18
18
  /**
19
19
  * Component default class name and class prefix.
20
20
  */
21
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
21
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-progress-linear';
22
22
 
23
23
  /**
24
24
  * Component default props.
@@ -2,8 +2,7 @@ import React, { ReactNode } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
5
- import { GenericProps } from '@lumx/react/utils/type';
6
- import { getRootClassName } from '@lumx/react/utils/className';
5
+ import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
7
6
  import { mergeRefs } from '@lumx/react/utils/mergeRefs';
8
7
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
9
8
 
@@ -28,7 +27,7 @@ const COMPONENT_NAME = 'ProgressTracker';
28
27
  /**
29
28
  * Component default class name and class prefix.
30
29
  */
31
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
30
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-progress-tracker';
32
31
 
33
32
  /**
34
33
  * Component default props.
@@ -4,8 +4,8 @@ import classNames from 'classnames';
4
4
 
5
5
  import { mdiAlertCircle, mdiCheckCircle, mdiRadioboxBlank, mdiRadioboxMarked } from '@lumx/icons';
6
6
  import { Icon, InputHelper, InputLabel, Kind, Size } from '@lumx/react';
7
- import { GenericProps } from '@lumx/react/utils/type';
8
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
7
+ import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
8
+ import { handleBasicClasses } from '@lumx/react/utils/className';
9
9
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
10
10
 
11
11
  import { useTabProviderContext } from '../tabs/state';
@@ -40,7 +40,7 @@ const COMPONENT_NAME = 'ProgressTrackerStep';
40
40
  /**
41
41
  * Component default class name and class prefix.
42
42
  */
43
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
43
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-progress-tracker-step';
44
44
 
45
45
  /**
46
46
  * Component default props.
@@ -3,8 +3,8 @@ import React, { ReactNode, SyntheticEvent, InputHTMLAttributes } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { InputHelper, InputLabel, Theme } from '@lumx/react';
6
- import { GenericProps, HasTheme } from '@lumx/react/utils/type';
7
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
6
+ import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
7
+ import { handleBasicClasses } from '@lumx/react/utils/className';
8
8
  import { useId } from '@lumx/react/hooks/useId';
9
9
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
10
10
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
@@ -43,7 +43,7 @@ const COMPONENT_NAME = 'RadioButton';
43
43
  /**
44
44
  * Component default class name and class prefix.
45
45
  */
46
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
46
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-radio-button';
47
47
 
48
48
  /**
49
49
  * Component default props.
@@ -2,8 +2,7 @@ import React, { ReactNode } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
5
- import { GenericProps } from '@lumx/react/utils/type';
6
- import { getRootClassName } from '@lumx/react/utils/className';
5
+ import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
7
6
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
8
7
 
9
8
  /**
@@ -22,7 +21,7 @@ const COMPONENT_NAME = 'RadioGroup';
22
21
  /**
23
22
  * Component default class name and class prefix.
24
23
  */
25
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
24
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-radio-group';
26
25
 
27
26
  /**
28
27
  * RadioGroup component.
@@ -8,9 +8,10 @@ import { IconButton } from '@lumx/react/components/button/IconButton';
8
8
  import { Chip } from '@lumx/react/components/chip/Chip';
9
9
  import { Icon } from '@lumx/react/components/icon/Icon';
10
10
  import { InputLabel } from '@lumx/react/components/input-label/InputLabel';
11
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
11
+ import { handleBasicClasses } from '@lumx/react/utils/className';
12
12
  import { mergeRefs } from '@lumx/react/utils/mergeRefs';
13
13
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
14
+ import type { ComponentClassName } from '@lumx/react/utils/type';
14
15
 
15
16
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
16
17
  import { WithSelectContext } from './WithSelectContext';
@@ -28,7 +29,7 @@ export { SelectVariant };
28
29
  const COMPONENT_NAME = 'Select';
29
30
 
30
31
  /** The default class name and classes prefix for this component. */
31
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
32
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-select';
32
33
 
33
34
  /** The default value of props. */
34
35
  const DEFAULT_PROPS: Partial<SelectProps> = {
@@ -7,10 +7,11 @@ import { Size, Theme } from '@lumx/react/components';
7
7
  import { Chip } from '@lumx/react/components/chip/Chip';
8
8
  import { Icon } from '@lumx/react/components/icon/Icon';
9
9
  import { InputLabel } from '@lumx/react/components/input-label/InputLabel';
10
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
10
+ import { handleBasicClasses } from '@lumx/react/utils/className';
11
11
  import { mergeRefs } from '@lumx/react/utils/mergeRefs';
12
12
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
13
13
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
14
+ import type { ComponentClassName } from '@lumx/react/utils/type';
14
15
 
15
16
  import { WithSelectContext } from './WithSelectContext';
16
17
  import { CoreSelectProps, SelectVariant } from './constants';
@@ -33,7 +34,7 @@ export interface SelectMultipleProps extends CoreSelectProps {
33
34
  const COMPONENT_NAME = 'Select';
34
35
 
35
36
  /** The default class name and classes prefix for this component. */
36
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
37
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-select';
37
38
 
38
39
  /** The default value of props. */
39
40
  const DEFAULT_PROPS: Partial<SelectMultipleProps> = {