File tree Expand file tree Collapse file tree 4 files changed +15
-4
lines changed Expand file tree Collapse file tree 4 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @obosbbl/grunnmuren-react ' : patch
3+ ---
4+
5+ Base ` href ` prop on ` <Backlink> ` , ` <Breadcrumb> ` and ` <Button> ` to enable type safe routes.
Original file line number Diff line number Diff line change 11import { ChevronLeft } from '@obosbbl/grunnmuren-icons-react' ;
22import { cx } from 'cva' ;
33import { type Ref , forwardRef } from 'react' ;
4- import { Button , type ButtonProps , Link } from 'react-aria-components' ;
4+ import {
5+ Button ,
6+ type ButtonProps ,
7+ Link ,
8+ type LinkProps as RACLinkProps ,
9+ } from 'react-aria-components' ;
510
611type ButtonOrLinkProps = {
712 children ?: React . ReactNode ;
813 /** Additional CSS className for the element. */
914 className ?: string ;
1015 /** Determines whether to use an anchor or a button for the Backlink */
11- href ?: string ;
16+ href ?: RACLinkProps [ 'href' ] ;
1217 /** To add a permanent underline on the link (not only on hover)
1318 * @default false
1419 */
Original file line number Diff line number Diff line change 55 Link ,
66 Breadcrumb as RACBreadcrumb ,
77 type BreadcrumbProps as RACBreadcrumbProps ,
8+ type LinkProps as RACLinkProps ,
89} from 'react-aria-components' ;
910
1011type BreadcrumbProps = {
@@ -16,7 +17,7 @@ type BreadcrumbProps = {
1617 style ?: React . CSSProperties ;
1718
1819 /** The URL to navigate to when clicking the breadcrumb. */
19- href ?: string ;
20+ href ?: RACLinkProps [ 'href' ] ;
2021} & Omit < RACBreadcrumbProps , 'className' | 'style' > ;
2122
2223function Breadcrumb ( props : BreadcrumbProps , ref : Ref < HTMLLIElement > ) {
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ const buttonVariants = cva({
115115
116116type ButtonOrLinkProps = VariantProps < typeof buttonVariants > & {
117117 children ?: React . ReactNode ;
118- href ?: string ;
118+ href ?: RACLinkProps [ 'href' ] ;
119119 /**
120120 * Display the button in a loading state
121121 * @deprecated Use isPending instead.
You can’t perform that action at this time.
0 commit comments