Skip to content

Commit

Permalink
Update syntaxes in various components
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Jan 15, 2024
1 parent 5dec3ea commit 71e969a
Show file tree
Hide file tree
Showing 164 changed files with 2,087 additions and 1,314 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'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'

export default () =>
<SyntaxTable value={syntaxes}></SyntaxTable>
export default () => {
return (
<>
<SyntaxTable>
{syntaxes.map((syntax) =>
<SyntaxTr value={syntax} key={syntax}></SyntaxTr>)
}
</SyntaxTable>
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'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'

export default () =>
<SyntaxTable value={syntaxes}></SyntaxTable>
export default () => {
return (
<>
<SyntaxTable>
{syntaxes.map((syntax) =>
<SyntaxTr value={syntax} key={syntax}></SyntaxTr>)
}
</SyntaxTable>
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'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'

export default () =>
<SyntaxTable value={syntaxes}></SyntaxTable>
export default () => {
return (
<>
<SyntaxTable>
{syntaxes.map((syntax) =>
<SyntaxTr value={syntax} key={syntax}></SyntaxTr>)
}
</SyntaxTable>
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'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'

export default () =>
<SyntaxTable value={syntaxes}></SyntaxTable>
export default () => {
return (
<>
<SyntaxTable>
{syntaxes.map((syntax) =>
<SyntaxTr value={syntax} key={syntax}></SyntaxTr>)
}
</SyntaxTable>
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'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'

export default () =>
<SyntaxTable value={syntaxes}></SyntaxTable>
export default () => {
return (
<>
<SyntaxTable>
{syntaxes.map((syntax) =>
<SyntaxTr value={syntax} key={syntax}></SyntaxTr>)
}
</SyntaxTable>
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'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'

export default () =>
<SyntaxTable value={syntaxes}></SyntaxTable>
export default () => {
return (
<>
<SyntaxTable>
{syntaxes.map((syntax) =>
<SyntaxTr value={syntax} key={syntax}></SyntaxTr>)
}
</SyntaxTable>
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'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'

export default () =>
<SyntaxTable value={syntaxes}></SyntaxTable>
export default () => {
return (
<>
<SyntaxTable>
{syntaxes.map((syntax) =>
<SyntaxTr value={syntax} key={syntax}></SyntaxTr>)
}
</SyntaxTable>
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'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'

export default () =>
<SyntaxTable value={syntaxes}></SyntaxTable>
export default () => {
return (
<>
<SyntaxTable>
{syntaxes.map((syntax) =>
<SyntaxTr value={syntax} key={syntax}></SyntaxTr>)
}
</SyntaxTable>
</>
)
}
64 changes: 30 additions & 34 deletions website/app/[locale]/(root)/docs/animation/components/Overview.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
'use client'

import Demo from 'websites/components/Demo'
import Code from 'websites/components/Code'
import SyntaxTable from '~/components/SyntaxTable'
import syntaxes from '../syntaxes'
import { l } from 'to-line'
import { IconBallTennis, IconBell, IconBellRinging, IconCircle, IconCurrentLocation, IconFocusCentered, IconHandFinger, IconHeart, IconLoader, IconLoader2, IconLoaderQuarter, IconMapPin, IconMaximize, IconPointer, IconSquare, IconStar, IconUfo } from '@tabler/icons-react'
import clsx from 'clsx'
import SyntaxTr from '~/components/SyntaxTr'

export default () =>
<SyntaxTable value={syntaxes} scrollY={false} previewClass={(eachClass: string) => {
const className = 'app-icon-primary stroke:1 v:top mr:3x ml:-2 contain:strict'
if (eachClass.startsWith('@flash')) {
return <IconStar className={l(eachClass, className)} />
}
if (eachClass.startsWith('@heart')) {
return <IconHeart className={l(eachClass, className)} />
}
if (eachClass.startsWith('@pulse')) {
return <IconHandFinger className={l(eachClass, className)} />
}
if (eachClass.startsWith('@zoom')) {
return <IconMaximize className={l(eachClass, className)} />
}
if (eachClass.startsWith('@jump')) {
return <IconBallTennis className={l(eachClass, className)} />
}
if (eachClass.startsWith('@shake')) {
return <IconBell className={l(eachClass, className)} />
}
if (eachClass.startsWith('@rotate')) {
return <IconLoader className={l(eachClass, className)} />
}
if (eachClass.startsWith('@float')) {
return <IconUfo className={l(eachClass, className)} />
}
return <IconCircle className={l(eachClass, className)} />
}}></SyntaxTable>
export default () => {
const previewSyntax = ''
return (
<SyntaxTable scrollY={0}>
{syntaxes.map((syntax) => {
return (
<SyntaxTr value={syntax} key={syntax} previewSyntax={previewSyntax}>
{typeof syntax === 'string' && {
'@fade|1s|infinite': <IconCircle className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />,
'@fade|1s|infinite|reverse': <IconCircle className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />,
'@ping|1s|infinite': <IconCircle className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />,
'@flash|1s|infinite': <IconStar className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />,
'@heart|1s|infinite': <IconHeart className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />,
'@jump|1s|infinite': <IconBallTennis className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />,
'@pulse|1s|infinite': <IconHandFinger className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />,
'@rotate|1s|infinite|linear': <IconLoader className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />,
'@rotate|1s|infinite|linear|reverse': <IconLoader className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />,
'@shake|1s|infinite': <IconBell className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />,
'@zoom|1s|infinite': <IconMaximize className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />,
'@float|3s|ease-in-out|infinite': <IconUfo className={clsx('app-icon-primary contain:strict ml:-2 mr:3x stroke:1 v:top', syntax)} />
}[syntax]}
</SyntaxTr>
)
}
)}
</SyntaxTable>
)
}
8 changes: 0 additions & 8 deletions website/app/[locale]/(root)/docs/animation/content.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
## Overview [sr-only]
<Overview />

Simplify the native syntax using the derived symbol and multi-style shorthand.
```html
-<div class="animation:fade|1s">
+<div class="@fade|1s">Recommanded
```

---

## Basic usage
### Ping indicator
Use the `ping` animation to indicate that the shop is open.
Expand Down
2 changes: 1 addition & 1 deletion website/app/[locale]/(root)/docs/animation/syntaxes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const syntaxes = [
['animation:`name`|`duration`|`…`', '@`name`|`duration`|`…`'],
['@`name`|`duration`|`…`'],
'@fade|1s|infinite',
'@fade|1s|infinite|reverse',
'@ping|1s|infinite',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'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'

export default () =>
<SyntaxTable value={syntaxes}></SyntaxTable>
export default () => {
return (
<>
<SyntaxTable>
{syntaxes.map((syntax) =>
<SyntaxTr value={syntax} key={syntax}></SyntaxTr>)
}
</SyntaxTable>
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'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'

export default () =>
<SyntaxTable value={syntaxes}></SyntaxTable>
export default () => {
return (
<>
<SyntaxTable>
{syntaxes.map((syntax) =>
<SyntaxTr value={syntax} key={syntax}></SyntaxTr>)
}
</SyntaxTable>
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'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'

export default () =>
<SyntaxTable value={syntaxes}></SyntaxTable>
export default () => {
return (
<>
<SyntaxTable>
{syntaxes.map((syntax) =>
<SyntaxTr value={syntax} key={syntax}></SyntaxTr>)
}
</SyntaxTable>
</>
)
}
Loading

0 comments on commit 71e969a

Please sign in to comment.