|
| 1 | +--- |
| 2 | +import Card from '@components/Card/Card.astro' |
| 3 | +import Input from '@components/Input/Input.astro' |
| 4 | +import Badge from '@components/Badge/Badge.astro' |
| 5 | +import Button from '@components/Button/Button.astro' |
| 6 | +import Checkbox from '@components/Checkbox/Checkbox.astro' |
| 7 | +import Radio from '@components/Radio/Radio.astro' |
| 8 | +import Switch from '@components/Switch/Switch.astro' |
| 9 | +import Avatar from '@components/Avatar/Avatar.astro' |
| 10 | +import Tabs from '@components/Tabs/Tabs.astro' |
| 11 | +import Table from '@components/Table/Table.astro' |
| 12 | +import Timeline from '@components/Timeline/Timeline.astro' |
| 13 | +import Progress from '@components/Progress/Progress.astro' |
| 14 | +import Rating from '@components/Rating/Rating.astro' |
| 15 | +import Spinner from '@components/Spinner/Spinner.astro' |
| 16 | +import TimelineItem from '@components/TimelineItem/TimelineItem.astro' |
| 17 | +
|
| 18 | +import { avatarGroup } from '@data' |
| 19 | +
|
| 20 | +const tabItems = [{ |
| 21 | + label: 'Profile', |
| 22 | + value: 'profile', |
| 23 | + active: true |
| 24 | +}, { |
| 25 | + label: 'Contact', |
| 26 | + value: 'contact' |
| 27 | +}] |
| 28 | +
|
| 29 | +const radioItems = [ |
| 30 | + { label: 'All messages', value: '1' }, |
| 31 | + { label: 'Direct messages only', value: '2', selected: true }, |
| 32 | + { label: 'No notifications', value: '3'}, |
| 33 | +] |
| 34 | +
|
| 35 | +const tasks = [ |
| 36 | + { theme: null, label: 'IP', ticket: 'W4567 - Home redesign' }, |
| 37 | + { theme: 'alert', label: 'P1', ticket: 'W2345 - Payment gateway warnings' }, |
| 38 | + { theme: 'warning', label: 'P3', ticket: 'W6789 - Investigate user auth issues' }, |
| 39 | + { theme: 'info', label: 'TODO', ticket: 'W1357 - Mobile redesign' } |
| 40 | +] |
| 41 | +--- |
| 42 | + |
| 43 | +<div class="examples flex"> |
| 44 | + <div class="example-column flex column"> |
| 45 | + <Card title="Sign up"> |
| 46 | + <div class="flex column"> |
| 47 | + <Input label="Email" placeholder="Enter your email" /> |
| 48 | + <Input |
| 49 | + type="password" |
| 50 | + label="Password" |
| 51 | + placeholder="Enter your password" |
| 52 | + subText="Generate a unique password <a href='#'>here</a>" |
| 53 | + /> |
| 54 | + <div> |
| 55 | + <Button theme="success">Create an account</Button> |
| 56 | + <Button theme="secondary">Sign in</Button> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + </Card> |
| 60 | + <Card> |
| 61 | + <Timeline theme="fill"> |
| 62 | + <TimelineItem title="2020"> |
| 63 | + <strong>Founded</strong> |
| 64 | + <br /> |
| 65 | + <span class="muted"> |
| 66 | + Launched our mission to transform online shopping with a handpicked selection of goods and a commitment to unparalleled customer care. |
| 67 | + </span> |
| 68 | + </TimelineItem> |
| 69 | + <TimelineItem title="2021"> |
| 70 | + <strong>Expanded Offerings</strong> |
| 71 | + <br /> |
| 72 | + <span class="muted"> |
| 73 | + Introduced over 500 unique, locally-sourced products, enriching our collection and supporting small businesses. |
| 74 | + </span> |
| 75 | + </TimelineItem> |
| 76 | + <TimelineItem title="2022"> |
| 77 | + <strong>⭐ Achieved Milestone</strong> |
| 78 | + <br /> |
| 79 | + <span class="muted"> |
| 80 | + Proudly served 100,000 happy customers, marked by launching same-day delivery in major cities and exclusive membership perks. |
| 81 | + </span> |
| 82 | + </TimelineItem> |
| 83 | + </Timeline> |
| 84 | + </Card> |
| 85 | + </div> |
| 86 | + |
| 87 | + <div class="example-column flex column"> |
| 88 | + <Card title="Settings"> |
| 89 | + <div class="flex column"> |
| 90 | + <Checkbox |
| 91 | + label="Enable all notifications" |
| 92 | + subText="Enable or disable all of your notification with one click. Previous settings will be overwritten." |
| 93 | + /> |
| 94 | + <Switch label="Security emails" toggled={true} /> |
| 95 | + <Switch label="Marketing emails" /> |
| 96 | + <hr /> |
| 97 | + <strong class="slack">Slack notifications</strong> |
| 98 | + <Radio |
| 99 | + items={radioItems} |
| 100 | + name="radio-example" |
| 101 | + /> |
| 102 | + </div> |
| 103 | + </Card> |
| 104 | + <Card title="SEO Overview"> |
| 105 | + <span>Keep track of the SEO performance of your posts.</span> |
| 106 | + |
| 107 | + <div class="my flex column md"> |
| 108 | + <div> |
| 109 | + <div class="flex justify-between muted progress-label"> |
| 110 | + <span>Underperforming</span> |
| 111 | + <span>50%</span> |
| 112 | + </div> |
| 113 | + <Progress value={50} color="var(--w-color-alert)" /> |
| 114 | + </div> |
| 115 | + <div> |
| 116 | + <div class="flex justify-between muted progress-label"> |
| 117 | + <span>OK</span> |
| 118 | + <span>30%</span> |
| 119 | + </div> |
| 120 | + <Progress value={30} color="var(--w-color-warning)" /> |
| 121 | + </div> |
| 122 | + <div> |
| 123 | + <div class="flex justify-between muted progress-label"> |
| 124 | + <span>SEO-friendly</span> |
| 125 | + <span>20%</span> |
| 126 | + </div> |
| 127 | + <Progress value={20} color="var(--w-color-success)" /> |
| 128 | + </div> |
| 129 | + </div> |
| 130 | + </Card> |
| 131 | + </div> |
| 132 | + |
| 133 | + <div class="example-column flex column"> |
| 134 | + <Card> |
| 135 | + <Tabs items={tabItems} theme="boxed" even={true}> |
| 136 | + <div data-tab="profile" data-active="true"> |
| 137 | + <div class="flex sm items-center"> |
| 138 | + <Avatar |
| 139 | + img="/img/avatar2.png" |
| 140 | + size={50} |
| 141 | + /> |
| 142 | + <div class="flex column xs"> |
| 143 | + <span>Emily</span> |
| 144 | + <span class="muted">QA Engineer</span> |
| 145 | + </div> |
| 146 | + </div> |
| 147 | + |
| 148 | + <strong class="tasks">Tasks</strong> |
| 149 | + <hr /> |
| 150 | + <div class="flex column xs"> |
| 151 | + {tasks.map(task => ( |
| 152 | + <div> |
| 153 | + <Badge theme={task.theme as any}> |
| 154 | + {task.label} |
| 155 | + </Badge> |
| 156 | + <a href="#" class="muted task"> |
| 157 | + {task.ticket} |
| 158 | + </a> |
| 159 | + </div> |
| 160 | + ))} |
| 161 | + </div> |
| 162 | + </div> |
| 163 | + <div data-tab="contact"> |
| 164 | + <Table |
| 165 | + data={[ |
| 166 | + ['Phone', '+1 234 5678'], |
| 167 | + ['Email', '<a href="#">emily@example.com</a>'], |
| 168 | + ['Slack', '@emily09'], |
| 169 | + ['Address', 'Mars, Pennsylvania'] |
| 170 | + ]} |
| 171 | + /> |
| 172 | + </div> |
| 173 | + </Tabs> |
| 174 | + </Card> |
| 175 | + |
| 176 | + <Card> |
| 177 | + <div class="flex sm items-center"> |
| 178 | + <Avatar |
| 179 | + img="/img/avatar0.png" |
| 180 | + size={50} |
| 181 | + /> |
| 182 | + <div class="flex column xs"> |
| 183 | + <span>Marcus</span> |
| 184 | + <span class="muted" data-tooltip="In Art & Collectibles"> |
| 185 | + Top rated seller |
| 186 | + </span> |
| 187 | + </div> |
| 188 | + </div> |
| 189 | + <hr /> |
| 190 | + <Rating |
| 191 | + score={4.8} |
| 192 | + showText={true} |
| 193 | + reviewCount={123} |
| 194 | + reviewLink="#" |
| 195 | + reviewTarget="_blank" |
| 196 | + /> |
| 197 | + <div class="flex center sm loading"> |
| 198 | + <Spinner /> |
| 199 | + <span class="muted"> |
| 200 | + Loading reviews... |
| 201 | + </span> |
| 202 | + </div> |
| 203 | + <hr /> |
| 204 | + <div class="sellers"> |
| 205 | + <strong>Explore other sellers</strong> |
| 206 | + <a href="#"> |
| 207 | + <Avatar |
| 208 | + size={[30, 40, 50, 40, 30]} |
| 209 | + img={avatarGroup} |
| 210 | + /> |
| 211 | + </a> |
| 212 | + </div> |
| 213 | + </Card> |
| 214 | + </div> |
| 215 | +</div> |
| 216 | + |
| 217 | +<style is:global lang="scss"> |
| 218 | + @import '../scss/config.scss'; |
| 219 | + |
| 220 | + .examples { |
| 221 | + margin-top: 100px; |
| 222 | + overflow-x: scroll; |
| 223 | + scrollbar-width: none; |
| 224 | + } |
| 225 | + |
| 226 | + .example-column { |
| 227 | + min-width: 370px; |
| 228 | + width: 370px; |
| 229 | + } |
| 230 | + |
| 231 | + .slack { |
| 232 | + margin-top: -5px; |
| 233 | + } |
| 234 | + |
| 235 | + .tasks { |
| 236 | + @include spacing(mt-sm); |
| 237 | + display: block; |
| 238 | + } |
| 239 | + |
| 240 | + .task { |
| 241 | + @include typography(none); |
| 242 | + |
| 243 | + &:hover { |
| 244 | + @include typography(primary); |
| 245 | + } |
| 246 | + } |
| 247 | + |
| 248 | + .progress-label { |
| 249 | + @include spacing(mb-xs); |
| 250 | + } |
| 251 | + |
| 252 | + .loading { |
| 253 | + @include spacing(mt-default); |
| 254 | + |
| 255 | + svg { |
| 256 | + @include spacing(m0); |
| 257 | + } |
| 258 | + } |
| 259 | + |
| 260 | + .sellers { |
| 261 | + @include typography(center); |
| 262 | + |
| 263 | + strong { |
| 264 | + @include spacing(my-xs); |
| 265 | + display: block; |
| 266 | + } |
| 267 | + } |
| 268 | +</style> |
0 commit comments