-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
32 changed files
with
642 additions
and
431 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,25 +1,46 @@ | ||
import { cn } from '@/utils/styles'; | ||
import type { FC } from 'react'; | ||
import React from 'react'; | ||
|
||
interface CardProps { | ||
children: React.ReactNode; | ||
className?: string; | ||
footer?: React.ReactNode; | ||
} | ||
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn('rounded-lg border bg-card pt-8 text-card-foreground shadow-sm', className)} | ||
{...props} | ||
/> | ||
)); | ||
Card.displayName = 'Card'; | ||
|
||
const Card: FC<CardProps> = ({ children, className, footer }) => { | ||
return ( | ||
<div | ||
className={cn( | ||
'flex flex-col rounded-md bg-opacity-50 bg-clip-padding px-8 pt-8 shadow backdrop-blur-2xl backdrop-filter bg-white', | ||
className, | ||
{ 'pb-8': !footer } | ||
)} | ||
> | ||
{children} | ||
{footer && <div className="mt-8 pb-4">{footer}</div>} | ||
</div> | ||
); | ||
}; | ||
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>( | ||
({ className, ...props }, ref) => ( | ||
<div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} /> | ||
) | ||
); | ||
CardHeader.displayName = 'CardHeader'; | ||
|
||
export default Card; | ||
const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>( | ||
({ className, ...props }, ref) => ( | ||
<h3 ref={ref} className={cn('text-lg font-semibold leading-none tracking-tight', className)} {...props} /> | ||
) | ||
); | ||
CardTitle.displayName = 'CardTitle'; | ||
|
||
const CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>( | ||
({ className, ...props }, ref) => ( | ||
<p ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} /> | ||
) | ||
); | ||
CardDescription.displayName = 'CardDescription'; | ||
|
||
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>( | ||
({ className, ...props }, ref) => <div ref={ref} className={cn('p-6 pt-0', className)} {...props} /> | ||
); | ||
CardContent.displayName = 'CardContent'; | ||
|
||
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>( | ||
({ className, ...props }, ref) => ( | ||
<div ref={ref} className={cn(' flex items-center p-6 pt-0', className)} {...props} /> | ||
) | ||
); | ||
CardFooter.displayName = 'CardFooter'; | ||
|
||
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }; |
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
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,30 @@ | ||
'use client'; | ||
|
||
import { cn } from '@/utils/styles'; | ||
import * as PopoverPrimitive from '@radix-ui/react-popover'; | ||
import * as React from 'react'; | ||
|
||
const Popover = PopoverPrimitive.Root; | ||
|
||
const PopoverTrigger = PopoverPrimitive.Trigger; | ||
|
||
const PopoverContent = React.forwardRef< | ||
React.ElementRef<typeof PopoverPrimitive.Content>, | ||
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> | ||
>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => ( | ||
<PopoverPrimitive.Portal> | ||
<PopoverPrimitive.Content | ||
ref={ref} | ||
align={align} | ||
sideOffset={sideOffset} | ||
className={cn( | ||
'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', | ||
className | ||
)} | ||
{...props} | ||
/> | ||
</PopoverPrimitive.Portal> | ||
)); | ||
PopoverContent.displayName = PopoverPrimitive.Content.displayName; | ||
|
||
export { Popover, PopoverTrigger, PopoverContent }; |
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
Oops, something went wrong.
22842b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ideas – ./
ideas-git-main-stormix.vercel.app
ideas-stormix.vercel.app
whatshouldibuildnext.com
www.whatshouldibuildnext.com