@lumx/core 4.3.2-alpha.17 → 4.3.2-alpha.18
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/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/PartialBy.d.ts +12 -0
- package/js/types/index.d.ts +1 -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/js/utils/events/index.js +2 -0
- package/package.json +2 -28
- package/js/components/Badge/BadgeWrapper.d.ts +0 -13
- package/js/components/Badge/BadgeWrapperStories.d.ts +0 -29
- package/js/components/Badge/BadgeWrapperTests.d.ts +0 -9
- package/js/components/Badge/Stories.d.ts +0 -52
- package/js/components/Badge/Tests.d.ts +0 -12
- package/js/components/Badge/index.d.ts +0 -37
- package/js/components/Button/Button.d.ts +0 -48
- package/js/components/Button/ButtonGroup.d.ts +0 -36
- package/js/components/Button/ButtonGroupStories.d.ts +0 -37
- package/js/components/Button/ButtonRoot.d.ts +0 -55
- package/js/components/Button/ButtonRootTests.d.ts +0 -12
- package/js/components/Button/IconButton.d.ts +0 -45
- package/js/components/Button/IconButtonStories.d.ts +0 -211
- package/js/components/Button/IconButtonTests.d.ts +0 -15
- package/js/components/Button/Stories.d.ts +0 -301
- package/js/components/Button/Tests.d.ts +0 -15
- package/js/components/Checkbox/Stories.d.ts +0 -88
- package/js/components/Checkbox/Tests.d.ts +0 -15
- package/js/components/Checkbox/index.d.ts +0 -49
- package/js/components/Divider/Stories.d.ts +0 -21
- package/js/components/Divider/Tests.d.ts +0 -12
- package/js/components/Divider/index.d.ts +0 -27
- package/js/components/Flag/Stories.d.ts +0 -120
- package/js/components/Flag/Tests.d.ts +0 -14
- package/js/components/Flag/index.d.ts +0 -34
- package/js/components/FlexBox/Stories.d.ts +0 -108
- package/js/components/FlexBox/Tests.d.ts +0 -13
- package/js/components/FlexBox/constants.d.ts +0 -4
- package/js/components/FlexBox/index.d.ts +0 -50
- package/js/components/FlexBox/types.d.ts +0 -7
- package/js/components/Heading/Stories.d.ts +0 -89
- package/js/components/Heading/Tests.d.ts +0 -11
- package/js/components/Heading/constants.d.ts +0 -21
- package/js/components/Heading/index.d.ts +0 -44
- package/js/components/Heading/utils.d.ts +0 -8
- package/js/components/Icon/Stories.d.ts +0 -150
- package/js/components/Icon/Tests.d.ts +0 -14
- package/js/components/Icon/constants.d.ts +0 -1
- package/js/components/Icon/index.d.ts +0 -41
- package/js/components/InputHelper/Stories.d.ts +0 -43
- package/js/components/InputHelper/Tests.d.ts +0 -12
- package/js/components/InputHelper/constants.d.ts +0 -3
- package/js/components/InputHelper/index.d.ts +0 -26
- package/js/components/InputLabel/Stories.d.ts +0 -34
- package/js/components/InputLabel/Tests.d.ts +0 -12
- package/js/components/InputLabel/index.d.ts +0 -25
- package/js/components/Link/Stories.d.ts +0 -93
- package/js/components/Link/Tests.d.ts +0 -15
- package/js/components/Link/index.d.ts +0 -54
- package/js/components/Message/Stories.d.ts +0 -119
- package/js/components/Message/Tests.d.ts +0 -14
- package/js/components/Message/index.d.ts +0 -75
- package/js/components/RadioButton/Stories.d.ts +0 -77
- package/js/components/RadioButton/Tests.d.ts +0 -15
- package/js/components/RadioButton/index.d.ts +0 -45
- package/js/components/RawClickable/Tests.d.ts +0 -14
- package/js/components/RawClickable/index.d.ts +0 -13
- package/js/components/Skeleton/SkeletonCircle.d.ts +0 -32
- package/js/components/Skeleton/SkeletonCircleStories.d.ts +0 -45
- package/js/components/Skeleton/SkeletonCircleTests.d.ts +0 -12
- package/js/components/Skeleton/SkeletonRectangle.d.ts +0 -47
- package/js/components/Skeleton/SkeletonRectangleStories.d.ts +0 -87
- package/js/components/Skeleton/SkeletonRectangleTests.d.ts +0 -13
- package/js/components/Skeleton/SkeletonTypography.d.ts +0 -37
- package/js/components/Skeleton/SkeletonTypographyStories.d.ts +0 -40
- package/js/components/Skeleton/SkeletonTypographyTests.d.ts +0 -13
- package/js/components/Skeleton/index.d.ts +0 -3
- package/js/components/Switch/Stories.d.ts +0 -94
- package/js/components/Switch/Tests.d.ts +0 -15
- package/js/components/Switch/index.d.ts +0 -47
- package/js/components/Table/Stories.d.ts +0 -25
- package/js/components/Table/TableCell.d.ts +0 -55
- package/js/components/Table/TableCellStories.d.ts +0 -44
- package/js/components/Table/TableCellTests.d.ts +0 -11
- package/js/components/Table/TableRowStories.d.ts +0 -23
- package/js/components/Table/Tests.d.ts +0 -11
- package/js/components/Table/constants.d.ts +0 -9
- package/js/components/Table/index.d.ts +0 -27
- package/js/components/Text/Stories.d.ts +0 -167
- package/js/components/Text/Tests.d.ts +0 -10
- package/js/components/Text/index.d.ts +0 -935
- package/js/components/Thumbnail/Stories.d.ts +0 -168
- package/js/components/Thumbnail/Tests.d.ts +0 -11
- package/js/components/Thumbnail/index.d.ts +0 -84
- package/js/components/Thumbnail/types.d.ts +0 -45
- package/js/components/Thumbnail/utils.d.ts +0 -79
- package/stories/controls/color.d.ts +0 -15
- package/stories/controls/element.d.ts +0 -16
- package/stories/controls/focusPoint.d.ts +0 -8
- package/stories/controls/icons.d.ts +0 -66
- package/stories/controls/image.d.ts +0 -96
- package/stories/controls/selectArgType.d.ts +0 -7
- package/stories/controls/theme.d.ts +0 -7
- package/stories/controls/typography.d.ts +0 -8
- package/stories/controls/withUndefined.d.ts +0 -1
- package/stories/types.d.ts +0 -47
- package/stories/utils/combinations.d.ts +0 -100
- package/stories/utils/concatPath.d.ts +0 -10
- package/stories/utils/disableArgTypes.d.ts +0 -7
- package/stories/utils/initDemoShadowDOMPortal.d.ts +0 -5
- package/stories/utils/lorem.d.ts +0 -7
- package/stories/utils/toFlattenProps.d.ts +0 -12
- package/stories/utils/withCategory.d.ts +0 -4
- package/testing/commonTestsSuiteTL.d.ts +0 -87
- package/testing/index.d.ts +0 -1
- package/testing/queries.d.ts +0 -4
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
-
/**
|
|
3
|
-
* Setup Divider 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
|
-
decorators?: never;
|
|
9
|
-
}>): {
|
|
10
|
-
meta: {
|
|
11
|
-
component: any;
|
|
12
|
-
render: any;
|
|
13
|
-
args: {
|
|
14
|
-
ref?: import("../../types").CommonRef;
|
|
15
|
-
theme?: import("../../constants").Theme | undefined;
|
|
16
|
-
className?: string | undefined;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
/** Default divider */
|
|
20
|
-
Default: {};
|
|
21
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SetupOptions } from '../../../testing';
|
|
2
|
-
import { DividerProps } from '.';
|
|
3
|
-
type SetupProps = Partial<DividerProps>;
|
|
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<DividerProps>) => {
|
|
8
|
-
divider: HTMLElement;
|
|
9
|
-
props: DividerProps;
|
|
10
|
-
};
|
|
11
|
-
declare const _default: (renderOptions: SetupOptions<DividerProps>) => void;
|
|
12
|
-
export default _default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { LumxClassName, HasTheme, HasClassName, CommonRef } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Defines the props of the component.
|
|
4
|
-
*/
|
|
5
|
-
export interface DividerProps extends HasTheme, HasClassName {
|
|
6
|
-
/** reference to the root element */
|
|
7
|
-
ref?: CommonRef;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Component display name.
|
|
11
|
-
*/
|
|
12
|
-
export declare const COMPONENT_NAME = "Divider";
|
|
13
|
-
/**
|
|
14
|
-
* Component default class name and class prefix.
|
|
15
|
-
*/
|
|
16
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
17
|
-
/**
|
|
18
|
-
* Component default props.
|
|
19
|
-
*/
|
|
20
|
-
export declare const DEFAULT_PROPS: Partial<DividerProps>;
|
|
21
|
-
/**
|
|
22
|
-
* Divider component.
|
|
23
|
-
*
|
|
24
|
-
* @param props Component props.
|
|
25
|
-
* @return JSX element.
|
|
26
|
-
*/
|
|
27
|
-
export declare const Divider: (props: DividerProps) => import("react").JSX.Element;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
-
/**
|
|
3
|
-
* Setup Flag 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, withResizableBox }, }: SetupStoriesOptions<{
|
|
8
|
-
decorators: 'withCombinations' | 'withResizableBox';
|
|
9
|
-
}>): {
|
|
10
|
-
meta: {
|
|
11
|
-
component: any;
|
|
12
|
-
render: any;
|
|
13
|
-
argTypes: {
|
|
14
|
-
color: {
|
|
15
|
-
control: {
|
|
16
|
-
type: "select" | "inline-radio";
|
|
17
|
-
};
|
|
18
|
-
options: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined)[];
|
|
19
|
-
mapping: Record<string, "light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined> | undefined;
|
|
20
|
-
};
|
|
21
|
-
icon: {
|
|
22
|
-
control: {
|
|
23
|
-
type: string;
|
|
24
|
-
};
|
|
25
|
-
options: {
|
|
26
|
-
undefined: undefined;
|
|
27
|
-
mdiAbTesting: string;
|
|
28
|
-
mdiAbjadArabic: string;
|
|
29
|
-
mdiAccount: string;
|
|
30
|
-
mdiAccountBox: string;
|
|
31
|
-
mdiAlert: string;
|
|
32
|
-
mdiAlertCircle: string;
|
|
33
|
-
mdiArrowDown: string;
|
|
34
|
-
mdiArrowUp: string;
|
|
35
|
-
mdiAtom: string;
|
|
36
|
-
mdiBee: string;
|
|
37
|
-
mdiBell: string;
|
|
38
|
-
mdiBullhornOutline: string;
|
|
39
|
-
mdiCheck: string;
|
|
40
|
-
mdiCheckCircle: string;
|
|
41
|
-
mdiChevronDown: string;
|
|
42
|
-
mdiChevronLeft: string;
|
|
43
|
-
mdiChevronRight: string;
|
|
44
|
-
mdiChevronUp: string;
|
|
45
|
-
mdiClose: string;
|
|
46
|
-
mdiCloseCircle: string;
|
|
47
|
-
mdiDelete: string;
|
|
48
|
-
mdiDotsHorizontal: string;
|
|
49
|
-
mdiDragVertical: string;
|
|
50
|
-
mdiEarth: string;
|
|
51
|
-
mdiEmail: string;
|
|
52
|
-
mdiEye: string;
|
|
53
|
-
mdiFileEdit: string;
|
|
54
|
-
mdiFlag: string;
|
|
55
|
-
mdiFolder: string;
|
|
56
|
-
mdiFolderGoogleDrive: string;
|
|
57
|
-
mdiFoodApple: string;
|
|
58
|
-
mdiGoogleCirclesExtended: string;
|
|
59
|
-
mdiHeart: string;
|
|
60
|
-
mdiHome: string;
|
|
61
|
-
mdiImageBroken: string;
|
|
62
|
-
mdiInformation: string;
|
|
63
|
-
mdiLink: string;
|
|
64
|
-
mdiMagnifyMinusOutline: string;
|
|
65
|
-
mdiMagnifyPlusOutline: string;
|
|
66
|
-
mdiMenuDown: string;
|
|
67
|
-
mdiMessageTextOutline: string;
|
|
68
|
-
mdiMinus: string;
|
|
69
|
-
mdiOpenInNew: string;
|
|
70
|
-
mdiPauseCircleOutline: string;
|
|
71
|
-
mdiPencil: string;
|
|
72
|
-
mdiPlay: string;
|
|
73
|
-
mdiPlayCircleOutline: string;
|
|
74
|
-
mdiPlus: string;
|
|
75
|
-
mdiRadioboxBlank: string;
|
|
76
|
-
mdiRadioboxMarked: string;
|
|
77
|
-
mdiReply: string;
|
|
78
|
-
mdiSend: string;
|
|
79
|
-
mdiStar: string;
|
|
80
|
-
mdiTextBox: string;
|
|
81
|
-
mdiTextBoxPlus: string;
|
|
82
|
-
mdiTram: string;
|
|
83
|
-
mdiTranslate: string;
|
|
84
|
-
mdiViewList: string;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
args: {
|
|
89
|
-
label: string;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
/** Default flag with label */
|
|
93
|
-
Default: {};
|
|
94
|
-
/** With icon */
|
|
95
|
-
WithIcon: {
|
|
96
|
-
args: {
|
|
97
|
-
icon: string;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
/** All `color` variants */
|
|
101
|
-
AllColors: {
|
|
102
|
-
args: {
|
|
103
|
-
icon: string;
|
|
104
|
-
};
|
|
105
|
-
argTypes: {
|
|
106
|
-
color: {
|
|
107
|
-
control: boolean;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
decorators: ((story: any, context: any) => any)[];
|
|
111
|
-
};
|
|
112
|
-
/** Truncate text option */
|
|
113
|
-
Truncate: {
|
|
114
|
-
args: {
|
|
115
|
-
label: string;
|
|
116
|
-
truncate: boolean;
|
|
117
|
-
};
|
|
118
|
-
decorators: ((story: any, context: any) => any)[];
|
|
119
|
-
};
|
|
120
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SetupOptions } from '../../../testing';
|
|
2
|
-
import { FlagProps } from '.';
|
|
3
|
-
type SetupProps = Partial<FlagProps>;
|
|
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<FlagProps>) => {
|
|
8
|
-
flag: HTMLElement;
|
|
9
|
-
icon: HTMLElement | null;
|
|
10
|
-
label: HTMLElement | null;
|
|
11
|
-
props: FlagProps;
|
|
12
|
-
};
|
|
13
|
-
declare const _default: (renderOptions: SetupOptions<FlagProps>) => void;
|
|
14
|
-
export default _default;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ColorPalette } from '../../constants';
|
|
2
|
-
import type { LumxClassName, HasTheme, JSXElement, HasClassName, CommonRef } from '../../types';
|
|
3
|
-
import { TextProps } from '../Text';
|
|
4
|
-
export interface FlagProps extends HasClassName, HasTheme {
|
|
5
|
-
/** Color of the component. */
|
|
6
|
-
color?: ColorPalette;
|
|
7
|
-
/** Icon to use before the label. */
|
|
8
|
-
icon?: string;
|
|
9
|
-
/** Text label of the flag. */
|
|
10
|
-
children: JSXElement;
|
|
11
|
-
/** Enable text truncate on overflow */
|
|
12
|
-
truncate?: boolean;
|
|
13
|
-
/** ref to the root element */
|
|
14
|
-
ref?: CommonRef;
|
|
15
|
-
/** Text component to use for rendering the label */
|
|
16
|
-
Text: (props: TextProps) => any;
|
|
17
|
-
}
|
|
18
|
-
export declare const COMPONENT_NAME = "Flag";
|
|
19
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
20
|
-
export declare const DEFAULT_PROPS: Partial<FlagProps>;
|
|
21
|
-
export declare const block: {
|
|
22
|
-
(additionalClasses: string[]): string;
|
|
23
|
-
(modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: string[]): string;
|
|
24
|
-
}, element: {
|
|
25
|
-
(elem: string, additionalClasses: string[]): string;
|
|
26
|
-
(elem: string, modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: string[]): string;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Flag component.
|
|
30
|
-
*
|
|
31
|
-
* @param props Component props.
|
|
32
|
-
* @return JSX element.
|
|
33
|
-
*/
|
|
34
|
-
export declare const Flag: (props: FlagProps) => import("react").JSX.Element;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
-
/**
|
|
3
|
-
* Setup FlexBox 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, args, decorators: { withWrapper, withCombinations }, overrides, }: SetupStoriesOptions<{
|
|
8
|
-
overrides: 'NoShrink' | 'MarginAuto';
|
|
9
|
-
decorators: 'withCombinations' | 'withWrapper';
|
|
10
|
-
}>): {
|
|
11
|
-
meta: {
|
|
12
|
-
component: any;
|
|
13
|
-
render: any;
|
|
14
|
-
args: any;
|
|
15
|
-
argTypes: {
|
|
16
|
-
orientation: {
|
|
17
|
-
control: {
|
|
18
|
-
type: "select" | "inline-radio";
|
|
19
|
-
};
|
|
20
|
-
options: ("horizontal" | "vertical")[];
|
|
21
|
-
mapping: Record<string, "horizontal" | "vertical"> | undefined;
|
|
22
|
-
};
|
|
23
|
-
fillSpace: {
|
|
24
|
-
control: string;
|
|
25
|
-
};
|
|
26
|
-
wrap: {
|
|
27
|
-
control: string;
|
|
28
|
-
};
|
|
29
|
-
noShrink: {
|
|
30
|
-
control: string;
|
|
31
|
-
};
|
|
32
|
-
hAlign: {
|
|
33
|
-
control: {
|
|
34
|
-
type: "select" | "inline-radio";
|
|
35
|
-
};
|
|
36
|
-
options: ("bottom" | "center" | "space-around" | "space-between" | "space-evenly" | "top")[];
|
|
37
|
-
mapping: Record<string, "bottom" | "center" | "space-around" | "space-between" | "space-evenly" | "top"> | undefined;
|
|
38
|
-
};
|
|
39
|
-
vAlign: {
|
|
40
|
-
control: {
|
|
41
|
-
type: "select" | "inline-radio";
|
|
42
|
-
};
|
|
43
|
-
options: ("center" | "left" | "right" | "space-around" | "space-between" | "space-evenly")[];
|
|
44
|
-
mapping: Record<string, "center" | "left" | "right" | "space-around" | "space-between" | "space-evenly"> | undefined;
|
|
45
|
-
};
|
|
46
|
-
gap: {
|
|
47
|
-
control: {
|
|
48
|
-
type: "select" | "inline-radio";
|
|
49
|
-
};
|
|
50
|
-
options: ("tiny" | "regular" | "medium" | "big" | "huge")[];
|
|
51
|
-
mapping: Record<string, "tiny" | "regular" | "medium" | "big" | "huge"> | undefined;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
/** Without config, FlexBox acts as a simple <div> */
|
|
56
|
-
NoConfig: {
|
|
57
|
-
decorators: ((story: any, context: any) => any)[];
|
|
58
|
-
};
|
|
59
|
-
/** Horizontal orientation with all possible item alignments */
|
|
60
|
-
Horizontal: {
|
|
61
|
-
args: {
|
|
62
|
-
orientation: "horizontal";
|
|
63
|
-
};
|
|
64
|
-
decorators: ((story: any, context: any) => any)[];
|
|
65
|
-
};
|
|
66
|
-
/** Vertical orientation with all possible item alignments */
|
|
67
|
-
Vertical: {
|
|
68
|
-
args: {
|
|
69
|
-
orientation: "vertical";
|
|
70
|
-
};
|
|
71
|
-
decorators: ((story: any, context: any) => any)[];
|
|
72
|
-
};
|
|
73
|
-
/** All gap sizes */
|
|
74
|
-
GapSizes: {
|
|
75
|
-
args: {
|
|
76
|
-
orientation: "horizontal";
|
|
77
|
-
};
|
|
78
|
-
argTypes: {
|
|
79
|
-
gap: {
|
|
80
|
-
control: boolean;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
decorators: ((story: any, context: any) => any)[];
|
|
84
|
-
};
|
|
85
|
-
/** Wrap items in new row or column */
|
|
86
|
-
Wrap: {
|
|
87
|
-
args: {
|
|
88
|
-
orientation: "horizontal";
|
|
89
|
-
wrap: boolean;
|
|
90
|
-
};
|
|
91
|
-
argTypes: {
|
|
92
|
-
wrap: {
|
|
93
|
-
control: boolean;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
decorators: ((story: any, context: any) => any)[];
|
|
97
|
-
};
|
|
98
|
-
/** Prevent FlexBox from shrinking into a parent flex box */
|
|
99
|
-
NoShrink: {
|
|
100
|
-
args: any;
|
|
101
|
-
decorators: ((story: any, context: any) => any)[];
|
|
102
|
-
};
|
|
103
|
-
/** All combinations of margin auto values */
|
|
104
|
-
MarginAuto: {
|
|
105
|
-
args: any;
|
|
106
|
-
decorators: ((story: any, context: any) => any)[];
|
|
107
|
-
};
|
|
108
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SetupOptions } from '../../../testing';
|
|
2
|
-
import { FlexBoxProps } from '.';
|
|
3
|
-
type SetupProps = Partial<FlexBoxProps>;
|
|
4
|
-
/**
|
|
5
|
-
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
6
|
-
*/
|
|
7
|
-
export declare const setup: (props: SetupProps | undefined, { render, ...options }: SetupOptions<FlexBoxProps>) => {
|
|
8
|
-
props: Partial<FlexBoxProps>;
|
|
9
|
-
flexBox: HTMLElement;
|
|
10
|
-
container: any;
|
|
11
|
-
};
|
|
12
|
-
declare const _default: (renderOptions: SetupOptions<FlexBoxProps>) => void;
|
|
13
|
-
export default _default;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const GAP_SIZES: ("tiny" | "regular" | "medium" | "big" | "huge")[];
|
|
2
|
-
export declare const SPACE_ALIGNMENTS: ("space-around" | "space-between" | "space-evenly")[];
|
|
3
|
-
export declare const VERTICAL_ALIGNMENTS: ("bottom" | "center" | "space-around" | "space-between" | "space-evenly" | "top")[];
|
|
4
|
-
export declare const HORIZONTAL_ALIGNMENTS: ("center" | "left" | "right" | "space-around" | "space-between" | "space-evenly")[];
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Orientation } from '../../constants';
|
|
2
|
-
import type { LumxClassName, JSXElement, HasClassName } from '../../types';
|
|
3
|
-
import type { FlexHorizontalAlignment, FlexVerticalAlignment, GapSize, MarginAutoAlignment } from './types';
|
|
4
|
-
export type * from './types';
|
|
5
|
-
/**
|
|
6
|
-
* Defines the props of the component.
|
|
7
|
-
*/
|
|
8
|
-
export interface FlexBoxProps extends HasClassName {
|
|
9
|
-
/** Children elements. */
|
|
10
|
-
children?: JSXElement;
|
|
11
|
-
/** Whether the "content filling space" is enabled or not. */
|
|
12
|
-
fillSpace?: boolean;
|
|
13
|
-
/** Gap space between flexbox items. */
|
|
14
|
-
gap?: GapSize;
|
|
15
|
-
/** Flex horizontal alignment. */
|
|
16
|
-
hAlign?: FlexVerticalAlignment;
|
|
17
|
-
/** Whether the "auto margin" is enabled all around or not. */
|
|
18
|
-
marginAuto?: MarginAutoAlignment | MarginAutoAlignment[];
|
|
19
|
-
/** Whether the "content shrink" is disabled or not. */
|
|
20
|
-
noShrink?: boolean;
|
|
21
|
-
/** Flex direction. */
|
|
22
|
-
orientation?: Orientation;
|
|
23
|
-
/** Flex vertical alignment. */
|
|
24
|
-
vAlign?: FlexHorizontalAlignment;
|
|
25
|
-
/** Whether the "flex wrap" is enabled or not. */
|
|
26
|
-
wrap?: boolean;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Component display name.
|
|
30
|
-
*/
|
|
31
|
-
export declare const COMPONENT_NAME = "FlexBox";
|
|
32
|
-
/**
|
|
33
|
-
* Component default class name and class prefix.
|
|
34
|
-
*/
|
|
35
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
36
|
-
export declare const block: {
|
|
37
|
-
(additionalClasses: string[]): string;
|
|
38
|
-
(modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: string[]): string;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Get FlexBox component props (className computation).
|
|
42
|
-
*
|
|
43
|
-
* @param props Component props.
|
|
44
|
-
* @return Computed props with className.
|
|
45
|
-
*/
|
|
46
|
-
export declare function getFlexBoxProps(props: FlexBoxProps): {
|
|
47
|
-
className: string;
|
|
48
|
-
/** Children elements. */
|
|
49
|
-
children?: JSXElement;
|
|
50
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Alignment, HorizontalAlignment, Size, VerticalAlignment } from '../../constants';
|
|
2
|
-
export type MarginAutoAlignment = Extract<Alignment, 'top' | 'bottom' | 'right' | 'left'>;
|
|
3
|
-
export type GapSize = Extract<Size, 'tiny' | 'regular' | 'medium' | 'big' | 'huge'>;
|
|
4
|
-
type SpaceAlignment = Extract<Alignment, 'space-between' | 'space-evenly' | 'space-around'>;
|
|
5
|
-
export type FlexVerticalAlignment = VerticalAlignment | SpaceAlignment;
|
|
6
|
-
export type FlexHorizontalAlignment = HorizontalAlignment | SpaceAlignment;
|
|
7
|
-
export {};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
-
/**
|
|
3
|
-
* Setup Heading 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: 'NestedHeadingLevelProvider';
|
|
9
|
-
decorators: 'withCombinations';
|
|
10
|
-
}>): {
|
|
11
|
-
meta: {
|
|
12
|
-
component: any;
|
|
13
|
-
render: any;
|
|
14
|
-
argTypes: {
|
|
15
|
-
as: {
|
|
16
|
-
control: {
|
|
17
|
-
type: "select" | "inline-radio";
|
|
18
|
-
};
|
|
19
|
-
options: import("../../types").HeadingElement[];
|
|
20
|
-
mapping: Record<string, import("../../types").HeadingElement> | undefined;
|
|
21
|
-
};
|
|
22
|
-
children: {
|
|
23
|
-
control: string;
|
|
24
|
-
};
|
|
25
|
-
typography: {
|
|
26
|
-
control: {
|
|
27
|
-
type: "select" | "inline-radio";
|
|
28
|
-
};
|
|
29
|
-
options: ("overline" | "caption" | "body1" | "body2" | "subtitle1" | "subtitle2" | "title" | "headline" | "display1" | "custom-title1" | "custom-title2" | "custom-title3" | "custom-title4" | "custom-title5" | "custom-title6" | "custom-intro" | "custom-body-large" | "custom-body" | "custom-quote" | "custom-publish-info" | "custom-button")[];
|
|
30
|
-
mapping: Record<string, "overline" | "caption" | "body1" | "body2" | "subtitle1" | "subtitle2" | "title" | "headline" | "display1" | "custom-title1" | "custom-title2" | "custom-title3" | "custom-title4" | "custom-title5" | "custom-title6" | "custom-intro" | "custom-body-large" | "custom-body" | "custom-quote" | "custom-publish-info" | "custom-button"> | undefined;
|
|
31
|
-
};
|
|
32
|
-
color: {
|
|
33
|
-
control: {
|
|
34
|
-
type: "select" | "inline-radio";
|
|
35
|
-
};
|
|
36
|
-
options: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined)[];
|
|
37
|
-
mapping: Record<string, "light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined> | undefined;
|
|
38
|
-
};
|
|
39
|
-
colorVariant: {
|
|
40
|
-
control: {
|
|
41
|
-
type: "select" | "inline-radio";
|
|
42
|
-
};
|
|
43
|
-
options: ("D1" | "D2" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "N")[];
|
|
44
|
-
mapping: Record<string, "D1" | "D2" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "N"> | undefined;
|
|
45
|
-
};
|
|
46
|
-
whiteSpace: {
|
|
47
|
-
control: {
|
|
48
|
-
type: "select" | "inline-radio";
|
|
49
|
-
};
|
|
50
|
-
options: string[];
|
|
51
|
-
mapping: Record<string, string> | undefined;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
/** Default heading with text */
|
|
56
|
-
Default: {
|
|
57
|
-
args: {
|
|
58
|
-
children: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
/** All supported heading elements */
|
|
62
|
-
AllLevels: {
|
|
63
|
-
args: {
|
|
64
|
-
children: string;
|
|
65
|
-
};
|
|
66
|
-
argTypes: {
|
|
67
|
-
as: {
|
|
68
|
-
control: boolean;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
decorators: ((story: any, context: any) => any)[];
|
|
72
|
-
};
|
|
73
|
-
/** All typography */
|
|
74
|
-
AllTypography: {
|
|
75
|
-
args: {
|
|
76
|
-
children: string;
|
|
77
|
-
};
|
|
78
|
-
argTypes: {
|
|
79
|
-
typography: {
|
|
80
|
-
control: boolean;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
decorators: ((story: any, context: any) => any)[];
|
|
84
|
-
};
|
|
85
|
-
/** Nest HeadingLevelProvider to increment heading levels */
|
|
86
|
-
NestedHeadingLevelProvider: {
|
|
87
|
-
[x: string]: any;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SetupOptions } from '../../../testing';
|
|
2
|
-
import { HeadingProps } from '.';
|
|
3
|
-
/**
|
|
4
|
-
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
5
|
-
*/
|
|
6
|
-
export declare const setup: (propsOverride: Partial<HeadingProps> | undefined, { render, ...options }: SetupOptions<HeadingProps>) => {
|
|
7
|
-
heading: HTMLElement;
|
|
8
|
-
props: HeadingProps;
|
|
9
|
-
};
|
|
10
|
-
declare const _default: ({ render, screen, ...options }: SetupOptions<HeadingProps>) => void;
|
|
11
|
-
export default _default;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { HeadingElement } from '../../types';
|
|
2
|
-
/** The maximum authorized heading level. */
|
|
3
|
-
export declare const MAX_HEADING_LEVEL = 6;
|
|
4
|
-
/**
|
|
5
|
-
* Typography to use by default depending on the heading level.
|
|
6
|
-
*/
|
|
7
|
-
export declare const DEFAULT_TYPOGRAPHY_BY_LEVEL: {
|
|
8
|
-
h1: "display1";
|
|
9
|
-
h2: "headline";
|
|
10
|
-
h3: "title";
|
|
11
|
-
h4: "subtitle2";
|
|
12
|
-
h5: "subtitle1";
|
|
13
|
-
h6: "body2";
|
|
14
|
-
};
|
|
15
|
-
export interface HeadingLevelContext {
|
|
16
|
-
/** The current level */
|
|
17
|
-
level: number;
|
|
18
|
-
/** The heading element matching the current level */
|
|
19
|
-
headingElement: HeadingElement;
|
|
20
|
-
}
|
|
21
|
-
export declare const defaultContext: HeadingLevelContext;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { HeadingElement, LumxClassName } from '../../types';
|
|
2
|
-
import { TextProps } from '../Text';
|
|
3
|
-
/**
|
|
4
|
-
* Defines the props of the component.
|
|
5
|
-
*/
|
|
6
|
-
export interface HeadingProps extends Partial<TextProps> {
|
|
7
|
-
/**
|
|
8
|
-
* Display a specific heading level instead of the one provided by parent context provider.
|
|
9
|
-
*/
|
|
10
|
-
as?: HeadingElement;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Component display name.
|
|
14
|
-
*/
|
|
15
|
-
export declare const COMPONENT_NAME = "Heading";
|
|
16
|
-
/**
|
|
17
|
-
* Component default class name and class prefix.
|
|
18
|
-
*/
|
|
19
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
20
|
-
/**
|
|
21
|
-
* Component default props.
|
|
22
|
-
*/
|
|
23
|
-
export declare const DEFAULT_PROPS: {};
|
|
24
|
-
/**
|
|
25
|
-
* Get Heading component common props
|
|
26
|
-
*
|
|
27
|
-
* @param props Component props.
|
|
28
|
-
* @param contextHeadingElement Heading element from context.
|
|
29
|
-
* @return Common Props
|
|
30
|
-
*/
|
|
31
|
-
export declare const getHeadingProps: (props: HeadingProps, contextHeadingElement?: HeadingElement) => {
|
|
32
|
-
as: HeadingElement;
|
|
33
|
-
className: string;
|
|
34
|
-
typography: import("../../constants").Typography;
|
|
35
|
-
color?: import("../../constants").ColorWithVariants | undefined;
|
|
36
|
-
colorVariant?: import("../../constants").ColorVariant | undefined;
|
|
37
|
-
truncate?: boolean | {
|
|
38
|
-
lines: number;
|
|
39
|
-
} | undefined;
|
|
40
|
-
noWrap?: boolean | undefined;
|
|
41
|
-
whiteSpace?: import("../../constants").WhiteSpace | undefined;
|
|
42
|
-
children?: import("react").ReactNode;
|
|
43
|
-
style?: import("react").CSSProperties | undefined;
|
|
44
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Computes the next heading level based on the optional prop level or the parent context level.
|
|
3
|
-
*
|
|
4
|
-
* @param levelProp - The explicit level provided via props (optional).
|
|
5
|
-
* @param parentLevel - The level from the parent context.
|
|
6
|
-
* @returns The calculated heading level, clamped to the maximum allowed level.
|
|
7
|
-
*/
|
|
8
|
-
export declare const computeHeadingLevel: (levelProp: number | undefined, parentLevel: number) => number;
|