@bettercms-ai/ui 0.15.0 → 0.16.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.
- package/dist/{Video-c2HnnOCp.d.ts → Video-vB2IlrdH.d.ts} +1 -1
- package/dist/blocks.d.ts +1 -1
- package/dist/blocks.js +14 -3
- package/dist/blocks.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/registry.js +14 -3
- package/dist/registry.js.map +1 -1
- package/dist/renderer.js +14 -3
- package/dist/renderer.js.map +1 -1
- package/dist/resolve.d.ts +5 -2
- package/dist/resolve.js +66 -12
- package/dist/resolve.js.map +1 -1
- package/package.json +2 -2
|
@@ -49,7 +49,7 @@ interface ButtonBlockProps extends ButtonProps, BcmsBindingProps {
|
|
|
49
49
|
/** The block style's paint (`splitButtonStyle(style).paint`), on the anchor itself. */
|
|
50
50
|
style?: CSSProperties;
|
|
51
51
|
}
|
|
52
|
-
declare function Button({ text, href, variant, size, fullWidth, arrow, icon: iconProp, newTab, align, className, style, "data-bcms-field": field, "data-bcms-kind": kind, }: ButtonBlockProps): react_jsx_runtime.JSX.Element;
|
|
52
|
+
declare function Button({ text, href, variant, size, fullWidth, arrow, icon: iconProp, newTab, rel, action, align, className, style, "data-bcms-field": field, "data-bcms-kind": kind, }: ButtonBlockProps): react_jsx_runtime.JSX.Element;
|
|
53
53
|
|
|
54
54
|
interface SpacerBlockProps extends SpacerProps {
|
|
55
55
|
className?: string;
|
package/dist/blocks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as Button, C as Columns, H as Heading, I as Image, S as Spacer, T as Text, V as Video } from './Video-
|
|
1
|
+
export { a as Button, C as Columns, H as Heading, I as Image, S as Spacer, T as Text, V as Video } from './Video-vB2IlrdH.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { SectionProps, ContentBlock, NavbarProps, FooterProps, SliderProps, TabsProps, ComponentProps, FormProps } from '@bettercms-ai/types';
|
|
4
4
|
import React from 'react';
|
package/dist/blocks.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,8 @@ function Button({
|
|
|
588
588
|
arrow = false,
|
|
589
589
|
icon: iconProp,
|
|
590
590
|
newTab = false,
|
|
591
|
+
rel,
|
|
592
|
+
action,
|
|
591
593
|
align = "left",
|
|
592
594
|
className = "",
|
|
593
595
|
style,
|
|
@@ -618,11 +620,20 @@ function Button({
|
|
|
618
620
|
};
|
|
619
621
|
const sizeClass = size === "sm" || size === "lg" ? sizeStyles[size] : sizeStyles.md;
|
|
620
622
|
const fullClass = fullWidth === true ? "flex w-full justify-center" : "";
|
|
623
|
+
const relTokens = [...newTab === true ? ["noopener", "noreferrer"] : [], ...LINK_RELS.includes(rel) ? [rel] : []];
|
|
624
|
+
if (action === "code") {
|
|
625
|
+
return /* @__PURE__ */ jsxs3("button", { type: "button", "data-bcms-field": field, "data-bcms-kind": kind, style, className: cn(baseStyles, variantStyles[buttonVariantOf(variant)], alignClass, sizeClass, fullClass, className), children: [
|
|
626
|
+
icon && /* @__PURE__ */ jsx5("span", { className: "mr-2 inline-flex", dangerouslySetInnerHTML: { __html: buttonIconSvg(icon, "bcms-btn-icon") } }),
|
|
627
|
+
text,
|
|
628
|
+
arrow === true && /* @__PURE__ */ jsx5("span", { className: "ml-2 inline-flex", dangerouslySetInnerHTML: { __html: buttonIconSvg("arrow-right", "bcms-btn-arrow") } })
|
|
629
|
+
] });
|
|
630
|
+
}
|
|
621
631
|
return /* @__PURE__ */ jsxs3(
|
|
622
632
|
"a",
|
|
623
633
|
{
|
|
624
|
-
href,
|
|
625
|
-
...newTab === true ? { target: "_blank"
|
|
634
|
+
href: typeof href === "string" && isScriptHref(href) ? "#" : href,
|
|
635
|
+
...newTab === true ? { target: "_blank" } : {},
|
|
636
|
+
...relTokens.length ? { rel: relTokens.join(" ") } : {},
|
|
626
637
|
"data-bcms-field": field,
|
|
627
638
|
"data-bcms-kind": kind,
|
|
628
639
|
style,
|