@react-types/button 3.10.2 → 3.12.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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/index.d.ts +7 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/button",
3
- "version": "3.10.2",
3
+ "version": "3.12.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "url": "https://github.com/adobe/react-spectrum"
10
10
  },
11
11
  "dependencies": {
12
- "@react-types/shared": "^3.27.0"
12
+ "@react-types/shared": "^3.29.0"
13
13
  },
14
14
  "peerDependencies": {
15
15
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
@@ -17,5 +17,5 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
- "gitHead": "09e7f44bebdc9d89122926b2b439a0a38a2814ea"
20
+ "gitHead": "9b66d270572f482948afee95622a85cdf68ed408"
21
21
  }
package/src/index.d.ts CHANGED
@@ -55,6 +55,8 @@ interface AriaBaseButtonProps extends FocusableDOMProps, AriaLabelingProps {
55
55
  'aria-controls'?: string,
56
56
  /** Indicates the current "pressed" state of toggle buttons. */
57
57
  'aria-pressed'?: boolean | 'true' | 'false' | 'mixed',
58
+ /** Indicates whether this element represents the current item within a container or set of related elements. */
59
+ 'aria-current'?: boolean | 'true' | 'false' | 'page' | 'step' | 'location' | 'date' | 'time',
58
60
  /**
59
61
  * The behavior of the button when used in an HTML form.
60
62
  * @default 'button'
@@ -70,7 +72,7 @@ interface AriaBaseButtonProps extends FocusableDOMProps, AriaLabelingProps {
70
72
  }
71
73
 
72
74
  export interface AriaButtonProps<T extends ElementType = 'button'> extends ButtonProps, LinkButtonProps<T>, AriaBaseButtonProps {}
73
- export interface AriaToggleButtonProps<T extends ElementType = 'button'> extends ToggleButtonProps, AriaBaseButtonProps, AriaButtonElementTypeProps<T> {}
75
+ export interface AriaToggleButtonProps<T extends ElementType = 'button'> extends ToggleButtonProps, Omit<AriaBaseButtonProps, 'aria-current'>, AriaButtonElementTypeProps<T> {}
74
76
  export interface AriaToggleButtonGroupItemProps<E extends ElementType = 'button'> extends Omit<AriaToggleButtonProps<E>, 'id' | 'isSelected' | 'defaultSelected' | 'onChange'> {
75
77
  /** An identifier for the item in the `selectedKeys` of a ToggleButtonGroup. */
76
78
  id: Key
@@ -78,7 +80,7 @@ export interface AriaToggleButtonGroupItemProps<E extends ElementType = 'button'
78
80
 
79
81
  /** @deprecated */
80
82
  type LegacyButtonVariant = 'cta' | 'overBackground';
81
- export interface SpectrumButtonProps<T extends ElementType = 'button'> extends AriaBaseButtonProps, ButtonProps, LinkButtonProps<T>, StyleProps {
83
+ export interface SpectrumButtonProps<T extends ElementType = 'button'> extends AriaBaseButtonProps, Omit<ButtonProps, 'onClick'>, LinkButtonProps<T>, StyleProps {
82
84
  /** The [visual style](https://spectrum.adobe.com/page/button/#Options) of the button. */
83
85
  variant: 'accent' | 'primary' | 'secondary' | 'negative' | LegacyButtonVariant,
84
86
  /** The background style of the button. */
@@ -96,19 +98,19 @@ export interface SpectrumButtonProps<T extends ElementType = 'button'> extends A
96
98
  isQuiet?: boolean
97
99
  }
98
100
 
99
- export interface SpectrumActionButtonProps extends AriaBaseButtonProps, ButtonProps, StyleProps {
101
+ export interface SpectrumActionButtonProps extends AriaBaseButtonProps, Omit<ButtonProps, 'onClick'>, StyleProps {
100
102
  /** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */
101
103
  isQuiet?: boolean,
102
104
  /** The static color style to apply. Useful when the button appears over a color background. */
103
105
  staticColor?: 'white' | 'black'
104
106
  }
105
107
 
106
- export interface SpectrumLogicButtonProps extends AriaBaseButtonProps, ButtonProps, StyleProps {
108
+ export interface SpectrumLogicButtonProps extends AriaBaseButtonProps, Omit<ButtonProps, 'onClick'>, StyleProps {
107
109
  /** The type of boolean sequence to be represented by the LogicButton. */
108
110
  variant: 'and' | 'or'
109
111
  }
110
112
 
111
- export interface SpectrumToggleButtonProps extends ToggleButtonProps, SpectrumActionButtonProps {
113
+ export interface SpectrumToggleButtonProps extends Omit<ToggleButtonProps, 'onClick'>, Omit<SpectrumActionButtonProps, 'aria-current'> {
112
114
  /** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */
113
115
  isEmphasized?: boolean
114
116
  }