-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #6219 from nitrogenous/icon-field
New components IconField & InputIcon
- Loading branch information
Showing
70 changed files
with
4,373 additions
and
1,266 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//Remove '*' during the development. | ||
* |
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,14 @@ | ||
import React from 'react'; | ||
import { DocSectionText } from '@/components/doc/common/docsectiontext'; | ||
|
||
export function AccessibilityDoc() { | ||
return ( | ||
<DocSectionText id="accessibility" label="Accessibility"> | ||
<h3>Screen Reader</h3> | ||
<p>IconField and InputIcon does not require any roles and attributes.</p> | ||
|
||
<h3>Keyboard Support</h3> | ||
<p>Components does not include any interactive elements.</p> | ||
</DocSectionText> | ||
); | ||
} |
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,84 @@ | ||
import React, { useState } from 'react'; | ||
import { DocSectionCode } from '@/components/doc/common/docsectioncode'; | ||
import { DocSectionText } from '@/components/doc/common/docsectiontext'; | ||
import { IconField } from '@/components/lib/iconfield/IconField'; | ||
import { InputIcon } from '@/components/lib/inputicon/InputIcon'; | ||
import { InputText } from '@/components/lib/inputtext/InputText'; | ||
|
||
export function BasicDoc(props) { | ||
const code = { | ||
basic: ` | ||
<IconField iconPosition="left"> | ||
<InputIcon className="pi pi-search"> </InputIcon> | ||
<InputText v-model="value1" placeholder="Search" /> | ||
</IconField> | ||
<IconField> | ||
<InputIcon className="pi pi-spin pi-spinner"> </InputIcon> | ||
<InputText v-model="value2" /> | ||
</IconField> | ||
`, | ||
javascript: ` | ||
import React from "react"; | ||
import { IconField } from "primereact/iconfield"; | ||
import { InputIcon } from "primereact/inputicon"; | ||
import { InputText } from "primereact/inputtext"; | ||
export default function BasicDemo() { | ||
return ( | ||
<IconField iconPosition="left"> | ||
<InputIcon className="pi pi-search"> </InputIcon> | ||
<InputText v-model="value1" placeholder="Search" /> | ||
</IconField> | ||
<IconField> | ||
<InputIcon className="pi pi-spin pi-spinner"> </InputIcon> | ||
<InputText v-model="value2" /> | ||
</IconField> | ||
) | ||
} | ||
`, | ||
typescript: ` | ||
import React from "react"; | ||
import { IconField } from "primereact/iconfield"; | ||
import { InputIcon } from "primereact/inputicon"; | ||
import { InputText } from "primereact/inputtext"; | ||
export default function BasicDemo() { | ||
return ( | ||
<IconField iconPosition="left"> | ||
<InputIcon className="pi pi-search"> </InputIcon> | ||
<InputText v-model="value1" placeholder="Search" /> | ||
</IconField> | ||
<IconField> | ||
<InputIcon className="pi pi-spin pi-spinner"> </InputIcon> | ||
<InputText v-model="value2" /> | ||
</IconField> | ||
) | ||
} | ||
` | ||
}; | ||
|
||
return ( | ||
<> | ||
<DocSectionText {...props}> | ||
<p> | ||
IconField is used as a controlled input with <i>value</i> and <i>onChange</i> properties. | ||
</p> | ||
</DocSectionText> | ||
<div className="card flex flex-wrap justify-content-center gap-3"> | ||
<IconField iconPosition="left"> | ||
<InputIcon className="pi pi-search" /> | ||
<InputText v-model="value1" placeholder="Search" /> | ||
</IconField> | ||
|
||
<IconField> | ||
<InputIcon className="pi pi-spin pi-spinner" /> | ||
<InputText v-model="value2" /> | ||
</IconField> | ||
</div> | ||
<DocSectionCode code={code} /> | ||
</> | ||
); | ||
} |
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,18 @@ | ||
import { DocSectionCode } from '@/components/doc/common/docsectioncode'; | ||
import { DocSectionText } from '@/components/doc/common/docsectiontext'; | ||
|
||
export function ImportDoc(props) { | ||
const code = { | ||
basic: ` | ||
import { IconField } from 'primereact/iconfield'; | ||
import { InputIcon } from 'primereact/inputicon'; | ||
` | ||
}; | ||
|
||
return ( | ||
<> | ||
<DocSectionText {...props}></DocSectionText> | ||
<DocSectionCode code={code} hideToggleCode import hideStackBlitz /> | ||
</> | ||
); | ||
} |
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,26 @@ | ||
import React from 'react'; | ||
import { DocSectionCode } from '@/components/doc/common/docsectioncode'; | ||
import { DocSectionText } from '@/components/doc/common/docsectiontext'; | ||
import { InputText } from '@/components/lib/inputtext/InputText'; | ||
|
||
export function PTDoc(props) { | ||
return ( | ||
<> | ||
<DocSectionText {...props}> | ||
<p> | ||
InputText is used as a controlled input with <i>value</i> and <i>onChange</i> properties. | ||
</p> | ||
</DocSectionText> | ||
<div className="card flex justify-content-center"> | ||
<InputText | ||
value={value} | ||
onChange={(e) => setValue(e.target.value)} | ||
pt={{ | ||
root: { className: 'border-primary-400' } | ||
}} | ||
/> | ||
</div> | ||
<DocSectionCode code={code} /> | ||
</> | ||
); | ||
} |
Oops, something went wrong.