@lumx/core 4.3.2-alpha.9 → 4.4.1-alpha.0
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/BadgeWrapperTests.d.ts +9 -0
- package/js/components/Badge/Tests.d.ts +12 -0
- package/js/components/Button/Button.d.ts +48 -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/IconButtonTests.d.ts +15 -0
- package/js/components/Button/Tests.d.ts +15 -0
- package/js/components/Checkbox/Tests.d.ts +15 -0
- package/js/components/Checkbox/index.d.ts +49 -0
- package/js/components/Divider/Tests.d.ts +12 -0
- package/js/components/Divider/index.d.ts +27 -0
- package/js/components/Flag/Tests.d.ts +14 -0
- package/js/components/Flag/index.d.ts +34 -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/GridColumnTests.d.ts +12 -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/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/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/Tests.d.ts +12 -0
- package/js/components/InputLabel/index.d.ts +25 -0
- package/js/components/Link/Tests.d.ts +8 -0
- package/js/components/Message/Tests.d.ts +14 -0
- package/js/components/Message/index.d.ts +75 -0
- package/js/components/ProgressCircular/Stories.d.ts +30 -0
- package/js/components/ProgressCircular/Tests.d.ts +11 -0
- package/js/components/ProgressCircular/index.d.ts +52 -0
- package/js/components/ProgressLinear/Stories.d.ts +11 -0
- package/js/components/ProgressLinear/Tests.d.ts +11 -0
- package/js/components/ProgressLinear/index.d.ts +27 -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 +14 -0
- package/js/components/Skeleton/SkeletonCircle.d.ts +32 -0
- package/js/components/Skeleton/SkeletonCircleTests.d.ts +12 -0
- package/js/components/Skeleton/SkeletonRectangle.d.ts +47 -0
- package/js/components/Skeleton/SkeletonRectangleTests.d.ts +13 -0
- package/js/components/Skeleton/SkeletonTypography.d.ts +37 -0
- package/js/components/Skeleton/SkeletonTypographyTests.d.ts +13 -0
- package/js/components/Skeleton/index.d.ts +3 -0
- package/js/components/Switch/Tests.d.ts +15 -0
- package/js/components/Switch/index.d.ts +47 -0
- package/js/components/Table/TableCell.d.ts +55 -0
- package/js/components/Table/TableCellTests.d.ts +11 -0
- package/js/components/Table/Tests.d.ts +11 -0
- package/js/components/Table/constants.d.ts +9 -0
- package/js/components/Text/Tests.d.ts +10 -0
- package/js/components/Text/index.d.ts +935 -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/Tests.d.ts +12 -0
- package/js/types/AriaAttributes.d.ts +29 -2
- package/js/types/index.d.ts +1 -0
- package/js/types/jsx/PropsToOverride.d.ts +2 -0
- package/lumx.css +0 -94
- package/package.json +32 -3
- 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 +48 -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
- package/scss/components/combobox/_index.scss +0 -86
- package/scss/components/combobox/_mixins.scss +0 -63
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
3
|
+
props: any;
|
|
4
|
+
badgeWrapper: HTMLElement;
|
|
5
|
+
div: HTMLElement;
|
|
6
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
/**
|
|
3
|
+
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
4
|
+
*/
|
|
5
|
+
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
6
|
+
props: any;
|
|
7
|
+
badge: HTMLElement;
|
|
8
|
+
div: HTMLElement;
|
|
9
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { JSXElement, LumxClassName } from '../../types';
|
|
2
|
+
import { BaseButtonProps } from './ButtonRoot';
|
|
3
|
+
/**
|
|
4
|
+
* Button emphasis definition.
|
|
5
|
+
* @deprecated Use Emphasis instead.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ButtonEmphasis: {
|
|
8
|
+
readonly low: "low";
|
|
9
|
+
readonly medium: "medium";
|
|
10
|
+
readonly high: "high";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Defines the props of the component.
|
|
14
|
+
*/
|
|
15
|
+
export interface ButtonProps extends BaseButtonProps {
|
|
16
|
+
/** Left icon (SVG path). */
|
|
17
|
+
leftIcon?: string;
|
|
18
|
+
/** Right icon (SVG path). */
|
|
19
|
+
rightIcon?: string;
|
|
20
|
+
/** When `true`, the button gets as large as possible. */
|
|
21
|
+
fullWidth?: boolean;
|
|
22
|
+
/** Children */
|
|
23
|
+
children?: JSXElement;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Component display name.
|
|
27
|
+
*/
|
|
28
|
+
export declare const COMPONENT_NAME = "Button";
|
|
29
|
+
/**
|
|
30
|
+
* Component default class name and class prefix.
|
|
31
|
+
*/
|
|
32
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
33
|
+
/**
|
|
34
|
+
* Component default props.
|
|
35
|
+
*/
|
|
36
|
+
export declare const DEFAULT_PROPS: Partial<ButtonProps>;
|
|
37
|
+
/**
|
|
38
|
+
* Button component.
|
|
39
|
+
*
|
|
40
|
+
* @param props Component props.
|
|
41
|
+
* @return JSX element.
|
|
42
|
+
*/
|
|
43
|
+
export declare const Button: {
|
|
44
|
+
(props: ButtonProps): import("react").JSX.Element;
|
|
45
|
+
displayName: string;
|
|
46
|
+
className: "lumx-button";
|
|
47
|
+
defaultProps: Partial<ButtonProps>;
|
|
48
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ColorPalette, Emphasis, Size } from '../../constants';
|
|
2
|
+
import { HasTheme, HasAriaDisabled, AriaAttributes, HasClassName } from '../../types';
|
|
3
|
+
import { BaseClickableProps } from '../RawClickable';
|
|
4
|
+
/**
|
|
5
|
+
* Button size definition.
|
|
6
|
+
*/
|
|
7
|
+
export type ButtonSize = Extract<Size, 's' | 'm'>;
|
|
8
|
+
export interface BaseButtonProps extends Pick<AriaAttributes, 'aria-expanded' | 'aria-haspopup' | 'aria-pressed' | 'aria-label'>, HasClassName, HasTheme, HasAriaDisabled, BaseClickableProps {
|
|
9
|
+
/** Color variant. */
|
|
10
|
+
color?: ColorPalette;
|
|
11
|
+
/** Emphasis variant. */
|
|
12
|
+
emphasis?: Emphasis;
|
|
13
|
+
/** Whether or not the button has a background color in low emphasis. */
|
|
14
|
+
hasBackground?: boolean;
|
|
15
|
+
/** Native anchor href property. It determines whether the Button will be a <button> or an <a>. */
|
|
16
|
+
href?: string;
|
|
17
|
+
/** Whether the component is disabled or not. */
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
/** Whether the component is selected or not (unsupported in `high` emphasis). */
|
|
20
|
+
isSelected?: boolean;
|
|
21
|
+
/** Native button name property. */
|
|
22
|
+
name?: string;
|
|
23
|
+
/** Size variant. */
|
|
24
|
+
size?: ButtonSize;
|
|
25
|
+
/** Native anchor target property. */
|
|
26
|
+
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
27
|
+
/** Native button type. */
|
|
28
|
+
type?: 'submit' | 'reset' | 'button' | undefined;
|
|
29
|
+
/** Custom component for the link (can be used to inject router Link). */
|
|
30
|
+
linkAs?: 'a' | any;
|
|
31
|
+
/** whether the button is dispalyed in full width or not */
|
|
32
|
+
fullWidth?: boolean;
|
|
33
|
+
/** whether the button is currently active or not */
|
|
34
|
+
isActive?: boolean;
|
|
35
|
+
/** whether the button is currently focused or not */
|
|
36
|
+
isFocused?: boolean;
|
|
37
|
+
/** whether the button is currently focused or not */
|
|
38
|
+
isHovered?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface ButtonRootProps extends BaseButtonProps {
|
|
41
|
+
variant: 'button' | 'icon';
|
|
42
|
+
}
|
|
43
|
+
export declare const BUTTON_WRAPPER_CLASSNAME = "lumx-button-wrapper";
|
|
44
|
+
export declare const BUTTON_CLASSNAME = "lumx-button";
|
|
45
|
+
/**
|
|
46
|
+
* ButtonRoot component.
|
|
47
|
+
*
|
|
48
|
+
* @param props Component props.
|
|
49
|
+
* @return JSX Element.
|
|
50
|
+
*/
|
|
51
|
+
export declare const ButtonRoot: {
|
|
52
|
+
(props: ButtonRootProps): import("react").JSX.Element;
|
|
53
|
+
displayName: string;
|
|
54
|
+
defaultProps: {};
|
|
55
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SetupOptions } from '@lumx/core/testing';
|
|
2
|
+
import { ButtonRootProps } from './ButtonRoot';
|
|
3
|
+
type SetupProps = Partial<ButtonRootProps>;
|
|
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<ButtonRootProps>) => {
|
|
8
|
+
props: any;
|
|
9
|
+
button: HTMLElement;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: (renderOptions: SetupOptions<ButtonRootProps>) => void;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseButtonProps } from './ButtonRoot';
|
|
2
|
+
import type { LumxClassName } from '../../types';
|
|
3
|
+
export interface IconButtonProps extends BaseButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Icon (SVG path).
|
|
6
|
+
* If `image` is also set, `image` will be used instead.
|
|
7
|
+
*/
|
|
8
|
+
icon?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Image (image url).
|
|
11
|
+
* Has priority over `icon`.
|
|
12
|
+
*/
|
|
13
|
+
image?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Label text (required for a11y purpose).
|
|
16
|
+
* If you really don't want an aria-label, you can set an empty label (this is not recommended).
|
|
17
|
+
*/
|
|
18
|
+
label: string;
|
|
19
|
+
/** text to be displayed on hover */
|
|
20
|
+
title?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Component display name.
|
|
24
|
+
*/
|
|
25
|
+
export declare const COMPONENT_NAME = "IconButton";
|
|
26
|
+
/**
|
|
27
|
+
* Component default class name and class prefix.
|
|
28
|
+
*/
|
|
29
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
30
|
+
/**
|
|
31
|
+
* Component default props.
|
|
32
|
+
*/
|
|
33
|
+
export declare const DEFAULT_PROPS: Partial<IconButtonProps>;
|
|
34
|
+
/**
|
|
35
|
+
* IconButton component.
|
|
36
|
+
*
|
|
37
|
+
* @param props Component props.
|
|
38
|
+
* @return JSX element.
|
|
39
|
+
*/
|
|
40
|
+
export declare const IconButton: {
|
|
41
|
+
(props: IconButtonProps): import("react").JSX.Element;
|
|
42
|
+
displayName: string;
|
|
43
|
+
className: "lumx-icon-button";
|
|
44
|
+
defaultProps: Partial<IconButtonProps>;
|
|
45
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SetupOptions } from '@lumx/core/testing';
|
|
2
|
+
import { IconButtonProps } from './IconButton';
|
|
3
|
+
type SetupProps = Partial<IconButtonProps>;
|
|
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<IconButtonProps>) => {
|
|
8
|
+
props: any;
|
|
9
|
+
iconButton: HTMLElement;
|
|
10
|
+
icon: HTMLElement | null;
|
|
11
|
+
img: HTMLElement | null;
|
|
12
|
+
wrapper: Partial<import("@lumx/core/testing").SetupResult>;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: (renderOptions: SetupOptions<IconButtonProps>) => void;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
import { ButtonProps } from './Button';
|
|
3
|
+
type SetupProps = Partial<ButtonProps>;
|
|
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<ButtonProps>) => {
|
|
8
|
+
props: any;
|
|
9
|
+
button: HTMLElement;
|
|
10
|
+
buttonWrapper: HTMLElement | null;
|
|
11
|
+
icons: HTMLElement[];
|
|
12
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: (renderOptions: SetupOptions<ButtonProps>) => void;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
import { CheckboxProps } from '.';
|
|
3
|
+
type SetupProps = Partial<CheckboxProps>;
|
|
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<CheckboxProps>) => {
|
|
8
|
+
checkbox: HTMLElement;
|
|
9
|
+
helper: HTMLElement | null;
|
|
10
|
+
label: HTMLElement | null;
|
|
11
|
+
input: HTMLElement;
|
|
12
|
+
props: CheckboxProps;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: (renderOptions: SetupOptions<CheckboxProps>) => void;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { JSXElement, LumxClassName, HasTheme, HasAriaDisabled, HasDisabled, HasClassName, HasChecked, CommonRef } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Intermediate state of checkbox.
|
|
4
|
+
*/
|
|
5
|
+
export declare const INTERMEDIATE_STATE = "intermediate";
|
|
6
|
+
/**
|
|
7
|
+
* Defines the props of the component.
|
|
8
|
+
*/
|
|
9
|
+
export interface CheckboxProps extends HasTheme, HasClassName, HasAriaDisabled, HasDisabled, HasChecked<boolean | 'intermediate'> {
|
|
10
|
+
/** Helper text. */
|
|
11
|
+
helper?: string;
|
|
12
|
+
/** Native input id property. */
|
|
13
|
+
id?: string;
|
|
14
|
+
/** Label text. */
|
|
15
|
+
label?: JSXElement;
|
|
16
|
+
/** Native input name property. */
|
|
17
|
+
name?: string;
|
|
18
|
+
/** Native input value property. */
|
|
19
|
+
value?: string;
|
|
20
|
+
/** optional props for input */
|
|
21
|
+
inputProps?: Record<string, any>;
|
|
22
|
+
/** Native input ref. */
|
|
23
|
+
inputRef?: CommonRef;
|
|
24
|
+
/** Native input id. */
|
|
25
|
+
inputId: string;
|
|
26
|
+
/** On change callback. */
|
|
27
|
+
handleChange?(isChecked: boolean, value?: string, name?: string, event?: any): void;
|
|
28
|
+
/** reference to the root element */
|
|
29
|
+
ref?: CommonRef;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Component display name.
|
|
33
|
+
*/
|
|
34
|
+
export declare const COMPONENT_NAME = "Checkbox";
|
|
35
|
+
/**
|
|
36
|
+
* Component default class name and class prefix.
|
|
37
|
+
*/
|
|
38
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
39
|
+
/**
|
|
40
|
+
* Component default props.
|
|
41
|
+
*/
|
|
42
|
+
export declare const DEFAULT_PROPS: Partial<CheckboxProps>;
|
|
43
|
+
/**
|
|
44
|
+
* Checkbox component.
|
|
45
|
+
*
|
|
46
|
+
* @param props Component props.
|
|
47
|
+
* @return JSX element.
|
|
48
|
+
*/
|
|
49
|
+
export declare const Checkbox: (props: CheckboxProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
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;
|
|
@@ -0,0 +1,27 @@
|
|
|
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
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;
|
|
@@ -0,0 +1,34 @@
|
|
|
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: import("classnames/types").ClassValue[]): string;
|
|
23
|
+
(modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: import("classnames/types").ClassValue[]): string;
|
|
24
|
+
}, element: {
|
|
25
|
+
(elem: string, additionalClasses: import("classnames/types").ClassValue[]): string;
|
|
26
|
+
(elem: string, modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: import("classnames/types").ClassValue[]): 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;
|
|
@@ -0,0 +1,13 @@
|
|
|
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;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const GAP_SIZES: ("big" | "tiny" | "regular" | "medium" | "huge")[];
|
|
2
|
+
export declare const SPACE_ALIGNMENTS: ("space-around" | "space-between" | "space-evenly")[];
|
|
3
|
+
export declare const VERTICAL_ALIGNMENTS: ("center" | "bottom" | "space-around" | "space-between" | "space-evenly" | "top")[];
|
|
4
|
+
export declare const HORIZONTAL_ALIGNMENTS: ("center" | "left" | "right" | "space-around" | "space-between" | "space-evenly")[];
|
|
@@ -0,0 +1,50 @@
|
|
|
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: import("classnames/types").ClassValue[]): string;
|
|
38
|
+
(modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: import("classnames/types").ClassValue[]): 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
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
|
+
import { Size } from '../../constants';
|
|
3
|
+
export type GridColumnGapSize = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;
|
|
4
|
+
/**
|
|
5
|
+
* Defines the props of the component.
|
|
6
|
+
*/
|
|
7
|
+
export interface GridColumnProps extends HasClassName {
|
|
8
|
+
/** Customize the root element. */
|
|
9
|
+
as?: any;
|
|
10
|
+
/** Children elements. */
|
|
11
|
+
children?: JSXElement;
|
|
12
|
+
/** Space between columns and rows. */
|
|
13
|
+
gap?: GridColumnGapSize;
|
|
14
|
+
/** Ideal number of columns. */
|
|
15
|
+
maxColumns?: number;
|
|
16
|
+
/** Minimum width for each item, reduce the number of column if there is not enough space. */
|
|
17
|
+
itemMinWidth?: number;
|
|
18
|
+
/** Custom styles. */
|
|
19
|
+
style?: any;
|
|
20
|
+
/** reference to the root element */
|
|
21
|
+
ref?: CommonRef;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Component display name.
|
|
25
|
+
*/
|
|
26
|
+
export declare const COMPONENT_NAME = "GridColumn";
|
|
27
|
+
/**
|
|
28
|
+
* Component default class name and class prefix.
|
|
29
|
+
*/
|
|
30
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
31
|
+
/**
|
|
32
|
+
* Component default props.
|
|
33
|
+
*/
|
|
34
|
+
export declare const DEFAULT_PROPS: Partial<GridColumnProps>;
|
|
35
|
+
/**
|
|
36
|
+
* The GridColumn is a layout component that can display children in a grid
|
|
37
|
+
* with custom display properties. It also comes with a responsive design,
|
|
38
|
+
* with a number of column that reduce when there is not enough space for each item.
|
|
39
|
+
*
|
|
40
|
+
* @param props Component props.
|
|
41
|
+
* @return JSX element.
|
|
42
|
+
*/
|
|
43
|
+
export declare const GridColumn: {
|
|
44
|
+
(props: GridColumnProps): import("react").JSX.Element;
|
|
45
|
+
displayName: string;
|
|
46
|
+
className: "lumx-grid-column";
|
|
47
|
+
defaultProps: Partial<GridColumnProps>;
|
|
48
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
/**
|
|
3
|
+
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
4
|
+
*/
|
|
5
|
+
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
6
|
+
props: any;
|
|
7
|
+
gridColumn: HTMLElement;
|
|
8
|
+
div: HTMLElement;
|
|
9
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,21 @@
|
|
|
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;
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
import { IconProps } from '.';
|
|
3
|
+
type SetupProps = Partial<IconProps>;
|
|
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<IconProps>) => {
|
|
8
|
+
i: HTMLElement;
|
|
9
|
+
svg: HTMLElement;
|
|
10
|
+
path: HTMLElement;
|
|
11
|
+
props: IconProps;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: (renderOptions: SetupOptions<IconProps>) => void;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ICON_SIZES: ("s" | "xxs" | "xs" | "m" | "l" | "xl" | "xxl")[];
|