wex-ui-lib 1.1.8 → 1.1.91

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/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import React__default, { forwardRef, useContext, useState, useRef, useEffect, useImperativeHandle, useMemo, Children, useLayoutEffect, useCallback } from 'react';
2
+ import React__default, { forwardRef, useContext, useState, useEffect, useRef, useImperativeHandle, useMemo, Children, useLayoutEffect, useCallback } from 'react';
3
3
 
4
4
  /******************************************************************************
5
5
  Copyright (c) Microsoft Corporation.
@@ -2189,13 +2189,20 @@ var templateObject_1$5, templateObject_2$3, templateObject_3$2, templateObject_4
2189
2189
 
2190
2190
  function Hero(props) {
2191
2191
  var children = props.children, _a = props.imageUrls, imageUrls = _a === undefined ? [""] : _a, backgroundColor = props.backgroundColor, overlay = props.overlay, marginTop = props.marginTop, height = props.height;
2192
- var _b = useState(imageUrls[0] ? imageUrls[0] : ""), activeBackgroundUrl = _b[0]; _b[1];
2193
- return (React__default.createElement(React__default.Fragment, null,
2194
- React__default.createElement(Container$3, { backgroundUrl: activeBackgroundUrl, marginTop: marginTop, height: height, backgroundColor: backgroundColor },
2195
- overlay && (React__default.createElement(Overlay, { color: overlay.color, opacity: overlay.opacity })),
2196
- React__default.createElement(HeroContent, null, children))));
2192
+ var _b = useState(0), activeIndex = _b[0], setActiveIndex = _b[1];
2193
+ useEffect(function () {
2194
+ if (imageUrls.length > 1) {
2195
+ var interval_1 = setInterval(function () {
2196
+ setActiveIndex(function (prevIndex) { return (prevIndex + 1) % imageUrls.length; });
2197
+ }, 4500);
2198
+ return function () { return clearInterval(interval_1); };
2199
+ }
2200
+ }, [imageUrls]);
2201
+ return (React__default.createElement(Container$3, { backgroundUrl: imageUrls[activeIndex] || "", marginTop: marginTop, height: height, backgroundColor: backgroundColor },
2202
+ overlay && (React__default.createElement(Overlay, { color: overlay.color, opacity: overlay.opacity })),
2203
+ React__default.createElement(HeroContent, null, children)));
2197
2204
  }
2198
- var Container$3 = newStyled.div(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n position: relative;\n width: 100vw;\n height: ", ";\n margin-top: ", ";\n background-image: url(", ");\n background-color: ", ";\n background-position-y: 69%;\n background-size: cover;\n @media only screen and (max-width: 800px) {\n padding: 80px 10px;\n svg {\n max-height: 300px;\n transform: translateX(20px);\n }\n }\n"], ["\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n position: relative;\n width: 100vw;\n height: ", ";\n margin-top: ", ";\n background-image: url(", ");\n background-color: ", ";\n background-position-y: 69%;\n background-size: cover;\n @media only screen and (max-width: 800px) {\n padding: 80px 10px;\n svg {\n max-height: 300px;\n transform: translateX(20px);\n }\n }\n"])), function (props) { return props.height ? "calc(".concat(props.height, " - ").concat(props.marginTop || '0px', ")") : '100vh'; }, function (props) { return props.marginTop; }, function (props) { return props.backgroundUrl; }, function (props) { return props.backgroundColor || 'none'; });
2205
+ var Container$3 = newStyled.div(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n width: 100vw;\n height: ", ";\n margin-top: ", ";\n background-image: url(", ");\n background-color: ", ";\n background-position-y: 69%;\n background-size: cover;\n transition: background-image 1s ease-in-out;\n\n @media only screen and (max-width: 800px) {\n padding: 80px 10px;\n svg {\n max-height: 300px;\n transform: translateX(20px);\n }\n }\n"], ["\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n width: 100vw;\n height: ", ";\n margin-top: ", ";\n background-image: url(", ");\n background-color: ", ";\n background-position-y: 69%;\n background-size: cover;\n transition: background-image 1s ease-in-out;\n\n @media only screen and (max-width: 800px) {\n padding: 80px 10px;\n svg {\n max-height: 300px;\n transform: translateX(20px);\n }\n }\n"])), function (props) { return props.height ? "calc(".concat(props.height, " - ").concat(props.marginTop || '0px', ")") : '100vh'; }, function (props) { return props.marginTop; }, function (props) { return props.backgroundUrl; }, function (props) { return props.backgroundColor || 'none'; });
2199
2206
  var Overlay = newStyled.div(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n z-index: 1;\n background-color: ", ";\n opacity: ", ";\n"], ["\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n z-index: 1;\n background-color: ", ";\n opacity: ", ";\n"])), function (props) { return props.color; }, function (props) { return props.opacity; });
2200
2207
  var HeroContent = newStyled.div(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n z-index: 2;\n"], ["\n width: 100%;\n height: 100%;\n z-index: 2;\n"])));
2201
2208
  var templateObject_1$4, templateObject_2$2, templateObject_3$1;
@@ -2398,7 +2405,7 @@ function Showcase(props) {
2398
2405
  var _a = useState(undefined), hoveredItemKey = _a[0], setHoveredItemKey = _a[1];
2399
2406
  var eightItems = useMemo(function () {
2400
2407
  if (items.length >= 8) {
2401
- return items.slice(0, 7);
2408
+ return items.slice(0, 8);
2402
2409
  }
2403
2410
  var result = [];
2404
2411
  var i = 0;