@treely/strapi-slices 6.0.3 → 6.1.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/README.md +1 -1
- package/dist/models/strapi/StrapiTextCardWithIcons.d.ts +3 -0
- package/dist/slices/TextCarousel/TextCarousel.stories.d.ts +1 -0
- package/dist/strapi-slices.cjs.development.js +20 -1
- package/dist/strapi-slices.cjs.development.js.map +1 -1
- package/dist/strapi-slices.cjs.production.min.js +1 -1
- package/dist/strapi-slices.cjs.production.min.js.map +1 -1
- package/dist/strapi-slices.esm.js +20 -1
- package/dist/strapi-slices.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/models/strapi/StrapiTextCardWithIcons.ts +3 -0
- package/src/slices/TextCarousel/TextCarousel.stories.tsx +66 -51
- package/src/slices/TextCarousel/TextCarousel.test.tsx +43 -0
- package/src/slices/TextCarousel/TextCarousel.tsx +23 -1
package/README.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import StrapiImage from './StrapiImage';
|
|
2
|
+
import StrapiLink from './StrapiLink';
|
|
2
3
|
interface StrapiTextCardWithIcon {
|
|
3
4
|
id: number;
|
|
4
5
|
title: string;
|
|
5
6
|
text: string;
|
|
6
7
|
icon: StrapiImage;
|
|
8
|
+
button?: StrapiLink;
|
|
9
|
+
image?: StrapiImage;
|
|
7
10
|
}
|
|
8
11
|
export default StrapiTextCardWithIcon;
|
|
@@ -4,3 +4,4 @@ export declare const Minimal: import("@storybook/types").AnnotatedStoryFn<import
|
|
|
4
4
|
export declare const WithTagline: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./TextCarousel").TextCarouselProps>;
|
|
5
5
|
export declare const WithTaglineAndText: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./TextCarousel").TextCarouselProps>;
|
|
6
6
|
export declare const WithButton: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./TextCarousel").TextCarouselProps>;
|
|
7
|
+
export declare const FullProps: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./TextCarousel").TextCarouselProps>;
|
|
@@ -2555,6 +2555,8 @@ var TextCarousel = function TextCarousel(_ref) {
|
|
|
2555
2555
|
formatMessage = _useContext.formatMessage;
|
|
2556
2556
|
var _useWindowSize = reactUse.useWindowSize(),
|
|
2557
2557
|
windowWidth = _useWindowSize.width;
|
|
2558
|
+
var _useRouter = router.useRouter(),
|
|
2559
|
+
push = _useRouter.push;
|
|
2558
2560
|
var _useState = React.useState(0),
|
|
2559
2561
|
sliderIndex = _useState[0],
|
|
2560
2562
|
setSliderIndex = _useState[1];
|
|
@@ -2615,7 +2617,9 @@ var TextCarousel = function TextCarousel(_ref) {
|
|
|
2615
2617
|
var id = _ref2.id,
|
|
2616
2618
|
title = _ref2.title,
|
|
2617
2619
|
text = _ref2.text,
|
|
2618
|
-
icon = _ref2.icon
|
|
2620
|
+
icon = _ref2.icon,
|
|
2621
|
+
image = _ref2.image,
|
|
2622
|
+
button = _ref2.button;
|
|
2619
2623
|
return React__default.default.createElement(CardContainer, {
|
|
2620
2624
|
key: id,
|
|
2621
2625
|
ref: itemRef
|
|
@@ -2631,6 +2635,21 @@ var TextCarousel = function TextCarousel(_ref) {
|
|
|
2631
2635
|
objectFit: icon.objectFit || 'contain'
|
|
2632
2636
|
}
|
|
2633
2637
|
}),
|
|
2638
|
+
image: image && React__default.default.createElement(Image__default.default, {
|
|
2639
|
+
src: strapiMediaUrl(image == null ? void 0 : image.img, 'medium'),
|
|
2640
|
+
alt: image == null ? void 0 : image.alt,
|
|
2641
|
+
fill: true,
|
|
2642
|
+
style: {
|
|
2643
|
+
objectFit: (image == null ? void 0 : image.objectFit) || 'cover',
|
|
2644
|
+
borderRadius: 'var(--boemly-radii-xl)'
|
|
2645
|
+
}
|
|
2646
|
+
}),
|
|
2647
|
+
button: button && {
|
|
2648
|
+
text: button.text,
|
|
2649
|
+
onClick: function onClick() {
|
|
2650
|
+
return push(strapiLinkUrl(button));
|
|
2651
|
+
}
|
|
2652
|
+
},
|
|
2634
2653
|
displayAs: "column"
|
|
2635
2654
|
}));
|
|
2636
2655
|
})), React__default.default.createElement(boemly.Box, {
|