@react-types/button 3.12.2 → 3.14.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 +28 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/button",
3
- "version": "3.12.2",
3
+ "version": "3.14.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.30.0"
12
+ "@react-types/shared": "^3.32.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": "265b4d7f107905ee1c6e87a8af1613ab440a6849"
20
+ "gitHead": "2c58ed3ddd9be9100af9b1d0cfd137fcdc95ba2d"
21
21
  }
package/src/index.d.ts CHANGED
@@ -47,6 +47,8 @@ export interface LinkButtonProps<T extends ElementType = 'button'> extends AriaB
47
47
  }
48
48
 
49
49
  interface AriaBaseButtonProps extends FocusableDOMProps, AriaLabelingProps {
50
+ /** Indicates whether the element is disabled to users of assistive technology. */
51
+ 'aria-disabled'?: boolean | 'true' | 'false',
50
52
  /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
51
53
  'aria-expanded'?: boolean | 'true' | 'false',
52
54
  /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
@@ -68,11 +70,34 @@ interface AriaBaseButtonProps extends FocusableDOMProps, AriaLabelingProps {
68
70
  * Caution, this can make the button inaccessible and should only be used when alternative keyboard interaction is provided,
69
71
  * such as ComboBox's MenuTrigger or a NumberField's increment/decrement control.
70
72
  */
71
- preventFocusOnPress?: boolean
73
+ preventFocusOnPress?: boolean,
74
+ /**
75
+ * The `<form>` element to associate the button with.
76
+ * The value of this attribute must be the id of a `<form>` in the same document.
77
+ * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#form).
78
+ */
79
+ form?: string,
80
+ /**
81
+ * The URL that processes the information submitted by the button.
82
+ * Overrides the action attribute of the button's form owner.
83
+ */
84
+ formAction?: string,
85
+ /** Indicates how to encode the form data that is submitted. */
86
+ formEncType?: string,
87
+ /** Indicates the HTTP method used to submit the form. */
88
+ formMethod?: string,
89
+ /** Indicates that the form is not to be validated when it is submitted. */
90
+ formNoValidate?: boolean,
91
+ /** Overrides the target attribute of the button's form owner. */
92
+ formTarget?: string,
93
+ /** Submitted as a pair with the button's value as part of the form data. */
94
+ name?: string,
95
+ /** The value associated with the button's name when it's submitted with the form data. */
96
+ value?: string
72
97
  }
73
98
 
74
99
  export interface AriaButtonProps<T extends ElementType = 'button'> extends ButtonProps, LinkButtonProps<T>, AriaBaseButtonProps {}
75
- export interface AriaToggleButtonProps<T extends ElementType = 'button'> extends ToggleButtonProps, Omit<AriaBaseButtonProps, 'aria-current'>, AriaButtonElementTypeProps<T> {}
100
+ export interface AriaToggleButtonProps<T extends ElementType = 'button'> extends ToggleButtonProps, Omit<AriaBaseButtonProps, 'aria-current' | 'form' | 'formAction' | 'formEncType' | 'formMethod' | 'formNoValidate' | 'formTarget' | 'name' | 'value' | 'type'>, AriaButtonElementTypeProps<T> {}
76
101
  export interface AriaToggleButtonGroupItemProps<E extends ElementType = 'button'> extends Omit<AriaToggleButtonProps<E>, 'id' | 'isSelected' | 'defaultSelected' | 'onChange'> {
77
102
  /** An identifier for the item in the `selectedKeys` of a ToggleButtonGroup. */
78
103
  id: Key
@@ -110,7 +135,7 @@ export interface SpectrumLogicButtonProps extends AriaBaseButtonProps, Omit<Butt
110
135
  variant: 'and' | 'or'
111
136
  }
112
137
 
113
- export interface SpectrumToggleButtonProps extends Omit<ToggleButtonProps, 'onClick'>, Omit<SpectrumActionButtonProps, 'aria-current'> {
138
+ export interface SpectrumToggleButtonProps extends Omit<ToggleButtonProps, 'onClick'>, Omit<SpectrumActionButtonProps, 'aria-current' | 'type' | 'form' | 'formAction' | 'formEncType' | 'formMethod' | 'formNoValidate' | 'formTarget' | 'name' | 'value'> {
114
139
  /** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */
115
140
  isEmphasized?: boolean
116
141
  }