@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
@@ -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, 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 = '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.
@@ -35,16 +34,7 @@ export const RadioGroup = forwardRef<RadioGroupProps, HTMLDivElement>((props, re
35
34
  const { children, className, ...forwardedProps } = props;
36
35
 
37
36
  return (
38
- <div
39
- ref={ref}
40
- {...forwardedProps}
41
- className={classNames(
42
- className,
43
- handleBasicClasses({
44
- prefix: CLASSNAME,
45
- }),
46
- )}
47
- >
37
+ <div ref={ref} {...forwardedProps} className={classNames(className, CLASSNAME)}>
48
38
  {children}
49
39
  </div>
50
40
  );
@@ -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> = {
@@ -7,8 +7,9 @@ import { Dropdown } from '@lumx/react/components/dropdown/Dropdown';
7
7
  import { InputHelper } from '@lumx/react/components/input-helper/InputHelper';
8
8
  import { useFocusTrap } from '@lumx/react/hooks/useFocusTrap';
9
9
  import { useListenFocus } from '@lumx/react/hooks/useListenFocus';
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
+ import type { ComponentClassName } from '@lumx/react/utils/type';
12
13
 
13
14
  import { useId } from '@lumx/react/hooks/useId';
14
15
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
@@ -18,7 +19,7 @@ import { CoreSelectProps, SelectVariant } from './constants';
18
19
  const COMPONENT_NAME = 'Select';
19
20
 
20
21
  /** The default class name and classes prefix for this component. */
21
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
22
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-select';
22
23
 
23
24
  /** The default value of props. */
24
25
  export const DEFAULT_PROPS: Partial<CoreSelectProps> = {
@@ -3,8 +3,7 @@ import React, { Children, ReactNode } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { SideNavigationItem, Theme } from '@lumx/react';
6
- import { GenericProps, HasTheme, isComponent } from '@lumx/react/utils/type';
7
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
6
+ import { type GenericProps, type HasTheme, isComponentType, type ComponentClassName } from '@lumx/react/utils/type';
8
7
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
9
8
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
10
9
 
@@ -24,7 +23,7 @@ const COMPONENT_NAME = 'SideNavigation';
24
23
  /**
25
24
  * Component default class name and class prefix.
26
25
  */
27
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
26
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-side-navigation';
28
27
 
29
28
  /**
30
29
  * SideNavigation component.
@@ -36,17 +35,13 @@ const CLASSNAME = getRootClassName(COMPONENT_NAME);
36
35
  export const SideNavigation = forwardRef<SideNavigationProps, HTMLUListElement>((props, ref) => {
37
36
  const defaultTheme = useTheme();
38
37
  const { children, className, theme = defaultTheme, ...forwardedProps } = props;
39
- const content = Children.toArray(children).filter(isComponent(SideNavigationItem));
38
+ const content = Children.toArray(children).filter(isComponentType(SideNavigationItem));
40
39
 
41
40
  return (
42
41
  <ul
43
42
  ref={ref}
44
43
  {...forwardedProps}
45
- className={classNames(
46
- className,
47
- theme === Theme.dark && 'lumx-color-font-light-N',
48
- handleBasicClasses({ prefix: CLASSNAME }),
49
- )}
44
+ className={classNames(className, theme === Theme.dark && 'lumx-color-font-light-N', CLASSNAME)}
50
45
  >
51
46
  {content}
52
47
  </ul>
@@ -4,8 +4,8 @@ import classNames from 'classnames';
4
4
 
5
5
  import { mdiChevronDown, mdiChevronUp } from '@lumx/icons';
6
6
  import { Emphasis, Icon, Size, IconButton, IconButtonProps } from '@lumx/react';
7
- import { GenericProps, HasCloseMode, isComponent } from '@lumx/react/utils/type';
8
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
7
+ import { type GenericProps, type HasCloseMode, isComponentType, type ComponentClassName } from '@lumx/react/utils/type';
8
+ import { handleBasicClasses } from '@lumx/react/utils/className';
9
9
  import { renderLink } from '@lumx/react/utils/renderLink';
10
10
  import { renderButtonOrLink } from '@lumx/react/utils/renderButtonOrLink';
11
11
  import { useId } from '@lumx/react/hooks/useId';
@@ -49,7 +49,7 @@ const COMPONENT_NAME = 'SideNavigationItem';
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-side-navigation-item';
53
53
 
54
54
  /**
55
55
  * Component default props.
@@ -84,7 +84,7 @@ export const SideNavigationItem = forwardRef<SideNavigationItemProps, HTMLLIElem
84
84
  ...forwardedProps
85
85
  } = props;
86
86
 
87
- const content = children && Children.toArray(children).filter(isComponent(SideNavigationItem));
87
+ const content = children && Children.toArray(children).filter(isComponentType(SideNavigationItem));
88
88
  const hasContent = !isEmpty(content);
89
89
  const shouldSplitActions = Boolean(onActionClick);
90
90
  const showChildren = hasContent && isOpen;
@@ -3,8 +3,8 @@ import React from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { GlobalSize, Theme, ColorPalette } 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
 
@@ -28,7 +28,7 @@ const COMPONENT_NAME = 'SkeletonCircle';
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-skeleton-circle';
32
32
 
33
33
  /**
34
34
  * SkeletonCircle component.
@@ -3,8 +3,8 @@ import React from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { AspectRatio, GlobalSize, Theme, ColorPalette } 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
 
@@ -42,7 +42,7 @@ const COMPONENT_NAME = 'SkeletonRectangle';
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-skeleton-rectangle';
46
46
 
47
47
  /**
48
48
  * SkeletonRectangle component.
@@ -3,8 +3,8 @@ import React, { CSSProperties } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { Theme, TypographyInterface, ColorPalette } 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
 
@@ -30,7 +30,7 @@ const COMPONENT_NAME = 'SkeletonTypography';
30
30
  /**
31
31
  * Component default class name and class prefix.
32
32
  */
33
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
33
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-skeleton-typography';
34
34
 
35
35
  /**
36
36
  * SkeletonTypography component.
@@ -5,8 +5,8 @@ import classNames from 'classnames';
5
5
 
6
6
  import { InputHelper, InputLabel, Theme } from '@lumx/react';
7
7
  import useEventCallback from '@lumx/react/hooks/useEventCallback';
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 { clamp } from '@lumx/react/utils/clamp';
11
11
  import { useId } from '@lumx/react/hooks/useId';
12
12
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
@@ -50,7 +50,7 @@ const COMPONENT_NAME = 'Slider';
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-slider';
54
54
 
55
55
  /**
56
56
  * Component default props.
@@ -3,8 +3,8 @@ import React, { Children, CSSProperties } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { FULL_WIDTH_PERCENT } from '@lumx/react/components/slideshow/constants';
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
  import { chunk } from '@lumx/react/utils/collection/chunk';
@@ -47,7 +47,7 @@ const COMPONENT_NAME = 'Slideshow';
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-slideshow';
51
51
 
52
52
  /**
53
53
  * Slides component.
@@ -4,8 +4,8 @@ import classNames from 'classnames';
4
4
 
5
5
  import { mdiChevronLeft, mdiChevronRight, mdiPlayCircleOutline, mdiPauseCircleOutline } from '@lumx/icons';
6
6
  import { Emphasis, IconButton, IconButtonProps, 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 { WINDOW } from '@lumx/react/constants';
10
10
  import { useSlideshowControls, DEFAULT_OPTIONS } from '@lumx/react/hooks/useSlideshowControls';
11
11
  import { useRovingTabIndex } from '@lumx/react/hooks/useRovingTabIndex';
@@ -65,7 +65,7 @@ const COMPONENT_NAME = 'SlideshowControls';
65
65
  /**
66
66
  * Component default class name and class prefix.
67
67
  */
68
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
68
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-slideshow-controls';
69
69
 
70
70
  /**
71
71
  * 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
  /**
@@ -22,7 +21,7 @@ const COMPONENT_NAME = 'SlideshowItem';
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-slideshow-item';
26
25
 
27
26
  /**
28
27
  * SlideshowItem component.
@@ -34,16 +33,7 @@ const CLASSNAME = getRootClassName(COMPONENT_NAME);
34
33
  export const SlideshowItem = forwardRef<SlideshowItemProps, HTMLDivElement>((props, ref) => {
35
34
  const { className, children, ...forwardedProps } = props;
36
35
  return (
37
- <div
38
- ref={ref}
39
- className={classNames(
40
- className,
41
- handleBasicClasses({
42
- prefix: CLASSNAME,
43
- }),
44
- )}
45
- {...forwardedProps}
46
- >
36
+ <div ref={ref} className={classNames(className, CLASSNAME)} {...forwardedProps}>
47
37
  {children}
48
38
  </div>
49
39
  );
@@ -2,10 +2,8 @@ import React from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
  import { mergeRefs } from '@lumx/react/utils/mergeRefs';
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
-
9
7
  import { useSlideFocusManagement } from './useSlideFocusManagement';
10
8
 
11
9
  /**
@@ -25,7 +23,7 @@ const COMPONENT_NAME = 'SlideshowItemGroup';
25
23
  /**
26
24
  * Component default class name and class prefix.
27
25
  */
28
- export const CLASSNAME = getRootClassName(COMPONENT_NAME);
26
+ export const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-slideshow-item-group';
29
27
 
30
28
  export const buildSlideShowGroupId = (slidesId: string, index: number) => `${slidesId}-slide-${index}`;
31
29
 
@@ -46,12 +44,7 @@ export const SlideshowItemGroup = forwardRef<SlideshowItemGroupProps, HTMLDivEle
46
44
  <div
47
45
  ref={mergeRefs(groupRef, ref)}
48
46
  role={role}
49
- className={classNames(
50
- className,
51
- handleBasicClasses({
52
- prefix: CLASSNAME,
53
- }),
54
- )}
47
+ className={classNames(className, CLASSNAME)}
55
48
  aria-roledescription="slide"
56
49
  aria-label={label}
57
50
  {...forwardedProps}
@@ -3,8 +3,8 @@ import React, { Children, InputHTMLAttributes, SyntheticEvent } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { Alignment, 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';
@@ -39,7 +39,7 @@ const COMPONENT_NAME = 'Switch';
39
39
  /**
40
40
  * Component default class name and class prefix.
41
41
  */
42
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
42
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-switch';
43
43
 
44
44
  /**
45
45
  * 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
 
@@ -26,7 +26,7 @@ const COMPONENT_NAME = 'Table';
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-table';
30
30
 
31
31
  /**
32
32
  * 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 { ComponentClassName, GenericProps } 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 = 'TableBody';
19
18
  /**
20
19
  * Component default class name and class prefix.
21
20
  */
22
- const CLASSNAME = getRootClassName(COMPONENT_NAME, true);
21
+ const CLASSNAME: ComponentClassName<'Table', typeof COMPONENT_NAME> = 'lumx-table__body';
23
22
 
24
23
  /**
25
24
  * TableBody component.
@@ -32,11 +31,7 @@ export const TableBody = forwardRef<TableBodyProps, HTMLTableSectionElement>((pr
32
31
  const { children, className, ...forwardedProps } = props;
33
32
 
34
33
  return (
35
- <tbody
36
- ref={ref}
37
- {...forwardedProps}
38
- className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }))}
39
- >
34
+ <tbody ref={ref} {...forwardedProps} className={classNames(className, CLASSNAME)}>
40
35
  {children}
41
36
  </tbody>
42
37
  );
@@ -4,8 +4,8 @@ import classNames from 'classnames';
4
4
 
5
5
  import { mdiArrowDown, mdiArrowUp } from '@lumx/icons';
6
6
  import { Icon, Size } from '@lumx/react';
7
- import { GenericProps, ValueOf } from '@lumx/react/utils/type';
8
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
7
+ import type { ComponentClassName, GenericProps, ValueOf } 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
  /**
@@ -44,7 +44,7 @@ const COMPONENT_NAME = 'TableCell';
44
44
  /**
45
45
  * Component default class name and class prefix.
46
46
  */
47
- const CLASSNAME = getRootClassName(COMPONENT_NAME, true);
47
+ const CLASSNAME: ComponentClassName<'Table', typeof COMPONENT_NAME> = 'lumx-table__cell';
48
48
 
49
49
  /**
50
50
  * Component default props.
@@ -109,10 +109,7 @@ export const TableCell = forwardRef<TableCellProps, HTMLTableCellElement>((props
109
109
  )}
110
110
 
111
111
  {variant === TableCellVariant.body && (
112
- <td
113
- {...forwardedProps}
114
- className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }), `${CLASSNAME}--body`)}
115
- >
112
+ <td {...forwardedProps} className={classNames(className, CLASSNAME, `${CLASSNAME}--body`)}>
116
113
  <div className={`${CLASSNAME}-content`}>{children}</div>
117
114
  </td>
118
115
  )}
@@ -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 { ComponentClassName, GenericProps } 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 = 'TableHeader';
19
18
  /**
20
19
  * Component default class name and class prefix.
21
20
  */
22
- const CLASSNAME = getRootClassName(COMPONENT_NAME, true);
21
+ const CLASSNAME: ComponentClassName<'Table', typeof COMPONENT_NAME> = 'lumx-table__header';
23
22
 
24
23
  /**
25
24
  * Component default props.
@@ -37,11 +36,7 @@ export const TableHeader = forwardRef<TableHeaderProps, HTMLTableSectionElement>
37
36
  const { children, className, ...forwardedProps } = props;
38
37
 
39
38
  return (
40
- <thead
41
- ref={ref}
42
- {...forwardedProps}
43
- className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }))}
44
- >
39
+ <thead ref={ref} {...forwardedProps} className={classNames(className, CLASSNAME)}>
45
40
  {children}
46
41
  </thead>
47
42
  );
@@ -2,8 +2,8 @@ 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 { ComponentClassName, GenericProps } from '@lumx/react/utils/type';
6
+ import { handleBasicClasses } from '@lumx/react/utils/className';
7
7
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
8
8
 
9
9
  /**
@@ -26,7 +26,7 @@ const COMPONENT_NAME = 'TableRow';
26
26
  /**
27
27
  * Component default class name and class prefix.
28
28
  */
29
- const CLASSNAME = getRootClassName(COMPONENT_NAME, true);
29
+ const CLASSNAME: ComponentClassName<'Table', typeof COMPONENT_NAME> = 'lumx-table__row';
30
30
 
31
31
  /**
32
32
  * Component default props.
@@ -3,13 +3,8 @@ import React, { Children, Fragment } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { Icon, ColorPalette, ColorVariant, Typography, WhiteSpace } from '@lumx/react';
6
- import { GenericProps, TextElement, isComponent } from '@lumx/react/utils/type';
7
- import {
8
- getFontColorClassName,
9
- getRootClassName,
10
- handleBasicClasses,
11
- getTypographyClassName,
12
- } from '@lumx/react/utils/className';
6
+ import { type GenericProps, type TextElement, isComponentType, type ComponentClassName } from '@lumx/react/utils/type';
7
+ import { getFontColorClassName, handleBasicClasses, getTypographyClassName } from '@lumx/react/utils/className';
13
8
  import { useOverflowTooltipLabel } from '@lumx/react/hooks/useOverflowTooltipLabel';
14
9
  import { useMergeRefs } from '@lumx/react/utils/mergeRefs';
15
10
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
@@ -61,7 +56,7 @@ const COMPONENT_NAME = 'Text';
61
56
  /**
62
57
  * Component default class name and class prefix.
63
58
  */
64
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
59
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-text';
65
60
 
66
61
  /**
67
62
  * Component default props.
@@ -131,7 +126,7 @@ export const Text = forwardRef<TextProps>((props, ref) => {
131
126
  {children &&
132
127
  Children.toArray(children).map((child, index) => {
133
128
  // Force wrap spaces around icons to make sure they are never stuck against text.
134
- if (isComponent(Icon)(child)) {
129
+ if (isComponentType(Icon)(child)) {
135
130
  return <Fragment key={child.key || index}> {child} </Fragment>;
136
131
  }
137
132
  return child;
@@ -15,8 +15,8 @@ import {
15
15
  Size,
16
16
  Theme,
17
17
  } from '@lumx/react';
18
- import { GenericProps, HasTheme } from '@lumx/react/utils/type';
19
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
18
+ import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
19
+ import { handleBasicClasses } from '@lumx/react/utils/className';
20
20
  import { mergeRefs } from '@lumx/react/utils/mergeRefs';
21
21
  import { useId } from '@lumx/react/hooks/useId';
22
22
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
@@ -91,7 +91,7 @@ const COMPONENT_NAME = 'TextField';
91
91
  /**
92
92
  * Component default class name and class prefix.
93
93
  */
94
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
94
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-text-field';
95
95
 
96
96
  /**
97
97
  * Default minimum number of rows in the multiline mode.