@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,123 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import Checkbox from '../components/Checkbox/Checkbox.vue'
|
|
3
|
+
import Grid from '../components/Grid/Grid.vue'
|
|
4
|
+
import Radio from '../components/Radio/Radio.vue'
|
|
5
|
+
import RadioGroup from '../components/Radio/RadioGroup.vue'
|
|
6
|
+
import Switch from '../components/Switch/Switch.vue'
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="mb-xxl">
|
|
11
|
+
<Grid :columns="2" gap="xl">
|
|
12
|
+
<div>
|
|
13
|
+
<h3 class="mb-l">
|
|
14
|
+
Checkbox
|
|
15
|
+
</h3>
|
|
16
|
+
<table class="mb-xl w-100">
|
|
17
|
+
<tbody>
|
|
18
|
+
<tr>
|
|
19
|
+
<th>Base</th>
|
|
20
|
+
<td>
|
|
21
|
+
<Checkbox label="Just click me" />
|
|
22
|
+
</td>
|
|
23
|
+
</tr>
|
|
24
|
+
<tr>
|
|
25
|
+
<th>Accent</th>
|
|
26
|
+
<td>
|
|
27
|
+
<Checkbox label="Just click me" accent />
|
|
28
|
+
</td>
|
|
29
|
+
</tr>
|
|
30
|
+
<tr>
|
|
31
|
+
<th>Disabled</th>
|
|
32
|
+
<td>
|
|
33
|
+
<Checkbox disabled label="Just click me" />
|
|
34
|
+
</td>
|
|
35
|
+
</tr>
|
|
36
|
+
<tr>
|
|
37
|
+
<th>Custom icons</th>
|
|
38
|
+
<td>
|
|
39
|
+
<Checkbox icon-on="ph:check-fat" icon-off="ph:x-bold" label="Just click me" />
|
|
40
|
+
</td>
|
|
41
|
+
</tr>
|
|
42
|
+
</tbody>
|
|
43
|
+
</table>
|
|
44
|
+
|
|
45
|
+
<h3 class="mb-l">
|
|
46
|
+
Switch
|
|
47
|
+
</h3>
|
|
48
|
+
<table class="mb-xl w-100">
|
|
49
|
+
<tbody>
|
|
50
|
+
<tr>
|
|
51
|
+
<th>Base</th>
|
|
52
|
+
<td>
|
|
53
|
+
<Switch label="Just click me" />
|
|
54
|
+
</td>
|
|
55
|
+
</tr>
|
|
56
|
+
<tr>
|
|
57
|
+
<th>Accent</th>
|
|
58
|
+
<td>
|
|
59
|
+
<Switch label="Just click me" accent />
|
|
60
|
+
</td>
|
|
61
|
+
</tr>
|
|
62
|
+
<tr>
|
|
63
|
+
<th>Disabled</th>
|
|
64
|
+
<td>
|
|
65
|
+
<Switch label="Just click me" disabled />
|
|
66
|
+
</td>
|
|
67
|
+
</tr>
|
|
68
|
+
</tbody>
|
|
69
|
+
</table>
|
|
70
|
+
</div>
|
|
71
|
+
<div>
|
|
72
|
+
<h3 class="mb-l">
|
|
73
|
+
Radio group
|
|
74
|
+
</h3>
|
|
75
|
+
|
|
76
|
+
<table class="w-100">
|
|
77
|
+
<tbody>
|
|
78
|
+
<tr>
|
|
79
|
+
<th>Base</th>
|
|
80
|
+
<td>
|
|
81
|
+
<RadioGroup>
|
|
82
|
+
<Radio value="one" label="First" />
|
|
83
|
+
<Radio value="two" label="Second" />
|
|
84
|
+
<Radio value="three" label="Third" disabled />
|
|
85
|
+
</RadioGroup>
|
|
86
|
+
</td>
|
|
87
|
+
</tr>
|
|
88
|
+
<tr>
|
|
89
|
+
<th>Accent</th>
|
|
90
|
+
<td>
|
|
91
|
+
<RadioGroup>
|
|
92
|
+
<Radio value="one" label="First" accent />
|
|
93
|
+
<Radio value="two" label="Second" accent />
|
|
94
|
+
<Radio value="three" label="Third" disabled accent />
|
|
95
|
+
</RadioGroup>
|
|
96
|
+
</td>
|
|
97
|
+
</tr>
|
|
98
|
+
<tr>
|
|
99
|
+
<th>Vertical</th>
|
|
100
|
+
<td>
|
|
101
|
+
<RadioGroup column>
|
|
102
|
+
<Radio value="one" label="First" />
|
|
103
|
+
<Radio value="two" label="Second" />
|
|
104
|
+
<Radio value="three" label="Third" disabled />
|
|
105
|
+
</RadioGroup>
|
|
106
|
+
</td>
|
|
107
|
+
</tr>
|
|
108
|
+
<tr>
|
|
109
|
+
<th>Disabled</th>
|
|
110
|
+
<td>
|
|
111
|
+
<RadioGroup column disabled>
|
|
112
|
+
<Radio value="one" label="First" />
|
|
113
|
+
<Radio value="two" label="Second" />
|
|
114
|
+
<Radio value="three" label="Third" disabled />
|
|
115
|
+
</RadioGroup>
|
|
116
|
+
</td>
|
|
117
|
+
</tr>
|
|
118
|
+
</tbody>
|
|
119
|
+
</table>
|
|
120
|
+
</div>
|
|
121
|
+
</Grid>
|
|
122
|
+
</div>
|
|
123
|
+
</template>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import Button from '../components/Button/Button.vue'
|
|
3
|
+
import CopyClipboard from '../components/CopyClipboard/CopyClipboard.vue'
|
|
4
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div class="mb-xxl">
|
|
9
|
+
<h3 class="mb-l">
|
|
10
|
+
Clipboard copy
|
|
11
|
+
</h3>
|
|
12
|
+
<table>
|
|
13
|
+
<tbody>
|
|
14
|
+
<tr>
|
|
15
|
+
<th>Base</th>
|
|
16
|
+
<td>
|
|
17
|
+
<CopyClipboard text="Copy me!">
|
|
18
|
+
<p>Copy me!</p>
|
|
19
|
+
</CopyClipboard>
|
|
20
|
+
</td>
|
|
21
|
+
</tr>
|
|
22
|
+
<tr>
|
|
23
|
+
<th>Custom slot & confirmation</th>
|
|
24
|
+
<td>
|
|
25
|
+
<CopyClipboard text="Copy me!" confirm>
|
|
26
|
+
<Button>Copy me!</Button>
|
|
27
|
+
</CopyClipboard>
|
|
28
|
+
</td>
|
|
29
|
+
</tr>
|
|
30
|
+
<tr>
|
|
31
|
+
<th>Custom confirm popup</th>
|
|
32
|
+
<td>
|
|
33
|
+
<CopyClipboard text="Copy me!" confirm>
|
|
34
|
+
<Button>Copy me!</Button>
|
|
35
|
+
<template #confirm>
|
|
36
|
+
<Flex column gap="s" align-center>
|
|
37
|
+
<strong>The dawg</strong>
|
|
38
|
+
<img style="width:128px;border-radius:8px" src="https://i.imgur.com/jMxIs6p.png" alt="">
|
|
39
|
+
</Flex>
|
|
40
|
+
</template>
|
|
41
|
+
</CopyClipboard>
|
|
42
|
+
</td>
|
|
43
|
+
</tr>
|
|
44
|
+
</tbody>
|
|
45
|
+
</table>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import Avatar from '../components/Avatar/Avatar.vue'
|
|
3
|
+
import Divider from '../components/Divider/Divider.vue'
|
|
4
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div class="mb-xxl">
|
|
9
|
+
<h3 class="mb-l">
|
|
10
|
+
Dividers
|
|
11
|
+
</h3>
|
|
12
|
+
|
|
13
|
+
<div class="container container-s">
|
|
14
|
+
<p>Standard divider</p>
|
|
15
|
+
<Divider />
|
|
16
|
+
<p>Divider with a variable spacing. For instance 80px. This means there will be a gap of 40 pixels above and below the divider. Size serves a different purpose with vertical dividers, so to achieve the same thing, you could also set the margin to <code>40px 0</code></p>
|
|
17
|
+
<Divider :size="80" />
|
|
18
|
+
<p>Using margin. The default divider size is 32px, so we need to either set it to 0 or offset the provided margin.</p>
|
|
19
|
+
<Divider margin="40px 0" />
|
|
20
|
+
|
|
21
|
+
<p>Different thickness (you specify the number of pixels)</p>
|
|
22
|
+
<Divider :thickness="5" :size="64" />
|
|
23
|
+
<p class="mb-s">
|
|
24
|
+
Vertical dividers. Here, size is the height of the divider. And if you want to add extra spacing between dividers, jsut set the margin to something like <code>0 16px</code>.
|
|
25
|
+
</p>
|
|
26
|
+
<Flex class="mb-xl">
|
|
27
|
+
<span>One</span>
|
|
28
|
+
<Divider vertical :size="16" />
|
|
29
|
+
<span>Two</span>
|
|
30
|
+
<Divider vertical :size="16" />
|
|
31
|
+
<span>Three</span>
|
|
32
|
+
</Flex>
|
|
33
|
+
<p>Dividers also accept a slot. This is rendered in the center, overlaying the divider. For instance an icon or an avatar, but it can be any component.</p>
|
|
34
|
+
<Divider size="80">
|
|
35
|
+
<Avatar />
|
|
36
|
+
</Divider>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,67 @@
|
|
|
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 Drawer from '../components/Drawer/Drawer.vue'
|
|
6
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
7
|
+
|
|
8
|
+
const open = ref(false)
|
|
9
|
+
const open2 = ref(false)
|
|
10
|
+
|
|
11
|
+
const size = ref<Sizes | 'full'>('s')
|
|
12
|
+
function setSize(s: any) {
|
|
13
|
+
size.value = s
|
|
14
|
+
open.value = true
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<div class="mb-xxl">
|
|
20
|
+
<h3 class="mb-l">
|
|
21
|
+
Drawers
|
|
22
|
+
</h3>
|
|
23
|
+
|
|
24
|
+
<table>
|
|
25
|
+
<tbody>
|
|
26
|
+
<tr>
|
|
27
|
+
<th>Base</th>
|
|
28
|
+
<td>
|
|
29
|
+
<Flex>
|
|
30
|
+
<Button square @click="setSize('s')">
|
|
31
|
+
S
|
|
32
|
+
</Button>
|
|
33
|
+
<Button square @click="setSize('m')">
|
|
34
|
+
M
|
|
35
|
+
</Button>
|
|
36
|
+
<Button square @click="setSize('l')">
|
|
37
|
+
L
|
|
38
|
+
</Button>
|
|
39
|
+
<Button square @click="setSize('xl')">
|
|
40
|
+
XL
|
|
41
|
+
</Button>
|
|
42
|
+
<Button square @click="setSize('full')">
|
|
43
|
+
Full
|
|
44
|
+
</Button>
|
|
45
|
+
</Flex>
|
|
46
|
+
<Drawer v-model="open" title="Hello" :container-size="size">
|
|
47
|
+
<h2>Hello</h2>
|
|
48
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dicta cupiditate laudantium maiores? Nesciunt harum doloribus accusantium architecto, quod rem porro iusto, quia dicta ex sapiente nulla earum voluptatibus, dolor veritatis?</p>
|
|
49
|
+
</Drawer>
|
|
50
|
+
</td>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<th>With animation + no handle</th>
|
|
54
|
+
<td>
|
|
55
|
+
<Button @click="open2 = !open2">
|
|
56
|
+
Open
|
|
57
|
+
</Button>
|
|
58
|
+
<Drawer v-model="open2" :handle="false" title="Hello" :container-size="size" :root-props="{ shouldScaleBackground: true }">
|
|
59
|
+
<h2>Hello</h2>
|
|
60
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dicta cupiditate laudantium maiores? Nesciunt harum doloribus accusantium architecto, quod rem porro iusto, quia dicta ex sapiente nulla earum voluptatibus, dolor veritatis?</p>
|
|
61
|
+
</Drawer>
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
</tbody>
|
|
65
|
+
</table>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Icon } from '@iconify/vue'
|
|
3
|
+
import Button from '../components/Button/Button.vue'
|
|
4
|
+
import Dropdown from '../components/Dropdown/Dropdown.vue'
|
|
5
|
+
import DropdownItem from '../components/Dropdown/DropdownItem.vue'
|
|
6
|
+
import DropdownTitle from '../components/Dropdown/DropdownTitle.vue'
|
|
7
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
8
|
+
|
|
9
|
+
const placements = ['top', 'bottom', 'left', 'right'] as const
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div class="mb-xxl">
|
|
14
|
+
<h3 class="mb-l">
|
|
15
|
+
Dropdowns
|
|
16
|
+
</h3>
|
|
17
|
+
|
|
18
|
+
<table class="mb-xxl">
|
|
19
|
+
<tbody>
|
|
20
|
+
<tr>
|
|
21
|
+
<th>
|
|
22
|
+
Base + expand <br> (dropdown takes width of the trigger)
|
|
23
|
+
</th>
|
|
24
|
+
<td>
|
|
25
|
+
<Dropdown expand>
|
|
26
|
+
<template #trigger="{ toggle }">
|
|
27
|
+
<Button class="btn btn-primary" expand @click="toggle">
|
|
28
|
+
Dropdown
|
|
29
|
+
</Button>
|
|
30
|
+
</template>
|
|
31
|
+
<DropdownItem>New user</DropdownItem>
|
|
32
|
+
<DropdownItem>Update</DropdownItem>
|
|
33
|
+
<DropdownItem>Cancel</DropdownItem>
|
|
34
|
+
</Dropdown>
|
|
35
|
+
</td>
|
|
36
|
+
</tr>
|
|
37
|
+
<tr>
|
|
38
|
+
<th>
|
|
39
|
+
Placements (some)
|
|
40
|
+
</th>
|
|
41
|
+
<td>
|
|
42
|
+
<Flex>
|
|
43
|
+
<Dropdown v-for="placement in placements" :key="placement" :placement="placement">
|
|
44
|
+
<template #trigger="{ toggle }">
|
|
45
|
+
<Button class="btn btn-primary" @click="toggle">
|
|
46
|
+
{{ placement }}
|
|
47
|
+
</Button>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<DropdownItem>New user</DropdownItem>
|
|
51
|
+
<DropdownItem>Update</DropdownItem>
|
|
52
|
+
<DropdownItem>Cancel</DropdownItem>
|
|
53
|
+
</Dropdown>
|
|
54
|
+
</Flex>
|
|
55
|
+
</td>
|
|
56
|
+
</tr>
|
|
57
|
+
<tr>
|
|
58
|
+
<th>Complex</th>
|
|
59
|
+
<td>
|
|
60
|
+
<Dropdown>
|
|
61
|
+
<template #trigger="{ toggle }">
|
|
62
|
+
<Button class="btn btn-primary" @click="toggle">
|
|
63
|
+
Dropdown
|
|
64
|
+
</Button>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<DropdownTitle>
|
|
68
|
+
Actions
|
|
69
|
+
<template #end>
|
|
70
|
+
3
|
|
71
|
+
</template>
|
|
72
|
+
</DropdownTitle>
|
|
73
|
+
|
|
74
|
+
<DropdownItem icon="ph:user">
|
|
75
|
+
New user
|
|
76
|
+
<template #hint>
|
|
77
|
+
<Icon icon="ic:round-keyboard-command-key" />
|
|
78
|
+
+ C
|
|
79
|
+
</template>
|
|
80
|
+
</DropdownItem>
|
|
81
|
+
<DropdownItem icon-end="ph:arrow-right">
|
|
82
|
+
Update
|
|
83
|
+
</DropdownItem>
|
|
84
|
+
<DropdownItem>Cancel</DropdownItem>
|
|
85
|
+
|
|
86
|
+
<DropdownTitle>Yourself</DropdownTitle>
|
|
87
|
+
<DropdownItem icon="ph:x" disabled>
|
|
88
|
+
Disabled option
|
|
89
|
+
</DropdownItem>
|
|
90
|
+
<DropdownItem icon="ph:x">
|
|
91
|
+
Delete
|
|
92
|
+
</DropdownItem>
|
|
93
|
+
</Dropdown>
|
|
94
|
+
</td>
|
|
95
|
+
</tr>
|
|
96
|
+
<tr>
|
|
97
|
+
<th>Disabled</th>
|
|
98
|
+
<td>
|
|
99
|
+
<Dropdown expand>
|
|
100
|
+
<template #trigger="{ toggle }">
|
|
101
|
+
<Button class="btn btn-primary" disabled @click="toggle">
|
|
102
|
+
Dropdown
|
|
103
|
+
</Button>
|
|
104
|
+
</template>
|
|
105
|
+
<DropdownItem>New user</DropdownItem>
|
|
106
|
+
<DropdownItem>Update</DropdownItem>
|
|
107
|
+
<DropdownItem>Cancel</DropdownItem>
|
|
108
|
+
</Dropdown>
|
|
109
|
+
</td>
|
|
110
|
+
</tr>
|
|
111
|
+
</tbody>
|
|
112
|
+
</table>
|
|
113
|
+
</div>
|
|
114
|
+
</template>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
4
|
+
import Grid from '../components/Grid/Grid.vue'
|
|
5
|
+
|
|
6
|
+
const cols = ref(3)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="mb-xxl">
|
|
11
|
+
<h3 class="mb-l">
|
|
12
|
+
Layouts
|
|
13
|
+
</h3>
|
|
14
|
+
|
|
15
|
+
<h6 class="block mb-m">
|
|
16
|
+
Flex
|
|
17
|
+
</h6>
|
|
18
|
+
|
|
19
|
+
<table class="mb-l">
|
|
20
|
+
<tbody>
|
|
21
|
+
<tr>
|
|
22
|
+
<th>Flex + gaps <br> (gap can either be set as a size or a number)</th>
|
|
23
|
+
<td class="w-85">
|
|
24
|
+
<Flex gap="l" column>
|
|
25
|
+
<Flex v-for="size in ['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl'] as const" :key="size" expand :gap="size">
|
|
26
|
+
<div v-for="key in 3" :key class="example flex-1">
|
|
27
|
+
{{ size.toUpperCase() }}
|
|
28
|
+
</div>
|
|
29
|
+
</Flex>
|
|
30
|
+
</Flex>
|
|
31
|
+
</td>
|
|
32
|
+
</tr>
|
|
33
|
+
</tbody>
|
|
34
|
+
</table>
|
|
35
|
+
|
|
36
|
+
<p class="mb-s">
|
|
37
|
+
All of the following props are boolean props
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
<table class="mb-xl">
|
|
41
|
+
<tbody>
|
|
42
|
+
<tr>
|
|
43
|
+
<th>Display props</th>
|
|
44
|
+
<td>
|
|
45
|
+
<Flex>
|
|
46
|
+
<code>inline</code><code>wrap</code><code>wrap-reverse</code><code>expand</code>
|
|
47
|
+
</Flex>
|
|
48
|
+
</td>
|
|
49
|
+
</tr>
|
|
50
|
+
<tr>
|
|
51
|
+
<th>Flow props</th>
|
|
52
|
+
<td>
|
|
53
|
+
<Flex>
|
|
54
|
+
<code>row</code><code>column</code><code>row-reverse</code><code>column-reverse</code>
|
|
55
|
+
</Flex>
|
|
56
|
+
</td>
|
|
57
|
+
</tr>
|
|
58
|
+
<tr>
|
|
59
|
+
<th>Justify props</th>
|
|
60
|
+
<td>
|
|
61
|
+
<Flex>
|
|
62
|
+
<code>justify-start</code><code>justify-end</code><code>justify-center</code>
|
|
63
|
+
<code>space-between</code><code>space-around</code><code>space-evenly</code>
|
|
64
|
+
</Flex>
|
|
65
|
+
</td>
|
|
66
|
+
</tr>
|
|
67
|
+
<tr>
|
|
68
|
+
<th>Align props</th>
|
|
69
|
+
<td>
|
|
70
|
+
<Flex>
|
|
71
|
+
<code>align-start</code><code>align-end</code><code>align-center</code>
|
|
72
|
+
<code>align-baseline</code>
|
|
73
|
+
</Flex>
|
|
74
|
+
</td>
|
|
75
|
+
</tr>
|
|
76
|
+
</tbody>
|
|
77
|
+
</table>
|
|
78
|
+
|
|
79
|
+
<h6 class="block mb-m">
|
|
80
|
+
Grid
|
|
81
|
+
</h6>
|
|
82
|
+
|
|
83
|
+
<p class="mb-s">
|
|
84
|
+
This grid utility is mostly meant for simple grid layouts. For anything mroe complicated, write your layouts in CSS. It supports setting <code>rows</code> or <code>columns</code> prop with a number or a string (the same way you'd write the CSS properties)
|
|
85
|
+
</p>
|
|
86
|
+
|
|
87
|
+
<p class="mb-s">
|
|
88
|
+
You can also set the `inlin` boolean prop and the `gap` prop which is a size prop or a number
|
|
89
|
+
</p>
|
|
90
|
+
|
|
91
|
+
<table>
|
|
92
|
+
<tbody>
|
|
93
|
+
<tr>
|
|
94
|
+
<th>
|
|
95
|
+
Base
|
|
96
|
+
<select v-model="cols" class="mt-s block">
|
|
97
|
+
<option v-for="key in 5" :key :value="key + 1">
|
|
98
|
+
Cols: {{ key + 1 }}
|
|
99
|
+
</option>
|
|
100
|
+
</select>
|
|
101
|
+
</th>
|
|
102
|
+
<td class="w-85">
|
|
103
|
+
<Grid :columns="cols" gap="l">
|
|
104
|
+
<div v-for="key in 9" :key class="example">
|
|
105
|
+
{{ key }}
|
|
106
|
+
</div>
|
|
107
|
+
</Grid>
|
|
108
|
+
</td>
|
|
109
|
+
</tr>
|
|
110
|
+
</tbody>
|
|
111
|
+
</table>
|
|
112
|
+
</div>
|
|
113
|
+
</template>
|
|
114
|
+
|
|
115
|
+
<style scoped>
|
|
116
|
+
.example {
|
|
117
|
+
height: 24px;
|
|
118
|
+
border-radius: var(--border-radius-m);
|
|
119
|
+
background-color: var(--color-border);
|
|
120
|
+
text-align: center;
|
|
121
|
+
}
|
|
122
|
+
</style>
|