@react-types/button
Advanced tools
Comparing version
{ | ||
"name": "@react-types/button", | ||
"version": "3.0.0-nightly-07431f4b1-241030", | ||
"version": "3.0.0-nightly-0784c3d29-250523", | ||
"description": "Spectrum UI components in React", | ||
@@ -12,11 +12,10 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-types/shared": "^3.0.0-nightly-07431f4b1-241030" | ||
"@react-types/shared": "3.0.0-nightly-0784c3d29-250523" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"stableVersion": "3.10.0" | ||
} | ||
} |
@@ -13,3 +13,3 @@ /* | ||
import {AriaLabelingProps, FocusableDOMProps, FocusableProps, PressEvents, StyleProps} from '@react-types/shared'; | ||
import {AriaLabelingProps, FocusableDOMProps, FocusableProps, Key, PressEvents, StyleProps} from '@react-types/shared'; | ||
import {ElementType, JSXElementConstructor, ReactNode} from 'react'; | ||
@@ -59,2 +59,4 @@ | ||
'aria-pressed'?: boolean | 'true' | 'false' | 'mixed', | ||
/** Indicates whether this element represents the current item within a container or set of related elements. */ | ||
'aria-current'?: boolean | 'true' | 'false' | 'page' | 'step' | 'location' | 'date' | 'time', | ||
/** | ||
@@ -75,7 +77,11 @@ * The behavior of the button when used in an HTML form. | ||
export interface AriaButtonProps<T extends ElementType = 'button'> extends ButtonProps, LinkButtonProps<T>, AriaBaseButtonProps {} | ||
export interface AriaToggleButtonProps<T extends ElementType = 'button'> extends ToggleButtonProps, AriaBaseButtonProps, AriaButtonElementTypeProps<T> {} | ||
export interface AriaToggleButtonProps<T extends ElementType = 'button'> extends ToggleButtonProps, Omit<AriaBaseButtonProps, 'aria-current'>, AriaButtonElementTypeProps<T> {} | ||
export interface AriaToggleButtonGroupItemProps<E extends ElementType = 'button'> extends Omit<AriaToggleButtonProps<E>, 'id' | 'isSelected' | 'defaultSelected' | 'onChange'> { | ||
/** An identifier for the item in the `selectedKeys` of a ToggleButtonGroup. */ | ||
id: Key | ||
} | ||
/** @deprecated */ | ||
type LegacyButtonVariant = 'cta' | 'overBackground'; | ||
export interface SpectrumButtonProps<T extends ElementType = 'button'> extends AriaBaseButtonProps, ButtonProps, LinkButtonProps<T>, StyleProps { | ||
export interface SpectrumButtonProps<T extends ElementType = 'button'> extends AriaBaseButtonProps, Omit<ButtonProps, 'onClick'>, LinkButtonProps<T>, StyleProps { | ||
/** The [visual style](https://spectrum.adobe.com/page/button/#Options) of the button. */ | ||
@@ -98,3 +104,3 @@ variant: 'accent' | 'primary' | 'secondary' | 'negative' | LegacyButtonVariant, | ||
export interface SpectrumActionButtonProps extends AriaBaseButtonProps, ButtonProps, StyleProps { | ||
export interface SpectrumActionButtonProps extends AriaBaseButtonProps, Omit<ButtonProps, 'onClick'>, StyleProps { | ||
/** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */ | ||
@@ -106,3 +112,3 @@ isQuiet?: boolean, | ||
export interface SpectrumLogicButtonProps extends AriaBaseButtonProps, ButtonProps, StyleProps { | ||
export interface SpectrumLogicButtonProps extends AriaBaseButtonProps, Omit<ButtonProps, 'onClick'>, StyleProps { | ||
/** The type of boolean sequence to be represented by the LogicButton. */ | ||
@@ -112,5 +118,5 @@ variant: 'and' | 'or' | ||
export interface SpectrumToggleButtonProps extends ToggleButtonProps, SpectrumActionButtonProps { | ||
export interface SpectrumToggleButtonProps extends Omit<ToggleButtonProps, 'onClick'>, Omit<SpectrumActionButtonProps, 'aria-current'> { | ||
/** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */ | ||
isEmphasized?: boolean | ||
} |
6451
9.77%105
6.06%+ Added
- Removed