@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
@@ -12,8 +12,8 @@ import React, {
12
12
  import classNames from 'classnames';
13
13
 
14
14
  import { AspectRatio, HorizontalAlignment, Icon, Size, Theme, ThumbnailObjectFit } from '@lumx/react';
15
- import { Falsy, GenericProps, HasTheme } from '@lumx/react/utils/type';
16
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
15
+ import type { Falsy, GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
16
+ import { handleBasicClasses } from '@lumx/react/utils/className';
17
17
  import { mdiImageBroken } from '@lumx/icons';
18
18
  import { useMergeRefs } from '@lumx/react/utils/mergeRefs';
19
19
  import { useImageLoad } from '@lumx/react/components/thumbnail/useImageLoad';
@@ -81,7 +81,7 @@ const COMPONENT_NAME = 'Thumbnail';
81
81
  /**
82
82
  * Component default class name and class prefix.
83
83
  */
84
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
84
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-thumbnail';
85
85
 
86
86
  /**
87
87
  * Component default props.
@@ -2,8 +2,8 @@ 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 { GenericProps, ComponentClassName } 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 = 'Toolbar';
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-toolbar';
30
30
 
31
31
  /**
32
32
  * Component default props.
@@ -5,8 +5,8 @@ import { createPortal } from 'react-dom';
5
5
  import classNames from 'classnames';
6
6
 
7
7
  import { DOCUMENT, VISUALLY_HIDDEN } from '@lumx/react/constants';
8
- import { GenericProps, HasCloseMode } from '@lumx/react/utils/type';
9
- import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
8
+ import type { GenericProps, HasCloseMode, ComponentClassName } from '@lumx/react/utils/type';
9
+ import { handleBasicClasses } from '@lumx/react/utils/className';
10
10
  import { useMergeRefs } from '@lumx/react/utils/mergeRefs';
11
11
  import { Placement } from '@lumx/react/components/popover';
12
12
  import { TooltipContextProvider } from '@lumx/react/components/tooltip/context';
@@ -47,7 +47,7 @@ const COMPONENT_NAME = 'Tooltip';
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-tooltip';
51
51
 
52
52
  /**
53
53
  * Component default props.
@@ -3,8 +3,8 @@ import React, { MouseEventHandler } from 'react';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  import { AspectRatio, Icon, Size, 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 { useBooleanState } from '@lumx/react/hooks/useBooleanState';
9
9
  import { useId } from '@lumx/react/hooks/useId';
10
10
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
@@ -60,7 +60,7 @@ const COMPONENT_NAME = 'Uploader';
60
60
  /**
61
61
  * Component default class name and class prefix.
62
62
  */
63
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
63
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-uploader';
64
64
 
65
65
  /**
66
66
  * Component default props.
@@ -2,8 +2,8 @@ import React, { ReactNode } from 'react';
2
2
  import classNames from 'classnames';
3
3
 
4
4
  import { Avatar, ColorPalette, Link, Orientation, Size, Theme } 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 { forwardRef } from '@lumx/react/utils/react/forwardRef';
8
8
 
9
9
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
@@ -54,7 +54,7 @@ const COMPONENT_NAME = 'UserBlock';
54
54
  /**
55
55
  * Component default class name and class prefix.
56
56
  */
57
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
57
+ const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-user-block';
58
58
 
59
59
  /**
60
60
  * Component default props.
@@ -0,0 +1,20 @@
1
+ import { getBasicClass } from '@lumx/core/js/utils';
2
+
3
+ describe(getBasicClass, () => {
4
+ it('should return correct basic CSS class for different types and values', () => {
5
+ // Test cases with different inputs
6
+ expect(getBasicClass({ prefix: 'test', type: 'color', value: 'primary' })).toBe('test--color-primary');
7
+ expect(getBasicClass({ prefix: 'test', type: 'variant', value: 'button' })).toBe('test--variant-button');
8
+ expect(getBasicClass({ prefix: 'test', type: 'isDark', value: true })).toBe('test--is-dark');
9
+ expect(getBasicClass({ prefix: 'test', type: 'dark', value: true })).toBe('test--is-dark');
10
+ expect(getBasicClass({ prefix: 'test', type: 'hasDark', value: true })).toBe('test--has-dark');
11
+ expect(getBasicClass({ prefix: 'test', type: 'isActive', value: false })).toBe('');
12
+
13
+ // Additional tests for boolean types
14
+ expect(getBasicClass({ prefix: 'test', type: 'hasBorder', value: true })).toBe('test--has-border');
15
+ expect(getBasicClass({ prefix: 'test', type: 'isVisible', value: false })).toBe('');
16
+
17
+ // Tests for undefined
18
+ expect(getBasicClass({ prefix: 'test', type: 'variant', value: undefined })).toBe('test--variant-undefined');
19
+ });
20
+ });
@@ -0,0 +1,11 @@
1
+ import { getFontColorClassName } from '@lumx/react/utils/className/getFontColorClassName';
2
+
3
+ describe(getFontColorClassName, () => {
4
+ it('should get lumx class for font color', () => {
5
+ expect(getFontColorClassName('dark')).toBe('lumx-color-font-dark-N');
6
+ });
7
+
8
+ it('should get lumx class for font color with variant', () => {
9
+ expect(getFontColorClassName('red', 'L2')).toBe('lumx-color-font-red-L2');
10
+ });
11
+ });
@@ -0,0 +1,7 @@
1
+ import { getTypographyClassName } from '@lumx/react/utils/className/getTypographyClassName';
2
+
3
+ describe(getTypographyClassName, () => {
4
+ it('should generate lumx typography class', () => {
5
+ expect(getTypographyClassName('title')).toBe('lumx-typography-title');
6
+ });
7
+ });
@@ -0,0 +1,28 @@
1
+ import { handleBasicClasses } from '@lumx/core/js/utils';
2
+
3
+ describe(handleBasicClasses, () => {
4
+ it('should return correct combined CSS classes based on props', () => {
5
+ const className = handleBasicClasses({
6
+ prefix: 'test',
7
+ // Undefined
8
+ undefined,
9
+ // Null
10
+ null: null,
11
+ // Empty string
12
+ emptyString: '',
13
+ // Empty array
14
+ emptyArray: [],
15
+ // Empty object
16
+ emptyObject: {},
17
+ // String
18
+ color: 'red',
19
+ // False property
20
+ isDisabled: false,
21
+ // Boolean without a prefix (is or has)
22
+ visible: true,
23
+ // Has prefix
24
+ hasButton: true,
25
+ });
26
+ expect(className).toBe('test test--color-red test--is-visible test--has-button');
27
+ });
28
+ });
@@ -1,4 +1,3 @@
1
1
  export { getBasicClass, handleBasicClasses } from '@lumx/core/js/utils';
2
- export { getRootClassName } from './getRootClassName';
3
2
  export { getTypographyClassName } from './getTypographyClassName';
4
3
  export { getFontColorClassName } from './getFontColorClassName';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Callback function type alias (use for readability)
3
+ */
4
+ export type Callback = () => void;
@@ -0,0 +1,14 @@
1
+ import type { ReactElement, Ref } from 'react';
2
+
3
+ /** LumX Component Type. */
4
+ export type Comp<P, T = HTMLElement> = {
5
+ (props: P & { ref?: Ref<T> }): ReactElement | null;
6
+ /** React component type. */
7
+ readonly $$typeof: symbol;
8
+ /** Component default props. */
9
+ defaultProps?: Partial<P>;
10
+ /** Component name. */
11
+ displayName?: string;
12
+ /** Component base class name. */
13
+ className?: string;
14
+ };
@@ -0,0 +1,7 @@
1
+ import type { KebabCase } from './KebabCase';
2
+
3
+ /** Transform the component name into the lumx class name. */
4
+ export type ComponentClassName<
5
+ TComponentName extends string,
6
+ TSubComponentName extends string = '',
7
+ > = `lumx-${KebabCase<TComponentName>}${TSubComponentName extends `${TComponentName}${infer TSubName}` ? `__${KebabCase<TSubName>}` : ''}`;
@@ -0,0 +1,16 @@
1
+ import type React from 'react';
2
+ import type { Comp } from './Comp';
3
+
4
+ /**
5
+ * Extract ref type for a component or JSX intrinsic element
6
+ *
7
+ * @example ComponentRef<'div'> => React.Ref<HTMLDivElement>
8
+ * @example ComponentRef<Button> => React.Ref<HTMLButtonElement
9
+ */
10
+ export type ComponentRef<C> = C extends keyof JSX.IntrinsicElements
11
+ ? JSX.IntrinsicElements[C]['ref']
12
+ : C extends Comp<any, infer T>
13
+ ? React.Ref<T>
14
+ : C extends React.JSXElementConstructor<{ ref?: infer R }>
15
+ ? R
16
+ : never;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * JS falsy values.
3
+ * (excluding `NaN` as it can't be distinguished from `number`)
4
+ */
5
+ export type Falsy = false | undefined | null | 0 | '';
@@ -0,0 +1,11 @@
1
+ import type { HasClassName } from './HasClassName';
2
+
3
+ /**
4
+ * Define a generic props types.
5
+ */
6
+ export interface GenericProps extends HasClassName {
7
+ /**
8
+ * Any prop (particularly any supported prop for a HTML element).
9
+ */
10
+ [propName: string]: any;
11
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Require either `aria-label` or `arial-labelledby` prop.
3
+ * If none are set, the order will prioritize `aria-labelledby` over `aria-label` as it
4
+ * needs a visible element.
5
+ */
6
+ export type HasAriaLabelOrLabelledBy<T = string | undefined> = T extends string
7
+ ? {
8
+ /**
9
+ * The id of the element to use as title of the dialog. Can be within or out of the dialog.
10
+ * Although it is not recommended, aria-label can be used instead if no visible element is available.
11
+ */
12
+ 'aria-labelledby': T;
13
+ /** The label of the dialog. */
14
+ 'aria-label'?: undefined;
15
+ }
16
+ : {
17
+ 'aria-label': string;
18
+ 'aria-labelledby'?: undefined;
19
+ };
@@ -0,0 +1,6 @@
1
+ export interface HasClassName {
2
+ /**
3
+ * Class name forwarded to the root element of the component.
4
+ */
5
+ className?: string;
6
+ }
@@ -0,0 +1,7 @@
1
+ export interface HasCloseMode {
2
+ /**
3
+ * Choose how the children are hidden when closed
4
+ * ('hide' keeps the children in DOM but hide them, 'unmount' remove the children from the DOM).
5
+ */
6
+ closeMode?: 'hide' | 'unmount';
7
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+
3
+ export type HasPolymorphicAs<E extends React.ElementType> = React.ComponentPropsWithoutRef<E> & {
4
+ /**
5
+ * Customize the rendered component.
6
+ */
7
+ as?: E;
8
+ };
@@ -0,0 +1,8 @@
1
+ import type { Theme } from '@lumx/react';
2
+
3
+ export interface HasTheme {
4
+ /**
5
+ * Theme adapting the component to light or dark background.
6
+ */
7
+ theme?: Theme;
8
+ }
@@ -0,0 +1,2 @@
1
+ /** Union type of all heading elements */
2
+ export type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
@@ -0,0 +1,6 @@
1
+ /** Transform a string literal into kebab case */
2
+ export type KebabCase<S> = S extends `${infer C}${infer T}`
3
+ ? T extends Uncapitalize<T>
4
+ ? `${Uncapitalize<C>}${KebabCase<T>}`
5
+ : `${Uncapitalize<C>}-${KebabCase<T>}`
6
+ : S;
@@ -0,0 +1,6 @@
1
+ import type React from 'react';
2
+
3
+ /**
4
+ * Maybe a HTMLElement or a React ref of a HTMLElement
5
+ */
6
+ export type MaybeElementOrRef<E extends HTMLElement> = E | React.RefObject<E | null> | null | undefined;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * A point coordinate in 2D space
3
+ */
4
+ export type Point = { x: number; y: number };
@@ -0,0 +1,2 @@
1
+ /** Predicate function type */
2
+ export type Predicate<T> = (t: T) => boolean;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Rectangle size
3
+ */
4
+ export type RectSize = { width: number; height: number };
@@ -0,0 +1,4 @@
1
+ import type { HeadingElement } from './HeadingElement';
2
+
3
+ /** Union type of all text elements */
4
+ export type TextElement = 'span' | 'p' | HeadingElement;
@@ -0,0 +1,2 @@
1
+ /** Get types of the values of a record. */
2
+ export type ValueOf<T extends Record<any, any>> = T[keyof T];
@@ -0,0 +1,19 @@
1
+ export { Callback } from './Callback';
2
+ export { Comp } from './Comp';
3
+ export { ComponentRef } from './ComponentRef';
4
+ export { Falsy } from './Falsy';
5
+ export { GenericProps } from './GenericProps';
6
+ export { HasAriaLabelOrLabelledBy } from './HasAriaLabelOrLabelledBy';
7
+ export { HasClassName } from './HasClassName';
8
+ export { HasCloseMode } from './HasCloseMode';
9
+ export { HasPolymorphicAs } from './HasPolymorphicAs';
10
+ export { HasTheme } from './HasTheme';
11
+ export { HeadingElement } from './HeadingElement';
12
+ export { isComponentType } from './isComponentType';
13
+ export { MaybeElementOrRef } from './MaybeElementOrRef';
14
+ export { Point } from './Point';
15
+ export { Predicate } from './Predicate';
16
+ export { RectSize } from './RectSize';
17
+ export { TextElement } from './TextElement';
18
+ export { ValueOf } from './ValueOf';
19
+ export { ComponentClassName } from './ComponentClassName';
@@ -0,0 +1,9 @@
1
+ import React, { ReactElement, ReactNode } from 'react';
2
+
3
+ /**
4
+ * Similar to `isComponent` but more precise as it's not based on the component `displayName` but on the component function reference.
5
+ */
6
+ export const isComponentType =
7
+ (type: ReactElement['type']) =>
8
+ (node: ReactNode): node is ReactElement =>
9
+ React.isValidElement(node) && node.type === type;
package/utils/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { RefObject } from 'react';
2
- import { F as Falsy } from '../_internal/index.js';
2
+ import { F as Falsy } from '../_internal/Falsy.js';
3
3
 
4
4
  interface ClickAwayParameters {
5
5
  /**