@theorem/react
Advanced tools
Comparing version 6.2.3 to 6.3.0
@@ -1,2 +0,2 @@ | ||
import type { CSSProperties, ReactNode } from "react"; | ||
import type { AnchorHTMLAttributes, CSSProperties, ReactNode } from "react"; | ||
export declare type Action = "submit" | string | { | ||
@@ -28,2 +28,6 @@ newWindow: string; | ||
currentPath?: string; | ||
/** | ||
* Override how the ActionArea renders links | ||
*/ | ||
renderLink?: (props: AnchorHTMLAttributes<HTMLAnchorElement>) => ReactNode; | ||
title?: string; | ||
@@ -30,0 +34,0 @@ style?: CSSProperties; |
@@ -12,3 +12,3 @@ var __assign = (this && this.__assign) || function () { | ||
}; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; | ||
import { scopedStyles } from "../lib"; | ||
@@ -57,8 +57,16 @@ var baseStyles = scopedStyles("ActionArea-base", { | ||
var download = opts.download, newWindow = opts.newWindow; | ||
var renderLink = props.renderLink || (function (p) { return _jsx("a", __assign({}, p, { children: p.children }), void 0); }); | ||
if (url === currentPath && !download) | ||
return span("current"); | ||
return ( | ||
/* Rule does not detect our dynamic values */ | ||
/* eslint-disable-next-line react/jsx-no-target-blank */ | ||
_jsx("a", __assign({ className: baseStyles + " " + className, download: download, href: url, rel: newWindow ? "noopener" : undefined, referrerPolicy: "strict-origin-when-cross-origin", target: newWindow ? "_blank" : undefined, title: title, style: style }, { children: children }), void 0)); | ||
return (_jsx(_Fragment, { children: renderLink({ | ||
className: baseStyles + " " + className, | ||
children: children, | ||
download: download, | ||
href: url, | ||
rel: newWindow ? "noopener" : undefined, | ||
referrerPolicy: "strict-origin-when-cross-origin", | ||
target: newWindow ? "_blank" : undefined, | ||
title: title, | ||
style: style, | ||
}) }, void 0)); | ||
}; | ||
@@ -65,0 +73,0 @@ if (action === "disabled") |
@@ -1,1 +0,1 @@ | ||
export declare function is404OurFault(): "maybe" | "yes" | "no"; | ||
export declare function is404OurFault(): "yes" | "no" | "maybe"; |
@@ -59,3 +59,3 @@ { | ||
"types": "dist/index.js", | ||
"version": "6.2.3" | ||
"version": "6.3.0" | ||
} |
@@ -59,3 +59,3 @@ { | ||
"types": "dist/index.js", | ||
"version": "6.2.3" | ||
"version": "6.3.0" | ||
} |
69584
102
1610