@lumx/core 4.9.0-next.11 → 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,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.11",
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.11",
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",