@lumx/core 4.9.0-next.10 → 4.9.0-next.12
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.
|
@@ -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
|
+
element: HTMLElement;
|
|
7
|
+
header: HTMLElement | null;
|
|
8
|
+
props: any;
|
|
9
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { HasClassName, LumxClassName, HasCloseMode, HasTheme, CommonRef, GenericProps, JSXElement } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the props of the component.
|
|
4
|
+
*/
|
|
5
|
+
export interface ExpansionPanelProps extends HasClassName, HasCloseMode, HasTheme {
|
|
6
|
+
/** Whether the expansion panel has a background. */
|
|
7
|
+
hasBackground?: boolean;
|
|
8
|
+
/** Whether the header has a divider. */
|
|
9
|
+
hasHeaderDivider?: boolean;
|
|
10
|
+
/** Whether the component is open or not. */
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
/** Label text (overwritten if a `<header>` is provided in the children). */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** On open callback. */
|
|
15
|
+
handleOpen?: (event: any) => void;
|
|
16
|
+
/** On close callback. */
|
|
17
|
+
handleClose?: (event: any) => void;
|
|
18
|
+
/** Props to pass to the toggle button (minus those already set by the ExpansionPanel props). */
|
|
19
|
+
toggleButtonProps: any;
|
|
20
|
+
/** On toggle open or close callback. */
|
|
21
|
+
handleToggleOpen?(shouldOpen: boolean, event: any): void;
|
|
22
|
+
/** Children */
|
|
23
|
+
children?: JSXElement;
|
|
24
|
+
/** Ref forwarded to the root `<section>` element. */
|
|
25
|
+
ref?: CommonRef;
|
|
26
|
+
/** Ref forwarded to the collapsible wrapper `<div>`. */
|
|
27
|
+
wrapperRef?: CommonRef;
|
|
28
|
+
/** Props spread onto the header content `<div>` (e.g. `aria-*`, `data-*`). */
|
|
29
|
+
headerProps: GenericProps;
|
|
30
|
+
/** Content rendered inside the header content area. */
|
|
31
|
+
headerContent?: JSXElement;
|
|
32
|
+
/** Optional drag handle element rendered at the start of the header. */
|
|
33
|
+
dragHandle?: JSXElement;
|
|
34
|
+
/** Content rendered inside the collapsible content area. */
|
|
35
|
+
content?: JSXElement;
|
|
36
|
+
/** Optional footer element rendered below the content. */
|
|
37
|
+
footer?: JSXElement;
|
|
38
|
+
/** IconButton component injected by the framework wrapper (React or Vue). */
|
|
39
|
+
IconButton: any;
|
|
40
|
+
/** Whether the children should remain mounted (visible in the DOM) while the panel is closed. */
|
|
41
|
+
isChildrenVisible?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export type ExpansionPanelPropsToOverride = 'handleOpen' | 'handleClose' | 'toggleButtonProps' | 'handleToggleOpen' | 'wrapperRef' | 'headerProps' | 'headerContent' | 'dragHandle' | 'content' | 'IconButton' | 'isChildrenVisible' | 'footer';
|
|
44
|
+
/**
|
|
45
|
+
* Component display name.
|
|
46
|
+
*/
|
|
47
|
+
export declare const COMPONENT_NAME = "ExpansionPanel";
|
|
48
|
+
/**
|
|
49
|
+
* Component default class name and class prefix.
|
|
50
|
+
*/
|
|
51
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
52
|
+
export declare const block: {
|
|
53
|
+
(additionalClasses: import("classnames/types").ClassValue[]): string;
|
|
54
|
+
(modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: import("classnames/types").ClassValue[]): string;
|
|
55
|
+
}, element: {
|
|
56
|
+
(elem: string, additionalClasses: import("classnames/types").ClassValue[]): string;
|
|
57
|
+
(elem: string, modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: import("classnames/types").ClassValue[]): string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Component default props.
|
|
61
|
+
*/
|
|
62
|
+
export declare const DEFAULT_PROPS: Partial<ExpansionPanelProps>;
|
|
63
|
+
/**
|
|
64
|
+
* ExpansionPanel component.
|
|
65
|
+
*
|
|
66
|
+
* @param props Component props.
|
|
67
|
+
* @param ref Component ref.
|
|
68
|
+
* @return React element.
|
|
69
|
+
*/
|
|
70
|
+
export declare const ExpansionPanel: (props: ExpansionPanelProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HorizontalAlignment } from '../../constants';
|
|
2
|
+
import { GenericProps, HasPolymorphicAs, HasTheme, JSXElement } from '../../types';
|
|
3
|
+
export type As = 'div' | 'figcaption';
|
|
4
|
+
export type ImageCaptionMetadata = {
|
|
5
|
+
/** Image title to display in the caption. */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** Props to pass to the title. */
|
|
8
|
+
titleProps?: GenericProps;
|
|
9
|
+
/** Image description. Can be either a string, ReactNode, or sanitized html object. */
|
|
10
|
+
description?: JSXElement | {
|
|
11
|
+
__html: string;
|
|
12
|
+
};
|
|
13
|
+
/** Props to pass to the title. */
|
|
14
|
+
descriptionProps?: GenericProps;
|
|
15
|
+
/** Tag content. */
|
|
16
|
+
tags?: JSXElement;
|
|
17
|
+
/** Caption custom CSS style. */
|
|
18
|
+
captionStyle?: GenericProps;
|
|
19
|
+
FlexBox: any;
|
|
20
|
+
Text: any;
|
|
21
|
+
};
|
|
22
|
+
export type ImageCaptionPropsToOverride = 'FlexBox' | 'Text' | 'titleProps' | 'descriptionProps' | 'captionStyle';
|
|
23
|
+
export type ImageCaptionProps<AS extends As = 'figcaption'> = HasTheme & HasPolymorphicAs<AS> & ImageCaptionMetadata & {
|
|
24
|
+
/** Base className for sub elements */
|
|
25
|
+
baseClassName?: string;
|
|
26
|
+
/** Alignment. */
|
|
27
|
+
align?: HorizontalAlignment;
|
|
28
|
+
/** Truncate text on title & description (no line wrapping). */
|
|
29
|
+
truncate?: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** Internal component used to render image captions */
|
|
32
|
+
export declare const ImageCaption: <AS extends As>(props: ImageCaptionProps<AS>) => import("react").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
imageBlock: HTMLElement;
|
|
8
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { HorizontalAlignment, Size } from '../../constants';
|
|
2
|
+
import type { CommonRef, HasClassName, JSXElement, LumxClassName, GenericProps, HasTheme, ValueOf } from '../../types';
|
|
3
|
+
import { ImageCaptionMetadata } from './ImageCaption';
|
|
4
|
+
/**
|
|
5
|
+
* Image block variants.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ImageBlockCaptionPosition: {
|
|
8
|
+
readonly below: "below";
|
|
9
|
+
readonly over: "over";
|
|
10
|
+
};
|
|
11
|
+
export type ImageBlockCaptionPosition = ValueOf<typeof ImageBlockCaptionPosition>;
|
|
12
|
+
/**
|
|
13
|
+
* Image block sizes.
|
|
14
|
+
*/
|
|
15
|
+
export type ImageBlockSize = Extract<Size, 'xl' | 'xxl'>;
|
|
16
|
+
/**
|
|
17
|
+
* Defines the props of the component.
|
|
18
|
+
*/
|
|
19
|
+
export interface ImageBlockProps extends HasClassName, HasTheme, ImageCaptionMetadata {
|
|
20
|
+
/** Action toolbar content. */
|
|
21
|
+
actions?: JSXElement;
|
|
22
|
+
/** Alignment. */
|
|
23
|
+
align?: HorizontalAlignment;
|
|
24
|
+
/** Image alternative text. */
|
|
25
|
+
alt: string;
|
|
26
|
+
/** Caption position. */
|
|
27
|
+
captionPosition?: ImageBlockCaptionPosition;
|
|
28
|
+
/** Whether the image has to fill its container height or not. */
|
|
29
|
+
fillHeight?: boolean;
|
|
30
|
+
/** Image URL. */
|
|
31
|
+
image: string;
|
|
32
|
+
/** Size variant. */
|
|
33
|
+
size?: ImageBlockSize;
|
|
34
|
+
/** Props to pass to the thumbnail (minus those already set by the ImageBlock props). */
|
|
35
|
+
thumbnailProps?: GenericProps;
|
|
36
|
+
/** reference to the root element */
|
|
37
|
+
ref?: CommonRef;
|
|
38
|
+
/** component for rendering the thumbnail */
|
|
39
|
+
Thumbnail: any;
|
|
40
|
+
/** component for rendering the image caption */
|
|
41
|
+
ImageCaption: any;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Component display name.
|
|
45
|
+
*/
|
|
46
|
+
export declare const COMPONENT_NAME = "ImageBlock";
|
|
47
|
+
/**
|
|
48
|
+
* Component default class name and class prefix.
|
|
49
|
+
*/
|
|
50
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
51
|
+
/**
|
|
52
|
+
* Component default props.
|
|
53
|
+
*/
|
|
54
|
+
export declare const DEFAULT_PROPS: Partial<ImageBlockProps>;
|
|
55
|
+
/**
|
|
56
|
+
* ImageBlock component.
|
|
57
|
+
*
|
|
58
|
+
* @param props Component props.
|
|
59
|
+
* @param ref Component ref.
|
|
60
|
+
* @return React element.
|
|
61
|
+
*/
|
|
62
|
+
export declare const ImageBlock: (props: ImageBlockProps) => import("react").JSX.Element;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@floating-ui/dom": "^1.7.5",
|
|
10
|
-
"@lumx/icons": "^4.9.0-next.
|
|
10
|
+
"@lumx/icons": "^4.9.0-next.12",
|
|
11
11
|
"classnames": "^2.3.2",
|
|
12
12
|
"focus-visible": "^5.0.2",
|
|
13
13
|
"lodash": "4.17.23",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
70
70
|
},
|
|
71
71
|
"sideEffects": false,
|
|
72
|
-
"version": "4.9.0-next.
|
|
72
|
+
"version": "4.9.0-next.12",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
75
75
|
"@testing-library/dom": "^10.4.1",
|