From eb1ac6256e0de6d312aca73c8322007d7acebb31 Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 8 Dec 2023 12:10:45 +0100 Subject: [PATCH] feat(components): use button for disclosure nav item --- package-lock.json | 2 +- .../navigation/navigation-disclosure-panel.tsx | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index d362e7e4..c221283a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -80,7 +80,7 @@ "vitest": "^1.0.1" }, "engines": { - "node": ">=18" + "node": ">=20" }, "peerDependencies": { "react": ">=17.0.1", diff --git a/src/components/navigation/navigation-disclosure-panel.tsx b/src/components/navigation/navigation-disclosure-panel.tsx index 1fb75293..e59fa2fc 100644 --- a/src/components/navigation/navigation-disclosure-panel.tsx +++ b/src/components/navigation/navigation-disclosure-panel.tsx @@ -2,8 +2,8 @@ import React from "react"; import { Disclosure } from "@headlessui/react"; import { classNames } from "../../util/class-names"; -export interface NavigationDisclosurePanelItemProps { - children: React.ReactNode; +export interface NavigationDisclosurePanelItemProps + extends React.ComponentPropsWithoutRef<"button"> { isActive?: boolean; isIndented?: boolean; } @@ -12,20 +12,23 @@ const NavigationDisclosurePanelItem = ({ children, isActive, isIndented, + ...props }: NavigationDisclosurePanelItemProps) => { return ( -
{children} {isActive && (
)} -
+ ); };