@lumx/core 4.3.2-alpha.11 → 4.3.2-alpha.13
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/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 +168 -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/constants/enums/index.d.ts +0 -9
- package/js/constants/enums/index.js +1 -10
- package/js/constants/index.js +1 -1
- package/js/types/index.d.ts +0 -1
- package/js/utils/classNames/bem/block.d.ts +2 -3
- package/js/utils/classNames/bem/element.d.ts +2 -3
- package/js/utils/classNames/bem/index.d.ts +4 -5
- package/lumx.css +0 -94
- package/package.json +23 -2
- package/scss/_components.scss +0 -1
- package/scss/lumx.scss +0 -1
- 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 +47 -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/types/PartialBy.d.ts +0 -12
- package/js/types/index.js +0 -1
- package/js/utils/disabledState/index.js +0 -12
- package/js/utils/events/index.js +0 -2
- package/scss/components/combobox/_index.scss +0 -86
- package/scss/components/combobox/_mixins.scss +0 -63
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Kind } from '../../constants';
|
|
2
|
+
import type { LumxClassName, HasTheme, JSXElement, HasClassName, CommonRef } from '../../types';
|
|
3
|
+
export declare const COMPONENT_NAME = "InputHelper";
|
|
4
|
+
export declare const InputHelperClassName: LumxClassName<typeof COMPONENT_NAME>;
|
|
5
|
+
/**
|
|
6
|
+
* Defines the props of the component.
|
|
7
|
+
*/
|
|
8
|
+
export interface InputHelperProps extends HasClassName, HasTheme {
|
|
9
|
+
/** Helper content. */
|
|
10
|
+
children: JSXElement;
|
|
11
|
+
/** Helper variant. */
|
|
12
|
+
kind?: Kind;
|
|
13
|
+
/** ref to the root element `p` */
|
|
14
|
+
ref?: CommonRef;
|
|
15
|
+
/** id for the input helper */
|
|
16
|
+
id?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* InputHelper component.
|
|
20
|
+
*/
|
|
21
|
+
export declare function InputHelper(props: InputHelperProps): import("react").JSX.Element;
|
|
22
|
+
export declare namespace InputHelper {
|
|
23
|
+
var displayName: string;
|
|
24
|
+
var className: "lumx-input-helper";
|
|
25
|
+
var defaultProps: Partial<InputHelperProps>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
/**
|
|
3
|
+
* Setup InputLabel 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 }: SetupStoriesOptions): {
|
|
8
|
+
meta: {
|
|
9
|
+
component: any;
|
|
10
|
+
render: any;
|
|
11
|
+
args: {
|
|
12
|
+
children: string;
|
|
13
|
+
};
|
|
14
|
+
argTypes: {
|
|
15
|
+
isRequired: {
|
|
16
|
+
control: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/** Default input label */
|
|
21
|
+
Default: {};
|
|
22
|
+
/** Required input label */
|
|
23
|
+
IsRequired: {
|
|
24
|
+
args: {
|
|
25
|
+
isRequired: boolean;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/** Default input label with custom typography */
|
|
29
|
+
WithCustomTypography: {
|
|
30
|
+
args: {
|
|
31
|
+
typography: "subtitle1";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
import { InputLabelProps } from '.';
|
|
3
|
+
type SetupProps = Partial<InputLabelProps>;
|
|
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<InputLabelProps>) => {
|
|
8
|
+
label: HTMLElement;
|
|
9
|
+
props: InputLabelProps;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: (renderOptions: SetupOptions<InputLabelProps>) => void;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LumxClassName, HasTheme, JSXElement, HasClassName, CommonRef } from '../../types';
|
|
2
|
+
import { Typography } from '../../constants';
|
|
3
|
+
export declare const COMPONENT_NAME = "InputLabel";
|
|
4
|
+
export declare const InputLabelClassName: LumxClassName<typeof COMPONENT_NAME>;
|
|
5
|
+
export interface InputLabelProps extends HasClassName, HasTheme {
|
|
6
|
+
/** Typography variant. */
|
|
7
|
+
typography?: Typography;
|
|
8
|
+
/** Label content. */
|
|
9
|
+
children: JSXElement;
|
|
10
|
+
/** Native htmlFor property. */
|
|
11
|
+
htmlFor: string;
|
|
12
|
+
/** Whether the component is required or not. */
|
|
13
|
+
isRequired?: boolean;
|
|
14
|
+
/** ref to the root element */
|
|
15
|
+
ref?: CommonRef;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* InputLabel component.
|
|
19
|
+
*/
|
|
20
|
+
export declare function InputLabel(props: InputLabelProps): import("react").JSX.Element;
|
|
21
|
+
export declare namespace InputLabel {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
var className: "lumx-input-label";
|
|
24
|
+
var defaultProps: Partial<InputLabelProps>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
import { ColorVariant } from '@lumx/core/js/constants';
|
|
3
|
+
/**
|
|
4
|
+
* Setup Link stories for a specific framework (React or Vue).
|
|
5
|
+
* This function creates all the stories with the appropriate decorators.
|
|
6
|
+
* Framework-specific render functions or args can be injected via `overrides`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setup({ component, render, decorators: { withCombinations }, }: SetupStoriesOptions<{
|
|
9
|
+
decorators: 'withCombinations';
|
|
10
|
+
}>): {
|
|
11
|
+
meta: {
|
|
12
|
+
component: any;
|
|
13
|
+
render: any;
|
|
14
|
+
argTypes: {
|
|
15
|
+
onClick: {
|
|
16
|
+
action: boolean;
|
|
17
|
+
};
|
|
18
|
+
typography: {
|
|
19
|
+
control: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
args: {
|
|
23
|
+
label: string;
|
|
24
|
+
color?: import("@lumx/core/js/constants").ColorWithVariants | undefined;
|
|
25
|
+
colorVariant?: ColorVariant | undefined;
|
|
26
|
+
href?: string | undefined;
|
|
27
|
+
leftIcon?: string | undefined;
|
|
28
|
+
as?: string | any;
|
|
29
|
+
rightIcon?: string | undefined;
|
|
30
|
+
target?: string | undefined;
|
|
31
|
+
typography?: string | undefined;
|
|
32
|
+
onClick?: ((event: any) => void) | undefined;
|
|
33
|
+
ref?: import("../../types").CommonRef;
|
|
34
|
+
theme?: import("@lumx/core/js/constants").Theme | undefined;
|
|
35
|
+
className?: string | undefined;
|
|
36
|
+
'aria-disabled'?: import("../../types/Booleanish").Booleanish | undefined;
|
|
37
|
+
isDisabled?: boolean | undefined;
|
|
38
|
+
disabled?: boolean | undefined;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/** Default link */
|
|
42
|
+
Default: {
|
|
43
|
+
args: {
|
|
44
|
+
href: string;
|
|
45
|
+
target: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** Link as button */
|
|
49
|
+
AsButton: {
|
|
50
|
+
args: {
|
|
51
|
+
label: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
/** With typography */
|
|
55
|
+
WithTypography: {
|
|
56
|
+
args: {
|
|
57
|
+
href: string;
|
|
58
|
+
typography: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
/** With color */
|
|
62
|
+
WithColor: {
|
|
63
|
+
args: {
|
|
64
|
+
href: string;
|
|
65
|
+
color: "primary";
|
|
66
|
+
colorVariant: "D1";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
/** Disabled states */
|
|
70
|
+
Disabled: {
|
|
71
|
+
argTypes: {
|
|
72
|
+
isDisabled: {
|
|
73
|
+
control: boolean;
|
|
74
|
+
};
|
|
75
|
+
'aria-disabled': {
|
|
76
|
+
control: boolean;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
args: {
|
|
80
|
+
label: string;
|
|
81
|
+
};
|
|
82
|
+
decorators: ((story: any, context: any) => any)[];
|
|
83
|
+
};
|
|
84
|
+
/** All states */
|
|
85
|
+
AllStates: {
|
|
86
|
+
argTypes: {
|
|
87
|
+
isDisabled: {
|
|
88
|
+
control: boolean;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
decorators: ((story: any, context: any) => any)[];
|
|
92
|
+
};
|
|
93
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
import { LinkProps } from '.';
|
|
3
|
+
type SetupProps = Partial<LinkProps>;
|
|
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<LinkProps>) => {
|
|
8
|
+
link: HTMLElement;
|
|
9
|
+
rightIcon: HTMLElement | null;
|
|
10
|
+
leftIcon: HTMLElement | null;
|
|
11
|
+
content: HTMLElement | null;
|
|
12
|
+
props: LinkProps;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: (renderOptions: SetupOptions<LinkProps>) => void;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ColorVariant, ColorWithVariants } from '@lumx/core/js/constants';
|
|
2
|
+
import type { JSXElement, LumxClassName, HasTheme, HasClassName, CommonRef, HasAriaDisabled, HasDisabled } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the props of the component.
|
|
5
|
+
*/
|
|
6
|
+
export interface LinkProps extends HasTheme, HasClassName, HasAriaDisabled, HasDisabled {
|
|
7
|
+
/** Link label content. */
|
|
8
|
+
label?: JSXElement;
|
|
9
|
+
/** Color variant. */
|
|
10
|
+
color?: ColorWithVariants;
|
|
11
|
+
/** Lightened or darkened variant of the selected icon color. */
|
|
12
|
+
colorVariant?: ColorVariant;
|
|
13
|
+
/** Link href. */
|
|
14
|
+
href?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Left icon (SVG path).
|
|
17
|
+
* @deprecated Instead, simply nest `<Icon />` in the label
|
|
18
|
+
*/
|
|
19
|
+
leftIcon?: string;
|
|
20
|
+
/** Element type or custom component for the link. */
|
|
21
|
+
as?: string | any;
|
|
22
|
+
/**
|
|
23
|
+
* Right icon (SVG path).
|
|
24
|
+
* @deprecated Instead, simply nest `<Icon />` in the label
|
|
25
|
+
*/
|
|
26
|
+
rightIcon?: string;
|
|
27
|
+
/** Link target. */
|
|
28
|
+
target?: string;
|
|
29
|
+
/** Typography variant. */
|
|
30
|
+
typography?: string;
|
|
31
|
+
/** Click handler. */
|
|
32
|
+
onClick?: (event: any) => void;
|
|
33
|
+
/** Reference to the root element. */
|
|
34
|
+
ref?: CommonRef;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Component display name.
|
|
38
|
+
*/
|
|
39
|
+
export declare const COMPONENT_NAME = "Link";
|
|
40
|
+
/**
|
|
41
|
+
* Component default class name and class prefix.
|
|
42
|
+
*/
|
|
43
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
44
|
+
/**
|
|
45
|
+
* Component default props.
|
|
46
|
+
*/
|
|
47
|
+
export declare const DEFAULT_PROPS: Partial<LinkProps>;
|
|
48
|
+
/**
|
|
49
|
+
* Link component (Core UI).
|
|
50
|
+
*
|
|
51
|
+
* @param props Component props.
|
|
52
|
+
* @return JSX element.
|
|
53
|
+
*/
|
|
54
|
+
export declare const Link: (props: LinkProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
/**
|
|
3
|
+
* Setup Message 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 }, overrides, }: SetupStoriesOptions<{
|
|
8
|
+
overrides: 'ClosableMessage';
|
|
9
|
+
decorators: 'withCombinations';
|
|
10
|
+
}>): {
|
|
11
|
+
meta: {
|
|
12
|
+
component: any;
|
|
13
|
+
render: any;
|
|
14
|
+
argTypes: {
|
|
15
|
+
kind: {
|
|
16
|
+
control: {
|
|
17
|
+
type: "select" | "inline-radio";
|
|
18
|
+
};
|
|
19
|
+
options: ("info" | "success" | "warning" | "error")[];
|
|
20
|
+
mapping: Record<string, "info" | "success" | "warning" | "error"> | undefined;
|
|
21
|
+
};
|
|
22
|
+
hasBackground: {
|
|
23
|
+
control: string;
|
|
24
|
+
};
|
|
25
|
+
icon: {
|
|
26
|
+
control: {
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
options: {
|
|
30
|
+
undefined: undefined;
|
|
31
|
+
mdiAbTesting: string;
|
|
32
|
+
mdiAbjadArabic: string;
|
|
33
|
+
mdiAccount: string;
|
|
34
|
+
mdiAccountBox: string;
|
|
35
|
+
mdiAlert: string;
|
|
36
|
+
mdiAlertCircle: string;
|
|
37
|
+
mdiArrowDown: string;
|
|
38
|
+
mdiArrowUp: string;
|
|
39
|
+
mdiAtom: string;
|
|
40
|
+
mdiBee: string;
|
|
41
|
+
mdiBell: string;
|
|
42
|
+
mdiBullhornOutline: string;
|
|
43
|
+
mdiCheck: string;
|
|
44
|
+
mdiCheckCircle: string;
|
|
45
|
+
mdiChevronDown: string;
|
|
46
|
+
mdiChevronLeft: string;
|
|
47
|
+
mdiChevronRight: string;
|
|
48
|
+
mdiChevronUp: string;
|
|
49
|
+
mdiClose: string;
|
|
50
|
+
mdiCloseCircle: string;
|
|
51
|
+
mdiDelete: string;
|
|
52
|
+
mdiDotsHorizontal: string;
|
|
53
|
+
mdiDragVertical: string;
|
|
54
|
+
mdiEarth: string;
|
|
55
|
+
mdiEmail: string;
|
|
56
|
+
mdiEye: string;
|
|
57
|
+
mdiFileEdit: string;
|
|
58
|
+
mdiFlag: string;
|
|
59
|
+
mdiFolder: string;
|
|
60
|
+
mdiFolderGoogleDrive: string;
|
|
61
|
+
mdiFoodApple: string;
|
|
62
|
+
mdiGoogleCirclesExtended: string;
|
|
63
|
+
mdiHeart: string;
|
|
64
|
+
mdiHome: string;
|
|
65
|
+
mdiImageBroken: string;
|
|
66
|
+
mdiInformation: string;
|
|
67
|
+
mdiLink: string;
|
|
68
|
+
mdiMagnifyMinusOutline: string;
|
|
69
|
+
mdiMagnifyPlusOutline: string;
|
|
70
|
+
mdiMenuDown: string;
|
|
71
|
+
mdiMessageTextOutline: string;
|
|
72
|
+
mdiMinus: string;
|
|
73
|
+
mdiOpenInNew: string;
|
|
74
|
+
mdiPauseCircleOutline: string;
|
|
75
|
+
mdiPencil: string;
|
|
76
|
+
mdiPlay: string;
|
|
77
|
+
mdiPlayCircleOutline: string;
|
|
78
|
+
mdiPlus: string;
|
|
79
|
+
mdiRadioboxBlank: string;
|
|
80
|
+
mdiRadioboxMarked: string;
|
|
81
|
+
mdiReply: string;
|
|
82
|
+
mdiSend: string;
|
|
83
|
+
mdiStar: string;
|
|
84
|
+
mdiTextBox: string;
|
|
85
|
+
mdiTextBoxPlus: string;
|
|
86
|
+
mdiTram: string;
|
|
87
|
+
mdiTranslate: string;
|
|
88
|
+
mdiViewList: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
args: {
|
|
93
|
+
children: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
/** Default message */
|
|
97
|
+
Default: {};
|
|
98
|
+
/** All `kind` variants */
|
|
99
|
+
AllKinds: {
|
|
100
|
+
decorators: ((story: any, context: any) => any)[];
|
|
101
|
+
};
|
|
102
|
+
/** All `kind` variants with `hasBackground` */
|
|
103
|
+
AllKindsWithBackground: {
|
|
104
|
+
args: {
|
|
105
|
+
hasBackground: boolean;
|
|
106
|
+
};
|
|
107
|
+
decorators: ((story: any, context: any) => any)[];
|
|
108
|
+
};
|
|
109
|
+
/** With custom icon */
|
|
110
|
+
CustomIcon: {
|
|
111
|
+
args: {
|
|
112
|
+
icon: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
/** With close button (has background and kind info) */
|
|
116
|
+
ClosableMessage: {
|
|
117
|
+
args: any;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
import { MessageProps } from '.';
|
|
3
|
+
type SetupProps = Partial<MessageProps>;
|
|
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<MessageProps>) => {
|
|
8
|
+
message: HTMLElement;
|
|
9
|
+
icon: HTMLElement | null;
|
|
10
|
+
closeButton: HTMLElement | null;
|
|
11
|
+
props: MessageProps;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: (renderOptions: SetupOptions<MessageProps>) => void;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Kind } from '../../constants';
|
|
2
|
+
import type { JSXElement, LumxClassName, HasClassName, CommonRef } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the props of the component.
|
|
5
|
+
*/
|
|
6
|
+
export interface MessageProps extends HasClassName {
|
|
7
|
+
/** Content. */
|
|
8
|
+
children?: JSXElement;
|
|
9
|
+
/** Whether the message has a background or not. */
|
|
10
|
+
hasBackground?: boolean;
|
|
11
|
+
/** Message variant. */
|
|
12
|
+
kind?: Kind;
|
|
13
|
+
/** Message custom icon SVG path. */
|
|
14
|
+
icon?: string;
|
|
15
|
+
/** Reference to the message container element. */
|
|
16
|
+
ref?: CommonRef;
|
|
17
|
+
/**
|
|
18
|
+
* Displays a close button.
|
|
19
|
+
*
|
|
20
|
+
* NB: only available if `kind === 'info' && hasBackground === true`
|
|
21
|
+
*/
|
|
22
|
+
closeButtonProps?: {
|
|
23
|
+
/** The callback called when the button is clicked */
|
|
24
|
+
onClick: () => void;
|
|
25
|
+
/** The label of the close button. */
|
|
26
|
+
label: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Component display name.
|
|
31
|
+
*/
|
|
32
|
+
export declare const COMPONENT_NAME = "Message";
|
|
33
|
+
/**
|
|
34
|
+
* Component default class name and class prefix.
|
|
35
|
+
*/
|
|
36
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
37
|
+
export declare const block: {
|
|
38
|
+
(additionalClasses: string[]): string;
|
|
39
|
+
(modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: string[]): string;
|
|
40
|
+
}, element: {
|
|
41
|
+
(elem: string, additionalClasses: string[]): string;
|
|
42
|
+
(elem: string, modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: string[]): string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Associative map from message kind to color and icon.
|
|
46
|
+
*/
|
|
47
|
+
export declare const CONFIG: {
|
|
48
|
+
error: {
|
|
49
|
+
color: "red";
|
|
50
|
+
icon: string;
|
|
51
|
+
};
|
|
52
|
+
info: {
|
|
53
|
+
color: "blue";
|
|
54
|
+
icon: string;
|
|
55
|
+
};
|
|
56
|
+
success: {
|
|
57
|
+
color: "green";
|
|
58
|
+
icon: string;
|
|
59
|
+
};
|
|
60
|
+
warning: {
|
|
61
|
+
color: "yellow";
|
|
62
|
+
icon: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Message component.
|
|
67
|
+
*
|
|
68
|
+
* @param props Component props.
|
|
69
|
+
* @return JSX element.
|
|
70
|
+
*/
|
|
71
|
+
export declare const Message: {
|
|
72
|
+
(props: MessageProps): import("react").JSX.Element;
|
|
73
|
+
displayName: string;
|
|
74
|
+
className: "lumx-message";
|
|
75
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
/**
|
|
3
|
+
* Setup RadioButton 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
|
+
};
|
|
24
|
+
args: {
|
|
25
|
+
isChecked: boolean;
|
|
26
|
+
name: string;
|
|
27
|
+
value: string;
|
|
28
|
+
helper?: string | undefined;
|
|
29
|
+
id?: string | undefined;
|
|
30
|
+
label?: import("react").ReactNode;
|
|
31
|
+
inputProps?: Record<string, any> | undefined;
|
|
32
|
+
inputRef?: import("../../types").CommonRef;
|
|
33
|
+
inputId?: string | undefined;
|
|
34
|
+
onChange?: ((value?: string, name?: string, event?: any) => void) | undefined;
|
|
35
|
+
ref?: import("../../types").CommonRef;
|
|
36
|
+
theme?: import("../../constants").Theme | undefined;
|
|
37
|
+
className?: string | undefined;
|
|
38
|
+
'aria-disabled'?: import("../../types/Booleanish").Booleanish | undefined;
|
|
39
|
+
isDisabled?: boolean | undefined;
|
|
40
|
+
disabled?: boolean | undefined;
|
|
41
|
+
checked?: boolean | undefined;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/** Default radio button */
|
|
45
|
+
Default: {};
|
|
46
|
+
/** With label and helper */
|
|
47
|
+
LabelAndHelper: {
|
|
48
|
+
argTypes: {
|
|
49
|
+
label: {
|
|
50
|
+
control: string;
|
|
51
|
+
};
|
|
52
|
+
helper: {
|
|
53
|
+
control: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
args: {
|
|
57
|
+
label: string;
|
|
58
|
+
helper: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
/** Disabled */
|
|
62
|
+
Disabled: {
|
|
63
|
+
argTypes: {
|
|
64
|
+
isDisabled: {
|
|
65
|
+
control: boolean;
|
|
66
|
+
};
|
|
67
|
+
'aria-disabled': {
|
|
68
|
+
control: boolean;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
args: {
|
|
72
|
+
label: string;
|
|
73
|
+
helper: string;
|
|
74
|
+
};
|
|
75
|
+
decorators: ((story: any, context: any) => any)[];
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -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;
|