@landtrustinc/design-system 1.2.51-beta.1 → 1.2.51-beta.3

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.d.ts CHANGED
@@ -1502,6 +1502,11 @@ type CtaCardProps = {
1502
1502
  * Button URL/href
1503
1503
  */
1504
1504
  ctaUrl: string;
1505
+ /**
1506
+ * Whether to open the CTA link in a new tab
1507
+ * @default false
1508
+ */
1509
+ ctaOpenInNewTab?: boolean;
1505
1510
  /**
1506
1511
  * Callback fired when the CTA card is displayed/rendered
1507
1512
  * Useful for analytics tracking
package/dist/index.js CHANGED
@@ -6390,12 +6390,18 @@ var WidgetRoot = ({
6390
6390
  (0, import_react31.useEffect)(() => {
6391
6391
  if (!isExpanded)
6392
6392
  return;
6393
- const isMobile = window.matchMedia("(max-width: 767px)").matches;
6394
- if (!isMobile)
6395
- return;
6393
+ const mql = window.matchMedia(`(max-width: calc(${screens.lg} - 1px))`);
6396
6394
  const originalOverflow = document.body.style.overflow;
6397
- document.body.style.overflow = "hidden";
6395
+ const applyScrollLock = (isMobile) => {
6396
+ document.body.style.overflow = isMobile ? "hidden" : originalOverflow;
6397
+ };
6398
+ const handleChange = (e) => {
6399
+ applyScrollLock(e.matches);
6400
+ };
6401
+ applyScrollLock(mql.matches);
6402
+ mql.addEventListener("change", handleChange);
6398
6403
  return () => {
6404
+ mql.removeEventListener("change", handleChange);
6399
6405
  document.body.style.overflow = originalOverflow;
6400
6406
  };
6401
6407
  }, [isExpanded]);
@@ -6886,6 +6892,7 @@ var CtaCard = ({
6886
6892
  description,
6887
6893
  ctaLabel,
6888
6894
  ctaUrl,
6895
+ ctaOpenInNewTab = false,
6889
6896
  onDisplay,
6890
6897
  onCtaClick,
6891
6898
  className
@@ -6904,6 +6911,8 @@ var CtaCard = ({
6904
6911
  variant: "primary",
6905
6912
  size: "base",
6906
6913
  onClick: onCtaClick,
6914
+ target: ctaOpenInNewTab ? "_blank" : void 0,
6915
+ rel: ctaOpenInNewTab ? "noopener noreferrer" : void 0,
6907
6916
  children: ctaLabel
6908
6917
  }
6909
6918
  ) })