@treely/strapi-slices 6.0.3 → 6.1.1

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 CHANGED
@@ -17,7 +17,7 @@ npm install
17
17
  Run the app in DEV mode:
18
18
 
19
19
  ```bash
20
- npm run dev
20
+ npm run storybook
21
21
  ```
22
22
 
23
23
  Run the linter:
@@ -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>;
@@ -2272,14 +2272,14 @@ var TextCardGrid = function TextCardGrid(_ref) {
2272
2272
 
2273
2273
  var _templateObject$5, _templateObject2$2, _templateObject3$1;
2274
2274
  var CarouselContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject$5 || (_templateObject$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-top: var(--boemly-space-6);\n padding: var(--boemly-space-8) 0;\n\n @media screen and (max-width: ", ") {\n margin-top: var(--boemly-space-4);\n width: var(--boemly-sizes-full);\n }\n\n width: var(--boemly-sizes-full);\n\n overflow-x: hidden;\n\n @media screen and (max-width: ", ") {\n overflow-x: scroll;\n }\n"])), BREAKPOINT_MD, BREAKPOINT_MD);
2275
- var CarouselInnerContainer = /*#__PURE__*/styled__default.default(framerMotion.motion.div)(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: var(--boemly-space-6);\n justify-content: center;\n\n width: calc(\n (var(--boemly-sizes-sm) + var(--boemly-space-6)) *\n ", " +\n var(--boemly-space-6)\n );\n min-width: var(--boemly-sizes-full);\n\n @media screen and (max-width: ", ") {\n justify-content: flex-start;\n width: calc(\n (var(--boemly-sizes-2xs) + var(--boemly-space-4)) *\n ", " +\n var(--boemly-space-6)\n );\n }\n"])), function (_ref) {
2275
+ var CarouselInnerContainer = /*#__PURE__*/styled__default.default(framerMotion.motion.div)(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: var(--boemly-space-6);\n justify-content: center;\n\n width: calc(\n (var(--boemly-sizes-sm) + var(--boemly-space-6)) *\n ", " +\n var(--boemly-space-6)\n );\n min-width: var(--boemly-sizes-full);\n\n @media screen and (max-width: ", ") {\n gap: var(--boemly-space-1);\n justify-content: flex-start;\n width: calc(\n (var(--boemly-sizes-2xs) + var(--boemly-space-4)) *\n ", " +\n var(--boemly-space-6)\n );\n }\n"])), function (_ref) {
2276
2276
  var numberOfItems = _ref.numberOfItems;
2277
2277
  return numberOfItems;
2278
2278
  }, BREAKPOINT_MD, function (_ref2) {
2279
2279
  var numberOfItems = _ref2.numberOfItems;
2280
2280
  return numberOfItems;
2281
2281
  });
2282
- var CardContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject3$1 || (_templateObject3$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: var(--boemly-sizes-sm);\n\n @media screen and (max-width: ", ") {\n width: var(--boemly-sizes-2xs);\n\n margin-right: var(--boemly-space-4);\n\n &:first-of-type {\n margin-left: var(--boemly-space-6);\n }\n }\n"])), BREAKPOINT_MD);
2282
+ var CardContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject3$1 || (_templateObject3$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: var(--boemly-sizes-sm);\n\n @media screen and (max-width: ", ") {\n min-width: var(--boemly-sizes-sm);\n\n margin-right: var(--boemly-space-4);\n\n &:first-of-type {\n margin-left: var(--boemly-space-6);\n }\n }\n"])), BREAKPOINT_MD);
2283
2283
 
2284
2284
  var _templateObject$4;
2285
2285
  var GLOBAL_STYLE = /*#__PURE__*/react$1.css(_templateObject$4 || (_templateObject$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n :root {\n --default-hero-height: calc(100vh - var(--boemly-space-24));\n }\n\n a {\n text-decoration: none;\n }\n"])));
@@ -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, {