@bettercms-ai/ui 0.14.0 → 0.15.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/dist/registry.js CHANGED
@@ -577,7 +577,7 @@ function Image({
577
577
  }
578
578
 
579
579
  // src/blocks/Button.tsx
580
- import { buttonIconOf, buttonIconSvg, buttonVariantOf } from "@bettercms-ai/types";
580
+ import { LINK_RELS, buttonIconOf, buttonIconSvg, buttonVariantOf, isScriptHref } from "@bettercms-ai/types";
581
581
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
582
582
  function Button({
583
583
  text,
@@ -588,6 +588,7 @@ function Button({
588
588
  arrow = false,
589
589
  icon: iconProp,
590
590
  newTab = false,
591
+ rel,
591
592
  align = "left",
592
593
  className = "",
593
594
  style,
@@ -618,11 +619,13 @@ function Button({
618
619
  };
619
620
  const sizeClass = size === "sm" || size === "lg" ? sizeStyles[size] : sizeStyles.md;
620
621
  const fullClass = fullWidth === true ? "flex w-full justify-center" : "";
622
+ const relTokens = [...newTab === true ? ["noopener", "noreferrer"] : [], ...LINK_RELS.includes(rel) ? [rel] : []];
621
623
  return /* @__PURE__ */ jsxs3(
622
624
  "a",
623
625
  {
624
- href,
625
- ...newTab === true ? { target: "_blank", rel: "noopener noreferrer" } : {},
626
+ href: typeof href === "string" && isScriptHref(href) ? "#" : href,
627
+ ...newTab === true ? { target: "_blank" } : {},
628
+ ...relTokens.length ? { rel: relTokens.join(" ") } : {},
626
629
  "data-bcms-field": field,
627
630
  "data-bcms-kind": kind,
628
631
  style,