From 8d20cfb0c6ff38e7180f1c6c5ffea2dcf60fd21c Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 3 May 2024 09:55:02 -0400 Subject: [PATCH] Deprecate dot notation (#3170) * Expose new components under dot notation Most of them already where so only a couple were missing. * Deprecate dot notation * Add deprecation to `RadioGroupOption` * Update deprecations * Update changelog * Update changelog --- packages/@headlessui-react/CHANGELOG.md | 1 + .../@headlessui-react/src/components/combobox/combobox.tsx | 4 ++++ packages/@headlessui-react/src/components/dialog/dialog.tsx | 6 ++++++ .../src/components/disclosure/disclosure.tsx | 2 ++ .../src/components/focus-trap/focus-trap.tsx | 1 + .../@headlessui-react/src/components/listbox/listbox.tsx | 5 +++++ packages/@headlessui-react/src/components/menu/menu.tsx | 6 ++++++ .../@headlessui-react/src/components/popover/popover.tsx | 4 ++++ packages/@headlessui-react/src/components/portal/portal.tsx | 5 ++++- .../src/components/radio-group/radio-group.tsx | 4 ++++ packages/@headlessui-react/src/components/switch/switch.tsx | 1 + packages/@headlessui-react/src/components/tabs/tabs.tsx | 4 ++++ .../src/components/transition/transition.tsx | 2 ++ 13 files changed, 44 insertions(+), 1 deletion(-) diff --git a/packages/@headlessui-react/CHANGELOG.md b/packages/@headlessui-react/CHANGELOG.md index 72c81c4918..ddb55f8704 100644 --- a/packages/@headlessui-react/CHANGELOG.md +++ b/packages/@headlessui-react/CHANGELOG.md @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Change default tags for `ListboxOptions`, `ListboxOption`, `ComboboxOptions`, `ComboboxOption` and `TabGroup` components ([#3109](https://github.com/tailwindlabs/headlessui/pull/3109)) - Change default tag from `div` to `Fragment` on `Transition` components ([#3110](https://github.com/tailwindlabs/headlessui/pull/3110)) - Update minimal peer dependency version requirements for `react` and `react-dom` ([#3131](https://github.com/tailwindlabs/headlessui/pull/3131)) +- Deprecate dot notation for components ([#2887](https://github.com/tailwindlabs/headlessui/pull/2887), [#3170](https://github.com/tailwindlabs/headlessui/pull/3170)) ### Added diff --git a/packages/@headlessui-react/src/components/combobox/combobox.tsx b/packages/@headlessui-react/src/components/combobox/combobox.tsx index bf8ac3df11..7fb744b0ff 100644 --- a/packages/@headlessui-react/src/components/combobox/combobox.tsx +++ b/packages/@headlessui-react/src/components/combobox/combobox.tsx @@ -1971,10 +1971,14 @@ export let ComboboxOptions = forwardRefWithAs(OptionsFn) as _internal_ComponentC export let ComboboxOption = forwardRefWithAs(OptionFn) as _internal_ComponentComboboxOption export let Combobox = Object.assign(ComboboxRoot, { + /** @deprecated use `` instead of `` */ Input: ComboboxInput, + /** @deprecated use `` instead of `` */ Button: ComboboxButton, /** @deprecated use `