-
Notifications
You must be signed in to change notification settings - Fork 119
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
d49c2fa
commit 6d574ee
Showing
55 changed files
with
601 additions
and
2,269 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,52 @@ | ||
import { DefaultInput, DefaultInputCode } from './variant/DefaultInput' | ||
import { LabelInput, LabelInputCode } from './variant/LabelInput' | ||
import { InputWithIcon, InputWithIconCode } from './variant/InputWithIcon' | ||
import { DisabledInput, DisabledInputCode } from './variant/DisabledInput' | ||
import { InputUseCaseCode, InputUseCases } from './variant/InputUseCases' | ||
|
||
import CodePreview from '../../../components/CodePreview' | ||
import ComponentApi from '../../../components/ComponentApi' | ||
|
||
## Table of Contents | ||
|
||
The Input Component is a fundamental user interface element used to collect user input or data in various forms, such as text, numbers, dates, or selections. It provides a space where users can type or select information, allowing them to interact with the application and provide necessary inputs. | ||
|
||
## Default Input | ||
|
||
Show a basic input field. | ||
|
||
<CodePreview github="Input" code={DefaultInputCode}> | ||
<DefaultInput /> | ||
</CodePreview> | ||
|
||
## Input With Label | ||
|
||
Input field with a corresponding label. | ||
|
||
<CodePreview github="Input" code={LabelInputCode}> | ||
<LabelInput /> | ||
</CodePreview> | ||
|
||
## Input With Icon | ||
|
||
Input field with an accompanying icon. | ||
|
||
<CodePreview github="Input" code={InputWithIconCode}> | ||
<InputWithIcon /> | ||
</CodePreview> | ||
|
||
## Disabled Input | ||
|
||
Disabled input field example. | ||
|
||
<CodePreview github="Input" code={DisabledInputCode}> | ||
<DisabledInput /> | ||
</CodePreview> | ||
|
||
## Use Case of Input | ||
|
||
An example demonstrating the usage of input fields. | ||
|
||
<CodePreview github="Input" code={InputUseCaseCode}> | ||
<InputUseCases /> | ||
</CodePreview> |
Empty file.
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 @@ | ||
'use client' | ||
import type { FC } from 'react' | ||
import InputDocsContent from './Input.mdx' | ||
|
||
const InputDocs: FC = () => <InputDocsContent /> | ||
|
||
export default InputDocs |
6 changes: 3 additions & 3 deletions
6
app/docs/components/textInput/page.tsx → app/docs/components/input/page.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,21 @@ | ||
'use client' | ||
import { Input } from '../../../../src' | ||
|
||
const DefaultInput = () => { | ||
return ( | ||
<div className="max-w-md p-2"> | ||
<Input placeholder="Enter name" type="text" /> | ||
</div> | ||
) | ||
} | ||
|
||
const DefaultInputCode = ` | ||
'use client' | ||
import { Input } from 'keep-react' | ||
export const InputComponent = () => { | ||
return <Input placeholder="Enter name" type="text" /> | ||
} | ||
` | ||
|
||
export { DefaultInput, DefaultInputCode } |
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,21 @@ | ||
'use client' | ||
import { Input } from '../../../../src' | ||
|
||
const DisabledInput = () => { | ||
return ( | ||
<div className="max-w-md p-2"> | ||
<Input disabled={true} placeholder="Enter name" /> | ||
</div> | ||
) | ||
} | ||
|
||
const DisabledInputCode = ` | ||
'use client' | ||
import { Input } from 'keep-react' | ||
export const InputComponent = () => { | ||
return <Input disabled={true} placeholder="Enter name" /> | ||
} | ||
` | ||
|
||
export { DisabledInput, DisabledInputCode } |
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,67 @@ | ||
'use client' | ||
import { Envelope, Lock } from 'phosphor-react' | ||
import { Button, Icon, Input, Label } from '../../../../src' | ||
|
||
const InputUseCases = () => { | ||
return ( | ||
<form className="mx-auto max-w-md space-y-2 rounded-lg border p-8 shadow-md"> | ||
<fieldset className="space-y-1"> | ||
<Label htmlFor="name">Email*</Label> | ||
<div className="relative"> | ||
<Input placeholder="Enter email" className="ps-11" /> | ||
<Icon> | ||
<Envelope size={19} color="#AFBACA" /> | ||
</Icon> | ||
</div> | ||
</fieldset> | ||
<fieldset className="space-y-1"> | ||
<Label htmlFor="password">Password*</Label> | ||
<div className="relative"> | ||
<Input id="password" placeholder="Enter password" type="password" className="ps-11" /> | ||
<Icon> | ||
<Lock size={19} color="#AFBACA" /> | ||
</Icon> | ||
</div> | ||
</fieldset> | ||
<Button size="sm" color="secondary" type="submit"> | ||
Sign In | ||
</Button> | ||
</form> | ||
) | ||
} | ||
|
||
const InputUseCaseCode = ` | ||
'use client' | ||
import { Envelope, Lock } from 'phosphor-react' | ||
import { Button, Icon, Input, Label } from 'keep-react' | ||
export const InputComponent = () => { | ||
return ( | ||
<form className="mx-auto max-w-md space-y-2 rounded-lg border p-8 shadow-md"> | ||
<fieldset className="space-y-1"> | ||
<Label htmlFor="name">Email</Label> | ||
<div className="relative"> | ||
<Input placeholder="Enter email" className="ps-11" /> | ||
<Icon> | ||
<Envelope size={19} color="#AFBACA" /> | ||
</Icon> | ||
</div> | ||
</fieldset> | ||
<fieldset className="space-y-1"> | ||
<Label htmlFor="password">Password</Label> | ||
<div className="relative"> | ||
<Input id="password" placeholder="Enter password" type="password" className="ps-11" /> | ||
<Icon> | ||
<Lock size={19} color="#AFBACA" /> | ||
</Icon> | ||
</div> | ||
</fieldset> | ||
<Button size="sm" color="secondary" type="submit"> | ||
Sign In | ||
</Button> | ||
</form> | ||
) | ||
} | ||
` | ||
|
||
export { InputUseCaseCode, InputUseCases } |
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,35 @@ | ||
'use client' | ||
import { Envelope } from 'phosphor-react' | ||
import { Icon, Input } from '../../../../src' | ||
|
||
const InputWithIcon = () => { | ||
return ( | ||
<div className="p-2"> | ||
<fieldset className="relative max-w-md"> | ||
<Input placeholder="Enter email" className="ps-11" /> | ||
<Icon> | ||
<Envelope size={19} color="#AFBACA" /> | ||
</Icon> | ||
</fieldset> | ||
</div> | ||
) | ||
} | ||
|
||
const InputWithIconCode = ` | ||
'use client' | ||
import { Envelope } from 'phosphor-react' | ||
import { Icon, Input } from 'keep-react' | ||
const InputWithIcon = () => { | ||
return ( | ||
<fieldset className="relative max-w-md"> | ||
<Input placeholder="Enter email" className="ps-11" /> | ||
<Icon> | ||
<Envelope size={19} color="#AFBACA" /> | ||
</Icon> | ||
</fieldset> | ||
) | ||
} | ||
` | ||
|
||
export { InputWithIcon, InputWithIconCode } |
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,27 @@ | ||
'use client' | ||
import { Input, Label } from '../../../../src' | ||
|
||
const LabelInput = () => { | ||
return ( | ||
<fieldset className="max-w-md space-y-1 p-2"> | ||
<Label htmlFor="name">Enter Name</Label> | ||
<Input id="name" placeholder="Enter name" type="text" /> | ||
</fieldset> | ||
) | ||
} | ||
|
||
const LabelInputCode = ` | ||
'use client' | ||
import { Input, Label } from 'keep-react' | ||
const LabelInput = () => { | ||
return ( | ||
<fieldset className="max-w-md space-y-1"> | ||
<Label htmlFor="name">Enter Name</Label> | ||
<Input id="name" placeholder="Enter name" type="text" /> | ||
</fieldset> | ||
) | ||
} | ||
` | ||
|
||
export { LabelInput, LabelInputCode } |
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
Oops, something went wrong.