This repository has been archived by the owner on Feb 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93d5b93
commit 75426dd
Showing
9 changed files
with
3,022 additions
and
2,431 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 9 additions & 1 deletion
10
src/components/ui/dialog/dialog.test.tsx → ...onents/ui/dialog/__test__/dialog.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { forwardRef, ElementRef, ComponentPropsWithoutRef } from 'react'; | ||
import { | ||
Root, | ||
Trigger, | ||
Group, | ||
Portal, | ||
Sub, | ||
SubTrigger, | ||
RadioGroup, | ||
SubContent, | ||
Content, | ||
Item, | ||
Label, | ||
Separator, | ||
} from '@radix-ui/react-dropdown-menu'; | ||
|
||
const DropdownMenu = Root; | ||
const DropdownMenuTrigger = Trigger; | ||
const DropdownMenuGroup = Group; | ||
const DropdownMenuPortal = Portal; | ||
const DropdownMenuSub = Sub; | ||
const DropdownMenuRadioGroup = RadioGroup; | ||
|
||
const DropdownMenuSubTrigger = forwardRef<ElementRef<typeof SubTrigger>, ComponentPropsWithoutRef<typeof SubTrigger>>( | ||
({ children, ...props }, ref) => ( | ||
<SubTrigger ref={ref} {...props}> | ||
{children} | ||
</SubTrigger> | ||
) | ||
); | ||
DropdownMenuSubTrigger.displayName = SubTrigger.displayName; | ||
|
||
const DropdownMenuSubContent = forwardRef<ElementRef<typeof SubContent>, ComponentPropsWithoutRef<typeof SubContent>>( | ||
(props, ref) => <SubContent ref={ref} {...props} /> | ||
); | ||
DropdownMenuSubContent.displayName = SubContent.displayName; | ||
|
||
const DropdownMenuContent = forwardRef<ElementRef<typeof Content>, ComponentPropsWithoutRef<typeof Content>>( | ||
({ sideOffset = 4, ...props }, ref) => ( | ||
<Portal> | ||
<Content ref={ref} sideOffset={sideOffset} {...props} /> | ||
</Portal> | ||
) | ||
); | ||
DropdownMenuContent.displayName = Content.displayName; | ||
|
||
const DropdownMenuItem = forwardRef<ElementRef<typeof Item>, ComponentPropsWithoutRef<typeof Item>>((props, ref) => ( | ||
<Item ref={ref} {...props} /> | ||
)); | ||
DropdownMenuItem.displayName = Item.displayName; | ||
|
||
const DropdownMenuLabel = forwardRef<ElementRef<typeof Label>, ComponentPropsWithoutRef<typeof Label>>((props, ref) => ( | ||
<Label ref={ref} {...props} /> | ||
)); | ||
DropdownMenuLabel.displayName = Label.displayName; | ||
|
||
const DropdownMenuSeparator = forwardRef<ElementRef<typeof Separator>, ComponentPropsWithoutRef<typeof Separator>>( | ||
(props, ref) => <Separator ref={ref} {...props} /> | ||
); | ||
DropdownMenuSeparator.displayName = Separator.displayName; | ||
|
||
export { | ||
DropdownMenu, | ||
DropdownMenuTrigger, | ||
DropdownMenuContent, | ||
DropdownMenuItem, | ||
DropdownMenuLabel, | ||
DropdownMenuSeparator, | ||
DropdownMenuGroup, | ||
DropdownMenuPortal, | ||
DropdownMenuSub, | ||
DropdownMenuSubContent, | ||
DropdownMenuSubTrigger, | ||
DropdownMenuRadioGroup, | ||
}; |
This file was deleted.
Oops, something went wrong.