-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Redish101/dev
24.5.4 dev累计更新同步
- Loading branch information
Showing
7 changed files
with
1,018 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
import Button from "@/components/Button"; | ||
import TextField from "@/components/TextField"; | ||
|
||
export default function App() { | ||
return ( | ||
<div> | ||
|
||
<div className="flex gap-1 p-24"> | ||
<div> | ||
<h2 className="font-light text-3xl">Buttons</h2> | ||
<div className="flex gap-1"> | ||
<Button variant="filled">Button</Button> | ||
<Button variant="outlined">Button</Button> | ||
<Button variant="text">Button</Button> | ||
</div> | ||
<h2 className="font-light text-3xl mt-12">Text Fields</h2> | ||
<div className="flex gap-1"> | ||
<TextField | ||
label="Label" | ||
placeholder="Placeholder" | ||
variant="filled" | ||
/> | ||
</div> | ||
</div> | ||
</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
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,28 @@ | ||
import { InputHTMLAttributes } from "react"; | ||
|
||
export interface TextFieldProps extends InputHTMLAttributes<HTMLElement> { | ||
label: string; | ||
placeholder: string; | ||
variant?: "filled" | "outlined" | ||
} | ||
|
||
export default function TextField({ | ||
label, | ||
placeholder, | ||
variant = "filled", | ||
...rest | ||
}: TextFieldProps) { | ||
return ( | ||
<div> | ||
<label | ||
className="pos-absolute px-4 pt-2 text-sm text-gray-500" | ||
>{label}</label> | ||
<input | ||
placeholder={placeholder} | ||
className="border-b-2 b-t-none b-x-none pt-7 rounded-t-md text-base flex justify-start items-start px-4 pb-2 bg-gray-200 placeholder-gray-600 placeholder-text-base outline-none focus:b-b-primary ease-in-out transition-all duration-300 | ||
" | ||
{...rest} | ||
/> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.