@restart/ui
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -45,3 +45,3 @@ "use strict"; | ||
if (isTrivialHref(props.href) && !props.role || props.role === 'button') { | ||
if (isTrivialHref(props.href) || props.role === 'button') { | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)("a", Object.assign({ | ||
@@ -48,0 +48,0 @@ ref: ref |
@@ -14,2 +14,3 @@ import * as React from 'react'; | ||
tagName?: keyof JSX.IntrinsicElements; | ||
role?: React.AriaRole | undefined; | ||
} | ||
@@ -20,3 +21,3 @@ export declare function isTrivialHref(href?: string): boolean; | ||
disabled: boolean | undefined; | ||
role?: 'button'; | ||
role?: React.AriaRole; | ||
tabIndex?: number | undefined; | ||
@@ -33,3 +34,3 @@ href?: string | undefined; | ||
} | ||
export declare function useButtonProps({ tagName, disabled, href, target, rel, onClick, tabIndex, type, }: UseButtonPropsOptions): [AriaButtonProps, UseButtonPropsMetadata]; | ||
export declare function useButtonProps({ tagName, disabled, href, target, rel, role, onClick, tabIndex, type, }: UseButtonPropsOptions): [AriaButtonProps, UseButtonPropsMetadata]; | ||
export interface BaseButtonProps { | ||
@@ -36,0 +37,0 @@ /** |
@@ -30,2 +30,3 @@ "use strict"; | ||
rel, | ||
role, | ||
onClick, | ||
@@ -84,3 +85,3 @@ tabIndex = 0, | ||
return [{ | ||
role: 'button', | ||
role: role != null ? role : 'button', | ||
// explicitly undefined so that it overrides the props disabled in a spread | ||
@@ -87,0 +88,0 @@ // e.g. <Tag {...props} {...hookProps} /> |
@@ -34,3 +34,3 @@ const _excluded = ["onKeyDown"]; | ||
if (isTrivialHref(props.href) && !props.role || props.role === 'button') { | ||
if (isTrivialHref(props.href) || props.role === 'button') { | ||
return /*#__PURE__*/_jsx("a", Object.assign({ | ||
@@ -37,0 +37,0 @@ ref: ref |
@@ -14,2 +14,3 @@ import * as React from 'react'; | ||
tagName?: keyof JSX.IntrinsicElements; | ||
role?: React.AriaRole | undefined; | ||
} | ||
@@ -20,3 +21,3 @@ export declare function isTrivialHref(href?: string): boolean; | ||
disabled: boolean | undefined; | ||
role?: 'button'; | ||
role?: React.AriaRole; | ||
tabIndex?: number | undefined; | ||
@@ -33,3 +34,3 @@ href?: string | undefined; | ||
} | ||
export declare function useButtonProps({ tagName, disabled, href, target, rel, onClick, tabIndex, type, }: UseButtonPropsOptions): [AriaButtonProps, UseButtonPropsMetadata]; | ||
export declare function useButtonProps({ tagName, disabled, href, target, rel, role, onClick, tabIndex, type, }: UseButtonPropsOptions): [AriaButtonProps, UseButtonPropsMetadata]; | ||
export interface BaseButtonProps { | ||
@@ -36,0 +37,0 @@ /** |
@@ -16,2 +16,3 @@ const _excluded = ["as", "disabled"]; | ||
rel, | ||
role, | ||
onClick, | ||
@@ -70,3 +71,3 @@ tabIndex = 0, | ||
return [{ | ||
role: 'button', | ||
role: role != null ? role : 'button', | ||
// explicitly undefined so that it overrides the props disabled in a spread | ||
@@ -73,0 +74,0 @@ // e.g. <Tag {...props} {...hookProps} /> |
{ | ||
"name": "@restart/ui", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Utilities for creating robust overlay components", | ||
@@ -5,0 +5,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
336400
8004