@lumx/react 3.10.1-alpha.5 → 3.10.1-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_internal/Falsy.d.ts +7 -0
- package/index.d.ts +291 -5
- package/index.js +167 -267
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/alert-dialog/AlertDialog.tsx +3 -2
- package/src/components/autocomplete/Autocomplete.tsx +2 -2
- package/src/components/autocomplete/AutocompleteMultiple.tsx +2 -2
- package/src/components/avatar/Avatar.tsx +3 -3
- package/src/components/badge/Badge.tsx +3 -3
- package/src/components/badge/BadgeWrapper.tsx +2 -3
- package/src/components/button/Button.tsx +4 -4
- package/src/components/button/ButtonGroup.tsx +2 -3
- package/src/components/button/IconButton.tsx +2 -2
- package/src/components/checkbox/Checkbox.tsx +3 -3
- package/src/components/chip/Chip.tsx +3 -3
- package/src/components/chip/ChipGroup.tsx +2 -3
- package/src/components/comment-block/CommentBlock.tsx +3 -3
- package/src/components/date-picker/constants.ts +2 -2
- package/src/components/dialog/Dialog.tsx +5 -5
- package/src/components/divider/Divider.tsx +3 -3
- package/src/components/drag-handle/DragHandle.tsx +3 -3
- package/src/components/dropdown/Dropdown.tsx +3 -4
- package/src/components/expansion-panel/ExpansionPanel.tsx +6 -6
- package/src/components/flag/Flag.tsx +3 -3
- package/src/components/flex-box/FlexBox.tsx +3 -3
- package/src/components/generic-block/GenericBlock.tsx +2 -3
- package/src/components/grid/Grid.tsx +3 -3
- package/src/components/grid/GridItem.tsx +3 -3
- package/src/components/grid-column/GridColumn.tsx +2 -3
- package/src/components/heading/Heading.tsx +2 -3
- package/src/components/icon/Icon.tsx +3 -3
- package/src/components/image-block/ImageBlock.tsx +3 -3
- package/src/components/image-lightbox/constants.ts +2 -2
- package/src/components/inline-list/InlineList.tsx +3 -3
- package/src/components/input-helper/InputHelper.tsx +3 -3
- package/src/components/input-label/InputLabel.tsx +3 -3
- package/src/components/lightbox/Lightbox.tsx +3 -3
- package/src/components/link/Link.tsx +3 -3
- package/src/components/link-preview/LinkPreview.tsx +3 -3
- package/src/components/list/List.tsx +3 -3
- package/src/components/list/ListDivider.tsx +2 -3
- package/src/components/list/ListItem.tsx +3 -3
- package/src/components/list/ListSubheader.tsx +2 -3
- package/src/components/list/useInteractiveList.tsx +3 -3
- package/src/components/message/Message.tsx +3 -3
- package/src/components/mosaic/Mosaic.tsx +3 -3
- package/src/components/navigation/Navigation.tsx +3 -3
- package/src/components/navigation/NavigationItem.tsx +9 -3
- package/src/components/navigation/NavigationSection.tsx +3 -3
- package/src/components/notification/Notification.tsx +3 -3
- package/src/components/popover/Popover.tsx +3 -3
- package/src/components/popover-dialog/PopoverDialog.tsx +2 -3
- package/src/components/post-block/PostBlock.tsx +3 -3
- package/src/components/progress/Progress.tsx +3 -3
- package/src/components/progress/ProgressCircular.tsx +3 -3
- package/src/components/progress/ProgressLinear.tsx +3 -3
- package/src/components/progress-tracker/ProgressTracker.tsx +2 -3
- package/src/components/progress-tracker/ProgressTrackerStep.tsx +3 -3
- package/src/components/radio-button/RadioButton.tsx +3 -3
- package/src/components/radio-button/RadioGroup.tsx +2 -3
- package/src/components/select/Select.tsx +3 -2
- package/src/components/select/SelectMultiple.tsx +3 -2
- package/src/components/select/WithSelectContext.tsx +3 -2
- package/src/components/side-navigation/SideNavigation.tsx +3 -4
- package/src/components/side-navigation/SideNavigationItem.tsx +4 -4
- package/src/components/skeleton/SkeletonCircle.tsx +3 -3
- package/src/components/skeleton/SkeletonRectangle.tsx +3 -3
- package/src/components/skeleton/SkeletonTypography.tsx +3 -3
- package/src/components/slider/Slider.tsx +3 -3
- package/src/components/slideshow/Slides.tsx +3 -3
- package/src/components/slideshow/SlideshowControls.tsx +3 -3
- package/src/components/slideshow/SlideshowItem.tsx +2 -3
- package/src/components/slideshow/SlideshowItemGroup.tsx +2 -3
- package/src/components/switch/Switch.tsx +3 -3
- package/src/components/table/Table.tsx +3 -3
- package/src/components/table/TableBody.tsx +2 -3
- package/src/components/table/TableCell.tsx +3 -3
- package/src/components/table/TableHeader.tsx +2 -3
- package/src/components/table/TableRow.tsx +3 -3
- package/src/components/text/Text.tsx +4 -9
- package/src/components/text-field/TextField.tsx +3 -3
- package/src/components/thumbnail/Thumbnail.tsx +3 -3
- package/src/components/toolbar/Toolbar.tsx +3 -3
- package/src/components/tooltip/Tooltip.tsx +3 -3
- package/src/components/uploader/Uploader.tsx +3 -3
- package/src/components/user-block/UserBlock.tsx +3 -3
- package/src/utils/className/index.ts +0 -1
- package/src/utils/className.test.js +41 -0
- package/src/utils/type/Callback.ts +4 -0
- package/src/utils/type/Comp.ts +14 -0
- package/src/utils/type/ComponentClassName.ts +7 -0
- package/src/utils/type/ComponentRef.ts +16 -0
- package/src/utils/type/Falsy.ts +5 -0
- package/src/utils/type/GenericProps.ts +11 -0
- package/src/utils/type/HasAriaLabelOrLabelledBy.ts +19 -0
- package/src/utils/type/HasClassName.ts +6 -0
- package/src/utils/type/HasCloseMode.ts +7 -0
- package/src/utils/type/HasPolymorphicAs.ts +8 -0
- package/src/utils/type/HasTheme.ts +8 -0
- package/src/utils/type/HeadingElement.ts +2 -0
- package/src/utils/type/KebabCase.ts +6 -0
- package/src/utils/type/MaybeElementOrRef.ts +6 -0
- package/src/utils/type/Point.ts +4 -0
- package/src/utils/type/Predicate.ts +2 -0
- package/src/utils/type/RectSize.ts +4 -0
- package/src/utils/type/TextElement.ts +4 -0
- package/src/utils/type/ValueOf.ts +2 -0
- package/src/utils/type/index.ts +19 -0
- package/src/utils/type/isComponentType.ts +9 -0
- package/utils/index.d.ts +1 -1
- package/_internal/index.d.ts +0 -285
- package/src/utils/className/getRootClassName.test.ts +0 -11
- package/src/utils/className/getRootClassName.ts +0 -24
- package/src/utils/type.ts +0 -164
package/package.json
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"url": "https://github.com/lumapps/design-system/issues"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@lumx/core": "^3.10.1-alpha.
|
|
10
|
-
"@lumx/icons": "^3.10.1-alpha.
|
|
9
|
+
"@lumx/core": "^3.10.1-alpha.7",
|
|
10
|
+
"@lumx/icons": "^3.10.1-alpha.7",
|
|
11
11
|
"@popperjs/core": "^2.5.4",
|
|
12
12
|
"body-scroll-lock": "^3.1.5",
|
|
13
13
|
"classnames": "^2.3.2",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"build:storybook": "storybook build"
|
|
111
111
|
},
|
|
112
112
|
"sideEffects": false,
|
|
113
|
-
"version": "3.10.1-alpha.
|
|
113
|
+
"version": "3.10.1-alpha.7"
|
|
114
114
|
}
|
|
@@ -15,9 +15,10 @@ import {
|
|
|
15
15
|
ButtonProps,
|
|
16
16
|
} from '@lumx/react';
|
|
17
17
|
import { mdiAlert, mdiAlertCircle, mdiCheckCircle, mdiInformation } from '@lumx/icons';
|
|
18
|
-
import {
|
|
18
|
+
import { handleBasicClasses } from '@lumx/react/utils/className';
|
|
19
19
|
import { useId } from '@lumx/react/hooks/useId';
|
|
20
20
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
21
|
+
import type { ComponentClassName } from '@lumx/react/utils/type';
|
|
21
22
|
|
|
22
23
|
export interface AlertDialogProps extends Omit<DialogProps, 'header' | 'footer'> {
|
|
23
24
|
/** Message variant. */
|
|
@@ -57,7 +58,7 @@ const COMPONENT_NAME = 'AlertDialog';
|
|
|
57
58
|
/**
|
|
58
59
|
* Component default class name and class prefix.
|
|
59
60
|
*/
|
|
60
|
-
const CLASSNAME =
|
|
61
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-alert-dialog';
|
|
61
62
|
|
|
62
63
|
/**
|
|
63
64
|
* Component default props.
|
|
@@ -5,11 +5,11 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { Dropdown, DropdownProps, IconButtonProps, Offset, Placement, TextField, TextFieldProps } from '@lumx/react';
|
|
6
6
|
|
|
7
7
|
import { GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
8
|
-
import { getRootClassName } from '@lumx/react/utils/className';
|
|
9
8
|
import { useFocus } from '@lumx/react/hooks/useFocus';
|
|
10
9
|
import { mergeRefs } from '@lumx/react/utils/mergeRefs';
|
|
11
10
|
import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
|
|
12
11
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
12
|
+
import type { ComponentClassName } from '@lumx/react/utils/type';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Defines the props of the component.
|
|
@@ -181,7 +181,7 @@ const COMPONENT_NAME = 'Autocomplete';
|
|
|
181
181
|
/**
|
|
182
182
|
* Component default class name and class prefix.
|
|
183
183
|
*/
|
|
184
|
-
const CLASSNAME =
|
|
184
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-autocomplete';
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
187
|
* Component default props.
|
|
@@ -5,7 +5,7 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { mdiClose } from '@lumx/icons';
|
|
6
6
|
|
|
7
7
|
import { Autocomplete, AutocompleteProps, Chip, HorizontalAlignment, Icon, Size } from '@lumx/react';
|
|
8
|
-
import {
|
|
8
|
+
import type { ComponentClassName } from '@lumx/react/utils/type';
|
|
9
9
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
10
10
|
import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
|
|
11
11
|
|
|
@@ -34,7 +34,7 @@ const COMPONENT_NAME = 'AutocompleteMultiple';
|
|
|
34
34
|
/**
|
|
35
35
|
* Component default class name and class prefix.
|
|
36
36
|
*/
|
|
37
|
-
const CLASSNAME =
|
|
37
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-autocomplete-multiple';
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Component default props.
|
|
@@ -4,8 +4,8 @@ import classNames from 'classnames';
|
|
|
4
4
|
|
|
5
5
|
import { AspectRatio, Size, Theme, Thumbnail, ThumbnailProps } from '@lumx/react';
|
|
6
6
|
|
|
7
|
-
import { GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
8
|
-
import {
|
|
7
|
+
import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
|
|
8
|
+
import { handleBasicClasses } from '@lumx/react/utils/className';
|
|
9
9
|
import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
|
|
10
10
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
11
11
|
|
|
@@ -51,7 +51,7 @@ const COMPONENT_NAME = 'Avatar';
|
|
|
51
51
|
/**
|
|
52
52
|
* Component default class name and class prefix.
|
|
53
53
|
*/
|
|
54
|
-
const CLASSNAME =
|
|
54
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-avatar';
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Component default props.
|
|
@@ -3,8 +3,8 @@ import React, { ReactNode } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { ColorPalette } from '@lumx/react';
|
|
6
|
-
import { GenericProps } from '@lumx/react/utils/type';
|
|
7
|
-
import {
|
|
6
|
+
import type { GenericProps, 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
|
/**
|
|
@@ -25,7 +25,7 @@ const COMPONENT_NAME = 'Badge';
|
|
|
25
25
|
/**
|
|
26
26
|
* Component default class name and class prefix.
|
|
27
27
|
*/
|
|
28
|
-
const CLASSNAME =
|
|
28
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-badge';
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Component default props.
|
|
@@ -2,9 +2,8 @@ import React, { ReactElement, ReactNode } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
|
-
import { getRootClassName } from '@lumx/react/utils/className';
|
|
6
5
|
import { DEFAULT_PROPS } from '@lumx/react/components/select/WithSelectContext';
|
|
7
|
-
import { GenericProps } from '@lumx/react/utils/type';
|
|
6
|
+
import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
|
|
8
7
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
9
8
|
|
|
10
9
|
export interface BadgeWrapperProps extends GenericProps {
|
|
@@ -22,7 +21,7 @@ const COMPONENT_NAME = 'BadgeWrapper';
|
|
|
22
21
|
/**
|
|
23
22
|
* Component default class name and class prefix.
|
|
24
23
|
*/
|
|
25
|
-
const CLASSNAME =
|
|
24
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-badge-wrapper';
|
|
26
25
|
|
|
27
26
|
export const BadgeWrapper = forwardRef<BadgeWrapperProps, HTMLDivElement>((props, ref) => {
|
|
28
27
|
const { badge, children, className, ...forwardedProps } = props;
|
|
@@ -3,8 +3,8 @@ import React, { ReactNode } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { Emphasis, Icon, Size, Theme, Text } from '@lumx/react';
|
|
6
|
-
import {
|
|
7
|
-
import { getBasicClass
|
|
6
|
+
import { isComponentType, type ComponentClassName } from '@lumx/react/utils/type';
|
|
7
|
+
import { getBasicClass } 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
|
|
|
@@ -38,7 +38,7 @@ const COMPONENT_NAME = 'Button';
|
|
|
38
38
|
/**
|
|
39
39
|
* Component default class name and class prefix.
|
|
40
40
|
*/
|
|
41
|
-
const CLASSNAME =
|
|
41
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-button';
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Component default props.
|
|
@@ -73,7 +73,7 @@ export const Button = forwardRef<ButtonProps, HTMLButtonElement | HTMLAnchorElem
|
|
|
73
73
|
variant="button"
|
|
74
74
|
>
|
|
75
75
|
{leftIcon && <Icon icon={leftIcon} />}
|
|
76
|
-
{children && (
|
|
76
|
+
{children && (isComponentType(Text)(children) ? children : <span>{children}</span>)}
|
|
77
77
|
{rightIcon && <Icon icon={rightIcon} />}
|
|
78
78
|
</ButtonRoot>
|
|
79
79
|
);
|
|
@@ -2,8 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
|
-
import { GenericProps } from '@lumx/react/utils/type';
|
|
6
|
-
import { getRootClassName } from '@lumx/react/utils/className';
|
|
5
|
+
import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
|
|
7
6
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -19,7 +18,7 @@ const COMPONENT_NAME = 'ButtonGroup';
|
|
|
19
18
|
/**
|
|
20
19
|
* Component default class name and class prefix.
|
|
21
20
|
*/
|
|
22
|
-
const CLASSNAME =
|
|
21
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-button-group';
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
24
|
* Component default props.
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { Emphasis, Icon, Size, Theme, Tooltip, TooltipProps } from '@lumx/react';
|
|
4
4
|
import { BaseButtonProps, ButtonRoot } from '@lumx/react/components/button/ButtonRoot';
|
|
5
|
-
import { getRootClassName } from '@lumx/react/utils/className';
|
|
6
5
|
import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
|
|
7
6
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
7
|
+
import type { ComponentClassName } from '@lumx/react/utils/type';
|
|
8
8
|
|
|
9
9
|
export interface IconButtonProps extends BaseButtonProps {
|
|
10
10
|
/**
|
|
@@ -39,7 +39,7 @@ const COMPONENT_NAME = 'IconButton';
|
|
|
39
39
|
/**
|
|
40
40
|
* Component default class name and class prefix.
|
|
41
41
|
*/
|
|
42
|
-
const CLASSNAME =
|
|
42
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-icon-button';
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Component default props.
|
|
@@ -5,8 +5,8 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { mdiCheck, mdiMinus } from '@lumx/icons';
|
|
6
6
|
|
|
7
7
|
import { Icon, InputHelper, InputLabel, Theme } from '@lumx/react';
|
|
8
|
-
import { GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
9
|
-
import {
|
|
8
|
+
import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
|
|
9
|
+
import { handleBasicClasses } from '@lumx/react/utils/className';
|
|
10
10
|
import { useId } from '@lumx/react/hooks/useId';
|
|
11
11
|
import { useMergeRefs } from '@lumx/react/utils/mergeRefs';
|
|
12
12
|
import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
|
|
@@ -51,7 +51,7 @@ const COMPONENT_NAME = 'Checkbox';
|
|
|
51
51
|
/**
|
|
52
52
|
* Component default class name and class prefix.
|
|
53
53
|
*/
|
|
54
|
-
const CLASSNAME =
|
|
54
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-checkbox';
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Component default props.
|
|
@@ -5,8 +5,8 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { ColorPalette, Size, Theme } from '@lumx/react';
|
|
6
6
|
import { useStopPropagation } from '@lumx/react/hooks/useStopPropagation';
|
|
7
7
|
|
|
8
|
-
import { GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
9
|
-
import {
|
|
8
|
+
import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
|
|
9
|
+
import { handleBasicClasses } from '@lumx/react/utils/className';
|
|
10
10
|
import { onEnterPressed } from '@lumx/react/utils/browser/event';
|
|
11
11
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
12
12
|
import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
|
|
@@ -50,7 +50,7 @@ const COMPONENT_NAME = 'Chip';
|
|
|
50
50
|
/**
|
|
51
51
|
* Component default class name and class prefix.
|
|
52
52
|
*/
|
|
53
|
-
const CLASSNAME =
|
|
53
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-chip';
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Component default props.
|
|
@@ -3,8 +3,7 @@ import React, { ReactNode } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { HorizontalAlignment } from '@lumx/react/components';
|
|
6
|
-
import { GenericProps } from '@lumx/react/utils/type';
|
|
7
|
-
import { getRootClassName } from '@lumx/react/utils/className';
|
|
6
|
+
import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
|
|
8
7
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
9
8
|
|
|
10
9
|
import { useChipGroupNavigation } from '@lumx/react/hooks/useChipGroupNavigation';
|
|
@@ -35,7 +34,7 @@ const COMPONENT_NAME = 'ChipGroup';
|
|
|
35
34
|
/**
|
|
36
35
|
* Component default class name and class prefix.
|
|
37
36
|
*/
|
|
38
|
-
const CLASSNAME =
|
|
37
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-chip-group';
|
|
39
38
|
|
|
40
39
|
/**
|
|
41
40
|
* ChipGroup component.
|
|
@@ -3,8 +3,8 @@ import React, { Children, ReactNode } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { Avatar, Size, Theme, Tooltip } from '@lumx/react';
|
|
6
|
-
import { GenericProps, HasTheme, ValueOf } from '@lumx/react/utils/type';
|
|
7
|
-
import {
|
|
6
|
+
import type { GenericProps, HasTheme, ValueOf, 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';
|
|
@@ -72,7 +72,7 @@ const COMPONENT_NAME = 'CommentBlock';
|
|
|
72
72
|
/**
|
|
73
73
|
* Component default class name and class prefix.
|
|
74
74
|
*/
|
|
75
|
-
const CLASSNAME =
|
|
75
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-comment-block';
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* Component default props.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 = 'DatePicker';
|
|
|
8
8
|
/**
|
|
9
9
|
* Component default class name and class prefix.
|
|
10
10
|
*/
|
|
11
|
-
export const CLASSNAME =
|
|
11
|
+
export const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-date-picker';
|
|
@@ -10,9 +10,9 @@ import { useCallbackOnEscape } from '@lumx/react/hooks/useCallbackOnEscape';
|
|
|
10
10
|
import { useFocusTrap } from '@lumx/react/hooks/useFocusTrap';
|
|
11
11
|
import { useIntersectionObserver } from '@lumx/react/hooks/useIntersectionObserver';
|
|
12
12
|
|
|
13
|
-
import { GenericProps,
|
|
13
|
+
import { type GenericProps, isComponentType, type ComponentClassName } from '@lumx/react/utils/type';
|
|
14
14
|
import { partitionMulti } from '@lumx/react/utils/collection/partitionMulti';
|
|
15
|
-
import {
|
|
15
|
+
import { handleBasicClasses } from '@lumx/react/utils/className';
|
|
16
16
|
import { ClickAwayProvider } from '@lumx/react/utils/ClickAwayProvider';
|
|
17
17
|
import { mergeRefs } from '@lumx/react/utils/mergeRefs';
|
|
18
18
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
@@ -65,8 +65,8 @@ export interface DialogProps extends GenericProps {
|
|
|
65
65
|
|
|
66
66
|
export type DialogSizes = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;
|
|
67
67
|
|
|
68
|
-
const isHeader =
|
|
69
|
-
const isFooter =
|
|
68
|
+
const isHeader = isComponentType('header');
|
|
69
|
+
const isFooter = isComponentType('footer');
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* Component display name.
|
|
@@ -76,7 +76,7 @@ const COMPONENT_NAME = 'Dialog';
|
|
|
76
76
|
/**
|
|
77
77
|
* Component default class name and class prefix.
|
|
78
78
|
*/
|
|
79
|
-
const CLASSNAME =
|
|
79
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-dialog';
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* 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 {
|
|
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
|
|
|
@@ -21,7 +21,7 @@ const COMPONENT_NAME = 'Divider';
|
|
|
21
21
|
/**
|
|
22
22
|
* Component default class name and class prefix.
|
|
23
23
|
*/
|
|
24
|
-
const CLASSNAME =
|
|
24
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-divider';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Component default props.
|
|
@@ -4,8 +4,8 @@ import classNames from 'classnames';
|
|
|
4
4
|
|
|
5
5
|
import { mdiDragVertical } from '@lumx/icons';
|
|
6
6
|
import { ColorPalette, Icon, Size, Theme } from '@lumx/react';
|
|
7
|
-
import { GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
8
|
-
import {
|
|
7
|
+
import type { GenericProps, HasTheme, ComponentClassName } from '@lumx/react/utils/type';
|
|
8
|
+
import { handleBasicClasses } from '@lumx/react/utils/className';
|
|
9
9
|
import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
|
|
10
10
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
11
11
|
|
|
@@ -22,7 +22,7 @@ const COMPONENT_NAME = 'DragHandle';
|
|
|
22
22
|
/**
|
|
23
23
|
* Component default class name and class prefix.
|
|
24
24
|
*/
|
|
25
|
-
const CLASSNAME =
|
|
25
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-drag-handle';
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* DragHandle component.
|
|
@@ -5,8 +5,7 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { List, ListProps } from '@lumx/react/components/list/List';
|
|
6
6
|
import { Popover, PopoverProps } from '@lumx/react/components/popover/Popover';
|
|
7
7
|
import { useInfiniteScroll } from '@lumx/react/hooks/useInfiniteScroll';
|
|
8
|
-
import { GenericProps,
|
|
9
|
-
import { getRootClassName } from '@lumx/react/utils/className';
|
|
8
|
+
import { type GenericProps, isComponentType, type ComponentClassName } from '@lumx/react/utils/type';
|
|
10
9
|
import { Offset, Placement } from '@lumx/react/components/popover/constants';
|
|
11
10
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
12
11
|
|
|
@@ -91,7 +90,7 @@ const COMPONENT_NAME = 'Dropdown';
|
|
|
91
90
|
/**
|
|
92
91
|
* Component default class name and class prefix.
|
|
93
92
|
*/
|
|
94
|
-
const CLASSNAME =
|
|
93
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-dropdown';
|
|
95
94
|
|
|
96
95
|
/**
|
|
97
96
|
* Component default props.
|
|
@@ -140,7 +139,7 @@ export const Dropdown = forwardRef<DropdownProps, HTMLDivElement>((props, ref) =
|
|
|
140
139
|
useInfiniteScroll(innerRef, onInfiniteScroll);
|
|
141
140
|
|
|
142
141
|
const popperElement = useMemo(() => {
|
|
143
|
-
return !Array.isArray(children) &&
|
|
142
|
+
return !Array.isArray(children) && isComponentType(List)(children)
|
|
144
143
|
? cloneElement<ListProps>(children, {
|
|
145
144
|
...children.props,
|
|
146
145
|
ref: listElement,
|
|
@@ -5,8 +5,8 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { mdiChevronDown, mdiChevronUp } from '@lumx/icons';
|
|
6
6
|
|
|
7
7
|
import { ColorPalette, DragHandle, Emphasis, IconButton, IconButtonProps, Theme } from '@lumx/react';
|
|
8
|
-
import { GenericProps, HasTheme,
|
|
9
|
-
import {
|
|
8
|
+
import { type GenericProps, type HasTheme, type ComponentClassName, isComponentType } from '@lumx/react/utils/type';
|
|
9
|
+
import { handleBasicClasses } from '@lumx/react/utils/className';
|
|
10
10
|
import { partitionMulti } from '@lumx/react/utils/collection/partitionMulti';
|
|
11
11
|
import { useTransitionVisibility } from '@lumx/react/hooks/useTransitionVisibility';
|
|
12
12
|
import { EXPANSION_PANEL_TRANSITION_DURATION } from '@lumx/core/js/constants';
|
|
@@ -45,16 +45,16 @@ const COMPONENT_NAME = 'ExpansionPanel';
|
|
|
45
45
|
/**
|
|
46
46
|
* Component default class name and class prefix.
|
|
47
47
|
*/
|
|
48
|
-
const CLASSNAME =
|
|
48
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-expansion-panel';
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Component default props.
|
|
52
52
|
*/
|
|
53
53
|
const DEFAULT_PROPS: Partial<ExpansionPanelProps> = {};
|
|
54
54
|
|
|
55
|
-
const isDragHandle =
|
|
56
|
-
const isHeader =
|
|
57
|
-
const isFooter =
|
|
55
|
+
const isDragHandle = isComponentType(DragHandle);
|
|
56
|
+
const isHeader = isComponentType('header');
|
|
57
|
+
const isFooter = isComponentType('footer');
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* ExpansionPanel component.
|
|
@@ -3,8 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { ColorPalette, Icon, Size, Theme, Text } from '@lumx/react';
|
|
6
|
-
import { GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
7
|
-
import {
|
|
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
|
|
|
@@ -20,7 +20,7 @@ export interface FlagProps extends GenericProps, HasTheme {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const COMPONENT_NAME = 'Flag';
|
|
23
|
-
const CLASSNAME =
|
|
23
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-flag';
|
|
24
24
|
const DEFAULT_PROPS: Partial<FlagProps> = {};
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -4,8 +4,8 @@ import classNames from 'classnames';
|
|
|
4
4
|
|
|
5
5
|
import { Alignment, Orientation } from '@lumx/react';
|
|
6
6
|
import { castArray } from '@lumx/react/utils/collection/castArray';
|
|
7
|
-
import { GenericProps } from '@lumx/react/utils/type';
|
|
8
|
-
import {
|
|
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
|
import { HorizontalAlignment, Size, VerticalAlignment } from '..';
|
|
11
11
|
|
|
@@ -49,7 +49,7 @@ const COMPONENT_NAME = 'FlexBox';
|
|
|
49
49
|
/**
|
|
50
50
|
* Component default class name and class prefix.
|
|
51
51
|
*/
|
|
52
|
-
const CLASSNAME =
|
|
52
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-flex-box';
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* FlexBox component.
|
|
@@ -2,8 +2,7 @@ import React, { Children, ReactElement, ReactNode } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
|
-
import { Comp, isComponentType } from '@lumx/react/utils/type';
|
|
6
|
-
import { getRootClassName } from '@lumx/react/utils/className';
|
|
5
|
+
import { type ComponentClassName, type Comp, isComponentType } from '@lumx/react/utils/type';
|
|
7
6
|
import { partitionMulti } from '@lumx/react/utils/collection/partitionMulti';
|
|
8
7
|
import { Orientation, Size, FlexBox, FlexBoxProps } from '@lumx/react';
|
|
9
8
|
import { GenericBlockGapSize } from '@lumx/react/components/generic-block/constants';
|
|
@@ -62,7 +61,7 @@ const COMPONENT_NAME = 'GenericBlock';
|
|
|
62
61
|
/**
|
|
63
62
|
* Component default class name and class prefix.
|
|
64
63
|
*/
|
|
65
|
-
const CLASSNAME =
|
|
64
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-generic-block';
|
|
66
65
|
|
|
67
66
|
/**
|
|
68
67
|
* Component default props.
|
|
@@ -3,8 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { Alignment, Orientation, Size } from '@lumx/react';
|
|
6
|
-
import { GenericProps } from '@lumx/react/utils/type';
|
|
7
|
-
import {
|
|
6
|
+
import type { GenericProps, 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
|
type GridGutterSize = Extract<Size, 'regular' | 'big' | 'huge'>;
|
|
@@ -33,7 +33,7 @@ const COMPONENT_NAME = 'Grid';
|
|
|
33
33
|
/**
|
|
34
34
|
* Component default class name and class prefix.
|
|
35
35
|
*/
|
|
36
|
-
const CLASSNAME =
|
|
36
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-grid';
|
|
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 { Alignment } from '@lumx/react';
|
|
6
|
-
import { GenericProps } from '@lumx/react/utils/type';
|
|
7
|
-
import {
|
|
6
|
+
import type { GenericProps, 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
|
type Columns = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|
|
@@ -29,7 +29,7 @@ const COMPONENT_NAME = 'GridItem';
|
|
|
29
29
|
/**
|
|
30
30
|
* Component default class name and class prefix.
|
|
31
31
|
*/
|
|
32
|
-
const CLASSNAME =
|
|
32
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-grid-item';
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* GridItem component.
|
|
@@ -3,8 +3,7 @@ import React, { ReactElement, ReactNode } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { Size } from '@lumx/react';
|
|
6
|
-
import { GenericProps } from '@lumx/react/utils/type';
|
|
7
|
-
import { getRootClassName } from '@lumx/react/utils/className';
|
|
6
|
+
import type { GenericProps, ComponentClassName } from '@lumx/react/utils/type';
|
|
8
7
|
import { forwardRef } from '@lumx/react/utils/react/forwardRef';
|
|
9
8
|
|
|
10
9
|
export type GridColumnGapSize = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;
|
|
@@ -33,7 +32,7 @@ const COMPONENT_NAME = 'GridColumn';
|
|
|
33
32
|
/**
|
|
34
33
|
* Component default class name and class prefix.
|
|
35
34
|
*/
|
|
36
|
-
const CLASSNAME =
|
|
35
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-grid-column';
|
|
37
36
|
|
|
38
37
|
/**
|
|
39
38
|
* Component default props.
|
|
@@ -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 } 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 =
|
|
30
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-heading';
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
33
|
* Component default props.
|
|
@@ -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 {
|
|
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 =
|
|
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 {
|
|
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 =
|
|
59
|
+
const CLASSNAME: ComponentClassName<typeof COMPONENT_NAME> = 'lumx-image-block';
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* Component default props.
|