diff --git a/src/components/actions/Action/Action.tsx b/src/components/actions/Action/Action.tsx index 750d5717..d5f3d6ea 100644 --- a/src/components/actions/Action/Action.tsx +++ b/src/components/actions/Action/Action.tsx @@ -12,11 +12,13 @@ import { TEXT_STYLES, TextStyleProps, tasty, + TagName, } from '../../../tasty'; import { useAction } from '../use-action'; -export interface CubeActionProps - extends Omit, +export interface CubeActionProps< + T extends TagName = 'a' | 'button' | 'span' | 'div', +> extends Omit, 'htmlType'>, BaseStyleProps, ContainerStyleProps, TextStyleProps, diff --git a/src/components/actions/Button/Button.stories.tsx b/src/components/actions/Button/Button.stories.tsx index d733bd20..676a1613 100644 --- a/src/components/actions/Button/Button.stories.tsx +++ b/src/components/actions/Button/Button.stories.tsx @@ -41,7 +41,6 @@ const Template: StoryFn = ({ icon, rightIcon, label, - onClick, ...props }) => ( - extends AllBaseProps, +export interface CubeUseActionProps< + T extends TagName = 'a' | 'button' | 'span' | 'div', +> extends AllBaseProps, Omit { to?: string; label?: string; htmlType?: 'button' | 'submit' | 'reset' | undefined; - onClick?: MouseEventHandler; - onMouseEnter?: MouseEventHandler; - onMouseLeave?: MouseEventHandler; } const FILTER_OPTIONS = { propNames: new Set(['onMouseEnter', 'onMouseLeave']) }; diff --git a/src/components/form/Label.tsx b/src/components/form/Label.tsx index 9e9a5c21..3c6cd51c 100644 --- a/src/components/form/Label.tsx +++ b/src/components/form/Label.tsx @@ -1,5 +1,5 @@ import { useDOMRef } from '@react-spectrum/utils'; -import { forwardRef, MouseEventHandler } from 'react'; +import { forwardRef } from 'react'; import { useProviderProps } from '../../provider'; import { @@ -85,7 +85,6 @@ export interface CubeLabelProps extends BaseProps, ContainerStyleProps { htmlFor?: string; for?: string; validationState?: ValidationState; - onClick?: MouseEventHandler; } function Label(props: CubeLabelProps, ref) { @@ -103,7 +102,6 @@ function Label(props: CubeLabelProps, ref) { isDisabled, validationState, for: labelFor, - onClick, ...otherProps } = props; @@ -139,7 +137,6 @@ function Label(props: CubeLabelProps, ref) { invalid: validationState === 'invalid', valid: validationState === 'valid', }} - onClick={onClick} > {typeof children !== 'string' ? ( children diff --git a/src/tasty/types.ts b/src/tasty/types.ts index eebd739b..a0826cb3 100644 --- a/src/tasty/types.ts +++ b/src/tasty/types.ts @@ -91,17 +91,22 @@ export interface AllBaseProps Omit< AllHTMLAttributes, | 'style' - | 'size' | 'disabled' | 'hidden' | 'css' - | 'color' - | 'height' - | 'width' | 'content' | 'translate' | 'as' | 'form' + | 'bgcolor' + | 'background' + | 'align' + | 'border' + | 'color' + | 'height' + | 'size' + | 'width' + | 'prefix' > {} export type BaseStyleProps = Pick;