@lumx/core 4.3.2-alpha.44 → 4.3.2-alpha.46
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.
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
-
import { ColorVariant } from '
|
|
3
|
-
|
|
4
|
-
|
|
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<{
|
|
2
|
+
import { ColorVariant } from '../../constants';
|
|
3
|
+
export declare function setup({ component, render, decorators: { withCombinations }, overrides, }: SetupStoriesOptions<{
|
|
4
|
+
overrides: 'AllStates';
|
|
9
5
|
decorators: 'withCombinations';
|
|
10
6
|
}>): {
|
|
11
7
|
meta: {
|
|
12
8
|
component: any;
|
|
13
9
|
render: any;
|
|
14
10
|
argTypes: {
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
color: {
|
|
12
|
+
control: {
|
|
13
|
+
type: "select" | "inline-radio";
|
|
14
|
+
};
|
|
15
|
+
options: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined)[];
|
|
16
|
+
mapping: Record<string, "light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined> | undefined;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
control:
|
|
18
|
+
colorVariant: {
|
|
19
|
+
control: {
|
|
20
|
+
type: "select" | "inline-radio";
|
|
21
|
+
};
|
|
22
|
+
options: ("D1" | "D2" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "N")[];
|
|
23
|
+
mapping: Record<string, "D1" | "D2" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "N"> | undefined;
|
|
20
24
|
};
|
|
21
25
|
};
|
|
22
26
|
args: {
|
|
23
|
-
|
|
24
|
-
color?: import("
|
|
27
|
+
children: string;
|
|
28
|
+
color?: import("../../constants").ColorWithVariants | undefined;
|
|
25
29
|
colorVariant?: ColorVariant | undefined;
|
|
26
30
|
href?: string | undefined;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
rightIcon?: string | undefined;
|
|
30
|
-
target?: string | undefined;
|
|
31
|
-
typography?: string | undefined;
|
|
31
|
+
isDisabled?: boolean | undefined;
|
|
32
|
+
linkAs?: string | any;
|
|
32
33
|
handleClick?: ((event: any) => void) | undefined;
|
|
34
|
+
target?: string | undefined;
|
|
35
|
+
typography?: import("../../constants").Typography | undefined;
|
|
33
36
|
ref?: import("../../types").CommonRef;
|
|
34
|
-
theme?: import("@lumx/core/js/constants").Theme | undefined;
|
|
35
37
|
className?: string | undefined;
|
|
36
38
|
'aria-disabled'?: import("../../types/Booleanish").Booleanish | undefined;
|
|
37
|
-
isDisabled?: boolean | undefined;
|
|
38
39
|
disabled?: boolean | undefined;
|
|
39
40
|
};
|
|
40
41
|
};
|
|
@@ -45,49 +46,20 @@ export declare function setup({ component, render, decorators: { withCombination
|
|
|
45
46
|
target: string;
|
|
46
47
|
};
|
|
47
48
|
};
|
|
48
|
-
/**
|
|
49
|
-
|
|
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: {
|
|
49
|
+
/** Show all color combinations */
|
|
50
|
+
AllColors: {
|
|
71
51
|
argTypes: {
|
|
72
|
-
|
|
52
|
+
color: {
|
|
73
53
|
control: boolean;
|
|
74
54
|
};
|
|
75
|
-
|
|
55
|
+
colorVariant: {
|
|
76
56
|
control: boolean;
|
|
77
57
|
};
|
|
78
58
|
};
|
|
79
|
-
args: {
|
|
80
|
-
label: string;
|
|
81
|
-
};
|
|
82
59
|
decorators: ((story: any, context: any) => any)[];
|
|
83
60
|
};
|
|
84
|
-
/**
|
|
61
|
+
/** Show state combinations */
|
|
85
62
|
AllStates: {
|
|
86
|
-
|
|
87
|
-
isDisabled: {
|
|
88
|
-
control: boolean;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
decorators: ((story: any, context: any) => any)[];
|
|
63
|
+
[x: string]: any;
|
|
92
64
|
};
|
|
93
65
|
};
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { SetupOptions } from '../../../testing';
|
|
2
|
-
|
|
3
|
-
|
|
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>) => {
|
|
2
|
+
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
3
|
+
props: any;
|
|
8
4
|
link: HTMLElement;
|
|
9
|
-
|
|
10
|
-
leftIcon: HTMLElement | null;
|
|
11
|
-
content: HTMLElement | null;
|
|
12
|
-
props: LinkProps;
|
|
5
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
13
6
|
};
|
|
14
|
-
declare const _default: (renderOptions: SetupOptions<
|
|
7
|
+
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
15
8
|
export default _default;
|
|
@@ -1,36 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { CommonRef, HasDisabled, JSXElement, LumxClassName } from '../../types';
|
|
2
|
+
import { HasAriaDisabled, HasClassName } from '../../types';
|
|
3
|
+
import { ColorVariant, ColorWithVariants, Typography } from '../../constants';
|
|
3
4
|
/**
|
|
4
5
|
* Defines the props of the component.
|
|
5
6
|
*/
|
|
6
|
-
export interface LinkProps extends
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
export interface LinkProps extends HasClassName, HasAriaDisabled, HasDisabled {
|
|
8
|
+
/** Children content */
|
|
9
|
+
children?: JSXElement;
|
|
9
10
|
/** Color variant. */
|
|
10
11
|
color?: ColorWithVariants;
|
|
11
12
|
/** Lightened or darkened variant of the selected icon color. */
|
|
12
13
|
colorVariant?: ColorVariant;
|
|
13
14
|
/** Link href. */
|
|
14
15
|
href?: string;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
as?: string | any;
|
|
22
|
-
/**
|
|
23
|
-
* Right icon (SVG path).
|
|
24
|
-
* @deprecated Instead, simply nest `<Icon />` in the label
|
|
25
|
-
*/
|
|
26
|
-
rightIcon?: string;
|
|
16
|
+
/** Whether the component is disabled or not. */
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
/** Custom element/component for the link. */
|
|
19
|
+
linkAs?: string | any;
|
|
20
|
+
/** Click handler (framework wrappers convert onClick to handleClick). */
|
|
21
|
+
handleClick?: (event: any) => void;
|
|
27
22
|
/** Link target. */
|
|
28
23
|
target?: string;
|
|
29
24
|
/** Typography variant. */
|
|
30
|
-
typography?:
|
|
31
|
-
/**
|
|
32
|
-
handleClick?: (event: any) => void;
|
|
33
|
-
/** Reference to the root element. */
|
|
25
|
+
typography?: Typography;
|
|
26
|
+
/** Element ref. */
|
|
34
27
|
ref?: CommonRef;
|
|
35
28
|
}
|
|
36
29
|
/**
|
|
@@ -46,7 +39,7 @@ export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
|
46
39
|
*/
|
|
47
40
|
export declare const DEFAULT_PROPS: Partial<LinkProps>;
|
|
48
41
|
/**
|
|
49
|
-
* Link component
|
|
42
|
+
* Link component.
|
|
50
43
|
*
|
|
51
44
|
* @param props Component props.
|
|
52
45
|
* @return JSX element.
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/lumapps/design-system/issues"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@lumx/icons": "^4.3.2-alpha.
|
|
9
|
+
"@lumx/icons": "^4.3.2-alpha.46",
|
|
10
10
|
"classnames": "^2.3.2",
|
|
11
11
|
"focus-visible": "^5.0.2",
|
|
12
12
|
"lodash": "4.17.23",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
67
67
|
},
|
|
68
68
|
"sideEffects": false,
|
|
69
|
-
"version": "4.3.2-alpha.
|
|
69
|
+
"version": "4.3.2-alpha.46",
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
72
72
|
"@testing-library/dom": "^10.4.1",
|