From 669af5559f1eb6554308f8523502cfd4222860c7 Mon Sep 17 00:00:00 2001 From: Chau Tran Date: Mon, 13 Jan 2025 10:52:23 -0600 Subject: [PATCH] feat(graph): update headlessui v2 (#29586) This PR updates `headlessui/react` to v2 so that it is compatible with the new graph library. This also bumps `preact` to `10.25` for `useId` compat. --- graph/ui-theme/src/lib/theme-panel.tsx | 40 +++--- .../src/lib/feedback-dialog.tsx | 37 +++--- nx-dev/ui-blog/src/lib/filters.tsx | 20 ++- nx-dev/ui-cloud/src/lib/hero.tsx | 19 ++- .../src/lib/headers/documentation-header.tsx | 15 ++- nx-dev/ui-common/src/lib/headers/header.tsx | 36 ++++-- nx-dev/ui-common/src/lib/sidebar.tsx | 19 ++- nx-dev/ui-common/src/lib/version-picker.tsx | 22 ++-- .../src/lib/customer-testimonial-carousel.tsx | 19 ++- nx-dev/ui-enterprise/src/lib/video-modal.tsx | 19 ++- nx-dev/ui-fence/src/lib/selector.tsx | 32 +++-- nx-dev/ui-home/src/lib/ci-for-monorepos.tsx | 19 ++- nx-dev/ui-powerpack/src/lib/hero.tsx | 6 +- nx-dev/ui-pricing/src/lib/faq.tsx | 15 ++- .../src/lib/theme-switcher.component.tsx | 31 +++-- package.json | 4 +- pnpm-lock.yaml | 121 +++++++++++++++++- 17 files changed, 331 insertions(+), 143 deletions(-) diff --git a/graph/ui-theme/src/lib/theme-panel.tsx b/graph/ui-theme/src/lib/theme-panel.tsx index 3e0ad6c84b..0f53c5e19e 100644 --- a/graph/ui-theme/src/lib/theme-panel.tsx +++ b/graph/ui-theme/src/lib/theme-panel.tsx @@ -1,4 +1,10 @@ -import { Menu, Transition } from '@headlessui/react'; +import { + Menu, + MenuButton, + MenuItem, + MenuItems, + Transition, +} from '@headlessui/react'; import { ComputerDesktopIcon, MoonIcon, @@ -28,7 +34,7 @@ export function ThemePanel({ return (
- @@ -42,7 +48,7 @@ export function ThemePanel({ {theme === 'dark' && ( +
- +
- - {({ active }) => ( + + {({ focus }) => ( )} - - - {({ active }) => ( + + + {({ focus }) => ( )} - - - {({ active }) => ( + + + {({ focus }) => ( )} - +
-
+
); diff --git a/nx-dev/feature-feedback/src/lib/feedback-dialog.tsx b/nx-dev/feature-feedback/src/lib/feedback-dialog.tsx index 5fab94639d..799b363967 100644 --- a/nx-dev/feature-feedback/src/lib/feedback-dialog.tsx +++ b/nx-dev/feature-feedback/src/lib/feedback-dialog.tsx @@ -1,4 +1,11 @@ -import { Dialog, Transition } from '@headlessui/react'; +import { + Description, + Dialog, + DialogPanel, + DialogTitle, + Transition, + TransitionChild, +} from '@headlessui/react'; import { ChangeEvent, Fragment, useMemo, useState } from 'react'; import { GithubIcon } from '@nx/nx-dev/ui-common'; import { cx } from '@nx/nx-dev/ui-primitives'; @@ -58,7 +65,7 @@ function FeedbackDialog({ return ( - + {/* This is the modal */}
- - - + @@ -95,7 +102,7 @@ function FeedbackDialog({ - + {/* The anatomy here should be @@ -217,11 +224,11 @@ function FeedbackDialog({ {isIdea && (
- + We are always looking to improve our documentation. If you have any suggestions, please let us know. - - + + - - + + - +
)} -
-
+ +
diff --git a/nx-dev/ui-blog/src/lib/filters.tsx b/nx-dev/ui-blog/src/lib/filters.tsx index e045d30b44..f3400b0515 100644 --- a/nx-dev/ui-blog/src/lib/filters.tsx +++ b/nx-dev/ui-blog/src/lib/filters.tsx @@ -4,7 +4,13 @@ import { FC, Fragment, SVGProps, useEffect, useState } from 'react'; import { usePathname, useSearchParams } from 'next/navigation'; import { ChevronDownIcon } from '@heroicons/react/24/outline'; -import { Menu, Transition } from '@headlessui/react'; +import { + Menu, + MenuButton, + MenuItem, + MenuItems, + Transition, +} from '@headlessui/react'; import { cx } from '@nx/nx-dev/ui-primitives'; import { BlogPostDataEntry } from '@nx/nx-dev/data-access-documents/node-only'; @@ -102,7 +108,7 @@ export function Filters({ {/* MOBILE */}
- @@ -111,7 +117,7 @@ export function Filters({ className="-mr-1 ml-2 h-5 w-5 text-violet-200 hover:text-violet-100" aria-hidden="true" /> - + - {filters.map((filter) => ( - + - + ))} - +
diff --git a/nx-dev/ui-cloud/src/lib/hero.tsx b/nx-dev/ui-cloud/src/lib/hero.tsx index 8d94a5bbcc..abaef056b0 100644 --- a/nx-dev/ui-cloud/src/lib/hero.tsx +++ b/nx-dev/ui-cloud/src/lib/hero.tsx @@ -1,5 +1,10 @@ 'use client'; -import { Dialog, Transition } from '@headlessui/react'; +import { + Dialog, + DialogPanel, + Transition, + TransitionChild, +} from '@headlessui/react'; import { cx } from '@nx/nx-dev/ui-primitives'; import { PlayIcon } from '@heroicons/react/24/outline'; import { motion } from 'framer-motion'; @@ -92,7 +97,7 @@ export function Hero(): JSX.Element { onClose={() => setIsOpen(false)} className="relative z-10" > -
- +
- - +