@lumx/react 4.9.0-next.11 → 4.9.0-next.13
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/index.d.ts +19 -7
- package/index.js +34 -19
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -3030,20 +3030,32 @@ interface ThumbnailProps extends GenericProps$1, ReactToJSX<ThumbnailProps$1, 'l
|
|
|
3030
3030
|
*/
|
|
3031
3031
|
declare const Thumbnail: Comp<ThumbnailProps, HTMLElement>;
|
|
3032
3032
|
|
|
3033
|
-
type
|
|
3034
|
-
type ImageCaptionMetadata = {
|
|
3033
|
+
type ImageCaptionMetadata$1 = {
|
|
3035
3034
|
/** Image title to display in the caption. */
|
|
3036
3035
|
title?: string;
|
|
3037
3036
|
/** Props to pass to the title. */
|
|
3038
|
-
titleProps?:
|
|
3039
|
-
/** Image description. Can be either a string, or sanitized html. */
|
|
3040
|
-
description?:
|
|
3037
|
+
titleProps?: GenericProps;
|
|
3038
|
+
/** Image description. Can be either a string, ReactNode, or sanitized html object. */
|
|
3039
|
+
description?: JSXElement | {
|
|
3041
3040
|
__html: string;
|
|
3042
3041
|
};
|
|
3043
3042
|
/** Props to pass to the title. */
|
|
3044
|
-
descriptionProps?:
|
|
3043
|
+
descriptionProps?: GenericProps;
|
|
3045
3044
|
/** Tag content. */
|
|
3046
|
-
tags?:
|
|
3045
|
+
tags?: JSXElement;
|
|
3046
|
+
/** Caption custom CSS style. */
|
|
3047
|
+
captionStyle?: GenericProps;
|
|
3048
|
+
FlexBox: any;
|
|
3049
|
+
Text: any;
|
|
3050
|
+
};
|
|
3051
|
+
type ImageCaptionPropsToOverride = 'FlexBox' | 'Text' | 'titleProps' | 'descriptionProps' | 'captionStyle';
|
|
3052
|
+
|
|
3053
|
+
type ForwardedTextProps = Omit<TextProps, 'as' | 'typography' | 'color' | 'colorVariant'>;
|
|
3054
|
+
type ImageCaptionMetadata = Omit<ImageCaptionMetadata$1, ImageCaptionPropsToOverride> & {
|
|
3055
|
+
/** Props to pass to the title. */
|
|
3056
|
+
titleProps?: ForwardedTextProps;
|
|
3057
|
+
/** Props to pass to the title. */
|
|
3058
|
+
descriptionProps?: ForwardedTextProps;
|
|
3047
3059
|
/** Caption custom CSS style. */
|
|
3048
3060
|
captionStyle?: CSSProperties;
|
|
3049
3061
|
};
|
package/index.js
CHANGED
|
@@ -12314,11 +12314,10 @@ Icon.className = Icon$1.className;
|
|
|
12314
12314
|
Icon.defaultProps = Icon$1.defaultProps;
|
|
12315
12315
|
|
|
12316
12316
|
/** Internal component used to render image captions */
|
|
12317
|
-
const ImageCaption = props => {
|
|
12318
|
-
const defaultTheme = useTheme();
|
|
12317
|
+
const ImageCaption$1 = props => {
|
|
12319
12318
|
const {
|
|
12320
12319
|
baseClassName,
|
|
12321
|
-
theme
|
|
12320
|
+
theme,
|
|
12322
12321
|
as = 'figcaption',
|
|
12323
12322
|
title,
|
|
12324
12323
|
titleProps,
|
|
@@ -12327,7 +12326,9 @@ const ImageCaption = props => {
|
|
|
12327
12326
|
tags,
|
|
12328
12327
|
captionStyle,
|
|
12329
12328
|
align,
|
|
12330
|
-
truncate
|
|
12329
|
+
truncate,
|
|
12330
|
+
FlexBox,
|
|
12331
|
+
Text
|
|
12331
12332
|
} = props;
|
|
12332
12333
|
if (!title && !description && !tags) return null;
|
|
12333
12334
|
const titleColor = {
|
|
@@ -12337,16 +12338,9 @@ const ImageCaption = props => {
|
|
|
12337
12338
|
color: theme === 'dark' ? 'light' : 'dark',
|
|
12338
12339
|
colorVariant: 'L2'
|
|
12339
12340
|
};
|
|
12340
|
-
|
|
12341
|
-
// Display description as string or HTML
|
|
12342
|
-
const descriptionContent = typeof description === 'string' ? {
|
|
12343
|
-
children: description
|
|
12344
|
-
} : {
|
|
12345
|
-
dangerouslySetInnerHTML: description
|
|
12346
|
-
};
|
|
12347
12341
|
return /*#__PURE__*/jsxs(FlexBox, {
|
|
12348
12342
|
as: as,
|
|
12349
|
-
className:
|
|
12343
|
+
className: classnames(baseClassName && `${baseClassName}__wrapper`),
|
|
12350
12344
|
style: captionStyle,
|
|
12351
12345
|
orientation: "vertical",
|
|
12352
12346
|
vAlign: align,
|
|
@@ -12354,25 +12348,31 @@ const ImageCaption = props => {
|
|
|
12354
12348
|
gap: "regular",
|
|
12355
12349
|
children: [(title || description) && /*#__PURE__*/jsxs(Text, {
|
|
12356
12350
|
as: "p",
|
|
12357
|
-
className:
|
|
12351
|
+
className: classnames(baseClassName && `${baseClassName}__caption`),
|
|
12358
12352
|
truncate: truncate,
|
|
12359
12353
|
...baseColor,
|
|
12360
12354
|
children: [title && /*#__PURE__*/jsx(Text, {
|
|
12361
12355
|
...titleProps,
|
|
12362
12356
|
as: "span",
|
|
12363
|
-
className:
|
|
12357
|
+
className: classnames(titleProps?.className, baseClassName && `${baseClassName}__title`),
|
|
12364
12358
|
typography: "subtitle1",
|
|
12365
12359
|
...titleColor,
|
|
12366
12360
|
children: title
|
|
12367
|
-
}), ' ', description && /*#__PURE__*/jsx(Text, {
|
|
12361
|
+
}), ' ', description && (typeof description === 'object' && '__html' in description ? /*#__PURE__*/jsx(Text, {
|
|
12368
12362
|
...descriptionProps,
|
|
12369
12363
|
as: "span",
|
|
12370
|
-
className:
|
|
12364
|
+
className: classnames(descriptionProps?.className, baseClassName && `${baseClassName}__description`),
|
|
12371
12365
|
typography: "body1",
|
|
12372
|
-
|
|
12373
|
-
})
|
|
12366
|
+
dangerouslySetInnerHTML: description
|
|
12367
|
+
}) : /*#__PURE__*/jsx(Text, {
|
|
12368
|
+
...descriptionProps,
|
|
12369
|
+
as: "span",
|
|
12370
|
+
className: classnames(descriptionProps?.className, baseClassName && `${baseClassName}__description`),
|
|
12371
|
+
typography: "body1",
|
|
12372
|
+
children: description
|
|
12373
|
+
}))]
|
|
12374
12374
|
}), tags && /*#__PURE__*/jsx(FlexBox, {
|
|
12375
|
-
className:
|
|
12375
|
+
className: classnames(baseClassName && `${baseClassName}__tags`),
|
|
12376
12376
|
orientation: "horizontal",
|
|
12377
12377
|
vAlign: align,
|
|
12378
12378
|
children: tags
|
|
@@ -12380,6 +12380,21 @@ const ImageCaption = props => {
|
|
|
12380
12380
|
});
|
|
12381
12381
|
};
|
|
12382
12382
|
|
|
12383
|
+
/** Internal component used to render image captions */
|
|
12384
|
+
const ImageCaption = props => {
|
|
12385
|
+
const defaultTheme = useTheme();
|
|
12386
|
+
const {
|
|
12387
|
+
theme = defaultTheme,
|
|
12388
|
+
...forwardedProps
|
|
12389
|
+
} = props;
|
|
12390
|
+
return ImageCaption$1({
|
|
12391
|
+
FlexBox,
|
|
12392
|
+
Text,
|
|
12393
|
+
theme,
|
|
12394
|
+
...forwardedProps
|
|
12395
|
+
});
|
|
12396
|
+
};
|
|
12397
|
+
|
|
12383
12398
|
const ImageBlockCaptionPosition = {
|
|
12384
12399
|
below: 'below',
|
|
12385
12400
|
over: 'over'
|