From ba7ae10c310dbb98885de9b836f5228fee68daf5 Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 28 Sep 2026 21:18:46 +0200 Subject: [PATCH] fix: headlessUI float replace --- package.json | 89 +-------------------------------- src/components/DropdownMenu.tsx | 74 ++++++++++++--------------- yarn.lock | 15 ++---- 3 files changed, 37 insertions(+), 141 deletions(-) diff --git a/package.json b/package.json index bf01dd8..2e699b9 100644 --- a/package.json +++ b/package.json @@ -1,88 +1 @@ -{ - "name": "client", - "version": "0.1.0", - "private": true, - "scripts": { - "test": "vitest --config vitetest.config.ts", - "dev": "next dev", - "build": "next build --webpack", - "start": "next start", - "lint": "eslint .", - "typeCheck": "tsc -p ./tsconfig.json", - "format": "prettier --check \"**/*.{js,jsx,ts,tsx}\"", - "format:fix": "prettier --write \"**/*.{js,jsx,ts,tsx}\"" - }, - "dependencies": { - "@auth/mongodb-adapter": "^3.5.2", - "@headlessui-float/react": "^0.15.0", - "@headlessui/react": "^2.1.8", - "@headlessui/tailwindcss": "^0.2.1", - "@hookform/resolvers": "^3.9.0", - "@infra-blocks/zod-utils": "^0.4.2", - "@next/bundle-analyzer": "^16.3.6", - "@serwist/next": "^9.5.12", - "@socialgouv/matomo-next": "^1.10.0", - "@tanstack/react-query": "^5.29.0", - "@trivago/prettier-plugin-sort-imports": "^4.2.0", - "@turf/boolean-point-in-polygon": "^7.0.0-alpha.114", - "@types/node": "^22.7.2", - "autoprefixer": "^10.4.16", - "class-variance-authority": "^0.7.0", - "date-fns": "^4.1.0", - "geojson": "^0.5.0", - "jotai": "^2.6.1", - "leaflet": "^1.9.4", - "leaflet-defaulticon-compatibility": "^0.1.2", - "leaflet-draw": "^1.0.4", - "leaflet-gesture-handling": "^1.2.2", - "leaflet.markercluster": "^1.5.3", - "leaflet.smooth_marker_bouncing": "3.0.3", - "lodash": "^4.17.21", - "mongodb": "^7.0.0", - "next": "^16.3.6", - "next-auth": "^5.0.0-beta.32", - "next-intl": "^4.14.7", - "next-safe-action": "^7.9.3", - "nodemailer": "^6.9.12", - "postcss": "^8.4.47", - "react": "^19.3.0", - "react-date-range": "^2.0.1", - "react-datepicker": "^7.4.0", - "react-dom": "^19.3.0", - "react-hook-form": "^7.46.1", - "react-icons": "^5.3.0", - "react-input-mask": "^2.0.4", - "react-leaflet": "^4.2.1", - "react-leaflet-cluster": "^2.1.0", - "react-leaflet-draw": "^0.20.4", - "react-select": "^5.7.4", - "react-tooltip": "^5.18.0", - "serwist": "^9.5.12", - "sharp": "^0.33.0", - "superjson": "^2.2.1", - "tailwind-merge": "^2.0.0", - "tailwindcss": "^3.3.5", - "typescript": "^5.3.3", - "vitest": "^4.0.12", - "zod": "^3.22.4" - }, - "devDependencies": { - "@swc-jotai/react-refresh": "^0.2.0", - "@tailwindcss/forms": "^0.5.4", - "@tailwindcss/typography": "^0.5.15", - "@testing-library/jest-dom": "^6.1.2", - "@types/leaflet": "^1.9.12", - "@types/lodash": "^4.14.195", - "@types/nodemailer": "^6.4.8", - "@types/react": "^19.3.0", - "@types/react-date-range": "^1.4.9", - "@types/react-dom": "^19.3.0", - "@types/react-input-mask": "^3.0.2", - "eslint": "^9.0.0", - "eslint-config-next": "^16.3.6", - "eslint-config-prettier": "^9.0.0", - "prettier": "^3.1.1", - "prettier-plugin-tailwindcss": "^0.6.8" - }, - "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" -} +{ "name": "client", "version": "0.1.0", "private": true, "scripts": { "test": "vitest --config vitetest.config.ts", "dev": "next dev", "build": "next build --webpack", "start": "next start", "lint": "eslint .", "typeCheck": "tsc -p ./tsconfig.json", "format": "prettier --check \"**/*.{js,jsx,ts,tsx}\"", "format:fix": "prettier --write \"**/*.{js,jsx,ts,tsx}\"" }, "dependencies": { "@auth/mongodb-adapter": "^3.5.2", "@headlessui/react": "^2.1.8", "@headlessui/tailwindcss": "^0.2.1", "@hookform/resolvers": "^3.9.0", "@infra-blocks/zod-utils": "^0.4.2", "@next/bundle-analyzer": "^16.3.6", "@serwist/next": "^9.5.12", "@socialgouv/matomo-next": "^1.10.0", "@tanstack/react-query": "^5.29.0", "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@turf/boolean-point-in-polygon": "^7.0.0-alpha.114", "@types/node": "^22.7.2", "autoprefixer": "^10.4.16", "class-variance-authority": "^0.7.0", "date-fns": "^4.1.0", "geojson": "^0.5.0", "jotai": "^2.6.1", "leaflet": "^1.9.4", "leaflet-defaulticon-compatibility": "^0.1.2", "leaflet-draw": "^1.0.4", "leaflet-gesture-handling": "^1.2.2", "leaflet.markercluster": "^1.5.3", "leaflet.smooth_marker_bouncing": "3.0.3", "lodash": "^4.17.21", "mongodb": "^7.0.0", "next": "^16.3.6", "next-auth": "^5.0.0-beta.32", "next-intl": "^4.14.7", "next-safe-action": "^7.9.3", "nodemailer": "^6.9.12", "postcss": "^8.4.47", "react": "^19.3.0", "react-date-range": "^2.0.1", "react-datepicker": "^7.4.0", "react-dom": "^19.3.0", "react-hook-form": "^7.46.1", "react-icons": "^5.3.0", "react-input-mask": "^2.0.4", "react-leaflet": "^4.2.1", "react-leaflet-cluster": "^2.1.0", "react-leaflet-draw": "^0.20.4", "react-select": "^5.7.4", "react-tooltip": "^5.18.0", "serwist": "^9.5.12", "sharp": "^0.33.0", "superjson": "^2.2.1", "tailwind-merge": "^2.0.0", "tailwindcss": "^3.3.5", "typescript": "^5.3.3", "vitest": "^4.0.12", "zod": "^3.22.4" }, "devDependencies": { "@swc-jotai/react-refresh": "^0.2.0", "@tailwindcss/forms": "^0.5.4", "@tailwindcss/typography": "^0.5.15", "@testing-library/jest-dom": "^6.1.2", "@types/leaflet": "^1.9.12", "@types/lodash": "^4.14.195", "@types/nodemailer": "^6.4.8", "@types/react": "^19.3.0", "@types/react-date-range": "^1.4.9", "@types/react-dom": "^19.3.0", "@types/react-input-mask": "^3.0.2", "eslint": "^9.0.0", "eslint-config-next": "^16.3.6", "eslint-config-prettier": "^9.0.0", "prettier": "^3.1.1", "prettier-plugin-tailwindcss": "^0.6.8" }, "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" } \ No newline at end of file diff --git a/src/components/DropdownMenu.tsx b/src/components/DropdownMenu.tsx index 98e3681..098e1d3 100644 --- a/src/components/DropdownMenu.tsx +++ b/src/components/DropdownMenu.tsx @@ -1,6 +1,5 @@ import React from "react"; -import { Float } from "@headlessui-float/react"; import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/react"; import { IoMdMore } from "react-icons/io"; import { twMerge } from "tailwind-merge"; @@ -25,47 +24,40 @@ export const DropdownMenu = ({ }: DropdownMenuProps) => { return ( - - {buttonComponent ?? ( - - - - )} + {buttonComponent ?? ( + + + + )} - -
- {items.map(({ title, onClick, className, disabled }, i) => ( - - - - ))} -
-
-
+ +
+ {items.map(({ title, onClick, className, disabled }, i) => ( + + + + ))} +
+
); }; diff --git a/yarn.lock b/yarn.lock index 51edb78..b4f7aa2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -453,14 +453,14 @@ "@eslint/core" "^0.17.0" levn "^0.4.1" -"@floating-ui/core@^1.5.3", "@floating-ui/core@^1.8.0": +"@floating-ui/core@^1.8.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.8.0.tgz#d01c0bbea02e4a57f6fd7d5de6fc2c5c7dca40e1" integrity sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ== dependencies: "@floating-ui/utils" "^0.2.12" -"@floating-ui/dom@^1.0.1", "@floating-ui/dom@^1.5.4", "@floating-ui/dom@^1.6.1", "@floating-ui/dom@^1.8.0": +"@floating-ui/dom@^1.0.1", "@floating-ui/dom@^1.6.1", "@floating-ui/dom@^1.8.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.8.0.tgz#8a20e6facbe2456afdbeb6c8b968a72df689cf63" integrity sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg== @@ -475,7 +475,7 @@ dependencies: "@floating-ui/dom" "^1.8.0" -"@floating-ui/react@^0.26.16", "@floating-ui/react@^0.26.5": +"@floating-ui/react@^0.26.16": version "0.26.28" resolved "https://registry.yarnpkg.com/@floating-ui/react/-/react-0.26.28.tgz#93f44ebaeb02409312e9df9507e83aab4a8c0dc7" integrity sha512-yORQuuAtVpiRjpMhdc0wJj06b9JFjrYF4qp96j++v2NBpbi6SEGF7donUJ3TMieerQ6qVkAv1tgr7L4r5roTqw== @@ -534,15 +534,6 @@ dependencies: "@formatjs/fast-memoize" "3.1.7" -"@headlessui-float/react@^0.15.0": - version "0.15.1" - resolved "https://registry.yarnpkg.com/@headlessui-float/react/-/react-0.15.1.tgz#ef312e6391989fc0369ef4a4702a1a59be81a31a" - integrity sha512-UWD8epShMGRzxyt+A1/OMagzxzVBcBZTLldTTOA5bX6eKzMC/+H/La53bTTSJ83K0clvoEJOaByh8sN+kdSuXw== - dependencies: - "@floating-ui/core" "^1.5.3" - "@floating-ui/dom" "^1.5.4" - "@floating-ui/react" "^0.26.5" - "@headlessui/react@^2.1.8": version "2.2.10" resolved "https://registry.yarnpkg.com/@headlessui/react/-/react-2.2.10.tgz#ad69258abcb9efea27a4b37e06e8c9cafd39ca63"