|
| 1 | +--- |
| 2 | +import ComponentWrapper from '@static/ComponentWrapper.astro' |
| 3 | +import Layout from '@static/Layout.astro' |
| 4 | +
|
| 5 | +import AstroCopy from '@components/Copy/Copy.astro' |
| 6 | +import SvelteCopy from '@components/Copy/Copy.svelte' |
| 7 | +import ReactCopy from '@components/Copy/Copy.tsx' |
| 8 | +
|
| 9 | +import checkIcon from '../../icons/check.svg?raw' |
| 10 | +import fileIcon from '../../icons/file.svg?raw' |
| 11 | +
|
| 12 | +import { getSections } from '@helpers' |
| 13 | +
|
| 14 | +const sections = getSections({ |
| 15 | + title: 'copies', |
| 16 | + components: [AstroCopy, SvelteCopy, ReactCopy], |
| 17 | + showSubTitle: true |
| 18 | +}) |
| 19 | +--- |
| 20 | + |
| 21 | +<Layout> |
| 22 | + <h1>Copy</h1> |
| 23 | + <div class="grid md-2 lg-3"> |
| 24 | + <ComponentWrapper type="Astro"> |
| 25 | + <AstroCopy tooltip="Click icon to copy">Copy Astro</AstroCopy> |
| 26 | + </ComponentWrapper> |
| 27 | + |
| 28 | + <ComponentWrapper type="Svelte"> |
| 29 | + <SvelteCopy theme="alert" tooltip="Click icon to copy" client:load>Copy Svelte</SvelteCopy> |
| 30 | + </ComponentWrapper> |
| 31 | + |
| 32 | + <ComponentWrapper type="React"> |
| 33 | + <ReactCopy theme="info" tooltip="Click icon to copy" client:load>Copy React</ReactCopy> |
| 34 | + </ComponentWrapper> |
| 35 | + </div> |
| 36 | + |
| 37 | + {sections.map(section => ( |
| 38 | + <h1>{section.title}</h1> |
| 39 | + <Fragment> |
| 40 | + {section.subTitle && <h2 set:html={section.subTitle} />} |
| 41 | + </Fragment> |
| 42 | + <div class="flex wrap sm"> |
| 43 | + <section.component>Default</section.component> |
| 44 | + <section.component theme="secondary">Secondary</section.component> |
| 45 | + <section.component theme="outline">Outline</section.component> |
| 46 | + <section.component theme="flat">Flat</section.component> |
| 47 | + <section.component theme="info">Info</section.component> |
| 48 | + <section.component theme="success">Success</section.component> |
| 49 | + <section.component theme="warning">Warning</section.component> |
| 50 | + <section.component theme="alert">Alert</section.component> |
| 51 | + <section.component tooltip="Click icon to copy">With tooltip</section.component> |
| 52 | + <section.component tooltip="Click icon to copy" tooltipPosition="bottom"> |
| 53 | + With tooltip position |
| 54 | + </section.component> |
| 55 | + <section.component copyIcon={fileIcon} copiedIcon={checkIcon}> |
| 56 | + Custom Icons |
| 57 | + </section.component> |
| 58 | + <section.component small={true} rounded={true}> |
| 59 | + Small & rounded |
| 60 | + </section.component> |
| 61 | + </div> |
| 62 | + ))} |
| 63 | +</Layout> |
0 commit comments