@react-types/switch 3.5.17 → 3.6.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 +7 -4
  2. package/src/index.d.ts +5 -38
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/switch",
3
- "version": "3.5.17",
3
+ "version": "3.6.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -9,13 +9,16 @@
9
9
  "url": "https://github.com/adobe/react-spectrum"
10
10
  },
11
11
  "dependencies": {
12
- "@react-types/shared": "^3.33.1"
12
+ "@react-aria/switch": "^3.8.0",
13
+ "@react-spectrum/switch": "^3.7.0"
13
14
  },
14
15
  "peerDependencies": {
15
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
16
+ "@react-spectrum/provider": "^3.0.0",
17
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
18
+ "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
16
19
  },
17
20
  "publishConfig": {
18
21
  "access": "public"
19
22
  },
20
- "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
23
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
21
24
  }
package/src/index.d.ts CHANGED
@@ -10,43 +10,10 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {AriaLabelingProps, FocusableDOMProps, FocusableProps, InputBase, InputDOMProps, StyleProps} from '@react-types/shared';
14
- import {ReactNode} from 'react';
13
+ import {AriaSwitchProps} from '@react-aria/switch';
15
14
 
16
- interface SwitchBase extends InputBase, FocusableProps {
17
- /**
18
- * The content to render as the Switch's label.
19
- */
20
- children?: ReactNode,
21
- /**
22
- * Whether the Switch should be selected (uncontrolled).
23
- */
24
- defaultSelected?: boolean,
25
- /**
26
- * Whether the Switch should be selected (controlled).
27
- */
28
- isSelected?: boolean,
29
- /**
30
- * Handler that is called when the Switch's selection state changes.
31
- */
32
- onChange?: (isSelected: boolean) => void,
33
- /**
34
- * The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).
35
- */
36
- value?: string
37
- }
38
- export interface SwitchProps extends SwitchBase {}
39
- export interface AriaSwitchBase extends SwitchBase, FocusableDOMProps, InputDOMProps, AriaLabelingProps {
40
- /**
41
- * Identifies the element (or elements) whose contents or presence are controlled by the current element.
42
- */
43
- 'aria-controls'?: string
44
- }
45
- export interface AriaSwitchProps extends SwitchProps, AriaSwitchBase {}
15
+ export {SwitchProps, AriaSwitchProps} from '@react-aria/switch';
16
+ export {SpectrumSwitchProps} from '@react-spectrum/switch';
46
17
 
47
- export interface SpectrumSwitchProps extends AriaSwitchProps, StyleProps {
48
- /**
49
- * This prop sets the emphasized style which provides visual prominence.
50
- */
51
- isEmphasized?: boolean
52
- }
18
+ // Backward compatibility.
19
+ export type AriaSwitchBase = AriaSwitchProps;