opus-toolkit-components 1.0.9 → 1.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.
@@ -12911,7 +12911,6 @@ function Loader(_ref) {
12911
12911
  }
12912
12912
  ;// external "opus-toolkit-styles/assets/logos/footer-logos.svg"
12913
12913
  const footer_logos_svg_namespaceObject = require("opus-toolkit-styles/assets/logos/footer-logos.svg");
12914
- var footer_logos_svg_default = /*#__PURE__*/__webpack_require__.n(footer_logos_svg_namespaceObject);
12915
12914
  ;// ./src/components/Cookies/CookieBanner.js
12916
12915
 
12917
12916
 
@@ -12922,32 +12921,54 @@ const CookieBanner = _ref => {
12922
12921
  logo,
12923
12922
  policyTxt = "This website uses cookies to ensure you get the best experience on our site. By clicking Accept, you consent to the use of cookies.",
12924
12923
  linkTxt = "Learn More",
12925
- // New props for control
12926
12924
  isVisible = true,
12927
- // show/hide banner
12928
12925
  onAccept = () => {},
12929
- // accept button handler
12930
- onLearnMore = () => {} // Learn More click handler
12926
+ onLearnMore = () => {}
12931
12927
  } = _ref;
12932
- if (!isVisible) return null; // hide banner if not visible
12928
+ const [show, setShow] = (0,external_react_.useState)(false);
12929
+ const [render, setRender] = (0,external_react_.useState)(isVisible);
12930
+ const [imageLoaded, setImageLoaded] = (0,external_react_.useState)(!logo); // if no logo image, consider loaded
12933
12931
 
12932
+ (0,external_react_.useEffect)(() => {
12933
+ if (isVisible) {
12934
+ setRender(true);
12935
+ if (logo) setImageLoaded(false);
12936
+ } else {
12937
+ setShow(false);
12938
+ const timeout = setTimeout(() => setRender(false), 300);
12939
+ return () => clearTimeout(timeout);
12940
+ }
12941
+ }, [isVisible]);
12942
+ (0,external_react_.useEffect)(() => {
12943
+ if (imageLoaded && render) {
12944
+ const timeout = setTimeout(() => setShow(true), 10);
12945
+ return () => clearTimeout(timeout);
12946
+ }
12947
+ }, [imageLoaded, render]);
12948
+ if (!render) return null;
12934
12949
  return /*#__PURE__*/external_react_default().createElement(Card, {
12935
12950
  intent: "brandSecondary",
12936
- className: "flex items-center justify-between p-4 space-x-4"
12951
+ className: "\n flex items-center justify-between p-4 space-x-4\n transition-all duration-300 ease-in-out\n ".concat(show ? "opacity-100 translate-y-0" : "opacity-0 translate-y-3", "\n ")
12937
12952
  }, /*#__PURE__*/external_react_default().createElement("div", {
12938
12953
  className: "flex items-center"
12939
- }, /*#__PURE__*/external_react_default().createElement("img", {
12940
- src: logo || (footer_logos_svg_default()),
12954
+ }, /*#__PURE__*/external_react_default().createElement("div", {
12955
+ className: "flex-shrink-0 mr-4"
12956
+ }, logo ? /*#__PURE__*/external_react_default().createElement("img", {
12957
+ src: logo,
12941
12958
  alt: "C247 Logo",
12942
- className: "mr-4"
12943
- }), /*#__PURE__*/external_react_default().createElement("p", {
12959
+ className: "w-full object-contain",
12960
+ onLoad: () => setImageLoaded(true),
12961
+ loading: "eager"
12962
+ }) : /*#__PURE__*/external_react_default().createElement(footer_logos_svg_namespaceObject.ReactComponent, {
12963
+ className: "w-full h-full"
12964
+ })), /*#__PURE__*/external_react_default().createElement("p", {
12944
12965
  className: "mr-4"
12945
12966
  }, policyTxt)), /*#__PURE__*/external_react_default().createElement("div", {
12946
12967
  className: "flex items-center space-x-4"
12947
12968
  }, /*#__PURE__*/external_react_default().createElement(Button, {
12948
12969
  rank: "primary",
12949
12970
  text: "Accept",
12950
- onClick: onAccept // call passed handler
12971
+ onClick: onAccept
12951
12972
  }), /*#__PURE__*/external_react_default().createElement(Button, {
12952
12973
  rank: "secondary",
12953
12974
  text: linkTxt,
@@ -12977,4 +12998,4 @@ const CookieBanner = _ref => {
12977
12998
  /******/ })()
12978
12999
  ;
12979
13000
  });
12980
- //# sourceMappingURL=main.5d4f09a62f10ac5f2dda.js.map
13001
+ //# sourceMappingURL=main.2a8cccc6fccd0826ee8d.js.map