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
Showing
5 changed files
with
64 additions
and
50 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
website/app/[locale]/(root)/docs/column-span/components/Basic.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,27 @@ | ||
import Demo from 'websites/components/Demo' | ||
import DemoPanel from 'websites/components/DemoPanel' | ||
import Code from 'websites/components/Code' | ||
import clsx from 'clsx' | ||
|
||
export default ({ className }: any) => { | ||
return ( | ||
<> | ||
<Demo $py={0}> | ||
<DemoPanel> | ||
<div className="cols:3 gap:8x"> | ||
<p className="m:0">There are many different types of animals, each with unique characteristics.</p> | ||
<p className={clsx(className, 'fg:strong font:bold')}>No matter what type of animal you are interested in, you will find something interesting and informative here.</p> | ||
<p className="m:0">Look at some of the most amazing creatures on earth, from spiders to whales!</p> | ||
</div> | ||
</DemoPanel> | ||
</Demo> | ||
<Code lang="html">{` | ||
<div class="cols:3 gap:8x"> | ||
<p>There are many different types of animals, ...</p> | ||
<p class="**${className}** font:bold">No matter what type of animal ...</p> | ||
<p>Look at some of the most amazing creatures on earth, ...</p> | ||
</div> | ||
`}</Code> | ||
</> | ||
) | ||
} |
49 changes: 16 additions & 33 deletions
49
website/app/[locale]/(root)/docs/column-span/components/Overview.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 |
---|---|---|
@@ -1,37 +1,20 @@ | ||
'use client' | ||
|
||
import Demo from 'websites/components/Demo' | ||
import Code from 'websites/components/Code' | ||
import SyntaxTable from '~/components/SyntaxTable' | ||
import syntaxes from '../syntaxes' | ||
import line from 'to-line' | ||
import SyntaxTable from '~/components/SyntaxTable' | ||
import SyntaxTr from '~/components/SyntaxTr' | ||
import SyntaxPreview from './SyntaxPreview' | ||
|
||
export default () => | ||
<SyntaxTable value={syntaxes} default="col-span:all"> | ||
{(className: string) => | ||
<> | ||
<Demo> | ||
<div className="cols:3 gap:30 w:full w:full_:where(div)"> | ||
<div className="box mb:30">1</div> | ||
<div className="box mb:30">2</div> | ||
<div className="box mb:30">3</div> | ||
<div className={line(className, 'box', className.includes('all') ? 'mb:30' : 'mb:30')}>4</div> | ||
<div className="box mb:30">5</div> | ||
<div className="box mb:30">6</div> | ||
<div className="box mb:30">7</div> | ||
</div> | ||
</Demo> | ||
<Code lang="html">{` | ||
<div class="cols:3"> | ||
<div>1</div> | ||
<div>2</div> | ||
<div>3</div> | ||
<div class="**${className}**">4</div> | ||
<div>5</div> | ||
<div>6</div> | ||
<div>7</div> | ||
</div> | ||
`}</Code> | ||
</> | ||
} | ||
</SyntaxTable> | ||
export default () => { | ||
const previewSyntax = 'col-span:all' | ||
return ( | ||
<> | ||
<SyntaxTable> | ||
{syntaxes.map((syntax) => | ||
<SyntaxTr value={syntax} key={syntax} previewSyntax={previewSyntax}></SyntaxTr>) | ||
} | ||
</SyntaxTable> | ||
<SyntaxPreview className={previewSyntax} /> | ||
</> | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
website/app/[locale]/(root)/docs/column-span/components/SyntaxPreview.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,10 @@ | ||
'use client' | ||
|
||
import useSelectedPreviewSyntax from '~/utils/use-selected-preview-syntax' | ||
import Basic from './Basic' | ||
|
||
export default (props: any) => { | ||
return ( | ||
<Basic className={useSelectedPreviewSyntax(props.className)} /> | ||
) | ||
} |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
const syntaxes = [['column-span:`value`', 'col-span:`value`'], ['col-span:all'], ['col-span:none']] | ||
const syntaxes = [ | ||
['col-span:`value`'], | ||
'col-span:all', | ||
'col-span:none' | ||
] | ||
|
||
export default syntaxes |