@lumx/react 3.10.1-alpha.4 → 3.10.1-alpha.6

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 (117) hide show
  1. package/_internal/Falsy.d.ts +7 -0
  2. package/index.d.ts +291 -5
  3. package/index.js +172 -298
  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 +3 -12
  8. package/src/components/autocomplete/AutocompleteMultiple.tsx +3 -8
  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 +3 -4
  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 +3 -7
  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 +4 -5
  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 +3 -9
  31. package/src/components/heading/Heading.tsx +3 -9
  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 +3 -10
  43. package/src/components/list/ListItem.tsx +3 -3
  44. package/src/components/list/ListSubheader.tsx +3 -4
  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 +3 -4
  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 +3 -8
  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 +3 -13
  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 +4 -9
  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 +3 -13
  74. package/src/components/slideshow/SlideshowItemGroup.tsx +3 -10
  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 +3 -8
  78. package/src/components/table/TableCell.tsx +4 -7
  79. package/src/components/table/TableHeader.tsx +3 -8
  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/getBasicClass.test.ts +20 -0
  89. package/src/utils/className/getFontColorClassName.test.ts +11 -0
  90. package/src/utils/className/getTypographyClassName.test.ts +7 -0
  91. package/src/utils/className/handleBasicClasses.test.ts +28 -0
  92. package/src/utils/className/index.ts +0 -1
  93. package/src/utils/type/Callback.ts +4 -0
  94. package/src/utils/type/Comp.ts +14 -0
  95. package/src/utils/type/ComponentClassName.ts +7 -0
  96. package/src/utils/type/ComponentRef.ts +16 -0
  97. package/src/utils/type/Falsy.ts +5 -0
  98. package/src/utils/type/GenericProps.ts +11 -0
  99. package/src/utils/type/HasAriaLabelOrLabelledBy.ts +19 -0
  100. package/src/utils/type/HasClassName.ts +6 -0
  101. package/src/utils/type/HasCloseMode.ts +7 -0
  102. package/src/utils/type/HasPolymorphicAs.ts +8 -0
  103. package/src/utils/type/HasTheme.ts +8 -0
  104. package/src/utils/type/HeadingElement.ts +2 -0
  105. package/src/utils/type/KebabCase.ts +6 -0
  106. package/src/utils/type/MaybeElementOrRef.ts +6 -0
  107. package/src/utils/type/Point.ts +4 -0
  108. package/src/utils/type/Predicate.ts +2 -0
  109. package/src/utils/type/RectSize.ts +4 -0
  110. package/src/utils/type/TextElement.ts +4 -0
  111. package/src/utils/type/ValueOf.ts +2 -0
  112. package/src/utils/type/index.ts +19 -0
  113. package/src/utils/type/isComponentType.ts +9 -0
  114. package/utils/index.d.ts +1 -1
  115. package/_internal/index.d.ts +0 -285
  116. package/src/utils/className/getRootClassName.ts +0 -24
  117. package/src/utils/type.ts +0 -164
@@ -2,8 +2,7 @@ import React from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
5
- import { HeadingElement } from '@lumx/react/utils/type';
6
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
5
+ import type { HeadingElement, ComponentClassName } from '@lumx/react/utils/type';
7
6
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
8
7
 
9
8
  import { Text, TextProps } from '../text';
@@ -28,7 +27,7 @@ const COMPONENT_NAME = 'Heading';
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-heading';
32
31
 
33
32
  /**
34
33
  * Component default props.
@@ -48,12 +47,7 @@ export const Heading = forwardRef<HeadingProps>((props, ref) => {
48
47
  return (
49
48
  <Text
50
49
  ref={ref}
51
- className={classNames(
52
- className,
53
- handleBasicClasses({
54
- prefix: CLASSNAME,
55
- }),
56
- )}
50
+ className={classNames(className, CLASSNAME)}
57
51
  as={computedHeadingElement}
58
52
  typography={DEFAULT_TYPOGRAPHY_BY_LEVEL[computedHeadingElement]}
59
53
  {...forwardedProps}
@@ -4,8 +4,8 @@ import classNames from 'classnames';
4
4
 
5
5
  import { mdiAlertCircle } from '@lumx/icons';
6
6
  import { ColorPalette, ColorVariant, Size, Theme } 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
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
11
11
 
@@ -40,7 +40,7 @@ const COMPONENT_NAME = 'Icon';
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-icon';
44
44
 
45
45
  /**
46
46
  * Component default props.
@@ -4,8 +4,8 @@ import classNames from 'classnames';
4
4
 
5
5
  import { Alignment, HorizontalAlignment, Size, Theme, Thumbnail } from '@lumx/react';
6
6
 
7
- import { GenericProps, HasTheme, ValueOf } from '@lumx/react/utils/type';
8
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
7
+ import type { GenericProps, HasTheme, ValueOf, 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 { useTheme } from '@lumx/react/utils/theme/ThemeContext';
@@ -56,7 +56,7 @@ const COMPONENT_NAME = 'ImageBlock';
56
56
  /**
57
57
  * Component default class name and class prefix.
58
58
  */
59
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
59
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-image-block';
60
60
 
61
61
  /**
62
62
  * Component default props.
@@ -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, handleBasicClasses } 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.
@@ -31,13 +30,7 @@ const CLASSNAME = getRootClassName(COMPONENT_NAME);
31
30
  export const ListDivider = forwardRef<ListDividerProps, HTMLLIElement>((props, ref) => {
32
31
  const { className, ...forwardedProps } = props;
33
32
 
34
- return (
35
- <li
36
- ref={ref}
37
- {...forwardedProps}
38
- className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }))}
39
- />
40
- );
33
+ return <li ref={ref} {...forwardedProps} className={classNames(className, CLASSNAME)} />;
41
34
  });
42
35
  ListDivider.displayName = COMPONENT_NAME;
43
36
  ListDivider.className = CLASSNAME;
@@ -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, handleBasicClasses } 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.
@@ -35,7 +34,7 @@ export const ListSubheader = forwardRef<ListSubheaderProps, HTMLLIElement>((prop
35
34
  const { children, className, ...forwardedProps } = props;
36
35
 
37
36
  return (
38
- <li ref={ref} {...forwardedProps} className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }))}>
37
+ <li ref={ref} {...forwardedProps} className={classNames(className, CLASSNAME)}>
39
38
  {children}
40
39
  </li>
41
40
  );
@@ -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, handleBasicClasses } 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.
@@ -51,7 +50,7 @@ export const PopoverDialog = forwardRef<PopoverDialogProps, HTMLDivElement>((pro
51
50
  <Popover
52
51
  {...forwardedProps}
53
52
  ref={ref}
54
- className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }))}
53
+ className={classNames(className, CLASSNAME)}
55
54
  role="dialog"
56
55
  aria-modal="true"
57
56
  /**
@@ -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, handleBasicClasses } 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.
@@ -61,11 +60,7 @@ export const ProgressTracker = forwardRef<ProgressTrackerProps, HTMLDivElement>(
61
60
  numberOfSteps > 0 ? ((100 / (numberOfSteps - 1)) * (state?.activeTabIndex || 0)) / 100 : 0;
62
61
 
63
62
  return (
64
- <div
65
- ref={mergeRefs(ref, stepListRef)}
66
- {...forwardedProps}
67
- className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }))}
68
- >
63
+ <div ref={mergeRefs(ref, stepListRef)} {...forwardedProps} className={classNames(className, CLASSNAME)}>
69
64
  <div className={`${CLASSNAME}__steps`} role="tablist" aria-label={ariaLabel}>
70
65
  {children}
71
66
  </div>