@dolanske/vui 0.5.0 → 1.0.1
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 +5 -4
- package/dist/components/Accordion/Accordion.vue.d.ts +3 -2
- package/dist/components/Accordion/AccordionGroup.vue.d.ts +5 -2
- package/dist/components/Alert/Alert.vue.d.ts +10 -3
- package/dist/components/Avatar/Avatar.vue.d.ts +16 -1
- package/dist/components/Badge/Badge.vue.d.ts +4 -3
- package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +4 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +3 -2
- package/dist/components/Button/Button.vue.d.ts +8 -17
- package/dist/components/ButtonGroup/ButtonGroup.vue.d.ts +5 -2
- package/dist/components/Calendar/Calendar.vue.d.ts +7 -7
- package/dist/components/Card/Card.vue.d.ts +4 -3
- package/dist/components/Checkbox/Checkbox.vue.d.ts +8 -6
- package/dist/components/CopyClipboard/CopyClipboard.vue.d.ts +2 -1
- package/dist/components/Divider/Divider.vue.d.ts +3 -2
- package/dist/components/Drawer/Drawer.vue.d.ts +6 -5
- package/dist/components/Dropdown/Dropdown.vue.d.ts +84 -6
- package/dist/components/Dropdown/DropdownItem.vue.d.ts +3 -2
- package/dist/components/Dropdown/DropdownTitle.vue.d.ts +6 -2
- package/dist/components/Flex/Flex.vue.d.ts +3 -2
- package/dist/components/Grid/Grid.vue.d.ts +7 -3
- package/dist/components/Input/Color.vue.d.ts +11 -0
- package/dist/components/Input/Counter.vue.d.ts +5 -5
- package/dist/components/Input/Dropzone.vue.d.ts +96 -11
- package/dist/components/Input/File.vue.d.ts +4 -3
- package/dist/components/Input/Input.vue.d.ts +9 -8
- package/dist/components/Input/Password.vue.d.ts +1 -1
- package/dist/components/Input/Textarea.vue.d.ts +7 -6
- package/dist/components/Kbd/Kbd.vue.d.ts +1 -1
- package/dist/components/Kbd/KbdGroup.vue.d.ts +5 -12
- package/dist/components/Modal/Confirm.vue.d.ts +7 -6
- package/dist/components/Modal/Modal.vue.d.ts +7 -6
- package/dist/components/OTP/OTP.vue.d.ts +7 -6
- package/dist/components/OTP/OTPItem.vue.d.ts +1 -1
- package/dist/components/Pagination/Pagination.vue.d.ts +6 -2
- package/dist/components/Popout/Popout.vue.d.ts +11 -3
- package/dist/components/Progress/Progress.vue.d.ts +7 -5
- package/dist/components/Radio/Radio.vue.d.ts +8 -6
- package/dist/components/Radio/RadioGroup.vue.d.ts +7 -6
- package/dist/components/Select/Select.vue.d.ts +6 -8
- package/dist/components/Sheet/Sheet.vue.d.ts +9 -5
- package/dist/components/Sidebar/Sidebar.vue.d.ts +70 -0
- package/dist/components/Skeleton/Skeleton.vue.d.ts +1 -1
- package/dist/components/Spinner/Spinner.vue.d.ts +1 -1
- package/dist/components/Switch/Switch.vue.d.ts +8 -6
- package/dist/components/Table/Cell.vue.d.ts +5 -2
- package/dist/components/Table/{Header.vue.d.ts → Head.vue.d.ts} +3 -2
- package/dist/components/Table/{Table.vue.d.ts → Root.vue.d.ts} +3 -2
- package/dist/components/Table/index.d.ts +6 -0
- package/dist/components/Table/table.d.ts +3 -3
- package/dist/components/Tabs/Tab.vue.d.ts +17 -3
- package/dist/components/Tabs/Tabs.vue.d.ts +8 -7
- package/dist/components/Toast/toast.d.ts +245 -0
- package/dist/components/Tooltip/Tooltip.vue.d.ts +2 -1
- package/dist/index.d.ts +5 -7
- package/dist/internal/Backdrop/Backdrop.vue.d.ts +3 -2
- package/dist/shared/helpers.d.ts +9 -0
- package/dist/shared/theme.d.ts +3 -0
- package/dist/vui.css +1 -0
- package/dist/vui.js +7160 -6355
- package/package.json +22 -18
- package/src/App.vue +90 -171
- package/src/components/Accordion/accordion.scss +1 -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 +15 -20
- package/src/components/Button/button.scss +156 -55
- package/src/components/ButtonGroup/ButtonGroup.vue +4 -1
- package/src/components/ButtonGroup/button-group.scss +2 -2
- package/src/components/Calendar/Calendar.vue +4 -1
- package/src/components/Calendar/calendar.scss +25 -2
- package/src/components/Card/Card.vue +2 -2
- package/src/components/Card/card.scss +4 -4
- package/src/components/Checkbox/Checkbox.vue +4 -1
- package/src/components/Checkbox/checkbox.scss +17 -12
- 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 +4 -4
- package/src/components/Dropdown/DropdownTitle.vue +7 -1
- package/src/components/Dropdown/dropdown-item.scss +9 -2
- package/src/components/Dropdown/dropdown.scss +21 -7
- package/src/components/Grid/Grid.vue +21 -1
- 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 +110 -16
- package/src/components/Kbd/KbdGroup.vue +2 -6
- package/src/components/Kbd/kbd.scss +6 -5
- 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 +18 -8
- 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 +24 -11
- 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 +39 -6
- 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 +5 -4
- package/src/components/Tabs/tabs.scss +10 -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 +8 -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 +30 -55
- package/src/style/layout.scss +74 -9
- package/src/style/text.scss +18 -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/dist/style.css +0 -1
- package/src/components/Table/Row.vue +0 -9
|
@@ -50,7 +50,7 @@ const selecting = inject(TableSelectionProvideSymbol) as TableSelectionProvide
|
|
|
50
50
|
}"
|
|
51
51
|
>
|
|
52
52
|
<table>
|
|
53
|
-
<thead>
|
|
53
|
+
<thead v-if="$slots.header">
|
|
54
54
|
<tr>
|
|
55
55
|
<slot name="header" />
|
|
56
56
|
</tr>
|
|
@@ -59,7 +59,7 @@ const selecting = inject(TableSelectionProvideSymbol) as TableSelectionProvide
|
|
|
59
59
|
<slot name="body" />
|
|
60
60
|
</tbody>
|
|
61
61
|
</table>
|
|
62
|
-
<div class="vui-table-pagination-wrap">
|
|
62
|
+
<div v-if="$slots.pagination" class="vui-table-pagination-wrap">
|
|
63
63
|
<slot name="pagination" />
|
|
64
64
|
</div>
|
|
65
65
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
2
|
import type { BaseRow, TableSelectionProvide } from './table'
|
|
3
3
|
import { computed, inject } from 'vue'
|
|
4
|
+
import { isObjectInSet } from '../../shared/helpers'
|
|
4
5
|
import Button from '../Button/Button.vue'
|
|
5
6
|
import { TableSelectionProvideSymbol } from './table'
|
|
6
7
|
|
|
@@ -14,7 +15,7 @@ const {
|
|
|
14
15
|
selectRow,
|
|
15
16
|
selectedRows,
|
|
16
17
|
} = inject(TableSelectionProvideSymbol) as TableSelectionProvide
|
|
17
|
-
const isSelected = computed(() => selectedRows.value
|
|
18
|
+
const isSelected = computed(() => isObjectInSet(selectedRows.value, props.row))
|
|
18
19
|
</script>
|
|
19
20
|
|
|
20
21
|
<template>
|
|
@@ -47,16 +47,28 @@
|
|
|
47
47
|
tr {
|
|
48
48
|
border: none;
|
|
49
49
|
|
|
50
|
+
&:first-child td {
|
|
51
|
+
border-top: 0 !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
&:has(.vui-table-interactive-cell.selected) {
|
|
51
55
|
td {
|
|
52
56
|
background-color: var(--color-bg-raised);
|
|
53
57
|
}
|
|
54
58
|
}
|
|
59
|
+
|
|
60
|
+
&:last-child td {
|
|
61
|
+
border-bottom: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
th {
|
|
66
|
+
border-top: 0 !important;
|
|
55
67
|
}
|
|
56
68
|
|
|
57
69
|
th,
|
|
58
70
|
td {
|
|
59
|
-
font-size: var(--font-size-
|
|
71
|
+
font-size: var(--font-size-m);
|
|
60
72
|
border: none;
|
|
61
73
|
border-left: none !important;
|
|
62
74
|
transition: var(--transition-fast);
|
|
@@ -72,6 +84,7 @@
|
|
|
72
84
|
height: auto;
|
|
73
85
|
padding-inline: var(--space-xs);
|
|
74
86
|
padding-block: 0;
|
|
87
|
+
vertical-align: middle;
|
|
75
88
|
|
|
76
89
|
&.selected .vui-button.icon .vui-button-slot svg path {
|
|
77
90
|
color: var(--color-text) !important;
|
|
@@ -107,24 +120,25 @@
|
|
|
107
120
|
|
|
108
121
|
th {
|
|
109
122
|
.vui-table-th-content {
|
|
110
|
-
color: var(--color-text
|
|
123
|
+
color: var(--color-text);
|
|
111
124
|
font-size: var(--font-size-xs);
|
|
112
125
|
text-transform: uppercase;
|
|
113
|
-
font-weight:
|
|
126
|
+
font-weight: var(--font-weight-semibold);
|
|
114
127
|
display: flex;
|
|
115
128
|
justify-content: flex-start;
|
|
116
129
|
align-items: center;
|
|
117
130
|
gap: var(--space-xs);
|
|
118
131
|
|
|
119
132
|
.vui-table-sort-button:not(.active) svg path {
|
|
120
|
-
color: var(--color-text-
|
|
133
|
+
color: var(--color-text-light);
|
|
121
134
|
}
|
|
122
135
|
}
|
|
123
136
|
}
|
|
124
137
|
}
|
|
125
138
|
|
|
126
139
|
.vui-table-pagination-wrap {
|
|
127
|
-
padding: var(--space-
|
|
140
|
+
padding: var(--space-xs) var(--space-m);
|
|
141
|
+
border-top: 1px solid var(--color-border);
|
|
128
142
|
|
|
129
143
|
p {
|
|
130
144
|
font-size: var(--font-size-s);
|
|
@@ -132,3 +146,9 @@
|
|
|
132
146
|
}
|
|
133
147
|
}
|
|
134
148
|
}
|
|
149
|
+
|
|
150
|
+
:root.light {
|
|
151
|
+
.vui-table-container table tr:has(.vui-table-interactive-cell.selected) td {
|
|
152
|
+
background-color: var(--color-bg-medium);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -38,7 +38,7 @@ interface TableOptionsInput {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// eslint-disable-next-line ts/explicit-function-return-type
|
|
41
|
-
export function defineTable<const Dataset extends
|
|
41
|
+
export function defineTable<const Dataset extends any[]>(
|
|
42
42
|
computedDataset: MaybeRefOrGetter<Dataset>,
|
|
43
43
|
tableOptions?: TableOptionsInput,
|
|
44
44
|
) {
|
|
@@ -139,7 +139,7 @@ export function defineTable<const Dataset extends Array<BaseRow>>(
|
|
|
139
139
|
})
|
|
140
140
|
|
|
141
141
|
const headers = computed(() => Object
|
|
142
|
-
.keys($data.value[0])
|
|
142
|
+
.keys($data.value[0] || {})
|
|
143
143
|
.map((key) => {
|
|
144
144
|
return {
|
|
145
145
|
label: key,
|
|
@@ -212,7 +212,11 @@ export function defineTable<const Dataset extends Array<BaseRow>>(
|
|
|
212
212
|
selectedRows.value = new Set()
|
|
213
213
|
}
|
|
214
214
|
else {
|
|
215
|
-
|
|
215
|
+
const data = new Set<BaseRow>()
|
|
216
|
+
for (const item of $data.value) {
|
|
217
|
+
data.add(item)
|
|
218
|
+
}
|
|
219
|
+
selectedRows.value = new Set(data)
|
|
216
220
|
}
|
|
217
221
|
}
|
|
218
222
|
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { Icon } from '@iconify/vue'
|
|
3
|
-
import { computed } from 'vue'
|
|
4
3
|
|
|
5
4
|
export interface TabProps {
|
|
6
5
|
disabled?: boolean
|
|
7
|
-
|
|
8
|
-
label: string
|
|
6
|
+
label?: string
|
|
9
7
|
icon?: string
|
|
10
8
|
}
|
|
11
|
-
|
|
12
9
|
const props = defineProps<TabProps>()
|
|
13
|
-
const id = computed(() => props.id ?? props.label)
|
|
14
10
|
</script>
|
|
15
11
|
|
|
16
12
|
<template>
|
|
17
13
|
<button
|
|
18
14
|
class="vui-tab"
|
|
19
|
-
:data-tab-id="
|
|
15
|
+
:data-tab-id="label"
|
|
20
16
|
:class="{ disabled: props.disabled }"
|
|
21
17
|
role="tab"
|
|
22
|
-
:name="
|
|
18
|
+
:name="label"
|
|
23
19
|
>
|
|
24
|
-
<
|
|
25
|
-
|
|
20
|
+
<slot>
|
|
21
|
+
<Icon v-if="props.icon" :icon="props.icon" />
|
|
22
|
+
{{ props.label }}
|
|
23
|
+
</slot>
|
|
26
24
|
</button>
|
|
27
25
|
</template>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import type { VNode } from 'vue'
|
|
2
3
|
import type { TabProps } from './Tab.vue'
|
|
3
|
-
import { useResizeObserver } from '@vueuse/core'
|
|
4
|
-
import { onMounted, useTemplateRef,
|
|
4
|
+
import { useResizeObserver } from '@vueuse/core'
|
|
5
|
+
import { onMounted, useTemplateRef, watch } from 'vue'
|
|
5
6
|
import './tabs.scss'
|
|
6
7
|
|
|
7
8
|
interface Props {
|
|
@@ -74,8 +75,8 @@ onMounted(() => {
|
|
|
74
75
|
:is="vnode"
|
|
75
76
|
v-for="vnode of slots.default()"
|
|
76
77
|
:key="vnode.props.id"
|
|
77
|
-
:class="{ active: vnode.props.
|
|
78
|
-
@click="active = vnode.props.
|
|
78
|
+
:class="{ active: vnode.props.label === active }"
|
|
79
|
+
@click="active = vnode.props.label"
|
|
79
80
|
/>
|
|
80
81
|
<template v-if="slots.end">
|
|
81
82
|
<div v-if="!!!expand" class="flex-1" />
|
|
@@ -50,9 +50,10 @@
|
|
|
50
50
|
align-items: center;
|
|
51
51
|
justify-content: center;
|
|
52
52
|
padding: 0 10px;
|
|
53
|
-
font-size: var(--font-size-
|
|
53
|
+
font-size: var(--font-size-m);
|
|
54
54
|
position: relative;
|
|
55
|
-
color: var(--color-text-
|
|
55
|
+
color: var(--color-text-lighter);
|
|
56
|
+
font-weight: var(--font-weight-medium);
|
|
56
57
|
transition: var(--transition);
|
|
57
58
|
cursor: default;
|
|
58
59
|
gap: var(--space-xs);
|
|
@@ -73,8 +74,14 @@
|
|
|
73
74
|
.vui-tab-underline {
|
|
74
75
|
transition: var(--transition);
|
|
75
76
|
display: block;
|
|
76
|
-
border-bottom:
|
|
77
|
+
border-bottom: 2px solid var(--color-text);
|
|
77
78
|
position: absolute;
|
|
78
79
|
bottom: 0;
|
|
79
80
|
}
|
|
80
81
|
}
|
|
82
|
+
|
|
83
|
+
:root.light {
|
|
84
|
+
.vui-tabs.vui-tabs-variant-filled {
|
|
85
|
+
background-color: var(--color-bg-medium);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -14,6 +14,11 @@ import './toast.scss'
|
|
|
14
14
|
<p v-if="toast.description">
|
|
15
15
|
{{ toast.description }}
|
|
16
16
|
</p>
|
|
17
|
+
<Component
|
|
18
|
+
:is="toast.body"
|
|
19
|
+
v-if="toast.body"
|
|
20
|
+
v-bind="{ data: toast.bodyProps, toastId }"
|
|
21
|
+
/>
|
|
17
22
|
</div>
|
|
18
23
|
<Button v-if="toast.action" @click="toast.action.handler(toast.id)">
|
|
19
24
|
{{ toast.action.label }}
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
display: flex;
|
|
15
15
|
border: 1px solid var(--color-border);
|
|
16
16
|
border-radius: var(--border-radius-m);
|
|
17
|
-
padding: var(--space-m)
|
|
18
|
-
background-color: var(--color-bg);
|
|
17
|
+
padding: var(--space-m);
|
|
18
|
+
background-color: var(--color-bg-lowered);
|
|
19
19
|
width: 100%;
|
|
20
20
|
align-items: center;
|
|
21
21
|
gap: var(--space-m);
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
margin-bottom: var(--space-xs);
|
|
30
30
|
display: block;
|
|
31
31
|
font-size: var(--font-size-m);
|
|
32
|
+
|
|
33
|
+
&:only-child {
|
|
34
|
+
margin: 0;
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
p {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Component } from 'vue'
|
|
1
2
|
import { ref } from 'vue'
|
|
2
3
|
|
|
3
4
|
interface ToastAction {
|
|
@@ -10,6 +11,8 @@ interface ToastOptions {
|
|
|
10
11
|
timeout?: number
|
|
11
12
|
action?: ToastAction
|
|
12
13
|
description?: string
|
|
14
|
+
body?: Component
|
|
15
|
+
bodyProps?: object
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
interface Toast {
|
|
@@ -20,6 +23,8 @@ interface Toast {
|
|
|
20
23
|
createdAt: number
|
|
21
24
|
expiresAt: number
|
|
22
25
|
description?: string
|
|
26
|
+
body?: Component
|
|
27
|
+
bodyProps?: object
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
// Store in a ref so the toast component can import it
|
|
@@ -44,6 +49,8 @@ export function pushToast(title: string, options?: ToastOptions): Toast {
|
|
|
44
49
|
action: parsedOptions.action,
|
|
45
50
|
createdAt: Date.now(),
|
|
46
51
|
expiresAt: Date.now() + parsedOptions.timeout,
|
|
52
|
+
body: parsedOptions.body,
|
|
53
|
+
bodyProps: parsedOptions.bodyProps ?? {},
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
toasts.value.set(id, newToast)
|
|
@@ -16,7 +16,7 @@ interface Props {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const {
|
|
19
|
-
placement
|
|
19
|
+
placement,
|
|
20
20
|
delay = 0,
|
|
21
21
|
} = defineProps<Props>()
|
|
22
22
|
|
|
@@ -66,21 +66,21 @@ const id = useId()
|
|
|
66
66
|
>
|
|
67
67
|
<slot />
|
|
68
68
|
</div>
|
|
69
|
-
<Transition
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
</Transition>
|
|
69
|
+
<!-- <Transition name="tooltip"> -->
|
|
70
|
+
<Popout v-if="showTooltip" :id :anchor="popoutAnchorRef" class="vui-tooltip" :placement>
|
|
71
|
+
<slot name="tooltip" />
|
|
72
|
+
</Popout>
|
|
73
|
+
<!-- </Transition> -->
|
|
74
74
|
</template>
|
|
75
75
|
|
|
76
|
-
<style scoped>
|
|
76
|
+
<!-- <style scoped>
|
|
77
77
|
.tooltip-enter-active,
|
|
78
78
|
.tooltip-leave-active {
|
|
79
|
-
transition:
|
|
79
|
+
transition: var(--transition-fast);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
.tooltip-enter-from,
|
|
83
83
|
.tooltip-leave-to {
|
|
84
84
|
opacity: 0;
|
|
85
85
|
}
|
|
86
|
-
</style>
|
|
86
|
+
</style> -->
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import Accordion from '../components/Accordion/Accordion.vue'
|
|
3
|
+
import AccordionGroup from '../components/Accordion/AccordionGroup.vue'
|
|
4
|
+
import Grid from '../components/Grid/Grid.vue'
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div class="mb-xxl">
|
|
9
|
+
<h3 class="mb-l">
|
|
10
|
+
Accordion
|
|
11
|
+
</h3>
|
|
12
|
+
|
|
13
|
+
<Grid :columns="2" gap="xl">
|
|
14
|
+
<div>
|
|
15
|
+
<strong class="block mb-s">Base</strong>
|
|
16
|
+
<Accordion label="Open details" class="mb-xl">
|
|
17
|
+
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Excepturi nostrum aspernatur nam earum vitae deleniti, odio atque esse sequi, in harum! Sint dolorum quis excepturi odio eum aspernatur aliquid harum.</p>
|
|
18
|
+
</Accordion>
|
|
19
|
+
|
|
20
|
+
<div class="mb-xl" />
|
|
21
|
+
|
|
22
|
+
<strong class="block mb-s">Group</strong>
|
|
23
|
+
<AccordionGroup single>
|
|
24
|
+
<Accordion label="First">
|
|
25
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum aliquam ad dicta nesciunt exercitationem? Quas vitae suscipit aliquam numquam incidunt corporis ullam, nihil dolores perferendis ipsa velit tempora accusantium cupiditate.
|
|
26
|
+
</Accordion>
|
|
27
|
+
<Accordion label="Second">
|
|
28
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum aliquam ad dicta nesciunt exercitationem? Quas vitae suscipit aliquam numquam incidunt corporis ullam, nihil dolores perferendis ipsa velit tempora accusantium cupiditate.
|
|
29
|
+
</Accordion>
|
|
30
|
+
<Accordion label="Third">
|
|
31
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum aliquam ad dicta nesciunt exercitationem? Quas vitae suscipit aliquam numquam incidunt corporis ullam, nihil dolores perferendis ipsa velit tempora accusantium cupiditate.
|
|
32
|
+
</Accordion>
|
|
33
|
+
</AccordionGroup>
|
|
34
|
+
</div>
|
|
35
|
+
<div>
|
|
36
|
+
<strong class="block mb-s">Card</strong>
|
|
37
|
+
<Accordion label="Open details" card>
|
|
38
|
+
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Excepturi nostrum aspernatur nam earum vitae deleniti, odio atque esse sequi, in harum! Sint dolorum quis excepturi odio eum aspernatur aliquid harum.</p>
|
|
39
|
+
</Accordion>
|
|
40
|
+
|
|
41
|
+
<div class="mb-xl" />
|
|
42
|
+
|
|
43
|
+
<strong class="block mb-s">Card group</strong>
|
|
44
|
+
<AccordionGroup single>
|
|
45
|
+
<Accordion card label="First" class="mb-xs">
|
|
46
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum aliquam ad dicta nesciunt exercitationem? Quas vitae suscipit aliquam numquam incidunt corporis ullam, nihil dolores perferendis ipsa velit tempora accusantium cupiditate.
|
|
47
|
+
</Accordion>
|
|
48
|
+
<Accordion card label="Second" class="mb-xs">
|
|
49
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum aliquam ad dicta nesciunt exercitationem? Quas vitae suscipit aliquam numquam incidunt corporis ullam, nihil dolores perferendis ipsa velit tempora accusantium cupiditate.
|
|
50
|
+
</Accordion>
|
|
51
|
+
<Accordion card label="Third" class="mb-xs">
|
|
52
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum aliquam ad dicta nesciunt exercitationem? Quas vitae suscipit aliquam numquam incidunt corporis ullam, nihil dolores perferendis ipsa velit tempora accusantium cupiditate.
|
|
53
|
+
</Accordion>
|
|
54
|
+
</AccordionGroup>
|
|
55
|
+
</div>
|
|
56
|
+
</Grid>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import { Icon } from '@iconify/vue'
|
|
3
|
+
import Alert from '../components/Alert/Alert.vue'
|
|
4
|
+
import Button from '../components/Button/Button.vue'
|
|
5
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
6
|
+
|
|
7
|
+
const variants = ['neutral', 'danger', 'warning', 'success', 'info'] as const
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="mb-xxl">
|
|
12
|
+
<h3 class="mb-l">
|
|
13
|
+
Alerts
|
|
14
|
+
</h3>
|
|
15
|
+
<table>
|
|
16
|
+
<tbody>
|
|
17
|
+
<tr>
|
|
18
|
+
<th>Base</th>
|
|
19
|
+
<td>
|
|
20
|
+
<Flex column>
|
|
21
|
+
<Alert v-for="variant in variants" :key="variant" :variant>
|
|
22
|
+
We'd like to get in touch about your car's extended warranty.
|
|
23
|
+
</Alert>
|
|
24
|
+
</Flex>
|
|
25
|
+
</td>
|
|
26
|
+
</tr>
|
|
27
|
+
<tr>
|
|
28
|
+
<th>Filled</th>
|
|
29
|
+
<td>
|
|
30
|
+
<Flex column>
|
|
31
|
+
<Alert v-for="variant in variants" :key="variant" :variant filled>
|
|
32
|
+
We'd like to get in touch about your car's extended warranty.
|
|
33
|
+
</Alert>
|
|
34
|
+
</Flex>
|
|
35
|
+
</td>
|
|
36
|
+
</tr>
|
|
37
|
+
<tr>
|
|
38
|
+
<th>Title + description</th>
|
|
39
|
+
<td>
|
|
40
|
+
<Flex column>
|
|
41
|
+
<Alert
|
|
42
|
+
v-for="variant in variants"
|
|
43
|
+
:key="variant"
|
|
44
|
+
:variant
|
|
45
|
+
title="Warranty discounts 2025"
|
|
46
|
+
description="We'd like to get in touch about your car's extended warranty."
|
|
47
|
+
/>
|
|
48
|
+
</Flex>
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<th>Title + description + filled</th>
|
|
53
|
+
<td>
|
|
54
|
+
<Flex column>
|
|
55
|
+
<Alert v-for="variant in variants" :key="variant" :variant title="Warranty discounts 2025" filled description="We'd like to get in touch about your car's extended warranty." />
|
|
56
|
+
</Flex>
|
|
57
|
+
</td>
|
|
58
|
+
</tr>
|
|
59
|
+
<tr>
|
|
60
|
+
<th>Custom</th>
|
|
61
|
+
<td>
|
|
62
|
+
<Alert variant="warning">
|
|
63
|
+
<Flex align-center space-between>
|
|
64
|
+
<p>Unfortunately we can't help you.</p>
|
|
65
|
+
<Button>
|
|
66
|
+
<template #start>
|
|
67
|
+
<Icon icon="ph:x" />
|
|
68
|
+
</template>
|
|
69
|
+
Ignore
|
|
70
|
+
</Button>
|
|
71
|
+
</Flex>
|
|
72
|
+
</Alert>
|
|
73
|
+
</td>
|
|
74
|
+
</tr>
|
|
75
|
+
</tbody>
|
|
76
|
+
</table>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import Avatar from '../components/Avatar/Avatar.vue'
|
|
3
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
4
|
+
|
|
5
|
+
const variants = ['s', 'm', 'l', 96] as const
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div class="mb-xxl">
|
|
10
|
+
<h3 class="mb-l">
|
|
11
|
+
Avatars
|
|
12
|
+
</h3>
|
|
13
|
+
<table>
|
|
14
|
+
<tbody>
|
|
15
|
+
<tr>
|
|
16
|
+
<th>Base S, M, L <br> + custom size</th>
|
|
17
|
+
<td>
|
|
18
|
+
<Flex>
|
|
19
|
+
<Avatar v-for="size in variants" :key="size" :size />
|
|
20
|
+
</Flex>
|
|
21
|
+
</td>
|
|
22
|
+
</tr>
|
|
23
|
+
<tr>
|
|
24
|
+
<th>Photo</th>
|
|
25
|
+
<td>
|
|
26
|
+
<Flex>
|
|
27
|
+
<Avatar v-for="size in variants" :key="size" :size url="https://i.imgur.com/bHWgZfD.jpeg" />
|
|
28
|
+
</Flex>
|
|
29
|
+
</td>
|
|
30
|
+
</tr>
|
|
31
|
+
<tr>
|
|
32
|
+
<th>Abbreviation</th>
|
|
33
|
+
<td>
|
|
34
|
+
<Flex>
|
|
35
|
+
<Avatar v-for="size in variants" :key="size" :size>
|
|
36
|
+
AB
|
|
37
|
+
</Avatar>
|
|
38
|
+
</Flex>
|
|
39
|
+
</td>
|
|
40
|
+
</tr>
|
|
41
|
+
</tbody>
|
|
42
|
+
</table>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import Badge from '../components/Badge/Badge.vue'
|
|
3
|
+
import Flex from '../components/Flex/Flex.vue'
|
|
4
|
+
|
|
5
|
+
const variants = ['neutral', 'danger', 'warning', 'success', 'info', 'accent'] as const
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div class="mb-xxl">
|
|
10
|
+
<h3 class="mb-l">
|
|
11
|
+
Badges
|
|
12
|
+
</h3>
|
|
13
|
+
<table>
|
|
14
|
+
<tbody>
|
|
15
|
+
<tr>
|
|
16
|
+
<th>Base</th>
|
|
17
|
+
<td>
|
|
18
|
+
<Flex>
|
|
19
|
+
<Badge v-for="variant in variants" :key="variant" :variant>
|
|
20
|
+
Badge
|
|
21
|
+
</Badge>
|
|
22
|
+
</Flex>
|
|
23
|
+
</td>
|
|
24
|
+
</tr>
|
|
25
|
+
<tr>
|
|
26
|
+
<th>Outline</th>
|
|
27
|
+
<td>
|
|
28
|
+
<Flex>
|
|
29
|
+
<Badge v-for="variant in variants" :key="variant" :variant outline>
|
|
30
|
+
Badge
|
|
31
|
+
</Badge>
|
|
32
|
+
</Flex>
|
|
33
|
+
</td>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<th>Filled</th>
|
|
37
|
+
<td>
|
|
38
|
+
<Flex>
|
|
39
|
+
<Badge v-for="variant in variants" :key="variant" :variant filled>
|
|
40
|
+
Badge
|
|
41
|
+
</Badge>
|
|
42
|
+
</Flex>
|
|
43
|
+
</td>
|
|
44
|
+
</tr>
|
|
45
|
+
</tbody>
|
|
46
|
+
</table>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import { Icon } from '@iconify/vue'
|
|
3
|
+
import BreadcrumbItem from '../components/Breadcrumbs/BreadcrumbItem.vue'
|
|
4
|
+
import Breadcrumbs from '../components/Breadcrumbs/Breadcrumbs.vue'
|
|
5
|
+
import Button from '../components/Button/Button.vue'
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div class="mb-xxl">
|
|
10
|
+
<h3 class="mb-l">
|
|
11
|
+
Breadcrumbs
|
|
12
|
+
</h3>
|
|
13
|
+
|
|
14
|
+
<table>
|
|
15
|
+
<tbody>
|
|
16
|
+
<tr>
|
|
17
|
+
<th>Base with links</th>
|
|
18
|
+
<td>
|
|
19
|
+
<Breadcrumbs>
|
|
20
|
+
<BreadcrumbItem label="Home" href="#" />
|
|
21
|
+
<BreadcrumbItem label="About" href="#" />
|
|
22
|
+
<BreadcrumbItem label="You" />
|
|
23
|
+
</Breadcrumbs>
|
|
24
|
+
</td>
|
|
25
|
+
</tr>
|
|
26
|
+
<tr>
|
|
27
|
+
<th>With components</th>
|
|
28
|
+
<td>
|
|
29
|
+
<Breadcrumbs>
|
|
30
|
+
<BreadcrumbItem label="Home" href="#" />
|
|
31
|
+
<BreadcrumbItem label="About" href="#" />
|
|
32
|
+
<BreadcrumbItem>
|
|
33
|
+
<Button size="s">
|
|
34
|
+
Switch
|
|
35
|
+
<template #end>
|
|
36
|
+
<Icon icon="ph:caret-down" />
|
|
37
|
+
</template>
|
|
38
|
+
</Button>
|
|
39
|
+
</BreadcrumbItem>
|
|
40
|
+
</Breadcrumbs>
|
|
41
|
+
</td>
|
|
42
|
+
</tr>
|
|
43
|
+
</tbody>
|
|
44
|
+
</table>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|