@lumx/core 4.3.2-alpha.3 → 4.3.2-alpha.30
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/js/components/Badge/BadgeWrapper.d.ts +13 -0
- package/js/components/Badge/BadgeWrapperStories.d.ts +29 -0
- package/js/components/Badge/BadgeWrapperTests.d.ts +9 -0
- package/js/components/Badge/Stories.d.ts +52 -0
- package/js/components/Badge/Tests.d.ts +12 -0
- package/js/components/Badge/index.d.ts +37 -0
- package/js/components/Button/Button.d.ts +48 -0
- package/js/components/Button/ButtonGroup.d.ts +36 -0
- package/js/components/Button/ButtonGroupStories.d.ts +37 -0
- package/js/components/Button/ButtonRoot.d.ts +55 -0
- package/js/components/Button/ButtonRootTests.d.ts +12 -0
- package/js/components/Button/IconButton.d.ts +45 -0
- package/js/components/Button/IconButtonStories.d.ts +211 -0
- package/js/components/Button/IconButtonTests.d.ts +15 -0
- package/js/components/Button/Stories.d.ts +301 -0
- package/js/components/Button/Tests.d.ts +15 -0
- package/js/components/Checkbox/Stories.d.ts +88 -0
- package/js/components/Checkbox/Tests.d.ts +15 -0
- package/js/components/Checkbox/index.d.ts +49 -0
- package/js/components/Divider/Stories.d.ts +21 -0
- package/js/components/Divider/Tests.d.ts +12 -0
- package/js/components/Divider/index.d.ts +27 -0
- package/js/components/Flag/Stories.d.ts +120 -0
- package/js/components/Flag/Tests.d.ts +14 -0
- package/js/components/Flag/index.d.ts +34 -0
- package/js/components/FlexBox/Stories.d.ts +108 -0
- package/js/components/FlexBox/Tests.d.ts +13 -0
- package/js/components/FlexBox/constants.d.ts +4 -0
- package/js/components/FlexBox/index.d.ts +50 -0
- package/js/components/FlexBox/types.d.ts +7 -0
- package/js/components/GridColumn/GridColumn.d.ts +48 -0
- package/js/components/GridColumn/GridColumnStories.d.ts +47 -0
- package/js/components/GridColumn/GridColumnTests.d.ts +12 -0
- package/js/components/Heading/Stories.d.ts +89 -0
- package/js/components/Heading/Tests.d.ts +11 -0
- package/js/components/Heading/constants.d.ts +21 -0
- package/js/components/Heading/index.d.ts +44 -0
- package/js/components/Heading/utils.d.ts +8 -0
- package/js/components/Icon/Stories.d.ts +150 -0
- package/js/components/Icon/Tests.d.ts +14 -0
- package/js/components/Icon/constants.d.ts +1 -0
- package/js/components/Icon/index.d.ts +41 -0
- package/js/components/InputHelper/Stories.d.ts +43 -0
- package/js/components/InputHelper/Tests.d.ts +12 -0
- package/js/components/InputHelper/constants.d.ts +3 -0
- package/js/components/InputHelper/index.d.ts +26 -0
- package/js/components/InputLabel/Stories.d.ts +34 -0
- package/js/components/InputLabel/Tests.d.ts +12 -0
- package/js/components/InputLabel/index.d.ts +25 -0
- package/js/components/Link/Stories.d.ts +93 -0
- package/js/components/Link/Tests.d.ts +15 -0
- package/js/components/Link/index.d.ts +54 -0
- package/js/components/Message/Stories.d.ts +119 -0
- package/js/components/Message/Tests.d.ts +14 -0
- package/js/components/Message/index.d.ts +75 -0
- package/js/components/RadioButton/Stories.d.ts +77 -0
- package/js/components/RadioButton/Tests.d.ts +15 -0
- package/js/components/RadioButton/index.d.ts +45 -0
- package/js/components/RawClickable/Tests.d.ts +14 -0
- package/js/components/RawClickable/index.d.ts +13 -0
- package/js/components/Skeleton/SkeletonCircle.d.ts +32 -0
- package/js/components/Skeleton/SkeletonCircleStories.d.ts +45 -0
- package/js/components/Skeleton/SkeletonCircleTests.d.ts +12 -0
- package/js/components/Skeleton/SkeletonRectangle.d.ts +47 -0
- package/js/components/Skeleton/SkeletonRectangleStories.d.ts +87 -0
- package/js/components/Skeleton/SkeletonRectangleTests.d.ts +13 -0
- package/js/components/Skeleton/SkeletonTypography.d.ts +37 -0
- package/js/components/Skeleton/SkeletonTypographyStories.d.ts +40 -0
- package/js/components/Skeleton/SkeletonTypographyTests.d.ts +13 -0
- package/js/components/Skeleton/index.d.ts +3 -0
- package/js/components/Switch/Stories.d.ts +94 -0
- package/js/components/Switch/Tests.d.ts +15 -0
- package/js/components/Switch/index.d.ts +47 -0
- package/js/components/Table/Stories.d.ts +25 -0
- package/js/components/Table/TableCell.d.ts +55 -0
- package/js/components/Table/TableCellStories.d.ts +44 -0
- package/js/components/Table/TableCellTests.d.ts +11 -0
- package/js/components/Table/TableRowStories.d.ts +23 -0
- package/js/components/Table/Tests.d.ts +11 -0
- package/js/components/Table/constants.d.ts +9 -0
- package/js/components/Table/index.d.ts +27 -0
- package/js/components/Text/Stories.d.ts +167 -0
- package/js/components/Text/Tests.d.ts +10 -0
- package/js/components/Text/index.d.ts +935 -0
- package/js/components/Thumbnail/Stories.d.ts +178 -0
- package/js/components/Thumbnail/Tests.d.ts +11 -0
- package/js/components/Thumbnail/index.d.ts +84 -0
- package/js/components/Thumbnail/types.d.ts +45 -0
- package/js/components/Thumbnail/utils.d.ts +79 -0
- package/js/components/Toolbar/Stories.d.ts +46 -0
- package/js/components/Toolbar/Tests.d.ts +12 -0
- package/js/components/Toolbar/index.d.ts +33 -0
- package/js/constants/enums/index.d.ts +9 -0
- package/js/constants/enums/index.js +10 -1
- package/js/constants/index.js +1 -1
- package/js/types/AriaAttributes.d.ts +29 -2
- package/js/types/PartialBy.d.ts +12 -0
- package/js/types/index.d.ts +2 -0
- package/js/types/jsx/PropsToOverride.d.ts +2 -0
- package/js/utils/classNames/bem/block.d.ts +3 -2
- package/js/utils/classNames/bem/element.d.ts +3 -2
- package/js/utils/classNames/bem/index.d.ts +5 -4
- package/package.json +31 -2
- package/stories/controls/color.d.ts +15 -0
- package/stories/controls/element.d.ts +16 -0
- package/stories/controls/focusPoint.d.ts +8 -0
- package/stories/controls/icons.d.ts +66 -0
- package/stories/controls/image.d.ts +96 -0
- package/stories/controls/selectArgType.d.ts +7 -0
- package/stories/controls/theme.d.ts +7 -0
- package/stories/controls/typography.d.ts +8 -0
- package/stories/controls/withUndefined.d.ts +1 -0
- package/stories/types.d.ts +43 -0
- package/stories/utils/combinations.d.ts +100 -0
- package/stories/utils/concatPath.d.ts +10 -0
- package/stories/utils/disableArgTypes.d.ts +7 -0
- package/stories/utils/initDemoShadowDOMPortal.d.ts +5 -0
- package/stories/utils/lorem.d.ts +7 -0
- package/stories/utils/toFlattenProps.d.ts +12 -0
- package/stories/utils/withCategory.d.ts +4 -0
- package/testing/commonTestsSuiteTL.d.ts +87 -0
- package/testing/index.d.ts +1 -0
- package/testing/queries.d.ts +4 -0
- package/js/utils/events/index.js +0 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
import { RadioButtonProps } from '.';
|
|
3
|
+
type SetupProps = Partial<RadioButtonProps>;
|
|
4
|
+
/**
|
|
5
|
+
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
6
|
+
*/
|
|
7
|
+
export declare const setup: (propsOverride: SetupProps | undefined, { render, ...options }: SetupOptions<RadioButtonProps>) => {
|
|
8
|
+
radioButton: HTMLElement;
|
|
9
|
+
helper: HTMLElement | null;
|
|
10
|
+
label: HTMLElement | null;
|
|
11
|
+
input: HTMLElement;
|
|
12
|
+
props: RadioButtonProps;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: (renderOptions: SetupOptions<RadioButtonProps>) => void;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { JSXElement, LumxClassName, HasTheme, HasAriaDisabled, HasDisabled, HasClassName, HasChecked, CommonRef } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the props of the component.
|
|
4
|
+
*/
|
|
5
|
+
export interface RadioButtonProps extends HasTheme, HasClassName, HasAriaDisabled, HasDisabled, HasChecked {
|
|
6
|
+
/** Helper text. */
|
|
7
|
+
helper?: string;
|
|
8
|
+
/** Native input id property. */
|
|
9
|
+
id?: string;
|
|
10
|
+
/** Label content. */
|
|
11
|
+
label?: JSXElement;
|
|
12
|
+
/** Native input name property. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Native input value property. */
|
|
15
|
+
value?: string;
|
|
16
|
+
/** optional props for input */
|
|
17
|
+
inputProps?: Record<string, any>;
|
|
18
|
+
/** Native input ref. */
|
|
19
|
+
inputRef?: CommonRef;
|
|
20
|
+
/** Native input id. */
|
|
21
|
+
inputId: string;
|
|
22
|
+
/** On change callback. */
|
|
23
|
+
onChange?(value?: string, name?: string, event?: any): void;
|
|
24
|
+
/** reference to the root element */
|
|
25
|
+
ref?: CommonRef;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Component display name.
|
|
29
|
+
*/
|
|
30
|
+
export declare const COMPONENT_NAME = "RadioButton";
|
|
31
|
+
/**
|
|
32
|
+
* Component default class name and class prefix.
|
|
33
|
+
*/
|
|
34
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
35
|
+
/**
|
|
36
|
+
* Component default props.
|
|
37
|
+
*/
|
|
38
|
+
export declare const DEFAULT_PROPS: Partial<RadioButtonProps>;
|
|
39
|
+
/**
|
|
40
|
+
* RadioButton component.
|
|
41
|
+
*
|
|
42
|
+
* @param props Component props.
|
|
43
|
+
* @return JSX element.
|
|
44
|
+
*/
|
|
45
|
+
export declare const RadioButton: (props: RadioButtonProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RawClickableProps } from '.';
|
|
2
|
+
import { SetupOptions } from '../../../testing';
|
|
3
|
+
type SetupProps = Partial<RawClickableProps<any>>;
|
|
4
|
+
/**
|
|
5
|
+
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
6
|
+
*/
|
|
7
|
+
export declare const setup: (propsOverride: SetupProps | undefined, { render, screen, ...options }: SetupOptions<RawClickableProps<any>>) => {
|
|
8
|
+
element: HTMLElement;
|
|
9
|
+
props: Omit<any, "ref"> & {
|
|
10
|
+
as?: any;
|
|
11
|
+
} & Record<string, unknown> & import(".").BaseClickableProps;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: (renderOptions: SetupOptions<RawClickableProps<any>>) => void;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CommonRef, HasPolymorphicAs, HasRequiredLinkHref, HasDisabled, JSXElement, ElementType, HasAriaDisabled } from '../../types';
|
|
2
|
+
export type ClickableElement = 'a' | 'button' | ElementType;
|
|
3
|
+
export interface BaseClickableProps extends HasDisabled, HasAriaDisabled {
|
|
4
|
+
children?: JSXElement;
|
|
5
|
+
onClick?: (event?: any) => void;
|
|
6
|
+
ref?: CommonRef;
|
|
7
|
+
}
|
|
8
|
+
export type RawClickableProps<E extends ClickableElement> = HasPolymorphicAs<E> & HasRequiredLinkHref<E> & BaseClickableProps;
|
|
9
|
+
/**
|
|
10
|
+
* Render clickable element (link, button or custom element)
|
|
11
|
+
* (also does some basic disabled state handling)
|
|
12
|
+
*/
|
|
13
|
+
export declare const RawClickable: <E extends ClickableElement>(props: RawClickableProps<E>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { LumxClassName, HasTheme, HasClassName, CommonRef } from '../../types';
|
|
2
|
+
import type { GlobalSize, ColorPalette } from '../../constants';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the props of the component.
|
|
5
|
+
*/
|
|
6
|
+
export interface SkeletonCircleProps extends HasTheme, HasClassName {
|
|
7
|
+
/** Size variant. */
|
|
8
|
+
size: GlobalSize;
|
|
9
|
+
/** The color of the skeleton. */
|
|
10
|
+
color?: ColorPalette;
|
|
11
|
+
/** Reference to the root element. */
|
|
12
|
+
ref?: CommonRef;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Component display name.
|
|
16
|
+
*/
|
|
17
|
+
export declare const COMPONENT_NAME = "SkeletonCircle";
|
|
18
|
+
/**
|
|
19
|
+
* Component default class name and class prefix.
|
|
20
|
+
*/
|
|
21
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
22
|
+
/**
|
|
23
|
+
* Component default props.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DEFAULT_PROPS: Partial<SkeletonCircleProps>;
|
|
26
|
+
/**
|
|
27
|
+
* SkeletonCircle component.
|
|
28
|
+
*
|
|
29
|
+
* @param props Component props.
|
|
30
|
+
* @return JSX element.
|
|
31
|
+
*/
|
|
32
|
+
export declare const SkeletonCircle: (props: SkeletonCircleProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
import type { SkeletonCircleProps } from './SkeletonCircle';
|
|
3
|
+
/**
|
|
4
|
+
* Setup SkeletonCircle stories for a specific framework (React or Vue).
|
|
5
|
+
*/
|
|
6
|
+
export declare function setup({ component, render, decorators: { withCombinations }, }: SetupStoriesOptions<{
|
|
7
|
+
decorators: 'withCombinations';
|
|
8
|
+
}>): {
|
|
9
|
+
meta: {
|
|
10
|
+
component: any;
|
|
11
|
+
render: any;
|
|
12
|
+
argTypes: {
|
|
13
|
+
size: {
|
|
14
|
+
control: string;
|
|
15
|
+
options: import("../../constants").GlobalSize[];
|
|
16
|
+
};
|
|
17
|
+
color: {
|
|
18
|
+
control: string;
|
|
19
|
+
options: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey")[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
args: Partial<SkeletonCircleProps>;
|
|
23
|
+
};
|
|
24
|
+
/** All sizes */
|
|
25
|
+
AllSize: {
|
|
26
|
+
argTypes: {
|
|
27
|
+
size: {
|
|
28
|
+
control: boolean;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
decorators: ((story: any, context: any) => any)[];
|
|
32
|
+
};
|
|
33
|
+
/** All colors */
|
|
34
|
+
AllColor: {
|
|
35
|
+
args: {
|
|
36
|
+
size: "m";
|
|
37
|
+
};
|
|
38
|
+
argTypes: {
|
|
39
|
+
color: {
|
|
40
|
+
control: boolean;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
decorators: ((story: any, context: any) => any)[];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
import { SkeletonCircleProps } from './SkeletonCircle';
|
|
3
|
+
type SetupProps = Partial<SkeletonCircleProps>;
|
|
4
|
+
/**
|
|
5
|
+
* Mounts the SkeletonCircle component and returns common DOM elements needed in tests.
|
|
6
|
+
*/
|
|
7
|
+
export declare const setup: (propsOverride: SetupProps | undefined, { render, ...options }: SetupOptions<SkeletonCircleProps>) => {
|
|
8
|
+
skeletonCircle: HTMLElement;
|
|
9
|
+
props: SkeletonCircleProps;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: (renderOptions: SetupOptions<SkeletonCircleProps>) => void;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { LumxClassName, HasTheme, HasClassName, CommonRef, ValueOf } from '../../types';
|
|
2
|
+
import type { GlobalSize, ColorPalette, AspectRatio } from '../../constants';
|
|
3
|
+
/**
|
|
4
|
+
* Skeleton variants.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SkeletonRectangleVariant: {
|
|
7
|
+
readonly squared: "squared";
|
|
8
|
+
readonly rounded: "rounded";
|
|
9
|
+
readonly pill: "pill";
|
|
10
|
+
};
|
|
11
|
+
export type SkeletonRectangleVariant = ValueOf<typeof SkeletonRectangleVariant>;
|
|
12
|
+
/**
|
|
13
|
+
* Defines the props of the component.
|
|
14
|
+
*/
|
|
15
|
+
export interface SkeletonRectangleProps extends HasTheme, HasClassName {
|
|
16
|
+
/** Aspect ratio (use with width and not height). */
|
|
17
|
+
aspectRatio?: Extract<AspectRatio, 'square' | 'horizontal' | 'vertical' | 'wide'>;
|
|
18
|
+
/** Height size. */
|
|
19
|
+
height?: GlobalSize;
|
|
20
|
+
/** Border variant. */
|
|
21
|
+
variant?: SkeletonRectangleVariant;
|
|
22
|
+
/** Width size. */
|
|
23
|
+
width?: GlobalSize;
|
|
24
|
+
/** The color of the skeleton. */
|
|
25
|
+
color?: ColorPalette;
|
|
26
|
+
/** Reference to the root element. */
|
|
27
|
+
ref?: CommonRef;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Component display name.
|
|
31
|
+
*/
|
|
32
|
+
export declare const COMPONENT_NAME = "SkeletonRectangle";
|
|
33
|
+
/**
|
|
34
|
+
* Component default class name and class prefix.
|
|
35
|
+
*/
|
|
36
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
37
|
+
/**
|
|
38
|
+
* Component default props.
|
|
39
|
+
*/
|
|
40
|
+
export declare const DEFAULT_PROPS: Partial<SkeletonRectangleProps>;
|
|
41
|
+
/**
|
|
42
|
+
* SkeletonRectangle component.
|
|
43
|
+
*
|
|
44
|
+
* @param props Component props.
|
|
45
|
+
* @return JSX element.
|
|
46
|
+
*/
|
|
47
|
+
export declare const SkeletonRectangle: (props: SkeletonRectangleProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
import { SkeletonRectangleVariant } from './SkeletonRectangle';
|
|
3
|
+
import type { SkeletonRectangleProps } from './SkeletonRectangle';
|
|
4
|
+
/**
|
|
5
|
+
* Setup SkeletonRectangle stories for a specific framework (React or Vue).
|
|
6
|
+
*/
|
|
7
|
+
export declare function setup({ component, render, decorators: { withCombinations }, }: SetupStoriesOptions<{
|
|
8
|
+
decorators: 'withCombinations';
|
|
9
|
+
}>): {
|
|
10
|
+
meta: {
|
|
11
|
+
component: any;
|
|
12
|
+
render: any;
|
|
13
|
+
argTypes: {
|
|
14
|
+
width: {
|
|
15
|
+
control: string;
|
|
16
|
+
options: (import("../../constants").GlobalSize | undefined)[];
|
|
17
|
+
};
|
|
18
|
+
height: {
|
|
19
|
+
control: string;
|
|
20
|
+
options: (import("../../constants").GlobalSize | undefined)[];
|
|
21
|
+
};
|
|
22
|
+
aspectRatio: {
|
|
23
|
+
control: string;
|
|
24
|
+
options: ("horizontal" | "vertical" | "wide" | "square" | undefined)[];
|
|
25
|
+
};
|
|
26
|
+
color: {
|
|
27
|
+
control: string;
|
|
28
|
+
options: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey")[];
|
|
29
|
+
};
|
|
30
|
+
variant: {
|
|
31
|
+
control: string;
|
|
32
|
+
options: (SkeletonRectangleVariant | undefined)[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
args: Partial<SkeletonRectangleProps>;
|
|
36
|
+
};
|
|
37
|
+
/** All sizes */
|
|
38
|
+
AllSize: {
|
|
39
|
+
argTypes: {
|
|
40
|
+
width: {
|
|
41
|
+
control: boolean;
|
|
42
|
+
};
|
|
43
|
+
height: {
|
|
44
|
+
control: boolean;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
decorators: ((story: any, context: any) => any)[];
|
|
48
|
+
};
|
|
49
|
+
/** All ratios (for a fixed width) */
|
|
50
|
+
AllRatios: {
|
|
51
|
+
args: {
|
|
52
|
+
width: "xl";
|
|
53
|
+
};
|
|
54
|
+
argTypes: {
|
|
55
|
+
aspectRatio: {
|
|
56
|
+
control: boolean;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
decorators: ((story: any, context: any) => any)[];
|
|
60
|
+
};
|
|
61
|
+
/** All variants */
|
|
62
|
+
AllVariants: {
|
|
63
|
+
args: {
|
|
64
|
+
width: "l";
|
|
65
|
+
height: "m";
|
|
66
|
+
};
|
|
67
|
+
argTypes: {
|
|
68
|
+
variant: {
|
|
69
|
+
control: boolean;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
decorators: ((story: any, context: any) => any)[];
|
|
73
|
+
};
|
|
74
|
+
/** All colors */
|
|
75
|
+
AllColors: {
|
|
76
|
+
args: {
|
|
77
|
+
width: "l";
|
|
78
|
+
height: "m";
|
|
79
|
+
};
|
|
80
|
+
argTypes: {
|
|
81
|
+
color: {
|
|
82
|
+
control: boolean;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
decorators: ((story: any, context: any) => any)[];
|
|
86
|
+
};
|
|
87
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
import { SkeletonRectangleProps } from './SkeletonRectangle';
|
|
3
|
+
type SetupProps = Partial<SkeletonRectangleProps>;
|
|
4
|
+
/**
|
|
5
|
+
* Mounts the SkeletonRectangle component and returns common DOM elements needed in tests.
|
|
6
|
+
*/
|
|
7
|
+
export declare const setup: (propsOverride: SetupProps | undefined, { render, ...options }: SetupOptions<SkeletonRectangleProps>) => {
|
|
8
|
+
skeletonRectangle: HTMLElement;
|
|
9
|
+
inner: HTMLElement | null;
|
|
10
|
+
props: SkeletonRectangleProps;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: (renderOptions: SetupOptions<SkeletonRectangleProps>) => void;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { LumxClassName, HasTheme, HasClassName, CommonRef } from '../../types';
|
|
3
|
+
import type { ColorPalette, TypographyInterface } from '../../constants';
|
|
4
|
+
/**
|
|
5
|
+
* Defines the props of the component.
|
|
6
|
+
*/
|
|
7
|
+
export interface SkeletonTypographyProps extends HasTheme, HasClassName {
|
|
8
|
+
/** Typography variant. */
|
|
9
|
+
typography: TypographyInterface;
|
|
10
|
+
/** Width CSS property. */
|
|
11
|
+
width?: CSSProperties['width'];
|
|
12
|
+
/** The color of the skeleton. */
|
|
13
|
+
color?: ColorPalette;
|
|
14
|
+
/** Reference to the root element. */
|
|
15
|
+
ref?: CommonRef;
|
|
16
|
+
/** Style object. */
|
|
17
|
+
style?: CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Component display name.
|
|
21
|
+
*/
|
|
22
|
+
export declare const COMPONENT_NAME = "SkeletonTypography";
|
|
23
|
+
/**
|
|
24
|
+
* Component default class name and class prefix.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
27
|
+
/**
|
|
28
|
+
* Component default props.
|
|
29
|
+
*/
|
|
30
|
+
export declare const DEFAULT_PROPS: Partial<SkeletonTypographyProps>;
|
|
31
|
+
/**
|
|
32
|
+
* SkeletonTypography component.
|
|
33
|
+
*
|
|
34
|
+
* @param props Component props.
|
|
35
|
+
* @return JSX element.
|
|
36
|
+
*/
|
|
37
|
+
export declare const SkeletonTypography: (props: SkeletonTypographyProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
/**
|
|
3
|
+
* Setup SkeletonTypography stories for a specific framework (React or Vue).
|
|
4
|
+
*/
|
|
5
|
+
export declare function setup({ component, render, }: SetupStoriesOptions<{
|
|
6
|
+
decorators?: never;
|
|
7
|
+
}>): {
|
|
8
|
+
meta: {
|
|
9
|
+
component: any;
|
|
10
|
+
render: any;
|
|
11
|
+
argTypes: {
|
|
12
|
+
typography: {
|
|
13
|
+
control: string;
|
|
14
|
+
options: ("overline" | "caption" | "body1" | "body2" | "subtitle1" | "subtitle2" | "title" | "headline" | "display1")[];
|
|
15
|
+
};
|
|
16
|
+
color: {
|
|
17
|
+
control: string;
|
|
18
|
+
options: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey")[];
|
|
19
|
+
};
|
|
20
|
+
width: {
|
|
21
|
+
control: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
args: {
|
|
25
|
+
typography: "body1";
|
|
26
|
+
width?: import("csstype").Property.Width<string | number> | undefined;
|
|
27
|
+
color?: import("../../constants").ColorPalette | undefined;
|
|
28
|
+
ref?: import("../../types").CommonRef;
|
|
29
|
+
style?: import("react").CSSProperties | undefined;
|
|
30
|
+
theme?: import("../../constants").Theme | undefined;
|
|
31
|
+
className?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** Text Typography */
|
|
35
|
+
TextTypography: {
|
|
36
|
+
args: {
|
|
37
|
+
typography: "body1";
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
import { SkeletonTypographyProps } from './SkeletonTypography';
|
|
3
|
+
type SetupProps = Partial<SkeletonTypographyProps>;
|
|
4
|
+
/**
|
|
5
|
+
* Mounts the SkeletonTypography component and returns common DOM elements needed in tests.
|
|
6
|
+
*/
|
|
7
|
+
export declare const setup: (propsOverride: SetupProps | undefined, { render, ...options }: SetupOptions<SkeletonTypographyProps>) => {
|
|
8
|
+
skeletonTypography: HTMLElement;
|
|
9
|
+
inner: HTMLElement | null;
|
|
10
|
+
props: SkeletonTypographyProps;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: (renderOptions: SetupOptions<SkeletonTypographyProps>) => void;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { SkeletonCircle, type SkeletonCircleProps, COMPONENT_NAME as SKELETON_CIRCLE_COMPONENT_NAME, CLASSNAME as SKELETON_CIRCLE_CLASSNAME, DEFAULT_PROPS as SKELETON_CIRCLE_DEFAULT_PROPS, } from './SkeletonCircle';
|
|
2
|
+
export { SkeletonRectangle, type SkeletonRectangleProps, SkeletonRectangleVariant, COMPONENT_NAME as SKELETON_RECTANGLE_COMPONENT_NAME, CLASSNAME as SKELETON_RECTANGLE_CLASSNAME, DEFAULT_PROPS as SKELETON_RECTANGLE_DEFAULT_PROPS, } from './SkeletonRectangle';
|
|
3
|
+
export { SkeletonTypography, type SkeletonTypographyProps, COMPONENT_NAME as SKELETON_TYPOGRAPHY_COMPONENT_NAME, CLASSNAME as SKELETON_TYPOGRAPHY_CLASSNAME, DEFAULT_PROPS as SKELETON_TYPOGRAPHY_DEFAULT_PROPS, } from './SkeletonTypography';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
/**
|
|
3
|
+
* Setup Switch stories for a specific framework (React or Vue).
|
|
4
|
+
* This function creates all the stories with the appropriate decorators.
|
|
5
|
+
* Framework-specific render functions or args can be injected via `overrides`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setup({ component, render, decorators: { withCombinations }, }: SetupStoriesOptions<{
|
|
8
|
+
decorators: 'withCombinations';
|
|
9
|
+
}>): {
|
|
10
|
+
meta: {
|
|
11
|
+
component: any;
|
|
12
|
+
render: any;
|
|
13
|
+
argTypes: {
|
|
14
|
+
onChange: {
|
|
15
|
+
action: boolean;
|
|
16
|
+
};
|
|
17
|
+
name: {
|
|
18
|
+
control: boolean;
|
|
19
|
+
};
|
|
20
|
+
value: {
|
|
21
|
+
control: boolean;
|
|
22
|
+
};
|
|
23
|
+
position: {
|
|
24
|
+
control: string;
|
|
25
|
+
options: string[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
args: {
|
|
29
|
+
isChecked: boolean;
|
|
30
|
+
name: string;
|
|
31
|
+
value: string;
|
|
32
|
+
helper?: string | undefined;
|
|
33
|
+
id?: string | undefined;
|
|
34
|
+
label?: import("react").ReactNode;
|
|
35
|
+
inputProps?: Record<string, any> | undefined;
|
|
36
|
+
inputRef?: import("../../types").CommonRef;
|
|
37
|
+
inputId?: string | undefined;
|
|
38
|
+
onChange?: ((isChecked: boolean, value?: string, name?: string, event?: any) => void) | undefined;
|
|
39
|
+
position?: "left" | "right" | undefined;
|
|
40
|
+
ref?: import("../../types").CommonRef;
|
|
41
|
+
theme?: import("../../constants").Theme | undefined;
|
|
42
|
+
className?: string | undefined;
|
|
43
|
+
'aria-disabled'?: import("../../types/Booleanish").Booleanish | undefined;
|
|
44
|
+
isDisabled?: boolean | undefined;
|
|
45
|
+
disabled?: boolean | undefined;
|
|
46
|
+
checked?: boolean | undefined;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
/** Default switch */
|
|
50
|
+
Default: {};
|
|
51
|
+
/** With label and helper */
|
|
52
|
+
LabelAndHelper: {
|
|
53
|
+
argTypes: {
|
|
54
|
+
label: {
|
|
55
|
+
control: string;
|
|
56
|
+
};
|
|
57
|
+
helper: {
|
|
58
|
+
control: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
args: {
|
|
62
|
+
label: string;
|
|
63
|
+
helper: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
/** With position right */
|
|
67
|
+
PositionRight: {
|
|
68
|
+
argTypes: {
|
|
69
|
+
position: {
|
|
70
|
+
control: boolean;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
args: {
|
|
74
|
+
label: string;
|
|
75
|
+
position: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/** Disabled */
|
|
79
|
+
Disabled: {
|
|
80
|
+
argTypes: {
|
|
81
|
+
isDisabled: {
|
|
82
|
+
control: boolean;
|
|
83
|
+
};
|
|
84
|
+
'aria-disabled': {
|
|
85
|
+
control: boolean;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
args: {
|
|
89
|
+
label: string;
|
|
90
|
+
helper: string;
|
|
91
|
+
};
|
|
92
|
+
decorators: ((story: any, context: any) => any)[];
|
|
93
|
+
};
|
|
94
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
import { SwitchProps } from '.';
|
|
3
|
+
type SetupProps = Partial<SwitchProps>;
|
|
4
|
+
/**
|
|
5
|
+
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
6
|
+
*/
|
|
7
|
+
export declare const setup: (propsOverride: SetupProps | undefined, { render, ...options }: SetupOptions<SwitchProps>) => {
|
|
8
|
+
switchWrapper: HTMLElement;
|
|
9
|
+
helper: HTMLElement | null;
|
|
10
|
+
label: HTMLElement | null;
|
|
11
|
+
input: HTMLElement;
|
|
12
|
+
props: SwitchProps;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: (renderOptions: SetupOptions<SwitchProps>) => void;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { JSXElement, LumxClassName, HasTheme, HasAriaDisabled, HasDisabled, HasClassName, HasChecked, CommonRef } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the props of the component.
|
|
4
|
+
*/
|
|
5
|
+
export interface SwitchProps extends HasTheme, HasClassName, HasAriaDisabled, HasDisabled, HasChecked {
|
|
6
|
+
/** Helper text. */
|
|
7
|
+
helper?: string;
|
|
8
|
+
/** Native input id property. */
|
|
9
|
+
id?: string;
|
|
10
|
+
/** Label text. */
|
|
11
|
+
label?: JSXElement;
|
|
12
|
+
/** Native input name property. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Native input value property. */
|
|
15
|
+
value?: string;
|
|
16
|
+
/** optional props for input */
|
|
17
|
+
inputProps?: Record<string, any>;
|
|
18
|
+
/** Native input ref. */
|
|
19
|
+
inputRef?: CommonRef;
|
|
20
|
+
/** Native input id. */
|
|
21
|
+
inputId: string;
|
|
22
|
+
/** On change callback. */
|
|
23
|
+
onChange?(isChecked: boolean, value?: string, name?: string, event?: any): void;
|
|
24
|
+
/** Position of the switch relative to the label. */
|
|
25
|
+
position?: 'left' | 'right';
|
|
26
|
+
/** reference to the root element */
|
|
27
|
+
ref?: CommonRef;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Component display name.
|
|
31
|
+
*/
|
|
32
|
+
export declare const COMPONENT_NAME = "Switch";
|
|
33
|
+
/**
|
|
34
|
+
* Component default class name and class prefix.
|
|
35
|
+
*/
|
|
36
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
37
|
+
/**
|
|
38
|
+
* Component default props.
|
|
39
|
+
*/
|
|
40
|
+
export declare const DEFAULT_PROPS: Partial<SwitchProps>;
|
|
41
|
+
/**
|
|
42
|
+
* Switch component.
|
|
43
|
+
*
|
|
44
|
+
* @param props Component props.
|
|
45
|
+
* @return JSX element.
|
|
46
|
+
*/
|
|
47
|
+
export declare const Switch: (props: SwitchProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '../../../stories/types';
|
|
2
|
+
export declare function setup({ component, overrides, }: SetupStoriesOptions<{
|
|
3
|
+
overrides: 'Default' | 'WithHeader';
|
|
4
|
+
decorators?: never;
|
|
5
|
+
}>): {
|
|
6
|
+
meta: {
|
|
7
|
+
component: any;
|
|
8
|
+
args: {
|
|
9
|
+
hasBefore: boolean;
|
|
10
|
+
hasDividers: boolean;
|
|
11
|
+
children?: import("react").ReactNode;
|
|
12
|
+
ref?: import("../../types").CommonRef;
|
|
13
|
+
theme?: import("../../constants").Theme | undefined;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/** Simple table */
|
|
18
|
+
Default: {
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
};
|
|
21
|
+
/** Table with header */
|
|
22
|
+
WithHeader: {
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { JSXElement, HasClassName, CommonRef, ValueOf } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Table head cell sort order.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ThOrder: {
|
|
6
|
+
readonly asc: "asc";
|
|
7
|
+
readonly desc: "desc";
|
|
8
|
+
};
|
|
9
|
+
export type ThOrder = ValueOf<typeof ThOrder>;
|
|
10
|
+
/**
|
|
11
|
+
* Table cell variants.
|
|
12
|
+
*/
|
|
13
|
+
export declare const TableCellVariant: {
|
|
14
|
+
readonly body: "body";
|
|
15
|
+
readonly head: "head";
|
|
16
|
+
};
|
|
17
|
+
export type TableCellVariant = ValueOf<typeof TableCellVariant>;
|
|
18
|
+
/**
|
|
19
|
+
* Defines the props of the component.
|
|
20
|
+
*/
|
|
21
|
+
export interface TableCellProps extends HasClassName {
|
|
22
|
+
/** Icon (SVG path).(thead only). */
|
|
23
|
+
icon?: string;
|
|
24
|
+
/** Whether the column is sortable or not (thead only). */
|
|
25
|
+
isSortable?: boolean;
|
|
26
|
+
/** Sort order displayed as icon (sortable thead only). */
|
|
27
|
+
sortOrder?: ThOrder;
|
|
28
|
+
/** Variant. */
|
|
29
|
+
variant?: TableCellVariant;
|
|
30
|
+
/** On header cell click callback. */
|
|
31
|
+
onHeaderClick?(): void;
|
|
32
|
+
/** Children */
|
|
33
|
+
children?: JSXElement;
|
|
34
|
+
/** reference to the root element */
|
|
35
|
+
ref?: CommonRef;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Component display name.
|
|
39
|
+
*/
|
|
40
|
+
export declare const COMPONENT_NAME = "TableCell";
|
|
41
|
+
/**
|
|
42
|
+
* Component default class name and class prefix.
|
|
43
|
+
*/
|
|
44
|
+
export declare const CLASSNAME: string;
|
|
45
|
+
/**
|
|
46
|
+
* Component default props.
|
|
47
|
+
*/
|
|
48
|
+
export declare const DEFAULT_PROPS: Partial<TableCellProps>;
|
|
49
|
+
/**
|
|
50
|
+
* TableCell component.
|
|
51
|
+
*
|
|
52
|
+
* @param props Component props.
|
|
53
|
+
* @return React element.
|
|
54
|
+
*/
|
|
55
|
+
export declare const TableCell: (props: TableCellProps) => import("react").JSX.Element;
|