Mark SwitchGroup as deprecated, prefer Field instead (#3232)

* mark `SwitchGroup` as deprecated

Also updated the `Switch.Group` message to also prefer the `<Field>`
component.

* update changelog
This commit is contained in:
Robin Malfait
2024-05-23 16:24:26 +02:00
committed by GitHub
parent 7fcb410be4
commit b478189fad
2 changed files with 6 additions and 1 deletions
+4
View File
@@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [internal] Dont set a focus fallback for Dialogs in demo mode ([#3194](https://github.com/tailwindlabs/headlessui/pull/3194))
- Ensure page doesn't scroll down when pressing `Escape` to close the `Dialog` component ([#3218](https://github.com/tailwindlabs/headlessui/pull/3218))
### Deprecated
- Mark `SwitchGroup` as deprecated, prefer `Field` instead ([#3232](https://github.com/tailwindlabs/headlessui/pull/3232))
## [2.0.3] - 2024-05-07
### Fixed
@@ -269,6 +269,7 @@ export interface _internal_ComponentSwitchLabel extends _internal_ComponentLabel
export interface _internal_ComponentSwitchDescription extends _internal_ComponentDescription {}
let SwitchRoot = forwardRefWithAs(SwitchFn) as _internal_ComponentSwitch
/** @deprecated use `<Field>` instead of `<SwitchGroup>` */
export let SwitchGroup = GroupFn as _internal_ComponentSwitchGroup
/** @deprecated use `<Label>` instead of `<SwitchLabel>` */
export let SwitchLabel = Label as _internal_ComponentSwitchLabel
@@ -276,7 +277,7 @@ export let SwitchLabel = Label as _internal_ComponentSwitchLabel
export let SwitchDescription = Description as _internal_ComponentSwitchDescription
export let Switch = Object.assign(SwitchRoot, {
/** @deprecated use `<SwitchGroup>` instead of `<Switch.Group>` */
/** @deprecated use `<Field>` instead of `<Switch.Group>` */
Group: SwitchGroup,
/** @deprecated use `<Label>` instead of `<Switch.Label>` */
Label: SwitchLabel,