-
Notifications
You must be signed in to change notification settings - Fork 0
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
d5f2cc6
commit bd2be94
Showing
6 changed files
with
63 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ComponentProps } from "react"; | ||
|
||
export type ControlProps = ComponentProps<"input">; | ||
|
||
export function Control(props: ControlProps) { | ||
return <input type="file" className="sr-only" id="photo" {...props} />; | ||
} |
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,9 @@ | ||
import { User } from "lucide-react"; | ||
|
||
export function ImagePreview() { | ||
return ( | ||
<div className="flex h-16 w-16 items-center justify-center rounded-full bg-violet-50"> | ||
<User className="h-8 w-8 text-violet-500" /> | ||
</div> | ||
); | ||
} |
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,7 @@ | ||
import { ComponentProps } from "react"; | ||
|
||
export type RootProps = ComponentProps<"div">; | ||
|
||
export function Root(props: RootProps) { | ||
return <div {...props} />; | ||
} |
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,22 @@ | ||
import { UploadCloud } from "lucide-react"; | ||
|
||
export function Trigger() { | ||
return ( | ||
<label | ||
htmlFor="photo" | ||
className="group flex flex-1 cursor-pointer flex-col items-center gap-3 rounded-lg border border-zinc-300 px-6 py-4 text-center text-zinc-500 shadow-sm hover:border-violet-200 hover:bg-violet-25 hover:text-violet-500" | ||
> | ||
<div className="rounded-full border-6 border-zinc-50 bg-zinc-100 p-2 group-hover:border-violet-50 group-hover:bg-violet-100"> | ||
<UploadCloud className="h-5 w-5 text-zinc-600 group-hover:text-violet-600" /> | ||
</div> | ||
|
||
<div className="flex flex-col items-center gap-1"> | ||
<span className="text-sm"> | ||
<span className="font-semibold text-violet-700">Click to upload</span>{" "} | ||
or drag and drop | ||
</span> | ||
<span className="text-xs">SVG, PNG, JPG or GIF (max. 800x400px)</span> | ||
</div> | ||
</label> | ||
); | ||
} |
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,6 @@ | ||
import { Control } from "./Control"; | ||
import { ImagePreview } from "./ImagePreview"; | ||
import { Root } from "./Root"; | ||
import { Trigger } from "./Trigger"; | ||
|
||
export { Control, ImagePreview, Root, Trigger }; |