@treely/strapi-slices 5.3.1 → 5.3.2

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.
@@ -3,12 +3,6 @@
3
3
  export declare const SliderContainer: import("@emotion/styled").StyledComponent<import("@chakra-ui/system/dist/system.types").MergeWithAs<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, Omit<import("@chakra-ui/system/dist/system.types").ChakraProps, never>, import("@chakra-ui/system/dist/system.types").As> & {
4
4
  theme?: import("@emotion/react").Theme | undefined;
5
5
  }, {}, {}>;
6
- interface ButtonsContainerProps {
7
- show: string;
8
- }
9
- export declare const ButtonsContainer: import("@emotion/styled").StyledComponent<(import("@chakra-ui/system/dist/system.types").MergeWithAs<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, Omit<import("@chakra-ui/system/dist/system.types").ChakraProps, never>, import("@chakra-ui/system/dist/system.types").As> & {
10
- theme?: import("@emotion/react").Theme | undefined;
11
- }) & ButtonsContainerProps, {}, {}>;
12
6
  interface SliderInnerContainerProps {
13
7
  imageCount: number;
14
8
  }
@@ -1418,12 +1418,12 @@ var LogoGridWithText = function LogoGridWithText(_ref) {
1418
1418
  })))));
1419
1419
  };
1420
1420
 
1421
- var _templateObject$7, _templateObject2$4, _templateObject3$2, _templateObject4$1, _templateObject5$1;
1421
+ var _templateObject$7, _templateObject2$4, _templateObject3$2, _templateObject4$1, _templateObject5;
1422
1422
  var MapHeroContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject$7 || (_templateObject$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 100vw;\n height: var(--default-hero-height);\n min-height: var(--boemly-sizes-3xl);\n background-color: var(--boemly-colors-primary-50);\n overflow: hidden;\n z-index: var(--boemly-zIndices-base);\n\n @media screen and (max-width: ", ") {\n height: auto;\n }\n"])), BREAKPOINT_LG);
1423
1423
  var MapHeroTextContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject2$4 || (_templateObject2$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n width: 100vw;\n top: 56%;\n left: 0;\n transform: translateY(-50%);\n z-index: var(--boemly-zIndices-aboveBase);\n\n @media screen and (max-width: ", ") {\n position: relative;\n transform: unset;\n\n padding-top: var(--boemly-space-32);\n }\n"])), BREAKPOINT_LG);
1424
1424
  var ShapeContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject3$2 || (_templateObject3$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: calc(var(--boemly-space-8) * -1);\n left: 0;\n\n width: var(--boemly-sizes-sm);\n height: var(--boemly-sizes-sm);\n\n border-top-right-radius: var(--boemly-radii-full);\n\n & span,\n div {\n border-top-right-radius: var(--boemly-radii-full);\n }\n\n @media screen and (max-width: ", ") {\n display: none;\n }\n"])), BREAKPOINT_LG);
1425
1425
  var MapContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject4$1 || (_templateObject4$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n\n width: 50%;\n height: 100%;\n\n right: 0;\n top: 0;\n\n & img {\n object-fit: cover !important;\n }\n\n @media screen and (max-width: ", ") {\n width: 100%;\n height: var(--boemly-sizes-4xl);\n position: relative;\n margin-top: calc(var(--boemly-space-72) * -1);\n background-color: var(--boemly-colors-white);\n\n & img {\n object-fit: contain !important;\n }\n }\n"])), BREAKPOINT_LG);
1426
- var MapGradient = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject5$1 || (_templateObject5$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n\n background: linear-gradient(\n 90deg,\n var(--boemly-colors-primary-50) 0%,\n var(--boemly-colors-primary-50) 10%,\n rgba(243, 246, 245, 0.6) 28%,\n rgba(243, 246, 245, 0) 40%,\n rgba(243, 246, 245, 0) 100%\n );\n\n @media screen and (max-width: ", ") {\n background: linear-gradient(\n 180deg,\n var(--boemly-colors-primary-50) 0%,\n var(--boemly-colors-primary-50) 36%,\n rgba(243, 246, 245, 0.12) 46%,\n rgba(243, 246, 245, 0) 100%\n );\n }\n"])), BREAKPOINT_LG);
1426
+ var MapGradient = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject5 || (_templateObject5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n\n background: linear-gradient(\n 90deg,\n var(--boemly-colors-primary-50) 0%,\n var(--boemly-colors-primary-50) 10%,\n rgba(243, 246, 245, 0.6) 28%,\n rgba(243, 246, 245, 0) 40%,\n rgba(243, 246, 245, 0) 100%\n );\n\n @media screen and (max-width: ", ") {\n background: linear-gradient(\n 180deg,\n var(--boemly-colors-primary-50) 0%,\n var(--boemly-colors-primary-50) 36%,\n rgba(243, 246, 245, 0.12) 46%,\n rgba(243, 246, 245, 0) 100%\n );\n }\n"])), BREAKPOINT_LG);
1427
1427
 
1428
1428
  var MapHero = function MapHero(_ref) {
1429
1429
  var slice = _ref.slice;
@@ -2251,8 +2251,8 @@ var ContextProvider = function ContextProvider(_ref) {
2251
2251
  }, children));
2252
2252
  };
2253
2253
 
2254
- var ITEM_GAP = 24;
2255
- var MAX_OFFSET_RIGHT = 55;
2254
+ var ITEM_GAP$1 = 24;
2255
+ var MAX_OFFSET_RIGHT$1 = 55;
2256
2256
  var TextCarousel = function TextCarousel(_ref) {
2257
2257
  var slice = _ref.slice;
2258
2258
  var containerRef = React.useRef(null);
@@ -2272,17 +2272,17 @@ var TextCarousel = function TextCarousel(_ref) {
2272
2272
  return slice.slides.length;
2273
2273
  }, [slice.slides.length]);
2274
2274
  var sliderItemsWidth = React.useMemo(function () {
2275
- return numberOfItems * (itemWidth + ITEM_GAP) - ITEM_GAP;
2275
+ return numberOfItems * (itemWidth + ITEM_GAP$1) - ITEM_GAP$1;
2276
2276
  }, [itemWidth, numberOfItems]);
2277
2277
  var offsetLeft = React.useMemo(function () {
2278
- return sliderIndex * (itemWidth + ITEM_GAP) * -1;
2278
+ return sliderIndex * (itemWidth + ITEM_GAP$1) * -1;
2279
2279
  }, [sliderIndex, itemWidth]);
2280
2280
  var allowScroll = React.useMemo(function () {
2281
- return sliderItemsWidth + ITEM_GAP * 2 > windowWidth;
2281
+ return sliderItemsWidth + ITEM_GAP$1 * 2 > windowWidth;
2282
2282
  }, [sliderItemsWidth, windowWidth]);
2283
2283
  var canMoveRight = React.useMemo(function () {
2284
2284
  var offsetRight = windowWidth - (sliderItemsWidth + offsetLeft);
2285
- return offsetRight < MAX_OFFSET_RIGHT;
2285
+ return offsetRight < MAX_OFFSET_RIGHT$1;
2286
2286
  }, [itemWidth, sliderIndex, sliderItemsWidth, windowWidth]);
2287
2287
  var canMoveLeft = React.useMemo(function () {
2288
2288
  return sliderIndex !== 0;
@@ -3180,19 +3180,15 @@ var FullWidthHighlightQuote = function FullWidthHighlightQuote(_ref) {
3180
3180
  })));
3181
3181
  };
3182
3182
 
3183
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
3183
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
3184
3184
  var SliderContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n --mobile-image-width: calc(100vw - var(--boemly-space-24));\n --desktop-image-width: var(--boemly-sizes-md);\n\n width: var(--boemly-size-full);\n\n overflow-x: hidden;\n\n padding-left: max(\n var(--boemly-space-8),\n calc(50vw - var(--boemly-sizes-7xl) / 2 + var(--boemly-space-6))\n );\n\n @media screen and (max-width: ", ") {\n overflow-x: scroll;\n padding-left: max(\n var(--boemly-space-8),\n calc(50vw - var(--boemly-sizes-7xl) / 2 + var(--boemly-space-8))\n );\n }\n"])), BREAKPOINT_MD);
3185
- var ButtonsContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: ", ";\n pointer-events: none;\n\n // Place at 50% of height of tallest image minus size of button\n position: absolute;\n top: calc(50% - var(--boemly-sizes-12));\n left: 0;\n width: var(--boemly-sizes-full);\n\n padding: 0 var(--boemly-sizes-32);\n justify-content: space-between;\n\n @media screen and (max-width: ", ") {\n display: none;\n }\n"])), function (_ref) {
3186
- var show = _ref.show;
3187
- return show ? 'flex' : 'none';
3188
- }, BREAKPOINT_MD);
3189
- var SliderInnerContainer = /*#__PURE__*/styled__default.default(framerMotion.motion.div)(_templateObject3 || (_templateObject3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: var(--boemly-space-6);\n\n width: fit-content;\n"])));
3190
- var ItemContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject4 || (_templateObject4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: var(--desktop-image-width);\n\n :last-of-type {\n margin-right: var(--boemly-space-8);\n }\n\n @media screen and (max-width: ", ") {\n width: var(--mobile-image-width);\n }\n"])), BREAKPOINT_MD);
3191
- var ImageContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject5 || (_templateObject5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n\n max-height: var(--boemly-sizes-xl);\n height: calc(\n var(--desktop-image-width) /\n ", "\n );\n width: var(--desktop-image-width);\n\n border-radius: var(--boemly-radii-xl);\n\n & img {\n border-radius: var(--boemly-radii-xl);\n }\n\n @media screen and (max-width: ", ") {\n height: calc(\n var(--mobile-image-width) /\n ", "\n );\n width: var(--mobile-image-width);\n }\n"])), function (_ref2) {
3192
- var aspectRatio = _ref2.aspectRatio;
3185
+ var SliderInnerContainer = /*#__PURE__*/styled__default.default(framerMotion.motion.div)(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: var(--boemly-space-6);\n\n width: fit-content;\n"])));
3186
+ var ItemContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject3 || (_templateObject3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: var(--desktop-image-width);\n\n :last-of-type {\n margin-right: var(--boemly-space-8);\n }\n\n @media screen and (max-width: ", ") {\n width: var(--mobile-image-width);\n }\n"])), BREAKPOINT_MD);
3187
+ var ImageContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateObject4 || (_templateObject4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n\n max-height: var(--boemly-sizes-xl);\n height: calc(\n var(--desktop-image-width) /\n ", "\n );\n width: var(--desktop-image-width);\n\n border-radius: var(--boemly-radii-xl);\n\n & img {\n border-radius: var(--boemly-radii-xl);\n }\n\n @media screen and (max-width: ", ") {\n height: calc(\n var(--mobile-image-width) /\n ", "\n );\n width: var(--mobile-image-width);\n }\n"])), function (_ref) {
3188
+ var aspectRatio = _ref.aspectRatio;
3193
3189
  return aspectRatio;
3194
- }, BREAKPOINT_MD, function (_ref3) {
3195
- var aspectRatio = _ref3.aspectRatio;
3190
+ }, BREAKPOINT_MD, function (_ref2) {
3191
+ var aspectRatio = _ref2.aspectRatio;
3196
3192
  return aspectRatio;
3197
3193
  });
3198
3194
 
@@ -3210,6 +3206,8 @@ var getClosestRatio = function getClosestRatio(width, height) {
3210
3206
  return ALLOWED_RATIOS[posMinDiff];
3211
3207
  };
3212
3208
 
3209
+ var ITEM_GAP = 24;
3210
+ var MAX_OFFSET_RIGHT = 162;
3213
3211
  var FullWidthImageSlider = function FullWidthImageSlider(_ref) {
3214
3212
  var slice = _ref.slice;
3215
3213
  var containerRef = React.useRef(null);
@@ -3226,9 +3224,25 @@ var FullWidthImageSlider = function FullWidthImageSlider(_ref) {
3226
3224
  var _useState2 = React.useState(false),
3227
3225
  isOpen = _useState2[0],
3228
3226
  setIsOpen = _useState2[1];
3229
- var allowScroll = windowWidth / 2 / imageWidth < slice.images.length;
3230
- var canMoveRight = sliderIndex < slice.images.length - 1;
3231
- var canMoveLeft = sliderIndex !== 0;
3227
+ var numberOfItems = React.useMemo(function () {
3228
+ return slice.images.length;
3229
+ }, [slice.images.length]);
3230
+ var sliderItemsWidth = React.useMemo(function () {
3231
+ return numberOfItems * (imageWidth + ITEM_GAP) - ITEM_GAP;
3232
+ }, [imageWidth, numberOfItems]);
3233
+ var offsetLeft = React.useMemo(function () {
3234
+ return sliderIndex * (imageWidth + ITEM_GAP) * -1;
3235
+ }, [sliderIndex, imageWidth]);
3236
+ var allowScroll = React.useMemo(function () {
3237
+ return sliderItemsWidth + ITEM_GAP * 3 > windowWidth;
3238
+ }, [sliderItemsWidth, windowWidth]);
3239
+ var canMoveRight = React.useMemo(function () {
3240
+ var offsetRight = windowWidth - (sliderItemsWidth + offsetLeft);
3241
+ return offsetRight < MAX_OFFSET_RIGHT;
3242
+ }, [imageWidth, sliderIndex, sliderItemsWidth, windowWidth]);
3243
+ var canMoveLeft = React.useMemo(function () {
3244
+ return sliderIndex !== 0;
3245
+ }, [sliderIndex]);
3232
3246
  return React__default.default.createElement(boemly.DefaultSectionContainer, null, React__default.default.createElement(SliderContainer, {
3233
3247
  ref: containerRef
3234
3248
  }, React__default.default.createElement(SliderInnerContainer, {
@@ -3267,8 +3281,16 @@ var FullWidthImageSlider = function FullWidthImageSlider(_ref) {
3267
3281
  })), React__default.default.createElement(boemly.Text, {
3268
3282
  height: "6"
3269
3283
  }, image.caption)));
3270
- }))), React__default.default.createElement(ButtonsContainer, {
3271
- show: (allowScroll && !isOpen).toString()
3284
+ }))), React__default.default.createElement(boemly.Box, {
3285
+ display: ['none', null, null, !!allowScroll ? 'flex' : 'none'],
3286
+ pointerEvents: "none",
3287
+ position: "absolute",
3288
+ top: "calc(50% - var(--boemly-sizes-12))",
3289
+ left: "0",
3290
+ width: "full",
3291
+ py: "0",
3292
+ px: "32",
3293
+ justifyContent: "space-between"
3272
3294
  }, React__default.default.createElement(boemly.Box, null, React__default.default.createElement(framerMotion.AnimatePresence, null, canMoveLeft && React__default.default.createElement(boemly.IconButton, {
3273
3295
  key: "leftButton",
3274
3296
  as: framerMotion.motion.button,