@lumx/react 3.7.6-alpha.6 → 3.7.6-alpha.8
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 +1 -1
- package/index.js +34 -27
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/image-block/ImageBlock.tsx +15 -2
- package/src/components/image-block/ImageCaption.tsx +16 -21
- package/src/components/image-lightbox/types.ts +1 -1
- package/src/stories/generated/ImageLightbox/Demos.stories.tsx +6 -0
- package/src/components/image-block/constants.ts +0 -11
package/index.d.ts
CHANGED
|
@@ -1387,7 +1387,7 @@ type InheritedThumbnailProps = Pick<ThumbnailProps, 'image' | 'alt' | 'imgProps'
|
|
|
1387
1387
|
type InheritedImageMetadata = Pick<ImageCaptionMetadata, 'title' | 'description' | 'tags'>;
|
|
1388
1388
|
type ImageProps = InheritedThumbnailProps & InheritedImageMetadata;
|
|
1389
1389
|
interface ImagesProps {
|
|
1390
|
-
/** Index of the active
|
|
1390
|
+
/** Index of the active image to show on open */
|
|
1391
1391
|
activeImageIndex?: number;
|
|
1392
1392
|
/** List of images to display */
|
|
1393
1393
|
images: Array<ImageProps>;
|
package/index.js
CHANGED
|
@@ -7655,35 +7655,27 @@ Icon.displayName = COMPONENT_NAME$w;
|
|
|
7655
7655
|
Icon.className = CLASSNAME$t;
|
|
7656
7656
|
Icon.defaultProps = DEFAULT_PROPS$p;
|
|
7657
7657
|
|
|
7658
|
-
/**
|
|
7659
|
-
* Component display name.
|
|
7660
|
-
*/
|
|
7661
|
-
const COMPONENT_NAME$x = 'ImageBlock';
|
|
7662
|
-
|
|
7663
|
-
/**
|
|
7664
|
-
* Component default class name and class prefix.
|
|
7665
|
-
*/
|
|
7666
|
-
const CLASSNAME$u = getRootClassName(COMPONENT_NAME$x);
|
|
7667
|
-
|
|
7668
7658
|
/** Internal component used to render image captions */
|
|
7669
7659
|
const ImageCaption = props => {
|
|
7670
7660
|
const {
|
|
7661
|
+
className,
|
|
7671
7662
|
theme,
|
|
7672
7663
|
as = 'figcaption',
|
|
7673
7664
|
title,
|
|
7674
7665
|
description,
|
|
7675
7666
|
tags,
|
|
7676
7667
|
captionStyle,
|
|
7677
|
-
align
|
|
7668
|
+
align,
|
|
7669
|
+
truncate
|
|
7678
7670
|
} = props;
|
|
7679
7671
|
if (!title && !description && !tags) return null;
|
|
7680
|
-
const titleColor =
|
|
7681
|
-
color: 'light'
|
|
7682
|
-
}
|
|
7683
|
-
const descriptionColor =
|
|
7684
|
-
color: 'light',
|
|
7672
|
+
const titleColor = {
|
|
7673
|
+
color: theme === 'dark' ? 'light' : 'dark'
|
|
7674
|
+
};
|
|
7675
|
+
const descriptionColor = {
|
|
7676
|
+
color: theme === 'dark' ? 'light' : 'dark',
|
|
7685
7677
|
colorVariant: 'L2'
|
|
7686
|
-
}
|
|
7678
|
+
};
|
|
7687
7679
|
|
|
7688
7680
|
// Display description as string or HTML
|
|
7689
7681
|
const descriptionContent = typeof description === 'string' ? {
|
|
@@ -7693,22 +7685,24 @@ const ImageCaption = props => {
|
|
|
7693
7685
|
};
|
|
7694
7686
|
return /*#__PURE__*/React.createElement(FlexBox, {
|
|
7695
7687
|
as: as,
|
|
7696
|
-
className:
|
|
7688
|
+
className: className,
|
|
7697
7689
|
style: captionStyle,
|
|
7698
7690
|
orientation: "horizontal",
|
|
7699
|
-
vAlign: align
|
|
7700
|
-
|
|
7701
|
-
|
|
7691
|
+
vAlign: align,
|
|
7692
|
+
hAlign: align === 'center' ? align : undefined,
|
|
7693
|
+
gap: "regular"
|
|
7694
|
+
}, (title || description) && /*#__PURE__*/React.createElement(Text, {
|
|
7695
|
+
as: "p",
|
|
7696
|
+
truncate: truncate
|
|
7702
7697
|
}, title && /*#__PURE__*/React.createElement(Text, _extends({
|
|
7703
7698
|
as: "span",
|
|
7704
|
-
|
|
7705
|
-
}, titleColor), title),
|
|
7699
|
+
typography: "subtitle1"
|
|
7700
|
+
}, titleColor), title), ' ', description && /*#__PURE__*/React.createElement(Text, _extends({
|
|
7706
7701
|
as: "span",
|
|
7707
|
-
|
|
7702
|
+
typography: "body1"
|
|
7708
7703
|
}, descriptionColor, descriptionContent))), tags && /*#__PURE__*/React.createElement(FlexBox, {
|
|
7709
7704
|
orientation: "horizontal",
|
|
7710
|
-
vAlign: align
|
|
7711
|
-
className: `${CLASSNAME$u}__tags`
|
|
7705
|
+
vAlign: align
|
|
7712
7706
|
}, tags));
|
|
7713
7707
|
};
|
|
7714
7708
|
|
|
@@ -7730,6 +7724,16 @@ const ImageBlockCaptionPosition = {
|
|
|
7730
7724
|
* Defines the props of the component.
|
|
7731
7725
|
*/
|
|
7732
7726
|
|
|
7727
|
+
/**
|
|
7728
|
+
* Component display name.
|
|
7729
|
+
*/
|
|
7730
|
+
const COMPONENT_NAME$x = 'ImageBlock';
|
|
7731
|
+
|
|
7732
|
+
/**
|
|
7733
|
+
* Component default class name and class prefix.
|
|
7734
|
+
*/
|
|
7735
|
+
const CLASSNAME$u = getRootClassName(COMPONENT_NAME$x);
|
|
7736
|
+
|
|
7733
7737
|
/**
|
|
7734
7738
|
* Component default props.
|
|
7735
7739
|
*/
|
|
@@ -7783,11 +7787,14 @@ const ImageBlock = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7783
7787
|
theme: theme,
|
|
7784
7788
|
alt: alt || title
|
|
7785
7789
|
})), /*#__PURE__*/React.createElement(ImageCaption, {
|
|
7790
|
+
className: `${CLASSNAME$u}__wrapper`,
|
|
7791
|
+
theme: theme,
|
|
7786
7792
|
title: title,
|
|
7787
7793
|
description: description,
|
|
7788
7794
|
tags: tags,
|
|
7789
7795
|
captionStyle: captionStyle,
|
|
7790
|
-
align: align
|
|
7796
|
+
align: align,
|
|
7797
|
+
truncate: captionPosition === 'over'
|
|
7791
7798
|
}), actions && /*#__PURE__*/React.createElement("div", {
|
|
7792
7799
|
className: `${CLASSNAME$u}__actions`
|
|
7793
7800
|
}, actions));
|