@dolanske/vui 0.4.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -13
- package/dist/components/Alert/Alert.vue.d.ts +7 -1
- package/dist/components/Avatar/Avatar.vue.d.ts +15 -1
- package/dist/components/Badge/Badge.vue.d.ts +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue.d.ts +5 -15
- package/dist/components/ButtonGroup/ButtonGroup.vue.d.ts +2 -0
- package/dist/components/Calendar/Calendar.vue.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.vue.d.ts +19 -4
- package/dist/components/Dropdown/DropdownTitle.vue.d.ts +5 -1
- package/dist/components/Flex/Flex.vue.d.ts +3 -1
- package/dist/components/Grid/Grid.vue.d.ts +7 -2
- package/dist/components/Input/Dropzone.vue.d.ts +1 -1
- package/dist/components/Input/Input.vue.d.ts +2 -2
- package/dist/components/Kbd/KbdGroup.vue.d.ts +3 -11
- package/dist/components/Modal/Confirm.vue.d.ts +1 -1
- package/dist/components/Modal/Modal.vue.d.ts +1 -1
- package/dist/components/Pagination/Pagination.vue.d.ts +3 -0
- package/dist/components/Popout/Popout.vue.d.ts +8 -1
- package/dist/components/Progress/Progress.vue.d.ts +2 -0
- package/dist/components/Radio/Radio.vue.d.ts +1 -0
- package/dist/components/Select/Select.vue.d.ts +2 -0
- package/dist/components/Sheet/Sheet.vue.d.ts +3 -0
- package/dist/components/Switch/Switch.vue.d.ts +1 -0
- package/dist/components/Table/index.d.ts +6 -0
- package/dist/components/Table/table.d.ts +1 -1
- package/dist/components/Tabs/Tab.vue.d.ts +16 -3
- package/dist/components/Tabs/Tabs.vue.d.ts +4 -0
- package/dist/components/Toast/toast.d.ts +245 -0
- package/dist/index.d.ts +2 -7
- package/dist/shared/helpers.d.ts +9 -0
- package/dist/shared/theme.d.ts +3 -0
- package/dist/style.css +1 -1
- package/dist/vui.js +6423 -6046
- package/package.json +8 -4
- package/src/App.vue +89 -192
- package/src/components/Accordion/accordion.scss +2 -0
- package/src/components/Alert/Alert.vue +11 -5
- package/src/components/Alert/alert.scss +104 -23
- package/src/components/Avatar/Avatar.vue +4 -1
- package/src/components/Avatar/avatar.scss +1 -1
- package/src/components/Badge/Badge.vue +1 -1
- package/src/components/Badge/badge.scss +134 -17
- package/src/components/Breadcrumbs/BreadcrumbItem.vue +2 -2
- package/src/components/Breadcrumbs/Breadcrumbs.vue +1 -2
- package/src/components/Breadcrumbs/breadcrumbs.scss +2 -1
- package/src/components/Button/Button.vue +16 -21
- package/src/components/Button/button.scss +159 -56
- package/src/components/ButtonGroup/ButtonGroup.vue +4 -1
- package/src/components/ButtonGroup/button-group.scss +2 -2
- package/src/components/Calendar/Calendar.vue +9 -3
- package/src/components/Calendar/calendar.scss +29 -2
- package/src/components/Card/Card.vue +2 -2
- package/src/components/Card/card.scss +4 -4
- package/src/components/Checkbox/Checkbox.vue +7 -5
- package/src/components/Checkbox/checkbox.scss +27 -13
- package/src/components/CopyClipboard/CopyClipboard.vue +15 -6
- package/src/components/CopyClipboard/copy-clipboard.scss +10 -2
- package/src/components/Drawer/Drawer.vue +4 -4
- package/src/components/Drawer/drawer.scss +1 -0
- package/src/components/Dropdown/Dropdown.vue +44 -20
- package/src/components/Dropdown/DropdownItem.vue +5 -4
- package/src/components/Dropdown/DropdownTitle.vue +7 -1
- package/src/components/Dropdown/dropdown-item.scss +84 -0
- package/src/components/Dropdown/dropdown.scss +21 -86
- package/src/components/Flex/Flex.vue +4 -1
- package/src/components/Grid/Grid.vue +25 -2
- package/src/components/Input/Color.vue +26 -0
- package/src/components/Input/Counter.vue +12 -16
- package/src/components/Input/Dropzone.vue +1 -1
- package/src/components/Input/File.vue +1 -1
- package/src/components/Input/Input.vue +8 -6
- package/src/components/Input/Password.vue +1 -13
- package/src/components/Input/Textarea.vue +4 -2
- package/src/components/Input/input.scss +113 -19
- package/src/components/Kbd/KbdGroup.vue +2 -6
- package/src/components/Kbd/kbd.scss +7 -6
- package/src/components/Modal/Confirm.vue +1 -1
- package/src/components/Modal/Modal.vue +23 -15
- package/src/components/Modal/modal.scss +11 -6
- package/src/components/OTP/otp.scss +8 -7
- package/src/components/Pagination/Pagination.vue +6 -3
- package/src/components/Popout/Popout.vue +15 -5
- package/src/components/Popout/popout.scss +8 -1
- package/src/components/Progress/Progress.vue +18 -5
- package/src/components/Progress/progress.scss +7 -1
- package/src/components/Radio/Radio.vue +4 -2
- package/src/components/Radio/radio.scss +28 -9
- package/src/components/Select/Select.vue +49 -18
- package/src/components/Select/select.scss +35 -2
- package/src/components/Sheet/Sheet.vue +8 -2
- package/src/components/Sheet/sheet.scss +9 -0
- package/src/components/Sidebar/Sidebar.vue +46 -16
- package/src/components/Sidebar/sidebar.scss +6 -5
- package/src/components/Spinner/spinner.scss +2 -1
- package/src/components/Switch/Switch.vue +4 -3
- package/src/components/Switch/switch.scss +48 -7
- package/src/components/Table/{Header.vue → Head.vue} +5 -5
- package/src/components/Table/{Table.vue → Root.vue} +2 -2
- package/src/components/Table/SelectRow.vue +2 -1
- package/src/components/Table/index.ts +7 -0
- package/src/components/Table/table.scss +25 -5
- package/src/components/Table/table.ts +7 -3
- package/src/components/Tabs/Tab.vue +7 -9
- package/src/components/Tabs/Tabs.vue +9 -2
- package/src/components/Tabs/tabs.scss +11 -3
- package/src/components/Toast/Toasts.vue +5 -0
- package/src/components/Toast/toast.scss +6 -2
- package/src/components/Toast/toast.ts +7 -0
- package/src/components/Tooltip/Tooltip.vue +9 -9
- package/src/components/Tooltip/tooltip.scss +4 -0
- package/src/examples/ExampleAccordions.vue +58 -0
- package/src/examples/ExampleAlerts.vue +78 -0
- package/src/examples/ExampleAvatars.vue +44 -0
- package/src/examples/ExampleBadges.vue +48 -0
- package/src/examples/ExampleBreadcrumbs.vue +46 -0
- package/src/examples/ExampleButtons.vue +140 -0
- package/src/examples/ExampleCalendars.vue +40 -0
- package/src/examples/ExampleCards.vue +94 -0
- package/src/examples/ExampleCheckboxes.vue +123 -0
- package/src/examples/ExampleCopyClipboard.vue +47 -0
- package/src/examples/ExampleDividers.vue +39 -0
- package/src/examples/ExampleDrawers.vue +67 -0
- package/src/examples/ExampleDropdowns.vue +114 -0
- package/src/examples/ExampleFlexGrid.vue +122 -0
- package/src/examples/ExampleInputs.vue +234 -0
- package/src/examples/ExampleKBD.vue +65 -0
- package/src/examples/ExampleModals.vue +143 -0
- package/src/examples/ExamplePalette.vue +159 -0
- package/src/examples/ExamplePopouts.vue +41 -0
- package/src/examples/ExampleSheets.vue +77 -0
- package/src/examples/ExampleSidebars.vue +270 -0
- package/src/examples/ExampleSkeletons.vue +26 -0
- package/src/examples/ExampleSpinners.vue +78 -0
- package/src/examples/ExampleTables.vue +195 -0
- package/src/examples/ExampleTabs.vue +119 -0
- package/src/examples/ExampleToasts.vue +96 -0
- package/src/examples/ExampleTooltips.vue +70 -0
- package/src/examples/shared/ExampleColor.vue +28 -0
- package/src/index.ts +4 -11
- package/src/internal/Backdrop/backdrop.scss +7 -1
- package/src/shared/helpers.ts +43 -0
- package/src/shared/theme.ts +22 -0
- package/src/style/animation.scss +1 -0
- package/src/style/core.scss +34 -57
- package/src/style/layout.scss +102 -5
- package/src/style/{fonts.scss → text.scss} +39 -0
- package/src/style/theme.scss +195 -0
- package/src/style/tooltip.scss +22 -4
- package/src/style/typography.scss +95 -18
- package/dist/components/Table/Row.vue.d.ts +0 -16
- package/src/components/Table/Row.vue +0 -9
- /package/dist/components/Table/{Header.vue.d.ts → Head.vue.d.ts} +0 -0
- /package/dist/components/Table/{Table.vue.d.ts → Root.vue.d.ts} +0 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import { Icon } from '@iconify/vue'
|
|
3
|
+
import { ref } from 'vue'
|
|
4
|
+
import Button from '../components/Button/Button.vue'
|
|
5
|
+
import Divider from '../components/Divider/Divider.vue'
|
|
6
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
7
|
+
import Grid from '../components/Grid/Grid.vue'
|
|
8
|
+
import Color from '../components/Input/Color.vue'
|
|
9
|
+
import Counter from '../components/Input/Counter.vue'
|
|
10
|
+
import Dropzone from '../components/Input/Dropzone.vue'
|
|
11
|
+
import File from '../components/Input/File.vue'
|
|
12
|
+
import Input from '../components/Input/Input.vue'
|
|
13
|
+
import Password from '../components/Input/Password.vue'
|
|
14
|
+
import Textarea from '../components/Input/Textarea.vue'
|
|
15
|
+
import OTP from '../components/OTP/OTP.vue'
|
|
16
|
+
import OTPItem from '../components/OTP/OTPItem.vue'
|
|
17
|
+
import Select from '../components/Select/Select.vue'
|
|
18
|
+
|
|
19
|
+
const options = [
|
|
20
|
+
{ value: 0, label: 'Jan' },
|
|
21
|
+
{ value: 1, label: 'Andrew' },
|
|
22
|
+
{ value: 2, label: 'Felix' },
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
const longOptions = [
|
|
26
|
+
...options,
|
|
27
|
+
{
|
|
28
|
+
value: 3,
|
|
29
|
+
label: 'Kasper',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: 4,
|
|
33
|
+
label: 'Margarett',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: 5,
|
|
37
|
+
label: 'Bridgetson',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: 6,
|
|
41
|
+
label: 'Jenifer',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
value: 7,
|
|
45
|
+
label: 'Christopher',
|
|
46
|
+
},
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
const selected = ref([])
|
|
50
|
+
const selected1 = ref([])
|
|
51
|
+
const selected2 = ref([])
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<template>
|
|
55
|
+
<div class="mb-xxl">
|
|
56
|
+
<h3 class="mb-l">
|
|
57
|
+
Inputs
|
|
58
|
+
</h3>
|
|
59
|
+
|
|
60
|
+
<h6 class="mb-l">
|
|
61
|
+
Input extensions
|
|
62
|
+
</h6>
|
|
63
|
+
|
|
64
|
+
<Grid gap="l" :columns="3">
|
|
65
|
+
<Input placeholder="Margarett Bridgetson" />
|
|
66
|
+
<Input label="Default" />
|
|
67
|
+
<Input label="Password" placeholder="*******" type="password" model-value="asdasdasdass" />
|
|
68
|
+
<Input label="Has hint" hint="What is your birth name?" />
|
|
69
|
+
<Input label="Limited" hint="What is your birth name?" limit="65" placeholder="Your name" />
|
|
70
|
+
<Input label="With errors" hint="What is your birth name?" limit="65" :errors="['Your name is too short']" />
|
|
71
|
+
<Input label="Readonly" hint="What is your birth name?" readonly model-value="Readonly value" />
|
|
72
|
+
<Input label="Required" hint="What is your birth name?" required />
|
|
73
|
+
<Input label="Disabled" hint="What is your birth name?" disabled />
|
|
74
|
+
<Input label="With slot" hint="What is your phone number, sir?">
|
|
75
|
+
<template #start>
|
|
76
|
+
+358
|
|
77
|
+
</template>
|
|
78
|
+
</Input>
|
|
79
|
+
<Input label="With icon" hint="What is your birth name?" placeholder="Your phone sir">
|
|
80
|
+
<template #start>
|
|
81
|
+
<Icon icon="ph:phone" />
|
|
82
|
+
</template>
|
|
83
|
+
</Input>
|
|
84
|
+
<Input label="With button" hint="What is your birth name?" placeholder="Your phone sir">
|
|
85
|
+
<template #start>
|
|
86
|
+
<Icon icon="ph:phone" />
|
|
87
|
+
</template>
|
|
88
|
+
<template #end>
|
|
89
|
+
<Button>Clear</Button>
|
|
90
|
+
</template>
|
|
91
|
+
</Input>
|
|
92
|
+
<Input label="Two buttons" placeholder="Some stuff">
|
|
93
|
+
<template #start>
|
|
94
|
+
<Button square icon="ph:eye" />
|
|
95
|
+
</template>
|
|
96
|
+
<template #end>
|
|
97
|
+
<Button>Clear</Button>
|
|
98
|
+
</template>
|
|
99
|
+
</Input>
|
|
100
|
+
<Input label="Icon and button" placeholder="Some stuff">
|
|
101
|
+
<template #start>
|
|
102
|
+
<Button>Start</Button>
|
|
103
|
+
</template>
|
|
104
|
+
<template #end>
|
|
105
|
+
<Icon icon="ph:phone" />
|
|
106
|
+
</template>
|
|
107
|
+
</Input>
|
|
108
|
+
</Grid>
|
|
109
|
+
|
|
110
|
+
<Divider :size="48" />
|
|
111
|
+
|
|
112
|
+
<h6 class="mb-l">
|
|
113
|
+
Default input types
|
|
114
|
+
</h6>
|
|
115
|
+
|
|
116
|
+
<Grid gap="m" :columns="3">
|
|
117
|
+
<Input label="Text" />
|
|
118
|
+
<Password label="Password" />
|
|
119
|
+
<Color placeholder="Erm uhmm" label="Pick color" hint="A bonus hint idk" />
|
|
120
|
+
<Input label="Date" type="date" />
|
|
121
|
+
<Input label="Email" type="email" />
|
|
122
|
+
<Input label="Number" type="number" />
|
|
123
|
+
<Input label="Range" type="range" />
|
|
124
|
+
<Input label="Search" type="search" />
|
|
125
|
+
<Input label="Tel" type="tel" />
|
|
126
|
+
<Input label="Time" type="time" />
|
|
127
|
+
<Input label="Url" type="url" :errors="['Bro didnt count enough']" />
|
|
128
|
+
<File label="File" />
|
|
129
|
+
<Counter label="Counter" hint="It counts!!" />
|
|
130
|
+
</Grid>
|
|
131
|
+
|
|
132
|
+
<Divider :size="48" />
|
|
133
|
+
|
|
134
|
+
<h6 class="mb-l">
|
|
135
|
+
Textarea
|
|
136
|
+
</h6>
|
|
137
|
+
|
|
138
|
+
<Grid :columns="2" gap="m">
|
|
139
|
+
<Textarea label="Your story" hint="tell me everything" :resize="false" required />
|
|
140
|
+
<Textarea expand label="With limit" :limit="64" :resize="false" placeholder="Bro tell me a short story" />
|
|
141
|
+
<Textarea expand label="Resize vertical" />
|
|
142
|
+
<Textarea expand label="Resize horizontal" resize="horizontal" />
|
|
143
|
+
<Textarea expand label="Resize both" :resize="true" :errors="['Just an error test carry on', 'Whoops another issue']" />
|
|
144
|
+
<Textarea expand label="Autoresize" hint="This is not supported in firefox yet" />
|
|
145
|
+
<Textarea expand label="Readonly" model-value="Hiiiiiiiii uwuwuwu" readonly />
|
|
146
|
+
<Textarea expand label="Disabled" disabled />
|
|
147
|
+
</Grid>
|
|
148
|
+
|
|
149
|
+
<Divider :size="48" />
|
|
150
|
+
|
|
151
|
+
<h6 class="mb-l">
|
|
152
|
+
Dropzone
|
|
153
|
+
</h6>
|
|
154
|
+
|
|
155
|
+
<Dropzone expand />
|
|
156
|
+
|
|
157
|
+
<Divider :size="48" />
|
|
158
|
+
|
|
159
|
+
<h6 class="mb-l">
|
|
160
|
+
Select
|
|
161
|
+
</h6>
|
|
162
|
+
<Grid gap="xl" :columns="3">
|
|
163
|
+
<Select expand :options="longOptions" label="Base, single, search, showClear" search show-clear />
|
|
164
|
+
<Select expand :options="options" label="Base readonly" readonly />
|
|
165
|
+
<Select expand :options="options" label="Base disabled" disabled placeholder="Custom placeholder bro" />
|
|
166
|
+
<Select :options="options" label="Required (single)" expand required />
|
|
167
|
+
<Select :options="options" label="Base + errors" expand :errors="['Hello bro']" />
|
|
168
|
+
<Select v-model="selected" :options="options" label="Base multi" expand :single="false" />
|
|
169
|
+
<Select v-model="selected2" :options="options" label="Multi, max options 2" expand :single="false" :max-active-options="2" />
|
|
170
|
+
<Select v-model="selected1" :options="options" label="Multi required" required expand :single="false" hint="Must always have at least one option selected" />
|
|
171
|
+
|
|
172
|
+
<select>
|
|
173
|
+
<option value="" disabled>
|
|
174
|
+
Select option
|
|
175
|
+
</option>
|
|
176
|
+
<option value="Jan">
|
|
177
|
+
Jan
|
|
178
|
+
</option>
|
|
179
|
+
<option value="Andrew">
|
|
180
|
+
Andrew
|
|
181
|
+
</option>
|
|
182
|
+
<option value="Kasper">
|
|
183
|
+
Kasper
|
|
184
|
+
</option>
|
|
185
|
+
</select>
|
|
186
|
+
</Grid>
|
|
187
|
+
<Divider :size="48" />
|
|
188
|
+
|
|
189
|
+
<h6 class="mb-l">
|
|
190
|
+
OTP
|
|
191
|
+
</h6>
|
|
192
|
+
|
|
193
|
+
<table>
|
|
194
|
+
<tbody>
|
|
195
|
+
<tr>
|
|
196
|
+
<th>Base</th>
|
|
197
|
+
<td>
|
|
198
|
+
<OTP>
|
|
199
|
+
<Flex :gap="0" align-center>
|
|
200
|
+
<OTPItem :i="0" />
|
|
201
|
+
<OTPItem :i="1" />
|
|
202
|
+
<OTPItem :i="2" />
|
|
203
|
+
<span class="ml-m mr-m">-</span>
|
|
204
|
+
<OTPItem :i="3" />
|
|
205
|
+
<OTPItem :i="4" />
|
|
206
|
+
<OTPItem :i="5" />
|
|
207
|
+
</Flex>
|
|
208
|
+
</OTP>
|
|
209
|
+
</td>
|
|
210
|
+
</tr>
|
|
211
|
+
<tr>
|
|
212
|
+
<th>Redacted + only numbers</th>
|
|
213
|
+
<td>
|
|
214
|
+
<OTP redacted mode="num">
|
|
215
|
+
<OTPItem :i="0" />
|
|
216
|
+
<OTPItem :i="1" />
|
|
217
|
+
<OTPItem :i="2" />
|
|
218
|
+
</OTP>
|
|
219
|
+
</td>
|
|
220
|
+
</tr>
|
|
221
|
+
<tr>
|
|
222
|
+
<th>Only characters</th>
|
|
223
|
+
<td>
|
|
224
|
+
<OTP redacted mode="char">
|
|
225
|
+
<OTPItem :i="0" />
|
|
226
|
+
<OTPItem :i="1" />
|
|
227
|
+
<OTPItem :i="2" />
|
|
228
|
+
</OTP>
|
|
229
|
+
</td>
|
|
230
|
+
</tr>
|
|
231
|
+
</tbody>
|
|
232
|
+
</table>
|
|
233
|
+
</div>
|
|
234
|
+
</template>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import { whenever } from '@vueuse/core'
|
|
3
|
+
import { ref } from 'vue'
|
|
4
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
5
|
+
import Kbd from '../components/Kbd/Kbd.vue'
|
|
6
|
+
import KbdGroup from '../components/Kbd/KbdGroup.vue'
|
|
7
|
+
|
|
8
|
+
const active = ref(false)
|
|
9
|
+
|
|
10
|
+
whenever(active, () => {
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
active.value = false
|
|
13
|
+
}, 1000)
|
|
14
|
+
})
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div class="mb-xxl">
|
|
19
|
+
<h3 class="mb-l">
|
|
20
|
+
KBD
|
|
21
|
+
</h3>
|
|
22
|
+
|
|
23
|
+
<table>
|
|
24
|
+
<tbody>
|
|
25
|
+
<tr>
|
|
26
|
+
<th>Base</th>
|
|
27
|
+
<td>
|
|
28
|
+
<Flex>
|
|
29
|
+
<Kbd keys="Ctrl" />
|
|
30
|
+
<Kbd keys="Shift" />
|
|
31
|
+
<Kbd keys="A" />
|
|
32
|
+
</Flex>
|
|
33
|
+
</td>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<th>Group</th>
|
|
37
|
+
<td>
|
|
38
|
+
<Flex :gap="2">
|
|
39
|
+
<KbdGroup @trigger="active = true">
|
|
40
|
+
<Kbd highlight keys="Shift" />
|
|
41
|
+
<Kbd highlight keys="A" />
|
|
42
|
+
</KbdGroup>
|
|
43
|
+
{{ active ? 'Pressed' : '' }}
|
|
44
|
+
</Flex>
|
|
45
|
+
</td>
|
|
46
|
+
</tr>
|
|
47
|
+
<tr>
|
|
48
|
+
<th>Custom labels</th>
|
|
49
|
+
<td>
|
|
50
|
+
<Flex>
|
|
51
|
+
<Kbd highlight keys="Shift" label="Shift bro" />
|
|
52
|
+
<Kbd highlight keys="A" label="A key" />
|
|
53
|
+
</Flex>
|
|
54
|
+
</td>
|
|
55
|
+
</tr>
|
|
56
|
+
<tr>
|
|
57
|
+
<th>Multiple keys in one</th>
|
|
58
|
+
<td>
|
|
59
|
+
<Kbd keys="Shift+A" highlight />
|
|
60
|
+
</td>
|
|
61
|
+
</tr>
|
|
62
|
+
</tbody>
|
|
63
|
+
</table>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { Sizes } from '../shared/types'
|
|
3
|
+
import { ref } from 'vue'
|
|
4
|
+
import Button from '../components/Button/Button.vue'
|
|
5
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
6
|
+
import Modal from '../components/Modal/Modal.vue'
|
|
7
|
+
|
|
8
|
+
const open = ref(false)
|
|
9
|
+
const open2 = ref(false)
|
|
10
|
+
const open3 = ref(false)
|
|
11
|
+
const open4 = ref(false)
|
|
12
|
+
const open5 = ref(false)
|
|
13
|
+
|
|
14
|
+
const size = ref<Sizes | 'full'>('s')
|
|
15
|
+
function setSize(s: any) {
|
|
16
|
+
size.value = s
|
|
17
|
+
open2.value = true
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div class="mb-xxl">
|
|
23
|
+
<h3 class="mb-l">
|
|
24
|
+
Modals
|
|
25
|
+
</h3>
|
|
26
|
+
|
|
27
|
+
<table>
|
|
28
|
+
<tbody>
|
|
29
|
+
<tr>
|
|
30
|
+
<th>Base</th>
|
|
31
|
+
<td>
|
|
32
|
+
<Button @click="open = !open">
|
|
33
|
+
Open
|
|
34
|
+
</Button>
|
|
35
|
+
<Modal v-model="open">
|
|
36
|
+
<template #header>
|
|
37
|
+
<h4>Modal </h4>
|
|
38
|
+
</template>
|
|
39
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ad harum id, distinctio voluptatum repellat eveniet repellendus saepe velit rem illo facere aspernatur iste nam, quasi dolores expedita consectetur enim autem?</p>
|
|
40
|
+
<template #footer="{ close }">
|
|
41
|
+
<Button @click="close">
|
|
42
|
+
Close
|
|
43
|
+
</Button>
|
|
44
|
+
</template>
|
|
45
|
+
</Modal>
|
|
46
|
+
</td>
|
|
47
|
+
</tr>
|
|
48
|
+
<tr>
|
|
49
|
+
<th>Sizes</th>
|
|
50
|
+
<td>
|
|
51
|
+
<Flex>
|
|
52
|
+
<Button square @click="setSize('s')">
|
|
53
|
+
S
|
|
54
|
+
</Button>
|
|
55
|
+
<Button square @click="setSize('l')">
|
|
56
|
+
L
|
|
57
|
+
</Button>
|
|
58
|
+
<Button square @click="setSize('full')">
|
|
59
|
+
Full
|
|
60
|
+
</Button>
|
|
61
|
+
</Flex>
|
|
62
|
+
<Modal v-model="open2" :size>
|
|
63
|
+
<template #header>
|
|
64
|
+
<h4>Modal </h4>
|
|
65
|
+
</template>
|
|
66
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ad harum id, distinctio voluptatum repellat eveniet repellendus saepe velit rem illo facere aspernatur iste nam, quasi dolores expedita consectetur enim autem?</p>
|
|
67
|
+
<template #footer="{ close }">
|
|
68
|
+
<Button @click="close">
|
|
69
|
+
Close
|
|
70
|
+
</Button>
|
|
71
|
+
</template>
|
|
72
|
+
</Modal>
|
|
73
|
+
</td>
|
|
74
|
+
</tr>
|
|
75
|
+
<tr>
|
|
76
|
+
<th>Centered + separators + can't dismiss</th>
|
|
77
|
+
<td>
|
|
78
|
+
<Button @click="open3 = !open3">
|
|
79
|
+
Open
|
|
80
|
+
</Button>
|
|
81
|
+
<Modal v-model="open3" centered :card="{ separators: true }" :can-dismiss="false">
|
|
82
|
+
<template #header>
|
|
83
|
+
<h4>What is this?</h4>
|
|
84
|
+
</template>
|
|
85
|
+
<p>Non dismissable modal means that it can only be closed via a provided button. Like a confirmation etc. No chance of closing it by clicking the x buttton, pressing escape or clicking the backdrop.</p>
|
|
86
|
+
<template #footer="{ close }">
|
|
87
|
+
<Button @click="close">
|
|
88
|
+
Close
|
|
89
|
+
</Button>
|
|
90
|
+
</template>
|
|
91
|
+
</Modal>
|
|
92
|
+
</td>
|
|
93
|
+
</tr>
|
|
94
|
+
<tr>
|
|
95
|
+
<th>
|
|
96
|
+
Scrollable
|
|
97
|
+
</th>
|
|
98
|
+
<td>
|
|
99
|
+
<Button @click="open4 = !open4">
|
|
100
|
+
Open
|
|
101
|
+
</Button>
|
|
102
|
+
<Modal v-model="open4" :card="{ separators: true }" scrollable>
|
|
103
|
+
<template #header>
|
|
104
|
+
<h4>What is this?</h4>
|
|
105
|
+
</template>
|
|
106
|
+
<p class="text-xxxxl">
|
|
107
|
+
Non dismissable modal means that it can only be closed via a provided button. Like a confirmation etc. No chance of closing it by clicking the x buttton, pressing escape or clicking the backdrop. Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas nisi eos dolores ipsa perspiciatis ullam voluptates quos. Recusandae quod atque, laudantium quis, ad quaerat cumque vero quibusdam facilis, blanditiis eius.
|
|
108
|
+
</p>
|
|
109
|
+
<template #footer="{ close }">
|
|
110
|
+
<Button @click="close">
|
|
111
|
+
Close
|
|
112
|
+
</Button>
|
|
113
|
+
</template>
|
|
114
|
+
</Modal>
|
|
115
|
+
</td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<th>
|
|
119
|
+
Fullscreen
|
|
120
|
+
</th>
|
|
121
|
+
<td>
|
|
122
|
+
<Button @click="open5 = !open5">
|
|
123
|
+
Open
|
|
124
|
+
</Button>
|
|
125
|
+
<Modal v-model="open5" size="screen" :card="{ separators: true }" scrollable>
|
|
126
|
+
<template #header>
|
|
127
|
+
<h4>What is this?</h4>
|
|
128
|
+
</template>
|
|
129
|
+
<p class="text-xxxxl">
|
|
130
|
+
Non dismissable modal means that it can only be closed via a provided button. Like a confirmation etc. No chance of closing it by clicking the x buttton, pressing escape or clicking the backdrop. Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas nisi eos dolores ipsa perspiciatis ullam voluptates quos. Recusandae quod atque, laudantium quis, ad quaerat cumque vero quibusdam facilis, blanditiis eius. Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis sed, impedit officia ad earum optio molestiae nihil mollitia quas enim neque repudiandae minus? Odio fugit voluptates enim et iste odit? Lorem, ipsum dolor sit amet consectetur adipisicing elit. In mollitia harum consectetur ad soluta laudantium? In earum animi harum impedit modi dolores, quod ex, ipsa ipsum est perferendis laudantium aut? Lorem ipsum dolor sit amet consectetur adipisicing elit. Placeat, cupiditate autem aut nisi quas voluptatem dolorem, eaque odit voluptates laboriosam consequuntur dolore alias a provident corporis nemo. Blanditiis, vel! Maiores!
|
|
131
|
+
</p>
|
|
132
|
+
<template #footer="{ close }">
|
|
133
|
+
<Button @click="close">
|
|
134
|
+
Close
|
|
135
|
+
</Button>
|
|
136
|
+
</template>
|
|
137
|
+
</Modal>
|
|
138
|
+
</td>
|
|
139
|
+
</tr>
|
|
140
|
+
</tbody>
|
|
141
|
+
</table>
|
|
142
|
+
</div>
|
|
143
|
+
</template>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import { Icon } from '@iconify/vue'
|
|
3
|
+
import Button from '../components/Button/Button.vue'
|
|
4
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
5
|
+
import Grid from '../components/Grid/Grid.vue'
|
|
6
|
+
import { setColorTheme, theme } from '../shared/theme'
|
|
7
|
+
import ExampleColor from './shared/ExampleColor.vue'
|
|
8
|
+
|
|
9
|
+
// function getPalette(type: 'light' | 'dark') {
|
|
10
|
+
// return Array.from(document.styleSheets)
|
|
11
|
+
// .flatMap((styleSheet: CSSStyleSheet) => Array.from(styleSheet.cssRules))
|
|
12
|
+
// .filter(
|
|
13
|
+
// (cssRule: CSSRule): cssRule is CSSStyleRule =>
|
|
14
|
+
// cssRule instanceof CSSStyleRule && cssRule.selectorText === `:root`,
|
|
15
|
+
// )
|
|
16
|
+
// .flatMap((cssRule: CSSStyleRule) => Array.from(cssRule.style))
|
|
17
|
+
// .filter((style: string) => style.startsWith(`--${type}`))
|
|
18
|
+
// }
|
|
19
|
+
|
|
20
|
+
// const light = getPalette('light')
|
|
21
|
+
// const dark = getPalette('dark')
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<div>
|
|
26
|
+
<h3 class="mb-l">
|
|
27
|
+
Themes
|
|
28
|
+
</h3>
|
|
29
|
+
|
|
30
|
+
<Grid :columns="2">
|
|
31
|
+
<Flex class="theme-wrap light" column gap="xxs">
|
|
32
|
+
<Flex space-between class="mb-l" align-center expand>
|
|
33
|
+
<h5>Light</h5>
|
|
34
|
+
<Button :disabled="theme === 'light'" variant="gray" data-title-top="Switch theme" @click="setColorTheme('light')">
|
|
35
|
+
<template #start>
|
|
36
|
+
<Icon icon="ph:sun" />
|
|
37
|
+
</template>
|
|
38
|
+
Use
|
|
39
|
+
</Button>
|
|
40
|
+
</Flex>
|
|
41
|
+
<ExampleColor name="Bg" color="--light-color-bg" />
|
|
42
|
+
<ExampleColor name="Bg Medium" color="--light-color-bg-medium" />
|
|
43
|
+
<ExampleColor name="Bg Raised" color="--light-color-bg-raised" />
|
|
44
|
+
<ExampleColor name="Bg Lowered" color="--light-color-bg-lowered" />
|
|
45
|
+
<div class="padder" />
|
|
46
|
+
<ExampleColor name="Text" color="--light-color-text" />
|
|
47
|
+
<ExampleColor name="Text Light" color="--light-color-text-light" />
|
|
48
|
+
<ExampleColor name="Text Lighter" color="--light-color-text-lighter" />
|
|
49
|
+
<ExampleColor name="Text Lightest" color="--light-color-text-lightest" />
|
|
50
|
+
<ExampleColor name="Text Invert" color="--light-color-text-invert" />
|
|
51
|
+
<div class="padder" />
|
|
52
|
+
<ExampleColor name="Button Gray" color="--light-color-button-gray" />
|
|
53
|
+
<ExampleColor name="Button Gray Hover" color="--light-color-button-gray-hover" />
|
|
54
|
+
<div class="padder" />
|
|
55
|
+
<ExampleColor name="Text Red" color="--light-color-text-red" />
|
|
56
|
+
<ExampleColor name="Bg Red Lowered" color="--light-color-bg-red-lowered" />
|
|
57
|
+
<ExampleColor name="Bg Red Raised" color="--light-color-bg-red-raised" />
|
|
58
|
+
<div class="padder" />
|
|
59
|
+
<ExampleColor name="Text Green" color="--light-color-text-green" />
|
|
60
|
+
<ExampleColor name="Bg Green Lowered" color="--light-color-bg-green-lowered" />
|
|
61
|
+
<ExampleColor name="Bg Green Raised" color="--light-color-bg-green-raised" />
|
|
62
|
+
<div class="padder" />
|
|
63
|
+
<ExampleColor name="Text Yellow" color="--light-color-text-yellow" />
|
|
64
|
+
<ExampleColor name="Bg Yellow Lowered" color="--light-color-bg-yellow-lowered" />
|
|
65
|
+
<ExampleColor name="Bg Yellow Raised" color="--light-color-bg-yellow-raised" />
|
|
66
|
+
<div class="padder" />
|
|
67
|
+
<ExampleColor name="Text Blue" color="--light-color-text-blue" />
|
|
68
|
+
<ExampleColor name="Bg Blue Lowered" color="--light-color-bg-blue-lowered" />
|
|
69
|
+
<ExampleColor name="Bg Blue Raised" color="--light-color-bg-blue-raised" />
|
|
70
|
+
<div class="padder" />
|
|
71
|
+
<ExampleColor name="Border" color="--light-color-border" />
|
|
72
|
+
<ExampleColor name="Border Strong" color="--light-color-border-strong" />
|
|
73
|
+
<ExampleColor name="Border Weak" color="--light-color-border-weak" />
|
|
74
|
+
<div class="padder" />
|
|
75
|
+
<ExampleColor name="Accent" color="--light-color-accent" />
|
|
76
|
+
<ExampleColor name="Bg Accent Lowered" color="--light-color-bg-accent-lowered" />
|
|
77
|
+
<ExampleColor name="Bg Accent Raised" color="--light-color-bg-accent-raised" />
|
|
78
|
+
</Flex>
|
|
79
|
+
|
|
80
|
+
<Flex class="theme-wrap dark" gap="xxs" column>
|
|
81
|
+
<Flex space-between class="mb-l" align-center expand>
|
|
82
|
+
<h5>Dark</h5>
|
|
83
|
+
<Button :disabled="theme === 'dark'" variant="gray" data-title-top="Switch theme" @click="setColorTheme('dark')">
|
|
84
|
+
<template #start>
|
|
85
|
+
<Icon icon="ph:moon" />
|
|
86
|
+
</template>
|
|
87
|
+
Use
|
|
88
|
+
</Button>
|
|
89
|
+
</Flex>
|
|
90
|
+
<ExampleColor name="Bg" color="--dark-color-bg" />
|
|
91
|
+
<ExampleColor name="Bg Medium" color="--dark-color-bg-medium" />
|
|
92
|
+
<ExampleColor name="Bg Raised" color="--dark-color-bg-raised" />
|
|
93
|
+
<ExampleColor name="Bg Lowered" color="--dark-color-bg-lowered" />
|
|
94
|
+
<div class="padder" />
|
|
95
|
+
<ExampleColor name="Text" color="--dark-color-text" />
|
|
96
|
+
<ExampleColor name="Text Light" color="--dark-color-text-light" />
|
|
97
|
+
<ExampleColor name="Text Lighter" color="--dark-color-text-lighter" />
|
|
98
|
+
<ExampleColor name="Text Lightest" color="--dark-color-text-lightest" />
|
|
99
|
+
<ExampleColor name="Text Invert" color="--dark-color-text-invert" />
|
|
100
|
+
<div class="padder" />
|
|
101
|
+
<ExampleColor name="Button Gray" color="--dark-color-button-gray" />
|
|
102
|
+
<ExampleColor name="Button Gray Hover" color="--dark-color-button-gray-hover" />
|
|
103
|
+
<div class="padder" />
|
|
104
|
+
<ExampleColor name="Text Red" color="--dark-color-text-red" />
|
|
105
|
+
<ExampleColor name="Bg Red Lowered" color="--dark-color-bg-red-lowered" />
|
|
106
|
+
<ExampleColor name="Bg Red Raised" color="--dark-color-bg-red-raised" />
|
|
107
|
+
<div class="padder" />
|
|
108
|
+
<ExampleColor name="Text Green" color="--dark-color-text-green" />
|
|
109
|
+
<ExampleColor name="Bg Green Lowered" color="--dark-color-bg-green-lowered" />
|
|
110
|
+
<ExampleColor name="Bg Green Raised" color="--dark-color-bg-green-raised" />
|
|
111
|
+
<div class="padder" />
|
|
112
|
+
<ExampleColor name="Text Yellow" color="--dark-color-text-yellow" />
|
|
113
|
+
<ExampleColor name="Bg Yellow Lowered" color="--dark-color-bg-yellow-lowered" />
|
|
114
|
+
<ExampleColor name="Bg Yellow Raised" color="--dark-color-bg-yellow-raised" />
|
|
115
|
+
<div class="padder" />
|
|
116
|
+
<ExampleColor name="Text Blue" color="--dark-color-text-blue" />
|
|
117
|
+
<ExampleColor name="Bg Blue Lowered" color="--dark-color-bg-blue-lowered" />
|
|
118
|
+
<ExampleColor name="Bg Blue Raised" color="--dark-color-bg-blue-raised" />
|
|
119
|
+
<div class="padder" />
|
|
120
|
+
<ExampleColor name="Border" color="--dark-color-border" />
|
|
121
|
+
<ExampleColor name="Border Strong" color="--dark-color-border-strong" />
|
|
122
|
+
<ExampleColor name="Border Weak" color="--dark-color-border-weak" />
|
|
123
|
+
<div class="padder" />
|
|
124
|
+
<ExampleColor name="Accent" color="--dark-color-accent" />
|
|
125
|
+
<ExampleColor name="Bg Accent Lowered" color="--dark-color-bg-accent-lowered" />
|
|
126
|
+
<ExampleColor name="Bg Accent Raised" color="--dark-color-bg-accent-raised" />
|
|
127
|
+
</Flex>
|
|
128
|
+
</Grid>
|
|
129
|
+
</div>
|
|
130
|
+
</template>
|
|
131
|
+
|
|
132
|
+
<style>
|
|
133
|
+
.padder {
|
|
134
|
+
height: 16px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.theme-wrap {
|
|
138
|
+
padding: var(--space-m);
|
|
139
|
+
border-radius: var(--border-radius-m);
|
|
140
|
+
|
|
141
|
+
&.light {
|
|
142
|
+
background-color: white;
|
|
143
|
+
|
|
144
|
+
h5,
|
|
145
|
+
span {
|
|
146
|
+
color: var(--light-color-text) !important;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&.dark {
|
|
151
|
+
background-color: black;
|
|
152
|
+
|
|
153
|
+
h5,
|
|
154
|
+
span {
|
|
155
|
+
color: var(--dark-color-text) !important;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, useTemplateRef } from 'vue'
|
|
3
|
+
import Button from '../components/Button/Button.vue'
|
|
4
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
5
|
+
import Popout from '../components/Popout/Popout.vue'
|
|
6
|
+
|
|
7
|
+
const anch = useTemplateRef('anch')
|
|
8
|
+
const open = ref(false)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="mb-xxl">
|
|
13
|
+
<h3 class="mb-l">
|
|
14
|
+
Popout
|
|
15
|
+
</h3>
|
|
16
|
+
|
|
17
|
+
<p class="mb-l">
|
|
18
|
+
Popout is a simpler version of dropdown. By default, it only provides functionality to float an element to the anchor. It is up to the developer to style it and set its placement / offset. Both dropdown & tooltip use the popout base.
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<Flex>
|
|
22
|
+
<Button ref="anch" class="mb-xxs" @click="open = !open">
|
|
23
|
+
Open popout
|
|
24
|
+
</Button>
|
|
25
|
+
<p class="text-s text-color-light w-50">
|
|
26
|
+
This popout has offset of <code>32</code> and its placement is <code>bottom-start</code>. It also has an attached event to <code>clickOutside</code> which is fired when user clicks outside of the popout. In that case, we manually close it.
|
|
27
|
+
</p>
|
|
28
|
+
</Flex>
|
|
29
|
+
<Popout v-if="open" :anchor="anch" class="test-popout" :offset="32" placement="bottom-start" @click-outside="open = false">
|
|
30
|
+
<h3>Popout content</h3>
|
|
31
|
+
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Dolorem facere eligendi ex, alias itaque molestiae, vero animi, vitae vel fuga corporis aut consectetur temporibus ipsum placeat dolores perferendis. Deleniti, et!</p>
|
|
32
|
+
</Popout>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<style scoped>
|
|
37
|
+
.test-popout {
|
|
38
|
+
max-width: 256px;
|
|
39
|
+
padding: var(--space-xl);
|
|
40
|
+
}
|
|
41
|
+
</style>
|