-
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.
fix code examples for accordion and accordion group
- Loading branch information
1 parent
296033b
commit d30cff5
Showing
7 changed files
with
278 additions
and
22 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
110 changes: 110 additions & 0 deletions
110
packages/documentation/components/accordion-group/code-strings.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
const text = ` | ||
<p> | ||
Aenean aliquam dignissim pretium. Ut nulla nunc, euismod sit amet justo | ||
vel, convallis volutpat neque. Morbi semper odio sed diam tristique, nec | ||
tempor neque tempus. Praesent quis ultrices odio. Nulla vestibulum nulla | ||
sed massa molestie, quis vulputate risus semper. Phasellus elementum, | ||
metus in iaculis sollicitudin, risus elit pulvinar neque, eget pulvinar | ||
odio libero eu mi. Vivamus id leo facilisis, tincidunt lacus semper, | ||
condimentum est. Nam euismod non eros a lacinia. | ||
</p> | ||
`; | ||
|
||
export const AutoClosing = `const App = () => { | ||
return ( | ||
<AccordionGroup | ||
titles={['one', 'two', 'three']} | ||
autoClose | ||
border={false} | ||
size="sm" | ||
> | ||
${text.repeat(3)} | ||
</AccordionGroup> | ||
); | ||
`; | ||
|
||
export const CustomIconCode = `const App = () => { | ||
return ( | ||
<AccordionGroup | ||
titles={['one', 'two', 'three', 'four']} | ||
border={false} | ||
iconType="plus" | ||
> | ||
${text.repeat(4)} | ||
</AccordionGroup> | ||
); | ||
`; | ||
|
||
export const RTLCode = `const App = () => { | ||
return ( | ||
<AccordionGroup | ||
titles={['one', 'two', 'three', 'four']} | ||
border | ||
alignIconRight | ||
> | ||
${text.repeat(4)} | ||
</AccordionGroup> | ||
) | ||
}`; | ||
|
||
export const MediumSizedCode = `const App = () => { | ||
return ( | ||
<AccordionGroup | ||
titles={['one', 'two', 'three', 'four']} | ||
border={false} | ||
size="md" | ||
> | ||
${text.repeat(4)} | ||
</AccordionGroup> | ||
) | ||
}`; | ||
|
||
export const LargeSizedCode = `const App = () => { | ||
return ( | ||
<AccordionGroup | ||
titles={['one', 'two', 'three', 'four']} | ||
border={false} | ||
size="lg" | ||
> | ||
${text.repeat(4)} | ||
</AccordionGroup> | ||
) | ||
}`; | ||
|
||
export const DefaultCode = `const App = () => { | ||
return ( | ||
<AccordionGroup titles={['one', 'two']}> | ||
${text} | ||
<div | ||
style={{ | ||
height: '400px', | ||
width: '100%', | ||
}} | ||
> | ||
<Image src="https://bit.ly/3i9PcxC"></Image> | ||
</div> | ||
</AccordionGroup> | ||
); | ||
}`; | ||
|
||
export const InitialStateCode = `const App = () => { | ||
return ( | ||
<AccordionGroup | ||
titles={['one', 'two']} | ||
autoClose={false} | ||
border={false} | ||
expanded | ||
focusable | ||
> | ||
${text} | ||
<div | ||
style={{ | ||
height: '300px', | ||
width: '100%', | ||
}} | ||
> | ||
<Image src="https://bit.ly/3i9PcxC"></Image> | ||
</div> | ||
</AccordionGroup> | ||
); | ||
}`; |
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
76 changes: 76 additions & 0 deletions
76
packages/documentation/components/accordion/code-strings.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
const TextContent = ` | ||
<div> | ||
<p> | ||
Sed laoreet neque eget sem varius, et interdum dui venenatis. | ||
Suspendisse in faucibus tortor, nec aliquet arcu. Quisque at Proin | ||
auctor velit massa, euismod pretium dui euismod in. Pellentesque rhoncus | ||
eros id posuere tincidunt. Maecenas quis libero vitae elit consectetur | ||
finibus et ac libero. Donec at fermentum lectus. Cras iaculis augue non | ||
mauris interdum, vitae pretium mi blandit. Aenean ultrices pellentesque | ||
lectus ac faucibus. Morbi tristique vulputate nisi, id porttitor diam | ||
egestas a. Suspendisse a tortor suscipit, accumsan massa at, viverra | ||
urna. Maecenas vel lectus sodales, dapibus dolor eget, pharetra neque. | ||
Nam eleifend id mauris in suscipit. Ut sed risus at mi vulputate | ||
rhoncus. | ||
</p> | ||
<p> | ||
It is a long established fact that a reader will be distracted by the | ||
readable content of a page when looking at its layout. The point of | ||
using Lorem Ipsum is that it has a more-or-less normal distribution of | ||
letters, as opposed to using Content here, content here, making it look | ||
like readable English. Many desktop publishing packages and web page | ||
editors now use Lorem Ipsum as their default model text, and a search | ||
for lorem ipsum will uncover many web sites still in their infancy. | ||
Various versions have evolved over the years, sometimes by accident, | ||
sometimes on purpose (injected humour and the like). | ||
</p> | ||
</div> | ||
`; | ||
|
||
export const DefaultCodeString = `const App = () => { | ||
return ( | ||
<Accordion title="Lorem Ipsum" focusable> | ||
${TextContent} | ||
</Accordion> | ||
); | ||
}`; | ||
|
||
export const RTLCodeString = `const App = () => { | ||
return ( | ||
<Accordion title="Lorem Ipsum" alignIconRight border> | ||
${TextContent} | ||
</Accordion> | ||
); | ||
}`; | ||
|
||
export const ExpandedCodeString = `const App = () => { | ||
return ( | ||
<Accordion title="Lorem Ipsum" expanded focusable> | ||
${TextContent} | ||
</Accordion> | ||
); | ||
}`; | ||
|
||
export const MediumSizedCodeString = `const App = () => { | ||
return ( | ||
<Accordion title="Lorem Ipsum" size="md"> | ||
${TextContent} | ||
</Accordion> | ||
); | ||
}`; | ||
|
||
export const LargeSizedCodeString = `const App = () => { | ||
return ( | ||
<Accordion title="Lorem Ipsum" size="lg"> | ||
${TextContent} | ||
</Accordion> | ||
); | ||
}`; | ||
|
||
export const CustomIconCodeString = `const App = () => { | ||
return ( | ||
<Accordion title="Lorem Ipsum" customIcon={<span role="img">🔥</span>}> | ||
${TextContent} | ||
</Accordion> | ||
); | ||
}`; |
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.
d30cff5
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:
react-creme – ./
react-creme-prabhuignoto.vercel.app
react-creme-git-master-prabhuignoto.vercel.app
react-creme.vercel.app
react-creme.prabhumurthy.com