From ca92642b882b99616fd8f8f4772f69890fa52ed0 Mon Sep 17 00:00:00 2001 From: Jordan Phillips Date: Sat, 4 May 2024 13:59:03 +1000 Subject: [PATCH] feat: add optional useHref prop to DesignSystemProvider --- packages/react/src/hooks/use-design-system.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/react/src/hooks/use-design-system.tsx b/packages/react/src/hooks/use-design-system.tsx index 82fc42a..d72bc01 100644 --- a/packages/react/src/hooks/use-design-system.tsx +++ b/packages/react/src/hooks/use-design-system.tsx @@ -2,9 +2,20 @@ import { RouterProvider } from '@react-aria/utils' export type UseDesignSystemProps = React.PropsWithChildren & { /** - * Provides a client side router to all components that contain links + * Function to perform client-side navigation. + * + * @param path - The path to navigate to. + * @returns void */ navigate?: (path: string) => void + + /** + * Optional function to convert a router specific href to a native HTML href. + * + * @param href - The router-specific href to convert. + * @returns The converted native HTML href. + */ + useHref?: (href: string) => string } export const DesignSystemProvider: React.FC = ({ navigate, children }) => {